PageSourceSearch

https://scoutsland.live/assets/chunks/chunk-1-YAH8Yh.js

js scoutsland.live collected 2026-10-02 02:01:21 UTC 9,779 bytes, 1 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"821ea7e147f045d2860a3e0d1e100e4ae59e5c20"};var a=(new e.Error).stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="992807e1-eb6c-4d17-bd5c-1bc5b2edc55a",e._sentryDebugIdIdentifier="sentry-dbid-992807e1-eb6c-4d17-bd5c-1bc5b2edc55a")}catch(t){}}();import{r as e,j as a}from"./chunk-DbxBeaFY.js";import{t}from"./chunk-yJ4IumGD.js";import{a as r,l as s,D as n,S as o}from"./chunk-O6FBTeNJ.js";import{u as i}from"./chunk-B5R0n4Sp.js";import{c as l,b as c,D as d,a as g}from"./chunk-UbjNlMp5.js";import{X as m,a as h,az as u,aA as y,aB as b,D as f,j as p,e as x,av as w}from"./chunk-88Eu5Xbc.js";async function k(){const e=await async function(){return"undefined"==typeof window?null:window.Clerk?.session?.getToken()??null}();return e?{Authorization:`Bearer ${e}`}:{}}function j(a){const{type:n,playerId:o,matchId:l,clubId:c,playerIds:d,matchCardType:g,sportmonksLeagueIds:m,days:h,startDate:u,endDate:y,limit:b,positions:f,nationalityId:p,minAge:x,maxAge:w}=a,{t:j,i18n:v}=i(),{isSignedIn:N,isLoaded:S}=r(),[$,C]=e.useState(!1),[I,L]=e.useState("post"),[D,R]=e.useState(v.language||"en"),[T,E]=e.useState(g??"match"),[U,O]=e.useState(!1),[F,A]=e.useState(null),[P,_]=e.useState(!1),B=e.useRef(null),M=e.useCallback(()=>{!S||N?C(!0):t.error(j("share.signInRequired","Sign in to generate share images"))},[S,N,j]),K=e.useCallback(()=>{C(!1)},[]),z=e.useMemo(()=>{const e=function(){try{return new URL("https://api.scouts.land/graphql").origin}catch{return"http://localhost:3000"}}(),a=new URLSearchParams;return a.set("format",I),a.set("lang",D),a.set("tz",Intl.DateTimeFormat().resolvedOptions().timeZone),"player"===n&&o?`${e}/api/og-images/player/${o}?${a.toString()}`:"match"===n&&l?("match"!==T&&a.set("card",T),`${e}/api/og-images/match/${l}?${a.toString()}`):"club-form"===n&&c?(b&&a.set("limit",String(b)),`${e}/api/og-images/club-form/${c}?${a.toString()}`):"compare"===n&&d&&d.length>=2?(a.set("ids",d.join(",")),`${e}/api/og-images/compare?${a.toString()}`):(m&&m.length>0&&a.set("leagueIds",m.join(",")),u&&y?(a.set("startDate",u),a.set("endDate",y)):h&&a.set("days",String(h)),b&&a.set("limit",String(b)),f&&f.length>0&&a.set("positions",f.join(",")),p&&a.set("nationalityId",p),x&&a.set("minAge",String(x)),w&&a.set("maxAge",String(w)),`${e}/api/og-images/${n}?${a.toString()}`)},[n,o,l,c,d,T,I,D,m,h,u,y,b,f,p,x,w]);e.useEffect(()=>{if(!$||!N)return;if(B.current===z)return;let e=!1;return B.current=z,_(!0),A(e=>(e&&URL.revokeObjectURL(e),null)),(async()=>{try{const a=await k(),r=await fetch(z,{headers:a});if(!r.ok){if(429===r.status){const e=await r.json().catch(()=>({}));t.error(e.message||j("share.dailyLimitReached","Daily limit reached. Try again tomorrow."))}return}const s=await r.blob();e||A(URL.createObjectURL(s))}catch{}finally{e||_(!1)}})(),()=>{e=!0}},[$,z,N,j]),e.useEffect(()=>{$||(B.current=null,A(e=>(e&&URL.revokeObjectURL(e),null)))},[$]);const q=e.useCallback(async()=>{const e=await k(),a=await fetch(z,{headers:e});if(!a.ok){if(429===a.status){const e=await a.json().catch(()=>({}));throw new Error(e.message||j("share.dailyLimitReached","Daily limit reached. Try again tomorrow."))}throw new Error(`HTTP ${a.status}`)}return a.blob()},[z,j]),Y=e.useCallback(async()=>{O(!0);try{const e=await q(),a=URL.createObjectURL(e),r=document.createElement("a");r.href=a,r.download=`scoutsland-${n}-${I}-${D}.png`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(a),s.shareContent(n,I,"download_png"),t.success(j("share.downloaded","Image downloaded!"))}catch(e){const a=e instanceof Error?e.message:"";t.error(a||j("share.error","Failed to download image"))}finally{O(!1)}},[q,n,I,D,j]);return{isModalOpen:$,openShareModal:M,closeShareModal:K,format:I,setFormat:L,cardLanguage:D,setCardLanguage:R,matchCardType:T,setMatchCardType:E,imageUrl:z,previewBlobUrl:F,isFetchingPreview:P,fetchImageBlob:q,handleDownload:Y,isDownloading:U}}const v=[{key:"post",Icon:u,labelKey:"share.post",fallback:"Post"},{key:"story",Icon:y,labelKey:"share.story",fallback:"Story"},{key:"twitter",Icon:b,labelKey:"share.twitter",fallback:"X"}],N=[{key:"en",label:"EN"},{key:"de",label:"DE"},{key:"tr",label:"TR"},{key:"lt",label:"LT"},{key:"es",label:"ES"}],S={post:.8,story:.5625,twitter:1200/675},$=({isOpen:r,onClose:u,type:y,imageUrl:b,previewBlobUrl:k,isFetchingPreview:j,fetchImageBlob:$,format:C,onFormatChange:I,cardLanguage:L,onCardLanguageChange:D,onDownload:R,isDownloading:T,shareUrl:E,shareTitle:U})=>{const{t:O}=i(),[F,A]=e.useState(!1),[P,_]=e.useState(!0),[B,M]=e.useState(!1),K=k??($?null:b),z="club-form"===y||"compare"===y,q="club-form"===y?.8:"compare"===y?1200/1300:S[C],Y=e.useCallback(async()=>{try{await navigator.clipboard.writeText(E),A(!0),s.shareContent(y,C,"copy"),setTimeout(()=>A(!1),2e3)}catch{t.error(O("errors.failedToCopy","Failed to copy"))}},[E,y,C,O]),Z=e.useCallback(async()=>{try{const e=$?await $():await fetch(b).then(e=>{if(!e.ok)throw new Error("Fetch failed");return e.blob()}),a=new File([e],`scoutsland-${y}-${C}.png`,{type:"image/png"});navigator.canShare&&navigator.canShare({files:[a]})?(await navigator.share({title:U,text:"",url:E,files:[a]}),s.shareContent(y,C,"native_image")):await navigator.share({title:U,text:"",url:E})}catch(e){"AbortError"!==e.name&&console.error("Native share failed:",e)}},[$,b,y,C,U,E]);return a.jsx(l,{open:r,onOpenChange:e=>{e||u()},children:a.jsxs(c,{fullScreenMobile:!0,className:"flex flex-col overflow-hidden p-0 outline-none",hideCloseButton:!0,children:[a.jsxs("div",{className:"shrink-0 flex items-center justify-between p-4 border-b border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-900",children:[a.jsx(d,{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:O("common.share")}),a.jsx("button",{onClick:u,className:`p-2 cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-700 ${n.radius.button} ${n.transitions.colors}`,"aria-label":O("common.close"),children:a.jsx(m,{className:"w-5 h-5 text-gray-500 dark:text-gray-400"})})]}),a.jsx(g,{className:"sr-only",children:O("share.modalDescription","Download or share this content as an image on social media")}),a.jsxs("div",{className:"flex flex-col sm:flex-row flex-1 min-h-0 overflow-hidden",children:[a.jsx("div",{className:"shrink-0 sm:flex-1 flex items-center justify-center p-6 bg-gray-50 dark:bg-gray-900 sm:border-r border-gray-200 dark:border-gray-700 overflow-hidden",children:a.jsxs("div",{className:"relative overflow-hidden rounded-lg bg-gray-900",style:{width:"100%",maxWidth:"twitter"===C?340:"post"===C?260:200,aspectRatio:String(q)},children:[(P||j)&&a.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:a.jsx(h,{className:"w-8 h-8 text-gray-400 animate-spin"})}),B&&!j&&a.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-gray-400 text-sm",children:O("share.previewError","Preview unavailable")}
1),K&&a.jsx("img",{src:K,alt:U,className:"w-full h-full object-contain transition-opacity "+(P?"opacity-0":"opacity-100"),onLoad:()=>_(!1),onError:()=>{_(!1),M(!0)}},K)]})}),a.jsx(o,{className:"flex-1 min-h-0 sm:flex-none sm:w-56",children:a.jsxs("div",{className:"p-4 flex flex-col gap-3",children:[!z&&a.jsx("div",{className:"flex gap-1.5",children:v.map(({key:e,Icon:t,labelKey:r,fallback:s})=>a.jsxs("button",{onClick:()=>{_(!0),M(!1),I(e)},className:"flex-1 flex items-center justify-center gap-1 py-1.5 text-xs font-medium rounded-lg transition-colors "+(C===e?"bg-primary-600 text-white":"bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-gray-700"),children:[a.jsx(t,{className:"w-3.5 h-3.5"}),O(r,s)]},e))}),a.jsx("div",{className:"flex gap-1",children:N.map(({key:e,label:t})=>a.jsx("button",{onClick:()=>{_(!0),M(!1),D(e)},className:"flex-1 py-1.5 text-xs font-semibold rounded-md transition-colors "+(L===e?"bg-primary-600 text-white":"bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-gray-700"),children:t},e))}),a.jsx("div",{className:"h-px bg-gray-200 dark:bg-gray-700"}),a.jsxs("div",{className:"flex flex-col gap-2",children:[a.jsxs("button",{onClick:R,disabled:T,className:`flex items-center justify-center gap-2 px-4 py-2.5 bg-primary-600 hover:bg-primary-700 disabled:opacity-50 disabled:cursor-not-allowed text-white ${n.radius.button} ${n.transitions.colors} font-medium text-sm`,children:[T?a.jsx(h,{className:"w-4 h-4 animate-spin"}):a.jsx(f,{className:"w-4 h-4"}),O("share.downloadPng","Download PNG")]}),"undefined"!=typeof navigator&&"share"in navigator&&a.jsxs("button",{onClick:Z,className:`flex items-center justify-center gap-2 px-4 py-2.5 bg-gray-100 dark:bg-gray-800 hover:bg-gray-200 dark:hover:bg-gray-700 text-gray-900 dark:text-gray-100 ${n.radius.button} ${n.transitions.colors} font-medium text-sm`,children:[a.jsx(p,{className:"w-4 h-4"}),O("share.shareImage","Share Image")]})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("input",{type:"text",value:E,readOnly:!0,className:`flex-1 min-w-0 px-3 py-2 ${n.colors.background.tertiary} text-gray-900 dark:text-gray-100 ${n.radius.input} text-sm border ${n.colors.border.base} focus:outline-none`}),a.jsx("button",{onClick:Y,className:`shrink-0 px-4 py-2 ${n.radius.button} ${n.transitions.default} font-medium text-sm ${F?"bg-green-600 text-white":"bg-gray-200 dark:bg-gray-700 text-gray-900 dark:text-gray-100 hover:bg-gray-300 dark:hover:bg-gray-600"}`,"aria-label":O("common.copyLink"),children:F?a.jsx(x,{className:"w-5 h-5"}):a.jsx(w,{className:"w-5 h-5"})})]})]})})]})]})})};export{$ as O,j 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.