{"version":3,"file":"IFrameEmbed.Cf0W4NET.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/RvJCZi1pDfqzAYcBgU8Z/lPVYOcnHFnYE0GdndDAA/IFrameEmbed.js"],"sourcesContent":["// Fully customizable iframe component that can embed HTML and URLs perfectly in Framer\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useEffect,useRef,useState,startTransition}from\"react\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function IFrameEmbed(props){const{embedType=\"url\",url=\"https://www.framer.com\",htmlContent=\"<h1>Hello World</h1>\",allowFullscreen=true,allowScripts=true,allowForms=true,allowPopups=false,allowSameOrigin=true,borderRadius=0,showBorder=false,borderColor=\"#CCCCCC\",borderWidth=1,backgroundColor=\"#FFFFFF\",loading=\"lazy\",title=\"Embedded Content\"}=props;const iframeRef=useRef(null);const[srcDoc,setSrcDoc]=useState(\"\");useEffect(()=>{if(embedType===\"html\"&&htmlContent){startTransition(()=>{setSrcDoc(htmlContent);});}},[embedType,htmlContent]);const sandbox=[];if(allowScripts)sandbox.push(\"allow-scripts\");if(allowForms)sandbox.push(\"allow-forms\");if(allowPopups)sandbox.push(\"allow-popups\");if(allowSameOrigin)sandbox.push(\"allow-same-origin\");sandbox.push(\"allow-presentation\");sandbox.push(\"allow-modals\");sandbox.push(\"allow-top-navigation\");sandbox.push(\"allow-top-navigation-by-user-activation\");const sandboxValue=sandbox.join(\" \");const iframeStyles={width:\"100%\",height:\"100%\",border:showBorder?`${borderWidth}px solid ${borderColor}`:\"none\",borderRadius:`${borderRadius}px`,backgroundColor,display:\"block\"};return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",overflow:\"hidden\",position:\"relative\",borderRadius:`${borderRadius}px`},children:embedType===\"url\"?/*#__PURE__*/_jsx(\"iframe\",{ref:iframeRef,src:url,title:title,style:iframeStyles,allowFullScreen:allowFullscreen,sandbox:sandboxValue,loading:loading,referrerPolicy:\"no-referrer-when-downgrade\"}):/*#__PURE__*/_jsx(\"iframe\",{ref:iframeRef,srcDoc:srcDoc,title:title,style:iframeStyles,allowFullScreen:allowFullscreen,sandbox:sandboxValue,loading:loading})});}addPropertyControls(IFrameEmbed,{embedType:{type:ControlType.Enum,title:\"Embed Type\",options:[\"url\",\"html\"],optionTitles:[\"URL\",\"HTML\"],defaultValue:\"url\",displaySegmentedControl:true},url:{type:ControlType.String,title:\"URL\",defaultValue:\"https://www.framer.com\",placeholder:\"https://example.com\",hidden:({embedType})=>embedType!==\"url\"},htmlContent:{type:ControlType.String,title:\"HTML Content\",defaultValue:\"<h1>Hello World</h1>\",displayTextArea:true,placeholder:\"Enter HTML code...\",hidden:({embedType})=>embedType!==\"html\"},title:{type:ControlType.String,title:\"Title\",defaultValue:\"Embedded Content\",placeholder:\"Accessibility title...\"},allowFullscreen:{type:ControlType.Boolean,title:\"Fullscreen\",defaultValue:true,enabledTitle:\"Allow\",disabledTitle:\"Block\"},allowScripts:{type:ControlType.Boolean,title:\"Scripts\",defaultValue:true,enabledTitle:\"Allow\",disabledTitle:\"Block\"},allowForms:{type:ControlType.Boolean,title:\"Forms\",defaultValue:true,enabledTitle:\"Allow\",disabledTitle:\"Block\"},allowPopups:{type:ControlType.Boolean,title:\"Popups\",defaultValue:false,enabledTitle:\"Allow\",disabledTitle:\"Block\"},allowSameOrigin:{type:ControlType.Boolean,title:\"Same Origin\",defaultValue:true,enabledTitle:\"Allow\",disabledTitle:\"Block\"},loading:{type:ControlType.Enum,title:\"Loading\",options:[\"lazy\",\"eager\"],optionTitles:[\"Lazy\",\"Eager\"],defaultValue:\"lazy\",displaySegmentedControl:true},showBorder:{type:ControlType.Boolean,title:\"Border\",defaultValue:false,enabledTitle:\"Show\",disabledTitle:\"Hide\"},borderColor:{type:ControlType.Color,title:\"Border Color\",defaultValue:\"#CCCCCC\",hidden:({showBorder})=>!showBorder},borderWidth:{type:ControlType.Number,title:\"Border Width\",defaultValue:1,min:1,max:10,step:1,unit:\"px\",hidden:({showBorder})=>!showBorder},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:0,min:0,max:50,step:1,unit:\"px\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"IFrameEmbed\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\",\"framerSupportedLayoutHeight\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./IFrameEmbed.map"],"mappings":"+LAIG,SAAwB,EAAY,EAAM,CAAC,GAAK,CAAC,YAAU,MAAM,MAAI,yBAAyB,cAAY,uBAAuB,kBAAgB,GAAK,eAAa,GAAK,aAAW,GAAK,cAAY,GAAM,kBAAgB,GAAK,eAAa,EAAE,aAAW,GAAM,cAAY,UAAU,cAAY,EAAE,kBAAgB,UAAU,UAAQ,OAAO,QAAM,oBAAoB,EAAY,EAAUA,EAAO,IAAI,EAAO,CAAC,EAAO,GAAWC,EAAS,EAAE,EAAE,MAAc,CAAI,IAAY,QAAQ,GAAa,MAAoB,CAAC,EAAU,CAAW,CAAE,CAAC,CAAG,EAAE,CAAC,EAAU,CAAW,CAAC,EAAE,IAAM,EAAQ,CAAC,EAAK,GAAa,EAAQ,KAAK,eAAe,EAAK,GAAW,EAAQ,KAAK,aAAa,EAAK,GAAY,EAAQ,KAAK,cAAc,EAAK,GAAgB,EAAQ,KAAK,mBAAmB,EAAE,EAAQ,KAAK,oBAAoB,EAAE,EAAQ,KAAK,cAAc,EAAE,EAAQ,KAAK,sBAAsB,EAAE,EAAQ,KAAK,yCAAyC,EAAE,IAAM,EAAa,EAAQ,KAAK,GAAG,EAAQ,EAAa,CAAC,MAAM,OAAO,OAAO,OAAO,OAAO,EAAW,GAAG,EAAY,WAAW,IAAc,OAAO,aAAa,GAAG,EAAa,IA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