{"version":3,"file":"Search.cRJrNFPX.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/FZBjiDAyqo6FgJAknvGB/Ti5wlGwnK5gQep25FsOb/Search.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState,useRef}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerDisableUnlink\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function BroadcastSearch(props){const[searchQuery,setSearchQuery]=useState(\"\");const BROADCAST_ID=\"3.14px solid transparent\";const uniqueId=useRef(`broadcast-search-${Math.random().toString(36).substring(2,11)}`);useEffect(()=>{// Initial filter\nfilterItems(searchQuery);// Set up an interval to refresh the data\nconst intervalId=setInterval(()=>filterItems(searchQuery),1e3);// Clean up on unmount\nreturn()=>clearInterval(intervalId);},[searchQuery]);const filterItems=query=>{// Find broadcaster elements\nconst broadcasterElements=document.querySelectorAll(`[style*=\"border: ${BROADCAST_ID}\"]`);if(broadcasterElements.length>0){const broadcaster=broadcasterElements[0];const children=Array.from(broadcaster.children);// Tag each element with this filter's search state\nchildren.forEach(child=>{const textContent=child.textContent||child.innerText||\"\";const matchesSearch=!query.trim()||textContent.toLowerCase().includes(query.toLowerCase());// Store matching state as a data attribute\nchild.setAttribute(`data-search-${uniqueId.current}`,matchesSearch?\"match\":\"no-match\");});// Now check all filters to determine visibility\nchildren.forEach(child=>{// Get all filter data attributes on this child\nconst attrs=child.getAttributeNames().filter(name=>name.startsWith(\"data-filter-\")||name.startsWith(\"data-search-\"));// Item is visible only if it matches ALL active filters\nconst shouldShow=attrs.every(attr=>{return child.getAttribute(attr)===\"match\";});child.style.display=shouldShow?\"\":\"none\";});}};const handleSearchChange=e=>{setSearchQuery(e.target.value);};// Create a style element for the placeholder color\nuseEffect(()=>{const styleEl=document.createElement(\"style\");styleEl.innerHTML=`\n            #${uniqueId.current}::placeholder {\n                color: ${props.placeholderColor};\n            }\n        `;document.head.appendChild(styleEl);return()=>{document.head.removeChild(styleEl);};},[props.placeholderColor]);return /*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\"},children:[/*#__PURE__*/_jsx(\"input\",{id:uniqueId.current,type:\"text\",value:searchQuery,onChange:handleSearchChange,placeholder:props.placeholder,style:{width:\"100%\",height:\"100%\",padding:props.inputPadding,paddingLeft:props.showSearchIcon?\"36px\":props.inputPadding,border:`${props.border.borderWidth}px ${props.border.borderStyle} ${props.border.borderColor}`,borderRadius:props.borderRadius,...props.font,color:props.fontColor,backgroundColor:props.inputBackground,outline:\"none\",boxSizing:\"border-box\"}}),props.showSearchIcon&&/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",left:\"10px\",top:\"50%\",transform:\"translateY(-50%)\",pointerEvents:\"none\"},children:/*#__PURE__*/_jsx(\"svg\",{width:\"16\",height:\"16\",viewBox:\"0 0 24 24\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M21 21L15 15M17 10C17 13.866 13.866 17 10 17C6.13401 17 3 13.866 3 10C3 6.13401 6.13401 3 10 3C13.866 3 17 6.13401 17 10Z\",stroke:props.iconColor,strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\"})})})]});}// Default props\nBroadcastSearch.defaultProps={placeholder:\"Search...\",placeholderColor:\"#888888\",showSearchIcon:true,iconColor:\"#888888\",fontColor:\"#000000\",inputBackground:\"white\",inputPadding:\"10px\",borderRadius:\"8px\",border:{borderWidth:1,borderStyle:\"solid\",borderColor:\"#dddddd\"},font:{family:\"Inter\",fontSize:14,fontWeight:400,lineHeight:1.5,letterSpacing:0,textAlign:\"left\"}};// Property controls\naddPropertyControls(BroadcastSearch,{placeholder:{type:ControlType.String,title:\"Placeholder\",defaultValue:\"Search...\"},placeholderColor:{type:ControlType.Color,title:\"Placeholder Color\",defaultValue:\"#888888\"},showSearchIcon:{type:ControlType.Boolean,title:\"Show Icon\",defaultValue:true},iconColor:{type:ControlType.Color,title:\"Icon Color\",defaultValue:\"#888888\",hidden(props){return!props.showSearchIcon;}},fontColor:{type:ControlType.Color,title:\"Font Color\",defaultValue:\"#000000\"},inputBackground:{type:ControlType.Color,title:\"Input Background\",defaultValue:\"white\"},inputPadding:{type:ControlType.Padding,title:\"Input Padding\",defaultValue:\"10px\"},border:{type:ControlType.Border,title:\"Border\",defaultValue:{borderWidth:1,borderStyle:\"solid\",borderColor:\"#dddddd\"}},borderRadius:{type:ControlType.BorderRadius,title:\"Border Radius\",defaultValue:\"8px\"},font:{type:ControlType.Font,controls:\"extended\",title:\"Font\",defaultValue:{family:\"Inter\",fontSize:14,fontWeight:400,lineHeight:1.5,letterSpacing:0,textAlign:\"left\"},description:\"v1.0 \\n[via SegmentUI](https://www.segmentUI.com)\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"BroadcastSearch\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\",\"framerSupportedLayoutHeight\":\"any\",\"framerDisableUnlink\":\"*\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Search.map"],"mappings":"yRAKG,SAAwB,EAAgB,EAAM,CAAC,GAAK,CAAC,EAAY,GAAgBA,EAAS,GAAG,CAAqD,EAASC,EAAO,oBAAoB,KAAK,QAAQ,CAAC,SAAS,GAAG,CAAC,UAAU,EAAE,GAAG,GAAG,CAAC,MAAc,CACrP,EAAY,EAAY,CACxB,IAAM,EAAW,gBAAgB,EAAY,EAAY,CAAC,IAAI,CAC9D,UAAU,cAAc,EAAW,EAAG,CAAC,EAAY,CAAC,CAAC,IAAM,EAAY,GAAO,CAC9E,IAAM,EAAoB,SAAS,iBAAiB,8CAAqC,CAAC,GAAG,EAAoB,OAAO,EAAE,CAAC,IAAM,EAAY,EAAoB,GAAS,EAAS,MAAM,KAAK,EAAY,SAAS,CACnN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