{"version":3,"file":"ResetFiltersButton.DZZZuVSL.mjs","names":["useSuperfieldsStore","superfieldsId"],"sources":["https:/framerusercontent.com/modules/JNlU8ejmmkr575rYvdTZ/o9V4EkVrZr50KXIigAx3/kg_85gb_o.js","https:/framerusercontent.com/modules/kf2LBfm1QDK0TMFrHROs/nL8rJEgBzssQxh9GSsdT/ResetFiltersButton.js"],"sourcesContent":["// Generated by Framer (85eaff3)\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,cx,motion,useSVGTemplate,withCSS}from\"framer\";import*as React from\"react\";import{forwardRef}from\"react\";const mask=\"var(--framer-icon-mask)\";const Base=/*#__PURE__*/forwardRef(function(props,ref){return /*#__PURE__*/_jsx(\"svg\",{...props,ref:ref,children:props.children});});const MotionSVG=motion.create(Base);const SVG=/*#__PURE__*/forwardRef((props,ref)=>{const{animated,layoutId,children,...rest}=props;return animated?/*#__PURE__*/_jsx(MotionSVG,{...rest,layoutId:layoutId,ref:ref,children:children}):/*#__PURE__*/_jsx(\"svg\",{...rest,ref:ref,children:children});});const svg='<svg display=\"block\" role=\"presentation\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 19.293 13.293 C 19.745 13.743 19.999 14.355 19.999 14.993 C 19.999 15.631 19.745 16.243 19.293 16.693 L 16.693 19.293 C 16.243 19.745 15.631 19.999 14.993 19.999 C 14.355 19.999 13.743 19.745 13.293 19.293 L 0.693 6.693 C -0.243 5.753 -0.243 4.233 0.693 3.293 L 3.293 0.693 C 4.233 -0.243 5.753 -0.243 6.693 0.693 Z\" fill=\"transparent\" height=\"19.998984206725016px\" id=\"UJ5syV1Nr\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"var(--js9iwy, 2)\" stroke=\"var(--1m973uw, rgb(0,0,0))\" transform=\"translate(2.007 2.007)\" width=\"19.998984206725016px\"/><path d=\"M 0 2 L 2 0\" fill=\"transparent\" height=\"2px\" id=\"IN9uZlznR\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"var(--js9iwy, 2)\" stroke=\"var(--1m973uw, rgb(0,0,0))\" transform=\"translate(14.5 10.5)\" width=\"2px\"/><path d=\"M 0 2 L 2 0\" fill=\"transparent\" height=\"2px\" id=\"lknvCj6bU\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"var(--js9iwy, 2)\" stroke=\"var(--1m973uw, rgb(0,0,0))\" transform=\"translate(11.5 7.5)\" width=\"2px\"/><path d=\"M 0 2 L 2 0\" fill=\"transparent\" height=\"2px\" id=\"dfWYUytEj\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"var(--js9iwy, 2)\" stroke=\"var(--1m973uw, rgb(0,0,0))\" transform=\"translate(8.5 4.5)\" width=\"2px\"/><path d=\"M 0 2 L 2 0\" fill=\"transparent\" height=\"2px\" id=\"uVk4GEMYa\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"var(--js9iwy, 2)\" stroke=\"var(--1m973uw, rgb(0,0,0))\" transform=\"translate(17.5 13.5)\" width=\"2px\"/></svg>';const getProps=({color,height,id,width,width1,...props})=>{return{...props,JEeZYcamG:width1??props.JEeZYcamG??2,P_DcoRcrY:color??props.P_DcoRcrY??\"rgb(0, 0, 0)\"};};const Component=/*#__PURE__*/React.forwardRef(function(props,ref){const{style,className,layoutId,variant,P_DcoRcrY,JEeZYcamG,...restProps}=getProps(props);const href=useSVGTemplate(\"3916576838\",svg);return /*#__PURE__*/_jsx(SVG,{...restProps,className:cx(\"framer-C79W3\",className),layoutId:layoutId,ref:ref,role:\"presentation\",style:{\"--1m973uw\":P_DcoRcrY,\"--js9iwy\":JEeZYcamG,...style},viewBox:\"0 0 24 24\",children:/*#__PURE__*/_jsx(\"use\",{href:href})});});const css=[`.framer-C79W3 { -webkit-mask: ${mask}; aspect-ratio: 1; display: block; mask: ${mask}; width: 24px; }`];/**\n * This is a generated Framer component.\n * @framerIntrinsicWidth 24\n * @framerIntrinsicHeight 24\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerVariables {\"P_DcoRcrY\":\"color\",\"JEeZYcamG\":\"width1\"}\n * @framerImmutableVariables true\n * @framerVector {\"name\":\"Ruler\",\"color\":{\"type\":\"variable\",\"value\":\"1m973uw\"},\"set\":{\"localId\":\"vectorSet/ZsiCCGPvG\",\"id\":\"ZsiCCGPvG\",\"moduleId\":\"Y7SpbVH16cWqMhj75z1M\"}}\n */const Icon=withCSS(Component,css,\"framer-C79W3\");Icon.displayName=\"Ruler\";export default Icon;addPropertyControls(Icon,{P_DcoRcrY:{defaultValue:\"rgb(0, 0, 0)\",hidden:false,title:\"Color\",type:ControlType.Color},JEeZYcamG:{defaultValue:2,displayStepper:true,hidden:false,max:16,min:1,title:\"Width\",type:ControlType.Number}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Icon\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerVector\":\"{\\\"name\\\":\\\"Ruler\\\",\\\"color\\\":{\\\"type\\\":\\\"variable\\\",\\\"value\\\":\\\"1m973uw\\\"},\\\"set\\\":{\\\"localId\\\":\\\"vectorSet/ZsiCCGPvG\\\",\\\"id\\\":\\\"ZsiCCGPvG\\\",\\\"moduleId\\\":\\\"Y7SpbVH16cWqMhj75z1M\\\"}}\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"24\",\"framerImmutableVariables\":\"true\",\"framerIntrinsicHeight\":\"24\",\"framerVariables\":\"{\\\"P_DcoRcrY\\\":\\\"color\\\",\\\"JEeZYcamG\\\":\\\"width1\\\"}\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{buttonPropertyControls,Button,superfieldsId,useInstanceId}from\"https://framerusercontent.com/modules/FZjYlw33eNo8pxLbSFLX/9cz7ek89fMdNfYUyPOlg/SuperfieldsShared.js\";import useSuperfieldsStore from\"https://framerusercontent.com/modules/OoGHZMzWDzm2mNN7bmeR/SrfgZxoYwWZOduOAI06A/Store.js\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n * @framerDisableUnlink\n */export default function ResetFiltersButton(props){const{superfieldsId,border}=props;const isCanvas=RenderTarget.current()===RenderTarget.canvas;const id=useInstanceId();const[filters,search,setFilterValue,setSearch]=useSuperfieldsStore(superfieldsId,state=>[state.filters,state.search,state.setFilterValue,state.setSearch]);function onButtonClick(){if(props.resetFilters&&filters){for(const fieldName of Object.keys(filters)){setFilterValue(fieldName,filters[fieldName]?.defaultValue);}}if(props.resetSearch&&search){setSearch(\"\");}props.click?.();}let areFiltersActive=false;if(props.resetFilters&&filters){for(const fieldName of Object.keys(filters)){const filter=filters[fieldName];if(!filter){continue;}if(filter.value!==filter.defaultValue){areFiltersActive=true;break;}}}if(props.resetSearch&&search){areFiltersActive=true;}if(props.autoHide&&!areFiltersActive&&!isCanvas){return /*#__PURE__*/_jsx(\"style\",{id:id,dangerouslySetInnerHTML:{__html:`div:has(> #${id}) { display: none; }`}});}return /*#__PURE__*/_jsx(Button,{props:props,onClick:onButtonClick,onMouseEnter:props.hover});}ResetFiltersButton.displayName=\"Reset Filters Button\";//@ts-ignore\naddPropertyControls(ResetFiltersButton,{...superfieldsId(),resetFilters:{type:ControlType.Boolean,defaultValue:true},resetSearch:{type:ControlType.Boolean,defaultValue:true,description:\" \"},...buttonPropertyControls({text:\"Reset Filters\"}),autoHide:{type:ControlType.Boolean,defaultValue:false,description:\"Hide button when no filters/search are active\",title:\"Auto-Hide\"},click:{type:ControlType.EventHandler},hover:{type:ControlType.EventHandler}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ResetFiltersButton\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any\",\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"iWAC2C,IAAqF,IAA4B,CAAoC,EAAK,0BAAgC,EAAkB,EAAW,SAAS,EAAM,EAAI,CAAC,OAAoB,EAAK,MAAM,CAAC,GAAG,EAAU,MAAI,SAAS,EAAM,SAAS,CAAC,EAAG,CAAO,EAAU,EAAO,OAAO,EAAK,CAAO,EAAiB,GAAY,EAAM,IAAM,CAAC,GAAK,CAAC,WAAS,WAAS,WAAS,GAAG,GAAM,EAAM,OAAO,EAAsB,EAAK,EAAU,CAAC,GAAG,EAAc,WAAa,MAAa,WAAS,CAAC,CAAc,EAAK,MAAM,CAAC,GAAG,EAAS,MAAa,WAAS,CAAC,EAAG,CAAO,EAAI,8pDAAoqD,GAAU,CAAC,QAAM,SAAO,KAAG,QAAM,SAAO,GAAG,MAAgB,CAAC,GAAG,EAAM,UAAU,GAAQ,EAAM,WAAW,EAAE,UAAU,GAAO,EAAM,WAAW,eAAe,EAS38E,EAAK,EATs+E,EAAiB,SAAS,EAAM,EAAI,CAAC,GAAK,CAAC,QAAM,YAAU,WAAS,UAAQ,YAAU,YAAU,GAAG,GAAW,EAAS,EAAM,CAAO,EAAK,EAAe,aAAa,EAAI,CAAC,OAAoB,EAAK,EAAI,CAAC,GAAG,EAAU,UAAU,EAAG,eAAe,EAAU,CAAU,WAAa,MAAI,KAAK,eAAe,MAAM,CAAC,YAAY,EAAU,WAAW,EAAU,GAAG,EAAM,CAAC,QAAQ,YAAY,SAAsB,EAAK,MAAM,CAAM,OAAK,CAAC,CAAC,CAAC,EAAG,CAAW,CAAC,iCAAiC,EAAK,2CAA2C,EAAK,kBAAkB,CASh/F,eAAe,CAAC,EAAK,YAAY,UAAuB,EAAK,EA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