@kuadrant/kuadrant-backstage-plugin-frontend 0.0.2-dev-7d09bfa → 0.0.2-dev-724df72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -4
- package/dist/index.esm.js +1 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/plugin.esm.js +1 -9
- package/dist/plugin.esm.js.map +1 -1
- package/dist-scalprum/internal.plugin-kuadrant.1ec7b1dc71663b4b9a17.js +2 -0
- package/dist-scalprum/internal.plugin-kuadrant.1ec7b1dc71663b4b9a17.js.map +1 -0
- package/dist-scalprum/plugin-manifest.json +2 -2
- package/dist-scalprum/static/1085.d17e689a.chunk.js +3 -0
- package/dist-scalprum/static/1085.d17e689a.chunk.js.map +1 -0
- package/dist-scalprum/static/1645.db086648.chunk.js +3 -0
- package/dist-scalprum/static/{5568.5dbce633.chunk.js.LICENSE.txt → 1645.db086648.chunk.js.LICENSE.txt} +0 -9
- package/dist-scalprum/static/1645.db086648.chunk.js.map +1 -0
- package/dist-scalprum/static/2233.bf0c10d7.chunk.js +3 -0
- package/dist-scalprum/static/2233.bf0c10d7.chunk.js.LICENSE.txt +9 -0
- package/dist-scalprum/static/2233.bf0c10d7.chunk.js.map +1 -0
- package/dist-scalprum/static/2628.20156dc1.chunk.js +3 -0
- package/dist-scalprum/static/2628.20156dc1.chunk.js.map +1 -0
- package/dist-scalprum/static/2946.a35243f1.chunk.js +3 -0
- package/dist-scalprum/static/{9510.e4112e19.chunk.js.LICENSE.txt → 2946.a35243f1.chunk.js.LICENSE.txt} +10 -0
- package/dist-scalprum/static/2946.a35243f1.chunk.js.map +1 -0
- package/dist-scalprum/static/2952.b3c7e41c.chunk.js +2 -0
- package/dist-scalprum/static/2952.b3c7e41c.chunk.js.map +1 -0
- package/dist-scalprum/static/{2967.8d9c1b1f.chunk.js → 2967.6a1db3ad.chunk.js} +2 -2
- package/dist-scalprum/static/2967.6a1db3ad.chunk.js.map +1 -0
- package/dist-scalprum/static/3091.9a74ea5f.chunk.js +2 -0
- package/dist-scalprum/static/{65.0e01be7c.chunk.js.map → 3091.9a74ea5f.chunk.js.map} +1 -1
- package/dist-scalprum/static/{327.cd6b3fee.chunk.js → 327.a9a99299.chunk.js} +2 -2
- package/dist-scalprum/static/327.a9a99299.chunk.js.map +1 -0
- package/dist-scalprum/static/3504.1c2f2e54.chunk.js +3 -0
- package/dist-scalprum/static/3504.1c2f2e54.chunk.js.LICENSE.txt +9 -0
- package/dist-scalprum/static/3504.1c2f2e54.chunk.js.map +1 -0
- package/dist-scalprum/static/3657.882640ca.chunk.js +3 -0
- package/dist-scalprum/static/3657.882640ca.chunk.js.LICENSE.txt +8 -0
- package/dist-scalprum/static/3657.882640ca.chunk.js.map +1 -0
- package/dist-scalprum/static/3954.12dd8006.chunk.js +3 -0
- package/dist-scalprum/static/3954.12dd8006.chunk.js.LICENSE.txt +9 -0
- package/dist-scalprum/static/3954.12dd8006.chunk.js.map +1 -0
- package/dist-scalprum/static/3984.647ef00c.chunk.js +2 -0
- package/dist-scalprum/static/3984.647ef00c.chunk.js.map +1 -0
- package/dist-scalprum/static/4026.d652a7a1.chunk.js +2 -0
- package/dist-scalprum/static/4026.d652a7a1.chunk.js.map +1 -0
- package/dist-scalprum/static/{6386.6386.ce38cef3.css → 4093.4093.3597955d.css} +1 -1
- package/dist-scalprum/static/4093.4093.3597955d.css.map +1 -0
- package/dist-scalprum/static/4093.ee6f0452.chunk.js +3 -0
- package/dist-scalprum/static/4093.ee6f0452.chunk.js.map +1 -0
- package/dist-scalprum/static/4382.a7363415.chunk.js +3 -0
- package/dist-scalprum/static/4382.a7363415.chunk.js.map +1 -0
- package/dist-scalprum/static/4614.23f2a85b.chunk.js +2 -0
- package/dist-scalprum/static/4614.23f2a85b.chunk.js.map +1 -0
- package/dist-scalprum/static/{4682.3c7098a8.chunk.js → 4682.bd2dfccd.chunk.js} +2 -2
- package/dist-scalprum/static/4682.bd2dfccd.chunk.js.map +1 -0
- package/dist-scalprum/static/4935.e14465ff.chunk.js +3 -0
- package/dist-scalprum/static/4935.e14465ff.chunk.js.LICENSE.txt +9 -0
- package/dist-scalprum/static/4935.e14465ff.chunk.js.map +1 -0
- package/dist-scalprum/static/5010.0cd6c959.chunk.js +3 -0
- package/dist-scalprum/static/5010.0cd6c959.chunk.js.map +1 -0
- package/dist-scalprum/static/{5203.43732b3f.chunk.js → 5203.539ed3ec.chunk.js} +2 -2
- package/dist-scalprum/static/{5203.43732b3f.chunk.js.map → 5203.539ed3ec.chunk.js.map} +1 -1
- package/dist-scalprum/static/{5453.b3ee2392.chunk.js → 5453.ecdee66d.chunk.js} +2 -2
- package/dist-scalprum/static/{5453.b3ee2392.chunk.js.map → 5453.ecdee66d.chunk.js.map} +1 -1
- package/dist-scalprum/static/6038.63d1f832.chunk.js +3 -0
- package/dist-scalprum/static/6038.63d1f832.chunk.js.LICENSE.txt +8 -0
- package/dist-scalprum/static/6038.63d1f832.chunk.js.map +1 -0
- package/dist-scalprum/static/635.e030b18a.chunk.js +3 -0
- package/dist-scalprum/static/635.e030b18a.chunk.js.LICENSE.txt +9 -0
- package/dist-scalprum/static/635.e030b18a.chunk.js.map +1 -0
- package/dist-scalprum/static/6371.d45f37cc.chunk.js +2 -0
- package/dist-scalprum/static/6371.d45f37cc.chunk.js.map +1 -0
- package/dist-scalprum/static/{6800.8ec3a2eb.chunk.js → 6800.6e2a08fe.chunk.js} +2 -2
- package/dist-scalprum/static/{6800.8ec3a2eb.chunk.js.map → 6800.6e2a08fe.chunk.js.map} +1 -1
- package/dist-scalprum/static/{6840.6cc88a16.chunk.js → 6840.3bd67cf4.chunk.js} +2 -2
- package/dist-scalprum/static/{6840.6cc88a16.chunk.js.map → 6840.3bd67cf4.chunk.js.map} +1 -1
- package/dist-scalprum/static/7164.5dc4bc72.chunk.js +2 -0
- package/dist-scalprum/static/7164.5dc4bc72.chunk.js.map +1 -0
- package/dist-scalprum/static/{7791.55db7365.chunk.js → 7791.8135d440.chunk.js} +2 -2
- package/dist-scalprum/static/{7791.55db7365.chunk.js.map → 7791.8135d440.chunk.js.map} +1 -1
- package/dist-scalprum/static/8083.4763f88b.chunk.js +206 -0
- package/dist-scalprum/static/8083.4763f88b.chunk.js.LICENSE.txt +9 -0
- package/dist-scalprum/static/8083.4763f88b.chunk.js.map +1 -0
- package/dist-scalprum/static/{8172.e89bbae7.chunk.js → 8172.cbe1f2c4.chunk.js} +2 -2
- package/dist-scalprum/static/8172.cbe1f2c4.chunk.js.map +1 -0
- package/dist-scalprum/static/{8799.4ea4639c.chunk.js → 8799.83d049f3.chunk.js} +2 -2
- package/dist-scalprum/static/{8799.4ea4639c.chunk.js.map → 8799.83d049f3.chunk.js.map} +1 -1
- package/dist-scalprum/static/{3587.490690d6.chunk.js → 9316.d9f2fe18.chunk.js} +2 -2
- package/dist-scalprum/static/{3587.490690d6.chunk.js.map → 9316.d9f2fe18.chunk.js.map} +1 -1
- package/dist-scalprum/static/{5568.5dbce633.chunk.js → 9655.db0c82b2.chunk.js} +3 -3
- package/dist-scalprum/static/9655.db0c82b2.chunk.js.LICENSE.txt +8 -0
- package/dist-scalprum/static/9655.db0c82b2.chunk.js.map +1 -0
- package/dist-scalprum/static/9710.7ec34777.chunk.js +2 -0
- package/dist-scalprum/static/9710.7ec34777.chunk.js.map +1 -0
- package/dist-scalprum/static/{4302.9a59485e.chunk.js → 9738.b037daf3.chunk.js} +2 -2
- package/dist-scalprum/static/9738.b037daf3.chunk.js.map +1 -0
- package/dist-scalprum/static/exposed-PluginRoot.c3fd0cc1.chunk.js +2 -0
- package/dist-scalprum/static/exposed-PluginRoot.c3fd0cc1.chunk.js.map +1 -0
- package/dist-scalprum/static/react-syntax-highlighter_languages_highlight_http.a55e168b.chunk.js +2 -0
- package/dist-scalprum/static/{react-syntax-highlighter_languages_highlight_http.5859273c.chunk.js.map → react-syntax-highlighter_languages_highlight_http.a55e168b.chunk.js.map} +1 -1
- package/package.json +10 -11
- package/dist/components/ApprovalQueueCard/ApprovalQueueCard.esm.js +0 -761
- package/dist/components/ApprovalQueueCard/ApprovalQueueCard.esm.js.map +0 -1
- package/dist/components/ApprovalQueueCard/index.esm.js +0 -2
- package/dist/components/ApprovalQueueCard/index.esm.js.map +0 -1
- package/dist-scalprum/internal.plugin-kuadrant.5d9e1e73c7f21bbed39a.js +0 -2
- package/dist-scalprum/internal.plugin-kuadrant.5d9e1e73c7f21bbed39a.js.map +0 -1
- package/dist-scalprum/static/1994.19e6a1c5.chunk.js +0 -3
- package/dist-scalprum/static/1994.19e6a1c5.chunk.js.map +0 -1
- package/dist-scalprum/static/2628.0605e07f.chunk.js +0 -3
- package/dist-scalprum/static/2628.0605e07f.chunk.js.map +0 -1
- package/dist-scalprum/static/2752.df63f31c.chunk.js +0 -2
- package/dist-scalprum/static/2752.df63f31c.chunk.js.map +0 -1
- package/dist-scalprum/static/2967.8d9c1b1f.chunk.js.map +0 -1
- package/dist-scalprum/static/3097.582b68d3.chunk.js +0 -2
- package/dist-scalprum/static/3097.582b68d3.chunk.js.map +0 -1
- package/dist-scalprum/static/327.cd6b3fee.chunk.js.map +0 -1
- package/dist-scalprum/static/3584.c820a5c7.chunk.js +0 -2
- package/dist-scalprum/static/3584.c820a5c7.chunk.js.map +0 -1
- package/dist-scalprum/static/3647.67079e5f.chunk.js +0 -2
- package/dist-scalprum/static/3647.67079e5f.chunk.js.map +0 -1
- package/dist-scalprum/static/3984.7bc07774.chunk.js +0 -2
- package/dist-scalprum/static/3984.7bc07774.chunk.js.map +0 -1
- package/dist-scalprum/static/4302.9a59485e.chunk.js.map +0 -1
- package/dist-scalprum/static/4682.3c7098a8.chunk.js.map +0 -1
- package/dist-scalprum/static/5010.2228c754.chunk.js +0 -3
- package/dist-scalprum/static/5010.2228c754.chunk.js.map +0 -1
- package/dist-scalprum/static/5568.5dbce633.chunk.js.map +0 -1
- package/dist-scalprum/static/6272.ef31cb1c.chunk.js +0 -2
- package/dist-scalprum/static/6272.ef31cb1c.chunk.js.map +0 -1
- package/dist-scalprum/static/6371.c4899d73.chunk.js +0 -3
- package/dist-scalprum/static/6371.c4899d73.chunk.js.map +0 -1
- package/dist-scalprum/static/6386.6386.ce38cef3.css.map +0 -1
- package/dist-scalprum/static/6386.903891f3.chunk.js +0 -3
- package/dist-scalprum/static/6386.903891f3.chunk.js.map +0 -1
- package/dist-scalprum/static/65.0e01be7c.chunk.js +0 -2
- package/dist-scalprum/static/6753.76832e72.chunk.js +0 -2
- package/dist-scalprum/static/6753.76832e72.chunk.js.map +0 -1
- package/dist-scalprum/static/8172.e89bbae7.chunk.js.map +0 -1
- package/dist-scalprum/static/8627.111cbac9.chunk.js +0 -2
- package/dist-scalprum/static/8627.111cbac9.chunk.js.map +0 -1
- package/dist-scalprum/static/9510.e4112e19.chunk.js +0 -3
- package/dist-scalprum/static/9510.e4112e19.chunk.js.map +0 -1
- package/dist-scalprum/static/9644.7d342123.chunk.js +0 -2
- package/dist-scalprum/static/9644.7d342123.chunk.js.map +0 -1
- package/dist-scalprum/static/993.c164940e.chunk.js +0 -2
- package/dist-scalprum/static/993.c164940e.chunk.js.map +0 -1
- package/dist-scalprum/static/exposed-PluginRoot.5b6638e2.chunk.js +0 -2
- package/dist-scalprum/static/exposed-PluginRoot.5b6638e2.chunk.js.map +0 -1
- package/dist-scalprum/static/react-syntax-highlighter_languages_highlight_http.5859273c.chunk.js +0 -2
- /package/dist-scalprum/static/{6371.c4899d73.chunk.js.LICENSE.txt → 1085.d17e689a.chunk.js.LICENSE.txt} +0 -0
- /package/dist-scalprum/static/{2628.0605e07f.chunk.js.LICENSE.txt → 2628.20156dc1.chunk.js.LICENSE.txt} +0 -0
- /package/dist-scalprum/static/{6386.903891f3.chunk.js.LICENSE.txt → 4093.ee6f0452.chunk.js.LICENSE.txt} +0 -0
- /package/dist-scalprum/static/{1994.19e6a1c5.chunk.js.LICENSE.txt → 4382.a7363415.chunk.js.LICENSE.txt} +0 -0
- /package/dist-scalprum/static/{5010.2228c754.chunk.js.LICENSE.txt → 5010.0cd6c959.chunk.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! For license information please see 4382.a7363415.chunk.js.LICENSE.txt */
|
|
2
|
+
"use strict";(self.webpackChunkinternal_plugin_kuadrant=self.webpackChunkinternal_plugin_kuadrant||[]).push([[4382],{24217:(e,t,n)=>{n.d(t,{J:()=>X});var r=n(22097);const i=(0,r.createApiRef)({id:"plugin.permission.api"}),o={DENY:"DENY",ALLOW:"ALLOW",CONDITIONAL:"CONDITIONAL"};var a=n(95478),s=n(58139);const u=()=>{},c=u(),l=Object,d=e=>e===c,f=e=>"function"==typeof e,g=(e,t)=>({...e,...t}),p=new WeakMap;let v=0;const h=e=>{const t=typeof e,n=e&&e.constructor,r=n==Date;let i,o;if(l(e)!==e||r||n==RegExp)i=r?e.toJSON():"symbol"==t?e.toString():"string"==t?JSON.stringify(e):""+e;else{if(i=p.get(e),i)return i;if(i=++v+"~",p.set(e,i),n==Array){for(i="@",o=0;o<e.length;o++)i+=h(e[o])+",";p.set(e,i)}if(n==l){i="#";const t=l.keys(e).sort();for(;!d(o=t.pop());)d(e[o])||(i+=o+":"+h(e[o])+",");p.set(e,i)}}return i},w=new WeakMap,y={},m={},b="undefined",O=typeof window!=b,E=typeof document!=b,S=(e,t)=>{const n=w.get(e);return[()=>!d(t)&&e.get(t)||y,r=>{if(!d(t)){const i=e.get(t);t in m||(m[t]=i),n[5](t,g(i,r),i||y)}},n[6],()=>!d(t)&&t in m?m[t]:!d(t)&&e.get(t)||y]};let _=!0;const[L,R]=O&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[u,u],k={isOnline:()=>_,isVisible:()=>{const e=E&&document.visibilityState;return d(e)||"hidden"!==e}},T={initFocus:e=>(E&&document.addEventListener("visibilitychange",e),L("focus",e),()=>{E&&document.removeEventListener("visibilitychange",e),R("focus",e)}),initReconnect:e=>{const t=()=>{_=!0,e()},n=()=>{_=!1};return L("online",t),L("offline",n),()=>{R("online",t),R("offline",n)}}},D=!a.useId,V=!O||"Deno"in window,C=V?a.useEffect:a.useLayoutEffect,I="undefined"!=typeof navigator&&navigator.connection,A=!V&&I&&(["slow-2g","2g"].includes(I.effectiveType)||I.saveData),x=e=>{if(f(e))try{e=e()}catch(t){e=""}const t=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?h(e):"",t]};let W=0;const P=()=>++W;async function N(...e){const[t,n,r,i]=e,o=g({populateCache:!0,throwOnError:!0},"boolean"==typeof i?{revalidate:i}:i||{});let a=o.populateCache;const s=o.rollbackOnError;let u=o.optimisticData;const l=o.throwOnError;if(f(n)){const e=n,r=[],i=t.keys();for(const n of i)!/^\$(inf|sub)\$/.test(n)&&e(t.get(n)._k)&&r.push(n);return Promise.all(r.map(p))}return p(n);async function p(n){const[i]=x(n);if(!i)return;const[g,p]=S(t,i),[v,h,y,m]=w.get(t),b=()=>{const e=v[i];return(f(o.revalidate)?o.revalidate(g().data,n):!1!==o.revalidate)&&(delete y[i],delete m[i],e&&e[0])?e[0](2).then(()=>g().data):g().data};if(e.length<3)return b();let O,E=r;const _=P();h[i]=[_,0];const L=!d(u),R=g(),k=R.data,T=R._c,D=d(T)?k:T;if(L&&(u=f(u)?u(D,k):u,p({data:u,_c:D})),f(E))try{E=E(D)}catch(e){O=e}if(E&&f(E.then)){if(E=await E.catch(e=>{O=e}),_!==h[i][0]){if(O)throw O;return E}O&&L&&(e=>"function"==typeof s?s(e):!1!==s)(O)&&(a=!0,p({data:D,_c:c}))}if(a&&!O)if(f(a)){const e=a(E,D);p({data:e,error:c,_c:c})}else p({data:E,error:c,_c:c});if(h[i][1]=P(),Promise.resolve(b()).then(()=>{p({_c:c})}),!O)return E;if(l)throw O}}const F=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},M=(e,t)=>{if(!w.has(e)){const n=g(T,t),r={},i=N.bind(c,e);let o=u;const a={},s=(e,t)=>{const n=a[e]||[];return a[e]=n,n.push(t),()=>n.splice(n.indexOf(t),1)},l=(t,n,r)=>{e.set(t,n);const i=a[t];if(i)for(const e of i)e(n,r)},d=()=>{if(!w.has(e)&&(w.set(e,[r,{},{},{},i,l,s]),!V)){const t=n.initFocus(setTimeout.bind(c,F.bind(c,r,0))),i=n.initReconnect(setTimeout.bind(c,F.bind(c,r,1)));o=()=>{t&&t(),i&&i(),w.delete(e)}}};return d(),[e,i,d,o]}return[e,w.get(e)[4]]},[j,$]=M(new Map),q=g({onLoadingSlow:u,onSuccess:u,onError:u,onErrorRetry:(e,t,n,r,i)=>{const o=n.errorRetryCount,a=i.retryCount,s=~~((Math.random()+.5)*(1<<(a<8?a:8)))*n.errorRetryInterval;!d(o)&&a>o||setTimeout(r,s,i)},onDiscarded:u,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:A?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:A?5e3:3e3,compare:(e,t)=>h(e)==h(t),isPaused:()=>!1,cache:j,mutate:$,fallback:{}},k),J=(e,t)=>{const n=g(e,t);if(t){const{use:r,fallback:i}=e,{use:o,fallback:a}=t;r&&o&&(n.use=r.concat(o)),i&&a&&(n.fallback=g(i,a))}return n},Y=(0,a.createContext)({}),U=O&&window.__SWR_DEVTOOLS_USE__,z=U?window.__SWR_DEVTOOLS_USE__:[],H=z.concat(e=>(t,n,r)=>e(t,n&&((...e)=>{const[r]=x(t),[,,,i]=w.get(j);if(r.startsWith("$inf$"))return n(...e);const o=i[r];return d(o)?n(...e):(delete i[r],o)}),r));U&&(window.__SWR_DEVTOOLS_REACT__=a);const B=a.use||(e=>{if("pending"===e.status)throw e;if("fulfilled"===e.status)return e.value;throw"rejected"===e.status?e.reason:(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e)}),G={dedupe:!0},K=(l.defineProperty(e=>{const{value:t}=e,n=(0,a.useContext)(Y),r=f(t),i=(0,a.useMemo)(()=>r?t(n):t,[r,n,t]),o=(0,a.useMemo)(()=>r?i:J(n,i),[r,n,i]),s=i&&i.provider,u=(0,a.useRef)(c);s&&!u.current&&(u.current=M(s(o.cache||j),i));const l=u.current;return l&&(o.cache=l[0],o.mutate=l[1]),C(()=>{if(l)return l[2]&&l[2](),l[3]},[]),(0,a.createElement)(Y.Provider,g(e,{value:o}))},"defaultValue",{value:q}),Q=(e,t,n)=>{const{cache:r,compare:i,suspense:o,fallbackData:u,revalidateOnMount:l,revalidateIfStale:p,refreshInterval:v,refreshWhenHidden:h,refreshWhenOffline:y,keepPreviousData:m}=n,[E,_,L,R]=w.get(r),[k,T]=x(e),I=(0,a.useRef)(!1),A=(0,a.useRef)(!1),W=(0,a.useRef)(k),F=(0,a.useRef)(t),M=(0,a.useRef)(n),j=()=>M.current,$=()=>j().isVisible()&&j().isOnline(),[q,J,Y,U]=S(r,k),z=(0,a.useRef)({}).current,H=d(u)?n.fallback[k]:u,K=(e,t)=>{for(const n in z){const r=n;if("data"===r){if(!i(e[r],t[r])){if(!d(e[r]))return!1;if(!i(oe,t[r]))return!1}}else if(t[r]!==e[r])return!1}return!0},Q=(0,a.useMemo)(()=>{const e=!!k&&!!t&&(d(l)?!j().isPaused()&&!o&&(!!d(p)||p):l),n=t=>{const n=g(t);return delete n._k,e?{isValidating:!0,isLoading:!0,...n}:n},r=q(),i=U(),a=n(r),s=r===i?a:n(i);let u=a;return[()=>{const e=n(q());return K(e,u)?(u.data=e.data,u.isLoading=e.isLoading,u.isValidating=e.isValidating,u.error=e.error,u):(u=e,e)},()=>s]},[r,k]),X=(0,s.useSyncExternalStore)((0,a.useCallback)(e=>Y(k,(t,n)=>{K(n,t)||e()}),[r,k]),Q[0],Q[1]),Z=!I.current,ee=E[k]&&E[k].length>0,te=X.data,ne=d(te)?H:te,re=X.error,ie=(0,a.useRef)(ne),oe=m?d(te)?ie.current:te:ne,ae=!(ee&&!d(re))&&(Z&&!d(l)?l:!j().isPaused()&&(o?!d(ne)&&p:d(ne)||p)),se=!!(k&&t&&Z&&ae),ue=d(X.isValidating)?se:X.isValidating,ce=d(X.isLoading)?se:X.isLoading,le=(0,a.useCallback)(async e=>{const t=F.current;if(!k||!t||A.current||j().isPaused())return!1;let r,o,a=!0;const s=e||{},u=!L[k]||!s.dedupe,l=()=>D?!A.current&&k===W.current&&I.current:k===W.current,g={isValidating:!1,isLoading:!1},p=()=>{J(g)},v=()=>{const e=L[k];e&&e[1]===o&&delete L[k]},h={isValidating:!0};d(q().data)&&(h.isLoading=!0);try{if(u&&(J(h),n.loadingTimeout&&d(q().data)&&setTimeout(()=>{a&&l()&&j().onLoadingSlow(k,n)},n.loadingTimeout),L[k]=[t(T),P()]),[r,o]=L[k],r=await r,u&&setTimeout(v,n.dedupingInterval),!L[k]||L[k][1]!==o)return u&&l()&&j().onDiscarded(k),!1;g.error=c;const e=_[k];if(!d(e)&&(o<=e[0]||o<=e[1]||0===e[1]))return p(),u&&l()&&j().onDiscarded(k),!1;const s=q().data;g.data=i(s,r)?s:r,u&&l()&&j().onSuccess(r,k,n)}catch(e){v();const t=j(),{shouldRetryOnError:n}=t;t.isPaused()||(g.error=e,u&&l()&&(t.onError(e,k,t),(!0===n||f(n)&&n(e))&&(j().revalidateOnFocus&&j().revalidateOnReconnect&&!$()||t.onErrorRetry(e,k,t,e=>{const t=E[k];t&&t[0]&&t[0](3,e)},{retryCount:(s.retryCount||0)+1,dedupe:!0}))))}return a=!1,p(),!0},[k,r]),de=(0,a.useCallback)((...e)=>N(r,W.current,...e),[]);if(C(()=>{F.current=t,M.current=n,d(te)||(ie.current=te)}),C(()=>{if(!k)return;const e=le.bind(c,G);let t=0;const n=((e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const e=r.indexOf(n);e>=0&&(r[e]=r[r.length-1],r.pop())}})(k,E,(n,r={})=>{if(0==n){const n=Date.now();j().revalidateOnFocus&&n>t&&$()&&(t=n+j().focusThrottleInterval,e())}else if(1==n)j().revalidateOnReconnect&&$()&&e();else{if(2==n)return le();if(3==n)return le(r)}});return A.current=!1,W.current=k,I.current=!0,J({_k:T}),ae&&(d(ne)||V?e():(r=e,O&&typeof window.requestAnimationFrame!=b?window.requestAnimationFrame(r):setTimeout(r,1))),()=>{A.current=!0,n()};var r},[k]),C(()=>{let e;function t(){const t=f(v)?v(q().data):v;t&&-1!==e&&(e=setTimeout(n,t))}function n(){q().error||!h&&!j().isVisible()||!y&&!j().isOnline()?t():le(G).then(t)}return t(),()=>{e&&(clearTimeout(e),e=-1)}},[v,h,y,k]),(0,a.useDebugValue)(oe),o&&d(ne)&&k){if(!D&&V)throw new Error("Fallback data is required when using suspense in SSR.");F.current=t,M.current=n,A.current=!1;const e=R[k];if(!d(e)){const t=de(e);B(t)}if(!d(re))throw re;{const e=le(G);d(oe)||(e.status="fulfilled",e.value=!0),B(e)}}return{mutate:de,get data(){return z.data=!0,oe},get error(){return z.error=!0,re},get isValidating(){return z.isValidating=!0,ue},get isLoading(){return z.isLoading=!0,ce}}},function(...e){const t=g(q,(0,a.useContext)(Y)),[n,r,i]=(e=>f(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(null===e[1]?e[2]:e[1])||{}])(e),o=J(t,i);let s=Q;const{use:u}=o,c=(u||[]).concat(H);for(let e=c.length;e--;)s=c[e](s);return s(n,r||o.fetcher||null,o)});var Q;function X(e){const t=(0,r.useApi)(i),{data:n,error:a}=K(e,async e=>{if("resourceType"in e.permission&&!e.resourceRef)return o.DENY;const{result:n}=await t.authorize(e);return n});return a?{error:a,loading:!1,allowed:!1}:void 0===n?{loading:!0,allowed:!1}:{loading:!1,allowed:n===o.ALLOW}}},58139:(e,t,n)=>{e.exports=n(93296)},83572:(e,t,n)=>{function r({name:e,attributes:t,resourceType:n}){return n?{type:"resource",name:e,attributes:t,resourceType:n}:{type:"basic",name:e,attributes:t}}n.d(t,{i:()=>r})},93296:(e,t,n)=>{var r=n(95478),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=r.useState,a=r.useEffect,s=r.useLayoutEffect,u=r.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch(e){return!0}}var l="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=o({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,c(i)&&l({inst:i})},[e,n,t]),a(function(){return c(i)&&l({inst:i}),e(function(){c(i)&&l({inst:i})})},[e]),u(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:l}}]);
|
|
3
|
+
//# sourceMappingURL=4382.a7363415.chunk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"static/4382.a7363415.chunk.js","mappings":";qKAEA,MAAMA,GAAmB,IAAAC,cAAa,CACpCC,GAAI,0BCHAC,EAAkB,CAItBC,KAAM,OAINC,MAAO,QAIPC,YAAa,e,0BCTf,MAAMC,EAAO,OAKPC,EAA8BD,IAC9BE,EAASC,OACTC,EAAeC,GAAIA,IAAMJ,EACzBK,EAAcD,GAAgB,mBAALA,EACzBE,EAAe,CAACC,EAAGC,KAAI,IAClBD,KACAC,IAQLC,EAAQ,IAAIC,QAElB,IAAIC,EAAU,EASd,MAAMC,EAAcC,IAChB,MAAMC,SAAcD,EACdE,EAAcF,GAAOA,EAAIE,YACzBC,EAASD,GAAeE,KAC9B,IAAIC,EACAC,EACJ,GAAIlB,EAAOY,KAASA,GAAQG,GAAUD,GAAeK,OA8BjDF,EAASF,EAASH,EAAIQ,SAAmB,UAARP,EAAmBD,EAAIS,WAAqB,UAARR,EAAmBS,KAAKC,UAAUX,GAAO,GAAKA,MA9B1D,CAIzD,GADAK,EAAST,EAAMgB,IAAIZ,GACfK,EAAQ,OAAOA,EAMnB,GAFAA,IAAWP,EAAU,IACrBF,EAAMiB,IAAIb,EAAKK,G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ACxE,EAEEC,EAAWL,EAAMK,SACjBhP,EAAY2O,EAAM3O,UAClBC,EAAkB0O,EAAM1O,gBACxBqN,EAAgBqB,EAAMrB,cA0BxB,SAAS2B,EAAuBC,GAC9B,IAAIC,EAAoBD,EAAK5E,YAC7B4E,EAAOA,EAAK/K,MACZ,IACE,IAAIiL,EAAYD,IAChB,OAAQP,EAASM,EAAME,EACzB,CAAE,MAAOxM,GACP,OAAO,CACT,CACF,CAIA,IAAIyM,EACF,oBAAuBjR,aACvB,IAAuBA,OAAOE,eAC9B,IAAuBF,OAAOE,SAASqK,cANzC,SAAgC7E,EAAWwG,GACzC,OAAOA,GACT,EArCA,SAAgCxG,EAAWwG,GACzC,IAAInG,EAAQmG,IACVgF,EAAYN,EAAS,CAAEE,KAAM,CAAE/K,MAAOA,EAAOmG,YAAaA,KAC1D4E,EAAOI,EAAU,GAAGJ,KACpBK,EAAcD,EAAU,GAmB1B,OAlBArP,EACE,WACEiP,EAAK/K,MAAQA,EACb+K,EAAK5E,YAAcA,EACnB2E,EAAuBC,IAASK,EAAY,CAAEL,KAAMA,GACtD,EACA,CAACpL,EAAWK,EAAOmG,IAErBtK,EACE,WAEE,OADAiP,EAAuBC,IAASK,EAAY,CAAEL,KAAMA,IAC7CpL,EAAU,WACfmL,EAAuBC,IAASK,EAAY,CAAEL,KAAMA,GACtD,EACF,EACA,CAACpL,IAEHwJ,EAAcnJ,GACPA,CACT,EAoBAmK,EAAQnD,0BACN,IAAWwD,EAAMxD,qBAAuBwD,EAAMxD,qBAAuBkE,C","sources":["webpack://internal.plugin-kuadrant/./node_modules/@backstage/plugin-permission-react/dist/apis/PermissionApi.esm.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/plugin-permission-react/node_modules/@backstage/plugin-permission-common/dist/types/api.esm.js","webpack://internal.plugin-kuadrant/../../node_modules/swr/dist/_internal/index.mjs","webpack://internal.plugin-kuadrant/../../node_modules/swr/dist/core/index.mjs","webpack://internal.plugin-kuadrant/./node_modules/@backstage/plugin-permission-react/dist/hooks/usePermission.esm.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/plugin-permission-react/node_modules/@backstage/plugin-permission-common/dist/permissions/util.esm.js","webpack://internal.plugin-kuadrant/../../node_modules/use-sync-external-store/shim/index.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/plugin-permission-common/dist/permissions/createPermission.esm.js","webpack://internal.plugin-kuadrant/../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js"],"sourcesContent":["import { createApiRef } from '@backstage/core-plugin-api';\n\nconst permissionApiRef = createApiRef({\n id: \"plugin.permission.api\"\n});\n\nexport { permissionApiRef };\n//# sourceMappingURL=PermissionApi.esm.js.map\n","const AuthorizeResult = {\n /**\n * The authorization request is denied.\n */\n DENY: \"DENY\",\n /**\n * The authorization request is allowed.\n */\n ALLOW: \"ALLOW\",\n /**\n * The authorization request is allowed if the provided conditions are met.\n */\n CONDITIONAL: \"CONDITIONAL\"\n};\n\nexport { AuthorizeResult };\n//# sourceMappingURL=api.esm.js.map\n","import React, { useEffect, useLayoutEffect, createContext, useContext, useMemo, useRef, createElement } from 'react';\n\n// Shared state between server components and client components\nconst noop = ()=>{};\n// Using noop() as the undefined value as undefined can be replaced\n// by something else. Prettier ignore and extra parentheses are necessary here\n// to ensure that tsc doesn't remove the __NOINLINE__ comment.\n// prettier-ignore\nconst UNDEFINED = /*#__NOINLINE__*/ noop();\nconst OBJECT = Object;\nconst isUndefined = (v)=>v === UNDEFINED;\nconst isFunction = (v)=>typeof v == 'function';\nconst mergeObjects = (a, b)=>({\n ...a,\n ...b\n });\nconst isPromiseLike = (x)=>isFunction(x.then);\n\n// use WeakMap to store the object->key mapping\n// so the objects can be garbage collected.\n// WeakMap uses a hashtable under the hood, so the lookup\n// complexity is almost O(1).\nconst table = new WeakMap();\n// counter of the key\nlet counter = 0;\n// A stable hash implementation that supports:\n// - Fast and ensures unique hash properties\n// - Handles unserializable values\n// - Handles object key ordering\n// - Generates short results\n//\n// This is not a serialization function, and the result is not guaranteed to be\n// parsable.\nconst stableHash = (arg)=>{\n const type = typeof arg;\n const constructor = arg && arg.constructor;\n const isDate = constructor == Date;\n let result;\n let index;\n if (OBJECT(arg) === arg && !isDate && constructor != RegExp) {\n // Object/function, not null/date/regexp. Use WeakMap to store the id first.\n // If it's already hashed, directly return the result.\n result = table.get(arg);\n if (result) return result;\n // Store the hash first for circular reference detection before entering the\n // recursive `stableHash` calls.\n // For other objects like set and map, we use this id directly as the hash.\n result = ++counter + '~';\n table.set(arg, result);\n if (constructor == Array) {\n // Array.\n result = '@';\n for(index = 0; index < arg.length; index++){\n result += stableHash(arg[index]) + ',';\n }\n table.set(arg, result);\n }\n if (constructor == OBJECT) {\n // Object, sort keys.\n result = '#';\n const keys = OBJECT.keys(arg).sort();\n while(!isUndefined(index = keys.pop())){\n if (!isUndefined(arg[index])) {\n result += index + ':' + stableHash(arg[index]) + ',';\n }\n }\n table.set(arg, result);\n }\n } else {\n result = isDate ? arg.toJSON() : type == 'symbol' ? arg.toString() : type == 'string' ? JSON.stringify(arg) : '' + arg;\n }\n return result;\n};\n\n// Global state used to deduplicate requests and store listeners\nconst SWRGlobalState = new WeakMap();\n\nconst EMPTY_CACHE = {};\nconst INITIAL_CACHE = {};\nconst STR_UNDEFINED = 'undefined';\n// NOTE: Use the function to guarantee it's re-evaluated between jsdom and node runtime for tests.\nconst isWindowDefined = typeof window != STR_UNDEFINED;\nconst isDocumentDefined = typeof document != STR_UNDEFINED;\nconst hasRequestAnimationFrame = ()=>isWindowDefined && typeof window['requestAnimationFrame'] != STR_UNDEFINED;\nconst createCacheHelper = (cache, key)=>{\n const state = SWRGlobalState.get(cache);\n return [\n // Getter\n ()=>!isUndefined(key) && cache.get(key) || EMPTY_CACHE,\n // Setter\n (info)=>{\n if (!isUndefined(key)) {\n const prev = cache.get(key);\n // Before writing to the store, we keep the value in the initial cache\n // if it's not there yet.\n if (!(key in INITIAL_CACHE)) {\n INITIAL_CACHE[key] = prev;\n }\n state[5](key, mergeObjects(prev, info), prev || EMPTY_CACHE);\n }\n },\n // Subscriber\n state[6],\n // Get server cache snapshot\n ()=>{\n if (!isUndefined(key)) {\n // If the cache was updated on the client, we return the stored initial value.\n if (key in INITIAL_CACHE) return INITIAL_CACHE[key];\n }\n // If we haven't done any client-side updates, we return the current value.\n return !isUndefined(key) && cache.get(key) || EMPTY_CACHE;\n }\n ];\n} // export { UNDEFINED, OBJECT, isUndefined, isFunction, mergeObjects, isPromiseLike }\n;\n\n/**\n * Due to the bug https://bugs.chromium.org/p/chromium/issues/detail?id=678075,\n * it's not reliable to detect if the browser is currently online or offline\n * based on `navigator.onLine`.\n * As a workaround, we always assume it's online on the first load, and change\n * the status upon `online` or `offline` events.\n */ let online = true;\nconst isOnline = ()=>online;\n// For node and React Native, `add/removeEventListener` doesn't exist on window.\nconst [onWindowEvent, offWindowEvent] = isWindowDefined && window.addEventListener ? [\n window.addEventListener.bind(window),\n window.removeEventListener.bind(window)\n] : [\n noop,\n noop\n];\nconst isVisible = ()=>{\n const visibilityState = isDocumentDefined && document.visibilityState;\n return isUndefined(visibilityState) || visibilityState !== 'hidden';\n};\nconst initFocus = (callback)=>{\n // focus revalidate\n if (isDocumentDefined) {\n document.addEventListener('visibilitychange', callback);\n }\n onWindowEvent('focus', callback);\n return ()=>{\n if (isDocumentDefined) {\n document.removeEventListener('visibilitychange', callback);\n }\n offWindowEvent('focus', callback);\n };\n};\nconst initReconnect = (callback)=>{\n // revalidate on reconnected\n const onOnline = ()=>{\n online = true;\n callback();\n };\n // nothing to revalidate, just update the status\n const onOffline = ()=>{\n online = false;\n };\n onWindowEvent('online', onOnline);\n onWindowEvent('offline', onOffline);\n return ()=>{\n offWindowEvent('online', onOnline);\n offWindowEvent('offline', onOffline);\n };\n};\nconst preset = {\n isOnline,\n isVisible\n};\nconst defaultConfigOptions = {\n initFocus,\n initReconnect\n};\n\nconst IS_REACT_LEGACY = !React.useId;\nconst IS_SERVER = !isWindowDefined || 'Deno' in window;\n// Polyfill requestAnimationFrame\nconst rAF = (f)=>hasRequestAnimationFrame() ? window['requestAnimationFrame'](f) : setTimeout(f, 1);\n// React currently throws a warning when using useLayoutEffect on the server.\n// To get around it, we can conditionally useEffect on the server (no-op) and\n// useLayoutEffect in the browser.\nconst useIsomorphicLayoutEffect = IS_SERVER ? useEffect : useLayoutEffect;\n// This assignment is to extend the Navigator type to use effectiveType.\nconst navigatorConnection = typeof navigator !== 'undefined' && navigator.connection;\n// Adjust the config based on slow connection status (<= 70Kbps).\nconst slowConnection = !IS_SERVER && navigatorConnection && ([\n 'slow-2g',\n '2g'\n].includes(navigatorConnection.effectiveType) || navigatorConnection.saveData);\n\nconst serialize = (key)=>{\n if (isFunction(key)) {\n try {\n key = key();\n } catch (err) {\n // dependencies not ready\n key = '';\n }\n }\n // Use the original key as the argument of fetcher. This can be a string or an\n // array of values.\n const args = key;\n // If key is not falsy, or not an empty array, hash it.\n key = typeof key == 'string' ? key : (Array.isArray(key) ? key.length : key) ? stableHash(key) : '';\n return [\n key,\n args\n ];\n};\n\n// Global timestamp.\nlet __timestamp = 0;\nconst getTimestamp = ()=>++__timestamp;\n\nconst FOCUS_EVENT = 0;\nconst RECONNECT_EVENT = 1;\nconst MUTATE_EVENT = 2;\nconst ERROR_REVALIDATE_EVENT = 3;\n\nvar events = {\n __proto__: null,\n ERROR_REVALIDATE_EVENT: ERROR_REVALIDATE_EVENT,\n FOCUS_EVENT: FOCUS_EVENT,\n MUTATE_EVENT: MUTATE_EVENT,\n RECONNECT_EVENT: RECONNECT_EVENT\n};\n\nasync function internalMutate(...args) {\n const [cache, _key, _data, _opts] = args;\n // When passing as a boolean, it's explicitly used to disable/enable\n // revalidation.\n const options = mergeObjects({\n populateCache: true,\n throwOnError: true\n }, typeof _opts === 'boolean' ? {\n revalidate: _opts\n } : _opts || {});\n let populateCache = options.populateCache;\n const rollbackOnErrorOption = options.rollbackOnError;\n let optimisticData = options.optimisticData;\n const rollbackOnError = (error)=>{\n return typeof rollbackOnErrorOption === 'function' ? rollbackOnErrorOption(error) : rollbackOnErrorOption !== false;\n };\n const throwOnError = options.throwOnError;\n // If the second argument is a key filter, return the mutation results for all\n // filtered keys.\n if (isFunction(_key)) {\n const keyFilter = _key;\n const matchedKeys = [];\n const it = cache.keys();\n for (const key of it){\n if (// Skip the special useSWRInfinite and useSWRSubscription keys.\n !/^\\$(inf|sub)\\$/.test(key) && keyFilter(cache.get(key)._k)) {\n matchedKeys.push(key);\n }\n }\n return Promise.all(matchedKeys.map(mutateByKey));\n }\n return mutateByKey(_key);\n async function mutateByKey(_k) {\n // Serialize key\n const [key] = serialize(_k);\n if (!key) return;\n const [get, set] = createCacheHelper(cache, key);\n const [EVENT_REVALIDATORS, MUTATION, FETCH, PRELOAD] = SWRGlobalState.get(cache);\n const startRevalidate = ()=>{\n const revalidators = EVENT_REVALIDATORS[key];\n const revalidate = isFunction(options.revalidate) ? options.revalidate(get().data, _k) : options.revalidate !== false;\n if (revalidate) {\n // Invalidate the key by deleting the concurrent request markers so new\n // requests will not be deduped.\n delete FETCH[key];\n delete PRELOAD[key];\n if (revalidators && revalidators[0]) {\n return revalidators[0](MUTATE_EVENT).then(()=>get().data);\n }\n }\n return get().data;\n };\n // If there is no new data provided, revalidate the key with current state.\n if (args.length < 3) {\n // Revalidate and broadcast state.\n return startRevalidate();\n }\n let data = _data;\n let error;\n // Update global timestamps.\n const beforeMutationTs = getTimestamp();\n MUTATION[key] = [\n beforeMutationTs,\n 0\n ];\n const hasOptimisticData = !isUndefined(optimisticData);\n const state = get();\n // `displayedData` is the current value on screen. It could be the optimistic value\n // that is going to be overridden by a `committedData`, or get reverted back.\n // `committedData` is the validated value that comes from a fetch or mutation.\n const displayedData = state.data;\n const currentData = state._c;\n const committedData = isUndefined(currentData) ? displayedData : currentData;\n // Do optimistic data update.\n if (hasOptimisticData) {\n optimisticData = isFunction(optimisticData) ? optimisticData(committedData, displayedData) : optimisticData;\n // When we set optimistic data, backup the current committedData data in `_c`.\n set({\n data: optimisticData,\n _c: committedData\n });\n }\n if (isFunction(data)) {\n // `data` is a function, call it passing current cache value.\n try {\n data = data(committedData);\n } catch (err) {\n // If it throws an error synchronously, we shouldn't update the cache.\n error = err;\n }\n }\n // `data` is a promise/thenable, resolve the final data first.\n if (data && isPromiseLike(data)) {\n // This means that the mutation is async, we need to check timestamps to\n // avoid race conditions.\n data = await data.catch((err)=>{\n error = err;\n });\n // Check if other mutations have occurred since we've started this mutation.\n // If there's a race we don't update cache or broadcast the change,\n // just return the data.\n if (beforeMutationTs !== MUTATION[key][0]) {\n if (error) throw error;\n return data;\n } else if (error && hasOptimisticData && rollbackOnError(error)) {\n // Rollback. Always populate the cache in this case but without\n // transforming the data.\n populateCache = true;\n // Reset data to be the latest committed data, and clear the `_c` value.\n set({\n data: committedData,\n _c: UNDEFINED\n });\n }\n }\n // If we should write back the cache after request.\n if (populateCache) {\n if (!error) {\n // Transform the result into data.\n if (isFunction(populateCache)) {\n const populateCachedData = populateCache(data, committedData);\n set({\n data: populateCachedData,\n error: UNDEFINED,\n _c: UNDEFINED\n });\n } else {\n // Only update cached data and reset the error if there's no error. Data can be `undefined` here.\n set({\n data,\n error: UNDEFINED,\n _c: UNDEFINED\n });\n }\n }\n }\n // Reset the timestamp to mark the mutation has ended.\n MUTATION[key][1] = getTimestamp();\n // Update existing SWR Hooks' internal states:\n Promise.resolve(startRevalidate()).then(()=>{\n // The mutation and revalidation are ended, we can clear it since the data is\n // not an optimistic value anymore.\n set({\n _c: UNDEFINED\n });\n });\n // Throw error or return data\n if (error) {\n if (throwOnError) throw error;\n return;\n }\n return data;\n }\n}\n\nconst revalidateAllKeys = (revalidators, type)=>{\n for(const key in revalidators){\n if (revalidators[key][0]) revalidators[key][0](type);\n }\n};\nconst initCache = (provider, options)=>{\n // The global state for a specific provider will be used to deduplicate\n // requests and store listeners. As well as a mutate function that is bound to\n // the cache.\n // The provider's global state might be already initialized. Let's try to get the\n // global state associated with the provider first.\n if (!SWRGlobalState.has(provider)) {\n const opts = mergeObjects(defaultConfigOptions, options);\n // If there's no global state bound to the provider, create a new one with the\n // new mutate function.\n const EVENT_REVALIDATORS = {};\n const mutate = internalMutate.bind(UNDEFINED, provider);\n let unmount = noop;\n const subscriptions = {};\n const subscribe = (key, callback)=>{\n const subs = subscriptions[key] || [];\n subscriptions[key] = subs;\n subs.push(callback);\n return ()=>subs.splice(subs.indexOf(callback), 1);\n };\n const setter = (key, value, prev)=>{\n provider.set(key, value);\n const subs = subscriptions[key];\n if (subs) {\n for (const fn of subs){\n fn(value, prev);\n }\n }\n };\n const initProvider = ()=>{\n if (!SWRGlobalState.has(provider)) {\n // Update the state if it's new, or if the provider has been extended.\n SWRGlobalState.set(provider, [\n EVENT_REVALIDATORS,\n {},\n {},\n {},\n mutate,\n setter,\n subscribe\n ]);\n if (!IS_SERVER) {\n // When listening to the native events for auto revalidations,\n // we intentionally put a delay (setTimeout) here to make sure they are\n // fired after immediate JavaScript executions, which can be\n // React's state updates.\n // This avoids some unnecessary revalidations such as\n // https://github.com/vercel/swr/issues/1680.\n const releaseFocus = opts.initFocus(setTimeout.bind(UNDEFINED, revalidateAllKeys.bind(UNDEFINED, EVENT_REVALIDATORS, FOCUS_EVENT)));\n const releaseReconnect = opts.initReconnect(setTimeout.bind(UNDEFINED, revalidateAllKeys.bind(UNDEFINED, EVENT_REVALIDATORS, RECONNECT_EVENT)));\n unmount = ()=>{\n releaseFocus && releaseFocus();\n releaseReconnect && releaseReconnect();\n // When un-mounting, we need to remove the cache provider from the state\n // storage too because it's a side-effect. Otherwise, when re-mounting we\n // will not re-register those event listeners.\n SWRGlobalState.delete(provider);\n };\n }\n }\n };\n initProvider();\n // This is a new provider, we need to initialize it and setup DOM events\n // listeners for `focus` and `reconnect` actions.\n // We might want to inject an extra layer on top of `provider` in the future,\n // such as key serialization, auto GC, etc.\n // For now, it's just a `Map` interface without any modifications.\n return [\n provider,\n mutate,\n initProvider,\n unmount\n ];\n }\n return [\n provider,\n SWRGlobalState.get(provider)[4]\n ];\n};\n\n// error retry\nconst onErrorRetry = (_, __, config, revalidate, opts)=>{\n const maxRetryCount = config.errorRetryCount;\n const currentRetryCount = opts.retryCount;\n // Exponential backoff\n const timeout = ~~((Math.random() + 0.5) * (1 << (currentRetryCount < 8 ? currentRetryCount : 8))) * config.errorRetryInterval;\n if (!isUndefined(maxRetryCount) && currentRetryCount > maxRetryCount) {\n return;\n }\n setTimeout(revalidate, timeout, opts);\n};\nconst compare = (currentData, newData)=>stableHash(currentData) == stableHash(newData);\n// Default cache provider\nconst [cache, mutate] = initCache(new Map());\n// Default config\nconst defaultConfig = mergeObjects({\n // events\n onLoadingSlow: noop,\n onSuccess: noop,\n onError: noop,\n onErrorRetry,\n onDiscarded: noop,\n // switches\n revalidateOnFocus: true,\n revalidateOnReconnect: true,\n revalidateIfStale: true,\n shouldRetryOnError: true,\n // timeouts\n errorRetryInterval: slowConnection ? 10000 : 5000,\n focusThrottleInterval: 5 * 1000,\n dedupingInterval: 2 * 1000,\n loadingTimeout: slowConnection ? 5000 : 3000,\n // providers\n compare,\n isPaused: ()=>false,\n cache,\n mutate,\n fallback: {}\n}, // use web preset by default\npreset);\n\nconst mergeConfigs = (a, b)=>{\n // Need to create a new object to avoid mutating the original here.\n const v = mergeObjects(a, b);\n // If two configs are provided, merge their `use` and `fallback` options.\n if (b) {\n const { use: u1, fallback: f1 } = a;\n const { use: u2, fallback: f2 } = b;\n if (u1 && u2) {\n v.use = u1.concat(u2);\n }\n if (f1 && f2) {\n v.fallback = mergeObjects(f1, f2);\n }\n }\n return v;\n};\n\nconst SWRConfigContext = createContext({});\nconst SWRConfig = (props)=>{\n const { value } = props;\n const parentConfig = useContext(SWRConfigContext);\n const isFunctionalConfig = isFunction(value);\n const config = useMemo(()=>isFunctionalConfig ? value(parentConfig) : value, [\n isFunctionalConfig,\n parentConfig,\n value\n ]);\n // Extend parent context values and middleware.\n const extendedConfig = useMemo(()=>isFunctionalConfig ? config : mergeConfigs(parentConfig, config), [\n isFunctionalConfig,\n parentConfig,\n config\n ]);\n // Should not use the inherited provider.\n const provider = config && config.provider;\n // initialize the cache only on first access.\n const cacheContextRef = useRef(UNDEFINED);\n if (provider && !cacheContextRef.current) {\n cacheContextRef.current = initCache(provider(extendedConfig.cache || cache), config);\n }\n const cacheContext = cacheContextRef.current;\n // Override the cache if a new provider is given.\n if (cacheContext) {\n extendedConfig.cache = cacheContext[0];\n extendedConfig.mutate = cacheContext[1];\n }\n // Unsubscribe events.\n useIsomorphicLayoutEffect(()=>{\n if (cacheContext) {\n cacheContext[2] && cacheContext[2]();\n return cacheContext[3];\n }\n }, []);\n return createElement(SWRConfigContext.Provider, mergeObjects(props, {\n value: extendedConfig\n }));\n};\n\nconst INFINITE_PREFIX = '$inf$';\n\n// @ts-expect-error\nconst enableDevtools = isWindowDefined && window.__SWR_DEVTOOLS_USE__;\nconst use = enableDevtools ? window.__SWR_DEVTOOLS_USE__ : [];\nconst setupDevTools = ()=>{\n if (enableDevtools) {\n // @ts-expect-error\n window.__SWR_DEVTOOLS_REACT__ = React;\n }\n};\n\nconst normalize = (args)=>{\n return isFunction(args[1]) ? [\n args[0],\n args[1],\n args[2] || {}\n ] : [\n args[0],\n null,\n (args[1] === null ? args[2] : args[1]) || {}\n ];\n};\n\nconst useSWRConfig = ()=>{\n return mergeObjects(defaultConfig, useContext(SWRConfigContext));\n};\n\nconst preload = (key_, fetcher)=>{\n const [key, fnArg] = serialize(key_);\n const [, , , PRELOAD] = SWRGlobalState.get(cache);\n // Prevent preload to be called multiple times before used.\n if (PRELOAD[key]) return PRELOAD[key];\n const req = fetcher(fnArg);\n PRELOAD[key] = req;\n return req;\n};\nconst middleware = (useSWRNext)=>(key_, fetcher_, config)=>{\n // fetcher might be a sync function, so this should not be an async function\n const fetcher = fetcher_ && ((...args)=>{\n const [key] = serialize(key_);\n const [, , , PRELOAD] = SWRGlobalState.get(cache);\n if (key.startsWith(INFINITE_PREFIX)) {\n // we want the infinite fetcher to be called.\n // handling of the PRELOAD cache happens there.\n return fetcher_(...args);\n }\n const req = PRELOAD[key];\n if (isUndefined(req)) return fetcher_(...args);\n delete PRELOAD[key];\n return req;\n });\n return useSWRNext(key_, fetcher, config);\n };\n\nconst BUILT_IN_MIDDLEWARE = use.concat(middleware);\n\n// It's tricky to pass generic types as parameters, so we just directly override\n// the types here.\nconst withArgs = (hook)=>{\n return function useSWRArgs(...args) {\n // Get the default and inherited configuration.\n const fallbackConfig = useSWRConfig();\n // Normalize arguments.\n const [key, fn, _config] = normalize(args);\n // Merge configurations.\n const config = mergeConfigs(fallbackConfig, _config);\n // Apply middleware\n let next = hook;\n const { use } = config;\n const middleware = (use || []).concat(BUILT_IN_MIDDLEWARE);\n for(let i = middleware.length; i--;){\n next = middleware[i](next);\n }\n return next(key, fn || config.fetcher || null, config);\n };\n};\n\n// Add a callback function to a list of keyed callback functions and return\n// the unsubscribe function.\nconst subscribeCallback = (key, callbacks, callback)=>{\n const keyedRevalidators = callbacks[key] || (callbacks[key] = []);\n keyedRevalidators.push(callback);\n return ()=>{\n const index = keyedRevalidators.indexOf(callback);\n if (index >= 0) {\n // O(1): faster than splice\n keyedRevalidators[index] = keyedRevalidators[keyedRevalidators.length - 1];\n keyedRevalidators.pop();\n }\n };\n};\n\n// Create a custom hook with a middleware\nconst withMiddleware = (useSWR, middleware)=>{\n return (...args)=>{\n const [key, fn, config] = normalize(args);\n const uses = (config.use || []).concat(middleware);\n return useSWR(key, fn, {\n ...config,\n use: uses\n });\n };\n};\n\nsetupDevTools();\n\nexport { INFINITE_PREFIX, IS_REACT_LEGACY, IS_SERVER, OBJECT, SWRConfig, SWRGlobalState, UNDEFINED, cache, compare, createCacheHelper, defaultConfig, defaultConfigOptions, getTimestamp, hasRequestAnimationFrame, initCache, internalMutate, isDocumentDefined, isFunction, isPromiseLike, isUndefined, isWindowDefined, mergeConfigs, mergeObjects, mutate, noop, normalize, preload, preset, rAF, events as revalidateEvents, serialize, slowConnection, stableHash, subscribeCallback, useIsomorphicLayoutEffect, useSWRConfig, withArgs, withMiddleware };\n","import 'client-only';\nimport ReactExports, { useRef, useMemo, useCallback, useDebugValue } from 'react';\nimport { useSyncExternalStore } from 'use-sync-external-store/shim/index.js';\nimport { serialize, OBJECT, SWRConfig as SWRConfig$1, defaultConfig, withArgs, SWRGlobalState, createCacheHelper, isUndefined, getTimestamp, UNDEFINED, isFunction, revalidateEvents, internalMutate, useIsomorphicLayoutEffect, subscribeCallback, IS_SERVER, rAF, IS_REACT_LEGACY, mergeObjects } from 'swr/_internal';\nexport { mutate, preload, useSWRConfig } from 'swr/_internal';\n\nconst unstable_serialize = (key)=>serialize(key)[0];\n\n/// <reference types=\"react/experimental\" />\nconst use = ReactExports.use || ((promise)=>{\n if (promise.status === 'pending') {\n throw promise;\n } else if (promise.status === 'fulfilled') {\n return promise.value;\n } else if (promise.status === 'rejected') {\n throw promise.reason;\n } else {\n promise.status = 'pending';\n promise.then((v)=>{\n promise.status = 'fulfilled';\n promise.value = v;\n }, (e)=>{\n promise.status = 'rejected';\n promise.reason = e;\n });\n throw promise;\n }\n});\nconst WITH_DEDUPE = {\n dedupe: true\n};\nconst useSWRHandler = (_key, fetcher, config)=>{\n const { cache, compare, suspense, fallbackData, revalidateOnMount, revalidateIfStale, refreshInterval, refreshWhenHidden, refreshWhenOffline, keepPreviousData } = config;\n const [EVENT_REVALIDATORS, MUTATION, FETCH, PRELOAD] = SWRGlobalState.get(cache);\n // `key` is the identifier of the SWR internal state,\n // `fnArg` is the argument/arguments parsed from the key, which will be passed\n // to the fetcher.\n // All of them are derived from `_key`.\n const [key, fnArg] = serialize(_key);\n // If it's the initial render of this hook.\n const initialMountedRef = useRef(false);\n // If the hook is unmounted already. This will be used to prevent some effects\n // to be called after unmounting.\n const unmountedRef = useRef(false);\n // Refs to keep the key and config.\n const keyRef = useRef(key);\n const fetcherRef = useRef(fetcher);\n const configRef = useRef(config);\n const getConfig = ()=>configRef.current;\n const isActive = ()=>getConfig().isVisible() && getConfig().isOnline();\n const [getCache, setCache, subscribeCache, getInitialCache] = createCacheHelper(cache, key);\n const stateDependencies = useRef({}).current;\n const fallback = isUndefined(fallbackData) ? config.fallback[key] : fallbackData;\n const isEqual = (prev, current)=>{\n for(const _ in stateDependencies){\n const t = _;\n if (t === 'data') {\n if (!compare(prev[t], current[t])) {\n if (!isUndefined(prev[t])) {\n return false;\n }\n if (!compare(returnedData, current[t])) {\n return false;\n }\n }\n } else {\n if (current[t] !== prev[t]) {\n return false;\n }\n }\n }\n return true;\n };\n const getSnapshot = useMemo(()=>{\n const shouldStartRequest = (()=>{\n if (!key) return false;\n if (!fetcher) return false;\n // If `revalidateOnMount` is set, we take the value directly.\n if (!isUndefined(revalidateOnMount)) return revalidateOnMount;\n // If it's paused, we skip revalidation.\n if (getConfig().isPaused()) return false;\n if (suspense) return false;\n if (!isUndefined(revalidateIfStale)) return revalidateIfStale;\n return true;\n })();\n // Get the cache and merge it with expected states.\n const getSelectedCache = (state)=>{\n // We only select the needed fields from the state.\n const snapshot = mergeObjects(state);\n delete snapshot._k;\n if (!shouldStartRequest) {\n return snapshot;\n }\n return {\n isValidating: true,\n isLoading: true,\n ...snapshot\n };\n };\n const cachedData = getCache();\n const initialData = getInitialCache();\n const clientSnapshot = getSelectedCache(cachedData);\n const serverSnapshot = cachedData === initialData ? clientSnapshot : getSelectedCache(initialData);\n // To make sure that we are returning the same object reference to avoid\n // unnecessary re-renders, we keep the previous snapshot and use deep\n // comparison to check if we need to return a new one.\n let memorizedSnapshot = clientSnapshot;\n return [\n ()=>{\n const newSnapshot = getSelectedCache(getCache());\n const compareResult = isEqual(newSnapshot, memorizedSnapshot);\n if (compareResult) {\n // Mentally, we should always return the `memorizedSnapshot` here\n // as there's no change between the new and old snapshots.\n // However, since the `isEqual` function only compares selected fields,\n // the values of the unselected fields might be changed. That's\n // simply because we didn't track them.\n // To support the case in https://github.com/vercel/swr/pull/2576,\n // we need to update these fields in the `memorizedSnapshot` too\n // with direct mutations to ensure the snapshot is always up-to-date\n // even for the unselected fields, but only trigger re-renders when\n // the selected fields are changed.\n memorizedSnapshot.data = newSnapshot.data;\n memorizedSnapshot.isLoading = newSnapshot.isLoading;\n memorizedSnapshot.isValidating = newSnapshot.isValidating;\n memorizedSnapshot.error = newSnapshot.error;\n return memorizedSnapshot;\n } else {\n memorizedSnapshot = newSnapshot;\n return newSnapshot;\n }\n },\n ()=>serverSnapshot\n ];\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n cache,\n key\n ]);\n // Get the current state that SWR should return.\n const cached = useSyncExternalStore(useCallback((callback)=>subscribeCache(key, (current, prev)=>{\n if (!isEqual(prev, current)) callback();\n }), // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n cache,\n key\n ]), getSnapshot[0], getSnapshot[1]);\n const isInitialMount = !initialMountedRef.current;\n const hasRevalidator = EVENT_REVALIDATORS[key] && EVENT_REVALIDATORS[key].length > 0;\n const cachedData = cached.data;\n const data = isUndefined(cachedData) ? fallback : cachedData;\n const error = cached.error;\n // Use a ref to store previously returned data. Use the initial data as its initial value.\n const laggyDataRef = useRef(data);\n const returnedData = keepPreviousData ? isUndefined(cachedData) ? laggyDataRef.current : cachedData : data;\n // - Suspense mode and there's stale data for the initial render.\n // - Not suspense mode and there is no fallback data and `revalidateIfStale` is enabled.\n // - `revalidateIfStale` is enabled but `data` is not defined.\n const shouldDoInitialRevalidation = (()=>{\n // if a key already has revalidators and also has error, we should not trigger revalidation\n if (hasRevalidator && !isUndefined(error)) return false;\n // If `revalidateOnMount` is set, we take the value directly.\n if (isInitialMount && !isUndefined(revalidateOnMount)) return revalidateOnMount;\n // If it's paused, we skip revalidation.\n if (getConfig().isPaused()) return false;\n // Under suspense mode, it will always fetch on render if there is no\n // stale data so no need to revalidate immediately mount it again.\n // If data exists, only revalidate if `revalidateIfStale` is true.\n if (suspense) return isUndefined(data) ? false : revalidateIfStale;\n // If there is no stale data, we need to revalidate when mount;\n // If `revalidateIfStale` is set to true, we will always revalidate.\n return isUndefined(data) || revalidateIfStale;\n })();\n // Resolve the default validating state:\n // If it's able to validate, and it should revalidate when mount, this will be true.\n const defaultValidatingState = !!(key && fetcher && isInitialMount && shouldDoInitialRevalidation);\n const isValidating = isUndefined(cached.isValidating) ? defaultValidatingState : cached.isValidating;\n const isLoading = isUndefined(cached.isLoading) ? defaultValidatingState : cached.isLoading;\n // The revalidation function is a carefully crafted wrapper of the original\n // `fetcher`, to correctly handle the many edge cases.\n const revalidate = useCallback(async (revalidateOpts)=>{\n const currentFetcher = fetcherRef.current;\n if (!key || !currentFetcher || unmountedRef.current || getConfig().isPaused()) {\n return false;\n }\n let newData;\n let startAt;\n let loading = true;\n const opts = revalidateOpts || {};\n // If there is no ongoing concurrent request, or `dedupe` is not set, a\n // new request should be initiated.\n const shouldStartNewRequest = !FETCH[key] || !opts.dedupe;\n /*\n For React 17\n Do unmount check for calls:\n If key has changed during the revalidation, or the component has been\n unmounted, old dispatch and old event callbacks should not take any\n effect\n\n For React 18\n only check if key has changed\n https://github.com/reactwg/react-18/discussions/82\n */ const callbackSafeguard = ()=>{\n if (IS_REACT_LEGACY) {\n return !unmountedRef.current && key === keyRef.current && initialMountedRef.current;\n }\n return key === keyRef.current;\n };\n // The final state object when the request finishes.\n const finalState = {\n isValidating: false,\n isLoading: false\n };\n const finishRequestAndUpdateState = ()=>{\n setCache(finalState);\n };\n const cleanupState = ()=>{\n // Check if it's still the same request before deleting it.\n const requestInfo = FETCH[key];\n if (requestInfo && requestInfo[1] === startAt) {\n delete FETCH[key];\n }\n };\n // Start fetching. Change the `isValidating` state, update the cache.\n const initialState = {\n isValidating: true\n };\n // It is in the `isLoading` state, if and only if there is no cached data.\n // This bypasses fallback data and laggy data.\n if (isUndefined(getCache().data)) {\n initialState.isLoading = true;\n }\n try {\n if (shouldStartNewRequest) {\n setCache(initialState);\n // If no cache is being rendered currently (it shows a blank page),\n // we trigger the loading slow event.\n if (config.loadingTimeout && isUndefined(getCache().data)) {\n setTimeout(()=>{\n if (loading && callbackSafeguard()) {\n getConfig().onLoadingSlow(key, config);\n }\n }, config.loadingTimeout);\n }\n // Start the request and save the timestamp.\n // Key must be truthy if entering here.\n FETCH[key] = [\n currentFetcher(fnArg),\n getTimestamp()\n ];\n }\n [newData, startAt] = FETCH[key];\n newData = await newData;\n if (shouldStartNewRequest) {\n // If the request isn't interrupted, clean it up after the\n // deduplication interval.\n setTimeout(cleanupState, config.dedupingInterval);\n }\n // If there're other ongoing request(s), started after the current one,\n // we need to ignore the current one to avoid possible race conditions:\n // req1------------------>res1 (current one)\n // req2---------------->res2\n // the request that fired later will always be kept.\n // The timestamp maybe be `undefined` or a number\n if (!FETCH[key] || FETCH[key][1] !== startAt) {\n if (shouldStartNewRequest) {\n if (callbackSafeguard()) {\n getConfig().onDiscarded(key);\n }\n }\n return false;\n }\n // Clear error.\n finalState.error = UNDEFINED;\n // If there're other mutations(s), that overlapped with the current revalidation:\n // case 1:\n // req------------------>res\n // mutate------>end\n // case 2:\n // req------------>res\n // mutate------>end\n // case 3:\n // req------------------>res\n // mutate-------...---------->\n // we have to ignore the revalidation result (res) because it's no longer fresh.\n // meanwhile, a new revalidation should be triggered when the mutation ends.\n const mutationInfo = MUTATION[key];\n if (!isUndefined(mutationInfo) && // case 1\n (startAt <= mutationInfo[0] || // case 2\n startAt <= mutationInfo[1] || // case 3\n mutationInfo[1] === 0)) {\n finishRequestAndUpdateState();\n if (shouldStartNewRequest) {\n if (callbackSafeguard()) {\n getConfig().onDiscarded(key);\n }\n }\n return false;\n }\n // Deep compare with the latest state to avoid extra re-renders.\n // For local state, compare and assign.\n const cacheData = getCache().data;\n // Since the compare fn could be custom fn\n // cacheData might be different from newData even when compare fn returns True\n finalState.data = compare(cacheData, newData) ? cacheData : newData;\n // Trigger the successful callback if it's the original request.\n if (shouldStartNewRequest) {\n if (callbackSafeguard()) {\n getConfig().onSuccess(newData, key, config);\n }\n }\n } catch (err) {\n cleanupState();\n const currentConfig = getConfig();\n const { shouldRetryOnError } = currentConfig;\n // Not paused, we continue handling the error. Otherwise, discard it.\n if (!currentConfig.isPaused()) {\n // Get a new error, don't use deep comparison for errors.\n finalState.error = err;\n // Error event and retry logic. Only for the actual request, not\n // deduped ones.\n if (shouldStartNewRequest && callbackSafeguard()) {\n currentConfig.onError(err, key, currentConfig);\n if (shouldRetryOnError === true || isFunction(shouldRetryOnError) && shouldRetryOnError(err)) {\n if (!getConfig().revalidateOnFocus || !getConfig().revalidateOnReconnect || isActive()) {\n // If it's inactive, stop. It will auto-revalidate when\n // refocusing or reconnecting.\n // When retrying, deduplication is always enabled.\n currentConfig.onErrorRetry(err, key, currentConfig, (_opts)=>{\n const revalidators = EVENT_REVALIDATORS[key];\n if (revalidators && revalidators[0]) {\n revalidators[0](revalidateEvents.ERROR_REVALIDATE_EVENT, _opts);\n }\n }, {\n retryCount: (opts.retryCount || 0) + 1,\n dedupe: true\n });\n }\n }\n }\n }\n }\n // Mark loading as stopped.\n loading = false;\n // Update the current hook's state.\n finishRequestAndUpdateState();\n return true;\n }, // `setState` is immutable, and `eventsCallback`, `fnArg`, and\n // `keyValidating` are depending on `key`, so we can exclude them from\n // the deps array.\n //\n // FIXME:\n // `fn` and `config` might be changed during the lifecycle,\n // but they might be changed every render like this.\n // `useSWR('key', () => fetch('/api/'), { suspense: true })`\n // So we omit the values from the deps array\n // even though it might cause unexpected behaviors.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n key,\n cache\n ]);\n // Similar to the global mutate but bound to the current cache and key.\n // `cache` isn't allowed to change during the lifecycle.\n const boundMutate = useCallback(// Use callback to make sure `keyRef.current` returns latest result every time\n (...args)=>{\n return internalMutate(cache, keyRef.current, ...args);\n }, // eslint-disable-next-line react-hooks/exhaustive-deps\n []);\n // The logic for updating refs.\n useIsomorphicLayoutEffect(()=>{\n fetcherRef.current = fetcher;\n configRef.current = config;\n // Handle laggy data updates. If there's cached data of the current key,\n // it'll be the correct reference.\n if (!isUndefined(cachedData)) {\n laggyDataRef.current = cachedData;\n }\n });\n // After mounted or key changed.\n useIsomorphicLayoutEffect(()=>{\n if (!key) return;\n const softRevalidate = revalidate.bind(UNDEFINED, WITH_DEDUPE);\n // Expose revalidators to global event listeners. So we can trigger\n // revalidation from the outside.\n let nextFocusRevalidatedAt = 0;\n const onRevalidate = (type, opts = {})=>{\n if (type == revalidateEvents.FOCUS_EVENT) {\n const now = Date.now();\n if (getConfig().revalidateOnFocus && now > nextFocusRevalidatedAt && isActive()) {\n nextFocusRevalidatedAt = now + getConfig().focusThrottleInterval;\n softRevalidate();\n }\n } else if (type == revalidateEvents.RECONNECT_EVENT) {\n if (getConfig().revalidateOnReconnect && isActive()) {\n softRevalidate();\n }\n } else if (type == revalidateEvents.MUTATE_EVENT) {\n return revalidate();\n } else if (type == revalidateEvents.ERROR_REVALIDATE_EVENT) {\n return revalidate(opts);\n }\n return;\n };\n const unsubEvents = subscribeCallback(key, EVENT_REVALIDATORS, onRevalidate);\n // Mark the component as mounted and update corresponding refs.\n unmountedRef.current = false;\n keyRef.current = key;\n initialMountedRef.current = true;\n // Keep the original key in the cache.\n setCache({\n _k: fnArg\n });\n // Trigger a revalidation\n if (shouldDoInitialRevalidation) {\n if (isUndefined(data) || IS_SERVER) {\n // Revalidate immediately.\n softRevalidate();\n } else {\n // Delay the revalidate if we have data to return so we won't block\n // rendering.\n rAF(softRevalidate);\n }\n }\n return ()=>{\n // Mark it as unmounted.\n unmountedRef.current = true;\n unsubEvents();\n };\n }, [\n key\n ]);\n // Polling\n useIsomorphicLayoutEffect(()=>{\n let timer;\n function next() {\n // Use the passed interval\n // ...or invoke the function with the updated data to get the interval\n const interval = isFunction(refreshInterval) ? refreshInterval(getCache().data) : refreshInterval;\n // We only start the next interval if `refreshInterval` is not 0, and:\n // - `force` is true, which is the start of polling\n // - or `timer` is not 0, which means the effect wasn't canceled\n if (interval && timer !== -1) {\n timer = setTimeout(execute, interval);\n }\n }\n function execute() {\n // Check if it's OK to execute:\n // Only revalidate when the page is visible, online, and not errored.\n if (!getCache().error && (refreshWhenHidden || getConfig().isVisible()) && (refreshWhenOffline || getConfig().isOnline())) {\n revalidate(WITH_DEDUPE).then(next);\n } else {\n // Schedule the next interval to check again.\n next();\n }\n }\n next();\n return ()=>{\n if (timer) {\n clearTimeout(timer);\n timer = -1;\n }\n };\n }, [\n refreshInterval,\n refreshWhenHidden,\n refreshWhenOffline,\n key\n ]);\n // Display debug info in React DevTools.\n useDebugValue(returnedData);\n // In Suspense mode, we can't return the empty `data` state.\n // If there is an `error`, the `error` needs to be thrown to the error boundary.\n // If there is no `error`, the `revalidation` promise needs to be thrown to\n // the suspense boundary.\n if (suspense && isUndefined(data) && key) {\n // SWR should throw when trying to use Suspense on the server with React 18,\n // without providing any initial data. See:\n // https://github.com/vercel/swr/issues/1832\n if (!IS_REACT_LEGACY && IS_SERVER) {\n throw new Error('Fallback data is required when using suspense in SSR.');\n }\n // Always update fetcher and config refs even with the Suspense mode.\n fetcherRef.current = fetcher;\n configRef.current = config;\n unmountedRef.current = false;\n const req = PRELOAD[key];\n if (!isUndefined(req)) {\n const promise = boundMutate(req);\n use(promise);\n }\n if (isUndefined(error)) {\n const promise = revalidate(WITH_DEDUPE);\n if (!isUndefined(returnedData)) {\n promise.status = 'fulfilled';\n promise.value = true;\n }\n use(promise);\n } else {\n throw error;\n }\n }\n return {\n mutate: boundMutate,\n get data () {\n stateDependencies.data = true;\n return returnedData;\n },\n get error () {\n stateDependencies.error = true;\n return error;\n },\n get isValidating () {\n stateDependencies.isValidating = true;\n return isValidating;\n },\n get isLoading () {\n stateDependencies.isLoading = true;\n return isLoading;\n }\n };\n};\nconst SWRConfig = OBJECT.defineProperty(SWRConfig$1, 'defaultValue', {\n value: defaultConfig\n});\n/**\n * A hook to fetch data.\n *\n * @link https://swr.vercel.app\n * @example\n * ```jsx\n * import useSWR from 'swr'\n * function Profile() {\n * const { data, error, isLoading } = useSWR('/api/user', fetcher)\n * if (error) return <div>failed to load</div>\n * if (isLoading) return <div>loading...</div>\n * return <div>hello {data.name}!</div>\n * }\n * ```\n */ const useSWR = withArgs(useSWRHandler);\n\nexport { SWRConfig, useSWR as default, unstable_serialize };\n","import { useApi } from '@backstage/core-plugin-api';\nimport { permissionApiRef } from '../apis/PermissionApi.esm.js';\nimport { isResourcePermission, AuthorizeResult } from '@backstage/plugin-permission-common';\nimport useSWR from 'swr';\n\nfunction usePermission(input) {\n const permissionApi = useApi(permissionApiRef);\n const { data, error } = useSWR(input, async (args) => {\n if (isResourcePermission(args.permission) && !args.resourceRef) {\n return AuthorizeResult.DENY;\n }\n const { result } = await permissionApi.authorize(args);\n return result;\n });\n if (error) {\n return { error, loading: false, allowed: false };\n }\n if (data === void 0) {\n return { loading: true, allowed: false };\n }\n return { loading: false, allowed: data === AuthorizeResult.ALLOW };\n}\n\nexport { usePermission };\n//# sourceMappingURL=usePermission.esm.js.map\n","function isPermission(permission, comparedPermission) {\n return permission.name === comparedPermission.name;\n}\nfunction isResourcePermission(permission, resourceType) {\n if (!(\"resourceType\" in permission)) {\n return false;\n }\n return !resourceType || permission.resourceType === resourceType;\n}\nfunction isCreatePermission(permission) {\n return permission.attributes.action === \"create\";\n}\nfunction isReadPermission(permission) {\n return permission.attributes.action === \"read\";\n}\nfunction isUpdatePermission(permission) {\n return permission.attributes.action === \"update\";\n}\nfunction isDeletePermission(permission) {\n return permission.attributes.action === \"delete\";\n}\nfunction toPermissionEvaluator(permissionAuthorizer) {\n return {\n authorize: async (requests, options) => {\n const response = await permissionAuthorizer.authorize(requests, options);\n return response;\n },\n authorizeConditional(requests, options) {\n const parsedRequests = requests;\n return permissionAuthorizer.authorize(parsedRequests, options);\n }\n };\n}\n\nexport { isCreatePermission, isDeletePermission, isPermission, isReadPermission, isResourcePermission, isUpdatePermission, toPermissionEvaluator };\n//# sourceMappingURL=util.esm.js.map\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('../cjs/use-sync-external-store-shim.production.js');\n} else {\n module.exports = require('../cjs/use-sync-external-store-shim.development.js');\n}\n","function createPermission({\n name,\n attributes,\n resourceType\n}) {\n if (resourceType) {\n return {\n type: \"resource\",\n name,\n attributes,\n resourceType\n };\n }\n return {\n type: \"basic\",\n name,\n attributes\n };\n}\n\nexport { createPermission };\n//# sourceMappingURL=createPermission.esm.js.map\n","/**\n * @license React\n * use-sync-external-store-shim.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"react\");\nfunction is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\nvar objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useState = React.useState,\n useEffect = React.useEffect,\n useLayoutEffect = React.useLayoutEffect,\n useDebugValue = React.useDebugValue;\nfunction useSyncExternalStore$2(subscribe, getSnapshot) {\n var value = getSnapshot(),\n _useState = useState({ inst: { value: value, getSnapshot: getSnapshot } }),\n inst = _useState[0].inst,\n forceUpdate = _useState[1];\n useLayoutEffect(\n function () {\n inst.value = value;\n inst.getSnapshot = getSnapshot;\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n },\n [subscribe, value, getSnapshot]\n );\n useEffect(\n function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n return subscribe(function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n });\n },\n [subscribe]\n );\n useDebugValue(value);\n return value;\n}\nfunction checkIfSnapshotChanged(inst) {\n var latestGetSnapshot = inst.getSnapshot;\n inst = inst.value;\n try {\n var nextValue = latestGetSnapshot();\n return !objectIs(inst, nextValue);\n } catch (error) {\n return !0;\n }\n}\nfunction useSyncExternalStore$1(subscribe, getSnapshot) {\n return getSnapshot();\n}\nvar shim =\n \"undefined\" === typeof window ||\n \"undefined\" === typeof window.document ||\n \"undefined\" === typeof window.document.createElement\n ? useSyncExternalStore$1\n : useSyncExternalStore$2;\nexports.useSyncExternalStore =\n void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;\n"],"names":["permissionApiRef","createApiRef","id","AuthorizeResult","DENY","ALLOW","CONDITIONAL","noop","UNDEFINED","OBJECT","Object","isUndefined","v","isFunction","mergeObjects","a","b","table","WeakMap","counter","stableHash","arg","type","constructor","isDate","Date","result","index","RegExp","toJSON","toString","JSON","stringify","get","set","Array","length","keys","sort","pop","SWRGlobalState","EMPTY_CACHE","INITIAL_CACHE","STR_UNDEFINED","isWindowDefined","window","isDocumentDefined","document","createCacheHelper","cache","key","state","info","prev","online","onWindowEvent","offWindowEvent","addEventListener","bind","removeEventListener","preset","isOnline","isVisible","visibilityState","defaultConfigOptions","initFocus","callback","initReconnect","onOnline","onOffline","IS_REACT_LEGACY","IS_SERVER","useIsomorphicLayoutEffect","useEffect","useLayoutEffect","navigatorConnection","navigator","connection","slowConnection","includes","effectiveType","saveData","err","args","isArray","__timestamp","getTimestamp","async","internalMutate","_key","_data","_opts","options","populateCache","throwOnError","revalidate","rollbackOnErrorOption","rollbackOnError","optimisticData","keyFilter","matchedKeys","it","test","_k","push","Promise","all","map","mutateByKey","EVENT_REVALIDATORS","MUTATION","FETCH","PRELOAD","startRevalidate","revalidators","data","then","error","beforeMutationTs","hasOptimisticData","displayedData","currentData","_c","committedData","catch","populateCachedData","resolve","revalidateAllKeys","initCache","provider","has","opts","mutate","unmount","subscriptions","subscribe","subs","splice","indexOf","setter","value","fn","initProvider","releaseFocus","setTimeout","releaseReconnect","delete","Map","defaultConfig","onLoadingSlow","onSuccess","onError","onErrorRetry","_","__","config","maxRetryCount","errorRetryCount","currentRetryCount","retryCount","timeout","Math","random","errorRetryInterval","onDiscarded","revalidateOnFocus","revalidateOnReconnect","revalidateIfStale","shouldRetryOnError","focusThrottleInterval","dedupingInterval","loadingTimeout","compare","newData","isPaused","fallback","mergeConfigs","use","u1","f1","u2","f2","concat","SWRConfigContext","createContext","enableDevtools","__SWR_DEVTOOLS_USE__","BUILT_IN_MIDDLEWARE","useSWRNext","key_","fetcher_","startsWith","req","__SWR_DEVTOOLS_REACT__","promise","status","reason","e","WITH_DEDUPE","dedupe","useSWR","defineProperty","props","parentConfig","useContext","isFunctionalConfig","useMemo","extendedConfig","cacheContextRef","useRef","current","cacheContext","createElement","Provider","hook","fetcher","suspense","fallbackData","revalidateOnMount","refreshInterval","refreshWhenHidden","refreshWhenOffline","keepPreviousData","fnArg","initialMountedRef","unmountedRef","keyRef","fetcherRef","configRef","getConfig","isActive","getCache","setCache","subscribeCache","getInitialCache","stateDependencies","isEqual","t","returnedData","getSnapshot","shouldStartRequest","getSelectedCache","snapshot","isValidating","isLoading","cachedData","initialData","clientSnapshot","serverSnapshot","memorizedSnapshot","newSnapshot","cached","useSyncExternalStore","useCallback","isInitialMount","hasRevalidator","laggyDataRef","shouldDoInitialRevalidation","defaultValidatingState","revalidateOpts","currentFetcher","startAt","loading","shouldStartNewRequest","callbackSafeguard","finalState","finishRequestAndUpdateState","cleanupState","requestInfo","initialState","mutationInfo","cacheData","currentConfig","boundMutate","softRevalidate","nextFocusRevalidatedAt","unsubEvents","callbacks","keyedRevalidators","subscribeCallback","now","f","timer","next","interval","execute","clearTimeout","useDebugValue","Error","fallbackConfig","_config","normalize","middleware","i","usePermission","input","permissionApi","useApi","permission","resourceRef","authorize","allowed","module","exports","createPermission","name","attributes","resourceType","React","objectIs","is","x","y","useState","checkIfSnapshotChanged","inst","latestGetSnapshot","nextValue","shim","_useState","forceUpdate"],"sourceRoot":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkinternal_plugin_kuadrant=self.webpackChunkinternal_plugin_kuadrant||[]).push([[4614],{4614:(e,t,n)=>{n.r(t),n.d(t,{AnalyticsContext:()=>u,FeatureFlagState:()=>P,SessionState:()=>R,alertApiRef:()=>F,analyticsApiRef:()=>l,appThemeApiRef:()=>$,atlassianAuthApiRef:()=>S,attachComponentData:()=>B,bitbucketAuthApiRef:()=>E,bitbucketServerAuthApiRef:()=>C,configApiRef:()=>j,createApiFactory:()=>m,createApiRef:()=>p.y,createComponentExtension:()=>X,createExternalRouteRef:()=>pe,createPlugin:()=>ne,createReactExtension:()=>J,createRoutableExtension:()=>Q,createRouteRef:()=>ie,createSubRouteRef:()=>ue,discoveryApiRef:()=>G,errorApiRef:()=>D.m,featureFlagsApiRef:()=>V,fetchApiRef:()=>I,getComponentData:()=>L,githubAuthApiRef:()=>v,gitlabAuthApiRef:()=>A,googleAuthApiRef:()=>y,identityApiRef:()=>O,microsoftAuthApiRef:()=>w,oauthRequestApiRef:()=>T,oktaAuthApiRef:()=>b,oneloginAuthApiRef:()=>x,openshiftAuthApiRef:()=>k,storageApiRef:()=>_,useAnalytics:()=>g,useApi:()=>c.gf,useApiHolder:()=>c.Q2,useApp:()=>M,useElementFilter:()=>ee,useRouteRef:()=>q,useRouteRefParams:()=>le,vmwareCloudAuthApiRef:()=>N,withApis:()=>c.wV});var o=n(31085),r=n(15427),i=n(95478);const a=(0,r.createVersionedContext)("analytics-context"),s=()=>{const e=(0,i.useContext)(a);if(void 0===e)return{routeRef:"unknown",pluginId:"root",extension:"App"};const t=e.atVersion(1);if(void 0===t)throw new Error("No context found for version 1.");return t},u=e=>{const{attributes:t,children:n}=e,i={...s(),...t},u=(0,r.createVersionedValueMap)({1:i});return(0,o.jsx)(a.Provider,{value:u,children:n})};var c=n(82206),p=n(49930);const l=(0,p.y)({id:"core.analytics"}),d=(0,r.getOrCreateGlobalSingleton)("core-plugin-api:analytics-tracker-events",()=>({mostRecentGatheredNavigation:void 0,mostRecentRoutableExtensionRender:void 0,beforeUnloadRegistered:!1})),h="_ROUTABLE-EXTENSION-RENDERED";class f{constructor(e,t={routeRef:"unknown",pluginId:"root",extension:"App"}){this.analyticsApi=e,this.context=t,d.beforeUnloadRegistered||(addEventListener("beforeunload",()=>{d.mostRecentGatheredNavigation&&(this.analyticsApi.captureEvent({...d.mostRecentGatheredNavigation,...d.mostRecentRoutableExtensionRender}),d.mostRecentGatheredNavigation=void 0,d.mostRecentRoutableExtensionRender=void 0)},{once:!0,passive:!0}),d.beforeUnloadRegistered=!0)}setContext(e){this.context=e}captureEvent(e,t,{value:n,attributes:o}={}){const{_routeNodeType:r,...i}=this.context;if(e!==h){if(d.mostRecentGatheredNavigation){try{this.analyticsApi.captureEvent({...d.mostRecentGatheredNavigation,...d.mostRecentRoutableExtensionRender})}catch(e){console.warn("Error during analytics event capture. %o",e)}d.mostRecentGatheredNavigation=void 0,d.mostRecentRoutableExtensionRender=void 0}if("navigate"!==e||"gathered"!==r||"root"!==i.pluginId)try{this.analyticsApi.captureEvent({action:e,subject:t,value:n,attributes:o,context:i})}catch(e){console.warn("Error during analytics event capture. %o",e)}else d.mostRecentGatheredNavigation={action:e,subject:t,value:n,attributes:o,context:i}}else d.mostRecentGatheredNavigation&&(d.mostRecentRoutableExtensionRender={context:{...i,extension:"App"}})}}function g(){const e=(0,i.useRef)(null),t=s(),n=function(){try{return(0,c.gf)(l)}catch{return{captureEvent:()=>{}}}}(),o=(null===e.current&&(e.current=new f(n)),e.current);return o.setContext(t),o}function m(e,t){return"id"in e?{api:e,deps:{},factory:()=>t}:e}var R=(e=>(e.SignedIn="SignedIn",e.SignedOut="SignedOut",e))(R||{});const y=(0,p.y)({id:"core.auth.google"}),v=(0,p.y)({id:"core.auth.github"}),b=(0,p.y)({id:"core.auth.okta"}),A=(0,p.y)({id:"core.auth.gitlab"}),w=(0,p.y)({id:"core.auth.microsoft"}),x=(0,p.y)({id:"core.auth.onelogin"}),E=(0,p.y)({id:"core.auth.bitbucket"}),C=(0,p.y)({id:"core.auth.bitbucket-server"}),S=(0,p.y)({id:"core.auth.atlassian"}),N=(0,p.y)({id:"core.auth.vmware-cloud"}),k=(0,p.y)({id:"core.auth.openshift"}),F=(0,p.y)({id:"core.alert"}),$=(0,p.y)({id:"core.apptheme"}),j=(0,p.y)({id:"core.config"}),G=(0,p.y)({id:"core.discovery"});var D=n(42594),P=(e=>(e[e.None=0]="None",e[e.Active=1]="Active",e))(P||{});const V=(0,p.y)({id:"core.featureflags"}),I=(0,p.y)({id:"core.fetch"}),O=(0,p.y)({id:"core.identity"}),T=(0,p.y)({id:"core.oauthrequest"}),_=(0,p.y)({id:"core.storage"}),M=()=>{const e=(0,r.useVersionedContext)("app-context");if(!e)throw new Error("App context is not available");const t=e.atVersion(1);if(!t)throw new Error("AppContext v1 not available");return t},z=(0,r.getOrCreateGlobalSingleton)("component-data-store",()=>new WeakMap),W="__backstage_data";function B(e,t,n){const o=e;let r=o[W]??z.get(e);if(r||(r={map:new Map},Object.defineProperty(o,W,{enumerable:!1,configurable:!0,writable:!1,value:r}),z.set(e,r)),r.map.has(t)){const n=e.displayName||e.name;throw new Error(`Attempted to attach duplicate data "${t}" to component "${n}"`)}r.map.set(t,n)}function L(e,t){if(!e)return;const n=e.type;if(!n)return;const o=n[W]??z.get(n);return o?o.map.get(t):void 0}var U=n(49634);function q(e){const{pathname:t}=(0,U.useLocation)(),n=(0,r.useVersionedContext)("routing-context");if(!n)throw new Error("Routing context is not available");const o=n.atVersion(1),a=(0,i.useMemo)(()=>o&&o.resolve(e,{pathname:t}),[o,e,t]);if(!n)throw new Error("useRouteRef used outside of routing context");if(!o)throw new Error("RoutingContext v1 not available");const s="optional"in e&&e.optional;if(!a&&!s)throw new Error(`No path for ${e}`);return a}class H extends i.Component{static getDerivedStateFromError(e){return{error:e}}state={error:void 0};handleErrorReset=()=>{this.setState({error:void 0})};render(){const{error:e}=this.state,{app:t,plugin:n}=this.props,{ErrorBoundaryFallback:r}=t.getComponents();return e?(0,o.jsx)(r,{error:e,resetError:this.handleErrorReset,plugin:n}):this.props.children}}var K=n(57556);function Q(e){const{component:t,mountPoint:n,name:r}=e;return J({component:{lazy:()=>t().then(e=>{const t=t=>{const r=g();try{q(n)}catch(e){if("object"==typeof e&&null!==e){const{message:t}=e;if("string"==typeof t&&t.startsWith("No path for "))throw new Error(`Routable extension component with mount point ${n} was not discovered in the app element tree. Routable extension components may not be rendered by other components and must be directly available as an element within the App provider component.`)}throw e}return(0,i.useEffect)(()=>{r.captureEvent(h,"")},[r]),(0,o.jsx)(e,{...t})},a=r||e.displayName||e.name||"LazyComponent";return t.displayName=`RoutableExtension(${a})`,t})},data:{"core.mountPoint":n},name:r})}function X(e){const{component:t,name:n}=e;return J({component:t,name:n})}function J(e){const{data:t={},name:n}=e;let r;if(n||console.warn("Declaring extensions without name is DEPRECATED. Make sure that all usages of createReactExtension, createComponentExtension and createRoutableExtension provide a name."),"lazy"in e.component){const t=e.component.lazy;r=(0,i.lazy)(()=>t().then(e=>({default:e}),e=>{const t=n?` of the ${n} extension`:"";throw new K.HK(`Failed lazy loading${t}, try to reload the page`,e)}))}else r=e.component.sync;const a=n||r.displayName||r.name||"Component";return{expose(e){const s=a=>{const s=M(),{Progress:c}=s.getComponents(),p=t?.["core.mountPoint"];return(0,o.jsx)(i.Suspense,{fallback:(0,o.jsx)(c,{}),children:(0,o.jsx)(H,{app:s,plugin:e,children:(0,o.jsx)(u,{attributes:{pluginId:e.getId(),...n&&{extension:n},...p&&{routeRef:p.id}},children:(0,o.jsx)(r,{...a})})})})};B(s,"core.plugin",e),B(s,"core.extensionName",n);for(const[e,n]of Object.entries(t))B(s,e,n);return s.displayName=`Extension(${a})`,s}}}function Y(e,t,n,o){return i.Children.toArray(e).flatMap(e=>{if(!(0,i.isValidElement)(e))return[];if(e.type===i.Fragment)return Y(e.props.children,t,n,o);if(L(e,"core.featureFlagged")){const r=e.props;return("with"in r?t.isActive(r.with):!t.isActive(r.without))?Y(e.props.children,t,n,o):[]}if(void 0===n||n(e))return[e];if(o)throw new Error(o);return Y(e.props.children,t,n,o)})}class Z{constructor(e,t){this.node=e,this.featureFlagsApi=t}selectByComponentData(e){const t=Y(this.node,this.featureFlagsApi,t=>void 0!==L(t,e.key),e.withStrictError);return new Z(t,this.featureFlagsApi)}findComponentData(e){return Y(this.node,this.featureFlagsApi,t=>void 0!==L(t,e.key)).map(t=>L(t,e.key)).filter(e=>void 0!==e)}getElements(){return Y(this.node,this.featureFlagsApi)}}function ee(e,t,n=[]){const o=(0,c.gf)(V),r=new Z(e,o);return(0,i.useMemo)(()=>t(r),[e,...n])}class te{constructor(e){this.config=e}getId(){return this.config.id}getApis(){return this.config.apis??[]}getFeatureFlags(){return this.config.featureFlags?.slice()??[]}get routes(){return this.config.routes??{}}get externalRoutes(){return this.config.externalRoutes??{}}provide(e){return e.expose(this)}toString(){return`plugin{${this.config.id}}`}}function ne(e){return new te(e)}const oe=(0,r.getOrCreateGlobalSingleton)("route-ref-type",()=>Symbol("route-ref-type"));class re{constructor(e,t){this.id=e,this.params=t}[oe]="absolute";get title(){return this.id}toString(){return`routeRef{type=absolute,id=${this.id}}`}}function ie(e){return new re(e.id,e.params??[])}const ae=/^\w+$/;class se{constructor(e,t,n,o){this.id=e,this.path=t,this.parent=n,this.params=o}[oe]="sub";toString(){return`routeRef{type=sub,id=${this.id}}`}}function ue(e){const{id:t,path:n,parent:o}=e,r=n.split("/").filter(e=>e.startsWith(":")).map(e=>e.substring(1)),i=[...o.params,...r];if(o.params.some(e=>r.includes(e)))throw new Error("SubRouteRef may not have params that overlap with its parent");if(!n.startsWith("/"))throw new Error(`SubRouteRef path must start with '/', got '${n}'`);if(n.endsWith("/"))throw new Error(`SubRouteRef path must not end with '/', got '${n}'`);for(const e of r)if(!ae.test(e))throw new Error(`SubRouteRef path has invalid param, got '${e}'`);return new se(t,n,o,i)}class ce{constructor(e,t,n,o){this.id=e,this.params=t,this.optional=n,this.defaultTarget=o}[oe]="external";toString(){return`routeRef{type=external,id=${this.id}}`}getDefaultTarget(){return this.defaultTarget}}function pe(e){return new ce(e.id,e.params??[],Boolean(e.optional),e?.defaultTarget)}function le(e){return(0,U.useParams)()}}}]);
|
|
2
|
+
//# sourceMappingURL=4614.23f2a85b.chunk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"static/4614.23f2a85b.chunk.js","mappings":"yqCAIA,MAAMA,GAAwB,IAAAC,wBAAuB,qBAC/C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vB,CACA,CAACrB,IAAgB,WACjB,QAAAF,GACE,MAAO,6BAA6B7J,KAAKX,KAC3C,CACA,gBAAAgM,GACE,OAAOrL,KAAKoL,aACd,EAEF,SAASE,GAAuB3M,GAC9B,OAAO,IAAIwM,GACTxM,EAAQU,GACRV,EAAQuL,QAAU,GAClBqB,QAAQ5M,EAAQuG,UAChBvG,GAASyM,cAEb,CCtBA,SAASI,GAAkBC,GACzB,OAAO,IAAAC,YACT,C","sources":["webpack://internal.plugin-kuadrant/./node_modules/@backstage/plugin-api-docs/node_modules/@backstage/core-plugin-api/dist/analytics/AnalyticsContext.esm.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/plugin-api-docs/node_modules/@backstage/core-plugin-api/dist/apis/definitions/AnalyticsApi.esm.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/plugin-api-docs/node_modules/@backstage/core-plugin-api/dist/analytics/Tracker.esm.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/plugin-api-docs/node_modules/@backstage/core-plugin-api/dist/analytics/useAnalytics.esm.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/plugin-api-docs/node_modules/@backstage/core-plugin-api/dist/apis/system/helpers.esm.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/plugin-api-docs/node_modules/@backstage/core-plugin-api/dist/apis/definitions/auth.esm.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/plugin-api-docs/node_modules/@backstage/core-plugin-api/dist/apis/definitions/AlertApi.esm.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/plugin-api-docs/node_modules/@backstage/core-plugin-api/dist/apis/definitions/AppThemeApi.esm.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/plugin-api-docs/node_modules/@backstage/core-plugin-api/dist/apis/definitions/ConfigApi.esm.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/plugin-api-docs/node_modules/@backstage/core-plugin-api/dist/apis/definitions/DiscoveryApi.esm.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/plugin-api-docs/node_modules/@backstage/core-plugin-api/dist/apis/definitions/FeatureFlagsApi.esm.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/plugin-api-docs/node_modules/@backstage/core-plugin-api/dist/apis/definitions/FetchApi.esm.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/plugin-api-docs/node_modules/@backstage/core-plugin-api/dist/apis/definitions/IdentityApi.esm.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/plugin-api-docs/node_modules/@backstage/core-plugin-api/dist/apis/definitions/OAuthRequestApi.esm.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/plugin-api-docs/node_modules/@backstage/core-plugin-api/dist/apis/definitions/StorageApi.esm.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/plugin-api-docs/node_modules/@backstage/core-plugin-api/dist/app/useApp.esm.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/plugin-api-docs/node_modules/@backstage/core-plugin-api/dist/extensions/componentData.esm.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/plugin-api-docs/node_modules/@backstage/core-plugin-api/dist/routing/useRouteRef.esm.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/plugin-api-docs/node_modules/@backstage/core-plugin-api/dist/extensions/PluginErrorBoundary.esm.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/plugin-api-docs/node_modules/@backstage/core-plugin-api/dist/extensions/extensions.esm.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/plugin-api-docs/node_modules/@backstage/core-plugin-api/dist/extensions/useElementFilter.esm.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/plugin-api-docs/node_modules/@backstage/core-plugin-api/dist/plugin/Plugin.esm.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/plugin-api-docs/node_modules/@backstage/core-plugin-api/dist/routing/types.esm.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/plugin-api-docs/node_modules/@backstage/core-plugin-api/dist/routing/RouteRef.esm.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/plugin-api-docs/node_modules/@backstage/core-plugin-api/dist/routing/SubRouteRef.esm.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/plugin-api-docs/node_modules/@backstage/core-plugin-api/dist/routing/ExternalRouteRef.esm.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/plugin-api-docs/node_modules/@backstage/core-plugin-api/dist/routing/useRouteRefParams.esm.js"],"sourcesContent":["import { jsx } from 'react/jsx-runtime';\nimport { createVersionedContext, createVersionedValueMap } from '@backstage/version-bridge';\nimport { useContext } from 'react';\n\nconst AnalyticsReactContext = createVersionedContext(\"analytics-context\");\nconst useAnalyticsContext = () => {\n const theContext = useContext(AnalyticsReactContext);\n if (theContext === void 0) {\n return {\n routeRef: \"unknown\",\n pluginId: \"root\",\n extension: \"App\"\n };\n }\n const theValue = theContext.atVersion(1);\n if (theValue === void 0) {\n throw new Error(\"No context found for version 1.\");\n }\n return theValue;\n};\nconst AnalyticsContext = (options) => {\n const { attributes, children } = options;\n const parentValues = useAnalyticsContext();\n const combinedValue = {\n ...parentValues,\n ...attributes\n };\n const versionedCombinedValue = createVersionedValueMap({ 1: combinedValue });\n return /* @__PURE__ */ jsx(AnalyticsReactContext.Provider, { value: versionedCombinedValue, children });\n};\n\nexport { AnalyticsContext, useAnalyticsContext };\n//# sourceMappingURL=AnalyticsContext.esm.js.map\n","import 'react/jsx-runtime';\nimport '@backstage/version-bridge';\nimport '@backstage/errors';\nimport { createApiRef } from '../system/ApiRef.esm.js';\n\nconst analyticsApiRef = createApiRef({\n id: \"core.analytics\"\n});\n\nexport { analyticsApiRef };\n//# sourceMappingURL=AnalyticsApi.esm.js.map\n","import { getOrCreateGlobalSingleton } from '@backstage/version-bridge';\n\nconst globalEvents = getOrCreateGlobalSingleton(\n \"core-plugin-api:analytics-tracker-events\",\n () => ({\n mostRecentGatheredNavigation: void 0,\n mostRecentRoutableExtensionRender: void 0,\n beforeUnloadRegistered: false\n })\n);\nconst routableExtensionRenderedEvent = \"_ROUTABLE-EXTENSION-RENDERED\";\nclass Tracker {\n constructor(analyticsApi, context = {\n routeRef: \"unknown\",\n pluginId: \"root\",\n extension: \"App\"\n }) {\n this.analyticsApi = analyticsApi;\n this.context = context;\n if (!globalEvents.beforeUnloadRegistered) {\n addEventListener(\n \"beforeunload\",\n () => {\n if (globalEvents.mostRecentGatheredNavigation) {\n this.analyticsApi.captureEvent({\n ...globalEvents.mostRecentGatheredNavigation,\n ...globalEvents.mostRecentRoutableExtensionRender\n });\n globalEvents.mostRecentGatheredNavigation = void 0;\n globalEvents.mostRecentRoutableExtensionRender = void 0;\n }\n },\n { once: true, passive: true }\n );\n globalEvents.beforeUnloadRegistered = true;\n }\n }\n setContext(context) {\n this.context = context;\n }\n captureEvent(action, subject, {\n value,\n attributes\n } = {}) {\n const { _routeNodeType, ...context } = this.context;\n if (action === routableExtensionRenderedEvent) {\n if (globalEvents.mostRecentGatheredNavigation) {\n globalEvents.mostRecentRoutableExtensionRender = {\n context: {\n ...context,\n extension: \"App\"\n }\n };\n }\n return;\n }\n if (globalEvents.mostRecentGatheredNavigation) {\n try {\n this.analyticsApi.captureEvent({\n ...globalEvents.mostRecentGatheredNavigation,\n ...globalEvents.mostRecentRoutableExtensionRender\n });\n } catch (e) {\n console.warn(\"Error during analytics event capture. %o\", e);\n }\n globalEvents.mostRecentGatheredNavigation = void 0;\n globalEvents.mostRecentRoutableExtensionRender = void 0;\n }\n if (action === \"navigate\" && _routeNodeType === \"gathered\" && context.pluginId === \"root\") {\n globalEvents.mostRecentGatheredNavigation = {\n action,\n subject,\n value,\n attributes,\n context\n };\n return;\n }\n try {\n this.analyticsApi.captureEvent({\n action,\n subject,\n value,\n attributes,\n context\n });\n } catch (e) {\n console.warn(\"Error during analytics event capture. %o\", e);\n }\n }\n}\n\nexport { Tracker, routableExtensionRenderedEvent };\n//# sourceMappingURL=Tracker.esm.js.map\n","import { useAnalyticsContext } from './AnalyticsContext.esm.js';\nimport { useApi } from '../apis/system/useApi.esm.js';\nimport '../apis/definitions/auth.esm.js';\nimport '../apis/definitions/AlertApi.esm.js';\nimport { analyticsApiRef } from '../apis/definitions/AnalyticsApi.esm.js';\nimport '../apis/definitions/AppThemeApi.esm.js';\nimport '../apis/definitions/ConfigApi.esm.js';\nimport '../apis/definitions/DiscoveryApi.esm.js';\nimport '../apis/definitions/ErrorApi.esm.js';\nimport '../apis/definitions/FeatureFlagsApi.esm.js';\nimport '../apis/definitions/FetchApi.esm.js';\nimport '../apis/definitions/IdentityApi.esm.js';\nimport '../apis/definitions/OAuthRequestApi.esm.js';\nimport '../apis/definitions/StorageApi.esm.js';\nimport { useRef } from 'react';\nimport { Tracker } from './Tracker.esm.js';\n\nfunction useAnalyticsApi() {\n try {\n return useApi(analyticsApiRef);\n } catch {\n return { captureEvent: () => {\n } };\n }\n}\nfunction useAnalytics() {\n const trackerRef = useRef(null);\n const context = useAnalyticsContext();\n const analyticsApi = useAnalyticsApi();\n function getTracker() {\n if (trackerRef.current === null) {\n trackerRef.current = new Tracker(analyticsApi);\n }\n return trackerRef.current;\n }\n const tracker = getTracker();\n tracker.setContext(context);\n return tracker;\n}\n\nexport { useAnalytics };\n//# sourceMappingURL=useAnalytics.esm.js.map\n","function createApiFactory(factory, instance) {\n if (\"id\" in factory) {\n return {\n api: factory,\n deps: {},\n factory: () => instance\n };\n }\n return factory;\n}\n\nexport { createApiFactory };\n//# sourceMappingURL=helpers.esm.js.map\n","import 'react/jsx-runtime';\nimport '@backstage/version-bridge';\nimport '@backstage/errors';\nimport { createApiRef } from '../system/ApiRef.esm.js';\n\nvar SessionState = /* @__PURE__ */ ((SessionState2) => {\n SessionState2[\"SignedIn\"] = \"SignedIn\";\n SessionState2[\"SignedOut\"] = \"SignedOut\";\n return SessionState2;\n})(SessionState || {});\nconst googleAuthApiRef = createApiRef({\n id: \"core.auth.google\"\n});\nconst githubAuthApiRef = createApiRef({\n id: \"core.auth.github\"\n});\nconst oktaAuthApiRef = createApiRef({\n id: \"core.auth.okta\"\n});\nconst gitlabAuthApiRef = createApiRef({\n id: \"core.auth.gitlab\"\n});\nconst microsoftAuthApiRef = createApiRef({\n id: \"core.auth.microsoft\"\n});\nconst oneloginAuthApiRef = createApiRef({\n id: \"core.auth.onelogin\"\n});\nconst bitbucketAuthApiRef = createApiRef({\n id: \"core.auth.bitbucket\"\n});\nconst bitbucketServerAuthApiRef = createApiRef({\n id: \"core.auth.bitbucket-server\"\n});\nconst atlassianAuthApiRef = createApiRef({\n id: \"core.auth.atlassian\"\n});\nconst vmwareCloudAuthApiRef = createApiRef({\n id: \"core.auth.vmware-cloud\"\n});\nconst openshiftAuthApiRef = createApiRef({\n id: \"core.auth.openshift\"\n});\n\nexport { SessionState, atlassianAuthApiRef, bitbucketAuthApiRef, bitbucketServerAuthApiRef, githubAuthApiRef, gitlabAuthApiRef, googleAuthApiRef, microsoftAuthApiRef, oktaAuthApiRef, oneloginAuthApiRef, openshiftAuthApiRef, vmwareCloudAuthApiRef };\n//# sourceMappingURL=auth.esm.js.map\n","import 'react/jsx-runtime';\nimport '@backstage/version-bridge';\nimport '@backstage/errors';\nimport { createApiRef } from '../system/ApiRef.esm.js';\n\nconst alertApiRef = createApiRef({\n id: \"core.alert\"\n});\n\nexport { alertApiRef };\n//# sourceMappingURL=AlertApi.esm.js.map\n","import 'react/jsx-runtime';\nimport '@backstage/version-bridge';\nimport '@backstage/errors';\nimport { createApiRef } from '../system/ApiRef.esm.js';\n\nconst appThemeApiRef = createApiRef({\n id: \"core.apptheme\"\n});\n\nexport { appThemeApiRef };\n//# sourceMappingURL=AppThemeApi.esm.js.map\n","import 'react/jsx-runtime';\nimport '@backstage/version-bridge';\nimport '@backstage/errors';\nimport { createApiRef } from '../system/ApiRef.esm.js';\n\nconst configApiRef = createApiRef({\n id: \"core.config\"\n});\n\nexport { configApiRef };\n//# sourceMappingURL=ConfigApi.esm.js.map\n","import 'react/jsx-runtime';\nimport '@backstage/version-bridge';\nimport '@backstage/errors';\nimport { createApiRef } from '../system/ApiRef.esm.js';\n\nconst discoveryApiRef = createApiRef({\n id: \"core.discovery\"\n});\n\nexport { discoveryApiRef };\n//# sourceMappingURL=DiscoveryApi.esm.js.map\n","import 'react/jsx-runtime';\nimport '@backstage/version-bridge';\nimport '@backstage/errors';\nimport { createApiRef } from '../system/ApiRef.esm.js';\n\nvar FeatureFlagState = /* @__PURE__ */ ((FeatureFlagState2) => {\n FeatureFlagState2[FeatureFlagState2[\"None\"] = 0] = \"None\";\n FeatureFlagState2[FeatureFlagState2[\"Active\"] = 1] = \"Active\";\n return FeatureFlagState2;\n})(FeatureFlagState || {});\nconst featureFlagsApiRef = createApiRef({\n id: \"core.featureflags\"\n});\n\nexport { FeatureFlagState, featureFlagsApiRef };\n//# sourceMappingURL=FeatureFlagsApi.esm.js.map\n","import 'react/jsx-runtime';\nimport '@backstage/version-bridge';\nimport '@backstage/errors';\nimport { createApiRef } from '../system/ApiRef.esm.js';\n\nconst fetchApiRef = createApiRef({\n id: \"core.fetch\"\n});\n\nexport { fetchApiRef };\n//# sourceMappingURL=FetchApi.esm.js.map\n","import 'react/jsx-runtime';\nimport '@backstage/version-bridge';\nimport '@backstage/errors';\nimport { createApiRef } from '../system/ApiRef.esm.js';\n\nconst identityApiRef = createApiRef({\n id: \"core.identity\"\n});\n\nexport { identityApiRef };\n//# sourceMappingURL=IdentityApi.esm.js.map\n","import 'react/jsx-runtime';\nimport '@backstage/version-bridge';\nimport '@backstage/errors';\nimport { createApiRef } from '../system/ApiRef.esm.js';\n\nconst oauthRequestApiRef = createApiRef({\n id: \"core.oauthrequest\"\n});\n\nexport { oauthRequestApiRef };\n//# sourceMappingURL=OAuthRequestApi.esm.js.map\n","import 'react/jsx-runtime';\nimport '@backstage/version-bridge';\nimport '@backstage/errors';\nimport { createApiRef } from '../system/ApiRef.esm.js';\n\nconst storageApiRef = createApiRef({\n id: \"core.storage\"\n});\n\nexport { storageApiRef };\n//# sourceMappingURL=StorageApi.esm.js.map\n","import { useVersionedContext } from '@backstage/version-bridge';\n\nconst useApp = () => {\n const versionedContext = useVersionedContext(\n \"app-context\"\n );\n if (!versionedContext) {\n throw new Error(\"App context is not available\");\n }\n const appContext = versionedContext.atVersion(1);\n if (!appContext) {\n throw new Error(\"AppContext v1 not available\");\n }\n return appContext;\n};\n\nexport { useApp };\n//# sourceMappingURL=useApp.esm.js.map\n","import { getOrCreateGlobalSingleton } from '@backstage/version-bridge';\n\nconst globalStore = getOrCreateGlobalSingleton(\n \"component-data-store\",\n () => /* @__PURE__ */ new WeakMap()\n);\nconst componentDataKey = \"__backstage_data\";\nfunction attachComponentData(component, type, data) {\n const dataComponent = component;\n let container = dataComponent[componentDataKey] ?? globalStore.get(component);\n if (!container) {\n container = { map: /* @__PURE__ */ new Map() };\n Object.defineProperty(dataComponent, componentDataKey, {\n enumerable: false,\n configurable: true,\n writable: false,\n value: container\n });\n globalStore.set(component, container);\n }\n if (container.map.has(type)) {\n const name = component.displayName || component.name;\n throw new Error(\n `Attempted to attach duplicate data \"${type}\" to component \"${name}\"`\n );\n }\n container.map.set(type, data);\n}\nfunction getComponentData(node, type) {\n if (!node) {\n return void 0;\n }\n const component = node.type;\n if (!component) {\n return void 0;\n }\n const container = component[componentDataKey] ?? globalStore.get(component);\n if (!container) {\n return void 0;\n }\n return container.map.get(type);\n}\n\nexport { attachComponentData, getComponentData };\n//# sourceMappingURL=componentData.esm.js.map\n","import { useMemo } from 'react';\nimport { useLocation } from 'react-router-dom';\nimport { useVersionedContext } from '@backstage/version-bridge';\n\nfunction useRouteRef(routeRef) {\n const { pathname } = useLocation();\n const versionedContext = useVersionedContext(\n \"routing-context\"\n );\n if (!versionedContext) {\n throw new Error(\"Routing context is not available\");\n }\n const resolver = versionedContext.atVersion(1);\n const routeFunc = useMemo(\n () => resolver && resolver.resolve(routeRef, { pathname }),\n [resolver, routeRef, pathname]\n );\n if (!versionedContext) {\n throw new Error(\"useRouteRef used outside of routing context\");\n }\n if (!resolver) {\n throw new Error(\"RoutingContext v1 not available\");\n }\n const isOptional = \"optional\" in routeRef && routeRef.optional;\n if (!routeFunc && !isOptional) {\n throw new Error(`No path for ${routeRef}`);\n }\n return routeFunc;\n}\n\nexport { useRouteRef };\n//# sourceMappingURL=useRouteRef.esm.js.map\n","import { jsx } from 'react/jsx-runtime';\nimport { Component } from 'react';\n\nclass PluginErrorBoundary extends Component {\n static getDerivedStateFromError(error) {\n return { error };\n }\n state = { error: void 0 };\n handleErrorReset = () => {\n this.setState({ error: void 0 });\n };\n render() {\n const { error } = this.state;\n const { app, plugin } = this.props;\n const { ErrorBoundaryFallback } = app.getComponents();\n if (error) {\n return /* @__PURE__ */ jsx(\n ErrorBoundaryFallback,\n {\n error,\n resetError: this.handleErrorReset,\n plugin\n }\n );\n }\n return this.props.children;\n }\n}\n\nexport { PluginErrorBoundary };\n//# sourceMappingURL=PluginErrorBoundary.esm.js.map\n","import { jsx } from 'react/jsx-runtime';\nimport { lazy, useEffect, Suspense } from 'react';\nimport { AnalyticsContext } from '../analytics/AnalyticsContext.esm.js';\nimport { useAnalytics } from '../analytics/useAnalytics.esm.js';\nimport { useApp } from '../app/useApp.esm.js';\nimport '../routing/types.esm.js';\nimport { useRouteRef } from '../routing/useRouteRef.esm.js';\nimport 'react-router-dom';\nimport { attachComponentData } from './componentData.esm.js';\nimport { PluginErrorBoundary } from './PluginErrorBoundary.esm.js';\nimport { routableExtensionRenderedEvent } from '../analytics/Tracker.esm.js';\nimport { ForwardedError } from '@backstage/errors';\n\nfunction createRoutableExtension(options) {\n const { component, mountPoint, name } = options;\n return createReactExtension({\n component: {\n lazy: () => component().then((InnerComponent) => {\n const RoutableExtensionWrapper = (props) => {\n const analytics = useAnalytics();\n try {\n useRouteRef(mountPoint);\n } catch (error) {\n if (typeof error === \"object\" && error !== null) {\n const { message } = error;\n if (typeof message === \"string\" && message.startsWith(\"No path for \")) {\n throw new Error(\n `Routable extension component with mount point ${mountPoint} was not discovered in the app element tree. Routable extension components may not be rendered by other components and must be directly available as an element within the App provider component.`\n );\n }\n }\n throw error;\n }\n useEffect(() => {\n analytics.captureEvent(routableExtensionRenderedEvent, \"\");\n }, [analytics]);\n return /* @__PURE__ */ jsx(InnerComponent, { ...props });\n };\n const componentName = name || InnerComponent.displayName || InnerComponent.name || \"LazyComponent\";\n RoutableExtensionWrapper.displayName = `RoutableExtension(${componentName})`;\n return RoutableExtensionWrapper;\n })\n },\n data: {\n \"core.mountPoint\": mountPoint\n },\n name\n });\n}\nfunction createComponentExtension(options) {\n const { component, name } = options;\n return createReactExtension({ component, name });\n}\nfunction createReactExtension(options) {\n const { data = {}, name } = options;\n if (!name) {\n console.warn(\n \"Declaring extensions without name is DEPRECATED. Make sure that all usages of createReactExtension, createComponentExtension and createRoutableExtension provide a name.\"\n );\n }\n let Component;\n if (\"lazy\" in options.component) {\n const lazyLoader = options.component.lazy;\n Component = lazy(\n () => lazyLoader().then(\n (component) => ({ default: component }),\n (error) => {\n const ofExtension = name ? ` of the ${name} extension` : \"\";\n throw new ForwardedError(\n `Failed lazy loading${ofExtension}, try to reload the page`,\n error\n );\n }\n )\n );\n } else {\n Component = options.component.sync;\n }\n const componentName = name || Component.displayName || Component.name || \"Component\";\n return {\n expose(plugin) {\n const Result = (props) => {\n const app = useApp();\n const { Progress } = app.getComponents();\n const mountPoint = data?.[\"core.mountPoint\"];\n return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Progress, {}), children: /* @__PURE__ */ jsx(PluginErrorBoundary, { app, plugin, children: /* @__PURE__ */ jsx(\n AnalyticsContext,\n {\n attributes: {\n pluginId: plugin.getId(),\n ...name && { extension: name },\n ...mountPoint && { routeRef: mountPoint.id }\n },\n children: /* @__PURE__ */ jsx(Component, { ...props })\n }\n ) }) });\n };\n attachComponentData(Result, \"core.plugin\", plugin);\n attachComponentData(Result, \"core.extensionName\", name);\n for (const [key, value] of Object.entries(data)) {\n attachComponentData(Result, key, value);\n }\n Result.displayName = `Extension(${componentName})`;\n return Result;\n }\n };\n}\n\nexport { createComponentExtension, createReactExtension, createRoutableExtension };\n//# sourceMappingURL=extensions.esm.js.map\n","import { useMemo, Children, isValidElement, Fragment } from 'react';\nimport { getComponentData } from './componentData.esm.js';\nimport { useApi } from '../apis/system/useApi.esm.js';\nimport '../apis/definitions/auth.esm.js';\nimport '../apis/definitions/AlertApi.esm.js';\nimport '../apis/definitions/AnalyticsApi.esm.js';\nimport '../apis/definitions/AppThemeApi.esm.js';\nimport '../apis/definitions/ConfigApi.esm.js';\nimport '../apis/definitions/DiscoveryApi.esm.js';\nimport '../apis/definitions/ErrorApi.esm.js';\nimport { featureFlagsApiRef } from '../apis/definitions/FeatureFlagsApi.esm.js';\nimport '../apis/definitions/FetchApi.esm.js';\nimport '../apis/definitions/IdentityApi.esm.js';\nimport '../apis/definitions/OAuthRequestApi.esm.js';\nimport '../apis/definitions/StorageApi.esm.js';\n\nfunction selectChildren(rootNode, featureFlagsApi, selector, strictError) {\n return Children.toArray(rootNode).flatMap((node) => {\n if (!isValidElement(node)) {\n return [];\n }\n if (node.type === Fragment) {\n return selectChildren(\n node.props.children,\n featureFlagsApi,\n selector,\n strictError\n );\n }\n if (getComponentData(node, \"core.featureFlagged\")) {\n const props = node.props;\n const isEnabled = \"with\" in props ? featureFlagsApi.isActive(props.with) : !featureFlagsApi.isActive(props.without);\n if (isEnabled) {\n return selectChildren(\n node.props.children,\n featureFlagsApi,\n selector,\n strictError\n );\n }\n return [];\n }\n if (selector === void 0 || selector(node)) {\n return [node];\n }\n if (strictError) {\n throw new Error(strictError);\n }\n return selectChildren(\n node.props.children,\n featureFlagsApi,\n selector,\n strictError\n );\n });\n}\nclass Collection {\n constructor(node, featureFlagsApi) {\n this.node = node;\n this.featureFlagsApi = featureFlagsApi;\n }\n selectByComponentData(query) {\n const selection = selectChildren(\n this.node,\n this.featureFlagsApi,\n (node) => getComponentData(node, query.key) !== void 0,\n query.withStrictError\n );\n return new Collection(selection, this.featureFlagsApi);\n }\n findComponentData(query) {\n const selection = selectChildren(\n this.node,\n this.featureFlagsApi,\n (node) => getComponentData(node, query.key) !== void 0\n );\n return selection.map((node) => getComponentData(node, query.key)).filter((data) => data !== void 0);\n }\n getElements() {\n return selectChildren(this.node, this.featureFlagsApi);\n }\n}\nfunction useElementFilter(node, filterFn, dependencies = []) {\n const featureFlagsApi = useApi(featureFlagsApiRef);\n const elements = new Collection(node, featureFlagsApi);\n return useMemo(() => filterFn(elements), [node, ...dependencies]);\n}\n\nexport { useElementFilter };\n//# sourceMappingURL=useElementFilter.esm.js.map\n","class PluginImpl {\n constructor(config) {\n this.config = config;\n }\n getId() {\n return this.config.id;\n }\n getApis() {\n return this.config.apis ?? [];\n }\n getFeatureFlags() {\n return this.config.featureFlags?.slice() ?? [];\n }\n get routes() {\n return this.config.routes ?? {};\n }\n get externalRoutes() {\n return this.config.externalRoutes ?? {};\n }\n provide(extension) {\n return extension.expose(this);\n }\n toString() {\n return `plugin{${this.config.id}}`;\n }\n}\nfunction createPlugin(config) {\n return new PluginImpl(config);\n}\n\nexport { PluginImpl, createPlugin };\n//# sourceMappingURL=Plugin.esm.js.map\n","import { getOrCreateGlobalSingleton } from '@backstage/version-bridge';\n\nconst routeRefType = getOrCreateGlobalSingleton(\n \"route-ref-type\",\n () => Symbol(\"route-ref-type\")\n);\n\nexport { routeRefType };\n//# sourceMappingURL=types.esm.js.map\n","import { routeRefType } from './types.esm.js';\n\nclass RouteRefImpl {\n constructor(id, params) {\n this.id = id;\n this.params = params;\n }\n [routeRefType] = \"absolute\";\n get title() {\n return this.id;\n }\n toString() {\n return `routeRef{type=absolute,id=${this.id}}`;\n }\n}\nfunction createRouteRef(config) {\n return new RouteRefImpl(\n config.id,\n config.params ?? []\n );\n}\n\nexport { RouteRefImpl, createRouteRef };\n//# sourceMappingURL=RouteRef.esm.js.map\n","import { routeRefType } from './types.esm.js';\n\nconst PARAM_PATTERN = /^\\w+$/;\nclass SubRouteRefImpl {\n constructor(id, path, parent, params) {\n this.id = id;\n this.path = path;\n this.parent = parent;\n this.params = params;\n }\n [routeRefType] = \"sub\";\n toString() {\n return `routeRef{type=sub,id=${this.id}}`;\n }\n}\nfunction createSubRouteRef(config) {\n const { id, path, parent } = config;\n const pathParams = path.split(\"/\").filter((p) => p.startsWith(\":\")).map((p) => p.substring(1));\n const params = [...parent.params, ...pathParams];\n if (parent.params.some((p) => pathParams.includes(p))) {\n throw new Error(\n \"SubRouteRef may not have params that overlap with its parent\"\n );\n }\n if (!path.startsWith(\"/\")) {\n throw new Error(`SubRouteRef path must start with '/', got '${path}'`);\n }\n if (path.endsWith(\"/\")) {\n throw new Error(`SubRouteRef path must not end with '/', got '${path}'`);\n }\n for (const param of pathParams) {\n if (!PARAM_PATTERN.test(param)) {\n throw new Error(`SubRouteRef path has invalid param, got '${param}'`);\n }\n }\n const subRouteRef = new SubRouteRefImpl(\n id,\n path,\n parent,\n params\n );\n return subRouteRef;\n}\n\nexport { SubRouteRefImpl, createSubRouteRef };\n//# sourceMappingURL=SubRouteRef.esm.js.map\n","import { routeRefType } from './types.esm.js';\n\nclass ExternalRouteRefImpl {\n constructor(id, params, optional, defaultTarget) {\n this.id = id;\n this.params = params;\n this.optional = optional;\n this.defaultTarget = defaultTarget;\n }\n [routeRefType] = \"external\";\n toString() {\n return `routeRef{type=external,id=${this.id}}`;\n }\n getDefaultTarget() {\n return this.defaultTarget;\n }\n}\nfunction createExternalRouteRef(options) {\n return new ExternalRouteRefImpl(\n options.id,\n options.params ?? [],\n Boolean(options.optional),\n options?.defaultTarget\n );\n}\n\nexport { ExternalRouteRefImpl, createExternalRouteRef };\n//# sourceMappingURL=ExternalRouteRef.esm.js.map\n","import { useParams } from 'react-router-dom';\n\nfunction useRouteRefParams(_routeRef) {\n return useParams();\n}\n\nexport { useRouteRefParams };\n//# sourceMappingURL=useRouteRefParams.esm.js.map\n"],"names":["AnalyticsReactContext","createVersionedContext","useAnalyticsContext","theContext","useContext","routeRef","pluginId","extension","theValue","atVersion","Error","AnalyticsContext","options","attributes","children","combinedValue","versionedCombinedValue","createVersionedValueMap","jsx","Provider","value","analyticsApiRef","id","globalEvents","getOrCreateGlobalSingleton","mostRecentGatheredNavigation","mostRecentRoutableExtensionRender","beforeUnloadRegistered","routableExtensionRenderedEvent","Tracker","constructor","analyticsApi","context","this","addEventListener","captureEvent","once","passive","setContext","action","subject","_routeNodeType","e","console","warn","useAnalytics","trackerRef","useRef","useAnalyticsApi","tracker","current","createApiFactory","factory","instance","api","deps","SessionState","SessionState2","googleAuthApiRef","githubAuthApiRef","oktaAuthApiRef","gitlabAuthApiRef","microsoftAuthApiRef","oneloginAuthApiRef","bitbucketAuthApiRef","bitbucketServerAuthApiRef","atlassianAuthApiRef","vmwareCloudAuthApiRef","openshiftAuthApiRef","alertApiRef","appThemeApiRef","configApiRef","discoveryApiRef","FeatureFlagState","FeatureFlagState2","featureFlagsApiRef","fetchApiRef","identityApiRef","oauthRequestApiRef","storageApiRef","useApp","versionedContext","useVersionedContext","appContext","globalStore","WeakMap","componentDataKey","attachComponentData","component","type","data","dataComponent","container","get","map","Map","Object","defineProperty","enumerable","configurable","writable","set","has","name","displayName","getComponentData","node","useRouteRef","pathname","useLocation","resolver","routeFunc","useMemo","resolve","isOptional","optional","PluginErrorBoundary","Component","getDerivedStateFromError","error","state","handleErrorReset","setState","render","app","plugin","props","ErrorBoundaryFallback","getComponents","resetError","createRoutableExtension","mountPoint","createReactExtension","lazy","then","InnerComponent","RoutableExtensionWrapper","analytics","message","startsWith","useEffect","componentName","createComponentExtension","lazyLoader","default","ofExtension","sync","expose","Result","Progress","Suspense","fallback","getId","key","entries","selectChildren","rootNode","featureFlagsApi","selector","strictError","Children","toArray","flatMap","isValidElement","Fragment","isActive","with","without","Collection","selectByComponentData","query","selection","withStrictError","findComponentData","filter","getElements","useElementFilter","filterFn","dependencies","elements","PluginImpl","config","getApis","apis","getFeatureFlags","featureFlags","slice","routes","externalRoutes","provide","toString","createPlugin","routeRefType","Symbol","RouteRefImpl","params","title","createRouteRef","PARAM_PATTERN","SubRouteRefImpl","path","parent","createSubRouteRef","pathParams","split","p","substring","some","includes","endsWith","param","test","ExternalRouteRefImpl","defaultTarget","getDefaultTarget","createExternalRouteRef","Boolean","useRouteRefParams","_routeRef","useParams"],"sourceRoot":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkinternal_plugin_kuadrant=self.webpackChunkinternal_plugin_kuadrant||[]).push([[4682],{5030:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var a=n(85608),s=n(95478),r=a.__importDefault(n(10009));t.default=function(e,t,n){void 0===t&&(t=[]),void 0===n&&(n={loading:!1});var i=s.useRef(0),o=r.default(),l=s.useState(n),c=l[0],d=l[1],u=s.useCallback(function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var s=++i.current;return c.loading||d(function(e){return a.__assign(a.__assign({},e),{loading:!0})}),e.apply(void 0,t).then(function(e){return o()&&s===i.current&&d({value:e,loading:!1}),e},function(e){return o()&&s===i.current&&d({error:e,loading:!1}),e})},t);return[c,u]}},10009:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var a=n(95478);t.default=function(){var e=a.useRef(!1),t=a.useCallback(function(){return e.current},[]);return a.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),t}},12229:(e,t,n)=>{n.d(t,{Z:()=>A});var a=n(31085),s=n(95478),r=n.n(s),i=n(10394),o=n(72501),l=n(64947),c=n(37197),d=n(69621),u=n(12981),p=n(86901),m=n(69076),h=n(58837),v=n(6924),g=n(23164);const f=(0,h.A)(e=>({root:{width:240,minWidth:240,padding:e.spacing(2),borderRight:`1px solid ${e.palette.divider}`,backgroundColor:e.palette.background.paper,height:"100%",overflowY:"auto"},sectionTitle:{fontWeight:600,fontSize:"0.75rem",textTransform:"uppercase",letterSpacing:"0.05em",color:e.palette.text.secondary,marginBottom:e.spacing(1),display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",userSelect:"none"},filterSection:{marginBottom:e.spacing(2)},checkbox:{padding:e.spacing(.5)},checkboxLabel:{fontSize:"0.875rem"},clearButton:{marginTop:e.spacing(2)},count:{fontSize:"0.75rem",color:e.palette.text.secondary,marginLeft:e.spacing(1)}})),A=({sections:e,filters:t,onChange:n,onClear:s})=>{const h=f(),[A,x]=r().useState(new Set(e.filter(e=>e.collapsed).map(e=>e.id))),j=Object.values(t).some(e=>e.length>0);return(0,a.jsxs)(i.A,{className:h.root,children:[(0,a.jsxs)(i.A,{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,children:[(0,a.jsx)(o.A,{variant:"subtitle2",children:"Filters"}),j&&(0,a.jsx)(l.A,{size:"small",color:"primary",onClick:()=>{const t={};e.forEach(e=>{t[e.id]=[]}),n(t),null==s||s()},children:"Clear all"})]}),(0,a.jsx)(c.A,{}),e.map(e=>{const s=A.has(e.id),r=(t[e.id]||[]).length;return(0,a.jsxs)(i.A,{className:h.filterSection,mt:2,children:[(0,a.jsxs)(i.A,{className:h.sectionTitle,onClick:()=>{return t=e.id,void x(e=>{const n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n});var t},children:[(0,a.jsxs)(i.A,{display:"flex",alignItems:"center",children:[(0,a.jsx)("span",{children:e.title}),r>0&&(0,a.jsxs)("span",{className:h.count,children:["(",r,")"]})]}),s?(0,a.jsx)(v.A,{fontSize:"small"}):(0,a.jsx)(g.A,{fontSize:"small"})]}),(0,a.jsx)(d.A,{in:!s,children:(0,a.jsx)(u.A,{children:e.options.map(s=>(0,a.jsx)(p.A,{control:(0,a.jsx)(m.A,{checked:(t[e.id]||[]).includes(s.value),onChange:()=>((e,a)=>{const s=t[e]||[],r=s.includes(a)?s.filter(e=>e!==a):[...s,a];n({...t,[e]:r})})(e.id,s.value),size:"small",className:h.checkbox,color:"primary"}),label:(0,a.jsxs)(i.A,{display:"flex",alignItems:"center",children:[(0,a.jsx)("span",{className:h.checkboxLabel,children:s.label}),void 0!==s.count&&(0,a.jsxs)("span",{className:h.count,children:["(",s.count,")"]})]})},s.value))})})]},e.id)})]})}},14682:(e,t,n)=>{n.r(t),n.d(t,{ApiKeysPage:()=>se});var a=n(31085),s=n(95478),r=n.n(s),i=n(10394),o=n(31653),l=n(38605),c=n(289),d=n(15831),u=n(45210),p=n(46681),m=n(38599),h=n(49634),v=n(37725),g=n(86687),f=n(42367),A=n(25010),x=n(22097),j=n(91638),y=n(58837),b=n(72501),k=n(67720),w=n(71677),P=n(29365),S=n(78467),C=n(37757),q=n(26343),I=n(76891),R=n(61477),$=n(46805),z=n(93453),T=n(64947),B=n(32269),N=n(61524),M=n(99594),E=n(77225),_=n(39590),L=n(16397),F=n(63221),O=n(12229),D=n(46299);const W=(0,y.A)(e=>({container:{display:"flex",height:"100%",minHeight:400},tableContainer:{flex:1,overflow:"auto",padding:10},useCasePanel:{padding:e.spacing(2),backgroundColor:e.palette.background.default},useCaseLabel:{fontWeight:600,marginBottom:e.spacing(1),color:e.palette.text.secondary,textTransform:"uppercase",fontSize:"0.75rem"},rejectedBanner:{backgroundColor:e.palette.error.light,border:`1px solid ${e.palette.error.main}`,borderRadius:e.shape.borderRadius,padding:e.spacing(1.5,2),marginBottom:e.spacing(2),display:"flex",alignItems:"center",gap:e.spacing(1)}})),K=({request:e})=>{var t,n;const s=W(),r="Rejected"===(null===(t=e.status)||void 0===t?void 0:t.phase),o=(null===(n=e.spec.apiProductRef)||void 0===n?void 0:n.name)||"unknown";return(0,a.jsxs)(i.A,{className:s.useCasePanel,onClick:e=>e.stopPropagation(),children:[r&&(0,a.jsxs)(i.A,{className:s.rejectedBanner,children:[(0,a.jsx)(E.A,{color:"error",fontSize:"small"}),(0,a.jsxs)(b.A,{variant:"body2",children:["This API key was rejected."," ",(0,a.jsx)(v.N_,{to:`/catalog/default/api/${o}/api-keys`,children:"Request a new API key"})]})]}),(0,a.jsx)(b.A,{className:s.useCaseLabel,children:"Use Case"}),(0,a.jsx)(b.A,{variant:"body2",children:e.spec.useCase||"No use case provided"})]})},U=()=>{var e,t;const n=W(),r=(0,h.useNavigate)(),o=(0,x.useApi)(x.configApiRef),l=(0,x.useApi)(x.fetchApiRef),c=(0,x.useApi)(x.alertApiRef),d=o.getString("backend.baseUrl"),[u,p]=(0,s.useState)(new Set),[m,y]=(0,s.useState)(null),[U,H]=(0,s.useState)(null),[V,Y]=(0,s.useState)({open:!1,request:null,plans:[]}),[Z,J]=(0,s.useState)(0),[X,G]=(0,s.useState)(null),[Q,ee]=(0,s.useState)({open:!1,request:null}),[te,ne]=(0,s.useState)(new Map),[ae,se]=(0,s.useState)(new Set),[re,ie]=(0,s.useState)(new Set),[oe,le]=(0,s.useState)(!1),[ce,de]=(0,s.useState)(null),[ue,pe]=(0,s.useState)(new Set),[me,he]=(0,s.useState)({status:[],apiProduct:[],tier:[]}),{value:ve,loading:ge,error:fe}=(0,j.A)(async()=>{const[e,t]=await Promise.all([l.fetch(`${d}/api/kuadrant/requests/my`),l.fetch(`${d}/api/kuadrant/apiproducts`)]);if(!e.ok)throw new Error("failed to fetch requests");const n=(await e.json()).items||[];let a=[];t.ok&&(a=(await t.json()).items||[]);const s=new Map;return a.forEach(e=>{var t;const n=`${e.metadata.namespace}/${e.metadata.name}`,a=(null===(t=e.metadata.annotations)||void 0===t?void 0:t["backstage.io/owner"])||"unknown";s.set(n,a)}),{requests:n,products:a,ownerMap:s}},[d,l,Z]),Ae=(0,s.useMemo)(()=>(null==ve?void 0:ve.requests)?ve.requests.filter(e=>!ue.has(e.metadata.name)):[],[null==ve?void 0:ve.requests,ue]),xe=(0,s.useMemo)(()=>{const e={Approved:0,Pending:0,Rejected:0},t=new Map,n=new Map;return Ae.forEach(a=>{var s,r;const i=(null===(s=a.status)||void 0===s?void 0:s.phase)||"Pending";e[i]++;const o=(null===(r=a.spec.apiProductRef)||void 0===r?void 0:r.name)||"unknown";t.set(o,(t.get(o)||0)+1);const l=a.spec.planTier||"unknown";n.set(l,(n.get(l)||0)+1)}),[{id:"status",title:"Status",options:[{value:"Approved",label:"Active",count:e.Approved},{value:"Pending",label:"Pending",count:e.Pending},{value:"Rejected",label:"Rejected",count:e.Rejected}]},{id:"apiProduct",title:"API Product",options:Array.from(t.entries()).map(([e,t])=>({value:e,label:e,count:t})),collapsed:t.size>5},{id:"tier",title:"Tier",options:Array.from(n.entries()).map(([e,t])=>({value:e,label:e.charAt(0).toUpperCase()+e.slice(1),count:t}))}]},[Ae]),je=(0,s.useMemo)(()=>Ae.filter(e=>{if(me.status.length>0){var t;const n=(null===(t=e.status)||void 0===t?void 0:t.phase)||"Pending";if(!me.status.includes(n))return!1}if(me.apiProduct.length>0){var n;const t=(null===(n=e.spec.apiProductRef)||void 0===n?void 0:n.name)||"unknown";if(!me.apiProduct.includes(t))return!1}if(me.tier.length>0){const t=e.spec.planTier||"unknown";if(!me.tier.includes(t))return!1}return!0}),[Ae,me]),ye=e=>{p(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},be=()=>{y(null),H(null)},ke=async()=>{if(!U)return;const e=U;be();try{var t;const a=null===(t=e.spec.apiProductRef)||void 0===t?void 0:t.name,s=e.metadata.namespace,r=await l.fetch(`${d}/api/kuadrant/apiproducts/${s}/${a}`);if(r.ok){var n;const t=(null===(n=(await r.json()).spec)||void 0===n?void 0:n.plans)||[];Y({open:!0,request:e,plans:t})}else Y({open:!0,request:e,plans:[]})}catch(t){console.error("Error fetching plans:",t),Y({open:!0,request:e,plans:[]})}},we=()=>{if(!U)return;const e=U;be(),ee({open:!0,request:e})},Pe=[{title:"API Product",field:"spec.apiProductRef.name",render:e=>{var t;const n=(null===(t=e.spec.apiProductRef)||void 0===t?void 0:t.name)||"unknown";return(0,a.jsx)(v.N_,{to:`/catalog/default/api/${n}/api-keys`,children:(0,a.jsx)("strong",{children:n})})}},{title:"Owner",field:"owner",render:e=>{var t,n;const s=`${e.metadata.namespace}/${null===(t=e.spec.apiProductRef)||void 0===t?void 0:t.name}`,r=((null==ve||null===(n=ve.ownerMap)||void 0===n?void 0:n.get(s))||"unknown").replace(/^user:default\//,"");return(0,a.jsx)(b.A,{variant:"body2",children:r})}},{title:"Status",field:"status.phase",render:e=>{var t;const n=(null===(t=e.status)||void 0===t?void 0:t.phase)||"Pending",s="Approved"===n?"Active":n;return(0,a.jsx)(k.A,{label:s,size:"small",style:(0,D.S)(n)})}},{title:"Tier",field:"spec.planTier",render:e=>(0,a.jsx)(k.A,{label:e.spec.planTier,size:"small",variant:"outlined"})},{title:"API Key",field:"status.secretRef",filtering:!1,render:e=>{var t,n,s,r;if("Approved"!==(null===(t=e.status)||void 0===t?void 0:t.phase))return(0,a.jsx)(b.A,{variant:"body2",color:"textSecondary",children:"-"});const o=`${e.metadata.namespace}/${e.metadata.name}`,l=null===(s=e.status)||void 0===s||null===(n=s.secretRef)||void 0===n?void 0:n.name,d=u.has(e.metadata.name),p=ae.has(o),m=te.get(o),h=!1!==(null===(r=e.status)||void 0===r?void 0:r.canReadSecret),v=re.has(o)||!h;return l?v&&!m?(0,a.jsx)(w.Ay,{title:"This API key has already been viewed and cannot be retrieved again",children:(0,a.jsxs)(i.A,{display:"flex",alignItems:"center",children:[(0,a.jsx)(b.A,{variant:"body2",color:"textSecondary",style:{fontFamily:"monospace",marginRight:8},children:"Already viewed"}),(0,a.jsx)(N.A,{fontSize:"small",color:"disabled"})]})}):(0,a.jsxs)(i.A,{display:"flex",alignItems:"center",style:{gap:8},children:[(0,a.jsx)(i.A,{fontFamily:"monospace",fontSize:"0.875rem",children:p?"Loading...":d&&m?m:"•".repeat(20)+"..."}),d&&m&&(0,a.jsx)(w.Ay,{title:"Copy to clipboard",children:(0,a.jsx)(P.A,{size:"small",onClick:async()=>{m&&(await navigator.clipboard.writeText(m),c.post({message:"API key copied to clipboard",severity:"success",display:"transient"}))},children:(0,a.jsx)(M.A,{fontSize:"small"})})}),(0,a.jsx)(w.Ay,{title:d?"Hide API key":"Reveal API key (one-time only)",children:(0,a.jsx)("span",{children:(0,a.jsx)(P.A,{size:"small",onClick:()=>{d?(((e,t)=>{const n=`${e}/${t}`;ne(e=>{const t=new Map(e);return t.delete(n),t})})(e.metadata.namespace,e.metadata.name),ye(e.metadata.name)):v||(de({namespace:e.metadata.namespace,name:e.metadata.name}),le(!0))},disabled:p||v&&!m,children:d?(0,a.jsx)(N.A,{fontSize:"small"}):(0,a.jsx)(B.A,{fontSize:"small"})})})})]}):(0,a.jsx)(b.A,{variant:"body2",color:"textSecondary",children:"Awaiting secret..."})}},{title:"Requested",field:"metadata.creationTimestamp",render:e=>{if(!e.metadata.creationTimestamp)return(0,a.jsx)(b.A,{variant:"body2",children:"-"});const t=new Date(e.metadata.creationTimestamp);return(0,a.jsx)(b.A,{variant:"body2",children:t.toLocaleDateString()})}},{title:"Actions",filtering:!1,width:"100px",render:e=>X===e.metadata.name?(0,a.jsx)(S.A,{size:20}):(0,a.jsxs)(i.A,{display:"flex",style:{gap:4},children:[(0,a.jsx)(w.Ay,{title:"View details",children:(0,a.jsx)(P.A,{size:"small",onClick:t=>{t.stopPropagation(),r(`/kuadrant/api-keys/${e.metadata.namespace}/${e.metadata.name}`)},children:(0,a.jsx)(B.A,{fontSize:"small"})})}),(0,a.jsx)(w.Ay,{title:"Delete",children:(0,a.jsx)(P.A,{size:"small",onClick:t=>{t.stopPropagation(),ee({open:!0,request:e})},children:(0,a.jsx)(_.A,{fontSize:"small"})})})]})}],Se=(0,s.useMemo)(()=>[{render:e=>{var t;const n=e.rowData;return(null==n||null===(t=n.metadata)||void 0===t?void 0:t.name)?(0,a.jsx)(K,{request:n}):(0,a.jsx)(i.A,{})}}],[]);return ge?(0,a.jsx)(g.k,{}):fe?(0,a.jsx)(f._,{error:fe}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(i.A,{className:n.container,children:[(0,a.jsx)(O.Z,{sections:xe,filters:me,onChange:he}),(0,a.jsx)(i.A,{className:n.tableContainer,children:0===je.length?(0,a.jsx)(i.A,{p:4,textAlign:"center",children:(0,a.jsx)(b.A,{variant:"body1",color:"textSecondary",children:0===Ae.length?"No API keys found. Request access to an API to get started.":"No API keys match the selected filters."})}):(0,a.jsx)(A.X,{options:{paging:je.length>10,pageSize:20,search:!0,filtering:!1,debounceInterval:300,toolbar:!0,emptyRowsWhenPaging:!1},columns:Pe,data:je.map(e=>({...e,id:e.metadata.name})),detailPanel:Se})})]}),(0,a.jsx)(C.A,{id:"myapikeys-menu",open:Boolean(m),onClose:be,anchorReference:"anchorPosition",anchorPosition:m||{top:0,left:0},children:U&&(()=>{const e=[];var t;return e.push((0,a.jsx)(q.A,{onClick:()=>{r(`/kuadrant/api-keys/${U.metadata.namespace}/${U.metadata.name}`),be()},children:"View Details"},"view")),(t=U).status&&"Pending"!==t.status.phase||e.push((0,a.jsx)(q.A,{onClick:ke,children:"Edit"},"edit")),e.push((0,a.jsx)(q.A,{onClick:we,children:"Delete"},"delete")),e})()}),V.request&&(0,a.jsx)(L.e,{open:V.open,request:V.request,availablePlans:V.plans,onClose:()=>Y({open:!1,request:null,plans:[]}),onSuccess:()=>{Y({open:!1,request:null,plans:[]}),J(e=>e+1)}}),(0,a.jsx)(F.K,{open:Q.open,title:"Delete API Key",description:`Are you sure you want to delete this API key for ${(null===(t=Q.request)||void 0===t||null===(e=t.spec.apiProductRef)||void 0===e?void 0:e.name)||"this API"}?`,deleting:null!==X,onConfirm:async()=>{if(!Q.request)return;const e=Q.request,t=e.metadata.name;pe(e=>new Set(e).add(t)),G(t);try{if(!(await l.fetch(`${d}/api/kuadrant/requests/${e.metadata.namespace}/${e.metadata.name}`,{method:"DELETE"})).ok)throw new Error("Failed to delete request");J(e=>e+1),c.post({message:"API key deleted",severity:"success",display:"transient"}),ee({open:!1,request:null})}catch(e){console.error("Error deleting request:",e),pe(e=>{const n=new Set(e);return n.delete(t),n}),c.post({message:"Failed to delete API key",severity:"error",display:"transient"})}finally{G(null)}},onCancel:()=>{ee({open:!1,request:null})}}),(0,a.jsxs)(I.A,{open:oe,onClose:()=>{le(!1),de(null)},maxWidth:"sm",children:[(0,a.jsx)(R.A,{children:(0,a.jsxs)(i.A,{display:"flex",alignItems:"center",children:[(0,a.jsx)(E.A,{color:"primary",style:{marginRight:8}}),"View API Key"]})}),(0,a.jsxs)($.A,{children:[(0,a.jsxs)(b.A,{variant:"body1",paragraph:!0,children:["This API key can only be viewed ",(0,a.jsx)("strong",{children:"once"}),". After you reveal it, you will not be able to retrieve it again."]}),(0,a.jsx)(b.A,{variant:"body2",color:"textSecondary",children:"Make sure to copy and store it securely before closing this view."})]}),(0,a.jsxs)(z.A,{children:[(0,a.jsx)(T.A,{onClick:()=>{le(!1),de(null)},children:"Cancel"}),(0,a.jsx)(T.A,{variant:"contained",color:"primary",onClick:()=>{ce&&((async(e,t)=>{const n=`${e}/${t}`;if(!ae.has(n)){se(e=>new Set(e).add(n));try{const a=await l.fetch(`${d}/api/kuadrant/apikeys/${e}/${t}/secret`);if(a.ok){const e=await a.json();ne(t=>new Map(t).set(n,e.apiKey)),ie(e=>new Set(e).add(n))}else 403===a.status&&(ie(e=>new Set(e).add(n)),c.post({message:"This API key has already been viewed and cannot be retrieved again.",severity:"warning",display:"transient"}))}catch(e){const t=e instanceof Error?e.message:"unknown error occurred";c.post({message:`Failed to fetch api key: ${t}`,severity:"error",display:"transient"})}finally{se(e=>{const t=new Set(e);return t.delete(n),t})}}})(ce.namespace,ce.name),ye(ce.name)),le(!1),de(null)},children:"Reveal API Key"})]})]})]})};var H=n(35015),V=n(34955),Y=n(46205),Z=n(16249),J=n(55429),X=n(92399);const G=(0,y.A)(e=>({container:{display:"flex",height:"100%",minHeight:400},tableContainer:{flex:1,overflow:"auto",padding:10},useCasePanel:{padding:e.spacing(2),backgroundColor:e.palette.background.default},useCaseLabel:{fontWeight:600,marginBottom:e.spacing(1),color:e.palette.text.secondary,textTransform:"uppercase",fontSize:"0.75rem"},bulkActions:{padding:e.spacing(2),backgroundColor:e.palette.background.default,borderBottom:`1px solid ${e.palette.divider}`,display:"flex",alignItems:"center",justifyContent:"space-between"}})),Q=({open:e,request:t,action:n,processing:s,onClose:o,onConfirm:l})=>{var c,d;const[u,p]=r().useState(""),m="approve"===n?"Approve":"Reject",h="approve"===n?"Approving...":"Rejecting...",v="reject"===n,g=(null==t||null===(c=t.spec.requestedBy)||void 0===c?void 0:c.userId)||"",f=!v||u===g;return r().useEffect(()=>{e||p("")},[e]),(0,a.jsxs)(I.A,{open:e,onClose:s?void 0:o,maxWidth:"sm",fullWidth:!0,children:[(0,a.jsx)(R.A,{children:v?(0,a.jsxs)(i.A,{display:"flex",alignItems:"center",style:{gap:8},children:[(0,a.jsx)(X.A,{color:"error"}),(0,a.jsxs)("span",{children:[m," API Key"]})]}):(0,a.jsxs)("span",{children:[m," API Key"]})}),(0,a.jsx)($.A,{children:t&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("p",{children:[(0,a.jsx)("strong",{children:"User:"})," ",t.spec.requestedBy.userId]}),(0,a.jsxs)("p",{children:[(0,a.jsx)("strong",{children:"API:"})," ",(null===(d=t.spec.apiProductRef)||void 0===d?void 0:d.name)||"unknown"]}),(0,a.jsxs)("p",{children:[(0,a.jsx)("strong",{children:"Tier:"})," ",t.spec.planTier]}),(0,a.jsxs)(i.A,{mb:2,children:[(0,a.jsx)(b.A,{variant:"body2",component:"span",style:{fontWeight:"bold"},children:"Use Case:"})," ",(0,a.jsx)(b.A,{variant:"body2",component:"span",style:{whiteSpace:"pre-wrap"},children:t.spec.useCase||"-"})]}),v&&(0,a.jsxs)(i.A,{mt:2,children:[(0,a.jsxs)(b.A,{variant:"body2",color:"textSecondary",gutterBottom:!0,children:["Type ",(0,a.jsx)("strong",{children:g})," to confirm rejection:"]}),(0,a.jsx)(Z.A,{fullWidth:!0,variant:"outlined",size:"small",value:u,onChange:e=>p(e.target.value),disabled:s,autoFocus:!0,placeholder:g})]})]})}),(0,a.jsxs)(z.A,{children:[(0,a.jsx)(T.A,{onClick:o,disabled:s,children:"Cancel"}),(0,a.jsx)(T.A,{onClick:l,color:"approve"===n?"primary":"secondary",variant:"contained",disabled:s||!f,startIcon:s?(0,a.jsx)(S.A,{size:16,color:"inherit"}):void 0,children:s?h:m})]})]})},ee=({open:e,requests:t,action:n,processing:s,onClose:r,onConfirm:o})=>{const l="approve"===n,c=l?"Approve All":"Reject All",d=l?"Approving...":"Rejecting...";return(0,a.jsxs)(I.A,{open:e,onClose:s?void 0:r,maxWidth:"md",fullWidth:!0,children:[(0,a.jsxs)(R.A,{children:[l?"Approve":"Reject"," ",t.length," API Keys"]}),(0,a.jsxs)($.A,{children:[(0,a.jsxs)(b.A,{variant:"body2",paragraph:!0,children:["You are about to ",l?"approve":"reject"," the following API keys:"]}),(0,a.jsx)(i.A,{mb:2,maxHeight:200,overflow:"auto",children:t.map(e=>{var t;return(0,a.jsx)(i.A,{mb:1,p:1,bgcolor:"background.default",children:(0,a.jsxs)(b.A,{variant:"body2",children:[(0,a.jsx)("strong",{children:e.spec.requestedBy.userId})," -"," ",(null===(t=e.spec.apiProductRef)||void 0===t?void 0:t.name)||"unknown"," (",e.spec.planTier,")"]})},`${e.metadata.namespace}/${e.metadata.name}`)})})]}),(0,a.jsxs)(z.A,{children:[(0,a.jsx)(T.A,{onClick:r,disabled:s,children:"Cancel"}),(0,a.jsx)(T.A,{onClick:o,color:l?"primary":"secondary",variant:"contained",disabled:s,startIcon:s?(0,a.jsx)(S.A,{size:16,color:"inherit"}):void 0,children:s?d:c})]})]})},te=({request:e})=>{const t=G();return(0,a.jsxs)(i.A,{className:t.useCasePanel,onClick:e=>e.stopPropagation(),children:[(0,a.jsx)(b.A,{className:t.useCaseLabel,children:"Use Case"}),(0,a.jsx)(b.A,{variant:"body2",children:e.spec.useCase||"No use case provided"})]})},ne=()=>{var e;const t=G(),n=(0,x.useApi)(x.configApiRef),r=(0,x.useApi)(x.fetchApiRef),o=(0,x.useApi)(x.identityApiRef),l=(0,x.useApi)(x.alertApiRef),c=n.getString("backend.baseUrl"),[d,u]=(0,s.useState)(0),[p,m]=(0,s.useState)([]),[h,j]=(0,s.useState)({open:!1,request:null,action:"approve",processing:!1}),[y,w]=(0,s.useState)({open:!1,requests:[],action:"approve",processing:!1}),[P,S]=(0,s.useState)({status:[],apiProduct:[],tier:[]}),{allowed:C,loading:q,error:I}=(0,Y.l)(V.z4),{allowed:R,loading:$,error:z}=(0,Y.l)(V.q0),B=q||$,N=I||z,{value:M,loading:E,error:_}=(0,H.A)(async()=>{const e=(await o.getBackstageIdentity()).userEntityRef,[t,n]=await Promise.all([r.fetch(`${c}/api/kuadrant/requests`),r.fetch(`${c}/api/kuadrant/apiproducts`)]);if(!t.ok)return{allRequests:[],reviewedBy:e,ownedApiProducts:new Set};const a=t.headers.get("content-type");if(!(null==a?void 0:a.includes("application/json")))return l.post({message:"Unexpected content-type from the server response.",display:"transient",severity:"warning"}),{allRequests:[],reviewedBy:e,ownedApiProducts:new Set};const s=(await t.json()).items||[],i=new Set;if(n.ok){const t=await n.json();for(const n of t.items||[]){var d,u;(null===(u=n.metadata)||void 0===u||null===(d=u.annotations)||void 0===d?void 0:d["backstage.io/owner"])===e&&i.add(`${n.metadata.namespace}/${n.metadata.name}`)}}return{allRequests:s,reviewedBy:e,ownedApiProducts:i}},[c,r,o,d]),L=(0,s.useMemo)(()=>{if(!(null==M?void 0:M.allRequests))return[];const e={Approved:0,Pending:0,Rejected:0},t=new Map,n=new Map;return M.allRequests.forEach(a=>{var s,r;const i=(null===(s=a.status)||void 0===s?void 0:s.phase)||"Pending";e[i]++;const o=(null===(r=a.spec.apiProductRef)||void 0===r?void 0:r.name)||"unknown";t.set(o,(t.get(o)||0)+1);const l=a.spec.planTier||"unknown";n.set(l,(n.get(l)||0)+1)}),[{id:"status",title:"Status",options:[{value:"Pending",label:"Pending",count:e.Pending},{value:"Approved",label:"Approved",count:e.Approved},{value:"Rejected",label:"Rejected",count:e.Rejected}]},{id:"apiProduct",title:"API Product",options:Array.from(t.entries()).map(([e,t])=>({value:e,label:e,count:t})),collapsed:t.size>5},{id:"tier",title:"Tier",options:Array.from(n.entries()).map(([e,t])=>({value:e,label:e.charAt(0).toUpperCase()+e.slice(1),count:t}))}]},[null==M?void 0:M.allRequests]),F=(0,s.useMemo)(()=>(null==M?void 0:M.allRequests)?M.allRequests.filter(e=>{if(P.status.length>0){var t;const n=(null===(t=e.status)||void 0===t?void 0:t.phase)||"Pending";if(!P.status.includes(n))return!1}if(P.apiProduct.length>0){var n;const t=(null===(n=e.spec.apiProductRef)||void 0===n?void 0:n.name)||"unknown";if(!P.apiProduct.includes(t))return!1}if(P.tier.length>0){const t=e.spec.planTier||"unknown";if(!P.tier.includes(t))return!1}return!0}):[],[null==M?void 0:M.allRequests,P]),W=e=>new Date(e).toLocaleDateString("en-GB",{year:"numeric",month:"short",day:"numeric"}),K=[{title:"Requester",field:"spec.requestedBy.userId",render:e=>(0,a.jsx)(b.A,{variant:"body2",children:e.spec.requestedBy.userId})},{title:"API Product",field:"spec.apiProductRef.name",render:e=>{var t;const n=(null===(t=e.spec.apiProductRef)||void 0===t?void 0:t.name)||"unknown";return(0,a.jsx)(v.N_,{to:`/catalog/default/api/${n}`,children:(0,a.jsx)("strong",{children:n})})}},{title:"Status",field:"status.phase",render:e=>{var t;const n=(null===(t=e.status)||void 0===t?void 0:t.phase)||"Pending";return(0,a.jsx)(k.A,{label:n,size:"small",style:(0,D.S)(n)})}},{title:"Tier",field:"spec.planTier",render:e=>(0,a.jsx)(k.A,{label:e.spec.planTier,size:"small",variant:"outlined"})},{title:"Requested",field:"metadata.creationTimestamp",render:e=>(0,a.jsx)(b.A,{variant:"body2",children:e.metadata.creationTimestamp?W(e.metadata.creationTimestamp):"-"})},{title:"Reviewed By",field:"status.reviewedBy",render:e=>{var t;if(!(null===(t=e.status)||void 0===t?void 0:t.reviewedBy))return(0,a.jsx)(b.A,{variant:"body2",color:"textSecondary",children:"-"});const n=e.status.reviewedBy.replace(/^user:default\//,""),s="system"===n;return(0,a.jsxs)(i.A,{children:[(0,a.jsx)(b.A,{variant:"body2",children:s?"Automatic":n}),e.status.reviewedAt&&(0,a.jsx)(b.A,{variant:"caption",color:"textSecondary",children:W(e.status.reviewedAt)})]})}},{title:"Actions",filtering:!1,render:e=>{var t,n,s;if("Pending"!==((null===(t=e.status)||void 0===t?void 0:t.phase)||"Pending"))return null;const r=`${e.metadata.namespace}/${(null===(n=e.spec.apiProductRef)||void 0===n?void 0:n.name)||"unknown"}`;var o;const l=null!==(o=null==M||null===(s=M.ownedApiProducts)||void 0===s?void 0:s.has(r))&&void 0!==o&&o;return C||R&&l?(0,a.jsxs)(i.A,{display:"flex",style:{gap:8},children:[(0,a.jsx)(T.A,{size:"small",startIcon:(0,a.jsx)(J.A,{}),onClick:()=>{j({open:!0,request:e,action:"approve",processing:!1})},color:"primary",variant:"outlined",children:"Approve"}),(0,a.jsx)(T.A,{size:"small",startIcon:(0,a.jsx)(X.A,{}),onClick:()=>{j({open:!0,request:e,action:"reject",processing:!1})},color:"secondary",variant:"outlined",children:"Reject"})]}):null}}],U=(0,s.useMemo)(()=>[{render:e=>{var t;const n=e.rowData;return(null==n||null===(t=n.metadata)||void 0===t?void 0:t.name)?(0,a.jsx)(te,{request:n}):(0,a.jsx)(i.A,{})}}],[]);if(E||B)return(0,a.jsx)(g.k,{});if(_)return(0,a.jsx)(f._,{error:_});if(N)return(0,a.jsx)(i.A,{p:2,children:(0,a.jsxs)(b.A,{color:"error",children:["Unable to check permissions: ",N.message]})});const Z=C||R;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(i.A,{className:t.container,children:[(0,a.jsx)(O.Z,{sections:L,filters:P,onChange:S}),(0,a.jsxs)(i.A,{className:t.tableContainer,children:[p.length>0&&(0,a.jsxs)(i.A,{className:t.bulkActions,children:[(0,a.jsxs)(b.A,{variant:"body2",children:[p.length," request",1!==p.length?"s":""," selected"]}),(0,a.jsxs)(i.A,{display:"flex",style:{gap:8},children:[(0,a.jsx)(T.A,{size:"small",variant:"contained",color:"primary",startIcon:(0,a.jsx)(J.A,{}),onClick:()=>{0!==p.length&&w({open:!0,requests:p,action:"approve",processing:!1})},children:"Approve Selected"}),(0,a.jsx)(T.A,{size:"small",variant:"contained",color:"secondary",startIcon:(0,a.jsx)(X.A,{}),onClick:()=>{0!==p.length&&w({open:!0,requests:p,action:"reject",processing:!1})},children:"Reject Selected"})]})]}),0===F.length?(0,a.jsx)(i.A,{p:4,textAlign:"center",children:(0,a.jsx)(b.A,{variant:"body1",color:"textSecondary",children:0===(null==M||null===(e=M.allRequests)||void 0===e?void 0:e.length)?"No API keys found.":"No API keys match the selected filters."})}):(0,a.jsx)(A.X,{options:{selection:Z,showSelectAllCheckbox:F.some(e=>{var t;return!(null===(t=e.status)||void 0===t?void 0:t.phase)||"Pending"===e.status.phase}),selectionProps:e=>{var t,n;return{disabled:"Pending"!==(null===(t=e.status)||void 0===t?void 0:t.phase)&&void 0!==(null===(n=e.status)||void 0===n?void 0:n.phase)}},paging:F.length>10,pageSize:20,search:!0,filtering:!1,debounceInterval:300,showTextRowsSelected:!1,toolbar:!0,emptyRowsWhenPaging:!1},columns:K,data:F.map(e=>{const t=p.some(t=>t.metadata.name===e.metadata.name&&t.metadata.namespace===e.metadata.namespace);return{...e,id:e.metadata.name,tableData:{checked:t}}}),onSelectionChange:e=>{const t=e.filter(e=>{var t;return!(null===(t=e.status)||void 0===t?void 0:t.phase)||"Pending"===e.status.phase});m(t)},detailPanel:U})]})]}),(0,a.jsx)(Q,{open:h.open,request:h.request,action:h.action,processing:h.processing,onClose:()=>j({open:!1,request:null,action:"approve",processing:!1}),onConfirm:async()=>{if(!h.request||!M)return;j(e=>({...e,processing:!0}));const e="approve"===h.action?`${c}/api/kuadrant/requests/${h.request.metadata.namespace}/${h.request.metadata.name}/approve`:`${c}/api/kuadrant/requests/${h.request.metadata.namespace}/${h.request.metadata.name}/reject`;try{if(!(await r.fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reviewedBy:M.reviewedBy})})).ok)throw new Error(`failed to ${h.action} request`);j({open:!1,request:null,action:"approve",processing:!1}),m(e=>e.filter(e=>{var t,n;return e.metadata.name!==(null===(t=h.request)||void 0===t?void 0:t.metadata.name)||e.metadata.namespace!==(null===(n=h.request)||void 0===n?void 0:n.metadata.namespace)})),u(e=>e+1);const t="approve"===h.action?"approved":"rejected";l.post({message:`API key ${t}`,severity:"success",display:"transient"})}catch(e){console.error(`error ${h.action}ing request:`,e),j(e=>({...e,processing:!1})),l.post({message:`Failed to ${h.action} API key`,severity:"error",display:"transient"})}}}),(0,a.jsx)(ee,{open:y.open,requests:y.requests,action:y.action,processing:y.processing,onClose:()=>w({open:!1,requests:[],action:"approve",processing:!1}),onConfirm:async()=>{if(!M||0===y.requests.length)return;w(e=>({...e,processing:!0}));const e="approve"===y.action,t=e?`${c}/api/kuadrant/requests/bulk-approve`:`${c}/api/kuadrant/requests/bulk-reject`;try{if(!(await r.fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({requests:y.requests.map(e=>({namespace:e.metadata.namespace,name:e.metadata.name})),reviewedBy:M.reviewedBy})})).ok)throw new Error(`failed to bulk ${y.action} requests`);const n=y.requests.length,a=e?"approved":"rejected";w({open:!1,requests:[],action:"approve",processing:!1}),m([]),u(e=>e+1),l.post({message:`${n} API keys ${a}`,severity:"success",display:"transient"})}catch(e){console.error(`error bulk ${y.action}ing requests:`,e),w(e=>({...e,processing:!1})),l.post({message:`Failed to bulk ${y.action} API keys`,severity:"error",display:"transient"})}}})]})},ae=()=>{const[e,t]=(0,s.useState)(0),{allowed:n,loading:r}=(0,Y.l)(V.KV);return(0,a.jsxs)(c.Y,{themeId:"tool",children:[(0,a.jsx)(d.Y,{title:"API Keys",subtitle:"API keys management for Kubernetes",children:(0,a.jsx)(u.Y,{children:"Manage your API keys and access requests"})}),(0,a.jsxs)(p.U,{children:[(0,a.jsx)(i.A,{mb:2,children:(0,a.jsxs)(o.A,{value:e,onChange:(e,n)=>{t(n)},indicatorColor:"primary",textColor:"primary",children:[(0,a.jsx)(l.A,{label:"My API keys","data-testid":"my-api-keys-tab"}),!r&&n&&(0,a.jsx)(l.A,{label:"API keys approval","data-testid":"api-keys-approval-tab"})]})}),0===e&&(0,a.jsx)(U,{}),1===e&&n&&(0,a.jsx)(ne,{})]})]})},se=()=>(0,a.jsx)(m.B,{permission:V.DS,errorMessage:"you don't have permission to view the API Keys page",children:(0,a.jsx)(ae,{})})},23164:(e,t,n)=>{var a=n(4293),s=n(78920);t.A=void 0;var r=s(n(95478)),i=(0,a(n(74044)).default)(r.createElement("path",{d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"}),"ExpandLess");t.A=i},27799:(e,t,n)=>{var a=n(4293),s=n(78920);t.A=void 0;var r=s(n(95478)),i=(0,a(n(74044)).default)(r.createElement("path",{d:"M21 5v6.59l-3-3.01-4 4.01-4-4-4 4-3-3.01V5c0-1.1.9-2 2-2h14c1.1 0 2 .9 2 2zm-3 6.42l3 3.01V19c0 1.1-.9 2-2 2H5c-1.1 0-2-.9-2-2v-6.58l3 2.99 4-4 4 4 4-3.99z"}),"BrokenImage");t.A=i},38599:(e,t,n)=>{n.d(t,{B:()=>l});var a=n(31085),s=(n(95478),n(10394)),r=n(72501),i=n(86687),o=n(46205);const l=({children:e,permission:t,fallback:n,errorMessage:l})=>{const{allowed:c,loading:d,error:u}=(0,o.l)(t);return d?(0,a.jsx)(i.k,{}):u?(0,a.jsxs)(s.A,{p:4,children:[(0,a.jsxs)(r.A,{color:"error",children:["Unable to check permissions: ",u.message]}),(0,a.jsx)(r.A,{variant:"body2",color:"textSecondary",children:"Please try again or contact your administrator"})]}):c?(0,a.jsx)(a.Fragment,{children:e}):n?(0,a.jsx)(a.Fragment,{children:n}):(0,a.jsxs)(s.A,{p:4,children:[(0,a.jsx)(r.A,{color:"textSecondary",children:l||"You don't have permission to view this page"}),(0,a.jsx)(s.A,{mt:1,children:(0,a.jsxs)(r.A,{variant:"caption",color:"textSecondary",children:["Required permission: ",t.name]})})]})}},39590:(e,t,n)=>{var a=n(4293),s=n(78920);t.A=void 0;var r=s(n(95478)),i=(0,a(n(74044)).default)(r.createElement("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"}),"Delete");t.A=i},45210:(e,t,n)=>{n.d(t,{Y:()=>I});var a=n(31085),s=n(22097),r=n(10394),i=n(64947),o=n(93453),l=n(29365),c=n(46423),d=n(5951),u=n(26343),p=n(28233),m=n(55197),h=n(37976),v=n(72501),g=n(5893),f=n(95478),A=(n(45250),n(49634),n(21006)),x=n(67550);const j=()=>{const{t:e}=(0,x.i)(A.O);return{url:"https://github.com/backstage/backstage/issues",items:[{title:e("supportConfig.default.title"),icon:"warning",links:[{title:e("supportConfig.default.linkTitle"),url:"https://github.com/backstage/backstage/blob/master/app-config.yaml"}]}]}};var y=n(27799);function b(e){const{id:t,Fallback:n=y.A,...r}=e,i=(0,s.useApp)().getSystemIcon(t)??n;return(0,a.jsx)(i,{...r})}function k(e){return(0,a.jsx)(b,{id:"help",...e})}var w=n(37725);const P=(0,h.makeStyles)({popoverList:{minWidth:260,maxWidth:400},menuItem:{whiteSpace:"normal"}},{name:"BackstageSupportButton"}),S=({icon:e})=>{const t=(0,s.useApp)(),n=e?t.getSystemIcon(e)??k:k;return(0,a.jsx)(n,{})},C=({link:e})=>(0,a.jsx)(w.N_,{to:e.url,children:e.title??e.url}),q=({item:e})=>(0,a.jsxs)(u.A,{button:!1,children:[(0,a.jsx)(c.A,{children:(0,a.jsx)(S,{icon:e.icon})}),(0,a.jsx)(d.A,{primary:e.title,secondary:e.links?.reduce((e,t,n)=>[...e,n>0&&(0,a.jsx)("br",{},n),(0,a.jsx)(C,{link:t},t.url)],[])})]});function I(e){const{t}=(0,x.i)(A.O),{title:n,items:c,children:d}=e,{items:h}=function(){const e=(0,s.useApiHolder)().get(s.configApiRef),t=e?.getOptionalConfig("app.support"),n=j();return t?{url:t.getString("url"),items:t.getConfigArray("items").flatMap(e=>({title:e.getString("title"),icon:e.getOptionalString("icon"),links:(e.getOptionalConfigArray("links")??[]).flatMap(e=>({url:e.getString("url"),title:e.getOptionalString("title")??""}))}))}:n}(),[y,b]=(0,f.useState)(!1),[w,S]=(0,f.useState)(null),C=P(),I=(0,s.useApi)(s.configApiRef).getOptionalConfig("app.support"),R=(0,g.A)(e=>e.breakpoints.down("sm")),$=e=>{S(e.currentTarget),b(!0)},z=()=>{b(!1)};return I?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(r.A,{display:"flex",ml:1,children:R?(0,a.jsx)(l.A,{color:"primary",size:"small",onClick:$,"data-testid":"support-button","aria-label":"Support",children:(0,a.jsx)(k,{})}):(0,a.jsx)(i.A,{"data-testid":"support-button","aria-label":"Support",color:"primary",onClick:$,startIcon:(0,a.jsx)(k,{}),children:t("supportButton.title")})}),(0,a.jsxs)(m.Ay,{"data-testid":"support-button-popover",open:y,anchorEl:w,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},onClose:z,children:[(0,a.jsxs)(p.A,{className:C.popoverList,autoFocusItem:Boolean(w),children:[n&&(0,a.jsx)(u.A,{button:!1,alignItems:"flex-start",className:C.menuItem,children:(0,a.jsx)(v.A,{variant:"subtitle1",children:n})}),f.Children.map(d,(e,t)=>(0,a.jsx)(u.A,{button:!1,alignItems:"flex-start",className:C.menuItem,children:e},`child-${t}`)),(c??h).map((e,t)=>(0,a.jsx)(q,{item:e},`item-${t}`))]}),(0,a.jsx)(o.A,{children:(0,a.jsx)(i.A,{color:"primary",onClick:z,"aria-label":"Close",children:t("supportButton.close")})})]})]}):null}},46299:(e,t,n)=>{n.d(t,{S:()=>a});const a=e=>{const t={border:"none"};switch(e){case"Approved":return{...t,backgroundColor:"#4caf50",color:"#fff"};case"Rejected":return{...t,backgroundColor:"#f44336",color:"#fff"};default:return{...t,backgroundColor:"#ff9800",color:"#fff"}}}},55429:(e,t,n)=>{var a=n(4293),s=n(78920);t.A=void 0;var r=s(n(95478)),i=(0,a(n(74044)).default)(r.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckCircle");t.A=i},91638:(e,t,n)=>{var a=n(85608),s=n(95478),r=a.__importDefault(n(5030));t.A=function(e,t){void 0===t&&(t=[]);var n=r.default(e,t,{loading:!0}),a=n[0],i=n[1];return s.useEffect(function(){i()},[i]),a}}}]);
|
|
2
|
-
//# sourceMappingURL=4682.
|
|
1
|
+
"use strict";(self.webpackChunkinternal_plugin_kuadrant=self.webpackChunkinternal_plugin_kuadrant||[]).push([[4682],{5030:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var a=n(85608),s=n(95478),r=a.__importDefault(n(10009));t.default=function(e,t,n){void 0===t&&(t=[]),void 0===n&&(n={loading:!1});var i=s.useRef(0),o=r.default(),l=s.useState(n),c=l[0],d=l[1],u=s.useCallback(function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var s=++i.current;return c.loading||d(function(e){return a.__assign(a.__assign({},e),{loading:!0})}),e.apply(void 0,t).then(function(e){return o()&&s===i.current&&d({value:e,loading:!1}),e},function(e){return o()&&s===i.current&&d({error:e,loading:!1}),e})},t);return[c,u]}},10009:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var a=n(95478);t.default=function(){var e=a.useRef(!1),t=a.useCallback(function(){return e.current},[]);return a.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),t}},12229:(e,t,n)=>{n.d(t,{Z:()=>A});var a=n(31085),s=n(95478),r=n.n(s),i=n(10394),o=n(72501),l=n(64947),c=n(37197),d=n(69621),u=n(12981),p=n(86901),m=n(69076),h=n(58837),v=n(6924),g=n(23164);const f=(0,h.A)(e=>({root:{width:240,minWidth:240,padding:e.spacing(2),borderRight:`1px solid ${e.palette.divider}`,backgroundColor:e.palette.background.paper,height:"100%",overflowY:"auto"},sectionTitle:{fontWeight:600,fontSize:"0.75rem",textTransform:"uppercase",letterSpacing:"0.05em",color:e.palette.text.secondary,marginBottom:e.spacing(1),display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",userSelect:"none"},filterSection:{marginBottom:e.spacing(2)},checkbox:{padding:e.spacing(.5)},checkboxLabel:{fontSize:"0.875rem"},clearButton:{marginTop:e.spacing(2)},count:{fontSize:"0.75rem",color:e.palette.text.secondary,marginLeft:e.spacing(1)}})),A=({sections:e,filters:t,onChange:n,onClear:s})=>{const h=f(),[A,x]=r().useState(new Set(e.filter(e=>e.collapsed).map(e=>e.id))),j=Object.values(t).some(e=>e.length>0);return(0,a.jsxs)(i.A,{className:h.root,children:[(0,a.jsxs)(i.A,{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,children:[(0,a.jsx)(o.A,{variant:"subtitle2",children:"Filters"}),j&&(0,a.jsx)(l.A,{size:"small",color:"primary",onClick:()=>{const t={};e.forEach(e=>{t[e.id]=[]}),n(t),null==s||s()},children:"Clear all"})]}),(0,a.jsx)(c.A,{}),e.map(e=>{const s=A.has(e.id),r=(t[e.id]||[]).length;return(0,a.jsxs)(i.A,{className:h.filterSection,mt:2,children:[(0,a.jsxs)(i.A,{className:h.sectionTitle,onClick:()=>{return t=e.id,void x(e=>{const n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n});var t},children:[(0,a.jsxs)(i.A,{display:"flex",alignItems:"center",children:[(0,a.jsx)("span",{children:e.title}),r>0&&(0,a.jsxs)("span",{className:h.count,children:["(",r,")"]})]}),s?(0,a.jsx)(v.A,{fontSize:"small"}):(0,a.jsx)(g.A,{fontSize:"small"})]}),(0,a.jsx)(d.A,{in:!s,children:(0,a.jsx)(u.A,{children:e.options.map(s=>(0,a.jsx)(p.A,{control:(0,a.jsx)(m.A,{checked:(t[e.id]||[]).includes(s.value),onChange:()=>((e,a)=>{const s=t[e]||[],r=s.includes(a)?s.filter(e=>e!==a):[...s,a];n({...t,[e]:r})})(e.id,s.value),size:"small",className:h.checkbox,color:"primary"}),label:(0,a.jsxs)(i.A,{display:"flex",alignItems:"center",children:[(0,a.jsx)("span",{className:h.checkboxLabel,children:s.label}),void 0!==s.count&&(0,a.jsxs)("span",{className:h.count,children:["(",s.count,")"]})]})},s.value))})})]},e.id)})]})}},14682:(e,t,n)=>{n.r(t),n.d(t,{ApiKeysPage:()=>se});var a=n(31085),s=n(95478),r=n.n(s),i=n(10394),o=n(31653),l=n(38605),c=n(289),d=n(15831),u=n(45210),p=n(46681),m=n(38599),h=n(49634),v=n(37725),g=n(86687),f=n(42367),A=n(25010),x=n(22097),j=n(91638),y=n(58837),b=n(72501),k=n(67720),w=n(71677),P=n(29365),S=n(78467),C=n(37757),q=n(26343),R=n(76891),I=n(61477),$=n(46805),z=n(93453),T=n(64947),B=n(32269),N=n(61524),M=n(99594),E=n(77225),_=n(39590),L=n(16397),F=n(63221),O=n(12229),D=n(46299);const W=(0,y.A)(e=>({container:{display:"flex",height:"100%",minHeight:400},tableContainer:{flex:1,overflow:"auto",padding:10},useCasePanel:{padding:e.spacing(2),backgroundColor:e.palette.background.default},useCaseLabel:{fontWeight:600,marginBottom:e.spacing(1),color:e.palette.text.secondary,textTransform:"uppercase",fontSize:"0.75rem"},rejectedBanner:{backgroundColor:e.palette.error.light,border:`1px solid ${e.palette.error.main}`,borderRadius:e.shape.borderRadius,padding:e.spacing(1.5,2),marginBottom:e.spacing(2),display:"flex",alignItems:"center",gap:e.spacing(1)}})),K=({request:e})=>{var t,n;const s=W(),r="Rejected"===(null===(t=e.status)||void 0===t?void 0:t.phase),o=(null===(n=e.spec.apiProductRef)||void 0===n?void 0:n.name)||"unknown";return(0,a.jsxs)(i.A,{className:s.useCasePanel,onClick:e=>e.stopPropagation(),children:[r&&(0,a.jsxs)(i.A,{className:s.rejectedBanner,children:[(0,a.jsx)(E.A,{color:"error",fontSize:"small"}),(0,a.jsxs)(b.A,{variant:"body2",children:["This API key was rejected."," ",(0,a.jsx)(v.N_,{to:`/catalog/default/api/${o}/api-keys`,children:"Request a new API key"})]})]}),(0,a.jsx)(b.A,{className:s.useCaseLabel,children:"Use Case"}),(0,a.jsx)(b.A,{variant:"body2",children:e.spec.useCase||"No use case provided"})]})},U=()=>{var e,t;const n=W(),r=(0,h.useNavigate)(),o=(0,x.useApi)(x.configApiRef),l=(0,x.useApi)(x.fetchApiRef),c=(0,x.useApi)(x.alertApiRef),d=o.getString("backend.baseUrl"),[u,p]=(0,s.useState)(new Set),[m,y]=(0,s.useState)(null),[U,H]=(0,s.useState)(null),[V,Y]=(0,s.useState)({open:!1,request:null,plans:[]}),[Z,J]=(0,s.useState)(0),[X,G]=(0,s.useState)(null),[Q,ee]=(0,s.useState)({open:!1,request:null}),[te,ne]=(0,s.useState)(new Map),[ae,se]=(0,s.useState)(new Set),[re,ie]=(0,s.useState)(new Set),[oe,le]=(0,s.useState)(!1),[ce,de]=(0,s.useState)(null),[ue,pe]=(0,s.useState)(new Set),[me,he]=(0,s.useState)({status:[],apiProduct:[],tier:[]}),{value:ve,loading:ge,error:fe}=(0,j.A)(async()=>{const[e,t]=await Promise.all([l.fetch(`${d}/api/kuadrant/requests/my`),l.fetch(`${d}/api/kuadrant/apiproducts`)]);if(!e.ok)throw new Error("failed to fetch requests");const n=(await e.json()).items||[];let a=[];t.ok&&(a=(await t.json()).items||[]);const s=new Map;return a.forEach(e=>{var t;const n=`${e.metadata.namespace}/${e.metadata.name}`,a=(null===(t=e.metadata.annotations)||void 0===t?void 0:t["backstage.io/owner"])||"unknown";s.set(n,a)}),{requests:n,products:a,ownerMap:s}},[d,l,Z]),Ae=(0,s.useMemo)(()=>(null==ve?void 0:ve.requests)?ve.requests.filter(e=>!ue.has(e.metadata.name)):[],[null==ve?void 0:ve.requests,ue]),xe=(0,s.useMemo)(()=>{const e={Approved:0,Pending:0,Rejected:0},t=new Map,n=new Map;return Ae.forEach(a=>{var s,r;const i=(null===(s=a.status)||void 0===s?void 0:s.phase)||"Pending";e[i]++;const o=(null===(r=a.spec.apiProductRef)||void 0===r?void 0:r.name)||"unknown";t.set(o,(t.get(o)||0)+1);const l=a.spec.planTier||"unknown";n.set(l,(n.get(l)||0)+1)}),[{id:"status",title:"Status",options:[{value:"Approved",label:"Active",count:e.Approved},{value:"Pending",label:"Pending",count:e.Pending},{value:"Rejected",label:"Rejected",count:e.Rejected}]},{id:"apiProduct",title:"API Product",options:Array.from(t.entries()).map(([e,t])=>({value:e,label:e,count:t})),collapsed:t.size>5},{id:"tier",title:"Tier",options:Array.from(n.entries()).map(([e,t])=>({value:e,label:e.charAt(0).toUpperCase()+e.slice(1),count:t}))}]},[Ae]),je=(0,s.useMemo)(()=>Ae.filter(e=>{if(me.status.length>0){var t;const n=(null===(t=e.status)||void 0===t?void 0:t.phase)||"Pending";if(!me.status.includes(n))return!1}if(me.apiProduct.length>0){var n;const t=(null===(n=e.spec.apiProductRef)||void 0===n?void 0:n.name)||"unknown";if(!me.apiProduct.includes(t))return!1}if(me.tier.length>0){const t=e.spec.planTier||"unknown";if(!me.tier.includes(t))return!1}return!0}),[Ae,me]),ye=e=>{p(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},be=()=>{y(null),H(null)},ke=async()=>{if(!U)return;const e=U;be();try{var t;const a=null===(t=e.spec.apiProductRef)||void 0===t?void 0:t.name,s=e.metadata.namespace,r=await l.fetch(`${d}/api/kuadrant/apiproducts/${s}/${a}`);if(r.ok){var n;const t=(null===(n=(await r.json()).spec)||void 0===n?void 0:n.plans)||[];Y({open:!0,request:e,plans:t})}else Y({open:!0,request:e,plans:[]})}catch(t){console.error("Error fetching plans:",t),Y({open:!0,request:e,plans:[]})}},we=()=>{if(!U)return;const e=U;be(),ee({open:!0,request:e})},Pe=[{title:"API Product",field:"spec.apiProductRef.name",render:e=>{var t;const n=(null===(t=e.spec.apiProductRef)||void 0===t?void 0:t.name)||"unknown";return(0,a.jsx)(v.N_,{to:`/catalog/default/api/${n}/api-keys`,children:(0,a.jsx)("strong",{children:n})})}},{title:"Owner",field:"owner",render:e=>{var t,n;const s=`${e.metadata.namespace}/${null===(t=e.spec.apiProductRef)||void 0===t?void 0:t.name}`,r=((null==ve||null===(n=ve.ownerMap)||void 0===n?void 0:n.get(s))||"unknown").replace(/^user:default\//,"");return(0,a.jsx)(b.A,{variant:"body2",children:r})}},{title:"Status",field:"status.phase",render:e=>{var t;const n=(null===(t=e.status)||void 0===t?void 0:t.phase)||"Pending",s="Approved"===n?"Active":n;return(0,a.jsx)(k.A,{label:s,size:"small",style:(0,D.S)(n)})}},{title:"Tier",field:"spec.planTier",render:e=>(0,a.jsx)(k.A,{label:e.spec.planTier,size:"small",variant:"outlined"})},{title:"API Key",field:"status.secretRef",filtering:!1,render:e=>{var t,n,s,r;if("Approved"!==(null===(t=e.status)||void 0===t?void 0:t.phase))return(0,a.jsx)(b.A,{variant:"body2",color:"textSecondary",children:"-"});const o=`${e.metadata.namespace}/${e.metadata.name}`,l=null===(s=e.status)||void 0===s||null===(n=s.secretRef)||void 0===n?void 0:n.name,d=u.has(e.metadata.name),p=ae.has(o),m=te.get(o),h=!1!==(null===(r=e.status)||void 0===r?void 0:r.canReadSecret),v=re.has(o)||!h;return l?v&&!m?(0,a.jsx)(w.Ay,{title:"This API key has already been viewed and cannot be retrieved again",children:(0,a.jsxs)(i.A,{display:"flex",alignItems:"center",children:[(0,a.jsx)(b.A,{variant:"body2",color:"textSecondary",style:{fontFamily:"monospace",marginRight:8},children:"Already viewed"}),(0,a.jsx)(N.A,{fontSize:"small",color:"disabled"})]})}):(0,a.jsxs)(i.A,{display:"flex",alignItems:"center",style:{gap:8},children:[(0,a.jsx)(i.A,{fontFamily:"monospace",fontSize:"0.875rem",children:p?"Loading...":d&&m?m:"•".repeat(20)+"..."}),d&&m&&(0,a.jsx)(w.Ay,{title:"Copy to clipboard",children:(0,a.jsx)(P.A,{size:"small",onClick:async()=>{m&&(await navigator.clipboard.writeText(m),c.post({message:"API key copied to clipboard",severity:"success",display:"transient"}))},children:(0,a.jsx)(M.A,{fontSize:"small"})})}),(0,a.jsx)(w.Ay,{title:d?"Hide API key":"Reveal API key (one-time only)",children:(0,a.jsx)("span",{children:(0,a.jsx)(P.A,{size:"small",onClick:()=>{d?(((e,t)=>{const n=`${e}/${t}`;ne(e=>{const t=new Map(e);return t.delete(n),t})})(e.metadata.namespace,e.metadata.name),ye(e.metadata.name)):v||(de({namespace:e.metadata.namespace,name:e.metadata.name}),le(!0))},disabled:p||v&&!m,children:d?(0,a.jsx)(N.A,{fontSize:"small"}):(0,a.jsx)(B.A,{fontSize:"small"})})})})]}):(0,a.jsx)(b.A,{variant:"body2",color:"textSecondary",children:"Awaiting secret..."})}},{title:"Requested",field:"metadata.creationTimestamp",render:e=>{if(!e.metadata.creationTimestamp)return(0,a.jsx)(b.A,{variant:"body2",children:"-"});const t=new Date(e.metadata.creationTimestamp);return(0,a.jsx)(b.A,{variant:"body2",children:t.toLocaleDateString()})}},{title:"Actions",filtering:!1,width:"100px",render:e=>X===e.metadata.name?(0,a.jsx)(S.A,{size:20}):(0,a.jsxs)(i.A,{display:"flex",style:{gap:4},children:[(0,a.jsx)(w.Ay,{title:"View details",children:(0,a.jsx)(P.A,{size:"small",onClick:t=>{t.stopPropagation(),r(`/kuadrant/api-keys/${e.metadata.namespace}/${e.metadata.name}`)},children:(0,a.jsx)(B.A,{fontSize:"small"})})}),(0,a.jsx)(w.Ay,{title:"Delete",children:(0,a.jsx)(P.A,{size:"small",onClick:t=>{t.stopPropagation(),ee({open:!0,request:e})},children:(0,a.jsx)(_.A,{fontSize:"small"})})})]})}],Se=(0,s.useMemo)(()=>[{render:e=>{var t;const n=e.rowData;return(null==n||null===(t=n.metadata)||void 0===t?void 0:t.name)?(0,a.jsx)(K,{request:n}):(0,a.jsx)(i.A,{})}}],[]);return ge?(0,a.jsx)(g.k,{}):fe?(0,a.jsx)(f._,{error:fe}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(i.A,{className:n.container,children:[(0,a.jsx)(O.Z,{sections:xe,filters:me,onChange:he}),(0,a.jsx)(i.A,{className:n.tableContainer,children:0===je.length?(0,a.jsx)(i.A,{p:4,textAlign:"center",children:(0,a.jsx)(b.A,{variant:"body1",color:"textSecondary",children:0===Ae.length?"No API keys found. Request access to an API to get started.":"No API keys match the selected filters."})}):(0,a.jsx)(A.X,{options:{paging:je.length>10,pageSize:20,search:!0,filtering:!1,debounceInterval:300,toolbar:!0,emptyRowsWhenPaging:!1},columns:Pe,data:je.map(e=>({...e,id:e.metadata.name})),detailPanel:Se})})]}),(0,a.jsx)(C.A,{id:"myapikeys-menu",open:Boolean(m),onClose:be,anchorReference:"anchorPosition",anchorPosition:m||{top:0,left:0},children:U&&(()=>{const e=[];var t;return e.push((0,a.jsx)(q.A,{onClick:()=>{r(`/kuadrant/api-keys/${U.metadata.namespace}/${U.metadata.name}`),be()},children:"View Details"},"view")),(t=U).status&&"Pending"!==t.status.phase||e.push((0,a.jsx)(q.A,{onClick:ke,children:"Edit"},"edit")),e.push((0,a.jsx)(q.A,{onClick:we,children:"Delete"},"delete")),e})()}),V.request&&(0,a.jsx)(L.e,{open:V.open,request:V.request,availablePlans:V.plans,onClose:()=>Y({open:!1,request:null,plans:[]}),onSuccess:()=>{Y({open:!1,request:null,plans:[]}),J(e=>e+1)}}),(0,a.jsx)(F.K,{open:Q.open,title:"Delete API Key",description:`Are you sure you want to delete this API key for ${(null===(t=Q.request)||void 0===t||null===(e=t.spec.apiProductRef)||void 0===e?void 0:e.name)||"this API"}?`,deleting:null!==X,onConfirm:async()=>{if(!Q.request)return;const e=Q.request,t=e.metadata.name;pe(e=>new Set(e).add(t)),G(t);try{if(!(await l.fetch(`${d}/api/kuadrant/requests/${e.metadata.namespace}/${e.metadata.name}`,{method:"DELETE"})).ok)throw new Error("Failed to delete request");J(e=>e+1),c.post({message:"API key deleted",severity:"success",display:"transient"}),ee({open:!1,request:null})}catch(e){console.error("Error deleting request:",e),pe(e=>{const n=new Set(e);return n.delete(t),n}),c.post({message:"Failed to delete API key",severity:"error",display:"transient"})}finally{G(null)}},onCancel:()=>{ee({open:!1,request:null})}}),(0,a.jsxs)(R.A,{open:oe,onClose:()=>{le(!1),de(null)},maxWidth:"sm",children:[(0,a.jsx)(I.A,{children:(0,a.jsxs)(i.A,{display:"flex",alignItems:"center",children:[(0,a.jsx)(E.A,{color:"primary",style:{marginRight:8}}),"View API Key"]})}),(0,a.jsxs)($.A,{children:[(0,a.jsxs)(b.A,{variant:"body1",paragraph:!0,children:["This API key can only be viewed ",(0,a.jsx)("strong",{children:"once"}),". After you reveal it, you will not be able to retrieve it again."]}),(0,a.jsx)(b.A,{variant:"body2",color:"textSecondary",children:"Make sure to copy and store it securely before closing this view."})]}),(0,a.jsxs)(z.A,{children:[(0,a.jsx)(T.A,{onClick:()=>{le(!1),de(null)},children:"Cancel"}),(0,a.jsx)(T.A,{variant:"contained",color:"primary",onClick:()=>{ce&&((async(e,t)=>{const n=`${e}/${t}`;if(!ae.has(n)){se(e=>new Set(e).add(n));try{const a=await l.fetch(`${d}/api/kuadrant/apikeys/${e}/${t}/secret`);if(a.ok){const e=await a.json();ne(t=>new Map(t).set(n,e.apiKey)),ie(e=>new Set(e).add(n))}else 403===a.status&&(ie(e=>new Set(e).add(n)),c.post({message:"This API key has already been viewed and cannot be retrieved again.",severity:"warning",display:"transient"}))}catch(e){const t=e instanceof Error?e.message:"unknown error occurred";c.post({message:`Failed to fetch api key: ${t}`,severity:"error",display:"transient"})}finally{se(e=>{const t=new Set(e);return t.delete(n),t})}}})(ce.namespace,ce.name),ye(ce.name)),le(!1),de(null)},children:"Reveal API Key"})]})]})]})};var H=n(35015),V=n(34955),Y=n(46205),Z=n(16249),J=n(55429),X=n(92399);const G=(0,y.A)(e=>({container:{display:"flex",height:"100%",minHeight:400},tableContainer:{flex:1,overflow:"auto",padding:10},useCasePanel:{padding:e.spacing(2),backgroundColor:e.palette.background.default},useCaseLabel:{fontWeight:600,marginBottom:e.spacing(1),color:e.palette.text.secondary,textTransform:"uppercase",fontSize:"0.75rem"},bulkActions:{padding:e.spacing(2),backgroundColor:e.palette.background.default,borderBottom:`1px solid ${e.palette.divider}`,display:"flex",alignItems:"center",justifyContent:"space-between"}})),Q=({open:e,request:t,action:n,processing:s,onClose:o,onConfirm:l})=>{var c,d;const[u,p]=r().useState(""),m="approve"===n?"Approve":"Reject",h="approve"===n?"Approving...":"Rejecting...",v="reject"===n,g=(null==t||null===(c=t.spec.requestedBy)||void 0===c?void 0:c.userId)||"",f=!v||u===g;return r().useEffect(()=>{e||p("")},[e]),(0,a.jsxs)(R.A,{open:e,onClose:s?void 0:o,maxWidth:"sm",fullWidth:!0,children:[(0,a.jsx)(I.A,{children:v?(0,a.jsxs)(i.A,{display:"flex",alignItems:"center",style:{gap:8},children:[(0,a.jsx)(X.A,{color:"error"}),(0,a.jsxs)("span",{children:[m," API Key"]})]}):(0,a.jsxs)("span",{children:[m," API Key"]})}),(0,a.jsx)($.A,{children:t&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("p",{children:[(0,a.jsx)("strong",{children:"User:"})," ",t.spec.requestedBy.userId]}),(0,a.jsxs)("p",{children:[(0,a.jsx)("strong",{children:"API:"})," ",(null===(d=t.spec.apiProductRef)||void 0===d?void 0:d.name)||"unknown"]}),(0,a.jsxs)("p",{children:[(0,a.jsx)("strong",{children:"Tier:"})," ",t.spec.planTier]}),(0,a.jsxs)(i.A,{mb:2,children:[(0,a.jsx)(b.A,{variant:"body2",component:"span",style:{fontWeight:"bold"},children:"Use Case:"})," ",(0,a.jsx)(b.A,{variant:"body2",component:"span",style:{whiteSpace:"pre-wrap"},children:t.spec.useCase||"-"})]}),v&&(0,a.jsxs)(i.A,{mt:2,children:[(0,a.jsxs)(b.A,{variant:"body2",color:"textSecondary",gutterBottom:!0,children:["Type ",(0,a.jsx)("strong",{children:g})," to confirm rejection:"]}),(0,a.jsx)(Z.A,{fullWidth:!0,variant:"outlined",size:"small",value:u,onChange:e=>p(e.target.value),disabled:s,autoFocus:!0,placeholder:g})]})]})}),(0,a.jsxs)(z.A,{children:[(0,a.jsx)(T.A,{onClick:o,disabled:s,children:"Cancel"}),(0,a.jsx)(T.A,{onClick:l,color:"approve"===n?"primary":"secondary",variant:"contained",disabled:s||!f,startIcon:s?(0,a.jsx)(S.A,{size:16,color:"inherit"}):void 0,children:s?h:m})]})]})},ee=({open:e,requests:t,action:n,processing:s,onClose:r,onConfirm:o})=>{const l="approve"===n,c=l?"Approve All":"Reject All",d=l?"Approving...":"Rejecting...";return(0,a.jsxs)(R.A,{open:e,onClose:s?void 0:r,maxWidth:"md",fullWidth:!0,children:[(0,a.jsxs)(I.A,{children:[l?"Approve":"Reject"," ",t.length," API Keys"]}),(0,a.jsxs)($.A,{children:[(0,a.jsxs)(b.A,{variant:"body2",paragraph:!0,children:["You are about to ",l?"approve":"reject"," the following API keys:"]}),(0,a.jsx)(i.A,{mb:2,maxHeight:200,overflow:"auto",children:t.map(e=>{var t;return(0,a.jsx)(i.A,{mb:1,p:1,bgcolor:"background.default",children:(0,a.jsxs)(b.A,{variant:"body2",children:[(0,a.jsx)("strong",{children:e.spec.requestedBy.userId})," -"," ",(null===(t=e.spec.apiProductRef)||void 0===t?void 0:t.name)||"unknown"," (",e.spec.planTier,")"]})},`${e.metadata.namespace}/${e.metadata.name}`)})})]}),(0,a.jsxs)(z.A,{children:[(0,a.jsx)(T.A,{onClick:r,disabled:s,children:"Cancel"}),(0,a.jsx)(T.A,{onClick:o,color:l?"primary":"secondary",variant:"contained",disabled:s,startIcon:s?(0,a.jsx)(S.A,{size:16,color:"inherit"}):void 0,children:s?d:c})]})]})},te=({request:e})=>{const t=G();return(0,a.jsxs)(i.A,{className:t.useCasePanel,onClick:e=>e.stopPropagation(),children:[(0,a.jsx)(b.A,{className:t.useCaseLabel,children:"Use Case"}),(0,a.jsx)(b.A,{variant:"body2",children:e.spec.useCase||"No use case provided"})]})},ne=()=>{var e;const t=G(),n=(0,x.useApi)(x.configApiRef),r=(0,x.useApi)(x.fetchApiRef),o=(0,x.useApi)(x.identityApiRef),l=(0,x.useApi)(x.alertApiRef),c=n.getString("backend.baseUrl"),[d,u]=(0,s.useState)(0),[p,m]=(0,s.useState)([]),[h,j]=(0,s.useState)({open:!1,request:null,action:"approve",processing:!1}),[y,w]=(0,s.useState)({open:!1,requests:[],action:"approve",processing:!1}),[P,S]=(0,s.useState)({status:[],apiProduct:[],tier:[]}),{allowed:C,loading:q,error:R}=(0,Y.l)(V.z4),{allowed:I,loading:$,error:z}=(0,Y.l)(V.q0),B=q||$,N=R||z,{value:M,loading:E,error:_}=(0,H.A)(async()=>{const e=(await o.getBackstageIdentity()).userEntityRef,[t,n]=await Promise.all([r.fetch(`${c}/api/kuadrant/requests`),r.fetch(`${c}/api/kuadrant/apiproducts`)]);if(!t.ok)return{allRequests:[],reviewedBy:e,ownedApiProducts:new Set};const a=t.headers.get("content-type");if(!(null==a?void 0:a.includes("application/json")))return l.post({message:"Unexpected content-type from the server response.",display:"transient",severity:"warning"}),{allRequests:[],reviewedBy:e,ownedApiProducts:new Set};const s=(await t.json()).items||[],i=new Set;if(n.ok){const t=await n.json();for(const n of t.items||[]){var d,u;(null===(u=n.metadata)||void 0===u||null===(d=u.annotations)||void 0===d?void 0:d["backstage.io/owner"])===e&&i.add(`${n.metadata.namespace}/${n.metadata.name}`)}}return{allRequests:s,reviewedBy:e,ownedApiProducts:i}},[c,r,o,d]),L=(0,s.useMemo)(()=>{if(!(null==M?void 0:M.allRequests))return[];const e={Approved:0,Pending:0,Rejected:0},t=new Map,n=new Map;return M.allRequests.forEach(a=>{var s,r;const i=(null===(s=a.status)||void 0===s?void 0:s.phase)||"Pending";e[i]++;const o=(null===(r=a.spec.apiProductRef)||void 0===r?void 0:r.name)||"unknown";t.set(o,(t.get(o)||0)+1);const l=a.spec.planTier||"unknown";n.set(l,(n.get(l)||0)+1)}),[{id:"status",title:"Status",options:[{value:"Pending",label:"Pending",count:e.Pending},{value:"Approved",label:"Approved",count:e.Approved},{value:"Rejected",label:"Rejected",count:e.Rejected}]},{id:"apiProduct",title:"API Product",options:Array.from(t.entries()).map(([e,t])=>({value:e,label:e,count:t})),collapsed:t.size>5},{id:"tier",title:"Tier",options:Array.from(n.entries()).map(([e,t])=>({value:e,label:e.charAt(0).toUpperCase()+e.slice(1),count:t}))}]},[null==M?void 0:M.allRequests]),F=(0,s.useMemo)(()=>(null==M?void 0:M.allRequests)?M.allRequests.filter(e=>{if(P.status.length>0){var t;const n=(null===(t=e.status)||void 0===t?void 0:t.phase)||"Pending";if(!P.status.includes(n))return!1}if(P.apiProduct.length>0){var n;const t=(null===(n=e.spec.apiProductRef)||void 0===n?void 0:n.name)||"unknown";if(!P.apiProduct.includes(t))return!1}if(P.tier.length>0){const t=e.spec.planTier||"unknown";if(!P.tier.includes(t))return!1}return!0}):[],[null==M?void 0:M.allRequests,P]),W=e=>new Date(e).toLocaleDateString("en-GB",{year:"numeric",month:"short",day:"numeric"}),K=[{title:"Requester",field:"spec.requestedBy.userId",render:e=>(0,a.jsx)(b.A,{variant:"body2",children:e.spec.requestedBy.userId})},{title:"API Product",field:"spec.apiProductRef.name",render:e=>{var t;const n=(null===(t=e.spec.apiProductRef)||void 0===t?void 0:t.name)||"unknown";return(0,a.jsx)(v.N_,{to:`/catalog/default/api/${n}`,children:(0,a.jsx)("strong",{children:n})})}},{title:"Status",field:"status.phase",render:e=>{var t;const n=(null===(t=e.status)||void 0===t?void 0:t.phase)||"Pending";return(0,a.jsx)(k.A,{label:n,size:"small",style:(0,D.S)(n)})}},{title:"Tier",field:"spec.planTier",render:e=>(0,a.jsx)(k.A,{label:e.spec.planTier,size:"small",variant:"outlined"})},{title:"Requested",field:"metadata.creationTimestamp",render:e=>(0,a.jsx)(b.A,{variant:"body2",children:e.metadata.creationTimestamp?W(e.metadata.creationTimestamp):"-"})},{title:"Reviewed By",field:"status.reviewedBy",render:e=>{var t;if(!(null===(t=e.status)||void 0===t?void 0:t.reviewedBy))return(0,a.jsx)(b.A,{variant:"body2",color:"textSecondary",children:"-"});const n=e.status.reviewedBy.replace(/^user:default\//,""),s="system"===n;return(0,a.jsxs)(i.A,{children:[(0,a.jsx)(b.A,{variant:"body2",children:s?"Automatic":n}),e.status.reviewedAt&&(0,a.jsx)(b.A,{variant:"caption",color:"textSecondary",children:W(e.status.reviewedAt)})]})}},{title:"Actions",filtering:!1,render:e=>{var t,n,s;if("Pending"!==((null===(t=e.status)||void 0===t?void 0:t.phase)||"Pending"))return null;const r=`${e.metadata.namespace}/${(null===(n=e.spec.apiProductRef)||void 0===n?void 0:n.name)||"unknown"}`;var o;const l=null!==(o=null==M||null===(s=M.ownedApiProducts)||void 0===s?void 0:s.has(r))&&void 0!==o&&o;return C||I&&l?(0,a.jsxs)(i.A,{display:"flex",style:{gap:8},children:[(0,a.jsx)(T.A,{size:"small",startIcon:(0,a.jsx)(J.A,{}),onClick:()=>{j({open:!0,request:e,action:"approve",processing:!1})},color:"primary",variant:"outlined",children:"Approve"}),(0,a.jsx)(T.A,{size:"small",startIcon:(0,a.jsx)(X.A,{}),onClick:()=>{j({open:!0,request:e,action:"reject",processing:!1})},color:"secondary",variant:"outlined",children:"Reject"})]}):null}}],U=(0,s.useMemo)(()=>[{render:e=>{var t;const n=e.rowData;return(null==n||null===(t=n.metadata)||void 0===t?void 0:t.name)?(0,a.jsx)(te,{request:n}):(0,a.jsx)(i.A,{})}}],[]);if(E||B)return(0,a.jsx)(g.k,{});if(_)return(0,a.jsx)(f._,{error:_});if(N)return(0,a.jsx)(i.A,{p:2,children:(0,a.jsxs)(b.A,{color:"error",children:["Unable to check permissions: ",N.message]})});const Z=C||I;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(i.A,{className:t.container,children:[(0,a.jsx)(O.Z,{sections:L,filters:P,onChange:S}),(0,a.jsxs)(i.A,{className:t.tableContainer,children:[p.length>0&&(0,a.jsxs)(i.A,{className:t.bulkActions,children:[(0,a.jsxs)(b.A,{variant:"body2",children:[p.length," request",1!==p.length?"s":""," selected"]}),(0,a.jsxs)(i.A,{display:"flex",style:{gap:8},children:[(0,a.jsx)(T.A,{size:"small",variant:"contained",color:"primary",startIcon:(0,a.jsx)(J.A,{}),onClick:()=>{0!==p.length&&w({open:!0,requests:p,action:"approve",processing:!1})},children:"Approve Selected"}),(0,a.jsx)(T.A,{size:"small",variant:"contained",color:"secondary",startIcon:(0,a.jsx)(X.A,{}),onClick:()=>{0!==p.length&&w({open:!0,requests:p,action:"reject",processing:!1})},children:"Reject Selected"})]})]}),0===F.length?(0,a.jsx)(i.A,{p:4,textAlign:"center",children:(0,a.jsx)(b.A,{variant:"body1",color:"textSecondary",children:0===(null==M||null===(e=M.allRequests)||void 0===e?void 0:e.length)?"No API keys found.":"No API keys match the selected filters."})}):(0,a.jsx)(A.X,{options:{selection:Z,showSelectAllCheckbox:F.some(e=>{var t;return!(null===(t=e.status)||void 0===t?void 0:t.phase)||"Pending"===e.status.phase}),selectionProps:e=>{var t,n;return{disabled:"Pending"!==(null===(t=e.status)||void 0===t?void 0:t.phase)&&void 0!==(null===(n=e.status)||void 0===n?void 0:n.phase)}},paging:F.length>10,pageSize:20,search:!0,filtering:!1,debounceInterval:300,showTextRowsSelected:!1,toolbar:!0,emptyRowsWhenPaging:!1},columns:K,data:F.map(e=>{const t=p.some(t=>t.metadata.name===e.metadata.name&&t.metadata.namespace===e.metadata.namespace);return{...e,id:e.metadata.name,tableData:{checked:t}}}),onSelectionChange:e=>{const t=e.filter(e=>{var t;return!(null===(t=e.status)||void 0===t?void 0:t.phase)||"Pending"===e.status.phase});m(t)},detailPanel:U})]})]}),(0,a.jsx)(Q,{open:h.open,request:h.request,action:h.action,processing:h.processing,onClose:()=>j({open:!1,request:null,action:"approve",processing:!1}),onConfirm:async()=>{if(!h.request||!M)return;j(e=>({...e,processing:!0}));const e="approve"===h.action?`${c}/api/kuadrant/requests/${h.request.metadata.namespace}/${h.request.metadata.name}/approve`:`${c}/api/kuadrant/requests/${h.request.metadata.namespace}/${h.request.metadata.name}/reject`;try{if(!(await r.fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reviewedBy:M.reviewedBy})})).ok)throw new Error(`failed to ${h.action} request`);j({open:!1,request:null,action:"approve",processing:!1}),m(e=>e.filter(e=>{var t,n;return e.metadata.name!==(null===(t=h.request)||void 0===t?void 0:t.metadata.name)||e.metadata.namespace!==(null===(n=h.request)||void 0===n?void 0:n.metadata.namespace)})),u(e=>e+1);const t="approve"===h.action?"approved":"rejected";l.post({message:`API key ${t}`,severity:"success",display:"transient"})}catch(e){console.error(`error ${h.action}ing request:`,e),j(e=>({...e,processing:!1})),l.post({message:`Failed to ${h.action} API key`,severity:"error",display:"transient"})}}}),(0,a.jsx)(ee,{open:y.open,requests:y.requests,action:y.action,processing:y.processing,onClose:()=>w({open:!1,requests:[],action:"approve",processing:!1}),onConfirm:async()=>{if(!M||0===y.requests.length)return;w(e=>({...e,processing:!0}));const e="approve"===y.action,t=e?`${c}/api/kuadrant/requests/bulk-approve`:`${c}/api/kuadrant/requests/bulk-reject`;try{if(!(await r.fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({requests:y.requests.map(e=>({namespace:e.metadata.namespace,name:e.metadata.name})),reviewedBy:M.reviewedBy})})).ok)throw new Error(`failed to bulk ${y.action} requests`);const n=y.requests.length,a=e?"approved":"rejected";w({open:!1,requests:[],action:"approve",processing:!1}),m([]),u(e=>e+1),l.post({message:`${n} API keys ${a}`,severity:"success",display:"transient"})}catch(e){console.error(`error bulk ${y.action}ing requests:`,e),w(e=>({...e,processing:!1})),l.post({message:`Failed to bulk ${y.action} API keys`,severity:"error",display:"transient"})}}})]})},ae=()=>{const[e,t]=(0,s.useState)(0),{allowed:n,loading:r}=(0,Y.l)(V.KV);return(0,a.jsxs)(c.Y,{themeId:"tool",children:[(0,a.jsx)(d.Y,{title:"API Keys",subtitle:"API keys management for Kubernetes",children:(0,a.jsx)(u.Y,{children:"Manage your API keys and access requests"})}),(0,a.jsxs)(p.U,{children:[(0,a.jsx)(i.A,{mb:2,children:(0,a.jsxs)(o.A,{value:e,onChange:(e,n)=>{t(n)},indicatorColor:"primary",textColor:"primary",children:[(0,a.jsx)(l.A,{label:"My API keys","data-testid":"my-api-keys-tab"}),!r&&n&&(0,a.jsx)(l.A,{label:"API keys approval","data-testid":"api-keys-approval-tab"})]})}),0===e&&(0,a.jsx)(U,{}),1===e&&n&&(0,a.jsx)(ne,{})]})]})},se=()=>(0,a.jsx)(m.B,{permission:V.DS,errorMessage:"you don't have permission to view the API Keys page",children:(0,a.jsx)(ae,{})})},23164:(e,t,n)=>{var a=n(4293),s=n(78920);t.A=void 0;var r=s(n(95478)),i=(0,a(n(74044)).default)(r.createElement("path",{d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"}),"ExpandLess");t.A=i},27799:(e,t,n)=>{var a=n(4293),s=n(78920);t.A=void 0;var r=s(n(95478)),i=(0,a(n(74044)).default)(r.createElement("path",{d:"M21 5v6.59l-3-3.01-4 4.01-4-4-4 4-3-3.01V5c0-1.1.9-2 2-2h14c1.1 0 2 .9 2 2zm-3 6.42l3 3.01V19c0 1.1-.9 2-2 2H5c-1.1 0-2-.9-2-2v-6.58l3 2.99 4-4 4 4 4-3.99z"}),"BrokenImage");t.A=i},38599:(e,t,n)=>{n.d(t,{B:()=>l});var a=n(31085),s=(n(95478),n(10394)),r=n(72501),i=n(86687),o=n(46205);const l=({children:e,permission:t,fallback:n,errorMessage:l})=>{const{allowed:c,loading:d,error:u}=(0,o.l)(t);return d?(0,a.jsx)(i.k,{}):u?(0,a.jsxs)(s.A,{p:4,children:[(0,a.jsxs)(r.A,{color:"error",children:["Unable to check permissions: ",u.message]}),(0,a.jsx)(r.A,{variant:"body2",color:"textSecondary",children:"Please try again or contact your administrator"})]}):c?(0,a.jsx)(a.Fragment,{children:e}):n?(0,a.jsx)(a.Fragment,{children:n}):(0,a.jsxs)(s.A,{p:4,children:[(0,a.jsx)(r.A,{color:"textSecondary",children:l||"You don't have permission to view this page"}),(0,a.jsx)(s.A,{mt:1,children:(0,a.jsxs)(r.A,{variant:"caption",color:"textSecondary",children:["Required permission: ",t.name]})})]})}},39590:(e,t,n)=>{var a=n(4293),s=n(78920);t.A=void 0;var r=s(n(95478)),i=(0,a(n(74044)).default)(r.createElement("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"}),"Delete");t.A=i},45210:(e,t,n)=>{n.d(t,{Y:()=>R});var a=n(31085),s=n(22097),r=n(10394),i=n(64947),o=n(93453),l=n(29365),c=n(46423),d=n(5951),u=n(26343),p=n(28233),m=n(55197),h=n(37976),v=n(72501),g=n(5893),f=n(95478),A=(n(45250),n(49634),n(21006)),x=n(75501);const j=()=>{const{t:e}=(0,x.useTranslationRef)(A.O);return{url:"https://github.com/backstage/backstage/issues",items:[{title:e("supportConfig.default.title"),icon:"warning",links:[{title:e("supportConfig.default.linkTitle"),url:"https://github.com/backstage/backstage/blob/master/app-config.yaml"}]}]}};var y=n(27799);function b(e){const{id:t,Fallback:n=y.A,...r}=e,i=(0,s.useApp)().getSystemIcon(t)??n;return(0,a.jsx)(i,{...r})}function k(e){return(0,a.jsx)(b,{id:"help",...e})}var w=n(37725);const P=(0,h.makeStyles)({popoverList:{minWidth:260,maxWidth:400},menuItem:{whiteSpace:"normal"}},{name:"BackstageSupportButton"}),S=({icon:e})=>{const t=(0,s.useApp)(),n=e?t.getSystemIcon(e)??k:k;return(0,a.jsx)(n,{})},C=({link:e})=>(0,a.jsx)(w.N_,{to:e.url,children:e.title??e.url}),q=({item:e})=>(0,a.jsxs)(u.A,{button:!1,children:[(0,a.jsx)(c.A,{children:(0,a.jsx)(S,{icon:e.icon})}),(0,a.jsx)(d.A,{primary:e.title,secondary:e.links?.reduce((e,t,n)=>[...e,n>0&&(0,a.jsx)("br",{},n),(0,a.jsx)(C,{link:t},t.url)],[])})]});function R(e){const{t}=(0,x.useTranslationRef)(A.O),{title:n,items:c,children:d}=e,{items:h}=function(){const e=(0,s.useApiHolder)().get(s.configApiRef),t=e?.getOptionalConfig("app.support"),n=j();return t?{url:t.getString("url"),items:t.getConfigArray("items").flatMap(e=>({title:e.getString("title"),icon:e.getOptionalString("icon"),links:(e.getOptionalConfigArray("links")??[]).flatMap(e=>({url:e.getString("url"),title:e.getOptionalString("title")??""}))}))}:n}(),[y,b]=(0,f.useState)(!1),[w,S]=(0,f.useState)(null),C=P(),R=(0,s.useApi)(s.configApiRef).getOptionalConfig("app.support"),I=(0,g.A)(e=>e.breakpoints.down("sm")),$=e=>{S(e.currentTarget),b(!0)},z=()=>{b(!1)};return R?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(r.A,{display:"flex",ml:1,children:I?(0,a.jsx)(l.A,{color:"primary",size:"small",onClick:$,"data-testid":"support-button","aria-label":"Support",children:(0,a.jsx)(k,{})}):(0,a.jsx)(i.A,{"data-testid":"support-button","aria-label":"Support",color:"primary",onClick:$,startIcon:(0,a.jsx)(k,{}),children:t("supportButton.title")})}),(0,a.jsxs)(m.Ay,{"data-testid":"support-button-popover",open:y,anchorEl:w,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},onClose:z,children:[(0,a.jsxs)(p.A,{className:C.popoverList,autoFocusItem:Boolean(w),children:[n&&(0,a.jsx)(u.A,{button:!1,alignItems:"flex-start",className:C.menuItem,children:(0,a.jsx)(v.A,{variant:"subtitle1",children:n})}),f.Children.map(d,(e,t)=>(0,a.jsx)(u.A,{button:!1,alignItems:"flex-start",className:C.menuItem,children:e},`child-${t}`)),(c??h).map((e,t)=>(0,a.jsx)(q,{item:e},`item-${t}`))]}),(0,a.jsx)(o.A,{children:(0,a.jsx)(i.A,{color:"primary",onClick:z,"aria-label":"Close",children:t("supportButton.close")})})]})]}):null}},46299:(e,t,n)=>{n.d(t,{S:()=>a});const a=e=>{const t={border:"none"};switch(e){case"Approved":return{...t,backgroundColor:"#4caf50",color:"#fff"};case"Rejected":return{...t,backgroundColor:"#f44336",color:"#fff"};default:return{...t,backgroundColor:"#ff9800",color:"#fff"}}}},55429:(e,t,n)=>{var a=n(4293),s=n(78920);t.A=void 0;var r=s(n(95478)),i=(0,a(n(74044)).default)(r.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckCircle");t.A=i},91638:(e,t,n)=>{var a=n(85608),s=n(95478),r=a.__importDefault(n(5030));t.A=function(e,t){void 0===t&&(t=[]);var n=r.default(e,t,{loading:!0}),a=n[0],i=n[1];return s.useEffect(function(){i()},[i]),a}}}]);
|
|
2
|
+
//# sourceMappingURL=4682.bd2dfccd.chunk.js.map
|