"use strict";(self.webpackChunk_1js_files_in_taskbar=self.webpackChunk_1js_files_in_taskbar||[]).push([[7863],{65161:(e,t,n)=>{n.r(t),n.d(t,{Component:()=>O});var l=n(71124),s=n(31525),a=n(58393),i=n(34445),r=n(65481),o=n(5577),c=n(61353),d=n(30706),u=n(35680),m=n(49791),p=n(36036),v=n(87646),f=n(81036),E=n(15136),b=n(93475),h=n(27323),N=n(7897),k=n(53341),P=n(86688),_=n(21989),I=n(50039),w=n(27815);const C=e=>{var t;const n=l.useRef(null),[s,C]=l.useState(!0),[O,g]=l.useState([]),[L,y]=l.useState(!1),{user:A}=(0,v.J)(),F=(null===(t=null==A?void 0:A.email)||void 0===t?void 0:t.toLowerCase())||"",S=(0,k.I)(),{customProps:q,id:T}=e,{dispatchImpressionClick:j,fileName:B,fileUrl:H,listId:R,parentLink:D,siteId:K,spoIdPromise:U,uniqueId:V,webId:$}=q,x=T.startsWith("SPO_");let z=U;x||void 0!==z||(z=(0,o.kh)(K,$,V).then((e=>`SPO_${(0,o.yG)(K,$,R)}_${e}`)));const G=x?a.Observable.returnValue(T):a.Observable.fromPromise(z);l.useEffect((()=>{if(!n.current)return;return(0,h.R)(n.current)}),[n]),l.useEffect((()=>{g([]);G.selectMany((e=>{const t=(0,_.L)();return(0,f.f)(t,e)()})).subscribe((e=>{var t,n,l;if(e){const s=null===(t=null==e?void 0:e.value)||void 0===t?void 0:t.resultTable;if(!(null==s?void 0:s.length))return void y(!0);if(null===(l=null===(n=null==s?void 0:s[0])||void 0===n?void 0:n.item1)||void 0===l?void 0:l.userNotOpenedFile)C(!1);else{const t=(0,E.V)(e,F);t&&g(t)}}y(!0)}),(()=>{y(!0)}))}),[T]);const J=(0,i.Ip)(null!=H?H:D),M=(0,m.g)({type:2,size:32,imageFileType:"png"}),W=(0,c.ur)(B),X=(0,P.S1)(q),Z=e=>{D&&(window.open(D,"_blank","noopener noreferrer"),null==j||j(e,{commandId:"OpenFolderLocation"}),e.stopPropagation())};return l.createElement("div",{className:S.fileDetails},l.createElement(u.Z,{className:S.card},l.createElement("div",{className:S.headerBlock},l.createElement("div",{className:S.iconAndTitle},l.createElement(d.I,Object.assign({className:S.headerIcon},M)),l.createElement("div",{className:S.titleArea},l.createElement("div",{className:S.titleLink},l.createElement(r.A,{content:(0,N.KX)(),relationship:"description",positioning:"below-start"},l.createElement("h1",{className:S.title},l.createElement("a",{href:X,className:S.fileTitle},W))),l.createElement(r.A,{content:(0,N.qH)(),relationship:"description",positioning:"below-start"},l.createElement("a",{href:D,className:S.filePath},l.createElement("span",{className:(0,w.I)().visuallyHidden},(0,N.l0)()),J))))),l.createElement(I.I,{quickActionProps:{id:T,customProps:q,folderPreviewCard:!0}})),l.createElement("div",{ref:n,className:S.content,"data-scroll-enabled":"true"},l.createElement("div",{className:S.contentBlock},l.createElement(b._,{dispatchActionEvent:j,fetchedActivities:L,activities:O,userOpenedFile:s,openFileURL:X}),l.createElement("button",{className:S.openFolderLocationButton,onClick:e=>{Z(e)},onKeyDown:e=>{"Enter"===e.key&&Z(e)}},(0,N.qH)(),l.createElement(p.x2u,{className:S.openFolderLocationIcon}))))))},O=()=>{const e=(0,s.Oq)();if(!e||!e._filePreviewCardProps)return null;const{value:{id:t,customProps:n}}=e._filePreviewCardProps;return n?l.createElement(C,{customProps:n,id:t}):null}}}]);