{"version":3,"file":"Linkembedd.DRaaUezE.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/mwfSEp0SNmSpUti1SKsX/wLrpsZbs2wqeWdBoKRZ8/Linkembedd.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{motion}from\"framer-motion\";/**\n * @framerDisableUnlink\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerIntrinsicWidth 600\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerIntrinsicHeight 400\n */export default function Embed(props){const[loading,setLoading]=useState(true);const[prevScale,setPrevScale]=useState(props.scaleFactor);const containerStyle={width:\"100%\",height:\"100%\",overflow:\"hidden\",position:\"relative\"};const iframeStyle={width:`${100*props.scaleFactor}%`,height:`${100*props.scaleFactor}%`,border:props.showBorder?`${props.borderWidth}px solid ${props.borderColor}`:\"none\",borderRadius:props.borderRadius,transform:`scale(${1/props.scaleFactor})`,transformOrigin:\"0 0\",position:\"absolute\",left:0,top:0,opacity:loading?0:1,transition:\"opacity 0.3s ease\"};const progressStyle={position:\"absolute\",top:0,left:0,height:\"2px\",width:\"100%\",background:\"#f0f0f0\",zIndex:1e3};const progressBarStyle={height:\"100%\",background:props.loaderColor};useEffect(()=>{if(prevScale!==props.scaleFactor){setLoading(true);setPrevScale(props.scaleFactor);const timer=setTimeout(()=>{setLoading(false);},500);return()=>clearTimeout(timer);}},[props.scaleFactor]);const renderLoader=()=>{if(!loading||props.loader===\"none\")return null;if(props.loader===\"progress\"){return /*#__PURE__*/_jsx(\"div\",{style:progressStyle,children:/*#__PURE__*/_jsx(motion.div,{style:progressBarStyle,initial:{width:\"0%\"},animate:{width:\"100%\"},transition:{duration:1}})});}if(props.loader===\"skeleton\"){return /*#__PURE__*/_jsx(motion.div,{style:{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",borderRadius:props.borderRadius,background:`linear-gradient(90deg, ${props.skeletonColor} 0%, ${props.skeletonHighlight} 50%, ${props.skeletonColor} 100%)`,backgroundSize:\"200% 100%\"},animate:{backgroundPosition:[\"200% 0\",\"-200% 0\"]},transition:{duration:1,repeat:Infinity,ease:\"linear\"}});}};useEffect(()=>{const timer=setTimeout(()=>{setLoading(false);},1e3);return()=>clearTimeout(timer);},[props.url]);return /*#__PURE__*/_jsxs(\"div\",{style:containerStyle,children:[renderLoader(),/*#__PURE__*/_jsx(\"iframe\",{src:props.url,style:iframeStyle,allow:\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\",allowFullScreen:true,onLoad:()=>setLoading(false)})]});}Embed.defaultProps={url:\"https://example.com\",showBorder:false,borderWidth:1,borderColor:\"#000000\",borderRadius:0,scaleFactor:1,loader:\"none\",loaderColor:\"#0099ff\",skeletonColor:\"#f0f0f0\",skeletonHighlight:\"#f8f8f8\"};addPropertyControls(Embed,{url:{type:ControlType.Link,title:\"URL\"},scaleFactor:{type:ControlType.Number,title:\"Scale Factor\",defaultValue:1,min:1,max:5,step:.1},loader:{type:ControlType.Enum,title:\"Loader\",options:[\"none\",\"progress\",\"skeleton\"],defaultValue:\"none\"},loaderColor:{type:ControlType.Color,title:\"Loader Color\",hidden(props){return props.loader===\"none\"||props.loader===\"skeleton\";}},skeletonColor:{type:ControlType.Color,title:\"Skeleton Color\",hidden(props){return props.loader!==\"skeleton\";}},skeletonHighlight:{type:ControlType.Color,title:\"Skeleton Highlight\",hidden(props){return props.loader!==\"skeleton\";}},showBorder:{type:ControlType.Boolean,title:\"Show Border\",defaultValue:false},borderWidth:{type:ControlType.Number,title:\"Border Width\",defaultValue:1,min:0,max:20,step:1,hidden(props){return!props.showBorder;}},borderColor:{type:ControlType.Color,title:\"Border Color\",hidden(props){return!props.showBorder;}},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:0,min:0,max:100,step:1,description:\"v1.0 \\n[via SegmentUI](https://www.segmentUI.com)\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Embed\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"600\",\"framerIntrinsicHeight\":\"400\",\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"*\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Linkembedd.map"],"mappings":"0OAOG,SAAwB,EAAM,EAAM,CAAC,GAAK,CAAC,EAAQ,GAAYA,EAAS,GAAK,CAAM,CAAC,EAAU,GAAcA,EAAS,EAAM,YAAY,CAAO,EAAe,CAAC,MAAM,OAAO,OAAO,OAAO,SAAS,SAAS,SAAS,WAAW,CAAO,EAAY,CAAC,MAAM,GAAG,IAAI,EAAM,YAAY,GAAG,OAAO,GAAG,IAAI,EAAM,YAAY,GAAG,OAAO,EAAM,WAAW,GAAG,EAAM,YAAY,WAAW,EAAM,cAAc,OAAO,aAAa,EAAM,aAAa,UAAU,SAAS,EAAE,EAAM,YAAY,GAAG,gBAAgB,MAAM,SAAS,WAAW,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAQ,EAAE,EAAE,WAAW,oBAAoB,CAAO,EAAc,CAAC,SAAS,WAAW,IAAI,EAAE,KAAK,EAAE,OAAO,MAAM,MAAM,OAAO,WAAW,UAAU,OAAO,IAAI,CAAO,EAAiB,CAAC,OAAO,OAAO,WAAW,EAAM,YAAY,CAA0gC,OAAzgC,MAAc,CAAC,GAAG,IAAY,EAAM,YAAY,CAAC,EAAW,GAAK,CAAC,EAAa,EAAM,YAAY,CAAC,IAAM,EAAM,eAAe,CAAC,EAAW,GAAM,EAAG,IAAI,CAAC,UAAU,aAAa,EAAM,GAAI,CAAC,EAAM,YAAY,CAAC,CAA4sB,MAAc,CAAC,IAAM,EAAM,eAAe,CAAC,EAAW,GAAM,EAAG,IAAI,CAAC,UAAU,aAAa,EAAM,EAAG,C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