@veecode-platform/plugin-veecode-homepage-dynamic 0.1.4 → 0.1.5

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.
Files changed (19) hide show
  1. package/dist-scalprum/plugin-manifest.json +3 -3
  2. package/dist-scalprum/static/{5689.44adcfd6.chunk.js → 5689.ba470bd3.chunk.js} +1 -1
  3. package/dist-scalprum/static/{5689.44adcfd6.chunk.js.map → 5689.ba470bd3.chunk.js.map} +1 -1
  4. package/dist-scalprum/static/7499.53d03b96.chunk.js +2 -0
  5. package/dist-scalprum/static/7499.53d03b96.chunk.js.map +1 -0
  6. package/dist-scalprum/static/{8505.9dd864c9.chunk.js → 8505.bd5ab33a.chunk.js} +1 -1
  7. package/dist-scalprum/static/{8505.9dd864c9.chunk.js.map → 8505.bd5ab33a.chunk.js.map} +1 -1
  8. package/dist-scalprum/static/{9286.e13da971.chunk.js → 9286.0bf88601.chunk.js} +2 -2
  9. package/dist-scalprum/static/{9286.e13da971.chunk.js.map → 9286.0bf88601.chunk.js.map} +1 -1
  10. package/dist-scalprum/static/avatar.e87ac168..svg +1 -0
  11. package/dist-scalprum/static/exposed-PluginRoot.7c0308e7.chunk.js +2 -0
  12. package/dist-scalprum/static/{exposed-PluginRoot.995e7d70.chunk.js.map → exposed-PluginRoot.7c0308e7.chunk.js.map} +1 -1
  13. package/dist-scalprum/{veecode-platform.plugin-veecode-homepage.75421414c269ea7d1780.js → veecode-platform.plugin-veecode-homepage.f5e3396deb211e8548f4.js} +2 -2
  14. package/dist-scalprum/{veecode-platform.plugin-veecode-homepage.75421414c269ea7d1780.js.map → veecode-platform.plugin-veecode-homepage.f5e3396deb211e8548f4.js.map} +1 -1
  15. package/package.json +1 -1
  16. package/dist-scalprum/static/4576.e773bb92.chunk.js +0 -2
  17. package/dist-scalprum/static/4576.e773bb92.chunk.js.map +0 -1
  18. package/dist-scalprum/static/exposed-PluginRoot.995e7d70.chunk.js +0 -2
  19. /package/dist-scalprum/static/{9286.e13da971.chunk.js.LICENSE.txt → 9286.0bf88601.chunk.js.LICENSE.txt} +0 -0
