1import{y as C,aT as v,aU as N,aV as P}from"./DyKNP8cS.js";import{u as F}from"./6ET-ChJZ.js";function I(e){if(!e||typeof e!="string")return null;const r=new Date(e);if(Number.isNaN(r.getTime()))return null;const t=new Date;let n=t.getFullYear()-r.getFullYear();const a=t.getMonth()-r.getMonth();return(a<0||a===0&&t.getDate()<r.getDate())&&n--,n>=0&&n<130?n:null}function L(e,r,t,n){const s=(t-e)*Math.PI/180,o=(n-r)*Math.PI/180,u=Math.sin(s/2)*Math.sin(s/2)+Math.cos(e*Math.PI/180)*Math.cos(t*Math.PI/180)*Math.sin(o/2)*Math.sin(o/2);return Math.round(6371*2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)))}const R=["thumbnail","small","medium","large"];function D(e,r){const t=new Map;for(const n of R){const a=e?.formats?.[n],s=a?.url,o=Number(a?.width);!s||!Number.isFinite(o)||o<=0||(!t.has(s)||t.get(s)<o)&&t.set(s,o)}return t.size<2||!t.has(r)?"":[...t.entries()].sort((n,a)=>n[1]-a[1]).map(([n,a])=>`${n} ${a}w`).join(", ")}function j(e){const r=Array.isArray(e?.data)?e.data:Array.isArray(e)?e:e?[e]:[],t=[],n={},a={};for(const s of r){const o=s?.attributes||s,u=o?.formats?.medium?.url||o?.formats?.large?.url||o?.url||o?.formats?.thumbnail?.url||o?.formats?.small?.url;if(!u)continue;t.push(u);const l=o?.url;l&&l!==u&&(n[u]=l);const d=D(o,u);d&&(a[u]=d)}return{photos:[...new Set(t)],originaux:n,jeux:a}}function w(e,r){if(e.length<2)return e;let t=N(`${r}|${P()}`);const n=()=>(t=(t*1664525+1013904223)%4294967296,t/4294967296),a=[...e];for(let s=a.length-1;s>0;s--){const o=Math.floor(n()*(s+1));[a[s],a[o]]=[a[o],a[s]]}return a}function x(){const e=C(),{countCommonInterests:r}=v();function t(n,a){const s=Array.isArray(n)?n:[];if(s.length===0)return[];const o=F(s),u=e.User?.latitude,l=e.User?.longitude,d=new Set(a||[]),b=[];for(let m=0;m<s.length;m++){const i=s[m],h=o[m]||{},f=Number(i?.id);if(!f||d.has(f))continue;d.add(f);const c=i?.userProfile,{photos:$,originaux:S,jeux:A}=j(i?.avatar),M=w($,f);let g=null;const p=Number(i?._distance);if(Number.isFinite(p))p<200&&(g=Math.round(p));else if(u&&l&&i?.latitude&&i?.longitude){const y=L(u,l,i.latitude,i.longitude);y<200&&(g=y)}b.push({id:f,username:h.username,age:I(i?.birth),avatarUrl:M[0]||h.pictureOriginal,photos:M,photoOriginals:S,photoSrcset:A,bio:c?.presentation||"",status:typeof i?.status=="string"?i.status.trim():"",distanceKm:g,search:Array.isArray(c?.search)?c.search:[],badgeShow:h.badgeShow,badgeColor:h.badgeColor,badgeLabel:h.badgeLabel,certified:!!c?.certified,commonInterests:r(c),subscriptionLevel:Number(i?.subscriptionLevel??0)||0,lastRealConnection:i?.lastRealConnection?String(i.lastRealConnection):null,stepConnection:Number(h.stepConnection)||0,avatarFaceScore:c?.avatarFaceScore===null||c?.avatarFaceScore===void 0?null:Number(c.avatarFaceScore),avatarAdultScore:c?.avatarAdultScore===null||c?.avatarAdultScore===void 0?null:Number(c.avatarAdultScore),gender:i?.gender===null||i?.gender===void 0?null:Number(i.gender)})}return b}return{toCards:t}}async function z(e,r,t=5,n=20,a=!1){const s=a?"&rejouer=1":"";return $fetch(`${e}/api/match/curated-suggestions?matchCount=${t}&mosaicCount=${n}${s}`,{headers:{Authorization:`Bearer ${r}`}})}async function B(e,r,t){return $fetch(`${e}/api/match/like/${t}`,{method:"POST",headers:{Authorization:`Bearer ${r}`}})}async function E(e,r,t,n){return $fetch(`${e}/api/match/action/${t}`,{method:"DELETE",headers:{Authorization:`Bearer ${r}`},query:{kind:n}})}async function O(e,r,t){return $fetch(`${e}/api/match/pass/${t}`,{method:"POST",headers:{Authorization:`Bearer ${r}`}})}async function k(e,r){try{const t=await $fetch(`${e}/api/match-pass/recent`,{headers:{Authorization:`Bearer ${r}`}});return Array.isArray(t?.data)?t.data:[]}catch{return[]}}export{E as a,k as b,I as c,z as f,L as h,B as l,O as p,x as u};
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.