PageSourceSearch

https://tt.vg/_nuxt/CHol9yip.js

js tt.vg collected 2026-10-06 19:02:21 UTC 3,310 bytes, 1 lines download raw bytes

1const f=["WEB","PHONE","EMAIL","SMS","SOCIAL"],g={WEB:"i-lucide-globe",PHONE:"i-lucide-phone",EMAIL:"i-lucide-mail",SMS:"i-lucide-message-square",SOCIAL:"i-lucide-messages-square"};function L(e,r){const n=r.recipient.trim();if(!n)return"";const o=new URLSearchParams;e==="EMAIL"&&r.subject&&o.set("subject",r.subject),r.body&&(e==="EMAIL"||e==="SMS")&&o.set("body",r.body),e==="SOCIAL"&&r.platform==="whatsapp"&&r.body&&o.set("text",r.body);const i=e==="PHONE"?"tel:":e==="EMAIL"?"mailto:":e==="SMS"?"sms:":r.platform==="telegram"?"https://t.me/":"https://wa.me/",c=e==="SOCIAL"?r.platform==="telegram"?n.replace(/^@/,""):n.replace(/[+ ()-]/g,""):n;return`${i}${c}${o.size?"?"+w(o):""}`}function m(e,r=!1){return[...e].some(n=>{const o=n.charCodeAt(0);return o===127||o<32&&!(r&&[9,10,13].includes(o))})}function w(e){return e.toString().replaceAll("+","%20")}function E(e){if(e==null)return"WEB";if(!f.includes(e))throw new Error("invalid destination type");return e}function S(e,r="WEB"){const n=E(r);if(typeof e!="string"||!e.trim()||e.length>4e4||m(e))throw new Error("invalid destination url");const o=e.trim();if(n==="WEB"||n==="SOCIAL"){const t=new URL(o);if(!["http:","https:"].includes(t.protocol)||t.username||t.password)throw new Error("invalid destination url");if(n==="SOCIAL"&&(t.protocol!=="https:"||t.port||!["t.me","wa.me"].includes(t.hostname)))throw new Error("invalid social destination");if(n==="SOCIAL"){if(t.hash)throw new Error("invalid social destination");if(t.hostname==="wa.me"&&(!/^\/[1-9]\d{5,14}$/.test(t.pathname)||[...t.searchParams.keys()].some(d=>d!=="text")))throw new Error("invalid social destination");const a=t.searchParams.get("text")??"";if(t.searchParams.getAll("text").length>1||a.length>2e3||m(a,!0))throw new Error("invalid social destination");if(t.hostname==="t.me"&&(!/^\/[A-Za-z][A-Za-z0-9_]{4,31}$/.test(t.pathname)||t.search))throw new Error("invalid social destination")}return t.href}const i=n==="PHONE"?"tel:":n==="EMAIL"?"mailto:":"sms:",c=o.toLowerCase().startsWith(i)?o.slice(i.length):o;if(c.includes("#"))throw new Error("invalid destination url");const[A,...p]=c.split("?");if(p.length>1)throw new Error("invalid destination url");const l=new URLSearchParams(p[0]??""),u=n==="EMAIL"?["subject","body"]:n==="SMS"?["body"]:[];for(const[t,a]of l)if(!u.includes(t)||l.getAll(t).length!==1||a.length>2e3||m(a,t==="body"))throw new Error("invalid destination url");let s=A??"";if(n==="EMAIL"){if(!/^[A-Za-z0-9.!$'*+\-_~]+@[A-Za-z0-9](?:[A-Za-z0-9.-]*[A-Za-z0-9])?\.[A-Za-z]{2,63}$/.test(s)||s.length>254)throw new Error("invalid email destination");const[t,a]=s.split("@");if(!t||t.length>64||t.startsWith(".")||t.endsWith(".")||t.includes("..")||a.split(".").some(d=>!/^[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?$/.test(d)))throw new Error("invalid email destination")}else if(s=s.replace(/[ ()-]/g,""),!/^\+?[1-9]\d{5,14}$/.test(s))throw new Error("invalid phone destination");const h=new URLSearchParams;for(const t of u)l.has(t)&&h.set(t,l.get(t));return`${i}${s}${h.size?"?"+w(h):""}`}function I(e,r){const n=E(r),o=S(e,n),i=new URL(o);return{type:n,recipient:n==="SOCIAL"?i.origin+i.pathname:i.pathname,subject:i.searchParams.get("subject")??"",body:i.searchParams.get(n==="SOCIAL"?"text":"body")??""}}export{g as D,f as a,I as b,L as c,S as n};

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.