@@ -1,3 +1,3 @@
1
- /*! For license information please see 9286.e13da971.chunk.js.LICENSE.txt */
1
+ /*! For license information please see 9286.0bf88601.chunk.js.LICENSE.txt */
2
2
  "use strict";(self.webpackChunkveecode_platform_plugin_veecode_homepage=self.webpackChunkveecode_platform_plugin_veecode_homepage||[]).push([[1085,9286],{31085:(e,t,s)=>{e.exports=s(73335)},69286:(e,t,s)=>{s.r(t),s.d(t,{AlertApiForwarder:()=>ae,ApiFactoryRegistry:()=>d,ApiProvider:()=>l,ApiResolver:()=>p,AppRouter:()=>Ue,AppThemeSelector:()=>pe,AtlassianAuth:()=>ne,BitbucketAuth:()=>ee,BitbucketServerAuth:()=>se,ConfigReader:()=>he.o,ErrorAlerter:()=>me,ErrorApiForwarder:()=>we,FeatureFlagged:()=>He,FetchMiddlewares:()=>Ee,FlatRoutes:()=>kt,FrontendHostDiscovery:()=>fe,GithubAuth:()=>T,GitlabAuth:()=>F,GoogleAuth:()=>L,LocalStorageFeatureFlags:()=>Se,MicrosoftAuth:()=>K,MultipleAnalyticsApi:()=>ce,NoOpAnalyticsApi:()=>ue,OAuth2:()=>j,OAuthRequestManager:()=>xe,OktaAuth:()=>_,OneLoginAuth:()=>Y,SamlAuth:()=>V,UnhandledErrorForwarder:()=>ve,UrlPatternDiscovery:()=>ge,VMwareCloudAuth:()=>ie,WebStorage:()=>Pe,createFetchApi:()=>Ae,createSpecializedApp:()=>Ct,defaultConfigLoader:()=>mt,openLoginPopup:()=>g});var r=s(31085),n=s(95478),o=s(39067),i=s.n(o);class a{holders;constructor(...e){this.holders=e}get(e){for(const t of this.holders){const s=t.get(e);if(s)return s}}}var c=s(64218);const u=(0,c.createVersionedContext)("api-context"),l=e=>{const{apis:t,children:s}=e,o=(0,n.useContext)(u)?.atVersion(1),i=o?new a(t,o):t;return(0,r.jsx)(u.Provider,{value:(0,c.createVersionedValueMap)({1:i}),children:s})};l.propTypes={apis:i().shape({get:i().func.isRequired}).isRequired,children:i().node};class p{constructor(e){this.factories=e}static validateFactories(e,t){for(const s of t){const t=[s],r=new Set;for(;t.length;){const n=t.shift(),o=e.get(n);if(o)for(const e of Object.values(o.deps)){if(e.id===s.id)throw new Error(`Circular dependency of api factory for ${s}`);r.has(e)||(r.add(e),t.push(e))}}}}apis=new Map;get(e){return this.load(e)}load(e,t=[]){const s=this.apis.get(e.id);if(s)return s;const r=this.factories.get(e);if(!r)return;if(t.includes(r.api))throw new Error(`Circular dependency of api factory for ${r.api}`);const n=this.loadDeps(e,r.deps,[...t,r.api]),o=r.factory(n);return this.apis.set(e.id,o),o}loadDeps(e,t,s){const r={};for(const n in t)if(t.hasOwnProperty(n)){const o=t[n],i=this.load(o,s);if(!i)throw new Error(`No API factory available for dependency ${o} of dependent ${e}`);r[n]=i}return r}}var h=(e=>(e[e.default=10]="default",e[e.app=50]="app",e[e.static=100]="static",e))(h||{});class d{factories=new Map;register(e,t){const s=h[e],r=this.factories.get(t.api.id);return!(r&&r.priority>=s||(this.factories.set(t.api.id,{priority:s,factory:t}),0))}get(e){const t=this.factories.get(e.id);if(t)return t.factory}getAllApis(){const e=new Set;for(const{factory:t}of this.factories.values())e.add(t.api);return e}}function g(e){return new Promise(((t,s)=>{const r=e.width||500,n=e.height||700,o=window.screen.width/2-r/2,i=window.screen.height/2-n/2,a=new URL(e.url).origin,c=window.open(e.url,e.name,`menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=${r},height=${n},top=${i},left=${o}`);let u="";if(!c||void 0===c.closed||c.closed){const e=new Error("Failed to open auth popup.");return e.name="PopupRejectedError",void s(e)}const l=e=>{if(e.source!==c)return;if(e.origin!==a)return;const{data:r}=e;if("config_info"===r.type)return void(u=r.targetOrigin);if("authorization_response"!==r.type)return;const n=r;if("error"in n){const e=new Error(n.error.message);e.name=n.error.name,s(e)}else t(n.response);h()},p=setInterval((()=>{if(c.closed){const e="Login failed, "+(u&&u!==window.location.origin?`Incorrect app origin, expected ${u}`:"popup was closed"),t=new Error(e);t.name="PopupClosedError",s(t),h()}}),100);function h(){window.removeEventListener("message",l),clearInterval(p)}window.addEventListener("message",l)}))}let f=!1;function m(e){return[...e].join(" ")}class w{discoveryApi;environment;provider;joinScopesFunc;authRequester;sessionTransform;enableExperimentalRedirectFlow;popupOptions;constructor(e){const{configApi:t,discoveryApi:s,environment:r,provider:n,joinScopes:o=m,oauthRequestApi:i,sessionTransform:a=e=>e,popupOptions:c}=e;f||t||(console.warn("DEPRECATION WARNING: Authentication providers require a configApi instance to configure the authentication flow. Please provide one to the authentication provider constructor."),f=!0),this.enableExperimentalRedirectFlow=!!t&&(t.getOptionalBoolean("enableExperimentalRedirectFlow")??!1),this.authRequester=i.createAuthRequester({provider:n,onAuthRequest:async e=>this.enableExperimentalRedirectFlow?this.executeRedirect(e):this.showPopup(e)}),this.discoveryApi=s,this.environment=r,this.provider=n,this.joinScopesFunc=o,this.sessionTransform=a,this.popupOptions=c}async createSession(e){return e.instantPopup?this.enableExperimentalRedirectFlow?this.executeRedirect(e.scopes):this.showPopup(e.scopes):this.authRequester(e.scopes)}async refreshSession(e){const t=await fetch(await this.buildUrl("/refresh",{optional:!0,...e&&{scope:this.joinScopesFunc(e.scopes)}}),{headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch((e=>{throw new Error(`Auth refresh request failed, ${e}`)}));if(!t.ok){const e=new Error(`Auth refresh request failed, ${t.statusText}`);throw e.status=t.status,e}const s=await t.json();if(s.error){const e=new Error(s.error.message);throw s.error.name&&(e.name=s.error.name),e}return await this.sessionTransform(s)}async removeSession(){const e=await fetch(await this.buildUrl("/logout"),{method:"POST",headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch((e=>{throw new Error(`Logout request failed, ${e}`)}));if(!e.ok){const t=new Error(`Logout request failed, ${e.statusText}`);throw t.status=e.status,t}}async showPopup(e){const t=this.joinScopesFunc(e),s=await this.buildUrl("/start",{scope:t,origin:window.location.origin,flow:"popup"}),r=this.popupOptions?.size?.fullscreen?window.screen.width:this.popupOptions?.size?.width||450,n=this.popupOptions?.size?.fullscreen?window.screen.height:this.popupOptions?.size?.height||730,o=await g({url:s,name:`${this.provider.title} Login`,width:r,height:n});return await this.sessionTransform(o)}async executeRedirect(e){const t=this.joinScopesFunc(e);return window.location.href=await this.buildUrl("/start",{scope:t,origin:window.location.origin,redirectUrl:window.location.href,flow:"redirect"}),new Promise((()=>{}))}async buildUrl(e,t){const s=await this.discoveryApi.getBaseUrl("auth"),r=this.buildQueryString({...t,env:this.environment});return`${s}/${this.provider.id}${e}${r}`}buildQueryString(e){if(!e)return"";const t=Object.entries(e).map((([e,t])=>"string"==typeof t?`${encodeURIComponent(e)}=${encodeURIComponent(t)}`:t?encodeURIComponent(e):void 0)).filter(Boolean).join("&");return t?`?${t}`:""}}function v(e,t){for(const s of t)if(!e.has(s))return!1;return!0}class y{constructor(e){this.options=e}sessionExistsAndHasScope(e,t){return!!e&&(!t||(void 0===this.options.sessionScopes||v(this.options.sessionScopes(e),t)))}getExtendedScope(e,t){const s=new Set(this.options.defaultScopes);if(e&&void 0!==this.options.sessionScopes){const t=this.options.sessionScopes(e);for(const e of t)s.add(e)}if(t)for(const e of t)s.add(e);return s}}var S=s(96403),A=s.n(S);class b{isClosed=!1;terminatingError;observable=new(A())((e=>this.isClosed?(this.terminatingError?e.error(this.terminatingError):e.complete(),()=>{}):(this.subscribers.add(e),()=>{this.subscribers.delete(e)})));subscribers=new Set;[Symbol.observable](){return this}get closed(){return this.isClosed}next(e){if(this.isClosed)throw new Error("PublishSubject is closed");this.subscribers.forEach((t=>t.next(e)))}error(e){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.terminatingError=e,this.subscribers.forEach((t=>t.error(e)))}complete(){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.subscribers.forEach((e=>e.complete()))}subscribe(e,t,s){const r="function"==typeof e?{next:e,error:t,complete:s}:e;return this.observable.subscribe(r)}}class R{isClosed;currentValue;terminatingError;observable;constructor(e){this.isClosed=!1,this.currentValue=e,this.terminatingError=void 0,this.observable=new(A())((e=>this.isClosed?(this.terminatingError?e.error(this.terminatingError):e.complete(),()=>{}):(e.next(this.currentValue),this.subscribers.add(e),()=>{this.subscribers.delete(e)})))}subscribers=new Set;[Symbol.observable](){return this}get closed(){return this.isClosed}next(e){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.currentValue=e,this.subscribers.forEach((t=>t.next(e)))}error(e){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.terminatingError=e,this.subscribers.forEach((t=>t.error(e)))}complete(){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.subscribers.forEach((e=>e.complete()))}subscribe(e,t,s){const r="function"==typeof e?{next:e,error:t,complete:s}:e;return this.observable.subscribe(r)}}var I=s(22097);class E{subject=new R(I.SessionState.SignedOut);signedIn=!1;setIsSignedIn(e){this.signedIn!==e&&(this.signedIn=e,this.subject.next(this.signedIn?I.SessionState.SignedIn:I.SessionState.SignedOut))}sessionState$(){return this.subject}}class ${connector;helper;sessionScopesFunc;sessionShouldRefreshFunc;stateTracker=new E;refreshPromise;currentSession;constructor(e){const{connector:t,defaultScopes:s=new Set,sessionScopes:r,sessionShouldRefresh:n}=e;this.connector=t,this.sessionScopesFunc=r,this.sessionShouldRefreshFunc=n,this.helper=new y({sessionScopes:r,defaultScopes:s})}async getSession(e){if(this.helper.sessionExistsAndHasScope(this.currentSession,e.scopes)){if(!this.sessionShouldRefreshFunc(this.currentSession))return this.currentSession;try{const t=await this.collapsedSessionRefresh(e.scopes),s=this.sessionScopesFunc(this.currentSession);return v(this.sessionScopesFunc(t),s)&&(this.currentSession=t),t}catch(t){if(e.optional)return;throw t}}if(!e.instantPopup)try{const t=await this.collapsedSessionRefresh(e.scopes);return this.currentSession=t,this.getSession(e)}catch{}if(!e.optional)return this.currentSession=await this.connector.createSession({...e,scopes:this.helper.getExtendedScope(this.currentSession,e.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,await this.connector.removeSession(),this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}async collapsedSessionRefresh(e){if(this.refreshPromise)return this.refreshPromise;this.refreshPromise=this.connector.refreshSession({scopes:this.helper.getExtendedScope(this.currentSession,e)});try{const t=await this.refreshPromise;if(!this.helper.sessionExistsAndHasScope(t,e))throw new Error("Refreshed session did not receive the required scopes");return this.stateTracker.setIsSignedIn(!0),t}finally{delete this.refreshPromise}}}const x={id:"oauth2",title:"Your Identity Provider",icon:()=>null};class j{static createAuthConnector(e){if("authConnector"in e)return e.authConnector;const{scopeTransform:t=e=>e,configApi:s,discoveryApi:r,environment:n="development",provider:o=x,oauthRequestApi:i,popupOptions:a}=e;return new w({configApi:s,discoveryApi:r,environment:n,provider:o,oauthRequestApi:i,sessionTransform({backstageIdentity:e,...s}){const r={...s,providerInfo:{idToken:s.providerInfo.idToken,accessToken:s.providerInfo.accessToken,scopes:j.normalizeScopes(s.providerInfo.scope,{scopeTransform:t}),expiresAt:s.providerInfo.expiresInSeconds?new Date(Date.now()+1e3*s.providerInfo.expiresInSeconds):void 0}};return e&&(r.backstageIdentity={token:e.token,identity:e.identity,expiresAt:e.expiresInSeconds?new Date(Date.now()+1e3*e.expiresInSeconds):void 0}),r},popupOptions:a})}static create(e){const{defaultScopes:t=[],scopeTransform:s=e=>e}=e,r=j.createAuthConnector(e),n=new $({connector:r,defaultScopes:new Set(t),sessionScopes:e=>e.providerInfo.scopes,sessionShouldRefresh:e=>{let t=1/0;return e.providerInfo?.expiresAt&&(t=Math.min(t,(e.providerInfo.expiresAt.getTime()-Date.now())/1e3)),e.backstageIdentity?.expiresAt&&(t=Math.min(t,(e.backstageIdentity.expiresAt.getTime()-Date.now())/1e3)),t<180}});return new j({sessionManager:n,scopeTransform:s})}sessionManager;scopeTransform;constructor(e){this.sessionManager=e.sessionManager,this.scopeTransform=e.scopeTransform}async signIn(){await this.getAccessToken()}async signOut(){await this.sessionManager.removeSession()}sessionState$(){return this.sessionManager.sessionState$()}async getAccessToken(e,t){const s=j.normalizeScopes(e,{scopeTransform:this.scopeTransform}),r=await this.sessionManager.getSession({...t,scopes:s});return r?.providerInfo.accessToken??""}async getIdToken(e={}){const t=await this.sessionManager.getSession({...e,scopes:new Set(["openid"])});return t?.providerInfo.idToken??""}async getBackstageIdentity(e={}){const t=await this.sessionManager.getSession(e);return t?.backstageIdentity}async getProfile(e={}){const t=await this.sessionManager.getSession(e);return t?.profile}static normalizeScopes(e,t){if(!e)return new Set;const s=Array.isArray(e)?e:e.split(/[\s|,]/).filter(Boolean),r=t?t.scopeTransform(s):s;return new Set(r)}}const P={id:"github",title:"GitHub",icon:()=>null};class T{static create(e){const{configApi:t,discoveryApi:s,environment:r="development",provider:n=P,oauthRequestApi:o,defaultScopes:i=["read:user"]}=e;return j.create({configApi:t,discoveryApi:s,oauthRequestApi:o,provider:n,environment:r,defaultScopes:i})}}const C={id:"gitlab",title:"GitLab",icon:()=>null};class F{static create(e){const{configApi:t,discoveryApi:s,environment:r="development",provider:n=C,oauthRequestApi:o,defaultScopes:i=["read_user"]}=e;return j.create({configApi:t,discoveryApi:s,oauthRequestApi:o,provider:n,environment:r,defaultScopes:i})}}const k={id:"google",title:"Google",icon:()=>null},O="https://www.googleapis.com/auth/";class L{static create(e){const{configApi:t,discoveryApi:s,oauthRequestApi:r,environment:n="development",provider:o=k,defaultScopes:i=["openid",`${O}userinfo.email`,`${O}userinfo.profile`]}=e;return j.create({configApi:t,discoveryApi:s,oauthRequestApi:r,provider:o,environment:n,defaultScopes:i,scopeTransform:e=>e.map((e=>"openid"===e?e:"profile"===e||"email"===e?`${O}userinfo.${e}`:e.startsWith(O)?e:`${O}${e}`))})}}const M={id:"okta",title:"Okta",icon:()=>null},U=new Set(["openid","profile","email","phone","address","groups","offline_access"]),q="okta.";class _{static create(e){const{configApi:t,discoveryApi:s,environment:r="development",provider:n=M,oauthRequestApi:o,defaultScopes:i=["openid","email","profile","offline_access"]}=e;return j.create({configApi:t,discoveryApi:s,oauthRequestApi:o,provider:n,environment:r,defaultScopes:i,scopeTransform:e=>e.map((e=>U.has(e)||e.startsWith(q)?e:`${q}${e}`))})}}class N{discoveryApi;environment;provider;constructor(e){const{discoveryApi:t,environment:s,provider:r}=e;this.discoveryApi=t,this.environment=s,this.provider=r}async createSession(){const e=await this.buildUrl("/start"),t=await g({url:e,name:`${this.provider.title} Login`,width:450,height:730});return{...t,id:t.profile.email}}async refreshSession(){}async removeSession(){const e=await fetch(await this.buildUrl("/logout"),{method:"POST",headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch((e=>{throw new Error(`Logout request failed, ${e}`)}));if(!e.ok){const t=new Error(`Logout request failed, ${e.statusText}`);throw t.status=e.status,t}}async buildUrl(e){return`${await this.discoveryApi.getBaseUrl("auth")}/${this.provider.id}${e}?env=${this.environment}`}}class D{connector;helper;stateTracker=new E;currentSession;constructor(e){const{connector:t,defaultScopes:s=new Set,sessionScopes:r}=e;this.connector=t,this.helper=new y({sessionScopes:r,defaultScopes:s})}setSession(e){this.currentSession=e,this.stateTracker.setIsSignedIn(Boolean(e))}async getSession(e){return this.helper.sessionExistsAndHasScope(this.currentSession,e.scopes)?this.currentSession:e.optional?void 0:(this.currentSession=await this.connector.createSession({...e,scopes:this.helper.getExtendedScope(this.currentSession,e.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession)}async removeSession(){this.currentSession=void 0,this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}}class B{manager;storageKey;schema;sessionShouldRefreshFunc;helper;constructor(e){const{manager:t,storageKey:s,schema:r,sessionScopes:n,sessionShouldRefresh:o=()=>!1}=e;this.manager=t,this.storageKey=s,this.schema=r,this.sessionShouldRefreshFunc=o,this.helper=new y({sessionScopes:n,defaultScopes:new Set})}setSession(e){this.manager.setSession(e),this.saveSession(e)}async getSession(e){const{scopes:t}=e,s=this.loadSession();if(this.helper.sessionExistsAndHasScope(s,t)&&!this.sessionShouldRefreshFunc(s))return this.manager.setSession(s),s;const r=await this.manager.getSession(e);return this.saveSession(r),r}async removeSession(){localStorage.removeItem(this.storageKey),await this.manager.removeSession()}sessionState$(){return this.manager.sessionState$()}loadSession(){try{const e=localStorage.getItem(this.storageKey);if(e){const t=JSON.parse(e,((e,t)=>"Set"===t?.__type?new Set(t.__value):t));try{return this.schema.parse(t)}catch(e){throw console.log(`Failed to load session from local storage because it did not conform to the expected schema, ${e}`),e}}return}catch(e){return void localStorage.removeItem(this.storageKey)}}saveSession(e){if(void 0!==e){try{this.schema.parse(e)}catch(e){return void console.warn(`Failed to save session to local storage because it did not conform to the expected schema, ${e}`)}localStorage.setItem(this.storageKey,JSON.stringify(e,((e,t)=>t instanceof Set?{__type:"Set",__value:Array.from(t)}:t)))}else localStorage.removeItem(this.storageKey)}}var z=s(44867);const G=z.z.object({profile:z.z.object({email:z.z.string().optional(),displayName:z.z.string().optional(),picture:z.z.string().optional()}),backstageIdentity:z.z.object({token:z.z.string(),identity:z.z.object({type:z.z.literal("user"),userEntityRef:z.z.string(),ownershipEntityRefs:z.z.array(z.z.string())})})}),H={id:"saml",title:"SAML",icon:()=>null};class V{constructor(e){this.sessionManager=e}static create(e){const{discoveryApi:t,environment:s="development",provider:r=H}=e,n=new N({discoveryApi:t,environment:s,provider:r}),o=new D({connector:n}),i=new B({manager:o,storageKey:`${r.id}Session`,schema:G});return new V(i)}sessionState$(){return this.sessionManager.sessionState$()}async signIn(){await this.getBackstageIdentity({})}async signOut(){await this.sessionManager.removeSession()}async getBackstageIdentity(e={}){const t=await this.sessionManager.getSession(e);return t?.backstageIdentity}async getProfile(e={}){const t=await this.sessionManager.getSession(e);return t?.profile}}const W={id:"microsoft",title:"Microsoft",icon:()=>null};class K{oauth2;configApi;environment;provider;oauthRequestApi;discoveryApi;scopeTransform;static MicrosoftGraphID="00000003-0000-0000-c000-000000000000";static create(e){return new K(e)}constructor(e){const{configApi:t,environment:s="development",provider:r=W,oauthRequestApi:n,discoveryApi:o,defaultScopes:i=["openid","offline_access","profile","email","User.Read"],scopeTransform:a=e=>e.concat("offline_access")}=e;this.configApi=t,this.environment=s,this.provider=r,this.oauthRequestApi=n,this.discoveryApi=o,this.scopeTransform=a,this.oauth2={[K.MicrosoftGraphID]:j.create({configApi:this.configApi,discoveryApi:this.discoveryApi,oauthRequestApi:this.oauthRequestApi,provider:this.provider,environment:this.environment,scopeTransform:this.scopeTransform,defaultScopes:i})}}microsoftGraph(){return this.oauth2[K.MicrosoftGraphID]}static resourceForScopes(e){const t=[...new Set(e.split(" ").map(K.resourceForScope).filter((e=>"openid"!==e)))];if(t.length>1)return Promise.reject(new Error(`Requested access token with scopes from multiple Azure resources: ${t.join(", ")}. Access tokens can only have a single audience.`));const s=t[0]??K.MicrosoftGraphID;return Promise.resolve(s)}static resourceForScope(e){const t=e.match(/^(?<resourceURI>.*)\/(?<scp>[^\/]*)$/)?.groups;if(t){const{resourceURI:e}=t;return e.replace(/^api:\/\//,"")}switch(e){case"email":case"openid":case"offline_access":case"profile":return"openid";default:return K.MicrosoftGraphID}}async getAccessToken(e,t){const s=void 0===e?K.MicrosoftGraphID:await K.resourceForScopes(Array.isArray(e)?e.join(" "):e);return s in this.oauth2||(this.oauth2[s]=j.create({configApi:this.configApi,discoveryApi:this.discoveryApi,oauthRequestApi:this.oauthRequestApi,provider:this.provider,environment:this.environment,scopeTransform:this.scopeTransform})),this.oauth2[s].getAccessToken(e,t)}getIdToken(e){return this.microsoftGraph().getIdToken(e)}getProfile(e){return this.microsoftGraph().getProfile(e)}getBackstageIdentity(e){return this.microsoftGraph().getBackstageIdentity(e)}signIn(){return this.microsoftGraph().signIn()}signOut(){return this.microsoftGraph().signOut()}sessionState$(){return this.microsoftGraph().sessionState$()}}const J={id:"onelogin",title:"onelogin",icon:()=>null},Q=new Set(["openid","profile","email","phone","address","groups","offline_access"]),X="onelogin.";class Y{static create(e){const{configApi:t,discoveryApi:s,environment:r="development",provider:n=J,oauthRequestApi:o}=e;return j.create({configApi:t,discoveryApi:s,oauthRequestApi:o,provider:n,environment:r,defaultScopes:["openid","email","profile","offline_access"],scopeTransform:e=>e.map((e=>Q.has(e)||e.startsWith(X)?e:`${X}${e}`))})}}const Z={id:"bitbucket",title:"Bitbucket",icon:()=>null};class ee{static create(e){const{configApi:t,discoveryApi:s,environment:r="development",provider:n=Z,oauthRequestApi:o,defaultScopes:i=["account"]}=e;return j.create({configApi:t,discoveryApi:s,oauthRequestApi:o,provider:n,environment:r,defaultScopes:i})}}const te={id:"bitbucketServer",title:"Bitbucket Server",icon:()=>null};class se{static create(e){const{configApi:t,discoveryApi:s,environment:r="development",provider:n=te,oauthRequestApi:o,defaultScopes:i=["PROJECT_ADMIN"]}=e;return j.create({configApi:t,discoveryApi:s,oauthRequestApi:o,provider:n,environment:r,defaultScopes:i})}}const re={id:"atlassian",title:"Atlassian",icon:()=>null};class ne{static create(e){const{configApi:t,discoveryApi:s,environment:r="development",provider:n=re,oauthRequestApi:o}=e;return j.create({configApi:t,discoveryApi:s,oauthRequestApi:o,provider:n,environment:r})}}const oe={id:"vmwareCloudServices",title:"VMware Cloud",icon:()=>null};class ie{static create(e){const{configApi:t,discoveryApi:s,oauthRequestApi:r,environment:n="development",provider:o=oe,defaultScopes:i=["openid"]}=e;return j.create({configApi:t,discoveryApi:s,oauthRequestApi:r,provider:o,environment:n,defaultScopes:i})}}class ae{subject=new b;post(e){this.subject.next(e)}alert$(){return this.subject}}class ce{constructor(e){this.actualApis=e}static fromApis(e){return new ce(e)}captureEvent(e){this.actualApis.forEach((t=>{try{t.captureEvent(e)}catch{}}))}}class ue{captureEvent(e){}}const le="theme";class pe{constructor(e){this.themes=e}static createWithStorage(e){const t=new pe(e);if(!window.localStorage)return t;const s=window.localStorage.getItem(le)??void 0;return t.setActiveThemeId(s),t.activeThemeId$().subscribe((e=>{e?window.localStorage.setItem(le,e):window.localStorage.removeItem(le)})),window.addEventListener("storage",(e=>{if(e.key===le){const e=localStorage.getItem(le)??void 0;t.setActiveThemeId(e)}})),t}activeThemeId;subject=new R(void 0);getInstalledThemes(){return this.themes.slice()}activeThemeId$(){return this.subject}getActiveThemeId(){return this.activeThemeId}setActiveThemeId(e){this.activeThemeId=e,this.subject.next(e)}}var he=s(43563);const de="Invalid discovery URL pattern,";class ge{constructor(e){this.parts=e}static compile(e){const t=e.split(/\{\{\s*pluginId\s*\}\}/),s=t.join("pluginId");let r;try{r=new URL(s)}catch{throw new Error(`${de} URL '${s}' is invalid`)}if(r.hash)throw new Error(`${de} URL must not have a hash`);if(r.search)throw new Error(`${de} URL must not have a query`);if(s.endsWith("/"))throw new Error(`${de} URL must not end with a slash`);return new ge(t)}async getBaseUrl(e){return this.parts.join(encodeURIComponent(e))}}class fe{constructor(e,t){this.endpoints=e,this.defaultEndpoint=t}static fromConfig(e,t){const s=t?.pathPattern??"/api/{{ pluginId }}",r=e.getString("backend.baseUrl"),n=e.getOptionalConfigArray("discovery.endpoints")?.flatMap((e=>{const t="object"==typeof e.get("target")?e.getOptionalString("target.external"):e.getString("target");if(!t)return[];const s=ge.compile(t);return e.getStringArray("plugins").map((e=>[e,s]))}));return new fe(new Map(n),ge.compile(`${r}${s}`))}async getBaseUrl(e){const t=this.endpoints.get(e);return t?t.getBaseUrl(e):this.defaultEndpoint.getBaseUrl(e)}}class me{constructor(e,t){this.alertApi=e,this.errorApi=t}post(e,t){return t?.hidden||this.alertApi.post({message:e.message,severity:"error"}),this.errorApi.post(e,t)}error$(){return this.errorApi.error$()}}class we{subject=new b;post(e,t){this.subject.next({error:e,context:t})}error$(){return this.subject}}class ve{static forward(e,t){window.addEventListener("unhandledrejection",(s=>{e.post(s.reason,t)}))}}function ye(e){if(e.length<3)throw new Error(`The '${e}' feature flag must have a minimum length of three characters.`);if(e.length>150)throw new Error(`The '${e}' feature flag must not exceed 150 characters.`);if(!e.match(/^[a-z]+[a-z0-9-]+$/))throw new Error(`The '${e}' feature flag must start with a lowercase letter and only contain lowercase letters, numbers and hyphens. Examples: feature-flag-one, alpha, release-2020`)}class Se{registeredFeatureFlags=[];flags;registerFlag(e){ye(e.name),this.registeredFeatureFlags.push(e)}getRegisteredFlags(){return this.registeredFeatureFlags.slice()}isActive(e){return this.flags||(this.flags=this.load()),this.flags.get(e)===I.FeatureFlagState.Active}save(e){this.flags||(this.flags=this.load()),e.merge||this.flags.clear();for(const[t,s]of Object.entries(e.states))this.flags.set(t,s);const t=Array.from(this.flags.entries()).filter((([,e])=>e===I.FeatureFlagState.Active));window.localStorage.setItem("featureFlags",JSON.stringify(Object.fromEntries(t)))}load(){try{const e=window.localStorage.getItem("featureFlags");if(!e)return new Map;const t=JSON.parse(e);if("object"!=typeof t||null===t||Array.isArray(t))return new Map;const s=Object.entries(t).filter((([e,t])=>(ye(e),t===I.FeatureFlagState.Active)));return new Map(s)}catch{return new Map}}}function Ae(e){let t=e.baseImplementation||s.g.fetch;const r=[e.middleware??[]].flat().reverse();for(const e of r)t=e.apply(t);return{fetch:t}}class be{constructor(e,t,s,r){this.identityApi=e,this.allowUrl=t,this.headerName=s,this.headerValue=r}static create(e){const t=function(e){return e.allowUrl?e.allowUrl:e.urlPrefixAllowlist?Re(e.urlPrefixAllowlist):e.config?Re([e.config.getString("backend.baseUrl"),...be.getDiscoveryUrlPrefixes(e.config)]):()=>!1}(e),s=e.header?.name||"authorization",r=e.header?.value||(e=>`Bearer ${e}`);return new be(e.identityApi,t,s,r)}static getDiscoveryUrlPrefixes(e){return(e.getOptionalConfigArray("discovery.endpoints")||[]).flatMap((e=>{const t="object"==typeof e.get("target")?e.getString("target.external"):e.getString("target");return e.getStringArray("plugins").map((e=>t.replace(/\{\{\s*pluginId\s*\}\}/g,e)))}))}apply(e){return async(t,s)=>{const r=new Request(t,s),{token:n}=await this.identityApi.getCredentials();return!r.headers.get(this.headerName)&&"string"==typeof n&&n&&this.allowUrl(r.url)?(r.headers.set(this.headerName,this.headerValue(n)),e(r)):e(t,s)}}}function Re(e){const t=e.map((e=>e.replace(/\/$/,"")));return e=>t.some((t=>e===t||e.startsWith(`${t}/`)))}class Ie{constructor(e){this.discoveryApi=e}apply(e){return async(t,s)=>{const r=new Request(t,s);if(!r.url.startsWith("plugin://"))return e(t,s);const{hostname:n,pathname:o,search:i,hash:a,username:c,password:u}=new URL(`http://${r.url.substring(9)}`);let l=await this.discoveryApi.getBaseUrl(n);if(c||u){const e=new URL(l),t=`${c}${u?`:${u}`:""}@`;l=`${e.protocol}//${t}${e.host}${e.pathname}`}const p=`${h=l,d=o,d&&"/"!==d?`${h.replace(/\/$/,"")}/${d.replace(/^\//,"")}`:h}${i}${a}`;var h,d,g;return e(p,"string"==typeof t||"object"==typeof(g=t)&&g?.constructor===URL?s:t)}}}class Ee{static resolvePluginProtocol(e){return new Ie(e.discoveryApi)}static injectIdentityAuth(e){return be.create(e)}constructor(){}}class $e{requests=[];subject=new R(this.getCurrentPending());request(e){return new Promise(((t,s)=>{this.requests.push({scopes:e,resolve:t,reject:s}),this.subject.next(this.getCurrentPending())}))}resolve(e,t){this.requests=this.requests.filter((s=>!function(e,t){for(const s of t)if(!e.has(s))return!1;return!0}(e,s.scopes)||(s.resolve(t),!1))),this.subject.next(this.getCurrentPending())}reject(e){this.requests.forEach((t=>t.reject(e))),this.requests=[],this.subject.next(this.getCurrentPending())}pending(){return this.subject}getCurrentPending(){const e=0===this.requests.length?void 0:this.requests.slice(1).reduce(((e,t)=>function(e,...t){const s=new Set(e);for(const e of t)for(const t of e)s.add(t);return s}(e,t.scopes)),this.requests[0].scopes);return{scopes:e,resolve:t=>{e&&this.resolve(e,t)},reject:t=>{e&&this.reject(t)}}}}class xe{subject=new b;currentRequests=[];handlerCount=0;createAuthRequester(e){const t=new $e,s=this.handlerCount;return this.handlerCount++,t.pending().subscribe({next:t=>{const r=this.currentRequests.slice(),n=this.makeAuthRequest(t,e);n?r[s]=n:delete r[s],this.currentRequests=r,this.subject.next(r.filter(Boolean))}}),e=>t.request(e)}makeAuthRequest(e,t){const{scopes:s}=e;if(s)return{provider:t.provider,trigger:async()=>{const r=await t.onAuthRequest(s);e.resolve(r)},reject:()=>{const t=new Error("Login failed, rejected by user");t.name="RejectedError",e.reject(t)}}}authRequest$(){return this.subject}}const je=new Map;class Pe{constructor(e,t){this.namespace=e,this.errorApi=t}static hasSubscribed=!1;static create(e){return new Pe(e.namespace??"",e.errorApi)}static addStorageEventListener(){window.addEventListener("storage",(e=>{for(const[t,s]of je.entries())e.key?.startsWith(t)&&s.handleStorageChange(e.key)}))}get(e){return this.snapshot(e).value}snapshot(e){let t,s="absent";try{const r=localStorage.getItem(this.getKeyName(e));r&&(t=JSON.parse(r,((e,t)=>("object"==typeof t&&null!==t&&Object.freeze(t),t))),s="present")}catch(t){this.errorApi.post(new Error(`Error when parsing JSON config from storage for: ${e}`))}return{key:e,value:t,presence:s}}forBucket(e){const t=`${this.namespace}/${e}`;return je.has(t)||je.set(t,new Pe(t,this.errorApi)),je.get(t)}async set(e,t){localStorage.setItem(this.getKeyName(e),JSON.stringify(t)),this.notifyChanges(e)}async remove(e){localStorage.removeItem(this.getKeyName(e)),this.notifyChanges(e)}observe$(e){return Pe.hasSubscribed||(Pe.addStorageEventListener(),Pe.hasSubscribed=!0),this.observable.filter((({key:t})=>t===e))}handleStorageChange(e){if(!e?.startsWith(this.namespace))return;const t=e?.slice(`${this.namespace}/`.length);t.includes("/")||this.notifyChanges(decodeURIComponent(t))}getKeyName(e){return`${this.namespace}/${encodeURIComponent(e)}`}notifyChanges(e){const t=this.snapshot(e);for(const e of this.subscribers)e.next(t)}subscribers=new Set;observable=new(A())((e=>(this.subscribers.add(e),()=>{this.subscribers.delete(e)})))}const Te=(0,n.createContext)(void 0);var Ce=s(42469);function Fe(){const[e]=(0,Ce.createRoutesFromChildren)((0,r.jsx)(Ce.Route,{index:!0,element:(0,r.jsx)("div",{})}));return!e.index}const ke=({pathname:e,search:t,hash:s,attributes:r})=>{const o=(0,I.useAnalytics)();return(0,n.useEffect)((()=>{o.captureEvent("navigate",`${e}${t}${s}`,{attributes:r})}),[o,e,t,s,r]),null},Oe=({routeObjects:e})=>{const{pathname:t,search:s,hash:n}=(0,Ce.useLocation)(),{params:o,...i}=((e,t)=>{try{const s=(0,Ce.matchRoutes)(t,{pathname:e}),r=s?.filter((e=>e?.route.routeRefs?.size>0)).pop(),n=r?.route;if(!n)return;if(""===n.path&&"/"!==e)return;let o,i;1===n.routeRefs.size&&(o=n.routeRefs.values().next().value),1===n.plugins.size&&(i=n.plugins.values().next().value);const a=Object.entries(r?.params||{}).reduce(((e,[t,s])=>(void 0!==s&&"*"!==t&&(e[t]=s),e)),{});return{extension:"App",pluginId:i?.getId()||"root",...o?{routeRef:o.id}:{},_routeNodeType:n.element,params:a}}catch{return}})(t,e)||{params:{}};return(0,r.jsx)(I.AnalyticsContext,{attributes:i,children:(0,r.jsx)(ke,{pathname:t,search:s,hash:n,attributes:o})})};function Le(e){let{pathname:t}=new URL(e.getOptionalString("app.baseUrl")??"/","http://sample.dev");return t=t.replace(/\/*$/,""),t}function Me({component:e,appIdentityProxy:t,children:s}){const[o,i]=(0,n.useState)(),a=Le((0,I.useApi)(I.configApiRef));return o?(t.setTarget(o,{signOutTargetUrl:a||"/"}),(0,r.jsx)(r.Fragment,{children:s})):(0,r.jsx)(e,{onSignInSuccess:i})}function Ue(e){const{Router:t,SignInPage:s}=(0,I.useApp)().getComponents(),o=Le((0,I.useApi)(I.configApiRef)),i=`${o}/*`,a=(0,n.useContext)(Te);if(!a)throw new Error("AppRouter must be rendered within the AppProvider");const{routeObjects:c,appIdentityProxy:u}=a;return s?Fe()?(0,r.jsxs)(t,{children:[(0,r.jsx)(Oe,{routeObjects:c}),(0,r.jsx)(Me,{component:s,appIdentityProxy:u,children:(0,r.jsx)(Ce.Routes,{children:(0,r.jsx)(Ce.Route,{path:i,element:(0,r.jsx)(r.Fragment,{children:e.children})})})})]}):(0,r.jsxs)(t,{basename:o,children:[(0,r.jsx)(Oe,{routeObjects:c}),(0,r.jsx)(Me,{component:s,appIdentityProxy:u,children:e.children})]}):(u.setTarget({getUserId:()=>"guest",getIdToken:async()=>{},getProfile:()=>({email:"guest@example.com",displayName:"Guest"}),getProfileInfo:async()=>({email:"guest@example.com",displayName:"Guest"}),getBackstageIdentity:async()=>({type:"user",userEntityRef:"user:default/guest",ownershipEntityRefs:["user:default/guest"]}),getCredentials:async()=>({}),signOut:async()=>{}},{signOutTargetUrl:o||"/"}),Fe()?(0,r.jsxs)(t,{children:[(0,r.jsx)(Oe,{routeObjects:c}),(0,r.jsx)(Ce.Routes,{children:(0,r.jsx)(Ce.Route,{path:i,element:(0,r.jsx)(r.Fragment,{children:e.children})})})]}):(0,r.jsxs)(t,{basename:o,children:[(0,r.jsx)(Oe,{routeObjects:c}),e.children]}))}(0,I.attachComponentData)(Ue,"core.type","AppRouter");var qe=s(35015);const _e=(0,I.createApiRef)({id:"core.applanguage"});var Ne=s(48347);function De(e,t){return()=>({accumulator:e(),visit:t})}function Be(e){return e.props?.children}function ze(e){if(e.props?.path&&e.props?.element)return e.props?.element}const Ge=De((()=>new Set),((e,t)=>{const s=(0,I.getComponentData)(t,"core.plugin");s&&e.add(s)})),He=e=>{const{children:t}=e,s=(0,I.useApi)(I.featureFlagsApiRef),n="with"in e?s.isActive(e.with):!s.isActive(e.without);return(0,r.jsx)(r.Fragment,{children:n?t:null})};(0,I.attachComponentData)(He,"core.featureFlagged",!0);const Ve={caseSensitive:!1,path:"*",element:"match-all",routeRefs:new Set,plugins:new Set};function We(e){const t=e;return t?.type?t.type.displayName??t.type.name??String(t.type):String(t)}const Ke=e=>{const t=new Set;return e&&t.add(e),t};function Je(e,t=new Array){return n.Children.forEach(e,(e=>{if(!(0,n.isValidElement)(e))return;const s=(0,I.getComponentData)(e,"core.mountPoint");if(s){const r=(0,I.getComponentData)(e,"core.plugin");t.push({routeRef:s,plugin:r})}Je(e.props.children,t)})),t}const Qe=De((()=>({paths:new Map,parents:new Map,objects:new Array})),((e,t,s,r)=>{if(r?.isElementAncestor)return r;if(s?.props.element===t)return{...r,isElementAncestor:!0};const n=t.props?.path,o=(0,I.getComponentData)(t,"core.mountPoint");if(o&&n)throw new Error(`Path property may not be set directly on a routable extension "${We(t)}"`);const i=r?.obj?.children??e.objects;if(void 0!==n){if("string"!=typeof n)throw new Error(`Element path must be a string at "${We(t)}"`);const s=n.startsWith("/")?n.slice(1):n,o=t.props.element;if((0,I.getComponentData)(t,"core.gatherMountPoints")){if(o)throw new Error(`Mount point gatherers may not have an element prop "${We(t)}"`);const e={path:s,element:"gathered",routeRefs:new Set,caseSensitive:Boolean(t.props?.caseSensitive),children:[Ve],plugins:new Set};return i.push(e),{obj:e,gatherPath:s,routeRef:r?.routeRef,gatherRouteRef:r?.routeRef}}if(o){const[a,...c]=Je(o);if(c.length>0)throw new Error(`Route element with path "${n}" may not contain multiple routable extensions`);if(!a)return r;const{routeRef:u,plugin:l}=a,p={path:s,element:"mounted",routeRefs:new Set([u]),caseSensitive:Boolean(t.props?.caseSensitive),children:[Ve],plugins:Ke(l)};return i.push(p),e.paths.set(u,s),e.parents.set(u,r?.routeRef),{obj:p,routeRef:u??r?.routeRef,gatherPath:s,gatherRouteRef:r?.gatherRouteRef}}}if(o){if(void 0===r?.gatherPath)throw new Error(`Routable extension "${We(t)}" with mount point "${o}" must be assigned a path`);r?.obj?.routeRefs.add(o);const s=(0,I.getComponentData)(t,"core.plugin");return s&&r?.obj?.plugins.add(s),e.paths.set(o,r.gatherPath),e.parents.set(o,r?.gatherRouteRef),{...r,routeRef:o}}return r})),Xe=De((()=>({paths:new Map,parents:new Map,objects:new Array})),((e,t,s,r)=>{if(s?.props.element===t)return r;let o=r?.obj,i=r?.routeRef,a=r?.sticky;const c=t.props?.path,u=o?.children??e.objects,l=Boolean(t.props?.caseSensitive);let p=r?.path;if((0,I.getComponentData)(t,"core.gatherMountPoints")){if(!c)throw new Error("Mount point gatherer must have a path");p=c}const h=t.props?.element;let d=(0,I.getComponentData)(t,"core.mountPoint");if(!d&&(0,n.isValidElement)(h)&&(d=(0,I.getComponentData)(h,"core.mountPoint")),d){let s=c;if(p&&(s?p=void 0:s=p),!s)throw new Error("Mounted routable extension must have a path");e.paths.set(d,s),i&&a?(e.parents.set(d,i),c&&(i=d,a=!1)):(e.parents.set(d,i),i=d),c?(o={caseSensitive:l,path:c,element:"mounted",routeRefs:new Set([d]),children:[Ve],plugins:Ke((0,I.getComponentData)(t.props.element,"core.plugin"))},u.push(o)):o?.routeRefs.add(d)}if((0,I.getComponentData)(t,"core.gatherMountPoints")&&(a=!0),(0,I.getComponentData)(t,"core.gatherMountPoints")){if(!c)throw new Error("Mount point gatherer must have a path");d||(o={caseSensitive:l,path:c,element:"gathered",routeRefs:new Set,children:[Ve],plugins:r?.obj?.plugins||new Set},u.push(o))}return{obj:o,path:p,routeRef:i,sticky:a}})),Ye=De((()=>new Set),((e,t)=>{if(t.type===He){const s=t.props;e.add("with"in s?s.with:s.without)}})),Ze=(0,c.getOrCreateGlobalSingleton)("route-ref-type",(()=>Symbol("route-ref-type")));function et(e){return"absolute"===e[Ze]}function tt(e){return"sub"===e[Ze]}function st(...e){const t=e.join("/").replace(/\/\/+/g,"/");return"/"!==t&&t.endsWith("/")?t.slice(0,-1):t}var rt=s(46155),nt=s.n(rt);class ot{constructor(e,t,s,r,n){this.routePaths=e,this.routeParents=t,this.routeObjects=s,this.routeBindings=r,this.appBasePath=n}resolve(e,t){const[s,r]=function(e,t,s){let r,n="";if(et(e))r=e;else if(tt(e))r=e.parent,n=e.path;else{if("external"!==e[Ze])throw e[Ze]?new Error(`Unknown or invalid route ref type, ${e[Ze]}`):new Error(`Unknown object passed to useRouteRef, got ${e}`);{const t=s.get(e);if(!t)return[void 0,""];if(et(t))r=t;else{if(!tt(t))throw new Error(`ExternalRouteRef was bound to invalid target, ${t}`);r=t.parent,n=t.path}}}if(!r)return[void 0,""];const o=t.get(r);return void 0===o?[void 0,""]:[r,st(o,n)]}(e,this.routePaths,this.routeBindings);if(!s)return;let n;n="string"==typeof t?this.trimPath(t):t.pathname?{...t,pathname:this.trimPath(t.pathname)}:t;const o=this.appBasePath+function(e,t,s,r,n){const o=(0,Ce.matchRoutes)(n,t)??[],i=Array();let a=-1;for(let t=e;t&&(a=o.findIndex((e=>e.route.routeRefs.has(t))),-1===a);t=r.get(t))i.unshift(t);return 0===i.length&&(a-=1),`${st(-1===a?"":o[a].pathname,...i.slice(0,-1).map((t=>{const r=s.get(t);if(void 0===r)throw new Error(`No path for ${t}`);if(r.includes(":"))throw new Error(`Cannot route to ${e} with parent ${t} as it has parameters`);return r})))}/`}(s,n,this.routePaths,this.routeParents,this.routeObjects);return(...[e])=>{const t=e&&nt()(e,(e=>"string"==typeof e?e.replaceAll(/[&?#;\/]/g,(e=>encodeURIComponent(e))):e));return st(o,(0,Ce.generatePath)(r,t))}}trimPath(e){return e&&e.startsWith(this.appBasePath)?e.slice(this.appBasePath.length):e}}const it=(0,c.createVersionedContext)("routing-context"),at=({routePaths:e,routeParents:t,routeObjects:s,routeBindings:n,basePath:o="",children:i})=>{const a=new ot(e,t,s,n,o),u=(0,c.createVersionedValueMap)({1:a});return(0,r.jsx)(it.Provider,{value:u,children:i})},ct=(0,c.createVersionedContext)("app-context"),ut=({appContext:e,children:t})=>{const s=(0,c.createVersionedValueMap)({1:e});return(0,r.jsx)(ct.Provider,{value:s,children:t})};function lt(e){return new Error(`Tried to access IdentityApi ${e} before app was loaded`)}function pt(e){console.warn(`WARNING: Call to ${e} is deprecated and will break in the future`)}class ht{target;waitForTarget;resolveTarget=()=>{};signOutTargetUrl="/";#e;constructor(){this.waitForTarget=new Promise((e=>{this.resolveTarget=e}))}setTarget(e,t){this.target=e,this.signOutTargetUrl=t.signOutTargetUrl,this.resolveTarget(e)}getUserId(){if(!this.target)throw lt("getUserId");if(!this.target.getUserId)throw new Error("IdentityApi does not implement getUserId");return pt("getUserId"),this.target.getUserId()}getProfile(){if(!this.target)throw lt("getProfile");if(!this.target.getProfile)throw new Error("IdentityApi does not implement getProfile");return pt("getProfile"),this.target.getProfile()}async getProfileInfo(){return this.waitForTarget.then((e=>e.getProfileInfo()))}async getBackstageIdentity(){const e=await this.waitForTarget.then((e=>e.getBackstageIdentity()));return e.userEntityRef.match(/^.*:.*\/.*$/)||console.warn(`WARNING: The App IdentityApi provided an invalid userEntityRef, '${e.userEntityRef}'. It must be a full Entity Reference of the form '<kind>:<namespace>/<name>'.`),e}async getCredentials(){return this.waitForTarget.then((e=>e.getCredentials()))}async getIdToken(){return this.waitForTarget.then((e=>{if(!e.getIdToken)throw new Error("IdentityApi does not implement getIdToken");return pt("getIdToken"),e.getIdToken()}))}async signOut(){await this.waitForTarget.then((e=>e.signOut())),await(this.#e?.()),window.location.href=this.signOutTargetUrl}enableCookieAuth(e){if(this.#e)return;const t=function({discoveryApi:e,fetchApi:t,errorApi:s}){let r,n=!1,o=!0,i=5e3;const a="BroadcastChannel"in window?new BroadcastChannel("app-auth-cookie-expires-at"):void 0,c=e=>{const t=6e4*(1+3*Math.random());return Math.max(e-Date.now(),3e5)-t},u=async()=>{try{const s=`${await e.getBaseUrl("app")}/.backstage/auth/v1/cookie`,r=await t.fetch(s,{credentials:"include"});if(!r.ok)throw new Error(`Request failed with status ${r.status} ${r.statusText}, see request towards ${s} for more details`);const n=await r.json();if(!n.expiresAt)throw new Error("No expiration date in response");const i=Date.parse(n.expiresAt);if(Number.isNaN(i))throw new Error("Invalid expiration date in response");o=!0,a?.postMessage({action:"COOKIE_REFRESH_SUCCESS",payload:{expiresAt:new Date(i).toISOString()}}),p(c(i))}catch(e){o?(o=!1,i=5e3):(i=Math.min(3e5,2*i),console.error("Session cookie refresh failed",e),s.post(new Error("Session refresh failed, see developer console for details"))),p(i)}},l=e=>{const{data:t}=e;if(null!==t&&"object"==typeof t&&"action"in t&&"COOKIE_REFRESH_SUCCESS"===t.action){const e=Date.parse(t.payload.expiresAt);if(Number.isNaN(e))return void console.warn("Received invalid expiration from session refresh channel");p(c(e))}};function p(e){n||(r&&clearTimeout(r),r=setTimeout(u,e))}return a?.addEventListener("message",l),u(),()=>{n=!0,r&&clearTimeout(r),a?.removeEventListener("message",l),a?.close()}}(e);this.#e=async()=>{t();const s=await e.discoveryApi.getBaseUrl("app");try{await fetch(`${s}/.backstage/auth/v1/cookie`,{method:"DELETE",credentials:"include"})}catch{}}}}var dt=s(1394);function gt({children:e}){const t=(0,I.useApi)(I.appThemeApiRef),s=function(e,t,s){if(void 0!==e){const t=s.find((t=>t.id===e));if(t)return t}if(t){const e=s.find((e=>"dark"===e.variant));if(e)return e}return s.find((e=>"light"===e.variant))||s[0]}((0,dt.A)(t.activeThemeId$(),t.getActiveThemeId()),!!Boolean(window.matchMedia)&&(()=>{const e=(0,n.useMemo)((()=>window.matchMedia("(prefers-color-scheme: dark)")),[]),[t,s]=(0,n.useState)(e.matches);return(0,n.useEffect)((()=>{const t=e=>{s(e.matches)};return e.addListener(t),()=>{e.removeListener(t)}}),[e]),t})(),t.getInstalledThemes());if(!s)throw new Error("App has no themes");return(0,r.jsx)(s.Provider,{children:e})}var ft=s(39907);const mt=async()=>function(e="__APP_INJECTED_RUNTIME_CONFIG__"){const t=new Array,s=ft.env.APP_CONFIG;if(s){if(!Array.isArray(s))throw new Error("Static configuration has invalid format");t.push(...s)}const r=document.querySelectorAll('script[type="backstage.io/config"]');if(r.length>0)for(const e of r)try{const s=e.textContent;if(!s)throw new Error("tag is empty");let r;try{r=JSON.parse(s)}catch(e){throw new Error(`failed to parse config; ${e}`)}if(!Array.isArray(r))throw new Error("data is not an array");t.push(...r)}catch(e){throw new Error(`Failed to load config from script tag, ${e.message}`)}else if(e!=="__app_injected_runtime_config__".toLocaleUpperCase("en-US"))try{const s=JSON.parse(e);Array.isArray(s)?t.push(...s):t.push({data:s,context:"env"})}catch(e){throw new Error(`Failed to load runtime configuration, ${e}`)}const n=window.__APP_CONFIG__;return n&&t.push({context:"window",data:n}),t}();class wt{apis=[];add(e,t){return this.apis.push([e.id,t]),t}build(){return new vt(new Map(this.apis))}}class vt{constructor(e){this.apis=e}static builder(){return new wt}static from(e){return new vt(new Map(e.map((([e,t])=>[e.id,t]))))}static with(e,t){return new vt(new Map([[e.id,t]]))}with(e,t){return new vt(new Map([...this.apis,[e.id,t]]))}get(e){return this.apis.get(e.id)}}const yt="language",St="en";class At{static create(e){const t=e?.availableLanguages??[St];if(t.length!==new Set(t).size)throw new Error(`Supported languages may not contain duplicates, got '${t.join("', '")}'`);if(!t.includes(St))throw new Error(`Supported languages must include '${St}'`);const s=e?.defaultLanguage??St;if(!t.includes(s))throw new Error(`Initial language must be one of the supported languages, got '${s}'`);return new At(t,s)}static createWithStorage(e){const t=At.create(e);if(!window.localStorage)return t;const s=window.localStorage.getItem(yt),{languages:r}=t.getAvailableLanguages();return s&&r.includes(s)&&t.setLanguage(s),t.language$().subscribe((({language:e})=>{e!==window.localStorage.getItem(yt)&&window.localStorage.setItem(yt,e)})),window.addEventListener("storage",(e=>{if(e.key===yt){const e=localStorage.getItem(yt)??void 0;e&&t.setLanguage(e)}})),t}#t;#s;#r;constructor(e,t){this.#t=e,this.#s=t,this.#r=new R({language:this.#s})}getAvailableLanguages(){return{languages:this.#t.slice()}}setLanguage(e){const t=e??St;if(t!==this.#s){if(t&&!this.#t.includes(t))throw new Error(`Failed to change language to '${t}', available languages are '${this.#t.join("', '")}'`);this.#s=t,this.#r.next({language:t})}}getLanguage(){return{language:this.#s}}language$(){return this.#r}}var bt=s(47304);function Rt(e){const t=e;if("@backstage/TranslationRef"!==t.$$type)throw new Error(`Invalid translation ref, bad type '${t.$$type}'`);if("v1"!==t.version)throw new Error(`Invalid translation ref, bad version '${t.version}'`);return t}function It(e){return Object.fromEntries(Object.entries(e).filter((e=>null!==e[1])))}class Et{constructor(e){this.onLoad=e}#n=new Set;#o=new Map;#i=new Map;addTranslationResource(e){const t=function(e){const t=e;if("@backstage/TranslationResource"!==t.$$type)throw new Error(`Invalid translation resource, bad type '${t.$$type}'`);if("v1"!==t.version)throw new Error(`Invalid translation resource, bad version '${t.version}'`);return t}(e);for(const e of t.resources){const s=this.#a(e.language,t.id);this.#i.has(s)||this.#i.set(s,e.loader)}}#a(e,t){return`${e}/${t}`}needsLoading(e,t){const s=this.#a(e,t);return!!this.#i.get(s)&&!this.#n.has(s)}async load(e,t){const s=this.#a(e,t),r=this.#i.get(s);if(!r)return;if(this.#n.has(s))return;const n=this.#o.get(s);if(n)return void await n;const o=r().then((r=>{this.onLoad({language:e,namespace:t,messages:r.messages}),this.#n.add(s)}),(e=>{throw this.#n.add(s),e}));this.#o.set(s,o),await o}}class $t{#c;#u;#l;static fromI18n(e){const t=e.services.interpolator,s=t.format;let r;return t.format=(e,t,n,o)=>t?s(e,t,n,o):r?.(e,t,n,o)??e,new $t(Math.random().toString(36).substring(2,8),(e=>{r=e}))}constructor(e,t){this.#c=t,this.#u=e,this.#l=new RegExp(`\\$${e}\\(([^)]+)\\)`)}wrapT(e){return(t,s)=>{let r;this.#c((e=>{if((0,n.isValidElement)(e)){r||(r=new Map);const t=r.size.toString();return r.set(t,e),`$${this.#u}(${t})`}return e}));const o=e(t,s);if(!r)return o;const i=o.split(this.#l);return(0,n.createElement)(n.Fragment,null,...i.map(((e,t)=>t%2==0?e:r?.get(e))).filter(Boolean))}}}class xt{static create(e){const{languages:t}=e.languageApi.getAvailableLanguages(),s=(0,bt.Q_)({fallbackLng:St,supportedLngs:t,interpolation:{escapeValue:!1,alwaysFormat:!0},ns:[],defaultNS:!1,fallbackNS:!1,initImmediate:!1});if(s.init(),!s.isInitialized)throw new Error("i18next was unexpectedly not initialized");const r=$t.fromI18n(s),{language:n}=e.languageApi.getLanguage();n!==St&&s.changeLanguage(n);const o=new Et((e=>{s.addResourceBundle(e.language,e.namespace,It(e.messages),!1,!0)})),i=e?.resources||[];for(let e=i.length-1;e>=0;e--){const t=i[e];"@backstage/TranslationResource"===t.$$type?o.addTranslationResource(t):"@backstage/TranslationMessages"===t.$$type&&s.addResourceBundle(St,t.id,It(t.messages),!0,!1)}const a=new xt(s,o,e.languageApi.getLanguage().language,r);return e.languageApi.language$().subscribe((({language:e})=>{a.#p(e)})),a}#h;#d;#s;#g;#f=new Set;#m=new Set;constructor(e,t,s,r){this.#h=e,this.#d=t,this.#s=s,this.#g=r}getTranslation(e){const t=Rt(e);return this.#w(t),this.#v(t)}translation$(e){const t=Rt(e);return this.#w(t),new(A())((e=>{let s={};const r=()=>{s={};const r=s;this.#d.load(this.#s,t.id).then((()=>{if(r===s){const s=this.#v(t);s.ready&&e.next(s)}}),(t=>{r===s&&e.error(Array.isArray(t)?t[0]:t)}))},n=()=>{const s=this.#v(t);s.ready?e.next(s):r()};return this.#d.needsLoading(this.#s,t.id)&&r(),this.#m.add(n),()=>{this.#m.delete(n)}}))}#p(e){this.#s!==e&&(this.#s=e,this.#h.changeLanguage(e),this.#m.forEach((e=>e())))}#v(e){if(this.#d.needsLoading(this.#s,e.id))return{ready:!1};const t=this.#h.getFixedT(null,e.id);return{ready:!0,t:this.#g.wrapT(t)}}#w(e){if(this.#f.has(e.id))return;this.#f.add(e.id);const t=e.getDefaultMessages();this.#h.addResourceBundle(St,e.id,t,!0,!1);const s=e.getDefaultResource();s&&this.#d.addTranslationResource(s)}}function jt(e){const t=new URL(e);return t.protocol=document.location.protocol,t.hostname=document.location.hostname,t.port=document.location.port,t.toString().replace(/\/$/,"")}class Pt{constructor(e){this.app=e}getPlugins(){return this.app.getPlugins()}getSystemIcon(e){return this.app.getSystemIcon(e)}getSystemIcons(){return this.app.getSystemIcons()}getComponents(){return this.app.getComponents()}}class Tt{apiHolder;configApi;apis;icons;plugins;featureFlags;components;themes;configLoader;defaultApis;bindRoutes;appLanguageApi;translationResources;appIdentityProxy=new ht;apiFactoryRegistry;constructor(e){this.apis=e.apis??[],this.icons=e.icons,this.plugins=new Set(e.plugins??[]),this.featureFlags=e.featureFlags??[],this.components=e.components,this.themes=e.themes,this.configLoader=e.configLoader??mt,this.defaultApis=e.defaultApis??[],this.bindRoutes=e.bindRoutes,this.apiFactoryRegistry=new d,this.appLanguageApi=At.createWithStorage({defaultLanguage:e.__experimentalTranslations?.defaultLanguage,availableLanguages:e.__experimentalTranslations?.availableLanguages}),this.translationResources=e.__experimentalTranslations?.resources??[]}getPlugins(){return Array.from(this.plugins)}getSystemIcon(e){return this.icons[e]}getSystemIcons(){return this.icons}getComponents(){return this.components}createRoot(e){const t=this.getProvider();return()=>(0,r.jsx)(t,{children:e})}#y=!1;getProvider(){if(this.#y)throw new Error("app.getProvider() or app.createRoot() has already been called, and can only be called once");this.#y=!0;const e=new Pt(this);let t,s;return({children:o})=>{const i=(0,n.useRef)(!0),a=(0,n.useMemo)((()=>pe.createWithStorage(this.themes)),[]),{routing:c,featureFlags:u}=(0,n.useMemo)((()=>{const e=Fe();e&&console.warn("\nDEPRECATION WARNING: React Router Beta is deprecated and support for it will be removed in a future release.\n Please migrate to use React Router v6 stable.\n See https://backstage.io/docs/tutorials/react-router-stable-migration\n");const t=function(e){const t={};for(const s in e.collectors)e.collectors.hasOwnProperty(s)&&(t[s]=e.collectors[s]());const s=[{node:n.Children.toArray(e.root),parent:void 0,contexts:{}}];for(;0!==s.length;){const{node:r,parent:o,contexts:i}=s.shift();n.Children.forEach(r,(r=>{if(!(0,n.isValidElement)(r))return;const a={};for(const e in t)if(t.hasOwnProperty(e)){const s=t[e];a[e]=s.visit(s.accumulator,r,o,i[e])}for(const t of e.discoverers){const e=t(r);e&&s.push({node:e,parent:r,contexts:a})}}))}return Object.fromEntries(Object.entries(t).map((([e,t])=>[e,t.accumulator])))}({root:o,discoverers:[Be,ze],collectors:{routing:e?Xe:Qe,collectedPlugins:Ge,featureFlags:Ye}});return t.collectedPlugins.forEach((e=>this.plugins.add(e))),this.verifyPlugins(this.plugins),this.getApiHolder(),t}),[o]),p=function(e,t,s){const n=Boolean(e),o=(0,qe.A)(e||(()=>Promise.resolve([])));let i;if(n&&o.loading){const{Progress:e}=t;i=(0,r.jsx)(e,{})}else if(o.error){const{BootErrorPage:e}=t;i=(0,r.jsx)(e,{step:"load-config",error:o.error})}const{ThemeProvider:a=gt}=t;return i?{node:(0,r.jsx)(l,{apis:vt.with(I.appThemeApiRef,s),children:(0,r.jsx)(a,{children:i})})}:{api:he.o.fromConfigs(o.value?.length?function(e){const t=he.o.fromConfigs(e),s=t.getOptionalString("app.baseUrl"),r=t.getOptionalString("backend.baseUrl");let n,o,i=e;if(s&&r&&new URL(s).origin===new URL(r).origin){const e=jt(r);r!==e&&(n=e)}if(s){const e=jt(s);s!==e&&(o=e)}return(o||n)&&(i=i.concat({data:{app:o&&{baseUrl:o},backend:n&&{baseUrl:n}},context:"relative-resolver"})),i}(o.value):[])}}(this.configLoader,this.components,a),h="api"in p;if(h){const{api:e}=p;this.configApi=e}if("node"in p)return p.node;if(s)throw s;if(!t)try{t=function(e,t,s){const r=function(e){const t=new Map,s=new Map;for(const r of e){for(const[e,s]of Object.entries(r.routes??{})){const n=`${r.getId()}.${e}`;if(t.has(n))throw new Error(`Unexpected duplicate route '${n}'`);t.set(n,s)}for(const[e,t]of Object.entries(r.externalRoutes??{})){const n=`${r.getId()}.${e}`;if(s.has(n))throw new Error(`Unexpected duplicate external route '${n}'`);s.set(n,t)}}return{routes:t,externalRoutes:s}}(s),n=new Map,o=new Set;e&&e({bind:(e,t)=>{for(const[s,r]of Object.entries(t)){const t=e[s];if(!t)throw new Error(`Key ${s} is not an existing external route`);if(!r&&!t.optional)throw new Error(`External route ${s} is required but was ${!1===r?"disabled":"not provided"}`);r?n.set(t,r):!1===r&&o.add(t)}}});const i=t.getOptionalConfig("app.routes.bindings")?.get();if(i)for(const[e,t]of Object.entries(i)){if(!(!1===(a=t)||"string"==typeof a&&a))throw new Error(`Invalid config at app.routes.bindings['${e}'], value must be a non-empty string or false`);const s=r.externalRoutes.get(e);if(!s)throw new Error(`Invalid config at app.routes.bindings, '${e}' is not a valid external route`);if(!n.has(s)&&!o.has(s))if(!1===t)o.add(s);else{const o=r.routes.get(t);if(!o)throw new Error(`Invalid config at app.routes.bindings['${e}'], '${t}' is not a valid route`);n.set(s,o)}}var a;for(const e of r.externalRoutes.values())if(!n.has(e)&&!o.has(e)){const t="getDefaultTarget"in e?e.getDefaultTarget():void 0;if(t){const s=r.routes.get(t);s&&n.set(e,s)}}return n}(this.bindRoutes,p.api,this.plugins),function(e,t){const s=new Set(t.values());s.delete(void 0);for(const r of t.keys()){if(s.has(r))continue;let n=r,o="";for(;n;){const s=e.get(n);if(void 0===s)throw new Error(`No path for ${n}`);o=st(s,o),n=t.get(n)}const i=o.match(/:(\w+)/g);if(i)for(let e=0;e<i.length;e++)for(let t=e+1;t<i.length;t++)if(i[t]===i[e])throw new Error(`Parameter ${i[t]} is duplicated in path ${o}`)}}(c.paths,c.parents),function(e,t){for(const s of t)if(s.externalRoutes)for(const[t,r]of Object.entries(s.externalRoutes))if(!r.optional&&!e.has(r))throw new Error(`External route '${t}' of the '${s.getId()}' plugin must be bound to a target route. See https://backstage.io/link?bind-routes for details.`)}(t,this.plugins)}catch(e){throw s=e,e}if(h&&i.current){i.current=!1;const e=this.getApiHolder().get(I.featureFlagsApiRef);if(e){for(const t of this.featureFlags)e.registerFlag({...t,pluginId:""});for(const t of this.plugins.values())if("getFeatureFlags"in t)for(const s of t.getFeatureFlags())e.registerFlag({name:s.name,pluginId:t.getId()});else for(const s of t.output())"feature-flag"===s.type&&e.registerFlag({name:s.name,pluginId:t.getId()});const t=e.getRegisteredFlags(),s=new Set(t.map((e=>e.name)));for(const t of u)s.has(t)||e.registerFlag({name:t,pluginId:""})}}const{ThemeProvider:d=gt,Progress:g}=this.components,f=this.getApiHolder();if(function(){const e=document.querySelector('meta[name="backstage-app-mode"]');return"protected"===(e?.getAttribute("content")??"public")}()){const e=f.get(I.errorApiRef),t=f.get(I.fetchApiRef),s=f.get(I.discoveryApiRef);if(!e||!t||!s)throw new Error("App is running in protected mode but missing required APIs");this.appIdentityProxy.enableCookieAuth({errorApi:e,fetchApi:t,discoveryApi:s})}return(0,r.jsx)(l,{apis:f,children:(0,r.jsx)(ut,{appContext:e,children:(0,r.jsx)(d,{children:(0,r.jsx)(at,{routePaths:c.paths,routeParents:c.parents,routeObjects:c.objects,routeBindings:t,basePath:(m=p.api,Fe()?Le(m):""),children:(0,r.jsx)(Te.Provider,{value:{routeObjects:c.objects,appIdentityProxy:this.appIdentityProxy},children:(0,r.jsx)(n.Suspense,{fallback:(0,r.jsx)(g,{}),children:o})})})})})});var m}}getRouter(){return Ue}getApiHolder(){if(this.apiHolder){for(const e of this.plugins)for(const t of e.getApis())this.apiFactoryRegistry.get(t.api)||this.apiFactoryRegistry.register("default",t);return p.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder}this.apiFactoryRegistry.register("static",{api:I.appThemeApiRef,deps:{},factory:()=>pe.createWithStorage(this.themes)}),this.apiFactoryRegistry.register("static",{api:I.configApiRef,deps:{},factory:()=>{if(!this.configApi)throw new Error("Tried to access config API before config was loaded");return this.configApi}}),this.apiFactoryRegistry.register("static",{api:I.identityApiRef,deps:{},factory:()=>this.appIdentityProxy}),this.apiFactoryRegistry.register("static",{api:_e,deps:{},factory:()=>this.appLanguageApi}),this.apiFactoryRegistry.register("default",{api:Ne.J,deps:{languageApi:_e},factory:({languageApi:e})=>xt.create({languageApi:e,resources:this.translationResources})}),this.apiFactoryRegistry.register("default",{api:I.featureFlagsApiRef,deps:{},factory:()=>new Se});for(const e of this.defaultApis)this.apiFactoryRegistry.register("default",e);for(const e of this.plugins)for(const t of e.getApis())if(!this.apiFactoryRegistry.register("default",t))throw new Error(`Plugin ${e.getId()} tried to register duplicate or forbidden API factory for ${t.api}`);for(const e of this.apis)if(!this.apiFactoryRegistry.register("app",e))throw new Error(`Duplicate or forbidden API factory for ${e.api} in app`);return p.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder=new p(this.apiFactoryRegistry),this.apiHolder}verifyPlugins(e){const t=new Set;for(const s of e){const e=s.getId();if(t.has(e))throw new Error(`Duplicate plugin found '${e}'`);t.add(e)}}}function Ct(e){return new Tt(e)}let Ft=!1;const kt=e=>{const t=(0,I.useApp)(),{NotFoundErrorPage:s}=t.getComponents(),o=(0,n.useMemo)((()=>Fe()),[]),i=[...(0,I.useElementFilter)(e.children,(e=>e.getElements().flatMap((e=>{let t=e.props.path;if(""===t)return[];t=t?.replace(/\/\*$/,"")??"/";let s=o?e:e.props.element;return o||s||(s=e,Ft||(console.warn("DEPRECATION WARNING: All elements within <FlatRoutes> must be of type <Route> with an element prop. Existing usages of <Navigate key=[path] to=[to] /> should be replaced with <Route path=[path] element={<Navigate to=[to] />} />."),Ft=!0)),[{path:t,element:s,children:e.props.children?[{path:"/"===t?"/":"*",element:e.props.children}]:void 0}]})).sort(((e,t)=>t.path.localeCompare(e.path))).map((e=>({...e,path:"/"===e.path?"/":`${e.path}/*`}))))),{path:"*",element:(0,r.jsx)(s,{})}];return(0,Ce.useRoutes)(i)};(0,I.attachComponentData)(kt,"core.type","FlatRoutes")},73335:(e,t,s)=>{var r=s(95478),n=Symbol.for("react.element"),o=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function u(e,t,s){var r,o={},u=null,l=null;for(r in void 0!==s&&(u=""+s),void 0!==t.key&&(u=""+t.key),void 0!==t.ref&&(l=t.ref),t)i.call(t,r)&&!c.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===o[r]&&(o[r]=t[r]);return{$$typeof:n,type:e,key:u,ref:l,props:o,_owner:a.current}}t.Fragment=o,t.jsx=u,t.jsxs=u}}]);
3
- //# sourceMappingURL=9286.e13da971.chunk.js.map
3
+ //# sourceMappingURL=9286.0bf88601.chunk.js.map