{"version":3,"file":"Twitter.aOTUtiaL.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/PN5c9Lm200xYeKxP2Gcy/II6tyEWaTvUw9Dzdhpmd/Utils.js","https:/framer.com/m/Utils-QTIc.js@II6tyEWaTvUw9Dzdhpmd","https:/framerusercontent.com/modules/yP6Ky9DUjdi5Mttr9BJ9/PeUoR9WElmAWTAhUiNfR/Twitter.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{ControlType}from\"framer\";export const updateChildren=(children,properties)=>{return[{...children,props:{...children.props,children:{...children.props.children,props:{...children.props.children.props,children:{...children.props.children.props.children,props:{...children.props.children.props.children.props,...properties}}}}}}];};export const SettingsMessage=({title,description,containerStyle})=>{return /*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",flexDirection:\"column\",alignItems:\"center\",textAlign:\"center\",justifyContent:\"center\",backgroundColor:\"rgba(136, 85, 255, 0.1)\",overflow:\"hidden\",...containerStyle},children:[/*#__PURE__*/_jsx(\"span\",{role:\"img\",\"aria-label\":\"icon\",style:{fontSize:\"32px\"},children:\"✨\"}),/*#__PURE__*/_jsxs(\"div\",{style:{maxWidth:\"240px\"},children:[/*#__PURE__*/_jsx(\"h1\",{style:{fontSize:11,color:\"#96F\",fontWeight:600},children:title}),/*#__PURE__*/_jsx(\"p\",{style:{fontSize:11,color:\"rgba(153, 102, 255, 0.7)\",lineHeight:1.5},children:description})]})]});};export const radiusProperty=(defaultValue=0)=>({type:ControlType.FusedNumber,defaultValue,title:\"Radius\",toggleKey:\"radiusIsMixed\",toggleTitles:[\"All\",\"Individual\"],valueKeys:[\"radiusTopLeft\",\"radiusTopRight\",\"radiusBottomRight\",\"radiusBottomLeft\"],valueLabels:[\"TL\",\"TR\",\"BR\",\"BL\"],min:0});export const getBorderRadius=property=>{if(property.radiusIsMixed){return`${property.radiusTopLeft}px ${property.radiusTopRight}px ${property.radiusBottomRight}px ${property.radiusBottomLeft}px`;}else if(property.radius){return`${property.radius}px`;}return\"0\";};\nexport const __FramerMetadata__ = {\"exports\":{\"updateChildren\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"radiusProperty\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getBorderRadius\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"SettingsMessage\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Utils.map","/*\n * Utils\n *\n * Learn More: https://www.framer.com/asset-urls\n */\n\nexport * from \"https://framerusercontent.com/modules/PN5c9Lm200xYeKxP2Gcy/II6tyEWaTvUw9Dzdhpmd/Utils.js\"\n","import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useRef,useState,useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{SettingsMessage}from\"https://framer.com/m/Utils-QTIc.js@II6tyEWaTvUw9Dzdhpmd\";/**\n * @framerDisableUnlink\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerIntrinsicWidth 300\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerIntrinsicHeight 150\n */export default function Twitter(props){const ref=useRef(null);const[isLoading,setIsLoading]=useState(true);const{type,screenName,style,tweetId}=props;if(!type||!screenName||!tweetId){return /*#__PURE__*/_jsx(SettingsMessage,{title:\"Set Up the Component\",description:\"Add name or tweet ID in the component property.\",containerStyle:style});}useEffect(()=>{const cleanupRef=()=>{if(ref.current){while(ref.current.firstChild){ref.current.removeChild(ref.current.firstChild);}}};if(isLoading===false){cleanupRef();setIsLoading(true);}const script=document.createElement(\"script\");script.src=\"https://platform.twitter.com/widgets.js\";script.async=true;script.onload=()=>{if(window.twttr){if(type===\"timeline\"){window.twttr.widgets.createTimeline({sourceType:\"timeline\",screenName,ariaPolite:\"assertive\"},ref.current).then(()=>setIsLoading(false));}else{window.twttr.widgets.createTweet(tweetId,ref.current).then(()=>setIsLoading(false));}}else{console.error(\"Failure to load window.twttr\");}};document.body.appendChild(script);return()=>{document.body.removeChild(script);};},[type,screenName,tweetId]);return /*#__PURE__*/_jsxs(\"div\",{style:{overflow:\"hidden\",...style},children:[isLoading&&/*#__PURE__*/_jsx(\"span\",{children:\"Loading...\"}),/*#__PURE__*/_jsx(\"div\",{ref:ref})]});}Twitter.displayName=\"Twitter\";addPropertyControls(Twitter,{type:{title:\"Type\",type:ControlType.Enum,defaultValue:\"timeline\",displaySegmentedControl:true,options:[\"timeline\",\"tweet\"],optionTitles:[\"Timeline\",\"Tweet\"]},screenName:{type:ControlType.String,title:\"Name\",defaultValue:\"ClementLIONNE\",hidden(props){return props.type!==\"timeline\";}},tweetId:{type:ControlType.String,title:\"Tweet Id\",defaultValue:\"1754547826124525702\",hidden(props){return props.type!==\"tweet\";}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Twitter\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"150\",\"framerIntrinsicWidth\":\"300\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerDisableUnlink\":\"*\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Twitter.map"],"mappings":"gOAAyD,IAAgC,CAA6T,GAAiB,CAAC,QAAM,cAAY,oBAAuC,EAAM,MAAM,CAAC,MAAM,CAAC,QAAQ,OAAO,cAAc,SAAS,WAAW,SAAS,UAAU,SAAS,eAAe,SAAS,gBAAgB,0BAA0B,SAAS,SAAS,GAAG,EAAe,CAAC,SAAS,CAAc,EAAK,OAAO,CAAC,KAAK,MAAM,aAAa,OAAO,MAAM,CAAC,SAAS,OAAO,CAAC,SAAS,IAAI,CAAC,CAAc,EAAM,MAAM,CAAC,MAAM,CAAC,SAAS,QAAQ,CAAC,SAAS,CAAc,EAA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