performance.mark("js-parse-end:80022-6f492d61f4a81692.js"); "use strict";(globalThis.webpackChunk_github_ui_github_ui=globalThis.webpackChunk_github_ui_github_ui||[]).push([["80022"],{59046(e,t,a){a.d(t,{Y:()=>l});var i=a(74848),r=a(16522),n=a(61225),o=a(22211),s=a(49685);function l(e){let t,a,l,c,u,m=(0,r.c)(15),{onUpdateModel:g,selectedModelId:p}=e,{models:f,isLoading:_}=(0,o.h)();m[0]!==g?(t=e=>{g(e.id)},m[0]=g,m[1]=t):t=m[1];let h=t;m[2]!==f||m[3]!==p?(a=f?.find(e=>e.id===p),m[2]=f,m[3]=p,m[4]=a):a=m[4];let v=a;m[5]!==f?(l=f?.find(d)??f?.[0],m[5]=f,m[6]=l):l=m[6];let y=l;if(m[7]!==y||m[8]!==v||m[9]!==p)c=p?v??{id:p,name:`${p} (unavailable)`,displayName:`${p} (unavailable)`,hasLimitedCapabilities:!0,isThirdParty:!1,version:"",vendor:"",preview:!1,model_picker_enabled:!1,capabilities:{type:"chat",family:"",limits:{max_prompt_tokens:0},supports:{},tokenizer:""}}:y,m[7]=y,m[8]=v,m[9]=p,m[10]=c;else c=m[10];let b=c,w=s.W.codingAgentHideModelPickerIfOnlyAuto&&f?.length===1&&f[0]?.id==="auto";return _||!f||!b||w?null:(m[11]!==f||m[12]!==h||m[13]!==b?(u=(0,i.jsx)(n.k,{models:f,selectedModel:b,onModelPicked:h,disabled:!1,type:"global",variant:"invisible",showCategories:!1,showMultipliers:!0,showPreviewModelsSeparately:!1}),m[11]=f,m[12]=h,m[13]=b,m[14]=u):u=m[14],u)}function d(e){return e.is_chat_default}l.displayName="ModelPicker"},9773(e,t,a){a.d(t,{B:()=>l});var i=a(16522),r=a(97286),n=a(78597),o=a(37186);let s={display_name:"Copilot CLI",slug:"copilot-cli",avatar_url:"",doc_url:""};function l(e){let t,a,l,d,c,u=(0,i.c)(11);u[0]!==e?(t=(0,o.lR)(e??void 0),l=r.I,a=["agent-info",e,t],u[0]=e,u[1]=t,u[2]=a,u[3]=l):(t=u[1],a=u[2],l=u[3]),u[4]!==e||u[5]!==t?(d=async()=>{if(t)return s;let a=await (0,n.Sr)(`/copilot/agent-sessions/agents/${e}`);if(!a.ok){if(a.status>=500)throw Error(`Failed to fetch agent info for agent ${e}: ${a.status}`);return null}return(await a.json()).agent_info},u[4]=e,u[5]=t,u[6]=d):d=u[6];let m=!!e;return u[7]!==a||u[8]!==d||u[9]!==m?(c={queryKey:a,queryFn:d,enabled:m,staleTime:1/0,retry:3},u[7]=a,u[8]=d,u[9]=m,u[10]=c):c=u[10],l(c)}},13292(e,t,a){a.d(t,{N:()=>n});var i=a(96540),r=a(46993);function n(){let e=(0,i.useCallback)(e=>{let t=t=>{t.key===r.Pm&&e()};return window.addEventListener("storage",t),()=>window.removeEventListener("storage",t)},[]),t=(0,i.useCallback)(()=>{try{return localStorage.getItem(r.Pm)??void 0}catch{return}},[]),a=(0,i.useCallback)(()=>void 0,[]);return[(0,i.useSyncExternalStore)(e,t,a),(0,i.useCallback)(e=>{try{void 0===e?localStorage.removeItem(r.Pm):localStorage.setItem(r.Pm,e),window.dispatchEvent(new StorageEvent("storage",{key:r.Pm,newValue:e??null,oldValue:localStorage.getItem(r.Pm)}))}catch{}},[])]}},22211(e,t,a){a.d(t,{h:()=>c});var i=a(96540),r=a(43806);let n=["(Beta)","(Preview)"],o="/images/modules/marketplace/models/families/openai-logo.svg",s=new Map([["Azure OpenAI",o],["OpenAI",o],["Anthropic","/images/modules/marketplace/models/families/anthropic.svg"],["Google","/images/modules/marketplace/models/families/gemini.svg"],["xAI","/images/modules/marketplace/models/families/xai.svg"]]),l=null,d=null;function c(){let[e,t]=(0,i.useState)(l||[]),[a,r]=(0,i.useState)(!l),[o,c]=(0,i.useState)(null);return(0,i.useEffect)(()=>{if(l){t(l),r(!1);return}if(d)return void(async()=>{try{let e=await d;t(e),r(!1)}catch(e){c(e instanceof Error?e:Error("An unexpected error occurred while loading models.")),r(!1)}})();async function e(){try{r(!0),c(null);let e=await u(),t=await e.json(),a=null!==document.querySelector('[data-color-mode="dark"]'),i=(t.data||[]).map(e=>{let t=s.get(e.vendor);return"xAI"===e.vendor&&a&&(t="/images/modules/marketplace/models/families/xai-dark.svg"),{...e,displayName:((e,t)=>{let a=e||t;for(let e of n)if(a.endsWith(e))return a.replace(e,"").trim();return a})(e.name,e.id),logoURL:t,hasLimitedCapabilities:!e.capabilities.supports.tool_calls,isThirdParty:"Azure OpenAI"!==e.vendor}});return l=i,d=null,i}catch(t){d=null;let e=t instanceof Error?t:Error("An unexpected error occurred while loading models.");throw c(e),e}finally{r(!1)}}d||(d=e()),(async()=>{try{let e=await d;t(e),r(!1)}catch(e){c(e instanceof Error?e:Error("An unexpected error occurred while loading models.")),r(!1)}})()},[]),{models:e,isLoading:a,error:o}}async function u(){return await (0,r.I)({path:"/agents/swe/models",method:"GET"})}},37186(e,t,a){function i(e){return void 0!==e&&("string"==typeof e?parseInt(e,10):e)===1693627}function r(e){return!!e&&i(e.agent_id)}function n(e){return!!e&&i(e.agentId)}function o(e){return!!e&&(e.agent_collaborators?.some(e=>i(e.agent_id))??!1)}a.d(t,{Km:()=>o,lR:()=>i,nM:()=>r,uL:()=>n})},46993(e,t,a){let i,r,n,o,s,l,d;a.d(t,{Ct:()=>g,De:()=>h,Pm:()=>M,Pq:()=>S,Q3:()=>P,SF:()=>y,T6:()=>v,Wt:()=>p,an:()=>A,in:()=>w,kF:()=>u,mh:()=>C,nX:()=>b,o9:()=>m,pr:()=>c,qB:()=>f,qY:()=>k,sk:()=>I,vA:()=>_});let c="/copilot/agents",u="task-view",m="tasks-in-chat-view",g="/issues/agent_assignments",p=e=>`/enterprises/${encodeURIComponent(e)}/ai-controls/agents/policies`,f="Provide additional instructions for Copilot",_="Pick the starting point that Copilot will use when it creates a new branch",h="Target repository",v="Base branch",y="Custom agent",b="Optional prompt",w="Select base branch",S="Provide additional instructions for the agent",I="Pick the starting point that the agent will use when it creates a new branch",k="copilot-chat-spec-task",C=["activity_panel","agents_page","agents_panel","api_call_received","repo_agents","repo_agents_sidebar"],A="sweagent-capi:",M="AGENT_TASKS_SELECTED_MODEL_v1",P=["var(--fgColor-done)","var(--fgColor-accent)","var(--fgColor-success)","var(--fgColor-attention)","var(--fgColor-severe)","var(--fgColor-danger)","var(--fgColor-sponsors)"];function E(e,t,a,i,r,n,o,s,l,d,c,u=0,m=!1){let g=new Date("2025-06-04T20:00:00.000Z"),p=new Date(g.getTime()-24*c*36e5),f=new Date(g.getTime()-24*u*36e5);return{id:e,global_relay_id:t,number:a,state:i,title:r,reviewable_state:n,url:`http://github.localhost:80/monalisa/smile/pull/${a}`,labels:o,comments:s,assignees_avatar_urls:Array.from({length:l},(t,a)=>`https://avatars.githubusercontent.com/u/${e+a}?v=4`),created_at:p.toISOString(),updated_at:f.toISOString(),merged_at:"merged"===i?f.toISOString():void 0,closed_at:"closed"===i||"merged"===i?f.toISOString():void 0,author:d,head_sha:`${r.toLowerCase().replace(/\s+/g,"")}123456789abcdef0123456789abcdef01234567`.substring(0,40),repository_nwo:"monalisa/smile",inMergeQueue:m,repository_id:1,head_ref_name:"feature-branch",base_ref_name:"main",pr_diff_summary:{lines_added:Math.floor(4*Math.random())+1,lines_changed:Math.floor(3*Math.random())+1,lines_deleted:Math.floor(2*Math.random())+1}}}function x(e,t,a,i,r,n,o,s,l=0,d=0,c,u){let m=new Date("2025-06-04T20:00:00.000Z"),g=new Date(m.getTime()-60*s*6e4),p=new Date(m.getTime()-60*l*6e4);return{id:e,name:t,user_id:a,agent_id:i,state:r,owner_id:9919,repo_id:4,resource_type:"pull",resource_id:n,resource_global_id:o,created_at:g.toISOString(),last_updated_at:p.toISOString(),updated_at:p.toISOString(),completed_at:"completed"===r||"failed"===r?p.toISOString():void 0,workflow_run_id:12340+Math.floor(30*Math.random()),log_entries:[],error:c?{message:c}:null,premium_requests:d,event_identifiers:null,event_type:"api_call_received",event_url:null,event_content:t||null,model:u??""}}function T(e,t){return{resource_type:"pull",resource_id:e.id,resource_global_id:e.global_relay_id,session_count:1,latest_session_updated_at:t.updated_at??t.last_updated_at,latest_session_state:t.state,pull:e}}i=["cancelled","idle","in_progress","waiting_for_user","completed","failed","timed_out"],r=["Refactor database queries for performance","Implement dark mode theme","Optimize API response times","Add mobile responsive design","Implement caching layer","Add internationalization support","Update documentation and README","Fix critical security vulnerability","Add user authentication system","Initial project setup and configuration","Implement real-time notifications","Add search functionality","Optimize bundle size","Add unit tests coverage","Implement error handling","Add accessibility features","Optimize database connections","Implement feature flags","Migrate to TypeScript","Implement CI/CD pipeline","Add monitoring and alerts"],n=["alice-dev","bob-backend","charlie-frontend","diana-fullstack","eve-designer","frank-security"],o=[["performance","database"],["ui","theme","enhancement"],["performance","api"],["mobile","responsive","ui"],["performance","caching","backend"],["i18n","feature","localization"]],s=["timeout","validation error","resource conflict","permission denied"],l=1,d="",[...["open","closed","merged"].flatMap(e=>i.map(t=>{d=`PR_${l}`;let a=(l-1)%r.length,i=r[a],c=n[(l-1)%n.length],u=o[a%o.length],m=T(E(l,d,l,e,i,Math.random()>.7?"draft":"ready",u,Math.floor(15*Math.random())+1,Math.floor(3*Math.random()),c,l,l),x(`session-${l.toString().padStart(3,"0")}`,`${i.split(" ").slice(0,3).join(" ")} - ${t}`,0x996718+l,1143300+l,t,l,d,l,l,Math.floor(10*Math.random()),"failed"===t?`Operation failed due to ${s[Math.floor(4*Math.random())]}`:void 0));return l++,m})),T(E(l,d,l,"open","Add feature flags support (in merge queue)","ready",["feature","flags"],5,1,"alice-dev",21,0,!0),x(`session-${l.toString().padStart(3,"0")}`,"Add feature flags support - in_progress",0x996718+l,1143300+l,"in_progress",l,d,1,0,2,void 0))]},93797(e,t,a){a.d(t,{A:()=>g,v:()=>m});var i=a(74848),r=a(16522),n=a(73537),o=a(66743),s=a(41431),l=a(96540),d=a(11515),c=a(10506),u=a(4216);function m(){let e,t,a=(0,r.c)(3),{chatQuotaRemaining:i,isLicensedLimited:o,chatQuotaExceeded:s,resetDate:d}=(0,u.xR)();a[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,n.G7)("copilot_coding_agent_free_users_exp"),a[0]=e):e=a[0];let m=e&&o;a[1]!==d?(t=()=>!!d&&c.Jt.getCodingAgentQuotaBannerDismissed(d),a[1]=d,a[2]=t):t=a[2];let[g]=(0,l.useState)(t);return m&&!s&&i<=50&&!g||m&&s}function g(e){let t,a,m,g,p,f,_,h,v,y,b=(0,r.c)(27),{onQuotaExhaustedChange:w,entrypointLocation:S}=e,{chatQuotaRemaining:I,isLicensedLimited:k,chatQuotaExceeded:C,resetDate:A}=(0,u.xR)();b[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,n.G7)("copilot_coding_agent_free_users_exp"),b[0]=t):t=b[0];let M=100-I,P=t&&k;b[1]!==S?(a=()=>{(0,o.BI)("copilot_growth.free_cca",{target:`QUOTA_UPSELL_CLICK_${S}`})},b[1]=S,b[2]=a):a=b[2];let E=a;b[3]!==A?(m=()=>!!A&&c.Jt.getCodingAgentQuotaBannerDismissed(A),b[3]=A,b[4]=m):m=b[4];let[x,T]=(0,l.useState)(m),D=P&&C;b[5]!==w||b[6]!==D?(g=()=>{w?.(D)},p=[D,w],b[5]=w,b[6]=D,b[7]=g,b[8]=p):(g=b[7],p=b[8]),(0,l.useEffect)(g,p),b[9]!==A?(f=()=>{A&&(c.Jt.setCodingAgentQuotaBannerDismissed(A),T(!0))},b[9]=A,b[10]=f):f=b[10];let O=f;if(!(P&&!C&&I<=50&&!x)&&!D)return null;b[11]!==O||b[12]!==M||b[13]!==A||b[14]!==D?(_=D?{variant:"upsell",title:"Limit reached",testId:"coding-agent-quota-exhausted-banner",message:`You have reached your free plan limit. Limit resets on ${A}.`,onDismiss:void 0}:{variant:"info",title:"Quota approaching",testId:"coding-agent-quota-approaching-banner",message:`You've used ${M}% of your free requests this month.`,onDismiss:O},b[11]=O,b[12]=M,b[13]=A,b[14]=D,b[15]=_):_=b[15];let $=_;return b[16]!==E?(h=(0,i.jsx)(s.l.PrimaryAction,{as:"a",href:d.Zs,onClick:E,children:"Upgrade To Copilot Pro"}),b[16]=E,b[17]=h):h=b[17],b[18]!==$.message||b[19]!==$.onDismiss||b[20]!==$.title||b[21]!==$.variant||b[22]!==h?(v=(0,i.jsx)(s.l,{variant:$.variant,title:$.title,hideTitle:!0,primaryAction:h,onDismiss:$.onDismiss,children:$.message}),b[18]=$.message,b[19]=$.onDismiss,b[20]=$.title,b[21]=$.variant,b[22]=h,b[23]=v):v=b[23],b[24]!==$.testId||b[25]!==v?(y=(0,i.jsx)("div",{className:"CopilotCodingAgentQuotaBanner-module__container__RqXJG","data-testid":$.testId,children:v}),b[24]=$.testId,b[25]=v,b[26]=y):y=b[26],y}g.displayName="CopilotCodingAgentQuotaBanner"}}]); //# sourceMappingURL=80022-6f492d61f4a81692-ae9231c82d349021.js.map