{"version":3,"file":"UncodeSVG.DixwPyRy.mjs","names":["React.useState"],"sources":["https:/framerusercontent.com/modules/PQfBcXxT1QLKIRt14k6P/Aj24PjZdTsF3sS1fh127/UncodeSVG.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{Frame,addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export function SVGComponent(props){const{svgCode,fillColor,strokeColor,strokeWidth,rotation,svgFile,padding,disableCustomization,optimizationSettings,preserveAspectRatio,avoidPageSpeedImpact}=props;const defaultSVG=`\n        <svg id=\"Add documents\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n            <path d=\"M11.9999 20.9981H17.2367C19.0659 20.9981 20.5496 19.5144 20.5496 17.6843V12.5277C20.5496 10.6976 19.0659 9.21484 17.2367 9.21484H6.76305C4.93295 9.21484 3.44922 10.6976 3.44922 12.5277V17.6843C3.44922 19.5144 4.93295 20.9981 6.76305 20.9981H7.55448\" stroke=\"#FFFFFF\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n            <path d=\"M10.1523 15.3246H13.8495M12.0004 13.4766V17.1737\" stroke=\"#FFFFFF\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n            <path d=\"M6.18164 6.11169H17.818M8.7185 3H15.28\" stroke=\"#FFFFFF\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n        </svg>\n    `;const[svgContent,setSvgContent]=React.useState(svgCode||defaultSVG);const optimizeSVG=svg=>{let optimizedSvg=svg;if(optimizationSettings.removeMetadata){optimizedSvg=optimizedSvg.replace(/<metadata>.*?<\\/metadata>/g,\"\");}if(optimizationSettings.removeComments){optimizedSvg=optimizedSvg.replace(/<!--.*?-->/g,\"\");}if(optimizationSettings.minifyNumericValues){optimizedSvg=optimizedSvg.replace(/(\\d+\\.\\d{2})\\d+/g,\"$1\");}if(optimizationSettings.removeWhitespace){optimizedSvg=optimizedSvg.replace(/\\s{2,}/g,\" \").replace(/\\n/g,\"\");}return optimizedSvg;};React.useEffect(()=>{let parser=new DOMParser;let svgDoc=parser.parseFromString(svgCode||defaultSVG,\"image/svg+xml\");let svgElement=svgDoc.querySelector(\"svg\");if(svgElement){svgElement.setAttribute(\"width\",\"100%\");svgElement.setAttribute(\"height\",\"100%\");svgElement.setAttribute(\"preserveAspectRatio\",preserveAspectRatio);if(!disableCustomization){let paths=svgElement.querySelectorAll(\"path\");paths.forEach(path=>{if(fillColor)path.setAttribute(\"fill\",fillColor);if(strokeColor)path.setAttribute(\"stroke\",strokeColor);if(strokeWidth)path.setAttribute(\"stroke-width\",strokeWidth);});}let svgString=new XMLSerializer().serializeToString(svgElement);setSvgContent(optimizeSVG(svgString));}},[svgCode,fillColor,strokeColor,strokeWidth,preserveAspectRatio,disableCustomization,optimizationSettings]);React.useEffect(()=>{if(svgFile){fetch(svgFile).then(response=>response.text()).then(text=>{let parser=new DOMParser;let svgDoc=parser.parseFromString(text,\"image/svg+xml\");let svgElement=svgDoc.querySelector(\"svg\");if(svgElement){svgElement.setAttribute(\"width\",\"100%\");svgElement.setAttribute(\"height\",\"100%\");svgElement.setAttribute(\"preserveAspectRatio\",preserveAspectRatio);if(!disableCustomization){let paths=svgElement.querySelectorAll(\"path\");paths.forEach(path=>{if(fillColor)path.setAttribute(\"fill\",fillColor);if(strokeColor)path.setAttribute(\"stroke\",strokeColor);if(strokeWidth)path.setAttribute(\"stroke-width\",strokeWidth);});}let svgString=new XMLSerializer().serializeToString(svgElement);setSvgContent(optimizeSVG(svgString));}}).catch(error=>console.error(\"Error loading SVG file:\",error));}},[svgFile,fillColor,strokeColor,strokeWidth,preserveAspectRatio,disableCustomization,optimizationSettings]);return /*#__PURE__*/_jsx(Frame,{size:\"100%\",background:\"transparent\",style:{display:\"flex\",justifyContent:\"center\",alignItems:\"center\",transform:`rotate(${rotation}deg)`,overflow:\"visible\",minWidth:\"16px\",minHeight:\"16px\"},children:/*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",minWidth:\"16px\",minHeight:\"16px\",padding:`${padding}px`},dangerouslySetInnerHTML:{__html:svgContent}})});}// Definindo as propriedades que serão manipuladas no Framer\naddPropertyControls(SVGComponent,{svgCode:{type:ControlType.String,title:\"SVG Code\",placeholder:\"<svg></svg>\"},fillColor:{type:ControlType.Color,title:\"Fill Color\",defaultValue:\"rgba(0, 0, 0, 0)\",hidden:props=>props.disableCustomization},strokeColor:{type:ControlType.Color,title:\"Stroke Color\",defaultValue:\"#000000\",hidden:props=>props.disableCustomization},strokeWidth:{type:ControlType.Number,title:\"Stroke Width\",defaultValue:1,hidden:props=>props.disableCustomization},rotation:{type:ControlType.Number,title:\"Rotation\",defaultValue:0,min:0,max:360},padding:{type:ControlType.Number,title:\"Padding\",defaultValue:0,min:0},disableCustomization:{type:ControlType.Boolean,title:\"Disable Customization\",defaultValue:false,description:\"Disable customization options when uploading non-icon SVGs.\"},optimizationSettings:{type:ControlType.Object,title:\"Optimization Settings\",controls:{removeMetadata:{type:ControlType.Boolean,title:\"Remove Metadata\",defaultValue:true},removeComments:{type:ControlType.Boolean,title:\"Remove Comments\",defaultValue:true},minifyNumericValues:{type:ControlType.Boolean,title:\"Minify Numeric Values\",defaultValue:true},removeWhitespace:{type:ControlType.Boolean,title:\"Remove Whitespace\",defaultValue:true},simplifyPaths:{type:ControlType.Boolean,title:\"Simplify Paths\",defaultValue:false}}},avoidPageSpeedImpact:{type:ControlType.Boolean,title:\"Avoid PageSpeed Impact\",defaultValue:false,description:\"Render SVG inline to avoid PageSpeed Insights impact.\"},codeBy:{type:ControlType.String,title:\" \",defaultValue:\"Code by @omatusaelhorch\",readOnly:true,displaySegmentedControl:false,description:\"This component was created by @omatusaelhorch.\"}});export default SVGComponent// Code by @omatusaelhorch\n;\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SVGComponent\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\",\"framerSupportedLayoutHeight\":\"any\",\"framerContractVersion\":\"1\"}},\"SVGComponent\":{\"type\":\"reactComponent\",\"name\":\"SVGComponent\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any\",\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./UncodeSVG.map"],"mappings":"yLAGG,SAAgB,EAAa,EAAM,CAAC,GAAK,CAAC,UAAQ,YAAU,cAAY,cAAY,WAAS,UAAQ,UAAQ,uBAAqB,uBAAqB,sBAAoB,wBAAsB,EAAY,EAAW;;;;;;MAMhN,CAAC,EAAW,GAAeA,EAAe,GAAS,EAAW,CAAO,EAAY,GAAK,CAAC,IAAI,EAAa,EAAoa,OAA7Z,EAAqB,iBAAgB,EAAa,EAAa,QAAQ,6BAA6B,GAAG,EAAK,EAAqB,iBAAgB,EAAa,EAAa,QAAQ,cAAc,GAAG,EAAK,EAAqB,sBAAqB,EAAa,EAAa,QAAQ,mBAAmB,KAAK,EAAK,EAAqB,mBAAkB,EAAa,EAAa,QAAQ,UAAU,IAAI,CAAC,QAAQ,MAAM,GAAG,EAAS,GAAksD,OAAnrD,MAAoB,CAAiG,IAAI,EAAzF,IAAI,WAAS,CAAmB,gBAAgB,GAAS,EAAW,gBAAgB,CAAuB,cAAc,MAAM,CAAI,IAAY,EAAW,aAAa,QAAQ,OAAO,CAAC,EAAW,aAAa,SAAS,OAAO,CAAC,EAAW,aAAa,sBAAsB,EAAoB,CAAK,GAAgC,EAAW,iBAAiB,OAAO,CAAO,QAAQ,GAAM,CAAI,GAAU,EAAK,aAAa,OAAO,EAAU,CAAI,GAAY,EAAK,aAAa,SAAS,EAAY,CAAI,GAAY,EAAK,aAAa,eAAe,EAAY,EAAG,CAAkE,EAAc,EAAhE,IAAI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