1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2084],{80522:function(e,l,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/drive/shared-content",function(){return t(74272)}])},97450:function(e,l,t){"use strict";t.d(l,{Z:function(){return x}});var n=t(85893),i=t(86010),a=t(12451),r=t(41664),s=t.n(r),o=t(11163),d=t(99403),c=t(51020),u=t(67294),p=t(55346),h=t(65541),m=t.n(h);function x(e){let{rootLabel:l,pageType:t,path:r=[],onAction:h}=e,x=(0,o.useRouter)(),v=(0,u.useRef)(null),f=(0,u.useRef)(null);r.length>2&&r[0];let y=r.length>2?r.slice(-2):r,g=r.length>2?r.slice(0,-2):[],j=g.map(e=>({label:e.name,command:()=>x.push("/drive/".concat(t,"/").concat(e.id))}));return(0,n.jsxs)(a.E.nav,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{duration:.2},className:"flex align-items-center gap-1 text-sm text-gray-600 overflow-x-auto whitespace-nowrap scrollbar-thin scrollbar-thumb-gray-300 scrollbar-track-transparent p-1 md:p-0",style:{WebkitOverflowScrolling:"touch"},children:[(0,n.jsx)(s(),{href:"/drive/".concat(t),className:(0,i.Z)("text-base flex-shrink-0 pointer-events-none select-none",r.length>0&&"hover:text-primary transition-colors hover:bg-gray-200 px-2 py-1 border-round-xl pointer-events-auto"),children:l}),g.length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(p.Dli,{className:"text-xs text-gray-400 flex-shrink-0"}),(0,n.jsx)(c.v,{model:j,popup:!0,ref:f}),(0,n.jsx)(d.z,{icon:"pi pi-ellipsis-h",text:!0,rounded:!0,className:"!p-1 text-gray-500 hover:text-primary",onClick:e=>{var l;return null===(l=f.current)||void 0===l?void 0:l.toggle(e)}})]}),y.map((e,l)=>{let i=l===y.length-1;return(0,n.jsxs)("div",{className:"flex align-items-center gap-1 flex-shrink-0 min-w-0",children:[(0,n.jsx)(p.Dli,{className:"text-xs text-gray-400 flex-shrink-0"}),i?(0,n.jsx)("div",{className:"flex align-items-center gap-1 min-w-0",children:(0,n.jsx)("span",{className:"font-medium text-base text-gray-900 white-space-nowrap text-overflow-ellipsis overflow-hidden max-w-7rem lg:max-w-full",title:e.name,children:e.name})}):(0,n.jsx)(s(),{href:"/drive/".concat(t,"/").concat(e.id),className:"hover:text-primary text-base flex-shrink-0 transition-colors hover:bg-gray-200 px-2 py-1 border-round-xl \n white-space-nowrap text-overflow-ellipsis overflow-hidden max-w-7rem lg:max-w-full",title:e.name,children:e.name})]},e.id)}),h&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(c.v,{model:[{label:"You can add content or organize your content from here.",disabled:!0,style:{fontSize:14}},{label:"New Folder",icon:"pi pi-folder",command:()=>null==h?void 0:h("new-folder",null)},{label:"Upload File",icon:"pi pi-upload",command:()=>null==h?void 0:h("upload",null),visible:"my-drive"===t},{label:"Add Content",icon:"pi pi-plus",command:()=>null==h?void 0:h("add-content",null),visible:"exam-library"===t&&r.length>0}],popup:!0,ref:v}),(0,n.jsxs)(d.z,{iconPos:"left",rounded:!0,className:m().menu_btn_style,onClick:e=>{var l;return null===(l=v.current)||void 0===l?void 0:l.toggle(e)},style:{display:"flex",gap:2,fontSize:14,marginLeft:"auto",padding:"5px 10px"},children:[(0,n.jsx)(p.wEH,{style:{width:16}}),(0,n.jsx)("span",{children:"New"})]})]})]},r.map(e=>e.id).join("-"))}},23844:function(e,l,t){"use strict";var n=t(85893),i=t(12850),a=t(3369),r=t(35955),s=t(86010),o=t(41085),d=t(66361),c=t(12451),u=t(11163),p=t(99403),h=t(51020),m=t(67294),x=t(49294),v=t(99272),f=t(55346),y=t(88767),g=t(86455),j=t.n(g);l.Z=e=>{var l,t;let g;let{data:_,loading:w=!1,onAction:b,isSharedItem:N=!1,disableDragging:C=!1}=e,S=(0,u.useRouter)(),D=S.query.folderId,E=(0,m.useRef)(null),F=(0,y.useQueryClient)(),k=(0,o.C)(e=>e.auth.currentUser),Z=()=>{D?(F.fetchQuery(["my-drive-folders-".concat(D),null==k?void 0:k.id]),F.fetchQuery(["my-drive",null==k?void 0:k.id,_.parentFolderId])):(F.fetchQuery(["my-drive-folders",null==k?void 0:k.id]),F.fetchQuery(["my-drive_root",null==k?void 0:k.id]))},[z,I]=(0,m.useState)(!1),[R,L]=(0,m.useState)(!1),[A,Q]=(0,m.useState)(!1),[B,M]=(0,m.useState)(!1),[H,O]=(0,m.useState)(!1),[{isDragging:q},T]=(0,x.c)(()=>{var e;return{type:"DRIVE_FOLDER",canDrag:!C,item:{id:_.id,type:"folder",parent_id:_.parentFolderId,children:(null==_?void 0:null===(e=_.data)||void 0===e?void 0:e.children)||[]},collect:e=>({isDragging:!!e.isDragging()})}}),[{isOver:V},U]=(0,v.L)(()=>({accept:["DRIVE_FOLDER","DRIVE_FILE"],drop:e=>{e.id!==_.id&&(Q(!0),d.Z.patch("/dam/".concat(e.type,"-service/move/"),{id:e.id,parent:_.id,user_id:null==k?void 0:k.id}).then(l=>{"folder"===e.type?Z():"file"===e.type&&(D?F.fetchQuery(["my-drive-files-".concat(D),null==k?void 0:k.id]):F.fetchQuery(["my-drive-files",null==k?void 0:k.id]))}).catch(e=>console.log(e)).finally(()=>{Q(!1)}))},canDrop:e=>e.id!==_.id,collect:e=>({isOver:e.isOver(),canDrop:e.canDrop()})})),W=(0,m.useCallback)(e=>{T(e),U(e)},[T,U]);return(0,n.jsxs)(m.Fragment,{children:[(0,n.jsx)(h.v,{model:(g=_.id,[{label:"Share",icon:"pi pi-share-alt",command:()=>I(!0)},{label:"Move",icon:"pi pi-arrows-alt",command:()=>L(!0),disabled:N},{label:"Rename",icon:"pi pi-pencil",command:()=>M(!0),disabled:N},{label:"Delete",icon:"pi pi-trash",command:()=>{j().fire({icon:"warning",title:"Alert",text:"Are you sure want to delete?",confirmButtonText:"Yes, Delete",confirmButtonColor:"var(--error-color)",showConfirmButton:!0,cancelButtonText:"No",showCancelButton:!0}).then(e=>{e.isConfirmed&&(null==b||b("delete",g))})},disabled:N}]),popup:!0,ref:E}),(0,n.jsx)(r.Z,{show:z,handleClose:I,handleSuccess:e=>{console.log({userIDs:e})},fileId:"".concat(_.id),type:_.type}),(0,n.jsx)(i.Z,{show:R,handleClose:L,handleSuccess:e=>{k&&(Q(!0),d.Z.patch("/dam/folder-service/move/",{id:_.id,parent:e,user_id:null==k?void 0:k.id}).then(e=>{Z(),L(!1)}).catch(e=>console.log(e)).finally(()=>{Q(!1)}))},movefolderID:"".concat(_.id)}),(0,n.jsx)(a.Z,{show:B,handleClose:M,handleSuccess:e=>{O(!0),d.Z.patch("/dam/folder-service/rename/",{id:_.id,title:e,user_id:null==k?void 0:k.id,parent:_.parentFolderId}).then(e=>{Z(),M(!1)}).catch(e=>{console.log(e)}).finally(()=>{O(!1)})}
1,defaultName:_.name,loading:H}),(0,n.jsxs)(c.E.div,{ref:W,initial:{scale:1},animate:{scale:V&&!q?1.05:1,opacity:q?.5:1},transition:{duration:.2},style:{border:V&&!q?"2px solid var(--primary-color)":"2px solid transparent"},className:(0,s.Z)("flex align-items-center gap-2 w-full overflow-hidden bg-gray-300 py-1 px-2 border-round-lg transition-colors cursor-pointer relative select-none","hover:bg-gray-400"),onDoubleClick:()=>{if(N){var e;S.push("/drive/shared-content/".concat(_.id,"?sender=").concat(null==_?void 0:null===(e=_.data)||void 0===e?void 0:e.sender_id))}else S.push("/drive/my-drive/".concat(_.id))},children:[(w||A)&&(0,n.jsx)("div",{className:"absolute top-0 left-0 w-full h-full flex align-items-center justify-content-center text-primary",style:{background:"rgba(255, 255, 255, 0.5)",zIndex:99},children:(0,n.jsx)("i",{className:"pi pi-spin pi-spinner",style:{fontSize:"1.5rem"}})}),(0,n.jsx)(f.$nz,{style:{fontSize:"20px",flexShrink:0,color:"#4A90E2"}}),(0,n.jsxs)("p",{className:"text-sm white-space-nowrap text-overflow-ellipsis overflow-hidden flex-grow-1",style:{minWidth:0},title:"".concat(_.name," ").concat(N?"shared by "+(null==_?void 0:null===(l=_.data)||void 0===l?void 0:l.sender_name):""),children:[_.name,N?"shared by "+(null==_?void 0:null===(t=_.data)||void 0===t?void 0:t.sender_name):""]}),(0,n.jsx)("div",{children:(0,n.jsx)(p.z,{text:!0,rounded:!0,className:"w-auto h-auto p-2 text-gray-600",onClick:e=>{var l;null===(l=E.current)||void 0===l||l.toggle(e)},icon:"pi pi-ellipsis-v"})})]})]})}},93411:function(e,l,t){"use strict";var n=t(85893),i=t(81633),a=t(11163),r=t(6094),s=t(67294),o=t(29788),d=t.n(o);l.Z=e=>{let{pathname:l}=e,t=(0,a.useRouter)(),o=t.query.q,[c,u]=(0,s.useState)(o),p=(0,i.N)(c);return(0,s.useEffect)(()=>{p&&t.push("/drive/".concat(l,"/search?q=").concat(encodeURIComponent(p||"")))},[p]),(0,n.jsx)("div",{className:"w-full",style:{maxWidth:450},children:(0,n.jsxs)("span",{className:"p-input-icon-left w-full",children:[(0,n.jsx)("i",{className:"pi pi-search text-primary text-md",style:{left:10}}),(0,n.jsx)(r.o,{id:"nav_search",name:"nav_search",value:c,onChange:e=>u(e.target.value),placeholder:"Search...",className:d().search__input__styles,autoComplete:"false"})]})})}},74272:function(e,l,t){"use strict";t.r(l),t.d(l,{getDriveSharedData:function(){return f}});var n=t(85893),i=t(77179),a=t(72840),r=t(41085),s=t(66361),o=t(65820),d=t(12451),c=t(67294),u=t(88767);t(86455);var p=t(97450),h=t(22363),m=t(23844),x=t(34009),v=t(93411);let f=async(e,l)=>{var t,n;let i=await s.Z.post("/dam/file-service/get-drive-data",{reciever_id:e}),a=(null===(t=i.data)||void 0===t?void 0:t.folders)||[],r=(null===(n=i.data)||void 0===n?void 0:n.files)||[];return{folders:a.map(e=>({id:e.id,name:e.name,type:"FOLDER",parentFolderId:(null==e?void 0:e.parent_folder_id)||null,createdAt:e.created_at,updatedAt:e.updated_at,data:{sender_id:null==e?void 0:e.sender_id,sender_name:null==e?void 0:e.sender_name,annotation_status:null==e?void 0:e.annotation_status}})),files:r.map(e=>({id:e.id,name:e.name,type:"FILE",parentFolderId:e.folder_id,createdAt:e.created_at,updatedAt:e.updated_at,data:e}))}},y=()=>{let e=(0,u.useQueryClient)(),l=(0,r.C)(e=>e.auth.currentUser),{data:t,isLoading:x,refetch:y}=(0,u.useQuery)({queryKey:["my-drive-shared-data",null==l?void 0:l.id],queryFn:()=>f(l.id),staleTime:6e4,enabled:!!(null==l?void 0:l.id)}),[g,j]=(0,c.useState)(!1),[_,w]=(0,c.useState)(!1),[b,N]=(0,c.useState)(!1),[C,S]=(0,c.useState)(null),D=(null==t?void 0:t.folders)||[],E=(null==t?void 0:t.files)||[];return(0,n.jsxs)(c.Fragment,{children:[(0,n.jsx)(i.Z,{show:g,handleClose:j,handleSuccess:t=>{if(!l)return;let n={name:t,owner:null==l?void 0:l.id,parent:null};w(!0),s.Z.post("/dam/folder-service/upload",n).then(t=>{y(),e.fetchQuery(["my-drive_root",null==l?void 0:l.id])}).catch(e=>{console.log(e)}).finally(()=>{w(!1),j(!1)})},loading:_}),(0,n.jsx)(a.Z,{show:b,handleClose:N,handleSuccess:e=>{N(!1)},foldername:"Home",parentFolder:null}),(0,n.jsxs)("div",{className:"flex flex-column gap-4 pt-4",style:{paddingBottom:"20vh"},children:[(0,n.jsx)("div",{className:"flex align-items-center justify-content-center w-full",children:(0,n.jsx)(v.Z,{pathname:"shared-content"})}),(0,n.jsx)(p.Z,{rootLabel:"Shared Content",pageType:"shared-content",path:[]}),x?(0,n.jsxs)("div",{className:"flex align-items-center justify-content-center gap-1",children:[(0,n.jsx)("i",{className:"pi pi-spin pi-spinner",style:{fontSize:"1rem"}}),(0,n.jsx)("span",{style:{fontSize:"1rem"},children:"Loading..."})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"grid",children:(0,n.jsx)(o.M,{children:D.map(e=>(0,n.jsx)(d.E.div,{className:"sm:col-6 md:col-4 lg:col-3 xl:col-2",layout:!0,initial:{opacity:1,scale:1},exit:{opacity:0,scale:0},transition:{duration:.3,ease:[.4,0,.2,1]},children:(0,n.jsx)(m.Z,{data:e,loading:C===e.id,isSharedItem:!0,disableDragging:!0})},e.id))})}),(0,n.jsx)("div",{className:"grid",children:(0,n.jsx)(o.M,{children:E.map(e=>(0,n.jsx)(d.E.div,{className:"sm:col-6 md:col-4 lg:col-3 xl:col-2",layout:!0,initial:{opacity:1,scale:1},exit:{opacity:0,scale:0},transition:{duration:.3,ease:[.4,0,.2,1]},children:(0,n.jsx)(h.Z,{data:e,loading:C===e.id,isSharedItem:!0,disableDragging:!0})},e.id))})}),D.length+E.length===0&&(0,n.jsxs)("div",{className:"flex flex-column align-items-center justify-content-center flex-grow-1",children:[(0,n.jsxs)("svg",{stroke:"currentColor",fill:"
1currentColor",strokeWidth:"0",version:"1",viewBox:"0 0 48 48",enableBackground:"new 0 0 48 48",height:"100px",width:"100px",xmlns:"http://www.w3.org/2000/svg",children:[(0,n.jsx)("polygon",{fill:"#90CAF9",points:"33,42 5,42 5,4 24,4 33,13"}),(0,n.jsx)("polygon",{fill:"#E1F5FE",points:"31.5,14 23,14 23,5.5"}),(0,n.jsx)("rect",{x:"38.3",y:"34.8",transform:"matrix(.707 -.707 .707 .707 -17.177 40.055)",fill:"#616161",width:"2.8",height:"12"}),(0,n.jsx)("circle",{fill:"#616161",cx:"28",cy:"29",r:"11"}),(0,n.jsx)("circle",{fill:"#90CAF9",cx:"28",cy:"29",r:"9"}),(0,n.jsx)("rect",{x:"39.5",y:"37.6",transform:"matrix(.707 -.707 .707 .707 -17.661 41.223)",fill:"#37474F",width:"2.8",height:"8.7"}),(0,n.jsxs)("g",{fill:"#1976D2",children:[(0,n.jsx)("path",{d:"M30,31h-9.7c0.4,1.6,1.3,3,2.5,4H30V31z"}),(0,n.jsx)("path",{d:"M20.3,27H30v-4h-7.3C21.5,24,20.7,25.4,20.3,27z"}),(0,n.jsx)("path",{d:"M20.1,20H11v2h7.3C18.8,21.3,19.4,20.6,20.1,20z"}),(0,n.jsx)("path",{d:"M17.1,24H11v2h5.4C16.6,25.3,16.8,24.6,17.1,24z"}),(0,n.jsx)("path",{d:"M16,29c0-0.3,0-0.7,0.1-1H11v2h5.1C16,29.7,16,29.3,16,29z"}),(0,n.jsx)("path",{d:"M16.4,32H11v2h6.1C16.8,33.4,16.6,32.7,16.4,32z"})]})]}),(0,n.jsx)("p",{className:"text-base font-medium",children:"\uD83E\uDD1D Nothing shared with you yet"})]})]})]})]})};y.getLayout=e=>(0,n.jsx)(x.Z,{children:e}),l.default=y},65541:function(e){e.exports={btn_styles:"styles_btn_styles__o7_Ug",menu_btn_style:"styles_menu_btn_style__EuSuV"}},29788:function(e){e.exports={search__input__styles:"styles_search__input__styles__VXE_B"}}},function(e){e.O(0,[123,4396,4817,7730,7300,4658,2667,2002,9294,4468,19,2494,9462,4903,7263,4949,2888,9774,179],function(){return e(e.s=80522)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.