"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4987],{14987:(e,t,r)=>{r.r(t),r.d(t,{CodeDrawerActions:()=>b});var s=r(57505),c=r(82628),a=r(40559),l=r(22744),n=r(98772),i=r(16697),o=r(42753),d=r(77445),u=r(59858),p=r(22610),h=r(50245),x=r(5013),m=r(2435),g=r(38157);let b=({doc:e,docSpaceId:t,hostname:r,isDocumentActionsEnabled:b,showDocFeedback:f,isOpenSourceSuggestionsEnabled:v,showEditInGitApp:y,docGitAppPathUrl:j,isMobile:w,isDotNew:k,onScrollToTop:A})=>{let[E,S]=(0,h.useState)(!1),N=(0,h.useRef)(null),F=(0,h.useRef)(0),I=(0,c.W)(),_=(0,l.B)(),C=(0,d.md)(n.q2,{store:(0,n.yO)()}),D=v||y&&j;return((0,h.useEffect)(()=>{let e=document.getElementById(o.Ox);N.current=e?.querySelector("[data-overlayscrollbars-viewport]")??e;let t=()=>{cancelAnimationFrame(F.current),F.current=requestAnimationFrame(()=>{let e=N.current;if(!e)return;let t=e.scrollHeight-e.clientHeight;if(t<=0)return;let r=e.scrollTop/t>=.3;S(e=>e===r?e:r)})};return N.current?.addEventListener("scroll",t,{passive:!0}),()=>{N.current?.removeEventListener("scroll",t),cancelAnimationFrame(F.current)}},[]),b||f||D||A)?(0,s.jsxs)("div",{className:"flex flex-col",children:[b&&(0,s.jsx)("div",{className:"flex flex-col items-start w-full mt-10",children:(0,s.jsx)(x.PublicDocActions,{doc:e,hostname:r})}),f?(0,s.jsxs)("div",{className:(0,i.cn)("flex flex-col gap-6",b?"my-10":"mt-10"),children:[(0,s.jsx)(p.default,{id:"google-recaptcha-script",src:`https://www.google.com/recaptcha/enterprise.js?render=${I.recaptchaKey}`}),(0,s.jsx)(a.d,{content:_("disable_for_preview"),disabled:!k,children:(0,s.jsx)(g.DocumentFeedback,{docId:e?.id,docSpaceId:t,showFeedback:f,isFeedbackDisabled:k,doc:e,isMobile:w,isTablet:C,isOpenSourceSuggestionsEnabled:v,showEditInGitApp:y,docGitAppPathUrl:j,isInToc:!0})})]}):D?(0,s.jsx)(m.SuggestChangesAndEditOnGithub,{doc:e,docSpaceId:t,isMobile:w,isTablet:C,docGitAppPathUrl:j,isOpenSourceSuggestionsEnabled:v,showEditInGitApp:y,showDocFeedback:f}):null,A&&(0,s.jsx)("div",{className:(0,i.cn)("flex flex-col transition-opacity duration-300",!f&&"mt-8",E?"opacity-100":"opacity-0 pointer-events-none"),children:(0,s.jsxs)("button",{className:(0,i.cn)("ab-tab-focus flex px-4 py-2 gap-2 font-semibold items-center justify-center cursor-pointer rounded-lg md:w-fit transition-colors","text-gray-500 dark:text-gray-400","hover:text-gray-800 hover:dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-800"),onClick:A,children:[(0,s.jsx)(u.A,{size:14}),(0,s.jsx)("span",{className:"leading-5 text-base",children:"Back to Top"})]})})]}):null}}}]);