import{p as S,r as l,u as T}from"./chunk-WNDXCNJR.mjs";import{o as m,s as h,u as g,v as y,y as r}from"./chunk-Q5HXITMY.mjs";import{c as o}from"./chunk-RIUMFBNJ.mjs";var b={position:"relative",width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},M={...b,borderRadius:6,background:"rgba(136, 85, 255, 0.3)",color:"#85F",border:"1px dashed #85F",flexDirection:"column"},P={onClick:{type:l.EventHandler},onMouseEnter:{type:l.EventHandler},onMouseLeave:{type:l.EventHandler}},B={type:l.Number,title:"Font Size",min:2,max:200,step:1,displayStepper:!0},z={font:{type:l.Boolean,title:"Font",defaultValue:!1,disabledTitle:"Default",enabledTitle:"Custom"},fontFamily:{type:l.String,title:"Family",placeholder:"Inter",hidden:({font:e})=>!e},fontWeight:{type:l.Enum,title:"Weight",options:[100,200,300,400,500,600,700,800,900],optionTitles:["Thin","Extra-light","Light","Regular","Medium","Semi-bold","Bold","Extra-bold","Black"],hidden:({font:e})=>!e}};function w(){return h(()=>S.current()===S.canvas,[])}function U(e){let{borderRadius:t,isMixedBorderRadius:s,topLeftRadius:n,topRightRadius:c,bottomRightRadius:p,bottomLeftRadius:u}=e;return h(()=>s?`${n}px ${c}px ${p}px ${u}px`:`${t}px`,[t,s,n,c,p,u])}var j={borderRadius:{title:"Radius",type:l.FusedNumber,toggleKey:"isMixedBorderRadius",toggleTitles:["Radius","Radius per corner"],valueKeys:["topLeftRadius","topRightRadius","bottomRightRadius","bottomLeftRadius"],valueLabels:["TL","TR","BR","BL"],min:0}};var W={padding:{type:l.FusedNumber,toggleKey:"paddingPerSide",toggleTitles:["Padding","Padding per side"],valueKeys:["paddingTop","paddingRight","paddingBottom","paddingLeft"],valueLabels:["T","R","B","L"],min:0,title:"Padding"}};function I({type:e,url:t,html:s,style:n={}}){return e==="url"&&t?r(D,{url:t,style:n}):e==="html"&&s?r(q,{html:s,style:n}):r(K,{style:n})}T(I,{type:{type:l.Enum,defaultValue:"url",displaySegmentedControl:!0,options:["url","html"],optionTitles:["URL","HTML"]},url:{title:"URL",type:l.String,description:"Some websites don\u2019t support embedding.",hidden(e){return e.type!=="url"}},html:{title:"HTML",type:l.String,displayTextArea:!0,hidden(e){return e.type!=="html"}}});function K({style:e}){return r("div",{style:{minHeight:O(e),...M,overflow:"hidden",...e},children:r("div",{style:_,children:"To embed a website or widget, add it to the properties\xA0panel."})})}function D({url:e,style:t}){let s=!t.height;/[a-z]+:\/\//.test(e)||(e="https://"+e);let n=w(),[c,p]=y(n?void 0:!1);if(m(()=>{if(!n)return;let u=!0;p(void 0);async function x(){let d=await fetch("https://api.framer.com/functions/check-iframe-url?url="+encodeURIComponent(e));if(d.status==200){let{isBlocked:f}=await d.json();u&&p(f)}else{let f=await d.text();console.error(f);let C=new Error("This site can\u2019t be reached.");p(C)}}return x().catch(d=>{console.error(d),p(d)}),()=>{u=!1}},[e]),n&&s)return r(v,{message:"URL embeds do not support auto height.",style:t});if(!e.startsWith("https://"))return r(v,{message:"Unsupported protocol.",style:t});if(c===void 0)return r(Q,{});if(c instanceof Error)return r(v,{message:c.message,style:t});if(c===!0){let u=`Can\u2019t embed ${e} due to its content security policy.`;return r(v,{message:u,style:t})}return r("iframe",{src:e,style:{...F,...t},loading:"lazy",fetchPriority:n?"low":"auto",referrerPolicy:"no-referrer",sandbox:G(n)})}var F={width:"100%",height:"100%",border:"none"};function G(e){let t=["allow-same-origin","allow-scripts"];return e||t.push("allow-downloads","allow-forms","allow-modals","allow-orientation-lock","allow-pointer-lock","allow-popups","allow-popups-to-escape-sandbox","allow-presentation","allow-storage-access-by-user-activation","allow-top-navigation-by-user-activation"),t.join(" ")}function q({html:e,...t}){if(e.includes("<\/script>")){let n=e.includes(""),c=e.includes("");return n||c?r(Y,{html:e,...t}):r(J,{html:e,...t})}return r(Z,{html:e,...t})}function J({html:e,style:t}){let s=g(),[n,c]=y(0);m(()=>{var d;let f=(d=s.current)===null||d===void 0?void 0:d.contentWindow;function C(E){if(E.source!==f)return;let V=E.data;if(typeof V!="object"||V===null)return;let R=V.embedHeight;typeof R=="number"&&c(R)}return o.addEventListener("message",C),f?.postMessage("getEmbedHeight","*"),()=>{o.removeEventListener("message",C)}},[]);let p=`
${e}