"use strict";(globalThis.webpackChunk_github_ui_github_ui=globalThis.webpackChunk_github_ui_github_ui||[]).push([[35843],{6873:(e,t,a)=>{a.r(t),a.d(t,{FileResultRow:()=>O,default:()=>S});var n=a(74848),r=a(31078),l=a(53552),i=a(6665),o=a(19189),s=a(78314),c=a(65787),d=a(59672),u=a(66108),m=a(39467),h=a(96459),f=a(97068),p=a(38621),y=a(45800),g=a(72511),x=a(5524),v=a(84268),w=a(31604),R=a(69726),F=a(12683),b=a(10095),_=a(91385),C=a(96540),N=a(7808),T=a(64642),j=a(76492),I=a(54030),k=a(34164);let E={excludeDirectories:!1,excludeSeeAllResults:!1};function S({actionListClassName:e,additionalResults:t,commitOid:a,config:u=E,findFileWorkerPath:p,getItemUrl:R,onRenderRow:b,onItemSelected:_,searchBoxRef:S,className:O,sx:L}){var P;let B,{excludeDirectories:D,excludeSeeAllResults:V}=u,{query:W,setQuery:G}=(0,r.JS)(),z=(0,s.t)(),M=C.useRef(null),H=S??M,[U,K]=C.useState(W.length>0),[q,Z]=C.useState(!!W),{list:X,directories:Y,loading:J,error:Q}=(0,I.o)(a,U,!!D),{path:ee}=(0,l.eu)(),{getUrl:et}=(0,o.Z)(),{queryText:ea,queryLine:en}=(B=(P=(P=W).replaceAll(" ","")).indexOf(":"))>=0?{queryText:P.substring(0,B),queryLine:parseInt(P.substring(B+1),10)}:{queryText:P,queryLine:void 0},{matches:er,clearMatches:el}=function(e,t,a,n){let[r,l]=C.useState(),o=C.useRef(""),s=C.useRef(null),{sendStats:c}=(0,i.T)(),d=C.useRef(!1),u=C.useCallback(()=>{let e=new N.z(a,T.j);e.onmessage=({data:e})=>{d.current=!1,l(e.list),o.current=e.query,e.startTime&&c("repository.find-file",{"find-file-base-count":e.baseCount,"find-file-results-count":e.list.length,"find-file-duration-ms":performance.now()-e.startTime})},s.current=e},[c,a]);return C.useEffect(()=>{if(n)return u(),function(){s.current?.terminate()}},[u,n]),C.useEffect(()=>{if(e.length&&t){d.current&&(s.current?.terminate(),u());let a=o.current&&t.startsWith(o.current);d.current=!0,s.current?.postMessage({baseList:a&&r||e,query:t,startTime:performance.now()})}},[e,t,u]),{matches:r,clearMatches:()=>l(void 0)}}((0,C.useMemo)(()=>[...X,...t??[]].sort(),[t,X]),ea,p,U),{sendRepoClickEvent:ei}=(0,i.T)(),eo=(0,h.Z)(),[es,ec]=C.useState(0),[ed,eu]=C.useState(()=>(0,j.q)()),em=C.useRef(null),eh=C.useRef(null),ef="file-results-list",{sendRepoKeyDownEvent:ep}=(0,i.T)(),{screenSize:ey}=(0,m.lm)(),eg=u.enableOverlay??ey>=m.Gy.large,ex=C.useCallback(e=>{ei("FILE_TREE.SEARCH_RESULT_CLICK"),_?.(e),Z(!1)},[ei,_]),ev=(e,t,a)=>R?R(e,t,a):et({path:e,action:t?"tree":"blob",hash:a}),{containerRef:ew}=(0,y.G)({bindKeys:f.z0.ArrowVertical|f.z0.HomeAndEnd,focusInStrategy:"previous"},[J,Q]);C.useEffect(()=>{W||Z(!1)},[W]),C.useEffect(()=>{document.activeElement!==H.current&&eg&&Z(!1)},[ee,H,eg]);let eR=er?.slice(0,40)||[],eF=er&&er.length>eR.length,eb=(0,n.jsx)("div",{className:(0,k.$)("FileResultsList-module__Box--vA4S3",{"FileResultsList-module__OverlayEnabled--TR58f":eg}),children:Q?(0,n.jsx)(g.A,{variant:"danger",className:"m-3",children:"Failed to search"}):(0,n.jsxs)(x.l,{ref:ew,className:(0,k.$)(e,"FileResultsList-module__ActionList--_Vf2k",{"FileResultsList-module__ActionList_Overlay--_kFTy":eg}),role:"listbox",children:[!J&&eR.map((e,t)=>{let a=Y.includes(e),r=ev(e,a,en?`L${en}`:"");return(0,n.jsx)($,{active:e===ee,index:t,focused:ed&&es===t,match:e,onRender:b,query:ea,onClick:ex,isDirectory:a,to:r,useOverlay:eg,listRef:ew},e)}),(0,n.jsxs)("div",{className:"m-3 text-center",children:[(0,n.jsx)(A,{loading:J||!er,visibleResultCount:eR.length,truncated:!!eF}),eF&&!V&&(0,n.jsxs)(n.Fragment,{children:["\xa0",(0,n.jsx)(v.A,{id:"see-all-results-link",className:(0,k.$)("focus-visible",{"FileResultsList-module__PrimerLink--vMxOi":ed&&es===eR.length}),ref:em,href:(0,d.Y8Y)({owner:z.ownerLogin,repo:z.name,searchTerm:`path:${ea}`}),children:"See all results"})]})]})]})});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(F.az,{ref:eh,sx:L,className:O,children:(0,n.jsx)(j.Z,{ariaActiveDescendant:(!eg&&W||eg&&q)&&ed&&es>-1?eF&&es===eR.length?"see-all-results-link":`file-result-${es}`:void 0,ariaExpanded:eg?q:void 0,ariaHasPopup:eg,ariaControls:eg?ef:void 0,ref:H,query:W,onKeyDown:e=>{let{key:t,shiftKey:a,metaKey:n,altKey:r,ctrlKey:l}=e;if(!a&&!n&&!r){if("Escape"===t)W?(ep("FILE_TREE.CANCEL_SEARCH"),G(""),el()):document.activeElement&&document.activeElement.blur();else if(!W)return;else if("Enter"===t){if(!V&&eF&&es===eR.length)eo((0,d.Y8Y)({owner:z.ownerLogin,repo:z.name,searchTerm:`path:${ea}`})),_?.();else if(eR[es]){let e=eR[es];eo(ev(eR[es],!1,en?`L${en}`:"")),Z(!1),_?.(e)}}else if("ArrowDown"===t||l&&"n"===t){if(!V&&eF&&es>=eR.length-1){if(ec(eR.length),em.current&&ew.current){let e=(0,c.U)(ew.current);(0,f.Rt)(em.current,e,{behavior:"instant"})}}else ec(Math.min(es+1,eR.length-1));e.preventDefault();return}else if("ArrowUp"===t||l&&"p"===t){ec(Math.max(es-1,0)),e.preventDefault();return}}},onPreload:()=>K(!0),onSearch:e=>{G(e),e?Z(!0):(el(),Z(!1)),ec(0)},onBlur:e=>{ew.current?.contains(e.relatedTarget)||(Z(!1),eu(!1))},onFocus:()=>{W&&Z(!0),eu(!0)},className:"FileResultsList-module__FilesSearchBox--fSAh3"})}),eg&&(0,n.jsx)(w.T,{anchorRef:eh,open:eg&&q,renderAnchor:null,onClose:()=>{Z(!1)},focusZoneSettings:{disabled:!0},focusTrapSettings:{disabled:!0},width:"xlarge",align:"end",overlayProps:{id:ef,role:"dialog"},children:eb}),!eg&&W&&eb]})}function A({visibleResultCount:e,truncated:t,loading:a}){return(0,n.jsx)("span",{role:"status",className:a||t||0===e?void 0:"sr-only","aria-label":a?"Loading":void 0,children:a?(0,n.jsx)(R.A,{size:"large"}):0===e?"No matches found":t?`First ${e} files shown.`:`Showing ${e} files.`},"results-count-status")}let O=({active:e,focused:t,index:a,match:r,query:l,to:i,isDirectory:o,onClick:s,onRender:d,useOverlay:m,listRef:h})=>{let p=(0,_.Xq)(l,r);d?.();let y=C.useRef(null);C.useEffect(()=>{if(t&&y.current&&h?.current){let e=(0,c.U)(h.current);(0,f.Rt)(y.current,e,{behavior:"instant"})}},[t,h]);let g=(0,C.useCallback)(()=>{s?.(r)},[r,s]);return(0,n.jsx)(x.l.Item,{role:"group",active:e,className:(0,k.$)(t?"FileResultsList-module__ActionList_ItemFocused--lCTMd":void 0),children:(0,n.jsxs)(u.N,{to:i,ref:y,role:"option",onClick:g,id:`file-result-${a}`,tabIndex:m?-1:0,"data-focus-visible-added":t||void 0,className:(0,k.$)("d-flex","FileResultsList-module__ActionList_Item--DMdMo"),children:[(0,n.jsx)("div",{className:"d-flex flex-1 flex-column overflow-hidden",children:(0,n.jsx)(B,{text:r,positionsList:p,LeadingIcon:o?L:P,className:"FileResultsList-module__HighlightMatch--Is2AV"})}),t&&(0,n.jsx)("div",{className:"sr-only",children:`Go to ${o?"folder":"file"}`})]})},r)},L=()=>(0,n.jsx)(b.A,{"aria-label":"Directory",icon:p.FileDirectoryFillIcon,size:"small",className:"FileResultsList-module__Octicon--LtXx2"}),P=()=>(0,n.jsx)(b.A,{"aria-label":"File",icon:p.FileIcon,className:"fgColor-muted mr-2",size:"small"}),$=C.memo(O);function B({text:e,positionsList:t,className:a,LeadingIcon:r}){let l=[],i=0;for(let a of t){if(Number(a)!==a||ae.length)continue;let t=e.slice(i,a);t&&l.push(D(t)),i=a+1,l.push((0,n.jsx)("mark",{className:"text-bold bgColor-transparent fgColor-default",children:e[a]},a))}return l.push(D(e.slice(i))),(0,n.jsx)("div",{className:a,children:(0,n.jsxs)(n.Fragment,{children:[r&&(0,n.jsx)(r,{}),l]})})}function D(e){return e.replaceAll("/","/\u200B")}try{S.displayName||(S.displayName="FileResultsList")}catch{}try{A.displayName||(A.displayName="FileResultsStatus")}catch{}try{O.displayName||(O.displayName="FileResultRow")}catch{}try{L.displayName||(L.displayName="DirectoryIcon")}catch{}try{P.displayName||(P.displayName="FileResultIcon")}catch{}try{$.displayName||($.displayName="MemoizedFileResultRow")}catch{}try{B.displayName||(B.displayName="HighlightMatch")}catch{}},8624:(e,t,a)=>{a.d(t,{L:()=>s});var n=a(74848),r=a(16522),l=a(38621),i=a(26108),o=a(34164);a(96540);let s=e=>{let t,a,s,c=(0,r.c)(17),{ref:d,expanded:u,testid:m,ariaLabel:h,ariaControls:f,onToggleExpanded:p,alignment:y,dataHotkey:g,className:x,size:v,tooltipDirection:w,variant:R}=e,F=u?`collapse-${m}`:`expand-${m}`,b=u?"left"===y?l.SidebarExpandIcon:l.SidebarCollapseIcon:"left"===y?l.SidebarCollapseIcon:l.SidebarExpandIcon;c[0]!==p?(t=e=>{p(e)},c[0]=p,c[1]=t):t=c[1];let _=R??"invisible";return c[2]!==x?(a=(0,o.$)(x,"fgColor-muted"),c[2]=x,c[3]=a):a=c[3],c[4]!==f||c[5]!==h||c[6]!==g||c[7]!==u||c[8]!==d||c[9]!==v||c[10]!==F||c[11]!==b||c[12]!==t||c[13]!==_||c[14]!==a||c[15]!==w?(s=(0,n.jsx)(i.K,{"aria-label":h,tooltipDirection:w,ref:d,"data-testid":F,"aria-expanded":u,"aria-controls":f,icon:b,"data-hotkey":g,onClick:t,variant:_,size:v,className:a}),c[4]=f,c[5]=h,c[6]=g,c[7]=u,c[8]=d,c[9]=v,c[10]=F,c[11]=b,c[12]=t,c[13]=_,c[14]=a,c[15]=w,c[16]=s):s=c[16],s};s.displayName="ExpandButton"},12748:(e,t,a)=>{a.d(t,{_:()=>r});var n=a(74848);function r({buttonFocusId:e,buttonHotkey:t,onButtonClick:a,buttonTestLabel:r,onlyAddHotkeyScopeButton:l}){return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{hidden:!0,"data-testid":r||"","data-hotkey":t,onClick:a,"data-hotkey-scope":e}),!l&&(0,n.jsx)("button",{hidden:!0,"data-hotkey":t,onClick:a})]})}try{r.displayName||(r.displayName="DuplicateOnKeydownButton")}catch{}},23451:(e,t,a)=>{a.d(t,{Z:()=>n});function n({appendQuery:e,retainScrollPosition:t,returnTarget:a}){window.dispatchEvent(new CustomEvent("blackbird_monolith_append_and_focus_input",{detail:{appendQuery:e,retainScrollPosition:t,returnTarget:a}}))}},31315:(e,t,a)=>{function n(e){return r(e)[0]}function r(e){let t=[];for(let a of function(){try{return document.cookie.split(";")}catch{return[]}}()){let[n,r]=a.trim().split("=");e===n&&void 0!==r&&t.push({key:n,value:r})}return t}function l(e,t,a=null,n=!1,r="lax"){let i=document.domain;if(null==i)throw Error("Unable to get document domain");i.endsWith(".github.com")&&(i="github.com");let o="https:"===location.protocol?"; secure":"",s=a?`; expires=${a}`:"";!1===n&&(i=`.${i}`);try{document.cookie=`${e}=${t}; path=/; domain=${i}${s}${o}; samesite=${r}`}catch{}}function i(e,t=!1){let a=document.domain;if(null==a)throw Error("Unable to get document domain");a.endsWith(".github.com")&&(a="github.com");let n=new Date(Date.now()-1).toUTCString(),r="https:"===location.protocol?"; secure":"",l=`; expires=${n}`;!1===t&&(a=`.${a}`);try{document.cookie=`${e}=''; path=/; domain=${a}${l}${r}`}catch{}}a.d(t,{OR:()=>r,Ri:()=>n,TV:()=>l,Yj:()=>i})},46209:(e,t,a)=>{a.d(t,{Ak:()=>m,cD:()=>u,iK:()=>d});var n=a(74848),r=a(41617),l=a(35898),i=a(82075),o=a(39467),s=a(96540);let c=(0,i.A)("localStorage"),d=(0,s.createContext)({openPanel:void 0,setOpenPanel:()=>void 0});function u({children:e,payload:t,openPanelRef:a}){let i="blame"in t,u=(0,r.Hf)(t),m=(0,l.i)(),h=(0,s.useRef)(void 0),[f,p]=(0,s.useState)(()=>{let e=c.getItem("codeNavOpen");if(!m&&""!==e&&null!==e||m&&t.symbolsExpanded)return"codeNav"}),y=(i||u)&&"codeNav"===f?void 0:f;s.useEffect(()=>{a.current=y},[y,a]);let g=(0,s.useCallback)((e,t)=>{p(a=>(a&&h.current&&h.current.focus(),h.current=t,i||u&&"codeNav"===e?void 0:e))},[i,u]);!function(e){let{screenSize:t}=(0,o.lm)(),a=(0,s.useRef)(t);(0,s.useEffect)(()=>{let n=a.current>=o.Gy.large,r=a.current===t;t({openPanel:y,setOpenPanel:g}),[y,g]);return(0,n.jsx)(d,{value:x,children:e})}function m(){return(0,s.use)(d)}try{d.displayName||(d.displayName="OpenPanelContext")}catch{}try{u.displayName||(u.displayName="OpenPanelProvider")}catch{}},52475:(e,t,a)=>{a.d(t,{_S:()=>l,cB:()=>o,cW:()=>i});var n=a(53627),r=a(56038);let l=()=>{let e=(0,n.JV)().appId;return e&&"rails"!==e?e:crypto.randomUUID()},i=e=>{(0,n.C3)({appId:e})},o=()=>{let e=document.querySelector("react-app")||document.querySelector("projects-v2");return e?.uuid||"rails"};r.cg?.addEventListener("hashchange",()=>{(0,n.C3)({appId:o()})},!0)},64830:(e,t,a)=>{a.d(t,{T2:()=>c,cp:()=>f,ud:()=>y});var n=a(74848),r=a(16522),l=a(82075),i=a(96540);let o=(0,l.A)("localStorage"),s="codeView.codeFolding",c="codeView.codeWrapping",d="codeView.centerView",u="codeView.openSymbolsOnClick",m=new Map([[s,"Show code folding buttons"],[c,"Wrap lines"],[d,"Center content"],[u,"Open symbols on click"]]),h=(0,i.createContext)({codeFoldingOption:{},codeWrappingOption:{},codeCenterOption:{},openSymbolsOption:{}}),f=e=>{let t,a,l=(0,r.c)(8),{children:i}=e,o=p(s,!0),m=p(c,!1),f=p(d,!1),y=p(u,!0);l[0]!==f||l[1]!==o||l[2]!==m||l[3]!==y?(t={codeFoldingOption:o,codeWrappingOption:m,codeCenterOption:f,openSymbolsOption:y},l[0]=f,l[1]=o,l[2]=m,l[3]=y,l[4]=t):t=l[4];let g=t;return l[5]!==i||l[6]!==g?(a=(0,n.jsx)(h,{value:g,children:i}),l[5]=i,l[6]=g,l[7]=a):a=l[7],a};function p(e,t){let a,n,l,s,c=(0,r.c)(11);c[0]!==e?(a=o.getItem(e),c[0]=e,c[1]=a):a=c[1];let d=a;c[2]!==t||c[3]!==d?(n=()=>d?"true"===d:t,c[2]=t,c[3]=d,c[4]=n):n=c[4];let[u,h]=(0,i.useState)(n);c[5]!==e?(l=m.get(e)||"",c[5]=e,c[6]=l):l=c[6];let f=l;return c[7]!==u||c[8]!==f||c[9]!==e?(s={name:e,enabled:u,setEnabled:h,label:f},c[7]=u,c[8]=f,c[9]=e,c[10]=s):s=c[10],s}function y(){return(0,i.use)(h)}try{h.displayName||(h.displayName="CodeViewOptionsContext")}catch{}try{f.displayName||(f.displayName="CodeViewOptionsProvider")}catch{}},76492:(e,t,a)=>{a.d(t,{Z:()=>m,q:()=>h});var n=a(74848),r=a(70170),l=a(37272),i=a(6665),o=a(56038),s=a(38621),c=a(12683),d=a(96540),u=a(34164);let m=({ref:e,ariaActiveDescendant:t,ariaControls:a,ariaExpanded:o,ariaHasPopup:m,onBlur:f,onFocus:p,onKeyDown:y,onPreload:g,onSearch:x,query:v,sx:w,className:R})=>{let{sendRepoClickEvent:F}=(0,i.T)(),[b,_]=d.useState(v),C=d.useRef((0,r.s)(e=>x(e),250));d.useEffect(()=>{_(v)},[v]);let N=v?(0,n.jsx)(c.ks.Action,{onClick:()=>{F("FILE_TREE.CANCEL_SEARCH"),x("")},icon:s.XCircleFillIcon,"aria-label":"Clear",className:"fgColor-muted"}):void 0;return(0,n.jsx)(c.ks,{autoFocus:h(),ref:e,value:b,onKeyDown:y,onChange:e=>{_(e.target.value),g(),C.current(e.target.value)},sx:w,className:(0,u.$)("d-flex",R),"aria-label":"Go to file","aria-activedescendant":t,role:m?"combobox":void 0,"aria-controls":a,"aria-expanded":o,"aria-haspopup":m?"dialog":void 0,autoCorrect:"off",spellCheck:"false",placeholder:"Go to file",leadingVisual:s.SearchIcon,trailingAction:N,trailingVisual:N?void 0:()=>(0,n.jsx)(l.E,{children:(0,n.jsx)("kbd",{children:"t"})}),onFocus:e=>{g(),e.target.select(),p?.(e)},onBlur:f,onClick:()=>F("FILE_TREE.SEARCH_BOX")})};function h(){return"1"===new URLSearchParams(o.fV.search).get("search")}m.displayName="FilesSearchBox"},82697:(e,t,a)=>{a.d(t,{Nq:()=>U,H:()=>p,c2:()=>ed,Uy:()=>K,qn:()=>ex});var n=a(74848),r=a(16522),l=a(12748),i=a(80780),o=a(8624),s=a(11529),c=a(38621),d=a(21373),u=a(34164),m=a(96540);let h=e=>{let t,a,m,h,f,p,y=(0,r.c)(32),{ref:g,expanded:x,onToggleExpanded:v,className:w,ariaControls:R,textAreaId:F,useFilesButtonBreakpoint:b,variant:_,getTooltipDirection:C}=e,N=void 0===b||b,{toggleTreeShortcut:T}=(0,i.wk)(),{isServer:j}=(0,s.V)();y[0]!==x||y[1]!==C?(t=C?.(x)??"se",y[0]=x,y[1]=C,y[2]=t):t=y[2];let I=t;y[3]!==x||y[4]!==j||y[5]!==v||y[6]!==g||y[7]!==T.hotkey||y[8]!==N||y[9]!==_?(a=N&&(!x||j)&&(0,n.jsx)(d.Q,{"aria-label":"Expand file tree",leadingVisual:c.ArrowLeftIcon,"data-hotkey":T.hotkey,"data-testid":"expand-file-tree-button-mobile",ref:g,onClick:v,variant:_??"invisible",className:"ExpandFileTreeButton-module__Button_1--g8F6Q",children:"Files"}),y[3]=x,y[4]=j,y[5]=v,y[6]=g,y[7]=T.hotkey,y[8]=N,y[9]=_,y[10]=a):a=y[10];let k=T.hotkey,E=N&&(!x||j);y[11]!==w||y[12]!==E?(m=(0,u.$)(w,"position-relative","ExpandFileTreeButton-module__expandButton--oKI1R",{"ExpandFileTreeButton-module__filesButtonBreakpoint--03FKA":E}),y[11]=w,y[12]=E,y[13]=m):m=y[13];let S=x?"Collapse file tree":"Expand file tree";return y[14]!==R||y[15]!==x||y[16]!==v||y[17]!==g||y[18]!==m||y[19]!==S||y[20]!==T.hotkey||y[21]!==I||y[22]!==_?(h=(0,n.jsx)(o.L,{dataHotkey:k,className:m,expanded:x,alignment:"left",ariaLabel:S,tooltipDirection:I,testid:"file-tree-button",ariaControls:R,ref:g,variant:_,onToggleExpanded:v}),y[14]=R,y[15]=x,y[16]=v,y[17]=g,y[18]=m,y[19]=S,y[20]=T.hotkey,y[21]=I,y[22]=_,y[23]=h):h=y[23],y[24]!==v||y[25]!==F||y[26]!==T.hotkey?(f=(0,n.jsx)(l._,{buttonFocusId:F,buttonHotkey:T.hotkey,onButtonClick:v,onlyAddHotkeyScopeButton:!0}),y[24]=v,y[25]=F,y[26]=T.hotkey,y[27]=f):f=y[27],y[28]!==a||y[29]!==h||y[30]!==f?(p=(0,n.jsxs)(n.Fragment,{children:[a,h,f]}),y[28]=a,y[29]=h,y[30]=f,y[31]=p):p=y[31],p};h.displayName="ExpandFileTreeButton";var f=a(6665);function p(e){let t,a,o=(0,r.c)(8),{inputRef:s,onFindFilesShortcut:c,textAreaId:d}=e,{sendRepoKeyDownEvent:u}=(0,f.T)(),{findFilesShortcut:m}=(0,i.wk)();return o[0]!==s||o[1]!==c||o[2]!==u?(t=()=>{c?.(),s?.current?.focus(),u("GO_TO_FILE")},o[0]=s,o[1]=c,o[2]=u,o[3]=t):t=o[3],o[4]!==m.hotkey||o[5]!==t||o[6]!==d?(a=(0,n.jsx)(l._,{buttonFocusId:d,buttonHotkey:m.hotkey,onButtonClick:t}),o[4]=m.hotkey,o[5]=t,o[6]=d,o[7]=a):a=o[7],a}try{p.displayName||(p.displayName="FindFilesShortcut")}catch{}var y=a(6873),g=a(93753),x=a(31078),v=a(46209),w=a(19189),R=a(78314),F=a(53419),b=a(59672),_=a(66108),C=a(39467),N=a(64830),T=a(97068),j=a(73783),I=a(26108),k=a(87555),E=a(79080),S=a(10095),A=a(12683),O=a(27104);let L=(0,m.createContext)({knownFolders:new Map,dispatchKnownFolders:()=>{}});try{L.displayName||(L.displayName="FileTreeContext")}catch{}var P=a(96379);async function $(e){let t=await (0,P.lS)(`${e}?noancestors=1`);if(!t.ok)throw Error(`Failed to fetch tree data: ${t.status} ${t.statusText}`);let a=await t.json();return"codeViewTreeWithPathRoute"in a.payload?{tree:{items:a.payload.codeViewTreeWithPathRoute.tree.items,totalCount:a.payload.codeViewTreeWithPathRoute.tree.totalCount}}:"codeViewTreeRoute"in a.payload?{tree:{items:a.payload.codeViewTreeRoute.tree.items,totalCount:a.payload.codeViewTreeRoute.tree.totalCount}}:{tree:{items:a.payload.tree.items,totalCount:a.payload.tree.totalCount}}}let B="ReposFileTreePane-module__HideTree--IyYTf";var D=a(53552),V=a(25556),W=a(34535),G=a(96459),z=a(60569),M=a(69726);let H=(0,m.createContext)({});function U(e){let t,a,l,i,o,s=(0,r.c)(6),{children:c}=e,d=(0,m.useRef)(!1),u=(0,m.useRef)(!1),h=(0,m.useRef)(!0);s[0]===Symbol.for("react.memo_cache_sentinel")?(t=e=>{d.current=e},s[0]=t):t=s[0];let f=t;s[1]===Symbol.for("react.memo_cache_sentinel")?(a=e=>{u.current=e},s[1]=a):a=s[1];let p=a;s[2]===Symbol.for("react.memo_cache_sentinel")?(l=e=>{h.current=e},s[2]=l):l=s[2];let y=l;s[3]===Symbol.for("react.memo_cache_sentinel")?(i={expandAllFolders:d,refreshTree:u,shouldFetchFolders:h,setExpandAllFolders:f,setRefreshTree:p,setShouldFetchFolders:y},s[3]=i):i=s[3];let g=i;return s[4]!==c?(o=(0,n.jsx)(H,{value:g,children:c}),s[4]=c,s[5]=o):o=s[5],o}function K(){return(0,m.use)(H)}try{H.displayName||(H.displayName="FileTreeControlContext")}catch{}try{U.displayName||(U.displayName="FileTreeControlProvider")}catch{}var q=a(52870);function Z(e,t,a){let n=[];for(let r of t)if(r.startsWith(e)){let t=r.slice(e.length+1),l=t.indexOf("/"),i=l>0?t.slice(0,l):t,o=`${e}/${i}`;if(a&&a.some(e=>e.path===o))continue;let s={items:[],data:{contentType:o===r?"file":"directory",name:i,path:o,isClientOnly:!0}};n.push(s)}return n}function X(e,t,a){e.data.name=e.data.name.slice(e.data.name.lastIndexOf("/")+1,e.data.name.length);let n=t.name.slice(0,t.name.lastIndexOf("/")),r=n.indexOf("/")>-1,l={path:t.path.slice(0,t.path.lastIndexOf("/")),contentType:t.contentType,name:n,hasSimplifiedPath:r},i={items:[e],data:l};return(a.set(l.path,i),r)?X(i,{...l},a):i}function Y(e,t,a,n){if(!e)return{newRootItems:a,rootItemsUpdated:!1};let r=!!e[""]&&J("",t,a,e[""].items);for(let r of(n?.(a),Object.keys(e).sort()))if(r){let a=t.get(r);a&&(J(r,t,a.items,e[r].items,n),a.data.totalCount=e[r].totalCount)}return{newRootItems:a,rootItemsUpdated:r}}function J(e,t,a,n,r){let l=!1;for(let i of n){let n=e?`${e}/${i.name}`:i.name;if(!t.get(n)){let e={items:[],data:{...i}};if(t.set(n,e),i.hasSimplifiedPath){let n=X(e,i,t),o=a.findIndex(e=>e.data.path===n.data.path);-1!==o?n.items.length>a[o].items.length&&(a[o]=n,l=!0):(a.push(n),r?.(a))}else a.push(e),r?.(a)}}return l}function Q(e){let t,a,l,i,o,s,d,u,h,p,y,g,x=(0,r.c)(43),{isActive:v,file:w,onItemSelected:R,getItemUrl:F,selectedItemRef:b,navigate:_,onRenderRow:C,getFileTrailingVisual:N,getFileIcon:T}=e,{sendRepoClickEvent:j}=(0,f.T)(),I=m.useRef(null);x[0]===Symbol.for("react.memo_cache_sentinel")?(t={focusRowRef:I,mouseRowRef:I},x[0]=t):t=x[0];let k=(0,W.Z)(t),E="submodule"===w.data.contentType;x[1]!==w.data||x[2]!==N?(a=N?.(w.data),x[1]=w.data,x[2]=N,x[3]=a):a=x[3];let S=a;x[4]!==w.data||x[5]!==F||x[6]!==v||x[7]!==E||x[8]!==_||x[9]!==R||x[10]!==j?(l=e=>{E?(e.preventDefault(),w.data.submoduleUrl&&(window.location.href=w.data.submoduleUrl)):e.metaKey||e.ctrlKey||1===e.button?(window.open(F(w.data),"_blank"),e.preventDefault()):v?e.preventDefault():(R?.(),j("FILES_TREE.ITEM",{item_path:w.data.path}),_(F(w.data)),e.stopPropagation())},x[4]=w.data,x[5]=F,x[6]=v,x[7]=E,x[8]=_,x[9]=R,x[10]=j,x[11]=l):l=x[11];let A=l;C?.();let O=`${w.data.path}-item`,L=v?void 0:"auto 2rem";x[12]!==w.data||x[13]!==T||x[14]!==E?(i=T?T(w.data):E?(0,n.jsx)(c.FileSubmoduleIcon,{}):(0,n.jsx)(c.FileIcon,{}),x[12]=w.data,x[13]=T,x[14]=E,x[15]=i):i=x[15],x[16]!==i?(o=(0,n.jsx)(z.G.LeadingVisual,{children:i}),x[16]=i,x[17]=o):o=x[17];let P=E?"var(--fgColor-accent, var(--color-accent-fg))":void 0;return x[18]!==P?(s={color:P},x[18]=P,x[19]=s):s=x[19],x[20]!==w.data.name||x[21]!==b||x[22]!==s?(d=(0,n.jsx)("span",{ref:b,style:s,children:w.data.name}),x[20]=w.data.name,x[21]=b,x[22]=s,x[23]=d):d=x[23],x[24]!==w.data.name||x[25]!==k?(u=k&&(0,n.jsx)(V.m,{"data-testid":`${w.data.name}-item-tooltip`,id:`${w.data.name}-item-tooltip`,contentRef:I,"aria-label":w.data.name,open:!0,direction:"ne"}),x[24]=w.data.name,x[25]=k,x[26]=u):u=x[26],x[27]!==d||x[28]!==u?(h=(0,n.jsxs)(n.Fragment,{children:[d,u]}),x[27]=d,x[28]=u,x[29]=h):h=x[29],x[30]!==S?(p=!!S?.screenReaderText&&(0,n.jsx)("span",{className:"sr-only",children:S.screenReaderText}),x[30]=S,x[31]=p):p=x[31],x[32]!==S?(y=!!S?.trailingVisual&&(0,n.jsx)(z.G.TrailingVisual,{children:S.trailingVisual}),x[32]=S,x[33]=y):y=x[33],x[34]!==v||x[35]!==A||x[36]!==h||x[37]!==p||x[38]!==y||x[39]!==O||x[40]!==L||x[41]!==o?(g=(0,n.jsxs)(z.G.Item,{ref:I,onSelect:A,current:v,id:O,containIntrinsicSize:L,children:[o,h,p,y]}),x[34]=v,x[35]=A,x[36]=h,x[37]=p,x[38]=y,x[39]=O,x[40]=L,x[41]=o,x[42]=g):g=x[42],g}let ee=m.memo(Q);function et({clientOnlyFilePaths:e,directory:t,isActive:a,isAncestorOfActive:r,leadingPath:l="",onItemSelected:i,dispatchKnownFolders:o,getItemUrl:s,getFetchUrl:c,selectedItemRef:d,navigate:u,onRenderRow:h,getFileTrailingVisual:p,getFileIcon:y,navigateOnClick:g=!0}){let{expandAllFolders:x,shouldFetchFolders:v}=K(),[w,R]=(0,m.useState)(x?.current||r),{sendRepoClickEvent:F}=(0,f.T)(),b=m.useRef(null),_=m.useRef(null),C=(0,W.Z)({focusRowRef:_,mouseRowRef:b}),[N,T,j,I,k,E,S]=function(e,t,a){let[n,r]=m.useState(e.items),[l,i]=m.useState(e.data.totalCount||0),[o,s]=m.useState(!1),[c,d]=m.useState(!1),{safeSetTimeout:u}=(0,q.A)();m.useEffect(()=>{r(e.items)},[e.items]),m.useEffect(()=>{void 0!==e.data.totalCount&&i(e.data.totalCount)},[e.data.totalCount]);let h=m.useCallback(()=>{d(!1)},[]),f=m.useCallback((e,t)=>{let a=e||[...n];r(a.slice(0,100)),u(()=>{r(a),void 0!==t&&i(t)},1)},[n,u]);return[m.useCallback(async n=>{let l=new Map;if(e.data.isClientOnly){if(n){let a=Z(e.data.path,n);for(let e of a)l.set(e.data.path,e);t({type:"add",folders:l,processingTime:0}),a.length>100?f(a,a.length):(r(a),i(a.length))}}else{let o=a(e.data);d(!1),s(!0);let c=Date.now();try{let a=await $(o),s=a.tree.items.map(e=>{let t={items:[],data:{...e},autoExpand:"directory"===e.contentType&&1===a.tree.items.length};return(l.set(e.path,t),e.hasSimplifiedPath)?X(t,e,l):t});if(n){let t=e.data.path,r=Z(t,n,a.tree.items);for(let e of(s.push(...r),r))l.set(e.data.path,e)}t({type:"add",folders:l,processingTime:Date.now()-c}),e.items=s,e.data.totalCount=a.tree.totalCount,s.length>100?f(s,a.tree.totalCount):(r(s),i(a.tree.totalCount))}catch{d(!0)}}s(!1)},[a,e,t,f]),f,n,o,c,h,l]}(t,o,c),A=S-j.length,O=l?`${l}/`:"";(0,m.useEffect)(()=>{x?.current&&!w&&R(!0)},[t,x,w]);let L=m.useCallback(n=>{x?.current&&(x.current=!1),n&&!w&&!I&&!k&&(t.items.length>100?T():0!==t.items.length||a||r||v?.current===!1||N(e)),n!==w&&R(n)},[x,w,I,k,t.items.length,a,r,v,T,N,e]),P=m.useCallback(e=>{e.metaKey||e.ctrlKey||1===e.button&&g?(window.open(s(t.data),"_blank"),e.preventDefault()):a?e.preventDefault():(i?.(),F("FILES_TREE.ITEM",{item_path:t.data.path}),g?u(s(t.data)):L?.(!w),e.stopPropagation())},[t.data,s,a,w,u,g,i,L,F]);m.useEffect(()=>{r&&!w&&L?.(!0)},[r]),m.useEffect(()=>{0===t.items.length&&w?L?.(!1):!w&&t.autoExpand&&L?.(!0)},[t.items.length]);let B=m.useCallback(e=>{d&&a&&d(e),b.current=e},[d,a]);return 1===t.items.length&&"directory"===t.items[0].data.contentType?(0,n.jsx)(er,{clientOnlyFilePaths:e,directoryItems:t.items,leadingPath:O+t.data.name,inheritsActive:a,dispatchKnownFolders:o,onItemSelected:i,selectedItemRef:d,getItemUrl:s,directoryNavigateOnClick:g,getFileTrailingVisual:p,getFileIcon:y}):(h?.(),(0,n.jsxs)(z.G.Item,{ref:_,expanded:w,onExpandedChange:L,current:a,onSelect:P,id:`${t.data.path}-item`,containIntrinsicSize:a?void 0:"auto 2rem",children:[(0,n.jsx)(z.G.LeadingVisual,{children:(0,n.jsx)(z.G.DirectoryIcon,{})}),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("span",{ref:B,children:[O,t.data.name]}),C&&(0,n.jsx)(V.m,{"data-testid":`${t.data.name}-directory-item-tooltip`,id:`${t.data.name}-directory-item-tooltip`,contentRef:_,"aria-label":`${O}${t.data.name}`,open:!0,direction:"ne"})]}),(0,n.jsx)(z.G.SubTree,{state:I?"loading":k?"error":"done",children:k?(0,n.jsx)(z.G.ErrorDialog,{onRetry:N,onDismiss:E,children:"There was an error loading the folder contents."}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(er,{clientOnlyFilePaths:e,directoryItems:j,dispatchKnownFolders:o,onItemSelected:i,selectedItemRef:d,getItemUrl:s,directoryNavigateOnClick:g,getFileTrailingVisual:p,getFileIcon:y}),A>0&&(0,n.jsx)(ei,{message:`${A} entries not shown`})]})})]}))}let ea=m.memo(et);function en({clientOnlyFilePaths:e,directoryItems:t,leadingPath:a,inheritsActive:r,onItemSelected:l,dispatchKnownFolders:i,selectedItemRef:o,onRenderRow:s,getItemUrl:c,getFileTrailingVisual:d,getFileIcon:u,directoryNavigateOnClick:h=!0}){let{path:f}=(0,D.eu)(),p=(0,w.Z)(),y=(0,G.Z)(),g=m.useRef(y);return(0,n.jsx)(n.Fragment,{children:t.map(t=>{let m=f===t.data.path,y=m||f.startsWith(`${t.data.path}/`);return"directory"===t.data.contentType?(0,n.jsx)(ea,{clientOnlyFilePaths:e,isActive:r||m,isAncestorOfActive:y,onItemSelected:l,leadingPath:a,directory:t,dispatchKnownFolders:i,getItemUrl:c,getFetchUrl:p.getItemUrl,selectedItemRef:y?o:void 0,navigate:g.current,onRenderRow:s,navigateOnClick:h,getFileTrailingVisual:d,getFileIcon:u,itemCount:t.items.length},t.data.name):(0,n.jsx)(ee,{onItemSelected:l,file:t,isActive:m,getItemUrl:c,selectedItemRef:m?o:void 0,navigate:g.current,onRenderRow:s,getFileTrailingVisual:d,getFileIcon:u},t.data.name)})})}let er=m.memo(en);function el(e){let{clientOnlyFilePaths:t,data:a,rootItems:r,setRootItems:l,fetchError:i,incompleteFileTree:o,processingTime:s,loading:c,onRenderRow:d,getItemUrl:h,getFileTrailingVisual:f,getFileIcon:p,sortDirectoryItems:y}=e,{knownFolders:g,dispatchKnownFolders:x}=(0,m.use)(L),{refreshTree:v}=K();m.useEffect(()=>{if(c)return;let e=new Map,t=[];v?.current||(e=new Map(g),t=r.slice());let{newRootItems:n,rootItemsUpdated:i}=Y(a,e,t,y);(n.length>r.length||i||v?.current)&&l(n),(e.size>g.size||v?.current)&&x({type:"set",folders:e,processingTime:s}),v?.current&&(v.current=!1)},[a,c]);let w=m.useCallback(e=>{1===e.button&&e.preventDefault()},[]);return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)("div",{onMouseDown:w,className:(0,u.$)(e.className,"ReposFileTreeView-module__Box--bDodO"),"data-testid":"repos-file-tree-container",children:c?(0,n.jsx)("div",{className:"ReposFileTreeView-module__Box_1--Q_A5H",children:(0,n.jsx)(M.A,{"aria-label":"Loading file tree"})}):(0,n.jsx)("nav",{"aria-label":"File Tree Navigation",children:(0,n.jsxs)(z.G,{"aria-label":"Files",children:[i&&(0,n.jsx)(ei,{message:"Some files could not be loaded."}),o&&(0,n.jsx)(ei,{message:"Sign in to see the full file tree."}),(0,n.jsx)(er,{clientOnlyFilePaths:t,directoryItems:r,onItemSelected:e.onItemSelected,dispatchKnownFolders:x,selectedItemRef:e.selectedItemRef,onRenderRow:d,directoryNavigateOnClick:e.directoryNavigateOnClick,getItemUrl:h,getFileTrailingVisual:f,getFileIcon:p})]})})})})}function ei(e){let t,a,l=(0,r.c)(3),{message:i}=e,o=i||"Couldn't load.";return l[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,n.jsx)(z.G.LeadingVisual,{children:(0,n.jsx)(S.A,{icon:c.AlertFillIcon,className:"ReposFileTreeView-module__Octicon--XcIsb"})}),l[0]=t):t=l[0],l[1]!==o?(a=(0,n.jsxs)(z.G.Item,{id:"error-tree-row",children:[t,(0,n.jsx)("div",{className:"ReposFileTreeView-module__Box_2--bCLXn",children:o})]}),l[1]=o,l[2]=a):a=l[2],a}try{Q.displayName||(Q.displayName="WrappedFileTreeRow")}catch{}try{ee.displayName||(ee.displayName="FileTreeRow")}catch{}try{et.displayName||(et.displayName="WrappedDirectoryTreeRow")}catch{}try{ea.displayName||(ea.displayName="DirectoryTreeRow")}catch{}try{en.displayName||(en.displayName="WrappedDirectoryContents")}catch{}try{er.displayName||(er.displayName="DirectoryContents")}catch{}try{el.displayName||(el.displayName="ReposFileTreeView")}catch{}try{ei.displayName||(ei.displayName="ErrorTreeRow")}catch{}var eo=a(23451);function es(e){let t,a,o,s,d,u=(0,r.c)(16),{sx:m,onClick:h,textAreaId:f}=e,{searchShortcut:p}=(0,i.wk)();return u[0]!==h?(t=e=>{h?.(),(0,eo.Z)({retainScrollPosition:!0,returnTarget:e.target.closest("button")})},u[0]=h,u[1]=t):t=u[1],u[2]!==p.hotkey||u[3]!==m||u[4]!==t?(a=(0,n.jsx)(A.K0,{"aria-label":"Search this repository",tooltipDirection:"nw",icon:c.SearchIcon,"data-hotkey":p.hotkey,sx:m,size:"medium",onClick:t,className:"SearchButton-module__IconButton--kxA3Q"}),u[2]=p.hotkey,u[3]=m,u[4]=t,u[5]=a):a=u[5],u[6]!==h||u[7]!==f?(o=()=>{let e=document.getElementById(f);h?.(),(0,eo.Z)({retainScrollPosition:!0,returnTarget:e??void 0})},u[6]=h,u[7]=f,u[8]=o):o=u[8],u[9]!==p.hotkey||u[10]!==o||u[11]!==f?(s=(0,n.jsx)(l._,{buttonFocusId:f,buttonHotkey:p.hotkey,onButtonClick:o,onlyAddHotkeyScopeButton:!0}),u[9]=p.hotkey,u[10]=o,u[11]=f,u[12]=s):s=u[12],u[13]!==a||u[14]!==s?(d=(0,n.jsxs)(n.Fragment,{children:[a,s]}),u[13]=a,u[14]=s,u[15]=d):d=u[15],d}try{es.displayName||(es.displayName="SearchButton")}catch{}let ec=C.Gy.xxxlarge;function ed({clientOnlyFilePaths:e,collapseTree:t,showTree:a,fileTree:r,treeToggleElement:l,treeToggleRef:i,onItemSelected:o,processingTime:d,searchBoxRef:h,repo:f,path:F,refInfo:P,isFilePath:D,foldersToFetch:V,incompleteFileTree:W,id:G,onFindFilesShortcut:z,textAreaId:M,getItemUrlOverride:H,headerClassName:U,paneClassName:K,paneContentsClassName:q,treeContainerClassName:Z,findFileWorkerPath:X,headerContent:J,getFileTrailingVisual:Q,getFileIcon:ee,sortDirectoryItems:et,showFindFile:ea=!0,directoryNavigateOnClick:en=!0,showRefSelectorRow:er=!0,paneResizable:ei=!0}){if(ea&&void 0===X)throw Error("findFileWorkerPath must be provided when showFindFile is true");let{openPanel:eo}=(0,v.Ak)(),[ed,eh]=m.useState(V.length>0),[ef,ep]=m.useState(!1),ey=m.useRef([]),eg=m.useRef(null),ex=m.useRef(!1),ev=m.useRef(!1),ew=m.useRef(null),{query:eR}=(0,x.JS)(),eF=m.useRef(eR);eF.current=eR;let{codeCenterOption:eb}=(0,N.ud)(),e_=m.useRef(eo),{isServer:eC}=(0,s.V)(),{getItemUrl:eN}=(0,w.Z)(),eT=H||eN,{defaultBranch:ej}=(0,R.t)(),eI=[],ek=new Map,eE=m.useRef(ed);!eE.current&&r&&(eI=Y(r,ek,[],et).newRootItems),eE.current=!0;let[eS,eA]=m.useReducer(eu,ek),[eO,eL]=m.useState(eI);m.useEffect(()=>{a&&(!eR||window.innerWidth>=C.Gy.large)||(ew.current=null)},[a,eR]),m.useEffect(()=>{eo&&e_.current!==eo&&window.innerWidth{let t=eN({contentType:"directory",path:e,name:e});try{let a=await $(t),n={items:a.tree.items,totalCount:a.tree.totalCount};r[e]=n}catch{ep(!0)}ey.current.push(e),ey.current.length===V.length&&eh(!1)},[r,V.length,eN]);m.useEffect(()=>{if(W)eh(!1);else if(V&&!ex.current)for(let e of V)eP(e);ex.current=!0},[eP,V,W,eS.size]);let e$=m.useCallback(e=>{a&&(!eF.current||window.innerWidth>=C.Gy.large)&&eg.current&&e&&(0,T.Rt)(e,eg.current,{endMargin:window.innerHeight/2,startMargin:window.innerHeight/2,behavior:"auto"})},[a]),eB=m.useCallback(e=>{e&&ev.current?ev.current=!1:ew.current!==e&&e$(e),ew.current=e},[e$]),eD=m.useCallback(e=>{eg.current=e,window.innerWidth>=ec&&e$(ew.current)},[e$]),eV=m.useCallback(e=>{e&&e$(ew.current)},[e$]),{screenSize:eW}=(0,C.lm)(),eG=!eC&&(eo&&eW=C.Gy.large,ez=m.useCallback(()=>{eG||o(),ev.current=!0},[o,eG]),eM=D?F.substring(0,F.lastIndexOf("/")):F,eH=(0,m.useMemo)(()=>({knownFolders:eS,dispatchKnownFolders:eA}),[eS]),eU=m.useMemo(()=>eC?null:(0,O.KF)(),[eC]),eK=m.useCallback(()=>{window.innerWidth>C.Gy.large&&window.innerWidth0;return(0,F.BI)("file-tree",{"fetch-count":a?t.folders.size-e.size:t.folders.size,"file-count":t.folders.size,"nav-type":a?"soft":"hard","processing-time":t.processingTime}),t.folders}case"add":{let a=new Map([...e,...t.folders]);return(0,F.BI)("file-tree",{"fetch-count":t.folders.size,"file-count":a.size,"nav-type":"fetch","processing-time":t.processingTime}),a}default:throw Error(`Unknown action type: ${t.type}`)}}function em({scrollingRef:e}){let[t,a]=m.useState(e.current&&e.current.scrollTop>0);return m.useEffect(()=>{if(e.current){let t=e.current,n=()=>{t&&t.scrollTop>0?a(!0):a(!1)};return t.addEventListener("scroll",n),()=>{t.removeEventListener("scroll",n)}}},[e]),t?(0,n.jsx)("div",{className:"ReposFileTreePane-module__Box_8--KVzCi"}):null}try{ed.displayName||(ed.displayName="ReposFileTreePane")}catch{}try{em.displayName||(em.displayName="TreeBorder")}catch{}var eh=a(76492),ef=a(31315),ep=a(35898),ey=a(56038),eg=a(81960);function ex(e,t,a,r,l,i="fileTreeExpanded",o){let{sendRepoClickEvent:s}=(0,f.T)(),c=(0,ep.i)(),d=i?(0,ef.Ri)(i):void 0,u=void 0===ey.XC,p=!c&&d&&"false"!==d.value||c&&a;void 0===p&&(p=!1);let y=(0,m.useRef)(null),g=(0,m.useRef)(null),{screenSize:x}=(0,C.lm)(),[v,w]=(0,m.useState)(p),R=(0,m.useRef)(p),F=(0,m.useRef)(!1),b=(0,m.useRef)(!1),_=(0,m.useCallback)(()=>!(t.current&&window.innerWidth>=ec||!t.current&&window.innerWidth>=C.Gy.xlarge),[t]);(0,m.useLayoutEffect)(()=>{let e=_();e||(F.current=!1),w((0,eh.q)()&&x{let e=!t.current&&window.innerWidth=C.Gy.xlarge;e&&R.current&&!(0,eh.q)()&&v&&w(!1),a&&R.current&&!v&&w(!0)},[t,x]),(0,m.useLayoutEffect)(()=>{let e=t.current&&window.innerWidth=ec;e&&R.current&&!(0,eh.q)()&&v&&w(!1),a&&R.current&&!v&&w(!0)},[t]);let N=(0,m.useCallback)(e=>{if(w(!0),_()&&(F.current=!0),e?.setPreference&&(l?.(!0),R.current=!0,i)){let e=new Date(Date.now()+2592e6).toUTCString();(0,ef.TV)(i,"true",e)}e?.focus==="toggleButton"?requestAnimationFrame(()=>y.current?.focus()):e?.focus==="search"&&requestAnimationFrame(()=>g.current?.focus())},[i,2592e6,_,l]),T=(0,m.useCallback)(e=>{if(w(!1),F.current=!1,b.current=!0,e?.setPreference&&(l?.(!1),R.current=!1,i)){let e=new Date(Date.now()+2592e6).toUTCString();(0,ef.TV)(i,"false",e)}e?.focus==="toggleButton"&&requestAnimationFrame(()=>y.current?.focus())},[i,2592e6,l]),j=(0,m.useCallback)(e=>e&&window.innerWidth>=ec||!t.current&&window.innerWidth>=C.Gy.xlarge,[t]),I=(0,m.useMemo)(()=>(0,n.jsx)(eg.A,{as:"h2",className:"use-tree-pane-module__Heading--iI_ad",children:(0,n.jsx)(h,{expanded:v,ariaControls:e,onToggleExpanded:()=>{s(v?"FILES_TREE.HIDE":"FILES_TREE.SHOW"),v?T({focus:"toggleButton",setPreference:j(t.current)}):N({focus:"toggleButton",setPreference:j(t.current)})},className:void 0!==d||v||u?void 0:"react-tree-toggle-button-with-indicator",ref:y,textAreaId:r,...o})}),[v,e,d,u,r,o,s,T,j,t,N]);return{isTreeExpanded:v,expandTree:N,collapseTree:T,treeToggleElement:I,treeToggleRef:y,searchBoxRef:g}}}}]); //# sourceMappingURL=35843-e07429cf2dec.js.map