performance.mark("js-parse-end:3809-7e5958894ff9f6fb.js"); "use strict";(globalThis.webpackChunk_github_ui_github_ui=globalThis.webpackChunk_github_ui_github_ui||[]).push([["3809"],{81338(e,t,n){n.d(t,{R:()=>o});var r=n(16522);function o(e,t,n){let o,l,a,i,s=(0,r.c)(19);e:{let r,l,a;if(void 0===t||void 0===n||!e){let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={publicCodeReferences:[],codeVulnerabilities:[]},s[0]=e):e=s[0],o=e;break e}let{PublicCodeReference:i,CodeVulnerability:c}=e;s[1]!==i||s[2]!==n||s[3]!==t?(r=i?.filter(e=>e.startOffset>=t&&e.endOffset<=n),s[1]=i,s[2]=n,s[3]=t,s[4]=r):r=s[4],s[5]!==c||s[6]!==n||s[7]!==t?(l=c?.filter(e=>e.startOffset>=t&&e.endOffset<=n),s[5]=c,s[6]=n,s[7]=t,s[8]=l):l=s[8],s[9]!==r||s[10]!==l?(a={publicCodeReferences:r,codeVulnerabilities:l},s[9]=r,s[10]=l,s[11]=a):a=s[11],o=a}let{publicCodeReferences:c,codeVulnerabilities:d}=o;s[12]!==c?(l=void 0===c?[]:c,s[12]=c,s[13]=l):l=s[13];let u=l;s[14]!==d?(a=void 0===d?[]:d,s[14]=d,s[15]=a):a=s[15];let m=a;return s[16]!==m||s[17]!==u?(i={publicCodeReferences:u,codeVulnerabilities:m},s[16]=m,s[17]=u,s[18]=i):i=s[18],i}},57976(e,t,n){n.d(t,{To:()=>X,sX:()=>Z});var r=n(74848),o=n(16522),l=n(96540),a=n(68432),i=n(45360),s=n(39869),c=n(31362);let d=(0,l.createContext)({});d.displayName="ExtensionContext";var u=n(34164),m=n(66743),p=n(81338),h=n(26108),f=n(38621),_=n(88275);let g=()=>{let e,t=(0,o.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 16 16","aria-hidden":"true",children:(0,r.jsx)("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M1 13h3M1 8h14M1 3h14"})}),t[0]=e):e=t[0],e};g.displayName="UnwrapIcon";let v=()=>{let e,t=(0,o.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 16 16","aria-hidden":"true",children:[(0,r.jsx)("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M1 13h3M1 3h14"}),(0,r.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M1 7.25a.75.75 0 0 0 0 1.5h11.5a1.75 1.75 0 1 1 0 3.5H9.536v-.464a.679.679 0 0 0-1.086-.543l-1.619 1.214a.68.68 0 0 0 0 1.086l1.619 1.214a.679.679 0 0 0 1.086-.543v-.464H12.5a3.25 3.25 0 0 0 0-6.5z",clipRule:"evenodd"})]}),t[0]=e):e=t[0],e};function x(e){let t,n,a,x,y,b,C,j,k,w,N,R,$,B,L,S=(0,o.c)(50),{language:E,children:A,code:M,startOffset:T,endOffset:I}=e;S[0]!==E?(t=(0,s.vL)(E),S[0]=E,S[1]=t):t=S[1];let{color:O,name:D}=t,P=(0,l.useId)(),{copilotAnnotations:W,chatMode:H,wrapCodeLines:V,onWrapCodeLinesChange:z}=(0,l.use)(d),[F,K]=(0,l.useState)(!1),{publicCodeReferences:U,codeVulnerabilities:Y}=(0,p.R)(W,T,I);S[2]!==H||S[3]!==z||S[4]!==V?(n=()=>{z?.(!V),(0,m.BI)("dotcom_chat.activate",{target:V?"CODE_BLOCK_UNWRAP":"CODE_BLOCK_WRAP",mode:H})},S[2]=H,S[3]=z,S[4]=V,S[5]=n):n=S[5];let J=n,q="immersive"===H,Z="assistive"===H;S[6]!==q||S[7]!==Z?(a=(0,u.$)("CodeBlock-module__container___ry3V",{"CodeBlock-module__immersive__Gmg6o":q,"CodeBlock-module__assistive__UAWB2":Z}),S[6]=q,S[7]=Z,S[8]=a):a=S[8],S[9]!==O?(x=(0,r.jsx)(c.q,{color:O}),S[9]=O,S[10]=x):x=S[10];let G=D||"Code";S[11]!==P||S[12]!==G?(y=(0,r.jsx)("span",{id:P,className:"CodeBlock-module__languageName__iQIeg",children:G}),S[11]=P,S[12]=G,S[13]=y):y=S[13],S[14]!==z||S[15]!==J||S[16]!==V?(b=z&&(0,r.jsx)(h.K,{variant:"invisible",icon:V?g:v,"aria-label":V?"Unwrap":"Wrap",onClick:J}),S[14]=z,S[15]=J,S[16]=V,S[17]=b):b=S[17],S[18]!==H||S[19]!==Y||S[20]!==U.length?(C=(U.length>0||Y.length>0)&&(0,r.jsx)(h.K,{variant:"invisible",icon:f.ShieldIcon,"aria-label":"Code insights",onClick:()=>{K(!0),(0,m.BI)("dotcom_chat.activate",{target:"CODE_BLOCK_SHIELD",mode:H})}}),S[18]=H,S[19]=Y,S[20]=U.length,S[21]=C):C=S[21],S[22]!==C||S[23]!==x||S[24]!==y||S[25]!==b?(j=(0,r.jsxs)("div",{className:"CodeBlock-module__header__tJzrz",children:[x,y,b,C]}),S[22]=C,S[23]=x,S[24]=y,S[25]=b,S[26]=j):j=S[26],S[27]!==H?(k=()=>{(0,m.BI)("dotcom_chat.activate",{target:"CODE_BLOCK_COPY",mode:H})},S[27]=H,S[28]=k):k=S[28],S[29]!==M||S[30]!==k?(w=(0,r.jsx)("div",{className:"CodeBlock-module__copyContainer__eNjNy",children:(0,r.jsx)("div",{className:"CodeBlock-module__copyContent__qV51h",children:(0,r.jsx)(i.T,{textToCopy:M,ariaLabel:"Copy code",className:"CodeBlock-module__copyButton__buwCD",onCopy:k})})}),S[29]=M,S[30]=k,S[31]=w):w=S[31];let X=V&&"CodeBlock-module__codeWrap__NkP9E";return S[32]!==X?(N=(0,u.$)(X),S[32]=X,S[33]=N):N=S[33],S[34]!==A||S[35]!==N?(R=(0,r.jsx)("div",{className:"CodeBlock-module__codeContainer___2Otq",children:(0,r.jsx)("pre",{className:"CodeBlock-module__code__N23o9",tabIndex:0,children:(0,r.jsx)("code",{className:N,children:A})})}),S[34]=A,S[35]=N,S[36]=R):R=S[36],S[37]!==P||S[38]!==j||S[39]!==w||S[40]!==R||S[41]!==a?($=(0,r.jsxs)("figure",{className:a,"aria-labelledby":P,children:[j,w,R]}),S[37]=P,S[38]=j,S[39]=w,S[40]=R,S[41]=a,S[42]=$):$=S[42],S[43]!==Y||S[44]!==F||S[45]!==U?(B=F&&(0,r.jsx)(_.t,{publicCodeReferences:U,codeVulnerabilities:Y,onClose:()=>K(!1)}),S[43]=Y,S[44]=F,S[45]=U,S[46]=B):B=S[46],S[47]!==$||S[48]!==B?(L=(0,r.jsxs)(r.Fragment,{children:[$,B]}),S[47]=$,S[48]=B,S[49]=L):L=S[49],L}v.displayName="WrapIcon",x.displayName="CodeBlock";var y=n(47970);let b="data-codeblock-props",C=(0,a.F)(b),j={code:(e,t)=>{let n=(0,a.k)(e,b);return n?(0,r.jsx)(x,{...n,children:e.children}):t}};var k=n(15514),w=n(82834);let N=["raw.githubusercontent.com/","private-user-images.githubusercontent.com/","avatars.githubusercontent.com/","gist.github.com/assets/","github.com/user-attachments/assets/","github.localhost/user-attachments/assets/"],R=(e,t)=>(0,y.YR)(e,(e,n,r)=>{if("element"===e.type&&"img"===e.tagName&&"src"in e.properties){let o,l=e.properties.src;try{o=new URL(l,window.location.origin)}catch{}let a=o?o.hostname+o.pathname:"";if(!o||!N.some(e=>a.startsWith(e))){let o=(0,k.s)(t,e)??"";if(r&&"number"==typeof n)return r.children[n]={type:"element",tagName:"span",properties:{},children:[{type:"text",value:o}]},[w._Z,n]}}}),$=[{open:/(?:^|\\n)\$\$/,close:/\$\$/}],B=[{open:/\$`/,close:/`\$/},{open:/\$\$(?! )/,close:/(?(0,l.createElement)("math-renderer",{...r,class:n},t)},T=e=>(0,y.YR)(e,e=>{"element"===e.type&&!("a"===e.tagName&&"href"in e.properties&&e.properties.href.startsWith("#"))&&(("a"===e.tagName||"target"in e.properties)&&(e.properties.target="_blank",e.properties.rel="noopener noreferrer"),!("target"in e.properties)&&("xlink:href"in e.properties||"href"in e.properties)&&(e.properties["xlink:show"]="new"))});var I=n(98379),O=n(91905),D=n(90860),P=n(9781),W=n(83865),H=n(43623);let V=Symbol("renderFallthrough"),z=e=>Object.entries(e);function F(e){let t={};for(let n of e)for(let[e,r]of z(n))if(r){let n=t[e];t[e]=t=>{let o=r(t,V);return o!==V?o:n?.(t)??(0,l.createElement)(e,t)}}return t}function K(e){return e.map(e=>e.reactComponents).filter(e=>!!e)}var U=n(89027);let Y=/^\s*$/,J=[[/^\s`/,/^[^\s]`/,"`"],[/^\s_/,/^[^\s]_/,"_"],[/^\s\*\*/,/^[^\s]\*\*/,"**"],[/^\s~~/,/^[^\s]~~/,"~~"],[/^\s\*/,/^[^\s]\*/,"*"],[/^\s\[/,/^[^\s]\]/,"](#)"],[/^\]\(/,/^[^\s]\)/,")"]];var q=n(19519);let Z="MarkdownRenderer-module__noFade__koxjj",G=[];function X(e){let t,n,a,i,s,c,m,p,h,f,_,g,v,x,b,k,N,V,z,Z,X,eo=(0,o.c)(52),{ref:el,className:ea,markdown:ei,chatMode:es,openLinksInCurrentTab:ec,onLinkClick:ed,extensions:eu,isStreaming:em,accessibleHeader:ep,copilotAnnotations:eh,wrapCodeLines:ef,onWrapCodeLinesChange:e_}=e,eg=void 0===eu?G:eu,[ev,ex]=(0,l.useState)(em??!1);eo[0]!==em?(t=()=>{if(em)ex(!0);else{let e=setTimeout(()=>{ex(!1)},750);return()=>clearTimeout(e)}},n=[em],eo[0]=em,eo[1]=t,eo[2]=n):(t=eo[1],n=eo[2]),(0,l.useEffect)(t,n),eo[3]===Symbol.for("react.memo_cache_sentinel")?(a={transformMarkdown:e=>(0,y.YR)(e,"code",e=>{e.data={...e.data,hName:"code",hProperties:{[C]:JSON.stringify({language:e.lang??"",code:e.value,startOffset:e.position?.start.offset??-1,endOffset:e.position?.end.offset??-1})}}}),transformHtml:e=>(0,y.YR)(e,"element",(e,t,n)=>{let r=e.children?.[0];n&&void 0!==t&&"pre"===e.tagName&&e.children?.length===1&&r?.type==="element"&&"code"===r.tagName&&C in r.properties&&n.children.splice(t,1,r)}),reactComponents:j},i={transformMarkdown:(({displayDelimiters:e=$,inlineDelimiters:t=B,codeBlockLanguages:n=L}={})=>r=>{let o,l;(o=e.map(({open:e,close:t})=>RegExp(`(?:^|\\n) *${e.source}((?: |.)+?)${t.source}(?= *(?:\\n|$))`,"g")),e=>(0,S.T)(e,o.map(e=>[e,(e,t)=>E(t)])))(r),(e=>(0,y.YR)(e,"code",(e,t,r)=>{e.lang&&n.has(e.lang)&&r&&void 0!==t&&r.children.splice(t,1,E(e.value))}))(r),(l=t.map(({open:e,close:t})=>RegExp(`(?(0,S.T)(e,l.map(e=>[e,(e,t)=>({type:"inlinemath",value:t,data:{hName:"math-renderer",hProperties:{className:"js-inline-math",style:"display: inline-block;"},hChildren:[{type:"text",value:t}]}})])))(r)})(A),reactComponents:M},eo[3]=a,eo[4]=i):(a=eo[3],i=eo[4]),eo[5]!==ec?(s=function({openLinksInCurrentTab:e}){return{transformHtml:e?void 0:T}}({openLinksInCurrentTab:ec}),eo[5]=ec,eo[6]=s):s=eo[6],eo[7]!==ev?(c=function({isStreaming:e}){return e?{preprocessMarkdown:e=>`${function(e){let t=new Set;for(let n=-1,r=` ${e.slice(0,2)}`;n<=e.length-3;n++,r=e.slice(n,n+3))for(let[e,n,o]of J)if(!t.has(o)&&e.test(r)){t.add(o);break}else if(t.has(o)&&n.test(r)){t.delete(o);break}for(let n of Array.from(t).reverse())e+=n;return e}(e)} \uE000`,transformMarkdown:e=>(0,w.VG)(e,(e,t)=>{if("value"in e&&e.value?.includes("\uE000"))for(let n of(e.value=e.value.replace("\uE000",""),e.isStreaming=!0,t))n.isStreaming=!0}),transformHtml:e=>(0,y.YR)(e,"text",(e,t,n)=>{if(void 0===n||void 0===t||Y.test(e.value))return;let r=e.value.split(" ").map((e,t,{length:n})=>{let r=tF(K(e)),a[0]=e,a[1]=t):t=a[1];let[i,s]=(0,l.useState)(t),c=(0,l.useRef)(e);return a[2]!==e?(n=()=>{let t=K(c.current),n=K(e);c.current=e;let r=null;for(let[e,o]of(t.length!==n.length&&(r=Error("A `MarkdownRenderer` extension containing a `reactComponents` field was added or removed. React extensions must remain referentially constant.")),t.entries()))o!==n[e]&&(r=Error("The `reactComponents` field in at least one `MarkdownRenderer` extension changed, or extensions containing `reactComponent` fields were reordered. React extensions must remain referentially constant.\nNOTE: This error may be safely ignored if it occurs due to hot-reloading in local development."));r&&(s(F(n)),(async()=>{throw r})())},r=[e],a[2]=e,a[3]=n,a[4]=r):(n=a[3],r=a[4]),(0,l.useEffect)(n,r),i}(ey);eo[19]!==ey||eo[20]!==ei?(_=ey.reduce(Q,ei),eo[19]=ey,eo[20]=ei,eo[21]=_):_=eo[21];let ew=_,eN=(0,l.useRef)(null);eo[22]!==el?(g=e=>{eN.current=e,"function"==typeof el?el(e):el&&(el.current=e)},eo[22]=el,eo[23]=g):g=eo[23];let eR=g;eo[24]!==ed?(v=()=>{if(!ed)return;let e=eN.current;if(!e)return;let t=t=>{let n=t.target.closest("a");n&&e.contains(n)&&ed(t)};return e.addEventListener("click",t),()=>e.removeEventListener("click",t)},x=[ed],eo[24]=ed,eo[25]=v,eo[26]=x):(v=eo[25],x=eo[26]),(0,l.useEffect)(v,x),eo[27]!==es||eo[28]!==eh||eo[29]!==em||eo[30]!==e_||eo[31]!==ef?(b={isStreaming:em,chatMode:es,copilotAnnotations:eh,wrapCodeLines:ef,onWrapCodeLinesChange:e_},eo[27]=es,eo[28]=eh,eo[29]=em,eo[30]=e_,eo[31]=ef,eo[32]=b):b=eo[32];let e$=b;eo[33]!==ep?(k=ep&&(0,r.jsx)("h3",{className:"sr-only",children:ep}),eo[33]=ep,eo[34]=k):k=eo[34];let eB=ev&&"MarkdownRenderer-module__fadeInContent__Z6XDA";return eo[35]!==ea||eo[36]!==eB?(N=(0,u.$)("markdown-body","MarkdownRenderer-module__container__sJ8jf",ea,eB),eo[35]=ea,eo[36]=eB,eo[37]=N):N=eo[37],eo[38]===Symbol.for("react.memo_cache_sentinel")?(V={"--MarkdownRenderer_streaming-fade-duration":"750ms"},eo[38]=V):V=eo[38],eo[39]!==ek||eo[40]!==ew||eo[41]!==ej||eo[42]!==eb?(z=(0,r.jsx)(I.o,{remarkPlugins:eb,rehypePlugins:ej,components:ek,children:ew}),eo[39]=ek,eo[40]=ew,eo[41]=ej,eo[42]=eb,eo[43]=z):z=eo[43],eo[44]!==eR||eo[45]!==N||eo[46]!==z?(Z=(0,r.jsx)("div",{ref:eR,className:N,style:V,"data-copilot-markdown":!0,children:z}),eo[44]=eR,eo[45]=N,eo[46]=z,eo[47]=Z):Z=eo[47],eo[48]!==e$||eo[49]!==k||eo[50]!==Z?(X=(0,r.jsxs)(d,{value:e$,children:[k,Z]}),eo[48]=e$,eo[49]=k,eo[50]=Z,eo[51]=X):X=eo[51],X}function Q(e,t){return t.preprocessMarkdown?.(e)??e}function ee(e){return!!e}function et(e){return e.transformHtml?()=>e.transformHtml:void 0}function en(e){return!!e}function er(e){return e.transformMarkdown?()=>e.transformMarkdown:void 0}X.displayName="MarkdownRenderer"},88275(e,t,n){n.d(t,{t:()=>h});var r=n(74848),o=n(16522),l=n(61398),a=n(38621),i=n(18990),s=n(206);function c(e){let t,n,l,s,c,d=(0,o.c)(11),{summary:u,icon:m,children:p}=e;return d[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,r.jsx)("span",{className:"AnnotationsList-module__chevron__TDCjv",children:(0,r.jsx)(a.ChevronRightIcon,{size:"small"})}),d[0]=t):t=d[0],d[1]!==u?(n=(0,r.jsx)("span",{className:"AnnotationsList-module__summaryText__sxZcc",children:u}),d[1]=u,d[2]=n):n=d[2],d[3]!==m||d[4]!==n?(l=(0,r.jsxs)("summary",{className:"AnnotationsList-module__summary__uMc25",children:[t,m," ",n]}),d[3]=m,d[4]=n,d[5]=l):l=d[5],d[6]!==p?(s=(0,r.jsx)("div",{className:"AnnotationsList-module__items__TtbJ_",children:(0,r.jsx)(i.l,{variant:"full",children:p})}),d[6]=p,d[7]=s):s=d[7],d[8]!==l||d[9]!==s?(c=(0,r.jsxs)("details",{children:[l,s]}),d[8]=l,d[9]=s,d[10]=c):c=d[10],c}function d(e){let t,n=(0,o.c)(3),{references:l}=e;if(n[0]!==l){let e,o=function(e){let t=new Map;for(let n of e){let e=function(e){let t=/^https?:\/\/github\.com\/([^/]+)\/([^/]+)/.exec(e);return t&&t[1]&&t[2]?{owner:t[1],name:t[2]}:null}(n.sourceURL);if(!e)continue;let{owner:r,name:o}=e;t.set(o,{name:o,owner:r,url:`https://github.com/${r}/${o}`,license:"NOASSERTION"===n.license?null:n.license})}return Array.from(t.values()).sort((e,t)=>e.name.localeCompare(t.name))}(l);n[2]===Symbol.for("react.memo_cache_sentinel")?(e=(0,r.jsx)("span",{style:{color:"var(--fgColor-muted)"},children:(0,r.jsx)(a.LawIcon,{})}),n[2]=e):e=n[2],t=(0,r.jsx)(c,{icon:e,summary:`Public code references from ${o.length} ${1===o.length?"repository":"repositories"}`,children:o.map(u)}),n[0]=l,n[1]=t}else t=n[1];return t}function u(e){return(0,r.jsxs)(i.l.LinkItem,{href:e.url,tabIndex:void 0,children:[(0,r.jsx)(i.l.LeadingVisual,{children:(0,r.jsx)(s.r,{src:`https://github.com/${e.owner}.png`,alt:`@${e.owner} avatar`,size:20})}),e.owner,"/",e.name,(0,r.jsx)(i.l.Description,{children:e.license?`${e.license} license`:"No license"})]},e.name)}function m(e){let t,n,l,i=(0,o.c)(6),{vulnerabilities:s}=e;i[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,r.jsx)("span",{style:{color:"var(--fgColor-attention)"},children:(0,r.jsx)(a.AlertIcon,{})}),i[0]=t):t=i[0];let d=`${s.length} ${1===s.length?"vulnerability":"vulnerabilities"} detected`;return i[1]!==s?(n=s.map(p),i[1]=s,i[2]=n):n=i[2],i[3]!==d||i[4]!==n?(l=(0,r.jsx)(c,{icon:t,summary:d,children:n}),i[3]=d,i[4]=n,i[5]=l):l=i[5],l}function p(e,t){return(0,r.jsxs)(i.l.Item,{children:[e.uiType,(0,r.jsx)(i.l.Description,{variant:"block",children:e.uiDescription})]},t)}c.displayName="AnnotationsList",d.displayName="ReferenceAnnotations",m.displayName="VulnerabilityAnnotations";let h=e=>{let t,n,a,i,s=(0,o.c)(10),{publicCodeReferences:c,codeVulnerabilities:u,onClose:p}=e;s[0]!==p?(t=()=>{p()},s[0]=p,s[1]=t):t=s[1];let h=t;return s[2]!==c?(n=c&&c.length>0&&(0,r.jsx)(d,{references:c.map(f)}),s[2]=c,s[3]=n):n=s[3],s[4]!==u?(a=u&&u.length>0&&(0,r.jsx)(m,{vulnerabilities:u.map(_)}),s[4]=u,s[5]=a):a=s[5],s[6]!==h||s[7]!==n||s[8]!==a?(i=(0,r.jsxs)(l.l,{title:"Code insights",subtitle:"Find matches across our platform or check for code vulnerabilities.",onClose:h,width:"xlarge",children:[n,a]}),s[6]=h,s[7]=n,s[8]=a,s[9]=i):i=s[9],i};function f(e){return e.details}function _(e){return e.details}h.displayName="CodeInsightsDialog"},31362(e,t,n){n.d(t,{q:()=>l});var r=n(74848),o=n(16522);function l(e){let t,n,l=(0,o.c)(5),{color:a,variant:i}=e;l[0]!==a?(t={backgroundColor:a},l[0]=a,l[1]=t):t=l[1];let s="compact"===i?"LanguageDot-module__languageDotCompact__BuFrL":"LanguageDot-module__languageDot__WZEoH";return l[2]!==t||l[3]!==s?(n=(0,r.jsx)("span",{style:t,className:s}),l[2]=t,l[3]=s,l[4]=n):n=l[4],n}l.displayName="LanguageDot"},68432(e,t,n){function r(e,t){return t in e&&"string"==typeof e[t]?JSON.parse(e[t]):null}n.d(t,{F:()=>o,k:()=>r});let o=e=>e.replaceAll(/-\w/g,e=>e[1]?.toUpperCase()??"")},45360(e,t,n){n.d(t,{T:()=>h});var r=n(74848),o=n(16522),l=n(19129),a=n(38621),i=n(26108),s=n(80117),c=n(55717),d=n(96540),u=n(34164),m=n(15582),p=n(933);function h(e){let t,n,h,f,_,g,v,x,y,b,C,j,k,w,N=(0,o.c)(33);N[0]!==e?({icon:g,size:v,onCopy:_,textToCopy:y,tooltipProps:b,variant:x,ariaLabel:t,className:n,disabled:h,...f}=e,N[0]=e,N[1]=t,N[2]=n,N[3]=h,N[4]=f,N[5]=_,N[6]=g,N[7]=v,N[8]=x,N[9]=y,N[10]=b):(t=N[1],n=N[2],h=N[3],f=N[4],_=N[5],g=N[6],v=N[7],x=N[8],y=N[9],b=N[10]);let R=void 0===g?a.CopyIcon:g,$=void 0===v?"medium":v,B=void 0===x?"invisible":x,[L,S]=d.useState(!1),E=(0,l.A)();N[11]!==E||N[12]!==_||N[13]!==y?(C=()=>{S(!0),(0,m.D)(y),_?.(),setTimeout(()=>E()&&S(!1),2e3)},N[11]=E,N[12]=_,N[13]=y,N[14]=C):C=N[14];let A=C,M=t??`Copy "${y}" to clipboard`,T=L?"Copied!":M,I=L?a.CheckIcon:R,O=L?"color-fg-success":void 0;N[15]!==n||N[16]!==O?(j=(0,u.$)(O,n),N[15]=n,N[16]=O,N[17]=j):j=N[17],N[18]!==f||N[19]!==A||N[20]!==$||N[21]!==I||N[22]!==j||N[23]!==B?(k={size:$,variant:B,onClick:A,icon:I,className:j,...f},N[18]=f,N[19]=A,N[20]=$,N[21]=I,N[22]=j,N[23]=B,N[24]=k):k=N[24];let D=k,P=(0,d.useId)();return N[25]!==L||N[26]!==h||N[27]!==M||N[28]!==D||N[29]!==P||N[30]!==b||N[31]!==T?(w=h?(0,r.jsx)(i.K,{...D,"aria-label":M,disabled:!0}):(0,r.jsxs)(r.Fragment,{children:[L&&(0,r.jsx)(s.s,{children:(0,r.jsx)(p.e,{children:"Copied!"})}),(0,r.jsx)(c.m,{text:T,"aria-label":M,type:"label",id:P,"aria-hidden":!0,...b,className:(0,u.$)("CopyToClipboardButton-module__tooltip__BhMvU",b?.className),children:(0,r.jsx)(i.K,{...D,"aria-labelledby":P})})]}),N[25]=L,N[26]=h,N[27]=M,N[28]=D,N[29]=P,N[30]=b,N[31]=T,N[32]=w):w=N[32],w}h.displayName="CopyToClipboardButton"},15582(e,t,n){n.d(t,{D:()=>r});function r(e){let t;if("clipboard"in navigator)return navigator.clipboard.writeText(e);let n=document.body;if(!n)return Promise.reject(Error());let r=((t=document.createElement("pre")).style.width="1px",t.style.height="1px",t.style.position="fixed",t.style.top="5px",t.textContent=e,t);return n.appendChild(r),!function(e){if("clipboard"in navigator)return navigator.clipboard.writeText(e.textContent||"");let t=getSelection();if(null==t)return Promise.reject(Error());t.removeAllRanges();let n=document.createRange();n.selectNodeContents(e),t.addRange(n),document.execCommand("copy"),t.removeAllRanges(),Promise.resolve()}(r),n.removeChild(r),Promise.resolve()}}}]); //# sourceMappingURL=3809-7e5958894ff9f6fb-612c4a7f6400b189.js.map