import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{Sa as i,kn as a}from"./index-qNrVJp-y.js";var o=n(),s=e(t(),1),c=r(),l=`xopc.extensionUiGrants.v1`;function u(){let e=(0,o.c)(79),{t}=i(),n=a(),[r,l]=(0,s.useState)(p),u;e[0]===n?u=e[1]:(u=n.toSorted(f),e[0]=n,e[1]=u);let h=u,g;e[2]===t?g=e[3]:(g=t(`extensionDebug.title`),e[2]=t,e[3]=g);let _;e[4]===g?_=e[5]:(_=(0,c.jsx)(`h1`,{className:`text-lg font-semibold text-fg`,children:g}),e[4]=g,e[5]=_);let v;e[6]===t?v=e[7]:(v=t(`extensionDebug.subtitle`),e[6]=t,e[7]=v);let y;e[8]===v?y=e[9]:(y=(0,c.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:v}),e[8]=v,e[9]=y);let b;e[10]!==_||e[11]!==y?(b=(0,c.jsxs)(`div`,{children:[_,y]}),e[10]=_,e[11]=y,e[12]=b):b=e[12];let x;e[13]===t?x=e[14]:(x=t(`extensionDebug.grantsHeading`),e[13]=t,e[14]=x);let S;e[15]===x?S=e[16]:(S=(0,c.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:x}),e[15]=x,e[16]=S);let C;e[17]===t?C=e[18]:(C=t(`extensionDebug.grantsHint`),e[17]=t,e[18]=C);let w;e[19]===C?w=e[20]:(w=(0,c.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:C}),e[19]=C,e[20]=w);let T;e[21]===r?T=e[22]:(T=(0,c.jsx)(`pre`,{className:`mt-3 max-h-48 overflow-auto rounded-lg border border-edge-subtle bg-surface-muted p-3 font-mono text-xs text-fg`,children:r}),e[21]=r,e[22]=T);let E;e[23]===Symbol.for(`react.memo_cache_sentinel`)?(E=()=>l(m()),e[23]=E):E=e[23];let D;e[24]===t?D=e[25]:(D=t(`extensionDebug.refresh`),e[24]=t,e[25]=D);let O;e[26]===D?O=e[27]:(O=(0,c.jsx)(`button`,{type:`button`,className:`mt-3 rounded-lg border border-edge px-3 py-1.5 text-xs font-medium text-fg hover:bg-surface-hover`,onClick:E,children:D}),e[26]=D,e[27]=O);let k;e[28]!==T||e[29]!==O||e[30]!==S||e[31]!==w?(k=(0,c.jsxs)(`section`,{className:`rounded-xl border border-edge bg-surface-base p-4`,children:[S,w,T,O]}),e[28]=T,e[29]=O,e[30]=S,e[31]=w,e[32]=k):k=e[32];let A;e[33]===t?A=e[34]:(A=t(`extensionDebug.listHeading`),e[33]=t,e[34]=A);let j;e[35]===A?j=e[36]:(j=(0,c.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:A}),e[35]=A,e[36]=j);let M;e[37]===t?M=e[38]:(M=t(`extensionDebug.colId`),e[37]=t,e[38]=M);let N;e[39]===M?N=e[40]:(N=(0,c.jsx)(`th`,{className:`py-2 pr-2`,children:M}),e[39]=M,e[40]=N);let P;e[41]===t?P=e[42]:(P=t(`extensionDebug.colName`),e[41]=t,e[42]=P);let F;e[43]===P?F=e[44]:(F=(0,c.jsx)(`th`,{className:`py-2 pr-2`,children:P}),e[43]=P,e[44]=F);let I;e[45]===t?I=e[46]:(I=t(`extensionDebug.colPermissions`),e[45]=t,e[46]=I);let L;e[47]===I?L=e[48]:(L=(0,c.jsx)(`th`,{className:`py-2`,children:I}),e[47]=I,e[48]=L);let R;e[49]!==N||e[50]!==F||e[51]!==L?(R=(0,c.jsx)(`thead`,{children:(0,c.jsxs)(`tr`,{className:`border-b border-edge text-xs uppercase text-fg-muted`,children:[N,F,L]})}),e[49]=N,e[50]=F,e[51]=L,e[52]=R):R=e[52];let z;e[53]===h?z=e[54]:(z=h.map(d),e[53]=h,e[54]=z);let B;e[55]===z?B=e[56]:(B=(0,c.jsx)(`tbody`,{children:z}),e[55]=z,e[56]=B);let V;e[57]!==R||e[58]!==B?(V=(0,c.jsx)(`div`,{className:`mt-3 overflow-x-auto`,children:(0,c.jsxs)(`table`,{className:`w-full min-w-[32rem] border-collapse text-left text-sm`,children:[R,B]})}),e[57]=R,e[58]=B,e[59]=V):V=e[59];let H;e[60]!==j||e[61]!==V?(H=(0,c.jsxs)(`section`,{className:`rounded-xl border border-edge bg-surface-base p-4`,children:[j,V]}),e[60]=j,e[61]=V,e[62]=H):H=e[62];let U;e[63]===t?U=e[64]:(U=t(`extensionDebug.futureHeading`),e[63]=t,e[64]=U);let W;e[65]===U?W=e[66]:(W=(0,c.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:U}),e[65]=U,e[66]=W);let G;e[67]===t?G=e[68]:(G=t(`extensionDebug.futureBody`),e[67]=t,e[68]=G);let K;e[69]===G?K=e[70]:(K=(0,c.jsx)(`p`,{className:`mt-2`,children:G}),e[69]=G,e[70]=K);let q;e[71]!==W||e[72]!==K?(q=(0,c.jsxs)(`section`,{className:`rounded-xl border border-dashed border-edge-subtle bg-surface-muted/50 p-4 text-sm text-fg-muted`,children:[W,K]}),e[71]=W,e[72]=K,e[73]=q):q=e[73];let J;return e[74]!==k||e[75]!==H||e[76]!==q||e[77]!==b?(J=(0,c.jsxs)(`div`,{className:`mx-auto flex w-full max-w-app-main flex-col gap-6 px-4 py-8`,children:[b,k,H,q]}),e[74]=k,e[75]=H,e[76]=q,e[77]=b,e[78]=J):J=e[78],J}function d(e){return(0,c.jsxs)(`tr`,{className:`border-b border-edge-subtle`,children:[(0,c.jsx)(`td`,{className:`py-2 pr-2 font-mono text-xs text-fg`,children:e.id}),(0,c.jsx)(`td`,{className:`py-2 pr-2 text-fg`,children:e.name}),(0,c.jsx)(`td`,{className:`py-2 font-mono text-xs text-fg-muted`,children:(e.ui?.permissions??[]).join(`, `)||`—`})]},e.id)}function f(e,t){return e.id.localeCompare(t.id)}function p(){return m()}function m(){try{let e=localStorage.getItem(l);if(!e)return`{}`;let t=JSON.parse(e);return JSON.stringify(t,null,2)}catch(e){return e instanceof Error?e.message:String(e)}}export{u as ExtensionDebugPage};