@ankhorage/atlas 0.19.0 → 0.19.1

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 (103) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +4 -4
  3. package/.next/fallback-build-manifest.json +3 -3
  4. package/.next/prerender-manifest.json +3 -3
  5. package/.next/server/app/_global-error/page/build-manifest.json +1 -1
  6. package/.next/server/app/_global-error/page.js.nft.json +1 -1
  7. package/.next/server/app/_global-error.html +1 -1
  8. package/.next/server/app/_global-error.rsc +1 -1
  9. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  12. package/.next/server/app/_not-found/page/build-manifest.json +1 -1
  13. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  14. package/.next/server/app/_not-found.html +1 -1
  15. package/.next/server/app/_not-found.rsc +1 -1
  16. package/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  17. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  18. package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  19. package/.next/server/app/api/auth/github/callback/route.js +2 -2
  20. package/.next/server/app/api/auth/github/callback/route.js.nft.json +1 -1
  21. package/.next/server/app/api/auth/github/login/route.js +2 -2
  22. package/.next/server/app/api/auth/github/login/route.js.nft.json +1 -1
  23. package/.next/server/app/api/auth/github/logout/route.js +2 -2
  24. package/.next/server/app/api/auth/github/logout/route.js.nft.json +1 -1
  25. package/.next/server/app/api/dependency-graph/route.js.nft.json +1 -1
  26. package/.next/server/app/api/workspace/retry/route.js +3 -3
  27. package/.next/server/app/api/workspace/retry/route.js.nft.json +1 -1
  28. package/.next/server/app/favicon.ico/route.js.nft.json +1 -1
  29. package/.next/server/app/page/build-manifest.json +1 -1
  30. package/.next/server/app/page/server-reference-manifest.json +5 -5
  31. package/.next/server/app/page.js +3 -3
  32. package/.next/server/app/page.js.nft.json +1 -1
  33. package/.next/server/chunks/[externals]__16594cb._.js +3 -0
  34. package/.next/server/chunks/[root-of-the-server]__112op4w._.js +3 -0
  35. package/.next/server/chunks/[root-of-the-server]__112op4w._.js.map +1 -0
  36. package/.next/server/chunks/[root-of-the-server]__1z32dpt._.js +3 -0
  37. package/.next/server/chunks/[root-of-the-server]__1z32dpt._.js.map +1 -0
  38. package/.next/server/chunks/[turbopack]_runtime.js +0 -132
  39. package/.next/server/chunks/[turbopack]_runtime.js.map +4 -5
  40. package/.next/server/chunks/_0clm3_5._.js +3 -0
  41. package/.next/server/chunks/_0clm3_5._.js.map +1 -0
  42. package/.next/server/chunks/_12-q8rr._.js +3 -0
  43. package/.next/server/chunks/_12-q8rr._.js.map +1 -0
  44. package/.next/server/chunks/_1m2ujwq._.js +3 -0
  45. package/.next/server/chunks/_1m2ujwq._.js.map +1 -0
  46. package/.next/server/chunks/_1upfrua._.js +3 -0
  47. package/.next/server/chunks/_1upfrua._.js.map +1 -0
  48. package/.next/server/chunks/ssr/[root-of-the-server]__0_6mxrx._.js +1 -1
  49. package/.next/server/chunks/ssr/[root-of-the-server]__1rpv02p._.js +3 -0
  50. package/.next/server/chunks/ssr/{[root-of-the-server]__1qwwuix._.js.map → [root-of-the-server]__1rpv02p._.js.map} +1 -1
  51. package/.next/server/chunks/ssr/[turbopack]_runtime.js +0 -132
  52. package/.next/server/chunks/ssr/[turbopack]_runtime.js.map +4 -5
  53. package/.next/server/chunks/ssr/{_0itx4l8._.js → _0lahb16._.js} +4 -4
  54. package/.next/server/chunks/ssr/_0lahb16._.js.map +1 -0
  55. package/.next/server/chunks/ssr/{_0jl3v86._.js → _14-yori._.js} +4 -21
  56. package/.next/server/chunks/ssr/_14-yori._.js.map +1 -0
  57. package/.next/server/middleware-build-manifest.js +4 -4
  58. package/.next/server/pages/404.html +1 -1
  59. package/.next/server/pages/500.html +1 -1
  60. package/.next/server/server-reference-manifest.js +1 -1
  61. package/.next/server/server-reference-manifest.json +6 -6
  62. package/.next/static/chunks/turbopack-16xk2dc34e79s.js +1 -0
  63. package/CHANGELOG.md +6 -0
  64. package/README.md +1 -1
  65. package/package.json +1 -3
  66. package/paradox/badges/npm.svg +3 -3
  67. package/paradox/diagrams/architecture-overview.mmd +9 -10
  68. package/paradox/diagrams/export-graph.mmd +2 -3
  69. package/paradox/diagrams/module-relationships.mmd +7 -7
  70. package/paradox/index.html +138 -177
  71. package/paradox/paradox.json +295 -519
  72. package/src/app/api/auth/github/callback/route.ts +5 -8
  73. package/src/app/api/auth/github/login/route.ts +6 -10
  74. package/src/app/api/auth/github/logout/route.ts +5 -2
  75. package/src/features/github-auth/adapters/inbound/next/createGitHubAuthCookieStores.ts +58 -0
  76. package/src/features/github-auth/adapters/inbound/next/createGitHubCallbackRoute.ts +9 -39
  77. package/src/features/github-auth/adapters/inbound/next/createGitHubLogoutRoute.ts +3 -9
  78. package/src/features/github-auth/adapters/inbound/next/githubAuthCookies.ts +102 -14
  79. package/src/features/github-auth/adapters/inbound/next/readGitHubAuthViewAsync.ts +7 -7
  80. package/src/features/github-auth/composition/createGitHubAuthAdapterAsync.ts +23 -48
  81. package/.next/server/chunks/[externals]__047_j9_._.js +0 -3
  82. package/.next/server/chunks/[root-of-the-server]__0kl17_6._.js +0 -3
  83. package/.next/server/chunks/[root-of-the-server]__0kl17_6._.js.map +0 -1
  84. package/.next/server/chunks/[root-of-the-server]__0zc0_9_._.js +0 -3
  85. package/.next/server/chunks/[root-of-the-server]__0zc0_9_._.js.map +0 -1
  86. package/.next/server/chunks/[root-of-the-server]__1-qgr16._.js +0 -3
  87. package/.next/server/chunks/[root-of-the-server]__1-qgr16._.js.map +0 -1
  88. package/.next/server/chunks/_0-0lsnu._.js +0 -3
  89. package/.next/server/chunks/_0-0lsnu._.js.map +0 -1
  90. package/.next/server/chunks/_0fcwlfe._.js +0 -20
  91. package/.next/server/chunks/_0fcwlfe._.js.map +0 -1
  92. package/.next/server/chunks/_0y7dqpe._.js +0 -20
  93. package/.next/server/chunks/_0y7dqpe._.js.map +0 -1
  94. package/.next/server/chunks/ssr/[root-of-the-server]__1qwwuix._.js +0 -3
  95. package/.next/server/chunks/ssr/_0itx4l8._.js.map +0 -1
  96. package/.next/server/chunks/ssr/_0jl3v86._.js.map +0 -1
  97. package/.next/static/chunks/turbopack-07w1w1kq0_rvo.js +0 -1
  98. package/src/features/github-auth/adapters/outbound/postgres/createPostgresGitHubAuthPersistence.ts +0 -235
  99. package/src/features/github-auth/ports/githubAuthPersistence.ts +0 -18
  100. /package/.next/server/chunks/{[externals]__047_j9_._.js.map → [externals]__16594cb._.js.map} +0 -0
  101. /package/.next/static/{jK4WG3twdKtlEqfqG7nM8 → NwI5a9X0nGevMfhoRcBQT}/_buildManifest.js +0 -0
  102. /package/.next/static/{jK4WG3twdKtlEqfqG7nM8 → NwI5a9X0nGevMfhoRcBQT}/_clientMiddlewareManifest.js +0 -0
  103. /package/.next/static/{jK4WG3twdKtlEqfqG7nM8 → NwI5a9X0nGevMfhoRcBQT}/_ssgManifest.js +0 -0
