import{s as v,t as f,u as k,v as h,x as b,r as u,y as g,l as p,e as w,z as y}from"./CAOuqjJ0.js";const n=v({callbacks:[]}),E=o=>{y(()=>{if(document.getElementById("twitter-widgets-js"))n.callbacks.push(o);else{n.callbacks.push(o);var e=document.createElement("script");e.id="twitter-widgets-js",e.src="https://platform.twitter.com/widgets.js",e.onload=()=>n.callbacks.forEach(r=>r()),document.body.appendChild(e)}})},j={key:1,class:"notion-tweet-error"},B={name:"NotionTweet"},x=f({...B,props:{...k},setup(o){const e=o,{properties:r}=h(e),m=b(()=>{var t,s,a,d;return(d=(a=(s=(t=r.value)==null?void 0:t.source)==null?void 0:s[0])==null?void 0:a[0].split("status/"))==null?void 0:d[1].split("?")[0]}),c=u(),l=u(),i=()=>{var t;(t=window.twttr)==null||t.ready().then(({widgets:s})=>{s.createTweetEmbed(m.value,c.value,{}).then(a=>{l.value=a?void 0:"error"}).catch(a=>{l.value=a})})};return E(i),g(()=>{i()}),(t,s)=>l.value?(p(),w("div",j,"Error loading Tweet")):(p(),w("div",{key:0,class:"notion-tweet",ref_key:"el",ref:c},null,512))}});export{x as default};