function u(t){return t.startsWith("https://www.youtube.com")||t.startsWith("https://youtube.com")||t.startsWith("https://youtu.be")}function l(t){const e=new URL(t),a=e.searchParams.get("ratio")?.replace(":","/")??"16 / 9";e.searchParams.delete("ratio");let r=e.hostname.includes("youtu.be")?e.pathname.slice(1):e.searchParams.get("v");const s=r.indexOf("?");if(s!==-1){const c=r.slice(s+1);r=r.slice(0,s);for(const[i,n]of new URLSearchParams(c))e.searchParams.set(i,n)}e.searchParams.delete("v");const o=e.searchParams.toString();return{src:`https://www.youtube-nocookie.com/embed/${r}${o?`?${o}`:""}`,allow:"fullscreen; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",style:a?`aspect-ratio: ${a}`:""}}function p(t){return t.startsWith("https://vimeo")}function h(t){const e=new URL(t.replace("https://vimeo.com/","https://player.vimeo.com/video/"));e.searchParams.set("transparent","false"),e.searchParams.set("dnt","1");const a=e.searchParams.get("ratio")?.replace(":","/");return{id:e.pathname.slice(1),src:e.toString(),allow:"autoplay; fullscreen; picture-in-picture",style:a?`aspect-ratio: ${a}`:""}}export{p as a,u as i,h as v,l as y};