@@ -0,0 +1,3 @@
1
+ module.exports=[13884,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"createDedupedByCallsiteServerErrorLoggerDev",{enumerable:!0,get:function(){return c}});let n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=i(void 0);if(t&&t.has(e))return t.get(e);var r={__proto__:null},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=n?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}return r.default=e,t&&t.set(e,r),r}(e.r(47540));function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(i=function(e){return e?r:t})(e)}let a={current:null},o="function"==typeof n.cache?n.cache:e=>e,s=console.warn;function c(e){return function(...t){s(e(...t))}}o(e=>{try{s(a.current)}finally{a.current=null}})},7460,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"cookies",{enumerable:!0,get:function(){return f}});let n=e.r(30240),i=e.r(472),a=e.r(56704),o=e.r(32319),s=e.r(68665),c=e.r(97573),l=e.r(4642),d=e.r(13884),u=e.r(43824),p=e.r(76414);function f(){let e="cookies",t=a.workAsyncStorage.getStore(),r=o.workUnitAsyncStorage.getStore();if(t){if(r&&!(0,u.isRequestApiAllowedInCurrentPhase)(r))throw Object.defineProperty(Error(`Route ${t.route} used \`cookies()\` inside \`after()\` while rendering. This is not supported. If you need this data inside an \`after()\` callback, use \`cookies()\` outside of the callback. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`),"__NEXT_ERROR_CODE",{value:"E1381",enumerable:!1,configurable:!0});if(t.forceStatic)return m(n.RequestCookiesAdapter.seal(new i.RequestCookies(new Headers({}))));if(t.dynamicShouldError)throw Object.defineProperty(new c.StaticGenBailoutError(`Route ${t.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`cookies()\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E849",enumerable:!1,configurable:!0});if(r)switch(r.type){case"cache":let a=Object.defineProperty(Error(`Route ${t.route} used \`cookies()\` inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \`cookies()\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E831",enumerable:!1,configurable:!0});throw Error.captureStackTrace(a,f),(0,l.applyOwnerStack)(a),t.invalidDynamicUsageError??=a,a;case"unstable-cache":throw Object.defineProperty(Error(`Route ${t.route} used \`cookies()\` inside a function cached with \`unstable_cache()\`. Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \`cookies()\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`),"__NEXT_ERROR_CODE",{value:"E846",enumerable:!1,configurable:!0});case"generate-static-params":throw Object.defineProperty(Error(`Route ${t.route} used \`cookies()\` inside \`generateStaticParams\`. This is not supported because \`generateStaticParams\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`),"__NEXT_ERROR_CODE",{value:"E1123",enumerable:!1,configurable:!0});case"prerender":var d=t,g=r;let o=h.get(g);if(o)return o;let y=(0,l.makeRuntimeHangingPromise)(g.renderSignal,d.route,"`cookies()`",g);return h.set(g,y),y;case"prerender-client":case"validation-client":let b="`cookies`";throw Object.defineProperty(new p.InvariantError(`${b} must not be used within a Client Component. Next.js should be preventing ${b} from being included in Client Components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E1037",enumerable:!1,configurable:!0});case"prerender-ppr":return(0,s.postponeWithTracking)(t.route,e,r.dynamicTracking);case"prerender-legacy":return(0,s.throwToInterruptStaticGeneration)(e,t,r);case"prerender-runtime":{let{stagedRendering:e}=r;if(e)return e.delayUntilStage(l.RENDER_STAGES_BY_DATA_KIND.sessionData,"cookies",r.cookies);return m(r.cookies)}case"private-cache":return m(r.cookies);case"request":let v;if((0,s.trackDynamicDataInDynamicRender)(r),v=(0,n.areCookiesMutableInCurrentPhase)(r)?r.userspaceMutableCookies:r.cookies,!r.asyncApiPromises)return m(v);if(v===r.mutableCookies)return r.asyncApiPromises.mutableCookies;return r.asyncApiPromises.cookies}}(0,o.throwForMissingRequestStore)(e)}let h=new WeakMap;function m(e){let t=h.get(e);if(t)return t;let r=Promise.resolve(e);return h.set(e,r),r}(0,d.createDedupedByCallsiteServerErrorLoggerDev)(function(e,t){let r=e?`Route "${e}" `:"This route ";return Object.defineProperty(Error(`${r}used ${t}. \`cookies()\` returns a Promise and must be unwrapped with \`await\` or \`React.use()\` before accessing its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`),"__NEXT_ERROR_CODE",{value:"E830",enumerable:!1,configurable:!0})})},36052,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={HeadersAdapter:function(){return s},ReadonlyHeadersError:function(){return o}};for(var i in n)Object.defineProperty(r,i,{enumerable:!0,get:n[i]});let a=e.r(30759);class o extends Error{constructor(){super("Headers cannot be modified. Read more: https://nextjs.org/docs/app/api-reference/functions/headers"),Object.defineProperty(this,"__NEXT_ERROR_CODE",{value:"E1176",enumerable:!1,configurable:!0})}static callable(){throw new o}}class s extends Headers{constructor(e){super(),this.headers=new Proxy(e,{get(t,r,n){if("symbol"==typeof r)return a.ReflectAdapter.get(t,r,n);let i=r.toLowerCase(),o=Object.keys(e).find(e=>e.toLowerCase()===i);if(void 0!==o)return a.ReflectAdapter.get(t,o,n)},set(t,r,n,i){if("symbol"==typeof r)return a.ReflectAdapter.set(t,r,n,i);let o=r.toLowerCase(),s=Object.keys(e).find(e=>e.toLowerCase()===o);return a.ReflectAdapter.set(t,s??r,n,i)},has(t,r){if("symbol"==typeof r)return a.ReflectAdapter.has(t,r);let n=r.toLowerCase(),i=Object.keys(e).find(e=>e.toLowerCase()===n);return void 0!==i&&a.ReflectAdapter.has(t,i)},deleteProperty(t,r){if("symbol"==typeof r)return a.ReflectAdapter.deleteProperty(t,r);let n=r.toLowerCase(),i=Object.keys(e).find(e=>e.toLowerCase()===n);return void 0===i||a.ReflectAdapter.deleteProperty(t,i)}})}static seal(e,t){let r,n=t&&t.size>0?e=>t.has(e.toLowerCase()):null,i=new Proxy(e,{get(e,t,n){switch(t){case"append":case"delete":case"set":return o.callable;case Symbol.iterator:return r[Symbol.iterator];case"get":case"has":case"getSetCookie":case"keys":case"values":case"entries":case"forEach":return r[t];default:return a.ReflectAdapter.get(e,t,n)}}});return r=n?function(e,t,r){function*n(){for(let t of e.entries())r(t[0])||(yield t)}return{entries:n,[Symbol.iterator]:n,get:t=>r(t)?null:e.get(t),has:t=>!r(t)&&e.has(t),getSetCookie:()=>r("set-cookie")?[]:e.getSetCookie(),*keys(){for(let t of e.keys())r(t)||(yield t)},*values(){for(let[,e]of n())yield e},forEach(e,r){for(let[i,a]of n())e.call(r,a,i,t)}}}(e,i,n):{get:e.get.bind(e),has:e.has.bind(e),getSetCookie:e.getSetCookie.bind(e),keys:e.keys.bind(e),values:e.values.bind(e),entries:e.entries.bind(e),[Symbol.iterator]:e[Symbol.iterator].bind(e),forEach(t,r){for(let[n,a]of e.entries())t.call(r,a,n,i)}},i}static fresh(e){return new Proxy(e,{get:(e,t,r)=>a.ReflectAdapter.get(e,t,r)})}merge(e){return Array.isArray(e)?e.join(", "):e}static from(e){return e instanceof Headers?e:new s(e)}append(e,t){let r=this.headers[e];"string"==typeof r?this.headers[e]=[r,t]:Array.isArray(r)?r.push(t):this.headers[e]=t}delete(e){delete this.headers[e]}get(e){let t=this.headers[e];return void 0!==t?this.merge(t):null}has(e){return void 0!==this.headers[e]}set(e,t){this.headers[e]=t}forEach(e,t){for(let[r,n]of this.entries())e.call(t,n,r,this)}*entries(){for(let e of Object.keys(this.headers)){let t=e.toLowerCase(),r=this.get(t);yield[t,r]}}*keys(){for(let e of Object.keys(this.headers)){let t=e.toLowerCase();yield t}}*values(){for(let e of Object.keys(this.headers)){let t=this.get(e);yield t}}[Symbol.iterator](){return this.entries()}}},19971,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"headers",{enumerable:!0,get:function(){return p}});let n=e.r(36052),i=e.r(56704),a=e.r(32319),o=e.r(68665),s=e.r(97573),c=e.r(4642),l=e.r(13884),d=e.r(43824),u=e.r(76414);function p(){let e="headers",t=i.workAsyncStorage.getStore(),r=a.workUnitAsyncStorage.getStore();if(t){if(r&&!(0,d.isRequestApiAllowedInCurrentPhase)(r))throw Object.defineProperty(Error(`Route ${t.route} used \`headers()\` inside \`after()\` while rendering. This is not supported. If you need this data inside an \`after()\` callback, use \`headers()\` outside of the callback. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`),"__NEXT_ERROR_CODE",{value:"E1378",enumerable:!1,configurable:!0});if(t.forceStatic)return h(n.HeadersAdapter.seal(new Headers({})));if(r)switch(r.type){case"cache":{let e=Object.defineProperty(Error(`Route ${t.route} used \`headers()\` inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \`headers()\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E833",enumerable:!1,configurable:!0});throw Error.captureStackTrace(e,p),(0,c.applyOwnerStack)(e),t.invalidDynamicUsageError??=e,e}case"unstable-cache":throw Object.defineProperty(Error(`Route ${t.route} used \`headers()\` inside a function cached with \`unstable_cache()\`. Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \`headers()\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`),"__NEXT_ERROR_CODE",{value:"E838",enumerable:!1,configurable:!0});case"generate-static-params":throw Object.defineProperty(Error(`Route ${t.route} used \`headers()\` inside \`generateStaticParams\`. This is not supported because \`generateStaticParams\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`),"__NEXT_ERROR_CODE",{value:"E1134",enumerable:!1,configurable:!0})}if(t.dynamicShouldError)throw Object.defineProperty(new s.StaticGenBailoutError(`Route ${t.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`headers()\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E828",enumerable:!1,configurable:!0});if(r)switch(r.type){case"prerender":var l=t,m=r;let i=f.get(m);if(i)return i;let a=(0,c.makeRuntimeHangingPromise)(m.renderSignal,l.route,"`headers()`",m);return f.set(m,a),a;case"prerender-client":case"validation-client":let g="`headers`";throw Object.defineProperty(new u.InvariantError(`${g} must not be used within a client component. Next.js should be preventing ${g} from being included in client components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E1017",enumerable:!1,configurable:!0});case"prerender-ppr":return(0,o.postponeWithTracking)(t.route,e,r.dynamicTracking);case"prerender-legacy":return(0,o.throwToInterruptStaticGeneration)(e,t,r);case"prerender-runtime":{let{stagedRendering:e}=r;if(e)return e.delayUntilStage(c.RENDER_STAGES_BY_DATA_KIND.sessionData,"headers",r.headers);return h(r.headers)}case"private-cache":return h(r.headers);case"request":if((0,o.trackDynamicDataInDynamicRender)(r),r.asyncApiPromises)return r.asyncApiPromises.headers;return h(r.headers)}}(0,a.throwForMissingRequestStore)(e)}let f=new WeakMap;function h(e){let t=f.get(e);if(t)return t;let r=Promise.resolve(e);return f.set(e,r),r}(0,l.createDedupedByCallsiteServerErrorLoggerDev)(function(e,t){let r=e?`Route "${e}" `:"This route ";return Object.defineProperty(Error(`${r}used ${t}. \`headers()\` returns a Promise and must be unwrapped with \`await\` or \`React.use()\` before accessing its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`),"__NEXT_ERROR_CODE",{value:"E836",enumerable:!1,configurable:!0})})},21423,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"draftMode",{enumerable:!0,get:function(){return u}});let n=e.r(32319),i=e.r(56704),a=e.r(68665),o=e.r(13884),s=e.r(97573),c=e.r(65252),l=e.r(76414);e.r(30759);let d=e.r(4642);function u(){let e="draftMode",t=i.workAsyncStorage.getStore(),r=n.workUnitAsyncStorage.getStore();switch((!t||!r)&&(0,n.throwForMissingRequestStore)(e),r.type){case"prerender-runtime":{let{stagedRendering:e}=r;if(e)return e.delayUntilStage(d.RENDER_STAGES_BY_DATA_KIND.sessionData,"draftMode",new m(r.draftMode));return p(r.draftMode,t)}case"request":return p(r.draftMode,t);case"cache":case"private-cache":case"unstable-cache":let a=(0,n.getDraftModeProviderForCacheScope)(t,r);if(a)return p(a,t);case"prerender":case"prerender-ppr":case"prerender-legacy":return p(null,t);case"prerender-client":case"validation-client":{let e="`draftMode`";throw Object.defineProperty(new l.InvariantError(`${e} must not be used within a Client Component. Next.js should be preventing ${e} from being included in Client Components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E1046",enumerable:!1,configurable:!0})}case"generate-static-params":throw Object.defineProperty(Error(`Route ${t.route} used \`${e}()\` inside \`generateStaticParams\`. This is not supported because \`generateStaticParams\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`),"__NEXT_ERROR_CODE",{value:"E1132",enumerable:!1,configurable:!0});default:return r}}function p(e,t){let r=h.get(e??f);return r||Promise.resolve(new m(e))}let f={},h=new WeakMap;class m{constructor(e){this._provider=e}get isEnabled(){return null!==this._provider&&this._provider.isEnabled}enable(){g("draftMode().enable()",this.enable),null!==this._provider&&this._provider.enable()}disable(){g("draftMode().disable()",this.disable),null!==this._provider&&this._provider.disable()}}function g(e,t){let r=i.workAsyncStorage.getStore(),o=n.workUnitAsyncStorage.getStore();if(r){if((null==o?void 0:o.phase)==="after")throw Object.defineProperty(Error(`Route ${r.route} used "${e}" inside \`after()\`. The enabled status of \`draftMode()\` can be read inside \`after()\` but you cannot enable or disable \`draftMode()\`. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`),"__NEXT_ERROR_CODE",{value:"E845",enumerable:!1,configurable:!0});if(r.dynamicShouldError)throw Object.defineProperty(new s.StaticGenBailoutError(`Route ${r.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${e}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E553",enumerable:!1,configurable:!0});if(o)switch(o.type){case"cache":case"private-cache":{let n=Object.defineProperty(Error(`Route ${r.route} used "${e}" inside "use cache". The enabled status of \`draftMode()\` can be read in caches but you must not enable or disable \`draftMode()\` inside a cache. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E829",enumerable:!1,configurable:!0});throw Error.captureStackTrace(n,t),(0,d.applyOwnerStack)(n),r.invalidDynamicUsageError??=n,n}case"unstable-cache":throw Object.defineProperty(Error(`Route ${r.route} used "${e}" inside a function cached with \`unstable_cache()\`. The enabled status of \`draftMode()\` can be read in caches but you must not enable or disable \`draftMode()\` inside a cache. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`),"__NEXT_ERROR_CODE",{value:"E844",enumerable:!1,configurable:!0});case"prerender":case"prerender-runtime":{let t=Object.defineProperty(Error(`Route ${r.route} used ${e} without first calling \`await connection()\`. See more info here: https://nextjs.org/docs/messages/next-prerender-sync-headers`),"__NEXT_ERROR_CODE",{value:"E126",enumerable:!1,configurable:!0});return(0,a.abortAndThrowOnSynchronousRequestDataAccess)(r.route,e,t,o)}case"prerender-client":case"validation-client":let n="`draftMode`";throw Object.defineProperty(new l.InvariantError(`${n} must not be used within a Client Component. Next.js should be preventing ${n} from being included in Client Components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E1046",enumerable:!1,configurable:!0});case"prerender-ppr":return(0,a.postponeWithTracking)(r.route,e,o.dynamicTracking);case"prerender-legacy":o.revalidate=0;let i=Object.defineProperty(new c.DynamicServerError(`Route ${r.route} couldn't be rendered statically because it used \`${e}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`),"__NEXT_ERROR_CODE",{value:"E558",enumerable:!1,configurable:!0});throw r.dynamicUsageDescription=e,r.dynamicUsageStack=i.stack,i;case"request":(0,a.trackDynamicDataInDynamicRender)(o);break;case"generate-static-params":throw Object.defineProperty(Error(`Route ${r.route} used \`${e}\` inside \`generateStaticParams\`. This is not supported because \`generateStaticParams\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`),"__NEXT_ERROR_CODE",{value:"E1121",enumerable:!1,configurable:!0})}}}(0,o.createDedupedByCallsiteServerErrorLoggerDev)(function(e,t){let r=e?`Route "${e}" `:"This route ";return Object.defineProperty(Error(`${r}used ${t}. \`draftMode()\` returns a Promise and must be unwrapped with \`await\` or \`React.use()\` before accessing its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`),"__NEXT_ERROR_CODE",{value:"E835",enumerable:!1,configurable:!0})})},93458,(e,t,r)=>{t.exports.cookies=e.r(7460).cookies,t.exports.headers=e.r(19971).headers,t.exports.draftMode=e.r(21423).draftMode},17374,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={ActionDidNotRevalidate:function(){return a},ActionDidRevalidateDynamicOnly:function(){return s},ActionDidRevalidateStaticAndDynamic:function(){return o}};for(var i in n)Object.defineProperty(r,i,{enumerable:!0,get:n[i]});let a=0,o=1,s=2},30240,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={MutableRequestCookiesAdapter:function(){return h},ReadonlyRequestCookiesError:function(){return l},RequestCookiesAdapter:function(){return d},appendMutableCookies:function(){return f},areCookiesMutableInCurrentPhase:function(){return g},createCookiesWithMutableAccessCheck:function(){return m},getModifiedCookieValues:function(){return p},responseCookiesToRequestCookies:function(){return b}};for(var i in n)Object.defineProperty(r,i,{enumerable:!0,get:n[i]});let a=e.r(472),o=e.r(30759),s=e.r(56704),c=e.r(17374);class l extends Error{constructor(){super("Cookies can only be modified in a Server Action or Route Handler. Read more: https://nextjs.org/docs/app/api-reference/functions/cookies#options"),Object.defineProperty(this,"__NEXT_ERROR_CODE",{value:"E1180",enumerable:!1,configurable:!0})}static callable(){throw new l}}class d{static seal(e){return new Proxy(e,{get(e,t,r){switch(t){case"clear":case"delete":case"set":return l.callable;default:return o.ReflectAdapter.get(e,t,r)}}})}static fresh(e){return new Proxy(e,{get:(e,t,r)=>o.ReflectAdapter.get(e,t,r)})}}let u=Symbol.for("next.mutated.cookies");function p(e){let t=e[u];return t&&Array.isArray(t)&&0!==t.length?t:[]}function f(e,t){let r=p(t);if(0===r.length)return!1;let n=new a.ResponseCookies(e),i=n.getAll();for(let e of r)n.set(e);for(let e of i)n.set(e);return!0}class h{static wrap(e,t){let r=new a.ResponseCookies(new Headers);for(let t of e.getAll())r.set(t);let n=[],i=new Set,l=()=>{let e=s.workAsyncStorage.getStore();if(e&&(e.pathWasRevalidated=c.ActionDidRevalidateStaticAndDynamic),n=r.getAll().filter(e=>i.has(e.name)),t){let e=[];for(let t of n){let r=new a.ResponseCookies(new Headers);r.set(t),e.push(r.toString())}t(e)}},d=new Proxy(r,{get(e,t,r){switch(t){case u:return n;case"delete":return function(...t){i.add("string"==typeof t[0]?t[0]:t[0].name);try{return e.delete(...t),d}finally{l()}};case"set":return function(...t){i.add("string"==typeof t[0]?t[0]:t[0].name);try{return e.set(...t),d}finally{l()}};default:return o.ReflectAdapter.get(e,t,r)}}});return d}}function m(e){let t=new Proxy(e.mutableCookies,{get(r,n,i){switch(n){case"delete":return function(...n){return y(e,"cookies().delete"),r.delete(...n),t};case"set":return function(...n){return y(e,"cookies().set"),r.set(...n),t};default:return o.ReflectAdapter.get(r,n,i)}}});return t}function g(e){return"action"===e.phase}function y(e,t){if(!g(e))throw new l}function b(e){let t=new a.RequestCookies(new Headers);for(let r of e.getAll())t.set(r);return t}},13090,(e,t,r)=>{function n(){this.pending=0,this.max=1/0,this.listeners=[],this.waiting=[],this.error=null}function i(e){e.pending+=1;var t=!1;return function(n){if(t)throw Error("callback called twice");if(t=!0,e.error=e.error||n,e.pending-=1,e.waiting.length>0&&e.pending<e.max){var a;a=e,e.waiting.shift()(i(a))}else if(0===e.pending){var o=e.listeners;e.listeners=[],o.forEach(r)}};function r(t){t(e.error)}}t.exports=n,n.prototype.go=function(e){var t;this.pending<this.max?(t=this,e(i(t))):this.waiting.push(e)},n.prototype.wait=function(e){0===this.pending?e(this.error):this.listeners.push(e)},n.prototype.hold=function(){return i(this)}},17805,(e,t,r)=>{var n=e.r(22734),i=e.r(24361),a=e.r(88947),o=a.Readable,s=a.PassThrough,c=e.r(13090),l=e.r(27699).EventEmitter;function d(e){l.call(this),this.fd=e,this.pend=new c,this.pend.max=1,this.refCount=0}function u(e,t){t=t||{},o.call(this,t),this.context=e,this.context.ref(),this.start=t.start||0,this.endOffset=t.end,this.pos=this.start}function p(e){l.call(this),this.refCount=0,this.buffer=e}r.BufferSlicer=p,r.FdSlicer=d,i.inherits(d,l),d.prototype.read=function(e,t,r,i,a){var o=this;o.pend.go(function(s){n.read(o.fd,e,t,r,i,function(e,t,r){s(),a(e,t,r)})})},d.prototype.createReadStream=function(e){return new u(this,e)},d.prototype.ref=function(){this.refCount+=1},d.prototype.unref=function(){var e=this;if(e.refCount-=1,e.refCount<0)throw Error("invalid unref");e.refCount>0||n.close(e.fd,function(t){t?e.emit("error",t):e.emit("close")})},i.inherits(u,o),u.prototype._read=function(e){var t=this,r=Math.min(t._readableState.highWaterMark,e);if(null!=t.endOffset&&(r=Math.min(r,t.endOffset-t.pos)),r<=0){t.push(null),this._cleanup();return}t.context.pend.go(function(e){var i=Buffer.allocUnsafe(r);n.read(t.context.fd,i,0,r,t.pos,function(r,n){r?t.destroy(r):0===n?(t.push(null),t._cleanup()):(t.pos+=n,t.push(i.slice(0,n))),e()})})},u.prototype._destroy=function(e,t){this._cleanup(),t(e)},u.prototype._cleanup=function(){null!=this.context&&(this.context.unref(),this.context=null)},i.inherits(p,l),p.prototype.read=function(e,t,r,n,i){if(!(0<=t&&t<=e.length))throw RangeError("offset outside buffer: 0 <= "+t+" <= "+e.length);if(n<0)throw RangeError("position is negative: "+n);(t+r>e.length&&(r=e.length-t),n+r>this.buffer.length&&(r=this.buffer.length-n),r<=0)?setImmediate(function(){i(null,0)}):(this.buffer.copy(e,t,n,n+r),setImmediate(function(){i(null,r)}))},p.prototype.createReadStream=function(e){var t=new s(e=e||{});t.start=e.start||0,t.endOffset=e.end,t.pos=t.endOffset||this.buffer.length;for(var r=this.buffer.slice(t.start,t.pos),n=0;;){var i=n+65536;if(i>=r.length){n<r.length&&t.write(r.slice(n,r.length));break}t.write(r.slice(n,i)),n=i}return t.end(),t},p.prototype.ref=function(){this.refCount+=1},p.prototype.unref=function(){if(this.refCount-=1,this.refCount<0)throw Error("invalid unref")}},63374,(e,t,r)=>{let n=new Int32Array([0,0x77073096,0xee0e612c,0x990951ba,0x76dc419,0x706af48f,0xe963a535,0x9e6495a3,0xedb8832,0x79dcb8a4,0xe0d5e91e,0x97d2d988,0x9b64c2b,0x7eb17cbd,0xe7b82d07,0x90bf1d91,0x1db71064,0x6ab020f2,0xf3b97148,0x84be41de,0x1adad47d,0x6ddde4eb,0xf4d4b551,0x83d385c7,0x136c9856,0x646ba8c0,0xfd62f97a,0x8a65c9ec,0x14015c4f,0x63066cd9,0xfa0f3d63,0x8d080df5,0x3b6e20c8,0x4c69105e,0xd56041e4,0xa2677172,0x3c03e4d1,0x4b04d447,0xd20d85fd,0xa50ab56b,0x35b5a8fa,0x42b2986c,0xdbbbc9d6,0xacbcf940,0x32d86ce3,0x45df5c75,0xdcd60dcf,0xabd13d59,0x26d930ac,0x51de003a,0xc8d75180,0xbfd06116,0x21b4f4b5,0x56b3c423,0xcfba9599,0xb8bda50f,0x2802b89e,0x5f058808,0xc60cd9b2,0xb10be924,0x2f6f7c87,0x58684c11,0xc1611dab,0xb6662d3d,0x76dc4190,0x1db7106,0x98d220bc,0xefd5102a,0x71b18589,0x6b6b51f,0x9fbfe4a5,0xe8b8d433,0x7807c9a2,0xf00f934,0x9609a88e,0xe10e9818,0x7f6a0dbb,0x86d3d2d,0x91646c97,0xe6635c01,0x6b6b51f4,0x1c6c6162,0x856530d8,0xf262004e,0x6c0695ed,0x1b01a57b,0x8208f4c1,0xf50fc457,0x65b0d9c6,0x12b7e950,0x8bbeb8ea,0xfcb9887c,0x62dd1ddf,0x15da2d49,0x8cd37cf3,0xfbd44c65,0x4db26158,0x3ab551ce,0xa3bc0074,0xd4bb30e2,0x4adfa541,0x3dd895d7,0xa4d1c46d,0xd3d6f4fb,0x4369e96a,0x346ed9fc,0xad678846,0xda60b8d0,0x44042d73,0x33031de5,0xaa0a4c5f,0xdd0d7cc9,0x5005713c,0x270241aa,0xbe0b1010,0xc90c2086,0x5768b525,0x206f85b3,0xb966d409,0xce61e49f,0x5edef90e,0x29d9c998,0xb0d09822,0xc7d7a8b4,0x59b33d17,0x2eb40d81,0xb7bd5c3b,0xc0ba6cad,0xedb88320,0x9abfb3b6,0x3b6e20c,0x74b1d29a,0xead54739,0x9dd277af,0x4db2615,0x73dc1683,0xe3630b12,0x94643b84,0xd6d6a3e,0x7a6a5aa8,0xe40ecf0b,0x9309ff9d,0xa00ae27,0x7d079eb1,0xf00f9344,0x8708a3d2,0x1e01f268,0x6906c2fe,0xf762575d,0x806567cb,0x196c3671,0x6e6b06e7,0xfed41b76,0x89d32be0,0x10da7a5a,0x67dd4acc,0xf9b9df6f,0x8ebeeff9,0x17b7be43,0x60b08ed5,0xd6d6a3e8,0xa1d1937e,0x38d8c2c4,0x4fdff252,0xd1bb67f1,0xa6bc5767,0x3fb506dd,0x48b2364b,0xd80d2bda,0xaf0a1b4c,0x36034af6,0x41047a60,0xdf60efc3,0xa867df55,0x316e8eef,0x4669be79,0xcb61b38c,0xbc66831a,0x256fd2a0,0x5268e236,0xcc0c7795,0xbb0b4703,0x220216b9,0x5505262f,0xc5ba3bbe,0xb2bd0b28,0x2bb45a92,0x5cb36a04,0xc2d7ffa7,0xb5d0cf31,0x2cd99e8b,0x5bdeae1d,0x9b64c2b0,0xec63f226,0x756aa39c,0x26d930a,0x9c0906a9,0xeb0e363f,0x72076785,0x5005713,0x95bf4a82,0xe2b87a14,0x7bb12bae,0xcb61b38,0x92d28e9b,0xe5d5be0d,0x7cdcefb7,0xbdbdf21,0x86d3d2d4,0xf1d4e242,0x68ddb3f8,0x1fda836e,0x81be16cd,0xf6b9265b,0x6fb077e1,0x18b74777,0x88085ae6,0xff0f6a70,0x66063bca,0x11010b5c,0x8f659eff,0xf862ae69,0x616bffd3,0x166ccf45,0xa00ae278,0xd70dd2ee,0x4e048354,0x3903b3c2,0xa7672661,0xd06016f7,0x4969474d,0x3e6e77db,0xaed16a4a,0xd9d65adc,0x40df0b66,936918e3,0xa9bcae53,0xdebb9ec5,0x47b2cf7f,0x30b5ffe9,0xbdbdf21c,0xcabac28a,0x53b39330,0x24b4a3a6,0xbad03605,0xcdd70693,0x54de5729,0x23d967bf,0xb3667a2e,0xc4614ab8,0x5d681b02,0x2a6f2b94,0xb40bbe37,0xc30c8ea1,0x5a05df1b,0x2d02ef8d]);t.exports=function(e){let t=-1;for(let r of e)t=n[(t^r)&255]^t>>>8;return(-1^t)>>>0}},73228,(e,t,r)=>{var n,i=e.r(22734),a=e.r(6461),o=e.r(17805),s=e.r(24361),c=e.r(27699).EventEmitter,l=e.r(88947).Transform,d=e.r(88947).PassThrough,u=e.r(88947).Writable;let p="function"==typeof a.crc32?a.crc32:e.r(63374);function f(e,t,r){"function"==typeof t&&(r=t,t=null),null==t&&(t={}),null==t.autoClose&&(t.autoClose=!0),null==t.lazyEntries&&(t.lazyEntries=!1),null==t.decodeStrings&&(t.decodeStrings=!0),null==t.validateEntrySizes&&(t.validateEntrySizes=!0),null==t.strictFileNames&&(t.strictFileNames=!1),null==r&&(r=M),i.open(e,"r",function(e,n){if(e)return r(e);h(n,t,function(e,t){e&&i.close(n,M),r(e,t)})})}function h(e,t,r){"function"==typeof t&&(r=t,t=null),null==t&&(t={}),null==t.autoClose&&(t.autoClose=!1),null==t.lazyEntries&&(t.lazyEntries=!1),null==t.decodeStrings&&(t.decodeStrings=!0),null==t.validateEntrySizes&&(t.validateEntrySizes=!0),null==t.strictFileNames&&(t.strictFileNames=!1),null==r&&(r=M),i.fstat(e,function(n,i){if(n)return r(n);g(new o.FdSlicer(e),i.size,t,r)})}function m(e,t,r){"function"==typeof t&&(r=t,t=null),null==t&&(t={}),t.autoClose=!1,null==t.lazyEntries&&(t.lazyEntries=!1),null==t.decodeStrings&&(t.decodeStrings=!0),null==t.validateEntrySizes&&(t.validateEntrySizes=!0),null==t.strictFileNames&&(t.strictFileNames=!1),g(new o.BufferSlicer(e),e.length,t,r)}function g(e,t,r,i){"function"==typeof r&&(i=r,r=null),null==r&&(r={}),null==r.autoClose&&(r.autoClose=!0),null==r.lazyEntries&&(r.lazyEntries=!1),null==r.decodeStrings&&(r.decodeStrings=!0);var a=!!r.decodeStrings;if(null==r.validateEntrySizes&&(r.validateEntrySizes=!0),null==r.strictFileNames&&(r.strictFileNames=!1),null==i&&(i=M),"number"!=typeof t)throw Error("expected totalSize parameter to be a number");if(t>Number.MAX_SAFE_INTEGER)throw Error("zip file too large. only file sizes up to 2^52 are supported due to JavaScript's Number type being an IEEE 754 double.");e.ref();var o=Math.min(65577,t),s=n(o),c=t-s.length;A(e,s,0,o,c,function(c){if(c)return i(c);for(var l=o-22;l>=0;l-=1)if(0x6054b50===s.readUInt32LE(l)){var d=s.subarray(l),u=d.readUInt16LE(4),p=d.readUInt16LE(10),f=d.readUInt32LE(16),h=d.readUInt16LE(20),m=d.length-22;if(h!==m)return i(Error("Invalid comment length. Expected: "+m+". Found: "+h+". Are there extra bytes at the end of the file? Or is the end of central dir signature `PK☺☻` in the comment?"));var g=a?O(d.subarray(22),!1):d.subarray(22);if(l-20>=0&&0x7064b50===s.readUInt32LE(l-20)){var b=_(s.subarray(l-20,l-20+20),8),v=n(56);return A(e,v,0,v.length,b,function(n){return n?i(n):0x6064b50!==v.readUInt32LE(0)?i(Error("invalid zip64 end of central directory record signature")):0!==(u=v.readUInt32LE(16))?i(Error("multi-disk zip files are not supported: found disk number: "+u)):(p=_(v,32),f=_(v,48),i(null,new y(e,f,t,p,g,r.autoClose,r.lazyEntries,a,r.validateEntrySizes,r.strictFileNames)))})}if(0!==u)return i(Error("multi-disk zip files are not supported: found disk number: "+u));return i(null,new y(e,f,t,p,g,r.autoClose,r.lazyEntries,a,r.validateEntrySizes,r.strictFileNames))}i(Error("End of central directory record signature not found. Either not a zip file, or file is truncated."))})}function y(e,t,r,n,i,a,o,s,l,d){var u=this;c.call(u),u.reader=e,u.reader.on("error",function(e){v(u,e)}),u.reader.once("close",function(){u.emit("close")}),u.readEntryCursor=t,u.fileSize=r,u.entryCount=n,u.comment=i,u.entriesRead=0,u.autoClose=!!a,u.lazyEntries=!!o,u.decodeStrings=!!s,u.validateEntrySizes=!!l,u.strictFileNames=!!d,u.isOpen=!0,u.emittedError=!1,u.hasEachEntryBeenCalled=!1,u.lazyEntries||u._readEntry()}function b(e,t){e.autoClose&&e.close(),v(e,t)}function v(e,t){e.emittedError||(e.emittedError=!0,e.emit("error",t))}function w(){}function E(){}function x(e,t,r){var n=31&e,i=(e>>5&15)-1,a=(e>>9&127)+1980,o=(31&t)*2,s=t>>5&63,c=t>>11&31;if(null==r||"local"===r)return new Date(a,i,n,c,s,o,0);if("UTC"===r)return new Date(Date.UTC(a,i,n,c,s,o,0));throw Error("unrecognized options.timezone: "+options.timezone)}function R(e,t,r,n){for(var i=null,a=0;a<r.length;a++){var o=r[a];if(28789===o.id){if(o.data.length<6||1!==o.data.readUInt8(0))continue;var s=o.data.readUInt32LE(1);if(p(t)!==s)continue;i=O(o.data.subarray(5),!0);break}}return null==i&&(i=O(t,(2048&e)!=0)),n||(i=i.replace(/\\/g,"/")),i}function k(e){return -1!==e.indexOf("\\")?"invalid characters in fileName: "+e:/^[a-zA-Z]:/.test(e)||/^\//.test(e)?"absolute path: "+e:-1!==e.split("/").indexOf("..")?"invalid relative path: "+e:null}function S(e){for(var t=[],r=0;r<e.length-3;){var n=e.readUInt16LE(r+0),i=e.readUInt16LE(r+2),a=r+4,o=a+i;if(o>e.length)throw Error("extra field length exceeds extra field buffer size");var s=e.subarray(a,o);t.push({id:n,data:s}),r=o}return t}function A(e,t,r,i,a,o){if(0===i)return setImmediate(function(){o(null,n(0))});e.read(t,r,i,a,function(e,t){return e?o(e):t<i?o(Error("unexpected EOF")):void o()})}function I(e){l.call(this),this.actualByteCount=0,this.expectedByteCount=e}function P(){c.call(this),this.refCount=0}function C(e){d.call(this),this.context=e,this.context.ref(),this.unreffedYet=!1}function O(e,t){if(t)return e.toString("utf8");for(var r="",n=0;n<e.length;n++)r+="\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "[e[n]];return r}function _(e,t){var r=e.readUInt32LE(t);return 0x100000000*e.readUInt32LE(t+4)+r}function j(e,t){"function"==typeof e.destroy?e._destroy=function(e,r){t(),null!=r&&r(e)}:e.destroy=t}function M(e){if(e)throw e}r.open=f,r.fromFd=h,r.fromBuffer=m,r.fromRandomAccessReader=g,r.openPromise=function(e,t){return new Promise((r,n)=>{f(e,{...t,lazyEntries:!0},function(e,t){if(e)return n(e);r(t)})})},r.fromFdPromise=function(e,t){return new Promise((r,n)=>{h(e,{...t,lazyEntries:!0},function(e,t){if(e)return n(e);r(t)})})},r.fromBufferPromise=function(e,t){return new Promise((r,n)=>{m(e,{...t,lazyEntries:!0},function(e,t){if(e)return n(e);r(t)})})},r.fromRandomAccessReaderPromise=function(e,t,r){return new Promise((n,i)=>{g(e,t,{...r,lazyEntries:!0},function(e,t){if(e)return i(e);n(t)})})},r.dosDateTimeToDate=x,r.getFileNameLowLevel=R,r.validateFileName=k,r.parseExtraFields=S,r.ZipFile=y,r.Entry=w,r.LocalFileHeader=E,r.RandomAccessReader=P,s.inherits(y,c),y.prototype.close=function(){this.isOpen&&(this.isOpen=!1,this.reader.unref())},y.prototype.readEntry=function(){if(!this.lazyEntries)throw Error("readEntry() called without lazyEntries:true");this._readEntry()},y.prototype._readEntry=function(){var e=this;if(e.entryCount===e.entriesRead)return void setImmediate(function(){e.autoClose&&e.close(),e.emittedError||e.emit("end")});if(!e.emittedError){var t=n(46);A(e.reader,t,0,t.length,e.readEntryCursor,function(r){if(r)return b(e,r);if(!e.emittedError){var i=new w,a=t.readUInt32LE(0);if(0x2014b50!==a)return b(e,Error("invalid central directory file header signature: 0x"+a.toString(16)));if(i.versionMadeBy=t.readUInt16LE(4),i.versionNeededToExtract=t.readUInt16LE(6),i.generalPurposeBitFlag=t.readUInt16LE(8),i.compressionMethod=t.readUInt16LE(10),i.lastModFileTime=t.readUInt16LE(12),i.lastModFileDate=t.readUInt16LE(14),i.crc32=t.readUInt32LE(16),i.compressedSize=t.readUInt32LE(20),i.uncompressedSize=t.readUInt32LE(24),i.fileNameLength=t.readUInt16LE(28),i.extraFieldLength=t.readUInt16LE(30),i.fileCommentLength=t.readUInt16LE(32),i.internalFileAttributes=t.readUInt16LE(36),i.externalFileAttributes=t.readUInt32LE(38),i.relativeOffsetOfLocalHeader=t.readUInt32LE(42),64&i.generalPurposeBitFlag)return b(e,Error("strong encryption is not supported"));e.readEntryCursor+=46,t=n(i.fileNameLength+i.extraFieldLength+i.fileCommentLength),A(e.reader,t,0,t.length,e.readEntryCursor,function(r){if(r)return b(e,r);if(!e.emittedError){i.fileNameRaw=t.subarray(0,i.fileNameLength);var n=i.fileNameLength+i.extraFieldLength;i.extraFieldRaw=t.subarray(i.fileNameLength,n),i.fileCommentRaw=t.subarray(n,n+i.fileCommentLength);try{i.extraFields=S(i.extraFieldRaw)}catch(t){return b(e,t)}if(e.decodeStrings){var a=(2048&i.generalPurposeBitFlag)!=0;i.fileComment=O(i.fileCommentRaw,a),i.fileName=R(i.generalPurposeBitFlag,i.fileNameRaw,i.extraFields,e.strictFileNames);var o=k(i.fileName);if(null!=o)return b(e,Error(o))}else i.fileComment=i.fileCommentRaw,i.fileName=i.fileNameRaw;i.comment=i.fileComment,e.readEntryCursor+=t.length,e.entriesRead+=1;for(var s=0;s<i.extraFields.length;s++){var c=i.extraFields[s];if(1===c.id){var l=c.data,d=0;if(0xffffffff===i.uncompressedSize){if(d+8>l.length)return b(e,Error("zip64 extended information extra field does not include uncompressed size"));i.uncompressedSize=_(l,d),d+=8}if(0xffffffff===i.compressedSize){if(d+8>l.length)return b(e,Error("zip64 extended information extra field does not include compressed size"));i.compressedSize=_(l,d),d+=8}if(0xffffffff===i.relativeOffsetOfLocalHeader){if(d+8>l.length)return b(e,Error("zip64 extended information extra field does not include relative header offset"));i.relativeOffsetOfLocalHeader=_(l,d),d+=8}break}}if(e.validateEntrySizes&&0===i.compressionMethod){var u=i.uncompressedSize;if(i.isEncrypted()&&(u+=12),i.compressedSize!==u)return b(e,Error("compressed/uncompressed size mismatch for stored file: "+i.compressedSize+" != "+i.uncompressedSize))}e.emit("entry",i),e.lazyEntries||e._readEntry()}})}})}},y.prototype.eachEntry=function(){let e=this;if(!e.lazyEntries)throw Error("eachEntry() requires lazyEntries: true");if(e.hasEachEntryBeenCalled)throw Error("eachEntry() must only be called once per ZipFile");e.hasEachEntryBeenCalled=!0;let t=null;function r(){e.removeListener("entry",n),e.removeListener("end",i),e.removeListener("error",a),e.autoClose&&e.close()}function n(e){let{resolve:r}=t;t=null,r({value:e})}function i(){let{resolve:e}=t;t=null,r(),e({done:!0})}function a(e){let{reject:n}=t;t=null,r(),n(e)}return e.on("entry",n),e.on("end",i),e.on("error",a),{[Symbol.asyncIterator](){return this},next(){let r=new Promise((e,r)=>{if(null!=t)throw Error("next() called before previous Promise was resolved.");t={resolve:e,reject:r}});return e.readEntry(),r},return:e=>(r(),Promise.resolve({done:!0,value:e})),throw:e=>(r(),Promise.reject(e))}},y.prototype.openReadStream=function(e,t,r){var n,i=this,a=0,o=e.compressedSize;if(null==r&&(r=t,t=null),null==t)t={};else{if(!1===t.decodeFileData){if(null!=t.decrypt)throw Error("cannot use options.decrypt when options.decodeFileData === false");if(null!=t.decompress)throw Error("cannot use options.decompress when options.decodeFileData === false")}else{if(null!=t.decrypt){if(!e.isEncrypted())throw Error("options.decrypt can only be specified for encrypted entries. See also option decodeFileData.");if(!1!==t.decrypt)throw Error("invalid options.decrypt value: "+t.decrypt);if(e.isCompressed()&&!1!==t.decompress)throw Error("entry is encrypted and compressed, and options.decompress !== false. See also option decodeFileData.")}if(null!=t.decompress){if(!e.isCompressed())throw Error("options.decompress can only be specified for compressed entries. See also option decodeFileData.");if(!1!==t.decompress&&!0!==t.decompress)throw Error("invalid options.decompress value: "+t.decompress);n=t.decompress}}if(null!=t.start){if((a=t.start)<0)throw Error("options.start < 0");if(a>e.compressedSize)throw Error("options.start > entry.compressedSize")}if(null!=t.end){if((o=t.end)<0)throw Error("options.end < 0");if(o>e.compressedSize)throw Error("options.end > entry.compressedSize");if(o<a)throw Error("options.end < options.start")}}var s=!1===t.decodeFileData||(0===e.compressionMethod||8===e.compressionMethod&&!1===t.decompress)&&(!e.isEncrypted()||!1===t.decrypt);if((null!=t.start||null!=t.end)&&!s)throw Error("start/end range require options.decodeFileData === false for non-trivial encoded entries.");if(!i.isOpen)return r(Error("closed"));if(e.isEncrypted()&&!s&&!1!==t.decrypt)return r(Error("entry is encrypted, and options.decodeFileData !== false"));if(s)n=!1;else{if(8!==e.compressionMethod)return r(Error("unsupported compression method: "+e.compressionMethod));n=!0!==t.decodeFileData}i.readLocalFileHeader(e,{minimal:!0},function(t,s){if(t)return r(t);i.openReadStreamLowLevel(s.fileDataStart,e.compressedSize,a,o,n,e.uncompressedSize,r)})},y.prototype.openReadStreamLowLevel=function(e,t,r,n,i,o,s){var c=this.reader.createReadStream({start:e+r,end:e+n}),l=c;if(i){var d=!1,u=a.createInflateRaw();c.on("error",function(e){setImmediate(function(){d||u.emit("error",e)})}),c.pipe(u),this.validateEntrySizes?(l=new I(o),u.on("error",function(e){setImmediate(function(){d||l.emit("error",e)})}),u.pipe(l)):l=u,j(l,function(){d=!0,u!==l&&u.unpipe(l),c.unpipe(u),c.destroy()})}s(null,l)},y.prototype.readLocalFileHeader=function(e,t,r){var i=this;null==r&&(r=t,t=null),null==t&&(t={}),i.reader.ref();var a=n(30);A(i.reader,a,0,a.length,e.relativeOffsetOfLocalHeader,function(o){try{if(o)return r(o);var s=a.readUInt32LE(0);if(0x4034b50!==s)return r(Error("invalid local file header signature: 0x"+s.toString(16)));var c=a.readUInt16LE(26),l=a.readUInt16LE(28),d=e.relativeOffsetOfLocalHeader+30+c+l;if(d+e.compressedSize>i.fileSize)return r(Error("file data overflows file bounds: "+d+" + "+e.compressedSize+" > "+i.fileSize));if(t.minimal)return r(null,{fileDataStart:d});var u=new E;u.fileDataStart=d,u.versionNeededToExtract=a.readUInt16LE(4),u.generalPurposeBitFlag=a.readUInt16LE(6),u.compressionMethod=a.readUInt16LE(8),u.lastModFileTime=a.readUInt16LE(10),u.lastModFileDate=a.readUInt16LE(12),u.crc32=a.readUInt32LE(14),u.compressedSize=a.readUInt32LE(18),u.uncompressedSize=a.readUInt32LE(22),u.fileNameLength=c,u.extraFieldLength=l,a=n(c+l),i.reader.ref(),A(i.reader,a,0,a.length,e.relativeOffsetOfLocalHeader+30,function(e){try{if(e)return r(e);return u.fileName=a.subarray(0,c),u.extraField=a.subarray(c),r(null,u)}finally{i.reader.unref()}})}finally{i.reader.unref()}})},y.prototype.openReadStreamPromise=function(e,t){return new Promise((r,n)=>{this.openReadStream(e,t,function(e,t){if(e)return n(e);r(t)})})},y.prototype.openReadStreamLowLevelPromise=function(e,t,r,n,i,a){return new Promise((o,s)=>{this.openReadStream(e,t,r,n,i,a,function(e,t){if(e)return s(e);o(t)})})},y.prototype.readLocalFileHeaderPromise=function(e,t){return new Promise((r,n)=>{this.readLocalFileHeader(e,t,function(e,t){if(e)return n(e);r(t)})})},w.prototype.getLastModDate=function(e){if(null==e&&(e={}),!e.forceDosFormat)for(var t=0;t<this.extraFields.length;t++){var r=this.extraFields[t];if(21589===r.id){var n=r.data;if(n.length<5||!(1&n[0]))continue;return new Date(1e3*n.readInt32LE(1))}if(10===r.id){var n=r.data;if(32!==n.length||1!==n.readUInt16LE(4)||24!==n.readUInt16LE(6))continue;return new Date((n.readUInt32LE(8)+0x100000000*n.readInt32LE(12))/1e4-116444736e5)}}return x(this.lastModFileDate,this.lastModFileTime,e.timezone)},w.prototype.canDecodeFileData=function(){return!this.isEncrypted()&&(0===this.compressionMethod||8===this.compressionMethod)},w.prototype.isEncrypted=function(){return(1&this.generalPurposeBitFlag)!=0},w.prototype.isCompressed=function(){return 8===this.compressionMethod},s.inherits(I,l),I.prototype._transform=function(e,t,r){if(this.actualByteCount+=e.length,this.actualByteCount>this.expectedByteCount)return r(Error("too many bytes in the stream. expected "+this.expectedByteCount+". got at least "+this.actualByteCount));r(null,e)},I.prototype._flush=function(e){if(this.actualByteCount<this.expectedByteCount)return e(Error("not enough bytes in the stream. expected "+this.expectedByteCount+". got only "+this.actualByteCount));e()},s.inherits(P,c),P.prototype.ref=function(){this.refCount+=1},P.prototype.unref=function(){var e=this;if(e.refCount-=1,!(e.refCount>0)){if(e.refCount<0)throw Error("invalid unref");e.close(function(t){if(t)return e.emit("error",t);e.emit("close")})}},P.prototype.createReadStream=function(e){null==e&&(e={});var t=e.start,r=e.end;if(t===r){var n=new d;return setImmediate(function(){n.end()}),n}var i=this._readStreamForRange(t,r),a=!1,o=new C(this);i.on("error",function(e){setImmediate(function(){a||o.emit("error",e)})}),j(o,function(){i.unpipe(o),o.unref(),i.destroy()});var s=new I(r-t);return o.on("error",function(e){setImmediate(function(){a||s.emit("error",e)})}),j(s,function(){a=!0,o.unpipe(s),o.destroy()}),i.pipe(o).pipe(s)},P.prototype._readStreamForRange=function(e,t){throw Error("not implemented")},P.prototype.read=function(e,t,r,n,i){var a=this.createReadStream({start:n,end:n+r}),o=new u,s=0;o._write=function(r,n,i){r.copy(e,t+s,0,r.length),s+=r.length,i()},o.on("finish",i),a.on("error",function(e){i(e)}),a.pipe(o)},P.prototype.close=function(e){setImmediate(e)},s.inherits(C,d),C.prototype._flush=function(e){this.unref(),e()},C.prototype.unref=function(e){this.unreffedYet||(this.unreffedYet=!0,this.context.unref())},n="function"==typeof Buffer.allocUnsafe?function(e){return Buffer.allocUnsafe(e)}:function(e){return new Buffer(e)}},98045,e=>{"use strict";let t;var r,n,i,a,o,s,c,l=e.i(93458),d=e.i(57345),u=e.i(54012);async function p(){let e=(0,d.readGitHubAuthSession)((await (0,l.cookies)()).toString());if(void 0===e)return{authentication:"anonymous",cacheScope:"anonymous"};let t=await (0,u.createGitHubAuthAdapterAsync)({session:e});if(!t.available)return{authentication:"anonymous",cacheScope:"anonymous"};let r=await t.adapter.getSession();return r.ok&&null!==r.data&&void 0!==r.data?{authentication:{kind:"user",accessToken:r.data.accessToken},cacheScope:`github-user:${r.data.user.id}`}:{authentication:"anonymous",cacheScope:"anonymous"}}function f(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}var h=e.i(66680),m=e.i(62906),g=e.i(64474),y=e.i(35530);function b(e,t){let r=t.flatMap(v);return function(e){let t=e.filter(e=>void 0!==e.name),r=t.filter((e,r)=>t.findIndex(({name:t})=>t===e.name)!==r);if(r.length>0)throw Error(`Duplicate focus package name: ${r[0]?.name??"unknown"}.`)}(r),(0,y.projectDependencyGraphFromSourceGraph)(e,r,t.map(({projectId:e,packages:t})=>({id:e,packages:t})))}function v(e){let t=e.packages.find(({rootPath:e})=>"."===e),r=new Set(e.workspaces.filter(({rootPath:e})=>"."===e).flatMap(({packagePaths:e})=>e));return[t??{rootPath:"."},...e.packages.filter(({rootPath:e})=>"."!==e&&r.has(e))].map(({rootPath:t,name:r})=>{let n=`${e.projectId}:${t}`;return{id:n,nodeId:`package:${n}`,projectId:e.projectId,relativeRoot:t,...void 0===r?{}:{name:r}}})}var w=e.i(52513);let E=new Set(["EACCES","ENOENT","ENOTDIR"]),x=["@types",".github","examples","test","tests","__tests__"],R=["**/*.test.*","**/*.spec.*","**/*_test.*","**/*_spec.*","**/test_*.*","**/spec_*.*"];async function k(e){try{let t=await (0,w.inspectProjectAsync)(e,{excludeDirectories:x,excludeFiles:R});if(!t.complete)throw Error(`Project inspection is incomplete: ${t.diagnostics.map(e=>e.message).join("; ")}`);return t}catch(n){var t;if(!((t=n)instanceof Error&&"code"in t&&"string"==typeof t.code&&E.has(t.code)))throw n;let r=Error(`Invalid or unavailable project path: ${e}`,{cause:n});throw r.name="ProjectPathUnavailableError",r}}var S=((o={}).Cpp="cpp",o.Delphi="delphi",o.JavaScript="javascript",o.Kotlin="kotlin",o.Python="python",o.TypeScript="typescript",o.Java="java",o.Unknown="unknown",o),A=e.i(50227),I=e.i(2157);function P(e,t,r={}){let n=A.default.resolve(e),i=A.default.isAbsolute(t)?A.default.resolve(t):A.default.resolve(n,t);C(n,i,t,!0===r.allowRoot);let a=(0,I.realpathSync)(n),o=function e(t){if((0,I.lstatSync)(t,{throwIfNoEntry:!1}))return t;let r=A.default.dirname(t);if(r===t)throw Error(`Unable to resolve an existing ancestor for path: ${t}`);return e(r)}(i),s=(0,I.realpathSync)(o);C(a,s,t,!0);let c=A.default.resolve(s,A.default.relative(o,i));return C(a,c,t,!0===r.allowRoot),c}function C(e,t,r,n){let i=A.default.relative(e,t),a=0===i.length;if(".."===i||i.startsWith(`..${A.default.sep}`)||A.default.isAbsolute(i)||a&&!n)throw Error(`Path escaped the allowed root: ${r}`)}var O=e.i(12714);function _(e){return e.replaceAll("\\","/")}async function j(e,t,r=t,n="package",i="canonical"){let a=P(t,".",{allowRoot:!0}),o=P(a,P(r,".",{allowRoot:!0}),{allowRoot:!0}),s=new Map(e.nodes.map(e=>[e.id,e.data])),c=new Map,l=new Map,d=0;for(let t of e.edges){var u;let e=s.get(t.target);if(void 0===e)throw Error(`Missing dependency-graph target node: ${t.target}`);let r="module"===(u=e).kind?u.path??"":"intrinsic"===u.classification&&u.focus&&"."===u.path?"":u.packageName??u.label;for(let e of t.data.evidence)""!==r&&(d=await M({analysisRoot:o,evidence:e,importNameMode:n,imports:c,intrinsicMode:i,ordinal:d,pkg:r,projectRoot:a,sourceTextByFile:l}))}return new Map([...c].map(([e,t])=>[e,[...t].sort((e,t)=>(e.position<0?Number.MAX_SAFE_INTEGER:e.position)-(t.position<0?Number.MAX_SAFE_INTEGER:t.position)||e.ordinal-t.ordinal).map(({definition:e})=>e)]))}async function M(e){var t,r;let n=A.default.resolve(e.projectRoot,e.evidence.sourceFile),i=_(A.default.relative(e.analysisRoot,n)),a=await function(e,t){let r=e.get(t);if(void 0!==r)return r;let n=$(t);return e.set(t,n),n}(e.sourceTextByFile,n),o=e.imports.get(i)??[];return o.push({definition:{name:"specifier"===e.importNameMode?e.evidence.specifier:e.pkg,pkg:e.pkg,isIntrinsic:(t=e.evidence,"canonical"===(r=e.intrinsicMode)?"intrinsic"===t.classification||"focus"===t.classification:"python-legacy"===r?t.specifier.startsWith("."):"delphi-standard-library"===r?t.specifier.startsWith("System.")||t.specifier.startsWith("Vcl.")||t.specifier.startsWith("FMX.")||t.specifier.startsWith("Data.")||t.specifier.startsWith("Web."):t.specifier.startsWith("kotlin.")||t.specifier.startsWith("java.")||t.specifier.startsWith("javax."))},position:a.indexOf(e.evidence.specifier),ordinal:e.ordinal}),e.imports.set(i,o),e.ordinal+1}async function $(e){try{return await (0,O.readFile)(e,"utf8")}catch(e){if(e instanceof Error&&"code"in e&&"ENOENT"===e.code)return"";throw e}}function T(e){let t=P(e.rootPath,e.filePath);return{content:(0,I.readFileSync)(t,"utf8"),path:t}}async function L(e,t,r,n){var i,a,o=r;if(![S.Java,S.TypeScript,S.Cpp,S.Python,S.Delphi,S.Kotlin].includes(o))throw Error("Supported language is 'Java', 'TypeScript', 'C++', 'Python', 'Delphi' & 'Kotlin'. More to follow.");let s=(i=e,(a=r)===S.TypeScript?".":i.detection.languages.find(e=>e.id===String(a))?.sourceRoots[0]??"."),c=P(n,s,{allowRoot:!0}),l=await U(t,r,n,c),d=N(),u=new Map([["",d]]);for(let t of e.directories){let e=z(t,s);void 0!==e&&""!==e&&D(u,e)}for(let t of e.files){let e=z(t,s);if(void 0===e||""===e||!function(e,t){let r=A.default.extname(e).toLowerCase();switch(t){case S.Java:return".java"===r;case S.TypeScript:return".ts"===r||".tsx"===r;case S.Cpp:return[".cpp",".cc",".cxx",".h",".hpp",".hxx"].includes(r);case S.Python:return".py"===r;case S.Delphi:return[".pas",".pp",".dpr"].includes(r);case S.Kotlin:return".kt"===r||".kts"===r;default:return!1}}(e,r))continue;let i=function(e){let t=P(e.projectPath,e.sourceFile);switch(e.language){case S.Java:return function(e,t,r){let{content:n,path:i}=T({rootPath:t,filePath:e});return{className:function(e,t){let r=RegExp(`(?:public\\s+)?(class|interface|enum|record)\\s+${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`);if(e.match(r))return t;let n=/(?:public\s+)?(class|interface|enum|record)\s+([A-Za-z0-9_]+)/.exec(e);return n?.[2]??""}(n,A.default.basename(i,".java")),package:function(e){let t=/^package\s+([a-zA-Z0-9_.]+);/m.exec(e);return t?.[1]??""}(n),imports:[...r],path:_(A.default.relative(t,i))}}(t,e.analysisRootPath,e.imports);case S.TypeScript:return function(e,t,r){let{content:n,path:i}=T({rootPath:t,filePath:e}),a=_(A.default.relative(t,i)),o=a.split("/");return{className:function(e,t){let r=/class\s+(\w+)/.exec(e);return r?r[1]:A.default.basename(t,".ts")}(n,i),imports:[...r],package:o.slice(0,-1).join("."),path:a}}(t,e.analysisRootPath,e.imports);case S.Cpp:return function(e,t,r){let{content:n,path:i}=T({rootPath:t,filePath:e}),a=A.default.basename(i),o=function(e){let t=/namespace\s+([a-zA-Z0-9_:]+)\s*\{/.exec(e);return t?.[1]?.replace(/::/g,".")??""}(n);return{className:function(e,t){let r=/class\s+([A-Za-z0-9_]+)/.exec(e);if(r)return r[1];let n=/struct\s+([A-Za-z0-9_]+)/.exec(e);return n?n[1]:A.default.basename(t,A.default.extname(t))}(n,a),package:o,imports:[...function(e,t,r){return[...r,...function(e,t,r){let n,i=new Set(r.map(({name:e})=>e)),a=/#include\s+(["<])([^">]+)[">]/g,o=[];for(;null!==(n=a.exec(e));){let[,e="",r=""]=n;if(i.has(r))continue;let a=r.replace(/\.(h|hpp|hxx)$/u,"").split("/"),s=a.length>1?a.slice(0,-1).join("."):"";(""===s||s===t)&&o.push({name:r,pkg:s,isIntrinsic:'"'===e})}return o}(e,t,r)].sort((t,r)=>e.indexOf(t.name)-e.indexOf(r.name))}(n,o,r)],path:_(A.default.relative(t,i))}}(t,e.analysisRootPath,e.imports);case S.Python:return function(e,t,r){let{content:n,path:i}=T({rootPath:t,filePath:e});return{className:function(e,t){let r=/^class\s+([A-Za-z0-9_]+)/m.exec(e);return r?r[1]:A.default.basename(t,A.default.extname(t))}(n,A.default.basename(i)),package:function(e,t){let r=_(A.default.relative(t,e)).split("/");return r.pop(),r.join(".")}(i,t),imports:[...r],path:_(A.default.relative(t,i))}}(t,e.analysisRootPath,e.imports);case S.Delphi:return function(e,t,r){let{content:n,path:i}=T({rootPath:t,filePath:e});return{className:function(e,t){let r=/\bunit\s+([A-Za-z_][A-Za-z0-9_]*)\s*;/i.exec(e);if(r)return r[1];let n=/\bT([A-Za-z_][A-Za-z0-9_]*)\s*=\s*class/i.exec(e);return n?"T"+n[1]:A.default.basename(t,A.default.extname(t))}(n,A.default.basename(i)),package:function(e,t){let r=_(A.default.relative(t,e)),n=A.default.posix.dirname(r);return"."===n?"":n.replace(/\//g,".")}(i,t),imports:[...r],path:_(A.default.relative(t,i))}}(t,e.analysisRootPath,e.imports);case S.Kotlin:return function(e,t,r){let{content:n,path:i}=T({rootPath:t,filePath:e});return{className:function(e,t){let r=/(?:^|\n)\s*(?:data\s+|sealed\s+|abstract\s+|open\s+)?(?:class|object|interface)\s+([A-Za-z0-9_]+)/m.exec(e);return r?r[1]:A.default.basename(t,A.default.extname(t))}(n,A.default.basename(i)),package:function(e){let t=/^\s*package\s+([\w.]+)/m.exec(e);return t?.[1]??""}(n),imports:[...r],path:_(A.default.relative(t,i))}}(t,e.analysisRootPath,e.imports);default:throw Error(`Unsupported parser language: ${e.language}`)}}({analysisRootPath:c,imports:l.get(e)??[],language:r,projectPath:n,sourceFile:t});!function(e,t,r){let n=t.lastIndexOf("/"),i=n<0?"":t.slice(0,n),a=n<0?t:t.slice(n+1);Object.defineProperty(D(e,i),a,{configurable:!0,enumerable:!0,value:r,writable:!0})}(u,e,i)}return d}function z(e,t){if("."===t)return e;if(e===t)return"";let r=`${t}/`;return e.startsWith(r)?e.slice(r.length):void 0}function D(e,t){let r=e.get(t);if(void 0!==r)return r;let n=t.lastIndexOf("/"),i=n<0?"":t.slice(0,n),a=n<0?t:t.slice(n+1),o=D(e,i),s=N();return Object.defineProperty(o,a,{configurable:!0,enumerable:!0,value:s,writable:!0}),e.set(t,s),s}function N(){return Object.setPrototypeOf({},null)}async function U(e,t,r,n){switch(t){case S.TypeScript:return j(e,r);case S.Java:case S.Cpp:return j(e,r,n,"specifier");case S.Kotlin:return j(e,r,n,"specifier","kotlin-standard-library");case S.Python:return j(e,r,n,"specifier","python-legacy");case S.Delphi:return j(e,r,n,"specifier","delphi-standard-library");default:return new Map}}function H(){return Error("GitHub repository must be owner/repository or a normal https://github.com repository URL.")}var F=e.i(60526),G=e.i(81111),q=e.i(88646),B=e.i(73228);let W=/\.(?:c|cc|cpp|cxx|dpr|h|hpp|java|js|jsx|kt|kts|pas|py|ts|tsx)$/iu,J=Buffer.from([80,75,3,4]);async function X(e,t={}){var r,n,i;let a=(r=t.limits,{maxEntryCount:V(r?.maxEntryCount,1e4),maxUncompressedSize:V(r?.maxUncompressedSize,0x10000000)});Q(t.signal);let o=await et(e);if(null===o||!o.isFile()||!e.toLowerCase().endsWith(".jar"))return null;await er(e),Q(t.signal);let s=await (0,O.mkdtemp)((0,A.join)((0,F.tmpdir)(),"atlas-source-jar-"));try{return await K(e,s,a,t.signal),{rootPath:s,projectName:(n=e,(0,A.basename)(n).replace(/\.jar$/iu,"")||"{unknown}"),cleanupAsync:()=>(0,O.rm)(s,{force:!0,recursive:!0})}}catch(e){if(await (0,O.rm)(s,{force:!0,recursive:!0}),t.signal?.aborted)throw ee(t.signal);throw(i=e)instanceof Error&&(i.message.startsWith("Source JAR")||i.message.startsWith("Unsupported binary JAR"))?i:Error("Unsupported local archive input: provide a valid source JAR file.",{cause:i})}}async function K(e,t,r,n){let i=await (0,B.openPromise)(e,{autoClose:!1,lazyEntries:!0,strictFileNames:!0,validateEntrySizes:!1}),a=()=>Y(i);n?.addEventListener("abort",a,{once:!0});try{if(i.entryCount>r.maxEntryCount)throw Error("Source JAR contains too many entries.");if(Q(n),!(await Z(i,t,r,n)).hasSourceFile)throw Error("Unsupported binary JAR input: the archive does not contain analyzable source files.")}finally{n?.removeEventListener("abort",a),Y(i)}}async function Z(e,t,r,n){var i;let a,o=0,s=0,c=!1,l=new Map,d=(i=r.maxUncompressedSize,a=0,()=>new G.Transform({transform(e,t,r){(a+=e.length)>i?r(Error("Source JAR expands beyond the supported size limit.")):r(null,e)}}));for await(let i of e.eachEntry()){if(Q(n),(o+=1)>r.maxEntryCount)throw Error("Source JAR contains too many entries.");let a=function(e,t){let{fileName:r}=e,n=r.endsWith("/")?"directory":"file";return function(e,t){let r="directory"===t?e.slice(0,-1):e;if(""===e||e.includes("\\")||(0,A.isAbsolute)(e)||r.split("/").some(e=>""===e||"."===e||".."===e))throw Error("Source JAR contains an unsafe entry path.")}(r,n),function(e){if(e.isEncrypted()||![0,8].includes(e.compressionMethod))throw Error("Source JAR contains an unsupported encrypted or compressed entry.")}(e),function(e,t){var r,n;let i=e.externalFileAttributes>>>16&61440;if(0!==i&&16384!==i&&32768!==i)throw Error("Source JAR contains an unsupported link or special entry.");if(r=t,n=i,"directory"===r&&32768===n||"file"===r&&16384===n)throw Error("Source JAR contains an inconsistent archive entry type.")}(e,n),en(t,r),n}(i,t);if(function(e,t,r){let n="directory"===r?t.slice(0,-1):t;if(e.has(n))throw Error("Source JAR contains duplicate archive entries.");let i=n.split("/");if(i.slice(0,-1).map((e,t)=>i.slice(0,t+1).join("/")).some(t=>"file"===e.get(t))||"file"===r&&[...e.keys()].some(e=>e.startsWith(`${n}/`)))throw Error("Source JAR contains colliding archive entries.");e.set(n,r)}(l,i.fileName,a),(s+=i.uncompressedSize)>r.maxUncompressedSize)throw Error("Source JAR expands beyond the supported size limit.");if("directory"===a){await (0,O.mkdir)(en(t,i.fileName),{recursive:!0});continue}let u=en(t,i.fileName);await (0,O.mkdir)((0,A.resolve)(u,".."),{recursive:!0}),await (0,q.pipeline)(await e.openReadStreamPromise(i),d(),(0,I.createWriteStream)(u,{flags:"wx"}),{signal:n}),c||=W.test(i.fileName)}return{hasSourceFile:c}}function V(e,t){if(void 0===e)return t;if(!Number.isSafeInteger(e)||e<=0||e>t)throw Error("Source JAR limit must be a positive integer within the supported maximum.");return e}function Y(e){e.isOpen&&e.close()}function Q(e){if(e?.aborted)throw ee(e)}function ee(e){return e.reason instanceof Error?e.reason:new DOMException("The source JAR operation was aborted.","AbortError")}async function et(e){try{return await (0,O.stat)(e)}catch{return null}}async function er(e){let t=await (0,O.open)(e,"r");try{let e=Buffer.alloc(J.length),{bytesRead:r}=await t.read(e,0,e.length,0);if(r!==J.length||!e.equals(J))throw Error("Unsupported local archive input: provide a valid source JAR file.")}finally{await t.close()}}function en(e,t){let r=(0,A.resolve)(e,t),n=(0,A.relative)(e,r);if(""===n||".."===n||n.startsWith(`..${A.sep}`)||(0,A.isAbsolute)(n))throw Error("Source JAR contains an unsafe entry path.");return r}class ei extends Error{code;retryAfterMilliseconds;constructor(e,t,r){super(t),this.code=e,this.retryAfterMilliseconds=r,this.name="GitHubRepositoryDiscoveryError"}}async function ea(e,t,r){let n=function(e){let t=e.headers.get("retry-after");if(!t||!/^\d+(?:\.\d+)?$/u.test(t))return;let r=1e3*Number(t);return Number.isSafeInteger(r)?r:void 0}(e);if(403!==e.status&&429!==e.status)return{isRateLimited:!1};if("0"===e.headers.get("x-ratelimit-remaining")){var i,a;return{isRateLimited:!0,retryAfterMilliseconds:(i=function(e,t){let r=e.headers.get("x-ratelimit-reset");if(!r||!/^\d+$/u.test(r))return;let n=1e3*Number(r)-t();return Number.isSafeInteger(n)&&n>=0?n:void 0}(e,t),a=n,void 0===i?a:void 0===a?i:Math.max(i,a))}}if(429===e.status||void 0!==n)return{isRateLimited:!0,retryAfterMilliseconds:n};let o=await r(e);return{isRateLimited:void 0!==o&&/\bsecondary rate limit\b/iu.test(o)}}async function eo(e,t,r,n,i,a){let o=0;for(let f=0;f<3;f+=1){var s,c,l,d,u,p;eg(i);let h=await ec(e,t,r,i);if(h.ok)try{return await es(a,h,t,i)}catch(e){if(ef(e))throw e;throw new ei("api-failure","GitHub returned malformed data.")}let m=await ea(h,t.now,e=>es(eu,e,t,i)),g=(s=h,c=n,(l=m).isRateLimited?new ei("rate-limited","GitHub rate limit reached. Retry after the reported delay.",l.retryAfterMilliseconds):404===s.status&&"owner"===c?new ei("owner-not-found","GitHub owner was not found."):401===s.status||403===s.status?new ei("permission-denied","GitHub denied access to this resource."):new ei("api-failure",`GitHub ${c} request failed with HTTP ${s.status}.`)),y=(d=h,u=f,(p=m).isRateLimited?p.retryAfterMilliseconds:429===d.status||d.status>=500?Math.min(250*2**u,3e4):void 0);if(!(f<2&&void 0!==y&&o+y<=6e4))throw g;await t.waitAsync(y,i),eg(i),o+=y}throw new ei("api-failure","GitHub request retry limit was exceeded.")}async function es(e,t,r,n){let i=el(n,r.timeoutMilliseconds);try{return await ed(e(t),i.signal)}catch(e){if(n?.aborted)throw eh();if(i.timedOut())throw em();throw e}finally{i.dispose()}}async function ec(e,t,r,n){let i=el(n,t.timeoutMilliseconds);try{return await ed(e(r,{headers:function(e){let t="environment"===e?process.env.GITHUB_TOKEN??process.env.GH_TOKEN:"object"==typeof e?e.accessToken:void 0;if("object"==typeof e&&!e.accessToken.trim())throw new ei("permission-denied","GitHub user authorization is unavailable.");return{Accept:"application/vnd.github+json","User-Agent":"@ankhorage/repository","X-GitHub-Api-Version":"2022-11-28",...t?{Authorization:`Bearer ${t}`}:{}}}(t.authentication),signal:i.signal}),i.signal)}catch(e){if(n?.aborted)throw eh();if(i.timedOut())throw em();if(e instanceof ei||ef(e))throw e;throw new ei("api-failure","GitHub request failed.")}finally{i.dispose()}}function el(e,t){let r=new AbortController,n=!1,i=()=>r.abort();e?.addEventListener("abort",i,{once:!0}),e?.aborted&&r.abort();let a=setTimeout(()=>{n=!0,r.abort()},t);return{dispose:()=>{clearTimeout(a),e?.removeEventListener("abort",i)},signal:r.signal,timedOut:()=>n}}function ed(e,t){return t?t.aborted?Promise.reject(eh()):new Promise((r,n)=>{let i=()=>n(eh());t.addEventListener("abort",i,{once:!0}),e.then(r,n).finally(()=>t.removeEventListener("abort",i))}):e}async function eu(e){try{let t=await e.json();if("object"!=typeof t||null===t)return;let r=Reflect.get(t,"message");return"string"==typeof r?r:void 0}catch{return}}function ep(e,t){return t?t.aborted?Promise.reject(eh()):new Promise((r,n)=>{let i=()=>{clearTimeout(a),t.removeEventListener("abort",i),n(eh())},a=setTimeout(()=>{t.removeEventListener("abort",i),r()},e);t.addEventListener("abort",i,{once:!0})}):new Promise(t=>setTimeout(t,e))}function ef(e){return e instanceof ei&&("cancelled"===e.code||"timeout"===e.code)}function eh(){return new ei("cancelled","GitHub repository operation was cancelled.")}function em(){return new ei("timeout","GitHub request timed out.")}function eg(e){if(e?.aborted)throw eh()}let ey="https://api.github.com",eb={affiliation:"owner,collaborator,organization_member",per_page:"100",visibility:"all"};async function ev(e,t,r){let{value:n}=await e(`${ey}/users/${encodeURIComponent(t)}`,"owner",r),i=eS(n,"owner"),a=eA(i.type,"owner type");if("User"!==a&&"Organization"!==a)throw new ei("api-failure","GitHub returned an unsupported owner type.");return{login:eA(i.login,"owner login"),type:"Organization"===a?"organization":"user",url:eA(i.html_url,"owner URL")}}async function ew(e,t,r){let n="organization"===t.type?"orgs":"users";return ex(e,`${ey}/${n}/${encodeURIComponent(t.login)}/repos?per_page=100&type=all&sort=full_name&direction=asc`,{path:`/${n}/${encodeURIComponent(t.login)}/repos`},r)}async function eE(e,t){return ex(e,`${ey}/user/repos?visibility=all&affiliation=owner,collaborator,organization_member&per_page=100`,{path:"/user/repos",filters:eb},t)}async function ex(e,t,r,n){let i=t,a=1,o=new Map,s=new Set;for(;void 0!==i&&s.size<1e3;){if(s.has(i))throw new ei("api-failure","GitHub returned a repeated repository pagination URL.");s.add(i);let t=await e(i,"repository list",n);if(!Array.isArray(t.value))throw new ei("api-failure","GitHub returned an invalid repository list.");for(let e of t.value){let t=function(e){let t=eS(e,"repository"),{id:r}=t;if("number"!=typeof r||!Number.isSafeInteger(r)||r<1)throw new ei("api-failure","GitHub returned an invalid repository ID.");let n=eS(t.owner,"repository owner");return{id:String(r),name:eA(t.name,"repository name"),owner:eA(n.login,"repository owner login"),url:eA(t.html_url,"repository URL"),visibility:function(e){if("internal"===e.visibility)return"internal";if(!0===e.private)return"private";if(!1===e.private)return"public";throw new ei("api-failure","GitHub returned an invalid repository visibility.")}(t)}}(e);o.set(t.id,t)}void 0!==(i=function(e,t,r){if(!e)return;let n=/<([^>]+)>;\s*rel="next"/u.exec(e);if(!n?.[1])return;let i=new URL(n[1]);if(i.origin!==ey||i.pathname!==t.path||!function(e,t){if(void 0===t)return eR(e)>0;let r=new Set([...Object.keys(t),"page"]);return[...e.searchParams.keys()].every(e=>r.has(e))&&Object.entries(t).every(([t,r])=>1===e.searchParams.getAll(t).length&&e.searchParams.get(t)===r)&&1===e.searchParams.getAll("page").length&&eR(e)>0}(i,t.filters)||eR(i)<=r)throw new ei("api-failure","GitHub returned an invalid pagination URL.");return i.href}(t.link,r,a))&&(a=eR(new URL(i)))}if(void 0!==i)throw new ei("api-failure","GitHub repository pagination exceeded the supported limit.");return[...o.values()].sort(ek)}function eR(e){let t=e.searchParams.get("page");return null!==t&&/^[1-9]\d*$/u.test(t)?Number(t):0}function ek(e,t){let r=`${e.owner.toLowerCase()}/${e.name.toLowerCase()}`,n=`${t.owner.toLowerCase()}/${t.name.toLowerCase()}`;return r<n?-1:+(r>n)}function eS(e,t){if("object"!=typeof e||null===e||Array.isArray(e))throw new ei("api-failure",`GitHub returned invalid ${t}.`);return Object.fromEntries(Object.entries(e))}function eA(e,t){if("string"!=typeof e||""===e.trim())throw new ei("api-failure",`GitHub returned invalid ${t}.`);return e}let eI="https://api.github.com";function eP(e=fetch,t={}){var r;let n=function(e=fetch,t={}){let r={authentication:t.authentication??"environment",now:t.now??Date.now,timeoutMilliseconds:t.timeoutMilliseconds??3e4,waitAsync:t.waitAsync??ep};return{requestBytesAsync:(t,n,i)=>eo(e,r,t,n,i,e=>e.arrayBuffer().then(e=>new Uint8Array(e))),requestJsonResponseAsync:(t,n,i)=>eo(e,r,t,n,i,async e=>({value:await e.json(),link:e.headers.get("link")}))}}(e,t);return{inspectRepositoryAsync:(e,t)=>eC(n,e,t),resolveRevisionAsync:(e,t,r)=>eO(n,e,t,r),readTreeAsync:(e,t,r)=>e_(n,e,t,r),readFileAsync:(e,t,r,i)=>ej(n,e,t,r,i),...(r=(e,t,r)=>n.requestJsonResponseAsync(e,t,r),{resolveOwnerAsync:(e,t)=>ev(r,e,t),listOwnerRepositoriesAsync:(e,t)=>ew(r,e,t),listAuthenticatedUserRepositoriesAsync:e=>eE(r,e)})}}async function eC(e,t,r){let n=eM((await e.requestJsonResponseAsync(`${eI}/repos/${encodeURIComponent(t.owner)}/${encodeURIComponent(t.name)}`,"repository metadata",r)).value,"repository metadata"),i=e$(n.default_branch,"repository default branch"),a=eM(n.owner,"repository owner");return{id:String(function(e,t){if("number"!=typeof e||!Number.isSafeInteger(e)||e<0)throw Error(`GitHub returned invalid ${t}.`);return e}(n.id,"repository ID")),owner:e$(a.login,"repository owner login"),name:e$(n.name,"repository name"),defaultBranch:i,url:e$(n.html_url,"repository URL")}}async function eO(e,t,r,n){let i=eM((await e.requestJsonResponseAsync(`${eI}/repos/${encodeURIComponent(t.owner)}/${encodeURIComponent(t.name)}/commits/${encodeURIComponent(r)}`,"repository revision",n)).value,"repository revision"),a=eM(i.commit,"repository commit"),o=eM(a.tree,"repository commit tree");return{commitSha:e$(i.sha,"repository commit SHA"),treeSha:e$(o.sha,"repository tree SHA")}}async function e_(e,t,r,n){let i=eM((await e.requestJsonResponseAsync(`${eI}/repos/${encodeURIComponent(t.owner)}/${encodeURIComponent(t.name)}/git/trees/${encodeURIComponent(r)}?recursive=1`,"repository tree",n)).value,"repository tree");if(!Array.isArray(i.tree))throw Error("GitHub returned an invalid repository tree.");return{entries:i.tree.map(e=>(function(e){let t=eM(e,"repository tree entry"),r=e$(t.type,"repository tree entry type");if("blob"!==r&&"tree"!==r&&"commit"!==r)throw Error(`GitHub returned an unsupported repository tree entry type: ${r}.`);let{size:n}=t;if(void 0!==n&&("number"!=typeof n||!Number.isSafeInteger(n)||n<0))throw Error("GitHub returned an invalid repository tree entry size.");return{mode:e$(t.mode,"repository tree entry mode"),path:e$(t.path,"repository tree entry path"),sha:e$(t.sha,"repository tree entry SHA"),type:r,...void 0===n?{}:{size:n}}})(e)),truncated:!0===i.truncated}}async function ej(e,t,r,n,i){let a=n.split("/").map(e=>encodeURIComponent(e)).join("/");return e.requestBytesAsync(`https://raw.githubusercontent.com/${encodeURIComponent(t.owner)}/${encodeURIComponent(t.name)}/${encodeURIComponent(r)}/${a}`,"repository file",i)}function eM(e,t){if("object"!=typeof e||null===e||Array.isArray(e))throw Error(`GitHub returned invalid ${t}.`);return Object.fromEntries(Object.entries(e))}function e$(e,t){if("string"!=typeof e||""===e.trim())throw Error(`GitHub returned invalid ${t}.`);return e}function eT(e){let t=function(e){try{return new URL(e)}catch(e){throw Error("Repository URL must be a valid GitHub HTTPS URL.",{cause:e})}}(e);var r,n=t;if("https:"!==n.protocol||"github.com"!==n.hostname.toLowerCase()||""!==n.username||""!==n.password)throw eL();let i=function(e){try{return e.pathname.split("/").filter(Boolean).map(e=>decodeURIComponent(e))}catch(e){throw Error("Repository URL contains an invalid encoded path.",{cause:e})}}(t);if(i.length<2)throw eL();let[a="",o="",s]=i,c=o.endsWith(".git")?o.slice(0,-4):o;var l=a,d=c;if(!/^[A-Za-z0-9](?:[A-Za-z0-9-]{0,98}[A-Za-z0-9])?$/u.test(l))throw Error("GitHub repository owner is invalid.");if(!/^[A-Za-z0-9._-]{1,100}$/u.test(d)||"."===d||".."===d)throw Error("GitHub repository name is invalid.");let u=i.slice(3);if(void 0===s)return{target:{owner:a,name:c,url:`https://github.com/${a}/${c}`},refCandidates:[]};if("commit"===s){if(1!==u.length)throw eL();return{target:{owner:a,name:c,url:`https://github.com/${a}/${c}`},refCandidates:[u[0]??""]}}if("tree"!==s&&"blob"!==s||0===u.length)throw eL();return{target:{owner:a,name:c,url:`https://github.com/${a}/${c}`},refCandidates:Array.from({length:(r=u).length},(e,t)=>r.slice(0,r.length-t).join("/"))}}function eL(){return Error("Repository URL must be a GitHub repository, tree, blob, or commit HTTPS URL.")}async function ez(e,t,r,n,i){for(let o of 0===t.refCandidates.length?[n]:t.refCandidates)try{return{...await e.resolveRevisionAsync(r,o,i),ref:o}}catch(e){var a;if(!((a=e)instanceof ei&&"api-failure"===a.code&&a.message.includes("HTTP 404")))throw e}throw Error("GitHub repository URL does not resolve to a branch, tag, or commit.")}async function eD(e,t){let r=eT(e.url),n=await t.inspectRepositoryAsync(r.target,e.signal),i={owner:n.owner,name:n.name,url:n.url},a=function(e){if(void 0===e)return;let t=e.trim();if(""===t)throw Error("GitHub repository ref must not be empty.");return t}(e.ref),o=void 0===a?await ez(t,r,i,n.defaultBranch,e.signal):{...await t.resolveRevisionAsync(i,a,e.signal),ref:a},s=await t.readTreeAsync(i,o.treeSha,e.signal),c=function(e,t){if(t)throw Error("GitHub repository tree is truncated and cannot be materialized safely.");let r=e.filter(e=>"blob"===e.type&&"120000"===e.mode),n=e.filter(e=>"blob"===e.type&&"120000"!==e.mode);if(n.length>2e4)throw Error("GitHub repository exceeds the 20000 file materialization limit.");if(n.reduce((e,t)=>{if(void 0===t.size)throw Error(`GitHub repository file size is missing for ${t.path}.`);return e+t.size},0)>0x10000000)throw Error("GitHub repository exceeds the 256 MiB materialization limit.");return{files:n,diagnostics:r.map(e=>({code:"symlink-skipped",severity:"warning",path:e.path,message:"Symbolic link skipped during safe GitHub repository materialization."}))}}(s.entries,s.truncated),l=await eN(e.destinationPath);try{await eU(t,i,o.commitSha,l,c.files,e.signal)}catch(e){throw await (0,O.rm)(l,{force:!0,recursive:!0}),e}return{rootPath:l,revision:o.commitSha,diagnostics:c.diagnostics,repository:{owner:n.owner,name:n.name,url:n.url,defaultBranch:n.defaultBranch},cleanupAsync:()=>(0,O.rm)(l,{force:!0,recursive:!0})}}async function eN(e){if(void 0===e)return(0,O.mkdtemp)((0,A.join)((0,F.tmpdir)(),"ankhorage-repository-"));let t=(0,A.resolve)(e);return await (0,O.mkdir)((0,A.dirname)(t),{recursive:!0}),await (0,O.mkdir)(t),t}async function eU(e,t,r,n,i,a){for(let o of Array.from({length:Math.ceil(i.length/8)},(e,t)=>i.slice(8*t,(t+1)*8)))await Promise.all(o.map(i=>eH(e,t,r,n,i,a)))}async function eH(e,t,r,n,i,a){let o=function(e,t){if(""===t.trim()||t.includes("\\")||t.startsWith("/")||t.split("/").some(e=>".."===e||""===e))throw Error(`Unsafe GitHub repository path: ${t}.`);let r=(0,A.resolve)(e,...t.split("/")),n=(0,A.relative)(e,r);if(""===n||".."===n||n.startsWith(`..${A.sep}`)||(0,A.isAbsolute)(n))throw Error(`Unsafe GitHub repository path: ${t}.`);return r}(n,i.path),s=await e.readFileAsync(t,r,i.path,a);if(i.size!==s.byteLength)throw Error(`GitHub repository file size changed while reading ${i.path}.`);await (0,O.mkdir)((0,A.dirname)(o),{recursive:!0}),await (0,O.writeFile)(o,s),"100755"===i.mode&&await (0,O.chmod)(o,493)}async function eF(e){return eD(e,eP(fetch,{authentication:e.authentication??"anonymous"}))}function eG(){return{materializeAsync:async(e,t,r="anonymous")=>{let n=await eF({url:e.url,...void 0===e.revision?{}:{ref:e.revision},authentication:r,signal:t});return{rootPath:n.rootPath,projectName:n.repository.name,revision:n.revision,cleanupAsync:n.cleanupAsync}}}}async function eq(e,t,r,n){if("filesystem"===e.kind){let t=await r?.materializeAsync(e,n);return null!=t?{source:e,...t}:{rootPath:(0,A.resolve)(e.path),projectName:(0,A.basename)((0,A.resolve)(e.path))||"{unknown}",source:e,cleanupAsync:()=>Promise.resolve()}}let i=await t.materializeAsync(e,n);return{rootPath:i.rootPath,projectName:i.projectName,revision:i.revision,source:e,cleanupAsync:i.cleanupAsync}}function eB(e,t){return eq(e,eG(),{materializeAsync:(e,t)=>X(e.path,{signal:t})},t)}function eW(e){return[e.authorization,e.provider,e.repositoryId,e.revision,e.schemaVersion].join("|")}function eJ(e,t){let r=e.get(t);if(void 0!==r)return e.delete(t),e.set(t,r),r}function eX(e,t,r,n){for(e.delete(t),e.set(t,r);e.size>n;){let t=e.keys().next().value;if(void 0===t)return;e.delete(t)}}var eK=e.i(54411);function eZ(e,t){let r=new Set(e.capabilities.map(({projectId:e})=>e));return 0!==r.size&&[...r].every(r=>e.capabilities.some(e=>e.projectId===r&&e.available.includes(t)))}let eV=[{id:"hexagonal",name:"Hexagonal / Ports and Adapters",reference:"https://alistair.cockburn.us/hexagonal-architecture",interpretation:"Application behavior communicates through purposeful ports; adapters translate external mechanisms. Composition selects adapters outside the application.",roles:[{id:"core",description:"Application behavior independent from external devices."},{id:"port",description:"Application-owned conversation contract."},{id:"adapter",description:"Technology-specific translation at a port."},{id:"composition",description:"Outer wiring of concrete adapters."}],allowedDependencies:eY(["core","port","adapter","composition"],[["core","port"],["port","core"],["adapter","core"],["adapter","port"],["composition","core"],["composition","port"],["composition","adapter"]])},{id:"clean",name:"Clean Architecture",reference:"https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html",interpretation:"Static source dependencies point inward from frameworks and interface adapters through use cases toward entities.",roles:[{id:"entity",description:"Enterprise business rules."},{id:"use-case",description:"Application-specific business rules."},{id:"interface-adapter",description:"Translation between use cases and external interfaces."},{id:"framework",description:"External frameworks, devices, and infrastructure."},{id:"composition",description:"Outermost assembly of concrete components."}],allowedDependencies:(r=["entity","use-case","interface-adapter","framework","composition"]).flatMap((e,t)=>r.slice(0,t+1).map(t=>({source:e,target:t})))},{id:"onion",name:"Onion Architecture",reference:"https://jeffreypalermo.com/2008/07/the-onion-architecture-part-1/",interpretation:"Domain model and services form the core. Application behavior, infrastructure implementations, and presentation depend toward that core.",roles:[{id:"domain-model",description:"Domain entities and value rules."},{id:"domain-service",description:"Domain behavior coordinating model concepts."},{id:"application-service",description:"Application workflow around the domain."},{id:"infrastructure",description:"External persistence and technical implementations."},{id:"presentation",description:"External user or program interface."},{id:"composition",description:"Outermost assembly of concrete components."}],allowedDependencies:eY(["domain-model","domain-service","application-service","infrastructure","presentation","composition"],[["domain-service","domain-model"],["application-service","domain-model"],["application-service","domain-service"],["infrastructure","domain-model"],["infrastructure","domain-service"],["infrastructure","application-service"],["presentation","domain-model"],["presentation","domain-service"],["presentation","application-service"],["composition","domain-model"],["composition","domain-service"],["composition","application-service"],["composition","infrastructure"],["composition","presentation"]])},{id:"layered",name:"Layered / N-Tier Architecture",reference:"https://martinfowler.com/bliki/PresentationDomainDataLayering.html",interpretation:"The initial strict variant follows presentation to domain to data source; domain-to-data-source coupling distinguishes it from inward-dependency models.",roles:[{id:"presentation",description:"Interaction and display concerns."},{id:"domain",description:"Business logic and application behavior."},{id:"data-source",description:"Persistence and external service access."},{id:"composition",description:"Assembly of the layers."}],allowedDependencies:eY(["presentation","domain","data-source","composition"],[["presentation","domain"],["domain","data-source"],["composition","presentation"],["composition","domain"],["composition","data-source"]])}];function eY(e,t){return[...e.map(e=>({source:e,target:e})),...t.map(([e,t])=>({source:e,target:t}))]}let eQ=new Map([["hexagonal",new Map([["core",["application","core","domain","service","usecase"]],["port",["gateway","interface","port","repository"]],["adapter",["adapter","client","controller","database","http","infra","infrastructure","persistence"]],["composition",["bootstrap","composition","container","wiring"]]])],["clean",new Map([["entity",["domain","entities","entity","model"]],["use-case",["application","interactor","service","usecase"]],["interface-adapter",["adapter","controller","gateway","mapper","presenter"]],["framework",["database","framework","http","infra","infrastructure","persistence","web"]],["composition",["bootstrap","composition","container","wiring"]]])],["onion",new Map([["domain-model",["domain","entity","model","value"]],["domain-service",["domainservice","policy","service"]],["application-service",["application","applicationservice","usecase"]],["infrastructure",["database","infra","infrastructure","persistence","repository"]],["presentation",["api","controller","http","presentation","ui","web"]],["composition",["bootstrap","composition","container","wiring"]]])],["layered",new Map([["presentation",["api","controller","http","presentation","ui","web"]],["domain",["application","business","domain","service"]],["data-source",["dao","data","database","db","persistence","repository"]],["composition",["bootstrap","composition","container","wiring"]]])]]),e0=new Map([["hexagonal",new Set(["adapter","composition"])],["clean",new Set(["framework","interface-adapter","composition"])],["onion",new Set(["infrastructure","presentation","composition"])],["layered",new Set(["data-source","presentation","composition"])]]);function e1(e,t){let r=new Set(e.graph.edges.filter(({data:e})=>"implements"===e.kind).map(({target:e})=>e)),n=new Set(e.graph.edges.filter(({data:e})=>"implements"===e.kind).map(({source:e})=>e)),i=new Map(e.graph.nodes.map(e=>[e.id,e.data])),a=new Set(e.graph.edges.filter(({data:e})=>"imports"===e.kind).filter(({target:e})=>i.get(e)?.classification==="vendor").map(({source:e})=>e));return e.graph.nodes.flatMap(e=>(function(e,t,r,n,i,a){var o;if("vendor"===(o=t).classification||"file"!==o.kind&&"class"!==o.kind&&"interface"!==o.kind&&"function"!==o.kind&&"type"!==o.kind)return[];let[s,c]=r.roles.map(({id:o})=>{var s,c,l,d,u,p,f,h,m,g,y,b,v,w,E,x,R;let k,S,A,I,P,C,O;return s=e,c=t,l=r.id,d=o,u=n,p=i,f=a,A=new Set([(h=c).semanticPath,h.name,h.path,h.filePath].filter(e=>void 0!==e).join(" ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(Boolean).flatMap(e6)),P=Math.min(.55,.32*(I=(eQ.get(l)?.get(d)??[]).filter(e=>A.has(e))).length),C=I.map(e=>({kind:"path",semanticPath:c.semanticPath,message:`Semantic name/path contains architecture hint "${e}".`,weight:.32})),O=(m=s,g=c,y=l,b=d,v=u,w=p,E=f,k=[],S=0,"hexagonal"===y&&"port"===b&&"interface"===g.kind&&v.has(m)&&(S+=.45,k.push({kind:"topology",semanticPath:g.semanticPath,message:"Interface is implemented by another source node, supporting a port role.",weight:.45})),"hexagonal"===y&&"adapter"===b&&w.has(m)&&(S+=.3,k.push({kind:"topology",semanticPath:g.semanticPath,message:"Source node implements an interface, supporting an adapter role.",weight:.3})),x=y,R=b,e0.get(x)?.has(R)&&E.has(m)&&(S+=.25,k.push({kind:"dependency",semanticPath:g.semanticPath,message:"Source node directly imports vendor code, supporting an outer-boundary role.",weight:.25})),{score:S,evidence:k}),{roleId:d,score:Math.min(1,P+O.score),evidence:[...C,...O.evidence]}}).sort((e,t)=>{var r,n;return t.score-e.score||(r=e.roleId,r<(n=t.roleId)?-1:+(r>n))});if(void 0===s||s.score<.3)return[];let l=Math.max(0,.15-Math.max(0,s.score-(c?.score??0)));return[{semanticPath:t.semanticPath,roleId:s.roleId,confidence:Math.round(1e3*Math.max(0,Math.min(1,s.score-l)))/1e3,evidence:s.evidence}]})(e.id,e.data,t,r,n,a))}function e6(e){return e.endsWith("ies")&&e.length>3?[e,`${e.slice(0,-3)}y`]:e.endsWith("s")&&!e.endsWith("ss")&&e.length>3?[e,e.slice(0,-1)]:[e]}let e2=["declarations","extends","implements","imports"];function e4(e){return 0===e.capabilities.length?e2:e2.filter(t=>!eZ(e,t))}var e3=e.i(71238),e8=e.i(72624);function e5(e){let t=new Map(e.nodes.map(({id:e})=>[e,[]]));for(let r of e.edges)t.get(r.source)?.push(r.target);for(let e of t.values())e.sort(e3.compareGraphIds);return t}function e7(e){let t=new Set(e.edges.filter(e=>e.source===e.target).map(e=>e.source));return(function(e){let t=e5(e),r=[],n=new Set;for(let i of e.nodes.map(({id:e})=>e).sort(e3.compareGraphIds))!function e(t,r,n,i){if(!n.has(t)){for(let a of(n.add(t),r.get(t)??[]))e(a,r,n,i);i.push(t)}}(i,t,n,r);let i=e5((0,e8.createGraph)({nodes:e.nodes,edges:e.edges.map(e=>({...e,source:e.target,target:e.source}))})),a=new Set,o=[];for(let e of[...r].reverse()){if(a.has(e))continue;let t=[];(function e(t,r,n,i){if(!n.has(t))for(let a of(n.add(t),i.push(t),r.get(t)??[]))e(a,r,n,i)})(e,i,a,t),o.push(t.sort(e3.compareGraphIds))}return o.sort((e,t)=>(0,e3.compareGraphIds)(e[0]??"",t[0]??""))})(e).filter(e=>e.length>1||void 0!==e[0]&&t.has(e[0]))}function e9(e,t){return e.id<t.id?-1:+(e.id>t.id)}function te(e){let t=[...e].sort(e9);var r=t;let n=tt(r.map(e=>e.id));if(null!==n)throw Error(`Duplicate RuleSet ID: ${n}`);let i=t.flatMap(e=>e.rules).sort((e,t)=>e9(e.identity,t.identity));return function(e){let t=tt(e.map(e=>e.identity.id));if(null!==t)throw Error(`Duplicate rule ID: ${t}`)}(i),{ruleSets:t,rules:i,ruleById:new Map(i.map(e=>[e.identity.id,e]))}}function tt(e){let t=new Set;for(let r of e){if(t.has(r))return r;t.add(r)}return null}function tr(e,t){return{config:null,diagnostics:[{code:"invalid-config",message:e,...void 0===t?{}:{path:t}}]}}function tn(e,t,r,n){return{rule:null,diagnostics:[{code:e,message:`rules.json ${t} ${r}`,path:t,...void 0===n?{}:{ruleId:n}}]}}function ti(e){let{execution:t,...r}=e;return r}function ta(e,t){return e9({id:e},{id:t})}let to={id:"global",kind:"global"};function ts(e,t){return tc(e.ruleId,t.ruleId)||tc(e.code,t.code)}function tc(e,t){return e9({id:e},{id:t})}function tl(e){return Object.freeze({...e,diagnostics:Object.freeze(e.diagnostics.map(td)),findings:Object.freeze(e.findings.map(tu)),rule:Object.freeze({...e.rule}),scope:Object.freeze({...e.scope})})}function td(e){return Object.freeze({...e})}function tu(e){return Object.freeze({...e,evidence:function e(t){return Array.isArray(t)?Object.freeze(t.map(e)):null!==t&&"object"==typeof t?Object.freeze(Object.fromEntries(Object.entries(t).map(([t,r])=>[t,e(r)]))):t}(e.evidence),sourceLocation:void 0===e.sourceLocation?void 0:Object.freeze({...e.sourceLocation}),subjects:Object.freeze(e.subjects.map(e=>Object.freeze({...e})))})}function tp(e,t,r,n,i,a="not-executed"){return tl({diagnostics:i,execution:a,findings:n,rule:Object.freeze({...e.identity}),scope:Object.freeze({...t.scope}),status:r})}function tf(e,t,r={}){let n=function(e,t={}){var r,n;let i=t.scope??to,a=function(e){let t=new Map;for(let r of e){let e=t.get(r.identity.id)??[];t.set(r.identity.id,[...e,r])}return t}(e),o=(r=a,[...new Set(t.selection?.rootRuleIds??r.keys())].sort(tc)),s=function(e,t){let r=[...e],n=new Set,i=[];for(let p of r){var a,o,s,c,l,d,u;if(n.has(p))continue;n.add(p);let f=t.get(p)??[];if(0===f.length){i.push((a=p,{code:(o=e.includes(p))?"unknown-rule":"missing-dependency",message:o?`Selected rule "${a}" is not registered.`:`Rule dependency "${a}" is not registered.`,ruleId:a}));continue}if(f.length>1){i.push((s=p,{code:"ambiguous-rule-id",message:`Rule ID "${s}" is provided more than once.`,ruleId:s}));continue}let[h]=f;if(void 0!==h)for(let e of[...new Set(h.dependencies.map(e=>e.ruleId))].sort(tc)){let n=t.get(e)??[];0===n.length?i.push((c=h.identity.id,l=e,{code:"missing-dependency",message:`Rule "${c}" depends on unknown rule "${l}".`,ruleId:c})):n.length>1?i.push((d=h.identity.id,u=e,{code:"ambiguous-rule-id",message:`Rule "${d}" depends on ambiguous rule ID "${u}".`,ruleId:d})):r.push(e)}}return{diagnostics:i,ruleIds:[...n].sort(tc)}}(o,a),c=new Map(s.ruleIds.flatMap(e=>{var t,r,n;let o,s=(t=e,1===(o=a.get(t)??[]).length?o[0]??null:null);return null===s?[]:[[e,(r=s,n=i,{dependencyRuleIds:[...new Set(r.dependencies.map(e=>e.ruleId))].sort(tc),facets:function(e){let t=new Map;for(let r of e.facets??[]){let n={id:r.id,value:r.value,version:r.version??e.identity.version};t.set(JSON.stringify(n),n)}return[...t.values()].sort((e,t)=>tc(e.id,t.id)||tc(e.value,t.value)||tc(e.version,t.version))}(r),id:JSON.stringify([r.identity.id,r.identity.version,n.kind,n.id]),rule:r.identity,scope:n})]]})),l=new Set((function(e){let t=new Set,r=new Map,n=new Map,i=[],a=[],o=s=>{let c=r.size;for(let a of(r.set(s,c),n.set(s,c),i.push(s),t.add(s),e.get(s)?.dependencyRuleIds??[])){if(!e.has(a))continue;let i=r.get(a);void 0===i?(o(a),n.set(s,Math.min(n.get(s)??c,n.get(a)??c))):t.has(a)&&n.set(s,Math.min(n.get(s)??c,i))}if(n.get(s)!==c)return;let l=i.splice(i.lastIndexOf(s));for(let e of l)t.delete(e);a.push(l.sort(tc))};for(let t of[...e.keys()].sort(tc))r.has(t)||o(t);return a})(n=c).filter(e=>(function(e,t){if(e.length>1)return!0;let[r]=e;return void 0!==r&&(t.get(r)?.dependencyRuleIds.includes(r)??!1)})(e,n)).flat()),d=function(e,t){let r=[...e.keys()].filter(e=>!t.has(e)),n=new Map(r.map(r=>[r,(e.get(r)?.dependencyRuleIds??[]).filter(r=>e.has(r)&&!t.has(r)).length])),i=new Map;for(let t of r)for(let r of e.get(t)?.dependencyRuleIds??[]){if(!n.has(r))continue;let e=i.get(r)??[];i.set(r,[...e,t])}let a=r.filter(e=>0===n.get(e)).sort(tc),o=[];for(;a.length>0;){let e=a.shift();if(void 0!==e)for(let t of(o.push(e),i.get(e)??[])){let e=(n.get(t)??0)-1;n.set(t,e),0===e&&(a.push(t),a.sort(tc))}}let s=[...e.keys()].filter(e=>!o.includes(e)).sort(tc);return[...o,...s].flatMap(t=>{let r=e.get(t);return void 0===r?[]:[r]})}(c,l);return{diagnostics:[...s.diagnostics,...[...l].sort(tc).map(e=>({code:"cycle",message:`Rule "${e}" participates in a dependency cycle.`,ruleId:e}))].sort(ts),nodes:d,rootRuleIds:o}}(t,r),i=new Map(t.map(e=>[e.identity.id,e])),a=function(e){let t=new Map;for(let r of e){let e=t.get(r.ruleId)??[];t.set(r.ruleId,[...e,r])}return t}(n.diagnostics),o=new Set(r.capabilities??[]),s=new Set(r.disabledRuleIds??[]),c=new Map;for(let t of n.nodes){let n=i.get(t.rule.id);if(void 0===n)continue;let l=function(e,t,r,n,i,a,o,s){let c=function(e,t,r){let n=r.filter(e=>"ambiguous-rule-id"===e.code||"cycle"===e.code||"missing-dependency"===e.code);return 0===n.length?null:tp(e,t,"ERROR",[],n)}(t,r,n);if(null!==c)return c;if(o.has(t.identity.id)){var l;return tp(l=t,r,"INCOMPLETE",[],[{code:"disabled-dependency",message:`Rule "${l.identity.id}" is disabled for this evaluation.`,ruleId:l.identity.id}])}let d=function(e,t){return e.dependencyRuleIds.flatMap(e=>{let r=t.get(e);return void 0===r?[]:[r]})}(r,i),u=function(e,t,r){let n=t.dependencyRuleIds.filter(e=>!r.some(t=>t.rule.id===e));if(n.length>0)return tp(e,t,"ERROR",[],n.map(t=>({code:"dependency-error",message:`Rule "${e.identity.id}" could not receive result for dependency "${t}".`,ruleId:e.identity.id})));let i=r.filter(e=>"ERROR"===e.status).map(e=>e.rule.id);return i.length>0?tp(e,t,"ERROR",[],i.map(t=>({code:"dependency-error",message:`Rule "${e.identity.id}" depends on errored rule "${t}".`,ruleId:e.identity.id}))):function(e,t,r){let n=r.filter(e=>"INCOMPLETE"===e.status||"SKIPPED"===e.status).map(e=>e.rule.id);return 0===n.length?null:tp(e,t,"INCOMPLETE",[],n.map(t=>({code:"dependency-incomplete",message:`Rule "${e.identity.id}" depends on incomplete rule "${t}".`,ruleId:e.identity.id})))}(e,t,r)}(t,r,d);if(null!==u)return u;let p=s.optionsByRuleId?.get(t.identity.id),f=function(e,t,r,n){let i=(e.requiredCapabilities??[]).filter(e=>!r.has(e));if(i.length>0)return tp(e,t,"INCOMPLETE",[],i.map(t=>({code:"missing-capability",ruleId:e.identity.id,message:`Rule "${e.identity.id}" requires unavailable capability "${t}".`})));try{let r=e.validateOptions?.(n)??[];return 0===r.length?null:tp(e,t,"ERROR",[],r.map(t=>({code:"invalid-options",ruleId:e.identity.id,message:`Rule "${e.identity.id}": ${t.message}`})))}catch{var a;return tp(e,t,"ERROR",[],[{code:"rule-error",ruleId:(a=e).identity.id,message:`Rule "${a.identity.id}" threw while the evaluator invoked it.`}])}}(t,r,a,p);if(null!==f)return f;let h=void 0===s.cache?null:void 0===s.cachePartition||void 0===s.factsVersion?null:{capabilities:[...new Set(s.capabilities??[])].sort(ta),dependencyResults:d.map(ti),factsVersion:s.factsVersion,options:s.optionsByRuleId?.get(r.rule.id),partition:s.cachePartition,rule:r.rule,scope:r.scope},m=null===h?void 0:function(e,t,r){try{var n,i;let a=e?.read(t);return void 0!==a&&(n=a,i=r,n.rule.id===i.rule.id&&n.rule.version===i.rule.version&&n.scope.id===i.scope.id&&n.scope.kind===i.scope.kind)?a:void 0}catch{return}}(s.cache,h,r);return void 0!==m?tl({...m,execution:"cache-hit"}):function(e,t,r,n,i,a,o){try{let s=t.evaluate({context:e,dependencyResults:Object.freeze([...n]),options:i,scope:r.scope}),c=tp(t,r,s.status,s.findings.map(e=>{var r,n,i;return r=e,n=t.identity.id,i=t.defaultSeverity,{...r,ruleId:n,severity:i,subjects:[...r.subjects].sort(e9)}}),[],"evaluated");if(null!==o)try{a?.write(o,c)}catch{}return c}catch{var s;return tp(t,r,"ERROR",[],[{code:"rule-error",ruleId:(s=t).identity.id,message:`Rule "${s.identity.id}" threw while the evaluator invoked it.`}],"evaluated")}}(e,t,r,d,p,s.cache,h)}(e,n,t,a.get(t.rule.id)??[],c,o,s,r);c.set(t.rule.id,l)}let l=n.nodes.flatMap(e=>{let t=c.get(e.rule.id);return void 0===t?[]:[t]});return{diagnostics:[...n.diagnostics.filter(e=>!c.has(e.ruleId)),...l.flatMap(th)].sort(tm),findings:l.flatMap(e=>e.findings),plan:n,results:l}}function th(e){return e.diagnostics.map(t=>({...t,ruleId:t.ruleId??e.rule.id}))}function tm(e,t){return e9({id:e.ruleId},{id:t.ruleId})||e9({id:e.code},{id:t.code})}function tg(e,t,r,n={}){var i;let a,o=function(e,t={}){let r=function(e){var t;let r;if(!f(e))return tr("rules.json must contain an object.");if(1!==e.version)return tr('rules.json "version" must be 1.',"version");if(!Array.isArray(e.rules))return tr('rules.json "rules" must be an array.',"rules");let n=e.rules.map((e,t)=>{var r,n,i,a;let o;return r=e,n=t,o=`rules[${n}]`,f(r)?"string"==typeof(i=r.id)&&i.trim().length>0?"boolean"!=typeof r.enabled?tn("invalid-config",`${o}.enabled`,'must define boolean "enabled".',r.id):void 0!==r.severity&&"error"!==(a=r.severity)&&"info"!==a&&"warning"!==a?tn("invalid-severity",`${o}.severity`,'has an invalid "severity".',r.id):void 0!==r.options&&!function e(t){return null===t||"boolean"==typeof t||"string"==typeof t||("number"==typeof t?Number.isFinite(t):Array.isArray(t)?t.every(e):f(t)&&Object.values(t).every(e))}(r.options)?tn("invalid-options",`${o}.options`,'has non-serializable "options".',r.id):{diagnostics:[],rule:{id:r.id,enabled:r.enabled,...void 0===r.severity?{}:{severity:r.severity},...void 0===r.options?{}:{options:r.options}}}:tn("invalid-rule-id",`${o}.id`,'must define a non-empty "id".'):tn("invalid-config",o,"must be an object.")}),i=n.flatMap(e=>e.diagnostics);if(i.length>0)return{config:null,diagnostics:i};let a=n.flatMap(e=>null===e.rule?[]:[e.rule]),o=(t=a,r=new Set,t.flatMap(e=>r.has(e.id)?[e.id]:(r.add(e.id),[])));return o.length>0?{config:null,diagnostics:o.map(e=>({code:"invalid-rule-id",message:`rules.json configures rule "${e}" more than once.`,path:"rules",ruleId:e}))}:{config:{version:1,rules:a},diagnostics:[]}}(e);if(null===r.config)return r;let n=function(e,t){let{registry:r}=t;if(void 0===r)return[];let n=new Set(t.capabilities??[]);return e.rules.reduce((e,i,a)=>{if(!i.enabled)return e;let o=r.ruleById.get(i.id);return void 0===o?[...e,{code:"unknown-rule",message:`rules.json configures unknown rule "${i.id}".`,path:`rules[${a}].id`,ruleId:i.id}]:[...e,...(void 0===t.capabilities?[]:(o.requiredCapabilities??[]).filter(e=>!n.has(e))).map(e=>({code:"missing-capability",message:`Rule "${o.identity.id}" requires unavailable capability "${e}".`,path:`rules[${a}]`,ruleId:o.identity.id})),...function(e,t,r){try{return(e.validateOptions?.(t.options)??[]).map(t=>({code:"invalid-options",message:`Rule "${e.identity.id}": ${t.message}`,ruleId:e.identity.id,...void 0===t.path?{}:{path:`rules[${r}].options.${t.path}`}}))}catch{return[{code:"rule-error",message:`Rule "${e.identity.id}" threw while validating its options.`,path:`rules[${r}].options`,ruleId:e.identity.id}]}}(o,i,a)]},[])}(r.config,t);return{config:0===n.length?r.config:null,diagnostics:n}}(t,{registry:r,capabilities:n.capabilities});if(null===o.config)return{findings:[],diagnostics:o.diagnostics.map(ty),plan:{diagnostics:[],nodes:[],rootRuleIds:[]},results:[]};let s=o.config.rules.filter(e=>e.enabled),c=new Map(s.map(e=>[e.id,e.options])),l=s.map(e=>e.id).filter(e=>r.ruleById.has(e)),d=tf(e,r.rules,{cache:n.cache,cachePartition:n.cachePartition,capabilities:n.capabilities,disabledRuleIds:r.rules.map(e=>e.identity.id).filter(e=>!l.includes(e)),optionsByRuleId:c,selection:{rootRuleIds:l},factsVersion:n.factsVersion,scope:n.scope}),u=(i=d.results,a=new Map(o.config.rules.map(e=>[e.id,e.severity])),i.map(e=>({...e,findings:e.findings.map(e=>({...e,severity:a.get(e.ruleId)??e.severity}))})));return{diagnostics:d.diagnostics,findings:u.flatMap(e=>e.findings),plan:d.plan,results:u}}function ty(e){return{code:"missing-capability"===e.code?"missing-capability":"unknown-rule"===e.code?"unknown-rule":"invalid-options"===e.code?"invalid-options":"rule-error"===e.code?"rule-error":"invalid-config",ruleId:e.ruleId??"rules.config",message:e.message}}function tb(e){let t=eV.find(({id:t})=>t===e);if(void 0===t)throw Error(`Unknown architecture model: ${e}`);return t}function tv(e,t){return`${e}\u0000${t}`}function tw(e,t,r,n,i){let a=e;for(;void 0!==a;){if("package"===t&&r.get(a)?.kind==="file"){let e=n.get(a);if(void 0!==e)return e}if(r.get(a)?.kind===t)return a;a=i.parentByNodeId.get(a)}let o=r.get(e)?.classification;return"vendor"===o||"unknown"===o?e:void 0}function tE(){return{identity:{id:"cyclic-dependencies",version:"1"},facets:[{id:"architecture-rule-kind",value:"cycle",version:"1"}],summary:"Source dependencies must not form cyclic intrinsic components.",defaultSeverity:"warning",dependencies:[],requiredCapabilities:["source-graph.imports"],validateOptions:tx,evaluate:({context:e,options:t})=>{var r,n,i,a,o;let s,c,l,d,u,p,f,h;return{findings:o=(r=e.graph,h=new Map((f="file"===(n=function(e){if(!tR(e))return"file";let{aggregation:t}=e;return"package"===t?"package":"file"}(t))?(s=new Set((i=r).graph.nodes.filter(({data:e})=>"file"===e.kind&&"intrinsic"===e.classification).map(({id:e})=>e)),c=i.graph.edges.filter(({source:e,target:t,data:r})=>"imports"===r.kind&&s.has(e)&&s.has(t)),{graph:{nodes:i.graph.nodes.filter(({id:e})=>s.has(e)),edges:c.map(({id:e,source:t,target:r})=>({id:e,source:t,target:r,data:{}}))},evidence:c.map(({id:e,source:t,target:r})=>({source:t,target:r,sourceSemanticPath:"",targetSemanticPath:"",weight:1,evidenceEdgeIds:[e]}))}):(l=function(e){let t=new Map,r=new Map,n=new Map,i=new Map,a=new Map,o=new Map,s=new Map;for(let s of e.graph.nodes){var c,l,d,u;if(t.set(s.id,s),r.set(s.data.semanticPath,s),a.set(s.id,[]),o.set(s.id,[]),"file"===s.data.kind&&void 0!==s.data.path&&n.set(tv(s.data.projectId,s.data.path),s),void 0!==s.data.filePath&&"project"!==(c=s.data.kind)&&"package"!==c&&"directory"!==c&&"file"!==c){let e=(l=s.data.projectId,d=s.data.filePath,u=s.data.name,`${tv(l,d)}\u0000${u}`);i.set(e,[...i.get(e)??[],s])}}for(let t of e.graph.edges)if(o.get(t.source)?.push(t),a.get(t.target)?.push(t),"contains"===t.data.kind){let e=s.get(t.target);if(void 0!==e&&e!==t.source)throw Error(`Source node ${t.target} has multiple containment parents.`);s.set(t.target,t.source)}return{nodeById:t,nodeBySemanticPath:r,fileByPath:n,symbolsByFileAndName:i,incomingByNodeId:a,outgoingByNodeId:o,parentByNodeId:s}}(a=r),d=function(e,t,r,n="imports"){let i=new Map(e.graph.nodes.map(e=>[e.id,e.data])),a=new Map(e.graph.edges.flatMap(e=>"declares-in"===e.data.kind?[[e.source,e.target]]:[])),o=new Map;for(let s of e.graph.edges){if(s.data.kind!==n)continue;let e=tw(s.source,r,i,a,t),c=tw(s.target,r,i,a,t);if(void 0===e||void 0===c||e===c)continue;let l=i.get(e)?.semanticPath,d=i.get(c)?.semanticPath;if(void 0===l||void 0===d)continue;let u=`${e}\u0000${c}`,p=o.get(u);o.set(u,{source:e,target:c,sourceSemanticPath:l,targetSemanticPath:d,weight:(p?.weight??0)+1,evidenceEdgeIds:[...p?.evidenceEdgeIds??[],s.id]})}return[...o.values()].sort((e,t)=>e.source-t.source||e.target-t.target)}(a,l,"package","imports"),u=new Set(a.graph.nodes.filter(({data:e})=>"package"===e.kind&&"vendor"!==e.classification&&"unknown"!==e.classification).map(({id:e})=>e)),p=d.filter(({source:e,target:t})=>u.has(e)&&u.has(t)),{graph:{nodes:a.graph.nodes.filter(({id:e})=>u.has(e)),edges:p.map(({source:e,target:t},r)=>({id:r,source:e,target:t,data:{}}))},evidence:p})).graph.nodes.map(e=>[e.id,e.data])),e7(f.graph).map(e=>{let t=new Set(e),r=e.flatMap(e=>{let t=h.get(e);return void 0===t?[]:[t.semanticPath]}).sort(),i=f.evidence.filter(({source:e,target:r})=>t.has(e)&&t.has(r)).flatMap(({evidenceEdgeIds:e})=>e).sort((e,t)=>e-t);return{ruleId:"cyclic-dependencies",severity:"warning",message:`Cyclic ${n} dependency component: ${r.join(" -> ")}`,subjects:r.map(e=>({id:e,kind:"source-node",path:e})),evidence:{aggregation:n,evidenceEdgeIds:i,relationKind:"imports",semanticPaths:r}}})),status:0===o.length?"PASS":"FAIL"}}}}function tx(e){if(void 0===e)return[];if(!tR(e))return[{code:"invalid-options",message:"Options must be an object."}];let{aggregation:t}=e;return void 0===t||"file"===t||"package"===t?[]:[{code:"invalid-options",message:'aggregation must be "file" or "package".',path:"aggregation"}]}function tR(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let tk=[["imports","imports"],["extends","extends"],["implements","implements"]],tS=[["imports","source-graph.imports"],["extends","source-graph.extends"],["implements","source-graph.implements"]],tA=[{id:"ankhorage",name:"Ankhorage Hexagonal Profile",baseModelId:"hexagonal",interpretation:"Ankhorage uses feature-first ownership with explicit inward roles and thin package-level delivery edges on top of Hexagonal Architecture.",source:{featureRoot:"src/features",facadeFiles:["index.ts"],packageWideDirectories:["constants","types","utils"],deliveryEdgeDirectories:["app","cli","host","platform"],inwardFeatureRoles:["application","contracts","domain","planning","ports"],roles:[{id:"domain",segments:["domain","core"],forbiddenOutwardSegments:["adapters","app","application","cli","composition","host","infrastructure","platform"],ruleId:"package.architecture.domain-outward-import.disallowed",label:"Domain/core policy"},{id:"application",segments:["application"],forbiddenOutwardSegments:["adapters","app","cli","composition","host","infrastructure","platform"],ruleId:"package.architecture.application-outward-import.disallowed",label:"Application/use-case code"},{id:"ports",segments:["ports"],forbiddenOutwardSegments:["adapters","app","cli","composition","host","infrastructure","platform"],ruleId:"package.architecture.port-outward-import.disallowed",label:"Port contracts"}],featureCombinations:[{role:"adapters",requiresAnyOf:["application","contracts","domain","planning","ports"],ruleId:"package.architecture.role-combination.invalid"},{role:"composition",requiresAnyOf:["adapters","application","planning","ports"],ruleId:"package.architecture.role-combination.invalid"}],thinDeliveryAdapter:{pathSegments:["cli","commands"],concreteAdapterSegment:"adapters",ruleId:"package.architecture.delivery-concrete-adapter-import.disallowed"}}}];function tI(e){let[t]=tA;if(void 0===t)throw Error("Unknown architecture profile: "+e);return t}function tP(e){return tC(e.ruleId,e.label+" must not import outward implementation roles.",({graph:t})=>tj(t).flatMap(({edge:t,sourcePath:r,targetPath:n})=>{if(!tT(r).some(t=>e.segments.includes(t)))return[];let i=tT(n).find(t=>e.forbiddenOutwardSegments.includes(t));return void 0===i?[]:[tO(e.ruleId,e.label+" must not import outward "+i+"/ implementation.",r,{outwardRole:i,sourcePath:r,targetPath:n},t$(t))]}),!0)}function tC(e,t,r,n=!1){return{identity:{id:e,version:"1"},facets:[{id:"architecture-rule-kind",value:"profile",version:"1"}],summary:t,defaultSeverity:"error",dependencies:[],...n?{requiredCapabilities:["source-graph.imports"]}:{},evaluate:({context:e})=>{var t;return{findings:t=r(e),status:0===t.length?"PASS":"FAIL"}}}}function tO(e,t,r,n,i){return{ruleId:e,severity:"error",message:t,subjects:[{id:r,kind:"source-file",path:r}],evidence:n,sourceLocation:i?.location===void 0?void 0:{...i.location,path:i.sourcePath}}}function t_(e){return e.graph.nodes.flatMap(({data:e})=>{if("file"!==e.kind||"vendor"===e.classification)return[];let t=tM(e);return t?.startsWith("src/")===!0?[t]:[]})}function tj(e){let t=new Map(e.graph.nodes.map(e=>[e.id,e.data]));return e.graph.edges.flatMap(e=>{if("imports"!==e.data.kind)return[];let r=t.get(e.source),n=t.get(e.target);if(void 0===r||void 0===n)return[];let i=tM(r),a=tM(n);return void 0===i||void 0===a?[]:[{edge:e,sourcePath:i,targetPath:a}]})}function tM(e){return e.path??e.filePath}function t$(e){return e.data.evidence[0]}function tT(e){return e.split("/").filter(Boolean)}let tL={version:1,rules:[{id:"architecture-dependency-direction",enabled:!0}]},tz=(e=process.env.ATLAS_PROJECT_PATH)=>{if(!e)throw Error("Missing ENV: ATLAS_PROJECT_PATH");return _(e)};function tD(e){return"package"===e.kind&&e.focus&&(void 0===e.path||"."===e.path)}function tN(e){return`repository.${encodeURIComponent(e).replaceAll(".","%2E")}`}function tU(e){return e.replaceAll("/",".").replace(/^\.+|\.+$/g,"")}function tH(e){return e.includes(".")?e.split(".").slice(0,-1).join("."):""}function tF(e){let t=e?.trim();if(t)return t}function tG(e,t=""){return Object.entries(e).sort(tq).map(([e,r])=>{let n=t?`${t}/${e}`:e;if(tB(r))return{graphPackage:r.package,id:`file:${n}`,kind:"file",label:e};let i=tG(r,n);return{children:i,graphPackage:function(e){let[t,...r]=e.map(e=>e.graphPackage).filter(e=>e.length);if(!t)return"";let n=t.split("."),i=n.findIndex((e,t)=>r.some(r=>r.split(".").at(t)!==e)),a=-1===i?n.length:i;return n.slice(0,a).join(".")}(i),id:`directory:${n}`,kind:"directory",label:e}})}function tq([e,t],[r,n]){return Number(tB(t))-Number(tB(n))||e.localeCompare(r)}function tB(e){return"path"in e&&"string"==typeof e.path&&"package"in e}function tW(e){return`repository.${encodeURIComponent(e).replaceAll(".","%2E")}`}function tJ(e,t){return e.map(e=>{var r,n;return t.get(e.id)??(n="failed",{repository:{id:(r=e).id,name:r.name,owner:r.owner},status:n,..."successful"===n?{}:{description:"cancelled"===n?"Loading was cancelled.":"Repository materialization failed."}})}).toSorted((e,t)=>Number("successful"===e.status)-Number("successful"===t.status))}function tX(e,t){return{repository:{id:e.id,name:e.name,owner:e.owner},status:t,..."successful"===t?{}:{description:"cancelled"===t?"Loading was cancelled.":"Repository materialization failed."}}}async function tK(e,t,r,n){if(!Number.isSafeInteger(t)||t<1)throw Error("Concurrency must be a positive integer.");let i=e.map((e,t)=>({input:e,index:t}));return(await Promise.all(Array.from({length:Math.min(t,e.length)},async()=>{let e=[];for(;;){let t=i.shift();if(void 0===t)return e;if(n?.aborted){e.push({index:t.index,outcome:{status:"rejected",reason:n.reason??new DOMException("The workspace request was cancelled.","AbortError")}});continue}try{e.push({index:t.index,outcome:{status:"fulfilled",value:await r(t.input,n)}})}catch(r){e.push({index:t.index,outcome:{status:"rejected",reason:r}})}}}))).flat().sort((e,t)=>e.index-t.index).map(e=>e.outcome)}async function tZ(e,t,r,n,i){let a=e.generation+1;e.generation=a;let o=await tK(t,4,n,i);if(e.generation!==a)throw new DOMException("A newer workspace operation superseded this one.","AbortError");for(let[r,n]of o.entries()){var s;let i=t.at(r);void 0!==i&&("fulfilled"===n.status?(e.entries.set(i.id,n.value),e.statuses.set(i.id,tX(i,"successful"))):e.statuses.set(i.id,tX(i,((s=n.reason)instanceof DOMException?"AbortError"===s.name:s instanceof Error&&"AbortError"===s.name)?"cancelled":"failed")))}return function(e){var t,r,n,i,a;let o=(r=e.repositories,n=e.entries,r.flatMap(e=>{let t=n.get(e.id);return void 0===t?[]:[{entry:t,repository:e}]}));if(0===o.length){return{currentSource:(i=e).source,projectName:"GitHub workspace",repositoryStatuses:tJ(i.repositories,i.statuses),runtimeId:i.runtimeId,workspace:{ok:!1,error:"No selected GitHub repositories could be analyzed."}}}let s=o.map(({entry:e})=>e.analysis),c=(0,g.createSourceGraphFromProjectAnalysisSnapshots)(s),l=b(c,s),d=function(e,t,r){let[n]=e;return{files:n.entry.files,language:n.entry.language,packageGraph:function(e,t=new Map){let r=new Map,n=new Map;for(let i of e.nodes){let e=function(e,t){let r=void 0===e.projectId?void 0:t.get(e.projectId);return void 0!==r?function(e,t){let r=tN(e);if(tD(t))return r;let n=tF(t.path)??tF(t.packageName)??tF(t.label);if(void 0!==n)return`${r}.${t.kind}.${tU(n)}`}(r.id,e):"module"===e.kind?tF(e.path):e.focus&&(void 0===e.path||"."===e.path)?void 0:tF(e.packageName)??tF(e.label)}(i.data,t);void 0!==e&&(r.set(i.id,e),n.has(e)||n.set(e,function(e,t,r){let n=void 0===t.projectId?void 0:r.get(t.projectId),i=void 0!==n||"intrinsic"===t.classification||t.focus,a=void 0===n?"module"===t.kind?t.parentPath??tH(e):tH(e):function(e,t){let r=tN(e);if(tD(t))return"";let n="module"===t.kind?t.parentPath:tH(t.path??"");return n?`${r}.${t.kind}.${tU(n)}`:r}(n.id,t),o=void 0!==n&&tD(t)?n.label:t.label;return{id:e,data:{classification:t.classification,path:e,parent:a,label:o,name:t.packageName??t.label,...void 0===n?{}:{repositoryId:n.id,repositoryLabel:n.label},...i?{isIntrinsic:!0}:{},..."package"===t.kind&&t.focus?{isWorkspaceRoot:!0}:{}}}}(e,i.data,t)))}let i=new Map;for(let t of e.edges){let e=r.get(t.source),n=r.get(t.target);if(void 0===e||void 0===n||e===n)continue;let a=`${e}->${n}`,o=i.get(a);i.set(a,{id:a,source:e,target:n,data:{weight:(o?.data.weight??0)+t.data.weight,evidence:[...o?.data.evidence??[],...t.data.evidence]}})}return{nodes:[...n.values()],edges:[...i.values()]}}(r,new Map(e.map(({repository:e})=>[e.id,{id:e.id,label:e.name}]))),projectPath:"",sourceGraph:t,timeStart:Date.now()}}(o,c,l);return{currentSource:e.source,projectName:1===o.length?o[0].repository.name:"GitHub workspace",repositoryStatuses:tJ(e.repositories,e.statuses),runtimeId:e.runtimeId,workspace:{ok:!0,value:{evaluation:(t={audit:function(e,t={},r={}){var n,i,a,o;let s,c,l,d=function(e={}){let t="block";for(let r of e.rules??[])if("cyclic-dependencies"===r.id)t=r.mode;else throw Error(`Unknown audit rule "${r.id}".`);return{...void 0===e.architectureTarget?{}:{architectureTarget:e.architectureTarget},failOnRuleViolation:e.failOnRuleViolation??!0,rules:[{id:"cyclic-dependencies",mode:t}]}}(t),u=function(e,t){var r;let n,i,a=(n=new Set((r=t).nodes.map(e=>e.id)),i=r.nodes.flatMap(e=>{let{parent:t}=e.data;if(""===t||!n.has(t))return[];let i=`${t}->${e.id}`;return r.edges.some(e=>e.id===i)?[]:[{data:{evidence:[],weight:1},id:i,source:t,target:e.id}]}),{edges:[...r.edges,...i],nodes:r.nodes}),o=e7(a),s=function e(t){return Object.values(t).flatMap(t=>{var r;return"path"in(r=t)&&"string"==typeof r.path&&"package"in r?[t]:e(t)})}(e),c=[],l=new Set;for(let e of o){e.forEach(e=>l.add(e));let t=[...function(e,t){let r=new Set(t??e.nodes.map(({id:e})=>e)),n=new Set(e.nodes.map(({id:e})=>e)),i=e.nodes.map(({id:e})=>e).filter(e=>r.has(e)).sort(e3.compareGraphIds),a=function(e,t,r){let n=new Map(e.nodes.map(({id:e})=>e).filter(e=>r.has(e)).map(e=>[e,[]]));for(let i of e.edges)t.has(i.source)&&t.has(i.target)&&r.has(i.source)&&r.has(i.target)&&n.get(i.source)?.push(i.target);for(let e of n.values())e.sort(e3.compareGraphIds);return n}(e,n,r);for(let e of i){var o;let t=function e(t,r,n,i,a){let o=[...i,r],s=new Set(a).add(r);for(let i of n.get(r)??[]){if(i===t)return[...o,t];if(s.has(i))continue;let r=e(t,i,n,o,s);if(null!==r)return r}return null}(o=e,o,a,[],new Set);if(null!==t)return t}return null}(a,e)??[...e,e[0]]];c.push({packages:t,displayPackages:t.map(e=>a.nodes.find(t=>t.id===e)?.data.label??e),projects:function(e,t){let r=new Map;for(let n of t){let t=e.nodes.find(e=>e.id===n)?.data;t?.repositoryId!==void 0&&void 0!==t.repositoryLabel&&r.set(t.repositoryId,{id:t.repositoryId,label:t.repositoryLabel})}return[...r.values()].toSorted((e,t)=>e.id.localeCompare(t.id))}(a,t),edges:t.slice(0,-1).map((e,r)=>(function(e,t,r,n){let i=e.edges.find(e=>e.source===r&&e.target===n);return{from:r,to:n,via:i?.data.evidence.map(e=>(function(e,t){let r=function(e,t){return e.find(e=>t===e.path||t.endsWith(`/${e.path}`))}(e,t.sourceFile),n=r?.path??t.sourceFile;return{filePath:n,fileClass:r?.className??A.default.basename(n,A.default.extname(n)),importName:t.specifier,isIntrinsic:"intrinsic"===t.classification||"focus"===t.classification}})(t,e))??[]}})(a,s,e,t[r+1]))})}return{cycles:c,packageSet:l,graph:t}}(e.files,e.packageGraph).cycles,p=function(e){var t,r,n,i;let a,o,s,c=(t=e.configuration.rules,t.find(e=>"cyclic-dependencies"===e.id)?.mode??"off");if("off"===c)return{genericRules:{diagnostics:[],findings:[],plan:{diagnostics:[],nodes:[],rootRuleIds:[]},results:[]},rules:[]};let l={id:"architecture.graph",rules:[tE()]},d=tf({graph:e.sourceGraph},l.rules,{capabilities:0===(a=new Set((r=e.sourceGraph).capabilities.map(({projectId:e})=>e))).size?[]:[...a].every(e=>r.capabilities.some(t=>t.projectId===e&&t.available.includes("imports")))?["source-graph.imports"]:[],optionsByRuleId:new Map([["cyclic-dependencies",{aggregation:"package"}]])});return{genericRules:d,rules:[(n=e.cyclicPackages,i=c,{id:"cyclic-dependencies",status:(s=(o=d.findings.filter(({ruleId:e})=>"cyclic-dependencies"===e)).length>0)?"failed":"passed",policy:"block"===i?"blocking":"advisory",message:s?`Detected ${o.length} cyclic package dependenc${1===o.length?"y":"ies"}.`:"No cyclic package dependencies detected.",details:n.map(e=>e.packages.join(" → ")),evidence:{cycles:n}})]}}({configuration:d,cyclicPackages:u,sourceGraph:e.sourceGraph}),f=(n=e.sourceGraph,{candidates:eV.map(e=>{var t,r,i,a,o,s,c,l,d,u,p,f;let h,m,g,y,b,v,w,E,x,R,k,S;return E=e1(t=n,r=e),R=(x=(i=t,a=r,h=new Map(E.map(e=>[e.semanticPath,e])),m=new Map(i.graph.nodes.map(e=>[e.id,e.data])),i.graph.edges.flatMap(e=>{if("imports"!==e.data.kind&&"extends"!==e.data.kind&&"implements"!==e.data.kind)return[];let t=m.get(e.source),r=m.get(e.target);if(void 0===t||void 0===r)return[];let n=h.get(t.semanticPath),i=h.get(r.semanticPath);if(void 0===n||void 0===i)return[];let o=a.allowedDependencies.some(e=>e.source===n.roleId&&e.target===i.roleId);return[{edge:e,source:t,target:r,sourceRole:n,targetRole:i,allowed:o}]}))).filter(({allowed:e})=>e),k=x.filter(({allowed:e})=>!e).map(({edge:e,source:t,target:r,sourceRole:n,targetRole:i})=>{var a,o,s,c,l;return a=e.data.kind,o=t.semanticPath,s=r.semanticPath,c=n,l=i,{relationKind:a,sourceSemanticPath:o,targetSemanticPath:s,sourceRole:c.roleId,targetRole:l.roleId,message:`${c.roleId} -> ${l.roleId} is not allowed by the inferred model.`}}),S=(o=t,s=r,c=E,l=x,d=R,y=0===(g=o.graph.nodes.filter(({data:e})=>{var t;return"vendor"!==(t=e).classification&&("file"===t.kind||"class"===t.kind||"interface"===t.kind||"function"===t.kind||"type"===t.kind)}).length)?0:c.length/g,b=0===c.length?0:c.reduce((e,t)=>e+t.confidence,0)/c.length,v=0===l.length?.5:d.length/l.length,w=new Set(c.map(({roleId:e})=>e)).size,Math.round(1e3*Math.max(0,Math.min(1,(.35*b+.25*y+.25*v+.15*(0===s.roles.length?0:w/s.roles.length))*(1-e4(o).length/(2*e2.length)))))/1e3),{modelId:r.id,confidence:S,score:Math.round(100*S),roleAssignments:E,supportingEvidence:(u=E,p=R.length,f=x.length,[...u.filter(({confidence:e})=>e>=.45).slice(0,20).map(({semanticPath:e,roleId:t,confidence:r})=>({kind:"topology",semanticPath:e,message:`Inferred role "${t}" with confidence ${r}.`,weight:r})),...0===f?[]:[{kind:"dependency",message:`${p} of ${f} classified dependencies follow this model's direction.`,weight:p/f}]]),contradictions:k,unavailableCapabilities:e4(t)}}).sort((e,t)=>{var r,n;return t.score-e.score||(r=e.modelId,r<(n=t.modelId)?-1:+(r>n))})}),h=function(e,t){if(void 0!==t)return"model"===t.kind?{target:t,result:function(e,t,r={}){var n;let i,a=tb(t),o=e1(e,a),s={graph:e,model:a,roleAssignments:o},c=(i=tb(t),{id:`architecture.${i.id}`,rules:[tE(),{identity:{id:"architecture-dependency-direction",version:"1"},facets:[{id:"architecture-rule-kind",value:"dependency-direction",version:"1"}],summary:"Classified source dependencies must follow the selected architecture model.",defaultSeverity:"warning",dependencies:[],evaluate:({context:e})=>{var t,r,n,i;let a,o,s,c;return s=(r=(t=e).graph,tk.flatMap(([e,t])=>eZ(r,t)?[e]:[])),{findings:c=(n=t,i=s,a=new Map(n.roleAssignments.map(e=>[e.semanticPath,e])),o=new Map(n.graph.graph.nodes.map(e=>[e.id,e.data])),n.graph.graph.edges.flatMap(e=>{if(!i.includes(e.data.kind))return[];let t=o.get(e.source),r=o.get(e.target);if(void 0===t||void 0===r)return[];let s=a.get(t.semanticPath),c=a.get(r.semanticPath);if(void 0===s||void 0===c||s.confidence<.3||c.confidence<.3||n.model.allowedDependencies.some(e=>e.source===s.roleId&&e.target===c.roleId))return[];let[l]=e.data.evidence;return[{ruleId:"architecture-dependency-direction",severity:"warning",message:`${s.roleId} must not depend on ${c.roleId} in ${n.model.name}.`,subjects:[{id:t.semanticPath,kind:t.kind,path:t.filePath??t.path},{id:r.semanticPath,kind:r.kind,path:r.filePath??r.path}],sourceLocation:l?.location===void 0?void 0:{...l.location,path:l.sourcePath},evidence:{modelId:n.model.id,relationKind:e.data.kind,sourceRole:s.roleId,sourceSemanticPath:t.semanticPath,targetRole:c.roleId,targetSemanticPath:r.semanticPath}}]})),status:s.length===tk.length?0===c.length?"PASS":"FAIL":"INCOMPLETE"}}}]}),l=0===(n=e).capabilities.length?[]:tS.flatMap(([e,t])=>eZ(n,e)?[t]:[]);return{...void 0===r.config?tf(s,c.rules,{cache:r.cache,cachePartition:r.cachePartition,capabilities:l,factsVersion:r.factsVersion,scope:{id:a.id,kind:"architecture-model"}}):tg(s,r.config,te([c]),{capabilities:l,scope:{id:a.id,kind:"architecture-model"}}),modelId:t,roleAssignments:o}}(e,t.id,{config:tL})}:{target:t,result:function(e,t,r={}){let n,i=tI(t),a={graph:e,profile:i},o={id:"architecture-profile."+(n=tI(t)).id,rules:[tC("package.architecture.feature-ownership.required","Implementation source must live below an owning feature, package-wide root, or delivery edge.",({graph:e,profile:t})=>t_(e).flatMap(e=>!function(e,t){let r=e.slice(4);if(t.source.facadeFiles.includes(r)||e===t.source.featureRoot||e.startsWith(t.source.featureRoot+"/"))return!0;let n=tT(r)[0]??"";return t.source.packageWideDirectories.includes(n)||t.source.deliveryEdgeDirectories.includes(n)}(e,t)?[tO("package.architecture.feature-ownership.required","Source implementation is outside canonical Ankhorage ownership: "+e+".",e,{path:e})]:[])),tC("package.architecture.role-combination.invalid","Feature architecture roles must form a meaningful inward/outward combination.",({graph:e,profile:t})=>[...(function(e,t){let r=t.source.featureRoot+"/",n=new Map;for(let t of t_(e)){if(!t.startsWith(r))continue;let[e,i]=tT(t.slice(r.length));if(void 0===e||void 0===i)continue;let a=n.get(e)??new Set;a.add(i),n.set(e,a)}return n})(e,t).entries()].flatMap(([e,r])=>t.source.featureCombinations.flatMap(n=>r.has(n.role)&&!n.requiresAnyOf.some(e=>r.has(e))?[tO(n.ruleId,n.role+"/ requires at least one inward role in feature "+e+".",t.source.featureRoot+"/"+e,{feature:e,role:n.role,requiresAnyOf:n.requiresAnyOf})]:[]))),...n.source.roles.map(tP),tC("package.architecture.delivery-concrete-adapter-import.disallowed","Thin delivery adapters must not wire concrete adapter implementations directly.",({graph:e,profile:t})=>{let r=t.source.thinDeliveryAdapter;return tj(e).flatMap(({edge:e,sourcePath:t,targetPath:n})=>{var i,a;let o=tT(t),s=tT(n);return(i=o,a=r.pathSegments,i.some((e,t)=>a.every((e,r)=>i[t+r]===e))&&s.includes(r.concreteAdapterSegment))?[tO(r.ruleId,"Thin delivery adapter must import an application operation or composition boundary instead of a concrete adapter.",t,{sourcePath:t,targetPath:n},t$(e))]:[]})},!0)]},s=eZ(e,"imports")?["source-graph.imports"]:[];return{...void 0===r.config?tf(a,o.rules,{cache:r.cache,cachePartition:r.cachePartition,capabilities:s,factsVersion:r.factsVersion,scope:{id:i.id,kind:"architecture-profile"}}):tg(a,r.config,te([o]),{capabilities:s,scope:{id:i.id,kind:"architecture-profile"}}),baseModelId:i.baseModelId,profileId:i.id}}(e,t.id)}}(e.sourceGraph,d.architectureTarget);return{configuration:d,evaluation:{architecture:f,...void 0===h?{}:{architectureEvaluation:h},cyclicPackages:u,genericRules:(a=p.genericRules,void 0===(o=h)?a:{diagnostics:[...a.diagnostics,...o.result.diagnostics],findings:[...a.findings,...o.result.findings],plan:{diagnostics:[...a.plan.diagnostics,...o.result.plan.diagnostics],nodes:[...a.plan.nodes,...o.result.plan.nodes],rootRuleIds:[...a.plan.rootRuleIds,...o.result.plan.rootRuleIds]},results:[...a.results,...o.result.results]}),rules:p.rules},files:e.files,packageGraph:e.packageGraph,sourceGraph:(i=e.sourceGraph,s=[],c=new Map,l=function e(t,r){return"string"==typeof t?r(t):Array.isArray(t)?t.map(t=>e(t,r)):(0,eK.isRecord)(t)?Object.fromEntries(Object.entries(t).map(([t,n])=>[r(t),e(n,r)])):t}(i,e=>{let t=c.get(e);return void 0===t&&(t=s.length,s.push(e),c.set(e,t)),`#${t}`}),JSON.stringify({version:1,strings:s,data:l})),meta:{language:e.language,projectName:r.projectName??((e=tz())=>{let t=_(e).split("/").pop();return void 0===t||0===t.length?"{unknown}":t})(e.projectPath),...void 0===r.source?{}:{source:r.source},...void 0===r.workspaceIdentity?{}:{workspaceIdentity:r.workspaceIdentity},timeStart:e.timeStart,timeEnd:Date.now()}}}(d,{},{workspaceIdentity:(a=o,`workspace:${a.map(({repository:e})=>e.id).toSorted((e,t)=>e.localeCompare(t)).join(",")}`)}),navigationTree:function(e){let t=new Map;for(let r of e)t.set(r.repository.owner,[...t.get(r.repository.owner)??[],r]);return[...t.entries()].sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>({children:t.toSorted((e,t)=>e.repository.name.localeCompare(t.repository.name)).map(({repository:e,entry:t})=>({children:function e(t,r){return t.map(t=>({...t,graphPackage:""===t.graphPackage?"":`${tW(r)}.module.${t.graphPackage}`,...t.children?{children:e(t.children,r)}:{}}))}(tG(t.files),e.id),graphPackage:tW(e.id),id:`repository:${e.id}`,kind:"virtual",label:e.name})),graphPackage:"",id:`owner:${e}`,kind:"virtual",label:e}))}(o),version:1}).audit.evaluation,packageGraph:t.audit.packageGraph,projectIdentity:function(e){if(void 0!==e.audit.meta.workspaceIdentity)return e.audit.meta.workspaceIdentity;let{source:t}=e.audit.meta;if(void 0!==t)return`github:${t.url}@${t.revision}`;let r=Array.from(JSON.stringify({files:e.audit.files,graph:e.audit.packageGraph})).reduce((e,t)=>(e^t.charCodeAt(0))*0x1000193>>>0,0x811c9dc5);return`snapshot:${r.toString(36)}`}(t),tree:t.navigationTree??tG(t.audit.files)}}}}({entries:e.entries,repositories:e.repositories,runtimeId:r,source:e.source,statuses:e.statuses})}async function tV(e,t,r,n,i){var a;let o=(a=n,{active:!1,entries:new Map,generation:0,repositories:a.repositories,source:a.source,statuses:new Map}),s=(0,h.randomUUID)();return function(e,t,r){for(e.set(t,r);e.size>t3;){let r=[...e.entries()].find(([e,r])=>e!==t&&!r.active);if(void 0===r)return;e.delete(r[0])}}(e,s,o),t1(o,()=>{var e;return tQ(o,n.repositories,s,t,r,{authentication:(e=n).authentication??"anonymous",authorizationScope:e.authorizationScope??"anonymous"},i)})}async function tY(e,t,r,n,i,a=t6,o){let s=e.get(n);if(void 0===s)throw new t2("unavailable","The workspace runtime is no longer available. Reload it to retry.");let c=s.repositories.find(e=>e.id===i);if(void 0===c)throw new t2("invalid","The requested repository is not part of this workspace.");if(s.statuses.get(c.id)?.status==="successful")throw new t2("stale","Only failed repositories can be retried.");return t1(s,()=>tQ(s,[c],n,t,r,a,o))}async function tQ(e,t,r,n,i,a,o){return tZ(e,t,r,async(e,t)=>t0(e,a.authentication,a.authorizationScope,n,i,t),o)}async function t0(e,t,r,n,i,a){var o;let s=await i.resolveRevisionAsync(e.url,t,a),c=(o=s,{authorization:r,provider:"github",repositoryId:o.repository.id,revision:o.revision.commitSha,schemaVersion:t4}),l=n.getAnalysis(c);if(void 0!==l)return l;let d=function(e){let t=e.trim();if(""===t)throw Error("Project source must not be empty.");try{return{kind:"github",url:function(e){let t=e.trim();if(""===t)throw Error("GitHub repository must not be empty.");let r=t.startsWith("github.com/")?`https://${t}`:t;if(r.startsWith("https://")){let e;var n=r;try{e=new URL(n)}catch(e){throw Error("GitHub repository URL is invalid.",{cause:e})}if("https:"!==e.protocol||"github.com"!==e.hostname.toLowerCase()||""!==e.username||""!==e.password||e.pathname.split("/").filter(Boolean).length<2)throw H();return n}if(/^[A-Za-z0-9](?:[A-Za-z0-9-]{0,98}[A-Za-z0-9])?\/[A-Za-z0-9._-]{1,100}(?:\.git)?$/u.test(r))return`https://github.com/${r}`;throw H()}(t)}}catch(e){if(t.includes("://")||t.startsWith("github.com/"))throw Error("Only local project paths and GitHub repository sources are supported.",{cause:e});return{kind:"filesystem",path:t}}}(e.url);if("github"!==d.kind)throw Error("Workspace repositories must be GitHub sources.");let u=await (i.materializeAsync??eB)({...d,revision:s.revision.commitSha},a,t);try{let t=await (i.inspectAsync??k)(u.rootPath),r=await (0,m.createProjectAnalysisSnapshotAsync)({id:e.id,inspection:t}),a=(0,g.createSourceGraphFromProjectAnalysisSnapshots)([r]),o=b(a,[r]),s=function(e){let t=[S.TypeScript,S.Java,S.Cpp,S.Python,S.Delphi,S.Kotlin],r=t.flatMap(t=>{let r=e.languages.find(e=>e.id===String(t));return r?[{language:t,detected:r}]:[]}).sort((e,r)=>r.detected.score-e.detected.score||r.detected.evidence.length-e.detected.evidence.length||t.indexOf(e.language)-t.indexOf(r.language)).at(0);if(void 0===r)throw Error(`No supported parser detected. Found: ${e.languages.map(e=>e.id).join(", ")||"unknown"}. Supported: ${t.join(", ")}.`);return{language:r.language,score:r.detected.score,indicators:r.detected.evidence,candidates:e.languages}}(t.detection),l={analysis:r,files:await L(t,o,s.language,u.rootPath),language:s};return n.setAnalysis(c,l),l}finally{await u.cleanupAsync()}}async function t1(e,t){if(e.active)throw new t2("rate-limited","A workspace operation is already in progress. Try again shortly.");e.active=!0;try{return await t()}finally{e.active=!1}}let t6={authentication:"anonymous",authorizationScope:"anonymous"};class t2 extends Error{kind;constructor(e,t){super(t),this.kind=e}}let t4=1,t3=32;function t8(e){return"string"==typeof e&&e.length>0&&e.length<=256}async function t5(e,t){let r=eT(e.url),n=await t.inspectRepositoryAsync(r.target,e.signal),i={owner:n.owner,name:n.name,url:n.url},a=await ez(t,r,i,n.defaultBranch,e.signal);return{repository:{id:n.id,owner:n.owner,name:n.name,url:n.url,defaultBranch:n.defaultBranch},revision:{commitSha:a.commitSha,ref:a.ref}}}let t7=(t=(s={materializeAsync:async(e,t,r="anonymous")=>"github"!==e.kind?eB(e,t):{...await eG().materializeAsync(e,t,r),source:e},resolveRevisionAsync:function(e,t,r){var n;return t5(n={authentication:t,url:e,signal:r},eP(fetch,{authentication:n.authentication??"anonymous"}))}}).cache??function(){if(!Number.isInteger(32))throw Error("Workspace analysis cache requires at least one entry.");let e=new Map,t=new Map;return{clearRepository:e=>{for(let r of t.keys())r.includes(`|${e}|`)&&t.delete(r)},getAnalysis:e=>eJ(t,eW(e)),getDiscovery:t=>eJ(e,t),setAnalysis:(e,r)=>eX(t,eW(e),r,32),setDiscovery:(t,r)=>eX(e,t,r,32)}}(),n=new Map,i=t,a=s,{loadAsync:(e,t)=>tV(n,i,a,e,t),retryAsync:(e,t,r,o)=>tY(n,i,a,e,t,r,o)}),t9=(c=async(e,t)=>{var r;let n=await p();return r={authentication:n.authentication,authorizationScope:n.cacheScope},t7.retryAsync(e,t,r,void 0)},async function(e){try{var t;let r=await e.json();if(t=r,!(f(t)&&t8(t.runtimeId)&&t8(t.repositoryId)))return Response.json({error:"Invalid workspace retry request."},{status:400});return Response.json(await c(r.runtimeId,r.repositoryId))}catch(t){var r=t;if(!(r instanceof t2))return Response.json({error:"Unable to retry repository."},{status:500});let e="invalid"===r.kind?400:"unavailable"===r.kind?410:"rate-limited"===r.kind?429:409;return Response.json({error:r.message},{status:e})}});e.s(["POST",0,t9],98045)},80536,e=>{"use strict";var t=e.i(8970),r=e.i(74017),n=e.i(96250),i=e.i(59756),a=e.i(61916),o=e.i(74677),s=e.i(69741),c=e.i(16795),l=e.i(87718),d=e.i(95169),u=e.i(47587),p=e.i(66012),f=e.i(49663),h=e.i(26937),m=e.i(10372),g=e.i(93695),y=e.i(9580);e.i(52474);var b=e.i(220);let v=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/workspace/retry/route",pathname:"/api/workspace/retry",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/workspace/retry/route.ts",nextConfigOutput:"standalone",userland:()=>e.r(98045),...{}}),{workAsyncStorage:w,workUnitAsyncStorage:E,serverHooks:x}=v;async function R(e,t,n){n.requestMeta&&(0,i.setRequestMeta)(e,n.requestMeta),v.isDev&&(0,i.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let w="/api/workspace/retry/route";w=w.replace(/\/index$/,"")||"/";let E=await v.prepare(e,t,{srcPage:w,multiZoneDraftMode:!1});if(!E)return t.statusCode=400,t.end("Bad Request"),null==n.waitUntil||n.waitUntil.call(n,Promise.resolve()),null;let{buildId:x,deploymentId:R,params:k,nextConfig:S,parsedUrl:A,isDraftMode:I,prerenderManifest:P,routerServerContext:C,isOnDemandRevalidate:O,revalidateOnlyGenerated:_,resolvedPathname:j,clientReferenceManifest:M,serverActionsManifest:$}=E,T=(0,s.normalizeAppPath)(w),L=!!P.routes[j]&&(v.isDev||(0,y.isRouteCacheOwner)(j,v.cacheOwner,P.routes[j])),z=!!(P.dynamicRoutes[T]||L),D=async()=>((null==C?void 0:C.render404)?await C.render404(e,t,A,!1):t.end("This page could not be found"),null);if(z&&!I){let e=P.dynamicRoutes[T];if(e&&!1===e.fallback&&!L){if(S.adapterPath)return await D();throw new g.NoFallbackError}}let N=null;!z||v.isDev||I||(N="/index"===(N=j)?"/":N);let U=!0===v.isDev||!z,H=z&&!U;$&&M&&(0,o.setManifestsSingleton)({page:w,clientReferenceManifest:M,serverActionsManifest:$});let F=e.method||"GET",G=(0,a.getTracer)(),q=G.getActiveScopeSpan(),B=!!(null==C?void 0:C.isWrappedByNextServer),W=!!(0,i.getRequestMeta)(e,"minimalMode"),J=(0,i.getRequestMeta)(e,"incrementalCache")||await v.getIncrementalCache(e,S,P,W);null==J||J.resetRequestCache(),globalThis.__incrementalCache=J;let X={params:k,previewProps:P.preview,renderOpts:{experimental:{authInterrupts:!!S.experimental.authInterrupts,useCacheTimeout:S.experimental.useCacheTimeout},cacheComponents:!!S.cacheComponents,validationLevel:S.experimental.instantInsights.validationLevel,isDraftMode:I,supportsDynamicResponse:U,incrementalCache:J,hmrRefreshHash:(0,i.getRequestMeta)(e,"hmrRefreshHash"),cacheLifeProfiles:S.cacheLife,staticPageGenerationTimeout:S.staticPageGenerationTimeout,waitUntil:n.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,n,i)=>v.onRequestError(e,t,n,i,C)},sharedContext:{buildId:x,deploymentId:R}},K=new c.NodeNextRequest(e),Z=new c.NodeNextResponse(t),V=l.NextRequestAdapter.fromNodeNextRequest(K,(0,l.signalFromNodeResponse)(t)),Y=async({previousCacheEntry:r})=>{try{if(!W&&O&&_&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let i=await v.handle(V,X);e.fetchMetrics=X.renderOpts.fetchMetrics;let a=X.renderOpts.pendingWaitUntil;a&&n.waitUntil&&(n.waitUntil(a),a=void 0);let o=X.renderOpts.collectedTags;if(!z)return await (0,p.sendResponse)(K,Z,i,a),null;{let e=await i.blob(),t=(0,f.toNodeOutgoingHttpHeaders)(i.headers);o&&(t[m.NEXT_CACHE_TAGS_HEADER]=o),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==X.renderOpts.collectedRevalidate&&!(X.renderOpts.collectedRevalidate>=m.INFINITE_CACHE)&&X.renderOpts.collectedRevalidate,n=void 0===X.renderOpts.collectedExpire||X.renderOpts.collectedExpire>=m.INFINITE_CACHE?!1!==r&&r>0?S.expireTime:void 0:X.renderOpts.collectedExpire;return{value:{kind:b.CachedRouteKind.APP_ROUTE,status:i.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:n}}}}catch(t){throw(null==r?void 0:r.isStale)&&await v.onRequestError(e,t,{routerKind:"App Router",routePath:w,routeType:"route",revalidateReason:(0,u.getRevalidateReason)({isStaticGeneration:H,isOnDemandRevalidate:O})},!1,C),t}},Q=async(i,o)=>{try{var s,c;let i=await v.handleResponse({req:e,nextConfig:S,cacheKey:N,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:P,isRoutePPREnabled:!1,isOnDemandRevalidate:O,revalidateOnlyGenerated:_,responseGenerator:Y,waitUntil:n.waitUntil,isMinimalMode:W});if(!z)return;if((null==i||null==(s=i.value)?void 0:s.kind)!==b.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==i||null==(c=i.value)?void 0:c.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});W||t.setHeader("x-nextjs-cache",O?"REVALIDATED":i.isMiss?"MISS":i.isStale?"STALE":"HIT"),I&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let a=(0,f.fromNodeOutgoingHttpHeaders)(i.value.headers);W&&z||a.delete(m.NEXT_CACHE_TAGS_HEADER),!i.cacheControl||t.getHeader("Cache-Control")||a.get("Cache-Control")||a.set("Cache-Control",(0,h.getCacheControlHeader)(i.cacheControl)),await (0,p.sendResponse)(K,Z,new Response(i.value.body,{headers:a,status:i.value.status||200}));return}catch(t){if(t instanceof g.NoFallbackError||await v.onRequestError(e,t,{routerKind:"App Router",routePath:T,routeType:"route",revalidateReason:(0,u.getRevalidateReason)({isStaticGeneration:H,isOnDemandRevalidate:O})},!1,C),z)throw t;await (0,p.sendResponse)(K,Z,new Response(null,{status:500}));return}finally{(()=>{if(!i)return;let e=t.statusCode;i.setAttributes({"http.status_code":e,"next.rsc":!1}),e&&e>=500&&(i.setStatus({code:a.SpanStatusCode.ERROR}),i.setAttribute("error.type",e.toString()));let r=G.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==d.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let n=r.get("next.route")||T,s=`${F} ${n}`;i.setAttributes({"next.route":n,"http.route":n,"next.span_name":s}),i.updateName(s),o&&o!==i&&(o.setAttribute("http.route",n),o.updateName(s))})()}};if(B&&q)await Q(q,void 0);else{let t=G.getActiveScopeSpan();await G.withPropagatedContext(e.headers,()=>G.trace(d.BaseServerSpan.handleRequest,{spanName:`${F} ${w}`,kind:a.SpanKind.SERVER,attributes:{"http.method":F,"http.target":e.url}},e=>Q(e,t)),void 0,!B)}}e.s(["handler",0,R,"patchFetch",0,function(){return(0,n.patchFetch)({workAsyncStorage:w,workUnitAsyncStorage:E})},"routeModule",0,v,"serverHooks",0,x,"workAsyncStorage",0,w,"workUnitAsyncStorage",0,E])}];
2
+
3
+ //# sourceMappingURL=_0clm3_5._.js.map