1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["CNo60Vvv.js","Cz7xZCJB.js","app-C2Ek0jQb.js","BX8RwoyW.js","cPPnkASS.css","BO-ECb7j.css","Cac247W_.css"])))=>i.map(i=>d[i]); 2import{as as Q,S as V,az as N,bj as J,i as f,M as k,d as W,e as X,I as q}from"./app-C2Ek0jQb.js";import{b as F,a as n,K,o as G,A as Y,g as l,l as a,q as r,u as s,t as I,B as p,i as w,L as _,H as u,F as B,h as j,C as v,N as Z,P as ee,d as te}from"./Cz7xZCJB.js";function le(M){const c=new URL(M);if(!["https:","http:"].includes(c.protocol))throw new Error("Invalid protocol");const d=new URLSearchParams(c.search);return c.hostname==="player.twitch.tv"?(d.set("parent",Q),d.set("allowfullscreen",""),d.set("autoplay","true")):(d.set("autoplay","1"),d.set("auto_play","1")),c.search=d.toString(),c.toString()}const ae=["allow","src"],se={key:1},oe={ref:"twitter"},ne=["src"],re={key:2},ie=["title"],ue=["title"],ce=["src"],de=["title"],pe=500,ve=F({__name:"MkUrlPreview",props:{url:{},detail:{type:Boolean,default:!1},compact:{type:Boolean,default:!1},showActions:{type:Boolean,default:!0}},setup(M){const c=M,d=n(V==="smartphone"||window.innerWidth<=pe),E=c.url.startsWith(N),A=E?"to":"href",D=E?null:"_blank",x=n(!0),$=n(null),m=n(null),L=n(null),C=n(null),z=n(null),S=n(!1),i=n({url:null,width:null,height:null}),b=n(!1),P=n(null),H=n(c.detail),U=`embed${Math.random().toString().replace(/\D/,"")}`,O=n(150),g=n(!1);K(()=>{b.value=!1});const o=new URL(c.url);if(!["http:","https:"].includes(o.protocol))throw new Error("invalid url");if(o.hostname==="twitter.com"||o.hostname==="mobile.twitter.com"||o.hostname==="x.com"||o.hostname==="mobile.x.com"){const e=o.pathname.match(/^\/.+\/status(?:es)?\/(\d+)/);e&&(P.value=e[1])}o.hostname==="music.youtube.com"&&o.pathname.match("^/(?:watch|channel)")&&(o.hostname="www.youtube.com"),o.hash="",window.fetch(`/url?url=${encodeURIComponent(o.href)}&lang=${J}`).then(e=>e.ok?e.json():null).then(e=>{if(!e||e.url==null){x.value=!1,g.value=!0;return}x.value=!1,g.value=!1,$.value=e.title,m.value=e.description,L.value=e.thumbnail,C.value=e.icon,z.value=e.sitename,i.value=e.player,S.value=e.sensitive??!1});function T(e){if(e.origin!=="https://platform.twitter.com")return;const t=e.data?.["twttr.embed"];if(t?.method!=="twttr.private.resize"||t?.id!==U)return;const h=t?.params[0]?.height;h&&(O.value=h)}function R(){const{dispose:e}=X(te(()=>q(()=>import("./CNo60Vvv.js"),__vite__mapDeps([0,1,2,3,4,5,6]))),{url:o.href},{closed:()=>{e()}})}return window.addEventListener("message",T),G(()=>{window.removeEventListener("message",T)}),(e,t)=>{const h=Y("MkEllipsis");return i.value.url&&b.value?(l(),a(B,{key:0},[r("div",{class:"xBA01",style:I(i.value.width?`padding: ${(i.value.height||0)/i.value.width*100}% 0 0`:`padding: ${i.value.height||0}px 0 0`)},[i.value.url.startsWith("http://")||i.value.url.startsWith("https://")?(l(),a("iframe",{key:0,sandbox:"allow-popups allow-scripts allow-storage-access-by-user-activation allow-same-origin",scrolling:"no",allow:i.value.allow==null?"autoplay;encrypted-media;fullscreen":i.value.allow.filter(y=>["autoplay","clipboard-write","fullscreen","encrypted-media","picture-in-picture","web-share"].includes(y)).join(";"),class:"xhXT7",src:s(le)(i.value.url),style:{border:0}},null,10,ae)):(l(),a("span",se,"invalid url"))],6),r("div",{class:"xEQzv"},[p(k,{small:!0,inline:"",onClick:t[0]||(t[0]=y=>b.value=!1)},{default:w(()=>[t[5]||(t[5]=r("i",{class:"ti ti-x"},null,-1)),_(" "+u(s(f).ts.disablePlayer),1)]),_:1})],2)],64)):P.value&&H.value?(l(),a(B,{key:1},[r("div",oe,[r("iframe",{ref:"tweet",allow:"fullscreen;web-share",sandbox:"allow-popups allow-popups-to-escape-sandbox allow-scripts allow-same-origin",scrolling:"no",style:I({position:"relative",width:"100%",height:`${O.value}px`,border:0}),src:`https://platform.twitter.com/embed/index.html?embedId=${U}&hideCard=false&hideThread=false&lang=en&theme=${s(W).state.darkMode?"dark":"light"}&id=${P.value}`},null,12,ne)],512),r("div",{class:"xEQzv"},[p(k,{small:!0,inline:"",onClick:t[1]||(t[1]=y=>H.value=!1)},{default:w(()=>[t[6]||(t[6]=r("i",{class:"ti ti-x"},null,-1)),_(" "+u(s(f).ts.close),1)]),_:1})],2)],64)):(l(),a("div",re,[(l(),j(ee(s(E)?"MkA":"a"),Z({class:["xlXwJ",{x4Jn8:e.compact}
2],[s(A)||""]:s(E)?e.url.substring(s(N).length):e.url,rel:"nofollow noopener",target:s(D),title:e.url}),{default:w(()=>[L.value&&!S.value?(l(),a("div",{key:0,class:"x3uMi",style:I(s(W).state.dataSaver.urlPreview?"":`background-image: url('${L.value}')`)},null,6)):v("",!0),r("article",{class:"xo52c"},[r("header",{class:"xfNOp"},[g.value?(l(),a("h1",{key:0,class:"xgWab"},u(e.url),3)):x.value?(l(),a("h1",{key:1,class:"xgWab"},[p(h)],2)):(l(),a("h1",{key:2,class:"xgWab",title:$.value??void 0},u($.value),11,ie))],2),g.value?(l(),a("p",{key:0,class:"xbyHy"},u(s(f).ts.failedToPreviewUrl),3)):x.value?(l(),a("p",{key:1,class:"xbyHy"},[p(h)],2)):m.value?(l(),a("p",{key:2,class:"xbyHy",title:m.value},u(m.value.length>85?m.value.slice(0,85)+"â¦":m.value),11,ue)):v("",!0),r("footer",{class:"xv626"},[C.value?(l(),a("img",{key:0,class:"xzLrO",src:C.value},null,10,ce)):v("",!0),g.value?(l(),a("p",{key:1,class:"xuHaL"},u(s(o).host),3)):x.value?(l(),a("p",{key:2,class:"xuHaL"},[p(h)],2)):(l(),a("p",{key:3,class:"xuHaL",title:z.value??s(o).host},u(z.value??s(o).host),11,de))],2)],2)]),_:1},16,["class","target","title"])),e.showActions?(l(),a(B,{key:0},[P.value?(l(),a("div",{key:0,class:"xEQzv"},[p(k,{small:!0,inline:"",onClick:t[2]||(t[2]=y=>H.value=!0)},{default:w(()=>[t[7]||(t[7]=r("i",{class:"ti ti-brand-x"},null,-1)),_(" "+u(s(f).ts.expandTweet),1)]),_:1})],2)):v("",!0),!b.value&&i.value.url?(l(),a("div",{key:1,class:"xEQzv"},[p(k,{small:!0,inline:"",onClick:t[3]||(t[3]=y=>b.value=!0)},{default:w(()=>[t[8]||(t[8]=r("i",{class:"ti ti-player-play"},null,-1)),_(" "+u(s(f).ts.enablePlayer),1)]),_:1}),d.value?v("",!0):(l(),j(k,{key:0,small:!0,inline:"",onClick:t[4]||(t[4]=y=>R())},{default:w(()=>[t[9]||(t[9]=r("i",{class:"ti ti-picture-in-picture"},null,-1)),_(" "+u(s(f).ts.openInWindow),1)]),_:1}))],2)):v("",!0)],64)):v("",!0)]))}}});const we=Object.freeze(Object.defineProperty({__proto__:null,default:ve},Symbol.toStringTag,{value:"Module"}));export{ve as M,we as a,le as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.