PageSourceSearch

https://player3.gg/assets/StudioGames-D3MKzZBO.js

js player3.gg collected 2026-10-05 03:09:32 UTC 28,867 bytes, 1 lines download raw bytes

1import{i as we,r as b,o as Q,j as e,M as r,k as w,ay as Ne,az as ke,aA as Se,aB as Ce,aC as De,aD as ze,aE as Ae,aF as Ie,B as S,T as C,a as D,b as z,L as W,t as A,q as Le,a2 as Pe,a$ as Ee}from"./index-yLHt_u4B.js";import{u as Ge}from"./useStudioContext-BdzdESNB.js";import{C as de,d as ce}from"./card-n98V_NUp.js";import{u as Re,a as Be,S as le,P as Ue,s as qe,b as re}from"./StudioSubmitPage-CgJ4xChD.js";import{u as Fe,p as $e,S as Te,a as Me}from"./submissionResolver-DKNKBiJ4.js";import{T as Ve}from"./ThirdPartySdkSection-B7SNPXkq.js";import{getReasonLabel as Ye,getReasonDescription as Oe}from"./rejectionReasons-C0fI9TZk.js";import"./useSubmitFormState-DPC8T161.js";import"./checkbox-CsTsh_QY.js";import"./switch-BBMP-Pqh.js";import"./GameBuildUploader-DPH76zLF.js";import"./progress-wdoERK5A.js";import"./godotPckParser-CEHz1Tcq.js";import"./p3ErrorHeuristics-zc-gAUy2.js";import"./rich-text-editor-CnDCsTek.js";import"./index-Dh4i1-J3.js";import"./richText-B-TGthEz.js";import"./genres-CnzAQO8V.js";import"./command-B55E1xi5.js";import"./search-BCw6JUlU.js";import"./gameStores-Ol2ZwBhc.js";import"./runnerLog-H5xG2-iO.js";import"./triangle-alert-maCZggfT.js";import"./circle-check-DpHtoDKC.js";import"./aiDisclosure-WJf-IRCs.js";import"./BrowseGameCard-CHjGwQZ8.js";import"./RatingSystem-BuX7E1uU.js";import"./useGame-D0Um0ks1.js";import"./playerRating-Cy_QtTV8.js";import"./alert-uui_M1nW.js";function me({game:s,originalSubmission:a,owner:o}){const _=[...s.trailer_urls||[],s.trailer_video_url||null].filter(u=>!!u).join(",")||null;return{user_id:o.user_id,contact_email:o.contact_email||(a==null?void 0:a.contact_email)||"",update_for_game_id:s.id,submission_source:"studio",status:"draft",sandbox_mode:!1,game_title:s.title,description:s.short_description||"",full_description:s.description||"",genre:(s.genre||[]).join(", ")||"Other",play_length:s.estimated_play_length||(a==null?void 0:a.play_length)||"Varies",engine:s.engine||"Browser",cloud_save_enabled:!!s.cloud_save_enabled,ai_disclosure:s.ai_disclosure??null,cloud_save_max_bytes:s.cloud_save_max_bytes??null,browser_ready:"Yes",maturity_rating:s.maturity_rating||null,num_players:s.max_players||1,version:s.version||"1.0",release_date:s.released_at||null,release_date_precision:s.release_date_precision||"exact",controller_support:s.controller_support??!1,game_type:s.game_type||"full",steam_url:s.steam_url||null,linked_demo_id:s.linked_demo_id||null,trailer_link:_,release_status:s.release_status||"live_now",feedback_dock_enabled:!!s.feedback_dock_enabled,testing_instructions:s.testing_instructions||null,languages_supported:s.languages_supported||[],website_url:s.website_url||null,other_store_links:s.other_store_links||[],youtube_trailer_url:s.youtube_trailer_url||null,input_compatibility:s.input_compatibility||[],cover_image_url:s.cover_image_url||null,thumbnail_url:s.thumbnail_url||null,landscape_preview_url:s.landscape_preview_url||null,preview_video_url:s.preview_video_url||null,screenshots:s.gameplay_screenshots||[],manual_images:s.manual_images||[],game_build_url:s.game_build_url||null,game_build_filename:s.game_build_filename||null,game_build_size:s.game_build_size||null,scan_status:s.game_build_url?"clean":null,scan_id:(a==null?void 0:a.scan_id)||null,scan_retry_count:0}}function Qe(s,a,o){const _=me({game:a,originalSubmission:o,owner:{user_id:s.user_id,contact_email:s.contact_email}}),u={},x=p=>{const l=s[p];(l==null||l===""||Array.isArray(l)&&l.length===0)&&_[p]!=null&&(u[p]=_[p])};return["cover_image_url","thumbnail_url","landscape_preview_url","preview_video_url","screenshots","manual_images","trailer_link","game_build_url","game_build_filename","game_build_size","scan_status","scan_id","release_status","release_date_precision","feedback_dock_enabled","testing_instructions","languages_supported","website_url","other_store_links","youtube_trailer_url","input_compatibility"].forEach(x),s.release_status==="live_now"&&a.release_status&&a.release_status!=="live_now"&&(u.release_status=a.release_status),s.release_date_precision==="exact"&&a.release_date_precision&&a.release_date_precision!=="exact"&&(u.release_date_precision=a.release_date_precision),s.engine==="Browser"&&a.engine&&a.engine!=="Browser"&&(u.engine=a.engine),s.cloud_save_enabled===!1&&a.cloud_save_enabled===!0&&(u.cloud_save_enabled=!0),s.cloud_save_max_bytes==null&&a.cloud_save_max_bytes!=null&&(u.cloud_save_max_bytes=a.cloud_save_max_bytes),u}const oe={draft:{label:"Draft",icon:"edit_note",color:"bg-muted text-muted-foreground"},pending:{label:"Awaiting Approval",icon:"hourglass_top",color:"bg-
1amber-500/20 text-amber-600 dark:text-amber-400"},approved:{label:"Approved",icon:"check_circle",color:"bg-emerald-500/20 text-emerald-600 dark:text-emerald-400"},declined:{label:"Declined",icon:"cancel",color:"bg-destructive/20 text-destructive"},rejected:{label:"Declined",icon:"cancel",color:"bg-destructive/20 text-destructive"}};function H(s){const a=new Date(new Date(s).getTime()+5184e6);return Math.max(0,Math.ceil((a.getTime()-Date.now())/(24*60*60*1e3)))}function We({sub:s}){if(s.status==="approved"&&s.delisted_at){const o=H(s.delisted_at);if(o>0)return e.jsxs(S,{variant:"outline",className:"text-xs gap-1.5 border-0 px-3 py-1 font-medium bg-amber-500/20 text-amber-600 dark:text-amber-400",children:[e.jsx(r,{name:"event_busy",size:14}),"Leaving Soon · ",o,"d"]})}if(s.status==="pending"&&s.update_for_game_id)return e.jsxs(S,{variant:"outline",className:"text-xs gap-1.5 border-0 px-3 py-1 font-medium bg-blue-500/20 text-blue-600 dark:text-blue-400",children:[e.jsx(r,{name:"system_update_alt",size:14}),"Update Pending"]});const a=oe[s.status]??oe.draft;return e.jsxs(S,{variant:"outline",className:`text-xs gap-1.5 border-0 px-3 py-1 font-medium ${a.color}`,children:[e.jsx(r,{name:a.icon,size:14}),a.label]})}function He({sub:s}){if(!s.scan_status)return null;const o={pending:{label:"Antivirus scan in progress…",icon:"hourglass_top",cls:"bg-amber-500/10 text-amber-600 dark:text-amber-400"},clean:{label:"Antivirus scan passed",icon:"verified_user",cls:"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400"},flagged:{label:"Build failed antivirus scan",icon:"gpp_bad",cls:"bg-destructive/10 text-destructive"},build_error:{label:"Build validation failed",icon:"broken_image",cls:"bg-orange-500/10 text-orange-600 dark:text-orange-400"},error:{label:"Antivirus scan error",icon:"error",cls:"bg-amber-500/10 text-amber-600 dark:text-amber-400"}}[s.scan_status];return o?e.jsxs(S,{variant:"outline",className:`text-[10px] gap-1 border-0 px-2 py-0.5 font-medium ${o.cls}`,children:[e.jsx(r,{name:o.icon,size:12}),o.label]}):null}function Ke({sub:s,onEdit:a,onView:o,onDelete:_,onUpdate:u,onPreviewLive:x,isDeleting:p=!1,readOnly:l=!1,hasPendingUpdate:d=!1}){const j=s.status==="draft"||s.status==="declined"||s.status==="rejected",g=s.status==="approved",N=s.status==="declined"||s.status==="rejected",k=g&&!!s.delisted_at,E=s.status==="draft"||N||g&&!k,n=new Date(s.created_at).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"});return e.jsx(de,{className:p?"opacity-60 pointer-events-none transition-opacity":"transition-opacity",children:e.jsxs(ce,{className:"p-4",children:[p&&e.jsxs("div",{className:"mb-3 flex items-center gap-2 text-xs font-medium text-destructive",children:[e.jsx("div",{className:"w-3 h-3 border-2 border-destructive border-t-transparent rounded-full animate-spin"}),"Deleting submission…"]}),e.jsxs("div",{className:"flex items-center gap-4",children:[(()=>{var y;const c=s.cover_image_url||(((y=s.screenshots)==null?void 0:y.length)>0?s.screenshots[0]:null),h=s.game_release_status??s.release_status,v=g&&!k&&(h==="coming_soon"||h==="active_playtest");return e.jsxs("div",{className:"relative w-16 aspect-[2/3] shrink-0",children:[c?e.jsx("img",{src:c,alt:s.game_title,className:"w-full h-full rounded-md object-cover"}):e.jsx("div",{className:"w-full h-full rounded-md bg-secondary flex items-center justify-center",children:e.jsx(r,{name:"sports_esports",size:24,className:"text-muted-foreground"})}),v&&e.jsx("div",{className:`absolute left-1 right-1 bottom-1 rounded px-1.5 py-0.5 text-[9px] font-display font-bold uppercase tracking-wide text-center backdrop-blur-sm ${h==="coming_soon"?"bg-[hsl(195_100%_50%/0.85)] text-[hsl(220_30%_8%)]":"bg-[hsl(310_100%_55%/0.85)] text-[hsl(220_30%_8%)]"}`,children:h==="coming_soon"?"Coming Soon":"Playtest"})]})})(),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("p",{className:"font-display text-sm font-bold truncate",children:s.game_title}),s.game_type==="demo"&&e.jsx(S,{variant:"outline",className:"text-[10px] border-emerald-500/30 text-emerald-600 dark:text-emerald-400",children:"Demo"})]}),(s.genre||s.game_release_status||s.release_status)&&e.jsxs("div",{className:"flex flex-wrap items-center gap-1 mt-1",children:[(()=>{const c=s.game_release_status??s.release_status;if(!c)return null;const h=c==="live_now"?{label:"Live",cls:"border-emerald-500/40 bg-emerald-500/10 text-emerald-600 dark:text-emerald-400"}:c==="coming_soon"?{label:"Coming Soon",cls:"border-cyan-500/40 bg-cyan-500/10 text-cyan-600 dark:text-cyan-400"}:{label:"Playtest",cls:"border-fuchsia-500/40 bg-fuchsia-500/10 text-fuchsia-600 dark:text-fuchsia-400"};return e.jsx(S,{variant:"outline",className:`text-[10px] font-bold uppercase tracking-wide ${h.cls}`,children:h.label})})(),s.genre&&s.genre.split(",").map(c=>
1c.trim()).filter(Boolean).map(c=>e.jsx(S,{variant:"outline",className:"text-[10px]",children:c},c))]}),e.jsx("p",{className:"text-[10px] text-muted-foreground mt-1",children:n})]}),e.jsxs("div",{className:"flex flex-col items-end gap-1",children:[e.jsx(We,{sub:s}),d&&e.jsxs(S,{variant:"outline",className:"text-xs gap-1.5 border-0 px-3 py-1 font-medium bg-blue-500/20 text-blue-600 dark:text-blue-400",children:[e.jsx(r,{name:"system_update_alt",size:14}),"Update Pending Review"]}),e.jsx(He,{sub:s})]}),e.jsxs("div",{className:"hidden lg:flex items-center gap-1 shrink-0",children:[g&&s.game_slug&&!k&&e.jsxs(C,{children:[e.jsx(D,{asChild:!0,children:e.jsx(w,{variant:"ghost",size:"icon",className:"h-8 w-8",asChild:!0,children:e.jsx("a",{href:`/game/${s.game_slug}`,target:"_blank",rel:"noopener noreferrer",children:e.jsx(r,{name:"play_circle",size:16})})})}),e.jsx(z,{children:"View player page"})]}),!l&&g&&!k&&e.jsxs(C,{children:[e.jsx(D,{asChild:!0,children:e.jsx(w,{variant:"ghost",size:"icon",className:"h-8 w-8",asChild:!0,children:e.jsx(W,{to:`/studio/games/${s.id}/achievements`,children:e.jsx(r,{name:"emoji_events",size:16})})})}),e.jsx(z,{children:"Achievements"})]}),!l&&g&&!k&&e.jsxs(C,{children:[e.jsx(D,{asChild:!0,children:e.jsx(w,{variant:"ghost",size:"icon",className:"h-8 w-8",asChild:!0,children:e.jsx(W,{to:`/studio/games/${s.id}/leaderboards`,children:e.jsx(r,{name:"leaderboard",size:16})})})}),e.jsx(z,{children:"Leaderboards"})]}),!l&&g&&!k&&e.jsxs(C,{children:[e.jsx(D,{asChild:!0,children:e.jsx(w,{variant:"ghost",size:"icon",className:"h-8 w-8",asChild:!0,children:e.jsx(W,{to:`/studio/games/${s.id}/api-tokens`,children:e.jsx(r,{name:"key",size:16})})})}),e.jsx(z,{children:"API Tokens / CI/CD"})]}),!l&&e.jsxs(e.Fragment,{children:[(s.status==="pending"||g)&&e.jsxs(C,{children:[e.jsx(D,{asChild:!0,children:e.jsx(w,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:o,children:e.jsx(r,{name:"visibility",size:16})})}),e.jsx(z,{children:"View submission"})]}),(()=>{const c=s.game_release_status??s.release_status;if(!(x&&(c==="coming_soon"||c==="active_playtest")&&(s.status==="pending"||s.status==="draft")&&!g))return null;const v=c==="coming_soon"?"Preview Coming Soon page":"Preview Playtest page";return e.jsxs(C,{children:[e.jsx(D,{asChild:!0,children:e.jsx(w,{variant:"ghost",size:"icon",className:"h-8 w-8 text-primary hover:text-primary",onClick:()=>x(s),"aria-label":v,children:e.jsx(r,{name:"podcasts",size:16})})}),e.jsx(z,{children:v})]})})(),j&&e.jsxs(C,{children:[e.jsx(D,{asChild:!0,children:e.jsx(w,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:a,children:e.jsx(r,{name:"edit",size:16})})}),e.jsx(z,{children:"Edit submission"})]}),g&&!k&&e.jsxs(C,{children:[e.jsx(D,{asChild:!0,children:e.jsx(w,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>u==null?void 0:u(s),children:e.jsx(r,{name:"update",size:16})})}),e.jsx(z,{children:"Update game"})]}),E&&e.jsxs(C,{children:[e.jsx(D,{asChild:!0,children:e.jsx(w,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive hover:text-destructive",onClick:_,disabled:p,children:p?e.jsx("div",{className:"w-4 h-4 border-2 border-destructive border-t-transparent rounded-full animate-spin"}):e.jsx(r,{name:"delete",size:16})})}),e.jsx(z,{children:g?"Remove game":N?"Delete submission":"Delete draft"})]})]})]})]}),g&&!k&&s.game_type==="demo"&&e.jsx("div",{className:"mt-3 ml-20 rounded-md border border-border bg-secondary/30 p-3",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(r,{name:"lightbulb",size:14,className:"text-primary mt-0.5 shrink-0"}),e.jsxs("p",{className:"text-xs text-muted-foreground leading-relaxed",children:["Want to release the full version? Submit a new Game Pack and select ",e.jsx("strong",{className:"text-foreground",children:"Full Game"})," as the game type. Your Demo will remain live and free to play independently."]})]})}),N&&(s.rejection_note||s.rejection_reason)&&e.jsxs("div",{className:"mt-3 ml-20 rounded-md border border-destructive/20 bg-destructive/5 p-3",children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[e.jsx(r,{name:"feedback",size:14,className:"text-destructive"}),e.jsx("span",{className:"text-xs font-display font-bold text-destructive",children:"Reason for Decline"})]}),(()=>{const c=s.rejection_reason,h=Ye(c),v=Oe(c);return e.jsxs("div",{className:"space-y-1.5",children:[h&&e.jsxs("p",{className:"text-xs text-foreground",children:[e.jsx("span",{className:"font-semibold",children:"Reason:"})," ",h,v?` — ${v}`:""]}),s.rejection_note&&e.jsxs("p",{className:"text-xs text-muted-foreground leading-relaxed whitespace-pre-wrap",children:[h?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-semibold",children:"Additional notes:"})," "]}
1):null,s.rejection_note]})]})})()]}),s.scan_report&&e.jsx("div",{className:"mt-3 ml-20",children:e.jsx(Ve,{scanReport:s.scan_report,variant:"studio"})}),s.scan_status==="error"&&e.jsxs("div",{className:"mt-3 ml-20 rounded-md border border-amber-500/20 bg-amber-500/5 p-3",children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[e.jsx(r,{name:"error",size:14,className:"text-amber-500"}),e.jsx("span",{className:"text-xs font-display font-bold text-amber-600 dark:text-amber-400",children:"Antivirus Scan Could Not Complete"})]}),e.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"The antivirus scan could not be completed. Please try editing your submission and resubmitting, or contact support."})]})]})})}function Je({sub:s}){const a=s.delisted_at?new Date(new Date(s.delisted_at).getTime()+5184e6):null,o=s.game_genre_tags??(s.genre?[s.genre]:[]);return e.jsx(de,{className:"opacity-60",children:e.jsx(ce,{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-4",children:[s.cover_image_url?e.jsx("img",{src:s.cover_image_url,alt:s.game_title,className:"w-16 aspect-[2/3] rounded-md object-cover shrink-0 grayscale"}):e.jsx("div",{className:"w-16 aspect-[2/3] rounded-md bg-secondary flex items-center justify-center shrink-0",children:e.jsx(r,{name:"sports_esports",size:24,className:"text-muted-foreground"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-display text-sm font-bold truncate",children:s.game_title}),o.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:o.map(_=>e.jsx(S,{variant:"outline",className:"text-[10px]",children:_},_))}),a&&e.jsxs("p",{className:"text-[10px] text-muted-foreground mt-1",children:["Removed ",a.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})]})]}),e.jsxs(S,{variant:"outline",className:"text-xs gap-1.5 border-0 px-3 py-1 font-medium bg-muted text-muted-foreground",children:[e.jsx(r,{name:"delete_forever",size:14}),"Removed"]})]})})})}function Xe({devProfile:s,readOnly:a=!1,submissionsOverride:o=null,submissionsLoadingOverride:_}){const[u,x]=we(),[p,l]=b.useState(null),[d,j]=b.useState(null),[g,N]=b.useState(!1),[k,E]=b.useState(null),[n,c]=b.useState(null),[h,v]=b.useState(null),[y,$]=b.useState(null),K=Re(o?null:s.user_id),G=o??K.data,T=o?!!_:K.isLoading,B=Be(),I=G??[];b.useEffect(()=>{N(!1),l(null),j(null),E(null),c(null)},[s.id]);const L=u.get("submissionId"),U=u.get("gameId"),{data:J,isLoading:X}=Fe(U),Z=b.useCallback(t=>{t.status==="draft"||t.status==="declined"||t.status==="rejected"?l(t):j(t)},[]);b.useEffect(()=>{if(a||!L&&!U||T||!(G!=null&&G.length)||U&&X||L&&((d==null?void 0:d.id)===L||(p==null?void 0:p.id)===L))return;const t=L?G.find(m=>m.id===L):null;if(t){Z(t);return}const i=$e(G,U,J);if(i){L&&Q.warning(Te),Z(i),x(m=>(m.set("submissionId",i.id),m),{replace:!0});return}x(m=>(m.delete("submissionId"),m.delete("gameId"),m),{replace:!0})},[L,U,J,X,G,T]);const ee=b.useCallback(t=>{l(t),x(i=>(i.set("submissionId",t.id),i),{replace:!0})},[x]),ue=b.useCallback(t=>{const i=Me(I,t)??t;j(i),x(m=>(m.set("submissionId",i.id),m),{replace:!0})},[x,I]),se=b.useCallback(()=>{N(!1),l(null),j(null),E(null),x(t=>(t.delete("submissionId"),t),{replace:!0})},[x]),_e=()=>{if(!n)return;const t=n.game_release_status??n.release_status,i=n.status==="approved"&&t!=="coming_soon",m=n;v(m.id),c(null),B.mutate({submission:m,mode:i?"delist":"delete"},{onSuccess:R=>{Q.success(i?`"${m.game_title}" has been scheduled for removal. It will remain available for 60 days.`:`"${m.game_title}" has been deleted.`),v(null)},onError:R=>{console.error("[submission-delete] failed:",R),re(R,{fallback:"Unable to delete this submission. Please try again or contact support if the issue persists."}),v(null)}})},te=async t=>{console.log("[update-flow] start",{fromSubmissionId:t.id,title:t.game_title});let{data:i}=await A.from("games").select("*").eq("submission_id",t.id).maybeSingle();if(!i&&t.user_id){const{data:f}=await A.from("games").select("*").eq("creator_id",t.user_id).ilike("title",t.game_title).maybeSingle();i=f}if(!i){Q.error("Could not find the linked game. Please try again.");return}const m=s.user_id;let R=null;if(i.submission_id){const{data:f}=await A.from("game_submissions").select("*").eq("id",i.submission_id).maybeSingle();R=f||null}const{data:P}=await A.from("game_submissions").select("*").eq("update_for_game_id",i.id).eq("user_id",m).in("status",["draft","pending"]).maybeSingle();if(P){console.log("[update-flow] reusing existing update row",{id:P.id,status:P.status});const f=Qe(P,i,R);let F=P;if(Object.keys(f).length>0&&P.status==="draft"){console.log("[update-flow] backfilling missing inherited fields",{id:P.id,fields:Object.keys(f)});const{data:ie}=await A.from("game_submissions").update(f).eq("id",P.id).select("*").single();ie&&(F=ie)}E(i.id),F.status==="pending"?j(F):l(F);return}const ye=me({game:i,originalSubmission:R,owner:{user_id:m,contact_email:t.contact_email||""}}),{data:ne,error:O}=await A.from("game_submissions").insert(ye).select("*").single();if(O){console.warn("[update-flow] insert failed, attempting recovery:",O.message);const{data:f}=await A.from("game_submissions").select("*").eq("update_for_game_id",i.id).eq("user_id",m).in("status",["draft","pending"]).maybeSingle();if(f){console.log("[update-flow] race resolved, reusing",f.id),E(i.id
1),f.status==="pending"?j(f):l(f);return}re(O);return}console.log("[update-flow] created new update draft (snapshot)",{id:ne.id}),E(i.id),l(ne)};if(g||p)return e.jsx(le,{studioName:s.studio_name,onClose:se,existingSubmission:p,updateForGameId:k,ownerUserId:s.user_id});if(d)return e.jsx(le,{studioName:s.studio_name,onClose:se,existingSubmission:d,readOnly:!0,ownerUserId:s.user_id});if(T)return e.jsx("p",{className:"text-center text-muted-foreground py-12",children:"Loading games…"});if(I.length===0)return a?e.jsxs("div",{className:"flex flex-col items-center justify-center py-24 px-6 text-center gap-4",children:[e.jsx("div",{className:"w-16 h-16 rounded-2xl bg-primary/10 flex items-center justify-center",children:e.jsx(r,{name:"sports_esports",size:32,className:"text-primary"})}),e.jsx("h2",{className:"font-display text-xl font-bold tracking-tight",children:"No Collaborations Yet"}),e.jsx("p",{className:"text-sm text-muted-foreground max-w-md leading-relaxed",children:"When a studio owner adds you as a collaborator on one of their games, it'll appear here."})]}):e.jsxs("div",{className:"flex flex-col items-center justify-center py-24 px-6 text-center gap-4",children:[e.jsx("div",{className:"w-16 h-16 rounded-2xl bg-primary/10 flex items-center justify-center",children:e.jsx(r,{name:"sports_esports",size:32,className:"text-primary"})}),e.jsx("h2",{className:"font-display text-xl font-bold tracking-tight",children:"No Games Yet"}),e.jsx("p",{className:"text-sm text-muted-foreground max-w-md leading-relaxed",children:"Submit your first game to get it reviewed and published on Player 3."}),e.jsxs(w,{onClick:()=>N(!0),className:"hidden lg:inline-flex gap-2 mt-2",children:[e.jsx(r,{name:"add",size:18}),"Submit New Game"]}),e.jsx("p",{className:"lg:hidden text-xs text-muted-foreground mt-2",children:"Submitting a new game requires a desktop browser."})]});const pe=new Set(I.filter(t=>t.update_for_game_id&&(t.status==="draft"||t.status==="pending")).map(t=>t.update_for_game_id)),xe=I.filter(t=>t.status==="draft"&&!t.update_for_game_id),ge=I.filter(t=>t.status==="pending"&&!t.update_for_game_id),he=I.filter(t=>t.status==="declined"||t.status==="rejected"),M=I.filter(t=>t.status==="approved"),fe=M.filter(t=>!t.delisted_at),be=M.filter(t=>t.delisted_at&&H(t.delisted_at)>0),V=M.filter(t=>t.delisted_at&&H(t.delisted_at)===0),je=[{title:"Declined",items:he,icon:"cancel"},{title:"Drafts",items:xe,icon:"edit_note"},{title:"Awaiting Approval",items:ge,icon:"hourglass_top"},{title:"Leaving Soon",items:be,icon:"event_busy"},{title:"Approved",items:fe,icon:"check_circle"}].filter(t=>t.items.length>0),ve=(n==null?void 0:n.game_release_status)??(n==null?void 0:n.release_status),q=(n==null?void 0:n.status)==="approved"&&ve==="coming_soon",Y=(n==null?void 0:n.status)==="approved"&&!q,ae=(n==null?void 0:n.status)==="declined"||(n==null?void 0:n.status)==="rejected";return e.jsxs("div",{className:"space-y-6",children:[!a&&e.jsx("div",{className:"flex justify-end",children:e.jsxs(w,{onClick:()=>N(!0),size:"sm",className:"hidden lg:inline-flex gap-2",children:[e.jsx(r,{name:"add",size:16}),"Submit New Game"]})}),!a&&e.jsxs("div",{className:"lg:hidden rounded-md border border-border bg-secondary/30 p-3 flex items-start gap-2",children:[e.jsx(r,{name:"desktop_windows",size:16,className:"text-primary mt-0.5 shrink-0"}),e.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Game management actions require a desktop browser. You can review submissions and statuses here."})]}),je.map(t=>e.jsxs("div",{className:"space-y-3",children:[e.jsxs("h3",{className:"font-display text-sm font-bold text-muted-foreground flex items-center gap-1.5",children:[e.jsx(r,{name:t.icon,size:16}),t.title,e.jsxs("span",{className:"text-muted-foreground/60 font-mono ml-1",children:["(",t.items.length,")"]})]}),e.jsx("div",{className:"space-y-2",children:t.items.map(i=>e.jsx(Ke,{sub:i,onEdit:()=>ee(i),onView:()=>ue(i),onDelete:()=>c(i),onUpdate:te,onPreviewLive:$,isDeleting:h===i.id,readOnly:a,hasPendingUpdate:!!i.game_id&&pe.has(i.game_id)},i.id))})]},t.title)),V.length>0&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("h3",{className:"font-display text-sm font-bold text-muted-foreground flex items-center gap-1.5",children:[e.jsx(r,{name:"delete_forever",size:16}),"Removed Games",e.jsxs("span",{className:"text-muted-foreground
1/60 font-mono ml-1",children:["(",V.length,")"]})]}),e.jsx("div",{className:"space-y-2",children:V.map(t=>e.jsx(Je,{sub:t},t.id))})]}),e.jsx(Ne,{open:!!n,onOpenChange:t=>!t&&!B.isPending&&c(null),children:e.jsxs(ke,{children:[e.jsxs(Se,{children:[e.jsx(Ce,{className:"font-display",children:Y?"Remove Game from Player 3?":q?"Remove Coming Soon Page?":ae?"Delete Declined Submission?":"Delete Draft?"}),e.jsx(De,{className:"space-y-2",children:Y?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"block",children:[e.jsxs("strong",{children:['"',n==null?void 0:n.game_title,'"']})," will remain playable for ",e.jsx("strong",{children:"60 more days"})," so players get one last chance to enjoy it. After that, it will be permanently removed from Player 3."]}),e.jsx("span",{className:"block text-xs text-muted-foreground",children:"This action cannot be undone. Analytics and reviews will be archived."})]}):q?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"block",children:[e.jsxs("strong",{children:['"',n==null?void 0:n.game_title,'"']})," will be permanently removed from Player 3, including its hype page, cover, screenshots, trailers, and any collected emails. This action cannot be undone."]}),e.jsx("span",{className:"block text-xs text-muted-foreground",children:"Because this game isn't playable yet, there's no 60-day grace period."})]}):ae?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"block",children:[e.jsxs("strong",{children:['"',n==null?void 0:n.game_title,'"']})," will be permanently deleted, including its build files, cover, screenshots, trailers, and all submission data. This action cannot be undone."]}),e.jsx("span",{className:"block text-xs text-muted-foreground",children:"You can always submit a new Game Pack later."})]}):e.jsxs("span",{children:[e.jsxs("strong",{children:['"',n==null?void 0:n.game_title,'"']})," will be permanently deleted. This cannot be undone."]})})]}),e.jsxs(ze,{children:[e.jsx(Ae,{disabled:B.isPending,children:"Cancel"}),e.jsx(Ie,{onClick:_e,disabled:B.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:B.isPending?"Deleting…":Y?"Remove Game":q?"Remove":"Delete"})]})]})}),y&&e.jsx(Ue,{open:!!y,onClose:()=>$(null),data:qe(y),studioName:s.studio_name,isApproved:y.status==="approved"&&!y.delisted_at,shareSlug:y.game_slug??y.slug??null,onEdit:()=>{const t=y;$(null),t.status==="approved"?te(t):ee(t)}})]})}function Ze(){const{user:s}=Le();return Pe({queryKey:["collaborator-submissions",s==null?void 0:s.id],enabled:!!(s!=null&&s.id),staleTime:6e4,queryFn:async()=>{const{data:a,error:o}=await A.rpc("get_my_collaborations");if(o)throw o;const _=(a??[]).filter(l=>Ee.has(l.status));if(_.length===0)return[];const u=_.map(l=>l.game_id).filter(Boolean),{data:x}=await A.from("games").select("id, title, slug, cover_image_url, thumbnail_url, screenshots, genre, release_status, delisted_at, game_type, created_at").in("id",u),p=new Map((x??[]).map(l=>[l.id,l]));return _.map(l=>{const d=p.get(l.game_id)??{},j=Array.isArray(d.genre)?d.genre:typeof d.genre=="string"?d.genre.split(",").map(N=>N.trim()).filter(Boolean):[];return{id:l.game_id,game_title:l.game_title??d.title??"Untitled",description:null,full_description:null,genre:j.join(", "),play_length:"",engine:"",browser_ready:"",demo_link:null,trailer_link:null,why_player3:null,contact_name:null,contact_email:"",screenshots:Array.isArray(d.screenshots)?d.screenshots:[],version:null,status:"approved",rejection_note:null,rejection_reason:null,maturity_rating:null,num_players:null,release_date:null,cover_image_url:d.cover_image_url??null,thumbnail_url:d.thumbnail_url??null,preview_video_url:null,landscape_preview_url:null,manual_images:null,steam_url:null,duplicate_steam_flag:null,update_for_game_id:null,update_changes_summary:null,game_type:d.game_type??"full",linked_demo_id:null,user_id:null,created_at:d.created_at??l.accepted_at??new Date().toISOString(),scan_id:null,scan_status:null,scan_report:null,scan_retry_count:0,delisted_at:d.delisted_at??null,game_genre_tags:j,game_slug:l.game_slug??d.slug??null,game_release_status:d.release_status??"live_now",release_status:d.release_status??"live_now"}})}})}function As(){const{devProfile:s,isCollaboratorOnly:a}=Ge(),{data:o,isLoading:_}=Ze();return e.jsxs("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 md:px-10 py-6 sm:py-8",children:[e.jsx("h1",{className:"font-display text-2xl font-bold tracking-tight mb-2",children:a?"Collaborator Games":"Your Games"}),a&&e.jsx("p",{className:"text-sm text-muted-foreground mb-6 max-w-2xl",children:"Read-only view of games you collaborate on. Submitting, editing, updating, and removing games stays with the studio owner."}),e.jsx(Xe,{devProfile:s,readOnly:a,submissionsOverride:a?o??[]:null,submissionsLoadingOverride:a?_:void 0})]})}export{As as default};

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.