1import{_ as ge}from"./CIcK5AWm.js";import{g as m,m as je,a3 as Ve,c as a,o,a as s,j as y,n as O,k as l,s as w,b as i,i as he,X as qe,t as r,F as T,r as j,N as _,u as Ke,e as Be,w as p,_ as Oe,d as x,h as ze,a4 as ye,z,a5 as I,B as Ge}from"./Cny-jMUR.js";import{_ as ve}from"./B-5qM8bm.js";import{_ as Ye}from"./CSHkLFmR.js";import{_ as He}from"./tJRDHKHm.js";import{_ as Xe}from"./Ca6ghO6a.js";import{_ as Je}from"./sd3vO9h1.js";import{_ as We}from"./DqaYmqoA.js";import{u as be}from"./D1mNL5xR.js";import{_ as Ze}from"./DlAUqK2U.js";import"./DRbcCXkf.js";import"./Deq16PoT.js";import"./B7NayylV.js";import"./lcsHDJOY.js";import"./COjSgi5K.js";import"./Bm98wYY5.js";import"./n8lNb2hy.js";import"./CXDzCsr7.js";import"./B8QNibK0.js";import"./YoF-LljS.js";import"./DgD9rLi7.js";const Qe={class:"space-y-3"},et={class:"overflow-hidden rounded-xl border border-gray-200 bg-white"},tt={class:"flex min-w-0 items-start gap-3"},st={class:"space-y-1"},lt=["href"],ot={key:1,class:"text-base font-semibold text-gray-900"},at={class:"text-sm text-gray-700 md:max-w-sm md:text-right"},rt={class:"text-xs text-gray-500"},nt={key:0,class:"space-y-4 border-t border-gray-200 px-4 py-4"},dt={class:"space-y-2"},it={key:0,class:"flex flex-wrap gap-2"},ut={key:1,class:"text-sm text-gray-400"},ct={class:"space-y-2"},pt={key:0,class:"flex flex-wrap gap-2"},mt={key:1,class:"text-sm text-gray-400"},ft={class:"space-y-2"},xt={key:0,class:"flex flex-wrap gap-2"},gt={key:1,class:"text-sm text-gray-400"},yt={key:0,class:"ml-4 space-y-3 border-l-2 border-gray-200 pl-4 md:ml-6 md:pl-5"},bt={key:0,class:"flex items-center gap-2 rounded-xl border border-gray-200 bg-white px-4 py-3 text-sm text-gray-600"},ht=Object.assign({name:"DropboxFolderTreeNode"},{__name:"DropboxFolderTreeNode",props:{node:{type:Object,required:!0},formatFolderMeta:{type:Function,required:!0},getEmailPillClasses:{type:Function,required:!0}},setup(b){const h=b,D=m(!1),F=m(Array.isArray(h.node.children)?h.node.children:[]),R=m(!1),$=m(F.value.length>0),M=m(""),G=w(()=>Array.isArray(h.node.directUserEmails)&&h.node.directUserEmails.some(P=>typeof P=="string"&&!P.toLowerCase().includes("@revby.co"))),V=w(()=>h.node.sharedLinkPolicy==="anyone"?"public":"restricted"),Y=w(()=>h.node.sharedLinkPolicy==="anyone"?"ml-1 font-medium text-green-600":"ml-1 font-medium text-gray-600"),Q=w(()=>G.value?"bg-red-50 hover:bg-red-100":"bg-gray-50 hover:bg-gray-100");je(()=>h.node.children,P=>{F.value=Array.isArray(P)?P:[],$.value=F.value.length>0});async function A(){var P;if(!(R.value||$.value)){R.value=!0,M.value="";try{const n=await $fetch("/api/admin/dropbox/folder-children",{query:{rootUrl:h.node.rootPreviewUrl,path:h.node.pathInRoot||"",sharedFolderId:h.node.sharedFolderId}});F.value=Array.isArray(n==null?void 0:n.children)?n.children:[],$.value=!0}catch(n){M.value=((P=n==null?void 0:n.data)==null?void 0:P.statusMessage)||(n==null?void 0:n.statusMessage)||(n==null?void 0:n.message)||"Request failed"}finally{R.value=!1}}}async function H(){D.value=!D.value,D.value&&await A()}return(P,n)=>{const q=he,S=ve,U=Ve("DropboxFolderTreeNode",!0);return o(),a("div",Qe,[s("div",et,[s("button",{type:"button",class:O(["flex w-full flex-col gap-4 px-4 py-4 text-left transition md:flex-row md:items-start md:justify-between",l(Q)]),onClick:H},[s("div",tt,[i(q,{name:"i-lucide-chevron-right",class:O(["mt-0.5 size-4 shrink-0 text-gray-500 transition-transform",{"rotate-90":l(D)}])},null,8,["class"]),s("div",st,[b.node.previewUrl?(o(),a("a",{key:0,href:b.node.previewUrl,target:"_blank",class:"text-base font-semibold text-brand underline",onClick:n[0]||(n[0]=qe(()=>{},["stop"]))},r(b.node.name),9,lt)):(o(),a("span",ot,r(b.node.name),1))])]),s("div",at,[s("div",rt,[s("span",null,r(b.formatFolderMeta(b.node)),1),n[1]||(n[1]=s("span",{class:"mx-1 text-gray-300"},"â¢",-1)),n[2]||(n[2]=s("span",null,"Access:",-1)),s("span",{class:O(l(Y))},r(l(V)),3)])])],2),l(D)?(o(),a("div",nt,[s("div",dt,[n[3]||(n[3]=s("div",{class:"text-xs font-semibold uppercase tracking-wide text-gray-500"},"Users",-1)),b.node.directUserEmails.length?(o(),a("div",it,[(o(!0),a(T,null,j(b.node.directUserEmails,g=>
1(o(),a("span",{key:g,class:O(b.getEmailPillClasses(g))},r(g),3))),128))])):(o(),a("div",ut,"â"))]),s("div",ct,[n[4]||(n[4]=s("div",{class:"text-xs font-semibold uppercase tracking-wide text-gray-500"},"Pending invites",-1)),b.node.inviteeEmails.length?(o(),a("div",pt,[(o(!0),a(T,null,j(b.node.inviteeEmails,g=>(o(),a("span",{key:g,class:O(b.getEmailPillClasses(g))},r(g),3))),128))])):(o(),a("div",mt,"â"))]),s("div",ft,[n[5]||(n[5]=s("div",{class:"text-xs font-semibold uppercase tracking-wide text-gray-500"},"Groups",-1)),b.node.groupNames.length?(o(),a("div",xt,[(o(!0),a(T,null,j(b.node.groupNames,g=>(o(),a("span",{key:g,class:"inline-flex max-w-full items-center rounded-full bg-blue-50 px-2.5 py-1 text-xs font-medium text-blue-700 break-all"},r(g),1))),128))])):(o(),a("div",gt,"â"))])])):y("",!0)]),l(D)&&(l(F).length||l(R))?(o(),a("div",yt,[l(R)?(o(),a("div",bt,[i(q,{name:"i-lucide-loader-2",class:"size-4 animate-spin text-brand"}),n[6]||(n[6]=s("span",null,"Loading subfoldersâ¦",-1))])):y("",!0),l(M)?(o(),_(S,{key:1,color:"red",title:"Could not load subfolders",description:l(M)},null,8,["description"])):y("",!0),(o(!0),a(T,null,j(l(F),g=>(o(),_(U,{key:g.id,node:g,"format-folder-meta":b.formatFolderMeta,"get-email-pill-classes":b.getEmailPillClasses},null,8,["node","format-folder-meta","get-email-pill-classes"]))),128))])):y("",!0)])}}}),vt={class:"bg-gray-50 min-h-screen"},wt={class:"max-w-4xl mx-auto pt-16 pb-20 p-4 space-y-6"},kt={class:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between"},_t={class:"flex flex-wrap gap-3"},Ct={class:"space-y-4"},Dt={key:0,class:"flex min-h-32 items-center justify-center rounded-xl border border-gray-200 bg-white"},Ft={class:"flex items-center gap-3 text-sm text-gray-600"},$t={class:"grid gap-4 md:grid-cols-2"},At={class:"rounded-xl border border-gray-200 bg-white p-4 text-sm text-gray-700"},Rt={class:"rounded-xl border border-gray-200 bg-white p-4 text-sm text-gray-700"},Pt={class:"mt-1 break-all text-gray-600"},Ut={class:"rounded-xl border border-gray-200 bg-white p-4"},Lt={class:"mt-3 flex flex-wrap gap-2"},Nt={class:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between"},Mt={class:"space-y-4"},St={key:0,class:"flex min-h-40 items-center justify-center rounded-xl border border-gray-200 bg-white"},Tt={class:"flex items-center gap-3 text-sm text-gray-600"},Et={class:"text-sm text-gray-700"},It={key:3,class:"space-y-4"},jt={key:4,class:"text-sm text-gray-500"},Vt={class:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between"},qt={class:"flex flex-wrap gap-3"},Kt={class:"space-y-4"},Bt={class:"grid gap-4 md:grid-cols-[minmax(0,1fr)_auto] md:items-end"},Ot={class:"flex flex-col gap-1 text-xs font-semibold text-gray-500"},zt={class:"flex flex-wrap items-center gap-4"}
1,Gt={class:"flex items-center gap-2 text-sm text-gray-700"},Yt={class:"flex items-center gap-2 text-sm text-gray-700"},Ht={class:"flex flex-col gap-1 text-xs font-semibold text-gray-500"},Xt={key:2,class:"flex min-h-40 items-center justify-center rounded-xl border border-gray-200 bg-white"},Jt={class:"flex items-center gap-3 text-sm text-gray-600"},Wt={class:"grid gap-4 sm:grid-cols-2 xl:grid-cols-5"},Zt={class:"rounded-xl border border-gray-200 bg-white p-4"},Qt={class:"mt-2 text-2xl font-semibold text-gray-900"},es={class:"rounded-xl border border-emerald-200 bg-emerald-50 p-4"},ts={class:"mt-2 text-2xl font-semibold text-emerald-900"},ss={class:"rounded-xl border border-amber-200 bg-amber-50 p-4"},ls={class:"mt-2 text-2xl font-semibold text-amber-900"},os={class:"rounded-xl border border-blue-200 bg-blue-50 p-4"},as={class:"mt-2 text-2xl font-semibold text-blue-900"},rs={class:"rounded-xl border border-gray-200 bg-gray-100 p-4"},ns={class:"mt-2 text-2xl font-semibold text-gray-900"},ds={class:"rounded-xl border border-gray-200 bg-white p-4 text-sm text-gray-700"},is={class:"overflow-x-auto rounded-lg border border-neutral-200 bg-white"},us={class:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between"},cs={class:"space-y-4"},ps={key:1,class:"grid gap-4 sm:grid-cols-2 xl:grid-cols-4"},ms={class:"rounded-xl border border-blue-200 bg-blue-50 p-4"},fs={class:"mt-2 text-2xl font-semibold text-blue-900"},xs={class:"rounded-xl border border-emerald-200 bg-emerald-50 p-4"},gs={class:"mt-2 text-2xl font-semibold text-emerald-900"},ys={class:"rounded-xl border border-amber-200 bg-amber-50 p-4"},bs={class:"mt-2 text-2xl font-semibold text-amber-900"},hs={class:"rounded-xl border border-red-200 bg-red-50 p-4"},vs={class:"mt-2 text-2xl font-semibold text-red-900"},ws={key:2,class:"overflow-x-auto rounded-lg border border-neutral-200 bg-white"},ks={class:"flex flex-col gap-4 md:flex-row md:items-end"},_s={class:"flex flex-col gap-1 text-xs font-semibold text-gray-500 w-full md:w-80"},Cs={key:0,class:"mt-4 text-sm text-red-600"},Ds={class:"space-y-2 text-sm text-gray-700"},Fs=["href"],$s={key:1},As="IEAGHOTMJUAGNWBI",Rs="IEAGHOTMJUAJDRLC",Ps={__name:"dropbox",setup(b){Ke({title:"Dropbox"});const h=m(""),D=m(!1),F=m(""),R=m(null),$=m(null),M=m(null),{data:G,pending:V,error:Y,refresh:Q}=be("/api/admin/dropbox/folders",{server:!1},"$aqx_wtiYz9"),{data:A,pending:H,error:P,refresh:n}=be("/api/dropbox/oauth/status",{server:!1},"$kLvm-8XMeO"),q=ge,S=m("Clients and Contracted Projects"),U=m(!1),g=m(""),L=m(null),X=m(""),J=m(!1),W=m(!1),K=m(!1),C=m(""),f=m(null),ee=m(null),te=w(()=>{var e;const t=P.value;return t?((e=t==null?void 0:t.data)==null?void 0:e.statusMessage)||(t==null?void 0:t.statusMessage)||(t==null?void 0:t.message)||"Request failed":""}),se=w(()=>{var t;return((t=A.value)==null?void 0:t.connectPath)||null}),le=w(()=>{var t;return((t=G.value)==null?void 0:t.tree)||[]}),re=w(()=>Ne(le.value)),we=w(()=>re.value.some(t=>{var e;return(e=t.groupNames)==null?void 0:e.length})),oe=w(()=>{var u;const t=Y.value;if(!t)return"";const e=((u=t==null?void 0:t.data)==null?void 0:u.statusMessage)||(t==null?void 0:t.statusMessage)||(t==null?void 0:t.message)||"Request failed";return e.includes("missing_scope")||e.includes("sharing.read")?"Dropbox rejected the request because the current token does not include sharing.read. Add that scope in the Dropbox app, reconnect Dropbox, and then refresh this page.":e}),ne=w(()=>{var t;return Array.isArray((t=L.value)==null?void 0:t.rows)?L.value.rows:[]}),N=w(()=>{var t;return((t=L.value)==null?void 0:t.summary)||{totalSharedFolders:0,includedFolders:0,excludedFolders:0,foldersNeedingChange:0,alreadyCompliantFolders:0,specialFolderFound:!1}}),B=t=>t==="members"?"Members only":t==="anyone"?"Anyone":t==="team"?"Team":t?String(t).replace(/_/g," "):"Unknown",ke=t=>t==="refresh_token"?"Refresh token":t==="legacy_access_token"?"Legacy access token":t==="unconfigured"?"Unconfigured":String(t||"unknown").replace(/_/g," "),_e=t=>t==="would_change"?{color:"primary",label:"Would change"}:t==="already_compliant"?{color:"neutral",label:"Already compliant"}:{color:"warning",label:"Excluded"},Ce=t=>t==="updated"?{color:"success",label:"Updated"}:t==="failed"?{color:"error",label:"Failed"}:{color:"warning",label:"Skipped"},De=w(()=>C.value?"Apply request failed":f.value?f.value.updatedCount>0&&f.value.failedCount===0?"Apply completed":f.value.updatedCount>0&&f.value.failedCount>0?"Apply completed with failures":f.value.failedCount>0?"Apply failed":"No changes applied":""),Fe=w(()=>C.value?"red":f.value?f.value.failedCount>0?f.value.updatedCount>0?"amber":"red":f.value.updatedCount>0?"green":"blue":"neutral"),de=w(()=>
1{if(C.value)return C.value;const t=f.value;return t?t.updatedCount>0&&t.failedCount===0?`Updated ${t.updatedCount} folder${t.updatedCount===1?"":"s"}. ${t.skippedCount} row${t.skippedCount===1?" was":"s were"} skipped because they were excluded or already compliant.`:t.updatedCount>0&&t.failedCount>0?`Updated ${t.updatedCount} folder${t.updatedCount===1?"":"s"}, but ${t.failedCount} update${t.failedCount===1?"":"s"} failed. Review the Apply Results table below for Dropbox error details.`:t.failedCount>0?`${t.failedCount} update${t.failedCount===1?"":"s"} failed and no folders were changed. Review the Apply Results table below for Dropbox error details.`:`No folder policies were changed. ${t.skippedCount} row${t.skippedCount===1?" was":"s were"} skipped because they were excluded or already compliant.`:""}),ie=w(()=>{const t=X.value.trim().toLowerCase();return ne.value.filter(e=>J.value&&!e.wouldUpdate||W.value&&!e.needsChange?!1:t?[e.name,e.path,e.topLevelName,e.reason,e.currentPolicy,e.accessType].some(u=>String(u||"").toLowerCase().includes(t)):!0)}),$e=[{accessorKey:"status",header:"Status",cell:({row:t})=>{const e=_e(t.original.status);return I(q,{color:e.color,variant:"soft"},()=>e.label)}},{accessorKey:"name",header:"Folder",cell:({row:t})=>t.original.name||"â"},{accessorKey:"path",header:"Path",cell:({row:t})=>I("div",{class:"max-w-sm break-all text-sm text-gray-700"},t.original.path||"â")},{accessorKey:"topLevelName",header:"Top level",cell:({row:t})=>t.original.topLevelName||"â"},{accessorKey:"depthFromTopLevel",header:"Depth"},{accessorKey:"currentPolicy",header:"Current policy",cell:({row:t})=>B(t.original.currentPolicy)},{accessorKey:"targetPolicy",header:"Target",cell:({row:t})=>B(t.original.targetPolicy)},{accessorKey:"reason",header:"Reason",cell:({row:t})=>I("div",{class:"max-w-md whitespace-normal text-sm text-gray-700"},t.original.reason)}],Ae=[{accessorKey:"status",header:"Status",cell:({row:t})=>{const e=Ce(t.original.status);return I(q,{color:e.color,variant:"soft"},()=>e.label)}},{accessorKey:"name",header:"Folder",cell:({row:t})=>t.original.name||"â"},{accessorKey:"path",header:"Path",cell:({row:t})=>I("div",{class:"max-w-sm break-all text-sm text-gray-700"},t.original.path||"â")},{accessorKey:"previousPolicy",header:"Previous",cell:({row:t})=>B(t.original.previousPolicy)},{accessorKey:"targetPolicy",header:"Target",cell:({row:t})=>B(t.original.targetPolicy)},{accessorKey:"reason",header:"Reason",cell:({row:t})=>I("div",{class:"max-w-md whitespace-normal text-sm text-gray-700"},t.original.reason)}],Z=async()=>{var t;U.value=!0,g.value="";try{L.value=await $fetch("/api/admin/dropbox/link-policy-dry-run",{query:{specialFolderName:S.value.trim()||"Clients and Contracted Projects"}})}catch(e){const u=((t=e==null?void 0:e.data)==null?void 0:t.statusMessage)||(e==null?void 0:e.statusMessage)||(e==null?void 0:e.message)||"Request failed";u.includes("missing_scope")||u.includes("sharing.read")?g.value="Dropbox rejected the request because the current token does not include sharing.read. Add that scope in the Dropbox app, reconnect Dropbox, and then rerun the dry run.":g.value=u}finally{U.value=!1}},Re=()=>{f.value=null,C.value=""},Pe=()=>{se.value&&(window.location.href=se.value)},ue=async()=>{var e;await Ge();const t=((e=ee.value)==null?void 0:e.$el)||ee.value;t!=null&&t.scrollIntoView&&t.scrollIntoView({behavior:"smooth",block:"start"})},Ue=async()=>{var u;const t=S.value.trim()||"Clients and Contracted Projects",e=Number(N.value.foldersNeedingChange||0);if(e&&window.confirm(`Apply Dropbox link policy changes to ${e} shared folder${e===1?"":"s"}? 2 3This will update each eligible folder to Members only.`)){K.value=!0,C.value="";try{f.value=await $fetch("/api/admin/dropbox/link-policy-apply",{method:"POST",body:{specialFolderName:t,confirm:!0}}),await Z(),await ue()}catch(c){const d=((u=c==null?void 0:c.data)==null?void 0:u.statusMessage)||(c==null?void 0:c.statusMessage)||(c==null?void 0:c.message)||"Request failed";d.includes("missing_scope")||d.includes("sharing.write")?C.value="Dropbox rejected the update because the current token does not include sharing.write. Add that scope in the Dropbox app, reconnect Dropbox, and then try again.":C.value=d,await ue()}finally{K.value=!1}}},Le=(t,e)=>t.name.localeCompare(e.name,void 0,{sensitivity:"base",numeric:!0}),Ne=t=>{const e=[],u=c=>
3{for(const d of c||[])e.push(d),u(d.children||[])};return u(t),e.sort(Le)},ce=t=>{if(typeof t!="string")return null;let e=t.trim();if(!e)return null;const u=e.match(/href="([^"]*)"/);u&&(e=u[1]);{const c=document.createElement("textarea");c.innerHTML=e,e=c.value}return e=e.trim(),e||null},Me=t=>{var c;const u=(c=(Array.isArray(t==null?void 0:t.customFields)?t.customFields:[]).find(d=>(d==null?void 0:d.id)===As))==null?void 0:c.value;return ce(u)},pe=async()=>{var e,u,c;const t=h.value.trim();if(t){D.value=!0,F.value="",R.value=null,$.value=null,M.value=null;try{const d=await $fetch(`/api/wrike/project?id=${encodeURIComponent(t)}`);R.value=d,$.value=Me(d),M.value=ce((u=(e=d==null?void 0:d.customFields)==null?void 0:e.find(v=>(v==null?void 0:v.id)===Rs))==null?void 0:u.value),$.value||(F.value="No Dropbox link found for that project.")}catch(d){F.value=((c=d==null?void 0:d.data)==null?void 0:c.statusMessage)||(d==null?void 0:d.message)||"Failed to load project."}finally{D.value=!1}}},Se=t=>{const e=[];return t.accessType&&e.push(t.accessType.replace(/_/g," ")),t.isTeamFolder?e.push("team folder"):t.isInsideTeamFolder&&e.push("inside team folder"),e.push(`${t.directUserCount} user${t.directUserCount===1?"":"s"}`),t.inviteeCount&&e.push(`${t.inviteeCount} invite${t.inviteeCount===1?"":"s"}`),t.groupCount&&e.push(`${t.groupCount} group${t.groupCount===1?"":"s"}`),e.join(" ⢠")},Te=t=>["inline-flex","max-w-full","items-center","rounded-full","px-2.5","py-1","text-xs","font-medium","break-all",typeof t=="string"&&t.toLowerCase().includes("@revby.co")?"bg-gray-100 text-gray-800":"bg-red-100 text-red-700"];return Be(()=>{Z()}),(t,e)=>{const u=he,c=Oe,d=ze,v=ve,Ee=ge,E=Ye,ae=He,me=Xe,fe=Je,Ie=We;return o(),a("div",vt,[s("div",wt,[i(c,{to:"/admin/",class:"inline-flex items-center text-brand text-lg"},{default:p(()=>[i(u,{name:"i-lucide-arrow-left",class:"mr-2"}),e[5]||(e[5]=x(" Admin ",-1))]),_:1}),e[52]||(e[52]=s("h1",{class:"text-3xl md:text-4xl font-bold text-neutral-950"},"Dropbox",-1)),i(E,null,{header:p(()=>[s("div",kt,[e[8]||(e[8]=s("div",null,[s("h2",{class:"text-2xl font-semibold text-neutral-950"},"Dropbox Connection"),s("p",{class:"text-sm text-gray-600"}," View the current Dropbox auth mode and reconnect the app when scopes change. ")],-1)),s("div",_t,[i(d,{color:"neutral",variant:"outline",loading:l(H),onClick:l(n)},{default:p(()=>[...e[6]||(e[6]=[x(" Refresh connection ",-1)])]),_:1},8,["loading","onClick"]),i(d,{color:"primary",disabled:!l(se),onClick:Pe},{default:p(()=>[...e[7]||(e[7]=[x(" Reconnect Dropbox ",-1)])]),_:1},8,["disabled"])])])]),default:p(()=>[s("div",Ct,[l(H)&&!l(A)&&!l(te)?(o(),a("div",Dt,[s("div",Ft,[i(u,{name:"i-lucide-loader-2",class:"size-5 animate-spin text-brand"}),e[9]||(e[9]=s("span",null,"Loading Dropbox connection statusâ¦",-1))])])):y("",!0),l(te)?(o(),_(v,{key:1,color:"red",title:"Dropbox connection status could not be loaded",description:l(te)},null,8,["description"])):l(A)?(o(),a(T,{key:2},[i(v,{color:"amber",title:"Reconnect required after scope changes",description:"If you added sharing.write after the original Dropbox authorization, the existing token likely does not include it. Reconnect Dropbox to mint a refresh token with the new scope set."}),s("div",$t,[s("div",At,[s("p",null,[e[10]||(e[10]=s("span",{class:"font-semibold text-gray-900"},"Auth mode:",-1)),x(" "+r(ke(l(A).authMode)),1)]),s("p",null,[e[11]||(e[11]=s("span",{class:"font-semibold text-gray-900"},"App key configured:",-1)),x(" "+r(l(A).hasAppKey?"Yes":"No"),1)]),s("p",null,[e[12]||(e[12]=s("span",{class:"font-semibold text-gray-900"},"App secret configured:",-1)),x(" "+r(l(A).hasAppSecret?"Yes":"No"),1)]),s("p",null,[e[13]||(e[13]=s("span",{class:"font-semibold text-gray-900"},"Refresh token configured:",-1)),x(" "+r(l(A).hasRefreshToken?"Yes":"No"),1)]),s("p",null,[e[14]||(e[14]=s("span",{class:"font-semibold text-gray-900"},"Legacy access token configured:",-1)),x(" "+r(l(A).hasLegacyAccessToken?"Yes":"No"),1)])]),s("div",Rt,[e[15]||(e[15]=s("p",null,[s("span",{class:"font-semibold text-gray-900"},"Redirect URI:")],-1)),s("p",Pt,r(l(A).redirectUri||"â"),1)])]),s("div",Ut,[e[16]||(e[16]=s("div",{class:"text-sm font-semibold text-gray-900"},"Required scopes",-1)),s("div",Lt,[(o(!0),a(T,null,j(l(A).requiredScopes||[],k=>(o(),_(Ee,{key:k,color:"neutral",variant:"soft"},{default:p(()=>[x(r(k),1)]),_:2},1024))),128))])])],64)):y("",!0)])]),_:1}),i(E,null,{header:p(()=>[s("div",Nt,[e[18]||(e[18]=s("div",null,[s("h2",{class:"text-2xl font-semibold text-neutral-950"}
3,"Folder Access"),s("p",{class:"text-sm text-gray-600"}," Lists Dropbox shared folders and the direct email addresses that have access to each folder. ")],-1)),i(d,{color:"neutral",variant:"outline",loading:l(V),onClick:l(Q)},{default:p(()=>[...e[17]||(e[17]=[x(" Refresh folders ",-1)])]),_:1},8,["loading","onClick"])])]),default:p(()=>{var k;return[s("div",Mt,[l(V)&&!l(re).length&&!l(oe)?(o(),a("div",St,[s("div",Tt,[i(u,{name:"i-lucide-loader-2",class:"size-5 animate-spin text-brand"}),e[19]||(e[19]=s("span",null,"Loading Dropbox folder accessâ¦",-1))])])):y("",!0),l(oe)?(o(),_(v,{key:1,color:"red",title:"Dropbox folder access could not be loaded",description:l(oe)},null,8,["description"])):l(we)?(o(),_(v,{key:2,color:"amber",title:"Some access is group-based",description:"Direct user emails are listed below. Group memberships are shown by group name only because this token does not expand group members into individual emails."})):y("",!0),s("p",Et,[e[20]||(e[20]=s("span",{class:"font-semibold text-gray-900"},"Folders found:",-1)),x(" "+r(((k=l(G))==null?void 0:k.totalFolders)??0),1)]),l(le).length?(o(),a("div",It,[(o(!0),a(T,null,j(l(le),xe=>(o(),_(ht,{key:xe.id,node:xe,"format-folder-meta":Se,"get-email-pill-classes":Te},null,8,["node"]))),128))])):!l(V)&&!l(Y)?(o(),a("p",jt," No shared folders were returned by Dropbox. ")):y("",!0)])]}),_:1}),i(E,null,{header:p(()=>[s("div",Vt,[e[23]||(e[23]=s("div",null,[s("h2",{class:"text-2xl font-semibold text-neutral-950"},"Link Policy Dry Run"),s("p",{class:"text-sm text-gray-600"}," Reviews Dropbox shared folders that can have their folder-level link policy updated and applies option B: only children and grandchildren under the special top-level folder are included, while all levels under every other top-level folder are included. ")],-1)),s("div",qt,[i(d,{color:"neutral",variant:"outline",loading:l(U),onClick:Z},{default:p(()=>[...e[21]||(e[21]=[x(" Run dry run ",-1)])]),_:1},8,["loading"]),i(d,{color:"primary",loading:l(K),disabled:l(K)||l(U)||!l(L)||!l(N).foldersNeedingChange,onClick:Ue},{default:p(()=>[...e[22]||(e[22]=[x(" Apply policy changes ",-1)])]),_:1},8,["loading","disabled"])])])]),default:p(()=>[s("div",Kt,[s("div",Bt,[s("label",Ot,[e[24]||(e[24]=s("span",null,"Special top-level folder",-1)),i(ae,{modelValue:l(S),"onUpdate:modelValue":e[0]||(e[0]=k=>z(S)?S.value=k:null),placeholder:"Clients and Contracted Projects",disabled:l(U),onKeyup:ye(Z,["enter"])},null,8,["modelValue","disabled"])]),s("div",zt,[s("label",Gt,[i(me,{modelValue:l(J),"onUpdate:modelValue":e[1]||(e[1]=k=>z(J)?J.value=k:null)},null,8,["modelValue"]),e[25]||(e[25]=s("span",null,"Show included only",-1))]),s("label",Yt,[i(me,{modelValue:l(W),"onUpdate:modelValue":e[2]||(e[2]=k=>z(W)?W.value=k:null)},null,8,["modelValue"]),e[26]||(e[26]=s("span",null,"Show needing change only",-1))])])]),s("label",Ht,[e[27]||(e[27]=s("span",null,"Filter results",-1)),i(ae,{modelValue:l(X),"onUpdate:modelValue":e[3]||(e[3]=k=>z(X)?X.value=k:null),placeholder:"Search by path, reason, or top-level folder",disabled:l(U)},null,8,["modelValue","disabled"])]),i(v,{color:"blue",title:"Dry run only",description:"This view only shows Dropbox shared folders that expose a mutable folder policy. Plain nested folders that are not separate shared folders will not appear here, because they cannot be updated independently."}),i(v,{color:"amber",title:"Apply changes",description:"Applying changes will rerun the selection logic on the server and then update every eligible shared folder to Members only. Excluded and already compliant rows will be skipped automatically."}),i(v,{color:"amber",title:"Dropbox owner requirement",description:"Dropbox only allows the owner of a shared folder to update that folderâs policy. Folders where the connected Dropbox account is not the owner are now excluded before apply runs."}),l(C)?(o(),_(v,{key:0,color:"red",title:"Apply request failed",description:l(C)},null,8,["description"])):l(de)?(o(),_(v,{key:1,color:l(Fe),title:l(De),description:l(de)},null,8,["color","title","description"])):y("",!0),l(U)&&!l(L)&&!l(g)?(o(),a("div",Xt,[s("div",Jt,[i(u,{name:"i-lucide-loader-2",class:"size-5 animate-spin text-brand"}),e[28]||(e[28]=s("span",null,"Running Dropbox link policy dry runâ¦",-1))])])):y("",!0),l(g)?(o(),_(v,{key:3,color:"red",title:"Dry run failed",description:l(g)},null,8,["description"])):l(L)&&!l(N).specialFolderFound?(o(),_(v,{key:4,color:"amber",title:"Special folder not found as a top-level shared folder",description:`No top-level shared folder named '${l(S)}' was found. The dry run still completed, but the special-folder exception was not applied.`},null,8,["description"])):y("",!0),l(L)?(o(),a(T,{key:5},[s("div",Wt,[s("div",Zt,[e[29]||(e[29]=s("div",{class:"text-xs font-semibold uppercase tracking-wide text-gray-500"},"Shared folders",-1)),s("div",Qt,r(l(N).totalSharedFolders),1)]),s("div",es,[e[30]||(e[30]=s("div",{class:"text-xs font-semibold uppercase tracking-wide text-emerald-700"},"Included",-1)),s("div",ts,r(l(N).includedFolders),1)]),s("div",ss,[e[31]||(e[31]=s("div",{class:"text-xs font-semibold uppercase tracking-wide text-amber-700"},"Excluded",-1)),s("div",ls,r(l(N).excludedFolders),1)]),s("div",os,[e[32]||(e[32]=s("div",{class:"text-xs font-semibold uppercase tracking-wide text-blue-700"},"Need change",-1)),s("div",as,r(l(N).foldersNeedingChange),1)]),s("div",rs,[e[33]||(e[33]=s("div",{class:"text-xs font-semibold uppercase tracking-wide text-gray-500"}
3,"Already compliant",-1)),s("div",ns,r(l(N).alreadyCompliantFolders),1)])]),s("div",ds,[s("p",null,[e[34]||(e[34]=s("span",{class:"font-semibold text-gray-900"},"Target policy:",-1)),x(" "+r(B(l(L).targetPolicy)),1)]),e[37]||(e[37]=s("p",null,[s("span",{class:"font-semibold text-gray-900"},"Special-folder rule:"),x(" Leave the special top-level folder itself alone, include only its children and grandchildren. ")],-1)),s("p",null,[e[35]||(e[35]=s("span",{class:"font-semibold text-gray-900"},"Visible rows:",-1)),x(" "+r(l(ie).length)+" of "+r(l(ne).length),1)]),s("p",null,[e[36]||(e[36]=s("span",{class:"font-semibold text-gray-900"},"Rows needing change:",-1)),x(" "+r(l(N).foldersNeedingChange),1)])]),s("div",is,[i(fe,{data:l(ie),columns:$e,class:"min-w-[1100px] dry-run-table"},null,8,["data"])])],64)):y("",!0)])]),_:1}),l(f)||l(C)?(o(),_(E,{key:0,ref_key:"applyResultsCard",ref:ee},{header:p(()=>[s("div",us,[e[39]||(e[39]=s("div",null,[s("h2",{class:"text-2xl font-semibold text-neutral-950"},"Apply Results"),s("p",{class:"text-sm text-gray-600"}," Audit log for the most recent policy-apply run. ")],-1)),i(d,{color:"neutral",variant:"outline",disabled:l(K),onClick:Re},{default:p(()=>[...e[38]||(e[38]=[x(" Clear results ",-1)])]),_:1},8,["disabled"])])]),default:p(()=>[s("div",cs,[l(C)?(o(),_(v,{key:0,color:"red",title:"Apply failed",description:l(C)},null,8,["description"])):y("",!0),l(f)?(o(),a("div",ps,[s("div",ms,[e[40]||(e[40]=s("div",{class:"text-xs font-semibold uppercase tracking-wide text-blue-700"},"Attempted",-1)),s("div",fs,r(l(f).attemptedUpdates),1)]),s("div",xs,[e[41]||(e[41]=s("div",{class:"text-xs font-semibold uppercase tracking-wide text-emerald-700"},"Updated",-1)),s("div",gs,r(l(f).updatedCount),1)]),s("div",ys,[e[42]||(e[42]=s("div",{class:"text-xs font-semibold uppercase tracking-wide text-amber-700"},"Skipped",-1)),s("div",bs,r(l(f).skippedCount),1)]),s("div",hs,[e[43]||(e[43]=s("div",{class:"text-xs font-semibold uppercase tracking-wide text-red-700"},"Failed",-1)),s("div",vs,r(l(f).failedCount),1)])])):y("",!0),l(f)?(o(),a("div",ws,[i(fe,{data:l(f).results||[],columns:Ae,class:"min-w-[1100px] apply-results-table"},null,8,["data"])])):y("",!0)])]),_:1},512)):y("",!0),i(E,null,{header:p(()=>[...e[44]||(e[44]=[s("h2",{class:"text-2xl font-semibold text-neutral-950"},"Project Lookup",-1)])]),default:p(()=>[s("div",ks,[s("label",_s,[e[45]||(e[45]=s("span",null,"Wrike project ID",-1)),i(ae,{modelValue:l(h),"onUpdate:modelValue":e[4]||(e[4]=k=>z(h)?h.value=k:null),placeholder:"e.g. IEABCD12345XYZ",disabled:l(D),onKeyup:ye(pe,["enter"])},null,8,["modelValue","disabled"])]),i(d,{color:"primary",loading:l(D),disabled:l(D)||!l(h).trim(),onClick:pe},{default:p(()=>[...e[46]||(e[46]=[x(" Get Dropbox files ",-1)])]),_:1},8,["loading","disabled"])]),l(F)?(o(),a("p",Cs,r(l(F)),1)):y("",!0)]),_:1}),l(R)?(o(),_(E,{key:1},{header:p(()=>[...e[47]||(e[47]=[s("h2",{class:"text-2xl font-semibold text-neutral-950"},"Project",-1)])]),default:p(()=>[s("div",Ds,[s("p",null,[e[48]||(e[48]=s("span",{class:"font-semibold text-gray-900"},"Title:",-1)),x(" "+r(l(R).title||"â"),1)]),s("p",null,[e[49]||(e[49]=s("span",{class:"font-semibold text-gray-900"},"Project ID:",-1)),x(" "+r(l(R).id||"â"),1)]),s("p",null,[e[50]||(e[50]=s("span",{class:"font-semibold text-gray-900"},"Dropbox link:",-1)),l($)?(o(),a("a",{key:0,href:l($),target:"_blank",class:"text-brand underline break-all"},r(l($)),9,Fs)):(o(),a("span",$s," â "))])])]),_:1})):y("",!0),l($)?(o(),_(E,{key:2},{header:p(()=>[...e[51]||(e[51]=[s("h2",{class:"text-2xl font-semibold text-neutral-950"},"Dropbox Files",-1)])]),default:p(()=>[i(Ie,{"folder-url":l($),"upload-url":l(M)},null,8,["folder-url","upload-url"])]),_:1})):y("",!0)])])}}},Zs=Ze(Ps,[["__scopeId","data-v-794185a7"]]);export{Zs as default};
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.