@dbt-tools/web 0.5.4 → 0.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import{n as e,r as t,t as n}from"./rolldown-runtime-Dw2cE7zH.js";import{i as r,n as i,r as a,t as o}from"./react-vendor-DL38pS2M.js";import{t as s}from"./tanstack-virtual-vendor-DdCr1qam.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var c=t(r(),1),l=i(),u=o();function d({message:e}){return(0,u.jsx)(`div`,{className:`error-banner`,children:e})}var f=typeof window<`u`?new URLSearchParams(window.location.search).get(`debug`)===`1`:!1;function p(...e){f&&console.log(`[dbt-tools]`,...e)}function m(e){!f||typeof performance>`u`||performance.mark(e)}function h(e,t,n){if(!f||typeof performance>`u`)return;performance.measure(e,t,n);let r=performance.getEntriesByName(e,`measure`),i=r[r.length-1];i&&p(`${e}: ${i.duration.toFixed(1)}ms`)}var g=`Unexpected analysis worker response`,_=`Unexpected resource-code worker response`,v=`Unexpected search-resources worker response`,y=`search-resources`,b=class{worker;requestId=0;pending=new Map;constructor(){this.worker=new Worker(new URL(`/assets/analysis.worker-DMZtkrdz.js`,``+import.meta.url),{type:`module`}),this.worker.onmessage=e=>{this.handleMessage(e.data)},this.worker.onerror=e=>{let t=this.formatWorkerError(e);p(`Analysis worker error`,t);for(let e of this.pending.values())e.reject(Error(t));this.pending.clear()},this.worker.onmessageerror=()=>{p(`Analysis worker message error`);for(let e of this.pending.values())e.reject(Error(`Analysis worker failed to deserialize a message`));this.pending.clear()}}formatWorkerError(e){let t=[];if(typeof e.filename==`string`&&e.filename.length>0){let n=e.lineno>0?`${e.filename}:${e.lineno}${e.colno>0?`:${e.colno}`:``}`:e.filename;t.push(n)}e.error instanceof Error&&e.error.message.trim()!==``&&t.push(e.error.message);let n=e.message?.trim();return n?t.length>0?`Analysis worker failed: ${n} (${t.join(` | `)})`:`Analysis worker failed: ${n}`:t.length>0?`Analysis worker failed: ${t.join(` | `)}`:`Analysis worker failed`}collectTransferables(e){return[e.manifestBytes,e.runResultsBytes,e.catalogBytes,e.sourcesBytes].filter(e=>e instanceof ArrayBuffer)}async loadAnalysis(e,t){let n=this.requestId+1;this.requestId=n;let r=`analysis-load:${n}:dispatch`,i=`analysis-load:${n}:ready`,a=`analysis-load:${n}:analysis-ready`;m(r);let o={type:`load-analysis`,protocolVersion:3,requestId:n,artifactBuffers:e,source:t},s=new Promise((e,r)=>{this.pending.set(n,{kind:`load`,resolve:e,reject:r,source:t})});return this.worker.postMessage(o,this.collectTransferables(e)),s.then(e=>(m(i),h(a,r,i),p(`Analysis worker ready`,{requestId:n,source:t,timings:e.metrics.timings}),{...e,metrics:{...e.metrics,dispatchMarkName:r,readyMarkName:i,analysisReadyMeasureName:a}}))}async requestResourceCode(e){let t=this.requestId+1;this.requestId=t;let n={type:`get-resource-code`,protocolVersion:3,requestId:t,uniqueId:e},r=new Promise((e,n)=>{this.pending.set(t,{kind:`resource-code`,resolve:e,reject:n})});return this.worker.postMessage(n),r}async searchResources(e){let t=this.requestId+1;this.requestId=t;let n={type:y,protocolVersion:3,requestId:t,query:e},r=new Promise((e,n)=>{this.pending.set(t,{kind:y,resolve:e,reject:n})});return this.worker.postMessage(n),r}terminate(){this.worker.terminate();for(let e of this.pending.values())e.reject(Error(`Analysis worker terminated`));this.pending.clear()}resolveLoadResponse(e,t){return t.type===`analysis-error`?(e.reject(Error(t.message)),!0):t.type===`analysis-ready`?(e.resolve({analysis:t.analysis,metrics:{requestId:t.requestId,source:e.source,dispatchMarkName:``,readyMarkName:``,analysisReadyMeasureName:``,timings:t.timings}}),!0):!1}resolveResourceCodeResponse(e,t){return t.type===`resource-code-error`?(e.reject(Error(t.message)),!0):t.type===`resource-code-ready`?(e.resolve({compiledCode:t.compiledCode,rawCode:t.rawCode}),!0):!1}resolveSearchResourcesResponse(e,t){return t.type===`search-resources-error`?(e.reject(Error(t.message)),!0):t.type===`search-resources-ready`?(e.resolve(t.resources),!0):!1}handleMessage(e){let t=this.pending.get(e.requestId);if(t){if(this.pending.delete(e.requestId),t.kind===`load`){if(this.resolveLoadResponse(t,e))return;t.reject(Error(g));return}if(t.kind===`resource-code`){if(this.resolveResourceCodeResponse(t,e))return;t.reject(Error(_));return}if(t.kind===y){if(this.resolveSearchResourcesResponse(t,e))return;t.reject(Error(v))}}}},x=null;function S(){return x??=new b,x}async function C(e,t){return S().loadAnalysis(e,t)}async function w(e){return S().requestResourceCode(e)}async function T(e){return S().searchResources(e)}var E=8;function D(e,t){return!e||t.query.trim()?[]:t.recentResourceIds.map(t=>e.resources.find(e=>e.uniqueId===t)??null).filter(e=>e!=null).slice(0,E)}function O(e,t){let n=t.query.trim(),r=(0,c.useMemo)(()=>D(e,t),[e,t.query,t.recentResourceIds]),[i,a]=(0,c.useState)([]),[o,s]=(0,c.useState)(!1),l=(0,c.useRef)(0);return(0,c.useEffect)(()=>{if(!e||!n){l.current+=1,a([]),s(!1);return}l.current+=1;let r=l.current,i=!1;return a([]),s(!0),T(t.query).then(e=>{!i&&l.current===r&&(a(e),s(!1))}).catch(()=>{!i&&l.current===r&&(a([]),s(!1))}),()=>{i=!0}},[e,n,t.query]),n?{results:i,loading:o}:{results:r,loading:!1}}function k(e){let t=e.locationDisplay??null,n=e.sourceKind??null;return t==null&&n==null?null:{sourceKind:n,locationDisplay:t}}function A(e){return e==null?null:e===`local`?`Local directory`:e===`s3`?`Amazon S3`:`Google Cloud Storage`}function j(e){return e===`preload`?`Live target`:e===`remote`?`Remote source`:e===`upload`?`Local upload`:`Waiting for artifacts`}function M(e){return e===`preload`?`DBT_TOOLS_TARGET_DIR`:e===`remote`?`REMOTE SOURCE`:e===`upload`?`UPLOADED`:`ARTIFACTS`}var N=`/assets/app-logo-ByfNNtT8.svg`;function P({className:e,size:t,title:n,testId:r}){return(0,u.jsx)(`img`,{src:N,alt:n??``,"aria-hidden":n?void 0:!0,className:e,style:t?{width:`${t}px`,height:`${t}px`}:void 0,"data-testid":r})}var ee=[{id:`health`,view:`health`,label:`Health`},{id:`timeline`,view:`timeline`,label:`Timeline`},{id:`inventory`,view:`inventory`,label:`Inventory`},{id:`runs`,view:`runs`,label:`Runs`}],F=new Set([`health`,`inventory`,`runs`,`timeline`,`settings`,`overview`,`catalog`,`execution`,`quality`,`dependencies`,`search`]);function te(e){let t=new URLSearchParams(e).get(`view`);return t===`lineage`||t===`dependencies`}function ne(e){switch(e){case`overview`:return`health`;case`catalog`:return`inventory`;case`execution`:case`quality`:return`runs`;case`dependencies`:case`lineage`:return`inventory`;case`search`:return`inventory`;case`runs`:case`timeline`:case`inventory`:case`health`:case`settings`:return e;default:return`health`}}function re(e){let t=new URLSearchParams(e),n=t.get(`view`);return n?n===`runs`&&t.get(`tab`)===`timeline`?`timeline`:n===`lineage`||n===`dependencies`?`inventory`:F.has(n)?ne(n):null:null}function ie(e){return new URLSearchParams(e).get(`resource`)}function ae(e){return new URLSearchParams(e).get(`selected`)}function oe(e){let t=new URLSearchParams(e).get(`assetTab`);return t===`summary`||t===`lineage`||t===`sql`||t===`runtime`||t===`tests`?t:null}function se(e){return oe(e)??(te(e)?`lineage`:`summary`)}function ce(e){let t=new URLSearchParams(e).get(`kind`);return t===`all`||t===`models`||t===`tests`||t===`seeds`||t===`snapshots`||t===`operations`?t:null}function le(e){let t=new URLSearchParams(e).get(`adapter`);if(t==null||t===``)return!0;let n=t.trim().toLowerCase();return!(n===`0`||n===`false`||n===`no`)}function ue(e){let t=new URLSearchParams(e).get(`lens`);return t===`status`||t===`type`||t===`coverage`?t:null}function de(e){let t=new URLSearchParams(e).get(`up`);if(t==null||t===``)return null;let n=Number(t);return Number.isFinite(n)?n:null}function fe(e){let t=new URLSearchParams(e).get(`down`);if(t==null||t===``)return null;let n=Number(t);return Number.isFinite(n)?n:null}function pe(e){let t=new URLSearchParams(e).get(`allDeps`);return t===`1`?!0:t===`0`?!1:null}function me(e){return Math.max(0,Math.min(10,e))}function he(e){let t=ie(e),n=new URLSearchParams(e).get(`selected`),r=oe(e),i=te(e)||r===`lineage`,a=de(e),o=fe(e),s=pe(e),c=ue(e);return{rootResourceId:t,selectedResourceId:i?n??t:t,upstreamDepth:me(a??2),downstreamDepth:me(o??2),allDepsMode:s??!1,lensMode:c??`type`,activeLegendKeys:new Set}}var ge=`dbt-tools.sidebarCollapsed`;function _e(e=!0){try{let e=window.localStorage.getItem(ge);if(e!==null)return e===`true`}catch{}return e}function ve(e,t){return ne(t)===e.view}function ye({id:e}){let t={viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,width:20,height:20,"aria-hidden":!0};return e===`health`?(0,u.jsx)(`svg`,{...t,children:(0,u.jsx)(`polyline`,{points:`2,12 6,12 8,5 10,19 13,12 15,12 17,8 19,12 22,12`})}):e===`runs`?(0,u.jsxs)(`svg`,{...t,children:[(0,u.jsx)(`rect`,{x:`3`,y:`4`,width:`3`,height:`16`,rx:`1`}),(0,u.jsx)(`rect`,{x:`9`,y:`8`,width:`3`,height:`12`,rx:`1`}),(0,u.jsx)(`rect`,{x:`15`,y:`6`,width:`3`,height:`14`,rx:`1`}),(0,u.jsx)(`rect`,{x:`21`,y:`10`,width:`0`,height:`0`}),(0,u.jsx)(`line`,{x1:`3`,y1:`20`,x2:`21`,y2:`20`})]}):e===`timeline`?(0,u.jsxs)(`svg`,{...t,children:[(0,u.jsx)(`path`,{d:`M4 18V7`}),(0,u.jsx)(`path`,{d:`M10 18V11`}),(0,u.jsx)(`path`,{d:`M16 18V5`}),(0,u.jsx)(`path`,{d:`M2 18h20`}),(0,u.jsx)(`path`,{d:`M4 9h3M10 13h3M16 7h3`})]}):e===`inventory`?(0,u.jsxs)(`svg`,{...t,children:[(0,u.jsx)(`path`,{d:`M2 7l10-4 10 4-10 4-10-4z`}),(0,u.jsx)(`path`,{d:`M2 12l10 4 10-4`}),(0,u.jsx)(`path`,{d:`M2 17l10 4 10-4`})]}):e===`settings`?(0,u.jsxs)(`svg`,{...t,children:[(0,u.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`}),(0,u.jsx)(`path`,{d:`M12 2.75v2.5`}),(0,u.jsx)(`path`,{d:`M12 18.75v2.5`}),(0,u.jsx)(`path`,{d:`M21.25 12h-2.5`}),(0,u.jsx)(`path`,{d:`M5.25 12h-2.5`}),(0,u.jsx)(`path`,{d:`M18.54 5.46l-1.77 1.77`}),(0,u.jsx)(`path`,{d:`M7.23 16.77l-1.77 1.77`}),(0,u.jsx)(`path`,{d:`M18.54 18.54l-1.77-1.77`}),(0,u.jsx)(`path`,{d:`M7.23 7.23L5.46 5.46`})]}):(0,u.jsxs)(`svg`,{...t,children:[(0,u.jsx)(`path`,{d:`M4 7h16`}),(0,u.jsx)(`path`,{d:`M4 12h9`}),(0,u.jsx)(`path`,{d:`M4 17h13`})]})}var be=`Waiting for artifacts`;function xe({activeView:e,setNavigationTarget:t,sidebarCollapsed:n,setSidebarCollapsed:r,onNavigate:i,analysis:a,analysisSource:o}){let s=j(o);return(0,u.jsxs)(`aside`,{id:`app-sidebar`,className:`app-sidebar${n?` app-sidebar--collapsed`:``}`,children:[(0,u.jsxs)(`button`,{type:`button`,className:`app-sidebar__brand-link`,onClick:()=>{t({view:`health`}),i()},title:`Go to Health`,children:[(0,u.jsx)(P,{className:`app-logo app-logo--brand`}),!n&&(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`strong`,{children:`dbt-tools`}),(0,u.jsx)(`span`,{children:`Artifact operations console`})]})]}),(0,u.jsx)(`nav`,{className:`app-sidebar__nav`,"aria-label":`Workspace sections`,children:(0,u.jsx)(`div`,{className:`nav-group`,children:ee.map(n=>{let r=!a;return(0,u.jsxs)(`button`,{type:`button`,className:ve(n,e)?`sidebar-link sidebar-link--active`:`sidebar-link`,disabled:r,onClick:()=>{t(n),i()},"aria-label":n.label,title:n.label,children:[(0,u.jsx)(`span`,{className:`sidebar-link__icon`,children:(0,u.jsx)(ye,{id:n.id})}),(0,u.jsx)(`div`,{className:`sidebar-link__body`,children:(0,u.jsx)(`strong`,{children:n.label})})]},n.id)})})}),(0,u.jsx)(`button`,{type:`button`,className:`sidebar-toggle`,onClick:()=>r(e=>!e),"aria-label":n?`Expand sidebar`:`Collapse sidebar`,children:n?`›`:`‹`}),(0,u.jsxs)(`div`,{className:`app-sidebar__footer`,children:[(0,u.jsxs)(`button`,{type:`button`,className:e===`settings`?`sidebar-link sidebar-link--active sidebar-settings-trigger`:`sidebar-link sidebar-settings-trigger`,onClick:()=>{t({view:`settings`}),i()},"aria-current":e===`settings`?`page`:void 0,"aria-label":`Open settings`,title:`Settings`,children:[(0,u.jsx)(`span`,{className:`sidebar-link__icon`,children:(0,u.jsx)(ye,{id:`settings`})}),!n&&(0,u.jsx)(`div`,{className:`sidebar-link__body`,children:(0,u.jsx)(`strong`,{children:`Settings`})})]}),!n&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`div`,{className:`sidebar-settings-divider`}),(0,u.jsxs)(`div`,{className:`app-sidebar__session`,children:[(0,u.jsx)(`p`,{className:`eyebrow`,children:`Session`}),(0,u.jsx)(`strong`,{children:s}),(0,u.jsx)(`span`,{children:a?`${a.summary.total_nodes} executions analyzed`:be})]})]})]})]})}function Se({pendingRemoteRun:e,acceptingRemoteRun:t,onAcceptPendingRemoteRun:n}){return e==null?null:(0,u.jsxs)(`section`,{className:`remote-update-banner`,"aria-label":`Remote update available`,children:[(0,u.jsxs)(`div`,{className:`remote-update-banner__copy`,children:[(0,u.jsx)(`p`,{className:`eyebrow`,children:`Remote update available`}),(0,u.jsx)(`strong`,{children:e.label}),(0,u.jsx)(`span`,{children:`A newer complete remote artifact pair is ready. Keep the current investigation until you decide to switch.`})]}),(0,u.jsx)(`button`,{type:`button`,className:`primary-action`,onClick:()=>void n(),disabled:t,children:t?`Switching…`:`Load latest remote run`})]})}function Ce(e){return e?e.fail+e.error+e.warn+e.skipped>0:!1}var we={accent:`#635BFF`,text:`#171C28`,textSoft:`#6B7385`,bg:`#F6F7FB`,bgSoft:`#FFFFFF`,borderDefault:`#D7DCE7`,borderSubtle:`#E6E9F0`,slate:`#64748B`,rose:`#C0352B`,mint:`#0F8A4B`,amber:`#A56315`},Te={accent:`#8A7CFF`,text:`#F3F6FC`,textSoft:`#98A3BC`,bg:`#0D1120`,bgSoft:`#151A2E`,borderDefault:`#313A58`,borderSubtle:`#262E47`,slate:`#8690AA`,rose:`#FF8D86`,mint:`#59D38C`,amber:`#F5B95C`};function Ee(e){return e===`dark`?Te:we}var De={success:we.mint,error:we.rose,skipped:we.slate,"run error":we.rose,pass:we.mint,fail:we.rose,warn:we.amber,"no op":we.slate},Oe={success:Te.mint,error:Te.rose,skipped:Te.slate,"run error":Te.rose,pass:Te.mint,fail:Te.rose,warn:Te.amber,"no op":Te.slate},ke=`#059669`,Ae=`#45c49a`,je=`rgba(100, 116, 139, 0.14)`,Me=`rgba(134, 144, 170, 0.2)`,Ne=`rgba(5, 150, 105, 0.14)`,Pe=`rgba(69, 196, 154, 0.2)`,Fe={model:`#1D4ED8`,test:`#64748B`,seed:`#635BFF`,snapshot:`#D97706`,source:ke,source_freshness:ke,exposure:`#EA580C`,metric:`#DB2777`,semantic_model:`#0891B2`,analysis:`#64748B`,unit_test:`#64748B`},Ie={model:`#5c8deb`,test:`#8690aa`,seed:`#9588e8`,snapshot:`#d4a24a`,source:Ae,source_freshness:Ae,exposure:`#d9845c`,metric:`#d172ae`,semantic_model:`#3eb0c8`,analysis:`#8690aa`,unit_test:`#8690aa`},Le={model:`rgba(29, 78, 216, 0.14)`,test:je,seed:`rgba(99, 91, 255, 0.14)`,snapshot:`rgba(217, 119, 6, 0.14)`,source:Ne,source_freshness:Ne,semantic_model:`rgba(8, 145, 178, 0.14)`,metric:`rgba(219, 39, 119, 0.14)`,exposure:`rgba(234, 88, 12, 0.14)`,analysis:je,unit_test:je},Re={model:`rgba(92, 141, 235, 0.22)`,test:Me,seed:`rgba(149, 136, 232, 0.22)`,snapshot:`rgba(212, 162, 74, 0.22)`,source:Pe,source_freshness:Pe,semantic_model:`rgba(62, 176, 200, 0.22)`,metric:`rgba(209, 114, 174, 0.22)`,exposure:`rgba(217, 132, 92, 0.22)`,analysis:Me,unit_test:Me};function ze(e){return e===`dark`?Ie:Fe}function Be(e){return e===`dark`?Re:Le}function Ve(e,t){let n=Be(t);return e&&n[e]?n[e]:t===`dark`?Me:je}var He={rowStripe:`#F1F3F8`,rowStripeHover:`#EEF0FF`,labelText:we.text,metaText:we.textSoft,axisTick:we.slate,gridLine:`#E6E9F0`,barHoverStroke:we.accent,testFailStripe:`rgba(192, 53, 43, 0.9)`,testSkipStripe:`rgba(165, 99, 21, 0.88)`,hullStroke:`#C8CEDB`,hullFill:`rgba(230, 233, 240, 0.35)`},Ue={rowStripe:`#101527`,rowStripeHover:`#232845`,labelText:Te.text,metaText:Te.textSoft,axisTick:Te.slate,gridLine:`#262E47`,barHoverStroke:Te.accent,testFailStripe:`rgba(255, 141, 134, 0.88)`,testSkipStripe:`rgba(245, 185, 92, 0.88)`,hullStroke:`#2E3759`,hullFill:`rgba(38, 46, 71, 0.4)`};function We(e){return e===`dark`?Ue:He}function Ge(e){let t=Ee(e);return{positive:t.mint,warning:t.amber,danger:t.rose,neutral:t.slate,skipped:t.accent}}var Ke=`workspace-pill workspace-pill--active`,qe=`workspace-pill`,Je=[{key:`model`,label:`Models`},{key:`source`,label:`Sources`},{key:`tests`,label:`Tests`},{key:`snapshot`,label:`Snapshots`},{key:`metric`,label:`Metrics`},{key:`semantic_model`,label:`Semantic models`}],Ye=new Set([`model`,`seed`,`snapshot`,`source`,`source_freshness`,`test`,`unit_test`,`metric`,`semantic_model`]),I=new Set([`test`,`unit_test`]),Xe=[...Ye].filter(e=>!I.has(e)).sort((e,t)=>e.localeCompare(t)),Ze=new Set([`model`,`seed`,`snapshot`,`source`]),Qe={project:`Project`,database:`Database`};function $e(e){return e.statusTone===`danger`&&!I.has(e.resourceType)&&e.resourceType!==`operation`&&e.resourceType!==`sql_operation`}function et(e){return typeof e!=`number`||Number.isNaN(e)?`n/a`:e>=60?`${Math.floor(e/60)}m ${(e%60).toFixed(2).padStart(5,`0`)}s`:e>=10?`${e.toFixed(1)}s`:`${e.toFixed(2)}s`}function tt(e){return e.split(`_`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function nt(e,t){let n=``;for(;t<e.length;){if(e[t]===`"`){if(e[t+1]===`"`){n+=`"`,t+=2;continue}t+=1;break}n+=e[t],t+=1}return{segment:n,next:t}}function rt(e){let t=[],n=0,r=e;for(;n<r.length;){if(r[n]===`.`){n+=1;continue}if(r[n]===`"`){let{segment:e,next:i}=nt(r,n+1);t.push(e),n=i}else{let e=n;for(;n<r.length&&r[n]!==`.`;)n+=1;t.push(r.slice(e,n))}}return t.join(`.`)}function it(e){return new Date(e).toLocaleString(`en-US`,{dateStyle:`medium`,timeStyle:`short`})}function at(e){return e.runStartedAt}function ot(e){return`tone-badge tone-badge--${e}`}function st(e){return ct(e.originalFilePath??e.patchPath??e.path)}function ct(e){if(!e)return null;let t=e.includes(`://`)?e.split(`://`)[1]??null:e;if(!t)return null;let n=t.split(`/`).map(e=>e.trim()).filter(Boolean).join(`/`);return n.length>0?n:null}function lt(e,t){if(!t)return!0;let n=t.trim().toLowerCase();return n?[e.name,e.resourceType,e.packageName,e.path??``,e.originalFilePath??``,e.patchPath??``,e.uniqueId].some(e=>e.toLowerCase().includes(n)):!0}function ut(e,t,n){return t===`all`?!0:t===`issues`?e.statusTone===`danger`?!0:Ce(n?.get(e.uniqueId)):e.statusTone===t}function dt(e,t){return t.size===0||t.has(e.resourceType)}function ft(e,t){if(t.size===0)return!0;let n=e.semantics?.materialization??`unknown`;return t.has(n)}function pt(e,t){if(!t)return!0;let n=t.trim().toLowerCase();if(!n)return!0;let r=e.semantics,i=r?[r.materialization,r.rawMaterialization??``,r.incrementalStrategy??``,r.relationName??``]:[];return[e.name,e.resourceType,e.packageName,e.path??``,e.uniqueId,e.status,e.threadId??``,...i].some(e=>e.toLowerCase().includes(n))}function mt(e,t){return t===`all`?!0:t===`issues`?e.statusTone===`danger`||e.statusTone===`warning`:e.statusTone===t}function ht(e){if(e.length===0)return null;let t={};for(let n of e)n.packageName&&(t[n.packageName]=(t[n.packageName]??0)+1);return Object.entries(t).sort((e,t)=>t[1]-e[1])[0]?.[0]??null}function gt(e,t){return t!=null&&e.packageName===t}function _t({name:e,packageName:t,path:n}){let r=e.toLowerCase(),i=t.toLowerCase(),a=(n??``).toLowerCase();return new Set([`dbt_artifacts_hashes`,`dbt_columns`,`dbt_exposures`,`dbt_groups`,`dbt_invocations`,`dbt_metrics`,`dbt_models`,`dbt_run_results`,`dbt_seeds`,`dbt_snapshots`,`dbt_source_freshness_results`,`dbt_sources`,`dbt_tests`,`elementary_test_results`,`job_run_results`,`locations`,`metadata`,`metricflow_time_spine`,`model_run_results`,`schema_columns_snapshot`,`seed_run_results`,`snapshot_run_results`,`test_result_rows`]).has(r)||r.startsWith(`dbt_`)||r.startsWith(`alerts_dbt_`)||a.includes(`/edr/`)||a.includes(`/dbt_artifacts/`)||a.includes(`/run_results/`)||a.includes(`/manifest/`)||a.includes(`/catalog/`)||i===`elementary`&&(r.includes(`dbt_`)||a.includes(`/edr/dbt_artifacts/`))}function vt(e){return new Set(e.filter(e=>e!==`macro`&&e!==`test`&&e!==`unit_test`))}function yt(e,t){return!Ye.has(e.resourceType)||I.has(e.resourceType)||_t(e)?!1:t==null?!0:e.packageName===t}function bt(e){return e.some(e=>e.compileStart!=null&&e.compileEnd!=null&&e.compileEnd>e.compileStart&&e.executeStart!=null&&e.executeEnd!=null&&e.executeEnd>e.executeStart)}function xt(e,t){let n=0;for(let r of e)I.has(r.resourceType??``)&&(_t(r)||t!=null&&r.packageName!==t||n++);return n}function St(e,t,n){return e.filter(e=>n&&!mt(e,t.status)||t.resourceTypes.size>0&&!t.resourceTypes.has(e.resourceType)?!1:pt(e,t.query))}function Ct(e,t){let n=t?.denominatorTotal??e.length,r=new Map;for(let t of e){let e=r.get(t.status)??{count:0,duration:0,tone:t.statusTone};e.count+=1,e.duration+=t.executionTime,r.set(t.status,e)}return[...r.entries()].map(([e,t])=>({status:e,count:t.count,duration:t.duration,share:n>0?t.count/n:0,tone:t.tone})).sort((e,t)=>t.count-e.count)}function wt(e,t){let n=new Map;for(let e of t)n.set(e.resourceType,(n.get(e.resourceType)??0)+1);let r=new Map;for(let t of e){let e=r.get(t.resourceType)??[];e.push(t),r.set(t.resourceType,e)}return[...r.entries()].map(([e,t])=>{let r=n.get(e)??0;return{resourceType:e,count:t.length,duration:t.reduce((e,t)=>e+t.executionTime,0),rowDenominatorCount:r,statusBreakdown:Ct(t,{denominatorTotal:r})}}).sort((e,t)=>t.count-e.count)}function Tt(e){let t=new Map;for(let n of e){let e=n.threadId??`unknown`,r=t.get(e)??{count:0,totalExecutionTime:0};r.count+=1,r.totalExecutionTime+=n.executionTime,t.set(e,r)}return[...t.entries()].map(([e,t])=>({threadId:e,count:t.count,totalExecutionTime:t.totalExecutionTime})).sort((e,t)=>t.totalExecutionTime-e.totalExecutionTime)}function Et(e,t){let n=St(e.executions,t,!0),r=St(e.executions,t,!1),i=n.filter(e=>I.has(e.resourceType)),a=Tt(n);return{filteredExecutions:n,baselineExecutionsForBreakdown:r,filteredStatusBreakdown:Ct(n),filteredThreadStats:a,filteredTypes:Array.from(new Set(n.map(e=>e.resourceType))).sort(),failingNodes:n.filter(e=>e.statusTone===`danger`).length,warningNodes:n.filter(e=>e.statusTone===`warning`).length,failedModels:n.filter($e).length,passingTests:i.filter(e=>e.statusTone===`positive`).length,failingTests:i.filter(e=>e.statusTone===`danger`).length,threadCount:a.filter(e=>e.threadId!==`unknown`).length,filteredExecutionTime:n.reduce((e,t)=>e+t.executionTime,0),topFailures:n.filter(e=>e.statusTone===`danger`).slice(0,3),topBottlenecks:[...n].sort((e,t)=>t.executionTime-e.executionTime).slice(0,3)}}function Dt({icon:e,headline:t,subtext:n}){return(0,u.jsxs)(`div`,{className:`empty-state-block`,children:[e!==void 0&&(0,u.jsx)(`span`,{className:`empty-state-block__icon`,"aria-hidden":`true`,children:e}),(0,u.jsx)(`strong`,{className:`empty-state-block__headline`,children:t}),n&&(0,u.jsx)(`p`,{className:`empty-state-block__subtext`,children:n})]})}function Ot({label:e}){return(0,u.jsx)(`span`,{className:`overview-scope-badge`,children:e})}function kt({derived:e,title:t=`Bottlenecks`,subtitle:n=`Longest-running nodes in the filtered execution slice.`,embedded:r=!1}){let i=e.topBottlenecks;return(0,u.jsxs)(`section`,{className:`overview-module overview-module--bottlenecks${r?` overview-module--embedded`:``}`,children:[!r&&(0,u.jsxs)(`div`,{className:`overview-module__header`,children:[(0,u.jsx)(`h3`,{children:t}),(0,u.jsx)(`p`,{children:n})]}),i.length>0?(0,u.jsx)(`div`,{className:`action-list`,children:i.map((t,n)=>(0,u.jsxs)(`div`,{className:`action-list__row`,children:[(0,u.jsxs)(`div`,{className:`action-list__body`,children:[(0,u.jsx)(`strong`,{children:`${n+1}. ${t.name}`}),(0,u.jsx)(`span`,{children:`${(t.executionTime/Math.max(e.filteredExecutionTime,1e-4)*100).toFixed(1)}% of filtered run`})]}),(0,u.jsx)(`div`,{className:`action-list__metric`,children:(0,u.jsx)(`strong`,{children:et(t.executionTime)})})]},t.uniqueId))}):(0,u.jsx)(Dt,{icon:`⚡`,headline:`No matching bottlenecks`,subtext:`No executions match the current dashboard filters.`})]})}function At({analysis:e,filtered:t}){let n=e.summary.critical_path?.path.length??0;return(0,u.jsxs)(`section`,{className:`overview-module overview-module--critical`,children:[(0,u.jsxs)(`div`,{className:`overview-module__header`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`h3`,{children:`Critical path`}),(0,u.jsx)(`p`,{children:`Dependency pressure and scheduling risk.`})]}),t&&(0,u.jsx)(Ot,{label:`Workspace-wide`})]}),(0,u.jsxs)(`div`,{className:`critical-path-card`,children:[(0,u.jsxs)(`div`,{className:`critical-path-card__headline`,children:[(0,u.jsxs)(`strong`,{children:[n,` nodes`]}),(0,u.jsx)(`span`,{children:e.graphSummary.hasCycles?`Cycles detected in the dependency graph.`:`No cycles detected in the dependency graph.`})]}),(0,u.jsxs)(`div`,{className:`critical-path-card__detail`,children:[(0,u.jsx)(`span`,{children:`Graph edges`}),(0,u.jsx)(`strong`,{children:e.graphSummary.totalEdges})]})]})]})}function jt({analysis:e,filtered:t}){let n=e.resources.filter(e=>!!e.description?.trim()).length,r=e.resources.length>0?Math.round(n/e.resources.length*100):0,i=Math.max(e.resources.length-n,0),a=e.resources.filter(e=>e.resourceType===`model`).length;return(0,u.jsxs)(`section`,{className:`overview-module overview-module--coverage`,children:[(0,u.jsxs)(`div`,{className:`overview-module__header`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`h3`,{children:`Coverage`}),(0,u.jsx)(`p`,{children:`Structural health of metadata and discovery quality.`})]}),t&&(0,u.jsx)(Ot,{label:`Workspace-wide`})]}),(0,u.jsxs)(`div`,{className:`coverage-card`,children:[(0,u.jsxs)(`div`,{className:`coverage-card__headline`,children:[(0,u.jsxs)(`strong`,{children:[r,`%`]}),(0,u.jsx)(`span`,{children:`Metadata coverage`})]}),(0,u.jsxs)(`div`,{className:`coverage-card__stats`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`span`,{children:`Documented`}),(0,u.jsxs)(`strong`,{children:[n,` / `,e.resources.length]})]}),(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`span`,{children:`Missing descriptions`}),(0,u.jsx)(`strong`,{children:i})]})]}),(0,u.jsx)(`p`,{children:a>0?`Next improvement: document core models first to improve catalog-style discovery.`:`Add descriptions to core resources to improve catalog-style discovery.`})]})]})}var Mt=`data-theme`,Nt=`dark`,Pt=`light`,Ft=`system`;function It(e){if(e===Nt)return Nt;if(e===Pt)return Pt;try{return window.matchMedia(`(prefers-color-scheme: dark)`).matches?Nt:Pt}catch{return Pt}}function Lt(){return typeof document>`u`?`light`:document.documentElement.getAttribute(Mt)===Nt?Nt:`light`}function Rt(e){e(Lt());let t=new MutationObserver(()=>e(Lt()));return t.observe(document.documentElement,{attributes:!0,attributeFilter:[Mt]}),()=>t.disconnect()}function zt(){let[e,t]=(0,c.useState)(()=>Lt());return(0,c.useEffect)(()=>(t(Lt()),Rt(t)),[]),e}function Bt(){let[e,t]=(0,c.useState)(()=>{try{let e=window.localStorage.getItem(`dbt-tools.theme`);if(e===Pt||e===Nt||e===Ft)return e}catch{}return Ft}),[n,r]=(0,c.useState)(()=>It(e));return(0,c.useEffect)(()=>{r(It(e));try{window.localStorage.setItem(`dbt-tools.theme`,e)}catch{}},[e]),(0,c.useEffect)(()=>{document.documentElement.setAttribute(Mt,n)},[n]),{theme:n,themePreference:e,setThemePreference:t,toggleTheme:()=>t(e=>e===Pt?Nt:e===Nt?Pt:Nt)}}var Vt=.08;function Ht(e){return[...e].sort((e,t)=>t.count-e.count)}var Ut=.999999999999,Wt=5e-4;function Gt(e,t=Vt){return e>=t}function Kt(e){if(e>=Ut)return`100%`;let t=e*100;if(e<Wt)return`<0.1%`;let n=Math.round(t);if(n===100){let e=t.toFixed(1);return Number.parseFloat(e)>=100&&(e=t.toFixed(2)),`${e}%`}if(n===0&&e>0)return t<.1?`<0.1%`:`${t.toFixed(1)}%`;if(Math.abs(t-n)<1e-9)return`${n}%`;let r=t.toFixed(1);return Number.parseFloat(r)>=100&&e<Ut&&(r=t.toFixed(2)),`${r}%`}function qt({title:e,subtitle:t,headerRight:n,children:r}){return(0,u.jsxs)(`section`,{className:`workspace-card`,children:[(0,u.jsxs)(`div`,{className:`workspace-card__header`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`h3`,{children:e}),t&&(0,u.jsx)(`p`,{children:t})]}),n]}),r]})}function Jt({resourceType:e}){return(0,u.jsxs)(`span`,{className:`resource-type-badge`,children:[(0,u.jsx)(Yt,{resourceType:e}),tt(e)]})}function Yt({resourceType:e}){switch(e){case`model`:return(0,u.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:[(0,u.jsx)(`path`,{d:`m8 2.2 4.8 2.7L8 7.6 3.2 4.9 8 2.2Z`}),(0,u.jsx)(`path`,{d:`m3.2 5 4.8 2.6L12.8 5M3.2 8l4.8 2.7 4.8-2.7M3.2 11l4.8 2.8 4.8-2.8`})]});case`source`:return(0,u.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:[(0,u.jsx)(`ellipse`,{cx:`8`,cy:`4`,rx:`4.6`,ry:`1.8`}),(0,u.jsx)(`path`,{d:`M3.4 4v5.3C3.4 10.7 5.5 12 8 12s4.6-1.3 4.6-2.7V4`}),(0,u.jsx)(`path`,{d:`M3.4 6.7C3.4 8 5.5 9.3 8 9.3s4.6-1.3 4.6-2.6`})]});case`test`:case`unit_test`:return(0,u.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:[(0,u.jsx)(`path`,{d:`M8 2.2 12.6 4v3.8c0 2.6-1.7 5-4.6 5.8-2.9-.8-4.6-3.2-4.6-5.8V4L8 2.2Z`}),(0,u.jsx)(`path`,{d:`m5.6 7.9 1.5 1.5 3.3-3.3`})]});case`metric`:return(0,u.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:[(0,u.jsx)(`path`,{d:`M2.5 11.8h11`}),(0,u.jsx)(`path`,{d:`M4.2 10.8V8.1M8 10.8V5.2m3.8 5.6V3.6`})]});case`semantic_model`:return(0,u.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:[(0,u.jsx)(`rect`,{x:`2.4`,y:`3`,width:`4.2`,height:`4.2`,rx:`1`}),(0,u.jsx)(`rect`,{x:`9.4`,y:`3`,width:`4.2`,height:`4.2`,rx:`1`}),(0,u.jsx)(`rect`,{x:`5.9`,y:`9`,width:`4.2`,height:`4.2`,rx:`1`}),(0,u.jsx)(`path`,{d:`M6.6 5.1h2.8M8 7.2V9`})]});case`macro`:return(0,u.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:[(0,u.jsx)(`path`,{d:`M5.2 3.3H3.4v9.4h1.8M10.8 3.3h1.8v9.4h-1.8`}),(0,u.jsx)(`path`,{d:`m9.6 5.1-3.2 5.8`})]});case`operation`:case`sql_operation`:return(0,u.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:(0,u.jsx)(`path`,{d:`M9.8 2.9a3.2 3.2 0 1 1-1.1 6.2L4 13.8 2.2 12l4.7-4.7a3.2 3.2 0 0 1 2.9-4.4Z`})});default:return(0,u.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:[(0,u.jsx)(`path`,{d:`M4.3 2.8h5l2.4 2.4v7.9H4.3z`}),(0,u.jsx)(`path`,{d:`M9.3 2.8v2.4h2.4`}),(0,u.jsx)(`path`,{d:`M5.8 8h4.4M5.8 10.2h4.4`})]})}}function Xt({mode:e,depth:t}){return e===`database`&&t===0?(0,u.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:[(0,u.jsx)(`ellipse`,{cx:`8`,cy:`4`,rx:`4.6`,ry:`1.8`}),(0,u.jsx)(`path`,{d:`M3.4 4v4.6C3.4 10 5.5 11.2 8 11.2s4.6-1.2 4.6-2.6V4`}),(0,u.jsx)(`path`,{d:`M3.4 6.4C3.4 7.8 5.5 9 8 9s4.6-1.2 4.6-2.6`})]}):(0,u.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:(0,u.jsx)(`path`,{d:`M2.5 4.3h4.1l1.2 1.5H13a.9.9 0 0 1 .9.9v5a.9.9 0 0 1-.9.9H3a.9.9 0 0 1-.9-.9V5.2a.9.9 0 0 1 .4-.9Z`})})}function Zt({title:e,description:t,toolbar:n,leadingPane:r,children:i,inspector:a,className:o=``,suppressHeader:s=!1}){return(0,u.jsxs)(`div`,{className:`workspace-view workspace-scaffold ${o}`.trim(),children:[s?null:(0,u.jsx)(`div`,{className:`lens-header`,children:(0,u.jsxs)(`div`,{className:`lens-header__title`,children:[(0,u.jsx)(`p`,{className:`eyebrow`,children:`Workspace lens`}),(0,u.jsx)(`h2`,{children:e}),(0,u.jsx)(`p`,{className:`lens-header__desc`,children:t})]})}),n?(0,u.jsx)(`div`,{className:`workspace-scaffold__toolbar`,children:n}):null,(0,u.jsxs)(`div`,{className:`workspace-scaffold__body${r?` workspace-scaffold__body--with-leading`:``}${a?` workspace-scaffold__body--with-inspector`:``}`,children:[r?(0,u.jsx)(`aside`,{className:`workspace-scaffold__leading`,children:r}):null,(0,u.jsx)(`div`,{className:`workspace-scaffold__main`,children:i}),a?(0,u.jsx)(`aside`,{className:`workspace-scaffold__inspector`,children:a}):null]})]})}function Qt({actions:e}){return(0,u.jsx)(`div`,{className:`entity-inspector__actions`,children:e.map(e=>(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:e.onClick,disabled:e.disabled,children:e.label},e.label))})}function $t({eyebrow:e,title:t,typeLabel:n,status:r,stats:i,sections:a,actions:o,emptyMessage:s}){return t?(0,u.jsxs)(`aside`,{className:`entity-inspector`,children:[e?(0,u.jsx)(`p`,{className:`eyebrow`,children:e}):null,(0,u.jsxs)(`div`,{className:`entity-inspector__header`,children:[n?(0,u.jsx)(`span`,{className:`entity-inspector__type-badge`,children:n}):null,r]}),(0,u.jsx)(`div`,{className:`entity-inspector__name`,children:(0,u.jsx)(`strong`,{children:t})}),i&&i.length>0?(0,u.jsx)(`dl`,{className:`entity-inspector__stats`,children:i.map(e=>(0,u.jsxs)(`div`,{className:`entity-inspector__stat`,children:[(0,u.jsx)(`dt`,{children:e.label}),(0,u.jsx)(`dd`,{children:e.value})]},e.label))}):null,a?.map(e=>(0,u.jsxs)(`div`,{className:`entity-inspector__section`,children:[(0,u.jsx)(`p`,{className:`entity-inspector__section-label`,children:e.label}),(0,u.jsx)(`div`,{className:`entity-inspector__mono`,children:e.value})]},e.label)),o&&o.length>0?(0,u.jsx)(Qt,{actions:o}):null]}):(0,u.jsx)(`aside`,{className:`entity-inspector entity-inspector--empty`,children:(0,u.jsx)(`p`,{className:`entity-inspector__placeholder`,children:s??`Select an item to inspect`})})}function en({group:e,statusColors:t}){let n=(0,c.useId)(),r=e.statusBreakdown.filter(e=>e.count>0),i=r.length>0?Ht(r):[],a=tt(e.resourceType);return(0,u.jsxs)(`div`,{className:`exec-type-bar-row`,children:[(0,u.jsx)(`div`,{className:`exec-type-bar-row__label`,id:n,title:a,children:a}),(0,u.jsxs)(`div`,{className:`exec-type-bar-row__bars`,children:[(0,u.jsx)(`div`,{className:`exec-type-bar-track`,role:`group`,"aria-labelledby":n,children:r.map(n=>{let r=Gt(n.share),i=Kt(n.share),a=`${n.status}: ${n.count} runs (${i}) of ${e.rowDenominatorCount}`;return(0,u.jsx)(`div`,{className:n.share<.08?`exec-type-bar-segment exec-type-bar-segment--minor`:`exec-type-bar-segment`,style:{flex:`${n.count} 1 0%`,backgroundColor:t[n.tone]},title:a,"aria-label":a,children:r?(0,u.jsxs)(`span`,{className:`exec-type-bar-segment__inner`,children:[i,` (`,n.count,`)`]}):null},`${e.resourceType}-${n.status}`)})}),r.length>0?(0,u.jsx)(`ul`,{className:`exec-type-bar-row__breakdown`,"aria-label":`${a} status breakdown`,children:i.map(n=>{let r=Kt(n.share);return(0,u.jsxs)(`li`,{className:`exec-type-bar-row__breakdown-item`,children:[(0,u.jsx)(`span`,{className:`legend-row__swatch`,style:{background:t[n.tone]},"aria-hidden":!0}),(0,u.jsx)(`span`,{className:`exec-type-bar-row__breakdown-label`,children:n.status}),(0,u.jsxs)(`span`,{className:`exec-type-bar-row__breakdown-metric`,children:[n.count,` · `,r]})]},`${e.resourceType}-${n.status}-breakdown`)})}):null]})]})}function tn({executions:e,executionsForShareDenominator:t}){let n=zt(),r=(0,c.useMemo)(()=>Ge(n),[n]),i=(0,c.useMemo)(()=>wt(e,t),[e,t]);return i.length===0?(0,u.jsx)(`div`,{className:`empty-state`,children:`No execution data.`}):(0,u.jsx)(`div`,{className:`exec-type-bar-stack`,"data-testid":`exec-type-bar-stack`,children:i.map(e=>(0,u.jsx)(en,{group:e,statusColors:r},e.resourceType))})}function nn({executions:e,executionsForShareDenominator:t}){return(0,u.jsx)(tn,{executions:e,executionsForShareDenominator:t})}function rn({graphSummary:e}){let t=Object.entries(e.nodesByType).sort((e,t)=>t[1]-e[1]);return t.length===0?(0,u.jsx)(`div`,{className:`empty-state`,children:`No node-type breakdown available.`}):(0,u.jsx)(`div`,{className:`rank-list`,children:t.map(([t,n])=>(0,u.jsxs)(`div`,{className:`rank-list__row`,children:[(0,u.jsx)(`div`,{className:`rank-list__body`,children:(0,u.jsx)(`strong`,{children:t})}),(0,u.jsxs)(`div`,{className:`rank-list__metric`,children:[(0,u.jsx)(`strong`,{children:n}),(0,u.jsx)(`span`,{children:e.totalNodes>0?`${(n/e.totalNodes*100).toFixed(0)}% of graph`:``})]})]},t))})}var an=[{value:`resources`,label:`Resources`},{value:`totalTime`,label:`Total time`},{value:`avgTime`,label:`Avg time`}];function on(e,t){switch(t){case`resources`:return e.count;case`totalTime`:return e.totalExecutionTime;case`avgTime`:return e.count>0?e.totalExecutionTime/e.count:0}}function sn(e,t){let n=on(e,t);return t===`resources`?n.toLocaleString():et(n)}function cn(e,t){let n=0;for(let r of e){let e=on(r,t);e>n&&(n=e)}return n}function ln(e){return e===`unknown`}function un(e,t){return[...e].sort((e,n)=>{let r=on(e,t),i=on(n,t);if(i!==r)return i-r;let a=ln(e.threadId);return a===ln(n.threadId)?e.threadId.localeCompare(n.threadId):a?1:-1})}var dn=12;function fn(e){let t=e.length,n=t>dn;return{rows:n?e.slice(0,dn):e,totalLanes:t,isTruncated:n}}function pn(e,t,n){let r=sn(e,t);return t===`resources`?`${e.threadId}: ${r} runs (${n}% of slice)`:t===`avgTime`?`${e.threadId}: ${r} (${e.count.toLocaleString()} runs)`:`${e.threadId}: ${r}`}function mn({derived:e}){let[t,n]=(0,c.useState)(`totalTime`),r=(0,c.useMemo)(()=>e.filteredThreadStats.reduce((e,t)=>e+t.count,0),[e.filteredThreadStats]),{displayRows:i,maxVal:a,isTruncated:o,totalLanes:s}=(0,c.useMemo)(()=>{let{rows:n,totalLanes:r,isTruncated:i}=fn(un(e.filteredThreadStats,t));return{displayRows:n,maxVal:cn(n,t),isTruncated:i,totalLanes:r}},[e.filteredThreadStats,t]);return(0,u.jsxs)(`section`,{className:`overview-module overview-module--threads`,children:[(0,u.jsxs)(`div`,{className:`overview-module__header`,children:[(0,u.jsx)(`h3`,{children:`Thread distribution`}),(0,u.jsx)(`p`,{children:o?`Top ${i.length} of ${s.toLocaleString()} worker lanes by selected metric.`:`Worker lanes in the current execution slice.`})]}),e.filteredThreadStats.length>0?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`div`,{className:`thread-dist-metric-pills pill-row`,role:`radiogroup`,"aria-label":`Thread distribution metric`,children:an.map(e=>(0,u.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":t===e.value,"aria-label":`${e.label}, thread distribution metric`,className:t===e.value?Ke:qe,onClick:()=>n(e.value),children:e.label},e.value))}),(0,u.jsx)(`ul`,{className:`thread-dist-list`,"aria-label":`Worker lanes by metric`,children:i.map(e=>{let n=on(e,t),i=a>0?Math.min(100,n/a*100):0,o=pn(e,t,r>0?Math.round(e.count/r*1e3)/10:0),s=`${e.threadId}, ${o}`;return(0,u.jsxs)(`li`,{className:`thread-dist-row`,"aria-label":s,children:[(0,u.jsx)(`div`,{className:`thread-dist-row__label`,title:e.threadId,children:e.threadId}),(0,u.jsx)(`div`,{className:`thread-dist-row__track-wrap`,children:(0,u.jsx)(`div`,{className:`thread-dist-row__track`,title:o,role:`presentation`,children:(0,u.jsx)(`div`,{className:`thread-dist-row__fill`,style:{width:`${i}%`}})})}),(0,u.jsx)(`div`,{className:`thread-dist-row__value`,children:sn(e,t)})]},e.threadId)})})]}):(0,u.jsx)(Dt,{icon:`⋯`,headline:`No thread data in slice`,subtext:`No matching executions were found for the current dashboard filters.`})]})}function hn({derived:e,analysis:t,workerThreadCount:n,modelsCount:r,testsCount:i}){let a=t.summary.critical_path?.path.length??0;return(0,u.jsxs)(`section`,{className:`overview-module overview-module--footprint`,children:[(0,u.jsxs)(`div`,{className:`overview-module__header`,children:[(0,u.jsx)(`h3`,{children:`Footprint`}),(0,u.jsx)(`p`,{children:`Filtered execution volume, duration, and worker scale.`})]}),(0,u.jsxs)(`div`,{className:`footprint-card`,children:[(0,u.jsxs)(`div`,{className:`footprint-card__stats`,children:[(0,u.jsxs)(`div`,{className:`footprint-card__stat`,children:[(0,u.jsx)(`span`,{children:`Executed`}),(0,u.jsx)(`strong`,{children:e.filteredExecutions.length})]}),(0,u.jsxs)(`div`,{className:`footprint-card__stat`,children:[(0,u.jsx)(`span`,{children:`Runtime`}),(0,u.jsx)(`strong`,{children:et(e.filteredExecutionTime)})]}),(0,u.jsxs)(`div`,{className:`footprint-card__stat`,children:[(0,u.jsx)(`span`,{children:`Worker lanes`}),(0,u.jsx)(`strong`,{children:n})]}),(0,u.jsxs)(`div`,{className:`footprint-card__stat`,children:[(0,u.jsx)(`span`,{children:`Models`}),(0,u.jsx)(`strong`,{children:r})]}),(0,u.jsxs)(`div`,{className:`footprint-card__stat`,children:[(0,u.jsx)(`span`,{children:`Tests`}),(0,u.jsx)(`strong`,{children:i})]})]}),(0,u.jsxs)(`p`,{className:`footprint-card__detail`,children:[`Graph totals remain workspace-wide: `,t.graphSummary.totalNodes,` `,`nodes, `,t.graphSummary.totalEdges,` edges, `,a,` `,`critical-path nodes.`]})]})]})}var gn=[`model`,`source`,`seed`,`snapshot`];function _n(e,t){let n={};for(let r of e){if(!gt(r,t))continue;let e=r.resourceType;n[e]=(n[e]??0)+1}return n}function vn(e,t){let n=e.resources??[],r=t==null?e.graphSummary.nodesByType:_n(n,t),i={};for(let n of e.executions){if(t!=null&&!gt(n,t))continue;let e=n.resourceType;i[e]=(i[e]??0)+1}let a={};for(let n of e.ganttData){if(!yt(n,t))continue;let e=n.resourceType;a[e]=(a[e]??0)+1}let o=new Set([...gn,...Object.keys(r),...Object.keys(i),...Object.keys(a)]),s=[];for(let e of[...o].sort((e,t)=>e.localeCompare(t)))s.push({resourceType:e,graphCount:r[e]??0,runCount:i[e]??0,timelineCount:a[e]??0});return s.filter(e=>gn.includes(e.resourceType)||e.graphCount>0||e.runCount>0||e.timelineCount>0)}function yn({rows:e}){return e.length===0?null:(0,u.jsxs)(`div`,{className:`invocation-resource-stats`,role:`region`,"aria-label":`Invocation resource counts by type`,children:[(0,u.jsx)(`p`,{className:`invocation-resource-stats__title`,children:`Resource counts (manifest graph vs this run vs timeline rows)`}),(0,u.jsxs)(`table`,{className:`invocation-resource-stats__table`,children:[(0,u.jsx)(`thead`,{children:(0,u.jsxs)(`tr`,{children:[(0,u.jsx)(`th`,{scope:`col`,children:`Type`}),(0,u.jsx)(`th`,{scope:`col`,className:`invocation-resource-stats__num`,children:`Manifest graph`}),(0,u.jsx)(`th`,{scope:`col`,className:`invocation-resource-stats__num`,children:`This run`}),(0,u.jsx)(`th`,{scope:`col`,className:`invocation-resource-stats__num`,children:`Timeline`})]})}),(0,u.jsx)(`tbody`,{children:e.map(e=>(0,u.jsxs)(`tr`,{children:[(0,u.jsx)(`th`,{scope:`row`,children:tt(e.resourceType)}),(0,u.jsx)(`td`,{className:`invocation-resource-stats__num`,children:e.graphCount.toLocaleString()}),(0,u.jsx)(`td`,{className:`invocation-resource-stats__num`,children:e.runCount.toLocaleString()}),(0,u.jsx)(`td`,{className:`invocation-resource-stats__num`,children:e.timelineCount.toLocaleString()})]},e.resourceType))})]}),(0,u.jsxs)(`p`,{className:`invocation-resource-stats__note`,children:[`When a project package is in scope, manifest graph counts match that package (same scope as this run and timeline). Synthetic source rows are described in ADR-0032 (`,(0,u.jsx)(`code`,{children:`docs/adr/0032-timeline-includes-dbt-sources-via-snapshot-synthesis.md`}),`).`]})]})}function bn({analysis:e}){let t=e.projectName??ht(e.executions);return(0,u.jsx)(yn,{rows:(0,c.useMemo)(()=>vn(e,t),[e,t])})}function xn(e,t){return e.failingNodes>0?{tone:`danger`,title:`${e.failingNodes} failing node${e.failingNodes===1?``:`s`} require attention`,summary:`Prioritize failing nodes before reviewing downstream impact.`}:e.warningNodes>0?{tone:`warning`,title:`${e.warningNodes} warning node${e.warningNodes===1?``:`s`} need review`,summary:`Warnings surfaced in this run. Review tests and runtime hotspots next.`}:{tone:`positive`,title:`Healthy run`,summary:t?`No failing nodes match the current dashboard filters.`:`No failing nodes surfaced in the latest run.`}}function Sn(e,t){let n=at(e);return[t??`Workspace`,`${e.graphSummary.totalNodes} graph nodes`,`${e.summary.total_nodes} executions`,e.invocationId==null?null:`invocation ${e.invocationId}`,n==null?null:`invocation started ${it(n)}`].filter(e=>!!e)}function Cn(e){return e.find(e=>e.label===`Workspace mode`)?.value??`—`}function wn({analysis:e,projectName:t,analysisSource:n,derived:r,filtered:i,workspaceSignals:a}){let{tone:o,title:s,summary:c}=xn(r,i),l=Sn(e,t),d=et(i?r.filteredExecutionTime:e.summary.total_execution_time),f=M(n),p=Cn(a),m=r.failingNodes>0?`${r.failedModels} failed model${r.failedModels===1?``:`s`} may block downstream investigation.`:r.warningNodes>0?`Review tests and runtime hotspots next.`:null;return(0,u.jsxs)(`section`,{className:`health-posture health-posture--${o}`,"aria-label":`Run posture`,children:[(0,u.jsxs)(`div`,{className:`health-posture__top`,children:[(0,u.jsx)(`p`,{className:`eyebrow`,children:`Run posture`}),(0,u.jsx)(`span`,{className:`health-posture__source`,children:f})]}),(0,u.jsx)(`p`,{className:`health-posture__meta`,children:l.join(` · `)}),(0,u.jsx)(`h3`,{className:`health-posture__headline`,children:s}),(0,u.jsx)(`p`,{className:`health-posture__summary`,children:c}),m!=null&&(0,u.jsx)(`p`,{className:`health-posture__followup`,children:m}),(0,u.jsxs)(`div`,{className:`health-posture__metrics`,role:`list`,children:[(0,u.jsxs)(`div`,{className:`health-posture__metric`,role:`listitem`,children:[(0,u.jsx)(`span`,{children:`Failing`}),(0,u.jsx)(`strong`,{children:r.failingNodes})]}),(0,u.jsxs)(`div`,{className:`health-posture__metric`,role:`listitem`,children:[(0,u.jsx)(`span`,{children:`Warnings`}),(0,u.jsx)(`strong`,{children:r.warningNodes})]}),(0,u.jsxs)(`div`,{className:`health-posture__metric`,role:`listitem`,children:[(0,u.jsx)(`span`,{children:`Runtime`}),(0,u.jsx)(`strong`,{children:d})]}),(0,u.jsxs)(`div`,{className:`health-posture__metric`,role:`listitem`,children:[(0,u.jsx)(`span`,{children:`Workspace`}),(0,u.jsx)(`strong`,{children:p})]})]})]})}var Tn=n(((e,t)=>{var n=typeof Reflect==`object`?Reflect:null,r=n&&typeof n.apply==`function`?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},i=n&&typeof n.ownKeys==`function`?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};function a(e){console&&console.warn&&console.warn(e)}var o=Number.isNaN||function(e){return e!==e};function s(){s.init.call(this)}t.exports=s,t.exports.once=y,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var c=10;function l(e){if(typeof e!=`function`)throw TypeError(`The "listener" argument must be of type Function. Received type `+typeof e)}Object.defineProperty(s,`defaultMaxListeners`,{enumerable:!0,get:function(){return c},set:function(e){if(typeof e!=`number`||e<0||o(e))throw RangeError(`The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received `+e+`.`);c=e}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if(typeof e!=`number`||e<0||o(e))throw RangeError(`The value of "n" is out of range. It must be a non-negative number. Received `+e+`.`);return this._maxListeners=e,this};function u(e){return e._maxListeners===void 0?s.defaultMaxListeners:e._maxListeners}s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i=e===`error`,a=this._events;if(a!==void 0)i&&=a.error===void 0;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=Error(`Unhandled error.`+(o?` (`+o.message+`)`:``));throw s.context=o,s}var c=a[e];if(c===void 0)return!1;if(typeof c==`function`)r(c,this,t);else for(var l=c.length,u=g(c,l),n=0;n<l;++n)r(u[n],this,t);return!0};function d(e,t,n,r){var i,o,s;if(l(n),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit(`newListener`,t,n.listener?n.listener:n),o=e._events),s=o[t]),s===void 0)s=o[t]=n,++e._eventsCount;else if(typeof s==`function`?s=o[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),i=u(e),i>0&&s.length>i&&!s.warned){s.warned=!0;var c=Error(`Possible EventEmitter memory leak detected. `+s.length+` `+String(t)+` listeners added. Use emitter.setMaxListeners() to increase limit`);c.name=`MaxListenersExceededWarning`,c.emitter=e,c.type=t,c.count=s.length,a(c)}return e}s.prototype.addListener=function(e,t){return d(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return d(this,e,t,!0)};function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}s.prototype.once=function(e,t){return l(t),this.on(e,p(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,p(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,r,i,a,o;if(l(t),r=this._events,r===void 0||(n=r[e],n===void 0))return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit(`removeListener`,e,n.listener||t));else if(typeof n!=`function`){for(i=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;i===0?n.shift():_(n,i),n.length===1&&(r[e]=n[0]),r.removeListener!==void 0&&this.emit(`removeListener`,e,o||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,n=this._events,r;if(n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var i=Object.keys(n),a;for(r=0;r<i.length;++r)a=i[r],a!==`removeListener`&&this.removeAllListeners(a);return this.removeAllListeners(`removeListener`),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],typeof t==`function`)this.removeListener(e,t);else if(t!==void 0)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this};function m(e,t,n){var r=e._events;if(r===void 0)return[];var i=r[t];return i===void 0?[]:typeof i==`function`?n?[i.listener||i]:[i]:n?v(i):g(i,i.length)}s.prototype.listeners=function(e){return m(this,e,!0)},s.prototype.rawListeners=function(e){return m(this,e,!1)},s.listenerCount=function(e,t){return typeof e.listenerCount==`function`?e.listenerCount(t):h.call(e,t)},s.prototype.listenerCount=h;function h(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n==`function`)return 1;if(n!==void 0)return n.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]};function g(e,t){for(var n=Array(t),r=0;r<t;++r)n[r]=e[r];return n}function _(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function v(e){for(var t=Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function y(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,a),r(n)}function a(){typeof e.removeListener==`function`&&e.removeListener(`error`,i),n([].slice.call(arguments))}x(e,t,a,{once:!0}),t!==`error`&&b(e,i,{once:!0})})}function b(e,t,n){typeof e.on==`function`&&x(e,`error`,t,n)}function x(e,t,n,r){if(typeof e.on==`function`)r.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener==`function`)e.addEventListener(t,function i(a){r.once&&e.removeEventListener(t,i),n(a)});else throw TypeError(`The "emitter" argument must be of type EventEmitter. Received type `+typeof e)}}))();function En(){let e=arguments[0];for(let t=1,n=arguments.length;t<n;t++)if(arguments[t])for(let n in arguments[t])e[n]=arguments[t][n];return e}var L=En;typeof Object.assign==`function`&&(L=Object.assign);function Dn(e,t,n,r){let i=e._nodes.get(t),a=null;return i&&(a=r===`mixed`?i.out&&i.out[n]||i.undirected&&i.undirected[n]:r===`directed`?i.out&&i.out[n]:i.undirected&&i.undirected[n]),a}function R(e){return typeof e==`object`&&!!e}function On(e){let t;for(t in e)return!1;return!0}function kn(e,t,n){Object.defineProperty(e,t,{enumerable:!1,configurable:!1,writable:!0,value:n})}function An(e,t,n){let r={enumerable:!0,configurable:!0};typeof n==`function`?r.get=n:(r.value=n,r.writable=!1),Object.defineProperty(e,t,r)}function jn(e){return!(!R(e)||e.attributes&&!Array.isArray(e.attributes))}function Mn(){let e=Math.floor(Math.random()*256)&255;return()=>e++}function Nn(){let e=arguments,t=null,n=-1;return{[Symbol.iterator](){return this},next(){let r=null;do{if(t===null){if(n++,n>=e.length)return{done:!0};t=e[n][Symbol.iterator]()}if(r=t.next(),r.done){t=null;continue}break}while(!0);return r}}}function Pn(){return{[Symbol.iterator](){return this},next(){return{done:!0}}}}var Fn=class extends Error{constructor(e){super(),this.name=`GraphError`,this.message=e}},z=class e extends Fn{constructor(t){super(t),this.name=`InvalidArgumentsGraphError`,typeof Error.captureStackTrace==`function`&&Error.captureStackTrace(this,e.prototype.constructor)}},B=class e extends Fn{constructor(t){super(t),this.name=`NotFoundGraphError`,typeof Error.captureStackTrace==`function`&&Error.captureStackTrace(this,e.prototype.constructor)}},V=class e extends Fn{constructor(t){super(t),this.name=`UsageGraphError`,typeof Error.captureStackTrace==`function`&&Error.captureStackTrace(this,e.prototype.constructor)}};function In(e,t){this.key=e,this.attributes=t,this.clear()}In.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=0,this.in={},this.out={},this.undirected={}};function Ln(e,t){this.key=e,this.attributes=t,this.clear()}Ln.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function Rn(e,t){this.key=e,this.attributes=t,this.clear()}Rn.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function zn(e,t,n,r,i){this.key=t,this.attributes=i,this.undirected=e,this.source=n,this.target=r}zn.prototype.attach=function(){let e=`out`,t=`in`;this.undirected&&(e=t=`undirected`);let n=this.source.key,r=this.target.key;this.source[e][r]=this,!(this.undirected&&n===r)&&(this.target[t][n]=this)},zn.prototype.attachMulti=function(){let e=`out`,t=`in`,n=this.source.key,r=this.target.key;this.undirected&&(e=t=`undirected`);let i=this.source[e],a=i[r];if(a===void 0){i[r]=this,this.undirected&&n===r||(this.target[t][n]=this);return}a.previous=this,this.next=a,i[r]=this,this.target[t][n]=this},zn.prototype.detach=function(){let e=this.source.key,t=this.target.key,n=`out`,r=`in`;this.undirected&&(n=r=`undirected`),delete this.source[n][t],delete this.target[r][e]},zn.prototype.detachMulti=function(){let e=this.source.key,t=this.target.key,n=`out`,r=`in`;this.undirected&&(n=r=`undirected`),this.previous===void 0?this.next===void 0?(delete this.source[n][t],delete this.target[r][e]):(this.next.previous=void 0,this.source[n][t]=this.next,this.target[r][e]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};var Bn=0,Vn=1,Hn=2,Un=3;function Wn(e,t,n,r,i,a,o){let s,c,l,u;if(r=``+r,n===Bn){if(s=e._nodes.get(r),!s)throw new B(`Graph.${t}: could not find the "${r}" node in the graph.`);l=i,u=a}else if(n===Un){if(i=``+i,c=e._edges.get(i),!c)throw new B(`Graph.${t}: could not find the "${i}" edge in the graph.`);let n=c.source.key,d=c.target.key;if(r===n)s=c.target;else if(r===d)s=c.source;else throw new B(`Graph.${t}: the "${r}" node is not attached to the "${i}" edge (${n}, ${d}).`);l=a,u=o}else{if(c=e._edges.get(r),!c)throw new B(`Graph.${t}: could not find the "${r}" edge in the graph.`);s=n===Vn?c.source:c.target,l=i,u=a}return[s,l,u]}function Gn(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=Wn(this,t,n,e,r,i);return a.attributes[o]}}function Kn(e,t,n){e.prototype[t]=function(e,r){let[i]=Wn(this,t,n,e,r);return i.attributes}}function qn(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=Wn(this,t,n,e,r,i);return a.attributes.hasOwnProperty(o)}}function Jn(e,t,n){e.prototype[t]=function(e,r,i,a){let[o,s,c]=Wn(this,t,n,e,r,i,a);return o.attributes[s]=c,this.emit(`nodeAttributesUpdated`,{key:o.key,type:`set`,attributes:o.attributes,name:s}),this}}function Yn(e,t,n){e.prototype[t]=function(e,r,i,a){let[o,s,c]=Wn(this,t,n,e,r,i,a);if(typeof c!=`function`)throw new z(`Graph.${t}: updater should be a function.`);let l=o.attributes;return l[s]=c(l[s]),this.emit(`nodeAttributesUpdated`,{key:o.key,type:`set`,attributes:o.attributes,name:s}),this}}function Xn(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=Wn(this,t,n,e,r,i);return delete a.attributes[o],this.emit(`nodeAttributesUpdated`,{key:a.key,type:`remove`,attributes:a.attributes,name:o}),this}}function Zn(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=Wn(this,t,n,e,r,i);if(!R(o))throw new z(`Graph.${t}: provided attributes are not a plain object.`);return a.attributes=o,this.emit(`nodeAttributesUpdated`,{key:a.key,type:`replace`,attributes:a.attributes}),this}}function Qn(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=Wn(this,t,n,e,r,i);if(!R(o))throw new z(`Graph.${t}: provided attributes are not a plain object.`);return L(a.attributes,o),this.emit(`nodeAttributesUpdated`,{key:a.key,type:`merge`,attributes:a.attributes,data:o}),this}}function $n(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=Wn(this,t,n,e,r,i);if(typeof o!=`function`)throw new z(`Graph.${t}: provided updater is not a function.`);return a.attributes=o(a.attributes),this.emit(`nodeAttributesUpdated`,{key:a.key,type:`update`,attributes:a.attributes}),this}}var er=[{name:e=>`get${e}Attribute`,attacher:Gn},{name:e=>`get${e}Attributes`,attacher:Kn},{name:e=>`has${e}Attribute`,attacher:qn},{name:e=>`set${e}Attribute`,attacher:Jn},{name:e=>`update${e}Attribute`,attacher:Yn},{name:e=>`remove${e}Attribute`,attacher:Xn},{name:e=>`replace${e}Attributes`,attacher:Zn},{name:e=>`merge${e}Attributes`,attacher:Qn},{name:e=>`update${e}Attributes`,attacher:$n}];function tr(e){er.forEach(function({name:t,attacher:n}){n(e,t(`Node`),Bn),n(e,t(`Source`),Vn),n(e,t(`Target`),Hn),n(e,t(`Opposite`),Un)})}function nr(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new V(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new V(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=Dn(this,a,o,n),!i)throw new B(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new V(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new B(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return i.attributes[r]}}function rr(e,t,n){e.prototype[t]=function(e){let r;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new V(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new V(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let i=``+e,a=``+arguments[1];if(r=Dn(this,i,a,n),!r)throw new B(`Graph.${t}: could not find an edge for the given path ("${i}" - "${a}").`)}else{if(n!==`mixed`)throw new V(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,r=this._edges.get(e),!r)throw new B(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return r.attributes}}function ir(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new V(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new V(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=Dn(this,a,o,n),!i)throw new B(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new V(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new B(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return i.attributes.hasOwnProperty(r)}}function ar(e,t,n){e.prototype[t]=function(e,r,i){let a;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new V(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new V(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let o=``+e,s=``+r;if(r=arguments[2],i=arguments[3],a=Dn(this,o,s,n),!a)throw new B(`Graph.${t}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(n!==`mixed`)throw new V(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,a=this._edges.get(e),!a)throw new B(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return a.attributes[r]=i,this.emit(`edgeAttributesUpdated`,{key:a.key,type:`set`,attributes:a.attributes,name:r}),this}}function or(e,t,n){e.prototype[t]=function(e,r,i){let a;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new V(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new V(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let o=``+e,s=``+r;if(r=arguments[2],i=arguments[3],a=Dn(this,o,s,n),!a)throw new B(`Graph.${t}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(n!==`mixed`)throw new V(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,a=this._edges.get(e),!a)throw new B(`Graph.${t}: could not find the "${e}" edge in the graph.`)}if(typeof i!=`function`)throw new z(`Graph.${t}: updater should be a function.`);return a.attributes[r]=i(a.attributes[r]),this.emit(`edgeAttributesUpdated`,{key:a.key,type:`set`,attributes:a.attributes,name:r}),this}}function sr(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new V(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new V(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=Dn(this,a,o,n),!i)throw new B(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new V(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new B(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return delete i.attributes[r],this.emit(`edgeAttributesUpdated`,{key:i.key,type:`remove`,attributes:i.attributes,name:r}),this}}function cr(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new V(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new V(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=Dn(this,a,o,n),!i)throw new B(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new V(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new B(`Graph.${t}: could not find the "${e}" edge in the graph.`)}if(!R(r))throw new z(`Graph.${t}: provided attributes are not a plain object.`);return i.attributes=r,this.emit(`edgeAttributesUpdated`,{key:i.key,type:`replace`,attributes:i.attributes}),this}}function lr(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new V(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new V(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=Dn(this,a,o,n),!i)throw new B(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new V(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new B(`Graph.${t}: could not find the "${e}" edge in the graph.`)}if(!R(r))throw new z(`Graph.${t}: provided attributes are not a plain object.`);return L(i.attributes,r),this.emit(`edgeAttributesUpdated`,{key:i.key,type:`merge`,attributes:i.attributes,data:r}),this}}function ur(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new V(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new V(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=Dn(this,a,o,n),!i)throw new B(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new V(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new B(`Graph.${t}: could not find the "${e}" edge in the graph.`)}if(typeof r!=`function`)throw new z(`Graph.${t}: provided updater is not a function.`);return i.attributes=r(i.attributes),this.emit(`edgeAttributesUpdated`,{key:i.key,type:`update`,attributes:i.attributes}),this}}var dr=[{name:e=>`get${e}Attribute`,attacher:nr},{name:e=>`get${e}Attributes`,attacher:rr},{name:e=>`has${e}Attribute`,attacher:ir},{name:e=>`set${e}Attribute`,attacher:ar},{name:e=>`update${e}Attribute`,attacher:or},{name:e=>`remove${e}Attribute`,attacher:sr},{name:e=>`replace${e}Attributes`,attacher:cr},{name:e=>`merge${e}Attributes`,attacher:lr},{name:e=>`update${e}Attributes`,attacher:ur}];function fr(e){dr.forEach(function({name:t,attacher:n}){n(e,t(`Edge`),`mixed`),n(e,t(`DirectedEdge`),`directed`),n(e,t(`UndirectedEdge`),`undirected`)})}var pr=[{name:`edges`,type:`mixed`},{name:`inEdges`,type:`directed`,direction:`in`},{name:`outEdges`,type:`directed`,direction:`out`},{name:`inboundEdges`,type:`mixed`,direction:`in`},{name:`outboundEdges`,type:`mixed`,direction:`out`},{name:`directedEdges`,type:`directed`},{name:`undirectedEdges`,type:`undirected`}];function mr(e,t,n,r){let i=!1;for(let a in t){if(a===r)continue;let o=t[a];if(i=n(o.key,o.attributes,o.source.key,o.target.key,o.source.attributes,o.target.attributes,o.undirected),e&&i)return o.key}}function hr(e,t,n,r){let i,a,o,s=!1;for(let c in t)if(c!==r){i=t[c];do{if(a=i.source,o=i.target,s=n(i.key,i.attributes,a.key,o.key,a.attributes,o.attributes,i.undirected),e&&s)return i.key;i=i.next}while(i!==void 0)}}function gr(e,t){let n=Object.keys(e),r=n.length,i,a=0;return{[Symbol.iterator](){return this},next(){do if(i)i=i.next;else{if(a>=r)return{done:!0};let o=n[a++];if(o===t){i=void 0;continue}i=e[o]}while(!i);return{done:!1,value:{edge:i.key,attributes:i.attributes,source:i.source.key,target:i.target.key,sourceAttributes:i.source.attributes,targetAttributes:i.target.attributes,undirected:i.undirected}}}}}function _r(e,t,n,r){let i=t[n];if(!i)return;let a=i.source,o=i.target;if(r(i.key,i.attributes,a.key,o.key,a.attributes,o.attributes,i.undirected)&&e)return i.key}function vr(e,t,n,r){let i=t[n];if(!i)return;let a=!1;do{if(a=r(i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes,i.undirected),e&&a)return i.key;i=i.next}while(i!==void 0)}function yr(e,t){let n=e[t];if(n.next!==void 0)return{[Symbol.iterator](){return this},next(){if(!n)return{done:!0};let e={edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected};return n=n.next,{done:!1,value:e}}};let r=!1;return{[Symbol.iterator](){return this},next(){return r===!0?{done:!0}:(r=!0,{done:!1,value:{edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected}})}}}function br(e,t){if(e.size===0)return[];if(t===`mixed`||t===e.type)return Array.from(e._edges.keys());let n=t===`undirected`?e.undirectedSize:e.directedSize,r=Array(n),i=t===`undirected`,a=e._edges.values(),o=0,s,c;for(;s=a.next(),s.done!==!0;)c=s.value,c.undirected===i&&(r[o++]=c.key);return r}function xr(e,t,n,r){if(t.size===0)return;let i=n!==`mixed`&&n!==t.type,a=n===`undirected`,o,s,c=!1,l=t._edges.values();for(;o=l.next(),o.done!==!0;){if(s=o.value,i&&s.undirected!==a)continue;let{key:t,attributes:n,source:l,target:u}=s;if(c=r(t,n,l.key,u.key,l.attributes,u.attributes,s.undirected),e&&c)return t}}function Sr(e,t){if(e.size===0)return Pn();let n=t!==`mixed`&&t!==e.type,r=t===`undirected`,i=e._edges.values();return{[Symbol.iterator](){return this},next(){let e,t;for(;;){if(e=i.next(),e.done)return e;if(t=e.value,!(n&&t.undirected!==r))break}return{value:{edge:t.key,attributes:t.attributes,source:t.source.key,target:t.target.key,sourceAttributes:t.source.attributes,targetAttributes:t.target.attributes,undirected:t.undirected},done:!1}}}}function Cr(e,t,n,r,i,a){let o=t?hr:mr,s;if(n!==`undirected`&&(r!==`out`&&(s=o(e,i.in,a),e&&s)||r!==`in`&&(s=o(e,i.out,a,r?void 0:i.key),e&&s))||n!==`directed`&&(s=o(e,i.undirected,a),e&&s))return s}function wr(e,t,n,r){let i=[];return Cr(!1,e,t,n,r,function(e){i.push(e)}),i}function Tr(e,t,n){let r=Pn();return e!==`undirected`&&(t!==`out`&&n.in!==void 0&&(r=Nn(r,gr(n.in))),t!==`in`&&n.out!==void 0&&(r=Nn(r,gr(n.out,t?void 0:n.key)))),e!==`directed`&&n.undirected!==void 0&&(r=Nn(r,gr(n.undirected))),r}function Er(e,t,n,r,i,a,o){let s=n?vr:_r,c;if(t!==`undirected`&&(i.in!==void 0&&r!==`out`&&(c=s(e,i.in,a,o),e&&c)||i.out!==void 0&&r!==`in`&&(r||i.key!==a)&&(c=s(e,i.out,a,o),e&&c))||t!==`directed`&&i.undirected!==void 0&&(c=s(e,i.undirected,a,o),e&&c))return c}function Dr(e,t,n,r,i){let a=[];return Er(!1,e,t,n,r,i,function(e){a.push(e)}),a}function Or(e,t,n,r){let i=Pn();return e!==`undirected`&&(n.in!==void 0&&t!==`out`&&r in n.in&&(i=Nn(i,yr(n.in,r))),n.out!==void 0&&t!==`in`&&r in n.out&&(t||n.key!==r)&&(i=Nn(i,yr(n.out,r)))),e!==`directed`&&n.undirected!==void 0&&r in n.undirected&&(i=Nn(i,yr(n.undirected,r))),i}function kr(e,t){let{name:n,type:r,direction:i}=t;e.prototype[n]=function(e,t){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return[];if(!arguments.length)return br(this,r);if(arguments.length===1){e=``+e;let t=this._nodes.get(e);if(t===void 0)throw new B(`Graph.${n}: could not find the "${e}" node in the graph.`);return wr(this.multi,r===`mixed`?this.type:r,i,t)}if(arguments.length===2){e=``+e,t=``+t;let a=this._nodes.get(e);if(!a)throw new B(`Graph.${n}: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new B(`Graph.${n}: could not find the "${t}" target node in the graph.`);return Dr(r,this.multi,i,a,t)}throw new z(`Graph.${n}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function Ar(e,t){let{name:n,type:r,direction:i}=t,a=`forEach`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[a]=function(e,t,n){if(!(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)){if(arguments.length===1)return n=e,xr(!1,this,r,n);if(arguments.length===2){e=``+e,n=t;let o=this._nodes.get(e);if(o===void 0)throw new B(`Graph.${a}: could not find the "${e}" node in the graph.`);return Cr(!1,this.multi,r===`mixed`?this.type:r,i,o,n)}if(arguments.length===3){e=``+e,t=``+t;let o=this._nodes.get(e);if(!o)throw new B(`Graph.${a}: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new B(`Graph.${a}: could not find the "${t}" target node in the graph.`);return Er(!1,r,this.multi,i,o,t,n)}throw new z(`Graph.${a}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};let o=`map`+n[0].toUpperCase()+n.slice(1);e.prototype[o]=function(){let e=Array.prototype.slice.call(arguments),t=e.pop(),n;if(e.length===0){let i=0;r!==`directed`&&(i+=this.undirectedSize),r!==`undirected`&&(i+=this.directedSize),n=Array(i);let a=0;e.push((e,r,i,o,s,c,l)=>{n[a++]=t(e,r,i,o,s,c,l)})}else n=[],e.push((e,r,i,a,o,s,c)=>{n.push(t(e,r,i,a,o,s,c))});return this[a].apply(this,e),n};let s=`filter`+n[0].toUpperCase()+n.slice(1);e.prototype[s]=function(){let e=Array.prototype.slice.call(arguments),t=e.pop(),n=[];return e.push((e,r,i,a,o,s,c)=>{t(e,r,i,a,o,s,c)&&n.push(e)}),this[a].apply(this,e),n};let c=`reduce`+n[0].toUpperCase()+n.slice(1);e.prototype[c]=function(){let e=Array.prototype.slice.call(arguments);if(e.length<2||e.length>4)throw new z(`Graph.${c}: invalid number of arguments (expecting 2, 3 or 4 and got ${e.length}).`);if(typeof e[e.length-1]==`function`&&typeof e[e.length-2]!=`function`)throw new z(`Graph.${c}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let t,n;e.length===2?(t=e[0],n=e[1],e=[]):e.length===3?(t=e[1],n=e[2],e=[e[0]]):e.length===4&&(t=e[2],n=e[3],e=[e[0],e[1]]);let r=n;return e.push((e,n,i,a,o,s,c)=>{r=t(r,e,n,i,a,o,s,c)}),this[a].apply(this,e),r}}function jr(e,t){let{name:n,type:r,direction:i}=t,a=`find`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[a]=function(e,t,n){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return!1;if(arguments.length===1)return n=e,xr(!0,this,r,n);if(arguments.length===2){e=``+e,n=t;let o=this._nodes.get(e);if(o===void 0)throw new B(`Graph.${a}: could not find the "${e}" node in the graph.`);return Cr(!0,this.multi,r===`mixed`?this.type:r,i,o,n)}if(arguments.length===3){e=``+e,t=``+t;let o=this._nodes.get(e);if(!o)throw new B(`Graph.${a}: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new B(`Graph.${a}: could not find the "${t}" target node in the graph.`);return Er(!0,r,this.multi,i,o,t,n)}throw new z(`Graph.${a}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};let o=`some`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(){let e=Array.prototype.slice.call(arguments),t=e.pop();return e.push((e,n,r,i,a,o,s)=>t(e,n,r,i,a,o,s)),!!this[a].apply(this,e)};let s=`every`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[s]=function(){let e=Array.prototype.slice.call(arguments),t=e.pop();return e.push((e,n,r,i,a,o,s)=>!t(e,n,r,i,a,o,s)),!this[a].apply(this,e)}}function Mr(e,t){let{name:n,type:r,direction:i}=t,a=n.slice(0,-1)+`Entries`;e.prototype[a]=function(e,t){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return Pn();if(!arguments.length)return Sr(this,r);if(arguments.length===1){e=``+e;let t=this._nodes.get(e);if(!t)throw new B(`Graph.${a}: could not find the "${e}" node in the graph.`);return Tr(r,i,t)}if(arguments.length===2){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new B(`Graph.${a}: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new B(`Graph.${a}: could not find the "${t}" target node in the graph.`);return Or(r,i,n,t)}throw new z(`Graph.${a}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function Nr(e){pr.forEach(t=>{kr(e,t),Ar(e,t),jr(e,t),Mr(e,t)})}var Pr=[{name:`neighbors`,type:`mixed`},{name:`inNeighbors`,type:`directed`,direction:`in`},{name:`outNeighbors`,type:`directed`,direction:`out`},{name:`inboundNeighbors`,type:`mixed`,direction:`in`},{name:`outboundNeighbors`,type:`mixed`,direction:`out`},{name:`directedNeighbors`,type:`directed`},{name:`undirectedNeighbors`,type:`undirected`}];function Fr(){this.A=null,this.B=null}Fr.prototype.wrap=function(e){this.A===null?this.A=e:this.B===null&&(this.B=e)},Fr.prototype.has=function(e){return this.A!==null&&e in this.A||this.B!==null&&e in this.B};function Ir(e,t,n,r,i){for(let a in r){let o=r[a],s=o.source,c=o.target,l=s===n?c:s;if(t&&t.has(l.key))continue;let u=i(l.key,l.attributes);if(e&&u)return l.key}}function Lr(e,t,n,r,i){if(t!==`mixed`){if(t===`undirected`)return Ir(e,null,r,r.undirected,i);if(typeof n==`string`)return Ir(e,null,r,r[n],i)}let a=new Fr,o;if(t!==`undirected`){if(n!==`out`){if(o=Ir(e,null,r,r.in,i),e&&o)return o;a.wrap(r.in)}if(n!==`in`){if(o=Ir(e,a,r,r.out,i),e&&o)return o;a.wrap(r.out)}}if(t!==`directed`&&(o=Ir(e,a,r,r.undirected,i),e&&o))return o}function Rr(e,t,n){if(e!==`mixed`){if(e===`undirected`)return Object.keys(n.undirected);if(typeof t==`string`)return Object.keys(n[t])}let r=[];return Lr(!1,e,t,n,function(e){r.push(e)}),r}function zr(e,t,n){let r=Object.keys(n),i=r.length,a=0;return{[Symbol.iterator](){return this},next(){let o=null;do{if(a>=i)return e&&e.wrap(n),{done:!0};let s=n[r[a++]],c=s.source,l=s.target;if(o=c===t?l:c,e&&e.has(o.key)){o=null;continue}}while(o===null);return{done:!1,value:{neighbor:o.key,attributes:o.attributes}}}}}function Br(e,t,n){if(e!==`mixed`){if(e===`undirected`)return zr(null,n,n.undirected);if(typeof t==`string`)return zr(null,n,n[t])}let r=Pn(),i=new Fr;return e!==`undirected`&&(t!==`out`&&(r=Nn(r,zr(i,n,n.in))),t!==`in`&&(r=Nn(r,zr(i,n,n.out)))),e!==`directed`&&(r=Nn(r,zr(i,n,n.undirected))),r}function Vr(e,t){let{name:n,type:r,direction:i}=t;e.prototype[n]=function(e){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return[];e=``+e;let t=this._nodes.get(e);if(t===void 0)throw new B(`Graph.${n}: could not find the "${e}" node in the graph.`);return Rr(r===`mixed`?this.type:r,i,t)}}function Hr(e,t){let{name:n,type:r,direction:i}=t,a=`forEach`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[a]=function(e,t){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return;e=``+e;let n=this._nodes.get(e);if(n===void 0)throw new B(`Graph.${a}: could not find the "${e}" node in the graph.`);Lr(!1,r===`mixed`?this.type:r,i,n,t)};let o=`map`+n[0].toUpperCase()+n.slice(1);e.prototype[o]=function(e,t){let n=[];return this[a](e,(e,r)=>{n.push(t(e,r))}),n};let s=`filter`+n[0].toUpperCase()+n.slice(1);e.prototype[s]=function(e,t){let n=[];return this[a](e,(e,r)=>{t(e,r)&&n.push(e)}),n};let c=`reduce`+n[0].toUpperCase()+n.slice(1);e.prototype[c]=function(e,t,n){if(arguments.length<3)throw new z(`Graph.${c}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let r=n;return this[a](e,(e,n)=>{r=t(r,e,n)}),r}}function Ur(e,t){let{name:n,type:r,direction:i}=t,a=n[0].toUpperCase()+n.slice(1,-1),o=`find`+a;e.prototype[o]=function(e,t){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return;e=``+e;let n=this._nodes.get(e);if(n===void 0)throw new B(`Graph.${o}: could not find the "${e}" node in the graph.`);return Lr(!0,r===`mixed`?this.type:r,i,n,t)};let s=`some`+a;e.prototype[s]=function(e,t){return!!this[o](e,t)};let c=`every`+a;e.prototype[c]=function(e,t){return!this[o](e,(e,n)=>!t(e,n))}}function Wr(e,t){let{name:n,type:r,direction:i}=t,a=n.slice(0,-1)+`Entries`;e.prototype[a]=function(e){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return Pn();e=``+e;let t=this._nodes.get(e);if(t===void 0)throw new B(`Graph.${a}: could not find the "${e}" node in the graph.`);return Br(r===`mixed`?this.type:r,i,t)}}function Gr(e){Pr.forEach(t=>{Vr(e,t),Hr(e,t),Ur(e,t),Wr(e,t)})}function Kr(e,t,n,r,i){let a=r._nodes.values(),o=r.type,s,c,l,u,d,f,p;for(;s=a.next(),s.done!==!0;){let r=!1;if(c=s.value,o!==`undirected`)for(l in u=c.out,u){d=u[l];do{if(f=d.target,r=!0,p=i(c.key,f.key,c.attributes,f.attributes,d.key,d.attributes,d.undirected),e&&p)return d;d=d.next}while(d)}if(o!==`directed`){for(l in u=c.undirected,u)if(!(t&&c.key>l)){d=u[l];do{if(f=d.target,f.key!==l&&(f=d.source),r=!0,p=i(c.key,f.key,c.attributes,f.attributes,d.key,d.attributes,d.undirected),e&&p)return d;d=d.next}while(d)}}if(n&&!r&&(p=i(c.key,null,c.attributes,null,null,null,null),e&&p))return null}}function qr(e,t){let n={key:e};return On(t.attributes)||(n.attributes=L({},t.attributes)),n}function Jr(e,t,n){let r={key:t,source:n.source.key,target:n.target.key};return On(n.attributes)||(r.attributes=L({},n.attributes)),e===`mixed`&&n.undirected&&(r.undirected=!0),r}function Yr(e){if(!R(e))throw new z(`Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.`);if(!(`key`in e))throw new z(`Graph.import: serialized node is missing its key.`);if(`attributes`in e&&(!R(e.attributes)||e.attributes===null))throw new z(`Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.`)}function Xr(e){if(!R(e))throw new z(`Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.`);if(!(`source`in e))throw new z(`Graph.import: serialized edge is missing its source.`);if(!(`target`in e))throw new z(`Graph.import: serialized edge is missing its target.`);if(`attributes`in e&&(!R(e.attributes)||e.attributes===null))throw new z(`Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.`);if(`undirected`in e&&typeof e.undirected!=`boolean`)throw new z(`Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.`)}var Zr=Mn(),Qr=new Set([`directed`,`undirected`,`mixed`]),$r=new Set([`domain`,`_events`,`_eventsCount`,`_maxListeners`]),ei=[{name:e=>`${e}Edge`,generateKey:!0},{name:e=>`${e}DirectedEdge`,generateKey:!0,type:`directed`},{name:e=>`${e}UndirectedEdge`,generateKey:!0,type:`undirected`},{name:e=>`${e}EdgeWithKey`},{name:e=>`${e}DirectedEdgeWithKey`,type:`directed`},{name:e=>`${e}UndirectedEdgeWithKey`,type:`undirected`}],ti={allowSelfLoops:!0,multi:!1,type:`mixed`};function ni(e,t,n){if(n&&!R(n))throw new z(`Graph.addNode: invalid attributes. Expecting an object but got "${n}"`);if(t=``+t,n||={},e._nodes.has(t))throw new V(`Graph.addNode: the "${t}" node already exist in the graph.`);let r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit(`nodeAdded`,{key:t,attributes:n}),r}function ri(e,t,n){let r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit(`nodeAdded`,{key:t,attributes:n}),r}function ii(e,t,n,r,i,a,o,s){if(!r&&e.type===`undirected`)throw new V(`Graph.${t}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(r&&e.type===`directed`)throw new V(`Graph.${t}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(s&&!R(s))throw new z(`Graph.${t}: invalid attributes. Expecting an object but got "${s}"`);if(a=``+a,o=``+o,s||={},!e.allowSelfLoops&&a===o)throw new V(`Graph.${t}: source & target are the same ("${a}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let c=e._nodes.get(a),l=e._nodes.get(o);if(!c)throw new B(`Graph.${t}: source node "${a}" not found.`);if(!l)throw new B(`Graph.${t}: target node "${o}" not found.`);let u={key:null,undirected:r,source:a,target:o,attributes:s};if(n)i=e._edgeKeyGenerator();else if(i=``+i,e._edges.has(i))throw new V(`Graph.${t}: the "${i}" edge already exists in the graph.`);if(!e.multi&&(r?c.undirected[o]!==void 0:c.out[o]!==void 0))throw new V(`Graph.${t}: an edge linking "${a}" to "${o}" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`);let d=new zn(r,i,c,l,s);e._edges.set(i,d);let f=a===o;return r?(c.undirectedDegree++,l.undirectedDegree++,f&&(c.undirectedLoops++,e._undirectedSelfLoopCount++)):(c.outDegree++,l.inDegree++,f&&(c.directedLoops++,e._directedSelfLoopCount++)),e.multi?d.attachMulti():d.attach(),r?e._undirectedSize++:e._directedSize++,u.key=i,e.emit(`edgeAdded`,u),i}function ai(e,t,n,r,i,a,o,s,c){if(!r&&e.type===`undirected`)throw new V(`Graph.${t}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(r&&e.type===`directed`)throw new V(`Graph.${t}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(s){if(c){if(typeof s!=`function`)throw new z(`Graph.${t}: invalid updater function. Expecting a function but got "${s}"`)}else if(!R(s))throw new z(`Graph.${t}: invalid attributes. Expecting an object but got "${s}"`)}a=``+a,o=``+o;let l;if(c&&(l=s,s=void 0),!e.allowSelfLoops&&a===o)throw new V(`Graph.${t}: source & target are the same ("${a}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let u=e._nodes.get(a),d=e._nodes.get(o),f,p;if(!n&&(f=e._edges.get(i),f)){if((f.source.key!==a||f.target.key!==o)&&(!r||f.source.key!==o||f.target.key!==a))throw new V(`Graph.${t}: inconsistency detected when attempting to merge the "${i}" edge with "${a}" source & "${o}" target vs. ("${f.source.key}", "${f.target.key}").`);p=f}if(!p&&!e.multi&&u&&(p=r?u.undirected[o]:u.out[o]),p){let t=[p.key,!1,!1,!1];if(c?!l:!s)return t;if(c){let t=p.attributes;p.attributes=l(t),e.emit(`edgeAttributesUpdated`,{type:`replace`,key:p.key,attributes:p.attributes})}else L(p.attributes,s),e.emit(`edgeAttributesUpdated`,{type:`merge`,key:p.key,attributes:p.attributes,data:s});return t}s||={},c&&l&&(s=l(s));let m={key:null,undirected:r,source:a,target:o,attributes:s};if(n)i=e._edgeKeyGenerator();else if(i=``+i,e._edges.has(i))throw new V(`Graph.${t}: the "${i}" edge already exists in the graph.`);let h=!1,g=!1;u||(u=ri(e,a,{}),h=!0,a===o&&(d=u,g=!0)),d||(d=ri(e,o,{}),g=!0),f=new zn(r,i,u,d,s),e._edges.set(i,f);let _=a===o;return r?(u.undirectedDegree++,d.undirectedDegree++,_&&(u.undirectedLoops++,e._undirectedSelfLoopCount++)):(u.outDegree++,d.inDegree++,_&&(u.directedLoops++,e._directedSelfLoopCount++)),e.multi?f.attachMulti():f.attach(),r?e._undirectedSize++:e._directedSize++,m.key=i,e.emit(`edgeAdded`,m),[i,!0,h,g]}function oi(e,t){e._edges.delete(t.key);let{source:n,target:r,attributes:i}=t,a=t.undirected,o=n===r;a?(n.undirectedDegree--,r.undirectedDegree--,o&&(n.undirectedLoops--,e._undirectedSelfLoopCount--)):(n.outDegree--,r.inDegree--,o&&(n.directedLoops--,e._directedSelfLoopCount--)),e.multi?t.detachMulti():t.detach(),a?e._undirectedSize--:e._directedSize--,e.emit(`edgeDropped`,{key:t.key,attributes:i,source:n.key,target:r.key,undirected:a})}var H=class e extends Tn.EventEmitter{constructor(e){if(super(),e=L({},ti,e),typeof e.multi!=`boolean`)throw new z(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${e.multi}".`);if(!Qr.has(e.type))throw new z(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${e.type}".`);if(typeof e.allowSelfLoops!=`boolean`)throw new z(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${e.allowSelfLoops}".`);let t=e.type===`mixed`?In:e.type===`directed`?Ln:Rn;kn(this,`NodeDataClass`,t);let n=`geid_`+Zr()+`_`,r=0;kn(this,`_attributes`,{}),kn(this,`_nodes`,new Map),kn(this,`_edges`,new Map),kn(this,`_directedSize`,0),kn(this,`_undirectedSize`,0),kn(this,`_directedSelfLoopCount`,0),kn(this,`_undirectedSelfLoopCount`,0),kn(this,`_edgeKeyGenerator`,()=>{let e;do e=n+ r++;while(this._edges.has(e));return e}),kn(this,`_options`,e),$r.forEach(e=>kn(this,e,this[e])),An(this,`order`,()=>this._nodes.size),An(this,`size`,()=>this._edges.size),An(this,`directedSize`,()=>this._directedSize),An(this,`undirectedSize`,()=>this._undirectedSize),An(this,`selfLoopCount`,()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),An(this,`directedSelfLoopCount`,()=>this._directedSelfLoopCount),An(this,`undirectedSelfLoopCount`,()=>this._undirectedSelfLoopCount),An(this,`multi`,this._options.multi),An(this,`type`,this._options.type),An(this,`allowSelfLoops`,this._options.allowSelfLoops),An(this,`implementation`,()=>`graphology`)}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(e){return this._nodes.has(``+e)}hasDirectedEdge(e,t){if(this.type===`undirected`)return!1;if(arguments.length===1){let t=``+e,n=this._edges.get(t);return!!n&&!n.undirected}else if(arguments.length===2){e=``+e,t=``+t;let n=this._nodes.get(e);return n?n.out.hasOwnProperty(t):!1}throw new z(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasUndirectedEdge(e,t){if(this.type===`directed`)return!1;if(arguments.length===1){let t=``+e,n=this._edges.get(t);return!!n&&n.undirected}else if(arguments.length===2){e=``+e,t=``+t;let n=this._nodes.get(e);return n?n.undirected.hasOwnProperty(t):!1}throw new z(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasEdge(e,t){if(arguments.length===1){let t=``+e;return this._edges.has(t)}else if(arguments.length===2){e=``+e,t=``+t;let n=this._nodes.get(e);return n?n.out!==void 0&&n.out.hasOwnProperty(t)||n.undirected!==void 0&&n.undirected.hasOwnProperty(t):!1}throw new z(`Graph.hasEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}directedEdge(e,t){if(this.type===`undirected`)return;if(e=``+e,t=``+t,this.multi)throw new V(`Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.`);let n=this._nodes.get(e);if(!n)throw new B(`Graph.directedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new B(`Graph.directedEdge: could not find the "${t}" target node in the graph.`);let r=n.out&&n.out[t]||void 0;if(r)return r.key}undirectedEdge(e,t){if(this.type===`directed`)return;if(e=``+e,t=``+t,this.multi)throw new V(`Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.`);let n=this._nodes.get(e);if(!n)throw new B(`Graph.undirectedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new B(`Graph.undirectedEdge: could not find the "${t}" target node in the graph.`);let r=n.undirected&&n.undirected[t]||void 0;if(r)return r.key}edge(e,t){if(this.multi)throw new V(`Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.`);e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new B(`Graph.edge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new B(`Graph.edge: could not find the "${t}" target node in the graph.`);let r=n.out&&n.out[t]||n.undirected&&n.undirected[t]||void 0;if(r)return r.key}areDirectedNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new B(`Graph.areDirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type===`undirected`?!1:t in n.in||t in n.out}areOutNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new B(`Graph.areOutNeighbors: could not find the "${e}" node in the graph.`);return this.type===`undirected`?!1:t in n.out}areInNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new B(`Graph.areInNeighbors: could not find the "${e}" node in the graph.`);return this.type===`undirected`?!1:t in n.in}areUndirectedNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new B(`Graph.areUndirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type===`directed`?!1:t in n.undirected}areNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new B(`Graph.areNeighbors: could not find the "${e}" node in the graph.`);return this.type!==`undirected`&&(t in n.in||t in n.out)||this.type!==`directed`&&t in n.undirected}areInboundNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new B(`Graph.areInboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!==`undirected`&&t in n.in||this.type!==`directed`&&t in n.undirected}areOutboundNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new B(`Graph.areOutboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!==`undirected`&&t in n.out||this.type!==`directed`&&t in n.undirected}inDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new B(`Graph.inDegree: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.inDegree}outDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new B(`Graph.outDegree: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.outDegree}directedDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new B(`Graph.directedDegree: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.inDegree+t.outDegree}undirectedDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new B(`Graph.undirectedDegree: could not find the "${e}" node in the graph.`);return this.type===`directed`?0:t.undirectedDegree}inboundDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new B(`Graph.inboundDegree: could not find the "${e}" node in the graph.`);let n=0;return this.type!==`directed`&&(n+=t.undirectedDegree),this.type!==`undirected`&&(n+=t.inDegree),n}outboundDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new B(`Graph.outboundDegree: could not find the "${e}" node in the graph.`);let n=0;return this.type!==`directed`&&(n+=t.undirectedDegree),this.type!==`undirected`&&(n+=t.outDegree),n}degree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new B(`Graph.degree: could not find the "${e}" node in the graph.`);let n=0;return this.type!==`directed`&&(n+=t.undirectedDegree),this.type!==`undirected`&&(n+=t.inDegree+t.outDegree),n}inDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new B(`Graph.inDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.inDegree-t.directedLoops}outDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new B(`Graph.outDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.outDegree-t.directedLoops}directedDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new B(`Graph.directedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.inDegree+t.outDegree-t.directedLoops*2}undirectedDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new B(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type===`directed`?0:t.undirectedDegree-t.undirectedLoops*2}inboundDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new B(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,r=0;return this.type!==`directed`&&(n+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!==`undirected`&&(n+=t.inDegree,r+=t.directedLoops),n-r}outboundDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new B(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,r=0;return this.type!==`directed`&&(n+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!==`undirected`&&(n+=t.outDegree,r+=t.directedLoops),n-r}degreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new B(`Graph.degreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,r=0;return this.type!==`directed`&&(n+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!==`undirected`&&(n+=t.inDegree+t.outDegree,r+=t.directedLoops*2),n-r}source(e){e=``+e;let t=this._edges.get(e);if(!t)throw new B(`Graph.source: could not find the "${e}" edge in the graph.`);return t.source.key}target(e){e=``+e;let t=this._edges.get(e);if(!t)throw new B(`Graph.target: could not find the "${e}" edge in the graph.`);return t.target.key}extremities(e){e=``+e;let t=this._edges.get(e);if(!t)throw new B(`Graph.extremities: could not find the "${e}" edge in the graph.`);return[t.source.key,t.target.key]}opposite(e,t){e=``+e,t=``+t;let n=this._edges.get(t);if(!n)throw new B(`Graph.opposite: could not find the "${t}" edge in the graph.`);let r=n.source.key,i=n.target.key;if(e===r)return i;if(e===i)return r;throw new B(`Graph.opposite: the "${e}" node is not attached to the "${t}" edge (${r}, ${i}).`)}hasExtremity(e,t){e=``+e,t=``+t;let n=this._edges.get(e);if(!n)throw new B(`Graph.hasExtremity: could not find the "${e}" edge in the graph.`);return n.source.key===t||n.target.key===t}isUndirected(e){e=``+e;let t=this._edges.get(e);if(!t)throw new B(`Graph.isUndirected: could not find the "${e}" edge in the graph.`);return t.undirected}isDirected(e){e=``+e;let t=this._edges.get(e);if(!t)throw new B(`Graph.isDirected: could not find the "${e}" edge in the graph.`);return!t.undirected}isSelfLoop(e){e=``+e;let t=this._edges.get(e);if(!t)throw new B(`Graph.isSelfLoop: could not find the "${e}" edge in the graph.`);return t.source===t.target}addNode(e,t){return ni(this,e,t).key}mergeNode(e,t){if(t&&!R(t))throw new z(`Graph.mergeNode: invalid attributes. Expecting an object but got "${t}"`);e=``+e,t||={};let n=this._nodes.get(e);return n?(t&&(L(n.attributes,t),this.emit(`nodeAttributesUpdated`,{type:`merge`,key:e,attributes:n.attributes,data:t})),[e,!1]):(n=new this.NodeDataClass(e,t),this._nodes.set(e,n),this.emit(`nodeAdded`,{key:e,attributes:t}),[e,!0])}updateNode(e,t){if(t&&typeof t!=`function`)throw new z(`Graph.updateNode: invalid updater function. Expecting a function but got "${t}"`);e=``+e;let n=this._nodes.get(e);if(n){if(t){let r=n.attributes;n.attributes=t(r),this.emit(`nodeAttributesUpdated`,{type:`replace`,key:e,attributes:n.attributes})}return[e,!1]}let r=t?t({}):{};return n=new this.NodeDataClass(e,r),this._nodes.set(e,n),this.emit(`nodeAdded`,{key:e,attributes:r}),[e,!0]}dropNode(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new B(`Graph.dropNode: could not find the "${e}" node in the graph.`);let n;if(this.type!==`undirected`){for(let e in t.out){n=t.out[e];do oi(this,n),n=n.next;while(n)}for(let e in t.in){n=t.in[e];do oi(this,n),n=n.next;while(n)}}if(this.type!==`directed`)for(let e in t.undirected){n=t.undirected[e];do oi(this,n),n=n.next;while(n)}this._nodes.delete(e),this.emit(`nodeDropped`,{key:e,attributes:t.attributes})}dropEdge(e){let t;if(arguments.length>1){let e=``+arguments[0],n=``+arguments[1];if(t=Dn(this,e,n,this.type),!t)throw new B(`Graph.dropEdge: could not find the "${e}" -> "${n}" edge in the graph.`)}else if(e=``+e,t=this._edges.get(e),!t)throw new B(`Graph.dropEdge: could not find the "${e}" edge in the graph.`);return oi(this,t),this}dropDirectedEdge(e,t){if(arguments.length<2)throw new V(`Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.`);if(this.multi)throw new V(`Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.`);e=``+e,t=``+t;let n=Dn(this,e,t,`directed`);if(!n)throw new B(`Graph.dropDirectedEdge: could not find a "${e}" -> "${t}" edge in the graph.`);return oi(this,n),this}dropUndirectedEdge(e,t){if(arguments.length<2)throw new V(`Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.`);if(this.multi)throw new V(`Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.`);let n=Dn(this,e,t,`undirected`);if(!n)throw new B(`Graph.dropUndirectedEdge: could not find a "${e}" -> "${t}" edge in the graph.`);return oi(this,n),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit(`cleared`)}clearEdges(){let e=this._nodes.values(),t;for(;t=e.next(),t.done!==!0;)t.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit(`edgesCleared`)}getAttribute(e){return this._attributes[e]}getAttributes(){return this._attributes}hasAttribute(e){return this._attributes.hasOwnProperty(e)}setAttribute(e,t){return this._attributes[e]=t,this.emit(`attributesUpdated`,{type:`set`,attributes:this._attributes,name:e}),this}updateAttribute(e,t){if(typeof t!=`function`)throw new z(`Graph.updateAttribute: updater should be a function.`);let n=this._attributes[e];return this._attributes[e]=t(n),this.emit(`attributesUpdated`,{type:`set`,attributes:this._attributes,name:e}),this}removeAttribute(e){return delete this._attributes[e],this.emit(`attributesUpdated`,{type:`remove`,attributes:this._attributes,name:e}),this}replaceAttributes(e){if(!R(e))throw new z(`Graph.replaceAttributes: provided attributes are not a plain object.`);return this._attributes=e,this.emit(`attributesUpdated`,{type:`replace`,attributes:this._attributes}),this}mergeAttributes(e){if(!R(e))throw new z(`Graph.mergeAttributes: provided attributes are not a plain object.`);return L(this._attributes,e),this.emit(`attributesUpdated`,{type:`merge`,attributes:this._attributes,data:e}),this}updateAttributes(e){if(typeof e!=`function`)throw new z(`Graph.updateAttributes: provided updater is not a function.`);return this._attributes=e(this._attributes),this.emit(`attributesUpdated`,{type:`update`,attributes:this._attributes}),this}updateEachNodeAttributes(e,t){if(typeof e!=`function`)throw new z(`Graph.updateEachNodeAttributes: expecting an updater function.`);if(t&&!jn(t))throw new z(`Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}`);let n=this._nodes.values(),r,i;for(;r=n.next(),r.done!==!0;)i=r.value,i.attributes=e(i.key,i.attributes);this.emit(`eachNodeAttributesUpdated`,{hints:t||null})}updateEachEdgeAttributes(e,t){if(typeof e!=`function`)throw new z(`Graph.updateEachEdgeAttributes: expecting an updater function.`);if(t&&!jn(t))throw new z(`Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}`);let n=this._edges.values(),r,i,a,o;for(;r=n.next(),r.done!==!0;)i=r.value,a=i.source,o=i.target,i.attributes=e(i.key,i.attributes,a.key,o.key,a.attributes,o.attributes,i.undirected);this.emit(`eachEdgeAttributesUpdated`,{hints:t||null})}forEachAdjacencyEntry(e){if(typeof e!=`function`)throw new z(`Graph.forEachAdjacencyEntry: expecting a callback.`);Kr(!1,!1,!1,this,e)}forEachAdjacencyEntryWithOrphans(e){if(typeof e!=`function`)throw new z(`Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.`);Kr(!1,!1,!0,this,e)}forEachAssymetricAdjacencyEntry(e){if(typeof e!=`function`)throw new z(`Graph.forEachAssymetricAdjacencyEntry: expecting a callback.`);Kr(!1,!0,!1,this,e)}forEachAssymetricAdjacencyEntryWithOrphans(e){if(typeof e!=`function`)throw new z(`Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.`);Kr(!1,!0,!0,this,e)}nodes(){return Array.from(this._nodes.keys())}forEachNode(e){if(typeof e!=`function`)throw new z(`Graph.forEachNode: expecting a callback.`);let t=this._nodes.values(),n,r;for(;n=t.next(),n.done!==!0;)r=n.value,e(r.key,r.attributes)}findNode(e){if(typeof e!=`function`)throw new z(`Graph.findNode: expecting a callback.`);let t=this._nodes.values(),n,r;for(;n=t.next(),n.done!==!0;)if(r=n.value,e(r.key,r.attributes))return r.key}mapNodes(e){if(typeof e!=`function`)throw new z(`Graph.mapNode: expecting a callback.`);let t=this._nodes.values(),n,r,i=Array(this.order),a=0;for(;n=t.next(),n.done!==!0;)r=n.value,i[a++]=e(r.key,r.attributes);return i}someNode(e){if(typeof e!=`function`)throw new z(`Graph.someNode: expecting a callback.`);let t=this._nodes.values(),n,r;for(;n=t.next(),n.done!==!0;)if(r=n.value,e(r.key,r.attributes))return!0;return!1}everyNode(e){if(typeof e!=`function`)throw new z(`Graph.everyNode: expecting a callback.`);let t=this._nodes.values(),n,r;for(;n=t.next(),n.done!==!0;)if(r=n.value,!e(r.key,r.attributes))return!1;return!0}filterNodes(e){if(typeof e!=`function`)throw new z(`Graph.filterNodes: expecting a callback.`);let t=this._nodes.values(),n,r,i=[];for(;n=t.next(),n.done!==!0;)r=n.value,e(r.key,r.attributes)&&i.push(r.key);return i}reduceNodes(e,t){if(typeof e!=`function`)throw new z(`Graph.reduceNodes: expecting a callback.`);if(arguments.length<2)throw new z(`Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let n=t,r=this._nodes.values(),i,a;for(;i=r.next(),i.done!==!0;)a=i.value,n=e(n,a.key,a.attributes);return n}nodeEntries(){let e=this._nodes.values();return{[Symbol.iterator](){return this},next(){let t=e.next();if(t.done)return t;let n=t.value;return{value:{node:n.key,attributes:n.attributes},done:!1}}}}export(){let e=Array(this._nodes.size),t=0;this._nodes.forEach((n,r)=>{e[t++]=qr(r,n)});let n=Array(this._edges.size);return t=0,this._edges.forEach((e,r)=>{n[t++]=Jr(this.type,r,e)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:e,edges:n}}import(t,n=!1){if(t instanceof e)return t.forEachNode((e,t)=>{n?this.mergeNode(e,t):this.addNode(e,t)}),t.forEachEdge((e,t,r,i,a,o,s)=>{n?s?this.mergeUndirectedEdgeWithKey(e,r,i,t):this.mergeDirectedEdgeWithKey(e,r,i,t):s?this.addUndirectedEdgeWithKey(e,r,i,t):this.addDirectedEdgeWithKey(e,r,i,t)}),this;if(!R(t))throw new z(`Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.`);if(t.attributes){if(!R(t.attributes))throw new z(`Graph.import: invalid attributes. Expecting a plain object.`);n?this.mergeAttributes(t.attributes):this.replaceAttributes(t.attributes)}let r,i,a,o,s;if(t.nodes){if(a=t.nodes,!Array.isArray(a))throw new z(`Graph.import: invalid nodes. Expecting an array.`);for(r=0,i=a.length;r<i;r++){o=a[r],Yr(o);let{key:e,attributes:t}=o;n?this.mergeNode(e,t):this.addNode(e,t)}}if(t.edges){let e=!1;if(this.type===`undirected`&&(e=!0),a=t.edges,!Array.isArray(a))throw new z(`Graph.import: invalid edges. Expecting an array.`);for(r=0,i=a.length;r<i;r++){s=a[r],Xr(s);let{source:t,target:i,attributes:o,undirected:c=e}=s,l;`key`in s?(l=n?c?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:c?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey,l.call(this,s.key,t,i,o)):(l=n?c?this.mergeUndirectedEdge:this.mergeDirectedEdge:c?this.addUndirectedEdge:this.addDirectedEdge,l.call(this,t,i,o))}}return this}nullCopy(t){let n=new e(L({},this._options,t));return n.replaceAttributes(L({},this.getAttributes())),n}emptyCopy(e){let t=this.nullCopy(e);return this._nodes.forEach((e,n)=>{let r=L({},e.attributes);e=new t.NodeDataClass(n,r),t._nodes.set(n,e)}),t}copy(e){if(e||={},typeof e.type==`string`&&e.type!==this.type&&e.type!==`mixed`)throw new V(`Graph.copy: cannot create an incompatible copy from "${this.type}" type to "${e.type}" because this would mean losing information about the current graph.`);if(typeof e.multi==`boolean`&&e.multi!==this.multi&&e.multi!==!0)throw new V(`Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.`);if(typeof e.allowSelfLoops==`boolean`&&e.allowSelfLoops!==this.allowSelfLoops&&e.allowSelfLoops!==!0)throw new V(`Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.`);let t=this.emptyCopy(e),n=this._edges.values(),r,i;for(;r=n.next(),r.done!==!0;)i=r.value,ii(t,`copy`,!1,i.undirected,i.key,i.source.key,i.target.key,L({},i.attributes));return t}toJSON(){return this.export()}toString(){return`[object Graph]`}inspect(){let e={};this._nodes.forEach((t,n)=>{e[n]=t.attributes});let t={},n={};this._edges.forEach((e,r)=>{let i=e.undirected?`--`:`->`,a=``,o=e.source.key,s=e.target.key,c;e.undirected&&o>s&&(c=o,o=s,s=c);let l=`(${o})${i}(${s})`;r.startsWith(`geid_`)?this.multi&&(n[l]===void 0?n[l]=0:n[l]++,a+=`${n[l]}. `):a+=`[${r}]: `,a+=l,t[a]=e.attributes});let r={};for(let e in this)this.hasOwnProperty(e)&&!$r.has(e)&&typeof this[e]!=`function`&&typeof e!=`symbol`&&(r[e]=this[e]);return r.attributes=this._attributes,r.nodes=e,r.edges=t,kn(r,`constructor`,this.constructor),r}};typeof Symbol<`u`&&(H.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=H.prototype.inspect),ei.forEach(e=>{[`add`,`merge`,`update`].forEach(t=>{let n=e.name(t),r=t===`add`?ii:ai;e.generateKey?H.prototype[n]=function(i,a,o){return r(this,n,!0,(e.type||this.type)===`undirected`,null,i,a,o,t===`update`)}:H.prototype[n]=function(i,a,o,s){return r(this,n,!1,(e.type||this.type)===`undirected`,i,a,o,s,t===`update`)}})}),tr(H),fr(H),Nr(H),Gr(H);var si=class extends H{constructor(e){let t=L({type:`directed`},e);if(`multi`in t&&t.multi!==!1)throw new z(`DirectedGraph.from: inconsistent indication that the graph should be multi in given options!`);if(t.type!==`directed`)throw new z(`DirectedGraph.from: inconsistent "`+t.type+`" type in given options!`);super(t)}},ci=class extends H{constructor(e){let t=L({type:`undirected`},e);if(`multi`in t&&t.multi!==!1)throw new z(`UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!`);if(t.type!==`undirected`)throw new z(`UndirectedGraph.from: inconsistent "`+t.type+`" type in given options!`);super(t)}},li=class extends H{constructor(e){let t=L({multi:!0},e);if(`multi`in t&&t.multi!==!0)throw new z(`MultiGraph.from: inconsistent indication that the graph should be simple in given options!`);super(t)}},ui=class extends H{constructor(e){let t=L({type:`directed`,multi:!0},e);if(`multi`in t&&t.multi!==!0)throw new z(`MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!`);if(t.type!==`directed`)throw new z(`MultiDirectedGraph.from: inconsistent "`+t.type+`" type in given options!`);super(t)}},di=class extends H{constructor(e){let t=L({type:`undirected`,multi:!0},e);if(`multi`in t&&t.multi!==!0)throw new z(`MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!`);if(t.type!==`undirected`)throw new z(`MultiUndirectedGraph.from: inconsistent "`+t.type+`" type in given options!`);super(t)}};function fi(e){e.from=function(t,n){let r=new e(L({},t.options,n));return r.import(t),r}}fi(H),fi(si),fi(ci),fi(li),fi(ui),fi(di),H.Graph=H,H.DirectedGraph=si,H.UndirectedGraph=ci,H.MultiGraph=li,H.MultiDirectedGraph=ui,H.MultiUndirectedGraph=di,H.InvalidArgumentsGraphError=z,H.NotFoundGraphError=B,H.UsageGraphError=V;var pi=n(((e,t)=>{t.exports=function(e){return typeof e==`object`&&!!e&&typeof e.addUndirectedEdgeWithKey==`function`&&typeof e.dropNode==`function`&&typeof e.multi==`boolean`}})),mi=n(((e,t)=>{var n=pi(),r=void 0,i=0,a=1;t.exports=function(e){if(!n(e))throw Error(`graphology-dag/has-cycle: the given graph is not a valid graphology instance.`);if(e.size===0)return!1;if(e.selfLoopCount!==0)return!0;let t={},o=[];function s(e){let n=t[e];if(n===r)o.push(e);else if(n===i)return!0;return!1}return e.someNode(n=>{if(t[n]===a)return!1;for(o.push(n);o.length!==0;){let n=o[o.length-1],r=t[n];if(r!==i){if(t[n]=i,e.someOutboundNeighbor(n,s))return!0}else r===i&&(o.pop(),t[n]=a)}return!1})}})),hi=n(((e,t)=>{var n=pi();t.exports=function(e,t,r){if(!n(e))throw Error(`graphology-dag/will-create-cycle: the given graph is not a valid graphology instance.`);if(t=``+t,r=``+r,t===r)return!0;if(!e.hasNode(t)||!e.hasNode(r)||e.hasDirectedEdge(t,r))return!1;if(e.hasDirectedEdge(r,t))return!0;let i=e.outNeighbors(r);function a(e){i.push(e)}for(;i.length!==0;){let n=i.pop();if(n===t)return!0;e.forEachOutNeighbor(n,a)}return!1}})),gi=n((e=>{e.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer<`u`,e.SYMBOL_SUPPORT=typeof Symbol<`u`})),_i=n(((e,t)=>{var n=gi(),r=n.ARRAY_BUFFER_SUPPORT,i=n.SYMBOL_SUPPORT;t.exports=function(e,t){var n,a,o,s,c;if(!e)throw Error(`obliterator/forEach: invalid iterable.`);if(typeof t!=`function`)throw Error(`obliterator/forEach: expecting a callback.`);if(Array.isArray(e)||r&&ArrayBuffer.isView(e)||typeof e==`string`||e.toString()===`[object Arguments]`){for(o=0,s=e.length;o<s;o++)t(e[o],o);return}if(typeof e.forEach==`function`){e.forEach(t);return}if(i&&Symbol.iterator in e&&typeof e.next!=`function`&&(e=e[Symbol.iterator]()),typeof e.next==`function`){for(n=e,o=0;c=n.next(),c.done!==!0;)t(c.value,o),o++;return}for(a in e)e.hasOwnProperty(a)&&t(e[a],a)}})),vi=n((e=>{var t=2**8-1,n=2**16-1,r=2**32-1,i=2**7-1,a=2**15-1,o=2**31-1;e.getPointerArray=function(e){var i=e-1;if(i<=t)return Uint8Array;if(i<=n)return Uint16Array;if(i<=r)return Uint32Array;throw Error(`mnemonist: Pointer Array of size > 4294967295 is not supported.`)},e.getSignedPointerArray=function(e){var t=e-1;return t<=i?Int8Array:t<=a?Int16Array:t<=o?Int32Array:Float64Array},e.getNumberType=function(e){return e===(e|0)?Math.sign(e)===-1?e<=127&&e>=-128?Int8Array:e<=32767&&e>=-32768?Int16Array:Int32Array:e<=255?Uint8Array:e<=65535?Uint16Array:Uint32Array:Float64Array};var s={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};e.getMinimalRepresentation=function(t,n){var r=null,i=0,a,o,c,l,u;for(l=0,u=t.length;l<u;l++)c=n?n(t[l]):t[l],o=e.getNumberType(c),a=s[o.name],a>i&&(i=a,r=o);return r},e.isTypedArray=function(e){return typeof ArrayBuffer<`u`&&ArrayBuffer.isView(e)},e.concat=function(){var e=0,t,n,r;for(t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var i=new arguments[0].constructor(e);for(t=0,n=0;t<r;t++)i.set(arguments[t],n),n+=arguments[t].length;return i},e.indices=function(t){for(var n=new(e.getPointerArray(t))(t),r=0;r<t;r++)n[r]=r;return n}})),yi=n((e=>{var t=_i(),n=vi();function r(e){return Array.isArray(e)||n.isTypedArray(e)}function i(e){if(typeof e.length==`number`)return e.length;if(typeof e.size==`number`)return e.size}function a(e){var n=i(e),r=typeof n==`number`?Array(n):[],a=0;return t(e,function(e){r[a++]=e}),r}function o(e){var r=i(e),a=typeof r==`number`?n.getPointerArray(r):Array,o=typeof r==`number`?Array(r):[],s=typeof r==`number`?new a(r):[],c=0;return t(e,function(e){o[c]=e,s[c]=c++}),[o,s]}e.isArrayLike=r,e.guessLength=i,e.toArray=a,e.toArrayWithIndices=o})),bi=n(((e,t)=>{function n(e){if(typeof e!=`function`)throw Error(`obliterator/iterator: expecting a function!`);this.next=e}typeof Symbol<`u`&&(n.prototype[Symbol.iterator]=function(){return this}),n.of=function(){var e=arguments,t=e.length,r=0;return new n(function(){return r>=t?{done:!0}:{done:!1,value:e[r++]}})},n.empty=function(){return new n(function(){return{done:!0}})},n.fromSequence=function(e){var t=0,r=e.length;return new n(function(){return t>=r?{done:!0}:{done:!1,value:e[t++]}})},n.is=function(e){return e instanceof n?!0:typeof e==`object`&&!!e&&typeof e.next==`function`},t.exports=n})),xi=n(((e,t)=>{var n=yi(),r=bi();function i(e,t){if(arguments.length<2)throw Error(`mnemonist/fixed-deque: expecting an Array class and a capacity.`);if(typeof t!=`number`||t<=0)throw Error("mnemonist/fixed-deque: `capacity` should be a positive number.");this.ArrayClass=e,this.capacity=t,this.items=new e(this.capacity),this.clear()}i.prototype.clear=function(){this.start=0,this.size=0},i.prototype.push=function(e){if(this.size===this.capacity)throw Error(`mnemonist/fixed-deque.push: deque capacity (`+this.capacity+`) exceeded!`);var t=this.start+this.size;return t>=this.capacity&&(t-=this.capacity),this.items[t]=e,++this.size},i.prototype.unshift=function(e){if(this.size===this.capacity)throw Error(`mnemonist/fixed-deque.unshift: deque capacity (`+this.capacity+`) exceeded!`);var t=this.start-1;return this.start===0&&(t=this.capacity-1),this.items[t]=e,this.start=t,++this.size},i.prototype.pop=function(){if(this.size!==0){this.size--;var e=this.start+this.size;return e>=this.capacity&&(e-=this.capacity),this.items[e]}},i.prototype.shift=function(){if(this.size!==0){var e=this.start;return this.size--,this.start++,this.start===this.capacity&&(this.start=0),this.items[e]}},i.prototype.peekFirst=function(){if(this.size!==0)return this.items[this.start]},i.prototype.peekLast=function(){if(this.size!==0){var e=this.start+this.size-1;return e>=this.capacity&&(e-=this.capacity),this.items[e]}},i.prototype.get=function(e){if(!(this.size===0||e>=this.capacity))return e=this.start+e,e>=this.capacity&&(e-=this.capacity),this.items[e]},i.prototype.forEach=function(e,t){t=arguments.length>1?t:this;for(var n=this.capacity,r=this.size,i=this.start,a=0;a<r;)e.call(t,this.items[i],a,this),i++,a++,i===n&&(i=0)},i.prototype.toArray=function(){var e=this.start+this.size;if(e<this.capacity)return this.items.slice(this.start,e);for(var t=new this.ArrayClass(this.size),n=this.capacity,r=this.size,i=this.start,a=0;a<r;)t[a]=this.items[i],i++,a++,i===n&&(i=0);return t},i.prototype.values=function(){var e=this.items,t=this.capacity,n=this.size,i=this.start,a=0;return new r(function(){if(a>=n)return{done:!0};var r=e[i];return i++,a++,i===t&&(i=0),{value:r,done:!1}})},i.prototype.entries=function(){var e=this.items,t=this.capacity,n=this.size,i=this.start,a=0;return new r(function(){if(a>=n)return{done:!0};var r=e[i];return i++,i===t&&(i=0),{value:[a++,r],done:!1}})},typeof Symbol<`u`&&(i.prototype[Symbol.iterator]=i.prototype.values),i.prototype.inspect=function(){var e=this.toArray();return e.type=this.ArrayClass.name,e.capacity=this.capacity,Object.defineProperty(e,`constructor`,{value:i,enumerable:!1}),e},typeof Symbol<`u`&&(i.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=i.prototype.inspect),i.from=function(e,t,r){if(arguments.length<3&&(r=n.guessLength(e),typeof r!=`number`))throw Error(`mnemonist/fixed-deque.from: could not guess iterable length. Please provide desired capacity as last argument.`);var a=new i(t,r);if(n.isArrayLike(e)){var o,s;for(o=0,s=e.length;o<s;o++)a.items[o]=e[o];return a.size=s,a}return n.forEach(e,function(e){a.push(e)}),a},t.exports=i})),Si=n((e=>{var t=pi(),n=xi();function r(e,t){let n=0;return e.forEachInNeighbor(t,()=>{n++}),n}function i(e,i){if(!t(e))throw Error(`graphology-dag/topological-sort: the given graph is not a valid graphology instance.`);if(e.type===`undirected`||e.undirectedSize!==0)throw Error(`graphology-dag/topological-sort: cannot work if graph is not directed.`);if(e.order===0)return;let a=new n(Array,e.order),o={},s=0;e.forEachNode((t,n)=>{let i=e.multi?r(e,t):e.inDegree(t);i===0?a.push([t,n,0]):(o[t]=i,s+=i)});let c=0;function l(e,t){let n=--o[e];s--,n===0&&a.push([e,t,c+1]),o[e]=n}for(;a.size!==0;){let[t,n,r]=a.shift();c=r,i(t,n,r),e.forEachOutNeighbor(t,l)}if(s!==0)throw Error(`graphology-dag/topological-sort: given graph is not acyclic.`)}function a(e){if(!t(e))throw Error(`graphology-dag/topological-sort: the given graph is not a valid graphology instance.`);let n=Array(e.order),r=0;return i(e,e=>{n[r++]=e}),n}function o(e,n){if(!t(e))throw Error(`graphology-dag/topological-generations: the given graph is not a valid graphology instance.`);if(e.order===0)return;let r=0,a=[];i(e,(e,t,i)=>{i>r&&(n(a),r=i,a=[]),a.push(e)}),n(a)}function s(e){if(!t(e))throw Error(`graphology-dag/topological-generations: the given graph is not a valid graphology instance.`);let n=[];return o(e,e=>{n.push(e)}),n}e.topologicalSort=a,e.forEachNodeInTopologicalOrder=i,e.topologicalGenerations=s,e.forEachTopologicalGeneration=o}));n((e=>{e.hasCycle=mi(),e.willCreateCycle=hi();var t=Si();e.forEachNodeInTopologicalOrder=t.forEachNodeInTopologicalOrder,e.topologicalSort=t.topologicalSort,e.topologicalGenerations=t.topologicalGenerations,e.forEachTopologicalGeneration=t.forEachTopologicalGeneration}))();function Ci(e,t){let n=e[t];if(typeof n==`number`&&Number.isFinite(n))return n;if(typeof n==`string`&&n.trim()!==``){let e=Number(n);if(Number.isFinite(e))return e}}function wi(e,t){let n=e[t];if(typeof n==`string`&&n.trim()!==``)return n}function Ti(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ei(e){if(!Ti(e))return{};let t=Ci(e,`bytes_processed`),n=Ci(e,`bytes_billed`),r=Ci(e,`slot_ms`),i=Ci(e,`rows_affected`),a=wi(e,`code`),o=wi(e,`_message`),s=wi(e,`query_id`)??wi(e,`job_id`),c=wi(e,`project_id`),l=wi(e,`location`);return{...t===void 0?{}:{bytesProcessed:t},...n===void 0?{}:{bytesBilled:n},...r===void 0?{}:{slotMs:r},...i===void 0?{}:{rowsAffected:i},...a===void 0?{}:{adapterCode:a},...o===void 0?{}:{adapterMessage:o},...s===void 0?{}:{queryId:s},...c===void 0?{}:{projectId:c},...l===void 0?{}:{location:l}}}function Di(e,t){if(!Ti(e))return{rawKeys:[]};let n=Object.keys(e).filter(e=>typeof e==`string`);return{...Ei(e),...t,rawKeys:n}}var Oi={name:`generic`,parse(e){return Di(e,{})}},ki={name:`athena`,parse(e){if(!Ti(e))return{rawKeys:[]};let t=Ci(e,`data_scanned_in_bytes`);return Di(e,{...t===void 0?{}:{bytesProcessed:t}})},canParse(e){return Ti(e)?`data_scanned_in_bytes`in e:!1}},Ai={name:`bigquery`,parse(e){if(!Ti(e))return{rawKeys:[]};let t=Ci(e,`bytes_processed`),n=Ci(e,`bytes_billed`),r=Ci(e,`slot_ms`),i=wi(e,`project_id`),a=wi(e,`location`),o=wi(e,`query_id`)??wi(e,`job_id`);return Di(e,{...t===void 0?{}:{bytesProcessed:t},...n===void 0?{}:{bytesBilled:n},...r===void 0?{}:{slotMs:r},...o===void 0?{}:{queryId:o},...i===void 0?{}:{projectId:i},...a===void 0?{}:{location:a}})},canParse(e){return Ti(e)?`bytes_processed`in e||`bytes_billed`in e||`slot_ms`in e||`job_id`in e||`location`in e:!1}},ji={name:`postgres`,parse(e){return Di(e,{})}},Mi={name:`redshift`,parse(e){return Di(e,{})}},Ni={name:`snowflake`,parse(e){if(!Ti(e))return{rawKeys:[]};let t=Ci(e,`rows_inserted`),n=Ci(e,`rows_deleted`),r=Ci(e,`rows_updated`),i=Ci(e,`rows_duplicates`);return Di(e,{...t===void 0?{}:{rowsInserted:t},...n===void 0?{}:{rowsDeleted:n},...r===void 0?{}:{rowsUpdated:r},...i===void 0?{}:{rowsDuplicated:i}})},canParse(e){return Ti(e)?`rows_inserted`in e||`rows_deleted`in e||`rows_updated`in e||`rows_duplicates`in e:!1}},Pi=new Map([[`athena`,ki],[`bigquery`,Ai],[`postgres`,ji],[`redshift`,Mi],[`snowflake`,Ni],[`spark`,{name:`spark`,parse(e){return Di(e,{})}}]]),Fi=[Ai,Ni,ki];new class{selectParser(e,t){if(e&&typeof e==`string`){let n=e.toLowerCase().trim(),r=Pi.get(n);if(r&&(!r.canParse||r.canParse(t)))return r}for(let e of Fi)if(e.canParse&&e.canParse(t))return e;return Oi}};var Ii={query_id:e=>e.adapterMetrics?.queryId??``,adapter_code:e=>e.adapterMetrics?.adapterCode??``,adapter_message:e=>e.adapterMetrics?.adapterMessage??``,bytes_processed:e=>e.adapterMetrics?.bytesProcessed,bytes_billed:e=>e.adapterMetrics?.bytesBilled,slot_ms:e=>e.adapterMetrics?.slotMs,rows_affected:e=>e.adapterMetrics?.rowsAffected,project_id:e=>e.adapterMetrics?.projectId,location:e=>e.adapterMetrics?.location,rows_inserted:e=>e.adapterMetrics?.rowsInserted,rows_updated:e=>e.adapterMetrics?.rowsUpdated,rows_deleted:e=>e.adapterMetrics?.rowsDeleted,rows_duplicated:e=>e.adapterMetrics?.rowsDuplicated};function Li(e,t){return Ii[t](e)}function Ri(e,t){let n=Li(e,t);return typeof n==`number`&&Number.isFinite(n)?n:0}Object.fromEntries([`bytes_processed`,`bytes_billed`,`slot_ms`,`rows_affected`,`rows_inserted`,`rows_updated`,`rows_deleted`,`rows_duplicated`].map(e=>[`${e}_desc`,t=>Ri(t,e)]));var zi=[{key:`queryId`,label:`Query ID`,shortLabel:`Query ID`,kind:`string`,humanSortKey:`query_id`},{key:`adapterCode`,label:`Adapter code`,shortLabel:`Code`,kind:`string`,humanSortKey:`adapter_code`},{key:`adapterMessage`,label:`Adapter message`,shortLabel:`Message`,kind:`string`,humanSortKey:`adapter_message`},{key:`bytesProcessed`,label:`Bytes processed`,shortLabel:`Bytes processed`,kind:`number`,humanSortKey:`bytes_processed`,summaryTotalKey:`totalBytesProcessed`},{key:`bytesBilled`,label:`Bytes billed`,shortLabel:`Bytes billed`,kind:`number`,humanSortKey:`bytes_billed`,summaryTotalKey:`totalBytesBilled`},{key:`slotMs`,label:`Slot ms`,shortLabel:`Slot ms`,kind:`number`,humanSortKey:`slot_ms`,summaryTotalKey:`totalSlotMs`},{key:`rowsAffected`,label:`Rows affected`,shortLabel:`Rows`,kind:`number`,humanSortKey:`rows_affected`,summaryTotalKey:`totalRowsAffected`},{key:`projectId`,label:`Project ID`,shortLabel:`Project`,kind:`string`,humanSortKey:`project_id`},{key:`location`,label:`Location`,shortLabel:`Location`,kind:`string`,humanSortKey:`location`},{key:`rowsInserted`,label:`Rows inserted`,shortLabel:`Inserted`,kind:`number`,humanSortKey:`rows_inserted`,summaryTotalKey:`totalRowsInserted`},{key:`rowsUpdated`,label:`Rows updated`,shortLabel:`Updated`,kind:`number`,humanSortKey:`rows_updated`,summaryTotalKey:`totalRowsUpdated`},{key:`rowsDeleted`,label:`Rows deleted`,shortLabel:`Deleted`,kind:`number`,humanSortKey:`rows_deleted`,summaryTotalKey:`totalRowsDeleted`},{key:`rowsDuplicated`,label:`Rows duplicated`,shortLabel:`Duplicated`,kind:`number`,humanSortKey:`rows_duplicated`,summaryTotalKey:`totalRowsDuplicated`}];function Bi(e,t){if(e!=null)return e[t]}function Vi(e,t){return t===void 0?`—`:e.kind===`number`&&typeof t==`number`?t.toLocaleString(`en-US`):String(t)}function Hi(e){return zi.filter(t=>e.some(e=>Bi(e,t.key)!==void 0))}function Ui(e){return e==null?[]:zi.filter(t=>t.summaryTotalKey==null?!1:e[t.summaryTotalKey]!==void 0)}var Wi={bytes_processed:`bytesProcessed`,bytes_billed:`bytesBilled`,slot_ms:`slotMs`,rows_affected:`rowsAffected`,code:`adapterCode`,_message:`adapterMessage`,query_id:`queryId`,job_id:`queryId`,project_id:`projectId`,location:`location`,data_scanned_in_bytes:`bytesProcessed`,rows_inserted:`rowsInserted`,rows_deleted:`rowsDeleted`,rows_updated:`rowsUpdated`,rows_duplicated:`rowsDuplicated`,rows_duplicates:`rowsDuplicated`};function Gi(e,t){if(t==null)return!1;let n=e.key;if(n.includes(`.`))return!1;let r=Wi[n];return r===void 0?!1:Bi(t,r)!==void 0}function Ki(e,t){return t==null||t.length===0?[]:t.filter(t=>!Gi(t,e))}function qi(e){return e.trim().toLowerCase()||`unknown`}function Ji(e){return I.has(e)?`tests`:e}function Yi({analysis:e,projectName:t}){let n=(0,c.useMemo)(()=>{let n=e.resources.filter(e=>gt(e,t)),r=new Map;for(let e of n){let t=Ji(e.resourceType);r.set(t,(r.get(t)??0)+1)}let i=[];for(let{key:e,label:t}of Je){let n=r.get(e)??0;n>0&&i.push({label:t,value:n.toLocaleString()})}let a=e.resources.filter(e=>!!e.description?.trim()).length,o=e.resources.length,s=o>0?Math.round(a/o*100):0;i.push({label:`Coverage`,value:`${s}%`}),i.push({label:`Graph nodes`,value:e.graphSummary.totalNodes.toLocaleString()}),i.push({label:`Edges`,value:e.graphSummary.totalEdges.toLocaleString()});let c=e.adapterTotals;if(c!=null&&c.nodesWithAdapterData>0){i.push({label:`Warehouse nodes`,value:c.nodesWithAdapterData.toLocaleString()});for(let e of Ui(c)){let t=e.summaryTotalKey,n=t==null?void 0:c[t];typeof n==`number`&&i.push({label:zi.find(t=>t.key===e.key)?.shortLabel??e.shortLabel,value:n.toLocaleString()})}}return i},[e,t]);return n.length===0?null:(0,u.jsx)(`div`,{className:`health-metric-row`,role:`region`,"aria-label":`Workspace metrics`,children:n.map((e,t)=>(0,u.jsxs)(`div`,{className:`health-metric-row__item`,children:[(0,u.jsx)(`span`,{className:`health-metric-row__label`,children:e.label}),(0,u.jsx)(`strong`,{className:`health-metric-row__value`,children:e.value})]},`${e.label}-${t}`))})}var Xi=[{value:`all`,label:`All`},{value:`positive`,label:`Healthy`},{value:`warning`,label:`Warnings`},{value:`danger`,label:`Errors`}];function Zi({filters:e,setFilters:t}){return(0,u.jsx)(`div`,{className:`health-exec-status-pills pill-row`,role:`group`,"aria-label":`Filter executions by status`,children:Xi.map(n=>(0,u.jsx)(`button`,{type:`button`,className:e.status===n.value?Ke:qe,onClick:()=>t(e=>({...e,status:n.value})),children:n.label},n.value))})}var Qi=new Set([`analysis`,`exposure`,`macro`,`metric`,`saved_query`,`semantic_model`,`source`]);function $i(e){if(e.materialization!==`unknown`)return!0;let t=qi(e.resourceType);return!Qi.has(t)}var ea=[`table`,`view`,`incremental`,`ephemeral`,`materialized_view`,`seed`,`snapshot`,`operation`,`test`,`unknown`],ta={table:`Table`,view:`View`,incremental:`Incr.`,ephemeral:`Eph.`,materialized_view:`Mat. view`,seed:`Seed`,snapshot:`Snap.`,operation:`Op.`,test:`Test`,unknown:`Unknown`},na={table:`Configured as a table: dbt typically creates or replaces a persisted warehouse relation on full runs; adapter-dependent.`,view:`Configured as a view: dbt typically maintains a view object; runtime reflects metadata refresh and adapter behavior.`,incremental:`Configured as incremental: persisted relation updated incrementally when the model runs incrementally; strategy and full refresh are adapter- and invocation-dependent.`,ephemeral:`Ephemeral model: compiled into downstream SQL and does not create its own warehouse relation.`,materialized_view:`Materialized view: adapter-specific persisted object; behavior and refresh semantics vary by warehouse.`,seed:`Seed: loads static data into a table (typically replace or merge per dbt configuration).`,snapshot:`Snapshot: dbt tracks slowly changing dimensions into a persisted snapshot table.`,operation:`Operation / hook-style step: not a standard persisted model relation.`,test:`Test: validates other resources; does not materialize a primary warehouse table like a model.`,unknown:`Materialization not recognized from manifest metadata; treat persistence and warehouse effects as adapter-dependent.`};function ra(e){return ta[e]??e}function ia(e){let t=[na[e.materialization]];if(e.rawMaterialization&&t.push(`Manifest materialized: ${e.rawMaterialization}`),e.relationName&&t.push(`Relation name (manifest): ${e.relationName}`),e.incrementalStrategy&&t.push(`Incremental strategy: ${e.incrementalStrategy}`),e.uniqueKey!=null){let n=Array.isArray(e.uniqueKey)?e.uniqueKey.join(`, `):e.uniqueKey;t.push(`Unique key: ${n}`)}return e.onSchemaChange&&t.push(`On schema change: ${e.onSchemaChange}`),e.fullRefreshCapable!=null&&t.push(`Full refresh configured: ${e.fullRefreshCapable}`),t.push(`Source: ${e.materializationSource} metadata.`),t.join(`
|
|
2
|
-
`)}function aa(e){let t=new Set;for(let n of e)n?.materialization&&t.add(n.materialization);return ea.filter(e=>t.has(e))}function oa({executions:e}){let{rows:t,total:n}=(0,c.useMemo)(()=>{let t=e.filter(e=>e.resourceType===`model`),n=new Map;for(let e of t){let t=e.semantics?.materialization??`unknown`;n.set(t,(n.get(t)??0)+1)}return{rows:ea.filter(e=>(n.get(e)??0)>0).map(e=>({kind:e,count:n.get(e)??0,share:t.length>0?(n.get(e)??0)/t.length*100:0})),total:t.length}},[e]);return n===0?(0,u.jsx)(`div`,{className:`health-mat-card`,children:(0,u.jsxs)(`div`,{className:`overview-module__header`,children:[(0,u.jsx)(`h3`,{children:`Model materializations`}),(0,u.jsx)(`p`,{children:`No model executions in this health slice.`})]})}):(0,u.jsxs)(`div`,{className:`health-mat-card`,children:[(0,u.jsxs)(`div`,{className:`overview-module__header`,children:[(0,u.jsx)(`h3`,{children:`Model materializations`}),(0,u.jsxs)(`p`,{children:[`Manifest-derived materialization kinds for executed models (`,n.toLocaleString(),` rows). Warehouse effects are adapter-dependent.`]})]}),(0,u.jsx)(`ul`,{className:`health-mat-card__list`,"aria-label":`Materialization counts`,children:t.map(({kind:e,count:t,share:n})=>(0,u.jsxs)(`li`,{className:`health-mat-card__row`,children:[(0,u.jsx)(`span`,{className:`health-mat-card__label`,children:ra(e)}),(0,u.jsx)(`span`,{className:`health-mat-card__bar-wrap`,"aria-hidden":!0,children:(0,u.jsx)(`span`,{className:`health-mat-card__bar`,style:{width:`${Math.max(n,2)}%`}})}),(0,u.jsxs)(`span`,{className:`health-mat-card__count`,children:[t,` (`,n.toFixed(n>=10?0:1),`%)`]})]},e))})]})}function sa({analysis:e,projectName:t,analysisSource:n,filters:r,setFilters:i,workspaceSignals:a}){let o=(0,c.useMemo)(()=>({status:r.status,query:``,resourceTypes:new Set}),[r.status]),s=(0,c.useMemo)(()=>Et(e,o),[e,o]),l=r.status!==`all`,d=s.threadCount||s.filteredThreadStats.length,f=s.filteredExecutions.filter(e=>e.resourceType===`model`).length,p=s.filteredExecutions.filter(e=>I.has(e.resourceType)).length;return(0,u.jsxs)(`div`,{className:`workspace-view health-view`,children:[(0,u.jsxs)(`div`,{className:`lens-header`,children:[(0,u.jsxs)(`div`,{className:`lens-header__title`,children:[(0,u.jsx)(`p`,{className:`eyebrow`,children:`Workspace lens`}),(0,u.jsx)(`h2`,{children:`Health`}),(0,u.jsx)(`p`,{className:`lens-header__desc`,children:`Run posture, critical issues, and dependency pressure at a glance.`})]}),l&&(0,u.jsx)(`span`,{className:`lens-header__badge`,children:`Filtered view`})]}),(0,u.jsxs)(`div`,{className:`health-fold`,children:[(0,u.jsx)(wn,{analysis:e,projectName:t,analysisSource:n,derived:s,filtered:l,workspaceSignals:a}),(0,u.jsx)(Yi,{analysis:e,projectName:t}),(0,u.jsx)(`section`,{className:`health-fold__bottlenecks`,"aria-label":`Bottlenecks`,children:(0,u.jsx)(kt,{derived:s})})]}),(0,u.jsxs)(`div`,{className:`health-detail`,children:[(0,u.jsxs)(`section`,{className:`health-section health-detail__execution`,children:[(0,u.jsxs)(`div`,{className:`health-section__header health-section__header--with-inline-controls`,children:[(0,u.jsxs)(`div`,{className:`health-section__header-text`,children:[(0,u.jsx)(`h3`,{children:`Execution breakdown`}),(0,u.jsxs)(`p`,{children:[s.filteredExecutions.length.toLocaleString(),` runs. Status mix by resource type.`]})]}),(0,u.jsx)(Zi,{filters:r,setFilters:i})]}),s.filteredExecutions.length>0?(0,u.jsx)(nn,{executions:s.filteredExecutions,executionsForShareDenominator:s.baselineExecutionsForBreakdown}):(0,u.jsx)(Dt,{icon:`◌`,headline:`No matching executions`,subtext:`Set status to All to include every run, or pick another status filter.`})]}),(0,u.jsxs)(`section`,{className:`health-section health-detail__context`,children:[(0,u.jsxs)(`div`,{className:`health-section__header`,children:[(0,u.jsx)(`h3`,{children:`Execution context`}),(0,u.jsx)(`p`,{children:`Worker pressure, footprint, and critical path.`})]}),(0,u.jsxs)(`div`,{className:`health-detail__grid`,children:[(0,u.jsx)(mn,{derived:s}),(0,u.jsxs)(`div`,{className:`health-detail__stack`,children:[(0,u.jsx)(At,{analysis:e,filtered:l}),(0,u.jsx)(hn,{derived:s,analysis:e,workerThreadCount:d,modelsCount:f,testsCount:p})]})]})]}),(0,u.jsxs)(`section`,{className:`health-section health-detail__structure`,children:[(0,u.jsxs)(`div`,{className:`health-section__header`,children:[(0,u.jsx)(`h3`,{children:`Structural health`}),(0,u.jsx)(`p`,{children:`Coverage and graph shape across the workspace.`})]}),(0,u.jsxs)(`div`,{className:`health-detail__grid`,children:[(0,u.jsx)(jt,{analysis:e,filtered:l}),(0,u.jsxs)(`div`,{className:`health-structure-composition`,children:[(0,u.jsx)(oa,{executions:s.filteredExecutions}),(0,u.jsxs)(`div`,{className:`overview-module__header`,children:[(0,u.jsx)(`h3`,{children:`Graph composition`}),(0,u.jsx)(`p`,{children:`Node type breakdown in the manifest graph.`})]}),(0,u.jsx)(rn,{graphSummary:e.graphSummary})]})]})]}),(0,u.jsxs)(`details`,{className:`health-detail__resource-stats`,children:[(0,u.jsx)(`summary`,{className:`health-detail__resource-stats-summary`,children:`Invocation resource counts`}),(0,u.jsx)(bn,{analysis:e})]})]})]})}function ca({semantics:e,variant:t=`default`}){if(!$i(e))return null;let n=e.materialization===`unknown`&&e.rawMaterialization?e.rawMaterialization.length>14?`${e.rawMaterialization.slice(0,12)}…`:e.rawMaterialization:ra(e.materialization),r=ia(e);return(0,u.jsx)(`span`,{className:t===`compact`?`materialization-semantics-badge materialization-semantics-badge--compact`:`materialization-semantics-badge`,title:r,"aria-label":r,children:n})}var la=a();function ua(){return{pass:0,fail:0,error:0,warn:0,skipped:0,notExecuted:0}}function da(e){return Ce(e)}function fa(e,t){let n=t??{},r=e.filter(e=>I.has(e.resourceType)),i=new Map;for(let e of r){let t=n[e.uniqueId]?.upstream?.map(e=>e.uniqueId)??[];for(let n of t){let t=i.get(n)??ua();e.statusTone===`positive`?t.pass+=1:e.statusTone===`danger`?t.error+=1:e.statusTone===`warning`?t.warn+=1:e.statusTone===`skipped`?t.skipped+=1:t.notExecuted+=1,i.set(n,t)}}return i}function pa(e,t,n){let r=n??{},i=t.filter(e=>I.has(e.resourceType)).filter(t=>(r[t.uniqueId]?.upstream?.map(e=>e.uniqueId)??[]).includes(e)).sort((e,t)=>{let n={danger:0,warning:1,positive:2,skipped:3,neutral:4},r=n[e.statusTone??`neutral`]-n[t.statusTone??`neutral`];if(r!==0)return r;let i=(t.executionTime??-1/0)-(e.executionTime??-1/0);return i===0?e.name.localeCompare(t.name):i}),a=i.filter(e=>e.statusTone===`positive`).length,o=i.filter(e=>e.statusTone===`warning`||e.statusTone===`danger`).length;return{total:i.length,passing:a,attention:o,tests:i}}function ma(e,t,n){return{id:e,label:t,kind:`branch`,children:[],count:0,parentIds:n}}function ha(e,t,n){return{id:e,label:t.name,kind:`resource`,children:[],resource:t,count:1,parentIds:n}}function ga(e){let t=e.split(`/`).map(e=>e.trim()).filter(Boolean);return{directories:t.slice(0,-1),fileName:t[t.length-1]??e}}function _a(e){return ct(e.originalFilePath??e.patchPath??e.path)}function va(e){let t=_a(e);return t?ga(t).directories:[]}function ya(e){let t=_a(e);return t?ga(t).fileName:null}function ba(e){return!e.database||!e.schema?[]:[e.database,e.schema,e.packageName]}function xa(e,t){let n=[`model`,`seed`,`snapshot`,`source`,`macro`,`operation`,`sql_operation`,`analysis`,`semantic_model`,`metric`,`test`,`unit_test`,`exposure`],r=n.indexOf(e.resourceType),i=n.indexOf(t.resourceType);return r===i?e.name.localeCompare(t.name):r===-1?1:i===-1?-1:r-i}function Sa(e,t){let n={branch:0,resource:1};return e.kind===t.kind?e.kind===`resource`&&t.kind===`resource`&&e.resource&&t.resource?xa(e.resource,t.resource):e.label.localeCompare(t.label):n[e.kind]-n[t.kind]}function Ca(e){return e.map(e=>{if(e.kind===`resource`)return e;let t=Ca(e.children).sort(Sa);return{...e,children:t,count:t.reduce((e,t)=>e+t.count,0)}}).sort(Sa)}function wa(e){return`project:branch:${e??`Workspace`}`}function Ta(e,t,n,r){let i=r??{},a=e.filter(e=>!I.has(e.resourceType)),o=fa(e,i),s=e=>{let t=ua();for(let n of e){let e;n.kind===`resource`?e=n.testStats??ua():(e=s(n.children),da(e)&&(n.testStats=e)),t.pass+=e.pass,t.fail+=e.fail,t.error+=e.error,t.warn+=e.warn,t.skipped+=e.skipped}return t},c=[],l=(e,t,n,r)=>{let i=e.find(e=>e.kind===`branch`&&e.id===t);if(i)return i;let a=ma(t,n,r);return e.push(a),a};if(t===`project`){let e=n??`Workspace`,r=l(c,wa(n),e,[]);for(let n of a){if(!_a(n))continue;let i=va(n),a=[r.id],s=r.children;for(let n=0;n<i.length;n+=1){let r=i[n],o=`${t}:branch:${[e,...i.slice(0,n+1)].join(`/`)}`,c=l(s,o,r,[...a]);a.push(o),s=c.children}let c=ha(`${t}:resource:${n.uniqueId}`,n,a),u=o.get(n.uniqueId);u&&da(u)&&(c.testStats=u),s.push(c)}return s(c),Ca(c).filter(e=>e.count>0)}for(let e of a){let n=ba(e);if(n.length===0)continue;let r=[],i=c;for(let e=0;e<n.length;e+=1){let a=n[e],o=`${t}:branch:${n.slice(0,e+1).join(`/`)}`,s=l(i,o,a,[...r]);r.push(o),i=s.children}let a=ha(`${t}:resource:${e.uniqueId}`,e,r),s=o.get(e.uniqueId);s&&da(s)&&(a.testStats=s),i.push(a)}return s(c),Ca(c)}function Ea(e,t,n=0){let r=[];for(let i of e)r.push({node:i,depth:n}),i.kind===`branch`&&t.has(i.id)&&r.push(...Ea(i.children,t,n+1));return r}function Da(e){let t=new Set,n=[...e];for(;n.length>0;){let e=n.pop();e.kind!==`resource`&&(t.add(e.id),n.push(...e.children))}return t}function Oa(e){let t=[],n=[...e];for(;n.length>0;){let e=n.pop();e.kind===`resource`&&e.resource?t.push(e.resource.uniqueId):n.push(...[...e.children].reverse())}return t}function ka(e,t){if(!t)return null;let n=[...e];for(;n.length>0;){let e=n.pop();if(e.kind===`resource`&&e.resource?.uniqueId===t)return e;n.push(...e.children)}return null}function Aa(e,t){let n=ka(e,t);return new Set(n?.parentIds??[])}function ja(e){return Math.max(0,Math.min(10,e))}function Ma(e){return Ze.has(e)}function Na(e,t,n,r){let i=new Map,a=[t];for(let o=1;o<=n;o+=1){let n=[];for(let s of a){let a=e[s],c=r===`upstream`?a?.upstream?.map(e=>e.uniqueId)??[]:a?.downstream?.map(e=>e.uniqueId)??[];for(let e of c)i.has(e)||e===t||(i.set(e,o),n.push(e))}if(a=n,a.length===0)break}return i}function Pa(e){switch(e){case`source`:case`seed`:case`snapshot`:return 0;case`model`:return 1;case`semantic_model`:return 2;case`metric`:case`exposure`:return 3;default:return 4}}function Fa(e,t,n,r){if(e===t)return{side:`selected`,depth:0};let i=n.get(e),a=r.get(e);return i!=null&&a!=null?i<=a?{side:`upstream`,depth:i}:{side:`downstream`,depth:a}:i==null?a==null?{side:`selected`,depth:0}:{side:`downstream`,depth:a}:{side:`upstream`,depth:i}}function Ia(e,t,n,r,i){let a=new Map,o=[...t.keys()].sort((e,n)=>t.get(e)-t.get(n));for(let t of o){let n=r.get(t);if(!n||I.has(n.resourceType))continue;let o=i[t]?.downstream?.map(e=>e.uniqueId)??[],s=0;for(let t of o)if(t===e)s=Math.max(s,0);else{let e=a.get(t);e!==void 0&&(s=Math.max(s,e))}a.set(t,s+1)}let s=new Map,c=[...n.keys()].sort((e,t)=>n.get(e)-n.get(t));for(let t of c){let n=r.get(t);if(!n||I.has(n.resourceType))continue;let a=i[t]?.upstream?.map(e=>e.uniqueId)??[],o=0;for(let t of a)if(t===e)o=Math.max(o,0);else{let e=s.get(t);e!==void 0&&(o=Math.max(o,e))}s.set(t,o+1)}let l=new Map,u=r.get(e);u&&l.set(0,[u]);for(let[e]of t){let t=r.get(e);if(!t||I.has(t.resourceType))continue;let n=-(a.get(e)??1),i=l.get(n)??[];i.push(t),l.set(n,i)}for(let[e]of n){let t=r.get(e);if(!t||I.has(t.resourceType))continue;let n=s.get(e)??1,i=l.get(n)??[];i.push(t),l.set(n,i)}return Array.from(l.entries()).sort((e,t)=>e[0]-t[0]).map(([e,t])=>({column:e,resources:[...new Map(t.map(e=>[e.uniqueId,e])).values()].sort((e,t)=>{let n=Pa(e.resourceType)-Pa(t.resourceType);return n===0?e.name.localeCompare(t.name):n})}))}function La(e,t){let n=new Map;e.forEach(e=>e.resources.forEach((e,t)=>n.set(e.uniqueId,t)));let r=e.map(e=>({...e,resources:[...e.resources]}));for(let e=0;e<4;e+=1){for(let e=1;e<r.length;e+=1){let i=r[e-1],a=r[e];a.resources.sort((e,r)=>{let a=t[e.uniqueId]?.upstream?.map(e=>e.uniqueId)??[],o=t[r.uniqueId]?.upstream?.map(e=>e.uniqueId)??[];return(a.length>0?a.reduce((e,t)=>e+(n.get(t)??i.resources.length),0)/a.length:n.get(e.uniqueId)??0)-(o.length>0?o.reduce((e,t)=>e+(n.get(t)??i.resources.length),0)/o.length:n.get(r.uniqueId)??0)}),a.resources.forEach((e,t)=>n.set(e.uniqueId,t))}for(let e=r.length-2;e>=0;--e){let i=r[e+1],a=r[e];a.resources.sort((e,r)=>{let a=t[e.uniqueId]?.downstream?.map(e=>e.uniqueId)??[],o=t[r.uniqueId]?.downstream?.map(e=>e.uniqueId)??[];return(a.length>0?a.reduce((e,t)=>e+(n.get(t)??i.resources.length),0)/a.length:n.get(e.uniqueId)??0)-(o.length>0?o.reduce((e,t)=>e+(n.get(t)??i.resources.length),0)/o.length:n.get(r.uniqueId)??0)}),a.resources.forEach((e,t)=>n.set(e.uniqueId,t))}}return r}function Ra(e){return e===`summary`?{nodeWidth:176,nodeHeight:64,nodeRadius:14,columnGap:104,rowGap:24,paddingX:40,paddingY:40}:{nodeWidth:212,nodeHeight:80,nodeRadius:18,columnGap:160,rowGap:40,paddingX:56,paddingY:52}}function za(e,t){let n=e.length,r=Math.max(1,...e.map(e=>e.resources.length));return{svgWidth:t.paddingX*2+n*t.nodeWidth+Math.max(0,n-1)*t.columnGap,svgHeight:t.paddingY*2+r*t.nodeHeight+Math.max(0,r-1)*t.rowGap}}function Ba(e,t,n,r,i,a,o){let s=new Map;return e.forEach((e,c)=>{let l=e.resources.length*a.nodeHeight+Math.max(0,e.resources.length-1)*a.rowGap,u=a.paddingY+(o-a.paddingY*2-l)/2,d=a.paddingX+c*(a.nodeWidth+a.columnGap);e.resources.forEach((o,c)=>{let l=u+c*(a.nodeHeight+a.rowGap),{depth:f,side:p}=Fa(o.uniqueId,t,n,r),m=i.get(o.uniqueId);s.set(o.uniqueId,{resource:o,x:d,y:l,column:e.column,depth:f,side:p,passCount:m?.pass??0,failCount:(m?.error??0)+(m?.warn??0),notExecutedCount:m?.notExecuted??0,skippedCount:m?.skipped??0})})}),s}function Va(e,t){let n=[];for(let r of t){let i=e[r]?.downstream??[];for(let e of i)t.has(e.uniqueId)&&n.push({from:r,to:e.uniqueId})}return n}function Ha({resource:e,dependencySummary:t,dependencyIndex:n,resourceById:r,upstreamDepth:i,downstreamDepth:a,displayMode:o=`focused`}){let s=Na(n,e.uniqueId,i,`upstream`),c=Na(n,e.uniqueId,a,`downstream`),l=La(Ia(e.uniqueId,s,c,r,n),n).filter(e=>e.resources.length>0),u=fa(Array.from(r.values()),n),d=Ra(o),{svgWidth:f,svgHeight:p}=za(l,d),m=Ba(l,e.uniqueId,s,c,u,d,p);return{upstreamMap:s,downstreamMap:c,columnNodes:l,nodeLayouts:m,graphEdges:Va(n,new Set(m.keys())),svgWidth:f,svgHeight:p,hasRelatedNodes:m.size>1&&((t?.upstreamCount??0)>0||(t?.downstreamCount??0)>0),nodeWidth:d.nodeWidth,nodeHeight:d.nodeHeight,nodeRadius:d.nodeRadius,displayMode:o}}function Ua(e,t){if(!e)return new Set;let n=new Set([e]);for(let r of t)r.from===e&&n.add(r.to),r.to===e&&n.add(r.from);return n}function Wa(e){return Array.from(new Set(Array.from(e.values()).map(e=>e.resource.resourceType))).sort((e,t)=>{let n=Pa(e)-Pa(t);return n===0?e.localeCompare(t):n})}var Ga={positive:`var(--bg-success-soft)`,warning:`var(--bg-warning-soft)`,danger:`var(--bg-danger-soft)`,skipped:`var(--bg-accent-soft)`,neutral:`var(--bg-surface-muted)`},Ka=`var(--bg-success-soft)`,qa=`var(--bg-danger-soft)`,Ja=`var(--dbt-type-generic-soft)`,Ya={model:`var(--dbt-type-model-soft)`,source:`var(--dbt-type-source-soft)`,seed:`var(--dbt-type-seed-soft)`,snapshot:`var(--dbt-type-snapshot-soft)`,test:`var(--dbt-type-test-soft)`,unit_test:`var(--dbt-type-test-soft)`,metric:`var(--dbt-type-metric-soft)`,semantic_model:`var(--dbt-type-semantic-model-soft)`,exposure:`var(--dbt-type-exposure-soft)`,macro:`var(--dbt-type-macro-soft)`,operation:`var(--dbt-type-operation-soft)`,sql_operation:`var(--dbt-type-operation-soft)`},Xa={model:`var(--dbt-type-model)`,source:`var(--dbt-type-source)`,seed:`var(--dbt-type-seed)`,snapshot:`var(--dbt-type-snapshot)`,test:`var(--dbt-type-test)`,unit_test:`var(--dbt-type-test)`,metric:`var(--dbt-type-metric)`,semantic_model:`var(--dbt-type-semantic-model)`,exposure:`var(--dbt-type-exposure)`,macro:`var(--dbt-type-macro)`,operation:`var(--dbt-type-operation)`,sql_operation:`var(--dbt-type-operation)`};function Za(e,t){switch(t){case`status`:return Ga[e.statusTone??`neutral`];case`type`:return Ya[e.resourceType]??Ja;case`coverage`:return e.description?Ka:qa}}function Qa(e,t){switch(t){case`status`:return e.statusTone??`neutral`;case`type`:return e.resourceType;case`coverage`:return e.description?`documented`:`undocumented`}}function $a(e){return e.charAt(0).toUpperCase()+e.slice(1)}function eo(e){return e.split(`_`).map(e=>$a(e)).join(` `)}function to(e,t){let n=()=>[`positive`,`warning`,`danger`,`skipped`,`neutral`].map(e=>({key:e,label:$a(e),color:Ga[e]})),r=()=>Wa(t).map(e=>({key:e,label:eo(e),color:Ya[e]??Ja,borderColor:Xa[e]??`var(--dbt-type-generic)`}));switch(e){case`status`:return n();case`type`:return r();case`coverage`:return[{key:`documented`,label:`Documented`,color:Ka},{key:`undocumented`,label:`No description`,color:qa}]}}function no(e,t,n){let r=new Map,i=(e,t)=>{let n=r.get(e);n?n.push(t):r.set(e,[t])};for(let{from:t,to:r}of e)!n.has(t)||!n.has(r)||(i(t,r),i(r,t));let a=new Set;if(!n.has(t))return a;let o=[t];a.add(t);for(let e=0;e<o.length;e+=1){let t=o[e];for(let e of r.get(t)??[])a.has(e)||(a.add(e),o.push(e))}return a}function ro(e,t,n){if(!e.has(n))return{nodeLayouts:e,graphEdges:t};let r=no(t,n,new Set(e.keys()));if(r.size===e.size)return{nodeLayouts:e,graphEdges:t};let i=new Map;for(let[t,n]of e.entries())r.has(t)&&i.set(t,n);let a=new Set(i.keys());return{nodeLayouts:i,graphEdges:t.filter(e=>a.has(e.from)&&a.has(e.to))}}function io(e,t,n,r){if(n.size===0)return ro(e.nodeLayouts,e.graphEdges,r);let i=new Map;for(let[a,o]of e.nodeLayouts.entries())(a===r||n.has(Qa(o.resource,t)))&&i.set(a,o);let a=new Set(i.keys());return ro(i,e.graphEdges.filter(e=>a.has(e.from)&&a.has(e.to)),r)}function ao({label:e,value:t,setValue:n,disabled:r=!1}){return(0,u.jsxs)(`div`,{className:`lineage-stepper${r?` lineage-stepper--disabled`:``}`,children:[(0,u.jsx)(`span`,{className:`lineage-stepper__label`,children:e}),(0,u.jsxs)(`div`,{className:`lineage-stepper__controls`,children:[(0,u.jsx)(`button`,{type:`button`,className:`lineage-stepper__button`,disabled:r||t<=1,onClick:()=>n(e=>ja(e-1)),children:`−`}),(0,u.jsx)(`span`,{className:`lineage-stepper__value`,children:t}),(0,u.jsx)(`button`,{type:`button`,className:`lineage-stepper__button`,disabled:r||t>=3,onClick:()=>n(e=>ja(e+1)),children:`+`})]})]})}function oo(e,t,n){return n?`all`:e===t&&e>=1&&e<=3?String(e):`custom`}function so({upstreamDepth:e,downstreamDepth:t,allDepsMode:n,setUpstreamDepth:r,setDownstreamDepth:i,setAllDepsMode:a}){let o=oo(e,t,n),s=e=>{if(e===`all`){a(!0);return}let t=Number(e);a(!1),r(t),i(t)};return(0,u.jsxs)(`div`,{className:`shared-depth-selector`,children:[(0,u.jsx)(`span`,{className:`shared-depth-selector__label`,children:`Depth`}),[`1`,`2`,`3`,`all`].map(e=>(0,u.jsx)(`button`,{type:`button`,className:o===e?Ke:qe,onClick:()=>s(e),children:e===`all`?`All`:e},e)),o===`custom`&&(0,u.jsx)(`span`,{className:`shared-depth-selector__state`,children:`Custom`})]})}function co({lensMode:e,setLensMode:t}){return(0,u.jsxs)(`div`,{className:`lens-selector`,children:[(0,u.jsx)(`span`,{className:`lens-selector__label`,children:`Lens`}),[{value:`type`,label:`Type`},{value:`status`,label:`Status`},{value:`coverage`,label:`Coverage`}].map(({value:n,label:r})=>(0,u.jsx)(`button`,{type:`button`,className:e===n?Ke:qe,onClick:()=>t(n),children:r},n))]})}function lo(e){let{layoutX:t,layoutY:n,nodeWidth:r,nodeHeight:i,zoom:a,viewportClientWidth:o,viewportClientHeight:s,scrollWidth:c,scrollHeight:l}=e;if(o<=0||s<=0||!Number.isFinite(t)||!Number.isFinite(n)||!Number.isFinite(r)||!Number.isFinite(i)||!Number.isFinite(a))return{scrollLeft:0,scrollTop:0};let u=(t+r/2)*a,d=(n+i/2)*a,f=Math.max(0,c-o),p=Math.max(0,l-s),m=u-o/2,h=d-s/2;return{scrollLeft:Math.min(f,Math.max(0,m)),scrollTop:Math.min(p,Math.max(0,h))}}var uo={width:248,height:176},fo={width:220,height:120},po={x:10,y:8};function mo(e){return 16+e.length*6.2}function ho({anchorX:e,anchorY:t,width:n,height:r,offset:i=6,margin:a=12}){let o=window.innerWidth,s=window.innerHeight,c=e+i,l=t+i;return c+n+a>o&&(c=e-n-i),l+r+a>s&&(l=t-r-i),c=Math.min(Math.max(a,c),Math.max(a,o-n-a)),l=Math.min(Math.max(a,l),Math.max(a,s-r-a)),{x:c,y:l}}function go({visibleNodeLayouts:e,getEffectivePos:t,svgWidth:n,svgHeight:r,nodeWidth:i,nodeHeight:a,zoom:o,nodeOffsets:s,nodeDragRef:c,onSelectResource:l,setHoveredId:d,setTooltipNodeId:f,setContextMenu:p,setNodeOffsets:m}){return(0,u.jsx)(`div`,{className:`dependency-graph__interactive-layer`,children:Array.from(e.values()).map(e=>{let{x:h,y:g}=t(e.resource.uniqueId,e.x,e.y),_={left:`${h/n*100}%`,top:`${g/r*100}%`,width:`${i/n*100}%`,height:`${a/r*100}%`};return(0,u.jsx)(`button`,{type:`button`,className:`dependency-graph__hotspot dependency-graph__hotspot--${e.side}`,style:_,onClick:()=>{c.current?.hasMoved||l(e.resource.uniqueId)},onContextMenu:t=>{t.preventDefault();let n=ho({anchorX:t.clientX,anchorY:t.clientY,width:fo.width,height:fo.height});p({x:n.x,y:n.y,nodeId:e.resource.uniqueId})},onMouseEnter:()=>{d(e.resource.uniqueId),f(e.resource.uniqueId)},onMouseLeave:()=>{d(null),f(null)},title:e.resource.uniqueId,onPointerDown:t=>{t.stopPropagation();let n=s.get(e.resource.uniqueId)??{dx:0,dy:0};c.current={nodeId:e.resource.uniqueId,pointerId:t.pointerId,startClientX:t.clientX,startClientY:t.clientY,initialDx:n.dx,initialDy:n.dy,hasMoved:!1},t.currentTarget.setPointerCapture(t.pointerId)},onPointerMove:t=>{let n=c.current;if(!n||n.pointerId!==t.pointerId||n.nodeId!==e.resource.uniqueId)return;let r=t.clientX-n.startClientX,i=t.clientY-n.startClientY;(Math.abs(r)>4||Math.abs(i)>4)&&(n.hasMoved=!0);let a=n.initialDx+r/o,s=n.initialDy+i/o;m(e=>{let t=new Map(e);return t.set(n.nodeId,{dx:a,dy:s}),t})},onPointerUp:e=>{c.current?.pointerId===e.pointerId&&(e.currentTarget.releasePointerCapture(e.pointerId),setTimeout(()=>{c.current=null},0))},onPointerCancel:()=>{c.current=null}},e.resource.uniqueId)})})}function _o({lensMode:e,legendItems:t,activeLegendKeys:n,onToggleLegendKey:r}){return(0,u.jsxs)(`div`,{className:`lineage-legend`,children:[(0,u.jsx)(`span`,{className:`lineage-legend__mode-label`,children:e===`status`?`By status`:e===`type`?`By type`:`By coverage`}),t.map(e=>(0,u.jsxs)(`button`,{type:`button`,className:`lineage-legend__item${n.size===0||n.has(e.key)?` lineage-legend__item--active`:` lineage-legend__item--inactive`}`,onClick:()=>r(e.key),children:[(0,u.jsx)(`span`,{className:`lineage-legend__swatch`,style:{background:e.color,borderColor:e.borderColor}}),e.label]},e.key)),n.size>0&&(0,u.jsx)(`button`,{type:`button`,className:`lineage-legend__clear`,onClick:()=>n.forEach(e=>{r(e)}),children:`Clear`})]})}function vo({node:e,x:t,badgeY:n,badgeHeight:r,badgeRadius:i,displayMode:a}){let o=String(e.passCount),s=String(e.failCount),c=mo(o),l=mo(s),d=e.notExecutedCount>0||e.skippedCount>0,f=a===`summary`&&d?4:6,p=e.notExecutedCount>0?String(e.notExecutedCount):``,m=e.skippedCount>0?String(e.skippedCount):``,h=p?mo(p):0,g=m?mo(m):0,_=t+16+c+f+l,v=e.notExecutedCount>0?_+f:0,y=e.skippedCount>0?e.notExecutedCount>0?v+h+f:_+f:0;return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`rect`,{x:t+16,y:n,width:c,height:r,rx:i,className:`dependency-graph__node-stat-pill dependency-graph__node-stat-pill--pass`}),(0,u.jsx)(`text`,{x:t+16+c/2,y:n+r/2,className:`dependency-graph__node-stat dependency-graph__node-stat--pass`,textAnchor:`middle`,dominantBaseline:`middle`,children:o}),(0,u.jsx)(`rect`,{x:t+16+c+f,y:n,width:l,height:r,rx:i,className:`dependency-graph__node-stat-pill ${e.failCount===0?`dependency-graph__node-stat-pill--neutral`:`dependency-graph__node-stat-pill--fail`}`}),(0,u.jsx)(`text`,{x:t+16+c+f+l/2,y:n+r/2,className:`dependency-graph__node-stat ${e.failCount===0?`dependency-graph__node-stat--neutral`:`dependency-graph__node-stat--fail`}`,textAnchor:`middle`,dominantBaseline:`middle`,children:s}),e.notExecutedCount>0?(0,u.jsxs)(`g`,{children:[(0,u.jsx)(`title`,{children:`Not executed in this run: ${e.notExecutedCount}`}),(0,u.jsx)(`rect`,{x:v,y:n,width:h,height:r,rx:i,className:`dependency-graph__node-stat-pill dependency-graph__node-stat-pill--not-executed`}),(0,u.jsx)(`text`,{x:v+h/2,y:n+r/2,className:`dependency-graph__node-stat dependency-graph__node-stat--not-executed`,textAnchor:`middle`,dominantBaseline:`middle`,children:p})]}):null,e.skippedCount>0?(0,u.jsxs)(`g`,{children:[(0,u.jsx)(`title`,{children:`Skipped dbt tests: ${e.skippedCount}`}),(0,u.jsx)(`rect`,{x:y,y:n,width:g,height:r,rx:i,className:`dependency-graph__node-stat-pill dependency-graph__node-stat-pill--skipped`}),(0,u.jsx)(`text`,{x:y+g/2,y:n+r/2,className:`dependency-graph__node-stat dependency-graph__node-stat--skipped`,textAnchor:`middle`,dominantBaseline:`middle`,children:m})]}):null]})}function yo({node:e,getEffectivePos:t,nodeWidth:n,nodeHeight:r,nodeRadius:i,displayMode:a,lensMode:o,highlightedIds:s,hasHoverFocus:c}){let l=!c||s.has(e.resource.uniqueId),{x:d,y:f}=t(e.resource.uniqueId,e.x,e.y),p=a===`summary`?f+r-20:f+r-23,m=a===`summary`?15:17,h=m/2,g=` dependency-graph__node--tone-${e.resource.statusTone??`neutral`}`;return(0,u.jsxs)(`g`,{children:[(0,u.jsx)(`rect`,{x:d,y:f,width:n,height:r,rx:i,className:`dependency-graph__node${e.side===`selected`?` dependency-graph__node--selected`:``}${l?``:` dependency-graph__node--dimmed`}${g}`,...e.side===`selected`?{stroke:`var(--graph-node-selected-stroke)`,strokeWidth:3}:{},style:{fill:Za(e.resource,o)}}),(0,u.jsx)(`foreignObject`,{x:d+16,y:a===`summary`?f+10:f+14,width:n-32,height:24,children:(0,u.jsxs)(`div`,{className:`dependency-graph__node-title-row`,title:`${e.resource.name} (${tt(e.resource.resourceType)})`,children:[(0,u.jsx)(`span`,{className:`dependency-graph__node-title-icon`,title:tt(e.resource.resourceType),children:(0,u.jsx)(Yt,{resourceType:e.resource.resourceType})}),(0,u.jsx)(`span`,{className:`dependency-graph__node-title-text`,children:e.resource.name})]})}),Ma(e.resource.resourceType)?(0,u.jsx)(vo,{node:e,x:d,badgeY:p,badgeHeight:m,badgeRadius:h,displayMode:a}):null]})}function bo({visibleEdges:e,visibleNodeLayouts:t,getEffectivePos:n,nodeWidth:r,nodeHeight:i,nodeRadius:a,displayMode:o,lensMode:s,highlightedIds:c,hasHoverFocus:l}){return(0,u.jsxs)(u.Fragment,{children:[e.map(e=>{let a=t.get(e.from),o=t.get(e.to);if(!a||!o)return null;let s=n(e.from,a.x,a.y),d=n(e.to,o.x,o.y),f=s.x+r,p=s.y+i/2,m=d.x,h=d.y+i/2,g=Math.max(28,Math.abs(m-f)*.34);return(0,u.jsx)(`path`,{d:`M ${f} ${p} C ${f+g} ${p}, ${m-g} ${h}, ${m} ${h}`,className:`dependency-graph__edge${!l||c.has(e.from)||c.has(e.to)?``:` dependency-graph__edge--dimmed`}`},`${e.from}->${e.to}`)}),Array.from(t.values()).map(e=>(0,u.jsx)(yo,{node:e,getEffectivePos:n,nodeWidth:r,nodeHeight:i,nodeRadius:a,displayMode:o,lensMode:s,highlightedIds:c,hasHoverFocus:l},e.resource.uniqueId))]})}function xo({zoom:e,setZoom:t,nodeOffsetsSize:n,onResetLayout:r,visibleNodeCount:i,upstreamCount:a,downstreamCount:o}){return(0,u.jsxs)(`div`,{className:`lineage-graph__viewport-toolbar`,children:[(0,u.jsxs)(`div`,{className:`lineage-graph__zoom-controls`,children:[(0,u.jsx)(`button`,{type:`button`,className:qe,onClick:()=>t(e=>Math.max(.4,e-.1)),children:`−`}),(0,u.jsxs)(`button`,{type:`button`,className:qe,onClick:()=>t(1),children:[Math.round(e*100),`%`]}),(0,u.jsx)(`button`,{type:`button`,className:qe,onClick:()=>t(e=>Math.min(2.5,e+.1)),children:`+`}),n>0&&(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:r,children:`Reset layout`})]}),(0,u.jsxs)(`p`,{className:`lineage-graph__summary`,children:[i,` nodes · `,a,` upstream · `,o,` `,`downstream`]})]})}function So({model:e,displayMode:t,fullscreen:n,lensMode:r,legendItems:i,activeLegendKeys:a,onToggleLegendKey:o,zoom:s,setZoom:c,nodeOffsets:l,setNodeOffsets:d,visibleNodeLayouts:f,visibleEdges:p,highlightedIds:m,hasHoverFocus:h,getEffectivePos:g,svgWidth:_,svgHeight:v,nodeWidth:y,nodeHeight:b,nodeRadius:x,viewportRef:S,panDragRef:C,nodeDragRef:w,onSelectResource:T,setHoveredId:E,setTooltipNodeId:D,setContextMenu:O,setViewportTick:k,tooltipLayout:A,tooltipPosition:j,contextMenu:M}){return(0,u.jsxs)(`div`,{className:`dependency-graph dependency-graph--${t}${n?` dependency-graph--fullscreen`:``}`,children:[(0,u.jsx)(_o,{lensMode:r,legendItems:i,activeLegendKeys:a,onToggleLegendKey:o}),(0,u.jsx)(xo,{zoom:s,setZoom:c,nodeOffsetsSize:l.size,onResetLayout:()=>d(new Map),visibleNodeCount:f.size,upstreamCount:e.upstreamMap.size,downstreamCount:e.downstreamMap.size}),(0,u.jsx)(`div`,{ref:S,className:`lineage-graph__viewport${n?` lineage-graph__viewport--fullscreen`:``}`,onPointerDown:e=>{let t=S.current;t&&(C.current={pointerId:e.pointerId,startX:e.clientX,startY:e.clientY,scrollLeft:t.scrollLeft,scrollTop:t.scrollTop},t.setPointerCapture(e.pointerId))},onPointerMove:e=>{let t=C.current,n=S.current;!t||!n||t.pointerId!==e.pointerId||(n.scrollLeft=t.scrollLeft-(e.clientX-t.startX),n.scrollTop=t.scrollTop-(e.clientY-t.startY))},onPointerUp:e=>{let t=S.current;C.current?.pointerId===e.pointerId&&t&&t.releasePointerCapture(e.pointerId),C.current=null},onPointerCancel:()=>{C.current=null},onScroll:()=>k(e=>e+1),children:(0,u.jsxs)(`div`,{className:`lineage-graph__canvas`,style:{width:`${_*s}px`,height:`${v*s}px`},children:[(0,u.jsxs)(`div`,{className:`lineage-graph__zoom-layer`,style:{width:`${_}px`,height:`${v}px`,transform:`scale(${s})`},children:[(0,u.jsx)(`svg`,{className:`dependency-graph__svg dependency-graph__svg--lens-${r}`,viewBox:`0 0 ${_} ${v}`,preserveAspectRatio:`xMidYMid meet`,"aria-hidden":`true`,children:(0,u.jsx)(bo,{visibleEdges:p,visibleNodeLayouts:f,getEffectivePos:g,nodeWidth:y,nodeHeight:b,nodeRadius:x,displayMode:t,lensMode:r,highlightedIds:m,hasHoverFocus:h})}),(0,u.jsx)(go,{visibleNodeLayouts:f,getEffectivePos:g,svgWidth:_,svgHeight:v,nodeWidth:y,nodeHeight:b,zoom:s,nodeOffsets:l,nodeDragRef:w,onSelectResource:T,setHoveredId:E,setTooltipNodeId:D,setContextMenu:O,setNodeOffsets:d})]}),A&&j&&(0,u.jsxs)(`div`,{className:`graph-node-tooltip`,style:{left:j.left,top:j.top},"aria-hidden":`true`,children:[(0,u.jsx)(`div`,{className:`graph-node-tooltip__name`,children:A.resource.name}),(0,u.jsxs)(`div`,{className:`graph-node-tooltip__meta`,children:[tt(A.resource.resourceType),A.resource.packageName?` · ${A.resource.packageName}`:``]}),A.resource.status&&(0,u.jsxs)(`div`,{className:`graph-node-tooltip__status graph-node-tooltip__status--${A.resource.statusTone}`,children:[A.resource.status,A.resource.executionTime==null?``:` · ${et(A.resource.executionTime)}`]}),A.resource.description&&(0,u.jsx)(`div`,{className:`graph-node-tooltip__description`,children:A.resource.description})]})]})}),M&&(0,u.jsxs)(`div`,{className:`graph-context-menu`,style:{left:M.x,top:M.y},onPointerDown:e=>e.stopPropagation(),children:[(0,u.jsx)(`button`,{type:`button`,className:`graph-context-menu__item`,onClick:()=>{T(M.nodeId),O(null)},children:`Focus on this node`}),(()=>{let e=f.get(M.nodeId);return e?(0,u.jsx)(`div`,{className:`graph-context-menu__label`,children:e.resource.name}):null})()]})]})}function Co(e,t,n,r,i,a,o,s){(0,c.useLayoutEffect)(()=>{if(!e)return;let i=o.current;if(!i)return;let{x:c,y:l}=a(e.resource.uniqueId,e.x,e.y),u=c*t,d=l*t,f=n*t,p=r*t,m=u+f-uo.width-po.x,h=d+po.y;m<i.scrollLeft+12&&(m=u+po.x),h+uo.height>i.scrollTop+i.clientHeight&&(h=d+p-uo.height-po.y),m=Math.min(Math.max(i.scrollLeft+12,m),Math.max(i.scrollLeft+12,i.scrollLeft+i.clientWidth-uo.width-12)),h=Math.min(Math.max(i.scrollTop+12,h),Math.max(i.scrollTop+12,i.scrollTop+i.clientHeight-uo.height-12)),s({left:m,top:h})},[e,t,n,r,i,a,o,s])}function wo({model:e,onSelectResource:t,lensMode:n=`type`,activeLegendKeys:r,onToggleLegendKey:i,fullscreen:a=!1,displayMode:o=`focused`}){let{nodeLayouts:s,svgHeight:l,svgWidth:d,nodeWidth:f,nodeHeight:p,nodeRadius:m}=e,[h,g]=(0,c.useState)(null),[_,v]=(0,c.useState)(null),[y,b]=(0,c.useState)(1),[x,S]=(0,c.useState)(0),[C,w]=(0,c.useState)(null),[T,E]=(0,c.useState)(new Map),[D,O]=(0,c.useState)(0),[k,A]=(0,c.useState)(null),j=(0,c.useRef)(null),M=(0,c.useRef)(null),N=(0,c.useRef)(null),P=(0,c.useRef)(null),ee=(0,c.useRef)(y),F=(0,c.useMemo)(()=>Array.from(s.values()).find(e=>e.side===`selected`)?.resource.uniqueId??``,[s]),te=(0,c.useMemo)(()=>io(e,n,r,F),[r,n,e,F]),ne=te.nodeLayouts,re=te.graphEdges;(0,c.useEffect)(()=>{queueMicrotask(()=>{b(1),E(new Map),O(e=>e+1)})},[e]),(0,c.useLayoutEffect)(()=>{ee.current=y;let e=P.current,t=N.current;e&&t&&(t.scrollLeft=e.x,t.scrollTop=e.y,P.current=null)},[y]),(0,c.useLayoutEffect)(()=>{if(ee.current!==1||T.size>0)return;let e=N.current;if(!e)return;if(!F){e.scrollLeft=0,e.scrollTop=0;return}let t=ne.get(F);if(!t){e.scrollLeft=0,e.scrollTop=0;return}let{scrollLeft:n,scrollTop:r}=lo({layoutX:t.x,layoutY:t.y,nodeWidth:f,nodeHeight:p,zoom:1,viewportClientWidth:e.clientWidth,viewportClientHeight:e.clientHeight,scrollWidth:e.scrollWidth,scrollHeight:e.scrollHeight});e.scrollLeft=n,e.scrollTop=r},[D,e,T,F,ne,f,p]),(0,c.useEffect)(()=>{if(!k)return;let e=()=>A(null),t=t=>{t.key===`Escape`&&e()};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[k]),(0,c.useEffect)(()=>{let e=N.current;if(!e)return;let t=t=>{if(t.preventDefault(),t.ctrlKey){let n=e.getBoundingClientRect(),r=t.clientX-n.left,i=t.clientY-n.top,a=e.scrollLeft,o=e.scrollTop;b(e=>{let n=Math.max(.4,Math.min(2.5,e*(1-t.deltaY*.003)));return P.current={x:(a+r)/e*n-r,y:(o+i)/e*n-i},n})}else e.scrollLeft+=t.deltaX,e.scrollTop+=t.deltaY};return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},[]);let ie=(0,c.useCallback)((e,t,n)=>{let r=T.get(e);return{x:t+(r?.dx??0),y:n+(r?.dy??0)}},[T]),ae=_!==null&&ne.has(_)?_:null,oe=ae?ne.get(ae)??null:null;if(Co(oe,y,f,p,x,ie,N,w),ne.size===0)return(0,u.jsx)(`div`,{className:`dependency-graph dependency-graph--empty dependency-graph--${o}${a?` dependency-graph--fullscreen`:``}`,children:(0,u.jsx)(Dt,{icon:`↔`,headline:`No lineage available`,subtext:`This resource could not be placed on the lineage canvas.`})});let se=to(n,s),ce=Ua(h,re);return(0,u.jsx)(So,{model:e,displayMode:o,fullscreen:a,lensMode:n,legendItems:se,activeLegendKeys:r,onToggleLegendKey:i,zoom:y,setZoom:b,nodeOffsets:T,setNodeOffsets:E,visibleNodeLayouts:ne,visibleEdges:re,highlightedIds:ce,hasHoverFocus:ce.size>0,getEffectivePos:ie,svgWidth:d,svgHeight:l,nodeWidth:f,nodeHeight:p,nodeRadius:m,viewportRef:N,panDragRef:j,nodeDragRef:M,onSelectResource:t,setHoveredId:g,setTooltipNodeId:v,setContextMenu:A,setViewportTick:S,tooltipLayout:oe,tooltipPosition:C,contextMenu:k})}function To({resource:e,dependencySummary:t,dependencyIndex:n,resourceById:r,upstreamDepth:i,downstreamDepth:a,allDepsMode:o,lensMode:s,activeLegendKeys:l,setUpstreamDepth:d,setDownstreamDepth:f,setAllDepsMode:p,setLensMode:m,setActiveLegendKeys:h,onSelectResource:g,displayMode:_=`focused`,openFullscreen:v=!1,onFullscreenChange:y,fullscreenScope:b=`viewport`}){let[x,S]=(0,c.useState)(!1);(0,c.useEffect)(()=>{S(v)},[v]);let C=(0,c.useCallback)(e=>{S(e),y?.(e)},[y]);(0,c.useEffect)(()=>{if(!x)return;let e=e=>{e.key===`Escape`&&C(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[x,C]),(0,c.useEffect)(()=>{if(!x||typeof document>`u`)return;let e=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=e}},[x]);let w=e=>{h(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},T=(0,c.useMemo)(()=>Ha({resource:e,dependencySummary:t,dependencyIndex:n,resourceById:r,upstreamDepth:o?20:i,downstreamDepth:o?20:a,displayMode:_}),[o,n,t,_,a,e,r,i]),E=()=>(0,u.jsxs)(`div`,{className:`lineage-toolbar`,children:[(0,u.jsx)(co,{lensMode:s,setLensMode:m}),(0,u.jsx)(so,{upstreamDepth:i,downstreamDepth:a,allDepsMode:o,setUpstreamDepth:d,setDownstreamDepth:f,setAllDepsMode:p}),(0,u.jsx)(ao,{label:`Upstream`,value:i,setValue:d,disabled:o}),(0,u.jsx)(ao,{label:`Downstream`,value:a,setValue:f,disabled:o}),l.size>0&&(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:()=>h(new Set),children:`Clear filters`}),_===`focused`&&!x?(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:()=>C(!0),children:`Expand`}):null]}),D=_===`summary`?(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:()=>C(!0),children:`Expand lineage`}):void 0,O=x?(0,u.jsxs)(`div`,{className:`lineage-dialog lineage-dialog--${b}`,role:`dialog`,"aria-modal":`true`,children:[(0,u.jsx)(`button`,{type:`button`,className:`lineage-dialog__backdrop`,"aria-label":`Dismiss lineage overlay`,onClick:()=>C(!1)}),(0,u.jsxs)(`section`,{className:`lineage-dialog__panel`,children:[(0,u.jsxs)(`div`,{className:`lineage-dialog__header`,children:[(0,u.jsxs)(`div`,{className:`lineage-dialog__header-main`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`p`,{className:`eyebrow`,children:`Lineage`}),(0,u.jsx)(`h3`,{children:e.name}),(0,u.jsx)(`p`,{className:`lineage-dialog__subtitle`,children:`Exact dependency graph with staged upstream and downstream columns.`})]}),(0,u.jsx)(`button`,{type:`button`,className:`lineage-dialog__close`,"aria-label":`Close lineage graph`,onClick:()=>C(!1),children:(0,u.jsx)(`span`,{"aria-hidden":`true`,children:`×`})})]}),(0,u.jsx)(`div`,{className:`lineage-dialog__toolbar`,children:E()})]}),(0,u.jsx)(wo,{model:T,onSelectResource:g,lensMode:s,activeLegendKeys:l,onToggleLegendKey:w,displayMode:`focused`,fullscreen:!0})]})]}):null;return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(qt,{title:_===`summary`?`Lineage graph`:`Lineage`,subtitle:_===`summary`?void 0:`Exact upstream and downstream lineage for ${e.name}.`,headerRight:_===`focused`?E():D,children:(0,u.jsxs)(`div`,{className:`lineage-summary lineage-summary--${_}`,children:[(0,u.jsxs)(`div`,{className:`lineage-summary__stats`,children:[(0,u.jsxs)(`div`,{className:`lineage-summary__stat`,children:[(0,u.jsx)(`span`,{children:`Selected resource`}),(0,u.jsx)(`strong`,{children:tt(e.resourceType)})]}),(0,u.jsxs)(`div`,{className:`lineage-summary__stat`,children:[(0,u.jsx)(`span`,{children:`Direct upstream`}),(0,u.jsx)(`strong`,{children:t?.upstreamCount??0})]}),(0,u.jsxs)(`div`,{className:`lineage-summary__stat`,children:[(0,u.jsx)(`span`,{children:`Direct downstream`}),(0,u.jsx)(`strong`,{children:t?.downstreamCount??0})]})]}),(0,u.jsx)(wo,{model:T,onSelectResource:g,lensMode:s,activeLegendKeys:l,onToggleLegendKey:w,displayMode:_})]})}),O&&typeof document<`u`&&(0,la.createPortal)(O,document.body)]})}function Eo(e,t){return t===`asc`?e:-e}function Do(e){return e.statusTone===`danger`||e.statusTone===`warning`?0:e.statusTone===`positive`?1:e.statusTone===`skipped`?2:3}function Oo(e,t){return(t.executionTime??-1/0)-(e.executionTime??-1/0)}function ko(e,t){return e===0?0:t===`asc`?-e:e}function Ao(e,t,n){let r=e.name.localeCompare(t.name);return r===0?e.uniqueId.localeCompare(t.uniqueId):Eo(r,n)}function jo(e,t,n){let r=Oo(e,t);return r===0?e.name.localeCompare(t.name):ko(r,n)}function Mo(e,t,n){let r=tt(e.resourceType).localeCompare(tt(t.resourceType));return r===0?e.name.localeCompare(t.name):Eo(r,n)}function No(e,t,n){let r=(e.testAttachedTarget??``).trim(),i=(t.testAttachedTarget??``).trim(),a=r.localeCompare(i);return a===0?e.name.localeCompare(t.name):Eo(a,n)}function Po(e,t,n){let r=Do(e)-Do(t);if(r!==0)return-Eo(r,n);let i=Oo(e,t);if(i!==0)return ko(i,n);let a=e.name.localeCompare(t.name);return a===0?e.uniqueId.localeCompare(t.uniqueId):Eo(a,n)}function Fo(e,t,n,r){switch(n){case`test`:return Ao(e,t,r);case`duration`:return jo(e,t,r);case`type`:return Mo(e,t,r);case`target`:return No(e,t,r);case`status`:return Po(e,t,r);default:return n}}function Io(e,t,n){return[...e].sort((e,r)=>Fo(e,r,t,n))}function Lo(e){return e.total===0?{label:`No attached tests`,tone:`neutral`,detail:`No quality evidence was linked to this asset in the current artifacts.`}:e.attention>0?{label:`Attention needed`,tone:`warning`,detail:`${e.attention} attention item${e.attention===1?``:`s`} across ${e.total} attached tests.`}:{label:`All attached tests passing`,tone:`positive`,detail:`${e.passing} of ${e.total} attached tests passed in the current artifacts.`}}function Ro(e,t,n){return e===t?n===`asc`?{indicator:`↑`,ariaSort:`ascending`}:{indicator:`↓`,ariaSort:`descending`}:{indicator:` `,ariaSort:`none`}}function zo(e,t,n){return e===t?n===`asc`?`desc`:`asc`:t===`status`||t===`duration`?`desc`:`asc`}var Bo=[{key:`test`,label:`Test`,alignEnd:!1,testCell:!0},{key:`status`,label:`Status`,alignEnd:!1,testCell:!1},{key:`type`,label:`Type`,alignEnd:!1,testCell:!1},{key:`target`,label:`Target`,alignEnd:!1,testCell:!1},{key:`duration`,label:`Duration`,alignEnd:!0,testCell:!1}];function Vo({resource:e,analysis:t,onNavigateTo:n}){let[r,i]=(0,c.useState)(`status`),[a,o]=(0,c.useState)(`desc`),s=(0,c.useMemo)(()=>pa(e.uniqueId,t.resources,t.dependencyIndex),[t.dependencyIndex,t.resources,e.uniqueId]),l=Lo(s),d=(0,c.useMemo)(()=>Io(s.tests,r,a),[s.tests,a,r]),f=e=>{o(t=>zo(r,e,t)),i(e)};return(0,u.jsxs)(qt,{title:`Tests`,subtitle:`Quality evidence and related dependency posture.`,children:[(0,u.jsxs)(`div`,{className:`asset-tests-summary`,children:[(0,u.jsxs)(`div`,{className:`asset-tests-summary__headline`,children:[(0,u.jsx)(`span`,{className:`tone-badge tone-badge--${l.tone}`,children:l.label}),(0,u.jsx)(`p`,{children:l.detail})]}),(0,u.jsxs)(`div`,{className:`asset-tests-summary__metrics`,"aria-label":`Test summary`,children:[(0,u.jsxs)(`span`,{className:`asset-tests-summary__metric`,children:[(0,u.jsx)(`strong`,{children:s.total}),(0,u.jsx)(`span`,{children:`Attached tests`})]}),(0,u.jsxs)(`span`,{className:`asset-tests-summary__metric`,children:[(0,u.jsx)(`strong`,{children:s.passing}),(0,u.jsx)(`span`,{children:`Passing`})]}),(0,u.jsxs)(`span`,{className:`asset-tests-summary__metric`,children:[(0,u.jsx)(`strong`,{children:s.attention}),(0,u.jsx)(`span`,{children:`Attention items`})]})]})]}),s.tests.length===0?(0,u.jsx)(`p`,{className:`resource-spotlight__description resource-spotlight__description--muted`,children:`No attached tests were found for this asset in the current artifacts.`}):(0,u.jsxs)(`div`,{className:`asset-tests-table`,"aria-label":`Attached tests evidence`,children:[(0,u.jsx)(`div`,{className:`asset-tests-table__toolbar`,children:(0,u.jsx)(`p`,{className:`asset-tests-table__caption`,children:`Compare attached test evidence by status, target, duration, and type. Failed and warned tests include run messages when dbt provides them.`})}),(0,u.jsxs)(`div`,{className:`asset-tests-table__header`,role:`row`,children:[Bo.map(({key:e,label:t,alignEnd:n,testCell:i})=>{let o=Ro(r,e,a);return(0,u.jsx)(`div`,{className:`asset-tests-table__cell${i?` asset-tests-table__cell--test`:``}${n?` asset-tests-table__cell--align-end`:``}`,role:`columnheader`,"aria-sort":o.ariaSort,children:(0,u.jsxs)(`button`,{type:`button`,className:`asset-tests-table__sort-button${n?` asset-tests-table__sort-button--align-end`:``}`,onClick:()=>f(e),children:[t,(0,u.jsx)(`span`,{className:`asset-tests-table__sort-indicator`,"aria-hidden":`true`,children:o.indicator})]})},e)}),(0,u.jsx)(`div`,{className:`asset-tests-table__cell asset-tests-table__cell--align-end`,role:`columnheader`,children:`Action`})]}),(0,u.jsx)(`div`,{className:`asset-tests-table__body`,children:d.map(e=>{let t=e.runResultMessage!=null&&e.runResultMessage!==``&&(e.statusTone===`danger`||e.statusTone===`warning`),r=e.testAttachedTarget?`Open ${e.name} (${e.testAttachedTarget}) in runs`:`Open ${e.name} in runs`;return(0,u.jsxs)(`div`,{className:`asset-tests-table__row-group`,children:[(0,u.jsxs)(`button`,{type:`button`,className:`asset-tests-table__row`,"aria-label":r,onClick:()=>n(`runs`,{executionId:e.uniqueId}),children:[(0,u.jsxs)(`div`,{className:`asset-tests-table__cell asset-tests-table__cell--test`,children:[(0,u.jsx)(`strong`,{title:e.name,children:e.name}),(0,u.jsx)(`span`,{className:`asset-tests-table__pkg`,children:e.packageName||`workspace`})]}),(0,u.jsx)(`div`,{className:`asset-tests-table__cell`,"data-label":`Status`,children:(0,u.jsx)(`span`,{className:ot(e.statusTone),children:e.status??`Not executed`})}),(0,u.jsx)(`div`,{className:`asset-tests-table__cell`,"data-label":`Type`,children:(0,u.jsx)(Jt,{resourceType:e.resourceType})}),(0,u.jsx)(`div`,{className:`asset-tests-table__cell asset-tests-table__cell--target`,"data-label":`Target`,title:e.testAttachedTarget??void 0,children:e.testAttachedTarget??`—`}),(0,u.jsx)(`div`,{className:`asset-tests-table__cell asset-tests-table__cell--align-end`,"data-label":`Duration`,children:et(e.executionTime)}),(0,u.jsx)(`div`,{className:`asset-tests-table__cell asset-tests-table__cell--align-end asset-tests-table__cell--action`,"data-label":`Action`,children:(0,u.jsx)(`span`,{className:`asset-tests-table__open-runs-icon`,"aria-hidden":`true`,children:(0,u.jsxs)(`svg`,{viewBox:`0 0 16 16`,width:`18`,height:`18`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.35`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,u.jsx)(`path`,{d:`M4.25 11.75 11.25 4.75`}),(0,u.jsx)(`path`,{d:`M5.5 4.75h5.75v5.75`})]})})})]}),t?(0,u.jsx)(`div`,{className:`asset-tests-table__run-message${e.statusTone===`warning`?` asset-tests-table__run-message--warn`:``}`,role:`note`,"aria-label":`dbt message for ${e.name}`,children:e.runResultMessage}):null]},e.uniqueId)})})]})]})}function Ho(e,t){let[n,r]=(0,c.useState)(null),[i,a]=(0,c.useState)(null),[o,s]=(0,c.useState)(!1),[l,u]=(0,c.useState)(null),d=(0,c.useRef)(0);return(0,c.useEffect)(()=>{d.current+=1;let t=d.current;if(!e){r(null),a(null),u(null),s(!1);return}let n=!1;return r(null),a(null),s(!0),u(null),w(e).then(e=>{n||d.current!==t||(r(e.compiledCode),a(e.rawCode))}).catch(e=>{n||d.current!==t||(r(null),a(null),u(e instanceof Error?e.message:`Failed to load SQL`))}).finally(()=>{!n&&d.current===t&&s(!1)}),()=>{n=!0}},[t,e]),{compiledCode:n,rawCode:i,loading:o,error:l}}function Uo(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Wo=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Go=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ko={};function qo(e,t){return((t||Ko).jsx?Go:Wo).test(e)}var Jo=/[ \t\n\f\r]/g;function Yo(e){return typeof e==`object`?e.type===`text`?Xo(e.value):!1:Xo(e)}function Xo(e){return e.replace(Jo,``)===``}var Zo=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};Zo.prototype.normal={},Zo.prototype.property={},Zo.prototype.space=void 0;function Qo(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Zo(n,r,t)}function $o(e){return e.toLowerCase()}var es=class{constructor(e,t){this.attribute=t,this.property=e}};es.prototype.attribute=``,es.prototype.booleanish=!1,es.prototype.boolean=!1,es.prototype.commaOrSpaceSeparated=!1,es.prototype.commaSeparated=!1,es.prototype.defined=!1,es.prototype.mustUseProperty=!1,es.prototype.number=!1,es.prototype.overloadedBoolean=!1,es.prototype.property=``,es.prototype.spaceSeparated=!1,es.prototype.space=void 0;var ts=e({boolean:()=>U,booleanish:()=>W,commaOrSpaceSeparated:()=>as,commaSeparated:()=>is,number:()=>G,overloadedBoolean:()=>rs,spaceSeparated:()=>K}),ns=0,U=os(),W=os(),rs=os(),G=os(),K=os(),is=os(),as=os();function os(){return 2**++ns}var ss=Object.keys(ts),cs=class extends es{constructor(e,t,n,r){let i=-1;if(super(e,t),ls(this,`space`,r),typeof n==`number`)for(;++i<ss.length;){let e=ss[i];ls(this,ss[i],(n&ts[e])===ts[e])}}};cs.prototype.defined=!0;function ls(e,t,n){n&&(e[t]=n)}function us(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new cs(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[$o(r)]=r,n[$o(a.attribute)]=r}return new Zo(t,n,e.space)}var ds=us({properties:{ariaActiveDescendant:null,ariaAtomic:W,ariaAutoComplete:null,ariaBusy:W,ariaChecked:W,ariaColCount:G,ariaColIndex:G,ariaColSpan:G,ariaControls:K,ariaCurrent:null,ariaDescribedBy:K,ariaDetails:null,ariaDisabled:W,ariaDropEffect:K,ariaErrorMessage:null,ariaExpanded:W,ariaFlowTo:K,ariaGrabbed:W,ariaHasPopup:null,ariaHidden:W,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:K,ariaLevel:G,ariaLive:null,ariaModal:W,ariaMultiLine:W,ariaMultiSelectable:W,ariaOrientation:null,ariaOwns:K,ariaPlaceholder:null,ariaPosInSet:G,ariaPressed:W,ariaReadOnly:W,ariaRelevant:null,ariaRequired:W,ariaRoleDescription:K,ariaRowCount:G,ariaRowIndex:G,ariaRowSpan:G,ariaSelected:W,ariaSetSize:G,ariaSort:null,ariaValueMax:G,ariaValueMin:G,ariaValueNow:G,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function fs(e,t){return t in e?e[t]:t}function ps(e,t){return fs(e,t.toLowerCase())}var ms=us({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:is,acceptCharset:K,accessKey:K,action:null,allow:null,allowFullScreen:U,allowPaymentRequest:U,allowUserMedia:U,alt:null,as:null,async:U,autoCapitalize:null,autoComplete:K,autoFocus:U,autoPlay:U,blocking:K,capture:null,charSet:null,checked:U,cite:null,className:K,cols:G,colSpan:null,content:null,contentEditable:W,controls:U,controlsList:K,coords:G|is,crossOrigin:null,data:null,dateTime:null,decoding:null,default:U,defer:U,dir:null,dirName:null,disabled:U,download:rs,draggable:W,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:U,formTarget:null,headers:K,height:G,hidden:rs,high:G,href:null,hrefLang:null,htmlFor:K,httpEquiv:K,id:null,imageSizes:null,imageSrcSet:null,inert:U,inputMode:null,integrity:null,is:null,isMap:U,itemId:null,itemProp:K,itemRef:K,itemScope:U,itemType:K,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:U,low:G,manifest:null,max:null,maxLength:G,media:null,method:null,min:null,minLength:G,multiple:U,muted:U,name:null,nonce:null,noModule:U,noValidate:U,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:U,optimum:G,pattern:null,ping:K,placeholder:null,playsInline:U,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:U,referrerPolicy:null,rel:K,required:U,reversed:U,rows:G,rowSpan:G,sandbox:K,scope:null,scoped:U,seamless:U,selected:U,shadowRootClonable:U,shadowRootDelegatesFocus:U,shadowRootMode:null,shape:null,size:G,sizes:null,slot:null,span:G,spellCheck:W,src:null,srcDoc:null,srcLang:null,srcSet:null,start:G,step:null,style:null,tabIndex:G,target:null,title:null,translate:null,type:null,typeMustMatch:U,useMap:null,value:W,width:G,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:K,axis:null,background:null,bgColor:null,border:G,borderColor:null,bottomMargin:G,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:U,declare:U,event:null,face:null,frame:null,frameBorder:null,hSpace:G,leftMargin:G,link:null,longDesc:null,lowSrc:null,marginHeight:G,marginWidth:G,noResize:U,noHref:U,noShade:U,noWrap:U,object:null,profile:null,prompt:null,rev:null,rightMargin:G,rules:null,scheme:null,scrolling:W,standby:null,summary:null,text:null,topMargin:G,valueType:null,version:null,vAlign:null,vLink:null,vSpace:G,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:U,disableRemotePlayback:U,prefix:null,property:null,results:G,security:null,unselectable:null},space:`html`,transform:ps}),hs=us({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:as,accentHeight:G,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:G,amplitude:G,arabicForm:null,ascent:G,attributeName:null,attributeType:null,azimuth:G,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:G,by:null,calcMode:null,capHeight:G,className:K,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:G,diffuseConstant:G,direction:null,display:null,dur:null,divisor:G,dominantBaseline:null,download:U,dx:null,dy:null,edgeMode:null,editable:null,elevation:G,enableBackground:null,end:null,event:null,exponent:G,externalResourcesRequired:null,fill:null,fillOpacity:G,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:is,g2:is,glyphName:is,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:G,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:G,horizOriginX:G,horizOriginY:G,id:null,ideographic:G,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:G,k:G,k1:G,k2:G,k3:G,k4:G,kernelMatrix:as,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:G,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:G,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:G,overlineThickness:G,paintOrder:null,panose1:null,path:null,pathLength:G,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:K,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:G,pointsAtY:G,pointsAtZ:G,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:as,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:as,rev:as,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:as,requiredFeatures:as,requiredFonts:as,requiredFormats:as,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:G,specularExponent:G,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:G,strikethroughThickness:G,string:null,stroke:null,strokeDashArray:as,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:G,strokeOpacity:G,strokeWidth:null,style:null,surfaceScale:G,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:as,tabIndex:G,tableValues:null,target:null,targetX:G,targetY:G,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:as,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:G,underlineThickness:G,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:G,values:null,vAlphabetic:G,vMathematical:G,vectorEffect:null,vHanging:G,vIdeographic:G,version:null,vertAdvY:G,vertOriginX:G,vertOriginY:G,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:G,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:fs}),gs=us({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),_s=us({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:ps}),vs=us({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),ys={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},bs=/[A-Z]/g,xs=/-[a-z]/g,Ss=/^data[-\w.:]+$/i;function Cs(e,t){let n=$o(t),r=t,i=es;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Ss.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(xs,Ts);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!xs.test(e)){let n=e.replace(bs,ws);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=cs}return new i(r,t)}function ws(e){return`-`+e.toLowerCase()}function Ts(e){return e.charAt(1).toUpperCase()}var Es=Qo([ds,ms,gs,_s,vs],`html`),Ds=Qo([ds,hs,gs,_s,vs],`svg`);function Os(e){return e.join(` `).trim()}var ks=n(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g,u=`
|
|
3
|
-
`,d=`/`,f=`*`,p=``,m=`comment`,h=`declaration`;function g(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,g=1;function v(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(u);g=~n?e.length-n:g+e.length}function y(){var e={line:l,column:g};return function(t){return t.position=new b(e),C(),t}}function b(e){this.start=e,this.end={line:l,column:g},this.source=t.source}b.prototype.content=e;function x(n){var r=Error(t.source+`:`+l+`:`+g+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=g,r.source=e,!t.silent)throw r}function S(t){var n=t.exec(e);if(n){var r=n[0];return v(r),e=e.slice(r.length),n}}function C(){S(i)}function w(e){var t;for(e||=[];t=T();)t!==!1&&e.push(t);return e}function T(){var t=y();if(!(d!=e.charAt(0)||f!=e.charAt(1))){for(var n=2;p!=e.charAt(n)&&(f!=e.charAt(n)||d!=e.charAt(n+1));)++n;if(n+=2,p===e.charAt(n-1))return x(`End of comment missing`);var r=e.slice(2,n-2);return g+=2,v(r),e=e.slice(n),g+=2,t({type:m,comment:r})}}function E(){var e=y(),t=S(a);if(t){if(T(),!S(o))return x(`property missing ':'`);var r=S(s),i=e({type:h,property:_(t[0].replace(n,p)),value:r?_(r[0].replace(n,p)):p});return S(c),i}}function D(){var e=[];w(e);for(var t;t=E();)t!==!1&&(e.push(t),w(e));return e}return C(),D()}function _(e){return e?e.replace(l,p):p}t.exports=g})),As=n((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.default=r;var n=t(ks());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),js=n((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),Ms=n(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(As()),r=js();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),Ns=Fs(`end`),Ps=Fs(`start`);function Fs(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function Is(e){let t=Ps(e),n=Ns(e);if(t&&n)return{start:t,end:n}}function Ls(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?zs(e.position):`start`in e||`end`in e?zs(e):`line`in e||`column`in e?Rs(e):``}function Rs(e){return Bs(e&&e.line)+`:`+Bs(e&&e.column)}function zs(e){return Rs(e&&e.start)+`-`+Rs(e&&e.end)}function Bs(e){return e&&typeof e==`number`?e:1}var q=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=Ls(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};q.prototype.file=``,q.prototype.name=``,q.prototype.reason=``,q.prototype.message=``,q.prototype.stack=``,q.prototype.column=void 0,q.prototype.line=void 0,q.prototype.ancestors=void 0,q.prototype.cause=void 0,q.prototype.fatal=void 0,q.prototype.place=void 0,q.prototype.ruleId=void 0,q.prototype.source=void 0;var Vs=t(Ms(),1),Hs={}.hasOwnProperty,Us=new Map,Ws=/[A-Z]/g,Gs=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Ks=new Set([`td`,`th`]),qs=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Js(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=ac(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=ic(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?Ds:Es,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Ys(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Ys(e,t,n){if(t.type===`element`)return Xs(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Zs(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return $s(e,t,n);if(t.type===`mdxjsEsm`)return Qs(e,t);if(t.type===`root`)return ec(e,t,n);if(t.type===`text`)return tc(e,t)}function Xs(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=Ds,e.schema=i),e.ancestors.push(t);let a=dc(e,t.tagName,!1),o=oc(e,t),s=cc(e,t);return Gs.has(t.tagName)&&(s=s.filter(function(e){return typeof e==`string`?!Yo(e):!0})),nc(e,o,a,t),rc(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Zs(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}fc(e,t.position)}function Qs(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);fc(e,t.position)}function $s(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=Ds,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:dc(e,t.name,!0),o=sc(e,t),s=cc(e,t);return nc(e,o,a,t),rc(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function ec(e,t,n){let r={};return rc(r,cc(e,t)),e.create(t,e.Fragment,r,n)}function tc(e,t){return t.value}function nc(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function rc(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function ic(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function ac(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=Ps(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function oc(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&Hs.call(t.properties,i)){let a=lc(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Ks.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function sc(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else fc(e,t.position);else{let i=r.name,a;if(r.value&&typeof r.value==`object`)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else fc(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function cc(e,t){let n=[],r=-1,i=e.passKeys?new Map:Us;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=Ys(e,a,o);s!==void 0&&n.push(s)}return n}function lc(e,t,n){let r=Cs(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Uo(n):Os(n)),r.property===`style`){let t=typeof n==`object`?n:uc(e,String(n));return e.stylePropertyNameCase===`css`&&(t=pc(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?ys[r.property]||r.property:r.attribute,n]}}function uc(e,t){try{return(0,Vs.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new q("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=qs+`#cannot-parse-style-attribute`,r}}function dc(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=qo(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=qo(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return Hs.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);fc(e)}function fc(e,t){let n=new q("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=qs+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function pc(e){let t={},n;for(n in e)Hs.call(e,n)&&(t[mc(n)]=e[n]);return t}function mc(e){let t=e.replace(Ws,hc);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function hc(e){return`-`+e.toLowerCase()}var gc={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},_c={};function vc(e,t){let n=t||_c;return yc(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function yc(e,t,n){if(xc(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return bc(e.children,t,n)}return Array.isArray(e)?bc(e,t,n):``}function bc(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=yc(e[i],t,n);return r.join(``)}function xc(e){return!!(e&&typeof e==`object`)}var Sc=document.createElement(`i`);function Cc(e){let t=`&`+e+`;`;Sc.innerHTML=t;let n=Sc.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`||n===t?!1:n}function wc(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function Tc(e,t){return e.length>0?(wc(e,e.length,0,t),e):t}var Ec={}.hasOwnProperty;function Dc(e){let t={},n=-1;for(;++n<e.length;)Oc(t,e[n]);return t}function Oc(e,t){let n;for(n in t){let r=(Ec.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){Ec.call(r,a)||(r[a]=[]);let e=i[a];kc(r[a],Array.isArray(e)?e:e?[e]:[])}}}function kc(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);wc(e,0,0,r)}function Ac(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function jc(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var Mc=Bc(/[A-Za-z]/),J=Bc(/[\dA-Za-z]/),Nc=Bc(/[#-'*+\--9=?A-Z^-~]/);function Pc(e){return e!==null&&(e<32||e===127)}var Fc=Bc(/\d/),Ic=Bc(/[\dA-Fa-f]/),Lc=Bc(/[!-/:-@[-`{-~]/);function Y(e){return e!==null&&e<-2}function X(e){return e!==null&&(e<0||e===32)}function Z(e){return e===-2||e===-1||e===32}var Rc=Bc(/\p{P}|\p{S}/u),zc=Bc(/\s/);function Bc(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Vc(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&J(e.charCodeAt(n+1))&&J(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function Q(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return Z(r)?(e.enter(n),s(r)):t(r)}function s(r){return Z(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var Hc={tokenize:Uc};function Uc(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Q(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return Y(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var Wc={tokenize:Kc},Gc={tokenize:qc};function Kc(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return wc(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Gc,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(Gc,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return Y(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;wc(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-- >r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function qc(e,t,n){return Q(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function Jc(e){if(e===null||X(e)||zc(e))return 1;if(Rc(e))return 2}function Yc(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var Xc={name:`attention`,resolveAll:Zc,tokenize:Qc};function Zc(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};$c(d,-c),$c(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=Tc(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=Tc(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=Tc(l,Yc(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=Tc(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=Tc(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,wc(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function Qc(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Jc(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=Jc(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function $c(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var el={name:`autolink`,tokenize:tl};function tl(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return Mc(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||J(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||J(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||Pc(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Nc(t)?(e.consume(t),l):n(t)}function u(e){return J(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||J(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var nl={partial:!0,tokenize:rl};function rl(e,t,n){return r;function r(t){return Z(t)?Q(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||Y(e)?t(e):n(e)}}var il={continuation:{tokenize:ol},exit:sl,name:`blockQuote`,tokenize:al};function al(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return Z(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function ol(e,t,n){let r=this;return i;function i(t){return Z(t)?Q(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(il,t,n)(r)}}function sl(e){e.exit(`blockQuote`)}var cl={name:`characterEscape`,tokenize:ll};function ll(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return Lc(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var ul={name:`characterReference`,tokenize:dl};function dl(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=J,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=Ic,u):(e.enter(`characterReferenceValue`),a=7,o=Fc,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===J&&!Cc(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var fl={partial:!0,tokenize:hl},pl={concrete:!0,name:`codeFenced`,tokenize:ml};function ml(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),Z(t)?Q(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||Y(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(fl,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||Y(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):Z(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),Q(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||Y(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||Y(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&Z(t)?Q(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||Y(t)?e.check(fl,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||Y(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),Z(t)?Q(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),Z(t)?Q(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||Y(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function hl(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var gl={name:`codeIndented`,tokenize:vl},_l={partial:!0,tokenize:yl};function vl(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),Q(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):Y(t)?e.attempt(_l,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||Y(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function yl(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):Q(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):Y(e)?i(e):n(e)}}var bl={name:`codeText`,previous:Sl,resolve:xl,tokenize:Cl};function xl(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Sl(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function Cl(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||Y(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var wl=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&Tl(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),Tl(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Tl(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);Tl(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);Tl(this.left,t.reverse())}}};function Tl(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function El(e){let t={},n=-1,r,i,a,o,s,c,l,u=new wl(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,Dl(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[1].type===`listItemIndent`))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return wc(e,0,1/0,u.slice(0)),!l}function Dl(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var Ol={resolve:Al,tokenize:jl},kl={partial:!0,tokenize:Ml};function Al(e){return El(e),e}function jl(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):Y(t)?e.check(kl,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function Ml(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Q(e,a,`linePrefix`)}function a(i){if(i===null||Y(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function Nl(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||Pc(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||Y(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||X(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||Pc(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function Pl(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):Y(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||Y(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!Z(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Fl(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Q(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||Y(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function Il(e,t){let n;return r;function r(i){return Y(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):Z(i)?Q(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var Ll={name:`definition`,tokenize:zl},Rl={partial:!0,tokenize:Bl};function zl(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Pl.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=jc(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return X(t)?Il(e,l)(t):l(t)}function l(t){return Nl(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Rl,d,d)(t)}function d(t){return Z(t)?Q(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||Y(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Bl(e,t,n){return r;function r(t){return X(t)?Il(e,i)(t):n(t)}function i(t){return Fl(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return Z(t)?Q(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||Y(e)?t(e):n(e)}}var Vl={name:`hardBreakEscape`,tokenize:Hl};function Hl(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return Y(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var Ul={name:`headingAtx`,resolve:Wl,tokenize:Gl};function Wl(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},wc(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function Gl(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||X(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||Y(n)?(e.exit(`atxHeading`),t(n)):Z(n)?Q(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||X(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var Kl=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),ql=[`pre`,`script`,`style`,`textarea`],Jl={concrete:!0,name:`htmlFlow`,resolveTo:Zl,tokenize:Ql},Yl={partial:!0,tokenize:eu},Xl={partial:!0,tokenize:$l};function Zl(e){let t=e.length;for(;t--&&!(e[t][0]===`enter`&&e[t][1].type===`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Ql(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:F):Mc(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):Mc(a)?(e.consume(a),i=4,r.interrupt?t:F):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:F):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return Mc(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||X(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&ql.includes(l)?(i=1,r.interrupt?t(s):O(s)):Kl.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||J(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return Z(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||Mc(t)?(e.consume(t),b):Z(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||J(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):Z(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):Z(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||Y(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||X(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||Z(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||Y(t)?O(t):Z(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),te):t===63&&i===3?(e.consume(t),F):t===93&&i===5?(e.consume(t),ee):Y(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Yl,ne,k)(t)):t===null||Y(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(Xl,A,ne)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||Y(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),F):O(t)}function N(t){return t===47?(e.consume(t),o=``,P):O(t)}function P(t){if(t===62){let n=o.toLowerCase();return ql.includes(n)?(e.consume(t),te):O(t)}return Mc(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),P):O(t)}function ee(t){return t===93?(e.consume(t),F):O(t)}function F(t){return t===62?(e.consume(t),te):t===45&&i===2?(e.consume(t),F):O(t)}function te(t){return t===null||Y(t)?(e.exit(`htmlFlowData`),ne(t)):(e.consume(t),te)}function ne(n){return e.exit(`htmlFlow`),t(n)}}function $l(e,t,n){let r=this;return i;function i(t){return Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function eu(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(nl,t,n)}}var tu={name:`htmlText`,tokenize:nu};function nu(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):Mc(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):Mc(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):Y(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):Y(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):Y(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):Y(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return Mc(t)?(e.consume(t),S):n(t)}function S(t){return t===45||J(t)?(e.consume(t),S):C(t)}function C(t){return Y(t)?(o=C,N(t)):Z(t)?(e.consume(t),C):M(t)}function w(t){return t===45||J(t)?(e.consume(t),w):t===47||t===62||X(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||Mc(t)?(e.consume(t),E):Y(t)?(o=T,N(t)):Z(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||J(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):Y(t)?(o=D,N(t)):Z(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):Y(t)?(o=O,N(t)):Z(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):Y(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||X(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||X(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),P}function P(t){return Z(t)?Q(e,ee,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):ee(t)}function ee(t){return e.enter(`htmlTextData`),o(t)}}var ru={name:`labelEnd`,resolveAll:su,resolveTo:cu,tokenize:lu},iu={tokenize:uu},au={tokenize:du},ou={tokenize:fu};function su(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&wc(e,0,e.length,n),e}function cu(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=Tc(s,e.slice(a+1,a+r+3)),s=Tc(s,[[`enter`,u,t]]),s=Tc(s,Yc(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=Tc(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=Tc(s,e.slice(o+1)),s=Tc(s,[[`exit`,c,t]]),wc(e,a,e.length,s),e}function lu(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(jc(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(iu,u,o?u:d)(t):t===91?e.attempt(au,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(ou,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function uu(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return X(t)?Il(e,a)(t):a(t)}function a(t){return t===41?u(t):Nl(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return X(t)?Il(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Fl(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return X(t)?Il(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function du(e,t,n){let r=this;return i;function i(t){return Pl.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(jc(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function fu(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var pu={name:`labelStartImage`,resolveAll:ru.resolveAll,tokenize:mu};function mu(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var hu={name:`labelStartLink`,resolveAll:ru.resolveAll,tokenize:gu};function gu(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var _u={name:`lineEnding`,tokenize:vu};function vu(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Q(e,t,`linePrefix`)}}var yu={name:`thematicBreak`,tokenize:bu};function bu(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||Y(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),Z(t)?Q(e,s,`whitespace`)(t):s(t))}}var xu={continuation:{tokenize:Tu},exit:Du,name:`list`,tokenize:wu},Su={partial:!0,tokenize:Ou},Cu={partial:!0,tokenize:Eu};function wu(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:Fc(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(yu,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return Fc(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(nl,r.interrupt?n:u,e.attempt(Su,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return Z(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function Tu(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(nl,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Q(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!Z(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Cu,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Q(e,e.attempt(xu,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function Eu(e,t,n){let r=this;return Q(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function Du(e){e.exit(this.containerState.type)}function Ou(e,t,n){let r=this;return Q(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!Z(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var ku={name:`setextUnderline`,resolveTo:Au,tokenize:ju};function Au(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function ju(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),Z(t)?Q(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||Y(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var Mu={tokenize:Nu};function Nu(e){let t=this,n=e.attempt(nl,r,e.attempt(this.parser.constructs.flowInitial,i,Q(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Ol,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var Pu={resolveAll:Ru()},Fu=Lu(`string`),Iu=Lu(`text`);function Lu(e){return{resolveAll:Ru(e===`text`?zu:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function Ru(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function zu(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var Bu=e({attentionMarkers:()=>Ju,contentInitial:()=>Hu,disable:()=>Yu,document:()=>Vu,flow:()=>Wu,flowInitial:()=>Uu,insideSpan:()=>qu,string:()=>Gu,text:()=>Ku}),Vu={42:xu,43:xu,45:xu,48:xu,49:xu,50:xu,51:xu,52:xu,53:xu,54:xu,55:xu,56:xu,57:xu,62:il},Hu={91:Ll},Uu={[-2]:gl,[-1]:gl,32:gl},Wu={35:Ul,42:yu,45:[ku,yu],60:Jl,61:ku,95:yu,96:pl,126:pl},Gu={38:ul,92:cl},Ku={[-5]:_u,[-4]:_u,[-3]:_u,33:pu,38:ul,42:Xc,60:[el,tu],91:hu,92:[Vl,cl],93:ru,95:Xc,96:bl},qu={null:[Xc,Pu]},Ju={null:[42,95]},Yu={null:[]};function Xu(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=Tc(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=Yc(a,l.events,l),l.events):[]}function f(e,t){return Qu(p(e),t)}function p(e){return Zu(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){Y(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&wc(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Zu(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Qu(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
1
|
+
import{n as e,r as t,t as n}from"./rolldown-runtime-Dw2cE7zH.js";import{i as r,n as i,r as a,t as o}from"./react-vendor-DL38pS2M.js";import{t as s}from"./tanstack-virtual-vendor-DdCr1qam.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var c=t(r(),1),l=i(),u=o();function d({message:e}){return(0,u.jsx)(`div`,{className:`error-banner`,children:e})}var f=typeof window<`u`?new URLSearchParams(window.location.search).get(`debug`)===`1`:!1;function p(...e){f&&console.log(`[dbt-tools]`,...e)}function m(e){!f||typeof performance>`u`||performance.mark(e)}function h(e,t,n){if(!f||typeof performance>`u`)return;performance.measure(e,t,n);let r=performance.getEntriesByName(e,`measure`),i=r[r.length-1];i&&p(`${e}: ${i.duration.toFixed(1)}ms`)}var g=`Unexpected analysis worker response`,_=`Unexpected resource-code worker response`,v=`Unexpected search-resources worker response`,y=`search-resources`,b=class{worker;requestId=0;pending=new Map;constructor(){this.worker=new Worker(new URL(`/assets/analysis.worker-CHgz--Rs.js`,``+import.meta.url),{type:`module`}),this.worker.onmessage=e=>{this.handleMessage(e.data)},this.worker.onerror=e=>{let t=this.formatWorkerError(e);p(`Analysis worker error`,t);for(let e of this.pending.values())e.reject(Error(t));this.pending.clear()},this.worker.onmessageerror=()=>{p(`Analysis worker message error`);for(let e of this.pending.values())e.reject(Error(`Analysis worker failed to deserialize a message`));this.pending.clear()}}formatWorkerError(e){let t=[];if(typeof e.filename==`string`&&e.filename.length>0){let n=e.lineno>0?`${e.filename}:${e.lineno}${e.colno>0?`:${e.colno}`:``}`:e.filename;t.push(n)}e.error instanceof Error&&e.error.message.trim()!==``&&t.push(e.error.message);let n=e.message?.trim();return n?t.length>0?`Analysis worker failed: ${n} (${t.join(` | `)})`:`Analysis worker failed: ${n}`:t.length>0?`Analysis worker failed: ${t.join(` | `)}`:`Analysis worker failed`}collectTransferables(e){return[e.manifestBytes,e.runResultsBytes,e.catalogBytes,e.sourcesBytes].filter(e=>e instanceof ArrayBuffer)}async loadAnalysis(e,t){let n=this.requestId+1;this.requestId=n;let r=`analysis-load:${n}:dispatch`,i=`analysis-load:${n}:ready`,a=`analysis-load:${n}:analysis-ready`;m(r);let o={type:`load-analysis`,protocolVersion:4,requestId:n,artifactBuffers:e,source:t},s=new Promise((e,r)=>{this.pending.set(n,{kind:`load`,resolve:e,reject:r,source:t})});return this.worker.postMessage(o,this.collectTransferables(e)),s.then(e=>(m(i),h(a,r,i),p(`Analysis worker ready`,{requestId:n,source:t,timings:e.metrics.timings}),{...e,metrics:{...e.metrics,dispatchMarkName:r,readyMarkName:i,analysisReadyMeasureName:a}}))}async requestResourceCode(e){let t=this.requestId+1;this.requestId=t;let n={type:`get-resource-code`,protocolVersion:4,requestId:t,uniqueId:e},r=new Promise((e,n)=>{this.pending.set(t,{kind:`resource-code`,resolve:e,reject:n})});return this.worker.postMessage(n),r}async searchResources(e){let t=this.requestId+1;this.requestId=t;let n={type:y,protocolVersion:4,requestId:t,query:e},r=new Promise((e,n)=>{this.pending.set(t,{kind:y,resolve:e,reject:n})});return this.worker.postMessage(n),r}terminate(){this.worker.terminate();for(let e of this.pending.values())e.reject(Error(`Analysis worker terminated`));this.pending.clear()}resolveLoadResponse(e,t){return t.type===`analysis-error`?(e.reject(Error(t.message)),!0):t.type===`analysis-ready`?(e.resolve({analysis:t.analysis,metrics:{requestId:t.requestId,source:e.source,dispatchMarkName:``,readyMarkName:``,analysisReadyMeasureName:``,timings:t.timings}}),!0):!1}resolveResourceCodeResponse(e,t){return t.type===`resource-code-error`?(e.reject(Error(t.message)),!0):t.type===`resource-code-ready`?(e.resolve({compiledCode:t.compiledCode,rawCode:t.rawCode}),!0):!1}resolveSearchResourcesResponse(e,t){return t.type===`search-resources-error`?(e.reject(Error(t.message)),!0):t.type===`search-resources-ready`?(e.resolve(t.resources),!0):!1}handleMessage(e){let t=this.pending.get(e.requestId);if(t){if(this.pending.delete(e.requestId),t.kind===`load`){if(this.resolveLoadResponse(t,e))return;t.reject(Error(g));return}if(t.kind===`resource-code`){if(this.resolveResourceCodeResponse(t,e))return;t.reject(Error(_));return}if(t.kind===y){if(this.resolveSearchResourcesResponse(t,e))return;t.reject(Error(v))}}}},x=null;function S(){return x??=new b,x}async function C(e,t){return S().loadAnalysis(e,t)}async function w(e){return S().requestResourceCode(e)}async function T(e){return S().searchResources(e)}var E=8;function D(e,t){return!e||t.query.trim()?[]:t.recentResourceIds.map(t=>e.resources.find(e=>e.uniqueId===t)??null).filter(e=>e!=null).slice(0,E)}function O(e,t){let n=t.query.trim(),r=(0,c.useMemo)(()=>D(e,t),[e,t.query,t.recentResourceIds]),[i,a]=(0,c.useState)([]),[o,s]=(0,c.useState)(!1),l=(0,c.useRef)(0);return(0,c.useEffect)(()=>{if(!e||!n){l.current+=1,a([]),s(!1);return}l.current+=1;let r=l.current,i=!1;return a([]),s(!0),T(t.query).then(e=>{!i&&l.current===r&&(a(e),s(!1))}).catch(()=>{!i&&l.current===r&&(a([]),s(!1))}),()=>{i=!0}},[e,n,t.query]),n?{results:i,loading:o}:{results:r,loading:!1}}function k(e){let t=e.locationDisplay??null,n=e.sourceKind??null;return t==null&&n==null?null:{sourceKind:n,locationDisplay:t}}function A(e){return e==null?null:e===`local`?`Local directory`:e===`s3`?`Amazon S3`:`Google Cloud Storage`}function j(e){return e===`preload`?`Live target`:e===`remote`?`Remote source`:e===`upload`?`Local upload`:`Waiting for artifacts`}function M(e){return e===`preload`?`DBT_TOOLS_TARGET_DIR`:e===`remote`?`REMOTE SOURCE`:e===`upload`?`UPLOADED`:`ARTIFACTS`}var N=`/assets/app-logo-ByfNNtT8.svg`;function P({className:e,size:t,title:n,testId:r}){return(0,u.jsx)(`img`,{src:N,alt:n??``,"aria-hidden":n?void 0:!0,className:e,style:t?{width:`${t}px`,height:`${t}px`}:void 0,"data-testid":r})}var ee=[{id:`health`,view:`health`,label:`Health`},{id:`timeline`,view:`timeline`,label:`Timeline`},{id:`inventory`,view:`inventory`,label:`Inventory`},{id:`runs`,view:`runs`,label:`Runs`}],F=new Set([`health`,`inventory`,`runs`,`timeline`,`settings`,`overview`,`catalog`,`execution`,`quality`,`dependencies`,`search`]);function te(e){let t=new URLSearchParams(e).get(`view`);return t===`lineage`||t===`dependencies`}function ne(e){switch(e){case`overview`:return`health`;case`catalog`:return`inventory`;case`execution`:case`quality`:return`runs`;case`dependencies`:case`lineage`:return`inventory`;case`search`:return`inventory`;case`discover`:return`inventory`;case`runs`:case`timeline`:case`inventory`:case`health`:case`settings`:return e;default:return`health`}}function re(e){let t=new URLSearchParams(e),n=t.get(`view`);return n?n===`discover`?`inventory`:n===`runs`&&t.get(`tab`)===`timeline`?`timeline`:n===`lineage`||n===`dependencies`?`inventory`:F.has(n)?ne(n):null:null}function ie(e){return new URLSearchParams(e).get(`resource`)}function ae(e){return new URLSearchParams(e).get(`selected`)}function oe(e){let t=new URLSearchParams(e).get(`assetTab`);return t===`summary`||t===`lineage`||t===`sql`||t===`runtime`||t===`tests`?t:null}function se(e){return oe(e)??(te(e)?`lineage`:`summary`)}function ce(e){let t=new URLSearchParams(e).get(`kind`);return t===`all`||t===`models`||t===`tests`||t===`seeds`||t===`snapshots`||t===`operations`?t:null}function le(e){let t=new URLSearchParams(e).get(`adapter`);if(t==null||t===``)return!0;let n=t.trim().toLowerCase();return!(n===`0`||n===`false`||n===`no`)}function ue(e){let t=new URLSearchParams(e).get(`lens`);return t===`status`||t===`type`||t===`coverage`?t:null}function de(e){let t=new URLSearchParams(e).get(`up`);if(t==null||t===``)return null;let n=Number(t);return Number.isFinite(n)?n:null}function fe(e){let t=new URLSearchParams(e).get(`down`);if(t==null||t===``)return null;let n=Number(t);return Number.isFinite(n)?n:null}function pe(e){let t=new URLSearchParams(e).get(`allDeps`);return t===`1`?!0:t===`0`?!1:null}function me(e){return Math.max(0,Math.min(10,e))}function he(e){let t=ie(e),n=new URLSearchParams(e).get(`selected`),r=oe(e),i=te(e)||r===`lineage`,a=de(e),o=fe(e),s=pe(e),c=ue(e);return{rootResourceId:t,selectedResourceId:i?n??t:t,upstreamDepth:me(a??2),downstreamDepth:me(o??2),allDepsMode:s??!1,lensMode:c??`type`,activeLegendKeys:new Set}}var ge=`dbt-tools.sidebarCollapsed`;function _e(e=!0){try{let e=window.localStorage.getItem(ge);if(e!==null)return e===`true`}catch{}return e}function ve(e,t){return ne(t)===e.view}function ye({id:e}){let t={viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,width:20,height:20,"aria-hidden":!0};return e===`health`?(0,u.jsx)(`svg`,{...t,children:(0,u.jsx)(`polyline`,{points:`2,12 6,12 8,5 10,19 13,12 15,12 17,8 19,12 22,12`})}):e===`runs`?(0,u.jsxs)(`svg`,{...t,children:[(0,u.jsx)(`rect`,{x:`3`,y:`4`,width:`3`,height:`16`,rx:`1`}),(0,u.jsx)(`rect`,{x:`9`,y:`8`,width:`3`,height:`12`,rx:`1`}),(0,u.jsx)(`rect`,{x:`15`,y:`6`,width:`3`,height:`14`,rx:`1`}),(0,u.jsx)(`rect`,{x:`21`,y:`10`,width:`0`,height:`0`}),(0,u.jsx)(`line`,{x1:`3`,y1:`20`,x2:`21`,y2:`20`})]}):e===`timeline`?(0,u.jsxs)(`svg`,{...t,children:[(0,u.jsx)(`path`,{d:`M4 18V7`}),(0,u.jsx)(`path`,{d:`M10 18V11`}),(0,u.jsx)(`path`,{d:`M16 18V5`}),(0,u.jsx)(`path`,{d:`M2 18h20`}),(0,u.jsx)(`path`,{d:`M4 9h3M10 13h3M16 7h3`})]}):e===`inventory`?(0,u.jsxs)(`svg`,{...t,children:[(0,u.jsx)(`path`,{d:`M2 7l10-4 10 4-10 4-10-4z`}),(0,u.jsx)(`path`,{d:`M2 12l10 4 10-4`}),(0,u.jsx)(`path`,{d:`M2 17l10 4 10-4`})]}):e===`settings`?(0,u.jsxs)(`svg`,{...t,children:[(0,u.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`}),(0,u.jsx)(`path`,{d:`M12 2.75v2.5`}),(0,u.jsx)(`path`,{d:`M12 18.75v2.5`}),(0,u.jsx)(`path`,{d:`M21.25 12h-2.5`}),(0,u.jsx)(`path`,{d:`M5.25 12h-2.5`}),(0,u.jsx)(`path`,{d:`M18.54 5.46l-1.77 1.77`}),(0,u.jsx)(`path`,{d:`M7.23 16.77l-1.77 1.77`}),(0,u.jsx)(`path`,{d:`M18.54 18.54l-1.77-1.77`}),(0,u.jsx)(`path`,{d:`M7.23 7.23L5.46 5.46`})]}):(0,u.jsxs)(`svg`,{...t,children:[(0,u.jsx)(`path`,{d:`M4 7h16`}),(0,u.jsx)(`path`,{d:`M4 12h9`}),(0,u.jsx)(`path`,{d:`M4 17h13`})]})}var be=`Waiting for artifacts`;function xe({activeView:e,setNavigationTarget:t,sidebarCollapsed:n,setSidebarCollapsed:r,onNavigate:i,analysis:a,analysisSource:o}){let s=j(o);return(0,u.jsxs)(`aside`,{id:`app-sidebar`,className:`app-sidebar${n?` app-sidebar--collapsed`:``}`,children:[(0,u.jsxs)(`button`,{type:`button`,className:`app-sidebar__brand-link`,onClick:()=>{t({view:`health`}),i()},title:`Go to Health`,children:[(0,u.jsx)(P,{className:`app-logo app-logo--brand`}),!n&&(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`strong`,{children:`dbt-tools`}),(0,u.jsx)(`span`,{children:`Artifact operations console`})]})]}),(0,u.jsx)(`nav`,{className:`app-sidebar__nav`,"aria-label":`Workspace sections`,children:(0,u.jsx)(`div`,{className:`nav-group`,children:ee.map(n=>{let r=!a;return(0,u.jsxs)(`button`,{type:`button`,className:ve(n,e)?`sidebar-link sidebar-link--active`:`sidebar-link`,disabled:r,onClick:()=>{t(n),i()},"aria-label":n.label,title:n.label,children:[(0,u.jsx)(`span`,{className:`sidebar-link__icon`,children:(0,u.jsx)(ye,{id:n.id})}),(0,u.jsx)(`div`,{className:`sidebar-link__body`,children:(0,u.jsx)(`strong`,{children:n.label})})]},n.id)})})}),(0,u.jsx)(`button`,{type:`button`,className:`sidebar-toggle`,onClick:()=>r(e=>!e),"aria-label":n?`Expand sidebar`:`Collapse sidebar`,children:n?`›`:`‹`}),(0,u.jsxs)(`div`,{className:`app-sidebar__footer`,children:[(0,u.jsxs)(`button`,{type:`button`,className:e===`settings`?`sidebar-link sidebar-link--active sidebar-settings-trigger`:`sidebar-link sidebar-settings-trigger`,onClick:()=>{t({view:`settings`}),i()},"aria-current":e===`settings`?`page`:void 0,"aria-label":`Open settings`,title:`Settings`,children:[(0,u.jsx)(`span`,{className:`sidebar-link__icon`,children:(0,u.jsx)(ye,{id:`settings`})}),!n&&(0,u.jsx)(`div`,{className:`sidebar-link__body`,children:(0,u.jsx)(`strong`,{children:`Settings`})})]}),!n&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`div`,{className:`sidebar-settings-divider`}),(0,u.jsxs)(`div`,{className:`app-sidebar__session`,children:[(0,u.jsx)(`p`,{className:`eyebrow`,children:`Session`}),(0,u.jsx)(`strong`,{children:s}),(0,u.jsx)(`span`,{children:a?`${a.summary.total_nodes} executions analyzed`:be})]})]})]})]})}function Se({pendingRemoteRun:e,acceptingRemoteRun:t,onAcceptPendingRemoteRun:n}){return e==null?null:(0,u.jsxs)(`section`,{className:`remote-update-banner`,"aria-label":`Remote update available`,children:[(0,u.jsxs)(`div`,{className:`remote-update-banner__copy`,children:[(0,u.jsx)(`p`,{className:`eyebrow`,children:`Remote update available`}),(0,u.jsx)(`strong`,{children:e.label}),(0,u.jsx)(`span`,{children:`A newer complete remote artifact pair is ready. Keep the current investigation until you decide to switch.`})]}),(0,u.jsx)(`button`,{type:`button`,className:`primary-action`,onClick:()=>void n(),disabled:t,children:t?`Switching…`:`Load latest remote run`})]})}var Ce=n(((e,t)=>{var n=typeof Reflect==`object`?Reflect:null,r=n&&typeof n.apply==`function`?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},i=n&&typeof n.ownKeys==`function`?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};function a(e){console&&console.warn&&console.warn(e)}var o=Number.isNaN||function(e){return e!==e};function s(){s.init.call(this)}t.exports=s,t.exports.once=y,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var c=10;function l(e){if(typeof e!=`function`)throw TypeError(`The "listener" argument must be of type Function. Received type `+typeof e)}Object.defineProperty(s,`defaultMaxListeners`,{enumerable:!0,get:function(){return c},set:function(e){if(typeof e!=`number`||e<0||o(e))throw RangeError(`The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received `+e+`.`);c=e}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if(typeof e!=`number`||e<0||o(e))throw RangeError(`The value of "n" is out of range. It must be a non-negative number. Received `+e+`.`);return this._maxListeners=e,this};function u(e){return e._maxListeners===void 0?s.defaultMaxListeners:e._maxListeners}s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i=e===`error`,a=this._events;if(a!==void 0)i&&=a.error===void 0;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=Error(`Unhandled error.`+(o?` (`+o.message+`)`:``));throw s.context=o,s}var c=a[e];if(c===void 0)return!1;if(typeof c==`function`)r(c,this,t);else for(var l=c.length,u=g(c,l),n=0;n<l;++n)r(u[n],this,t);return!0};function d(e,t,n,r){var i,o,s;if(l(n),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit(`newListener`,t,n.listener?n.listener:n),o=e._events),s=o[t]),s===void 0)s=o[t]=n,++e._eventsCount;else if(typeof s==`function`?s=o[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),i=u(e),i>0&&s.length>i&&!s.warned){s.warned=!0;var c=Error(`Possible EventEmitter memory leak detected. `+s.length+` `+String(t)+` listeners added. Use emitter.setMaxListeners() to increase limit`);c.name=`MaxListenersExceededWarning`,c.emitter=e,c.type=t,c.count=s.length,a(c)}return e}s.prototype.addListener=function(e,t){return d(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return d(this,e,t,!0)};function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}s.prototype.once=function(e,t){return l(t),this.on(e,p(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,p(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,r,i,a,o;if(l(t),r=this._events,r===void 0||(n=r[e],n===void 0))return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit(`removeListener`,e,n.listener||t));else if(typeof n!=`function`){for(i=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;i===0?n.shift():_(n,i),n.length===1&&(r[e]=n[0]),r.removeListener!==void 0&&this.emit(`removeListener`,e,o||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,n=this._events,r;if(n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var i=Object.keys(n),a;for(r=0;r<i.length;++r)a=i[r],a!==`removeListener`&&this.removeAllListeners(a);return this.removeAllListeners(`removeListener`),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],typeof t==`function`)this.removeListener(e,t);else if(t!==void 0)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this};function m(e,t,n){var r=e._events;if(r===void 0)return[];var i=r[t];return i===void 0?[]:typeof i==`function`?n?[i.listener||i]:[i]:n?v(i):g(i,i.length)}s.prototype.listeners=function(e){return m(this,e,!0)},s.prototype.rawListeners=function(e){return m(this,e,!1)},s.listenerCount=function(e,t){return typeof e.listenerCount==`function`?e.listenerCount(t):h.call(e,t)},s.prototype.listenerCount=h;function h(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n==`function`)return 1;if(n!==void 0)return n.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]};function g(e,t){for(var n=Array(t),r=0;r<t;++r)n[r]=e[r];return n}function _(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function v(e){for(var t=Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function y(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,a),r(n)}function a(){typeof e.removeListener==`function`&&e.removeListener(`error`,i),n([].slice.call(arguments))}x(e,t,a,{once:!0}),t!==`error`&&b(e,i,{once:!0})})}function b(e,t,n){typeof e.on==`function`&&x(e,`error`,t,n)}function x(e,t,n,r){if(typeof e.on==`function`)r.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener==`function`)e.addEventListener(t,function i(a){r.once&&e.removeEventListener(t,i),n(a)});else throw TypeError(`The "emitter" argument must be of type EventEmitter. Received type `+typeof e)}}))();function we(){let e=arguments[0];for(let t=1,n=arguments.length;t<n;t++)if(arguments[t])for(let n in arguments[t])e[n]=arguments[t][n];return e}var I=we;typeof Object.assign==`function`&&(I=Object.assign);function Te(e,t,n,r){let i=e._nodes.get(t),a=null;return i&&(a=r===`mixed`?i.out&&i.out[n]||i.undirected&&i.undirected[n]:r===`directed`?i.out&&i.out[n]:i.undirected&&i.undirected[n]),a}function L(e){return typeof e==`object`&&!!e}function Ee(e){let t;for(t in e)return!1;return!0}function De(e,t,n){Object.defineProperty(e,t,{enumerable:!1,configurable:!1,writable:!0,value:n})}function Oe(e,t,n){let r={enumerable:!0,configurable:!0};typeof n==`function`?r.get=n:(r.value=n,r.writable=!1),Object.defineProperty(e,t,r)}function ke(e){return!(!L(e)||e.attributes&&!Array.isArray(e.attributes))}function Ae(){let e=Math.floor(Math.random()*256)&255;return()=>e++}function je(){let e=arguments,t=null,n=-1;return{[Symbol.iterator](){return this},next(){let r=null;do{if(t===null){if(n++,n>=e.length)return{done:!0};t=e[n][Symbol.iterator]()}if(r=t.next(),r.done){t=null;continue}break}while(!0);return r}}}function Me(){return{[Symbol.iterator](){return this},next(){return{done:!0}}}}var Ne=class extends Error{constructor(e){super(),this.name=`GraphError`,this.message=e}},R=class e extends Ne{constructor(t){super(t),this.name=`InvalidArgumentsGraphError`,typeof Error.captureStackTrace==`function`&&Error.captureStackTrace(this,e.prototype.constructor)}},z=class e extends Ne{constructor(t){super(t),this.name=`NotFoundGraphError`,typeof Error.captureStackTrace==`function`&&Error.captureStackTrace(this,e.prototype.constructor)}},B=class e extends Ne{constructor(t){super(t),this.name=`UsageGraphError`,typeof Error.captureStackTrace==`function`&&Error.captureStackTrace(this,e.prototype.constructor)}};function Pe(e,t){this.key=e,this.attributes=t,this.clear()}Pe.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=0,this.in={},this.out={},this.undirected={}};function Fe(e,t){this.key=e,this.attributes=t,this.clear()}Fe.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function Ie(e,t){this.key=e,this.attributes=t,this.clear()}Ie.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function Le(e,t,n,r,i){this.key=t,this.attributes=i,this.undirected=e,this.source=n,this.target=r}Le.prototype.attach=function(){let e=`out`,t=`in`;this.undirected&&(e=t=`undirected`);let n=this.source.key,r=this.target.key;this.source[e][r]=this,!(this.undirected&&n===r)&&(this.target[t][n]=this)},Le.prototype.attachMulti=function(){let e=`out`,t=`in`,n=this.source.key,r=this.target.key;this.undirected&&(e=t=`undirected`);let i=this.source[e],a=i[r];if(a===void 0){i[r]=this,this.undirected&&n===r||(this.target[t][n]=this);return}a.previous=this,this.next=a,i[r]=this,this.target[t][n]=this},Le.prototype.detach=function(){let e=this.source.key,t=this.target.key,n=`out`,r=`in`;this.undirected&&(n=r=`undirected`),delete this.source[n][t],delete this.target[r][e]},Le.prototype.detachMulti=function(){let e=this.source.key,t=this.target.key,n=`out`,r=`in`;this.undirected&&(n=r=`undirected`),this.previous===void 0?this.next===void 0?(delete this.source[n][t],delete this.target[r][e]):(this.next.previous=void 0,this.source[n][t]=this.next,this.target[r][e]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};var Re=0,ze=1,Be=2,Ve=3;function He(e,t,n,r,i,a,o){let s,c,l,u;if(r=``+r,n===Re){if(s=e._nodes.get(r),!s)throw new z(`Graph.${t}: could not find the "${r}" node in the graph.`);l=i,u=a}else if(n===Ve){if(i=``+i,c=e._edges.get(i),!c)throw new z(`Graph.${t}: could not find the "${i}" edge in the graph.`);let n=c.source.key,d=c.target.key;if(r===n)s=c.target;else if(r===d)s=c.source;else throw new z(`Graph.${t}: the "${r}" node is not attached to the "${i}" edge (${n}, ${d}).`);l=a,u=o}else{if(c=e._edges.get(r),!c)throw new z(`Graph.${t}: could not find the "${r}" edge in the graph.`);s=n===ze?c.source:c.target,l=i,u=a}return[s,l,u]}function Ue(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=He(this,t,n,e,r,i);return a.attributes[o]}}function We(e,t,n){e.prototype[t]=function(e,r){let[i]=He(this,t,n,e,r);return i.attributes}}function Ge(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=He(this,t,n,e,r,i);return a.attributes.hasOwnProperty(o)}}function Ke(e,t,n){e.prototype[t]=function(e,r,i,a){let[o,s,c]=He(this,t,n,e,r,i,a);return o.attributes[s]=c,this.emit(`nodeAttributesUpdated`,{key:o.key,type:`set`,attributes:o.attributes,name:s}),this}}function qe(e,t,n){e.prototype[t]=function(e,r,i,a){let[o,s,c]=He(this,t,n,e,r,i,a);if(typeof c!=`function`)throw new R(`Graph.${t}: updater should be a function.`);let l=o.attributes;return l[s]=c(l[s]),this.emit(`nodeAttributesUpdated`,{key:o.key,type:`set`,attributes:o.attributes,name:s}),this}}function Je(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=He(this,t,n,e,r,i);return delete a.attributes[o],this.emit(`nodeAttributesUpdated`,{key:a.key,type:`remove`,attributes:a.attributes,name:o}),this}}function Ye(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=He(this,t,n,e,r,i);if(!L(o))throw new R(`Graph.${t}: provided attributes are not a plain object.`);return a.attributes=o,this.emit(`nodeAttributesUpdated`,{key:a.key,type:`replace`,attributes:a.attributes}),this}}function Xe(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=He(this,t,n,e,r,i);if(!L(o))throw new R(`Graph.${t}: provided attributes are not a plain object.`);return I(a.attributes,o),this.emit(`nodeAttributesUpdated`,{key:a.key,type:`merge`,attributes:a.attributes,data:o}),this}}function Ze(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=He(this,t,n,e,r,i);if(typeof o!=`function`)throw new R(`Graph.${t}: provided updater is not a function.`);return a.attributes=o(a.attributes),this.emit(`nodeAttributesUpdated`,{key:a.key,type:`update`,attributes:a.attributes}),this}}var Qe=[{name:e=>`get${e}Attribute`,attacher:Ue},{name:e=>`get${e}Attributes`,attacher:We},{name:e=>`has${e}Attribute`,attacher:Ge},{name:e=>`set${e}Attribute`,attacher:Ke},{name:e=>`update${e}Attribute`,attacher:qe},{name:e=>`remove${e}Attribute`,attacher:Je},{name:e=>`replace${e}Attributes`,attacher:Ye},{name:e=>`merge${e}Attributes`,attacher:Xe},{name:e=>`update${e}Attributes`,attacher:Ze}];function $e(e){Qe.forEach(function({name:t,attacher:n}){n(e,t(`Node`),Re),n(e,t(`Source`),ze),n(e,t(`Target`),Be),n(e,t(`Opposite`),Ve)})}function et(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new B(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new B(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=Te(this,a,o,n),!i)throw new z(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new B(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new z(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return i.attributes[r]}}function tt(e,t,n){e.prototype[t]=function(e){let r;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new B(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new B(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let i=``+e,a=``+arguments[1];if(r=Te(this,i,a,n),!r)throw new z(`Graph.${t}: could not find an edge for the given path ("${i}" - "${a}").`)}else{if(n!==`mixed`)throw new B(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,r=this._edges.get(e),!r)throw new z(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return r.attributes}}function nt(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new B(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new B(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=Te(this,a,o,n),!i)throw new z(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new B(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new z(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return i.attributes.hasOwnProperty(r)}}function rt(e,t,n){e.prototype[t]=function(e,r,i){let a;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new B(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new B(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let o=``+e,s=``+r;if(r=arguments[2],i=arguments[3],a=Te(this,o,s,n),!a)throw new z(`Graph.${t}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(n!==`mixed`)throw new B(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,a=this._edges.get(e),!a)throw new z(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return a.attributes[r]=i,this.emit(`edgeAttributesUpdated`,{key:a.key,type:`set`,attributes:a.attributes,name:r}),this}}function it(e,t,n){e.prototype[t]=function(e,r,i){let a;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new B(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new B(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let o=``+e,s=``+r;if(r=arguments[2],i=arguments[3],a=Te(this,o,s,n),!a)throw new z(`Graph.${t}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(n!==`mixed`)throw new B(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,a=this._edges.get(e),!a)throw new z(`Graph.${t}: could not find the "${e}" edge in the graph.`)}if(typeof i!=`function`)throw new R(`Graph.${t}: updater should be a function.`);return a.attributes[r]=i(a.attributes[r]),this.emit(`edgeAttributesUpdated`,{key:a.key,type:`set`,attributes:a.attributes,name:r}),this}}function at(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new B(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new B(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=Te(this,a,o,n),!i)throw new z(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new B(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new z(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return delete i.attributes[r],this.emit(`edgeAttributesUpdated`,{key:i.key,type:`remove`,attributes:i.attributes,name:r}),this}}function ot(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new B(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new B(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=Te(this,a,o,n),!i)throw new z(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new B(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new z(`Graph.${t}: could not find the "${e}" edge in the graph.`)}if(!L(r))throw new R(`Graph.${t}: provided attributes are not a plain object.`);return i.attributes=r,this.emit(`edgeAttributesUpdated`,{key:i.key,type:`replace`,attributes:i.attributes}),this}}function st(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new B(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new B(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=Te(this,a,o,n),!i)throw new z(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new B(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new z(`Graph.${t}: could not find the "${e}" edge in the graph.`)}if(!L(r))throw new R(`Graph.${t}: provided attributes are not a plain object.`);return I(i.attributes,r),this.emit(`edgeAttributesUpdated`,{key:i.key,type:`merge`,attributes:i.attributes,data:r}),this}}function ct(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new B(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new B(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=Te(this,a,o,n),!i)throw new z(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new B(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new z(`Graph.${t}: could not find the "${e}" edge in the graph.`)}if(typeof r!=`function`)throw new R(`Graph.${t}: provided updater is not a function.`);return i.attributes=r(i.attributes),this.emit(`edgeAttributesUpdated`,{key:i.key,type:`update`,attributes:i.attributes}),this}}var lt=[{name:e=>`get${e}Attribute`,attacher:et},{name:e=>`get${e}Attributes`,attacher:tt},{name:e=>`has${e}Attribute`,attacher:nt},{name:e=>`set${e}Attribute`,attacher:rt},{name:e=>`update${e}Attribute`,attacher:it},{name:e=>`remove${e}Attribute`,attacher:at},{name:e=>`replace${e}Attributes`,attacher:ot},{name:e=>`merge${e}Attributes`,attacher:st},{name:e=>`update${e}Attributes`,attacher:ct}];function ut(e){lt.forEach(function({name:t,attacher:n}){n(e,t(`Edge`),`mixed`),n(e,t(`DirectedEdge`),`directed`),n(e,t(`UndirectedEdge`),`undirected`)})}var dt=[{name:`edges`,type:`mixed`},{name:`inEdges`,type:`directed`,direction:`in`},{name:`outEdges`,type:`directed`,direction:`out`},{name:`inboundEdges`,type:`mixed`,direction:`in`},{name:`outboundEdges`,type:`mixed`,direction:`out`},{name:`directedEdges`,type:`directed`},{name:`undirectedEdges`,type:`undirected`}];function ft(e,t,n,r){let i=!1;for(let a in t){if(a===r)continue;let o=t[a];if(i=n(o.key,o.attributes,o.source.key,o.target.key,o.source.attributes,o.target.attributes,o.undirected),e&&i)return o.key}}function pt(e,t,n,r){let i,a,o,s=!1;for(let c in t)if(c!==r){i=t[c];do{if(a=i.source,o=i.target,s=n(i.key,i.attributes,a.key,o.key,a.attributes,o.attributes,i.undirected),e&&s)return i.key;i=i.next}while(i!==void 0)}}function mt(e,t){let n=Object.keys(e),r=n.length,i,a=0;return{[Symbol.iterator](){return this},next(){do if(i)i=i.next;else{if(a>=r)return{done:!0};let o=n[a++];if(o===t){i=void 0;continue}i=e[o]}while(!i);return{done:!1,value:{edge:i.key,attributes:i.attributes,source:i.source.key,target:i.target.key,sourceAttributes:i.source.attributes,targetAttributes:i.target.attributes,undirected:i.undirected}}}}}function ht(e,t,n,r){let i=t[n];if(!i)return;let a=i.source,o=i.target;if(r(i.key,i.attributes,a.key,o.key,a.attributes,o.attributes,i.undirected)&&e)return i.key}function gt(e,t,n,r){let i=t[n];if(!i)return;let a=!1;do{if(a=r(i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes,i.undirected),e&&a)return i.key;i=i.next}while(i!==void 0)}function _t(e,t){let n=e[t];if(n.next!==void 0)return{[Symbol.iterator](){return this},next(){if(!n)return{done:!0};let e={edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected};return n=n.next,{done:!1,value:e}}};let r=!1;return{[Symbol.iterator](){return this},next(){return r===!0?{done:!0}:(r=!0,{done:!1,value:{edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected}})}}}function vt(e,t){if(e.size===0)return[];if(t===`mixed`||t===e.type)return Array.from(e._edges.keys());let n=t===`undirected`?e.undirectedSize:e.directedSize,r=Array(n),i=t===`undirected`,a=e._edges.values(),o=0,s,c;for(;s=a.next(),s.done!==!0;)c=s.value,c.undirected===i&&(r[o++]=c.key);return r}function yt(e,t,n,r){if(t.size===0)return;let i=n!==`mixed`&&n!==t.type,a=n===`undirected`,o,s,c=!1,l=t._edges.values();for(;o=l.next(),o.done!==!0;){if(s=o.value,i&&s.undirected!==a)continue;let{key:t,attributes:n,source:l,target:u}=s;if(c=r(t,n,l.key,u.key,l.attributes,u.attributes,s.undirected),e&&c)return t}}function bt(e,t){if(e.size===0)return Me();let n=t!==`mixed`&&t!==e.type,r=t===`undirected`,i=e._edges.values();return{[Symbol.iterator](){return this},next(){let e,t;for(;;){if(e=i.next(),e.done)return e;if(t=e.value,!(n&&t.undirected!==r))break}return{value:{edge:t.key,attributes:t.attributes,source:t.source.key,target:t.target.key,sourceAttributes:t.source.attributes,targetAttributes:t.target.attributes,undirected:t.undirected},done:!1}}}}function xt(e,t,n,r,i,a){let o=t?pt:ft,s;if(n!==`undirected`&&(r!==`out`&&(s=o(e,i.in,a),e&&s)||r!==`in`&&(s=o(e,i.out,a,r?void 0:i.key),e&&s))||n!==`directed`&&(s=o(e,i.undirected,a),e&&s))return s}function St(e,t,n,r){let i=[];return xt(!1,e,t,n,r,function(e){i.push(e)}),i}function Ct(e,t,n){let r=Me();return e!==`undirected`&&(t!==`out`&&n.in!==void 0&&(r=je(r,mt(n.in))),t!==`in`&&n.out!==void 0&&(r=je(r,mt(n.out,t?void 0:n.key)))),e!==`directed`&&n.undirected!==void 0&&(r=je(r,mt(n.undirected))),r}function wt(e,t,n,r,i,a,o){let s=n?gt:ht,c;if(t!==`undirected`&&(i.in!==void 0&&r!==`out`&&(c=s(e,i.in,a,o),e&&c)||i.out!==void 0&&r!==`in`&&(r||i.key!==a)&&(c=s(e,i.out,a,o),e&&c))||t!==`directed`&&i.undirected!==void 0&&(c=s(e,i.undirected,a,o),e&&c))return c}function Tt(e,t,n,r,i){let a=[];return wt(!1,e,t,n,r,i,function(e){a.push(e)}),a}function Et(e,t,n,r){let i=Me();return e!==`undirected`&&(n.in!==void 0&&t!==`out`&&r in n.in&&(i=je(i,_t(n.in,r))),n.out!==void 0&&t!==`in`&&r in n.out&&(t||n.key!==r)&&(i=je(i,_t(n.out,r)))),e!==`directed`&&n.undirected!==void 0&&r in n.undirected&&(i=je(i,_t(n.undirected,r))),i}function Dt(e,t){let{name:n,type:r,direction:i}=t;e.prototype[n]=function(e,t){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return[];if(!arguments.length)return vt(this,r);if(arguments.length===1){e=``+e;let t=this._nodes.get(e);if(t===void 0)throw new z(`Graph.${n}: could not find the "${e}" node in the graph.`);return St(this.multi,r===`mixed`?this.type:r,i,t)}if(arguments.length===2){e=``+e,t=``+t;let a=this._nodes.get(e);if(!a)throw new z(`Graph.${n}: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new z(`Graph.${n}: could not find the "${t}" target node in the graph.`);return Tt(r,this.multi,i,a,t)}throw new R(`Graph.${n}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function Ot(e,t){let{name:n,type:r,direction:i}=t,a=`forEach`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[a]=function(e,t,n){if(!(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)){if(arguments.length===1)return n=e,yt(!1,this,r,n);if(arguments.length===2){e=``+e,n=t;let o=this._nodes.get(e);if(o===void 0)throw new z(`Graph.${a}: could not find the "${e}" node in the graph.`);return xt(!1,this.multi,r===`mixed`?this.type:r,i,o,n)}if(arguments.length===3){e=``+e,t=``+t;let o=this._nodes.get(e);if(!o)throw new z(`Graph.${a}: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new z(`Graph.${a}: could not find the "${t}" target node in the graph.`);return wt(!1,r,this.multi,i,o,t,n)}throw new R(`Graph.${a}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};let o=`map`+n[0].toUpperCase()+n.slice(1);e.prototype[o]=function(){let e=Array.prototype.slice.call(arguments),t=e.pop(),n;if(e.length===0){let i=0;r!==`directed`&&(i+=this.undirectedSize),r!==`undirected`&&(i+=this.directedSize),n=Array(i);let a=0;e.push((e,r,i,o,s,c,l)=>{n[a++]=t(e,r,i,o,s,c,l)})}else n=[],e.push((e,r,i,a,o,s,c)=>{n.push(t(e,r,i,a,o,s,c))});return this[a].apply(this,e),n};let s=`filter`+n[0].toUpperCase()+n.slice(1);e.prototype[s]=function(){let e=Array.prototype.slice.call(arguments),t=e.pop(),n=[];return e.push((e,r,i,a,o,s,c)=>{t(e,r,i,a,o,s,c)&&n.push(e)}),this[a].apply(this,e),n};let c=`reduce`+n[0].toUpperCase()+n.slice(1);e.prototype[c]=function(){let e=Array.prototype.slice.call(arguments);if(e.length<2||e.length>4)throw new R(`Graph.${c}: invalid number of arguments (expecting 2, 3 or 4 and got ${e.length}).`);if(typeof e[e.length-1]==`function`&&typeof e[e.length-2]!=`function`)throw new R(`Graph.${c}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let t,n;e.length===2?(t=e[0],n=e[1],e=[]):e.length===3?(t=e[1],n=e[2],e=[e[0]]):e.length===4&&(t=e[2],n=e[3],e=[e[0],e[1]]);let r=n;return e.push((e,n,i,a,o,s,c)=>{r=t(r,e,n,i,a,o,s,c)}),this[a].apply(this,e),r}}function kt(e,t){let{name:n,type:r,direction:i}=t,a=`find`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[a]=function(e,t,n){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return!1;if(arguments.length===1)return n=e,yt(!0,this,r,n);if(arguments.length===2){e=``+e,n=t;let o=this._nodes.get(e);if(o===void 0)throw new z(`Graph.${a}: could not find the "${e}" node in the graph.`);return xt(!0,this.multi,r===`mixed`?this.type:r,i,o,n)}if(arguments.length===3){e=``+e,t=``+t;let o=this._nodes.get(e);if(!o)throw new z(`Graph.${a}: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new z(`Graph.${a}: could not find the "${t}" target node in the graph.`);return wt(!0,r,this.multi,i,o,t,n)}throw new R(`Graph.${a}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};let o=`some`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(){let e=Array.prototype.slice.call(arguments),t=e.pop();return e.push((e,n,r,i,a,o,s)=>t(e,n,r,i,a,o,s)),!!this[a].apply(this,e)};let s=`every`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[s]=function(){let e=Array.prototype.slice.call(arguments),t=e.pop();return e.push((e,n,r,i,a,o,s)=>!t(e,n,r,i,a,o,s)),!this[a].apply(this,e)}}function At(e,t){let{name:n,type:r,direction:i}=t,a=n.slice(0,-1)+`Entries`;e.prototype[a]=function(e,t){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return Me();if(!arguments.length)return bt(this,r);if(arguments.length===1){e=``+e;let t=this._nodes.get(e);if(!t)throw new z(`Graph.${a}: could not find the "${e}" node in the graph.`);return Ct(r,i,t)}if(arguments.length===2){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new z(`Graph.${a}: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new z(`Graph.${a}: could not find the "${t}" target node in the graph.`);return Et(r,i,n,t)}throw new R(`Graph.${a}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function jt(e){dt.forEach(t=>{Dt(e,t),Ot(e,t),kt(e,t),At(e,t)})}var Mt=[{name:`neighbors`,type:`mixed`},{name:`inNeighbors`,type:`directed`,direction:`in`},{name:`outNeighbors`,type:`directed`,direction:`out`},{name:`inboundNeighbors`,type:`mixed`,direction:`in`},{name:`outboundNeighbors`,type:`mixed`,direction:`out`},{name:`directedNeighbors`,type:`directed`},{name:`undirectedNeighbors`,type:`undirected`}];function Nt(){this.A=null,this.B=null}Nt.prototype.wrap=function(e){this.A===null?this.A=e:this.B===null&&(this.B=e)},Nt.prototype.has=function(e){return this.A!==null&&e in this.A||this.B!==null&&e in this.B};function Pt(e,t,n,r,i){for(let a in r){let o=r[a],s=o.source,c=o.target,l=s===n?c:s;if(t&&t.has(l.key))continue;let u=i(l.key,l.attributes);if(e&&u)return l.key}}function Ft(e,t,n,r,i){if(t!==`mixed`){if(t===`undirected`)return Pt(e,null,r,r.undirected,i);if(typeof n==`string`)return Pt(e,null,r,r[n],i)}let a=new Nt,o;if(t!==`undirected`){if(n!==`out`){if(o=Pt(e,null,r,r.in,i),e&&o)return o;a.wrap(r.in)}if(n!==`in`){if(o=Pt(e,a,r,r.out,i),e&&o)return o;a.wrap(r.out)}}if(t!==`directed`&&(o=Pt(e,a,r,r.undirected,i),e&&o))return o}function It(e,t,n){if(e!==`mixed`){if(e===`undirected`)return Object.keys(n.undirected);if(typeof t==`string`)return Object.keys(n[t])}let r=[];return Ft(!1,e,t,n,function(e){r.push(e)}),r}function Lt(e,t,n){let r=Object.keys(n),i=r.length,a=0;return{[Symbol.iterator](){return this},next(){let o=null;do{if(a>=i)return e&&e.wrap(n),{done:!0};let s=n[r[a++]],c=s.source,l=s.target;if(o=c===t?l:c,e&&e.has(o.key)){o=null;continue}}while(o===null);return{done:!1,value:{neighbor:o.key,attributes:o.attributes}}}}}function Rt(e,t,n){if(e!==`mixed`){if(e===`undirected`)return Lt(null,n,n.undirected);if(typeof t==`string`)return Lt(null,n,n[t])}let r=Me(),i=new Nt;return e!==`undirected`&&(t!==`out`&&(r=je(r,Lt(i,n,n.in))),t!==`in`&&(r=je(r,Lt(i,n,n.out)))),e!==`directed`&&(r=je(r,Lt(i,n,n.undirected))),r}function zt(e,t){let{name:n,type:r,direction:i}=t;e.prototype[n]=function(e){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return[];e=``+e;let t=this._nodes.get(e);if(t===void 0)throw new z(`Graph.${n}: could not find the "${e}" node in the graph.`);return It(r===`mixed`?this.type:r,i,t)}}function Bt(e,t){let{name:n,type:r,direction:i}=t,a=`forEach`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[a]=function(e,t){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return;e=``+e;let n=this._nodes.get(e);if(n===void 0)throw new z(`Graph.${a}: could not find the "${e}" node in the graph.`);Ft(!1,r===`mixed`?this.type:r,i,n,t)};let o=`map`+n[0].toUpperCase()+n.slice(1);e.prototype[o]=function(e,t){let n=[];return this[a](e,(e,r)=>{n.push(t(e,r))}),n};let s=`filter`+n[0].toUpperCase()+n.slice(1);e.prototype[s]=function(e,t){let n=[];return this[a](e,(e,r)=>{t(e,r)&&n.push(e)}),n};let c=`reduce`+n[0].toUpperCase()+n.slice(1);e.prototype[c]=function(e,t,n){if(arguments.length<3)throw new R(`Graph.${c}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let r=n;return this[a](e,(e,n)=>{r=t(r,e,n)}),r}}function Vt(e,t){let{name:n,type:r,direction:i}=t,a=n[0].toUpperCase()+n.slice(1,-1),o=`find`+a;e.prototype[o]=function(e,t){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return;e=``+e;let n=this._nodes.get(e);if(n===void 0)throw new z(`Graph.${o}: could not find the "${e}" node in the graph.`);return Ft(!0,r===`mixed`?this.type:r,i,n,t)};let s=`some`+a;e.prototype[s]=function(e,t){return!!this[o](e,t)};let c=`every`+a;e.prototype[c]=function(e,t){return!this[o](e,(e,n)=>!t(e,n))}}function Ht(e,t){let{name:n,type:r,direction:i}=t,a=n.slice(0,-1)+`Entries`;e.prototype[a]=function(e){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return Me();e=``+e;let t=this._nodes.get(e);if(t===void 0)throw new z(`Graph.${a}: could not find the "${e}" node in the graph.`);return Rt(r===`mixed`?this.type:r,i,t)}}function Ut(e){Mt.forEach(t=>{zt(e,t),Bt(e,t),Vt(e,t),Ht(e,t)})}function Wt(e,t,n,r,i){let a=r._nodes.values(),o=r.type,s,c,l,u,d,f,p;for(;s=a.next(),s.done!==!0;){let r=!1;if(c=s.value,o!==`undirected`)for(l in u=c.out,u){d=u[l];do{if(f=d.target,r=!0,p=i(c.key,f.key,c.attributes,f.attributes,d.key,d.attributes,d.undirected),e&&p)return d;d=d.next}while(d)}if(o!==`directed`){for(l in u=c.undirected,u)if(!(t&&c.key>l)){d=u[l];do{if(f=d.target,f.key!==l&&(f=d.source),r=!0,p=i(c.key,f.key,c.attributes,f.attributes,d.key,d.attributes,d.undirected),e&&p)return d;d=d.next}while(d)}}if(n&&!r&&(p=i(c.key,null,c.attributes,null,null,null,null),e&&p))return null}}function Gt(e,t){let n={key:e};return Ee(t.attributes)||(n.attributes=I({},t.attributes)),n}function Kt(e,t,n){let r={key:t,source:n.source.key,target:n.target.key};return Ee(n.attributes)||(r.attributes=I({},n.attributes)),e===`mixed`&&n.undirected&&(r.undirected=!0),r}function qt(e){if(!L(e))throw new R(`Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.`);if(!(`key`in e))throw new R(`Graph.import: serialized node is missing its key.`);if(`attributes`in e&&(!L(e.attributes)||e.attributes===null))throw new R(`Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.`)}function Jt(e){if(!L(e))throw new R(`Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.`);if(!(`source`in e))throw new R(`Graph.import: serialized edge is missing its source.`);if(!(`target`in e))throw new R(`Graph.import: serialized edge is missing its target.`);if(`attributes`in e&&(!L(e.attributes)||e.attributes===null))throw new R(`Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.`);if(`undirected`in e&&typeof e.undirected!=`boolean`)throw new R(`Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.`)}var Yt=Ae(),Xt=new Set([`directed`,`undirected`,`mixed`]),Zt=new Set([`domain`,`_events`,`_eventsCount`,`_maxListeners`]),Qt=[{name:e=>`${e}Edge`,generateKey:!0},{name:e=>`${e}DirectedEdge`,generateKey:!0,type:`directed`},{name:e=>`${e}UndirectedEdge`,generateKey:!0,type:`undirected`},{name:e=>`${e}EdgeWithKey`},{name:e=>`${e}DirectedEdgeWithKey`,type:`directed`},{name:e=>`${e}UndirectedEdgeWithKey`,type:`undirected`}],$t={allowSelfLoops:!0,multi:!1,type:`mixed`};function en(e,t,n){if(n&&!L(n))throw new R(`Graph.addNode: invalid attributes. Expecting an object but got "${n}"`);if(t=``+t,n||={},e._nodes.has(t))throw new B(`Graph.addNode: the "${t}" node already exist in the graph.`);let r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit(`nodeAdded`,{key:t,attributes:n}),r}function tn(e,t,n){let r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit(`nodeAdded`,{key:t,attributes:n}),r}function nn(e,t,n,r,i,a,o,s){if(!r&&e.type===`undirected`)throw new B(`Graph.${t}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(r&&e.type===`directed`)throw new B(`Graph.${t}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(s&&!L(s))throw new R(`Graph.${t}: invalid attributes. Expecting an object but got "${s}"`);if(a=``+a,o=``+o,s||={},!e.allowSelfLoops&&a===o)throw new B(`Graph.${t}: source & target are the same ("${a}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let c=e._nodes.get(a),l=e._nodes.get(o);if(!c)throw new z(`Graph.${t}: source node "${a}" not found.`);if(!l)throw new z(`Graph.${t}: target node "${o}" not found.`);let u={key:null,undirected:r,source:a,target:o,attributes:s};if(n)i=e._edgeKeyGenerator();else if(i=``+i,e._edges.has(i))throw new B(`Graph.${t}: the "${i}" edge already exists in the graph.`);if(!e.multi&&(r?c.undirected[o]!==void 0:c.out[o]!==void 0))throw new B(`Graph.${t}: an edge linking "${a}" to "${o}" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`);let d=new Le(r,i,c,l,s);e._edges.set(i,d);let f=a===o;return r?(c.undirectedDegree++,l.undirectedDegree++,f&&(c.undirectedLoops++,e._undirectedSelfLoopCount++)):(c.outDegree++,l.inDegree++,f&&(c.directedLoops++,e._directedSelfLoopCount++)),e.multi?d.attachMulti():d.attach(),r?e._undirectedSize++:e._directedSize++,u.key=i,e.emit(`edgeAdded`,u),i}function rn(e,t,n,r,i,a,o,s,c){if(!r&&e.type===`undirected`)throw new B(`Graph.${t}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(r&&e.type===`directed`)throw new B(`Graph.${t}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(s){if(c){if(typeof s!=`function`)throw new R(`Graph.${t}: invalid updater function. Expecting a function but got "${s}"`)}else if(!L(s))throw new R(`Graph.${t}: invalid attributes. Expecting an object but got "${s}"`)}a=``+a,o=``+o;let l;if(c&&(l=s,s=void 0),!e.allowSelfLoops&&a===o)throw new B(`Graph.${t}: source & target are the same ("${a}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let u=e._nodes.get(a),d=e._nodes.get(o),f,p;if(!n&&(f=e._edges.get(i),f)){if((f.source.key!==a||f.target.key!==o)&&(!r||f.source.key!==o||f.target.key!==a))throw new B(`Graph.${t}: inconsistency detected when attempting to merge the "${i}" edge with "${a}" source & "${o}" target vs. ("${f.source.key}", "${f.target.key}").`);p=f}if(!p&&!e.multi&&u&&(p=r?u.undirected[o]:u.out[o]),p){let t=[p.key,!1,!1,!1];if(c?!l:!s)return t;if(c){let t=p.attributes;p.attributes=l(t),e.emit(`edgeAttributesUpdated`,{type:`replace`,key:p.key,attributes:p.attributes})}else I(p.attributes,s),e.emit(`edgeAttributesUpdated`,{type:`merge`,key:p.key,attributes:p.attributes,data:s});return t}s||={},c&&l&&(s=l(s));let m={key:null,undirected:r,source:a,target:o,attributes:s};if(n)i=e._edgeKeyGenerator();else if(i=``+i,e._edges.has(i))throw new B(`Graph.${t}: the "${i}" edge already exists in the graph.`);let h=!1,g=!1;u||(u=tn(e,a,{}),h=!0,a===o&&(d=u,g=!0)),d||(d=tn(e,o,{}),g=!0),f=new Le(r,i,u,d,s),e._edges.set(i,f);let _=a===o;return r?(u.undirectedDegree++,d.undirectedDegree++,_&&(u.undirectedLoops++,e._undirectedSelfLoopCount++)):(u.outDegree++,d.inDegree++,_&&(u.directedLoops++,e._directedSelfLoopCount++)),e.multi?f.attachMulti():f.attach(),r?e._undirectedSize++:e._directedSize++,m.key=i,e.emit(`edgeAdded`,m),[i,!0,h,g]}function an(e,t){e._edges.delete(t.key);let{source:n,target:r,attributes:i}=t,a=t.undirected,o=n===r;a?(n.undirectedDegree--,r.undirectedDegree--,o&&(n.undirectedLoops--,e._undirectedSelfLoopCount--)):(n.outDegree--,r.inDegree--,o&&(n.directedLoops--,e._directedSelfLoopCount--)),e.multi?t.detachMulti():t.detach(),a?e._undirectedSize--:e._directedSize--,e.emit(`edgeDropped`,{key:t.key,attributes:i,source:n.key,target:r.key,undirected:a})}var V=class e extends Ce.EventEmitter{constructor(e){if(super(),e=I({},$t,e),typeof e.multi!=`boolean`)throw new R(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${e.multi}".`);if(!Xt.has(e.type))throw new R(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${e.type}".`);if(typeof e.allowSelfLoops!=`boolean`)throw new R(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${e.allowSelfLoops}".`);let t=e.type===`mixed`?Pe:e.type===`directed`?Fe:Ie;De(this,`NodeDataClass`,t);let n=`geid_`+Yt()+`_`,r=0;De(this,`_attributes`,{}),De(this,`_nodes`,new Map),De(this,`_edges`,new Map),De(this,`_directedSize`,0),De(this,`_undirectedSize`,0),De(this,`_directedSelfLoopCount`,0),De(this,`_undirectedSelfLoopCount`,0),De(this,`_edgeKeyGenerator`,()=>{let e;do e=n+ r++;while(this._edges.has(e));return e}),De(this,`_options`,e),Zt.forEach(e=>De(this,e,this[e])),Oe(this,`order`,()=>this._nodes.size),Oe(this,`size`,()=>this._edges.size),Oe(this,`directedSize`,()=>this._directedSize),Oe(this,`undirectedSize`,()=>this._undirectedSize),Oe(this,`selfLoopCount`,()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),Oe(this,`directedSelfLoopCount`,()=>this._directedSelfLoopCount),Oe(this,`undirectedSelfLoopCount`,()=>this._undirectedSelfLoopCount),Oe(this,`multi`,this._options.multi),Oe(this,`type`,this._options.type),Oe(this,`allowSelfLoops`,this._options.allowSelfLoops),Oe(this,`implementation`,()=>`graphology`)}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(e){return this._nodes.has(``+e)}hasDirectedEdge(e,t){if(this.type===`undirected`)return!1;if(arguments.length===1){let t=``+e,n=this._edges.get(t);return!!n&&!n.undirected}else if(arguments.length===2){e=``+e,t=``+t;let n=this._nodes.get(e);return n?n.out.hasOwnProperty(t):!1}throw new R(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasUndirectedEdge(e,t){if(this.type===`directed`)return!1;if(arguments.length===1){let t=``+e,n=this._edges.get(t);return!!n&&n.undirected}else if(arguments.length===2){e=``+e,t=``+t;let n=this._nodes.get(e);return n?n.undirected.hasOwnProperty(t):!1}throw new R(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasEdge(e,t){if(arguments.length===1){let t=``+e;return this._edges.has(t)}else if(arguments.length===2){e=``+e,t=``+t;let n=this._nodes.get(e);return n?n.out!==void 0&&n.out.hasOwnProperty(t)||n.undirected!==void 0&&n.undirected.hasOwnProperty(t):!1}throw new R(`Graph.hasEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}directedEdge(e,t){if(this.type===`undirected`)return;if(e=``+e,t=``+t,this.multi)throw new B(`Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.`);let n=this._nodes.get(e);if(!n)throw new z(`Graph.directedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new z(`Graph.directedEdge: could not find the "${t}" target node in the graph.`);let r=n.out&&n.out[t]||void 0;if(r)return r.key}undirectedEdge(e,t){if(this.type===`directed`)return;if(e=``+e,t=``+t,this.multi)throw new B(`Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.`);let n=this._nodes.get(e);if(!n)throw new z(`Graph.undirectedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new z(`Graph.undirectedEdge: could not find the "${t}" target node in the graph.`);let r=n.undirected&&n.undirected[t]||void 0;if(r)return r.key}edge(e,t){if(this.multi)throw new B(`Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.`);e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new z(`Graph.edge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new z(`Graph.edge: could not find the "${t}" target node in the graph.`);let r=n.out&&n.out[t]||n.undirected&&n.undirected[t]||void 0;if(r)return r.key}areDirectedNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new z(`Graph.areDirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type===`undirected`?!1:t in n.in||t in n.out}areOutNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new z(`Graph.areOutNeighbors: could not find the "${e}" node in the graph.`);return this.type===`undirected`?!1:t in n.out}areInNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new z(`Graph.areInNeighbors: could not find the "${e}" node in the graph.`);return this.type===`undirected`?!1:t in n.in}areUndirectedNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new z(`Graph.areUndirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type===`directed`?!1:t in n.undirected}areNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new z(`Graph.areNeighbors: could not find the "${e}" node in the graph.`);return this.type!==`undirected`&&(t in n.in||t in n.out)||this.type!==`directed`&&t in n.undirected}areInboundNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new z(`Graph.areInboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!==`undirected`&&t in n.in||this.type!==`directed`&&t in n.undirected}areOutboundNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new z(`Graph.areOutboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!==`undirected`&&t in n.out||this.type!==`directed`&&t in n.undirected}inDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new z(`Graph.inDegree: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.inDegree}outDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new z(`Graph.outDegree: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.outDegree}directedDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new z(`Graph.directedDegree: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.inDegree+t.outDegree}undirectedDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new z(`Graph.undirectedDegree: could not find the "${e}" node in the graph.`);return this.type===`directed`?0:t.undirectedDegree}inboundDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new z(`Graph.inboundDegree: could not find the "${e}" node in the graph.`);let n=0;return this.type!==`directed`&&(n+=t.undirectedDegree),this.type!==`undirected`&&(n+=t.inDegree),n}outboundDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new z(`Graph.outboundDegree: could not find the "${e}" node in the graph.`);let n=0;return this.type!==`directed`&&(n+=t.undirectedDegree),this.type!==`undirected`&&(n+=t.outDegree),n}degree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new z(`Graph.degree: could not find the "${e}" node in the graph.`);let n=0;return this.type!==`directed`&&(n+=t.undirectedDegree),this.type!==`undirected`&&(n+=t.inDegree+t.outDegree),n}inDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new z(`Graph.inDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.inDegree-t.directedLoops}outDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new z(`Graph.outDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.outDegree-t.directedLoops}directedDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new z(`Graph.directedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.inDegree+t.outDegree-t.directedLoops*2}undirectedDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new z(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type===`directed`?0:t.undirectedDegree-t.undirectedLoops*2}inboundDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new z(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,r=0;return this.type!==`directed`&&(n+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!==`undirected`&&(n+=t.inDegree,r+=t.directedLoops),n-r}outboundDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new z(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,r=0;return this.type!==`directed`&&(n+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!==`undirected`&&(n+=t.outDegree,r+=t.directedLoops),n-r}degreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new z(`Graph.degreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,r=0;return this.type!==`directed`&&(n+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!==`undirected`&&(n+=t.inDegree+t.outDegree,r+=t.directedLoops*2),n-r}source(e){e=``+e;let t=this._edges.get(e);if(!t)throw new z(`Graph.source: could not find the "${e}" edge in the graph.`);return t.source.key}target(e){e=``+e;let t=this._edges.get(e);if(!t)throw new z(`Graph.target: could not find the "${e}" edge in the graph.`);return t.target.key}extremities(e){e=``+e;let t=this._edges.get(e);if(!t)throw new z(`Graph.extremities: could not find the "${e}" edge in the graph.`);return[t.source.key,t.target.key]}opposite(e,t){e=``+e,t=``+t;let n=this._edges.get(t);if(!n)throw new z(`Graph.opposite: could not find the "${t}" edge in the graph.`);let r=n.source.key,i=n.target.key;if(e===r)return i;if(e===i)return r;throw new z(`Graph.opposite: the "${e}" node is not attached to the "${t}" edge (${r}, ${i}).`)}hasExtremity(e,t){e=``+e,t=``+t;let n=this._edges.get(e);if(!n)throw new z(`Graph.hasExtremity: could not find the "${e}" edge in the graph.`);return n.source.key===t||n.target.key===t}isUndirected(e){e=``+e;let t=this._edges.get(e);if(!t)throw new z(`Graph.isUndirected: could not find the "${e}" edge in the graph.`);return t.undirected}isDirected(e){e=``+e;let t=this._edges.get(e);if(!t)throw new z(`Graph.isDirected: could not find the "${e}" edge in the graph.`);return!t.undirected}isSelfLoop(e){e=``+e;let t=this._edges.get(e);if(!t)throw new z(`Graph.isSelfLoop: could not find the "${e}" edge in the graph.`);return t.source===t.target}addNode(e,t){return en(this,e,t).key}mergeNode(e,t){if(t&&!L(t))throw new R(`Graph.mergeNode: invalid attributes. Expecting an object but got "${t}"`);e=``+e,t||={};let n=this._nodes.get(e);return n?(t&&(I(n.attributes,t),this.emit(`nodeAttributesUpdated`,{type:`merge`,key:e,attributes:n.attributes,data:t})),[e,!1]):(n=new this.NodeDataClass(e,t),this._nodes.set(e,n),this.emit(`nodeAdded`,{key:e,attributes:t}),[e,!0])}updateNode(e,t){if(t&&typeof t!=`function`)throw new R(`Graph.updateNode: invalid updater function. Expecting a function but got "${t}"`);e=``+e;let n=this._nodes.get(e);if(n){if(t){let r=n.attributes;n.attributes=t(r),this.emit(`nodeAttributesUpdated`,{type:`replace`,key:e,attributes:n.attributes})}return[e,!1]}let r=t?t({}):{};return n=new this.NodeDataClass(e,r),this._nodes.set(e,n),this.emit(`nodeAdded`,{key:e,attributes:r}),[e,!0]}dropNode(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new z(`Graph.dropNode: could not find the "${e}" node in the graph.`);let n;if(this.type!==`undirected`){for(let e in t.out){n=t.out[e];do an(this,n),n=n.next;while(n)}for(let e in t.in){n=t.in[e];do an(this,n),n=n.next;while(n)}}if(this.type!==`directed`)for(let e in t.undirected){n=t.undirected[e];do an(this,n),n=n.next;while(n)}this._nodes.delete(e),this.emit(`nodeDropped`,{key:e,attributes:t.attributes})}dropEdge(e){let t;if(arguments.length>1){let e=``+arguments[0],n=``+arguments[1];if(t=Te(this,e,n,this.type),!t)throw new z(`Graph.dropEdge: could not find the "${e}" -> "${n}" edge in the graph.`)}else if(e=``+e,t=this._edges.get(e),!t)throw new z(`Graph.dropEdge: could not find the "${e}" edge in the graph.`);return an(this,t),this}dropDirectedEdge(e,t){if(arguments.length<2)throw new B(`Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.`);if(this.multi)throw new B(`Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.`);e=``+e,t=``+t;let n=Te(this,e,t,`directed`);if(!n)throw new z(`Graph.dropDirectedEdge: could not find a "${e}" -> "${t}" edge in the graph.`);return an(this,n),this}dropUndirectedEdge(e,t){if(arguments.length<2)throw new B(`Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.`);if(this.multi)throw new B(`Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.`);let n=Te(this,e,t,`undirected`);if(!n)throw new z(`Graph.dropUndirectedEdge: could not find a "${e}" -> "${t}" edge in the graph.`);return an(this,n),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit(`cleared`)}clearEdges(){let e=this._nodes.values(),t;for(;t=e.next(),t.done!==!0;)t.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit(`edgesCleared`)}getAttribute(e){return this._attributes[e]}getAttributes(){return this._attributes}hasAttribute(e){return this._attributes.hasOwnProperty(e)}setAttribute(e,t){return this._attributes[e]=t,this.emit(`attributesUpdated`,{type:`set`,attributes:this._attributes,name:e}),this}updateAttribute(e,t){if(typeof t!=`function`)throw new R(`Graph.updateAttribute: updater should be a function.`);let n=this._attributes[e];return this._attributes[e]=t(n),this.emit(`attributesUpdated`,{type:`set`,attributes:this._attributes,name:e}),this}removeAttribute(e){return delete this._attributes[e],this.emit(`attributesUpdated`,{type:`remove`,attributes:this._attributes,name:e}),this}replaceAttributes(e){if(!L(e))throw new R(`Graph.replaceAttributes: provided attributes are not a plain object.`);return this._attributes=e,this.emit(`attributesUpdated`,{type:`replace`,attributes:this._attributes}),this}mergeAttributes(e){if(!L(e))throw new R(`Graph.mergeAttributes: provided attributes are not a plain object.`);return I(this._attributes,e),this.emit(`attributesUpdated`,{type:`merge`,attributes:this._attributes,data:e}),this}updateAttributes(e){if(typeof e!=`function`)throw new R(`Graph.updateAttributes: provided updater is not a function.`);return this._attributes=e(this._attributes),this.emit(`attributesUpdated`,{type:`update`,attributes:this._attributes}),this}updateEachNodeAttributes(e,t){if(typeof e!=`function`)throw new R(`Graph.updateEachNodeAttributes: expecting an updater function.`);if(t&&!ke(t))throw new R(`Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}`);let n=this._nodes.values(),r,i;for(;r=n.next(),r.done!==!0;)i=r.value,i.attributes=e(i.key,i.attributes);this.emit(`eachNodeAttributesUpdated`,{hints:t||null})}updateEachEdgeAttributes(e,t){if(typeof e!=`function`)throw new R(`Graph.updateEachEdgeAttributes: expecting an updater function.`);if(t&&!ke(t))throw new R(`Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}`);let n=this._edges.values(),r,i,a,o;for(;r=n.next(),r.done!==!0;)i=r.value,a=i.source,o=i.target,i.attributes=e(i.key,i.attributes,a.key,o.key,a.attributes,o.attributes,i.undirected);this.emit(`eachEdgeAttributesUpdated`,{hints:t||null})}forEachAdjacencyEntry(e){if(typeof e!=`function`)throw new R(`Graph.forEachAdjacencyEntry: expecting a callback.`);Wt(!1,!1,!1,this,e)}forEachAdjacencyEntryWithOrphans(e){if(typeof e!=`function`)throw new R(`Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.`);Wt(!1,!1,!0,this,e)}forEachAssymetricAdjacencyEntry(e){if(typeof e!=`function`)throw new R(`Graph.forEachAssymetricAdjacencyEntry: expecting a callback.`);Wt(!1,!0,!1,this,e)}forEachAssymetricAdjacencyEntryWithOrphans(e){if(typeof e!=`function`)throw new R(`Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.`);Wt(!1,!0,!0,this,e)}nodes(){return Array.from(this._nodes.keys())}forEachNode(e){if(typeof e!=`function`)throw new R(`Graph.forEachNode: expecting a callback.`);let t=this._nodes.values(),n,r;for(;n=t.next(),n.done!==!0;)r=n.value,e(r.key,r.attributes)}findNode(e){if(typeof e!=`function`)throw new R(`Graph.findNode: expecting a callback.`);let t=this._nodes.values(),n,r;for(;n=t.next(),n.done!==!0;)if(r=n.value,e(r.key,r.attributes))return r.key}mapNodes(e){if(typeof e!=`function`)throw new R(`Graph.mapNode: expecting a callback.`);let t=this._nodes.values(),n,r,i=Array(this.order),a=0;for(;n=t.next(),n.done!==!0;)r=n.value,i[a++]=e(r.key,r.attributes);return i}someNode(e){if(typeof e!=`function`)throw new R(`Graph.someNode: expecting a callback.`);let t=this._nodes.values(),n,r;for(;n=t.next(),n.done!==!0;)if(r=n.value,e(r.key,r.attributes))return!0;return!1}everyNode(e){if(typeof e!=`function`)throw new R(`Graph.everyNode: expecting a callback.`);let t=this._nodes.values(),n,r;for(;n=t.next(),n.done!==!0;)if(r=n.value,!e(r.key,r.attributes))return!1;return!0}filterNodes(e){if(typeof e!=`function`)throw new R(`Graph.filterNodes: expecting a callback.`);let t=this._nodes.values(),n,r,i=[];for(;n=t.next(),n.done!==!0;)r=n.value,e(r.key,r.attributes)&&i.push(r.key);return i}reduceNodes(e,t){if(typeof e!=`function`)throw new R(`Graph.reduceNodes: expecting a callback.`);if(arguments.length<2)throw new R(`Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let n=t,r=this._nodes.values(),i,a;for(;i=r.next(),i.done!==!0;)a=i.value,n=e(n,a.key,a.attributes);return n}nodeEntries(){let e=this._nodes.values();return{[Symbol.iterator](){return this},next(){let t=e.next();if(t.done)return t;let n=t.value;return{value:{node:n.key,attributes:n.attributes},done:!1}}}}export(){let e=Array(this._nodes.size),t=0;this._nodes.forEach((n,r)=>{e[t++]=Gt(r,n)});let n=Array(this._edges.size);return t=0,this._edges.forEach((e,r)=>{n[t++]=Kt(this.type,r,e)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:e,edges:n}}import(t,n=!1){if(t instanceof e)return t.forEachNode((e,t)=>{n?this.mergeNode(e,t):this.addNode(e,t)}),t.forEachEdge((e,t,r,i,a,o,s)=>{n?s?this.mergeUndirectedEdgeWithKey(e,r,i,t):this.mergeDirectedEdgeWithKey(e,r,i,t):s?this.addUndirectedEdgeWithKey(e,r,i,t):this.addDirectedEdgeWithKey(e,r,i,t)}),this;if(!L(t))throw new R(`Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.`);if(t.attributes){if(!L(t.attributes))throw new R(`Graph.import: invalid attributes. Expecting a plain object.`);n?this.mergeAttributes(t.attributes):this.replaceAttributes(t.attributes)}let r,i,a,o,s;if(t.nodes){if(a=t.nodes,!Array.isArray(a))throw new R(`Graph.import: invalid nodes. Expecting an array.`);for(r=0,i=a.length;r<i;r++){o=a[r],qt(o);let{key:e,attributes:t}=o;n?this.mergeNode(e,t):this.addNode(e,t)}}if(t.edges){let e=!1;if(this.type===`undirected`&&(e=!0),a=t.edges,!Array.isArray(a))throw new R(`Graph.import: invalid edges. Expecting an array.`);for(r=0,i=a.length;r<i;r++){s=a[r],Jt(s);let{source:t,target:i,attributes:o,undirected:c=e}=s,l;`key`in s?(l=n?c?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:c?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey,l.call(this,s.key,t,i,o)):(l=n?c?this.mergeUndirectedEdge:this.mergeDirectedEdge:c?this.addUndirectedEdge:this.addDirectedEdge,l.call(this,t,i,o))}}return this}nullCopy(t){let n=new e(I({},this._options,t));return n.replaceAttributes(I({},this.getAttributes())),n}emptyCopy(e){let t=this.nullCopy(e);return this._nodes.forEach((e,n)=>{let r=I({},e.attributes);e=new t.NodeDataClass(n,r),t._nodes.set(n,e)}),t}copy(e){if(e||={},typeof e.type==`string`&&e.type!==this.type&&e.type!==`mixed`)throw new B(`Graph.copy: cannot create an incompatible copy from "${this.type}" type to "${e.type}" because this would mean losing information about the current graph.`);if(typeof e.multi==`boolean`&&e.multi!==this.multi&&e.multi!==!0)throw new B(`Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.`);if(typeof e.allowSelfLoops==`boolean`&&e.allowSelfLoops!==this.allowSelfLoops&&e.allowSelfLoops!==!0)throw new B(`Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.`);let t=this.emptyCopy(e),n=this._edges.values(),r,i;for(;r=n.next(),r.done!==!0;)i=r.value,nn(t,`copy`,!1,i.undirected,i.key,i.source.key,i.target.key,I({},i.attributes));return t}toJSON(){return this.export()}toString(){return`[object Graph]`}inspect(){let e={};this._nodes.forEach((t,n)=>{e[n]=t.attributes});let t={},n={};this._edges.forEach((e,r)=>{let i=e.undirected?`--`:`->`,a=``,o=e.source.key,s=e.target.key,c;e.undirected&&o>s&&(c=o,o=s,s=c);let l=`(${o})${i}(${s})`;r.startsWith(`geid_`)?this.multi&&(n[l]===void 0?n[l]=0:n[l]++,a+=`${n[l]}. `):a+=`[${r}]: `,a+=l,t[a]=e.attributes});let r={};for(let e in this)this.hasOwnProperty(e)&&!Zt.has(e)&&typeof this[e]!=`function`&&typeof e!=`symbol`&&(r[e]=this[e]);return r.attributes=this._attributes,r.nodes=e,r.edges=t,De(r,`constructor`,this.constructor),r}};typeof Symbol<`u`&&(V.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=V.prototype.inspect),Qt.forEach(e=>{[`add`,`merge`,`update`].forEach(t=>{let n=e.name(t),r=t===`add`?nn:rn;e.generateKey?V.prototype[n]=function(i,a,o){return r(this,n,!0,(e.type||this.type)===`undirected`,null,i,a,o,t===`update`)}:V.prototype[n]=function(i,a,o,s){return r(this,n,!1,(e.type||this.type)===`undirected`,i,a,o,s,t===`update`)}})}),$e(V),ut(V),jt(V),Ut(V);var on=class extends V{constructor(e){let t=I({type:`directed`},e);if(`multi`in t&&t.multi!==!1)throw new R(`DirectedGraph.from: inconsistent indication that the graph should be multi in given options!`);if(t.type!==`directed`)throw new R(`DirectedGraph.from: inconsistent "`+t.type+`" type in given options!`);super(t)}},sn=class extends V{constructor(e){let t=I({type:`undirected`},e);if(`multi`in t&&t.multi!==!1)throw new R(`UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!`);if(t.type!==`undirected`)throw new R(`UndirectedGraph.from: inconsistent "`+t.type+`" type in given options!`);super(t)}},cn=class extends V{constructor(e){let t=I({multi:!0},e);if(`multi`in t&&t.multi!==!0)throw new R(`MultiGraph.from: inconsistent indication that the graph should be simple in given options!`);super(t)}},ln=class extends V{constructor(e){let t=I({type:`directed`,multi:!0},e);if(`multi`in t&&t.multi!==!0)throw new R(`MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!`);if(t.type!==`directed`)throw new R(`MultiDirectedGraph.from: inconsistent "`+t.type+`" type in given options!`);super(t)}},un=class extends V{constructor(e){let t=I({type:`undirected`,multi:!0},e);if(`multi`in t&&t.multi!==!0)throw new R(`MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!`);if(t.type!==`undirected`)throw new R(`MultiUndirectedGraph.from: inconsistent "`+t.type+`" type in given options!`);super(t)}};function dn(e){e.from=function(t,n){let r=new e(I({},t.options,n));return r.import(t),r}}dn(V),dn(on),dn(sn),dn(cn),dn(ln),dn(un),V.Graph=V,V.DirectedGraph=on,V.UndirectedGraph=sn,V.MultiGraph=cn,V.MultiDirectedGraph=ln,V.MultiUndirectedGraph=un,V.InvalidArgumentsGraphError=R,V.NotFoundGraphError=z,V.UsageGraphError=B;var fn=n(((e,t)=>{t.exports=function(e){return typeof e==`object`&&!!e&&typeof e.addUndirectedEdgeWithKey==`function`&&typeof e.dropNode==`function`&&typeof e.multi==`boolean`}})),pn=n(((e,t)=>{var n=fn(),r=void 0,i=0,a=1;t.exports=function(e){if(!n(e))throw Error(`graphology-dag/has-cycle: the given graph is not a valid graphology instance.`);if(e.size===0)return!1;if(e.selfLoopCount!==0)return!0;let t={},o=[];function s(e){let n=t[e];if(n===r)o.push(e);else if(n===i)return!0;return!1}return e.someNode(n=>{if(t[n]===a)return!1;for(o.push(n);o.length!==0;){let n=o[o.length-1],r=t[n];if(r!==i){if(t[n]=i,e.someOutboundNeighbor(n,s))return!0}else r===i&&(o.pop(),t[n]=a)}return!1})}})),mn=n(((e,t)=>{var n=fn();t.exports=function(e,t,r){if(!n(e))throw Error(`graphology-dag/will-create-cycle: the given graph is not a valid graphology instance.`);if(t=``+t,r=``+r,t===r)return!0;if(!e.hasNode(t)||!e.hasNode(r)||e.hasDirectedEdge(t,r))return!1;if(e.hasDirectedEdge(r,t))return!0;let i=e.outNeighbors(r);function a(e){i.push(e)}for(;i.length!==0;){let n=i.pop();if(n===t)return!0;e.forEachOutNeighbor(n,a)}return!1}})),hn=n((e=>{e.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer<`u`,e.SYMBOL_SUPPORT=typeof Symbol<`u`})),gn=n(((e,t)=>{var n=hn(),r=n.ARRAY_BUFFER_SUPPORT,i=n.SYMBOL_SUPPORT;t.exports=function(e,t){var n,a,o,s,c;if(!e)throw Error(`obliterator/forEach: invalid iterable.`);if(typeof t!=`function`)throw Error(`obliterator/forEach: expecting a callback.`);if(Array.isArray(e)||r&&ArrayBuffer.isView(e)||typeof e==`string`||e.toString()===`[object Arguments]`){for(o=0,s=e.length;o<s;o++)t(e[o],o);return}if(typeof e.forEach==`function`){e.forEach(t);return}if(i&&Symbol.iterator in e&&typeof e.next!=`function`&&(e=e[Symbol.iterator]()),typeof e.next==`function`){for(n=e,o=0;c=n.next(),c.done!==!0;)t(c.value,o),o++;return}for(a in e)e.hasOwnProperty(a)&&t(e[a],a)}})),_n=n((e=>{var t=2**8-1,n=2**16-1,r=2**32-1,i=2**7-1,a=2**15-1,o=2**31-1;e.getPointerArray=function(e){var i=e-1;if(i<=t)return Uint8Array;if(i<=n)return Uint16Array;if(i<=r)return Uint32Array;throw Error(`mnemonist: Pointer Array of size > 4294967295 is not supported.`)},e.getSignedPointerArray=function(e){var t=e-1;return t<=i?Int8Array:t<=a?Int16Array:t<=o?Int32Array:Float64Array},e.getNumberType=function(e){return e===(e|0)?Math.sign(e)===-1?e<=127&&e>=-128?Int8Array:e<=32767&&e>=-32768?Int16Array:Int32Array:e<=255?Uint8Array:e<=65535?Uint16Array:Uint32Array:Float64Array};var s={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};e.getMinimalRepresentation=function(t,n){var r=null,i=0,a,o,c,l,u;for(l=0,u=t.length;l<u;l++)c=n?n(t[l]):t[l],o=e.getNumberType(c),a=s[o.name],a>i&&(i=a,r=o);return r},e.isTypedArray=function(e){return typeof ArrayBuffer<`u`&&ArrayBuffer.isView(e)},e.concat=function(){var e=0,t,n,r;for(t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var i=new arguments[0].constructor(e);for(t=0,n=0;t<r;t++)i.set(arguments[t],n),n+=arguments[t].length;return i},e.indices=function(t){for(var n=new(e.getPointerArray(t))(t),r=0;r<t;r++)n[r]=r;return n}})),vn=n((e=>{var t=gn(),n=_n();function r(e){return Array.isArray(e)||n.isTypedArray(e)}function i(e){if(typeof e.length==`number`)return e.length;if(typeof e.size==`number`)return e.size}function a(e){var n=i(e),r=typeof n==`number`?Array(n):[],a=0;return t(e,function(e){r[a++]=e}),r}function o(e){var r=i(e),a=typeof r==`number`?n.getPointerArray(r):Array,o=typeof r==`number`?Array(r):[],s=typeof r==`number`?new a(r):[],c=0;return t(e,function(e){o[c]=e,s[c]=c++}),[o,s]}e.isArrayLike=r,e.guessLength=i,e.toArray=a,e.toArrayWithIndices=o})),yn=n(((e,t)=>{function n(e){if(typeof e!=`function`)throw Error(`obliterator/iterator: expecting a function!`);this.next=e}typeof Symbol<`u`&&(n.prototype[Symbol.iterator]=function(){return this}),n.of=function(){var e=arguments,t=e.length,r=0;return new n(function(){return r>=t?{done:!0}:{done:!1,value:e[r++]}})},n.empty=function(){return new n(function(){return{done:!0}})},n.fromSequence=function(e){var t=0,r=e.length;return new n(function(){return t>=r?{done:!0}:{done:!1,value:e[t++]}})},n.is=function(e){return e instanceof n?!0:typeof e==`object`&&!!e&&typeof e.next==`function`},t.exports=n})),bn=n(((e,t)=>{var n=vn(),r=yn();function i(e,t){if(arguments.length<2)throw Error(`mnemonist/fixed-deque: expecting an Array class and a capacity.`);if(typeof t!=`number`||t<=0)throw Error("mnemonist/fixed-deque: `capacity` should be a positive number.");this.ArrayClass=e,this.capacity=t,this.items=new e(this.capacity),this.clear()}i.prototype.clear=function(){this.start=0,this.size=0},i.prototype.push=function(e){if(this.size===this.capacity)throw Error(`mnemonist/fixed-deque.push: deque capacity (`+this.capacity+`) exceeded!`);var t=this.start+this.size;return t>=this.capacity&&(t-=this.capacity),this.items[t]=e,++this.size},i.prototype.unshift=function(e){if(this.size===this.capacity)throw Error(`mnemonist/fixed-deque.unshift: deque capacity (`+this.capacity+`) exceeded!`);var t=this.start-1;return this.start===0&&(t=this.capacity-1),this.items[t]=e,this.start=t,++this.size},i.prototype.pop=function(){if(this.size!==0){this.size--;var e=this.start+this.size;return e>=this.capacity&&(e-=this.capacity),this.items[e]}},i.prototype.shift=function(){if(this.size!==0){var e=this.start;return this.size--,this.start++,this.start===this.capacity&&(this.start=0),this.items[e]}},i.prototype.peekFirst=function(){if(this.size!==0)return this.items[this.start]},i.prototype.peekLast=function(){if(this.size!==0){var e=this.start+this.size-1;return e>=this.capacity&&(e-=this.capacity),this.items[e]}},i.prototype.get=function(e){if(!(this.size===0||e>=this.capacity))return e=this.start+e,e>=this.capacity&&(e-=this.capacity),this.items[e]},i.prototype.forEach=function(e,t){t=arguments.length>1?t:this;for(var n=this.capacity,r=this.size,i=this.start,a=0;a<r;)e.call(t,this.items[i],a,this),i++,a++,i===n&&(i=0)},i.prototype.toArray=function(){var e=this.start+this.size;if(e<this.capacity)return this.items.slice(this.start,e);for(var t=new this.ArrayClass(this.size),n=this.capacity,r=this.size,i=this.start,a=0;a<r;)t[a]=this.items[i],i++,a++,i===n&&(i=0);return t},i.prototype.values=function(){var e=this.items,t=this.capacity,n=this.size,i=this.start,a=0;return new r(function(){if(a>=n)return{done:!0};var r=e[i];return i++,a++,i===t&&(i=0),{value:r,done:!1}})},i.prototype.entries=function(){var e=this.items,t=this.capacity,n=this.size,i=this.start,a=0;return new r(function(){if(a>=n)return{done:!0};var r=e[i];return i++,i===t&&(i=0),{value:[a++,r],done:!1}})},typeof Symbol<`u`&&(i.prototype[Symbol.iterator]=i.prototype.values),i.prototype.inspect=function(){var e=this.toArray();return e.type=this.ArrayClass.name,e.capacity=this.capacity,Object.defineProperty(e,`constructor`,{value:i,enumerable:!1}),e},typeof Symbol<`u`&&(i.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=i.prototype.inspect),i.from=function(e,t,r){if(arguments.length<3&&(r=n.guessLength(e),typeof r!=`number`))throw Error(`mnemonist/fixed-deque.from: could not guess iterable length. Please provide desired capacity as last argument.`);var a=new i(t,r);if(n.isArrayLike(e)){var o,s;for(o=0,s=e.length;o<s;o++)a.items[o]=e[o];return a.size=s,a}return n.forEach(e,function(e){a.push(e)}),a},t.exports=i})),xn=n((e=>{var t=fn(),n=bn();function r(e,t){let n=0;return e.forEachInNeighbor(t,()=>{n++}),n}function i(e,i){if(!t(e))throw Error(`graphology-dag/topological-sort: the given graph is not a valid graphology instance.`);if(e.type===`undirected`||e.undirectedSize!==0)throw Error(`graphology-dag/topological-sort: cannot work if graph is not directed.`);if(e.order===0)return;let a=new n(Array,e.order),o={},s=0;e.forEachNode((t,n)=>{let i=e.multi?r(e,t):e.inDegree(t);i===0?a.push([t,n,0]):(o[t]=i,s+=i)});let c=0;function l(e,t){let n=--o[e];s--,n===0&&a.push([e,t,c+1]),o[e]=n}for(;a.size!==0;){let[t,n,r]=a.shift();c=r,i(t,n,r),e.forEachOutNeighbor(t,l)}if(s!==0)throw Error(`graphology-dag/topological-sort: given graph is not acyclic.`)}function a(e){if(!t(e))throw Error(`graphology-dag/topological-sort: the given graph is not a valid graphology instance.`);let n=Array(e.order),r=0;return i(e,e=>{n[r++]=e}),n}function o(e,n){if(!t(e))throw Error(`graphology-dag/topological-generations: the given graph is not a valid graphology instance.`);if(e.order===0)return;let r=0,a=[];i(e,(e,t,i)=>{i>r&&(n(a),r=i,a=[]),a.push(e)}),n(a)}function s(e){if(!t(e))throw Error(`graphology-dag/topological-generations: the given graph is not a valid graphology instance.`);let n=[];return o(e,e=>{n.push(e)}),n}e.topologicalSort=a,e.forEachNodeInTopologicalOrder=i,e.topologicalGenerations=s,e.forEachTopologicalGeneration=o}));n((e=>{e.hasCycle=pn(),e.willCreateCycle=mn();var t=xn();e.forEachNodeInTopologicalOrder=t.forEachNodeInTopologicalOrder,e.topologicalSort=t.topologicalSort,e.topologicalGenerations=t.topologicalGenerations,e.forEachTopologicalGeneration=t.forEachTopologicalGeneration}))();function Sn(e,t){let n=e[t];if(typeof n==`number`&&Number.isFinite(n))return n;if(typeof n==`string`&&n.trim()!==``){let e=Number(n);if(Number.isFinite(e))return e}}function Cn(e,t){let n=e[t];if(typeof n==`string`&&n.trim()!==``)return n}function wn(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Tn(e){if(!wn(e))return{};let t=Sn(e,`bytes_processed`),n=Sn(e,`bytes_billed`),r=Sn(e,`slot_ms`),i=Sn(e,`rows_affected`),a=Cn(e,`code`),o=Cn(e,`_message`),s=Cn(e,`query_id`)??Cn(e,`job_id`),c=Cn(e,`project_id`),l=Cn(e,`location`);return{...t===void 0?{}:{bytesProcessed:t},...n===void 0?{}:{bytesBilled:n},...r===void 0?{}:{slotMs:r},...i===void 0?{}:{rowsAffected:i},...a===void 0?{}:{adapterCode:a},...o===void 0?{}:{adapterMessage:o},...s===void 0?{}:{queryId:s},...c===void 0?{}:{projectId:c},...l===void 0?{}:{location:l}}}function En(e,t){if(!wn(e))return{rawKeys:[]};let n=Object.keys(e).filter(e=>typeof e==`string`);return{...Tn(e),...t,rawKeys:n}}var Dn={name:`generic`,parse(e){return En(e,{})}},On={name:`athena`,parse(e){if(!wn(e))return{rawKeys:[]};let t=Sn(e,`data_scanned_in_bytes`);return En(e,{...t===void 0?{}:{bytesProcessed:t}})},canParse(e){return wn(e)?`data_scanned_in_bytes`in e:!1}},kn={name:`bigquery`,parse(e){if(!wn(e))return{rawKeys:[]};let t=Sn(e,`bytes_processed`),n=Sn(e,`bytes_billed`),r=Sn(e,`slot_ms`),i=Cn(e,`project_id`),a=Cn(e,`location`),o=Cn(e,`query_id`)??Cn(e,`job_id`);return En(e,{...t===void 0?{}:{bytesProcessed:t},...n===void 0?{}:{bytesBilled:n},...r===void 0?{}:{slotMs:r},...o===void 0?{}:{queryId:o},...i===void 0?{}:{projectId:i},...a===void 0?{}:{location:a}})},canParse(e){return wn(e)?`bytes_processed`in e||`bytes_billed`in e||`slot_ms`in e||`job_id`in e||`location`in e:!1}},An={name:`postgres`,parse(e){return En(e,{})}},jn={name:`redshift`,parse(e){return En(e,{})}},Mn={name:`snowflake`,parse(e){if(!wn(e))return{rawKeys:[]};let t=Sn(e,`rows_inserted`),n=Sn(e,`rows_deleted`),r=Sn(e,`rows_updated`),i=Sn(e,`rows_duplicates`);return En(e,{...t===void 0?{}:{rowsInserted:t},...n===void 0?{}:{rowsDeleted:n},...r===void 0?{}:{rowsUpdated:r},...i===void 0?{}:{rowsDuplicated:i}})},canParse(e){return wn(e)?`rows_inserted`in e||`rows_deleted`in e||`rows_updated`in e||`rows_duplicates`in e:!1}},Nn=new Map([[`athena`,On],[`bigquery`,kn],[`postgres`,An],[`redshift`,jn],[`snowflake`,Mn],[`spark`,{name:`spark`,parse(e){return En(e,{})}}]]),Pn=[kn,Mn,On];new class{selectParser(e,t){if(e&&typeof e==`string`){let n=e.toLowerCase().trim(),r=Nn.get(n);if(r&&(!r.canParse||r.canParse(t)))return r}for(let e of Pn)if(e.canParse&&e.canParse(t))return e;return Dn}};var Fn={query_id:e=>e.adapterMetrics?.queryId??``,adapter_code:e=>e.adapterMetrics?.adapterCode??``,adapter_message:e=>e.adapterMetrics?.adapterMessage??``,bytes_processed:e=>e.adapterMetrics?.bytesProcessed,bytes_billed:e=>e.adapterMetrics?.bytesBilled,slot_ms:e=>e.adapterMetrics?.slotMs,rows_affected:e=>e.adapterMetrics?.rowsAffected,project_id:e=>e.adapterMetrics?.projectId,location:e=>e.adapterMetrics?.location,rows_inserted:e=>e.adapterMetrics?.rowsInserted,rows_updated:e=>e.adapterMetrics?.rowsUpdated,rows_deleted:e=>e.adapterMetrics?.rowsDeleted,rows_duplicated:e=>e.adapterMetrics?.rowsDuplicated};function In(e,t){return Fn[t](e)}function Ln(e,t){let n=In(e,t);return typeof n==`number`&&Number.isFinite(n)?n:0}Object.fromEntries([`bytes_processed`,`bytes_billed`,`slot_ms`,`rows_affected`,`rows_inserted`,`rows_updated`,`rows_deleted`,`rows_duplicated`].map(e=>[`${e}_desc`,t=>Ln(t,e)]));var Rn=[{key:`queryId`,label:`Query ID`,shortLabel:`Query ID`,kind:`string`,humanSortKey:`query_id`},{key:`adapterCode`,label:`Adapter code`,shortLabel:`Code`,kind:`string`,humanSortKey:`adapter_code`},{key:`adapterMessage`,label:`Adapter message`,shortLabel:`Message`,kind:`string`,humanSortKey:`adapter_message`},{key:`bytesProcessed`,label:`Bytes processed`,shortLabel:`Bytes processed`,kind:`number`,humanSortKey:`bytes_processed`,summaryTotalKey:`totalBytesProcessed`},{key:`bytesBilled`,label:`Bytes billed`,shortLabel:`Bytes billed`,kind:`number`,humanSortKey:`bytes_billed`,summaryTotalKey:`totalBytesBilled`},{key:`slotMs`,label:`Slot ms`,shortLabel:`Slot ms`,kind:`number`,humanSortKey:`slot_ms`,summaryTotalKey:`totalSlotMs`},{key:`rowsAffected`,label:`Rows affected`,shortLabel:`Rows`,kind:`number`,humanSortKey:`rows_affected`,summaryTotalKey:`totalRowsAffected`},{key:`projectId`,label:`Project ID`,shortLabel:`Project`,kind:`string`,humanSortKey:`project_id`},{key:`location`,label:`Location`,shortLabel:`Location`,kind:`string`,humanSortKey:`location`},{key:`rowsInserted`,label:`Rows inserted`,shortLabel:`Inserted`,kind:`number`,humanSortKey:`rows_inserted`,summaryTotalKey:`totalRowsInserted`},{key:`rowsUpdated`,label:`Rows updated`,shortLabel:`Updated`,kind:`number`,humanSortKey:`rows_updated`,summaryTotalKey:`totalRowsUpdated`},{key:`rowsDeleted`,label:`Rows deleted`,shortLabel:`Deleted`,kind:`number`,humanSortKey:`rows_deleted`,summaryTotalKey:`totalRowsDeleted`},{key:`rowsDuplicated`,label:`Rows duplicated`,shortLabel:`Duplicated`,kind:`number`,humanSortKey:`rows_duplicated`,summaryTotalKey:`totalRowsDuplicated`}];function zn(e,t){if(e!=null)return e[t]}function Bn(e,t){return t===void 0?`—`:e.kind===`number`&&typeof t==`number`?t.toLocaleString(`en-US`):String(t)}function Vn(e){return Rn.filter(t=>e.some(e=>zn(e,t.key)!==void 0))}function Hn(e){return e==null?[]:Rn.filter(t=>t.summaryTotalKey==null?!1:e[t.summaryTotalKey]!==void 0)}var Un={bytes_processed:`bytesProcessed`,bytes_billed:`bytesBilled`,slot_ms:`slotMs`,rows_affected:`rowsAffected`,code:`adapterCode`,_message:`adapterMessage`,query_id:`queryId`,job_id:`queryId`,project_id:`projectId`,location:`location`,data_scanned_in_bytes:`bytesProcessed`,rows_inserted:`rowsInserted`,rows_deleted:`rowsDeleted`,rows_updated:`rowsUpdated`,rows_duplicated:`rowsDuplicated`,rows_duplicates:`rowsDuplicated`};function Wn(e,t){if(t==null)return!1;let n=e.key;if(n.includes(`.`))return!1;let r=Un[n];return r===void 0?!1:zn(t,r)!==void 0}function Gn(e,t){return t==null||t.length===0?[]:t.filter(t=>!Wn(t,e))}function Kn(e){return e.trim().toLowerCase()||`unknown`}function qn(e){let t=e.split(/\s+/).filter(Boolean),n=[],r,i,a,o;for(let e of t)e.startsWith(`type:`)?r=e.slice(5):e.startsWith(`package:`)?i=e.slice(8):e.startsWith(`tag:`)?a=e.slice(4):e.startsWith(`path:`)?o=e.slice(5):e.startsWith(`owner:`)||e.startsWith(`source:`)?n.push(e.slice(e.indexOf(`:`)+1)):n.push(e);return{terms:n,type:r,package:i,tag:a,path:o}}function Jn(e,t,n,r,i){if(e.resource_type===`field`||t&&!t.split(`,`).map(e=>e.trim().toLowerCase()).filter(Boolean).includes(e.resource_type.toLowerCase())||n&&(e.package_name||``)!==n)return!1;if(r){let t=r.split(`,`).map(e=>e.trim().toLowerCase()).filter(Boolean),n=(e.tags||[]).map(e=>e.toLowerCase());if(!t.some(e=>n.includes(e)))return!1}return!(i&&!(e.path||``).includes(i))}function Yn(e){return e?e.fail+e.error+e.warn+e.skipped>0:!1}var Xn={accent:`#635BFF`,text:`#171C28`,textSoft:`#6B7385`,bg:`#F6F7FB`,bgSoft:`#FFFFFF`,borderDefault:`#D7DCE7`,borderSubtle:`#E6E9F0`,slate:`#64748B`,rose:`#C0352B`,mint:`#0F8A4B`,amber:`#A56315`},Zn={accent:`#8A7CFF`,text:`#F3F6FC`,textSoft:`#98A3BC`,bg:`#0D1120`,bgSoft:`#151A2E`,borderDefault:`#313A58`,borderSubtle:`#262E47`,slate:`#8690AA`,rose:`#FF8D86`,mint:`#59D38C`,amber:`#F5B95C`};function Qn(e){return e===`dark`?Zn:Xn}var $n={success:Xn.mint,error:Xn.rose,skipped:Xn.slate,"run error":Xn.rose,pass:Xn.mint,fail:Xn.rose,warn:Xn.amber,"no op":Xn.slate},er={success:Zn.mint,error:Zn.rose,skipped:Zn.slate,"run error":Zn.rose,pass:Zn.mint,fail:Zn.rose,warn:Zn.amber,"no op":Zn.slate},tr=`#059669`,nr=`#45c49a`,rr=`rgba(100, 116, 139, 0.14)`,ir=`rgba(134, 144, 170, 0.2)`,ar=`rgba(5, 150, 105, 0.14)`,or=`rgba(69, 196, 154, 0.2)`,sr={model:`#1D4ED8`,test:`#64748B`,seed:`#635BFF`,snapshot:`#D97706`,source:tr,source_freshness:tr,exposure:`#EA580C`,metric:`#DB2777`,semantic_model:`#0891B2`,analysis:`#64748B`,unit_test:`#64748B`},cr={model:`#5c8deb`,test:`#8690aa`,seed:`#9588e8`,snapshot:`#d4a24a`,source:nr,source_freshness:nr,exposure:`#d9845c`,metric:`#d172ae`,semantic_model:`#3eb0c8`,analysis:`#8690aa`,unit_test:`#8690aa`},lr={model:`rgba(29, 78, 216, 0.14)`,test:rr,seed:`rgba(99, 91, 255, 0.14)`,snapshot:`rgba(217, 119, 6, 0.14)`,source:ar,source_freshness:ar,semantic_model:`rgba(8, 145, 178, 0.14)`,metric:`rgba(219, 39, 119, 0.14)`,exposure:`rgba(234, 88, 12, 0.14)`,analysis:rr,unit_test:rr},ur={model:`rgba(92, 141, 235, 0.22)`,test:ir,seed:`rgba(149, 136, 232, 0.22)`,snapshot:`rgba(212, 162, 74, 0.22)`,source:or,source_freshness:or,semantic_model:`rgba(62, 176, 200, 0.22)`,metric:`rgba(209, 114, 174, 0.22)`,exposure:`rgba(217, 132, 92, 0.22)`,analysis:ir,unit_test:ir};function dr(e){return e===`dark`?cr:sr}function fr(e){return e===`dark`?ur:lr}function pr(e,t){let n=fr(t);return e&&n[e]?n[e]:t===`dark`?ir:rr}var mr={rowStripe:`#F1F3F8`,rowStripeHover:`#EEF0FF`,labelText:Xn.text,metaText:Xn.textSoft,axisTick:Xn.slate,gridLine:`#E6E9F0`,barHoverStroke:Xn.accent,testFailStripe:`rgba(192, 53, 43, 0.9)`,testSkipStripe:`rgba(165, 99, 21, 0.88)`,hullStroke:`#C8CEDB`,hullFill:`rgba(230, 233, 240, 0.35)`},hr={rowStripe:`#101527`,rowStripeHover:`#232845`,labelText:Zn.text,metaText:Zn.textSoft,axisTick:Zn.slate,gridLine:`#262E47`,barHoverStroke:Zn.accent,testFailStripe:`rgba(255, 141, 134, 0.88)`,testSkipStripe:`rgba(245, 185, 92, 0.88)`,hullStroke:`#2E3759`,hullFill:`rgba(38, 46, 71, 0.4)`};function gr(e){return e===`dark`?hr:mr}function _r(e){let t=Qn(e);return{positive:t.mint,warning:t.amber,danger:t.rose,neutral:t.slate,skipped:t.accent}}var vr=`workspace-pill workspace-pill--active`,yr=`workspace-pill`,br=[{key:`model`,label:`Models`},{key:`source`,label:`Sources`},{key:`tests`,label:`Tests`},{key:`snapshot`,label:`Snapshots`},{key:`metric`,label:`Metrics`},{key:`semantic_model`,label:`Semantic models`}],xr=new Set([`model`,`seed`,`snapshot`,`source`,`source_freshness`,`test`,`unit_test`,`metric`,`semantic_model`]),H=new Set([`test`,`unit_test`]),Sr=[...xr].filter(e=>!H.has(e)).sort((e,t)=>e.localeCompare(t)),Cr=new Set([`model`,`seed`,`snapshot`,`source`]),wr={project:`Project`,database:`Database`};function Tr(e){return e.statusTone===`danger`&&!H.has(e.resourceType)&&e.resourceType!==`operation`&&e.resourceType!==`sql_operation`}function Er(e){return typeof e!=`number`||Number.isNaN(e)?`n/a`:e>=60?`${Math.floor(e/60)}m ${(e%60).toFixed(2).padStart(5,`0`)}s`:e>=10?`${e.toFixed(1)}s`:`${e.toFixed(2)}s`}function Dr(e){return e.split(`_`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function Or(e,t){let n=``;for(;t<e.length;){if(e[t]===`"`){if(e[t+1]===`"`){n+=`"`,t+=2;continue}t+=1;break}n+=e[t],t+=1}return{segment:n,next:t}}function kr(e){let t=[],n=0,r=e;for(;n<r.length;){if(r[n]===`.`){n+=1;continue}if(r[n]===`"`){let{segment:e,next:i}=Or(r,n+1);t.push(e),n=i}else{let e=n;for(;n<r.length&&r[n]!==`.`;)n+=1;t.push(r.slice(e,n))}}return t.join(`.`)}function Ar(e){return new Date(e).toLocaleString(`en-US`,{dateStyle:`medium`,timeStyle:`short`})}function jr(e){return e.runStartedAt}function Mr(e){return`tone-badge tone-badge--${e}`}function Nr(e){return Pr(e.originalFilePath??e.patchPath??e.path)}function Pr(e){if(!e)return null;let t=e.includes(`://`)?e.split(`://`)[1]??null:e;if(!t)return null;let n=t.split(`/`).map(e=>e.trim()).filter(Boolean).join(`/`);return n.length>0?n:null}function Fr(e,t){if(!t)return!0;let n=t.trim().toLowerCase();if(!n)return!0;let r=qn(n);if(!Jn({unique_id:e.uniqueId,resource_type:e.resourceType,name:e.name,package_name:e.packageName,tags:e.tags,path:e.path??``},r.type,r.package,r.tag,r.path))return!1;let i=[e.name,e.resourceType,e.packageName,...e.tags??[],e.path??``,e.originalFilePath??``,e.patchPath??``,e.uniqueId].map(e=>e.toLowerCase());return r.terms.every(e=>i.some(t=>t.includes(e.toLowerCase())))}function Ir(e,t,n){return t===`all`?!0:t===`issues`?e.statusTone===`danger`?!0:Yn(n?.get(e.uniqueId)):e.statusTone===t}function Lr(e,t){return t.size===0||t.has(e.resourceType)}function Rr(e,t){if(t.size===0)return!0;let n=e.semantics?.materialization??`unknown`;return t.has(n)}function zr(e,t){if(!t)return!0;let n=t.trim().toLowerCase();if(!n)return!0;let r=e.semantics,i=r?[r.materialization,r.rawMaterialization??``,r.incrementalStrategy??``,r.relationName??``]:[];return[e.name,e.resourceType,e.packageName,e.path??``,e.uniqueId,e.status,e.threadId??``,...i].some(e=>e.toLowerCase().includes(n))}function Br(e,t){return t===`all`?!0:t===`issues`?e.statusTone===`danger`||e.statusTone===`warning`:e.statusTone===t}function Vr(e){if(e.length===0)return null;let t={};for(let n of e)n.packageName&&(t[n.packageName]=(t[n.packageName]??0)+1);return Object.entries(t).sort((e,t)=>t[1]-e[1])[0]?.[0]??null}function Hr(e,t){return t!=null&&e.packageName===t}function Ur({name:e,packageName:t,path:n}){let r=e.toLowerCase(),i=t.toLowerCase(),a=(n??``).toLowerCase();return new Set([`dbt_artifacts_hashes`,`dbt_columns`,`dbt_exposures`,`dbt_groups`,`dbt_invocations`,`dbt_metrics`,`dbt_models`,`dbt_run_results`,`dbt_seeds`,`dbt_snapshots`,`dbt_source_freshness_results`,`dbt_sources`,`dbt_tests`,`elementary_test_results`,`job_run_results`,`locations`,`metadata`,`metricflow_time_spine`,`model_run_results`,`schema_columns_snapshot`,`seed_run_results`,`snapshot_run_results`,`test_result_rows`]).has(r)||r.startsWith(`dbt_`)||r.startsWith(`alerts_dbt_`)||a.includes(`/edr/`)||a.includes(`/dbt_artifacts/`)||a.includes(`/run_results/`)||a.includes(`/manifest/`)||a.includes(`/catalog/`)||i===`elementary`&&(r.includes(`dbt_`)||a.includes(`/edr/dbt_artifacts/`))}function Wr(e){return new Set(e.filter(e=>e!==`macro`&&e!==`test`&&e!==`unit_test`))}function Gr(e,t){return!xr.has(e.resourceType)||H.has(e.resourceType)||Ur(e)?!1:t==null?!0:e.packageName===t}function Kr(e){return e.some(e=>e.compileStart!=null&&e.compileEnd!=null&&e.compileEnd>e.compileStart&&e.executeStart!=null&&e.executeEnd!=null&&e.executeEnd>e.executeStart)}function qr(e,t){let n=0;for(let r of e)H.has(r.resourceType??``)&&(Ur(r)||t!=null&&r.packageName!==t||n++);return n}function Jr(e,t,n){return e.filter(e=>n&&!Br(e,t.status)||t.resourceTypes.size>0&&!t.resourceTypes.has(e.resourceType)?!1:zr(e,t.query))}function Yr(e,t){let n=t?.denominatorTotal??e.length,r=new Map;for(let t of e){let e=r.get(t.status)??{count:0,duration:0,tone:t.statusTone};e.count+=1,e.duration+=t.executionTime,r.set(t.status,e)}return[...r.entries()].map(([e,t])=>({status:e,count:t.count,duration:t.duration,share:n>0?t.count/n:0,tone:t.tone})).sort((e,t)=>t.count-e.count)}function Xr(e,t){let n=new Map;for(let e of t)n.set(e.resourceType,(n.get(e.resourceType)??0)+1);let r=new Map;for(let t of e){let e=r.get(t.resourceType)??[];e.push(t),r.set(t.resourceType,e)}return[...r.entries()].map(([e,t])=>{let r=n.get(e)??0;return{resourceType:e,count:t.length,duration:t.reduce((e,t)=>e+t.executionTime,0),rowDenominatorCount:r,statusBreakdown:Yr(t,{denominatorTotal:r})}}).sort((e,t)=>t.count-e.count)}function Zr(e){let t=new Map;for(let n of e){let e=n.threadId??`unknown`,r=t.get(e)??{count:0,totalExecutionTime:0};r.count+=1,r.totalExecutionTime+=n.executionTime,t.set(e,r)}return[...t.entries()].map(([e,t])=>({threadId:e,count:t.count,totalExecutionTime:t.totalExecutionTime})).sort((e,t)=>t.totalExecutionTime-e.totalExecutionTime)}function Qr(e,t){let n=Jr(e.executions,t,!0),r=Jr(e.executions,t,!1),i=n.filter(e=>H.has(e.resourceType)),a=Zr(n);return{filteredExecutions:n,baselineExecutionsForBreakdown:r,filteredStatusBreakdown:Yr(n),filteredThreadStats:a,filteredTypes:Array.from(new Set(n.map(e=>e.resourceType))).sort(),failingNodes:n.filter(e=>e.statusTone===`danger`).length,warningNodes:n.filter(e=>e.statusTone===`warning`).length,failedModels:n.filter(Tr).length,passingTests:i.filter(e=>e.statusTone===`positive`).length,failingTests:i.filter(e=>e.statusTone===`danger`).length,threadCount:a.filter(e=>e.threadId!==`unknown`).length,filteredExecutionTime:n.reduce((e,t)=>e+t.executionTime,0),topFailures:n.filter(e=>e.statusTone===`danger`).slice(0,3),topBottlenecks:[...n].sort((e,t)=>t.executionTime-e.executionTime).slice(0,3)}}function $r({icon:e,headline:t,subtext:n}){return(0,u.jsxs)(`div`,{className:`empty-state-block`,children:[e!==void 0&&(0,u.jsx)(`span`,{className:`empty-state-block__icon`,"aria-hidden":`true`,children:e}),(0,u.jsx)(`strong`,{className:`empty-state-block__headline`,children:t}),n&&(0,u.jsx)(`p`,{className:`empty-state-block__subtext`,children:n})]})}function ei({label:e}){return(0,u.jsx)(`span`,{className:`overview-scope-badge`,children:e})}function ti({derived:e,title:t=`Bottlenecks`,subtitle:n=`Longest-running nodes in the filtered execution slice.`,embedded:r=!1}){let i=e.topBottlenecks;return(0,u.jsxs)(`section`,{className:`overview-module overview-module--bottlenecks${r?` overview-module--embedded`:``}`,children:[!r&&(0,u.jsxs)(`div`,{className:`overview-module__header`,children:[(0,u.jsx)(`h3`,{children:t}),(0,u.jsx)(`p`,{children:n})]}),i.length>0?(0,u.jsx)(`div`,{className:`action-list`,children:i.map((t,n)=>(0,u.jsxs)(`div`,{className:`action-list__row`,children:[(0,u.jsxs)(`div`,{className:`action-list__body`,children:[(0,u.jsx)(`strong`,{children:`${n+1}. ${t.name}`}),(0,u.jsx)(`span`,{children:`${(t.executionTime/Math.max(e.filteredExecutionTime,1e-4)*100).toFixed(1)}% of filtered run`})]}),(0,u.jsx)(`div`,{className:`action-list__metric`,children:(0,u.jsx)(`strong`,{children:Er(t.executionTime)})})]},t.uniqueId))}):(0,u.jsx)($r,{icon:`⚡`,headline:`No matching bottlenecks`,subtext:`No executions match the current dashboard filters.`})]})}function ni({analysis:e,filtered:t}){let n=e.summary.critical_path?.path.length??0;return(0,u.jsxs)(`section`,{className:`overview-module overview-module--critical`,children:[(0,u.jsxs)(`div`,{className:`overview-module__header`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`h3`,{children:`Critical path`}),(0,u.jsx)(`p`,{children:`Dependency pressure and scheduling risk.`})]}),t&&(0,u.jsx)(ei,{label:`Workspace-wide`})]}),(0,u.jsxs)(`div`,{className:`critical-path-card`,children:[(0,u.jsxs)(`div`,{className:`critical-path-card__headline`,children:[(0,u.jsxs)(`strong`,{children:[n,` nodes`]}),(0,u.jsx)(`span`,{children:e.graphSummary.hasCycles?`Cycles detected in the dependency graph.`:`No cycles detected in the dependency graph.`})]}),(0,u.jsxs)(`div`,{className:`critical-path-card__detail`,children:[(0,u.jsx)(`span`,{children:`Graph edges`}),(0,u.jsx)(`strong`,{children:e.graphSummary.totalEdges})]})]})]})}function ri({analysis:e,filtered:t}){let n=e.resources.filter(e=>!!e.description?.trim()).length,r=e.resources.length>0?Math.round(n/e.resources.length*100):0,i=Math.max(e.resources.length-n,0),a=e.resources.filter(e=>e.resourceType===`model`).length;return(0,u.jsxs)(`section`,{className:`overview-module overview-module--coverage`,children:[(0,u.jsxs)(`div`,{className:`overview-module__header`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`h3`,{children:`Coverage`}),(0,u.jsx)(`p`,{children:`Structural health of metadata and discovery quality.`})]}),t&&(0,u.jsx)(ei,{label:`Workspace-wide`})]}),(0,u.jsxs)(`div`,{className:`coverage-card`,children:[(0,u.jsxs)(`div`,{className:`coverage-card__headline`,children:[(0,u.jsxs)(`strong`,{children:[r,`%`]}),(0,u.jsx)(`span`,{children:`Metadata coverage`})]}),(0,u.jsxs)(`div`,{className:`coverage-card__stats`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`span`,{children:`Documented`}),(0,u.jsxs)(`strong`,{children:[n,` / `,e.resources.length]})]}),(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`span`,{children:`Missing descriptions`}),(0,u.jsx)(`strong`,{children:i})]})]}),(0,u.jsx)(`p`,{children:a>0?`Next improvement: document core models first to improve catalog-style discovery.`:`Add descriptions to core resources to improve catalog-style discovery.`})]})]})}var ii=`data-theme`,ai=`dark`,oi=`light`,si=`system`;function ci(e){if(e===ai)return ai;if(e===oi)return oi;try{return window.matchMedia(`(prefers-color-scheme: dark)`).matches?ai:oi}catch{return oi}}function li(){return typeof document>`u`?`light`:document.documentElement.getAttribute(ii)===ai?ai:`light`}function ui(e){e(li());let t=new MutationObserver(()=>e(li()));return t.observe(document.documentElement,{attributes:!0,attributeFilter:[ii]}),()=>t.disconnect()}function di(){let[e,t]=(0,c.useState)(()=>li());return(0,c.useEffect)(()=>(t(li()),ui(t)),[]),e}function fi(){let[e,t]=(0,c.useState)(()=>{try{let e=window.localStorage.getItem(`dbt-tools.theme`);if(e===oi||e===ai||e===si)return e}catch{}return si}),[n,r]=(0,c.useState)(()=>ci(e));return(0,c.useEffect)(()=>{r(ci(e));try{window.localStorage.setItem(`dbt-tools.theme`,e)}catch{}},[e]),(0,c.useEffect)(()=>{document.documentElement.setAttribute(ii,n)},[n]),{theme:n,themePreference:e,setThemePreference:t,toggleTheme:()=>t(e=>e===oi?ai:e===ai?oi:ai)}}var pi=.08;function mi(e){return[...e].sort((e,t)=>t.count-e.count)}var hi=.999999999999,gi=5e-4;function _i(e,t=pi){return e>=t}function vi(e){if(e>=hi)return`100%`;let t=e*100;if(e<gi)return`<0.1%`;let n=Math.round(t);if(n===100){let e=t.toFixed(1);return Number.parseFloat(e)>=100&&(e=t.toFixed(2)),`${e}%`}if(n===0&&e>0)return t<.1?`<0.1%`:`${t.toFixed(1)}%`;if(Math.abs(t-n)<1e-9)return`${n}%`;let r=t.toFixed(1);return Number.parseFloat(r)>=100&&e<hi&&(r=t.toFixed(2)),`${r}%`}function yi({title:e,subtitle:t,headerRight:n,children:r}){return(0,u.jsxs)(`section`,{className:`workspace-card`,children:[(0,u.jsxs)(`div`,{className:`workspace-card__header`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`h3`,{children:e}),t&&(0,u.jsx)(`p`,{children:t})]}),n]}),r]})}function bi({resourceType:e}){return(0,u.jsxs)(`span`,{className:`resource-type-badge`,children:[(0,u.jsx)(xi,{resourceType:e}),Dr(e)]})}function xi({resourceType:e}){switch(e){case`model`:return(0,u.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:[(0,u.jsx)(`path`,{d:`m8 2.2 4.8 2.7L8 7.6 3.2 4.9 8 2.2Z`}),(0,u.jsx)(`path`,{d:`m3.2 5 4.8 2.6L12.8 5M3.2 8l4.8 2.7 4.8-2.7M3.2 11l4.8 2.8 4.8-2.8`})]});case`source`:return(0,u.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:[(0,u.jsx)(`ellipse`,{cx:`8`,cy:`4`,rx:`4.6`,ry:`1.8`}),(0,u.jsx)(`path`,{d:`M3.4 4v5.3C3.4 10.7 5.5 12 8 12s4.6-1.3 4.6-2.7V4`}),(0,u.jsx)(`path`,{d:`M3.4 6.7C3.4 8 5.5 9.3 8 9.3s4.6-1.3 4.6-2.6`})]});case`test`:case`unit_test`:return(0,u.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:[(0,u.jsx)(`path`,{d:`M8 2.2 12.6 4v3.8c0 2.6-1.7 5-4.6 5.8-2.9-.8-4.6-3.2-4.6-5.8V4L8 2.2Z`}),(0,u.jsx)(`path`,{d:`m5.6 7.9 1.5 1.5 3.3-3.3`})]});case`metric`:return(0,u.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:[(0,u.jsx)(`path`,{d:`M2.5 11.8h11`}),(0,u.jsx)(`path`,{d:`M4.2 10.8V8.1M8 10.8V5.2m3.8 5.6V3.6`})]});case`semantic_model`:return(0,u.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:[(0,u.jsx)(`rect`,{x:`2.4`,y:`3`,width:`4.2`,height:`4.2`,rx:`1`}),(0,u.jsx)(`rect`,{x:`9.4`,y:`3`,width:`4.2`,height:`4.2`,rx:`1`}),(0,u.jsx)(`rect`,{x:`5.9`,y:`9`,width:`4.2`,height:`4.2`,rx:`1`}),(0,u.jsx)(`path`,{d:`M6.6 5.1h2.8M8 7.2V9`})]});case`macro`:return(0,u.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:[(0,u.jsx)(`path`,{d:`M5.2 3.3H3.4v9.4h1.8M10.8 3.3h1.8v9.4h-1.8`}),(0,u.jsx)(`path`,{d:`m9.6 5.1-3.2 5.8`})]});case`operation`:case`sql_operation`:return(0,u.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:(0,u.jsx)(`path`,{d:`M9.8 2.9a3.2 3.2 0 1 1-1.1 6.2L4 13.8 2.2 12l4.7-4.7a3.2 3.2 0 0 1 2.9-4.4Z`})});default:return(0,u.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:[(0,u.jsx)(`path`,{d:`M4.3 2.8h5l2.4 2.4v7.9H4.3z`}),(0,u.jsx)(`path`,{d:`M9.3 2.8v2.4h2.4`}),(0,u.jsx)(`path`,{d:`M5.8 8h4.4M5.8 10.2h4.4`})]})}}function Si({mode:e,depth:t}){return e===`database`&&t===0?(0,u.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:[(0,u.jsx)(`ellipse`,{cx:`8`,cy:`4`,rx:`4.6`,ry:`1.8`}),(0,u.jsx)(`path`,{d:`M3.4 4v4.6C3.4 10 5.5 11.2 8 11.2s4.6-1.2 4.6-2.6V4`}),(0,u.jsx)(`path`,{d:`M3.4 6.4C3.4 7.8 5.5 9 8 9s4.6-1.2 4.6-2.6`})]}):(0,u.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:(0,u.jsx)(`path`,{d:`M2.5 4.3h4.1l1.2 1.5H13a.9.9 0 0 1 .9.9v5a.9.9 0 0 1-.9.9H3a.9.9 0 0 1-.9-.9V5.2a.9.9 0 0 1 .4-.9Z`})})}function Ci({title:e,description:t,toolbar:n,leadingPane:r,children:i,inspector:a,className:o=``,suppressHeader:s=!1}){return(0,u.jsxs)(`div`,{className:`workspace-view workspace-scaffold ${o}`.trim(),children:[s?null:(0,u.jsx)(`div`,{className:`lens-header`,children:(0,u.jsxs)(`div`,{className:`lens-header__title`,children:[(0,u.jsx)(`p`,{className:`eyebrow`,children:`Workspace lens`}),(0,u.jsx)(`h2`,{children:e}),(0,u.jsx)(`p`,{className:`lens-header__desc`,children:t})]})}),n?(0,u.jsx)(`div`,{className:`workspace-scaffold__toolbar`,children:n}):null,(0,u.jsxs)(`div`,{className:`workspace-scaffold__body${r?` workspace-scaffold__body--with-leading`:``}${a?` workspace-scaffold__body--with-inspector`:``}`,children:[r?(0,u.jsx)(`aside`,{className:`workspace-scaffold__leading`,children:r}):null,(0,u.jsx)(`div`,{className:`workspace-scaffold__main`,children:i}),a?(0,u.jsx)(`aside`,{className:`workspace-scaffold__inspector`,children:a}):null]})]})}function wi({actions:e}){return(0,u.jsx)(`div`,{className:`entity-inspector__actions`,children:e.map(e=>(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:e.onClick,disabled:e.disabled,children:e.label},e.label))})}function Ti({eyebrow:e,title:t,typeLabel:n,status:r,stats:i,sections:a,actions:o,emptyMessage:s}){return t?(0,u.jsxs)(`aside`,{className:`entity-inspector`,children:[e?(0,u.jsx)(`p`,{className:`eyebrow`,children:e}):null,(0,u.jsxs)(`div`,{className:`entity-inspector__header`,children:[n?(0,u.jsx)(`span`,{className:`entity-inspector__type-badge`,children:n}):null,r]}),(0,u.jsx)(`div`,{className:`entity-inspector__name`,children:(0,u.jsx)(`strong`,{children:t})}),i&&i.length>0?(0,u.jsx)(`dl`,{className:`entity-inspector__stats`,children:i.map(e=>(0,u.jsxs)(`div`,{className:`entity-inspector__stat`,children:[(0,u.jsx)(`dt`,{children:e.label}),(0,u.jsx)(`dd`,{children:e.value})]},e.label))}):null,a?.map(e=>(0,u.jsxs)(`div`,{className:`entity-inspector__section`,children:[(0,u.jsx)(`p`,{className:`entity-inspector__section-label`,children:e.label}),(0,u.jsx)(`div`,{className:`entity-inspector__mono`,children:e.value})]},e.label)),o&&o.length>0?(0,u.jsx)(wi,{actions:o}):null]}):(0,u.jsx)(`aside`,{className:`entity-inspector entity-inspector--empty`,children:(0,u.jsx)(`p`,{className:`entity-inspector__placeholder`,children:s??`Select an item to inspect`})})}function Ei({group:e,statusColors:t}){let n=(0,c.useId)(),r=e.statusBreakdown.filter(e=>e.count>0),i=r.length>0?mi(r):[],a=Dr(e.resourceType);return(0,u.jsxs)(`div`,{className:`exec-type-bar-row`,children:[(0,u.jsx)(`div`,{className:`exec-type-bar-row__label`,id:n,title:a,children:a}),(0,u.jsxs)(`div`,{className:`exec-type-bar-row__bars`,children:[(0,u.jsx)(`div`,{className:`exec-type-bar-track`,role:`group`,"aria-labelledby":n,children:r.map(n=>{let r=_i(n.share),i=vi(n.share),a=`${n.status}: ${n.count} runs (${i}) of ${e.rowDenominatorCount}`;return(0,u.jsx)(`div`,{className:n.share<.08?`exec-type-bar-segment exec-type-bar-segment--minor`:`exec-type-bar-segment`,style:{flex:`${n.count} 1 0%`,backgroundColor:t[n.tone]},title:a,"aria-label":a,children:r?(0,u.jsxs)(`span`,{className:`exec-type-bar-segment__inner`,children:[i,` (`,n.count,`)`]}):null},`${e.resourceType}-${n.status}`)})}),r.length>0?(0,u.jsx)(`ul`,{className:`exec-type-bar-row__breakdown`,"aria-label":`${a} status breakdown`,children:i.map(n=>{let r=vi(n.share);return(0,u.jsxs)(`li`,{className:`exec-type-bar-row__breakdown-item`,children:[(0,u.jsx)(`span`,{className:`legend-row__swatch`,style:{background:t[n.tone]},"aria-hidden":!0}),(0,u.jsx)(`span`,{className:`exec-type-bar-row__breakdown-label`,children:n.status}),(0,u.jsxs)(`span`,{className:`exec-type-bar-row__breakdown-metric`,children:[n.count,` · `,r]})]},`${e.resourceType}-${n.status}-breakdown`)})}):null]})]})}function Di({executions:e,executionsForShareDenominator:t}){let n=di(),r=(0,c.useMemo)(()=>_r(n),[n]),i=(0,c.useMemo)(()=>Xr(e,t),[e,t]);return i.length===0?(0,u.jsx)(`div`,{className:`empty-state`,children:`No execution data.`}):(0,u.jsx)(`div`,{className:`exec-type-bar-stack`,"data-testid":`exec-type-bar-stack`,children:i.map(e=>(0,u.jsx)(Ei,{group:e,statusColors:r},e.resourceType))})}function Oi({executions:e,executionsForShareDenominator:t}){return(0,u.jsx)(Di,{executions:e,executionsForShareDenominator:t})}function ki({graphSummary:e}){let t=Object.entries(e.nodesByType).sort((e,t)=>t[1]-e[1]);return t.length===0?(0,u.jsx)(`div`,{className:`empty-state`,children:`No node-type breakdown available.`}):(0,u.jsx)(`div`,{className:`rank-list`,children:t.map(([t,n])=>(0,u.jsxs)(`div`,{className:`rank-list__row`,children:[(0,u.jsx)(`div`,{className:`rank-list__body`,children:(0,u.jsx)(`strong`,{children:t})}),(0,u.jsxs)(`div`,{className:`rank-list__metric`,children:[(0,u.jsx)(`strong`,{children:n}),(0,u.jsx)(`span`,{children:e.totalNodes>0?`${(n/e.totalNodes*100).toFixed(0)}% of graph`:``})]})]},t))})}var Ai=[{value:`resources`,label:`Resources`},{value:`totalTime`,label:`Total time`},{value:`avgTime`,label:`Avg time`}];function ji(e,t){switch(t){case`resources`:return e.count;case`totalTime`:return e.totalExecutionTime;case`avgTime`:return e.count>0?e.totalExecutionTime/e.count:0}}function Mi(e,t){let n=ji(e,t);return t===`resources`?n.toLocaleString():Er(n)}function Ni(e,t){let n=0;for(let r of e){let e=ji(r,t);e>n&&(n=e)}return n}function Pi(e){return e===`unknown`}function Fi(e,t){return[...e].sort((e,n)=>{let r=ji(e,t),i=ji(n,t);if(i!==r)return i-r;let a=Pi(e.threadId);return a===Pi(n.threadId)?e.threadId.localeCompare(n.threadId):a?1:-1})}var Ii=12;function Li(e){let t=e.length,n=t>Ii;return{rows:n?e.slice(0,Ii):e,totalLanes:t,isTruncated:n}}function Ri(e,t,n){let r=Mi(e,t);return t===`resources`?`${e.threadId}: ${r} runs (${n}% of slice)`:t===`avgTime`?`${e.threadId}: ${r} (${e.count.toLocaleString()} runs)`:`${e.threadId}: ${r}`}function zi({derived:e}){let[t,n]=(0,c.useState)(`totalTime`),r=(0,c.useMemo)(()=>e.filteredThreadStats.reduce((e,t)=>e+t.count,0),[e.filteredThreadStats]),{displayRows:i,maxVal:a,isTruncated:o,totalLanes:s}=(0,c.useMemo)(()=>{let{rows:n,totalLanes:r,isTruncated:i}=Li(Fi(e.filteredThreadStats,t));return{displayRows:n,maxVal:Ni(n,t),isTruncated:i,totalLanes:r}},[e.filteredThreadStats,t]);return(0,u.jsxs)(`section`,{className:`overview-module overview-module--threads`,children:[(0,u.jsxs)(`div`,{className:`overview-module__header`,children:[(0,u.jsx)(`h3`,{children:`Thread distribution`}),(0,u.jsx)(`p`,{children:o?`Top ${i.length} of ${s.toLocaleString()} worker lanes by selected metric.`:`Worker lanes in the current execution slice.`})]}),e.filteredThreadStats.length>0?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`div`,{className:`thread-dist-metric-pills pill-row`,role:`radiogroup`,"aria-label":`Thread distribution metric`,children:Ai.map(e=>(0,u.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":t===e.value,"aria-label":`${e.label}, thread distribution metric`,className:t===e.value?vr:yr,onClick:()=>n(e.value),children:e.label},e.value))}),(0,u.jsx)(`ul`,{className:`thread-dist-list`,"aria-label":`Worker lanes by metric`,children:i.map(e=>{let n=ji(e,t),i=a>0?Math.min(100,n/a*100):0,o=Ri(e,t,r>0?Math.round(e.count/r*1e3)/10:0),s=`${e.threadId}, ${o}`;return(0,u.jsxs)(`li`,{className:`thread-dist-row`,"aria-label":s,children:[(0,u.jsx)(`div`,{className:`thread-dist-row__label`,title:e.threadId,children:e.threadId}),(0,u.jsx)(`div`,{className:`thread-dist-row__track-wrap`,children:(0,u.jsx)(`div`,{className:`thread-dist-row__track`,title:o,role:`presentation`,children:(0,u.jsx)(`div`,{className:`thread-dist-row__fill`,style:{width:`${i}%`}})})}),(0,u.jsx)(`div`,{className:`thread-dist-row__value`,children:Mi(e,t)})]},e.threadId)})})]}):(0,u.jsx)($r,{icon:`⋯`,headline:`No thread data in slice`,subtext:`No matching executions were found for the current dashboard filters.`})]})}function Bi({derived:e,analysis:t,workerThreadCount:n,modelsCount:r,testsCount:i}){let a=t.summary.critical_path?.path.length??0;return(0,u.jsxs)(`section`,{className:`overview-module overview-module--footprint`,children:[(0,u.jsxs)(`div`,{className:`overview-module__header`,children:[(0,u.jsx)(`h3`,{children:`Footprint`}),(0,u.jsx)(`p`,{children:`Filtered execution volume, duration, and worker scale.`})]}),(0,u.jsxs)(`div`,{className:`footprint-card`,children:[(0,u.jsxs)(`div`,{className:`footprint-card__stats`,children:[(0,u.jsxs)(`div`,{className:`footprint-card__stat`,children:[(0,u.jsx)(`span`,{children:`Executed`}),(0,u.jsx)(`strong`,{children:e.filteredExecutions.length})]}),(0,u.jsxs)(`div`,{className:`footprint-card__stat`,children:[(0,u.jsx)(`span`,{children:`Runtime`}),(0,u.jsx)(`strong`,{children:Er(e.filteredExecutionTime)})]}),(0,u.jsxs)(`div`,{className:`footprint-card__stat`,children:[(0,u.jsx)(`span`,{children:`Worker lanes`}),(0,u.jsx)(`strong`,{children:n})]}),(0,u.jsxs)(`div`,{className:`footprint-card__stat`,children:[(0,u.jsx)(`span`,{children:`Models`}),(0,u.jsx)(`strong`,{children:r})]}),(0,u.jsxs)(`div`,{className:`footprint-card__stat`,children:[(0,u.jsx)(`span`,{children:`Tests`}),(0,u.jsx)(`strong`,{children:i})]})]}),(0,u.jsxs)(`p`,{className:`footprint-card__detail`,children:[`Graph totals remain workspace-wide: `,t.graphSummary.totalNodes,` `,`nodes, `,t.graphSummary.totalEdges,` edges, `,a,` `,`critical-path nodes.`]})]})]})}var Vi=[`model`,`source`,`seed`,`snapshot`];function Hi(e,t){let n={};for(let r of e){if(!Hr(r,t))continue;let e=r.resourceType;n[e]=(n[e]??0)+1}return n}function Ui(e,t){let n=e.resources??[],r=t==null?e.graphSummary.nodesByType:Hi(n,t),i={};for(let n of e.executions){if(t!=null&&!Hr(n,t))continue;let e=n.resourceType;i[e]=(i[e]??0)+1}let a={};for(let n of e.ganttData){if(!Gr(n,t))continue;let e=n.resourceType;a[e]=(a[e]??0)+1}let o=new Set([...Vi,...Object.keys(r),...Object.keys(i),...Object.keys(a)]),s=[];for(let e of[...o].sort((e,t)=>e.localeCompare(t)))s.push({resourceType:e,graphCount:r[e]??0,runCount:i[e]??0,timelineCount:a[e]??0});return s.filter(e=>Vi.includes(e.resourceType)||e.graphCount>0||e.runCount>0||e.timelineCount>0)}function Wi({rows:e}){return e.length===0?null:(0,u.jsxs)(`div`,{className:`invocation-resource-stats`,role:`region`,"aria-label":`Invocation resource counts by type`,children:[(0,u.jsx)(`p`,{className:`invocation-resource-stats__title`,children:`Resource counts (manifest graph vs this run vs timeline rows)`}),(0,u.jsxs)(`table`,{className:`invocation-resource-stats__table`,children:[(0,u.jsx)(`thead`,{children:(0,u.jsxs)(`tr`,{children:[(0,u.jsx)(`th`,{scope:`col`,children:`Type`}),(0,u.jsx)(`th`,{scope:`col`,className:`invocation-resource-stats__num`,children:`Manifest graph`}),(0,u.jsx)(`th`,{scope:`col`,className:`invocation-resource-stats__num`,children:`This run`}),(0,u.jsx)(`th`,{scope:`col`,className:`invocation-resource-stats__num`,children:`Timeline`})]})}),(0,u.jsx)(`tbody`,{children:e.map(e=>(0,u.jsxs)(`tr`,{children:[(0,u.jsx)(`th`,{scope:`row`,children:Dr(e.resourceType)}),(0,u.jsx)(`td`,{className:`invocation-resource-stats__num`,children:e.graphCount.toLocaleString()}),(0,u.jsx)(`td`,{className:`invocation-resource-stats__num`,children:e.runCount.toLocaleString()}),(0,u.jsx)(`td`,{className:`invocation-resource-stats__num`,children:e.timelineCount.toLocaleString()})]},e.resourceType))})]}),(0,u.jsxs)(`p`,{className:`invocation-resource-stats__note`,children:[`When a project package is in scope, manifest graph counts match that package (same scope as this run and timeline). Synthetic source rows are described in ADR-0006 (`,(0,u.jsx)(`code`,{children:`docs/adr/0006-timeline-includes-dbt-sources-via-snapshot-synthesis.md`}),`).`]})]})}function Gi({analysis:e}){let t=e.projectName??Vr(e.executions);return(0,u.jsx)(Wi,{rows:(0,c.useMemo)(()=>Ui(e,t),[e,t])})}function Ki(e,t){return e.failingNodes>0?{tone:`danger`,title:`${e.failingNodes} failing node${e.failingNodes===1?``:`s`} require attention`,summary:`Prioritize failing nodes before reviewing downstream impact.`}:e.warningNodes>0?{tone:`warning`,title:`${e.warningNodes} warning node${e.warningNodes===1?``:`s`} need review`,summary:`Warnings surfaced in this run. Review tests and runtime hotspots next.`}:{tone:`positive`,title:`Healthy run`,summary:t?`No failing nodes match the current dashboard filters.`:`No failing nodes surfaced in the latest run.`}}function qi(e,t){let n=jr(e);return[t??`Workspace`,`${e.graphSummary.totalNodes} graph nodes`,`${e.summary.total_nodes} executions`,e.invocationId==null?null:`invocation ${e.invocationId}`,n==null?null:`invocation started ${Ar(n)}`].filter(e=>!!e)}function Ji(e){return e.find(e=>e.label===`Workspace mode`)?.value??`—`}function Yi({analysis:e,projectName:t,analysisSource:n,derived:r,filtered:i,workspaceSignals:a}){let{tone:o,title:s,summary:c}=Ki(r,i),l=qi(e,t),d=Er(i?r.filteredExecutionTime:e.summary.total_execution_time),f=M(n),p=Ji(a),m=r.failingNodes>0?`${r.failedModels} failed model${r.failedModels===1?``:`s`} may block downstream investigation.`:r.warningNodes>0?`Review tests and runtime hotspots next.`:null;return(0,u.jsxs)(`section`,{className:`health-posture health-posture--${o}`,"aria-label":`Run posture`,children:[(0,u.jsxs)(`div`,{className:`health-posture__top`,children:[(0,u.jsx)(`p`,{className:`eyebrow`,children:`Run posture`}),(0,u.jsx)(`span`,{className:`health-posture__source`,children:f})]}),(0,u.jsx)(`p`,{className:`health-posture__meta`,children:l.join(` · `)}),(0,u.jsx)(`h3`,{className:`health-posture__headline`,children:s}),(0,u.jsx)(`p`,{className:`health-posture__summary`,children:c}),m!=null&&(0,u.jsx)(`p`,{className:`health-posture__followup`,children:m}),(0,u.jsxs)(`div`,{className:`health-posture__metrics`,role:`list`,children:[(0,u.jsxs)(`div`,{className:`health-posture__metric`,role:`listitem`,children:[(0,u.jsx)(`span`,{children:`Failing`}),(0,u.jsx)(`strong`,{children:r.failingNodes})]}),(0,u.jsxs)(`div`,{className:`health-posture__metric`,role:`listitem`,children:[(0,u.jsx)(`span`,{children:`Warnings`}),(0,u.jsx)(`strong`,{children:r.warningNodes})]}),(0,u.jsxs)(`div`,{className:`health-posture__metric`,role:`listitem`,children:[(0,u.jsx)(`span`,{children:`Runtime`}),(0,u.jsx)(`strong`,{children:d})]}),(0,u.jsxs)(`div`,{className:`health-posture__metric`,role:`listitem`,children:[(0,u.jsx)(`span`,{children:`Workspace`}),(0,u.jsx)(`strong`,{children:p})]})]})]})}function Xi(e){return H.has(e)?`tests`:e}function Zi({analysis:e,projectName:t}){let n=(0,c.useMemo)(()=>{let n=e.resources.filter(e=>Hr(e,t)),r=new Map;for(let e of n){let t=Xi(e.resourceType);r.set(t,(r.get(t)??0)+1)}let i=[];for(let{key:e,label:t}of br){let n=r.get(e)??0;n>0&&i.push({label:t,value:n.toLocaleString()})}let a=e.resources.filter(e=>!!e.description?.trim()).length,o=e.resources.length,s=o>0?Math.round(a/o*100):0;i.push({label:`Coverage`,value:`${s}%`}),i.push({label:`Graph nodes`,value:e.graphSummary.totalNodes.toLocaleString()}),i.push({label:`Edges`,value:e.graphSummary.totalEdges.toLocaleString()});let c=e.adapterTotals;if(c!=null&&c.nodesWithAdapterData>0){i.push({label:`Warehouse nodes`,value:c.nodesWithAdapterData.toLocaleString()});for(let e of Hn(c)){let t=e.summaryTotalKey,n=t==null?void 0:c[t];typeof n==`number`&&i.push({label:Rn.find(t=>t.key===e.key)?.shortLabel??e.shortLabel,value:n.toLocaleString()})}}return i},[e,t]);return n.length===0?null:(0,u.jsx)(`div`,{className:`health-metric-row`,role:`region`,"aria-label":`Workspace metrics`,children:n.map((e,t)=>(0,u.jsxs)(`div`,{className:`health-metric-row__item`,children:[(0,u.jsx)(`span`,{className:`health-metric-row__label`,children:e.label}),(0,u.jsx)(`strong`,{className:`health-metric-row__value`,children:e.value})]},`${e.label}-${t}`))})}var Qi=[{value:`all`,label:`All`},{value:`positive`,label:`Healthy`},{value:`warning`,label:`Warnings`},{value:`danger`,label:`Errors`}];function $i({filters:e,setFilters:t}){return(0,u.jsx)(`div`,{className:`health-exec-status-pills pill-row`,role:`group`,"aria-label":`Filter executions by status`,children:Qi.map(n=>(0,u.jsx)(`button`,{type:`button`,className:e.status===n.value?vr:yr,onClick:()=>t(e=>({...e,status:n.value})),children:n.label},n.value))})}var ea=new Set([`analysis`,`exposure`,`macro`,`metric`,`saved_query`,`semantic_model`,`source`]);function ta(e){if(e.materialization!==`unknown`)return!0;let t=Kn(e.resourceType);return!ea.has(t)}var na=[`table`,`view`,`incremental`,`ephemeral`,`materialized_view`,`seed`,`snapshot`,`operation`,`test`,`unknown`],ra={table:`Table`,view:`View`,incremental:`Incr.`,ephemeral:`Eph.`,materialized_view:`Mat. view`,seed:`Seed`,snapshot:`Snap.`,operation:`Op.`,test:`Test`,unknown:`Unknown`},ia={table:`Configured as a table: dbt typically creates or replaces a persisted warehouse relation on full runs; adapter-dependent.`,view:`Configured as a view: dbt typically maintains a view object; runtime reflects metadata refresh and adapter behavior.`,incremental:`Configured as incremental: persisted relation updated incrementally when the model runs incrementally; strategy and full refresh are adapter- and invocation-dependent.`,ephemeral:`Ephemeral model: compiled into downstream SQL and does not create its own warehouse relation.`,materialized_view:`Materialized view: adapter-specific persisted object; behavior and refresh semantics vary by warehouse.`,seed:`Seed: loads static data into a table (typically replace or merge per dbt configuration).`,snapshot:`Snapshot: dbt tracks slowly changing dimensions into a persisted snapshot table.`,operation:`Operation / hook-style step: not a standard persisted model relation.`,test:`Test: validates other resources; does not materialize a primary warehouse table like a model.`,unknown:`Materialization not recognized from manifest metadata; treat persistence and warehouse effects as adapter-dependent.`};function aa(e){return ra[e]??e}function oa(e){let t=[ia[e.materialization]];if(e.rawMaterialization&&t.push(`Manifest materialized: ${e.rawMaterialization}`),e.relationName&&t.push(`Relation name (manifest): ${e.relationName}`),e.incrementalStrategy&&t.push(`Incremental strategy: ${e.incrementalStrategy}`),e.uniqueKey!=null){let n=Array.isArray(e.uniqueKey)?e.uniqueKey.join(`, `):e.uniqueKey;t.push(`Unique key: ${n}`)}return e.onSchemaChange&&t.push(`On schema change: ${e.onSchemaChange}`),e.fullRefreshCapable!=null&&t.push(`Full refresh configured: ${e.fullRefreshCapable}`),t.push(`Source: ${e.materializationSource} metadata.`),t.join(`
|
|
2
|
+
`)}function sa(e){let t=new Set;for(let n of e)n?.materialization&&t.add(n.materialization);return na.filter(e=>t.has(e))}function ca({executions:e}){let{rows:t,total:n}=(0,c.useMemo)(()=>{let t=e.filter(e=>e.resourceType===`model`),n=new Map;for(let e of t){let t=e.semantics?.materialization??`unknown`;n.set(t,(n.get(t)??0)+1)}return{rows:na.filter(e=>(n.get(e)??0)>0).map(e=>({kind:e,count:n.get(e)??0,share:t.length>0?(n.get(e)??0)/t.length*100:0})),total:t.length}},[e]);return n===0?(0,u.jsx)(`div`,{className:`health-mat-card`,children:(0,u.jsxs)(`div`,{className:`overview-module__header`,children:[(0,u.jsx)(`h3`,{children:`Model materializations`}),(0,u.jsx)(`p`,{children:`No model executions in this health slice.`})]})}):(0,u.jsxs)(`div`,{className:`health-mat-card`,children:[(0,u.jsxs)(`div`,{className:`overview-module__header`,children:[(0,u.jsx)(`h3`,{children:`Model materializations`}),(0,u.jsxs)(`p`,{children:[`Manifest-derived materialization kinds for executed models (`,n.toLocaleString(),` rows). Warehouse effects are adapter-dependent.`]})]}),(0,u.jsx)(`ul`,{className:`health-mat-card__list`,"aria-label":`Materialization counts`,children:t.map(({kind:e,count:t,share:n})=>(0,u.jsxs)(`li`,{className:`health-mat-card__row`,children:[(0,u.jsx)(`span`,{className:`health-mat-card__label`,children:aa(e)}),(0,u.jsx)(`span`,{className:`health-mat-card__bar-wrap`,"aria-hidden":!0,children:(0,u.jsx)(`span`,{className:`health-mat-card__bar`,style:{width:`${Math.max(n,2)}%`}})}),(0,u.jsxs)(`span`,{className:`health-mat-card__count`,children:[t,` (`,n.toFixed(n>=10?0:1),`%)`]})]},e))})]})}function la({analysis:e,projectName:t,analysisSource:n,filters:r,setFilters:i,workspaceSignals:a}){let o=(0,c.useMemo)(()=>({status:r.status,query:``,resourceTypes:new Set}),[r.status]),s=(0,c.useMemo)(()=>Qr(e,o),[e,o]),l=r.status!==`all`,d=s.threadCount||s.filteredThreadStats.length,f=s.filteredExecutions.filter(e=>e.resourceType===`model`).length,p=s.filteredExecutions.filter(e=>H.has(e.resourceType)).length;return(0,u.jsxs)(`div`,{className:`workspace-view health-view`,children:[(0,u.jsxs)(`div`,{className:`lens-header`,children:[(0,u.jsxs)(`div`,{className:`lens-header__title`,children:[(0,u.jsx)(`p`,{className:`eyebrow`,children:`Workspace lens`}),(0,u.jsx)(`h2`,{children:`Health`}),(0,u.jsx)(`p`,{className:`lens-header__desc`,children:`Run posture, critical issues, and dependency pressure at a glance.`})]}),l&&(0,u.jsx)(`span`,{className:`lens-header__badge`,children:`Filtered view`})]}),(0,u.jsxs)(`div`,{className:`health-fold`,children:[(0,u.jsx)(Yi,{analysis:e,projectName:t,analysisSource:n,derived:s,filtered:l,workspaceSignals:a}),(0,u.jsx)(Zi,{analysis:e,projectName:t}),(0,u.jsx)(`section`,{className:`health-fold__bottlenecks`,"aria-label":`Bottlenecks`,children:(0,u.jsx)(ti,{derived:s})})]}),(0,u.jsxs)(`div`,{className:`health-detail`,children:[(0,u.jsxs)(`section`,{className:`health-section health-detail__execution`,children:[(0,u.jsxs)(`div`,{className:`health-section__header health-section__header--with-inline-controls`,children:[(0,u.jsxs)(`div`,{className:`health-section__header-text`,children:[(0,u.jsx)(`h3`,{children:`Execution breakdown`}),(0,u.jsxs)(`p`,{children:[s.filteredExecutions.length.toLocaleString(),` runs. Status mix by resource type.`]})]}),(0,u.jsx)($i,{filters:r,setFilters:i})]}),s.filteredExecutions.length>0?(0,u.jsx)(Oi,{executions:s.filteredExecutions,executionsForShareDenominator:s.baselineExecutionsForBreakdown}):(0,u.jsx)($r,{icon:`◌`,headline:`No matching executions`,subtext:`Set status to All to include every run, or pick another status filter.`})]}),(0,u.jsxs)(`section`,{className:`health-section health-detail__context`,children:[(0,u.jsxs)(`div`,{className:`health-section__header`,children:[(0,u.jsx)(`h3`,{children:`Execution context`}),(0,u.jsx)(`p`,{children:`Worker pressure, footprint, and critical path.`})]}),(0,u.jsxs)(`div`,{className:`health-detail__grid`,children:[(0,u.jsx)(zi,{derived:s}),(0,u.jsxs)(`div`,{className:`health-detail__stack`,children:[(0,u.jsx)(ni,{analysis:e,filtered:l}),(0,u.jsx)(Bi,{derived:s,analysis:e,workerThreadCount:d,modelsCount:f,testsCount:p})]})]})]}),(0,u.jsxs)(`section`,{className:`health-section health-detail__structure`,children:[(0,u.jsxs)(`div`,{className:`health-section__header`,children:[(0,u.jsx)(`h3`,{children:`Structural health`}),(0,u.jsx)(`p`,{children:`Coverage and graph shape across the workspace.`})]}),(0,u.jsxs)(`div`,{className:`health-detail__grid`,children:[(0,u.jsx)(ri,{analysis:e,filtered:l}),(0,u.jsxs)(`div`,{className:`health-structure-composition`,children:[(0,u.jsx)(ca,{executions:s.filteredExecutions}),(0,u.jsxs)(`div`,{className:`overview-module__header`,children:[(0,u.jsx)(`h3`,{children:`Graph composition`}),(0,u.jsx)(`p`,{children:`Node type breakdown in the manifest graph.`})]}),(0,u.jsx)(ki,{graphSummary:e.graphSummary})]})]})]}),(0,u.jsxs)(`details`,{className:`health-detail__resource-stats`,children:[(0,u.jsx)(`summary`,{className:`health-detail__resource-stats-summary`,children:`Invocation resource counts`}),(0,u.jsx)(Gi,{analysis:e})]})]})]})}function ua({semantics:e,variant:t=`default`}){if(!ta(e))return null;let n=e.materialization===`unknown`&&e.rawMaterialization?e.rawMaterialization.length>14?`${e.rawMaterialization.slice(0,12)}…`:e.rawMaterialization:aa(e.materialization),r=oa(e);return(0,u.jsx)(`span`,{className:t===`compact`?`materialization-semantics-badge materialization-semantics-badge--compact`:`materialization-semantics-badge`,title:r,"aria-label":r,children:n})}var da=a();function fa(){return{pass:0,fail:0,error:0,warn:0,skipped:0,notExecuted:0}}function pa(e){return Yn(e)}function ma(e,t){let n=t??{},r=e.filter(e=>H.has(e.resourceType)),i=new Map;for(let e of r){let t=n[e.uniqueId]?.upstream?.map(e=>e.uniqueId)??[];for(let n of t){let t=i.get(n)??fa();e.statusTone===`positive`?t.pass+=1:e.statusTone===`danger`?t.error+=1:e.statusTone===`warning`?t.warn+=1:e.statusTone===`skipped`?t.skipped+=1:t.notExecuted+=1,i.set(n,t)}}return i}function ha(e,t,n){let r=n??{},i=t.filter(e=>H.has(e.resourceType)).filter(t=>(r[t.uniqueId]?.upstream?.map(e=>e.uniqueId)??[]).includes(e)).sort((e,t)=>{let n={danger:0,warning:1,positive:2,skipped:3,neutral:4},r=n[e.statusTone??`neutral`]-n[t.statusTone??`neutral`];if(r!==0)return r;let i=(t.executionTime??-1/0)-(e.executionTime??-1/0);return i===0?e.name.localeCompare(t.name):i}),a=i.filter(e=>e.statusTone===`positive`).length,o=i.filter(e=>e.statusTone===`warning`||e.statusTone===`danger`).length;return{total:i.length,passing:a,attention:o,tests:i}}function ga(e,t,n){return{id:e,label:t,kind:`branch`,children:[],count:0,parentIds:n}}function _a(e,t,n){return{id:e,label:t.name,kind:`resource`,children:[],resource:t,count:1,parentIds:n}}function va(e){let t=e.split(`/`).map(e=>e.trim()).filter(Boolean);return{directories:t.slice(0,-1),fileName:t[t.length-1]??e}}function ya(e){return Pr(e.originalFilePath??e.patchPath??e.path)}function ba(e){let t=ya(e);return t?va(t).directories:[]}function xa(e){let t=ya(e);return t?va(t).fileName:null}function Sa(e){return!e.database||!e.schema?[]:[e.database,e.schema,e.packageName]}function Ca(e,t){let n=[`model`,`seed`,`snapshot`,`source`,`macro`,`operation`,`sql_operation`,`analysis`,`semantic_model`,`metric`,`test`,`unit_test`,`exposure`],r=n.indexOf(e.resourceType),i=n.indexOf(t.resourceType);return r===i?e.name.localeCompare(t.name):r===-1?1:i===-1?-1:r-i}function wa(e,t){let n={branch:0,resource:1};return e.kind===t.kind?e.kind===`resource`&&t.kind===`resource`&&e.resource&&t.resource?Ca(e.resource,t.resource):e.label.localeCompare(t.label):n[e.kind]-n[t.kind]}function Ta(e){return e.map(e=>{if(e.kind===`resource`)return e;let t=Ta(e.children).sort(wa);return{...e,children:t,count:t.reduce((e,t)=>e+t.count,0)}}).sort(wa)}function Ea(e){return`project:branch:${e??`Workspace`}`}function Da(e,t,n,r){let i=r??{},a=e.filter(e=>!H.has(e.resourceType)),o=ma(e,i),s=e=>{let t=fa();for(let n of e){let e;n.kind===`resource`?e=n.testStats??fa():(e=s(n.children),pa(e)&&(n.testStats=e)),t.pass+=e.pass,t.fail+=e.fail,t.error+=e.error,t.warn+=e.warn,t.skipped+=e.skipped}return t},c=[],l=(e,t,n,r)=>{let i=e.find(e=>e.kind===`branch`&&e.id===t);if(i)return i;let a=ga(t,n,r);return e.push(a),a};if(t===`project`){let e=n??`Workspace`,r=l(c,Ea(n),e,[]);for(let n of a){if(!ya(n))continue;let i=ba(n),a=[r.id],s=r.children;for(let n=0;n<i.length;n+=1){let r=i[n],o=`${t}:branch:${[e,...i.slice(0,n+1)].join(`/`)}`,c=l(s,o,r,[...a]);a.push(o),s=c.children}let c=_a(`${t}:resource:${n.uniqueId}`,n,a),u=o.get(n.uniqueId);u&&pa(u)&&(c.testStats=u),s.push(c)}return s(c),Ta(c).filter(e=>e.count>0)}for(let e of a){let n=Sa(e);if(n.length===0)continue;let r=[],i=c;for(let e=0;e<n.length;e+=1){let a=n[e],o=`${t}:branch:${n.slice(0,e+1).join(`/`)}`,s=l(i,o,a,[...r]);r.push(o),i=s.children}let a=_a(`${t}:resource:${e.uniqueId}`,e,r),s=o.get(e.uniqueId);s&&pa(s)&&(a.testStats=s),i.push(a)}return s(c),Ta(c)}function Oa(e,t,n=0){let r=[];for(let i of e)r.push({node:i,depth:n}),i.kind===`branch`&&t.has(i.id)&&r.push(...Oa(i.children,t,n+1));return r}function ka(e){let t=new Set,n=[...e];for(;n.length>0;){let e=n.pop();e.kind!==`resource`&&(t.add(e.id),n.push(...e.children))}return t}function Aa(e){let t=[],n=[...e];for(;n.length>0;){let e=n.pop();e.kind===`resource`&&e.resource?t.push(e.resource.uniqueId):n.push(...[...e.children].reverse())}return t}function ja(e,t){if(!t)return null;let n=[...e];for(;n.length>0;){let e=n.pop();if(e.kind===`resource`&&e.resource?.uniqueId===t)return e;n.push(...e.children)}return null}function Ma(e,t){let n=ja(e,t);return new Set(n?.parentIds??[])}function Na(e){return Math.max(0,Math.min(10,e))}function Pa(e){return Cr.has(e)}function Fa(e,t,n,r){let i=new Map,a=[t];for(let o=1;o<=n;o+=1){let n=[];for(let s of a){let a=e[s],c=r===`upstream`?a?.upstream?.map(e=>e.uniqueId)??[]:a?.downstream?.map(e=>e.uniqueId)??[];for(let e of c)i.has(e)||e===t||(i.set(e,o),n.push(e))}if(a=n,a.length===0)break}return i}function Ia(e){switch(e){case`source`:case`seed`:case`snapshot`:return 0;case`model`:return 1;case`semantic_model`:return 2;case`metric`:case`exposure`:return 3;default:return 4}}function La(e,t,n,r){if(e===t)return{side:`selected`,depth:0};let i=n.get(e),a=r.get(e);return i!=null&&a!=null?i<=a?{side:`upstream`,depth:i}:{side:`downstream`,depth:a}:i==null?a==null?{side:`selected`,depth:0}:{side:`downstream`,depth:a}:{side:`upstream`,depth:i}}function Ra(e,t,n,r,i){let a=new Map,o=[...t.keys()].sort((e,n)=>t.get(e)-t.get(n));for(let t of o){let n=r.get(t);if(!n||H.has(n.resourceType))continue;let o=i[t]?.downstream?.map(e=>e.uniqueId)??[],s=0;for(let t of o)if(t===e)s=Math.max(s,0);else{let e=a.get(t);e!==void 0&&(s=Math.max(s,e))}a.set(t,s+1)}let s=new Map,c=[...n.keys()].sort((e,t)=>n.get(e)-n.get(t));for(let t of c){let n=r.get(t);if(!n||H.has(n.resourceType))continue;let a=i[t]?.upstream?.map(e=>e.uniqueId)??[],o=0;for(let t of a)if(t===e)o=Math.max(o,0);else{let e=s.get(t);e!==void 0&&(o=Math.max(o,e))}s.set(t,o+1)}let l=new Map,u=r.get(e);u&&l.set(0,[u]);for(let[e]of t){let t=r.get(e);if(!t||H.has(t.resourceType))continue;let n=-(a.get(e)??1),i=l.get(n)??[];i.push(t),l.set(n,i)}for(let[e]of n){let t=r.get(e);if(!t||H.has(t.resourceType))continue;let n=s.get(e)??1,i=l.get(n)??[];i.push(t),l.set(n,i)}return Array.from(l.entries()).sort((e,t)=>e[0]-t[0]).map(([e,t])=>({column:e,resources:[...new Map(t.map(e=>[e.uniqueId,e])).values()].sort((e,t)=>{let n=Ia(e.resourceType)-Ia(t.resourceType);return n===0?e.name.localeCompare(t.name):n})}))}function za(e,t){let n=new Map;e.forEach(e=>e.resources.forEach((e,t)=>n.set(e.uniqueId,t)));let r=e.map(e=>({...e,resources:[...e.resources]}));for(let e=0;e<4;e+=1){for(let e=1;e<r.length;e+=1){let i=r[e-1],a=r[e];a.resources.sort((e,r)=>{let a=t[e.uniqueId]?.upstream?.map(e=>e.uniqueId)??[],o=t[r.uniqueId]?.upstream?.map(e=>e.uniqueId)??[];return(a.length>0?a.reduce((e,t)=>e+(n.get(t)??i.resources.length),0)/a.length:n.get(e.uniqueId)??0)-(o.length>0?o.reduce((e,t)=>e+(n.get(t)??i.resources.length),0)/o.length:n.get(r.uniqueId)??0)}),a.resources.forEach((e,t)=>n.set(e.uniqueId,t))}for(let e=r.length-2;e>=0;--e){let i=r[e+1],a=r[e];a.resources.sort((e,r)=>{let a=t[e.uniqueId]?.downstream?.map(e=>e.uniqueId)??[],o=t[r.uniqueId]?.downstream?.map(e=>e.uniqueId)??[];return(a.length>0?a.reduce((e,t)=>e+(n.get(t)??i.resources.length),0)/a.length:n.get(e.uniqueId)??0)-(o.length>0?o.reduce((e,t)=>e+(n.get(t)??i.resources.length),0)/o.length:n.get(r.uniqueId)??0)}),a.resources.forEach((e,t)=>n.set(e.uniqueId,t))}}return r}function Ba(e){return e===`summary`?{nodeWidth:176,nodeHeight:64,nodeRadius:14,columnGap:104,rowGap:24,paddingX:40,paddingY:40}:{nodeWidth:212,nodeHeight:80,nodeRadius:18,columnGap:160,rowGap:40,paddingX:56,paddingY:52}}function Va(e,t){let n=e.length,r=Math.max(1,...e.map(e=>e.resources.length));return{svgWidth:t.paddingX*2+n*t.nodeWidth+Math.max(0,n-1)*t.columnGap,svgHeight:t.paddingY*2+r*t.nodeHeight+Math.max(0,r-1)*t.rowGap}}function Ha(e,t,n,r,i,a,o){let s=new Map;return e.forEach((e,c)=>{let l=e.resources.length*a.nodeHeight+Math.max(0,e.resources.length-1)*a.rowGap,u=a.paddingY+(o-a.paddingY*2-l)/2,d=a.paddingX+c*(a.nodeWidth+a.columnGap);e.resources.forEach((o,c)=>{let l=u+c*(a.nodeHeight+a.rowGap),{depth:f,side:p}=La(o.uniqueId,t,n,r),m=i.get(o.uniqueId);s.set(o.uniqueId,{resource:o,x:d,y:l,column:e.column,depth:f,side:p,passCount:m?.pass??0,failCount:(m?.error??0)+(m?.warn??0),notExecutedCount:m?.notExecuted??0,skippedCount:m?.skipped??0})})}),s}function Ua(e,t){let n=[];for(let r of t){let i=e[r]?.downstream??[];for(let e of i)t.has(e.uniqueId)&&n.push({from:r,to:e.uniqueId})}return n}function Wa({resource:e,dependencySummary:t,dependencyIndex:n,resourceById:r,upstreamDepth:i,downstreamDepth:a,displayMode:o=`focused`}){let s=Fa(n,e.uniqueId,i,`upstream`),c=Fa(n,e.uniqueId,a,`downstream`),l=za(Ra(e.uniqueId,s,c,r,n),n).filter(e=>e.resources.length>0),u=ma(Array.from(r.values()),n),d=Ba(o),{svgWidth:f,svgHeight:p}=Va(l,d),m=Ha(l,e.uniqueId,s,c,u,d,p);return{upstreamMap:s,downstreamMap:c,columnNodes:l,nodeLayouts:m,graphEdges:Ua(n,new Set(m.keys())),svgWidth:f,svgHeight:p,hasRelatedNodes:m.size>1&&((t?.upstreamCount??0)>0||(t?.downstreamCount??0)>0),nodeWidth:d.nodeWidth,nodeHeight:d.nodeHeight,nodeRadius:d.nodeRadius,displayMode:o}}function Ga(e,t){if(!e)return new Set;let n=new Set([e]);for(let r of t)r.from===e&&n.add(r.to),r.to===e&&n.add(r.from);return n}function Ka(e){return Array.from(new Set(Array.from(e.values()).map(e=>e.resource.resourceType))).sort((e,t)=>{let n=Ia(e)-Ia(t);return n===0?e.localeCompare(t):n})}var qa={positive:`var(--bg-success-soft)`,warning:`var(--bg-warning-soft)`,danger:`var(--bg-danger-soft)`,skipped:`var(--bg-accent-soft)`,neutral:`var(--bg-surface-muted)`},Ja=`var(--bg-success-soft)`,Ya=`var(--bg-danger-soft)`,Xa=`var(--dbt-type-generic-soft)`,Za={model:`var(--dbt-type-model-soft)`,source:`var(--dbt-type-source-soft)`,seed:`var(--dbt-type-seed-soft)`,snapshot:`var(--dbt-type-snapshot-soft)`,test:`var(--dbt-type-test-soft)`,unit_test:`var(--dbt-type-test-soft)`,metric:`var(--dbt-type-metric-soft)`,semantic_model:`var(--dbt-type-semantic-model-soft)`,exposure:`var(--dbt-type-exposure-soft)`,macro:`var(--dbt-type-macro-soft)`,operation:`var(--dbt-type-operation-soft)`,sql_operation:`var(--dbt-type-operation-soft)`},Qa={model:`var(--dbt-type-model)`,source:`var(--dbt-type-source)`,seed:`var(--dbt-type-seed)`,snapshot:`var(--dbt-type-snapshot)`,test:`var(--dbt-type-test)`,unit_test:`var(--dbt-type-test)`,metric:`var(--dbt-type-metric)`,semantic_model:`var(--dbt-type-semantic-model)`,exposure:`var(--dbt-type-exposure)`,macro:`var(--dbt-type-macro)`,operation:`var(--dbt-type-operation)`,sql_operation:`var(--dbt-type-operation)`};function $a(e,t){switch(t){case`status`:return qa[e.statusTone??`neutral`];case`type`:return Za[e.resourceType]??Xa;case`coverage`:return e.description?Ja:Ya}}function eo(e,t){switch(t){case`status`:return e.statusTone??`neutral`;case`type`:return e.resourceType;case`coverage`:return e.description?`documented`:`undocumented`}}function to(e){return e.charAt(0).toUpperCase()+e.slice(1)}function no(e){return e.split(`_`).map(e=>to(e)).join(` `)}function ro(e,t){let n=()=>[`positive`,`warning`,`danger`,`skipped`,`neutral`].map(e=>({key:e,label:to(e),color:qa[e]})),r=()=>Ka(t).map(e=>({key:e,label:no(e),color:Za[e]??Xa,borderColor:Qa[e]??`var(--dbt-type-generic)`}));switch(e){case`status`:return n();case`type`:return r();case`coverage`:return[{key:`documented`,label:`Documented`,color:Ja},{key:`undocumented`,label:`No description`,color:Ya}]}}function io(e,t,n){let r=new Map,i=(e,t)=>{let n=r.get(e);n?n.push(t):r.set(e,[t])};for(let{from:t,to:r}of e)!n.has(t)||!n.has(r)||(i(t,r),i(r,t));let a=new Set;if(!n.has(t))return a;let o=[t];a.add(t);for(let e=0;e<o.length;e+=1){let t=o[e];for(let e of r.get(t)??[])a.has(e)||(a.add(e),o.push(e))}return a}function ao(e,t,n){if(!e.has(n))return{nodeLayouts:e,graphEdges:t};let r=io(t,n,new Set(e.keys()));if(r.size===e.size)return{nodeLayouts:e,graphEdges:t};let i=new Map;for(let[t,n]of e.entries())r.has(t)&&i.set(t,n);let a=new Set(i.keys());return{nodeLayouts:i,graphEdges:t.filter(e=>a.has(e.from)&&a.has(e.to))}}function oo(e,t,n,r){if(n.size===0)return ao(e.nodeLayouts,e.graphEdges,r);let i=new Map;for(let[a,o]of e.nodeLayouts.entries())(a===r||n.has(eo(o.resource,t)))&&i.set(a,o);let a=new Set(i.keys());return ao(i,e.graphEdges.filter(e=>a.has(e.from)&&a.has(e.to)),r)}function so({label:e,value:t,setValue:n,disabled:r=!1}){return(0,u.jsxs)(`div`,{className:`lineage-stepper${r?` lineage-stepper--disabled`:``}`,children:[(0,u.jsx)(`span`,{className:`lineage-stepper__label`,children:e}),(0,u.jsxs)(`div`,{className:`lineage-stepper__controls`,children:[(0,u.jsx)(`button`,{type:`button`,className:`lineage-stepper__button`,disabled:r||t<=1,onClick:()=>n(e=>Na(e-1)),children:`−`}),(0,u.jsx)(`span`,{className:`lineage-stepper__value`,children:t}),(0,u.jsx)(`button`,{type:`button`,className:`lineage-stepper__button`,disabled:r||t>=3,onClick:()=>n(e=>Na(e+1)),children:`+`})]})]})}function co(e,t,n){return n?`all`:e===t&&e>=1&&e<=3?String(e):`custom`}function lo({upstreamDepth:e,downstreamDepth:t,allDepsMode:n,setUpstreamDepth:r,setDownstreamDepth:i,setAllDepsMode:a}){let o=co(e,t,n),s=e=>{if(e===`all`){a(!0);return}let t=Number(e);a(!1),r(t),i(t)};return(0,u.jsxs)(`div`,{className:`shared-depth-selector`,children:[(0,u.jsx)(`span`,{className:`shared-depth-selector__label`,children:`Depth`}),[`1`,`2`,`3`,`all`].map(e=>(0,u.jsx)(`button`,{type:`button`,className:o===e?vr:yr,onClick:()=>s(e),children:e===`all`?`All`:e},e)),o===`custom`&&(0,u.jsx)(`span`,{className:`shared-depth-selector__state`,children:`Custom`})]})}function uo({lensMode:e,setLensMode:t}){return(0,u.jsxs)(`div`,{className:`lens-selector`,children:[(0,u.jsx)(`span`,{className:`lens-selector__label`,children:`Lens`}),[{value:`type`,label:`Type`},{value:`status`,label:`Status`},{value:`coverage`,label:`Coverage`}].map(({value:n,label:r})=>(0,u.jsx)(`button`,{type:`button`,className:e===n?vr:yr,onClick:()=>t(n),children:r},n))]})}function fo(e){let{layoutX:t,layoutY:n,nodeWidth:r,nodeHeight:i,zoom:a,viewportClientWidth:o,viewportClientHeight:s,scrollWidth:c,scrollHeight:l}=e;if(o<=0||s<=0||!Number.isFinite(t)||!Number.isFinite(n)||!Number.isFinite(r)||!Number.isFinite(i)||!Number.isFinite(a))return{scrollLeft:0,scrollTop:0};let u=(t+r/2)*a,d=(n+i/2)*a,f=Math.max(0,c-o),p=Math.max(0,l-s),m=u-o/2,h=d-s/2;return{scrollLeft:Math.min(f,Math.max(0,m)),scrollTop:Math.min(p,Math.max(0,h))}}var po={width:248,height:176},mo={width:220,height:120},ho={x:10,y:8};function go(e){return 16+e.length*6.2}function _o({anchorX:e,anchorY:t,width:n,height:r,offset:i=6,margin:a=12}){let o=window.innerWidth,s=window.innerHeight,c=e+i,l=t+i;return c+n+a>o&&(c=e-n-i),l+r+a>s&&(l=t-r-i),c=Math.min(Math.max(a,c),Math.max(a,o-n-a)),l=Math.min(Math.max(a,l),Math.max(a,s-r-a)),{x:c,y:l}}function vo({visibleNodeLayouts:e,getEffectivePos:t,svgWidth:n,svgHeight:r,nodeWidth:i,nodeHeight:a,zoom:o,nodeOffsets:s,nodeDragRef:c,onSelectResource:l,setHoveredId:d,setTooltipNodeId:f,setContextMenu:p,setNodeOffsets:m}){return(0,u.jsx)(`div`,{className:`dependency-graph__interactive-layer`,children:Array.from(e.values()).map(e=>{let{x:h,y:g}=t(e.resource.uniqueId,e.x,e.y),_={left:`${h/n*100}%`,top:`${g/r*100}%`,width:`${i/n*100}%`,height:`${a/r*100}%`};return(0,u.jsx)(`button`,{type:`button`,className:`dependency-graph__hotspot dependency-graph__hotspot--${e.side}`,style:_,onClick:()=>{c.current?.hasMoved||l(e.resource.uniqueId)},onContextMenu:t=>{t.preventDefault();let n=_o({anchorX:t.clientX,anchorY:t.clientY,width:mo.width,height:mo.height});p({x:n.x,y:n.y,nodeId:e.resource.uniqueId})},onMouseEnter:()=>{d(e.resource.uniqueId),f(e.resource.uniqueId)},onMouseLeave:()=>{d(null),f(null)},title:e.resource.uniqueId,onPointerDown:t=>{t.stopPropagation();let n=s.get(e.resource.uniqueId)??{dx:0,dy:0};c.current={nodeId:e.resource.uniqueId,pointerId:t.pointerId,startClientX:t.clientX,startClientY:t.clientY,initialDx:n.dx,initialDy:n.dy,hasMoved:!1},t.currentTarget.setPointerCapture(t.pointerId)},onPointerMove:t=>{let n=c.current;if(!n||n.pointerId!==t.pointerId||n.nodeId!==e.resource.uniqueId)return;let r=t.clientX-n.startClientX,i=t.clientY-n.startClientY;(Math.abs(r)>4||Math.abs(i)>4)&&(n.hasMoved=!0);let a=n.initialDx+r/o,s=n.initialDy+i/o;m(e=>{let t=new Map(e);return t.set(n.nodeId,{dx:a,dy:s}),t})},onPointerUp:e=>{c.current?.pointerId===e.pointerId&&(e.currentTarget.releasePointerCapture(e.pointerId),setTimeout(()=>{c.current=null},0))},onPointerCancel:()=>{c.current=null}},e.resource.uniqueId)})})}function yo({lensMode:e,legendItems:t,activeLegendKeys:n,onToggleLegendKey:r}){return(0,u.jsxs)(`div`,{className:`lineage-legend`,children:[(0,u.jsx)(`span`,{className:`lineage-legend__mode-label`,children:e===`status`?`By status`:e===`type`?`By type`:`By coverage`}),t.map(e=>(0,u.jsxs)(`button`,{type:`button`,className:`lineage-legend__item${n.size===0||n.has(e.key)?` lineage-legend__item--active`:` lineage-legend__item--inactive`}`,onClick:()=>r(e.key),children:[(0,u.jsx)(`span`,{className:`lineage-legend__swatch`,style:{background:e.color,borderColor:e.borderColor}}),e.label]},e.key)),n.size>0&&(0,u.jsx)(`button`,{type:`button`,className:`lineage-legend__clear`,onClick:()=>n.forEach(e=>{r(e)}),children:`Clear`})]})}function bo({node:e,x:t,badgeY:n,badgeHeight:r,badgeRadius:i,displayMode:a}){let o=String(e.passCount),s=String(e.failCount),c=go(o),l=go(s),d=e.notExecutedCount>0||e.skippedCount>0,f=a===`summary`&&d?4:6,p=e.notExecutedCount>0?String(e.notExecutedCount):``,m=e.skippedCount>0?String(e.skippedCount):``,h=p?go(p):0,g=m?go(m):0,_=t+16+c+f+l,v=e.notExecutedCount>0?_+f:0,y=e.skippedCount>0?e.notExecutedCount>0?v+h+f:_+f:0;return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`rect`,{x:t+16,y:n,width:c,height:r,rx:i,className:`dependency-graph__node-stat-pill dependency-graph__node-stat-pill--pass`}),(0,u.jsx)(`text`,{x:t+16+c/2,y:n+r/2,className:`dependency-graph__node-stat dependency-graph__node-stat--pass`,textAnchor:`middle`,dominantBaseline:`middle`,children:o}),(0,u.jsx)(`rect`,{x:t+16+c+f,y:n,width:l,height:r,rx:i,className:`dependency-graph__node-stat-pill ${e.failCount===0?`dependency-graph__node-stat-pill--neutral`:`dependency-graph__node-stat-pill--fail`}`}),(0,u.jsx)(`text`,{x:t+16+c+f+l/2,y:n+r/2,className:`dependency-graph__node-stat ${e.failCount===0?`dependency-graph__node-stat--neutral`:`dependency-graph__node-stat--fail`}`,textAnchor:`middle`,dominantBaseline:`middle`,children:s}),e.notExecutedCount>0?(0,u.jsxs)(`g`,{children:[(0,u.jsx)(`title`,{children:`Not executed in this run: ${e.notExecutedCount}`}),(0,u.jsx)(`rect`,{x:v,y:n,width:h,height:r,rx:i,className:`dependency-graph__node-stat-pill dependency-graph__node-stat-pill--not-executed`}),(0,u.jsx)(`text`,{x:v+h/2,y:n+r/2,className:`dependency-graph__node-stat dependency-graph__node-stat--not-executed`,textAnchor:`middle`,dominantBaseline:`middle`,children:p})]}):null,e.skippedCount>0?(0,u.jsxs)(`g`,{children:[(0,u.jsx)(`title`,{children:`Skipped dbt tests: ${e.skippedCount}`}),(0,u.jsx)(`rect`,{x:y,y:n,width:g,height:r,rx:i,className:`dependency-graph__node-stat-pill dependency-graph__node-stat-pill--skipped`}),(0,u.jsx)(`text`,{x:y+g/2,y:n+r/2,className:`dependency-graph__node-stat dependency-graph__node-stat--skipped`,textAnchor:`middle`,dominantBaseline:`middle`,children:m})]}):null]})}function xo({node:e,getEffectivePos:t,nodeWidth:n,nodeHeight:r,nodeRadius:i,displayMode:a,lensMode:o,highlightedIds:s,hasHoverFocus:c}){let l=!c||s.has(e.resource.uniqueId),{x:d,y:f}=t(e.resource.uniqueId,e.x,e.y),p=a===`summary`?f+r-20:f+r-23,m=a===`summary`?15:17,h=m/2,g=` dependency-graph__node--tone-${e.resource.statusTone??`neutral`}`;return(0,u.jsxs)(`g`,{children:[(0,u.jsx)(`rect`,{x:d,y:f,width:n,height:r,rx:i,className:`dependency-graph__node${e.side===`selected`?` dependency-graph__node--selected`:``}${l?``:` dependency-graph__node--dimmed`}${g}`,...e.side===`selected`?{stroke:`var(--graph-node-selected-stroke)`,strokeWidth:3}:{},style:{fill:$a(e.resource,o)}}),(0,u.jsx)(`foreignObject`,{x:d+16,y:a===`summary`?f+10:f+14,width:n-32,height:24,children:(0,u.jsxs)(`div`,{className:`dependency-graph__node-title-row`,title:`${e.resource.name} (${Dr(e.resource.resourceType)})`,children:[(0,u.jsx)(`span`,{className:`dependency-graph__node-title-icon`,title:Dr(e.resource.resourceType),children:(0,u.jsx)(xi,{resourceType:e.resource.resourceType})}),(0,u.jsx)(`span`,{className:`dependency-graph__node-title-text`,children:e.resource.name})]})}),Pa(e.resource.resourceType)?(0,u.jsx)(bo,{node:e,x:d,badgeY:p,badgeHeight:m,badgeRadius:h,displayMode:a}):null]})}function So({visibleEdges:e,visibleNodeLayouts:t,getEffectivePos:n,nodeWidth:r,nodeHeight:i,nodeRadius:a,displayMode:o,lensMode:s,highlightedIds:c,hasHoverFocus:l}){return(0,u.jsxs)(u.Fragment,{children:[e.map(e=>{let a=t.get(e.from),o=t.get(e.to);if(!a||!o)return null;let s=n(e.from,a.x,a.y),d=n(e.to,o.x,o.y),f=s.x+r,p=s.y+i/2,m=d.x,h=d.y+i/2,g=Math.max(28,Math.abs(m-f)*.34);return(0,u.jsx)(`path`,{d:`M ${f} ${p} C ${f+g} ${p}, ${m-g} ${h}, ${m} ${h}`,className:`dependency-graph__edge${!l||c.has(e.from)||c.has(e.to)?``:` dependency-graph__edge--dimmed`}`},`${e.from}->${e.to}`)}),Array.from(t.values()).map(e=>(0,u.jsx)(xo,{node:e,getEffectivePos:n,nodeWidth:r,nodeHeight:i,nodeRadius:a,displayMode:o,lensMode:s,highlightedIds:c,hasHoverFocus:l},e.resource.uniqueId))]})}function Co({zoom:e,setZoom:t,nodeOffsetsSize:n,onResetLayout:r,visibleNodeCount:i,upstreamCount:a,downstreamCount:o}){return(0,u.jsxs)(`div`,{className:`lineage-graph__viewport-toolbar`,children:[(0,u.jsxs)(`div`,{className:`lineage-graph__zoom-controls`,children:[(0,u.jsx)(`button`,{type:`button`,className:yr,onClick:()=>t(e=>Math.max(.4,e-.1)),children:`−`}),(0,u.jsxs)(`button`,{type:`button`,className:yr,onClick:()=>t(1),children:[Math.round(e*100),`%`]}),(0,u.jsx)(`button`,{type:`button`,className:yr,onClick:()=>t(e=>Math.min(2.5,e+.1)),children:`+`}),n>0&&(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:r,children:`Reset layout`})]}),(0,u.jsxs)(`p`,{className:`lineage-graph__summary`,children:[i,` nodes · `,a,` upstream · `,o,` `,`downstream`]})]})}function wo({model:e,displayMode:t,fullscreen:n,lensMode:r,legendItems:i,activeLegendKeys:a,onToggleLegendKey:o,zoom:s,setZoom:c,nodeOffsets:l,setNodeOffsets:d,visibleNodeLayouts:f,visibleEdges:p,highlightedIds:m,hasHoverFocus:h,getEffectivePos:g,svgWidth:_,svgHeight:v,nodeWidth:y,nodeHeight:b,nodeRadius:x,viewportRef:S,panDragRef:C,nodeDragRef:w,onSelectResource:T,setHoveredId:E,setTooltipNodeId:D,setContextMenu:O,setViewportTick:k,tooltipLayout:A,tooltipPosition:j,contextMenu:M}){return(0,u.jsxs)(`div`,{className:`dependency-graph dependency-graph--${t}${n?` dependency-graph--fullscreen`:``}`,children:[(0,u.jsx)(yo,{lensMode:r,legendItems:i,activeLegendKeys:a,onToggleLegendKey:o}),(0,u.jsx)(Co,{zoom:s,setZoom:c,nodeOffsetsSize:l.size,onResetLayout:()=>d(new Map),visibleNodeCount:f.size,upstreamCount:e.upstreamMap.size,downstreamCount:e.downstreamMap.size}),(0,u.jsx)(`div`,{ref:S,className:`lineage-graph__viewport${n?` lineage-graph__viewport--fullscreen`:``}`,onPointerDown:e=>{let t=S.current;t&&(C.current={pointerId:e.pointerId,startX:e.clientX,startY:e.clientY,scrollLeft:t.scrollLeft,scrollTop:t.scrollTop},t.setPointerCapture(e.pointerId))},onPointerMove:e=>{let t=C.current,n=S.current;!t||!n||t.pointerId!==e.pointerId||(n.scrollLeft=t.scrollLeft-(e.clientX-t.startX),n.scrollTop=t.scrollTop-(e.clientY-t.startY))},onPointerUp:e=>{let t=S.current;C.current?.pointerId===e.pointerId&&t&&t.releasePointerCapture(e.pointerId),C.current=null},onPointerCancel:()=>{C.current=null},onScroll:()=>k(e=>e+1),children:(0,u.jsxs)(`div`,{className:`lineage-graph__canvas`,style:{width:`${_*s}px`,height:`${v*s}px`},children:[(0,u.jsxs)(`div`,{className:`lineage-graph__zoom-layer`,style:{width:`${_}px`,height:`${v}px`,transform:`scale(${s})`},children:[(0,u.jsx)(`svg`,{className:`dependency-graph__svg dependency-graph__svg--lens-${r}`,viewBox:`0 0 ${_} ${v}`,preserveAspectRatio:`xMidYMid meet`,"aria-hidden":`true`,children:(0,u.jsx)(So,{visibleEdges:p,visibleNodeLayouts:f,getEffectivePos:g,nodeWidth:y,nodeHeight:b,nodeRadius:x,displayMode:t,lensMode:r,highlightedIds:m,hasHoverFocus:h})}),(0,u.jsx)(vo,{visibleNodeLayouts:f,getEffectivePos:g,svgWidth:_,svgHeight:v,nodeWidth:y,nodeHeight:b,zoom:s,nodeOffsets:l,nodeDragRef:w,onSelectResource:T,setHoveredId:E,setTooltipNodeId:D,setContextMenu:O,setNodeOffsets:d})]}),A&&j&&(0,u.jsxs)(`div`,{className:`graph-node-tooltip`,style:{left:j.left,top:j.top},"aria-hidden":`true`,children:[(0,u.jsx)(`div`,{className:`graph-node-tooltip__name`,children:A.resource.name}),(0,u.jsxs)(`div`,{className:`graph-node-tooltip__meta`,children:[Dr(A.resource.resourceType),A.resource.packageName?` · ${A.resource.packageName}`:``]}),A.resource.status&&(0,u.jsxs)(`div`,{className:`graph-node-tooltip__status graph-node-tooltip__status--${A.resource.statusTone}`,children:[A.resource.status,A.resource.executionTime==null?``:` · ${Er(A.resource.executionTime)}`]}),A.resource.description&&(0,u.jsx)(`div`,{className:`graph-node-tooltip__description`,children:A.resource.description})]})]})}),M&&(0,u.jsxs)(`div`,{className:`graph-context-menu`,style:{left:M.x,top:M.y},onPointerDown:e=>e.stopPropagation(),children:[(0,u.jsx)(`button`,{type:`button`,className:`graph-context-menu__item`,onClick:()=>{T(M.nodeId),O(null)},children:`Focus on this node`}),(()=>{let e=f.get(M.nodeId);return e?(0,u.jsx)(`div`,{className:`graph-context-menu__label`,children:e.resource.name}):null})()]})]})}function To(e,t,n,r,i,a,o,s){(0,c.useLayoutEffect)(()=>{if(!e)return;let i=o.current;if(!i)return;let{x:c,y:l}=a(e.resource.uniqueId,e.x,e.y),u=c*t,d=l*t,f=n*t,p=r*t,m=u+f-po.width-ho.x,h=d+ho.y;m<i.scrollLeft+12&&(m=u+ho.x),h+po.height>i.scrollTop+i.clientHeight&&(h=d+p-po.height-ho.y),m=Math.min(Math.max(i.scrollLeft+12,m),Math.max(i.scrollLeft+12,i.scrollLeft+i.clientWidth-po.width-12)),h=Math.min(Math.max(i.scrollTop+12,h),Math.max(i.scrollTop+12,i.scrollTop+i.clientHeight-po.height-12)),s({left:m,top:h})},[e,t,n,r,i,a,o,s])}function Eo({model:e,onSelectResource:t,lensMode:n=`type`,activeLegendKeys:r,onToggleLegendKey:i,fullscreen:a=!1,displayMode:o=`focused`}){let{nodeLayouts:s,svgHeight:l,svgWidth:d,nodeWidth:f,nodeHeight:p,nodeRadius:m}=e,[h,g]=(0,c.useState)(null),[_,v]=(0,c.useState)(null),[y,b]=(0,c.useState)(1),[x,S]=(0,c.useState)(0),[C,w]=(0,c.useState)(null),[T,E]=(0,c.useState)(new Map),[D,O]=(0,c.useState)(0),[k,A]=(0,c.useState)(null),j=(0,c.useRef)(null),M=(0,c.useRef)(null),N=(0,c.useRef)(null),P=(0,c.useRef)(null),ee=(0,c.useRef)(y),F=(0,c.useMemo)(()=>Array.from(s.values()).find(e=>e.side===`selected`)?.resource.uniqueId??``,[s]),te=(0,c.useMemo)(()=>oo(e,n,r,F),[r,n,e,F]),ne=te.nodeLayouts,re=te.graphEdges;(0,c.useEffect)(()=>{queueMicrotask(()=>{b(1),E(new Map),O(e=>e+1)})},[e]),(0,c.useLayoutEffect)(()=>{ee.current=y;let e=P.current,t=N.current;e&&t&&(t.scrollLeft=e.x,t.scrollTop=e.y,P.current=null)},[y]),(0,c.useLayoutEffect)(()=>{if(ee.current!==1||T.size>0)return;let e=N.current;if(!e)return;if(!F){e.scrollLeft=0,e.scrollTop=0;return}let t=ne.get(F);if(!t){e.scrollLeft=0,e.scrollTop=0;return}let{scrollLeft:n,scrollTop:r}=fo({layoutX:t.x,layoutY:t.y,nodeWidth:f,nodeHeight:p,zoom:1,viewportClientWidth:e.clientWidth,viewportClientHeight:e.clientHeight,scrollWidth:e.scrollWidth,scrollHeight:e.scrollHeight});e.scrollLeft=n,e.scrollTop=r},[D,e,T,F,ne,f,p]),(0,c.useEffect)(()=>{if(!k)return;let e=()=>A(null),t=t=>{t.key===`Escape`&&e()};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[k]),(0,c.useEffect)(()=>{let e=N.current;if(!e)return;let t=t=>{if(t.preventDefault(),t.ctrlKey){let n=e.getBoundingClientRect(),r=t.clientX-n.left,i=t.clientY-n.top,a=e.scrollLeft,o=e.scrollTop;b(e=>{let n=Math.max(.4,Math.min(2.5,e*(1-t.deltaY*.003)));return P.current={x:(a+r)/e*n-r,y:(o+i)/e*n-i},n})}else e.scrollLeft+=t.deltaX,e.scrollTop+=t.deltaY};return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},[]);let ie=(0,c.useCallback)((e,t,n)=>{let r=T.get(e);return{x:t+(r?.dx??0),y:n+(r?.dy??0)}},[T]),ae=_!==null&&ne.has(_)?_:null,oe=ae?ne.get(ae)??null:null;if(To(oe,y,f,p,x,ie,N,w),ne.size===0)return(0,u.jsx)(`div`,{className:`dependency-graph dependency-graph--empty dependency-graph--${o}${a?` dependency-graph--fullscreen`:``}`,children:(0,u.jsx)($r,{icon:`↔`,headline:`No lineage available`,subtext:`This resource could not be placed on the lineage canvas.`})});let se=ro(n,s),ce=Ga(h,re);return(0,u.jsx)(wo,{model:e,displayMode:o,fullscreen:a,lensMode:n,legendItems:se,activeLegendKeys:r,onToggleLegendKey:i,zoom:y,setZoom:b,nodeOffsets:T,setNodeOffsets:E,visibleNodeLayouts:ne,visibleEdges:re,highlightedIds:ce,hasHoverFocus:ce.size>0,getEffectivePos:ie,svgWidth:d,svgHeight:l,nodeWidth:f,nodeHeight:p,nodeRadius:m,viewportRef:N,panDragRef:j,nodeDragRef:M,onSelectResource:t,setHoveredId:g,setTooltipNodeId:v,setContextMenu:A,setViewportTick:S,tooltipLayout:oe,tooltipPosition:C,contextMenu:k})}function Do({resource:e,dependencySummary:t,dependencyIndex:n,resourceById:r,upstreamDepth:i,downstreamDepth:a,allDepsMode:o,lensMode:s,activeLegendKeys:l,setUpstreamDepth:d,setDownstreamDepth:f,setAllDepsMode:p,setLensMode:m,setActiveLegendKeys:h,onSelectResource:g,displayMode:_=`focused`,openFullscreen:v=!1,onFullscreenChange:y,fullscreenScope:b=`viewport`}){let[x,S]=(0,c.useState)(!1);(0,c.useEffect)(()=>{S(v)},[v]);let C=(0,c.useCallback)(e=>{S(e),y?.(e)},[y]);(0,c.useEffect)(()=>{if(!x)return;let e=e=>{e.key===`Escape`&&C(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[x,C]),(0,c.useEffect)(()=>{if(!x||typeof document>`u`)return;let e=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=e}},[x]);let w=e=>{h(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},T=(0,c.useMemo)(()=>Wa({resource:e,dependencySummary:t,dependencyIndex:n,resourceById:r,upstreamDepth:o?20:i,downstreamDepth:o?20:a,displayMode:_}),[o,n,t,_,a,e,r,i]),E=()=>(0,u.jsxs)(`div`,{className:`lineage-toolbar`,children:[(0,u.jsx)(uo,{lensMode:s,setLensMode:m}),(0,u.jsx)(lo,{upstreamDepth:i,downstreamDepth:a,allDepsMode:o,setUpstreamDepth:d,setDownstreamDepth:f,setAllDepsMode:p}),(0,u.jsx)(so,{label:`Upstream`,value:i,setValue:d,disabled:o}),(0,u.jsx)(so,{label:`Downstream`,value:a,setValue:f,disabled:o}),l.size>0&&(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:()=>h(new Set),children:`Clear filters`}),_===`focused`&&!x?(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:()=>C(!0),children:`Expand`}):null]}),D=_===`summary`?(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:()=>C(!0),children:`Expand lineage`}):void 0,O=x?(0,u.jsxs)(`div`,{className:`lineage-dialog lineage-dialog--${b}`,role:`dialog`,"aria-modal":`true`,children:[(0,u.jsx)(`button`,{type:`button`,className:`lineage-dialog__backdrop`,"aria-label":`Dismiss lineage overlay`,onClick:()=>C(!1)}),(0,u.jsxs)(`section`,{className:`lineage-dialog__panel`,children:[(0,u.jsxs)(`div`,{className:`lineage-dialog__header`,children:[(0,u.jsxs)(`div`,{className:`lineage-dialog__header-main`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`p`,{className:`eyebrow`,children:`Lineage`}),(0,u.jsx)(`h3`,{children:e.name}),(0,u.jsx)(`p`,{className:`lineage-dialog__subtitle`,children:`Exact dependency graph with staged upstream and downstream columns.`})]}),(0,u.jsx)(`button`,{type:`button`,className:`lineage-dialog__close`,"aria-label":`Close lineage graph`,onClick:()=>C(!1),children:(0,u.jsx)(`span`,{"aria-hidden":`true`,children:`×`})})]}),(0,u.jsx)(`div`,{className:`lineage-dialog__toolbar`,children:E()})]}),(0,u.jsx)(Eo,{model:T,onSelectResource:g,lensMode:s,activeLegendKeys:l,onToggleLegendKey:w,displayMode:`focused`,fullscreen:!0})]})]}):null;return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(yi,{title:_===`summary`?`Lineage graph`:`Lineage`,subtitle:_===`summary`?void 0:`Exact upstream and downstream lineage for ${e.name}.`,headerRight:_===`focused`?E():D,children:(0,u.jsxs)(`div`,{className:`lineage-summary lineage-summary--${_}`,children:[(0,u.jsxs)(`div`,{className:`lineage-summary__stats`,children:[(0,u.jsxs)(`div`,{className:`lineage-summary__stat`,children:[(0,u.jsx)(`span`,{children:`Selected resource`}),(0,u.jsx)(`strong`,{children:Dr(e.resourceType)})]}),(0,u.jsxs)(`div`,{className:`lineage-summary__stat`,children:[(0,u.jsx)(`span`,{children:`Direct upstream`}),(0,u.jsx)(`strong`,{children:t?.upstreamCount??0})]}),(0,u.jsxs)(`div`,{className:`lineage-summary__stat`,children:[(0,u.jsx)(`span`,{children:`Direct downstream`}),(0,u.jsx)(`strong`,{children:t?.downstreamCount??0})]})]}),(0,u.jsx)(Eo,{model:T,onSelectResource:g,lensMode:s,activeLegendKeys:l,onToggleLegendKey:w,displayMode:_})]})}),O&&typeof document<`u`&&(0,da.createPortal)(O,document.body)]})}function Oo(e,t){return t===`asc`?e:-e}function ko(e){return e.statusTone===`danger`||e.statusTone===`warning`?0:e.statusTone===`positive`?1:e.statusTone===`skipped`?2:3}function Ao(e,t){return(t.executionTime??-1/0)-(e.executionTime??-1/0)}function jo(e,t){return e===0?0:t===`asc`?-e:e}function Mo(e,t,n){let r=e.name.localeCompare(t.name);return r===0?e.uniqueId.localeCompare(t.uniqueId):Oo(r,n)}function No(e,t,n){let r=Ao(e,t);return r===0?e.name.localeCompare(t.name):jo(r,n)}function Po(e,t,n){let r=Dr(e.resourceType).localeCompare(Dr(t.resourceType));return r===0?e.name.localeCompare(t.name):Oo(r,n)}function Fo(e,t,n){let r=(e.testAttachedTarget??``).trim(),i=(t.testAttachedTarget??``).trim(),a=r.localeCompare(i);return a===0?e.name.localeCompare(t.name):Oo(a,n)}function Io(e,t,n){let r=ko(e)-ko(t);if(r!==0)return-Oo(r,n);let i=Ao(e,t);if(i!==0)return jo(i,n);let a=e.name.localeCompare(t.name);return a===0?e.uniqueId.localeCompare(t.uniqueId):Oo(a,n)}function Lo(e,t,n,r){switch(n){case`test`:return Mo(e,t,r);case`duration`:return No(e,t,r);case`type`:return Po(e,t,r);case`target`:return Fo(e,t,r);case`status`:return Io(e,t,r);default:return n}}function Ro(e,t,n){return[...e].sort((e,r)=>Lo(e,r,t,n))}function zo(e){return e.total===0?{label:`No attached tests`,tone:`neutral`,detail:`No quality evidence was linked to this asset in the current artifacts.`}:e.attention>0?{label:`Attention needed`,tone:`warning`,detail:`${e.attention} attention item${e.attention===1?``:`s`} across ${e.total} attached tests.`}:{label:`All attached tests passing`,tone:`positive`,detail:`${e.passing} of ${e.total} attached tests passed in the current artifacts.`}}function Bo(e,t,n){return e===t?n===`asc`?{indicator:`↑`,ariaSort:`ascending`}:{indicator:`↓`,ariaSort:`descending`}:{indicator:` `,ariaSort:`none`}}function Vo(e,t,n){return e===t?n===`asc`?`desc`:`asc`:t===`status`||t===`duration`?`desc`:`asc`}var Ho=[{key:`test`,label:`Test`,alignEnd:!1,testCell:!0},{key:`status`,label:`Status`,alignEnd:!1,testCell:!1},{key:`type`,label:`Type`,alignEnd:!1,testCell:!1},{key:`target`,label:`Target`,alignEnd:!1,testCell:!1},{key:`duration`,label:`Duration`,alignEnd:!0,testCell:!1}];function Uo({resource:e,analysis:t,onNavigateTo:n}){let[r,i]=(0,c.useState)(`status`),[a,o]=(0,c.useState)(`desc`),s=(0,c.useMemo)(()=>ha(e.uniqueId,t.resources,t.dependencyIndex),[t.dependencyIndex,t.resources,e.uniqueId]),l=zo(s),d=(0,c.useMemo)(()=>Ro(s.tests,r,a),[s.tests,a,r]),f=e=>{o(t=>Vo(r,e,t)),i(e)};return(0,u.jsxs)(yi,{title:`Tests`,subtitle:`Quality evidence and related dependency posture.`,children:[(0,u.jsxs)(`div`,{className:`asset-tests-summary`,children:[(0,u.jsxs)(`div`,{className:`asset-tests-summary__headline`,children:[(0,u.jsx)(`span`,{className:`tone-badge tone-badge--${l.tone}`,children:l.label}),(0,u.jsx)(`p`,{children:l.detail})]}),(0,u.jsxs)(`div`,{className:`asset-tests-summary__metrics`,"aria-label":`Test summary`,children:[(0,u.jsxs)(`span`,{className:`asset-tests-summary__metric`,children:[(0,u.jsx)(`strong`,{children:s.total}),(0,u.jsx)(`span`,{children:`Attached tests`})]}),(0,u.jsxs)(`span`,{className:`asset-tests-summary__metric`,children:[(0,u.jsx)(`strong`,{children:s.passing}),(0,u.jsx)(`span`,{children:`Passing`})]}),(0,u.jsxs)(`span`,{className:`asset-tests-summary__metric`,children:[(0,u.jsx)(`strong`,{children:s.attention}),(0,u.jsx)(`span`,{children:`Attention items`})]})]})]}),s.tests.length===0?(0,u.jsx)(`p`,{className:`resource-spotlight__description resource-spotlight__description--muted`,children:`No attached tests were found for this asset in the current artifacts.`}):(0,u.jsxs)(`div`,{className:`asset-tests-table`,"aria-label":`Attached tests evidence`,children:[(0,u.jsx)(`div`,{className:`asset-tests-table__toolbar`,children:(0,u.jsx)(`p`,{className:`asset-tests-table__caption`,children:`Compare attached test evidence by status, target, duration, and type. Failed and warned tests include run messages when dbt provides them.`})}),(0,u.jsxs)(`div`,{className:`asset-tests-table__header`,role:`row`,children:[Ho.map(({key:e,label:t,alignEnd:n,testCell:i})=>{let o=Bo(r,e,a);return(0,u.jsx)(`div`,{className:`asset-tests-table__cell${i?` asset-tests-table__cell--test`:``}${n?` asset-tests-table__cell--align-end`:``}`,role:`columnheader`,"aria-sort":o.ariaSort,children:(0,u.jsxs)(`button`,{type:`button`,className:`asset-tests-table__sort-button${n?` asset-tests-table__sort-button--align-end`:``}`,onClick:()=>f(e),children:[t,(0,u.jsx)(`span`,{className:`asset-tests-table__sort-indicator`,"aria-hidden":`true`,children:o.indicator})]})},e)}),(0,u.jsx)(`div`,{className:`asset-tests-table__cell asset-tests-table__cell--align-end`,role:`columnheader`,children:`Action`})]}),(0,u.jsx)(`div`,{className:`asset-tests-table__body`,children:d.map(e=>{let t=e.runResultMessage!=null&&e.runResultMessage!==``&&(e.statusTone===`danger`||e.statusTone===`warning`),r=e.testAttachedTarget?`Open ${e.name} (${e.testAttachedTarget}) in runs`:`Open ${e.name} in runs`;return(0,u.jsxs)(`div`,{className:`asset-tests-table__row-group`,children:[(0,u.jsxs)(`button`,{type:`button`,className:`asset-tests-table__row`,"aria-label":r,onClick:()=>n(`runs`,{executionId:e.uniqueId}),children:[(0,u.jsxs)(`div`,{className:`asset-tests-table__cell asset-tests-table__cell--test`,children:[(0,u.jsx)(`strong`,{title:e.name,children:e.name}),(0,u.jsx)(`span`,{className:`asset-tests-table__pkg`,children:e.packageName||`workspace`})]}),(0,u.jsx)(`div`,{className:`asset-tests-table__cell`,"data-label":`Status`,children:(0,u.jsx)(`span`,{className:Mr(e.statusTone),children:e.status??`Not executed`})}),(0,u.jsx)(`div`,{className:`asset-tests-table__cell`,"data-label":`Type`,children:(0,u.jsx)(bi,{resourceType:e.resourceType})}),(0,u.jsx)(`div`,{className:`asset-tests-table__cell asset-tests-table__cell--target`,"data-label":`Target`,title:e.testAttachedTarget??void 0,children:e.testAttachedTarget??`—`}),(0,u.jsx)(`div`,{className:`asset-tests-table__cell asset-tests-table__cell--align-end`,"data-label":`Duration`,children:Er(e.executionTime)}),(0,u.jsx)(`div`,{className:`asset-tests-table__cell asset-tests-table__cell--align-end asset-tests-table__cell--action`,"data-label":`Action`,children:(0,u.jsx)(`span`,{className:`asset-tests-table__open-runs-icon`,"aria-hidden":`true`,children:(0,u.jsxs)(`svg`,{viewBox:`0 0 16 16`,width:`18`,height:`18`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.35`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,u.jsx)(`path`,{d:`M4.25 11.75 11.25 4.75`}),(0,u.jsx)(`path`,{d:`M5.5 4.75h5.75v5.75`})]})})})]}),t?(0,u.jsx)(`div`,{className:`asset-tests-table__run-message${e.statusTone===`warning`?` asset-tests-table__run-message--warn`:``}`,role:`note`,"aria-label":`dbt message for ${e.name}`,children:e.runResultMessage}):null]},e.uniqueId)})})]})]})}function Wo(e,t){let[n,r]=(0,c.useState)(null),[i,a]=(0,c.useState)(null),[o,s]=(0,c.useState)(!1),[l,u]=(0,c.useState)(null),d=(0,c.useRef)(0);return(0,c.useEffect)(()=>{d.current+=1;let t=d.current;if(!e){r(null),a(null),u(null),s(!1);return}let n=!1;return r(null),a(null),s(!0),u(null),w(e).then(e=>{n||d.current!==t||(r(e.compiledCode),a(e.rawCode))}).catch(e=>{n||d.current!==t||(r(null),a(null),u(e instanceof Error?e.message:`Failed to load SQL`))}).finally(()=>{!n&&d.current===t&&s(!1)}),()=>{n=!0}},[t,e]),{compiledCode:n,rawCode:i,loading:o,error:l}}function Go(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Ko=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,qo=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Jo={};function Yo(e,t){return((t||Jo).jsx?qo:Ko).test(e)}var Xo=/[ \t\n\f\r]/g;function Zo(e){return typeof e==`object`?e.type===`text`?Qo(e.value):!1:Qo(e)}function Qo(e){return e.replace(Xo,``)===``}var $o=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};$o.prototype.normal={},$o.prototype.property={},$o.prototype.space=void 0;function es(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new $o(n,r,t)}function ts(e){return e.toLowerCase()}var ns=class{constructor(e,t){this.attribute=t,this.property=e}};ns.prototype.attribute=``,ns.prototype.booleanish=!1,ns.prototype.boolean=!1,ns.prototype.commaOrSpaceSeparated=!1,ns.prototype.commaSeparated=!1,ns.prototype.defined=!1,ns.prototype.mustUseProperty=!1,ns.prototype.number=!1,ns.prototype.overloadedBoolean=!1,ns.prototype.property=``,ns.prototype.spaceSeparated=!1,ns.prototype.space=void 0;var rs=e({boolean:()=>U,booleanish:()=>W,commaOrSpaceSeparated:()=>ss,commaSeparated:()=>os,number:()=>G,overloadedBoolean:()=>as,spaceSeparated:()=>K}),is=0,U=cs(),W=cs(),as=cs(),G=cs(),K=cs(),os=cs(),ss=cs();function cs(){return 2**++is}var ls=Object.keys(rs),us=class extends ns{constructor(e,t,n,r){let i=-1;if(super(e,t),ds(this,`space`,r),typeof n==`number`)for(;++i<ls.length;){let e=ls[i];ds(this,ls[i],(n&rs[e])===rs[e])}}};us.prototype.defined=!0;function ds(e,t,n){n&&(e[t]=n)}function fs(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new us(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[ts(r)]=r,n[ts(a.attribute)]=r}return new $o(t,n,e.space)}var ps=fs({properties:{ariaActiveDescendant:null,ariaAtomic:W,ariaAutoComplete:null,ariaBusy:W,ariaChecked:W,ariaColCount:G,ariaColIndex:G,ariaColSpan:G,ariaControls:K,ariaCurrent:null,ariaDescribedBy:K,ariaDetails:null,ariaDisabled:W,ariaDropEffect:K,ariaErrorMessage:null,ariaExpanded:W,ariaFlowTo:K,ariaGrabbed:W,ariaHasPopup:null,ariaHidden:W,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:K,ariaLevel:G,ariaLive:null,ariaModal:W,ariaMultiLine:W,ariaMultiSelectable:W,ariaOrientation:null,ariaOwns:K,ariaPlaceholder:null,ariaPosInSet:G,ariaPressed:W,ariaReadOnly:W,ariaRelevant:null,ariaRequired:W,ariaRoleDescription:K,ariaRowCount:G,ariaRowIndex:G,ariaRowSpan:G,ariaSelected:W,ariaSetSize:G,ariaSort:null,ariaValueMax:G,ariaValueMin:G,ariaValueNow:G,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function ms(e,t){return t in e?e[t]:t}function hs(e,t){return ms(e,t.toLowerCase())}var gs=fs({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:os,acceptCharset:K,accessKey:K,action:null,allow:null,allowFullScreen:U,allowPaymentRequest:U,allowUserMedia:U,alt:null,as:null,async:U,autoCapitalize:null,autoComplete:K,autoFocus:U,autoPlay:U,blocking:K,capture:null,charSet:null,checked:U,cite:null,className:K,cols:G,colSpan:null,content:null,contentEditable:W,controls:U,controlsList:K,coords:G|os,crossOrigin:null,data:null,dateTime:null,decoding:null,default:U,defer:U,dir:null,dirName:null,disabled:U,download:as,draggable:W,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:U,formTarget:null,headers:K,height:G,hidden:as,high:G,href:null,hrefLang:null,htmlFor:K,httpEquiv:K,id:null,imageSizes:null,imageSrcSet:null,inert:U,inputMode:null,integrity:null,is:null,isMap:U,itemId:null,itemProp:K,itemRef:K,itemScope:U,itemType:K,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:U,low:G,manifest:null,max:null,maxLength:G,media:null,method:null,min:null,minLength:G,multiple:U,muted:U,name:null,nonce:null,noModule:U,noValidate:U,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:U,optimum:G,pattern:null,ping:K,placeholder:null,playsInline:U,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:U,referrerPolicy:null,rel:K,required:U,reversed:U,rows:G,rowSpan:G,sandbox:K,scope:null,scoped:U,seamless:U,selected:U,shadowRootClonable:U,shadowRootDelegatesFocus:U,shadowRootMode:null,shape:null,size:G,sizes:null,slot:null,span:G,spellCheck:W,src:null,srcDoc:null,srcLang:null,srcSet:null,start:G,step:null,style:null,tabIndex:G,target:null,title:null,translate:null,type:null,typeMustMatch:U,useMap:null,value:W,width:G,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:K,axis:null,background:null,bgColor:null,border:G,borderColor:null,bottomMargin:G,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:U,declare:U,event:null,face:null,frame:null,frameBorder:null,hSpace:G,leftMargin:G,link:null,longDesc:null,lowSrc:null,marginHeight:G,marginWidth:G,noResize:U,noHref:U,noShade:U,noWrap:U,object:null,profile:null,prompt:null,rev:null,rightMargin:G,rules:null,scheme:null,scrolling:W,standby:null,summary:null,text:null,topMargin:G,valueType:null,version:null,vAlign:null,vLink:null,vSpace:G,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:U,disableRemotePlayback:U,prefix:null,property:null,results:G,security:null,unselectable:null},space:`html`,transform:hs}),_s=fs({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:ss,accentHeight:G,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:G,amplitude:G,arabicForm:null,ascent:G,attributeName:null,attributeType:null,azimuth:G,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:G,by:null,calcMode:null,capHeight:G,className:K,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:G,diffuseConstant:G,direction:null,display:null,dur:null,divisor:G,dominantBaseline:null,download:U,dx:null,dy:null,edgeMode:null,editable:null,elevation:G,enableBackground:null,end:null,event:null,exponent:G,externalResourcesRequired:null,fill:null,fillOpacity:G,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:os,g2:os,glyphName:os,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:G,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:G,horizOriginX:G,horizOriginY:G,id:null,ideographic:G,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:G,k:G,k1:G,k2:G,k3:G,k4:G,kernelMatrix:ss,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:G,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:G,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:G,overlineThickness:G,paintOrder:null,panose1:null,path:null,pathLength:G,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:K,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:G,pointsAtY:G,pointsAtZ:G,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ss,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ss,rev:ss,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ss,requiredFeatures:ss,requiredFonts:ss,requiredFormats:ss,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:G,specularExponent:G,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:G,strikethroughThickness:G,string:null,stroke:null,strokeDashArray:ss,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:G,strokeOpacity:G,strokeWidth:null,style:null,surfaceScale:G,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ss,tabIndex:G,tableValues:null,target:null,targetX:G,targetY:G,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ss,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:G,underlineThickness:G,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:G,values:null,vAlphabetic:G,vMathematical:G,vectorEffect:null,vHanging:G,vIdeographic:G,version:null,vertAdvY:G,vertOriginX:G,vertOriginY:G,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:G,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:ms}),vs=fs({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),ys=fs({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:hs}),bs=fs({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),xs={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},Ss=/[A-Z]/g,Cs=/-[a-z]/g,ws=/^data[-\w.:]+$/i;function Ts(e,t){let n=ts(t),r=t,i=ns;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&ws.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Cs,Ds);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Cs.test(e)){let n=e.replace(Ss,Es);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=us}return new i(r,t)}function Es(e){return`-`+e.toLowerCase()}function Ds(e){return e.charAt(1).toUpperCase()}var Os=es([ps,gs,vs,ys,bs],`html`),ks=es([ps,_s,vs,ys,bs],`svg`);function As(e){return e.join(` `).trim()}var js=n(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g,u=`
|
|
3
|
+
`,d=`/`,f=`*`,p=``,m=`comment`,h=`declaration`;function g(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,g=1;function v(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(u);g=~n?e.length-n:g+e.length}function y(){var e={line:l,column:g};return function(t){return t.position=new b(e),C(),t}}function b(e){this.start=e,this.end={line:l,column:g},this.source=t.source}b.prototype.content=e;function x(n){var r=Error(t.source+`:`+l+`:`+g+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=g,r.source=e,!t.silent)throw r}function S(t){var n=t.exec(e);if(n){var r=n[0];return v(r),e=e.slice(r.length),n}}function C(){S(i)}function w(e){var t;for(e||=[];t=T();)t!==!1&&e.push(t);return e}function T(){var t=y();if(!(d!=e.charAt(0)||f!=e.charAt(1))){for(var n=2;p!=e.charAt(n)&&(f!=e.charAt(n)||d!=e.charAt(n+1));)++n;if(n+=2,p===e.charAt(n-1))return x(`End of comment missing`);var r=e.slice(2,n-2);return g+=2,v(r),e=e.slice(n),g+=2,t({type:m,comment:r})}}function E(){var e=y(),t=S(a);if(t){if(T(),!S(o))return x(`property missing ':'`);var r=S(s),i=e({type:h,property:_(t[0].replace(n,p)),value:r?_(r[0].replace(n,p)):p});return S(c),i}}function D(){var e=[];w(e);for(var t;t=E();)t!==!1&&(e.push(t),w(e));return e}return C(),D()}function _(e){return e?e.replace(l,p):p}t.exports=g})),Ms=n((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.default=r;var n=t(js());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),Ns=n((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),Ps=n(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(Ms()),r=Ns();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),Fs=Ls(`end`),Is=Ls(`start`);function Ls(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function Rs(e){let t=Is(e),n=Fs(e);if(t&&n)return{start:t,end:n}}function zs(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Vs(e.position):`start`in e||`end`in e?Vs(e):`line`in e||`column`in e?Bs(e):``}function Bs(e){return Hs(e&&e.line)+`:`+Hs(e&&e.column)}function Vs(e){return Bs(e&&e.start)+`-`+Bs(e&&e.end)}function Hs(e){return e&&typeof e==`number`?e:1}var q=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=zs(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};q.prototype.file=``,q.prototype.name=``,q.prototype.reason=``,q.prototype.message=``,q.prototype.stack=``,q.prototype.column=void 0,q.prototype.line=void 0,q.prototype.ancestors=void 0,q.prototype.cause=void 0,q.prototype.fatal=void 0,q.prototype.place=void 0,q.prototype.ruleId=void 0,q.prototype.source=void 0;var Us=t(Ps(),1),Ws={}.hasOwnProperty,Gs=new Map,Ks=/[A-Z]/g,qs=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Js=new Set([`td`,`th`]),Ys=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Xs(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=sc(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=oc(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?ks:Os,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Zs(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Zs(e,t,n){if(t.type===`element`)return Qs(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return $s(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return tc(e,t,n);if(t.type===`mdxjsEsm`)return ec(e,t);if(t.type===`root`)return nc(e,t,n);if(t.type===`text`)return rc(e,t)}function Qs(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=ks,e.schema=i),e.ancestors.push(t);let a=pc(e,t.tagName,!1),o=cc(e,t),s=uc(e,t);return qs.has(t.tagName)&&(s=s.filter(function(e){return typeof e==`string`?!Zo(e):!0})),ic(e,o,a,t),ac(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function $s(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}mc(e,t.position)}function ec(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);mc(e,t.position)}function tc(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=ks,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:pc(e,t.name,!0),o=lc(e,t),s=uc(e,t);return ic(e,o,a,t),ac(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function nc(e,t,n){let r={};return ac(r,uc(e,t)),e.create(t,e.Fragment,r,n)}function rc(e,t){return t.value}function ic(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function ac(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function oc(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function sc(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=Is(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function cc(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&Ws.call(t.properties,i)){let a=dc(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Js.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function lc(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else mc(e,t.position);else{let i=r.name,a;if(r.value&&typeof r.value==`object`)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else mc(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function uc(e,t){let n=[],r=-1,i=e.passKeys?new Map:Gs;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=Zs(e,a,o);s!==void 0&&n.push(s)}return n}function dc(e,t,n){let r=Ts(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Go(n):As(n)),r.property===`style`){let t=typeof n==`object`?n:fc(e,String(n));return e.stylePropertyNameCase===`css`&&(t=hc(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?xs[r.property]||r.property:r.attribute,n]}}function fc(e,t){try{return(0,Us.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new q("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=Ys+`#cannot-parse-style-attribute`,r}}function pc(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=Yo(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=Yo(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return Ws.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);mc(e)}function mc(e,t){let n=new q("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=Ys+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function hc(e){let t={},n;for(n in e)Ws.call(e,n)&&(t[gc(n)]=e[n]);return t}function gc(e){let t=e.replace(Ks,_c);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function _c(e){return`-`+e.toLowerCase()}var vc={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},yc={};function bc(e,t){let n=t||yc;return xc(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function xc(e,t,n){if(Cc(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return Sc(e.children,t,n)}return Array.isArray(e)?Sc(e,t,n):``}function Sc(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=xc(e[i],t,n);return r.join(``)}function Cc(e){return!!(e&&typeof e==`object`)}var wc=document.createElement(`i`);function Tc(e){let t=`&`+e+`;`;wc.innerHTML=t;let n=wc.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`||n===t?!1:n}function Ec(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function Dc(e,t){return e.length>0?(Ec(e,e.length,0,t),e):t}var Oc={}.hasOwnProperty;function kc(e){let t={},n=-1;for(;++n<e.length;)Ac(t,e[n]);return t}function Ac(e,t){let n;for(n in t){let r=(Oc.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){Oc.call(r,a)||(r[a]=[]);let e=i[a];jc(r[a],Array.isArray(e)?e:e?[e]:[])}}}function jc(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);Ec(e,0,0,r)}function Mc(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function Nc(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var Pc=Hc(/[A-Za-z]/),J=Hc(/[\dA-Za-z]/),Fc=Hc(/[#-'*+\--9=?A-Z^-~]/);function Ic(e){return e!==null&&(e<32||e===127)}var Lc=Hc(/\d/),Rc=Hc(/[\dA-Fa-f]/),zc=Hc(/[!-/:-@[-`{-~]/);function Y(e){return e!==null&&e<-2}function X(e){return e!==null&&(e<0||e===32)}function Z(e){return e===-2||e===-1||e===32}var Bc=Hc(/\p{P}|\p{S}/u),Vc=Hc(/\s/);function Hc(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Uc(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&J(e.charCodeAt(n+1))&&J(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function Q(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return Z(r)?(e.enter(n),s(r)):t(r)}function s(r){return Z(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var Wc={tokenize:Gc};function Gc(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Q(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return Y(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var Kc={tokenize:Jc},qc={tokenize:Yc};function Jc(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return Ec(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(qc,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(qc,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return Y(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;Ec(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-- >r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Yc(e,t,n){return Q(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function Xc(e){if(e===null||X(e)||Vc(e))return 1;if(Bc(e))return 2}function Zc(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var Qc={name:`attention`,resolveAll:$c,tokenize:el};function $c(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};tl(d,-c),tl(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=Dc(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=Dc(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=Dc(l,Zc(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=Dc(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=Dc(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,Ec(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function el(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Xc(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=Xc(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function tl(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var nl={name:`autolink`,tokenize:rl};function rl(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return Pc(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||J(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||J(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||Ic(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Fc(t)?(e.consume(t),l):n(t)}function u(e){return J(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||J(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var il={partial:!0,tokenize:al};function al(e,t,n){return r;function r(t){return Z(t)?Q(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||Y(e)?t(e):n(e)}}var ol={continuation:{tokenize:cl},exit:ll,name:`blockQuote`,tokenize:sl};function sl(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return Z(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function cl(e,t,n){let r=this;return i;function i(t){return Z(t)?Q(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(ol,t,n)(r)}}function ll(e){e.exit(`blockQuote`)}var ul={name:`characterEscape`,tokenize:dl};function dl(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return zc(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var fl={name:`characterReference`,tokenize:pl};function pl(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=J,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=Rc,u):(e.enter(`characterReferenceValue`),a=7,o=Lc,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===J&&!Tc(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var ml={partial:!0,tokenize:_l},hl={concrete:!0,name:`codeFenced`,tokenize:gl};function gl(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),Z(t)?Q(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||Y(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(ml,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||Y(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):Z(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),Q(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||Y(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||Y(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&Z(t)?Q(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||Y(t)?e.check(ml,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||Y(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),Z(t)?Q(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),Z(t)?Q(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||Y(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function _l(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var vl={name:`codeIndented`,tokenize:bl},yl={partial:!0,tokenize:xl};function bl(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),Q(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):Y(t)?e.attempt(yl,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||Y(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function xl(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):Q(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):Y(e)?i(e):n(e)}}var Sl={name:`codeText`,previous:wl,resolve:Cl,tokenize:Tl};function Cl(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function wl(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function Tl(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||Y(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var El=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&Dl(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),Dl(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Dl(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);Dl(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);Dl(this.left,t.reverse())}}};function Dl(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Ol(e){let t={},n=-1,r,i,a,o,s,c,l,u=new El(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,kl(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[1].type===`listItemIndent`))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return Ec(e,0,1/0,u.slice(0)),!l}function kl(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var Al={resolve:Ml,tokenize:Nl},jl={partial:!0,tokenize:Pl};function Ml(e){return Ol(e),e}function Nl(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):Y(t)?e.check(jl,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function Pl(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Q(e,a,`linePrefix`)}function a(i){if(i===null||Y(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function Fl(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||Ic(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||Y(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||X(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||Ic(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function Il(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):Y(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||Y(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!Z(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Ll(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Q(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||Y(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function Rl(e,t){let n;return r;function r(i){return Y(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):Z(i)?Q(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var zl={name:`definition`,tokenize:Vl},Bl={partial:!0,tokenize:Hl};function Vl(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Il.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=Nc(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return X(t)?Rl(e,l)(t):l(t)}function l(t){return Fl(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Bl,d,d)(t)}function d(t){return Z(t)?Q(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||Y(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Hl(e,t,n){return r;function r(t){return X(t)?Rl(e,i)(t):n(t)}function i(t){return Ll(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return Z(t)?Q(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||Y(e)?t(e):n(e)}}var Ul={name:`hardBreakEscape`,tokenize:Wl};function Wl(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return Y(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var Gl={name:`headingAtx`,resolve:Kl,tokenize:ql};function Kl(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},Ec(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function ql(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||X(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||Y(n)?(e.exit(`atxHeading`),t(n)):Z(n)?Q(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||X(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var Jl=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),Yl=[`pre`,`script`,`style`,`textarea`],Xl={concrete:!0,name:`htmlFlow`,resolveTo:$l,tokenize:eu},Zl={partial:!0,tokenize:nu},Ql={partial:!0,tokenize:tu};function $l(e){let t=e.length;for(;t--&&!(e[t][0]===`enter`&&e[t][1].type===`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function eu(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:F):Pc(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):Pc(a)?(e.consume(a),i=4,r.interrupt?t:F):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:F):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return Pc(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||X(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Yl.includes(l)?(i=1,r.interrupt?t(s):O(s)):Jl.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||J(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return Z(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||Pc(t)?(e.consume(t),b):Z(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||J(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):Z(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):Z(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||Y(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||X(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||Z(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||Y(t)?O(t):Z(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),te):t===63&&i===3?(e.consume(t),F):t===93&&i===5?(e.consume(t),ee):Y(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Zl,ne,k)(t)):t===null||Y(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(Ql,A,ne)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||Y(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),F):O(t)}function N(t){return t===47?(e.consume(t),o=``,P):O(t)}function P(t){if(t===62){let n=o.toLowerCase();return Yl.includes(n)?(e.consume(t),te):O(t)}return Pc(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),P):O(t)}function ee(t){return t===93?(e.consume(t),F):O(t)}function F(t){return t===62?(e.consume(t),te):t===45&&i===2?(e.consume(t),F):O(t)}function te(t){return t===null||Y(t)?(e.exit(`htmlFlowData`),ne(t)):(e.consume(t),te)}function ne(n){return e.exit(`htmlFlow`),t(n)}}function tu(e,t,n){let r=this;return i;function i(t){return Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function nu(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(il,t,n)}}var ru={name:`htmlText`,tokenize:iu};function iu(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):Pc(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):Pc(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):Y(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):Y(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):Y(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):Y(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return Pc(t)?(e.consume(t),S):n(t)}function S(t){return t===45||J(t)?(e.consume(t),S):C(t)}function C(t){return Y(t)?(o=C,N(t)):Z(t)?(e.consume(t),C):M(t)}function w(t){return t===45||J(t)?(e.consume(t),w):t===47||t===62||X(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||Pc(t)?(e.consume(t),E):Y(t)?(o=T,N(t)):Z(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||J(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):Y(t)?(o=D,N(t)):Z(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):Y(t)?(o=O,N(t)):Z(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):Y(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||X(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||X(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),P}function P(t){return Z(t)?Q(e,ee,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):ee(t)}function ee(t){return e.enter(`htmlTextData`),o(t)}}var au={name:`labelEnd`,resolveAll:lu,resolveTo:uu,tokenize:du},ou={tokenize:fu},su={tokenize:pu},cu={tokenize:mu};function lu(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&Ec(e,0,e.length,n),e}function uu(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=Dc(s,e.slice(a+1,a+r+3)),s=Dc(s,[[`enter`,u,t]]),s=Dc(s,Zc(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=Dc(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=Dc(s,e.slice(o+1)),s=Dc(s,[[`exit`,c,t]]),Ec(e,a,e.length,s),e}function du(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(Nc(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(ou,u,o?u:d)(t):t===91?e.attempt(su,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(cu,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function fu(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return X(t)?Rl(e,a)(t):a(t)}function a(t){return t===41?u(t):Fl(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return X(t)?Rl(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Ll(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return X(t)?Rl(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function pu(e,t,n){let r=this;return i;function i(t){return Il.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(Nc(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function mu(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var hu={name:`labelStartImage`,resolveAll:au.resolveAll,tokenize:gu};function gu(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var _u={name:`labelStartLink`,resolveAll:au.resolveAll,tokenize:vu};function vu(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var yu={name:`lineEnding`,tokenize:bu};function bu(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Q(e,t,`linePrefix`)}}var xu={name:`thematicBreak`,tokenize:Su};function Su(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||Y(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),Z(t)?Q(e,s,`whitespace`)(t):s(t))}}var Cu={continuation:{tokenize:Du},exit:ku,name:`list`,tokenize:Eu},wu={partial:!0,tokenize:Au},Tu={partial:!0,tokenize:Ou};function Eu(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:Lc(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(xu,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return Lc(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(il,r.interrupt?n:u,e.attempt(wu,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return Z(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function Du(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(il,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Q(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!Z(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Tu,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Q(e,e.attempt(Cu,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function Ou(e,t,n){let r=this;return Q(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function ku(e){e.exit(this.containerState.type)}function Au(e,t,n){let r=this;return Q(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!Z(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var ju={name:`setextUnderline`,resolveTo:Mu,tokenize:Nu};function Mu(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function Nu(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),Z(t)?Q(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||Y(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var Pu={tokenize:Fu};function Fu(e){let t=this,n=e.attempt(il,r,e.attempt(this.parser.constructs.flowInitial,i,Q(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Al,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var Iu={resolveAll:Bu()},Lu=zu(`string`),Ru=zu(`text`);function zu(e){return{resolveAll:Bu(e===`text`?Vu:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function Bu(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function Vu(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var Hu=e({attentionMarkers:()=>Xu,contentInitial:()=>Wu,disable:()=>Zu,document:()=>Uu,flow:()=>Ku,flowInitial:()=>Gu,insideSpan:()=>Yu,string:()=>qu,text:()=>Ju}),Uu={42:Cu,43:Cu,45:Cu,48:Cu,49:Cu,50:Cu,51:Cu,52:Cu,53:Cu,54:Cu,55:Cu,56:Cu,57:Cu,62:ol},Wu={91:zl},Gu={[-2]:vl,[-1]:vl,32:vl},Ku={35:Gl,42:xu,45:[ju,xu],60:Xl,61:ju,95:xu,96:hl,126:hl},qu={38:fl,92:ul},Ju={[-5]:yu,[-4]:yu,[-3]:yu,33:hu,38:fl,42:Qc,60:[nl,ru],91:_u,92:[Ul,ul],93:au,95:Qc,96:Sl},Yu={null:[Qc,Iu]},Xu={null:[42,95]},Zu={null:[]};function Qu(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=Dc(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=Zc(a,l.events,l),l.events):[]}function f(e,t){return ed(p(e),t)}function p(e){return $u(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){Y(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&Ec(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function $u(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function ed(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
4
4
|
`;break;case-3:o=`\r
|
|
5
|
-
`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function $u(e){let t={constructs:Dc([Bu,...(e||{}).extensions||[]]),content:n(Hc),defined:[],document:n(Wc),flow:n(Mu),lazy:{},string:n(Fu),text:n(Iu)};return t;function n(e){return n;function n(n){return Xu(t,e,n)}}}function ed(e){for(;!El(e););return e}var td=/[\0\t\n\r]/g;function nd(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(td.lastIndex=u,c=td.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var rd=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function id(e){return e.replace(rd,ad)}function ad(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return Ac(n.slice(t?2:1),t?16:10)}return Cc(n)||e}var od={}.hasOwnProperty;function sd(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),cd(n)(ed($u(n).document().write(nd()(e,t,!0))))}function cd(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(ye),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(he),blockQuote:a(ue),characterEscape:T,characterReference:T,codeFenced:a(de),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(de,o),codeText:a(fe,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(pe),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(me),hardBreakEscape:a(ge),hardBreakTrailing:a(ge),htmlFlow:a(_e,o),htmlFlowData:T,htmlText:a(_e,o),htmlTextData:T,image:a(ve),label:o,link:a(ye),listItem:a(xe),listItemValue:f,listOrdered:a(be,d),listUnordered:a(be),paragraph:a(Se),reference:re,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(he),strong:a(Ce),thematicBreak:a(Te)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:le,autolinkProtocol:ce,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:ae,characterReferenceMarkerNumeric:ae,characterReferenceValue:oe,characterReference:se,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(j),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(N),label:ee,labelText:P,lineEnding:D,link:c(M),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ie,resourceDestinationString:F,resourceTitleString:te,resource:ne,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};ud(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];od.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||fd).call(a,void 0,e[0])}for(r.position={start:ld(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:ld(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(!(t[1].type===`linePrefix`||t[1].type===`blockQuotePrefix`||t[1].type===`blockQuotePrefixWhitespace`||t[1].type===`blockQuoteMarker`||t[1].type===`listItemIndent`))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:ld(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||fd).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+Ls({start:e.start,end:e.end})+`): it’s not open`);n.position.end=ld(e.end)}function u(){return vc(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=jc(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=we(),n.position={start:ld(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=ld(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=ld(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function N(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function P(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=id(t),n.identifier=jc(t).toLowerCase()}function ee(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function F(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function te(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function ne(){this.data.inReference=void 0}function re(){this.data.referenceType=`collapsed`}function ie(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=jc(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function ae(e){this.data.characterReferenceType=e.type}function oe(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=Ac(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=Cc(t);let i=this.stack[this.stack.length-1];i.value+=r}function se(e){let t=this.stack.pop();t.position.end=ld(e.end)}function ce(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function le(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function ue(){return{type:`blockquote`,children:[]}}function de(){return{type:`code`,lang:null,meta:null,value:``}}function fe(){return{type:`inlineCode`,value:``}}function pe(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function me(){return{type:`emphasis`,children:[]}}function he(){return{type:`heading`,depth:0,children:[]}}function ge(){return{type:`break`}}function _e(){return{type:`html`,value:``}}function ve(){return{type:`image`,title:null,url:``,alt:null}}function ye(){return{type:`link`,title:null,url:``,children:[]}}function be(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function xe(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function Se(){return{type:`paragraph`,children:[]}}function Ce(){return{type:`strong`,children:[]}}function we(){return{type:`text`,value:``}}function Te(){return{type:`thematicBreak`}}}function ld(e){return{line:e.line,column:e.column,offset:e.offset}}function ud(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?ud(e,r):dd(e,r)}}function dd(e,t){let n;for(n in t)if(od.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function fd(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+Ls({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ls({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+Ls({start:t.start,end:t.end})+`) is still open`)}function pd(e){let t=this;t.parser=n;function n(n){return sd(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function md(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function hd(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
6
|
-
`}]}function
|
|
7
|
-
`:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function
|
|
5
|
+
`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function td(e){let t={constructs:kc([Hu,...(e||{}).extensions||[]]),content:n(Wc),defined:[],document:n(Kc),flow:n(Pu),lazy:{},string:n(Lu),text:n(Ru)};return t;function n(e){return n;function n(n){return Qu(t,e,n)}}}function nd(e){for(;!Ol(e););return e}var rd=/[\0\t\n\r]/g;function id(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(rd.lastIndex=u,c=rd.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var ad=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function od(e){return e.replace(ad,sd)}function sd(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return Mc(n.slice(t?2:1),t?16:10)}return Tc(n)||e}var cd={}.hasOwnProperty;function ld(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),ud(n)(nd(td(n).document().write(id()(e,t,!0))))}function ud(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(ye),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(he),blockQuote:a(ue),characterEscape:T,characterReference:T,codeFenced:a(de),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(de,o),codeText:a(fe,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(pe),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(me),hardBreakEscape:a(ge),hardBreakTrailing:a(ge),htmlFlow:a(_e,o),htmlFlowData:T,htmlText:a(_e,o),htmlTextData:T,image:a(ve),label:o,link:a(ye),listItem:a(xe),listItemValue:f,listOrdered:a(be,d),listUnordered:a(be),paragraph:a(Se),reference:re,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(he),strong:a(Ce),thematicBreak:a(I)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:le,autolinkProtocol:ce,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:ae,characterReferenceMarkerNumeric:ae,characterReferenceValue:oe,characterReference:se,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(j),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(N),label:ee,labelText:P,lineEnding:D,link:c(M),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ie,resourceDestinationString:F,resourceTitleString:te,resource:ne,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};fd(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];cd.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||md).call(a,void 0,e[0])}for(r.position={start:dd(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:dd(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(!(t[1].type===`linePrefix`||t[1].type===`blockQuotePrefix`||t[1].type===`blockQuotePrefixWhitespace`||t[1].type===`blockQuoteMarker`||t[1].type===`listItemIndent`))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:dd(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||md).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+zs({start:e.start,end:e.end})+`): it’s not open`);n.position.end=dd(e.end)}function u(){return bc(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Nc(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=we(),n.position={start:dd(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=dd(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=dd(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function N(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function P(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=od(t),n.identifier=Nc(t).toLowerCase()}function ee(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function F(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function te(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function ne(){this.data.inReference=void 0}function re(){this.data.referenceType=`collapsed`}function ie(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Nc(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function ae(e){this.data.characterReferenceType=e.type}function oe(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=Mc(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=Tc(t);let i=this.stack[this.stack.length-1];i.value+=r}function se(e){let t=this.stack.pop();t.position.end=dd(e.end)}function ce(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function le(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function ue(){return{type:`blockquote`,children:[]}}function de(){return{type:`code`,lang:null,meta:null,value:``}}function fe(){return{type:`inlineCode`,value:``}}function pe(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function me(){return{type:`emphasis`,children:[]}}function he(){return{type:`heading`,depth:0,children:[]}}function ge(){return{type:`break`}}function _e(){return{type:`html`,value:``}}function ve(){return{type:`image`,title:null,url:``,alt:null}}function ye(){return{type:`link`,title:null,url:``,children:[]}}function be(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function xe(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function Se(){return{type:`paragraph`,children:[]}}function Ce(){return{type:`strong`,children:[]}}function we(){return{type:`text`,value:``}}function I(){return{type:`thematicBreak`}}}function dd(e){return{line:e.line,column:e.column,offset:e.offset}}function fd(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?fd(e,r):pd(e,r)}}function pd(e,t){let n;for(n in t)if(cd.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function md(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+zs({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+zs({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+zs({start:t.start,end:t.end})+`) is still open`)}function hd(e){let t=this;t.parser=n;function n(n){return ld(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function gd(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function _d(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
6
|
+
`}]}function vd(e,t){let n=t.value?t.value+`
|
|
7
|
+
`:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function yd(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function bd(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function xd(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=Uc(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function Sd(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Cd(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function wd(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function Td(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return wd(e,t);let i={src:Uc(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function Ed(e,t){let n={src:Uc(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Dd(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Od(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return wd(e,t);let i={href:Uc(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function kd(e,t){let n={href:Uc(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Ad(e,t,n){let r=e.all(t),i=n?jd(n):Md(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
8
8
|
`}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
9
|
-
`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function
|
|
9
|
+
`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function jd(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=Md(n[r])}return t}function Md(e){return e.spread??e.children.length>1}function Nd(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function Pd(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Fd(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Id(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ld(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=Is(t.children[1]),o=Fs(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function Rd(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function zd(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var Bd=9,Vd=32;function Hd(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(Ud(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(Ud(t.slice(i),i>0,!1)),a.join(``)}function Ud(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===Bd||t===Vd;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===Bd||t===Vd;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function Wd(e,t){let n={type:`text`,value:Hd(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Gd(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var Kd={blockquote:gd,break:_d,code:vd,delete:yd,emphasis:bd,footnoteReference:xd,heading:Sd,html:Cd,imageReference:Td,image:Ed,inlineCode:Dd,linkReference:Od,link:kd,listItem:Ad,list:Nd,paragraph:Pd,root:Fd,strong:Id,table:Ld,tableCell:zd,tableRow:Rd,text:Wd,thematicBreak:Gd,toml:qd,yaml:qd,definition:qd,footnoteDefinition:qd};function qd(){}var Jd=typeof self==`object`?self:globalThis,Yd=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(new Jd[e](t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(new Jd[a](o),i)};return r},Xd=e=>Yd(new Map,e)(0),Zd=``,{toString:Qd}={},{keys:$d}=Object,ef=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=Qd.call(e).slice(8,-1);switch(n){case`Array`:return[1,Zd];case`Object`:return[2,Zd];case`Date`:return[3,Zd];case`RegExp`:return[4,Zd];case`Map`:return[5,Zd];case`Set`:return[6,Zd];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]},tf=([e,t])=>e===0&&(t===`function`||t===`symbol`),nf=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=ef(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of $d(r))(e||!tf(ef(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(tf(ef(n))||tf(ef(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!tf(ef(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},rf=(e,{json:t,lossy:n}={})=>{let r=[];return nf(!(t||n),!!t,new Map,r)(e),r},af=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?Xd(rf(e,t)):structuredClone(e):(e,t)=>Xd(rf(e,t));function of(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function sf(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function cf(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||of,r=e.options.footnoteBackLabel||sf,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=Uc(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...af(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
|
|
10
10
|
`},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
|
|
11
|
-
`}]}}var
|
|
11
|
+
`}]}}var lf=(function(e){if(e==null)return mf;if(typeof e==`function`)return pf(e);if(typeof e==`object`)return Array.isArray(e)?uf(e):df(e);if(typeof e==`string`)return ff(e);throw Error(`Expected function, string, or object as test`)});function uf(e){let t=[],n=-1;for(;++n<e.length;)t[n]=lf(e[n]);return pf(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function df(e){let t=e;return pf(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function ff(e){return pf(t);function t(t){return t&&t.type===e}}function pf(e){return t;function t(t,n,r){return!!(hf(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function mf(){return!0}function hf(e){return typeof e==`object`&&!!e&&`type`in e}function gf(e){return e}var _f=[];function vf(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=lf(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,`name`,{value:`node (`+gf(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=_f,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=yf(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function yf(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?_f:[e]}function bf(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),vf(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var xf={}.hasOwnProperty,Sf={};function Cf(e,t){let n=t||Sf,r=new Map,i=new Map,a={all:s,applyData:Tf,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...Kd,...n.handlers},one:o,options:n,patch:wf,wrap:Df};return bf(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(xf.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=af(n);return r.children=a.all(e),r}return af(e)}return(a.options.unknownHandler||Ef)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=Of(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=Of(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function wf(e,t){e.position&&(t.position=Rs(e))}function Tf(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,af(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function Ef(e,t){let n=t.data||{},r=`value`in t&&!(xf.call(n,`hProperties`)||xf.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Df(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
|
|
12
12
|
`});++r<e.length;)r&&n.push({type:`text`,value:`
|
|
13
13
|
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
|
|
14
|
-
`}),n}function
|
|
15
|
-
`},i)),a}function Of(e,t){return e&&`run`in e?async function(n,r){let i=Df(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Df(n,{file:r,...e||t})}}function kf(e){if(e)throw e}var Af=n(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function jf(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Mf(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?Nf(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function Nf(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var Pf={basename:Ff,dirname:If,extname:Lf,join:Rf,sep:`/`};function Ff(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);Vf(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function If(e){if(Vf(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function Lf(e){Vf(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function Rf(...e){let t=-1,n;for(;++t<e.length;)Vf(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:zf(n)}function zf(e){Vf(e);let t=e.codePointAt(0)===47,n=Bf(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function Bf(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function Vf(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var Hf={cwd:Uf};function Uf(){return`/`}function Wf(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function Gf(e){if(typeof e==`string`)e=new URL(e);else if(!Wf(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return Kf(e)}function Kf(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var qf=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],Jf=class{constructor(e){let t;t=e?Wf(e)?{path:e}:typeof e==`string`||Qf(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:Hf.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<qf.length;){let e=qf[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)qf.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?Pf.basename(this.path):void 0}set basename(e){Xf(e,`basename`),Yf(e,`basename`),this.path=Pf.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?Pf.dirname(this.path):void 0}set dirname(e){Zf(this.basename,`dirname`),this.path=Pf.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?Pf.extname(this.path):void 0}set extname(e){if(Yf(e,`extname`),Zf(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=Pf.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){Wf(e)&&(e=Gf(e)),Xf(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?Pf.basename(this.path,this.extname):void 0}set stem(e){Xf(e,`stem`),Yf(e,`stem`),this.path=Pf.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new q(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function Yf(e,t){if(e&&e.includes(Pf.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+Pf.sep+"`")}function Xf(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function Zf(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function Qf(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var $f=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),ep=t(Af(),1),tp={}.hasOwnProperty,np=new class e extends $f{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Mf()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,ep.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(ap(`data`,this.frozen),this.namespace[e]=t,this):tp.call(this.namespace,e)&&this.namespace[e]||void 0:e?(ap(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=cp(e),n=this.parser||this.Parser;return rp(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),rp(`process`,this.parser||this.Parser),ip(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=cp(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);up(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),rp(`processSync`,this.parser||this.Parser),ip(`processSync`,this.compiler||this.Compiler),this.process(e,r),sp(`processSync`,`process`,t),n;function r(e,r){t=!0,kf(e),n=r}}run(e,t,n){op(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=cp(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),sp(`runSync`,`run`,n),r;function i(e,t){kf(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=cp(t),r=this.compiler||this.Compiler;return ip(`stringify`,r),op(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(ap(`use`,this.frozen),e!=null)if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e);else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,ep.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];jf(o)&&jf(r)&&(r=(0,ep.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function rp(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function ip(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function ap(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function op(e){if(!jf(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function sp(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function cp(e){return lp(e)?e:new Jf(e)}function lp(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function up(e){return typeof e==`string`||dp(e)}function dp(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var fp=[],pp={allowDangerousHtml:!0},mp=/^(https?|ircs?|mailto|xmpp)$/i,hp=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function gp(e){let t=_p(e),n=vp(e);return yp(t.runSync(t.parse(n),n),e)}function _p(e){let t=e.rehypePlugins||fp,n=e.remarkPlugins||fp,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...pp}:pp;return np().use(pd).use(n).use(Of,r).use(t)}function vp(e){let t=e.children||``,n=new Jf;return typeof t==`string`?n.value=t:``+t,n}function yp(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||bp;for(let e of hp)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return vf(e,l),Js(e,{Fragment:u.Fragment,components:i,ignoreInvalidStyle:!0,jsx:u.jsx,jsxs:u.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in gc)if(Object.hasOwn(gc,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=gc[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function bp(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||mp.test(e.slice(0,t))?e:``}function xp(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function Sp(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function Cp(e,t,n){let r=sf((n||{}).ignore||[]),i=wp(t),a=-1;for(;++a<i.length;)gf(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function wp(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([Tp(e[0]),Ep(e[1])])}return t}function Tp(e){return typeof e==`string`?new RegExp(Sp(e),`g`):e}function Ep(e){return typeof e==`function`?e:function(){return e}}var Dp=`phrasing`,Op=[`autolink`,`link`,`image`,`label`];function kp(){return{transforms:[Lp],enter:{literalAutolink:jp,literalAutolinkEmail:Mp,literalAutolinkHttp:Mp,literalAutolinkWww:Mp},exit:{literalAutolink:Ip,literalAutolinkEmail:Fp,literalAutolinkHttp:Np,literalAutolinkWww:Pp}}}function Ap(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:Dp,notInConstruct:Op},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:Dp,notInConstruct:Op},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:Dp,notInConstruct:Op}]}}function jp(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function Mp(e){this.config.enter.autolinkProtocol.call(this,e)}function Np(e){this.config.exit.autolinkProtocol.call(this,e)}function Pp(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function Fp(e){this.config.exit.autolinkEmail.call(this,e)}function Ip(e){this.exit(e)}function Lp(e){Cp(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Rp],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,zp]],{ignore:[`link`,`linkReference`]})}function Rp(e,t,n,r,i){let a=``;if(!Hp(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!Bp(n)))return!1;let o=Vp(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function zp(e,t,n,r){return!Hp(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function Bp(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function Vp(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=xp(e,`(`),a=xp(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function Hp(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||zc(n)||Rc(n))&&(!t||n!==47)}Qp.peek=Zp;function Up(){this.buffer()}function Wp(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function Gp(){this.buffer()}function Kp(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function qp(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=jc(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Jp(e){this.exit(e)}function Yp(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=jc(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Xp(e){this.exit(e)}function Zp(){return`[`}function Qp(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function $p(){return{enter:{gfmFootnoteCallString:Up,gfmFootnoteCall:Wp,gfmFootnoteDefinitionLabelString:Gp,gfmFootnoteDefinition:Kp},exit:{gfmFootnoteCallString:qp,gfmFootnoteCall:Jp,gfmFootnoteDefinitionLabelString:Yp,gfmFootnoteDefinition:Xp}}}function em(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Qp},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
16
|
-
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?
|
|
17
|
-
`)}function
|
|
18
|
-
`&&
|
|
19
|
-
`}function
|
|
14
|
+
`}),n}function Of(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function kf(e,t){let n=Cf(e,t),r=n.one(e,void 0),i=cf(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
|
|
15
|
+
`},i)),a}function Af(e,t){return e&&`run`in e?async function(n,r){let i=kf(n,{file:r,...t});await e.run(i,r)}:function(n,r){return kf(n,{file:r,...e||t})}}function jf(e){if(e)throw e}var Mf=n(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function Nf(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Pf(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?Ff(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function Ff(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var If={basename:Lf,dirname:Rf,extname:zf,join:Bf,sep:`/`};function Lf(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);Uf(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function Rf(e){if(Uf(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function zf(e){Uf(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function Bf(...e){let t=-1,n;for(;++t<e.length;)Uf(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:Vf(n)}function Vf(e){Uf(e);let t=e.codePointAt(0)===47,n=Hf(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function Hf(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function Uf(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var Wf={cwd:Gf};function Gf(){return`/`}function Kf(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function qf(e){if(typeof e==`string`)e=new URL(e);else if(!Kf(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return Jf(e)}function Jf(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var Yf=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],Xf=class{constructor(e){let t;t=e?Kf(e)?{path:e}:typeof e==`string`||ep(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:Wf.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<Yf.length;){let e=Yf[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)Yf.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?If.basename(this.path):void 0}set basename(e){Qf(e,`basename`),Zf(e,`basename`),this.path=If.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?If.dirname(this.path):void 0}set dirname(e){$f(this.basename,`dirname`),this.path=If.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?If.extname(this.path):void 0}set extname(e){if(Zf(e,`extname`),$f(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=If.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){Kf(e)&&(e=qf(e)),Qf(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?If.basename(this.path,this.extname):void 0}set stem(e){Qf(e,`stem`),Zf(e,`stem`),this.path=If.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new q(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function Zf(e,t){if(e&&e.includes(If.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+If.sep+"`")}function Qf(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function $f(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function ep(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var tp=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),np=t(Mf(),1),rp={}.hasOwnProperty,ip=new class e extends tp{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Pf()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,np.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(sp(`data`,this.frozen),this.namespace[e]=t,this):rp.call(this.namespace,e)&&this.namespace[e]||void 0:e?(sp(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=up(e),n=this.parser||this.Parser;return ap(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),ap(`process`,this.parser||this.Parser),op(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=up(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);fp(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),ap(`processSync`,this.parser||this.Parser),op(`processSync`,this.compiler||this.Compiler),this.process(e,r),lp(`processSync`,`process`,t),n;function r(e,r){t=!0,jf(e),n=r}}run(e,t,n){cp(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=up(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),lp(`runSync`,`run`,n),r;function i(e,t){jf(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=up(t),r=this.compiler||this.Compiler;return op(`stringify`,r),cp(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(sp(`use`,this.frozen),e!=null)if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e);else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,np.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];Nf(o)&&Nf(r)&&(r=(0,np.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function ap(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function op(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function sp(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function cp(e){if(!Nf(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function lp(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function up(e){return dp(e)?e:new Xf(e)}function dp(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function fp(e){return typeof e==`string`||pp(e)}function pp(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var mp=[],hp={allowDangerousHtml:!0},gp=/^(https?|ircs?|mailto|xmpp)$/i,_p=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function vp(e){let t=yp(e),n=bp(e);return xp(t.runSync(t.parse(n),n),e)}function yp(e){let t=e.rehypePlugins||mp,n=e.remarkPlugins||mp,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...hp}:hp;return ip().use(hd).use(n).use(Af,r).use(t)}function bp(e){let t=e.children||``,n=new Xf;return typeof t==`string`?n.value=t:``+t,n}function xp(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||Sp;for(let e of _p)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return bf(e,l),Xs(e,{Fragment:u.Fragment,components:i,ignoreInvalidStyle:!0,jsx:u.jsx,jsxs:u.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in vc)if(Object.hasOwn(vc,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=vc[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function Sp(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||gp.test(e.slice(0,t))?e:``}function Cp(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function wp(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function Tp(e,t,n){let r=lf((n||{}).ignore||[]),i=Ep(t),a=-1;for(;++a<i.length;)vf(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function Ep(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([Dp(e[0]),Op(e[1])])}return t}function Dp(e){return typeof e==`string`?new RegExp(wp(e),`g`):e}function Op(e){return typeof e==`function`?e:function(){return e}}var kp=`phrasing`,Ap=[`autolink`,`link`,`image`,`label`];function jp(){return{transforms:[zp],enter:{literalAutolink:Np,literalAutolinkEmail:Pp,literalAutolinkHttp:Pp,literalAutolinkWww:Pp},exit:{literalAutolink:Rp,literalAutolinkEmail:Lp,literalAutolinkHttp:Fp,literalAutolinkWww:Ip}}}function Mp(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:kp,notInConstruct:Ap},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:kp,notInConstruct:Ap},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:kp,notInConstruct:Ap}]}}function Np(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function Pp(e){this.config.enter.autolinkProtocol.call(this,e)}function Fp(e){this.config.exit.autolinkProtocol.call(this,e)}function Ip(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function Lp(e){this.config.exit.autolinkEmail.call(this,e)}function Rp(e){this.exit(e)}function zp(e){Tp(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Bp],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,Vp]],{ignore:[`link`,`linkReference`]})}function Bp(e,t,n,r,i){let a=``;if(!Wp(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!Hp(n)))return!1;let o=Up(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function Vp(e,t,n,r){return!Wp(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function Hp(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function Up(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=Cp(e,`(`),a=Cp(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function Wp(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||Vc(n)||Bc(n))&&(!t||n!==47)}em.peek=$p;function Gp(){this.buffer()}function Kp(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function qp(){this.buffer()}function Jp(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function Yp(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Nc(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Xp(e){this.exit(e)}function Zp(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Nc(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Qp(e){this.exit(e)}function $p(){return`[`}function em(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function tm(){return{enter:{gfmFootnoteCallString:Gp,gfmFootnoteCall:Kp,gfmFootnoteDefinitionLabelString:qp,gfmFootnoteDefinition:Jp},exit:{gfmFootnoteCallString:Yp,gfmFootnoteCall:Xp,gfmFootnoteDefinitionLabelString:Zp,gfmFootnoteDefinition:Qp}}}function nm(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:em},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
16
|
+
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?im:rm))),s(),o}}function rm(e,t,n){return t===0?e:im(e,t,n)}function im(e,t,n){return(n?``:` `)+e}var am=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];um.peek=dm;function om(){return{canContainEols:[`delete`],enter:{strikethrough:cm},exit:{strikethrough:lm}}}function sm(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:am}],handlers:{delete:um}}}function cm(e){this.enter({type:`delete`,children:[]},e)}function lm(e){this.exit(e)}function um(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function dm(){return`~`}function fm(e){return e.length}function pm(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||fm,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=mm(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=hm(r[d]);else{let e=hm(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&!(n.alignDelimiters===!1&&i===``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
|
|
17
|
+
`)}function mm(e){return e==null?``:String(e)}function hm(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function gm(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),_m);return i(),o}function _m(e,t,n){return`>`+(n?``:` `)+e}function vm(e,t){return ym(e,t.inConstruct,!0)&&!ym(e,t.notInConstruct,!1)}function ym(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function bm(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
18
|
+
`&&vm(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
|
|
19
|
+
`}function xm(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function Sm(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Cm(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function wm(e,t,n,r){let i=Cm(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(Sm(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,Tm);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(xm(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
|
|
20
20
|
`,encode:["`"],...s.current()})),t()}return u+=s.move(`
|
|
21
21
|
`),a&&(u+=s.move(a+`
|
|
22
|
-
`)),u+=s.move(c),l(),u}function
|
|
23
|
-
`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function
|
|
22
|
+
`)),u+=s.move(c),l(),u}function Tm(e,t,n){return(n?``:` `)+e}function Em(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Dm(e,t,n,r){let i=Em(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
|
|
23
|
+
`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function Om(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function km(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function Am(e,t,n){let r=Xc(e),i=Xc(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}jm.peek=Mm;function jm(e,t,n,r){let i=Om(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=Am(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=km(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=Am(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+km(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Mm(e,t,n){return n.options.emphasis||`*`}function Nm(e,t){let n=!1;return bf(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&bc(e)&&(t.options.setext||n))}function Pm(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(Nm(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
|
|
24
24
|
`,after:`
|
|
25
25
|
`});return r(),t(),o+`
|
|
26
26
|
`+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
|
|
27
27
|
`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
|
|
28
|
-
`,...a.current()});return/^[\t ]/.test(l)&&(l=
|
|
28
|
+
`,...a.current()});return/^[\t ]/.test(l)&&(l=km(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}Fm.peek=Im;function Fm(e){return e.value||``}function Im(){return`<`}Lm.peek=Rm;function Lm(e,t,n,r){let i=Em(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function Rm(){return`!`}zm.peek=Bm;function zm(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Bm(){return`!`}Vm.peek=Hm;function Vm(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function Hm(){return"`"}function Um(e,t){let n=bc(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Wm.peek=Gm;function Wm(e,t,n,r){let i=Em(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(Um(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function Gm(e,t,n){return Um(e,n)?`<`:`[`}Km.peek=qm;function Km(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function qm(){return`[`}function Jm(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Ym(e){let t=Jm(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Xm(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Zm(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Qm(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?Xm(n):Jm(n),s=e.ordered?o===`.`?`)`:`.`:Ym(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),Zm(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function $m(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function eh(e,t,n,r){let i=$m(n),a=n.bulletCurrent||Jm(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function th(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var nh=lf([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function rh(e,t,n,r){return(e.children.some(function(e){return nh(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function ih(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}ah.peek=oh;function ah(e,t,n,r){let i=ih(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=Am(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=km(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=Am(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+km(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function oh(e,t,n){return n.options.strong||`*`}function sh(e,t,n,r){return n.safe(e.value,r)}function ch(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function lh(e,t,n){let r=(Zm(n)+(n.options.ruleSpaces?` `:``)).repeat(ch(n));return n.options.ruleSpaces?r.slice(0,-1):r}var uh={blockquote:gm,break:bm,code:wm,definition:Dm,emphasis:jm,hardBreak:bm,heading:Pm,html:Fm,image:Lm,imageReference:zm,inlineCode:Vm,link:Wm,linkReference:Km,list:Qm,listItem:eh,paragraph:th,root:rh,strong:ah,text:sh,thematicBreak:lh};function dh(){return{enter:{table:fh,tableData:gh,tableHeader:gh,tableRow:mh},exit:{codeText:_h,table:ph,tableData:hh,tableHeader:hh,tableRow:hh}}}function fh(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function ph(e){this.exit(e),this.data.inTable=void 0}function mh(e){this.enter({type:`tableRow`,children:[]},e)}function hh(e){this.exit(e)}function gh(e){this.enter({type:`tableCell`,children:[]},e)}function _h(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,vh));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function vh(e,t){return t===`|`?t:e}function yh(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
29
29
|
`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
|
|
30
|
-
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return dm(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=ch.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function vh(){return{exit:{taskListCheckValueChecked:bh,taskListCheckValueUnchecked:bh,paragraph:xh}}}function yh(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:Sh}}}function bh(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function xh(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function Sh(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=ch.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function Ch(){return[kp(),$p(),im(),lh(),vh()]}function wh(e){return{extensions:[Ap(),em(e),am(),_h(e),yh()]}}var Th={tokenize:zh,partial:!0},Eh={tokenize:Bh,partial:!0},Dh={tokenize:Vh,partial:!0},Oh={tokenize:Hh,partial:!0},kh={tokenize:Uh,partial:!0},Ah={name:`wwwAutolink`,tokenize:Lh,previous:Wh},jh={name:`protocolAutolink`,tokenize:Rh,previous:Gh},Mh={name:`emailAutolink`,tokenize:Ih,previous:Kh},Nh={};function Ph(){return{text:Nh}}for(var Fh=48;Fh<123;)Nh[Fh]=Mh,Fh++,Fh===58?Fh=65:Fh===91&&(Fh=97);Nh[43]=Mh,Nh[45]=Mh,Nh[46]=Mh,Nh[95]=Mh,Nh[72]=[Mh,jh],Nh[104]=[Mh,jh],Nh[87]=[Mh,Ah],Nh[119]=[Mh,Ah];function Ih(e,t,n){let r=this,i,a;return o;function o(t){return!qh(t)||!Kh.call(r,r.previous)||Jh(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return qh(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(kh,u,l)(t):t===45||t===95||J(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&Mc(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function Lh(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!Wh.call(r,r.previous)||Jh(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(Th,e.attempt(Eh,e.attempt(Dh,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function Rh(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&Gh.call(r,r.previous)&&!Jh(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(Mc(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||Pc(t)||X(t)||zc(t)||Rc(t)?n(t):e.attempt(Eh,e.attempt(Dh,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function zh(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function Bh(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(Oh,c,s)(t):t===null||X(t)||zc(t)||t!==45&&Rc(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function Vh(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(Oh,t,a)(o):o===null||X(o)||zc(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function Hh(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||X(o)||zc(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||X(e)||zc(e)?t(e):r(e)}function a(e){return Mc(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):Mc(t)?(e.consume(t),o):n(t)}}function Uh(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return J(e)?n(e):t(e)}}function Wh(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||X(e)}function Gh(e){return!Mc(e)}function Kh(e){return!(e===47||qh(e))}function qh(e){return e===43||e===45||e===46||e===95||J(e)}function Jh(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var Yh={tokenize:rg,partial:!0};function Xh(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:eg,continuation:{tokenize:tg},exit:ng}},text:{91:{name:`gfmFootnoteCall`,tokenize:$h},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:Zh,resolveTo:Qh}}}}function Zh(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=jc(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function Qh(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function $h(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||X(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(jc(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return X(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function eg(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||X(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=jc(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return X(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),Q(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function tg(e,t,n){return e.check(nl,t,e.attempt(Yh,t,n))}function ng(e){e.exit(`gfmFootnoteDefinition`)}function rg(e,t,n){let r=this;return Q(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function ig(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&wc(o,o.length,0,Yc(s,e.slice(r+1,n),t)),wc(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),wc(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=Jc(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=Jc(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var ag=class{constructor(){this.map=[]}add(e,t,n){og(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function og(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function sg(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function cg(){return{flow:{null:{name:`table`,tokenize:lg,resolveAll:ug}}}}function lg(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):Y(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):Z(t)?Q(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||X(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,Z(t)?Q(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return Z(t)?Q(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||Y(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return Z(t)?Q(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||Y(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||Y(n)?(e.exit(`tableRow`),t(n)):Z(n)?Q(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||X(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function ug(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new ag;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(fg(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=dg(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=dg(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=dg(f,t,o,i,n,d)):(o[0]=o[1],d=dg(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&fg(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=sg(t.events,n))}return e}function dg(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},pg(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=pg(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=pg(t.events,n[2]),a=pg(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},pg(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function fg(e,t,n,r,i){let a=[],o=pg(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function pg(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var mg={name:`tasklistCheck`,tokenize:gg};function hg(){return{text:{91:mg}}}function gg(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return X(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return Y(r)?t(r):Z(r)?e.check({tokenize:_g},t,n)(r):n(r)}}function _g(e,t,n){return Q(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function vg(e){return Dc([Ph(),Xh(),ig(e),cg(),hg()])}var yg={};function bg(e){let t=this,n=e||yg,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(vg(n)),a.push(Ch()),o.push(wh(n))}function xg({href:e,children:t,...n}){let r=typeof e==`string`&&(e.startsWith(`http://`)||e.startsWith(`https://`));return(0,u.jsx)(`a`,{href:e,...n,...r?{target:`_blank`,rel:`noopener noreferrer`}:{},children:t})}var Sg={a:xg};function Cg({markdown:e,className:t,regionLabel:n=`Asset description`}){let r=(0,c.useRef)(null),[i,a]=(0,c.useState)(!1),[o,s]=(0,c.useState)(!1);return(0,c.useEffect)(()=>{let e=r.current;if(!e)return;let t=()=>{let e=r.current;if(e){if(i){s(!1);return}s(e.scrollHeight>e.clientHeight+1)}};t();let n=globalThis.ResizeObserver;if(n===void 0)return;let a=new n(t);return a.observe(e),()=>{a.disconnect()}},[e,i]),(0,u.jsxs)(`div`,{className:[`resource-description-md`,t].filter(Boolean).join(` `),role:`region`,"aria-label":n,children:[(0,u.jsx)(`div`,{ref:r,className:i?`resource-description-md__viewport resource-description-md__viewport--expanded`:`resource-description-md__viewport resource-description-md__viewport--collapsed`,children:(0,u.jsx)(`div`,{className:`resource-description-md__prose`,children:(0,u.jsx)(gp,{remarkPlugins:[bg],components:Sg,children:e})})}),(0,u.jsxs)(`div`,{className:`resource-description-md__toolbar`,children:[!i&&o?(0,u.jsx)(`button`,{type:`button`,className:`resource-description-md__toggle workspace-pill`,onClick:()=>a(!0),children:`Expand description`}):null,i?(0,u.jsx)(`button`,{type:`button`,className:`resource-description-md__toggle workspace-pill`,onClick:()=>a(!1),children:`Collapse description`}):null]})]})}var wg=(0,c.createContext)({missingCatalog:!1,missingSources:!1});function Tg(){return(0,c.useContext)(wg)}function Eg(e){let t=e.semantics?.relationName?.trim();if(t)return rt(t);let n=e.database?.trim(),r=e.schema?.trim();return n&&r?`${n}.${r}`:r||n||`n/a`}function Dg({adapterMetrics:e,extraAdapterRawFields:t}){let n=e==null?[]:Hi([e]);return t.length>0||n.length>0?(0,u.jsxs)(`div`,{className:`asset-summary__group`,children:[(0,u.jsx)(`p`,{className:`asset-summary__group-title`,children:`Adapter response`}),e!=null&&n.length>0?(0,u.jsx)(`div`,{className:`detail-grid`,children:n.map(t=>{let n=Bi(e,t.key);return(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:t.shortLabel}),(0,u.jsx)(`strong`,{children:n===void 0?`—`:Vi(t,n)})]},t.key)})}):null,t.length>0?(0,u.jsx)(`div`,{className:`asset-summary__adapter-raw`,"aria-label":`Additional adapter response fields`,children:t.map(e=>`${e.label}: ${e.displayValue}`).join(`
|
|
31
|
-
`)}):null]}):null}function
|
|
32
|
-
`,t);return n===-1?e.slice(t):e.slice(t,n+1)},r=t=>{if(e[t]!==`'`)return null;let n=t+1;for(;n<e.length;){if(e[n]===`'`&&e[n-1]!==`\\`){n+=1;break}n+=1}return e.slice(t,n)},i=t=>{let n=/^[0-9]+(\.[0-9]+)?/.exec(e.slice(t));return!n||t>0&&/[a-zA-Z_]/.test(e[t-1])?null:n[0]},a=t=>{let n=/^[a-zA-Z_][a-zA-Z0-9_]*/.exec(e.slice(t));if(!n)return null;let r=n[0],i=r.toUpperCase();return{type:Ag.has(i)?`keyword`:jg.has(i)?`function`:`identifier`,value:r}},o=a=>{let o=t(a)??n(a)??r(a)??i(a);return o==null?null:o.startsWith(`/*`)||o.startsWith(`--`)?{type:`comment`,value:o}:e[a]===`'`?{type:`string`,value:o}:{type:`number`,value:o}},s=e=>/[=<>!|+\-*/%^&~]/.test(e)?`operator`:/[(),;.[\]{}]/.test(e)?`punctuation`:null,c=[],l=0,u=e.length;for(;l<u;){let t=o(l);if(t!=null){c.push(t),l+=t.value.length;continue}let n=a(l);if(n!=null){c.push(n),l+=n.value.length;continue}let r=s(e[l]);if(r!=null){c.push({type:r,value:e[l]}),l++;continue}c.push({type:`plain`,value:e[l]}),l++}return c}function Ng({sql:e}){return(0,u.jsx)(`pre`,{className:`sql-panel`,children:(0,u.jsx)(`code`,{children:Mg(e).map((e,t)=>e.type===`plain`||e.type===`identifier`?e.value:(0,u.jsx)(`span`,{className:`sql-token-${e.type}`,children:e.value},t))})})}function Pg({size:e=24,label:t}){return(0,u.jsxs)(`svg`,{className:`spinner`,width:e,height:e,viewBox:`0 0 24 24`,fill:`none`,"aria-hidden":t?void 0:`true`,"aria-label":t,role:t?`img`:void 0,children:[(0,u.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`,stroke:`var(--panel-border)`,strokeWidth:`2.5`}),(0,u.jsx)(`path`,{d:`M12 2 A10 10 0 0 1 22 12`,stroke:`var(--accent)`,strokeWidth:`2.5`,strokeLinecap:`round`})]})}function Fg({label:e,values:t}){return t.length===0?null:(0,u.jsxs)(`div`,{className:`definition-list`,children:[(0,u.jsx)(`span`,{children:e}),(0,u.jsx)(`div`,{className:`definition-list__values`,children:t.map(e=>(0,u.jsx)(`span`,{className:`definition-pill`,children:e},e))})]})}function Ig(e){return(0,u.jsxs)(`div`,{className:`definition-panel`,children:[(0,u.jsxs)(`div`,{className:`detail-grid`,children:[(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Label`}),(0,u.jsx)(`strong`,{children:e.label??`Not captured`})]}),(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Metric type`}),(0,u.jsx)(`strong`,{children:e.metricType??`Not captured`})]}),(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Source`}),(0,u.jsx)(`strong`,{children:e.sourceReference??`Not captured`})]}),(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Time granularity`}),(0,u.jsx)(`strong`,{children:e.timeGranularity??`Not captured`})]})]}),e.expression&&(0,u.jsxs)(`div`,{className:`definition-block`,children:[(0,u.jsx)(`span`,{children:`Expression`}),(0,u.jsx)(`pre`,{children:e.expression})]}),e.description&&(0,u.jsxs)(`div`,{className:`definition-block`,children:[(0,u.jsx)(`span`,{children:`Description`}),(0,u.jsx)(`p`,{children:e.description})]}),(0,u.jsx)(Fg,{label:`Measures`,values:e.measures}),(0,u.jsx)(Fg,{label:`Referenced metrics`,values:e.metrics}),(0,u.jsx)(Fg,{label:`Filters`,values:e.filters})]})}function Lg(e){return(0,u.jsxs)(`div`,{className:`definition-panel`,children:[(0,u.jsxs)(`div`,{className:`detail-grid`,children:[(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Label`}),(0,u.jsx)(`strong`,{children:e.label??`Not captured`})]}),(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Source model`}),(0,u.jsx)(`strong`,{children:e.sourceReference??`Not captured`})]}),(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Default time dimension`}),(0,u.jsx)(`strong`,{children:e.defaultTimeDimension??`Not captured`})]})]}),(0,u.jsx)(Fg,{label:`Entities`,values:e.entities}),(0,u.jsx)(Fg,{label:`Measures`,values:e.measures}),(0,u.jsx)(Fg,{label:`Dimensions`,values:e.dimensions}),e.description&&(0,u.jsxs)(`div`,{className:`definition-block`,children:[(0,u.jsx)(`span`,{children:`Description`}),(0,u.jsx)(`p`,{children:e.description})]})]})}function Rg({showsDefinition:e,definition:t,sqlText:n,codeLoading:r,codeError:i}){return e&&t?t.kind===`metric`?Ig(t):Lg(t):r?(0,u.jsxs)(`div`,{className:`asset-sql-loading`,"aria-busy":`true`,children:[(0,u.jsx)(Pg,{size:28,label:`Loading SQL`}),(0,u.jsx)(`span`,{className:`asset-sql-loading__label`,children:`Loading SQL…`})]}):i?(0,u.jsx)(Dt,{icon:`⚠`,headline:`Could not load SQL`,subtext:i}):n?(0,u.jsx)(Ng,{sql:n}):(0,u.jsx)(Dt,{icon:`⌘`,headline:e?`No definition available`:`No SQL available`,subtext:e?`This resource does not expose enough definition metadata in the current artifacts.`:`This resource does not expose compiled or raw SQL in the current artifacts.`})}function zg({showsDefinition:e,definition:t,sqlText:n,codeLoading:r,codeError:i,hasCompiledSql:a}){return(0,u.jsx)(qt,{title:e?`Definition`:`SQL`,subtitle:e?t?.kind===`metric`?`Structured metric definition captured from the manifest.`:`Structured semantic model definition captured from the manifest.`:a?`Compiled SQL for the selected resource.`:`Raw SQL captured from the manifest.`,children:Rg({showsDefinition:e,definition:t,sqlText:n,codeLoading:r,codeError:i})})}function Bg(e){return e===`runtime`?`summary`:e}function Vg({resource:e,analysis:t,onSelectResource:n,assetViewState:r,onAssetViewStateChange:i,lineageViewState:a,onLineageViewStateChange:o,onNavigateTo:s}){let l=(0,c.useMemo)(()=>new Map(t.resources.map(e=>[e.uniqueId,e])),[t.resources]),d=(0,c.useMemo)(()=>e==null?null:t.executions.find(t=>t.uniqueId===e.uniqueId)??null,[t.executions,e]),f=a.upstreamDepth,p=a.downstreamDepth,m=a.allDepsMode,h=a.lensMode,g=a.activeLegendKeys,_=e=>o(t=>({...t,upstreamDepth:typeof e==`function`?e(t.upstreamDepth):e})),v=e=>o(t=>({...t,downstreamDepth:typeof e==`function`?e(t.downstreamDepth):e})),y=e=>o(t=>({...t,allDepsMode:typeof e==`function`?e(t.allDepsMode):e})),b=e=>o(t=>({...t,lensMode:e,activeLegendKeys:new Set})),x=e=>o(t=>({...t,activeLegendKeys:typeof e==`function`?e(t.activeLegendKeys):e})),S=Bg(r.activeTab),[C,w]=(0,c.useState)(!1),T=(0,c.useRef)({summary:null,lineage:null,sql:null,tests:null});(0,c.useEffect)(()=>{if(!e)return;let t=T.current[S];if(!t)return;let n=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;t.scrollIntoView({block:`start`,behavior:n?`auto`:`smooth`})},[S,e]);let{compiledCode:E,rawCode:D,loading:O,error:k}=Ho(e?.uniqueId??null,t);if(!e)return(0,u.jsx)(`div`,{className:`workspace-card`,children:(0,u.jsx)(Dt,{icon:`🔍`,headline:`No resource selected`,subtext:`Adjust the explorer filters or search to find the resource you're looking for.`})});let A=t.dependencyIndex[e.uniqueId],j=E??D??void 0,M=E!=null&&E!==``,N=e.definition??null,P=N?.kind===`metric`||N?.kind===`semantic_model`,ee=(0,u.jsxs)(`div`,{className:`resource-detail__subtitle`,children:[(0,u.jsx)(Jt,{resourceType:e.resourceType}),e.semantics?(0,u.jsx)(ca,{semantics:e.semantics}):null,(0,u.jsx)(`span`,{className:`resource-detail__package`,children:e.packageName||`workspace`})]}),F={resource:e,dependencySummary:A,dependencyIndex:t.dependencyIndex,resourceById:l,upstreamDepth:f,downstreamDepth:p,allDepsMode:m,lensMode:h,activeLegendKeys:g,setUpstreamDepth:_,setDownstreamDepth:v,setAllDepsMode:y,setLensMode:b,setActiveLegendKeys:x,onSelectResource:e=>{n(e),o(t=>({...t,selectedResourceId:e})),i(t=>({...t,selectedResourceId:e,activeTab:`lineage`}))}};return(0,u.jsxs)(`div`,{className:`workspace-view asset-workspace`,children:[(0,u.jsxs)(`section`,{className:`catalog-detail-hero`,children:[(0,u.jsxs)(`div`,{className:`catalog-detail-hero__content`,children:[(0,u.jsx)(`p`,{className:`eyebrow`,children:`Selected asset`}),(0,u.jsx)(`h3`,{children:e.name}),ee]}),(0,u.jsx)(`div`,{className:`asset-hero__actions`,"aria-label":`Asset actions`,children:(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:()=>s(`timeline`,{resourceId:e.uniqueId,executionId:e.uniqueId}),children:`Open in Timeline`})})]}),(0,u.jsx)(`div`,{className:`asset-workspace__body`,children:(0,u.jsxs)(`div`,{className:`asset-workspace__sections`,children:[(0,u.jsx)(`section`,{id:`asset-section-summary`,ref:e=>{T.current.summary=e},className:`asset-workspace__section`,children:(0,u.jsx)(kg,{resource:e,executionRow:d})}),(0,u.jsx)(`section`,{id:`asset-section-lineage`,ref:e=>{T.current.lineage=e},className:`asset-workspace__section`,children:(0,u.jsx)(To,{...F,displayMode:`summary`,openFullscreen:C,onFullscreenChange:w})}),(0,u.jsx)(`section`,{id:`asset-section-tests`,ref:e=>{T.current.tests=e},className:`asset-workspace__section`,children:(0,u.jsx)(Vo,{resource:e,analysis:t,onNavigateTo:s})}),(0,u.jsx)(`section`,{id:`asset-section-sql`,ref:e=>{T.current.sql=e},className:`asset-workspace__section`,children:(0,u.jsx)(zg,{showsDefinition:P,definition:N,sqlText:j,codeLoading:O,codeError:k,hasCompiledSql:M})})]})})]})}var Hg=200;function Ug({analysis:e,resource:t,onSelectResource:n,assetViewState:r,onAssetViewStateChange:i,lineageViewState:a,onLineageViewStateChange:o,onInvestigationSelectionChange:s,onNavigateTo:l}){let[d,f]=(0,c.useState)(``),[p,m]=(0,c.useState)([]),[h,g]=(0,c.useState)(!1),[_,v]=(0,c.useState)(``),y=(0,c.useRef)(0);(0,c.useEffect)(()=>{let e=d.trim(),t=e?Hg:0,n=window.setTimeout(()=>{if(!e){y.current+=1,m([]),g(!1);return}y.current+=1;let t=y.current;g(!0),T(e).then(e=>{y.current===t&&m(e)}).catch(()=>{y.current===t&&m([])}).finally(()=>{y.current===t&&g(!1)})},t);return()=>window.clearTimeout(n)},[d]);let b=e=>{e&&(i(t=>({...t,selectedResourceId:e,activeTab:`lineage`})),o(t=>({...t,rootResourceId:e,selectedResourceId:e})),s(t=>({...t,selectedResourceId:e,sourceLens:`inventory`})))};return(0,u.jsx)(Zt,{title:`Inventory`,description:`Browse, filter, and inspect all workspace assets.`,className:`inventory-view`,suppressHeader:t!=null,children:t?(0,u.jsx)(Vg,{analysis:e,resource:t,onSelectResource:e=>{n(e),s(t=>({...t,selectedResourceId:e,sourceLens:`inventory`}))},assetViewState:r,onAssetViewStateChange:i,lineageViewState:a,onLineageViewStateChange:o,onNavigateTo:l}):(0,u.jsx)(`div`,{className:`inventory-empty-state`,children:(0,u.jsxs)(`div`,{className:`inventory-empty-state__inner`,children:[(0,u.jsx)(Dt,{icon:`◱`,headline:`Select an asset to inspect`,subtext:`Use the browser panel on the left to find and select a model, source, seed, or other asset.`}),(0,u.jsxs)(`div`,{className:`inventory-empty-state__lineage-pick`,role:`group`,"aria-label":`Jump to lineage for an asset`,children:[(0,u.jsx)(`label`,{className:`inventory-empty-state__lineage-label`,htmlFor:`inventory-lineage-search`,children:`Or search for an asset to open its lineage graph`}),(0,u.jsx)(`input`,{id:`inventory-lineage-search`,type:`search`,className:`inventory-empty-state__lineage-search`,value:d,onChange:e=>{f(e.target.value),v(``)},placeholder:`Name, type, package, or unique id…`,autoComplete:`off`,enterKeyHint:`search`}),h&&(0,u.jsx)(`p`,{className:`inventory-empty-state__lineage-hint`,"aria-live":`polite`,children:`Searching…`}),p.length>0&&(0,u.jsx)(`ul`,{className:`inventory-empty-state__lineage-suggestions`,role:`listbox`,"aria-label":`Matching assets`,children:p.map(e=>(0,u.jsx)(`li`,{role:`none`,children:(0,u.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":_===e.uniqueId,className:_===e.uniqueId?`inventory-lineage-suggestion inventory-lineage-suggestion--active`:`inventory-lineage-suggestion`,onClick:()=>{y.current+=1,v(e.uniqueId),f(`${e.name} (${e.resourceType})`),m([]),g(!1)},children:[(0,u.jsx)(`span`,{className:`inventory-lineage-suggestion__name`,children:e.name}),(0,u.jsxs)(`span`,{className:`inventory-lineage-suggestion__meta`,children:[e.resourceType,e.packageName?` · ${e.packageName}`:``]})]})},e.uniqueId))}),(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill`,disabled:!_,onClick:()=>b(_),children:`Open lineage graph`})]})]})})})}function Wg(e){let t=[],n=new Map;for(let r of e)if(I.has(r.resourceType)){if(r.parentId!=null){let e=n.get(r.parentId)??[];e.push(r),n.set(r.parentId,e)}}else t.push(r);return t.sort((e,t)=>{let n=e.start-t.start;return n===0?t.duration-e.duration:n}),t.map(e=>{let t=n.get(e.unique_id)??[],{lanes:r,laneCount:i}=Gg(t);return{item:e,tests:t,lanes:r,laneCount:i}})}function Gg(e){if(e.length===0)return{lanes:[],laneCount:0};let t=[...e].sort((e,t)=>e.start-t.start),n=[],r=[];for(let e of t){let t=-1;for(let r=0;r<n.length;r++)if((n[r]??0)<=e.start){t=r,n[r]=e.end;break}t===-1&&(t=n.length,n.push(e.end)),r.push({item:e,lane:t})}return{lanes:r,laneCount:n.length}}var Kg=`dbt-tools.timelineLabelWidthPx`,qg=.78,Jg={color:`var(--text-soft)`,fontSize:`0.82rem`},Yg=`dbt-tools.timelineTimezone`;function Xg(e){return e>=6e4?`${(e/6e4).toFixed(0)}m`:e>=1e4?`${(e/1e3).toFixed(0)}s`:e>=1e3?`${(e/1e3).toFixed(1)}s`:`${e.toFixed(0)}ms`}function Zg(e,t){return new Intl.DateTimeFormat(`en-US`,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1,timeZone:t}).format(new Date(e))}function Qg(){let e=Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`,t=Intl.supportedValuesOf,n=t?.(`timeZone`)??[];return Array.from(new Set([e,`UTC`,...n]))}function $g(){let e=Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`;try{return window.localStorage.getItem(`dbt-tools.timelineTimezone`)||e}catch{return e}}function e_(e=160){try{let t=window.localStorage.getItem(Kg);if(t==null)return e;let n=Number.parseInt(t,10);return Number.isFinite(n)?n:e}catch{return e}}function t_(e){return[`success`,`pass`,`passed`].includes(e.trim().toLowerCase())}function n_(e){return[`skipped`,`no op`].includes(e.trim().toLowerCase())}function r_(e){let t=e.trim().toLowerCase();return!t_(t)&&!n_(t)}function i_(e){if(!Number.isFinite(e)||e<6e4)return 6e4;let t=10**Math.max(0,Math.floor(Math.log10(e))),n=e/t;return Math.max(6e4,(n<=1?1:n<=2?2:n<=5?5:10)*t)}var a_=[50,100,200,500,1e3,2e3,5e3,1e4,2e4,3e4,6e4,12e4,3e5,6e5,9e5,18e5,36e5,72e5,144e5,216e5,432e5,864e5],o_=8;function s_(e,t){if(t<=e)return[];let n=t-e,r=a_.find(e=>n/e<=o_)??i_(Math.ceil(n/o_)),i=[],a=Math.ceil(e/r)*r;e>0&&i.push({ms:e,label:Xg(e)});for(let n=a;n<=t;n+=r)n<=e||n>=t||i.push({ms:n,label:Xg(n)});return i.push({ms:t,label:Xg(t)}),i}function c_(e,t,n,r,i,a,o=10){if(e.length===0||r<=0)return e;let s=Math.max(1,n-t),c=e.map(e=>{let n=(e.ms-t)/s*r,o=a(i(e))/2;return{ms:e.ms,label:e.label,x:n,hw:o}}),l=e=>({ms:e.ms,label:e.label}),u=new Map(c.map(e=>[e.ms,e]));return(e=>{let t=c[c.length-1];if(t.ms!==n||e[e.length-1]?.ms===n)return e;for(;e.length>0;){let n=e[e.length-1],r=u.get(n.ms);if(!r||t.x-t.hw>=r.x+r.hw+o)break;e.pop()}return e.length===0&&e.push(l(c[0])),e.push(l(t)),e})((()=>{let e=[],t=null;for(let n of c){if(t==null){e.push(l(n)),t=n;continue}n.x-n.hw>=t.x+t.hw+o&&(e.push(l(n)),t=n)}return e})())}function l_(e,t){let n=t>0?Math.max(120,Math.min(560,t-200)):560;return Math.max(120,Math.min(n,Math.round(e)))}function u_(e){let[t,n]=(0,c.useState)(()=>typeof window>`u`?160:e_(220));(0,c.useEffect)(()=>{e<=0||n(t=>l_(t,e))},[e]),(0,c.useEffect)(()=>{try{window.localStorage.setItem(Kg,String(t))}catch{}},[t]);let r=(0,c.useMemo)(()=>e<=0?560:Math.max(120,Math.min(560,e-200)),[e]);return{effectiveLabelW:e>0?l_(t,e):t,maxLabelW:r,onLabelColumnWidthDrag:(0,c.useCallback)(t=>{n(l_(t,e>0?e:800))},[e])}}function d_(e,t){return!e||!t||!I.has(t.resourceType)||!I.has(e.resourceType)||t.parentId==null||e.parentId==null?!1:t.parentId===e.parentId}var f_={model:0,source:1,source_freshness:1,snapshot:2,seed:3,exposure:4,metric:5,semantic_model:6,test:7,unit_test:8,macro:9,analysis:10};function p_(e){return e?f_[e]??98:99}function m_(e,t,n){return[...e].sort((e,r)=>{let i=n.get(e),a=n.get(r),o=d_(i,t)?0:1,s=d_(a,t)?0:1;if(o!==s)return o-s;let c=p_(i?.resourceType),l=p_(a?.resourceType);if(c!==l)return c-l;let u=Math.abs((i?.end??0)-t.start),d=Math.abs((a?.end??0)-t.start);return u===d?e.localeCompare(r):u-d})}function h_(e,t,n){return t||e.length<=n?e:e.slice(0,n)}function g_(e,t,n){return[...e].sort((e,r)=>{let i=n.get(e),a=n.get(r),o=d_(i,t)?0:1,s=d_(a,t)?0:1;if(o!==s)return o-s;let c=p_(i?.resourceType),l=p_(a?.resourceType);if(c!==l)return c-l;let u=Math.abs((i?.start??0)-t.end),d=Math.abs((a?.start??0)-t.end);return u===d?e.localeCompare(r):u-d})}function __(e){return`${e.fromId}\t${e.toId}`}function v_(e,t){if(e.hop!==t.hop)return e.hop-t.hop;let n=e.leg===`upstream`?0:1,r=t.leg===`upstream`?0:1;if(n!==r)return n-r;let i=e.fromId.localeCompare(t.fromId);return i===0?e.toId.localeCompare(t.toId):i}function y_(e,t,n,r,i,a){return h_(m_(t.inbound.filter(e=>i(e)),n,r),a.showAllUpstream,a.maxUpstreamEdges).map(t=>({fromId:t,toId:e,tier:d_(r.get(t),n)?`secondary`:`primary`,hop:1,leg:`upstream`}))}function b_(e,t,n,r,i,a){return h_(g_(t.outbound.filter(e=>i(e)),n,r),a.showAllDownstream,a.maxDownstreamEdges).map(t=>({fromId:e,toId:t,tier:`downstream`,hop:1,leg:`downstream`}))}function x_(e,t,n,r,i,a,o){return{upExt:a?E_(e,t,n,r,i):{edges:[],truncated:!1},downExt:o?D_(e,t,n,r,i):{edges:[],truncated:!1}}}function S_(e,t,n){let r=new Map;for(let t of e)r.set(__(t),t);for(let e of t){let t=__(e);r.has(t)||r.set(t,e)}for(let e of n){let t=__(e);r.has(t)||r.set(t,e)}return[...r.values()].sort(v_)}function C_(e,t,n){let r=__({fromId:t,toId:n});return e.seen.has(r)||(e.seen.add(r),e.hop<2)?!1:(e.edges.push({fromId:t,toId:n,tier:e.direction===`upstream`?`primary`:`downstream`,hop:e.hop,leg:e.direction}),e.edges.length>=e.maxEdges)}function w_(e,t){let n=t.timelineAdjacency[e];if(!n)return!1;let r=t.direction===`upstream`?n.inbound:n.outbound;for(let n of r)if(t.inTimeline(n)){if(C_(t,t.direction===`upstream`?n:e,t.direction===`upstream`?e:n))return!0;t.nextFrontier.add(n)}return!1}function T_(e,t,n,r,i,a){let o=e=>n.has(e),s=new Set,c=[],l=!1,u=new Set([e]);for(let e=1;e<=r&&c.length<i;e++){let n=new Set,r={hop:e,direction:a,timelineAdjacency:t,inTimeline:o,seen:s,edges:c,maxEdges:i,nextFrontier:n};for(let e of u)if(l=w_(e,r),l)break;if(u=n,l||u.size===0)break}return{edges:c,truncated:l}}function E_(e,t,n,r,i){return T_(e,t,n,r,i,`upstream`)}function D_(e,t,n,r,i){return T_(e,t,n,r,i,`downstream`)}function O_(e,t,n,r,i){let a=e=>i===`upstream`?e.inbound:e.outbound,o=new Set;o.add(e);let s=new Set([e]);for(let e=0;e<r;e++){let e=new Set;for(let r of s){let i=t[r];if(i)for(let t of a(i))!n.has(t)||o.has(t)||(o.add(t),e.add(t))}s=e}return o}function k_(e,t,n){if(e==null)return null;if(t.has(e))return e;let r=n.get(e);return r&&I.has(r.resourceType)&&r.parentId!=null&&t.has(r.parentId)?r.parentId:null}function A_({focusId:e,timelineAdjacency:t,candidateIds:n,dependencyDirection:r,dependencyDepthHops:i}){let a=()=>new Set(n);if(e==null||!t||!n.has(e)||!t[e])return a();let o=Math.max(1,Math.min(3,Math.trunc(i))),s=r!==`downstream`,c=r!==`upstream`,l=new Set;for(let r of[`upstream`,`downstream`])if(!(r===`upstream`?!s:!c))for(let i of O_(e,t,n,o,r))l.add(i);return l}function j_(e,t,n,r,i){if(!e||!t)return{edges:[],extendedTruncated:!1};let a=t[e],o=n.get(e);if(!a||!o||!r.has(e))return{edges:[],extendedTruncated:!1};let s=e=>r.has(e),c=i.includeUpstream??!0,l=i.includeDownstream,u=[...c?y_(e,a,o,n,s,i):[],...l?b_(e,a,o,n,s,i):[]],d=i.extendedDeps;if(!d?.enabled)return{edges:[...u].sort(v_),extendedTruncated:!1};let{upExt:f,downExt:p}=x_(e,t,r,d.maxHops??3,d.maxEdgesPerDirection??12,c,l);return{edges:S_(u,f.edges,p.edges),extendedTruncated:f.truncated||p.truncated}}function M_(e,t,n,r,i,a){let o=n[e];if(!o)return null;let s=32+(r[e]??0)-i;if(o.item.unique_id===t)return s+6+14/2;if(!a)return null;for(let{item:e,lane:n}of o.lanes)if(e.unique_id===t)return s+44+5+n*14+10/2;return null}function N_(e){let{edge:t,itemById:n,bundleIndexById:r,bundles:i,rowOffsets:a,scrollTop:o,showTests:s,effectiveLabelW:c,rangeStart:l,rangeEnd:u,chartW:d}=e,f=n.get(t.fromId),p=n.get(t.toId),m=r.get(t.fromId),h=r.get(t.toId);if(f==null||p==null||m===void 0||h===void 0)return``;let g=M_(m,t.fromId,i,a,o,s),_=M_(h,t.toId,i,a,o,s);if(g==null||_==null)return``;let v=Math.max(1,u-l),y=c+(f.start+f.duration-l)/v*d,b=c+(p.start-l)/v*d,x=Math.abs(b-y)*.4;return`M${y},${g} C${y+x},${g} ${b-x},${_} ${b},${_}`}var P_=8,F_=8;function I_(e,t,n){if((e.hop??1)>=2)return e.leg===`upstream`?{stroke:t.slate,strokeWidth:1,strokeDasharray:`3 4`,opacity:.36,markerEnd:`url(#${n.secondary})`}:{stroke:t.accent,strokeWidth:1,strokeDasharray:`4 5`,opacity:.4,markerEnd:`url(#${n.downstream})`};switch(e.tier){case`secondary`:return{stroke:t.slate,strokeWidth:1,strokeDasharray:`4 3`,opacity:.42,markerEnd:`url(#${n.secondary})`};case`downstream`:return{stroke:t.accent,strokeWidth:1.5,strokeDasharray:`5 4`,opacity:.62,markerEnd:`url(#${n.downstream})`};default:return{stroke:t.accent,strokeWidth:2,strokeDasharray:`6 4`,opacity:.88,markerEnd:`url(#${n.primary})`}}}function L_({id:e,fill:t}){return(0,u.jsx)(`marker`,{id:e,viewBox:`0 0 ${P_} ${F_}`,refX:P_-.5,refY:F_/2,markerWidth:P_,markerHeight:F_,orient:`auto`,markerUnits:`userSpaceOnUse`,children:(0,u.jsx)(`path`,{d:`M0,0 L${P_},${F_/2} L0,${F_} Z`,fill:t})})}function R_({edges:e,focusId:t,itemById:n,bundleIndexById:r,bundles:i,rowOffsets:a,canvasWidth:o,effectiveLabelW:s,rangeStart:c,rangeEnd:l,scrollTop:d,viewportH:f,theme:p=`light`,showTests:m=!0}){if(t==null||e.length===0)return null;let h=Ee(p),g=o-s-24,_=`gantt-edge-mk-primary`,v=`gantt-edge-mk-secondary`,y=`gantt-edge-mk-downstream`,b={primary:_,secondary:v,downstream:y};return(0,u.jsxs)(`svg`,{style:{position:`absolute`,top:0,left:0,width:`100%`,height:f,pointerEvents:`none`,overflow:`hidden`,zIndex:5},"aria-hidden":!0,children:[(0,u.jsxs)(`defs`,{children:[(0,u.jsx)(L_,{id:_,fill:h.accent}),(0,u.jsx)(L_,{id:v,fill:h.slate}),(0,u.jsx)(L_,{id:y,fill:h.accent})]}),e.map((e,t)=>{let o=N_({edge:e,itemById:n,bundleIndexById:r,bundles:i,rowOffsets:a,scrollTop:d,showTests:m,effectiveLabelW:s,rangeStart:c,rangeEnd:l,chartW:g});if(!o)return null;let{stroke:f,strokeWidth:p,strokeDasharray:_,opacity:v,markerEnd:y}=I_(e,h,b);return(0,u.jsx)(`path`,{d:o,stroke:f,strokeWidth:p,strokeDasharray:_,fill:`none`,opacity:v,markerEnd:y},`${e.fromId}-${e.toId}-${e.tier}-${e.hop}-${e.leg}-${t}`)})]})}var z_=8;function B_({labelColumnW:e,viewportH:t,minW:n,maxW:r,onWidthChange:i}){let a=(0,c.useRef)(null),o=(0,c.useCallback)(e=>Math.max(n,Math.min(r,Math.round(e))),[n,r]),s=(0,c.useCallback)(t=>{t.preventDefault(),t.stopPropagation(),a.current={startX:t.clientX,startW:e},t.currentTarget.setPointerCapture(t.pointerId)},[e]),l=(0,c.useCallback)(e=>{let t=a.current;t&&i(o(t.startW+(e.clientX-t.startX)))},[o,i]),d=(0,c.useCallback)(e=>{a.current=null;try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}},[]),f=Math.max(0,e-z_/2);return(0,u.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize timeline name column`,className:`gantt-label-resize-handle`,style:{position:`absolute`,left:f,top:0,width:z_,height:t,cursor:`col-resize`,touchAction:`none`,zIndex:4,background:`transparent`},onPointerDown:s,onPointerMove:l,onPointerUp:d,onPointerCancel:d})}var V_=16,H_=0,U_=12;function W_(e){return e.split(/[\s_-]+/).filter(Boolean).map(e=>e[0].toUpperCase()+e.slice(1).toLowerCase()).join(` `)}function G_({hoverX:e,hoverY:t,frameWidth:n,frameHeight:r,tooltipWidth:i,tooltipHeight:a,offsetX:o=V_,offsetY:s=H_,margin:c=U_}){let l=Math.max(n,i+c*2),u=Math.max(r,a+c*2),d=e+o;d+i>l-c&&(d=e-i-o);let f=t+s;return f+a>u-c&&(f=u-a-c),d=Math.min(Math.max(c,d),Math.max(c,l-i-c)),f=Math.min(Math.max(c,f),Math.max(c,u-a-c)),{left:d,top:f}}function K_(e){if(!e)return!1;let t=e.adapterMetrics,n=e.adapterResponseFields;return Ki(t,n).length>0?!0:t==null?!1:Hi([t]).length>0}function q_({resource:e}){if(!e)return null;let t=e.adapterMetrics,n=e.adapterResponseFields,r=Ki(t,n),i=t==null?[]:Hi([t]);if(r.length===0&&i.length===0)return null;let a=t;return(0,u.jsxs)(`div`,{style:{marginTop:`0.25rem`,maxWidth:340},children:[(0,u.jsx)(`div`,{style:{marginBottom:`0.15rem`},children:(0,u.jsx)(`span`,{style:Jg,children:`Adapter response`})}),i.length>0&&a!=null?(0,u.jsx)(`div`,{style:{whiteSpace:`pre-wrap`,fontSize:`0.82rem`,lineHeight:1.35},children:i.map(e=>{let t=Bi(a,e.key),n=t===void 0?`—`:Vi(e,t);return`${e.shortLabel}: ${n}`}).join(`
|
|
30
|
+
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return pm(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=uh.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function bh(){return{exit:{taskListCheckValueChecked:Sh,taskListCheckValueUnchecked:Sh,paragraph:Ch}}}function xh(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:wh}}}function Sh(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function Ch(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function wh(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=uh.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function Th(){return[jp(),tm(),om(),dh(),bh()]}function Eh(e){return{extensions:[Mp(),nm(e),sm(),yh(e),xh()]}}var Dh={tokenize:Vh,partial:!0},Oh={tokenize:Hh,partial:!0},kh={tokenize:Uh,partial:!0},Ah={tokenize:Wh,partial:!0},jh={tokenize:Gh,partial:!0},Mh={name:`wwwAutolink`,tokenize:zh,previous:Kh},Nh={name:`protocolAutolink`,tokenize:Bh,previous:qh},Ph={name:`emailAutolink`,tokenize:Rh,previous:Jh},Fh={};function Ih(){return{text:Fh}}for(var Lh=48;Lh<123;)Fh[Lh]=Ph,Lh++,Lh===58?Lh=65:Lh===91&&(Lh=97);Fh[43]=Ph,Fh[45]=Ph,Fh[46]=Ph,Fh[95]=Ph,Fh[72]=[Ph,Nh],Fh[104]=[Ph,Nh],Fh[87]=[Ph,Mh],Fh[119]=[Ph,Mh];function Rh(e,t,n){let r=this,i,a;return o;function o(t){return!Yh(t)||!Jh.call(r,r.previous)||Xh(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return Yh(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(jh,u,l)(t):t===45||t===95||J(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&Pc(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function zh(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!Kh.call(r,r.previous)||Xh(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(Dh,e.attempt(Oh,e.attempt(kh,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function Bh(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&qh.call(r,r.previous)&&!Xh(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(Pc(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||Ic(t)||X(t)||Vc(t)||Bc(t)?n(t):e.attempt(Oh,e.attempt(kh,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function Vh(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function Hh(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(Ah,c,s)(t):t===null||X(t)||Vc(t)||t!==45&&Bc(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function Uh(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(Ah,t,a)(o):o===null||X(o)||Vc(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function Wh(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||X(o)||Vc(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||X(e)||Vc(e)?t(e):r(e)}function a(e){return Pc(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):Pc(t)?(e.consume(t),o):n(t)}}function Gh(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return J(e)?n(e):t(e)}}function Kh(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||X(e)}function qh(e){return!Pc(e)}function Jh(e){return!(e===47||Yh(e))}function Yh(e){return e===43||e===45||e===46||e===95||J(e)}function Xh(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var Zh={tokenize:ag,partial:!0};function Qh(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:ng,continuation:{tokenize:rg},exit:ig}},text:{91:{name:`gfmFootnoteCall`,tokenize:tg},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:$h,resolveTo:eg}}}}function $h(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=Nc(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function eg(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function tg(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||X(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(Nc(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return X(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function ng(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||X(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=Nc(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return X(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),Q(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function rg(e,t,n){return e.check(il,t,e.attempt(Zh,t,n))}function ig(e){e.exit(`gfmFootnoteDefinition`)}function ag(e,t,n){let r=this;return Q(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function og(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&Ec(o,o.length,0,Zc(s,e.slice(r+1,n),t)),Ec(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),Ec(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=Xc(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=Xc(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var sg=class{constructor(){this.map=[]}add(e,t,n){cg(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function cg(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function lg(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function ug(){return{flow:{null:{name:`table`,tokenize:dg,resolveAll:fg}}}}function dg(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):Y(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):Z(t)?Q(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||X(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,Z(t)?Q(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return Z(t)?Q(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||Y(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return Z(t)?Q(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||Y(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||Y(n)?(e.exit(`tableRow`),t(n)):Z(n)?Q(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||X(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function fg(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new sg;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(mg(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=pg(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=pg(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=pg(f,t,o,i,n,d)):(o[0]=o[1],d=pg(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&mg(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=lg(t.events,n))}return e}function pg(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},hg(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=hg(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=hg(t.events,n[2]),a=hg(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},hg(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function mg(e,t,n,r,i){let a=[],o=hg(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function hg(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var gg={name:`tasklistCheck`,tokenize:vg};function _g(){return{text:{91:gg}}}function vg(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return X(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return Y(r)?t(r):Z(r)?e.check({tokenize:yg},t,n)(r):n(r)}}function yg(e,t,n){return Q(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function bg(e){return kc([Ih(),Qh(),og(e),ug(),_g()])}var xg={};function Sg(e){let t=this,n=e||xg,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(bg(n)),a.push(Th()),o.push(Eh(n))}function Cg({href:e,children:t,...n}){let r=typeof e==`string`&&(e.startsWith(`http://`)||e.startsWith(`https://`));return(0,u.jsx)(`a`,{href:e,...n,...r?{target:`_blank`,rel:`noopener noreferrer`}:{},children:t})}var wg={a:Cg};function Tg({markdown:e,className:t,regionLabel:n=`Asset description`}){let r=(0,c.useRef)(null),[i,a]=(0,c.useState)(!1),[o,s]=(0,c.useState)(!1);return(0,c.useEffect)(()=>{let e=r.current;if(!e)return;let t=()=>{let e=r.current;if(e){if(i){s(!1);return}s(e.scrollHeight>e.clientHeight+1)}};t();let n=globalThis.ResizeObserver;if(n===void 0)return;let a=new n(t);return a.observe(e),()=>{a.disconnect()}},[e,i]),(0,u.jsxs)(`div`,{className:[`resource-description-md`,t].filter(Boolean).join(` `),role:`region`,"aria-label":n,children:[(0,u.jsx)(`div`,{ref:r,className:i?`resource-description-md__viewport resource-description-md__viewport--expanded`:`resource-description-md__viewport resource-description-md__viewport--collapsed`,children:(0,u.jsx)(`div`,{className:`resource-description-md__prose`,children:(0,u.jsx)(vp,{remarkPlugins:[Sg],components:wg,children:e})})}),(0,u.jsxs)(`div`,{className:`resource-description-md__toolbar`,children:[!i&&o?(0,u.jsx)(`button`,{type:`button`,className:`resource-description-md__toggle workspace-pill`,onClick:()=>a(!0),children:`Expand description`}):null,i?(0,u.jsx)(`button`,{type:`button`,className:`resource-description-md__toggle workspace-pill`,onClick:()=>a(!1),children:`Collapse description`}):null]})]})}var Eg=(0,c.createContext)({missingCatalog:!1,missingSources:!1});function Dg(){return(0,c.useContext)(Eg)}function Og(e){let t=e.semantics?.relationName?.trim();if(t)return kr(t);let n=e.database?.trim(),r=e.schema?.trim();return n&&r?`${n}.${r}`:r||n||`n/a`}function kg({adapterMetrics:e,extraAdapterRawFields:t}){let n=e==null?[]:Vn([e]);return t.length>0||n.length>0?(0,u.jsxs)(`div`,{className:`asset-summary__group`,children:[(0,u.jsx)(`p`,{className:`asset-summary__group-title`,children:`Adapter response`}),e!=null&&n.length>0?(0,u.jsx)(`div`,{className:`detail-grid`,children:n.map(t=>{let n=zn(e,t.key);return(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:t.shortLabel}),(0,u.jsx)(`strong`,{children:n===void 0?`—`:Bn(t,n)})]},t.key)})}):null,t.length>0?(0,u.jsx)(`div`,{className:`asset-summary__adapter-raw`,"aria-label":`Additional adapter response fields`,children:t.map(e=>`${e.label}: ${e.displayValue}`).join(`
|
|
31
|
+
`)}):null]}):null}function Ag({freshness:e}){return e==null?null:(0,u.jsxs)(yi,{title:`Source freshness`,subtitle:`Latest freshness evidence from sources.json when provided.`,children:[(0,u.jsxs)(`div`,{className:`detail-grid`,children:[(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Status`}),(0,u.jsx)(`strong`,{children:e.status})]}),(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Age`}),(0,u.jsx)(`strong`,{children:Er(e.ageSeconds)})]}),(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Max loaded at`}),(0,u.jsx)(`strong`,{children:e.maxLoadedAt??`n/a`})]}),(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Snapshotted at`}),(0,u.jsx)(`strong`,{children:e.snapshottedAt??`n/a`})]})]}),e.criteria==null?null:(0,u.jsxs)(`div`,{className:`detail-grid`,children:[(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Warn after`}),(0,u.jsx)(`strong`,{children:e.criteria.warnAfter??`n/a`})]}),(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Error after`}),(0,u.jsx)(`strong`,{children:e.criteria.errorAfter??`n/a`})]}),(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Filter`}),(0,u.jsx)(`strong`,{children:e.criteria.filter??`n/a`})]})]}),e.error?(0,u.jsx)(`p`,{className:`resource-spotlight__description`,children:e.error}):null]})}function jg({resource:e,executionRow:t=null}){let n=Dg(),r=e.adapterMetrics??t?.adapterMetrics,i=Gn(r,e.adapterResponseFields??t?.adapterResponseFields);return(0,u.jsxs)(`div`,{className:`asset-summary-stack`,children:[n.missingCatalog||n.missingSources?(0,u.jsx)(yi,{title:`Optional artifacts`,subtitle:`Capabilities limited for this session because some JSON files were not part of the load.`,children:(0,u.jsxs)(`ul`,{className:`resource-spotlight__description resource-spotlight__description--muted`,children:[n.missingCatalog?(0,u.jsxs)(`li`,{children:[(0,u.jsx)(`code`,{children:`catalog.json`}),` was not loaded — column counts and richer warehouse metadata may be absent.`]}):null,n.missingSources?(0,u.jsxs)(`li`,{children:[(0,u.jsx)(`code`,{children:`sources.json`}),` was not loaded — source freshness evidence is unavailable.`]}):null]})}):null,(0,u.jsxs)(yi,{title:`Resource`,subtitle:`Path, relation, and description from the project manifest.`,children:[(0,u.jsxs)(`div`,{className:`detail-grid`,children:[(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Project`}),(0,u.jsx)(`strong`,{children:e.packageName?.trim()||`n/a`})]}),(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Path`}),(0,u.jsx)(`strong`,{children:Nr(e)??`n/a`})]}),(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Relation`}),(0,u.jsx)(`strong`,{children:Og(e)})]}),e.catalogStats==null?null:(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Catalog columns`}),(0,u.jsx)(`strong`,{children:e.catalogStats.columnCount})]})]}),e.description?(0,u.jsx)(Tg,{markdown:e.description,className:`resource-spotlight__description`}):(0,u.jsx)(`p`,{className:`resource-spotlight__description resource-spotlight__description--muted`,children:`No description was captured for this asset. Catalog-oriented metadata can surface here when present in the manifest.`})]}),(0,u.jsx)(Ag,{freshness:e.sourceFreshness}),(0,u.jsx)(yi,{title:`This run`,subtitle:`Status, timing, and warehouse feedback from the captured run.`,children:(0,u.jsxs)(`div`,{className:`asset-summary__groups`,children:[(0,u.jsxs)(`div`,{className:`detail-grid`,children:[(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Status`}),(0,u.jsx)(`strong`,{children:e.status??`Not executed`})]}),(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Execution time`}),(0,u.jsx)(`strong`,{children:Er(e.executionTime)})]}),(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Thread`}),(0,u.jsx)(`strong`,{children:e.threadId??`n/a`})]})]}),(0,u.jsx)(kg,{adapterMetrics:r,extraAdapterRawFields:i})]})})]})}var Mg=new Set(`SELECT FROM WHERE WITH AS JOIN ON GROUP BY ORDER LIMIT HAVING UNION CASE WHEN THEN ELSE END LEFT RIGHT INNER OUTER CROSS DISTINCT NULL AND OR NOT IN IS BETWEEN LIKE EXISTS INSERT INTO UPDATE SET DELETE CREATE TABLE VIEW REPLACE IF ASC DESC USING AT ZONE INTERVAL QUALIFY WINDOW ROWS RANGE UNBOUNDED PRECEDING FOLLOWING CURRENT ROW PARTITION OVER`.split(` `)),Ng=new Set(`SUM COUNT AVG MAX MIN COALESCE CAST IFF IF ROW_NUMBER RANK DENSE_RANK NTILE LEAD LAG FIRST_VALUE LAST_VALUE NVL NVL2 NULLIF GREATEST LEAST TRIM LTRIM RTRIM UPPER LOWER LENGTH SUBSTR SUBSTRING REPLACE SPLIT CONCAT DATE YEAR MONTH DAY HOUR MINUTE SECOND DATEDIFF DATEADD CURRENT_DATE CURRENT_TIMESTAMP TO_DATE TO_TIMESTAMP TO_NUMBER TO_VARCHAR TRY_CAST CONVERT FLOOR CEIL ROUND ABS MOD SQRT LOG EXP ARRAY_AGG LISTAGG STRING_AGG GROUP_CONCAT FLATTEN UNNEST GENERATE_SERIES`.split(` `));function Pg(e){let t=t=>{if(!e.startsWith(`/*`,t))return null;let n=e.indexOf(`*/`,t+2);return n===-1?e.slice(t):e.slice(t,n+2)},n=t=>{if(!e.startsWith(`--`,t))return null;let n=e.indexOf(`
|
|
32
|
+
`,t);return n===-1?e.slice(t):e.slice(t,n+1)},r=t=>{if(e[t]!==`'`)return null;let n=t+1;for(;n<e.length;){if(e[n]===`'`&&e[n-1]!==`\\`){n+=1;break}n+=1}return e.slice(t,n)},i=t=>{let n=/^[0-9]+(\.[0-9]+)?/.exec(e.slice(t));return!n||t>0&&/[a-zA-Z_]/.test(e[t-1])?null:n[0]},a=t=>{let n=/^[a-zA-Z_][a-zA-Z0-9_]*/.exec(e.slice(t));if(!n)return null;let r=n[0],i=r.toUpperCase();return{type:Mg.has(i)?`keyword`:Ng.has(i)?`function`:`identifier`,value:r}},o=a=>{let o=t(a)??n(a)??r(a)??i(a);return o==null?null:o.startsWith(`/*`)||o.startsWith(`--`)?{type:`comment`,value:o}:e[a]===`'`?{type:`string`,value:o}:{type:`number`,value:o}},s=e=>/[=<>!|+\-*/%^&~]/.test(e)?`operator`:/[(),;.[\]{}]/.test(e)?`punctuation`:null,c=[],l=0,u=e.length;for(;l<u;){let t=o(l);if(t!=null){c.push(t),l+=t.value.length;continue}let n=a(l);if(n!=null){c.push(n),l+=n.value.length;continue}let r=s(e[l]);if(r!=null){c.push({type:r,value:e[l]}),l++;continue}c.push({type:`plain`,value:e[l]}),l++}return c}function Fg({sql:e}){return(0,u.jsx)(`pre`,{className:`sql-panel`,children:(0,u.jsx)(`code`,{children:Pg(e).map((e,t)=>e.type===`plain`||e.type===`identifier`?e.value:(0,u.jsx)(`span`,{className:`sql-token-${e.type}`,children:e.value},t))})})}function Ig({size:e=24,label:t}){return(0,u.jsxs)(`svg`,{className:`spinner`,width:e,height:e,viewBox:`0 0 24 24`,fill:`none`,"aria-hidden":t?void 0:`true`,"aria-label":t,role:t?`img`:void 0,children:[(0,u.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`,stroke:`var(--panel-border)`,strokeWidth:`2.5`}),(0,u.jsx)(`path`,{d:`M12 2 A10 10 0 0 1 22 12`,stroke:`var(--accent)`,strokeWidth:`2.5`,strokeLinecap:`round`})]})}function Lg({label:e,values:t}){return t.length===0?null:(0,u.jsxs)(`div`,{className:`definition-list`,children:[(0,u.jsx)(`span`,{children:e}),(0,u.jsx)(`div`,{className:`definition-list__values`,children:t.map(e=>(0,u.jsx)(`span`,{className:`definition-pill`,children:e},e))})]})}function Rg(e){return(0,u.jsxs)(`div`,{className:`definition-panel`,children:[(0,u.jsxs)(`div`,{className:`detail-grid`,children:[(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Label`}),(0,u.jsx)(`strong`,{children:e.label??`Not captured`})]}),(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Metric type`}),(0,u.jsx)(`strong`,{children:e.metricType??`Not captured`})]}),(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Source`}),(0,u.jsx)(`strong`,{children:e.sourceReference??`Not captured`})]}),(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Time granularity`}),(0,u.jsx)(`strong`,{children:e.timeGranularity??`Not captured`})]})]}),e.expression&&(0,u.jsxs)(`div`,{className:`definition-block`,children:[(0,u.jsx)(`span`,{children:`Expression`}),(0,u.jsx)(`pre`,{children:e.expression})]}),e.description&&(0,u.jsxs)(`div`,{className:`definition-block`,children:[(0,u.jsx)(`span`,{children:`Description`}),(0,u.jsx)(`p`,{children:e.description})]}),(0,u.jsx)(Lg,{label:`Measures`,values:e.measures}),(0,u.jsx)(Lg,{label:`Referenced metrics`,values:e.metrics}),(0,u.jsx)(Lg,{label:`Filters`,values:e.filters})]})}function zg(e){return(0,u.jsxs)(`div`,{className:`definition-panel`,children:[(0,u.jsxs)(`div`,{className:`detail-grid`,children:[(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Label`}),(0,u.jsx)(`strong`,{children:e.label??`Not captured`})]}),(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Source model`}),(0,u.jsx)(`strong`,{children:e.sourceReference??`Not captured`})]}),(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Default time dimension`}),(0,u.jsx)(`strong`,{children:e.defaultTimeDimension??`Not captured`})]})]}),(0,u.jsx)(Lg,{label:`Entities`,values:e.entities}),(0,u.jsx)(Lg,{label:`Measures`,values:e.measures}),(0,u.jsx)(Lg,{label:`Dimensions`,values:e.dimensions}),e.description&&(0,u.jsxs)(`div`,{className:`definition-block`,children:[(0,u.jsx)(`span`,{children:`Description`}),(0,u.jsx)(`p`,{children:e.description})]})]})}function Bg({showsDefinition:e,definition:t,sqlText:n,codeLoading:r,codeError:i}){return e&&t?t.kind===`metric`?Rg(t):zg(t):r?(0,u.jsxs)(`div`,{className:`asset-sql-loading`,"aria-busy":`true`,children:[(0,u.jsx)(Ig,{size:28,label:`Loading SQL`}),(0,u.jsx)(`span`,{className:`asset-sql-loading__label`,children:`Loading SQL…`})]}):i?(0,u.jsx)($r,{icon:`⚠`,headline:`Could not load SQL`,subtext:i}):n?(0,u.jsx)(Fg,{sql:n}):(0,u.jsx)($r,{icon:`⌘`,headline:e?`No definition available`:`No SQL available`,subtext:e?`This resource does not expose enough definition metadata in the current artifacts.`:`This resource does not expose compiled or raw SQL in the current artifacts.`})}function Vg({showsDefinition:e,definition:t,sqlText:n,codeLoading:r,codeError:i,hasCompiledSql:a}){return(0,u.jsx)(yi,{title:e?`Definition`:`SQL`,subtitle:e?t?.kind===`metric`?`Structured metric definition captured from the manifest.`:`Structured semantic model definition captured from the manifest.`:a?`Compiled SQL for the selected resource.`:`Raw SQL captured from the manifest.`,children:Bg({showsDefinition:e,definition:t,sqlText:n,codeLoading:r,codeError:i})})}function Hg(e){return e===`runtime`?`summary`:e}function Ug({resource:e,analysis:t,onSelectResource:n,assetViewState:r,onAssetViewStateChange:i,lineageViewState:a,onLineageViewStateChange:o,onNavigateTo:s}){let l=(0,c.useMemo)(()=>new Map(t.resources.map(e=>[e.uniqueId,e])),[t.resources]),d=(0,c.useMemo)(()=>e==null?null:t.executions.find(t=>t.uniqueId===e.uniqueId)??null,[t.executions,e]),f=a.upstreamDepth,p=a.downstreamDepth,m=a.allDepsMode,h=a.lensMode,g=a.activeLegendKeys,_=e=>o(t=>({...t,upstreamDepth:typeof e==`function`?e(t.upstreamDepth):e})),v=e=>o(t=>({...t,downstreamDepth:typeof e==`function`?e(t.downstreamDepth):e})),y=e=>o(t=>({...t,allDepsMode:typeof e==`function`?e(t.allDepsMode):e})),b=e=>o(t=>({...t,lensMode:e,activeLegendKeys:new Set})),x=e=>o(t=>({...t,activeLegendKeys:typeof e==`function`?e(t.activeLegendKeys):e})),S=Hg(r.activeTab),[C,w]=(0,c.useState)(!1),T=(0,c.useRef)({summary:null,lineage:null,sql:null,tests:null});(0,c.useEffect)(()=>{if(!e)return;let t=T.current[S];if(!t)return;let n=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;t.scrollIntoView({block:`start`,behavior:n?`auto`:`smooth`})},[S,e]);let{compiledCode:E,rawCode:D,loading:O,error:k}=Wo(e?.uniqueId??null,t);if(!e)return(0,u.jsx)(`div`,{className:`workspace-card`,children:(0,u.jsx)($r,{icon:`🔍`,headline:`No resource selected`,subtext:`Adjust the explorer filters or search to find the resource you're looking for.`})});let A=t.dependencyIndex[e.uniqueId],j=E??D??void 0,M=E!=null&&E!==``,N=e.definition??null,P=N?.kind===`metric`||N?.kind===`semantic_model`,ee=(0,u.jsxs)(`div`,{className:`resource-detail__subtitle`,children:[(0,u.jsx)(bi,{resourceType:e.resourceType}),e.semantics?(0,u.jsx)(ua,{semantics:e.semantics}):null,(0,u.jsx)(`span`,{className:`resource-detail__package`,children:e.packageName||`workspace`})]}),F={resource:e,dependencySummary:A,dependencyIndex:t.dependencyIndex,resourceById:l,upstreamDepth:f,downstreamDepth:p,allDepsMode:m,lensMode:h,activeLegendKeys:g,setUpstreamDepth:_,setDownstreamDepth:v,setAllDepsMode:y,setLensMode:b,setActiveLegendKeys:x,onSelectResource:e=>{n(e),o(t=>({...t,selectedResourceId:e})),i(t=>({...t,selectedResourceId:e,activeTab:`lineage`}))}};return(0,u.jsxs)(`div`,{className:`workspace-view asset-workspace`,children:[(0,u.jsxs)(`section`,{className:`catalog-detail-hero`,children:[(0,u.jsxs)(`div`,{className:`catalog-detail-hero__content`,children:[(0,u.jsx)(`p`,{className:`eyebrow`,children:`Selected asset`}),(0,u.jsx)(`h3`,{children:e.name}),ee]}),(0,u.jsx)(`div`,{className:`asset-hero__actions`,"aria-label":`Asset actions`,children:(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:()=>s(`timeline`,{resourceId:e.uniqueId,executionId:e.uniqueId}),children:`Open in Timeline`})})]}),(0,u.jsx)(`div`,{className:`asset-workspace__body`,children:(0,u.jsxs)(`div`,{className:`asset-workspace__sections`,children:[(0,u.jsx)(`section`,{id:`asset-section-summary`,ref:e=>{T.current.summary=e},className:`asset-workspace__section`,children:(0,u.jsx)(jg,{resource:e,executionRow:d})}),(0,u.jsx)(`section`,{id:`asset-section-lineage`,ref:e=>{T.current.lineage=e},className:`asset-workspace__section`,children:(0,u.jsx)(Do,{...F,displayMode:`summary`,openFullscreen:C,onFullscreenChange:w})}),(0,u.jsx)(`section`,{id:`asset-section-tests`,ref:e=>{T.current.tests=e},className:`asset-workspace__section`,children:(0,u.jsx)(Uo,{resource:e,analysis:t,onNavigateTo:s})}),(0,u.jsx)(`section`,{id:`asset-section-sql`,ref:e=>{T.current.sql=e},className:`asset-workspace__section`,children:(0,u.jsx)(Vg,{showsDefinition:P,definition:N,sqlText:j,codeLoading:O,codeError:k,hasCompiledSql:M})})]})})]})}var Wg=200;function Gg({analysis:e,resource:t,onSelectResource:n,assetViewState:r,onAssetViewStateChange:i,lineageViewState:a,onLineageViewStateChange:o,onInvestigationSelectionChange:s,onNavigateTo:l}){let[d,f]=(0,c.useState)(``),[p,m]=(0,c.useState)([]),[h,g]=(0,c.useState)(!1),[_,v]=(0,c.useState)(``),y=(0,c.useRef)(0);(0,c.useEffect)(()=>{let e=d.trim(),t=e?Wg:0,n=window.setTimeout(()=>{if(!e){y.current+=1,m([]),g(!1);return}y.current+=1;let t=y.current;g(!0),T(e).then(e=>{y.current===t&&m(e)}).catch(()=>{y.current===t&&m([])}).finally(()=>{y.current===t&&g(!1)})},t);return()=>window.clearTimeout(n)},[d]);let b=e=>{e&&(i(t=>({...t,selectedResourceId:e,activeTab:`lineage`})),o(t=>({...t,rootResourceId:e,selectedResourceId:e})),s(t=>({...t,selectedResourceId:e,sourceLens:`inventory`})))};return(0,u.jsx)(Ci,{title:`Inventory`,description:`Browse, filter, and inspect all workspace assets.`,className:`inventory-view`,suppressHeader:t!=null,children:t?(0,u.jsx)(Ug,{analysis:e,resource:t,onSelectResource:e=>{n(e),s(t=>({...t,selectedResourceId:e,sourceLens:`inventory`}))},assetViewState:r,onAssetViewStateChange:i,lineageViewState:a,onLineageViewStateChange:o,onNavigateTo:l}):(0,u.jsx)(`div`,{className:`inventory-empty-state`,children:(0,u.jsxs)(`div`,{className:`inventory-empty-state__inner`,children:[(0,u.jsx)($r,{icon:`◱`,headline:`Select an asset to inspect`,subtext:`Use the browser panel on the left to find and select a model, source, seed, or other asset.`}),(0,u.jsxs)(`div`,{className:`inventory-empty-state__lineage-pick`,role:`group`,"aria-label":`Jump to lineage for an asset`,children:[(0,u.jsx)(`label`,{className:`inventory-empty-state__lineage-label`,htmlFor:`inventory-lineage-search`,children:`Or search for an asset to open its lineage graph`}),(0,u.jsx)(`input`,{id:`inventory-lineage-search`,type:`search`,className:`inventory-empty-state__lineage-search`,value:d,onChange:e=>{f(e.target.value),v(``)},placeholder:`Name, type, package, or unique id…`,autoComplete:`off`,enterKeyHint:`search`}),h&&(0,u.jsx)(`p`,{className:`inventory-empty-state__lineage-hint`,"aria-live":`polite`,children:`Searching…`}),p.length>0&&(0,u.jsx)(`ul`,{className:`inventory-empty-state__lineage-suggestions`,role:`listbox`,"aria-label":`Matching assets`,children:p.map(e=>(0,u.jsx)(`li`,{role:`none`,children:(0,u.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":_===e.uniqueId,className:_===e.uniqueId?`inventory-lineage-suggestion inventory-lineage-suggestion--active`:`inventory-lineage-suggestion`,onClick:()=>{y.current+=1,v(e.uniqueId),f(`${e.name} (${e.resourceType})`),m([]),g(!1)},children:[(0,u.jsx)(`span`,{className:`inventory-lineage-suggestion__name`,children:e.name}),(0,u.jsxs)(`span`,{className:`inventory-lineage-suggestion__meta`,children:[e.resourceType,e.packageName?` · ${e.packageName}`:``]})]})},e.uniqueId))}),(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill`,disabled:!_,onClick:()=>b(_),children:`Open lineage graph`})]})]})})})}function Kg(e){let t=[],n=new Map;for(let r of e)if(H.has(r.resourceType)){if(r.parentId!=null){let e=n.get(r.parentId)??[];e.push(r),n.set(r.parentId,e)}}else t.push(r);return t.sort((e,t)=>{let n=e.start-t.start;return n===0?t.duration-e.duration:n}),t.map(e=>{let t=n.get(e.unique_id)??[],{lanes:r,laneCount:i}=qg(t);return{item:e,tests:t,lanes:r,laneCount:i}})}function qg(e){if(e.length===0)return{lanes:[],laneCount:0};let t=[...e].sort((e,t)=>e.start-t.start),n=[],r=[];for(let e of t){let t=-1;for(let r=0;r<n.length;r++)if((n[r]??0)<=e.start){t=r,n[r]=e.end;break}t===-1&&(t=n.length,n.push(e.end)),r.push({item:e,lane:t})}return{lanes:r,laneCount:n.length}}var Jg=`dbt-tools.timelineLabelWidthPx`,Yg=.78,Xg={color:`var(--text-soft)`,fontSize:`0.82rem`},Zg=`dbt-tools.timelineTimezone`;function Qg(e){return e>=6e4?`${(e/6e4).toFixed(0)}m`:e>=1e4?`${(e/1e3).toFixed(0)}s`:e>=1e3?`${(e/1e3).toFixed(1)}s`:`${e.toFixed(0)}ms`}function $g(e,t){return new Intl.DateTimeFormat(`en-US`,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1,timeZone:t}).format(new Date(e))}function e_(){let e=Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`,t=Intl.supportedValuesOf,n=t?.(`timeZone`)??[];return Array.from(new Set([e,`UTC`,...n]))}function t_(){let e=Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`;try{return window.localStorage.getItem(`dbt-tools.timelineTimezone`)||e}catch{return e}}function n_(e=160){try{let t=window.localStorage.getItem(Jg);if(t==null)return e;let n=Number.parseInt(t,10);return Number.isFinite(n)?n:e}catch{return e}}function r_(e){return[`success`,`pass`,`passed`].includes(e.trim().toLowerCase())}function i_(e){return[`skipped`,`no op`].includes(e.trim().toLowerCase())}function a_(e){let t=e.trim().toLowerCase();return!r_(t)&&!i_(t)}function o_(e){if(!Number.isFinite(e)||e<6e4)return 6e4;let t=10**Math.max(0,Math.floor(Math.log10(e))),n=e/t;return Math.max(6e4,(n<=1?1:n<=2?2:n<=5?5:10)*t)}var s_=[50,100,200,500,1e3,2e3,5e3,1e4,2e4,3e4,6e4,12e4,3e5,6e5,9e5,18e5,36e5,72e5,144e5,216e5,432e5,864e5],c_=8;function l_(e,t){if(t<=e)return[];let n=t-e,r=s_.find(e=>n/e<=c_)??o_(Math.ceil(n/c_)),i=[],a=Math.ceil(e/r)*r;e>0&&i.push({ms:e,label:Qg(e)});for(let n=a;n<=t;n+=r)n<=e||n>=t||i.push({ms:n,label:Qg(n)});return i.push({ms:t,label:Qg(t)}),i}function u_(e,t,n,r,i,a,o=10){if(e.length===0||r<=0)return e;let s=Math.max(1,n-t),c=e.map(e=>{let n=(e.ms-t)/s*r,o=a(i(e))/2;return{ms:e.ms,label:e.label,x:n,hw:o}}),l=e=>({ms:e.ms,label:e.label}),u=new Map(c.map(e=>[e.ms,e]));return(e=>{let t=c[c.length-1];if(t.ms!==n||e[e.length-1]?.ms===n)return e;for(;e.length>0;){let n=e[e.length-1],r=u.get(n.ms);if(!r||t.x-t.hw>=r.x+r.hw+o)break;e.pop()}return e.length===0&&e.push(l(c[0])),e.push(l(t)),e})((()=>{let e=[],t=null;for(let n of c){if(t==null){e.push(l(n)),t=n;continue}n.x-n.hw>=t.x+t.hw+o&&(e.push(l(n)),t=n)}return e})())}function d_(e,t){let n=t>0?Math.max(120,Math.min(560,t-200)):560;return Math.max(120,Math.min(n,Math.round(e)))}function f_(e){let[t,n]=(0,c.useState)(()=>typeof window>`u`?160:n_(220));(0,c.useEffect)(()=>{e<=0||n(t=>d_(t,e))},[e]),(0,c.useEffect)(()=>{try{window.localStorage.setItem(Jg,String(t))}catch{}},[t]);let r=(0,c.useMemo)(()=>e<=0?560:Math.max(120,Math.min(560,e-200)),[e]);return{effectiveLabelW:e>0?d_(t,e):t,maxLabelW:r,onLabelColumnWidthDrag:(0,c.useCallback)(t=>{n(d_(t,e>0?e:800))},[e])}}function p_(e,t){return!e||!t||!H.has(t.resourceType)||!H.has(e.resourceType)||t.parentId==null||e.parentId==null?!1:t.parentId===e.parentId}var m_={model:0,source:1,source_freshness:1,snapshot:2,seed:3,exposure:4,metric:5,semantic_model:6,test:7,unit_test:8,macro:9,analysis:10};function h_(e){return e?m_[e]??98:99}function g_(e,t,n){return[...e].sort((e,r)=>{let i=n.get(e),a=n.get(r),o=p_(i,t)?0:1,s=p_(a,t)?0:1;if(o!==s)return o-s;let c=h_(i?.resourceType),l=h_(a?.resourceType);if(c!==l)return c-l;let u=Math.abs((i?.end??0)-t.start),d=Math.abs((a?.end??0)-t.start);return u===d?e.localeCompare(r):u-d})}function __(e,t,n){return t||e.length<=n?e:e.slice(0,n)}function v_(e,t,n){return[...e].sort((e,r)=>{let i=n.get(e),a=n.get(r),o=p_(i,t)?0:1,s=p_(a,t)?0:1;if(o!==s)return o-s;let c=h_(i?.resourceType),l=h_(a?.resourceType);if(c!==l)return c-l;let u=Math.abs((i?.start??0)-t.end),d=Math.abs((a?.start??0)-t.end);return u===d?e.localeCompare(r):u-d})}function y_(e){return`${e.fromId}\t${e.toId}`}function b_(e,t){if(e.hop!==t.hop)return e.hop-t.hop;let n=e.leg===`upstream`?0:1,r=t.leg===`upstream`?0:1;if(n!==r)return n-r;let i=e.fromId.localeCompare(t.fromId);return i===0?e.toId.localeCompare(t.toId):i}function x_(e,t,n,r,i,a){return __(g_(t.inbound.filter(e=>i(e)),n,r),a.showAllUpstream,a.maxUpstreamEdges).map(t=>({fromId:t,toId:e,tier:p_(r.get(t),n)?`secondary`:`primary`,hop:1,leg:`upstream`}))}function S_(e,t,n,r,i,a){return __(v_(t.outbound.filter(e=>i(e)),n,r),a.showAllDownstream,a.maxDownstreamEdges).map(t=>({fromId:e,toId:t,tier:`downstream`,hop:1,leg:`downstream`}))}function C_(e,t,n,r,i,a,o){return{upExt:a?O_(e,t,n,r,i):{edges:[],truncated:!1},downExt:o?k_(e,t,n,r,i):{edges:[],truncated:!1}}}function w_(e,t,n){let r=new Map;for(let t of e)r.set(y_(t),t);for(let e of t){let t=y_(e);r.has(t)||r.set(t,e)}for(let e of n){let t=y_(e);r.has(t)||r.set(t,e)}return[...r.values()].sort(b_)}function T_(e,t,n){let r=y_({fromId:t,toId:n});return e.seen.has(r)||(e.seen.add(r),e.hop<2)?!1:(e.edges.push({fromId:t,toId:n,tier:e.direction===`upstream`?`primary`:`downstream`,hop:e.hop,leg:e.direction}),e.edges.length>=e.maxEdges)}function E_(e,t){let n=t.timelineAdjacency[e];if(!n)return!1;let r=t.direction===`upstream`?n.inbound:n.outbound;for(let n of r)if(t.inTimeline(n)){if(T_(t,t.direction===`upstream`?n:e,t.direction===`upstream`?e:n))return!0;t.nextFrontier.add(n)}return!1}function D_(e,t,n,r,i,a){let o=e=>n.has(e),s=new Set,c=[],l=!1,u=new Set([e]);for(let e=1;e<=r&&c.length<i;e++){let n=new Set,r={hop:e,direction:a,timelineAdjacency:t,inTimeline:o,seen:s,edges:c,maxEdges:i,nextFrontier:n};for(let e of u)if(l=E_(e,r),l)break;if(u=n,l||u.size===0)break}return{edges:c,truncated:l}}function O_(e,t,n,r,i){return D_(e,t,n,r,i,`upstream`)}function k_(e,t,n,r,i){return D_(e,t,n,r,i,`downstream`)}function A_(e,t,n,r,i){let a=e=>i===`upstream`?e.inbound:e.outbound,o=new Set;o.add(e);let s=new Set([e]);for(let e=0;e<r;e++){let e=new Set;for(let r of s){let i=t[r];if(i)for(let t of a(i))!n.has(t)||o.has(t)||(o.add(t),e.add(t))}s=e}return o}function j_(e,t,n){if(e==null)return null;if(t.has(e))return e;let r=n.get(e);return r&&H.has(r.resourceType)&&r.parentId!=null&&t.has(r.parentId)?r.parentId:null}function M_({focusId:e,timelineAdjacency:t,candidateIds:n,dependencyDirection:r,dependencyDepthHops:i}){let a=()=>new Set(n);if(e==null||!t||!n.has(e)||!t[e])return a();let o=Math.max(1,Math.min(3,Math.trunc(i))),s=r!==`downstream`,c=r!==`upstream`,l=new Set;for(let r of[`upstream`,`downstream`])if(!(r===`upstream`?!s:!c))for(let i of A_(e,t,n,o,r))l.add(i);return l}function N_(e,t,n,r,i){if(!e||!t)return{edges:[],extendedTruncated:!1};let a=t[e],o=n.get(e);if(!a||!o||!r.has(e))return{edges:[],extendedTruncated:!1};let s=e=>r.has(e),c=i.includeUpstream??!0,l=i.includeDownstream,u=[...c?x_(e,a,o,n,s,i):[],...l?S_(e,a,o,n,s,i):[]],d=i.extendedDeps;if(!d?.enabled)return{edges:[...u].sort(b_),extendedTruncated:!1};let{upExt:f,downExt:p}=C_(e,t,r,d.maxHops??3,d.maxEdgesPerDirection??12,c,l);return{edges:w_(u,f.edges,p.edges),extendedTruncated:f.truncated||p.truncated}}function P_(e,t,n,r,i,a){let o=n[e];if(!o)return null;let s=32+(r[e]??0)-i;if(o.item.unique_id===t)return s+6+14/2;if(!a)return null;for(let{item:e,lane:n}of o.lanes)if(e.unique_id===t)return s+44+5+n*14+10/2;return null}function F_(e){let{edge:t,itemById:n,bundleIndexById:r,bundles:i,rowOffsets:a,scrollTop:o,showTests:s,effectiveLabelW:c,rangeStart:l,rangeEnd:u,chartW:d}=e,f=n.get(t.fromId),p=n.get(t.toId),m=r.get(t.fromId),h=r.get(t.toId);if(f==null||p==null||m===void 0||h===void 0)return``;let g=P_(m,t.fromId,i,a,o,s),_=P_(h,t.toId,i,a,o,s);if(g==null||_==null)return``;let v=Math.max(1,u-l),y=c+(f.start+f.duration-l)/v*d,b=c+(p.start-l)/v*d,x=Math.abs(b-y)*.4;return`M${y},${g} C${y+x},${g} ${b-x},${_} ${b},${_}`}var I_=8,L_=8;function R_(e,t,n){if((e.hop??1)>=2)return e.leg===`upstream`?{stroke:t.slate,strokeWidth:1,strokeDasharray:`3 4`,opacity:.36,markerEnd:`url(#${n.secondary})`}:{stroke:t.accent,strokeWidth:1,strokeDasharray:`4 5`,opacity:.4,markerEnd:`url(#${n.downstream})`};switch(e.tier){case`secondary`:return{stroke:t.slate,strokeWidth:1,strokeDasharray:`4 3`,opacity:.42,markerEnd:`url(#${n.secondary})`};case`downstream`:return{stroke:t.accent,strokeWidth:1.5,strokeDasharray:`5 4`,opacity:.62,markerEnd:`url(#${n.downstream})`};default:return{stroke:t.accent,strokeWidth:2,strokeDasharray:`6 4`,opacity:.88,markerEnd:`url(#${n.primary})`}}}function z_({id:e,fill:t}){return(0,u.jsx)(`marker`,{id:e,viewBox:`0 0 ${I_} ${L_}`,refX:I_-.5,refY:L_/2,markerWidth:I_,markerHeight:L_,orient:`auto`,markerUnits:`userSpaceOnUse`,children:(0,u.jsx)(`path`,{d:`M0,0 L${I_},${L_/2} L0,${L_} Z`,fill:t})})}function B_({edges:e,focusId:t,itemById:n,bundleIndexById:r,bundles:i,rowOffsets:a,canvasWidth:o,effectiveLabelW:s,rangeStart:c,rangeEnd:l,scrollTop:d,viewportH:f,theme:p=`light`,showTests:m=!0}){if(t==null||e.length===0)return null;let h=Qn(p),g=o-s-24,_=`gantt-edge-mk-primary`,v=`gantt-edge-mk-secondary`,y=`gantt-edge-mk-downstream`,b={primary:_,secondary:v,downstream:y};return(0,u.jsxs)(`svg`,{style:{position:`absolute`,top:0,left:0,width:`100%`,height:f,pointerEvents:`none`,overflow:`hidden`,zIndex:5},"aria-hidden":!0,children:[(0,u.jsxs)(`defs`,{children:[(0,u.jsx)(z_,{id:_,fill:h.accent}),(0,u.jsx)(z_,{id:v,fill:h.slate}),(0,u.jsx)(z_,{id:y,fill:h.accent})]}),e.map((e,t)=>{let o=F_({edge:e,itemById:n,bundleIndexById:r,bundles:i,rowOffsets:a,scrollTop:d,showTests:m,effectiveLabelW:s,rangeStart:c,rangeEnd:l,chartW:g});if(!o)return null;let{stroke:f,strokeWidth:p,strokeDasharray:_,opacity:v,markerEnd:y}=R_(e,h,b);return(0,u.jsx)(`path`,{d:o,stroke:f,strokeWidth:p,strokeDasharray:_,fill:`none`,opacity:v,markerEnd:y},`${e.fromId}-${e.toId}-${e.tier}-${e.hop}-${e.leg}-${t}`)})]})}var V_=8;function H_({labelColumnW:e,viewportH:t,minW:n,maxW:r,onWidthChange:i}){let a=(0,c.useRef)(null),o=(0,c.useCallback)(e=>Math.max(n,Math.min(r,Math.round(e))),[n,r]),s=(0,c.useCallback)(t=>{t.preventDefault(),t.stopPropagation(),a.current={startX:t.clientX,startW:e},t.currentTarget.setPointerCapture(t.pointerId)},[e]),l=(0,c.useCallback)(e=>{let t=a.current;t&&i(o(t.startW+(e.clientX-t.startX)))},[o,i]),d=(0,c.useCallback)(e=>{a.current=null;try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}},[]),f=Math.max(0,e-V_/2);return(0,u.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize timeline name column`,className:`gantt-label-resize-handle`,style:{position:`absolute`,left:f,top:0,width:V_,height:t,cursor:`col-resize`,touchAction:`none`,zIndex:4,background:`transparent`},onPointerDown:s,onPointerMove:l,onPointerUp:d,onPointerCancel:d})}var U_=16,W_=0,G_=12;function K_(e){return e.split(/[\s_-]+/).filter(Boolean).map(e=>e[0].toUpperCase()+e.slice(1).toLowerCase()).join(` `)}function q_({hoverX:e,hoverY:t,frameWidth:n,frameHeight:r,tooltipWidth:i,tooltipHeight:a,offsetX:o=U_,offsetY:s=W_,margin:c=G_}){let l=Math.max(n,i+c*2),u=Math.max(r,a+c*2),d=e+o;d+i>l-c&&(d=e-i-o);let f=t+s;return f+a>u-c&&(f=u-a-c),d=Math.min(Math.max(c,d),Math.max(c,l-i-c)),f=Math.min(Math.max(c,f),Math.max(c,u-a-c)),{left:d,top:f}}function J_(e){if(!e)return!1;let t=e.adapterMetrics,n=e.adapterResponseFields;return Gn(t,n).length>0?!0:t==null?!1:Vn([t]).length>0}function Y_({resource:e}){if(!e)return null;let t=e.adapterMetrics,n=e.adapterResponseFields,r=Gn(t,n),i=t==null?[]:Vn([t]);if(r.length===0&&i.length===0)return null;let a=t;return(0,u.jsxs)(`div`,{style:{marginTop:`0.25rem`,maxWidth:340},children:[(0,u.jsx)(`div`,{style:{marginBottom:`0.15rem`},children:(0,u.jsx)(`span`,{style:Xg,children:`Adapter response`})}),i.length>0&&a!=null?(0,u.jsx)(`div`,{style:{whiteSpace:`pre-wrap`,fontSize:`0.82rem`,lineHeight:1.35},children:i.map(e=>{let t=zn(a,e.key),n=t===void 0?`—`:Bn(e,t);return`${e.shortLabel}: ${n}`}).join(`
|
|
33
33
|
`)}):null,r.length>0?(0,u.jsx)(`div`,{style:{marginTop:i.length>0?`0.35rem`:0,whiteSpace:`pre-wrap`,fontSize:`0.82rem`,lineHeight:1.35},"aria-label":`Additional adapter response fields`,children:r.map(e=>`${e.label}: ${e.displayValue}`).join(`
|
|
34
|
-
`)}):null]})}function J_({label:e,value:t}){return(0,u.jsxs)(`div`,{children:[(0,u.jsxs)(`span`,{style:Jg,children:[e,`: `]}),t]})}function Y_({semantics:e,materialized:t}){return e?(0,u.jsxs)(`div`,{style:{marginTop:`0.25rem`,maxWidth:340},children:[(0,u.jsx)(`div`,{children:(0,u.jsx)(`span`,{style:Jg,children:`Semantics: `})}),(0,u.jsx)(`div`,{style:{whiteSpace:`pre-wrap`,fontSize:`0.82rem`,lineHeight:1.35},children:ia(e)})]}):t?(0,u.jsx)(J_,{label:`Materialization`,value:W_(t)}):null}function X_({hover:e,runStartedAt:t,canShowTimestamps:n,timeZone:r}){let i=n&&t!=null?Zg(t+e.item.start,r):`+${Xg(e.item.start)}`,a=n&&t!=null?Zg(t+e.item.end,r):`+${Xg(e.item.end)}`;return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(J_,{label:`Start`,value:i}),(0,u.jsx)(J_,{label:`End`,value:a}),(0,u.jsx)(J_,{label:`Duration`,value:Xg(e.item.duration)})]})}function Z_({label:e,start:t,end:n}){return t==null||n==null||n<=t?null:(0,u.jsx)(J_,{label:e,value:Xg(n-t)})}function Q_({testStats:e}){if(!e)return null;let t=[e.pass>0?`✓${e.pass}`:null,e.error>0?`✗${e.error}`:null,e.warn>0?`!${e.warn}`:null,e.skipped>0?`−${e.skipped}`:null].filter(Boolean);return t.length===0?null:(0,u.jsx)(J_,{label:`Tests`,value:t.join(` · `)})}function $_({hover:e,frameWidth:t,frameHeight:n,runStartedAt:r,canShowTimestamps:i,timeZone:a,testStats:o,resourceByUniqueId:s}){let l=(0,c.useRef)(null),[d,f]=(0,c.useState)(()=>G_({hoverX:e.x,hoverY:e.y,frameWidth:t,frameHeight:n,tooltipWidth:220,tooltipHeight:160})),p=s?.get(e.item.unique_id),m=K_(p);return(0,c.useLayoutEffect)(()=>{let r=l.current;if(!r)return;let i=G_({hoverX:e.x,hoverY:e.y,frameWidth:t,frameHeight:n,tooltipWidth:r.offsetWidth,tooltipHeight:r.offsetHeight});f(e=>e.left===i.left&&e.top===i.top?e:i)},[n,t,e.x,e.y,e.item.unique_id,m]),(0,u.jsxs)(`div`,{ref:l,className:`chart-tooltip`,style:{position:`absolute`,left:d.left,top:d.top,pointerEvents:`none`,zIndex:20,minWidth:180},children:[(0,u.jsx)(`div`,{style:{fontWeight:700,marginBottom:`0.3rem`},children:e.item.name||e.item.unique_id}),(0,u.jsx)(J_,{label:`Status`,value:e.item.status}),e.item.resourceType&&(0,u.jsx)(J_,{label:`Type`,value:e.item.resourceType}),(0,u.jsx)(Y_,{semantics:e.item.semantics,materialized:e.item.materialized}),(0,u.jsx)(X_,{hover:e,runStartedAt:r,canShowTimestamps:i,timeZone:a}),(0,u.jsx)(Z_,{label:`Compile`,start:e.item.compileStart,end:e.item.compileEnd}),(0,u.jsx)(Z_,{label:`Execute`,start:e.item.executeStart,end:e.item.executeEnd}),(0,u.jsx)(Q_,{testStats:o}),(0,u.jsx)(q_,{resource:p})]})}function ev({canvasRef:e,scrollRef:t,edges:n,edgeFocusId:r,itemById:i,bundleIndexById:a,bundles:o,rowOffsets:s,containerWidth:l,effectiveLabelW:d,rangeStart:f,rangeEnd:p,scrollTop:m,viewportH:h,needsScroll:g,totalScrollH:_,theme:v,showTests:y,hover:b,runStartedAt:x,canShowTimestamps:S,timeZone:C,testStatsById:w,resourceByUniqueId:T,selectedId:E,onSelect:D,onPointer:O,onHoverClear:k,labelColumnResize:A}){let j=(0,c.useRef)(null),[M,N]=(0,c.useState)(0);return(0,c.useLayoutEffect)(()=>{let e=j.current;if(!e)return;let t=()=>N(e.getBoundingClientRect().width);t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]),(0,u.jsxs)(`section`,{ref:j,className:`chart-frame`,style:{position:`relative`,userSelect:`none`},children:[(0,u.jsx)(`canvas`,{ref:e,style:{position:`absolute`,top:0,left:0,width:`100%`,height:h,pointerEvents:`none`,display:`block`}}),(0,u.jsx)(R_,{edges:n,focusId:r,itemById:i,bundleIndexById:a,bundles:o,rowOffsets:s,canvasWidth:l>0?l:600,effectiveLabelW:d,rangeStart:f,rangeEnd:p,scrollTop:m,viewportH:h,theme:v,showTests:y}),(0,u.jsx)(`div`,{ref:t,className:`chart-frame__viewport`,role:`region`,tabIndex:0,"aria-label":`Timeline chart viewport — use arrow keys to scroll`,style:{position:`relative`,height:h,overflowY:g?`auto`:`hidden`},onMouseMove:e=>O(e,`move`),onClick:e=>O(e,`click`),onKeyDown:e=>{if(e.key!==`Enter`&&e.key!==` `)return;e.preventDefault();let t=b?.item.unique_id??E;t&&D?.(t)},onMouseLeave:k,children:(0,u.jsx)(`div`,{style:{height:_}})}),A?(0,u.jsx)(B_,{labelColumnW:A.width,viewportH:A.viewportH,minW:A.minW,maxW:A.maxW,onWidthChange:A.onChange}):null,b&&(0,u.jsx)($_,{hover:b,frameWidth:M>0?M:l,frameHeight:h,runStartedAt:x,canShowTimestamps:S,timeZone:C,testStats:w?.get(b.item.unique_id),resourceByUniqueId:T})]})}function tv({activeMode:e,onChange:t,activeTimeZone:n,timeZones:r,onTimeZoneChange:i}){return(0,u.jsx)(`div`,{className:`gantt-controls`,children:(0,u.jsxs)(`div`,{className:`gantt-controls__cluster`,children:[e===`timestamps`&&(0,u.jsxs)(`label`,{className:`gantt-timezone-select`,children:[(0,u.jsx)(`span`,{children:`Timezone`}),(0,u.jsx)(`select`,{value:n,onChange:e=>i(e.target.value),children:r.map(e=>(0,u.jsx)(`option`,{value:e,children:e},e))})]}),(0,u.jsxs)(`div`,{className:`gantt-mode-toggle`,children:[(0,u.jsx)(`button`,{type:`button`,className:e===`duration`?`active`:``,onClick:()=>t(`duration`),children:`Duration`}),(0,u.jsx)(`button`,{type:`button`,className:e===`timestamps`?`active`:``,onClick:()=>t(`timestamps`),children:`Timestamps`})]})]})})}var nv=1e3;function rv(e,t){let n=t?.get(e.item.unique_id);return n&&n.error+n.warn>0?!0:r_(e.item.status)||e.tests.some(e=>r_(e.status))}function iv(e,t,n){return{start:Math.max(0,Math.min(e,n)),end:Math.max(0,Math.min(t,n))}}function av({bundles:e,maxEnd:t,timeWindow:n,testStatsById:r,onChange:i}){let a=(0,c.useRef)(null),[o,s]=(0,c.useState)(null),l=(0,c.useRef)(null),d=Math.min(Math.max(nv,t*.01),t),f=n?.start??0,p=n?.end??t,m=n!=null;function h(e){let n=a.current;if(!n)return 0;let r=n.clientWidth;return r<=0||t<=0?0:(e-n.getBoundingClientRect().left)/r*t}function g(e,r){if(!a.current||a.current.clientWidth<=0||t<=0)return;let i=h(e.clientX);l.current={mode:r,startPx:e.clientX,initialStart:r===`create`?i:f,initialEnd:r===`create`?i:p,currentStart:r===`create`?i:f,currentEnd:r===`create`?i:p},s(r===`create`?{start:i,end:i}:n),a.current.setPointerCapture(e.pointerId)}function _(e){let n=l.current,r=a.current;if(!n||!r||t<=0)return;let i=r.clientWidth;if(i<=0)return;let o=(e.clientX-n.startPx)/i*t,c=n.initialEnd-n.initialStart,u=h(e.clientX);if(n.mode===`create`){let e={start:Math.min(n.initialStart,u),end:Math.max(n.initialStart,u)};l.current={...n,currentStart:e.start,currentEnd:e.end},s(e);return}if(n.mode===`pan`){let e=Math.min(Math.max(0,n.initialStart+o),t-c),r={start:e,end:e+c};l.current={...n,currentStart:r.start,currentEnd:r.end},s(r);return}if(n.mode===`start`){let e={start:Math.min(Math.max(0,n.initialStart+o),n.initialEnd-d),end:n.initialEnd};l.current={...n,currentStart:e.start,currentEnd:e.end},s(e);return}let f=Math.max(Math.min(t,n.initialEnd+o),n.initialStart+d),p={start:n.initialStart,end:f};l.current={...n,currentStart:p.start,currentEnd:p.end},s(p)}function v(e){let n=l.current;if(n&&a.current?.hasPointerCapture(e.pointerId)&&a.current.releasePointerCapture(e.pointerId),n){let e=iv(n.currentStart,n.currentEnd,t),r=e.end-e.start;(n.mode!==`create`||r>=d)&&(e.start<=0&&e.end>=t?i(null):i(e))}l.current=null,s(null)}let y=o??(m?{start:f,end:p}:{start:0,end:t}),b=y==null?0:Math.max(0,Math.min(100,y.start/t*100)),x=y==null?0:Math.max(0,Math.min(100,y.end/t*100)),S=Math.max(0,x-b);return(0,u.jsxs)(`div`,{className:`gantt-brush-wrap`,children:[(0,u.jsxs)(`div`,{className:`gantt-brush__header`,children:[(0,u.jsx)(`p`,{className:`gantt-brush__title`,children:`Time range`}),(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill`,disabled:!m,onClick:()=>i(null),children:`Reset zoom`})]}),(0,u.jsxs)(`div`,{ref:a,className:`gantt-brush`,onPointerDown:e=>{e.target!==e.currentTarget||e.button!==0||g(e,`create`)},onPointerMove:_,onPointerUp:v,onPointerCancel:v,role:`slider`,"aria-label":`Timeline time range`,"aria-valuemin":0,"aria-valuemax":Math.round(t),"aria-valuenow":Math.round(f),"aria-valuetext":`${Math.round(f)} to ${Math.round(p)} ms`,children:[e.map(e=>{let n=Math.max(0,e.item.start),i=Math.max(n,e.item.end),a=n/t*100,o=Math.max(.2,(i-n)/t*100),s=rv(e,r);return(0,u.jsx)(`span`,{className:s?`gantt-brush__bar gantt-brush__bar--issue`:`gantt-brush__bar`,"data-issue":s?`true`:`false`,style:{left:`${a}%`,width:`${o}%`}},e.item.unique_id)}),y!=null&&(0,u.jsxs)(`div`,{className:m||o!=null?`gantt-brush__selection`:`gantt-brush__selection gantt-brush__selection--default`,"data-default-range":m||o!=null?`false`:`true`,style:{left:`${b}%`,width:`${S}%`},onPointerDown:e=>g(e,`pan`),children:[(0,u.jsx)(`span`,{className:`gantt-brush__handle gantt-brush__handle--start`,onPointerDown:e=>{e.stopPropagation(),g(e,`start`)}}),(0,u.jsx)(`span`,{className:`gantt-brush__handle gantt-brush__handle--end`,onPointerDown:e=>{e.stopPropagation(),g(e,`end`)}})]})]})]})}function ov(e,t,n,r,i,a,o=2){let s=Math.max(1,t-e),c=i+a,l=i+(n-e)/s*a,u=i+(r-e)/s*a,d=Math.max(i,Math.min(l,u));return{x:d,width:Math.max(o,Math.min(c,Math.max(l,u))-d)}}function sv(e,t){return t&&e.laneCount>0?49+e.laneCount*14+5:44}function cv(e,t){let n=[],r=[],i=0;for(let a of e){n.push(i);let e=sv(a,t);r.push(e),i+=e}return{rowOffsets:n,rowHeights:r,totalHeight:i}}function lv(e,t,n){if(e.length===0)return-1;let r=0,i=e.length-1;for(;r<=i;){let a=Math.floor((r+i)/2),o=e[a]??0,s=t[a]??44;if(o>n)i=a-1;else if(o+s<=n)r=a+1;else return a}return-1}function uv(e,t,n,r,i,a,o,s){let c=(e,t,n)=>({item:e,x:t,y:n}),l=(e,t,n,r,i,a)=>e>=t&&e<=t+n&&(r==null||i==null||a==null||r>=i&&r<=i+a),{rowOffsets:u,rowHeights:d,showTests:f}=n;if(!s)return null;let p=e.currentTarget.getBoundingClientRect(),m=e.clientX-p.left,h=e.clientY-p.top;if(h<32||m<0)return null;let g=lv(u,d,h-32+r);if(g<0||g>=t.length)return null;let _=t[g];if(!_)return null;let v=s.getBoundingClientRect().width-o-24,y=32+(u[g]??0)-r;if(m<o)return c(_.item,m,h);let b=o,{x,width:S}=ov(i,a,_.item.start,_.item.end,b,v);if(l(m,x,S))return c(_.item,m,h);if(f&&_.lanes.length>0)for(let{item:e,lane:t}of _.lanes){let{x:n,width:r}=ov(i,a,e.start,e.end,b,v,4);if(l(m,n,r,h,y+44+5+t*14,10))return c(e,m,h)}return null}function dv(e,t,n){let{bundles:r,layout:i,scrollTop:a,rangeStart:o,rangeEnd:s,effectiveLabelW:c,canvas:l,setHover:u,onSelect:d}=n,f=uv(e,r,i,a,o,s,c,l);if(!f){t===`move`?u(null):d?.(null);return}if(t===`move`){u({item:f.item,x:f.x,y:f.y});return}d?.(f.item.unique_id)}var fv={...De};function pv(e,t=`light`){return(t===`dark`?Oe:De)[e.toLowerCase()]??Ee(t).textSoft}function mv(e,t=`light`){let n=ze(t);return(e&&n[e])??Ee(t).borderSubtle}var hv=3,gv=2.25;function _v(e){return(e?.error??0)+(e?.warn??0)>0}function vv(e,t,n,r,i,a){r<2*a&&(a=r/2),i<2*a&&(a=i/2),e.beginPath(),e.moveTo(t+a,n),e.arcTo(t+r,n,t+r,n+i,a),e.arcTo(t+r,n+i,t,n+i,a),e.arcTo(t,n+i,t,n,a),e.arcTo(t,n,t+r,n,a),e.closePath()}function yv(e,t,n,r,i,a){vv(e,t,n,r,i,a),e.fill()}function bv(e,t,n,r,i,a){vv(e,t,n,r,i,a),e.stroke()}function xv(e,t){let{rangeStart:n,rangeEnd:r,chartLeft:i,chartW:a,compileStart:o,compileEnd:s,barX:c,barY:l,barW:u,barH:d,radius:f,theme:p}=t;if(o==null||s==null||s<=o)return;let m=Math.max(1,r-n),h=i+(o-n)/m*a,g=i+(s-n)/m*a,_=Math.max(c,h),v=Math.min(c+u,g)-_;v<=.5||(e.save(),vv(e,c,l,u,d,f),e.clip(),e.fillStyle=p===`dark`?`rgba(0, 0, 0, 0.24)`:`rgba(0, 0, 0, 0.12)`,e.fillRect(_,l,v,d),e.restore())}function Sv(e,t,n,r,i,a,o,s){t%2==0&&(e.fillStyle=o?s.rowStripeHover:s.rowStripe,e.globalAlpha=a?1:.35,e.fillRect(0,n,r,i),e.globalAlpha=1)}function Cv({ctx:e,item:t,rowY:n,labelW:r,xOffset:i,emphasis:a,palette:o}){e.save(),e.globalAlpha=a,e.beginPath(),e.rect(i,n,r-10-i,44),e.clip(),e.textAlign=`left`,e.textBaseline=`middle`,e.font=`12px "IBM Plex Sans", "Avenir Next", sans-serif`,e.fillStyle=o.labelText,e.fillText(t.name||t.unique_id,i+2,n+44/2),e.restore()}function wv({ctx:e,item:t,rowY:n,rangeStart:r,rangeEnd:i,chartW:a,labelW:o,emphasis:s,isHovered:c,attachedTestStats:l,palette:u,theme:d}){let f=n+6,{x:p,width:m}=ov(r,i,t.start,t.end,o,a),h=_v(l),g=r_(t.status)||h;e.save(),e.globalAlpha=s,e.fillStyle=Ve(t.resourceType,d),yv(e,p,f,m,14,3),xv(e,{rangeStart:r,rangeEnd:i,chartLeft:o,chartW:a,compileStart:t.compileStart,compileEnd:t.compileEnd,barX:p,barY:f,barW:m,barH:14,radius:3,theme:d}),h&&t_(t.status)&&(e.fillStyle=u.testFailStripe,yv(e,p,f+14-4,m,4,2)),e.strokeStyle=g?u.testFailStripe:pv(t.status,d),e.lineWidth=g?hv:2,bv(e,p,f,m,14,3),e.restore(),c&&(e.save(),e.globalAlpha=1,e.strokeStyle=u.barHoverStroke,e.lineWidth=1.5,bv(e,p,f,m,14,3),e.restore())}function Tv({ctx:e,test:t,chipY:n,rangeStart:r,rangeEnd:i,chartW:a,labelW:o,palette:s,theme:c,emphasis:l,isHovered:u}){let{x:d,width:f}=ov(r,i,t.start,t.end,o,a,4),p=r_(t.status);e.save(),e.globalAlpha=l,e.fillStyle=Ve(t.resourceType,c),yv(e,d,n,f,10,2),xv(e,{rangeStart:r,rangeEnd:i,chartLeft:o,chartW:a,compileStart:t.compileStart,compileEnd:t.compileEnd,barX:d,barY:n,barW:f,barH:10,radius:2,theme:c}),e.strokeStyle=p?s.testFailStripe:pv(t.status,c),e.lineWidth=p?gv:1.5,bv(e,d,n,f,10,2),e.restore(),u&&(e.save(),e.globalAlpha=1,e.strokeStyle=s.barHoverStroke,e.lineWidth=1,bv(e,d,n,f,10,2),e.restore())}function Ev(e,t){let n=e.getContext(`2d`);if(!n)return null;let r=e.getBoundingClientRect(),i=window.devicePixelRatio||1,a=r.width,o=r.height;return a===0||o===0?null:(e.width=a*i,e.height=o*i,n.scale(i,i),n.clearRect(0,0,a,o),{ctx:n,w:a,h:o,chartW:a-t-24})}function Dv({ctx:e,labelW:t,chartW:n,h:r,rangeStart:i,rangeEnd:a,displayMode:o,runStartedAt:s,timeZone:c,palette:l}){let u=Math.max(1,a-i),d=s_(i,a);e.font=`11px 'IBM Plex Mono', 'Fira Mono', monospace`,e.textAlign=`center`,e.textBaseline=`middle`,e.fillStyle=l.axisTick;let f=e=>o===`timestamps`&&s!=null?Zg(s+e.ms,c):e.label,p=c_(d,i,a,n,f,t=>e.measureText(t).width);for(let a of p){let o=t+(a.ms-i)/u*n;e.strokeStyle=l.gridLine,e.lineWidth=1,e.beginPath(),e.moveTo(o,32),e.lineTo(o,r),e.stroke(),e.fillText(f(a),o,32/2)}}function Ov(e){let{ctx:t,bundle:n,rowIndex:r,rowY:i,bundleRowHeightPx:a,w:o,labelW:s,chartW:c,rangeStart:l,rangeEnd:u,focusIds:d,hoveredId:f,theme:p,palette:m,testStatsById:h,showTests:g}=e,_=d==null||d.has(n.item.unique_id)||n.lanes.some(e=>d.has(e.item.unique_id)),v=d==null||d.has(n.item.unique_id),y=f===n.item.unique_id,b=v?1:.18;if(Sv(t,r,i,o,a,_,y,m),Cv({ctx:t,item:n.item,rowY:i,labelW:s,xOffset:0,emphasis:b,palette:m}),wv({ctx:t,item:n.item,rowY:i,rangeStart:l,rangeEnd:u,chartW:c,labelW:s,emphasis:b,isHovered:y,attachedTestStats:h?.get(n.item.unique_id),palette:m,theme:p}),!(!g||n.lanes.length===0))for(let{item:e,lane:r}of n.lanes){let n=i+44+5+r*14,a=f===e.unique_id;Tv({ctx:t,test:e,chipY:n,rangeStart:l,rangeEnd:u,chartW:c,labelW:s,palette:m,theme:p,emphasis:d==null||d.has(e.unique_id)?1:.18,isHovered:a})}}function kv(e,t,n,r,{scrollTop:i,rangeStart:a,rangeEnd:o,displayMode:s,runStartedAt:c,focusIds:l,hoveredId:u,labelW:d=160,timeZone:f,testStatsById:p,theme:m=`light`,showTests:h=!1}){let g=Ev(e,d);if(!g)return;let{ctx:_,w:v,h:y,chartW:b}=g,x=We(m);if(Dv({ctx:_,labelW:d,chartW:b,h:y,rangeStart:a,rangeEnd:o,displayMode:s,runStartedAt:c,timeZone:f,palette:x}),t.length===0)return;let S=y-32,C=Av(n,i),w=jv(n,r,i,S);_.textBaseline=`middle`;for(let e=C;e<=w;e++){let s=t[e];if(!s)continue;let c=32+(n[e]??0)-i;Ov({ctx:_,bundle:s,rowIndex:e,rowY:c,bundleRowHeightPx:r[e]??44,w:v,labelW:d,chartW:b,rangeStart:a,rangeEnd:o,focusIds:l,hoveredId:u,theme:m,palette:x,testStatsById:p,showTests:h})}}function Av(e,t){if(e.length===0)return 0;let n=0,r=e.length-1;for(;n<r;){let i=Math.floor((n+r)/2);(e[i]??0)<t?n=i+1:r=i}return Math.max(0,n-1)}function jv(e,t,n,r){let i=n+r,a=0;for(let r=0;r<e.length;r++){let o=e[r]??0;if(!(o+(t[r]??44)<=n)){if(o>=i)break;a=r}}return a}function Mv({canvasRef:e,bundles:t,rowOffsets:n,rowHeights:r,scrollTop:i,rangeStart:a,rangeEnd:o,activeMode:s,runStartedAt:l,focusedIds:u,hoveredId:d,effectiveLabelW:f,timeZone:p,testStatsById:m,theme:h,showTests:g,setContainerWidth:_}){(0,c.useEffect)(()=>{if(t.length===0)return;function c(){let c=e.current;c&&kv(c,t,n,r,{scrollTop:i,rangeStart:a,rangeEnd:o,displayMode:s,runStartedAt:l,focusIds:u,hoveredId:d,labelW:f,timeZone:p,testStatsById:m,theme:h,showTests:g})}let v=e.current;if(!v)return;c();let y=new ResizeObserver(e=>{let t=e[0];t&&_(t.contentRect.width),c()});return y.observe(v),()=>y.disconnect()},[t,n,r,i,a,o,s,l,u,d,f,p,m,h,g,_])}function Nv(e){return Math.max(1,Math.min(3,Math.trunc(e)))}function Pv(e){let t=Nv(e.dependencyDepthHops);return{includeUpstream:e.dependencyDirection!==`downstream`,includeDownstream:e.dependencyDirection!==`upstream`,showAllUpstream:!1,maxUpstreamEdges:8,showAllDownstream:!1,maxDownstreamEdges:8,extendedDeps:t>1?{enabled:!0,maxHops:Nv(t),maxEdgesPerDirection:12}:{enabled:!1}}}function Fv({edgeFocusId:e,timelineAdjacency:t,itemById:n,bundleIndexById:r,dependencyDirection:i,dependencyDepthHops:a}){let o=(0,c.useMemo)(()=>Pv({dependencyDirection:i,dependencyDepthHops:a}),[a,i]),{edges:s}=(0,c.useMemo)(()=>j_(e,t,n,r,o),[e,t,n,r,o]);return{edges:s}}function Iv({data:e,runStartedAt:t,timelineAdjacency:n,testStatsById:r,resourceByUniqueId:i,showTests:a=!1,dependencyDirection:o=`both`,dependencyDepthHops:l=2,selectedId:d=null,onSelect:f,timeWindow:p=null,onTimeWindowChange:m}){let h=zt(),g=(0,c.useRef)(null),_=(0,c.useRef)(null),[v,y]=(0,c.useState)(null),[b,x]=(0,c.useState)(`duration`),[S,C]=(0,c.useState)($g),[w,T]=(0,c.useState)(0),[E,D]=(0,c.useState)(()=>typeof window>`u`?900:window.innerHeight),O=(0,c.useMemo)(()=>Qg(),[]),k=t!=null,A=k?b:`duration`;(0,c.useEffect)(()=>{try{window.localStorage.setItem(Yg,S)}catch{}},[S]);let{effectiveLabelW:j,maxLabelW:M,onLabelColumnWidthDrag:N}=u_(w),P=(0,c.useMemo)(()=>Wg(e),[e]),ee=(0,c.useMemo)(()=>{let e=1;for(let t of P){e=Math.max(e,t.item.end);for(let n of t.tests)e=Math.max(e,n.end)}return e},[P]),F=(0,c.useMemo)(()=>{if(!p)return P;let{start:t,end:n}=p,r=new Set;for(let e of P)for(let i of e.tests)if(i.end>t&&i.start<n){r.add(e.item.unique_id);break}return Wg(e.filter(e=>e.end>t&&e.start<n?!0:r.has(e.unique_id)))},[e,P,p]),te=p?.start??0,ne=p?p.end:ee,re=te,ie=ne,{rowOffsets:ae,rowHeights:oe}=(0,c.useMemo)(()=>cv(F,a),[F,a]),se=(0,c.useMemo)(()=>{let t=new Map;for(let n of e)t.set(n.unique_id,n);return t},[e]),ce=s({count:F.length,getScrollElement:()=>_.current,estimateSize:e=>F[e]?sv(F[e],a):44,getItemKey:e=>F[e]?.item.unique_id??e,overscan:10}),le=ce.scrollOffset??0;(0,c.useLayoutEffect)(()=>{ce.measure()},[F,a,ce]);let ue=(0,c.useMemo)(()=>({rowOffsets:ae,rowHeights:oe,showTests:a}),[ae,oe,a]),de=(0,c.useMemo)(()=>{let e=new Map;for(let t=0;t<F.length;t++){let n=F[t];if(n){e.set(n.item.unique_id,t);for(let r of n.tests)e.set(r.unique_id,t)}}return e},[F]),fe=d??v?.item.unique_id??null,{edges:pe}=Fv({edgeFocusId:fe,timelineAdjacency:n,itemById:se,bundleIndexById:de,dependencyDirection:o,dependencyDepthHops:l}),me=(0,c.useMemo)(()=>{if(!fe)return null;let e=new Set([fe]);for(let t of pe)e.add(t.fromId),e.add(t.toId);return e},[fe,pe]),he=32+ce.getTotalSize(),ge=Math.max(240,Math.min(E-320,Math.round(E*qg))),_e=Math.max(240,Math.min(ge,he)),ve=he>_e;if((0,c.useEffect)(()=>{let e=()=>D(window.innerHeight);return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),Mv({canvasRef:g,bundles:F,rowOffsets:ae,rowHeights:oe,scrollTop:le,rangeStart:re,rangeEnd:ie,activeMode:A,runStartedAt:t,focusedIds:me,hoveredId:v?.item.unique_id??null,effectiveLabelW:j,timeZone:S,testStatsById:r,theme:h,showTests:a,setContainerWidth:T}),P.length===0)return(0,u.jsx)(`div`,{className:`empty-state empty-state--chart`,children:`No Gantt data (run_results may lack timing info)`});function ye(e,t){dv(e,t,{bundles:F,layout:ue,scrollTop:le,rangeStart:re,rangeEnd:ie,effectiveLabelW:j,canvas:g.current,setHover:y,onSelect:f})}return(0,u.jsxs)(`div`,{className:`gantt-shell`,role:`region`,"aria-label":`Execution timeline`,children:[k&&(0,u.jsx)(tv,{activeMode:A,onChange:x,activeTimeZone:S,timeZones:O,onTimeZoneChange:C}),(0,u.jsx)(av,{bundles:P,maxEnd:ee,timeWindow:p,testStatsById:r,onChange:m??(()=>{})}),(0,u.jsx)(ev,{canvasRef:g,scrollRef:_,edges:pe,edgeFocusId:fe,itemById:se,bundleIndexById:de,bundles:F,rowOffsets:ae,containerWidth:w,effectiveLabelW:j,rangeStart:re,rangeEnd:ie,scrollTop:le,viewportH:_e,needsScroll:ve,totalScrollH:he,theme:h,showTests:a,hover:v,runStartedAt:t,canShowTimestamps:k,timeZone:S,testStatsById:r,resourceByUniqueId:i,selectedId:d,onSelect:f,onPointer:ye,onHoverClear:()=>y(null),labelColumnResize:{width:j,viewportH:_e,minW:120,maxW:M,onChange:N}})]})}var Lv={display:`inline-block`,width:10,height:10,borderRadius:2,flexShrink:0},Rv=` gantt-legend__item--active`;function zv(e){return`gantt-legend__item${e?Rv:``}`}function Bv(e,t){return{...Lv,background:e.bgSoft,borderLeft:`3px solid ${t}`,borderRadius:0}}function Vv({theme:e,themeHex:t,showCompileExecuteLegend:n}){let r=Ve(`model`,e),i=pv(`success`,e);return(0,u.jsxs)(`div`,{className:`gantt-legend__group gantt-legend__group--bar-key`,children:[(0,u.jsx)(`span`,{className:`gantt-legend__label`,children:`Bars`}),(0,u.jsxs)(`div`,{className:`gantt-legend__bar-key-row`,children:[(0,u.jsx)(`span`,{className:`gantt-legend__bar-key-swatch`,style:{background:r,border:`2px solid ${t.borderDefault}`,borderRadius:3},title:`Bar fill follows resource type`,"aria-hidden":!0}),(0,u.jsx)(`span`,{className:`gantt-legend__bar-key-caption`,children:`Fill = type`}),(0,u.jsx)(`span`,{className:`gantt-legend__bar-key-swatch`,style:{background:t.bgSoft,border:`2px solid ${i}`,borderRadius:3},title:`Bar outline follows run status`,"aria-hidden":!0}),(0,u.jsx)(`span`,{className:`gantt-legend__bar-key-caption`,children:`Border = status`})]}),n?(0,u.jsxs)(`div`,{className:`gantt-legend__bar-key-row gantt-legend__bar-key-row--phases`,children:[(0,u.jsx)(`span`,{className:`gantt-legend__bar-key-swatch`,style:{background:e===`dark`?`rgba(0, 0, 0, 0.24)`:`rgba(0, 0, 0, 0.12)`,border:`1px solid ${t.borderDefault}`,borderRadius:2},"aria-hidden":!0}),(0,u.jsx)(`span`,{className:`gantt-legend__bar-key-caption`,children:`Compile (darker)`}),(0,u.jsx)(`span`,{className:`gantt-legend__bar-key-swatch`,style:{background:r,border:`1px solid ${t.borderDefault}`,borderRadius:2},"aria-hidden":!0}),(0,u.jsx)(`span`,{className:`gantt-legend__bar-key-caption`,children:`Execute`})]}):null]})}function Hv({visibleStatuses:e,statusCounts:t,activeStatuses:n,onToggleStatus:r,failuresOnly:i,onToggleFailuresOnly:a,theme:o}){return e.length===0&&a==null?null:(0,u.jsxs)(`div`,{className:`gantt-legend__group`,children:[(0,u.jsx)(`span`,{className:`gantt-legend__label`,children:`Status`}),e.map(e=>{let i=n?.has(e)??!1,a=pv(e,o),s=t[e]??0;return(0,u.jsxs)(`button`,{type:`button`,className:zv(i),onClick:()=>r?.(e),title:`${e} (${s})`,children:[(0,u.jsx)(`span`,{style:{...Lv,background:a}}),(0,u.jsx)(`span`,{className:`gantt-legend__name`,children:e}),(0,u.jsx)(`span`,{className:`gantt-legend__count`,children:s})]},e)}),a!=null&&(0,u.jsxs)(`button`,{type:`button`,className:zv(!!i),onClick:a,title:i?`Show all parent rows`:`Show only parents with errors or failing tests`,"aria-pressed":i??!1,children:[(0,u.jsx)(`span`,{style:{...Lv,background:pv(`fail`,o)},"aria-hidden":!0}),(0,u.jsx)(`span`,{className:`gantt-legend__name`,children:`failures only`})]})]})}function Uv({visibleTypes:e,typeCounts:t,activeTypes:n,onToggleType:r,showTests:i,onToggleShowTests:a,testsLegendCount:o,theme:s,themeHex:c}){return e.length===0&&a==null?null:(0,u.jsxs)(`div`,{className:`gantt-legend__group`,children:[(0,u.jsx)(`span`,{className:`gantt-legend__label`,children:`Type`}),e.map(e=>{let i=n?.has(e)??!1,a=mv(e,s),o=t[e]??0;return(0,u.jsxs)(`button`,{type:`button`,className:zv(i),onClick:()=>r?.(e),title:`${e} (${o})`,children:[(0,u.jsx)(`span`,{style:Bv(c,a)}),(0,u.jsx)(`span`,{className:`gantt-legend__name`,children:e}),(0,u.jsx)(`span`,{className:`gantt-legend__count`,children:o})]},e)}),a!=null&&(0,u.jsxs)(`button`,{type:`button`,className:zv(!!i),onClick:a,title:i?`Hide test chips`:`Show test chips`,"aria-pressed":i??!1,children:[(0,u.jsx)(`span`,{style:Bv(c,mv(`test`,s)),"aria-hidden":!0}),(0,u.jsx)(`span`,{className:`gantt-legend__name`,children:`tests`}),(0,u.jsx)(`span`,{className:`gantt-legend__count`,children:o})]})]})}function Wv({materializationRows:e,materializationCounts:t,themeHex:n}){return e.length===0||t==null?null:(0,u.jsxs)(`div`,{className:`gantt-legend__group gantt-legend__group--materialization`,children:[(0,u.jsx)(`span`,{className:`gantt-legend__label`,children:`Materialization`}),(0,u.jsx)(`span`,{className:`gantt-legend__hint`,children:`Manifest-derived; not a bar color.`}),e.map(e=>{let r=t[e]??0;return(0,u.jsxs)(`div`,{className:`gantt-legend__item gantt-legend__item--static`,title:`Normalized from manifest config.materialized and resource type`,children:[(0,u.jsx)(`span`,{className:`gantt-legend__mat-icon`,"aria-hidden":!0,style:{...Lv,borderRadius:0,border:`2px dashed ${n.borderDefault}`,background:n.bgSoft}}),(0,u.jsx)(`span`,{className:`gantt-legend__name`,children:ra(e)}),(0,u.jsx)(`span`,{className:`gantt-legend__count`,children:r})]},e)})]})}function Gv({statusCounts:e,typeCounts:t,activeStatuses:n,activeTypes:r,onToggleStatus:i,onToggleType:a,showTests:o,onToggleShowTests:s,testsLegendCount:c=0,failuresOnly:l,onToggleFailuresOnly:d,showBarEncodingKey:f=!0,showCompileExecuteLegend:p=!1,materializationCounts:m}){let h=zt(),g=Ee(h),_=Object.keys(fv).filter(t=>(e[t]??0)>0),v=[...new Set([...Xe,...Object.keys(t)])].sort((e,t)=>e.localeCompare(t)),y=m==null?[]:ea.filter(e=>(m[e]??0)>0);return _.length>0||v.length>0||s!=null||d!=null||y.length>0?(0,u.jsxs)(`div`,{className:`gantt-legend`,children:[f?(0,u.jsx)(Vv,{theme:h,themeHex:g,showCompileExecuteLegend:p}):null,(0,u.jsx)(Hv,{visibleStatuses:_,statusCounts:e,activeStatuses:n,onToggleStatus:i,failuresOnly:l,onToggleFailuresOnly:d,theme:h}),(0,u.jsx)(Uv,{visibleTypes:v,typeCounts:t,activeTypes:r,onToggleType:a,showTests:o,onToggleShowTests:s,testsLegendCount:c,theme:h,themeHex:g}),(0,u.jsx)(Wv,{materializationRows:y,materializationCounts:m,themeHex:g})]}):null}var Kv=[{value:`upstream`,label:`Upstream`,glyph:`←`},{value:`both`,label:`Both`,glyph:`⇄`},{value:`downstream`,label:`Downstream`,glyph:`→`}];function qv({filters:e,setFilters:t}){let n=Nv(e.dependencyDepthHops),r=e=>t(t=>({...t,dependencyDepthHops:Nv(e)}));return(0,u.jsx)(`div`,{className:`timeline-dependency-controls gantt-legend`,"aria-label":`Dependency visualization controls`,children:(0,u.jsxs)(`div`,{className:`timeline-dependency-controls__top-row`,children:[(0,u.jsxs)(`div`,{className:`timeline-dependency-controls__zone`,children:[(0,u.jsx)(`span`,{className:`gantt-legend__label`,children:`Depth`}),(0,u.jsxs)(`div`,{className:`timeline-dependency-controls__stepper`,role:`group`,"aria-label":`Dependency depth`,children:[(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:()=>r(n-1),disabled:n<=1,"aria-label":`Decrease dependency depth`,children:`-`}),(0,u.jsx)(`span`,{className:`timeline-dependency-controls__depth-value`,children:n}),(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:()=>r(n+1),disabled:n>=3,"aria-label":`Increase dependency depth`,children:`+`})]}),(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill timeline-dependency-controls__max-button`,onClick:()=>r(3),children:`Max`})]}),(0,u.jsx)(`div`,{className:`timeline-dependency-controls__divider`,"aria-hidden":`true`}),(0,u.jsxs)(`div`,{className:`timeline-dependency-controls__zone timeline-dependency-controls__zone--direction`,children:[(0,u.jsx)(`span`,{className:`gantt-legend__label`,children:`Direction`}),(0,u.jsx)(`div`,{className:`workspace-segmented-control`,role:`tablist`,"aria-label":`Dependency direction`,children:Kv.map(n=>{let r=e.dependencyDirection===n.value;return(0,u.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":r,className:r?`workspace-segmented-control__button workspace-segmented-control__button--active`:`workspace-segmented-control__button`,onClick:()=>t(e=>({...e,dependencyDirection:n.value})),children:[(0,u.jsx)(`span`,{"aria-hidden":`true`,children:n.glyph}),` `,n.label]},n.value)})})]})]})})}function Jv(e,t,n){let r=(0,c.useMemo)(()=>new Set(n.map(e=>e.unique_id)),[n]),i=(0,c.useMemo)(()=>new Map(e.ganttData.map(e=>[e.unique_id,e])),[e.ganttData]),a=(0,c.useMemo)(()=>k_(t.selectedExecutionId,r,i),[t.selectedExecutionId,r,i]),o=(0,c.useMemo)(()=>A_({focusId:a,timelineAdjacency:e.timelineAdjacency,candidateIds:r,dependencyDirection:t.dependencyDirection,dependencyDepthHops:t.dependencyDepthHops}),[a,e.timelineAdjacency,r,t.dependencyDirection,t.dependencyDepthHops]),s=(0,c.useMemo)(()=>t.selectedExecutionId==null||t.neighborhoodRowsShowAll?n:n.filter(e=>o.has(e.unique_id)),[n,t.selectedExecutionId,t.neighborhoodRowsShowAll,o]),l=(0,c.useMemo)(()=>n.filter(e=>o.has(e.unique_id)).length,[n,o]);return{displayedParents:s,neighborhoodUi:(0,c.useMemo)(()=>t.selectedExecutionId==null||n.length===0||l>=n.length?null:t.neighborhoodRowsShowAll?{mode:`expanded`,total:n.length,narrowedCount:l}:{mode:`narrowed`,shown:l,total:n.length},[t.selectedExecutionId,t.neighborhoodRowsShowAll,n.length,l])}}function Yv({filters:e,hasActiveFilters:t,typeFilterHint:n,setFilters:r}){return(0,u.jsxs)(`div`,{className:`timeline-toolbar`,children:[(0,u.jsxs)(`label`,{className:`workspace-search workspace-search--compact timeline-toolbar__search`,children:[(0,u.jsx)(`span`,{children:`Search nodes`}),(0,u.jsxs)(`div`,{className:`workspace-search__input-row`,children:[(0,u.jsx)(`input`,{value:e.query,onChange:e=>r(t=>({...t,query:e.target.value})),placeholder:`Filter by name or id…`,"aria-label":`Search timeline nodes`}),e.query&&(0,u.jsx)(`button`,{type:`button`,className:`workspace-search__clear`,"aria-label":`Clear search`,onClick:()=>r(e=>({...e,query:``})),children:`✕`})]})]}),(n!=null||t)&&(0,u.jsxs)(`div`,{className:`timeline-toolbar__actions`,children:[n!=null&&(0,u.jsxs)(`p`,{className:`timeline-toolbar__hint`,role:`status`,children:[n.shown.length>0?`Showing types: ${n.shown.join(`, `)}. `:``,`Hidden by type filter:`,` `,n.hidden.map(({type:e,count:t})=>`${e} (${t})`).join(`, `),`.`]}),(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:()=>{r(e=>({...e,query:``,activeStatuses:new Set,activeTypes:new Set,selectedExecutionId:null,dependencyDirection:`both`,dependencyDepthHops:2,neighborhoodRowsShowAll:!1}))},children:`Clear all filters`})]})]})}function Xv({ui:e,setFilters:t}){return e.mode===`narrowed`?(0,u.jsxs)(u.Fragment,{children:[`Showing `,e.shown.toLocaleString(),` of `,e.total.toLocaleString(),` `,`timeline rows (dependency neighborhood)`,` — `,(0,u.jsx)(`button`,{type:`button`,className:`timeline-neighborhood-action`,onClick:()=>t(e=>({...e,neighborhoodRowsShowAll:!0})),children:`Show all rows`})]}):(0,u.jsxs)(u.Fragment,{children:[`Showing all `,e.total.toLocaleString(),` timeline rows`,` — `,(0,u.jsxs)(`button`,{type:`button`,className:`timeline-neighborhood-action`,onClick:()=>t(e=>({...e,neighborhoodRowsShowAll:!1})),children:[`Neighborhood only (`,e.narrowedCount.toLocaleString(),` rows)`]})]})}function Zv(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Qv(e,t,n){let r=n.get(e.unique_id),i=r?r.error+r.warn>0:t.some(e=>!t_(e.status));return!t_(e.status)||i}function $v(e,t){let n=t.trim().toLowerCase();return n?e.name.toLowerCase().includes(n)||e.unique_id.toLowerCase().includes(n):!0}function ey({analysis:e,filters:t,effectiveActiveTypes:n,filteredData:r,bundleRowCount:i,neighborhoodUi:a,statusCounts:o,typeCounts:s,materializationCounts:l,testsLegendCount:d,hasActiveFilters:f,typeFilterHint:p,testStatsById:m,resourceByUniqueId:h,setFilters:g,toggleStatus:_,toggleType:v,onInvestigationSelectionChange:y}){let b=(0,c.useMemo)(()=>bt(e.ganttData),[e.ganttData]),{timeWindow:x}=t;return(0,u.jsxs)(qt,{title:`Execution timeline`,subtitle:`Relative start and duration for each executed node.`,children:[(0,u.jsx)(Gv,{statusCounts:o,typeCounts:s,testsLegendCount:d,materializationCounts:l,activeStatuses:t.activeStatuses,activeTypes:n,onToggleStatus:_,onToggleType:v,showTests:t.showTests,onToggleShowTests:()=>g(e=>({...e,showTests:!e.showTests})),failuresOnly:t.failuresOnly,onToggleFailuresOnly:()=>g(e=>({...e,failuresOnly:!e.failuresOnly})),showCompileExecuteLegend:b}),(0,u.jsx)(Yv,{filters:t,hasActiveFilters:f,typeFilterHint:p,setFilters:g}),(0,u.jsx)(qv,{filters:t,setFilters:g}),x!=null&&(0,u.jsxs)(`p`,{className:`timeline-zoom-active`,role:`status`,children:[`Zoomed to `,Xg(x.end-x.start),` window`,` — `,(0,u.jsx)(`button`,{type:`button`,className:`timeline-zoom-clear`,onClick:()=>g(e=>({...e,timeWindow:null})),children:`Clear zoom ×`})]}),a!=null&&(0,u.jsx)(`p`,{className:`timeline-neighborhood-active`,role:`status`,children:(0,u.jsx)(Xv,{ui:a,setFilters:g})}),i>=2e4?(0,u.jsxs)(`p`,{className:`timeline-large-dataset-hint`,role:`status`,children:[`Showing `,i.toLocaleString(),` timeline rows. Use search or type and status filters to narrow the list.`]}):null,(0,u.jsx)(Iv,{data:r,runStartedAt:e.runStartedAt,timelineAdjacency:e.timelineAdjacency,testStatsById:m,resourceByUniqueId:h,showTests:t.showTests,dependencyDirection:t.dependencyDirection,dependencyDepthHops:t.dependencyDepthHops,selectedId:t.selectedExecutionId,timeWindow:x,onTimeWindowChange:e=>g(t=>({...t,timeWindow:e})),onSelect:t=>{g(e=>{let n=t==null,r=t!==e.selectedExecutionId,i=n||r?!1:e.neighborhoodRowsShowAll;return{...e,selectedExecutionId:t,neighborhoodRowsShowAll:i}}),y(n=>({...n,selectedExecutionId:t,selectedResourceId:t==null?n.selectedResourceId:e.resources.find(e=>e.uniqueId===t)?.uniqueId??n.selectedResourceId,sourceLens:`timeline`}))}})]})}function ty({analysis:e,filters:t,setFilters:n,onInvestigationSelectionChange:r}){let i=(0,c.useDeferredValue)(t.query),a=e.projectName??ht(e.executions),o=(0,c.useMemo)(()=>Array.from(new Set(e.ganttData.filter(e=>yt(e,a)).map(e=>e.resourceType).filter(e=>!!e))).sort(),[e.ganttData,a]),s=(0,c.useMemo)(()=>vt(o),[o]),l=t.activeTypes.size>0?t.activeTypes:s;function d(e){n(t=>{let n=new Set(t.activeStatuses);return n.has(e)?n.delete(e):n.add(e),{...t,activeStatuses:n}})}function f(e){n(t=>{let n=new Set(t.activeTypes.size>0?t.activeTypes:s);return n.has(e)?n.delete(e):n.add(e),{...t,activeTypes:n}})}let p=(0,c.useMemo)(()=>fa(e.resources,e.dependencyIndex),[e.dependencyIndex,e.resources]),m=(0,c.useMemo)(()=>new Map(e.resources.map(e=>[e.uniqueId,e])),[e.resources]),h=(0,c.useMemo)(()=>{let t=new Map;for(let n of e.ganttData){if(!I.has(n.resourceType)||n.parentId==null)continue;let e=t.get(n.parentId)??[];e.push(n),t.set(n.parentId,e)}return t},[e.ganttData]),{displayedParents:g,neighborhoodUi:_}=Jv(e,t,(0,c.useMemo)(()=>e.ganttData.filter(e=>I.has(e.resourceType)||t.activeTypes.size===0&&!yt(e,a)||t.activeStatuses.size>0&&!t.activeStatuses.has(e.status.toLowerCase())||l.size>0&&!l.has(e.resourceType??``)||!$v(e,i)?!1:t.failuresOnly?Qv(e,h.get(e.unique_id)??[],p):!0),[e.ganttData,i,l,t.activeStatuses,t.failuresOnly,t.activeTypes.size,a,p,h])),v=(0,c.useMemo)(()=>new Set(g.map(e=>e.unique_id)),[g]),y=(0,c.useMemo)(()=>t.showTests?e.ganttData.filter(e=>I.has(e.resourceType)&&e.parentId!=null&&v.has(e.parentId)):[],[e.ganttData,t.showTests,v]),b=(0,c.useMemo)(()=>[...g,...y],[g,y]),x=(0,c.useMemo)(()=>{let e={};for(let t of b){let n=t.semantics?.materialization??`unknown`;e[n]=(e[n]??0)+1}return e},[b]),{statusCounts:S,typeCounts:C}=(0,c.useMemo)(()=>{let t={},n={};for(let r of e.ganttData){if(!yt(r,a))continue;let e=r.status.toLowerCase();t[e]=(t[e]??0)+1;let i=r.resourceType;n[i]=(n[i]??0)+1}return{statusCounts:t,typeCounts:n}},[e.ganttData,a]),w=(0,c.useMemo)(()=>xt(e.ganttData,a),[e.ganttData,a]),T=!Zv(l,s),E=(0,c.useMemo)(()=>{if(!T)return null;let e=[...l].filter(e=>s.has(e)).sort(),t=[...s].filter(e=>!l.has(e)).sort().map(e=>({type:e,count:C[e]??0}));return t.length===0?null:{shown:e,hidden:t}},[s,l,T,C]),D=t.activeStatuses.size>0||T||t.query.length>0;return(0,u.jsx)(Zt,{title:`Timeline`,description:`Runtime timing, concurrency, bottlenecks, and execution order.`,className:`timeline-view`,children:(0,u.jsx)(ey,{analysis:e,filters:t,effectiveActiveTypes:l,filteredData:b,bundleRowCount:g.length,neighborhoodUi:_,statusCounts:S,typeCounts:C,materializationCounts:x,testsLegendCount:w,hasActiveFilters:D,typeFilterHint:E,testStatsById:p,resourceByUniqueId:m,setFilters:n,toggleStatus:d,toggleType:f,onInvestigationSelectionChange:r})})}var ny=100;function ry(){return{status:{all:0,positive:0,warning:0,danger:0},facets:{all:0,models:0,tests:0,seeds:0,snapshots:0,operations:0,healthy:0,warnings:0,errors:0,issues:0},resourceTypes:{},threadIds:{}}}function iy(e,t,n=!0){let r=(0,c.useRef)(null),i=(0,c.useRef)(0),[a,o]=(0,c.useState)(!1),[s,l]=(0,c.useState)(ny),[u,d]=(0,c.useState)([]),[f,p]=(0,c.useState)(0),[m,h]=(0,c.useState)(ry),[g,_]=(0,c.useState)(!0),[v,y]=(0,c.useState)(!1),[b,x]=(0,c.useState)(null);return(0,c.useEffect)(()=>{l(ny)},[t.kind,t.status,t.query,t.durationBand,t.sortBy,t.sortDirection,t.resourceTypes,t.materializationKinds,t.threadIds,e]),(0,c.useEffect)(()=>{if(!n){o(!1),_(!1),y(!1),d([]),p(0),h(ry()),x(null);return}let t=new Worker(new URL(`/assets/resultsQuery.worker-BrgyEpD8.js`,``+import.meta.url),{type:`module`});return r.current=t,o(!1),_(!0),d([]),p(0),h(ry()),x(null),t.onmessage=e=>{let t=e.data;if(t.type===`ready`){o(!0),_(!1),h(t.summary);return}if(t.type===`query-result`){if(t.requestId!==i.current)return;d(t.rows),p(t.totalMatches),h(t.summary),y(!1);return}x(t.message),_(!1),y(!1)},t.postMessage({type:`init`,rows:e}),()=>{t.terminate(),r.current=null}},[e,n]),(0,c.useEffect)(()=>{if(!n||!a||r.current==null)return;let e=i.current+1;i.current=e,y(!0),x(null),r.current.postMessage({type:`query`,requestId:e,kind:t.kind,status:t.status,query:t.query,resourceTypes:Array.from(t.resourceTypes),materializationKinds:Array.from(t.materializationKinds),threadIds:Array.from(t.threadIds),durationBand:t.durationBand,sortBy:t.sortBy,sortDirection:t.sortDirection,limit:s})},[n,a,s,t]),(0,c.useMemo)(()=>({rows:u,totalMatches:f,totalVisible:u.length,summary:m,hasMore:u.length<f,isIndexing:g,isLoading:v,error:b,loadMore:()=>l(e=>e+ny)}),[u,f,m,g,v,b])}function ay(e){return e.kind===`number`?0:1}function oy(e){return`adapter:${e}`}function sy(e){return e.startsWith(`adapter:`)}function cy(e,t){let n=Hi([e.adapterMetrics]).find(e=>e.key===t),r=n?Bi(e.adapterMetrics,n.key):void 0;if(!(n==null||r===void 0))return{displayValue:Vi(n,r),sortValue:typeof r==`number`||typeof r==`string`?r:void 0,isScalar:!0}}function ly(e){let t=Hi(e.map(e=>e.adapterMetrics)).map(t=>({id:oy(t.key),key:t.key,label:t.shortLabel,kind:t.kind,align:t.kind===`number`?`end`:`start`,isScalar:!0,presenceCount:e.filter(e=>Bi(e.adapterMetrics,t.key)!==void 0).length})).sort((e,t)=>{let n=ay(e),r=ay(t);return n===r?e.presenceCount===t.presenceCount?e.key.localeCompare(t.key):t.presenceCount-e.presenceCount:n-r});return{allColumns:t,visibleColumns:t.slice(0,6),overflowColumns:t.slice(6)}}function uy(e,t){return t.map(t=>{let n=cy(e,t.key);return`${t.label}: ${n?.displayValue??`—`}`}).join(`
|
|
35
|
-
`)}var
|
|
36
|
-
`)}]:[],c=[...o,...s];return(0,u.jsx)($t,{eyebrow:`Selected run item`,title:e.name,typeLabel:tt(e.resourceType),stats:[{label:`Status`,value:e.status},{label:`Duration`,value:et(e.executionTime)},{label:`Thread`,value:e.threadId??`n/a`},{label:fy,value:String(t.length+n.length)},{label:`Extra raw fields`,value:String(a.length)}],sections:c,actions:[{label:`Open in Timeline`,onClick:()=>r(`timeline`,{resourceId:e.uniqueId,executionId:e.uniqueId})},{label:`Open in Inventory`,onClick:()=>r(`inventory`,{resourceId:e.uniqueId,assetTab:`summary`})},{label:`Open in Lineage`,onClick:()=>r(`inventory`,{resourceId:e.uniqueId,assetTab:`lineage`,rootResourceId:e.uniqueId})}]})}function my(e){if(sy(e))return`desc`;switch(e){case`attention`:case`duration`:case`start`:return`desc`;default:return`asc`}}function hy(e,t){return t.sortBy===e?{sortBy:e,sortDirection:t.sortDirection===`asc`?`desc`:`asc`}:{sortBy:e,sortDirection:my(e)}}function gy(e,t,n){return e===t?n===`asc`?{indicator:`↑`,ariaSort:`ascending`}:{indicator:`↓`,ariaSort:`descending`}:{indicator:` `,ariaSort:`none`}}function _y(e){let t=[`minmax(280px, 2.5fr)`,`minmax(108px, 0.85fr)`,`minmax(92px, 0.7fr)`,`minmax(132px, 0.95fr)`,`minmax(96px, 0.72fr)`],n=e.map(e=>e.align===`end`?`minmax(120px, 0.95fr)`:`minmax(148px, 1.1fr)`);return[...t,...n,`minmax(160px, 1fr)`].join(` `)}function vy(e,t){return cy(e,t.key)?.displayValue??`—`}var yy=`results-table__cell--align-end`;function by({sortKey:e,label:t,alignEnd:n,cellClassName:r,runsViewState:i,onRunsViewStateChange:a}){let o=gy(i.sortBy,e,i.sortDirection);return(0,u.jsx)(`div`,{className:`results-table__cell${r?` ${r}`:``}${n?` ${yy}`:``}`,role:`columnheader`,"aria-sort":o.ariaSort,children:(0,u.jsxs)(`button`,{type:`button`,className:`results-table__sort-button${n?` results-table__sort-button--align-end`:``}`,onClick:()=>a(t=>({...t,...hy(e,t)})),children:[t,(0,u.jsx)(`span`,{className:`results-table__sort-indicator`,"aria-hidden":`true`,children:o.indicator})]})})}function xy({analysis:e,runsResults:t,runsViewState:n,adapterColumns:r,onRunsViewStateChange:i,onInvestigationSelectionChange:a}){let o=(0,c.useRef)(null),l=(0,c.useRef)(null),[d,f]=(0,c.useState)(44);(0,c.useLayoutEffect)(()=>{let e=l.current;if(!e||typeof ResizeObserver>`u`)return;let t=()=>{f(Math.max(1,Math.ceil(e.getBoundingClientRect().height)))};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[r.length]);let p=s({count:t.rows.length,getScrollElement:()=>o.current,estimateSize:()=>76,overscan:10,scrollMargin:d});(0,c.useEffect)(()=>{let e=o.current;if(!e)return;let n=()=>{e.scrollHeight-e.scrollTop-e.clientHeight<220&&t.hasMore&&!t.isLoading&&!t.isIndexing&&t.loadMore()};return e.addEventListener(`scroll`,n),n(),()=>e.removeEventListener(`scroll`,n)},[t]);let m={"--results-table-columns":_y(r)},h=Math.min(560,Math.max(120,t.rows.length*76)),g=p.options.scrollMargin;return(0,u.jsx)(`div`,{className:`results-table`,style:m,children:(0,u.jsxs)(`div`,{ref:o,className:`results-table__scroll`,style:{height:h,overflowY:`auto`,position:`relative`},children:[(0,u.jsxs)(`div`,{ref:l,className:`results-table__header results-table__header--sticky`,role:`row`,children:[(0,u.jsx)(by,{sortKey:`name`,label:`Item`,cellClassName:`results-table__cell--item`,runsViewState:n,onRunsViewStateChange:i}),(0,u.jsx)(by,{sortKey:`resourceType`,label:`Type`,runsViewState:n,onRunsViewStateChange:i}),(0,u.jsx)(by,{sortKey:`materialization`,label:`Materialization`,runsViewState:n,onRunsViewStateChange:i}),(0,u.jsx)(by,{sortKey:`status`,label:`Status`,runsViewState:n,onRunsViewStateChange:i}),(0,u.jsx)(by,{sortKey:`duration`,label:`Duration`,alignEnd:!0,runsViewState:n,onRunsViewStateChange:i}),r.map(e=>{let t=e.align===`end`;return e.isScalar?(0,u.jsx)(by,{sortKey:e.id,label:e.label,alignEnd:t,runsViewState:n,onRunsViewStateChange:i},e.id):(0,u.jsx)(`div`,{className:`results-table__cell${t?` ${yy}`:``}`,role:`columnheader`,title:e.label,children:e.label},e.id)}),(0,u.jsx)(by,{sortKey:`thread`,label:`Thread`,runsViewState:n,onRunsViewStateChange:i})]}),(0,u.jsx)(`div`,{className:`results-table__body`,children:(0,u.jsx)(`div`,{style:{height:p.getTotalSize(),position:`relative`},children:p.getVirtualItems().map(o=>{let s=t.rows[o.index];return s?(0,u.jsxs)(`button`,{type:`button`,className:`results-table__row${s.uniqueId===n.selectedExecutionId?` results-table__row--active`:``}`,style:{position:`absolute`,top:0,left:0,width:`100%`,transform:`translateY(${o.start-g}px)`},onClick:()=>{let t=e.resources.find(e=>e.uniqueId===s.uniqueId)??null;i(e=>({...e,selectedExecutionId:s.uniqueId})),a(e=>({...e,selectedExecutionId:s.uniqueId,selectedResourceId:t?.uniqueId??s.uniqueId,sourceLens:`runs`}))},children:[(0,u.jsx)(`div`,{className:`results-table__cell results-table__cell--item`,"data-label":`Item`,title:s.name,children:(0,u.jsx)(`strong`,{children:s.name})}),(0,u.jsx)(`div`,{className:`results-table__cell`,"data-label":`Type`,title:s.resourceType,children:s.resourceType}),(0,u.jsx)(`div`,{className:`results-table__cell`,"data-label":`Materialization`,children:s.semantics?(0,u.jsx)(ca,{semantics:s.semantics,variant:`compact`}):`—`}),(0,u.jsx)(`div`,{className:`results-table__cell`,"data-label":`Status`,children:(0,u.jsx)(`span`,{className:ot(s.statusTone),children:s.status})}),(0,u.jsx)(`div`,{className:`results-table__cell ${yy}`,"data-label":`Duration`,children:et(s.executionTime)}),r.map(e=>{let t=vy(s,e);return(0,u.jsx)(`div`,{className:`results-table__cell${e.align===`end`?` ${yy}`:``}`,"data-label":e.label,title:t,children:t},e.id)}),(0,u.jsx)(`div`,{className:`results-table__cell`,"data-label":`Thread`,title:s.threadId??`n/a`,children:s.threadId??`n/a`})]},s.uniqueId):null})})})]})})}function Sy({kinds:e,activeKinds:t,onToggleKind:n,buttonTitle:r}){return(0,u.jsx)(`div`,{className:`pill-row`,children:e.map(e=>(0,u.jsx)(`button`,{type:`button`,className:t.size===0||t.has(e)?Ke:qe,title:r,onClick:()=>n(e),children:ra(e)},e))})}var Cy=[{label:`All`,countKey:`all`},{kind:`models`,label:`Models`,countKey:`models`},{kind:`tests`,label:`Tests`,countKey:`tests`},{kind:`seeds`,label:`Seeds`,countKey:`seeds`},{kind:`snapshots`,label:`Snapshots`,countKey:`snapshots`},{kind:`operations`,label:`Operations`,countKey:`operations`},{status:`positive`,label:`Healthy`,countKey:`healthy`},{status:`issues`,label:`Issues`,countKey:`issues`},{status:`warning`,label:`Warnings`,countKey:`warnings`},{status:`danger`,label:`Errors`,countKey:`errors`}];function wy(e){return e.facets}function Ty({runsViewState:e,runsResults:t,adapterColumnLayout:n,adapterMetricsAvailable:r,availableMaterializationKinds:i,onRunsViewStateChange:a}){let o=n.visibleColumns.filter(e=>e.isScalar),s=e.showAdapterMetrics&&o.length>0;return(0,u.jsxs)(`div`,{className:`runs-toolbar runs-toolbar--stacked`,children:[(0,u.jsxs)(`div`,{className:`runs-toolbar__controls`,children:[(0,u.jsxs)(`label`,{className:`workspace-search workspace-search--compact runs-toolbar__search`,children:[(0,u.jsx)(`span`,{children:`Search`}),(0,u.jsx)(`input`,{value:e.query,onChange:e=>a(t=>({...t,query:e.target.value})),placeholder:`Filter by name, type, status, thread…`})]}),(0,u.jsxs)(`label`,{className:`workspace-search workspace-search--compact runs-toolbar__sort`,children:[(0,u.jsx)(`span`,{children:`Sort`}),(0,u.jsxs)(`select`,{value:e.sortBy,onChange:e=>{let t=e.target.value;a(e=>({...e,sortBy:t,sortDirection:my(t)}))},children:[(0,u.jsx)(`option`,{value:`attention`,children:`Attention`}),(0,u.jsx)(`option`,{value:`duration`,children:`Duration`}),(0,u.jsx)(`option`,{value:`name`,children:`Name`}),(0,u.jsx)(`option`,{value:`status`,children:`Status`}),(0,u.jsx)(`option`,{value:`start`,children:`Start`}),(0,u.jsx)(`option`,{value:`materialization`,children:`Materialization`}),s?o.map(e=>(0,u.jsx)(`option`,{value:e.id,children:e.label},e.id)):null]})]}),(0,u.jsxs)(`label`,{className:`runs-toolbar__toggle`,title:r?`Show normalized adapter metrics derived from the current run`:`No normalized adapter metrics are available in this run`,children:[(0,u.jsx)(`input`,{type:`checkbox`,checked:e.showAdapterMetrics,disabled:!r,onChange:e=>{let t=e.target.checked;a(e=>({...e,showAdapterMetrics:t,sortBy:!t&&sy(e.sortBy)?`attention`:e.sortBy,sortDirection:!t&&sy(e.sortBy)?`desc`:e.sortDirection}))}}),(0,u.jsx)(`span`,{children:`Adapter metrics`})]})]}),i.length>0?(0,u.jsxs)(`div`,{className:`runs-toolbar__mat-filters`,role:`group`,"aria-label":`Materialization filters`,children:[(0,u.jsx)(`span`,{className:`runs-toolbar__mat-filters-label`,children:`Materialization (manifest)`}),(0,u.jsx)(Sy,{kinds:i,activeKinds:e.materializationKinds,onToggleKind:e=>a(t=>{let n=new Set(t.materializationKinds);return n.has(e)?n.delete(e):n.add(e),{...t,materializationKinds:n}}),buttonTitle:`Filter run rows by normalized manifest materialization`})]}):null,e.showAdapterMetrics&&n.overflowColumns.length>0?(0,u.jsxs)(`p`,{className:`runs-toolbar__meta`,children:[`Showing `,n.visibleColumns.length,` of`,` `,n.allColumns.length,` adapter metrics. Select a row to inspect the remaining `,n.overflowColumns.length,`.`]}):null,(0,u.jsx)(`div`,{className:`runs-toolbar__facets`,children:Cy.map(n=>{let r=wy(t.summary);return(0,u.jsxs)(`button`,{type:`button`,className:n.kind!=null&&e.kind===n.kind||n.status!=null&&e.status===n.status||n.kind==null&&n.status==null&&e.kind===`all`&&e.status===`all`?`workspace-pill workspace-pill--active`:`workspace-pill`,onClick:()=>a(e=>({...e,kind:n.kind??`all`,status:n.status??`all`})),children:[n.label,` (`,r[n.countKey],`)`]},n.label)})})]})}function Ey({analysis:e,runsViewState:t,onRunsViewStateChange:n,onInvestigationSelectionChange:r,onNavigateTo:i}){let a=(0,c.useMemo)(()=>ly(e.executions),[e.executions]),o=a.allColumns.length>0,s=(0,c.useMemo)(()=>t.showAdapterMetrics&&o?a.visibleColumns:[],[a.visibleColumns,o,t.showAdapterMetrics]),l=(0,c.useMemo)(()=>aa(e.executions.map(e=>e.semantics)),[e.executions]),d=(0,c.useMemo)(()=>t.showAdapterMetrics&&o?a.overflowColumns:[],[a.overflowColumns,o,t.showAdapterMetrics]);(0,c.useEffect)(()=>{let e=t.sortBy;sy(e)&&!s.some(t=>t.id===e&&t.isScalar)&&n(e=>({...e,sortBy:`attention`,sortDirection:`desc`}))},[n,t.sortBy,s]),(0,c.useEffect)(()=>{!o&&t.showAdapterMetrics&&n(e=>({...e,showAdapterMetrics:!1}))},[o,n,t.showAdapterMetrics]);let f=iy(e.executions,t,!0),p=e.executions.find(e=>e.uniqueId===t.selectedExecutionId)??null;return(0,u.jsx)(Zt,{title:`Runs`,description:`Execution and quality evidence across models, tests, seeds, snapshots, and operations.`,toolbar:(0,u.jsx)(Ty,{runsViewState:t,runsResults:f,adapterColumnLayout:a,adapterMetricsAvailable:o,availableMaterializationKinds:l,onRunsViewStateChange:n}),inspector:p?(0,u.jsx)(py,{row:p,visibleColumns:s,overflowColumns:d,onNavigateTo:i}):null,className:`runs-view`,children:(0,u.jsx)(xy,{analysis:e,runsResults:f,runsViewState:t,adapterColumns:s,onRunsViewStateChange:n,onInvestigationSelectionChange:r})})}var $={resourceTypeSummaryAriaLabel:`Run outcomes for executed dbt assets (non-test resources such as models and sources), grouped by resource type. Counts are how many assets succeeded versus had warnings or failures. These are not dbt test pass or fail totals.`,resourceTypeSummaryTitle:`Run outcomes for executed dbt assets by type (excludes tests). Not dbt test pass or fail totals.`,resourceTypeSummaryItemTitle(e){return`${e}: executed asset run outcomes for this type, not dbt test totals.`},treeTestStatsTitle:`Attention-only rollup of executed dbt test outcomes for this folder or row: failed or errored, warning, and dbt-skipped. Passing tests and tests with no run result (not executed) are not shown here. A test that depends on multiple resources may be counted more than once in folder totals.`,treeTestStatsBranchAriaLabel:`Dbt test attention rollup for resources in this folder: failed or error, warning, and skipped counts only. Passing tests and not-executed tests are not shown. Tests with multiple upstream dependencies may be counted more than once when summed at higher folders.`,treeTestStatsLeafAriaLabel:`Dbt test attention outcomes for this resource: failed or error, warning, and skipped only. Passing tests and not-executed tests are not shown.`,treeTestStatErrorTitle(e){return`Failed or errored dbt test attachments: ${e}`},treeTestStatWarnTitle(e){return`Warning dbt test attachments: ${e}`},treeTestStatSkippedTitle(e){return`Dbt skipped or no-op test attachments: ${e}. Folder rollups may count one test multiple times when it depends on several resources.`},treeEmptyHeadline:`No resources found`,treeEmptyDefaultSubtext:`Adjust filters or search to find matching branches or assets.`,treeEmptySearchSubtext:`Try clearing or changing the resource search box.`,treeEmptyResourceTypesSubtext:`One or more dbt resource types are narrowed; add types or reset type filters to see more assets.`,treeEmptyMaterializationSubtext:`Materialization filters are narrowing the tree; clear or broaden them to see more assets (values come from manifest metadata).`,treeEmptyExecutionFilterSubtext(e){switch(e){case`danger`:return`Execution status is Fail: only assets with a failed or errored result in this run are shown. Assets without a run row are treated as Not executed, not Fail. For models whose run succeeded but dbt tests failed, use Issues. Try Execution status All, or confirm run results are loaded for this workspace.`;case`issues`:return`Execution status is Issues: assets with a failed or errored run result, or with failed, warned, or skipped dbt test attachments in this run. Fail shows execution failures only.`;case`neutral`:return`Execution status is Not executed: only assets without a matching run result (or unknown status) are shown. Try All or confirm run results are loaded.`;case`positive`:return`Execution status is Success: only successful runs are shown. Try All or adjust other filters.`;case`warning`:return`Execution status is Warn: only warned runs are shown. Try All or adjust other filters.`;case`skipped`:return`Execution status is Skipped: only skipped runs are shown. Try All or adjust other filters.`;default:return``}},executionStatusSectionTitle:`Filter by run & tests`,executionStatusRunOutcomeSubLabel:`Run outcome`,executionStatusProblemsSubLabel:`Run + dbt tests`};function Dy(e){switch(e){case`all`:return`All`;case`positive`:return`Success`;case`warning`:return`Warn`;case`danger`:return`Fail (run)`;case`skipped`:return`Skipped`;case`neutral`:return`Not executed`;case`issues`:return`Issues (run or tests)`;default:return e}}function Oy(e){return e===`all`?`Show all assets regardless of run outcome or attached dbt test results.`:$.treeEmptyExecutionFilterSubtext(e)}function ky(e){let t=[];return e.status!==`all`&&t.push($.treeEmptyExecutionFilterSubtext(e.status)),e.resourceQuery.trim()&&t.push($.treeEmptySearchSubtext),e.activeResourceTypeCount>0&&t.push($.treeEmptyResourceTypesSubtext),(e.activeMaterializationKindCount??0)>0&&t.push($.treeEmptyMaterializationSubtext),t.length===0?$.treeEmptyDefaultSubtext:t.join(` `)}var Ay=`dbt-tools.explorerFiltersExpanded`;function jy(){try{let e=window.localStorage.getItem(Ay);if(e!==null)return e===`true`}catch{}return!1}function My({filtersExpanded:e,setFiltersExpandedPersisted:t,activeFilterCount:n,filterSummary:r,resourceQuery:i,setResourceQuery:a,status:o,setStatus:s,availableResourceTypes:c,activeResourceTypes:l,toggleResourceType:d,availableMaterializationKinds:f,activeMaterializationKinds:p,toggleMaterializationKind:m}){return(0,u.jsxs)(`section`,{className:`explorer-filters`,"aria-label":`Explorer filters`,children:[(0,u.jsxs)(`button`,{type:`button`,className:`explorer-filters__toggle`,"aria-expanded":e,onClick:()=>t(!e),children:[(0,u.jsxs)(`span`,{className:`explorer-filters__toggle-copy`,children:[(0,u.jsx)(`span`,{className:`explorer-filters__toggle-label`,children:`Filters`}),(0,u.jsx)(`span`,{className:`explorer-filters__toggle-summary`,children:r})]}),(0,u.jsxs)(`span`,{className:`explorer-filters__toggle-meta`,children:[n>0&&(0,u.jsx)(`span`,{className:`explorer-filters__badge`,children:n}),(0,u.jsx)(`span`,{className:`explorer-filters__chevron${e?` explorer-filters__chevron--expanded`:``}`,"aria-hidden":`true`,children:`▾`})]})]}),e&&(0,u.jsxs)(`div`,{className:`explorer-filter-stack`,children:[(0,u.jsxs)(`label`,{className:`workspace-search`,children:[(0,u.jsx)(`span`,{children:`Search resources`}),(0,u.jsx)(`input`,{value:i,onChange:e=>a(e.target.value),placeholder:`Filter tree by name, path, type, or id`})]}),(0,u.jsxs)(`div`,{className:`explorer-filter-group`,children:[(0,u.jsx)(`span`,{className:`explorer-filter-group__label`,children:$.executionStatusSectionTitle}),(0,u.jsxs)(`div`,{className:`explorer-status-filters`,children:[(0,u.jsxs)(`div`,{className:`explorer-status-filters__block`,children:[(0,u.jsx)(`span`,{className:`explorer-status-filters__sublabel`,id:`explorer-status-run-outcome-label`,children:$.executionStatusRunOutcomeSubLabel}),(0,u.jsx)(`div`,{className:`pill-row`,role:`group`,"aria-labelledby":`explorer-status-run-outcome-label`,children:[`all`,`positive`,`warning`,`danger`,`skipped`,`neutral`].map(e=>(0,u.jsx)(`button`,{type:`button`,className:o===e?`workspace-pill workspace-pill--active`:`workspace-pill`,title:Oy(e),"aria-label":`${Dy(e)}. ${Oy(e)}`,onClick:()=>s(e),children:Dy(e)},e))})]}),(0,u.jsxs)(`div`,{className:`explorer-status-filters__block explorer-status-filters__block--problems`,children:[(0,u.jsx)(`span`,{className:`explorer-status-filters__sublabel`,id:`explorer-status-problems-label`,children:$.executionStatusProblemsSubLabel}),(0,u.jsx)(`div`,{className:`pill-row`,role:`group`,"aria-labelledby":`explorer-status-problems-label`,children:(0,u.jsx)(`button`,{type:`button`,className:o===`issues`?`workspace-pill workspace-pill--active`:`workspace-pill`,title:Oy(`issues`),"aria-label":`${Dy(`issues`)}. ${Oy(`issues`)}`,onClick:()=>s(`issues`),children:Dy(`issues`)})})]})]})]}),c.length>0&&(0,u.jsxs)(`div`,{className:`explorer-filter-group`,children:[(0,u.jsx)(`span`,{className:`explorer-filter-group__label`,children:`dbt resource type`}),(0,u.jsx)(`div`,{className:`pill-row`,children:c.map(e=>(0,u.jsx)(`button`,{type:`button`,className:l.size===0||l.has(e)?`workspace-pill workspace-pill--active`:`workspace-pill`,onClick:()=>d(e),children:tt(e)},e))})]}),f.length>0&&(0,u.jsxs)(`div`,{className:`explorer-filter-group`,children:[(0,u.jsx)(`span`,{className:`explorer-filter-group__label`,children:`Materialization (manifest)`}),(0,u.jsx)(Sy,{kinds:f,activeKinds:p,onToggleKind:m,buttonTitle:`Filter by normalized config.materialized / resource kind`})]})]})]})}function Ny(e){let t=tt(e.resourceType),n=ya(e);return n?`${e.name}, ${t}, file ${n}`:`${e.name}, ${t}`}function Py({testStats:e,variant:t}){if(!da(e))return null;let n=t===`branch`?$.treeTestStatsBranchAriaLabel:$.treeTestStatsLeafAriaLabel;return(0,u.jsxs)(`span`,{className:`explorer-tree__test-stats-wrap`,role:`group`,"aria-label":n,title:$.treeTestStatsTitle,children:[(0,u.jsx)(`span`,{className:`explorer-tree__test-stats-label`,"aria-hidden":`true`,children:`Test issues`}),(0,u.jsxs)(`span`,{className:`explorer-tree__test-stats`,children:[e.error>0&&(0,u.jsxs)(`span`,{className:`explorer-tree__test-stat explorer-tree__test-stat--fail`,title:$.treeTestStatErrorTitle(e.error),children:[`✗`,e.error]}),e.warn>0&&(0,u.jsxs)(`span`,{className:`explorer-tree__test-stat explorer-tree__test-stat--warn`,title:$.treeTestStatWarnTitle(e.warn),children:[`!`,e.warn]}),e.skipped>0&&(0,u.jsxs)(`span`,{className:`explorer-tree__test-stat explorer-tree__test-stat--skipped`,title:$.treeTestStatSkippedTitle(e.skipped),children:[`−`,e.skipped]})]})]})}function Fy({virtualRow:e,measureRow:t,children:n}){return(0,u.jsx)(`div`,{"data-index":e.index,ref:t,className:`explorer-tree__virtual-row`,style:{position:`absolute`,top:0,left:0,width:`100%`,transform:`translateY(${e.start}px)`},children:n})}function Iy({treeRows:e,explorerMode:t,expandedNodeIds:n,toggleExpandedNode:r,selectedResourceId:i,setSelectedResourceId:a,treeEmptyDisplay:o}){let l=(0,c.useRef)(null),d=s({count:e.length,getScrollElement:()=>l.current,estimateSize:()=>30,overscan:16}),f=d.measureElement;return e.length===0?(0,u.jsx)(`div`,{ref:l,className:`explorer-tree`,children:(0,u.jsx)(Dt,{icon:`🔍`,headline:o?.headline??$.treeEmptyHeadline,subtext:o?.subtext??$.treeEmptyDefaultSubtext})}):(0,u.jsx)(`div`,{ref:l,className:`explorer-tree`,children:(0,u.jsx)(`div`,{className:`explorer-tree__virtual-spacer`,style:{height:d.getTotalSize(),width:`100%`,position:`relative`},children:d.getVirtualItems().map(o=>{let s=e[o.index];if(!s)return null;let{node:c,depth:l}=s;if(c.kind===`branch`){let e=n.has(c.id);return(0,u.jsx)(Fy,{virtualRow:o,measureRow:f,children:(0,u.jsxs)(`button`,{type:`button`,className:`explorer-tree__row explorer-tree__row--branch`,style:{paddingLeft:`${.9+l*1.05}rem`},onClick:()=>r(c.id),children:[(0,u.jsx)(`span`,{className:`explorer-tree__chevron${e?` explorer-tree__chevron--expanded`:``}`,"aria-hidden":`true`,children:`▸`}),(0,u.jsx)(`span`,{className:`explorer-tree__folder`,"aria-hidden":`true`,children:(0,u.jsx)(Xt,{mode:t,depth:l})}),(0,u.jsx)(`span`,{className:`explorer-tree__label`,children:c.label}),c.testStats&&(0,u.jsx)(Py,{testStats:c.testStats,variant:`branch`})]})},o.key)}let d=c.resource;return(0,u.jsx)(Fy,{virtualRow:o,measureRow:f,children:(0,u.jsxs)(`button`,{type:`button`,className:d.uniqueId===i?`explorer-tree__row explorer-tree__row--leaf explorer-tree__row--active`:`explorer-tree__row explorer-tree__row--leaf`,style:{paddingLeft:`${.9+l*1.05}rem`},onClick:()=>a(d.uniqueId),title:d.uniqueId,"aria-label":Ny(d),children:[(0,u.jsx)(`span`,{className:`explorer-tree__leaf-icon`,"aria-hidden":`true`,children:(0,u.jsx)(Yt,{resourceType:d.resourceType})}),(0,u.jsx)(`span`,{className:`explorer-tree__resource-body`,children:(0,u.jsx)(`span`,{className:`explorer-tree__label`,children:d.name})}),d.semantics?(0,u.jsx)(ca,{semantics:d.semantics,variant:`compact`}):null,c.testStats&&(0,u.jsx)(Py,{testStats:c.testStats,variant:`leaf`})]})},o.key)})})})}function Ly({mode:e}){return e===`project`?(0,u.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,children:(0,u.jsx)(`path`,{d:`M3.5 7.5h6l1.8 2h8.7v7.8a1.2 1.2 0 0 1-1.2 1.2H4.7a1.2 1.2 0 0 1-1.2-1.2V8.7a1.2 1.2 0 0 1 1.2-1.2Z`})}):e===`database`?(0,u.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,children:[(0,u.jsx)(`ellipse`,{cx:`12`,cy:`6.2`,rx:`6.5`,ry:`2.7`}),(0,u.jsx)(`path`,{d:`M5.5 6.2v5.6c0 1.5 2.9 2.7 6.5 2.7s6.5-1.2 6.5-2.7V6.2`}),(0,u.jsx)(`path`,{d:`M5.5 11.8v5.8c0 1.5 2.9 2.7 6.5 2.7s6.5-1.2 6.5-2.7v-5.8`})]}):null}function Ry({resources:e}){let t=e.filter(e=>!I.has(e.resourceType)&&e.statusTone!==`neutral`);if(t.length===0)return null;let n=new Map;for(let e of t){let t=n.get(e.resourceType)??{pass:0,fail:0};e.statusTone===`positive`?t.pass++:(e.statusTone===`danger`||e.statusTone===`warning`)&&t.fail++,n.set(e.resourceType,t)}let r=Array.from(n.entries()).sort(([e],[t])=>e.localeCompare(t));return(0,u.jsx)(`div`,{className:`resource-type-summary`,"aria-label":$.resourceTypeSummaryAriaLabel,title:$.resourceTypeSummaryTitle,children:r.map(([e,{pass:t,fail:n}])=>{let r=tt(e);return(0,u.jsxs)(`span`,{className:`resource-type-summary__item`,title:$.resourceTypeSummaryItemTitle(r),children:[(0,u.jsx)(`span`,{className:`resource-type-summary__type`,children:r}),t>0&&(0,u.jsxs)(`span`,{className:`resource-type-summary__pass`,children:[`✓`,t]}),n>0&&(0,u.jsxs)(`span`,{className:`resource-type-summary__fail`,children:[`✗`,n]})]},e)})})}function zy({treeRows:e,filteredResources:t,totalResources:n,matchedResources:r,explorerMode:i,setExplorerMode:a,status:o,setStatus:s,availableResourceTypes:l,activeResourceTypes:d,toggleResourceType:f,availableMaterializationKinds:p,activeMaterializationKinds:m,toggleMaterializationKind:h,resourceQuery:g,setResourceQuery:_,selectedResourceId:v,expandedNodeIds:y,toggleExpandedNode:b,setSelectedResourceId:x}){let[S,C]=(0,c.useState)(jy),w=e=>{C(e);try{window.localStorage.setItem(Ay,String(e))}catch{}},T=(g.trim()?1:0)+(o===`all`?0:1)+(d.size>0?1:0)+(m.size>0?1:0),E=T>0?`${T} active`:`Search, status, and type`;return(0,u.jsxs)(`aside`,{className:`explorer-pane`,children:[(0,u.jsxs)(`div`,{className:`explorer-pane__header`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`p`,{className:`eyebrow`,children:`Asset explorer`}),(0,u.jsx)(`h2`,{children:`Workspace inventory`})]}),(0,u.jsxs)(`div`,{className:`explorer-pane__count`,children:[r,r!==n&&(0,u.jsxs)(`span`,{className:`explorer-pane__count-subtext`,children:[`of `,n]})]})]}),(0,u.jsx)(`div`,{className:`explorer-mode-tabs`,role:`tablist`,"aria-label":`Explorer modes`,children:[`project`,`database`].map(e=>(0,u.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":i===e,className:i===e?`explorer-mode-tab explorer-mode-tab--active`:`explorer-mode-tab`,onClick:()=>a(e),children:[(0,u.jsx)(`span`,{className:`explorer-mode-tab__icon`,"aria-hidden":`true`,children:(0,u.jsx)(Ly,{mode:e})}),Qe[e]]},e))}),(0,u.jsx)(My,{filtersExpanded:S,setFiltersExpandedPersisted:w,activeFilterCount:T,filterSummary:E,resourceQuery:g,setResourceQuery:_,status:o,setStatus:s,availableResourceTypes:l,activeResourceTypes:d,toggleResourceType:f,availableMaterializationKinds:p,activeMaterializationKinds:m,toggleMaterializationKind:h}),(0,u.jsx)(Ry,{resources:t}),(0,u.jsx)(Iy,{treeRows:e,explorerMode:i,expandedNodeIds:y,toggleExpandedNode:b,selectedResourceId:v,setSelectedResourceId:x,treeEmptyDisplay:e.length===0?{headline:$.treeEmptyHeadline,subtext:ky({status:o,resourceQuery:g,activeResourceTypeCount:d.size,activeMaterializationKindCount:m.size})}:void 0})]})}function By(e,t,n,r,i,a,o){(0,c.useEffect)(()=>{if(e.length===0||a==null)return;let t=Aa(e,a);t.size!==0&&o(e=>[...t].filter(t=>!e.expandedNodeIds.has(t)).length===0?e:{...e,expandedNodeIds:new Set([...e.expandedNodeIds,...t])})},[e,o,a]),(0,c.useEffect)(()=>{if(i!==`project`||a!=null||e.length===0||n.size>0)return;let s=wa(r);t.has(s)&&o(e=>e.explorerMode!==`project`||e.selectedResourceId!=null||e.expandedNodeIds.has(s)?e:{...e,expandedNodeIds:new Set([...e.expandedNodeIds,s])})},[t,i,n.size,e.length,o,r,a])}function Vy(e){return e===`inventory`}function Hy({analysis:e,projectName:t,activeView:n,assetViewState:r,onAssetViewStateChange:i,onInvestigationSelectionChange:a}){let o=(0,c.useMemo)(()=>r.explorerMode!==`project`||t==null?e.resources:e.resources.filter(e=>gt(e,t)),[e.resources,r.explorerMode,t]),s=(0,c.useMemo)(()=>Array.from(new Set(o.map(e=>e.resourceType))).sort(),[o]),l=(0,c.useMemo)(()=>aa(o.map(e=>e.semantics)),[o]),d=(0,c.useMemo)(()=>fa(o,e.dependencyIndex),[e.dependencyIndex,o]),f=(0,c.useMemo)(()=>o.filter(e=>ut(e,r.status,d)&&dt(e,r.resourceTypes)&&ft(e,r.materializationKinds)&<(e,r.resourceQuery)),[r.materializationKinds,r.resourceQuery,r.resourceTypes,r.status,d,o]),p=(0,c.useMemo)(()=>Ta(f,r.explorerMode,t,e.dependencyIndex),[e.dependencyIndex,r.explorerMode,f,t]),m=(0,c.useMemo)(()=>Da(p),[p]),h=(0,c.useMemo)(()=>new Set([...r.expandedNodeIds].filter(e=>m.has(e))),[m,r.expandedNodeIds]),g=(0,c.useMemo)(()=>Ea(p,h),[h,p]),_=(0,c.useMemo)(()=>Oa(p),[p]),v=r.selectedResourceId;return By(p,m,h,t,r.explorerMode,v,i),{explorerPane:Vy(n)?(0,u.jsx)(zy,{treeRows:g,filteredResources:f,totalResources:o.length,matchedResources:_.length,explorerMode:r.explorerMode,setExplorerMode:e=>i(t=>({...t,explorerMode:e})),status:r.status,setStatus:e=>i(t=>({...t,status:e})),availableResourceTypes:s,activeResourceTypes:r.resourceTypes,toggleResourceType:e=>i(t=>{let n=new Set(t.resourceTypes);return n.has(e)?n.delete(e):n.add(e),{...t,resourceTypes:n}}),availableMaterializationKinds:l,activeMaterializationKinds:r.materializationKinds,toggleMaterializationKind:e=>i(t=>{let n=new Set(t.materializationKinds);return n.has(e)?n.delete(e):n.add(e),{...t,materializationKinds:n}}),resourceQuery:r.resourceQuery,setResourceQuery:e=>i(t=>({...t,resourceQuery:e})),selectedResourceId:v,expandedNodeIds:h,toggleExpandedNode:e=>i(t=>{let n=new Set(t.expandedNodeIds);return n.has(e)?n.delete(e):n.add(e),{...t,expandedNodeIds:n}}),setSelectedResourceId:e=>{i(t=>({...t,selectedResourceId:e})),a(t=>({...t,selectedResourceId:e,sourceLens:`inventory`}))}}):null}}function Uy({analysis:e,activeView:t,analysisSource:n,overviewFilters:r,onOverviewFiltersChange:i,timelineFilters:a,onTimelineFiltersChange:o,assetViewState:s,onAssetViewStateChange:c,runsViewState:l,onRunsViewStateChange:d,lineageViewState:f,onLineageViewStateChange:p,onInvestigationSelectionChange:m,onNavigateTo:h,workspaceSignals:g}){let _=e.projectName??ht(e.executions),{explorerPane:v}=Hy({analysis:e,projectName:_,activeView:t,assetViewState:s,onAssetViewStateChange:c,onInvestigationSelectionChange:m}),y=s.selectedResourceId,b=e.resources.find(e=>e.uniqueId===y)??null;return(0,u.jsxs)(`div`,{className:`workspace-layout${v?``:` workspace-layout--full`}`,children:[v,(0,u.jsxs)(`div`,{className:`workspace-main-panel`,children:[t===`health`&&(0,u.jsx)(sa,{analysis:e,projectName:_,analysisSource:n,filters:r,setFilters:i,workspaceSignals:g}),t===`inventory`&&(0,u.jsx)(Ug,{analysis:e,resource:b,onSelectResource:e=>c(t=>({...t,selectedResourceId:e})),assetViewState:{...s,selectedResourceId:y},onAssetViewStateChange:c,lineageViewState:f,onLineageViewStateChange:p,onInvestigationSelectionChange:m,onNavigateTo:h}),t===`runs`&&(0,u.jsx)(Ey,{analysis:e,runsViewState:l,onRunsViewStateChange:d,onInvestigationSelectionChange:m,onNavigateTo:h}),t===`timeline`&&(0,u.jsx)(ty,{analysis:e,filters:a,setFilters:o,onInvestigationSelectionChange:m})]})]})}var Wy=(0,c.createContext)({toast:()=>{}}),Gy=0,Ky=4e3;function qy({children:e}){let[t,n]=(0,c.useState)([]),r=(0,c.useCallback)((e,t=`neutral`)=>{let r=++Gy;n(n=>[...n,{id:r,message:e,tone:t}]),setTimeout(()=>{n(e=>e.filter(e=>e.id!==r))},Ky)},[]);function i(e){n(t=>t.filter(t=>t.id!==e))}return(0,u.jsxs)(Wy.Provider,{value:{toast:r},children:[e,t.length>0&&(0,u.jsx)(`div`,{className:`toast-portal`,role:`status`,"aria-live":`polite`,children:t.map(e=>(0,u.jsxs)(`div`,{className:`toast toast--${e.tone}`,children:[(0,u.jsx)(`span`,{className:`toast__dot`,"aria-hidden":`true`}),(0,u.jsx)(`span`,{className:`toast__message`,children:e.message}),(0,u.jsx)(`button`,{type:`button`,className:`toast__dismiss`,"aria-label":`Dismiss notification`,onClick:()=>i(e.id),children:`✕`})]},e.id))})]})}function Jy(){return(0,c.useContext)(Wy)}var Yy={manifest:`/api/manifest.json`,runResults:`/api/run_results.json`,catalog:`/api/catalog.json`,sources:`/api/sources.json`},Xy=[{manifest:`/api/artifacts/current/manifest.json`,runResults:`/api/artifacts/current/run_results.json`,catalog:`/api/artifacts/current/catalog.json`,sources:`/api/artifacts/current/sources.json`},Yy];function Zy(){return{checkedAtMs:Date.now(),remoteProvider:null,remoteLocation:null,pollIntervalMs:null,currentRun:null,pendingRun:null,supportsSwitch:!1,needsSelection:!1,candidates:void 0,discoveryError:null,sourceKind:null,locationDisplay:null,missingOptionalArtifacts:void 0}}function Qy(e,t,n){return{mode:e,currentSource:t,label:n,...Zy()}}async function $y(e){let t=await fetch(e);if(!t.ok)return null;let n=t.headers?.get?.(`content-type`)?.toLowerCase();return n!=null&&!n.includes(`application/json`)?null:t.arrayBuffer()}async function eb(e){try{return await $y(e)}catch{return null}}async function tb(e){try{return await $y(e)}catch{return null}}async function nb(e){let[t,n,r,i]=await Promise.all([eb(e.manifest),eb(e.runResults),tb(e.catalog),tb(e.sources)]);return t==null||n==null?null:{manifestBytes:t,runResultsBytes:n,...r==null?{}:{catalogBytes:r},...i==null?{}:{sourcesBytes:i}}}async function rb(e=Xy){for(let t of e){let e=await nb(t);if(e!=null)return e}return null}async function ib(){let e=await rb([Yy]);return e==null?null:C(e,`preload`)}async function ab(){let e=await ib();return{status:Qy(e==null?`none`:`preload`,e==null?null:`preload`,e==null?`Waiting for artifacts`:`Live target`),result:e}}async function ob(){let e=await fetch(`/api/artifact-source`);if(!e.ok)throw Error(`Failed to load artifact source status`);return await e.json()}async function sb(e=`preload`){let t=await rb();return t==null?null:C(t,e)}async function cb(){let e;try{e=await fetch(`/api/artifact-source`)}catch{return ab()}if(e.status===404||!e.ok)return ab();let t;try{t=await e.json()}catch{return ab()}return t.currentSource==null?{status:t,result:null}:{status:t,result:await sb(t.currentSource)}}async function lb(e){let t=await fetch(`/api/artifact-source/switch`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e?{runId:e}:{})});if(!t.ok)throw Error(`Failed to switch artifact source run`);return await t.json()}async function ub(e,t){let n=await fetch(`/api/artifact-source/discover`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({type:e,location:t})}),r=await n.json().catch(()=>({}));if(!n.ok){let e=typeof r.error==`string`&&r.error.trim()!==``?r.error:`Failed to configure artifact source`;throw Error(e)}return r}async function db(e,t,n){let r=await fetch(`/api/artifact-source/configure`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({type:e,location:t,...n!=null&&n.trim()!==``?{runId:n}:{}})}),i=await r.json().catch(()=>({}));if(!r.ok){let e=typeof i.error==`string`&&i.error.trim()!==``?i.error:`Failed to configure artifact source`;throw Error(e)}return i}function fb(e){return e===`local`?`/path/to/target or relative/path`:e===`s3`?`s3://bucket/prefix or bucket/prefix`:`gs://bucket/prefix or bucket/prefix`}function pb(e){let t=e.selectedRunId!=null&&e.selectedRunId.trim()!==``;return e.discoverLoading?`Scanning for artifact runs…`:e.discoveryError?e.discoveryError:e.candidateRunIds.length>0&&t?`Ready to load the workspace.`:e.candidateRunIds.length>1&&!t?`Pick a candidate set, then load.`:e.location.trim()===``?`Enter a location, then press Enter or move focus away to scan.`:e.candidateRunIds.length===0?`Press Enter or leave the Location field to scan for artifact runs.`:`Press Enter or leave the field to refresh the scan, then load.`}function mb(e){if(e.loadLoading)return`Loading artifact workspace…`;if(e.canLoad)return;if(e.discoverLoading)return`Scanning for artifact runs…`;if(e.discoveryError!=null)return e.discoveryError;if(e.location.trim()===``)return`Enter a path, then press Enter or leave the Location field to scan.`;if(e.candidateRunIds.length===0)return`Press Enter or blur Location to scan, then click Load workspace.`;let t=e.selectedRunId!=null&&e.selectedRunId.trim()!==``;return e.candidateRunIds.length>1&&!t?`Pick a candidate run, then click Load workspace.`:`Press Enter or blur Location to scan, then click Load workspace.`}function hb({readinessRegionId:e,readinessLabel:t,sourceKind:n,onSourceKindChange:r,location:i,onLocationChange:a,onLocationBlur:o,onLocationKeyDown:s,candidateRunIds:c,selectedRunId:l,onSelectRunId:d,discoverLoading:f,canLoad:p,loadLoading:m,loadWorkspaceHint:h,onLoadWorkspace:g}){return(0,u.jsxs)(`div`,{className:`upload-panel`,children:[(0,u.jsxs)(`div`,{className:`upload-panel__header`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`p`,{className:`eyebrow`,children:`Artifact source`}),(0,u.jsx)(`h3`,{children:`Configure directory or prefix`})]}),(0,u.jsx)(`span`,{id:e,className:`upload-panel__status`,role:`status`,children:f?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(Pg,{size:16}),` `,t]}):t})]}),(0,u.jsxs)(`div`,{className:`upload-panel__inputs artifact-load-panel__inputs`,children:[(0,u.jsxs)(`div`,{className:`file-input-card`,children:[(0,u.jsx)(`label`,{htmlFor:`artifact-source-kind`,children:`Source type`}),(0,u.jsxs)(`select`,{id:`artifact-source-kind`,value:n,onChange:e=>r(e.target.value),children:[(0,u.jsx)(`option`,{value:`local`,children:`Local directory`}),(0,u.jsx)(`option`,{value:`s3`,children:`Amazon S3`}),(0,u.jsx)(`option`,{value:`gcs`,children:`Google Cloud Storage`})]})]}),(0,u.jsxs)(`div`,{className:`file-input-card`,children:[(0,u.jsx)(`label`,{htmlFor:`artifact-location-input`,children:`Location`}),(0,u.jsx)(`input`,{id:`artifact-location-input`,type:`text`,autoComplete:`off`,placeholder:fb(n),value:i,onChange:e=>a(e.target.value),onBlur:o,onKeyDown:s})]}),c.length>0?(0,u.jsxs)(`fieldset`,{className:`file-input-card`,children:[(0,u.jsxs)(`legend`,{children:[`Candidate sets`,c.length>1?` — choose one before loading.`:null]}),c.map(e=>(0,u.jsxs)(`label`,{className:`artifact-load-panel__radio-row`,htmlFor:`artifact-run-${e}`,children:[(0,u.jsx)(`input`,{id:`artifact-run-${e}`,type:`radio`,name:`artifact-run`,value:e,checked:l===e,onChange:()=>d(e)}),(0,u.jsx)(`span`,{children:e})]},e))]}):null]}),(0,u.jsxs)(`div`,{className:`upload-panel__tips`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`strong`,{children:`Local paths`}),(0,u.jsxs)(`span`,{children:[`Resolved on the machine running the dev server or`,` `,(0,u.jsx)(`code`,{children:`dbt-tools-web`}),`, not in your browser.`]})]}),(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`strong`,{children:`S3 and GCS`}),(0,u.jsx)(`span`,{children:`Use default SDK credential chains on the server. UI never receives cloud keys.`})]})]}),(0,u.jsx)(`div`,{className:`artifact-load-panel__actions artifact-load-panel__actions--load-only`,children:(0,u.jsx)(`button`,{type:`button`,className:`primary-action`,disabled:!p||c.length===0||m,"aria-busy":m,"aria-describedby":e,title:h??void 0,onClick:()=>{g()},children:m?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(Pg,{size:16}),` Loading…`]}):`Load workspace`})})]})}var gb=[{title:`Health-first overview`,body:`Spot failing nodes, long-running bottlenecks, and critical-path pressure before opening individual assets.`},{title:`Catalog-style context`,body:`Browse lineage-adjacent metadata such as descriptions, packages, execution status, and dependency depth in one flow.`},{title:`Timeline investigation`,body:`Shift from summary to execution sequencing without leaving the workspace, inspired by dbt docs and observability tools.`}];function _b(){return(0,u.jsxs)(`div`,{className:`upload-hero__copy`,children:[(0,u.jsx)(`p`,{className:`eyebrow`,children:`Load artifacts`}),(0,u.jsx)(`h2`,{children:`Point the workspace at a directory or cloud prefix that contains dbt JSON artifacts.`}),(0,u.jsxs)(`p`,{children:[`The server discovers `,(0,u.jsx)(`code`,{children:`manifest.json`}),` and`,` `,(0,u.jsx)(`code`,{children:`run_results.json`}),` (required), plus optional`,` `,(0,u.jsx)(`code`,{children:`catalog.json`}),` and `,(0,u.jsx)(`code`,{children:`sources.json`}),`. Cloud access uses server-side credentials only.`]}),(0,u.jsxs)(`div`,{className:`upload-hero__callout`,children:[(0,u.jsx)(`span`,{className:`upload-hero__callout-badge`,children:`Layout`}),(0,u.jsx)(`strong`,{children:`Artifacts at the location root or one subdirectory deep.`}),(0,u.jsx)(`p`,{children:`Multiple complete pairs under the same location require an explicit choice—nothing is auto-picked when several candidates exist.`})]}),(0,u.jsx)(`div`,{className:`upload-feature-grid`,children:gb.map(e=>(0,u.jsxs)(`article`,{className:`upload-feature-card`,children:[(0,u.jsx)(`strong`,{children:e.title}),(0,u.jsx)(`p`,{children:e.body})]},e.title))})]})}function vb({onManagedLoad:e,onError:t}){let{toast:n}=Jy(),r=(0,c.useId)(),[i,a]=(0,c.useState)(`local`),[o,s]=(0,c.useState)(``),[l,d]=(0,c.useState)(!1),[f,p]=(0,c.useState)(!1),[m,h]=(0,c.useState)([]),[g,_]=(0,c.useState)(null),[v,y]=(0,c.useState)(null),b=(0,c.useRef)(o),x=(0,c.useRef)(i);b.current=o,x.current=i;let S=(0,c.useRef)(0),C=(0,c.useRef)(``),w=(0,c.useMemo)(()=>({discoverLoading:l,discoveryError:v,candidateRunIds:m,selectedRunId:g,location:o}),[m,l,v,o,g]),T=(0,c.useMemo)(()=>pb(w),[w]),E=m.length>0&&g!=null&&g.trim()!==``&&!f&&v==null,D=(0,c.useMemo)(()=>mb({...w,loadLoading:f,canLoad:E}),[E,f,w]),O=(0,c.useCallback)(async r=>{if(r.trim()===``){t(`Select a candidate artifact set.`);return}p(!0),t(null);try{let i=await db(x.current,b.current.trim(),r),a=i.currentSource;if(a!==`preload`&&a!==`remote`){t(`Artifacts are not ready to load.`);return}let o=i.missingOptionalArtifacts??{missingCatalog:!1,missingSources:!1};if(o.missingCatalog||o.missingSources){let e=[];o.missingCatalog&&e.push(`catalog.json`),o.missingSources&&e.push(`sources.json`),n(`Optional artifacts not loaded: ${e.join(`, `)}. Related inventory panels may be limited.`,`positive`)}let s=await sb(a);if(s==null){t(`Could not read artifact bytes from the server.`);return}e(s,a,o)}catch(e){let r=e instanceof Error?e.message:`Failed to load artifacts.`;t(r),n(r,`danger`)}finally{p(!1)}},[t,e,n]),k=(0,c.useCallback)(async e=>{let n=x.current,r=b.current.trim(),i=`${n}|${r}`;if(r===``){t(`Enter a directory or bucket prefix.`);return}if(!e&&i===C.current)return;let a=++S.current;d(!0),t(null),y(null),h([]),_(null);try{let e=await ub(n,r);if(a!==S.current)return;if(e.discoveryError!=null){y(e.discoveryError),t(e.discoveryError);return}let o=e.candidates?.map(e=>e.runId)??[],s=e.needsSelection===!0;h(o),o.length===1?_(o[0]):o.length>1&&_(null),C.current=i,o.length===1&&!s&&await O(o[0])}catch(e){if(a!==S.current)return;let n=e instanceof Error?e.message:`Discovery failed.`;y(n),t(n)}finally{a===S.current&&d(!1)}},[O,t]);async function A(){if(g==null||g.trim()===``){t(`Select a candidate artifact set.`);return}await O(g)}return(0,u.jsxs)(`section`,{className:`upload-hero`,children:[(0,u.jsx)(_b,{}),(0,u.jsx)(hb,{readinessRegionId:r,readinessLabel:T,sourceKind:i,onSourceKindChange:e=>{a(e),h([]),_(null),y(null),C.current=``,t(null)},location:o,onLocationChange:s,onLocationBlur:()=>{b.current.trim()!==``&&k(!1)},onLocationKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),k(!1))},candidateRunIds:m,selectedRunId:g,onSelectRunId:_,discoverLoading:l,canLoad:E,loadLoading:f,loadWorkspaceHint:D,onLoadWorkspace:()=>{A()}})]})}function yb({className:e,style:t}){return(0,u.jsx)(`div`,{className:[`skeleton`,e].filter(Boolean).join(` `),style:t,"aria-hidden":`true`})}function bb(){return(0,u.jsxs)(`div`,{className:`loading-card`,children:[(0,u.jsx)(yb,{className:`loading-card__skeleton-icon`}),(0,u.jsxs)(`div`,{children:[(0,u.jsx)(yb,{className:`loading-card__skeleton-title`}),(0,u.jsx)(yb,{className:`loading-card__skeleton-body`})]})]})}var xb=`workspace-pill workspace-pill--active`,Sb=`workspace-pill`;function Cb(e){return e?xb:Sb}function wb({open:e,onClose:t,returnFocusRef:n,onManagedAnalysisLoaded:r,onError:i}){let a=(0,c.useRef)(null),o=(0,c.useRef)(!1);return(0,c.useEffect)(()=>{if(!e){o.current&&n.current?.focus(),o.current=!1;return}o.current=!0,a.current?.focus();let r=e=>{e.key===`Escape`&&(e.preventDefault(),t())};document.addEventListener(`keydown`,r);let i=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.removeEventListener(`keydown`,r),document.body.style.overflow=i}},[e,t,n]),e?(0,u.jsxs)(`div`,{className:`settings-artifact-dialog`,"aria-hidden":!1,children:[(0,u.jsx)(`button`,{type:`button`,className:`settings-artifact-dialog__backdrop`,"aria-label":`Close change location dialog`,onClick:()=>{i(null),t()}}),(0,u.jsxs)(`div`,{ref:a,className:`settings-artifact-dialog__panel`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`settings-artifact-dialog-title`,tabIndex:-1,children:[(0,u.jsxs)(`header`,{className:`settings-artifact-dialog__header`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`p`,{className:`eyebrow`,children:`Artifacts`}),(0,u.jsx)(`h2`,{id:`settings-artifact-dialog-title`,children:`Change artifact location`}),(0,u.jsx)(`p`,{className:`settings-artifact-dialog__lede`,children:`Use the same directory or cloud prefix flow as the main workspace load screen. Credentials stay on the server.`})]}),(0,u.jsx)(`button`,{type:`button`,className:`settings-artifact-dialog__close`,"aria-label":`Close`,onClick:()=>{i(null),t()},children:(0,u.jsx)(`span`,{"aria-hidden":`true`,children:`×`})})]}),(0,u.jsx)(`div`,{className:`settings-artifact-dialog__body`,children:(0,u.jsx)(vb,{onManagedLoad:r,onError:i})})]})]}):null}function Tb({analysisSource:e,executionCount:t}){return(0,u.jsxs)(`section`,{className:`settings-hero`,"aria-label":`Workspace preferences`,children:[(0,u.jsx)(`p`,{className:`eyebrow`,children:`Workspace profile`}),(0,u.jsx)(`h3`,{children:`Configure how this console looks and behaves by default.`}),(0,u.jsx)(`p`,{children:`Changes save locally and apply to the current workspace immediately when the relevant view is open.`}),(0,u.jsxs)(`div`,{className:`settings-chip-row`,children:[(0,u.jsx)(`span`,{className:`app-badge`,children:j(e)}),(0,u.jsx)(`span`,{className:`settings-chip`,children:t==null?`No artifacts loaded`:`${t} executions loaded`})]})]})}function Eb({themePreference:e,onThemeChange:t}){return(0,u.jsx)(qt,{title:`Appearance`,subtitle:`Choose how the workspace chrome should render by default.`,children:(0,u.jsxs)(`div`,{className:`settings-field-group`,children:[(0,u.jsx)(`span`,{className:`settings-field-label`,children:`Theme`}),(0,u.jsx)(`div`,{className:`settings-segmented`,children:[`system`,`light`,`dark`].map(n=>(0,u.jsx)(`button`,{type:`button`,className:Cb(e===n),onClick:()=>t(n),children:n===`system`?`System`:n.charAt(0).toUpperCase()+n.slice(1)},n))})]})})}function Db({analysisSource:e,executionCount:t,artifactLocationSnapshot:n,onOpenChangeLocation:r,changeLocationTriggerRef:i,pendingRemoteRun:a,acceptingRemoteRun:o,onAcceptPendingRemoteRun:s}){let c=A(n?.sourceKind),l=n?.locationDisplay!=null&&n.locationDisplay.trim()!==``?n.locationDisplay:null;return(0,u.jsx)(qt,{title:`Session`,subtitle:`Current artifact source and data-loading controls.`,children:(0,u.jsxs)(`div`,{className:`settings-stack`,children:[(0,u.jsxs)(`div`,{className:`settings-readout`,children:[(0,u.jsx)(`span`,{className:`settings-field-label`,children:`Current source`}),(0,u.jsx)(`strong`,{children:j(e)}),(0,u.jsx)(`p`,{children:t==null?`Load artifacts to unlock analysis views.`:`${t} executions are available in this session.`})]}),(0,u.jsxs)(`div`,{className:`settings-readout`,children:[(0,u.jsx)(`span`,{className:`settings-field-label`,children:`Configured location`}),l==null?c==null?(0,u.jsx)(`p`,{className:`settings-readout-muted`,children:`Nothing configured yet. Use Change location… to open the load wizard and point this session at a directory or cloud prefix.`}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`strong`,{children:c}),(0,u.jsx)(`p`,{className:`settings-readout-muted`,children:`Path label was not returned for this session.`})]}):(0,u.jsxs)(u.Fragment,{children:[c==null?null:(0,u.jsx)(`strong`,{children:c}),(0,u.jsx)(`p`,{className:`settings-mono-path settings-session__path`,title:l,children:l})]})]}),(0,u.jsx)(`div`,{className:`settings-session__actions`,children:(0,u.jsx)(`button`,{ref:i,type:`button`,className:`primary-action settings-primary-action`,onClick:r,children:`Change location…`})}),a&&(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:()=>void s(),disabled:o,children:o?`Switching…`:`Load ${a.label}`})]})})}function Ob({preferences:e,setPreferences:t}){return(0,u.jsx)(qt,{title:`Shell Defaults`,subtitle:`Control the default shape of the workspace chrome.`,children:(0,u.jsxs)(`div`,{className:`settings-field-group`,children:[(0,u.jsx)(`span`,{className:`settings-field-label`,children:`Sidebar`}),(0,u.jsxs)(`div`,{className:`settings-segmented`,children:[(0,u.jsx)(`button`,{type:`button`,className:Cb(!e.sidebarCollapsedDefault),onClick:()=>t(e=>({...e,sidebarCollapsedDefault:!1})),children:`Expanded`}),(0,u.jsx)(`button`,{type:`button`,className:Cb(e.sidebarCollapsedDefault),onClick:()=>t(e=>({...e,sidebarCollapsedDefault:!0})),children:`Collapsed`})]})]})})}function kb({preferences:e,setPreferences:t}){return(0,u.jsx)(qt,{title:`Timeline Defaults`,subtitle:`Set the default execution timeline filters and dependency focus.`,children:(0,u.jsxs)(`div`,{className:`settings-stack`,children:[(0,u.jsxs)(`div`,{className:`settings-inline-grid`,children:[(0,u.jsxs)(`label`,{className:`settings-toggle`,children:[(0,u.jsx)(`input`,{type:`checkbox`,checked:e.timelineDefaults.showTests,onChange:e=>t(t=>({...t,timelineDefaults:{...t.timelineDefaults,showTests:e.target.checked}}))}),(0,u.jsx)(`span`,{children:`Show tests by default`})]}),(0,u.jsxs)(`label`,{className:`settings-toggle`,children:[(0,u.jsx)(`input`,{type:`checkbox`,checked:e.timelineDefaults.failuresOnly,onChange:e=>t(t=>({...t,timelineDefaults:{...t.timelineDefaults,failuresOnly:e.target.checked}}))}),(0,u.jsx)(`span`,{children:`Start with failures-only emphasis`})]})]}),(0,u.jsxs)(`div`,{className:`settings-inline-grid`,children:[(0,u.jsxs)(`label`,{className:`settings-field`,children:[(0,u.jsx)(`span`,{className:`settings-field-label`,children:`Dependency direction`}),(0,u.jsxs)(`select`,{value:e.timelineDefaults.dependencyDirection,onChange:e=>t(t=>({...t,timelineDefaults:{...t.timelineDefaults,dependencyDirection:e.target.value}})),children:[(0,u.jsx)(`option`,{value:`upstream`,children:`Upstream`}),(0,u.jsx)(`option`,{value:`both`,children:`Both`}),(0,u.jsx)(`option`,{value:`downstream`,children:`Downstream`})]})]}),(0,u.jsxs)(`label`,{className:`settings-field`,children:[(0,u.jsx)(`span`,{className:`settings-field-label`,children:`Dependency depth`}),(0,u.jsx)(`input`,{type:`number`,min:`1`,max:`10`,value:e.timelineDefaults.dependencyDepthHops,onChange:e=>t(t=>({...t,timelineDefaults:{...t.timelineDefaults,dependencyDepthHops:Math.max(1,Math.min(10,Number(e.target.value)||1))}}))})]})]})]})})}function Ab({preferences:e,setPreferences:t}){return(0,u.jsx)(qt,{title:`Inventory Defaults`,subtitle:`Choose how asset exploration and lineage open by default.`,children:(0,u.jsxs)(`div`,{className:`settings-stack`,children:[(0,u.jsxs)(`div`,{className:`settings-inline-grid`,children:[(0,u.jsxs)(`label`,{className:`settings-field`,children:[(0,u.jsx)(`span`,{className:`settings-field-label`,children:`Explorer mode`}),(0,u.jsxs)(`select`,{value:e.inventoryDefaults.explorerMode,onChange:e=>t(t=>({...t,inventoryDefaults:{...t.inventoryDefaults,explorerMode:e.target.value}})),children:[(0,u.jsx)(`option`,{value:`project`,children:`Project`}),(0,u.jsx)(`option`,{value:`database`,children:`Database`})]})]}),(0,u.jsxs)(`label`,{className:`settings-field`,children:[(0,u.jsx)(`span`,{className:`settings-field-label`,children:`Lineage lens`}),(0,u.jsxs)(`select`,{value:e.inventoryDefaults.lineageLensMode,onChange:e=>t(t=>({...t,inventoryDefaults:{...t.inventoryDefaults,lineageLensMode:e.target.value}})),children:[(0,u.jsx)(`option`,{value:`type`,children:`Type`}),(0,u.jsx)(`option`,{value:`status`,children:`Status`}),(0,u.jsx)(`option`,{value:`coverage`,children:`Coverage`})]})]})]}),(0,u.jsxs)(`div`,{className:`settings-inline-grid`,children:[(0,u.jsxs)(`label`,{className:`settings-field`,children:[(0,u.jsx)(`span`,{className:`settings-field-label`,children:`Upstream depth`}),(0,u.jsx)(`input`,{type:`number`,min:`1`,max:`10`,value:e.inventoryDefaults.lineageUpstreamDepth,onChange:e=>t(t=>({...t,inventoryDefaults:{...t.inventoryDefaults,lineageUpstreamDepth:Math.max(1,Math.min(10,Number(e.target.value)||1))}}))})]}),(0,u.jsxs)(`label`,{className:`settings-field`,children:[(0,u.jsx)(`span`,{className:`settings-field-label`,children:`Downstream depth`}),(0,u.jsx)(`input`,{type:`number`,min:`1`,max:`10`,value:e.inventoryDefaults.lineageDownstreamDepth,onChange:e=>t(t=>({...t,inventoryDefaults:{...t.inventoryDefaults,lineageDownstreamDepth:Math.max(1,Math.min(10,Number(e.target.value)||1))}}))})]})]}),(0,u.jsxs)(`label`,{className:`settings-toggle`,children:[(0,u.jsx)(`input`,{type:`checkbox`,checked:e.inventoryDefaults.allDepsMode,onChange:e=>t(t=>({...t,inventoryDefaults:{...t.inventoryDefaults,allDepsMode:e.target.checked}}))}),(0,u.jsx)(`span`,{children:`Open lineage with all dependencies expanded`})]})]})})}function jb({preferences:e,setPreferences:t,themePreference:n,setThemePreference:r,analysisSource:i,artifactLocationSnapshot:a,executionCount:o,onManagedAnalysisLoaded:s,onError:l,pendingRemoteRun:d,acceptingRemoteRun:f,onAcceptPendingRemoteRun:p}){let[m,h]=(0,c.useState)(!1),g=(0,c.useRef)(null),_=(0,c.useCallback)((e,t,n)=>{h(!1),s(e,t,n)},[s]);return(0,u.jsxs)(Zt,{title:`Settings`,description:`Workspace defaults, visual preferences, and session controls.`,className:`settings-view`,children:[(0,u.jsx)(wb,{open:m,onClose:()=>{l(null),h(!1)},returnFocusRef:g,onManagedAnalysisLoaded:_,onError:l}),(0,u.jsxs)(`div`,{className:`settings-grid`,children:[(0,u.jsx)(Tb,{analysisSource:i,executionCount:o}),(0,u.jsx)(Eb,{themePreference:n,onThemeChange:e=>{r(e),t(t=>({...t,theme:e}))}}),(0,u.jsx)(Db,{analysisSource:i,executionCount:o,artifactLocationSnapshot:a,onOpenChangeLocation:()=>h(!0),changeLocationTriggerRef:g,pendingRemoteRun:d,acceptingRemoteRun:f,onAcceptPendingRemoteRun:p}),(0,u.jsx)(Ob,{preferences:e,setPreferences:t}),(0,u.jsx)(kb,{preferences:e,setPreferences:t}),(0,u.jsx)(Ab,{preferences:e,setPreferences:t})]})]})}function Mb({kind:e}){let t={fill:`none`,stroke:`currentColor`,strokeWidth:1.8,strokeLinecap:`round`,strokeLinejoin:`round`};return e===`invocation`?(0,u.jsxs)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,u.jsx)(`path`,{...t,d:`M20 12.5V7a2 2 0 0 0-2-2h-6.2a2 2 0 0 0-1.4.58l-4.82 4.82A2 2 0 0 0 5 11.82V17a2 2 0 0 0 2 2h5.5`}),(0,u.jsx)(`path`,{...t,d:`M9 5v4a2 2 0 0 1-2 2H5`}),(0,u.jsx)(`circle`,{...t,cx:`17.5`,cy:`17.5`,r:`3.5`})]}):e===`time`?(0,u.jsxs)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,u.jsx)(`circle`,{...t,cx:`12`,cy:`12`,r:`8`}),(0,u.jsx)(`path`,{...t,d:`M12 7.8v4.6l3 1.8`})]}):e===`project`?(0,u.jsx)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,u.jsx)(`path`,{...t,d:`M3.5 8.5a2 2 0 0 1 2-2h3l1.4 1.7h8.6a2 2 0 0 1 2 2v7.5a2 2 0 0 1-2 2h-13a2 2 0 0 1-2-2z`})}):(0,u.jsxs)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,u.jsx)(`path`,{...t,d:`M11.25 4.75 5.5 7.7v4.55c0 3.65 2.7 6.95 6.5 7.95 3.8-1 6.5-4.3 6.5-7.95V7.7z`}),(0,u.jsx)(`path`,{...t,d:`M9.4 12.15 11.2 14l3.35-3.45`})]})}function Nb(e,t){let n=e?.projectName??null,r=e?.invocationId??null,i=e?.warehouseType??null,a=e?at(e):null,o=a==null?null:it(a);return{label:n??`Workspace session`,subtitle:n==null&&r==null&&o==null?`Load artifacts to populate session details.`:null,summaryItems:[r?{key:`invocation`,label:`Invocation ID`,value:r,icon:`invocation`}:null,o?{key:`timestamp`,label:`Timestamp`,value:o,icon:`time`}:null,{key:`source`,label:`Source mode`,value:j(t),icon:`source`},i?{key:`warehouse`,label:`Warehouse type`,value:i.charAt(0).toUpperCase()+i.slice(1),icon:`project`}:null].filter(e=>e!=null)}}function Pb({summaryItems:e}){return(0,u.jsx)(`div`,{className:`app-header__summary-grid`,"aria-label":`Session metadata`,children:e.map(e=>(0,u.jsxs)(`div`,{className:`app-header__summary-item`,children:[(0,u.jsx)(`span`,{className:`app-header__summary-icon`,children:(0,u.jsx)(Mb,{kind:e.icon})}),(0,u.jsxs)(`span`,{className:`app-header__summary-copy`,children:[(0,u.jsx)(`span`,{className:`app-header__summary-label`,children:e.label}),(0,u.jsx)(`strong`,{className:`app-header__summary-value`,children:e.value})]})]},e.key))})}function Fb({header:e}){return(0,u.jsxs)(`div`,{className:`app-header__identity`,children:[(0,u.jsx)(`p`,{className:`eyebrow`,title:e.label,children:e.label}),e.subtitle?(0,u.jsx)(`p`,{className:`app-header__subheadline`,children:e.subtitle}):null,(0,u.jsx)(Pb,{summaryItems:e.summaryItems})]})}function Ib({analysis:e,searchState:t,setSearchState:n,omniboxResults:r,handleNavigateTo:i}){let a=t.query.trim().length>0;return(0,u.jsxs)(`div`,{className:`app-header__omnibox`,children:[(0,u.jsx)(`label`,{className:`app-header__search-control`,children:(0,u.jsxs)(`div`,{className:`app-header__search-shell`,children:[(0,u.jsxs)(`svg`,{className:`workspace-search__icon`,viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,u.jsx)(`circle`,{cx:`11`,cy:`11`,r:`6.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`}),(0,u.jsx)(`path`,{d:`M16 16l4 4`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`})]}),(0,u.jsx)(`input`,{value:t.query,onFocus:()=>n(e=>({...e,isOpen:!0})),onChange:e=>n(t=>({...t,query:e.target.value,isOpen:!0})),placeholder:`Search runs, pipelines, assets...`,"aria-label":`Global search`})]})}),t.isOpen&&e&&(0,u.jsx)(`div`,{className:`omnibox-results`,children:r.loading&&a?(0,u.jsx)(`div`,{className:`omnibox-results__empty`,children:`Searching…`}):r.results.length>0?r.results.map(e=>(0,u.jsxs)(`button`,{type:`button`,className:`omnibox-results__item`,onClick:()=>{n(t=>({...t,isOpen:!1,recentResourceIds:[e.uniqueId,...t.recentResourceIds.filter(t=>t!==e.uniqueId)].slice(0,8)})),i(`inventory`,{resourceId:e.uniqueId,assetTab:`summary`})},children:[(0,u.jsx)(`strong`,{children:e.name}),(0,u.jsx)(`span`,{children:e.resourceType})]},e.uniqueId)):(0,u.jsx)(`div`,{className:`omnibox-results__empty`,children:a?`No matching resources`:`Recent items will appear here`})})]})}function Lb({activeView:e,analysis:t,analysisSource:n,artifactLocationSnapshot:r,preloadLoading:i,pendingRemoteRun:a,acceptingRemoteRun:o,preferences:s,setPreferences:c,themePreference:l,setThemePreference:d,onManagedAnalysisLoaded:f,onError:p,onAcceptPendingRemoteRun:m,workspaceSignals:h,overviewFilters:g,setOverviewFilters:_,timelineFilters:v,setTimelineFilters:y,assetViewState:b,setAssetViewState:x,runsViewState:S,setRunsViewState:C,lineageViewState:w,setLineageViewState:T,setInvestigationSelection:E,handleNavigateTo:D}){return e===`settings`?(0,u.jsx)(jb,{preferences:s,setPreferences:c,themePreference:l,setThemePreference:d,analysisSource:n,artifactLocationSnapshot:r,executionCount:t?.summary.total_nodes??null,onManagedAnalysisLoaded:f,onError:p,pendingRemoteRun:a,acceptingRemoteRun:o,onAcceptPendingRemoteRun:m}):t?(0,u.jsx)(Uy,{analysis:t,activeView:e,analysisSource:n,overviewFilters:g,onOverviewFiltersChange:_,timelineFilters:v,onTimelineFiltersChange:y,assetViewState:b,onAssetViewStateChange:x,runsViewState:S,onRunsViewStateChange:C,lineageViewState:w,onLineageViewStateChange:T,onInvestigationSelectionChange:E,onNavigateTo:D,workspaceSignals:h}):i?(0,u.jsx)(bb,{}):(0,u.jsx)(vb,{onManagedLoad:f,onError:p})}function Rb({workspace:e,analysis:t,analysisSource:n,artifactLocationSnapshot:r,error:i,preloadLoading:a,pendingRemoteRun:o,acceptingRemoteRun:s,onManagedAnalysisLoaded:c,onError:l,onAcceptPendingRemoteRun:f,themePreference:p,setThemePreference:m,preferences:h,setPreferences:g,workspaceSignals:_}){let{activeView:v,sidebarCollapsed:y,setSidebarCollapsed:b,sidebarOpen:x,setSidebarOpen:S,overviewFilters:C,setOverviewFilters:w,timelineFilters:T,setTimelineFilters:E,assetViewState:D,setAssetViewState:k,runsViewState:A,setRunsViewState:j,lineageViewState:M,setLineageViewState:N,searchState:P,setSearchState:ee,setInvestigationSelection:F,setNavigationTarget:te,handleNavigateTo:ne,frameClass:re}=e,ie=O(t,P),ae=Nb(t,n);return(0,u.jsxs)(`div`,{className:re,children:[x&&(0,u.jsx)(`div`,{className:`sidebar-backdrop`,role:`presentation`,onClick:()=>S(!1)}),(0,u.jsx)(xe,{activeView:v,setNavigationTarget:te,sidebarCollapsed:y,setSidebarCollapsed:b,onNavigate:()=>S(!1),analysis:t,analysisSource:n}),(0,u.jsxs)(`main`,{className:`app-main`,children:[(0,u.jsxs)(`header`,{className:`app-header app-header--workspace`,children:[(0,u.jsx)(`button`,{type:`button`,className:`hamburger-btn`,"aria-label":`Open navigation`,"aria-expanded":x,"aria-controls":`app-sidebar`,onClick:()=>S(!0),children:(0,u.jsx)(`span`,{"aria-hidden":`true`,children:`☰`})}),(0,u.jsx)(Fb,{header:ae}),(0,u.jsx)(Ib,{analysis:t,searchState:P,setSearchState:ee,omniboxResults:ie,handleNavigateTo:ne})]}),i&&(0,u.jsx)(d,{message:i}),(0,u.jsx)(Se,{pendingRemoteRun:o,acceptingRemoteRun:s,onAcceptPendingRemoteRun:f}),(0,u.jsx)(Lb,{activeView:v,analysis:t,analysisSource:n,artifactLocationSnapshot:r,preloadLoading:a,pendingRemoteRun:o,acceptingRemoteRun:s,preferences:h,setPreferences:g,themePreference:p,setThemePreference:m,onManagedAnalysisLoaded:c,onError:l,onAcceptPendingRemoteRun:f,workspaceSignals:_,overviewFilters:C,setOverviewFilters:w,timelineFilters:T,setTimelineFilters:E,assetViewState:D,setAssetViewState:k,runsViewState:A,setRunsViewState:j,lineageViewState:M,setLineageViewState:N,setInvestigationSelection:F,handleNavigateTo:ne})]})]})}function zb(e,t,n){return t===`preload`?{value:`Live target`,detail:`Synced from DBT_TOOLS_TARGET_DIR with ${e.graphSummary.totalEdges} dependency edges ready for investigation.`}:t===`remote`?{value:`Remote source`,detail:`Managed from remote object storage with ${e.graphSummary.totalEdges} dependency edges ready for investigation.`}:{value:`Artifact upload`,detail:`${e.summary.total_nodes} executions loaded from local artifacts${n>0?`, including ${n} tests`:``}.`}}function Bb(e,t){let n=e.executions.filter(e=>e.statusTone===`danger`).length,r=e.executions.filter(e=>e.statusTone===`warning`).length,i=e.executions.filter(e=>[`test`,`unit_test`].includes(e.resourceType)).length,a=e.resources.filter(e=>!!e.description?.trim()).length,o=e.resources.length>0?Math.round(a/e.resources.length*100):0,s=zb(e,t,i);return[{label:`Run posture`,value:n>0?`${n} failing`:r>0?`${r} warning`:`Healthy`,detail:n>0?`Prioritize failing nodes before reviewing downstream impact.`:r>0?`Warnings detected; review tests and exposures next.`:`No failing nodes surfaced in this run.`,tone:n>0?`danger`:r>0?`warning`:`positive`},{label:`Metadata coverage`,value:`${o}%`,detail:`${a} of ${e.resources.length} resources include descriptions for catalog-style discovery.`,tone:o>=70?`positive`:o>=35?`warning`:`neutral`},{label:`Workspace mode`,value:s.value,detail:s.detail,tone:`neutral`}]}function Vb({setPreloadLoading:e,setAnalysis:t,setAnalysisSource:n,setPendingRemoteRun:r,setRemotePollIntervalMs:i,setError:a,pendingMetricsRef:o,setArtifactCapability:s,onArtifactSourceStatus:l}){let u=(0,c.useRef)(!1);(0,c.useEffect)(()=>{u.current||(u.current=!0,p(`Preload: fetching current managed artifacts`),cb().then(({result:c,status:u})=>{e(!1),r(u.pendingRun),i(u.pollIntervalMs),l?.(u),c?(p(`Preload: success, analysis loaded`),o.current=c.metrics,t(c.analysis),n(u.currentSource),a(null),s(u.missingOptionalArtifacts??{missingCatalog:!1,missingSources:!1})):(n(u.currentSource),s({missingCatalog:!1,missingSources:!1}))}).catch(t=>{e(!1),p(`Preload: error`,t),a(t instanceof Error?t.message:`Failed to load artifacts from server`)}))},[o,e,t,n,r,i,a,s,l])}function Hb(e,t,n,r){(0,c.useEffect)(()=>{},[e,r,t,n])}function Ub(e,t,n,r,i){(0,c.useEffect)(()=>{if(e!==`remote`){t(null),n(null);return}let a=!1,o=async()=>{try{let e=await ob();a||(t(e.pendingRun),n(e.pollIntervalMs),i?.(e))}catch(e){p(`Artifact source poll failed`,e)}};o();let s=window.setInterval(()=>{o()},r??3e4);return()=>{a=!0,window.clearInterval(s)}},[e,r,t,n,i])}function Wb(){let[e,t]=(0,c.useState)(null),[n,r]=(0,c.useState)(null),[i,a]=(0,c.useState)(null),[o,s]=(0,c.useState)(!0),[l,u]=(0,c.useState)(null),[d,f]=(0,c.useState)(!1),[g,_]=(0,c.useState)(null),[v,y]=(0,c.useState)({missingCatalog:!1,missingSources:!1}),[b,x]=(0,c.useState)(null),S=(0,c.useRef)(null),C=(0,c.useCallback)(e=>{x(t=>{let n=k(e);return n==null&&t==null||n!=null&&t!=null&&n.sourceKind===t.sourceKind&&n.locationDisplay===t.locationDisplay?t:n})},[]);return Vb({setPreloadLoading:s,setAnalysis:t,setAnalysisSource:a,setPendingRemoteRun:u,setRemotePollIntervalMs:_,setError:r,pendingMetricsRef:S,setArtifactCapability:y,onArtifactSourceStatus:C}),Hb(i,t,r,S),Ub(i,u,_,g,C),(0,c.useEffect)(()=>{if(e==null||S.current==null)return;let t=S.current;S.current=null,requestAnimationFrame(()=>{let e=`analysis-load:${t.requestId}:interactive`,n=`analysis-load:${t.requestId}:first-interactive-frame`;m(e),h(n,t.dispatchMarkName,e),p(`Analysis load metrics`,{requestId:t.requestId,source:t.source,timings:t.timings})})},[e]),{analysis:e,analysisSource:i,artifactLocationSnapshot:b,artifactCapability:v,error:n,preloadLoading:o,pendingRemoteRun:l,acceptingRemoteRun:d,onLoadDifferent:()=>{t(null),a(null),u(null),_(null),r(null),x(null),y({missingCatalog:!1,missingSources:!1})},onManagedAnalysisLoaded:(e,n,r)=>{S.current=e.metrics,a(n),u(null),t(e.analysis),y(r),ob().then(C).catch(()=>{})},onError:r,onAcceptPendingRemoteRun:async()=>{if(l!=null){f(!0);try{let e=await lb(l.runId),n=await sb(`remote`);n!=null&&(S.current=n.metrics,t(n.analysis),a(e.currentSource),_(e.pollIntervalMs),r(null),y(e.missingOptionalArtifacts??{missingCatalog:!1,missingSources:!1})),u(e.pendingRun),C(e)}catch(e){r(e instanceof Error?e.message:`Failed to switch remote artifact run`)}finally{f(!1)}}}}}var Gb=`dbt-tools.workspacePreferences`,Kb={theme:`system`,sidebarCollapsedDefault:!0,timelineDefaults:{showTests:!1,failuresOnly:!1,dependencyDirection:`both`,dependencyDepthHops:2},inventoryDefaults:{explorerMode:`project`,lineageLensMode:`type`,lineageUpstreamDepth:2,lineageDownstreamDepth:2,allDepsMode:!1}};function qb(e,t){return typeof e!=`number`||!Number.isFinite(e)?t:Math.max(1,Math.min(10,Math.round(e)))}function Jb(e){return e===`upstream`||e===`both`||e===`downstream`}function Yb(e){return e===`project`||e===`database`}function Xb(e){return e===`status`||e===`type`||e===`coverage`}function Zb(e){return e===`light`||e===`dark`||e===`system`}function Qb(e){if(!e)return Kb;try{let t=JSON.parse(e);return{theme:Zb(t.theme)?t.theme:Kb.theme,sidebarCollapsedDefault:typeof t.sidebarCollapsedDefault==`boolean`?t.sidebarCollapsedDefault:Kb.sidebarCollapsedDefault,timelineDefaults:{showTests:typeof t.timelineDefaults?.showTests==`boolean`?t.timelineDefaults.showTests:Kb.timelineDefaults.showTests,failuresOnly:typeof t.timelineDefaults?.failuresOnly==`boolean`?t.timelineDefaults.failuresOnly:Kb.timelineDefaults.failuresOnly,dependencyDirection:Jb(t.timelineDefaults?.dependencyDirection)?t.timelineDefaults.dependencyDirection:Kb.timelineDefaults.dependencyDirection,dependencyDepthHops:qb(t.timelineDefaults?.dependencyDepthHops,Kb.timelineDefaults.dependencyDepthHops)},inventoryDefaults:{explorerMode:Yb(t.inventoryDefaults?.explorerMode)?t.inventoryDefaults.explorerMode:Kb.inventoryDefaults.explorerMode,lineageLensMode:Xb(t.inventoryDefaults?.lineageLensMode)?t.inventoryDefaults.lineageLensMode:Kb.inventoryDefaults.lineageLensMode,lineageUpstreamDepth:qb(t.inventoryDefaults?.lineageUpstreamDepth,Kb.inventoryDefaults.lineageUpstreamDepth),lineageDownstreamDepth:qb(t.inventoryDefaults?.lineageDownstreamDepth,Kb.inventoryDefaults.lineageDownstreamDepth),allDepsMode:typeof t.inventoryDefaults?.allDepsMode==`boolean`?t.inventoryDefaults.allDepsMode:Kb.inventoryDefaults.allDepsMode}}}catch{return Kb}}function $b(){let[e,t]=(0,c.useState)(()=>{try{return Qb(window.localStorage.getItem(Gb))}catch{return Kb}});return(0,c.useEffect)(()=>{try{window.localStorage.setItem(Gb,JSON.stringify(e))}catch{}},[e]),{preferences:e,setPreferences:t}}function ex(e,t){let n=t!==e.selectedExecutionId;return{...e,selectedExecutionId:t,...n?{neighborhoodRowsShowAll:!1}:{}}}var tx=(e,t)=>({activeTab:se(e),expandedNodeIds:new Set,explorerMode:t?.inventoryDefaults.explorerMode??`project`,status:`all`,resourceTypes:new Set,materializationKinds:new Set,resourceQuery:``,selectedResourceId:ie(e),upstreamDepth:de(e)??t?.inventoryDefaults.lineageUpstreamDepth??2,downstreamDepth:fe(e)??t?.inventoryDefaults.lineageDownstreamDepth??2,allDepsMode:pe(e)??t?.inventoryDefaults.allDepsMode??!1,lensMode:ue(e)??t?.inventoryDefaults.lineageLensMode??`type`,activeLegendKeys:new Set}),nx=e=>{let t=re(e);return{kind:ce(e)??`all`,status:`all`,query:``,resourceTypes:new Set,materializationKinds:new Set,threadIds:new Set,durationBand:`all`,sortBy:`attention`,sortDirection:`desc`,groupBy:`none`,selectedExecutionId:t===`runs`?ae(e):null,showAdapterMetrics:t===`runs`?le(e):!1}},rx=(e,t)=>{let n=re(e),r=n===`runs`||n===`timeline`?ae(e):null;return{query:``,activeStatuses:new Set,activeTypes:new Set,selectedExecutionId:r,showTests:t?.timelineDefaults.showTests??!1,failuresOnly:t?.timelineDefaults.failuresOnly??!1,dependencyDirection:t?.timelineDefaults.dependencyDirection??`both`,dependencyDepthHops:t?.timelineDefaults.dependencyDepthHops??2,timeWindow:null,neighborhoodRowsShowAll:!1}},ix=e=>{let t=re(e)??`health`,n=ie(e),r=ae(e);return{selectedResourceId:n,selectedExecutionId:t===`runs`||t===`timeline`?r:null,sourceLens:null}};function ax(e,t){return{activeView:re(e)??`health`,assetViewState:tx(e,t),runsViewState:nx(e),timelineFilters:rx(e,t),lineageViewState:{...he(e),upstreamDepth:de(e)??t?.inventoryDefaults.lineageUpstreamDepth??2,downstreamDepth:fe(e)??t?.inventoryDefaults.lineageDownstreamDepth??2,allDepsMode:pe(e)??t?.inventoryDefaults.allDepsMode??!1,lensMode:ue(e)??t?.inventoryDefaults.lineageLensMode??`type`},investigationSelection:ix(e)}}function ox(e){let t=re(e),n=ie(e),r=ae(e);return{activeView:t??void 0,assetViewState:t=>({...t,selectedResourceId:n,activeTab:se(e)}),runsViewState:n=>({...n,kind:ce(e)??n.kind,selectedExecutionId:t===`runs`?r:null,showAdapterMetrics:t===`runs`?le(e):n.showAdapterMetrics}),timelineFilters:e=>ex(e,t===`timeline`?r:null),lineageViewState:he(e),investigationSelection:e=>({...e,selectedResourceId:n,selectedExecutionId:t===`runs`||t===`timeline`?r:null,sourceLens:e.sourceLens})}}var sx=[`resource`,`assetTab`,`selected`,`kind`,`adapter`,`up`,`down`,`allDeps`,`lens`];function cx(e,t){for(let n of sx)t?.has(n)||e.searchParams.delete(n)}function lx(e,t,n){t.selectedResourceId?e.searchParams.set(`resource`,t.selectedResourceId):e.searchParams.delete(`resource`),e.searchParams.set(`assetTab`,t.activeTab),e.searchParams.delete(`kind`),t.activeTab===`lineage`?(n.selectedResourceId?e.searchParams.set(`selected`,n.selectedResourceId):e.searchParams.delete(`selected`),e.searchParams.set(`up`,String(n.upstreamDepth)),e.searchParams.set(`down`,String(n.downstreamDepth)),e.searchParams.set(`allDeps`,n.allDepsMode?`1`:`0`),e.searchParams.set(`lens`,n.lensMode)):cx(e,new Set([`resource`,`assetTab`]))}function ux(e,t){e.searchParams.set(`kind`,t.kind),t.selectedExecutionId?e.searchParams.set(`selected`,t.selectedExecutionId):e.searchParams.delete(`selected`),t.showAdapterMetrics?e.searchParams.delete(`adapter`):e.searchParams.set(`adapter`,`0`),cx(e,new Set([`kind`,`selected`,`adapter`]))}function dx(e,t){t?e.searchParams.set(`selected`,t):e.searchParams.delete(`selected`),cx(e,new Set([`selected`]))}function fx(e){let{pathname:t,hash:n,activeView:r,assetViewState:i,runsViewState:a,timelineSelectedExecutionId:o,lineageViewState:s}=e,c=new URL(`http://local.invalid${t}${n}`);return c.searchParams.set(`view`,r),r===`inventory`?lx(c,i,s):r===`runs`?ux(c,a):r===`timeline`?dx(c,o):cx(c),`${t}${c.search}${n}`}function px(e){let t=(0,c.useRef)(!1),n=ax(window.location.search,e),[r,i]=(0,c.useState)(()=>n.activeView),[a,o]=(0,c.useState)(()=>_e(e.sidebarCollapsedDefault)),[s,l]=(0,c.useState)(!1),[u,d]=(0,c.useState)({status:`all`,resourceTypes:new Set,query:``}),[f,p]=(0,c.useState)(()=>n.timelineFilters),[m,h]=(0,c.useState)(()=>n.assetViewState),[g,_]=(0,c.useState)(()=>n.runsViewState),[v,y]=(0,c.useState)(()=>n.lineageViewState),[b,x]=(0,c.useState)({query:``,recentResourceIds:[],isOpen:!1}),[S,C]=(0,c.useState)(()=>n.investigationSelection),w=(0,c.useCallback)(e=>{o(t=>{let n=e(t);try{window.localStorage.setItem(ge,String(n))}catch{}return n})},[]),T=(0,c.useCallback)(e=>{i(e.view===`search`?`inventory`:e.view)},[]),E=(0,c.useCallback)((e,t)=>{i(e),t?.resourceId?(h(e=>({...e,selectedResourceId:t.resourceId??e.selectedResourceId,activeTab:t.assetTab??e.activeTab})),y(e=>({...e,rootResourceId:t.rootResourceId??t.resourceId??e.rootResourceId,selectedResourceId:t.resourceId??e.selectedResourceId}))):t?.assetTab&&e===`inventory`&&h(e=>({...e,activeTab:t.assetTab??e.activeTab})),t?.executionId&&(_(e=>({...e,selectedExecutionId:t.executionId??e.selectedExecutionId})),p(e=>ex(e,t.executionId??e.selectedExecutionId))),e===`runs`&&t?.resourceId&&_(e=>({...e,query:t.resourceId??e.query})),C(n=>({selectedResourceId:t?.resourceId??n.selectedResourceId,selectedExecutionId:t?.executionId??n.selectedExecutionId,sourceLens:e}))},[]);return(0,c.useEffect)(()=>{let e=fx({pathname:window.location.pathname,hash:window.location.hash,activeView:r,assetViewState:m,runsViewState:g,timelineSelectedExecutionId:f.selectedExecutionId,lineageViewState:v});e!==`${window.location.pathname}${window.location.search}${window.location.hash}`&&window.history.pushState(null,``,e)},[r,m,g,f.selectedExecutionId,v]),(0,c.useEffect)(()=>{let e=()=>{let e=ox(window.location.search);e.activeView!==void 0&&i(e.activeView),h(t=>e.assetViewState(t)),_(t=>e.runsViewState(t)),p(t=>e.timelineFilters(t)),y(e.lineageViewState),C(t=>e.investigationSelection(t))};return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]),(0,c.useEffect)(()=>{if(!t.current){t.current=!0;return}p(t=>({...t,showTests:e.timelineDefaults.showTests,failuresOnly:e.timelineDefaults.failuresOnly,dependencyDirection:e.timelineDefaults.dependencyDirection,dependencyDepthHops:e.timelineDefaults.dependencyDepthHops})),h(t=>({...t,explorerMode:e.inventoryDefaults.explorerMode})),y(t=>({...t,upstreamDepth:e.inventoryDefaults.lineageUpstreamDepth,downstreamDepth:e.inventoryDefaults.lineageDownstreamDepth,allDepsMode:e.inventoryDefaults.allDepsMode,lensMode:e.inventoryDefaults.lineageLensMode})),o(e.sidebarCollapsedDefault);try{window.localStorage.setItem(ge,String(e.sidebarCollapsedDefault))}catch{}},[e]),(0,c.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`k`&&(e.preventDefault(),x(e=>({...e,isOpen:!0}))),e.key===`Escape`&&(l(!1),x(e=>({...e,isOpen:!1})))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),{activeView:r,sidebarCollapsed:a,setSidebarCollapsed:w,sidebarOpen:s,setSidebarOpen:l,overviewFilters:u,setOverviewFilters:d,timelineFilters:f,setTimelineFilters:p,assetViewState:m,setAssetViewState:h,runsViewState:g,setRunsViewState:_,lineageViewState:v,setLineageViewState:y,searchState:b,setSearchState:x,investigationSelection:S,setInvestigationSelection:C,setNavigationTarget:T,handleNavigateTo:E,frameClass:[`app-frame`,a?`app-frame--sidebar-collapsed`:``,s?`app-frame--nav-open`:``].filter(Boolean).join(` `)}}function mx(){let{toast:e}=Jy(),{preferences:t,setPreferences:n}=$b(),r=px(t),{analysis:i,analysisSource:a,artifactLocationSnapshot:o,error:s,preloadLoading:l,pendingRemoteRun:d,acceptingRemoteRun:f,onManagedAnalysisLoaded:p,artifactCapability:m,onError:h,onAcceptPendingRemoteRun:g}=Wb(),{themePreference:_,setThemePreference:v}=Bt();(0,c.useEffect)(()=>{t.theme!==_&&v(t.theme)},[t.theme,v,_]);let y=(0,c.useRef)(null);(0,c.useEffect)(()=>{i&&!y.current&&a===`preload`&&e(`Workspace loaded — ${i.summary.total_nodes} executions`,`positive`),i&&!y.current&&a===`remote`&&e(`Remote workspace loaded — ${i.summary.total_nodes} executions`,`positive`),y.current=i},[i,a,e]);let b=(0,c.useRef)(null);(0,c.useEffect)(()=>{if(d==null){b.current=null;return}b.current!==d.runId&&(b.current=d.runId,e(`A newer remote run is available: ${d.label}`,`warning`))},[d,e]);let x=i?Bb(i,a):[];return(0,u.jsx)(wg.Provider,{value:m,children:(0,u.jsx)(Rb,{workspace:r,analysis:i,analysisSource:a,artifactLocationSnapshot:o,error:s,preloadLoading:l,pendingRemoteRun:d,acceptingRemoteRun:f,onManagedAnalysisLoaded:p,onError:h,onAcceptPendingRemoteRun:g,themePreference:_,setPreferences:n,preferences:t,setThemePreference:v,workspaceSignals:x})})}function hx(){return(0,u.jsx)(qy,{children:(0,u.jsx)(mx,{})})}(0,l.createRoot)(document.getElementById(`root`)).render((0,u.jsx)(c.StrictMode,{children:(0,u.jsx)(hx,{})}));
|
|
34
|
+
`)}):null]})}function X_({label:e,value:t}){return(0,u.jsxs)(`div`,{children:[(0,u.jsxs)(`span`,{style:Xg,children:[e,`: `]}),t]})}function Z_({semantics:e,materialized:t}){return e?(0,u.jsxs)(`div`,{style:{marginTop:`0.25rem`,maxWidth:340},children:[(0,u.jsx)(`div`,{children:(0,u.jsx)(`span`,{style:Xg,children:`Semantics: `})}),(0,u.jsx)(`div`,{style:{whiteSpace:`pre-wrap`,fontSize:`0.82rem`,lineHeight:1.35},children:oa(e)})]}):t?(0,u.jsx)(X_,{label:`Materialization`,value:K_(t)}):null}function Q_({hover:e,runStartedAt:t,canShowTimestamps:n,timeZone:r}){let i=n&&t!=null?$g(t+e.item.start,r):`+${Qg(e.item.start)}`,a=n&&t!=null?$g(t+e.item.end,r):`+${Qg(e.item.end)}`;return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(X_,{label:`Start`,value:i}),(0,u.jsx)(X_,{label:`End`,value:a}),(0,u.jsx)(X_,{label:`Duration`,value:Qg(e.item.duration)})]})}function $_({label:e,start:t,end:n}){return t==null||n==null||n<=t?null:(0,u.jsx)(X_,{label:e,value:Qg(n-t)})}function ev({testStats:e}){if(!e)return null;let t=[e.pass>0?`✓${e.pass}`:null,e.error>0?`✗${e.error}`:null,e.warn>0?`!${e.warn}`:null,e.skipped>0?`−${e.skipped}`:null].filter(Boolean);return t.length===0?null:(0,u.jsx)(X_,{label:`Tests`,value:t.join(` · `)})}function tv({hover:e,frameWidth:t,frameHeight:n,runStartedAt:r,canShowTimestamps:i,timeZone:a,testStats:o,resourceByUniqueId:s}){let l=(0,c.useRef)(null),[d,f]=(0,c.useState)(()=>q_({hoverX:e.x,hoverY:e.y,frameWidth:t,frameHeight:n,tooltipWidth:220,tooltipHeight:160})),p=s?.get(e.item.unique_id),m=J_(p);return(0,c.useLayoutEffect)(()=>{let r=l.current;if(!r)return;let i=q_({hoverX:e.x,hoverY:e.y,frameWidth:t,frameHeight:n,tooltipWidth:r.offsetWidth,tooltipHeight:r.offsetHeight});f(e=>e.left===i.left&&e.top===i.top?e:i)},[n,t,e.x,e.y,e.item.unique_id,m]),(0,u.jsxs)(`div`,{ref:l,className:`chart-tooltip`,style:{position:`absolute`,left:d.left,top:d.top,pointerEvents:`none`,zIndex:20,minWidth:180},children:[(0,u.jsx)(`div`,{style:{fontWeight:700,marginBottom:`0.3rem`},children:e.item.name||e.item.unique_id}),(0,u.jsx)(X_,{label:`Status`,value:e.item.status}),e.item.resourceType&&(0,u.jsx)(X_,{label:`Type`,value:e.item.resourceType}),(0,u.jsx)(Z_,{semantics:e.item.semantics,materialized:e.item.materialized}),(0,u.jsx)(Q_,{hover:e,runStartedAt:r,canShowTimestamps:i,timeZone:a}),(0,u.jsx)($_,{label:`Compile`,start:e.item.compileStart,end:e.item.compileEnd}),(0,u.jsx)($_,{label:`Execute`,start:e.item.executeStart,end:e.item.executeEnd}),(0,u.jsx)(ev,{testStats:o}),(0,u.jsx)(Y_,{resource:p})]})}function nv({canvasRef:e,scrollRef:t,edges:n,edgeFocusId:r,itemById:i,bundleIndexById:a,bundles:o,rowOffsets:s,containerWidth:l,effectiveLabelW:d,rangeStart:f,rangeEnd:p,scrollTop:m,viewportH:h,needsScroll:g,totalScrollH:_,theme:v,showTests:y,hover:b,runStartedAt:x,canShowTimestamps:S,timeZone:C,testStatsById:w,resourceByUniqueId:T,selectedId:E,onSelect:D,onPointer:O,onHoverClear:k,labelColumnResize:A}){let j=(0,c.useRef)(null),[M,N]=(0,c.useState)(0);return(0,c.useLayoutEffect)(()=>{let e=j.current;if(!e)return;let t=()=>N(e.getBoundingClientRect().width);t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]),(0,u.jsxs)(`section`,{ref:j,className:`chart-frame`,style:{position:`relative`,userSelect:`none`},children:[(0,u.jsx)(`canvas`,{ref:e,style:{position:`absolute`,top:0,left:0,width:`100%`,height:h,pointerEvents:`none`,display:`block`}}),(0,u.jsx)(B_,{edges:n,focusId:r,itemById:i,bundleIndexById:a,bundles:o,rowOffsets:s,canvasWidth:l>0?l:600,effectiveLabelW:d,rangeStart:f,rangeEnd:p,scrollTop:m,viewportH:h,theme:v,showTests:y}),(0,u.jsx)(`div`,{ref:t,className:`chart-frame__viewport`,role:`region`,tabIndex:0,"aria-label":`Timeline chart viewport — use arrow keys to scroll`,style:{position:`relative`,height:h,overflowY:g?`auto`:`hidden`},onMouseMove:e=>O(e,`move`),onClick:e=>O(e,`click`),onKeyDown:e=>{if(e.key!==`Enter`&&e.key!==` `)return;e.preventDefault();let t=b?.item.unique_id??E;t&&D?.(t)},onMouseLeave:k,children:(0,u.jsx)(`div`,{style:{height:_}})}),A?(0,u.jsx)(H_,{labelColumnW:A.width,viewportH:A.viewportH,minW:A.minW,maxW:A.maxW,onWidthChange:A.onChange}):null,b&&(0,u.jsx)(tv,{hover:b,frameWidth:M>0?M:l,frameHeight:h,runStartedAt:x,canShowTimestamps:S,timeZone:C,testStats:w?.get(b.item.unique_id),resourceByUniqueId:T})]})}function rv({activeMode:e,onChange:t,activeTimeZone:n,timeZones:r,onTimeZoneChange:i}){return(0,u.jsx)(`div`,{className:`gantt-controls`,children:(0,u.jsxs)(`div`,{className:`gantt-controls__cluster`,children:[e===`timestamps`&&(0,u.jsxs)(`label`,{className:`gantt-timezone-select`,children:[(0,u.jsx)(`span`,{children:`Timezone`}),(0,u.jsx)(`select`,{value:n,onChange:e=>i(e.target.value),children:r.map(e=>(0,u.jsx)(`option`,{value:e,children:e},e))})]}),(0,u.jsxs)(`div`,{className:`gantt-mode-toggle`,children:[(0,u.jsx)(`button`,{type:`button`,className:e===`duration`?`active`:``,onClick:()=>t(`duration`),children:`Duration`}),(0,u.jsx)(`button`,{type:`button`,className:e===`timestamps`?`active`:``,onClick:()=>t(`timestamps`),children:`Timestamps`})]})]})})}var iv=1e3;function av(e,t){let n=t?.get(e.item.unique_id);return n&&n.error+n.warn>0?!0:a_(e.item.status)||e.tests.some(e=>a_(e.status))}function ov(e,t,n){return{start:Math.max(0,Math.min(e,n)),end:Math.max(0,Math.min(t,n))}}function sv({bundles:e,maxEnd:t,timeWindow:n,testStatsById:r,onChange:i}){let a=(0,c.useRef)(null),[o,s]=(0,c.useState)(null),l=(0,c.useRef)(null),d=Math.min(Math.max(iv,t*.01),t),f=n?.start??0,p=n?.end??t,m=n!=null;function h(e){let n=a.current;if(!n)return 0;let r=n.clientWidth;return r<=0||t<=0?0:(e-n.getBoundingClientRect().left)/r*t}function g(e,r){if(!a.current||a.current.clientWidth<=0||t<=0)return;let i=h(e.clientX);l.current={mode:r,startPx:e.clientX,initialStart:r===`create`?i:f,initialEnd:r===`create`?i:p,currentStart:r===`create`?i:f,currentEnd:r===`create`?i:p},s(r===`create`?{start:i,end:i}:n),a.current.setPointerCapture(e.pointerId)}function _(e){let n=l.current,r=a.current;if(!n||!r||t<=0)return;let i=r.clientWidth;if(i<=0)return;let o=(e.clientX-n.startPx)/i*t,c=n.initialEnd-n.initialStart,u=h(e.clientX);if(n.mode===`create`){let e={start:Math.min(n.initialStart,u),end:Math.max(n.initialStart,u)};l.current={...n,currentStart:e.start,currentEnd:e.end},s(e);return}if(n.mode===`pan`){let e=Math.min(Math.max(0,n.initialStart+o),t-c),r={start:e,end:e+c};l.current={...n,currentStart:r.start,currentEnd:r.end},s(r);return}if(n.mode===`start`){let e={start:Math.min(Math.max(0,n.initialStart+o),n.initialEnd-d),end:n.initialEnd};l.current={...n,currentStart:e.start,currentEnd:e.end},s(e);return}let f=Math.max(Math.min(t,n.initialEnd+o),n.initialStart+d),p={start:n.initialStart,end:f};l.current={...n,currentStart:p.start,currentEnd:p.end},s(p)}function v(e){let n=l.current;if(n&&a.current?.hasPointerCapture(e.pointerId)&&a.current.releasePointerCapture(e.pointerId),n){let e=ov(n.currentStart,n.currentEnd,t),r=e.end-e.start;(n.mode!==`create`||r>=d)&&(e.start<=0&&e.end>=t?i(null):i(e))}l.current=null,s(null)}let y=o??(m?{start:f,end:p}:{start:0,end:t}),b=y==null?0:Math.max(0,Math.min(100,y.start/t*100)),x=y==null?0:Math.max(0,Math.min(100,y.end/t*100)),S=Math.max(0,x-b);return(0,u.jsxs)(`div`,{className:`gantt-brush-wrap`,children:[(0,u.jsxs)(`div`,{className:`gantt-brush__header`,children:[(0,u.jsx)(`p`,{className:`gantt-brush__title`,children:`Time range`}),(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill`,disabled:!m,onClick:()=>i(null),children:`Reset zoom`})]}),(0,u.jsxs)(`div`,{ref:a,className:`gantt-brush`,onPointerDown:e=>{e.target!==e.currentTarget||e.button!==0||g(e,`create`)},onPointerMove:_,onPointerUp:v,onPointerCancel:v,role:`slider`,"aria-label":`Timeline time range`,"aria-valuemin":0,"aria-valuemax":Math.round(t),"aria-valuenow":Math.round(f),"aria-valuetext":`${Math.round(f)} to ${Math.round(p)} ms`,children:[e.map(e=>{let n=Math.max(0,e.item.start),i=Math.max(n,e.item.end),a=n/t*100,o=Math.max(.2,(i-n)/t*100),s=av(e,r);return(0,u.jsx)(`span`,{className:s?`gantt-brush__bar gantt-brush__bar--issue`:`gantt-brush__bar`,"data-issue":s?`true`:`false`,style:{left:`${a}%`,width:`${o}%`}},e.item.unique_id)}),y!=null&&(0,u.jsxs)(`div`,{className:m||o!=null?`gantt-brush__selection`:`gantt-brush__selection gantt-brush__selection--default`,"data-default-range":m||o!=null?`false`:`true`,style:{left:`${b}%`,width:`${S}%`},onPointerDown:e=>g(e,`pan`),children:[(0,u.jsx)(`span`,{className:`gantt-brush__handle gantt-brush__handle--start`,onPointerDown:e=>{e.stopPropagation(),g(e,`start`)}}),(0,u.jsx)(`span`,{className:`gantt-brush__handle gantt-brush__handle--end`,onPointerDown:e=>{e.stopPropagation(),g(e,`end`)}})]})]})]})}function cv(e,t,n,r,i,a,o=2){let s=Math.max(1,t-e),c=i+a,l=i+(n-e)/s*a,u=i+(r-e)/s*a,d=Math.max(i,Math.min(l,u));return{x:d,width:Math.max(o,Math.min(c,Math.max(l,u))-d)}}function lv(e,t){return t&&e.laneCount>0?49+e.laneCount*14+5:44}function uv(e,t){let n=[],r=[],i=0;for(let a of e){n.push(i);let e=lv(a,t);r.push(e),i+=e}return{rowOffsets:n,rowHeights:r,totalHeight:i}}function dv(e,t,n){if(e.length===0)return-1;let r=0,i=e.length-1;for(;r<=i;){let a=Math.floor((r+i)/2),o=e[a]??0,s=t[a]??44;if(o>n)i=a-1;else if(o+s<=n)r=a+1;else return a}return-1}function fv(e,t,n,r,i,a,o,s){let c=(e,t,n)=>({item:e,x:t,y:n}),l=(e,t,n,r,i,a)=>e>=t&&e<=t+n&&(r==null||i==null||a==null||r>=i&&r<=i+a),{rowOffsets:u,rowHeights:d,showTests:f}=n;if(!s)return null;let p=e.currentTarget.getBoundingClientRect(),m=e.clientX-p.left,h=e.clientY-p.top;if(h<32||m<0)return null;let g=dv(u,d,h-32+r);if(g<0||g>=t.length)return null;let _=t[g];if(!_)return null;let v=s.getBoundingClientRect().width-o-24,y=32+(u[g]??0)-r;if(m<o)return c(_.item,m,h);let b=o,{x,width:S}=cv(i,a,_.item.start,_.item.end,b,v);if(l(m,x,S))return c(_.item,m,h);if(f&&_.lanes.length>0)for(let{item:e,lane:t}of _.lanes){let{x:n,width:r}=cv(i,a,e.start,e.end,b,v,4);if(l(m,n,r,h,y+44+5+t*14,10))return c(e,m,h)}return null}function pv(e,t,n){let{bundles:r,layout:i,scrollTop:a,rangeStart:o,rangeEnd:s,effectiveLabelW:c,canvas:l,setHover:u,onSelect:d}=n,f=fv(e,r,i,a,o,s,c,l);if(!f){t===`move`?u(null):d?.(null);return}if(t===`move`){u({item:f.item,x:f.x,y:f.y});return}d?.(f.item.unique_id)}var mv={...$n};function hv(e,t=`light`){return(t===`dark`?er:$n)[e.toLowerCase()]??Qn(t).textSoft}function gv(e,t=`light`){let n=dr(t);return(e&&n[e])??Qn(t).borderSubtle}var _v=3,vv=2.25;function yv(e){return(e?.error??0)+(e?.warn??0)>0}function bv(e,t,n,r,i,a){r<2*a&&(a=r/2),i<2*a&&(a=i/2),e.beginPath(),e.moveTo(t+a,n),e.arcTo(t+r,n,t+r,n+i,a),e.arcTo(t+r,n+i,t,n+i,a),e.arcTo(t,n+i,t,n,a),e.arcTo(t,n,t+r,n,a),e.closePath()}function xv(e,t,n,r,i,a){bv(e,t,n,r,i,a),e.fill()}function Sv(e,t,n,r,i,a){bv(e,t,n,r,i,a),e.stroke()}function Cv(e,t){let{rangeStart:n,rangeEnd:r,chartLeft:i,chartW:a,compileStart:o,compileEnd:s,barX:c,barY:l,barW:u,barH:d,radius:f,theme:p}=t;if(o==null||s==null||s<=o)return;let m=Math.max(1,r-n),h=i+(o-n)/m*a,g=i+(s-n)/m*a,_=Math.max(c,h),v=Math.min(c+u,g)-_;v<=.5||(e.save(),bv(e,c,l,u,d,f),e.clip(),e.fillStyle=p===`dark`?`rgba(0, 0, 0, 0.24)`:`rgba(0, 0, 0, 0.12)`,e.fillRect(_,l,v,d),e.restore())}function wv(e,t,n,r,i,a,o,s){t%2==0&&(e.fillStyle=o?s.rowStripeHover:s.rowStripe,e.globalAlpha=a?1:.35,e.fillRect(0,n,r,i),e.globalAlpha=1)}function Tv({ctx:e,item:t,rowY:n,labelW:r,xOffset:i,emphasis:a,palette:o}){e.save(),e.globalAlpha=a,e.beginPath(),e.rect(i,n,r-10-i,44),e.clip(),e.textAlign=`left`,e.textBaseline=`middle`,e.font=`12px "IBM Plex Sans", "Avenir Next", sans-serif`,e.fillStyle=o.labelText,e.fillText(t.name||t.unique_id,i+2,n+44/2),e.restore()}function Ev({ctx:e,item:t,rowY:n,rangeStart:r,rangeEnd:i,chartW:a,labelW:o,emphasis:s,isHovered:c,attachedTestStats:l,palette:u,theme:d}){let f=n+6,{x:p,width:m}=cv(r,i,t.start,t.end,o,a),h=yv(l),g=a_(t.status)||h;e.save(),e.globalAlpha=s,e.fillStyle=pr(t.resourceType,d),xv(e,p,f,m,14,3),Cv(e,{rangeStart:r,rangeEnd:i,chartLeft:o,chartW:a,compileStart:t.compileStart,compileEnd:t.compileEnd,barX:p,barY:f,barW:m,barH:14,radius:3,theme:d}),h&&r_(t.status)&&(e.fillStyle=u.testFailStripe,xv(e,p,f+14-4,m,4,2)),e.strokeStyle=g?u.testFailStripe:hv(t.status,d),e.lineWidth=g?_v:2,Sv(e,p,f,m,14,3),e.restore(),c&&(e.save(),e.globalAlpha=1,e.strokeStyle=u.barHoverStroke,e.lineWidth=1.5,Sv(e,p,f,m,14,3),e.restore())}function Dv({ctx:e,test:t,chipY:n,rangeStart:r,rangeEnd:i,chartW:a,labelW:o,palette:s,theme:c,emphasis:l,isHovered:u}){let{x:d,width:f}=cv(r,i,t.start,t.end,o,a,4),p=a_(t.status);e.save(),e.globalAlpha=l,e.fillStyle=pr(t.resourceType,c),xv(e,d,n,f,10,2),Cv(e,{rangeStart:r,rangeEnd:i,chartLeft:o,chartW:a,compileStart:t.compileStart,compileEnd:t.compileEnd,barX:d,barY:n,barW:f,barH:10,radius:2,theme:c}),e.strokeStyle=p?s.testFailStripe:hv(t.status,c),e.lineWidth=p?vv:1.5,Sv(e,d,n,f,10,2),e.restore(),u&&(e.save(),e.globalAlpha=1,e.strokeStyle=s.barHoverStroke,e.lineWidth=1,Sv(e,d,n,f,10,2),e.restore())}function Ov(e,t){let n=e.getContext(`2d`);if(!n)return null;let r=e.getBoundingClientRect(),i=window.devicePixelRatio||1,a=r.width,o=r.height;return a===0||o===0?null:(e.width=a*i,e.height=o*i,n.scale(i,i),n.clearRect(0,0,a,o),{ctx:n,w:a,h:o,chartW:a-t-24})}function kv({ctx:e,labelW:t,chartW:n,h:r,rangeStart:i,rangeEnd:a,displayMode:o,runStartedAt:s,timeZone:c,palette:l}){let u=Math.max(1,a-i),d=l_(i,a);e.font=`11px 'IBM Plex Mono', 'Fira Mono', monospace`,e.textAlign=`center`,e.textBaseline=`middle`,e.fillStyle=l.axisTick;let f=e=>o===`timestamps`&&s!=null?$g(s+e.ms,c):e.label,p=u_(d,i,a,n,f,t=>e.measureText(t).width);for(let a of p){let o=t+(a.ms-i)/u*n;e.strokeStyle=l.gridLine,e.lineWidth=1,e.beginPath(),e.moveTo(o,32),e.lineTo(o,r),e.stroke(),e.fillText(f(a),o,32/2)}}function Av(e){let{ctx:t,bundle:n,rowIndex:r,rowY:i,bundleRowHeightPx:a,w:o,labelW:s,chartW:c,rangeStart:l,rangeEnd:u,focusIds:d,hoveredId:f,theme:p,palette:m,testStatsById:h,showTests:g}=e,_=d==null||d.has(n.item.unique_id)||n.lanes.some(e=>d.has(e.item.unique_id)),v=d==null||d.has(n.item.unique_id),y=f===n.item.unique_id,b=v?1:.18;if(wv(t,r,i,o,a,_,y,m),Tv({ctx:t,item:n.item,rowY:i,labelW:s,xOffset:0,emphasis:b,palette:m}),Ev({ctx:t,item:n.item,rowY:i,rangeStart:l,rangeEnd:u,chartW:c,labelW:s,emphasis:b,isHovered:y,attachedTestStats:h?.get(n.item.unique_id),palette:m,theme:p}),!(!g||n.lanes.length===0))for(let{item:e,lane:r}of n.lanes){let n=i+44+5+r*14,a=f===e.unique_id;Dv({ctx:t,test:e,chipY:n,rangeStart:l,rangeEnd:u,chartW:c,labelW:s,palette:m,theme:p,emphasis:d==null||d.has(e.unique_id)?1:.18,isHovered:a})}}function jv(e,t,n,r,{scrollTop:i,rangeStart:a,rangeEnd:o,displayMode:s,runStartedAt:c,focusIds:l,hoveredId:u,labelW:d=160,timeZone:f,testStatsById:p,theme:m=`light`,showTests:h=!1}){let g=Ov(e,d);if(!g)return;let{ctx:_,w:v,h:y,chartW:b}=g,x=gr(m);if(kv({ctx:_,labelW:d,chartW:b,h:y,rangeStart:a,rangeEnd:o,displayMode:s,runStartedAt:c,timeZone:f,palette:x}),t.length===0)return;let S=y-32,C=Mv(n,i),w=Nv(n,r,i,S);_.textBaseline=`middle`;for(let e=C;e<=w;e++){let s=t[e];if(!s)continue;let c=32+(n[e]??0)-i;Av({ctx:_,bundle:s,rowIndex:e,rowY:c,bundleRowHeightPx:r[e]??44,w:v,labelW:d,chartW:b,rangeStart:a,rangeEnd:o,focusIds:l,hoveredId:u,theme:m,palette:x,testStatsById:p,showTests:h})}}function Mv(e,t){if(e.length===0)return 0;let n=0,r=e.length-1;for(;n<r;){let i=Math.floor((n+r)/2);(e[i]??0)<t?n=i+1:r=i}return Math.max(0,n-1)}function Nv(e,t,n,r){let i=n+r,a=0;for(let r=0;r<e.length;r++){let o=e[r]??0;if(!(o+(t[r]??44)<=n)){if(o>=i)break;a=r}}return a}function Pv({canvasRef:e,bundles:t,rowOffsets:n,rowHeights:r,scrollTop:i,rangeStart:a,rangeEnd:o,activeMode:s,runStartedAt:l,focusedIds:u,hoveredId:d,effectiveLabelW:f,timeZone:p,testStatsById:m,theme:h,showTests:g,setContainerWidth:_}){(0,c.useEffect)(()=>{if(t.length===0)return;function c(){let c=e.current;c&&jv(c,t,n,r,{scrollTop:i,rangeStart:a,rangeEnd:o,displayMode:s,runStartedAt:l,focusIds:u,hoveredId:d,labelW:f,timeZone:p,testStatsById:m,theme:h,showTests:g})}let v=e.current;if(!v)return;c();let y=new ResizeObserver(e=>{let t=e[0];t&&_(t.contentRect.width),c()});return y.observe(v),()=>y.disconnect()},[t,n,r,i,a,o,s,l,u,d,f,p,m,h,g,_])}function Fv(e){return Math.max(1,Math.min(3,Math.trunc(e)))}function Iv(e){let t=Fv(e.dependencyDepthHops);return{includeUpstream:e.dependencyDirection!==`downstream`,includeDownstream:e.dependencyDirection!==`upstream`,showAllUpstream:!1,maxUpstreamEdges:8,showAllDownstream:!1,maxDownstreamEdges:8,extendedDeps:t>1?{enabled:!0,maxHops:Fv(t),maxEdgesPerDirection:12}:{enabled:!1}}}function Lv({edgeFocusId:e,timelineAdjacency:t,itemById:n,bundleIndexById:r,dependencyDirection:i,dependencyDepthHops:a}){let o=(0,c.useMemo)(()=>Iv({dependencyDirection:i,dependencyDepthHops:a}),[a,i]),{edges:s}=(0,c.useMemo)(()=>N_(e,t,n,r,o),[e,t,n,r,o]);return{edges:s}}function Rv({data:e,runStartedAt:t,timelineAdjacency:n,testStatsById:r,resourceByUniqueId:i,showTests:a=!1,dependencyDirection:o=`both`,dependencyDepthHops:l=2,selectedId:d=null,onSelect:f,timeWindow:p=null,onTimeWindowChange:m}){let h=di(),g=(0,c.useRef)(null),_=(0,c.useRef)(null),[v,y]=(0,c.useState)(null),[b,x]=(0,c.useState)(`duration`),[S,C]=(0,c.useState)(t_),[w,T]=(0,c.useState)(0),[E,D]=(0,c.useState)(()=>typeof window>`u`?900:window.innerHeight),O=(0,c.useMemo)(()=>e_(),[]),k=t!=null,A=k?b:`duration`;(0,c.useEffect)(()=>{try{window.localStorage.setItem(Zg,S)}catch{}},[S]);let{effectiveLabelW:j,maxLabelW:M,onLabelColumnWidthDrag:N}=f_(w),P=(0,c.useMemo)(()=>Kg(e),[e]),ee=(0,c.useMemo)(()=>{let e=1;for(let t of P){e=Math.max(e,t.item.end);for(let n of t.tests)e=Math.max(e,n.end)}return e},[P]),F=(0,c.useMemo)(()=>{if(!p)return P;let{start:t,end:n}=p,r=new Set;for(let e of P)for(let i of e.tests)if(i.end>t&&i.start<n){r.add(e.item.unique_id);break}return Kg(e.filter(e=>e.end>t&&e.start<n?!0:r.has(e.unique_id)))},[e,P,p]),te=p?.start??0,ne=p?p.end:ee,re=te,ie=ne,{rowOffsets:ae,rowHeights:oe}=(0,c.useMemo)(()=>uv(F,a),[F,a]),se=(0,c.useMemo)(()=>{let t=new Map;for(let n of e)t.set(n.unique_id,n);return t},[e]),ce=s({count:F.length,getScrollElement:()=>_.current,estimateSize:e=>F[e]?lv(F[e],a):44,getItemKey:e=>F[e]?.item.unique_id??e,overscan:10}),le=ce.scrollOffset??0;(0,c.useLayoutEffect)(()=>{ce.measure()},[F,a,ce]);let ue=(0,c.useMemo)(()=>({rowOffsets:ae,rowHeights:oe,showTests:a}),[ae,oe,a]),de=(0,c.useMemo)(()=>{let e=new Map;for(let t=0;t<F.length;t++){let n=F[t];if(n){e.set(n.item.unique_id,t);for(let r of n.tests)e.set(r.unique_id,t)}}return e},[F]),fe=d??v?.item.unique_id??null,{edges:pe}=Lv({edgeFocusId:fe,timelineAdjacency:n,itemById:se,bundleIndexById:de,dependencyDirection:o,dependencyDepthHops:l}),me=(0,c.useMemo)(()=>{if(!fe)return null;let e=new Set([fe]);for(let t of pe)e.add(t.fromId),e.add(t.toId);return e},[fe,pe]),he=32+ce.getTotalSize(),ge=Math.max(240,Math.min(E-320,Math.round(E*Yg))),_e=Math.max(240,Math.min(ge,he)),ve=he>_e;if((0,c.useEffect)(()=>{let e=()=>D(window.innerHeight);return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),Pv({canvasRef:g,bundles:F,rowOffsets:ae,rowHeights:oe,scrollTop:le,rangeStart:re,rangeEnd:ie,activeMode:A,runStartedAt:t,focusedIds:me,hoveredId:v?.item.unique_id??null,effectiveLabelW:j,timeZone:S,testStatsById:r,theme:h,showTests:a,setContainerWidth:T}),P.length===0)return(0,u.jsx)(`div`,{className:`empty-state empty-state--chart`,children:`No Gantt data (run_results may lack timing info)`});function ye(e,t){pv(e,t,{bundles:F,layout:ue,scrollTop:le,rangeStart:re,rangeEnd:ie,effectiveLabelW:j,canvas:g.current,setHover:y,onSelect:f})}return(0,u.jsxs)(`div`,{className:`gantt-shell`,role:`region`,"aria-label":`Execution timeline`,children:[k&&(0,u.jsx)(rv,{activeMode:A,onChange:x,activeTimeZone:S,timeZones:O,onTimeZoneChange:C}),(0,u.jsx)(sv,{bundles:P,maxEnd:ee,timeWindow:p,testStatsById:r,onChange:m??(()=>{})}),(0,u.jsx)(nv,{canvasRef:g,scrollRef:_,edges:pe,edgeFocusId:fe,itemById:se,bundleIndexById:de,bundles:F,rowOffsets:ae,containerWidth:w,effectiveLabelW:j,rangeStart:re,rangeEnd:ie,scrollTop:le,viewportH:_e,needsScroll:ve,totalScrollH:he,theme:h,showTests:a,hover:v,runStartedAt:t,canShowTimestamps:k,timeZone:S,testStatsById:r,resourceByUniqueId:i,selectedId:d,onSelect:f,onPointer:ye,onHoverClear:()=>y(null),labelColumnResize:{width:j,viewportH:_e,minW:120,maxW:M,onChange:N}})]})}var zv={display:`inline-block`,width:10,height:10,borderRadius:2,flexShrink:0},Bv=` gantt-legend__item--active`;function Vv(e){return`gantt-legend__item${e?Bv:``}`}function Hv(e,t){return{...zv,background:e.bgSoft,borderLeft:`3px solid ${t}`,borderRadius:0}}function Uv({theme:e,themeHex:t,showCompileExecuteLegend:n}){let r=pr(`model`,e),i=hv(`success`,e);return(0,u.jsxs)(`div`,{className:`gantt-legend__group gantt-legend__group--bar-key`,children:[(0,u.jsx)(`span`,{className:`gantt-legend__label`,children:`Bars`}),(0,u.jsxs)(`div`,{className:`gantt-legend__bar-key-row`,children:[(0,u.jsx)(`span`,{className:`gantt-legend__bar-key-swatch`,style:{background:r,border:`2px solid ${t.borderDefault}`,borderRadius:3},title:`Bar fill follows resource type`,"aria-hidden":!0}),(0,u.jsx)(`span`,{className:`gantt-legend__bar-key-caption`,children:`Fill = type`}),(0,u.jsx)(`span`,{className:`gantt-legend__bar-key-swatch`,style:{background:t.bgSoft,border:`2px solid ${i}`,borderRadius:3},title:`Bar outline follows run status`,"aria-hidden":!0}),(0,u.jsx)(`span`,{className:`gantt-legend__bar-key-caption`,children:`Border = status`})]}),n?(0,u.jsxs)(`div`,{className:`gantt-legend__bar-key-row gantt-legend__bar-key-row--phases`,children:[(0,u.jsx)(`span`,{className:`gantt-legend__bar-key-swatch`,style:{background:e===`dark`?`rgba(0, 0, 0, 0.24)`:`rgba(0, 0, 0, 0.12)`,border:`1px solid ${t.borderDefault}`,borderRadius:2},"aria-hidden":!0}),(0,u.jsx)(`span`,{className:`gantt-legend__bar-key-caption`,children:`Compile (darker)`}),(0,u.jsx)(`span`,{className:`gantt-legend__bar-key-swatch`,style:{background:r,border:`1px solid ${t.borderDefault}`,borderRadius:2},"aria-hidden":!0}),(0,u.jsx)(`span`,{className:`gantt-legend__bar-key-caption`,children:`Execute`})]}):null]})}function Wv({visibleStatuses:e,statusCounts:t,activeStatuses:n,onToggleStatus:r,failuresOnly:i,onToggleFailuresOnly:a,theme:o}){return e.length===0&&a==null?null:(0,u.jsxs)(`div`,{className:`gantt-legend__group`,children:[(0,u.jsx)(`span`,{className:`gantt-legend__label`,children:`Status`}),e.map(e=>{let i=n?.has(e)??!1,a=hv(e,o),s=t[e]??0;return(0,u.jsxs)(`button`,{type:`button`,className:Vv(i),onClick:()=>r?.(e),title:`${e} (${s})`,children:[(0,u.jsx)(`span`,{style:{...zv,background:a}}),(0,u.jsx)(`span`,{className:`gantt-legend__name`,children:e}),(0,u.jsx)(`span`,{className:`gantt-legend__count`,children:s})]},e)}),a!=null&&(0,u.jsxs)(`button`,{type:`button`,className:Vv(!!i),onClick:a,title:i?`Show all parent rows`:`Show only parents with errors or failing tests`,"aria-pressed":i??!1,children:[(0,u.jsx)(`span`,{style:{...zv,background:hv(`fail`,o)},"aria-hidden":!0}),(0,u.jsx)(`span`,{className:`gantt-legend__name`,children:`failures only`})]})]})}function Gv({visibleTypes:e,typeCounts:t,activeTypes:n,onToggleType:r,showTests:i,onToggleShowTests:a,testsLegendCount:o,theme:s,themeHex:c}){return e.length===0&&a==null?null:(0,u.jsxs)(`div`,{className:`gantt-legend__group`,children:[(0,u.jsx)(`span`,{className:`gantt-legend__label`,children:`Type`}),e.map(e=>{let i=n?.has(e)??!1,a=gv(e,s),o=t[e]??0;return(0,u.jsxs)(`button`,{type:`button`,className:Vv(i),onClick:()=>r?.(e),title:`${e} (${o})`,children:[(0,u.jsx)(`span`,{style:Hv(c,a)}),(0,u.jsx)(`span`,{className:`gantt-legend__name`,children:e}),(0,u.jsx)(`span`,{className:`gantt-legend__count`,children:o})]},e)}),a!=null&&(0,u.jsxs)(`button`,{type:`button`,className:Vv(!!i),onClick:a,title:i?`Hide test chips`:`Show test chips`,"aria-pressed":i??!1,children:[(0,u.jsx)(`span`,{style:Hv(c,gv(`test`,s)),"aria-hidden":!0}),(0,u.jsx)(`span`,{className:`gantt-legend__name`,children:`tests`}),(0,u.jsx)(`span`,{className:`gantt-legend__count`,children:o})]})]})}function Kv({materializationRows:e,materializationCounts:t,themeHex:n}){return e.length===0||t==null?null:(0,u.jsxs)(`div`,{className:`gantt-legend__group gantt-legend__group--materialization`,children:[(0,u.jsx)(`span`,{className:`gantt-legend__label`,children:`Materialization`}),(0,u.jsx)(`span`,{className:`gantt-legend__hint`,children:`Manifest-derived; not a bar color.`}),e.map(e=>{let r=t[e]??0;return(0,u.jsxs)(`div`,{className:`gantt-legend__item gantt-legend__item--static`,title:`Normalized from manifest config.materialized and resource type`,children:[(0,u.jsx)(`span`,{className:`gantt-legend__mat-icon`,"aria-hidden":!0,style:{...zv,borderRadius:0,border:`2px dashed ${n.borderDefault}`,background:n.bgSoft}}),(0,u.jsx)(`span`,{className:`gantt-legend__name`,children:aa(e)}),(0,u.jsx)(`span`,{className:`gantt-legend__count`,children:r})]},e)})]})}function qv({statusCounts:e,typeCounts:t,activeStatuses:n,activeTypes:r,onToggleStatus:i,onToggleType:a,showTests:o,onToggleShowTests:s,testsLegendCount:c=0,failuresOnly:l,onToggleFailuresOnly:d,showBarEncodingKey:f=!0,showCompileExecuteLegend:p=!1,materializationCounts:m}){let h=di(),g=Qn(h),_=Object.keys(mv).filter(t=>(e[t]??0)>0),v=[...new Set([...Sr,...Object.keys(t)])].sort((e,t)=>e.localeCompare(t)),y=m==null?[]:na.filter(e=>(m[e]??0)>0);return _.length>0||v.length>0||s!=null||d!=null||y.length>0?(0,u.jsxs)(`div`,{className:`gantt-legend`,children:[f?(0,u.jsx)(Uv,{theme:h,themeHex:g,showCompileExecuteLegend:p}):null,(0,u.jsx)(Wv,{visibleStatuses:_,statusCounts:e,activeStatuses:n,onToggleStatus:i,failuresOnly:l,onToggleFailuresOnly:d,theme:h}),(0,u.jsx)(Gv,{visibleTypes:v,typeCounts:t,activeTypes:r,onToggleType:a,showTests:o,onToggleShowTests:s,testsLegendCount:c,theme:h,themeHex:g}),(0,u.jsx)(Kv,{materializationRows:y,materializationCounts:m,themeHex:g})]}):null}var Jv=[{value:`upstream`,label:`Upstream`,glyph:`←`},{value:`both`,label:`Both`,glyph:`⇄`},{value:`downstream`,label:`Downstream`,glyph:`→`}];function Yv({filters:e,setFilters:t}){let n=Fv(e.dependencyDepthHops),r=e=>t(t=>({...t,dependencyDepthHops:Fv(e)}));return(0,u.jsx)(`div`,{className:`timeline-dependency-controls gantt-legend`,"aria-label":`Dependency visualization controls`,children:(0,u.jsxs)(`div`,{className:`timeline-dependency-controls__top-row`,children:[(0,u.jsxs)(`div`,{className:`timeline-dependency-controls__zone`,children:[(0,u.jsx)(`span`,{className:`gantt-legend__label`,children:`Depth`}),(0,u.jsxs)(`div`,{className:`timeline-dependency-controls__stepper`,role:`group`,"aria-label":`Dependency depth`,children:[(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:()=>r(n-1),disabled:n<=1,"aria-label":`Decrease dependency depth`,children:`-`}),(0,u.jsx)(`span`,{className:`timeline-dependency-controls__depth-value`,children:n}),(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:()=>r(n+1),disabled:n>=3,"aria-label":`Increase dependency depth`,children:`+`})]}),(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill timeline-dependency-controls__max-button`,onClick:()=>r(3),children:`Max`})]}),(0,u.jsx)(`div`,{className:`timeline-dependency-controls__divider`,"aria-hidden":`true`}),(0,u.jsxs)(`div`,{className:`timeline-dependency-controls__zone timeline-dependency-controls__zone--direction`,children:[(0,u.jsx)(`span`,{className:`gantt-legend__label`,children:`Direction`}),(0,u.jsx)(`div`,{className:`workspace-segmented-control`,role:`tablist`,"aria-label":`Dependency direction`,children:Jv.map(n=>{let r=e.dependencyDirection===n.value;return(0,u.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":r,className:r?`workspace-segmented-control__button workspace-segmented-control__button--active`:`workspace-segmented-control__button`,onClick:()=>t(e=>({...e,dependencyDirection:n.value})),children:[(0,u.jsx)(`span`,{"aria-hidden":`true`,children:n.glyph}),` `,n.label]},n.value)})})]})]})})}function Xv(e,t,n){let r=(0,c.useMemo)(()=>new Set(n.map(e=>e.unique_id)),[n]),i=(0,c.useMemo)(()=>new Map(e.ganttData.map(e=>[e.unique_id,e])),[e.ganttData]),a=(0,c.useMemo)(()=>j_(t.selectedExecutionId,r,i),[t.selectedExecutionId,r,i]),o=(0,c.useMemo)(()=>M_({focusId:a,timelineAdjacency:e.timelineAdjacency,candidateIds:r,dependencyDirection:t.dependencyDirection,dependencyDepthHops:t.dependencyDepthHops}),[a,e.timelineAdjacency,r,t.dependencyDirection,t.dependencyDepthHops]),s=(0,c.useMemo)(()=>t.selectedExecutionId==null||t.neighborhoodRowsShowAll?n:n.filter(e=>o.has(e.unique_id)),[n,t.selectedExecutionId,t.neighborhoodRowsShowAll,o]),l=(0,c.useMemo)(()=>n.filter(e=>o.has(e.unique_id)).length,[n,o]);return{displayedParents:s,neighborhoodUi:(0,c.useMemo)(()=>t.selectedExecutionId==null||n.length===0||l>=n.length?null:t.neighborhoodRowsShowAll?{mode:`expanded`,total:n.length,narrowedCount:l}:{mode:`narrowed`,shown:l,total:n.length},[t.selectedExecutionId,t.neighborhoodRowsShowAll,n.length,l])}}function Zv({filters:e,hasActiveFilters:t,typeFilterHint:n,setFilters:r}){return(0,u.jsxs)(`div`,{className:`timeline-toolbar`,children:[(0,u.jsxs)(`label`,{className:`workspace-search workspace-search--compact timeline-toolbar__search`,children:[(0,u.jsx)(`span`,{children:`Search nodes`}),(0,u.jsxs)(`div`,{className:`workspace-search__input-row`,children:[(0,u.jsx)(`input`,{value:e.query,onChange:e=>r(t=>({...t,query:e.target.value})),placeholder:`Filter by name or id…`,"aria-label":`Search timeline nodes`}),e.query&&(0,u.jsx)(`button`,{type:`button`,className:`workspace-search__clear`,"aria-label":`Clear search`,onClick:()=>r(e=>({...e,query:``})),children:`✕`})]})]}),(n!=null||t)&&(0,u.jsxs)(`div`,{className:`timeline-toolbar__actions`,children:[n!=null&&(0,u.jsxs)(`p`,{className:`timeline-toolbar__hint`,role:`status`,children:[n.shown.length>0?`Showing types: ${n.shown.join(`, `)}. `:``,`Hidden by type filter:`,` `,n.hidden.map(({type:e,count:t})=>`${e} (${t})`).join(`, `),`.`]}),(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:()=>{r(e=>({...e,query:``,activeStatuses:new Set,activeTypes:new Set,selectedExecutionId:null,dependencyDirection:`both`,dependencyDepthHops:2,neighborhoodRowsShowAll:!1}))},children:`Clear all filters`})]})]})}function Qv({ui:e,setFilters:t}){return e.mode===`narrowed`?(0,u.jsxs)(u.Fragment,{children:[`Showing `,e.shown.toLocaleString(),` of `,e.total.toLocaleString(),` `,`timeline rows (dependency neighborhood)`,` — `,(0,u.jsx)(`button`,{type:`button`,className:`timeline-neighborhood-action`,onClick:()=>t(e=>({...e,neighborhoodRowsShowAll:!0})),children:`Show all rows`})]}):(0,u.jsxs)(u.Fragment,{children:[`Showing all `,e.total.toLocaleString(),` timeline rows`,` — `,(0,u.jsxs)(`button`,{type:`button`,className:`timeline-neighborhood-action`,onClick:()=>t(e=>({...e,neighborhoodRowsShowAll:!1})),children:[`Neighborhood only (`,e.narrowedCount.toLocaleString(),` rows)`]})]})}function $v(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function ey(e,t,n){let r=n.get(e.unique_id),i=r?r.error+r.warn>0:t.some(e=>!r_(e.status));return!r_(e.status)||i}function ty(e,t){let n=t.trim().toLowerCase();return n?e.name.toLowerCase().includes(n)||e.unique_id.toLowerCase().includes(n):!0}function ny({analysis:e,filters:t,effectiveActiveTypes:n,filteredData:r,bundleRowCount:i,neighborhoodUi:a,statusCounts:o,typeCounts:s,materializationCounts:l,testsLegendCount:d,hasActiveFilters:f,typeFilterHint:p,testStatsById:m,resourceByUniqueId:h,setFilters:g,toggleStatus:_,toggleType:v,onInvestigationSelectionChange:y}){let b=(0,c.useMemo)(()=>Kr(e.ganttData),[e.ganttData]),{timeWindow:x}=t;return(0,u.jsxs)(yi,{title:`Execution timeline`,subtitle:`Relative start and duration for each executed node.`,children:[(0,u.jsx)(qv,{statusCounts:o,typeCounts:s,testsLegendCount:d,materializationCounts:l,activeStatuses:t.activeStatuses,activeTypes:n,onToggleStatus:_,onToggleType:v,showTests:t.showTests,onToggleShowTests:()=>g(e=>({...e,showTests:!e.showTests})),failuresOnly:t.failuresOnly,onToggleFailuresOnly:()=>g(e=>({...e,failuresOnly:!e.failuresOnly})),showCompileExecuteLegend:b}),(0,u.jsx)(Zv,{filters:t,hasActiveFilters:f,typeFilterHint:p,setFilters:g}),(0,u.jsx)(Yv,{filters:t,setFilters:g}),x!=null&&(0,u.jsxs)(`p`,{className:`timeline-zoom-active`,role:`status`,children:[`Zoomed to `,Qg(x.end-x.start),` window`,` — `,(0,u.jsx)(`button`,{type:`button`,className:`timeline-zoom-clear`,onClick:()=>g(e=>({...e,timeWindow:null})),children:`Clear zoom ×`})]}),a!=null&&(0,u.jsx)(`p`,{className:`timeline-neighborhood-active`,role:`status`,children:(0,u.jsx)(Qv,{ui:a,setFilters:g})}),i>=2e4?(0,u.jsxs)(`p`,{className:`timeline-large-dataset-hint`,role:`status`,children:[`Showing `,i.toLocaleString(),` timeline rows. Use search or type and status filters to narrow the list.`]}):null,(0,u.jsx)(Rv,{data:r,runStartedAt:e.runStartedAt,timelineAdjacency:e.timelineAdjacency,testStatsById:m,resourceByUniqueId:h,showTests:t.showTests,dependencyDirection:t.dependencyDirection,dependencyDepthHops:t.dependencyDepthHops,selectedId:t.selectedExecutionId,timeWindow:x,onTimeWindowChange:e=>g(t=>({...t,timeWindow:e})),onSelect:t=>{g(e=>{let n=t==null,r=t!==e.selectedExecutionId,i=n||r?!1:e.neighborhoodRowsShowAll;return{...e,selectedExecutionId:t,neighborhoodRowsShowAll:i}}),y(n=>({...n,selectedExecutionId:t,selectedResourceId:t==null?n.selectedResourceId:e.resources.find(e=>e.uniqueId===t)?.uniqueId??n.selectedResourceId,sourceLens:`timeline`}))}})]})}function ry({analysis:e,filters:t,setFilters:n,onInvestigationSelectionChange:r}){let i=(0,c.useDeferredValue)(t.query),a=e.projectName??Vr(e.executions),o=(0,c.useMemo)(()=>Array.from(new Set(e.ganttData.filter(e=>Gr(e,a)).map(e=>e.resourceType).filter(e=>!!e))).sort(),[e.ganttData,a]),s=(0,c.useMemo)(()=>Wr(o),[o]),l=t.activeTypes.size>0?t.activeTypes:s;function d(e){n(t=>{let n=new Set(t.activeStatuses);return n.has(e)?n.delete(e):n.add(e),{...t,activeStatuses:n}})}function f(e){n(t=>{let n=new Set(t.activeTypes.size>0?t.activeTypes:s);return n.has(e)?n.delete(e):n.add(e),{...t,activeTypes:n}})}let p=(0,c.useMemo)(()=>ma(e.resources,e.dependencyIndex),[e.dependencyIndex,e.resources]),m=(0,c.useMemo)(()=>new Map(e.resources.map(e=>[e.uniqueId,e])),[e.resources]),h=(0,c.useMemo)(()=>{let t=new Map;for(let n of e.ganttData){if(!H.has(n.resourceType)||n.parentId==null)continue;let e=t.get(n.parentId)??[];e.push(n),t.set(n.parentId,e)}return t},[e.ganttData]),{displayedParents:g,neighborhoodUi:_}=Xv(e,t,(0,c.useMemo)(()=>e.ganttData.filter(e=>H.has(e.resourceType)||t.activeTypes.size===0&&!Gr(e,a)||t.activeStatuses.size>0&&!t.activeStatuses.has(e.status.toLowerCase())||l.size>0&&!l.has(e.resourceType??``)||!ty(e,i)?!1:t.failuresOnly?ey(e,h.get(e.unique_id)??[],p):!0),[e.ganttData,i,l,t.activeStatuses,t.failuresOnly,t.activeTypes.size,a,p,h])),v=(0,c.useMemo)(()=>new Set(g.map(e=>e.unique_id)),[g]),y=(0,c.useMemo)(()=>t.showTests?e.ganttData.filter(e=>H.has(e.resourceType)&&e.parentId!=null&&v.has(e.parentId)):[],[e.ganttData,t.showTests,v]),b=(0,c.useMemo)(()=>[...g,...y],[g,y]),x=(0,c.useMemo)(()=>{let e={};for(let t of b){let n=t.semantics?.materialization??`unknown`;e[n]=(e[n]??0)+1}return e},[b]),{statusCounts:S,typeCounts:C}=(0,c.useMemo)(()=>{let t={},n={};for(let r of e.ganttData){if(!Gr(r,a))continue;let e=r.status.toLowerCase();t[e]=(t[e]??0)+1;let i=r.resourceType;n[i]=(n[i]??0)+1}return{statusCounts:t,typeCounts:n}},[e.ganttData,a]),w=(0,c.useMemo)(()=>qr(e.ganttData,a),[e.ganttData,a]),T=!$v(l,s),E=(0,c.useMemo)(()=>{if(!T)return null;let e=[...l].filter(e=>s.has(e)).sort(),t=[...s].filter(e=>!l.has(e)).sort().map(e=>({type:e,count:C[e]??0}));return t.length===0?null:{shown:e,hidden:t}},[s,l,T,C]),D=t.activeStatuses.size>0||T||t.query.length>0;return(0,u.jsx)(Ci,{title:`Timeline`,description:`Runtime timing, concurrency, bottlenecks, and execution order.`,className:`timeline-view`,children:(0,u.jsx)(ny,{analysis:e,filters:t,effectiveActiveTypes:l,filteredData:b,bundleRowCount:g.length,neighborhoodUi:_,statusCounts:S,typeCounts:C,materializationCounts:x,testsLegendCount:w,hasActiveFilters:D,typeFilterHint:E,testStatsById:p,resourceByUniqueId:m,setFilters:n,toggleStatus:d,toggleType:f,onInvestigationSelectionChange:r})})}var iy=100;function ay(){return{status:{all:0,positive:0,warning:0,danger:0},facets:{all:0,models:0,tests:0,seeds:0,snapshots:0,operations:0,healthy:0,warnings:0,errors:0,issues:0},resourceTypes:{},threadIds:{}}}function oy(e,t,n=!0){let r=(0,c.useRef)(null),i=(0,c.useRef)(0),[a,o]=(0,c.useState)(!1),[s,l]=(0,c.useState)(iy),[u,d]=(0,c.useState)([]),[f,p]=(0,c.useState)(0),[m,h]=(0,c.useState)(ay),[g,_]=(0,c.useState)(!0),[v,y]=(0,c.useState)(!1),[b,x]=(0,c.useState)(null);return(0,c.useEffect)(()=>{l(iy)},[t.kind,t.status,t.query,t.durationBand,t.sortBy,t.sortDirection,t.resourceTypes,t.materializationKinds,t.threadIds,e]),(0,c.useEffect)(()=>{if(!n){o(!1),_(!1),y(!1),d([]),p(0),h(ay()),x(null);return}let t=new Worker(new URL(`/assets/resultsQuery.worker-BrgyEpD8.js`,``+import.meta.url),{type:`module`});return r.current=t,o(!1),_(!0),d([]),p(0),h(ay()),x(null),t.onmessage=e=>{let t=e.data;if(t.type===`ready`){o(!0),_(!1),h(t.summary);return}if(t.type===`query-result`){if(t.requestId!==i.current)return;d(t.rows),p(t.totalMatches),h(t.summary),y(!1);return}x(t.message),_(!1),y(!1)},t.postMessage({type:`init`,rows:e}),()=>{t.terminate(),r.current=null}},[e,n]),(0,c.useEffect)(()=>{if(!n||!a||r.current==null)return;let e=i.current+1;i.current=e,y(!0),x(null),r.current.postMessage({type:`query`,requestId:e,kind:t.kind,status:t.status,query:t.query,resourceTypes:Array.from(t.resourceTypes),materializationKinds:Array.from(t.materializationKinds),threadIds:Array.from(t.threadIds),durationBand:t.durationBand,sortBy:t.sortBy,sortDirection:t.sortDirection,limit:s})},[n,a,s,t]),(0,c.useMemo)(()=>({rows:u,totalMatches:f,totalVisible:u.length,summary:m,hasMore:u.length<f,isIndexing:g,isLoading:v,error:b,loadMore:()=>l(e=>e+iy)}),[u,f,m,g,v,b])}function sy(e){return e.kind===`number`?0:1}function cy(e){return`adapter:${e}`}function ly(e){return e.startsWith(`adapter:`)}function uy(e,t){let n=Vn([e.adapterMetrics]).find(e=>e.key===t),r=n?zn(e.adapterMetrics,n.key):void 0;if(!(n==null||r===void 0))return{displayValue:Bn(n,r),sortValue:typeof r==`number`||typeof r==`string`?r:void 0,isScalar:!0}}function dy(e){let t=Vn(e.map(e=>e.adapterMetrics)).map(t=>({id:cy(t.key),key:t.key,label:t.shortLabel,kind:t.kind,align:t.kind===`number`?`end`:`start`,isScalar:!0,presenceCount:e.filter(e=>zn(e.adapterMetrics,t.key)!==void 0).length})).sort((e,t)=>{let n=sy(e),r=sy(t);return n===r?e.presenceCount===t.presenceCount?e.key.localeCompare(t.key):t.presenceCount-e.presenceCount:n-r});return{allColumns:t,visibleColumns:t.slice(0,6),overflowColumns:t.slice(6)}}function fy(e,t){return t.map(t=>{let n=uy(e,t.key);return`${t.label}: ${n?.displayValue??`—`}`}).join(`
|
|
35
|
+
`)}var py=`Raw adapter response fields`,my=`Adapter metrics`;function hy({row:e,visibleColumns:t,overflowColumns:n,onNavigateTo:r}){if(!e)return null;let i=e.adapterResponseFields?.length??0,a=Gn(e.adapterMetrics,e.adapterResponseFields),o=t.length>0||n.length>0?[...t.length>0?[{label:my,value:fy(e,t)}]:[],...n.length>0?[{label:`More adapter metrics`,value:fy(e,n)}]:[]]:e.adapterMetrics?[{label:my,value:`This row has normalized adapter metrics but none are configured as visible columns.`}]:[],s=i===0?[{label:py,value:`This row has no adapter_response fields.`}]:a.length>0?[{label:py,value:a.map(e=>`${e.label}: ${e.displayValue}`).join(`
|
|
36
|
+
`)}]:[],c=[...o,...s];return(0,u.jsx)(Ti,{eyebrow:`Selected run item`,title:e.name,typeLabel:Dr(e.resourceType),stats:[{label:`Status`,value:e.status},{label:`Duration`,value:Er(e.executionTime)},{label:`Thread`,value:e.threadId??`n/a`},{label:my,value:String(t.length+n.length)},{label:`Extra raw fields`,value:String(a.length)}],sections:c,actions:[{label:`Open in Timeline`,onClick:()=>r(`timeline`,{resourceId:e.uniqueId,executionId:e.uniqueId})},{label:`Open in Inventory`,onClick:()=>r(`inventory`,{resourceId:e.uniqueId,assetTab:`summary`})},{label:`Open in Lineage`,onClick:()=>r(`inventory`,{resourceId:e.uniqueId,assetTab:`lineage`,rootResourceId:e.uniqueId})}]})}function gy(e){if(ly(e))return`desc`;switch(e){case`attention`:case`duration`:case`start`:return`desc`;default:return`asc`}}function _y(e,t){return t.sortBy===e?{sortBy:e,sortDirection:t.sortDirection===`asc`?`desc`:`asc`}:{sortBy:e,sortDirection:gy(e)}}function vy(e,t,n){return e===t?n===`asc`?{indicator:`↑`,ariaSort:`ascending`}:{indicator:`↓`,ariaSort:`descending`}:{indicator:` `,ariaSort:`none`}}function yy(e){let t=[`minmax(280px, 2.5fr)`,`minmax(108px, 0.85fr)`,`minmax(92px, 0.7fr)`,`minmax(132px, 0.95fr)`,`minmax(96px, 0.72fr)`],n=e.map(e=>e.align===`end`?`minmax(120px, 0.95fr)`:`minmax(148px, 1.1fr)`);return[...t,...n,`minmax(160px, 1fr)`].join(` `)}function by(e,t){return uy(e,t.key)?.displayValue??`—`}var xy=`results-table__cell--align-end`;function Sy({sortKey:e,label:t,alignEnd:n,cellClassName:r,runsViewState:i,onRunsViewStateChange:a}){let o=vy(i.sortBy,e,i.sortDirection);return(0,u.jsx)(`div`,{className:`results-table__cell${r?` ${r}`:``}${n?` ${xy}`:``}`,role:`columnheader`,"aria-sort":o.ariaSort,children:(0,u.jsxs)(`button`,{type:`button`,className:`results-table__sort-button${n?` results-table__sort-button--align-end`:``}`,onClick:()=>a(t=>({...t,..._y(e,t)})),children:[t,(0,u.jsx)(`span`,{className:`results-table__sort-indicator`,"aria-hidden":`true`,children:o.indicator})]})})}function Cy({analysis:e,runsResults:t,runsViewState:n,adapterColumns:r,onRunsViewStateChange:i,onInvestigationSelectionChange:a}){let o=(0,c.useRef)(null),l=(0,c.useRef)(null),[d,f]=(0,c.useState)(44);(0,c.useLayoutEffect)(()=>{let e=l.current;if(!e||typeof ResizeObserver>`u`)return;let t=()=>{f(Math.max(1,Math.ceil(e.getBoundingClientRect().height)))};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[r.length]);let p=s({count:t.rows.length,getScrollElement:()=>o.current,estimateSize:()=>76,overscan:10,scrollMargin:d});(0,c.useEffect)(()=>{let e=o.current;if(!e)return;let n=()=>{e.scrollHeight-e.scrollTop-e.clientHeight<220&&t.hasMore&&!t.isLoading&&!t.isIndexing&&t.loadMore()};return e.addEventListener(`scroll`,n),n(),()=>e.removeEventListener(`scroll`,n)},[t]);let m={"--results-table-columns":yy(r)},h=Math.min(560,Math.max(120,t.rows.length*76)),g=p.options.scrollMargin;return(0,u.jsx)(`div`,{className:`results-table`,style:m,children:(0,u.jsxs)(`div`,{ref:o,className:`results-table__scroll`,style:{height:h,overflowY:`auto`,position:`relative`},children:[(0,u.jsxs)(`div`,{ref:l,className:`results-table__header results-table__header--sticky`,role:`row`,children:[(0,u.jsx)(Sy,{sortKey:`name`,label:`Item`,cellClassName:`results-table__cell--item`,runsViewState:n,onRunsViewStateChange:i}),(0,u.jsx)(Sy,{sortKey:`resourceType`,label:`Type`,runsViewState:n,onRunsViewStateChange:i}),(0,u.jsx)(Sy,{sortKey:`materialization`,label:`Materialization`,runsViewState:n,onRunsViewStateChange:i}),(0,u.jsx)(Sy,{sortKey:`status`,label:`Status`,runsViewState:n,onRunsViewStateChange:i}),(0,u.jsx)(Sy,{sortKey:`duration`,label:`Duration`,alignEnd:!0,runsViewState:n,onRunsViewStateChange:i}),r.map(e=>{let t=e.align===`end`;return e.isScalar?(0,u.jsx)(Sy,{sortKey:e.id,label:e.label,alignEnd:t,runsViewState:n,onRunsViewStateChange:i},e.id):(0,u.jsx)(`div`,{className:`results-table__cell${t?` ${xy}`:``}`,role:`columnheader`,title:e.label,children:e.label},e.id)}),(0,u.jsx)(Sy,{sortKey:`thread`,label:`Thread`,runsViewState:n,onRunsViewStateChange:i})]}),(0,u.jsx)(`div`,{className:`results-table__body`,children:(0,u.jsx)(`div`,{style:{height:p.getTotalSize(),position:`relative`},children:p.getVirtualItems().map(o=>{let s=t.rows[o.index];return s?(0,u.jsxs)(`button`,{type:`button`,className:`results-table__row${s.uniqueId===n.selectedExecutionId?` results-table__row--active`:``}`,style:{position:`absolute`,top:0,left:0,width:`100%`,transform:`translateY(${o.start-g}px)`},onClick:()=>{let t=e.resources.find(e=>e.uniqueId===s.uniqueId)??null;i(e=>({...e,selectedExecutionId:s.uniqueId})),a(e=>({...e,selectedExecutionId:s.uniqueId,selectedResourceId:t?.uniqueId??s.uniqueId,sourceLens:`runs`}))},children:[(0,u.jsx)(`div`,{className:`results-table__cell results-table__cell--item`,"data-label":`Item`,title:s.name,children:(0,u.jsx)(`strong`,{children:s.name})}),(0,u.jsx)(`div`,{className:`results-table__cell`,"data-label":`Type`,title:s.resourceType,children:s.resourceType}),(0,u.jsx)(`div`,{className:`results-table__cell`,"data-label":`Materialization`,children:s.semantics?(0,u.jsx)(ua,{semantics:s.semantics,variant:`compact`}):`—`}),(0,u.jsx)(`div`,{className:`results-table__cell`,"data-label":`Status`,children:(0,u.jsx)(`span`,{className:Mr(s.statusTone),children:s.status})}),(0,u.jsx)(`div`,{className:`results-table__cell ${xy}`,"data-label":`Duration`,children:Er(s.executionTime)}),r.map(e=>{let t=by(s,e);return(0,u.jsx)(`div`,{className:`results-table__cell${e.align===`end`?` ${xy}`:``}`,"data-label":e.label,title:t,children:t},e.id)}),(0,u.jsx)(`div`,{className:`results-table__cell`,"data-label":`Thread`,title:s.threadId??`n/a`,children:s.threadId??`n/a`})]},s.uniqueId):null})})})]})})}function wy({kinds:e,activeKinds:t,onToggleKind:n,buttonTitle:r}){return(0,u.jsx)(`div`,{className:`pill-row`,children:e.map(e=>(0,u.jsx)(`button`,{type:`button`,className:t.size===0||t.has(e)?vr:yr,title:r,onClick:()=>n(e),children:aa(e)},e))})}var Ty=[{label:`All`,countKey:`all`},{kind:`models`,label:`Models`,countKey:`models`},{kind:`tests`,label:`Tests`,countKey:`tests`},{kind:`seeds`,label:`Seeds`,countKey:`seeds`},{kind:`snapshots`,label:`Snapshots`,countKey:`snapshots`},{kind:`operations`,label:`Operations`,countKey:`operations`},{status:`positive`,label:`Healthy`,countKey:`healthy`},{status:`issues`,label:`Issues`,countKey:`issues`},{status:`warning`,label:`Warnings`,countKey:`warnings`},{status:`danger`,label:`Errors`,countKey:`errors`}];function Ey(e){return e.facets}function Dy({runsViewState:e,runsResults:t,adapterColumnLayout:n,adapterMetricsAvailable:r,availableMaterializationKinds:i,onRunsViewStateChange:a}){let o=n.visibleColumns.filter(e=>e.isScalar),s=e.showAdapterMetrics&&o.length>0;return(0,u.jsxs)(`div`,{className:`runs-toolbar runs-toolbar--stacked`,children:[(0,u.jsxs)(`div`,{className:`runs-toolbar__controls`,children:[(0,u.jsxs)(`label`,{className:`workspace-search workspace-search--compact runs-toolbar__search`,children:[(0,u.jsx)(`span`,{children:`Search`}),(0,u.jsx)(`input`,{value:e.query,onChange:e=>a(t=>({...t,query:e.target.value})),placeholder:`Filter by name, type, status, thread…`})]}),(0,u.jsxs)(`label`,{className:`workspace-search workspace-search--compact runs-toolbar__sort`,children:[(0,u.jsx)(`span`,{children:`Sort`}),(0,u.jsxs)(`select`,{value:e.sortBy,onChange:e=>{let t=e.target.value;a(e=>({...e,sortBy:t,sortDirection:gy(t)}))},children:[(0,u.jsx)(`option`,{value:`attention`,children:`Attention`}),(0,u.jsx)(`option`,{value:`duration`,children:`Duration`}),(0,u.jsx)(`option`,{value:`name`,children:`Name`}),(0,u.jsx)(`option`,{value:`status`,children:`Status`}),(0,u.jsx)(`option`,{value:`start`,children:`Start`}),(0,u.jsx)(`option`,{value:`materialization`,children:`Materialization`}),s?o.map(e=>(0,u.jsx)(`option`,{value:e.id,children:e.label},e.id)):null]})]}),(0,u.jsxs)(`label`,{className:`runs-toolbar__toggle`,title:r?`Show normalized adapter metrics derived from the current run`:`No normalized adapter metrics are available in this run`,children:[(0,u.jsx)(`input`,{type:`checkbox`,checked:e.showAdapterMetrics,disabled:!r,onChange:e=>{let t=e.target.checked;a(e=>({...e,showAdapterMetrics:t,sortBy:!t&&ly(e.sortBy)?`attention`:e.sortBy,sortDirection:!t&&ly(e.sortBy)?`desc`:e.sortDirection}))}}),(0,u.jsx)(`span`,{children:`Adapter metrics`})]})]}),i.length>0?(0,u.jsxs)(`div`,{className:`runs-toolbar__mat-filters`,role:`group`,"aria-label":`Materialization filters`,children:[(0,u.jsx)(`span`,{className:`runs-toolbar__mat-filters-label`,children:`Materialization (manifest)`}),(0,u.jsx)(wy,{kinds:i,activeKinds:e.materializationKinds,onToggleKind:e=>a(t=>{let n=new Set(t.materializationKinds);return n.has(e)?n.delete(e):n.add(e),{...t,materializationKinds:n}}),buttonTitle:`Filter run rows by normalized manifest materialization`})]}):null,e.showAdapterMetrics&&n.overflowColumns.length>0?(0,u.jsxs)(`p`,{className:`runs-toolbar__meta`,children:[`Showing `,n.visibleColumns.length,` of`,` `,n.allColumns.length,` adapter metrics. Select a row to inspect the remaining `,n.overflowColumns.length,`.`]}):null,(0,u.jsx)(`div`,{className:`runs-toolbar__facets`,children:Ty.map(n=>{let r=Ey(t.summary);return(0,u.jsxs)(`button`,{type:`button`,className:n.kind!=null&&e.kind===n.kind||n.status!=null&&e.status===n.status||n.kind==null&&n.status==null&&e.kind===`all`&&e.status===`all`?`workspace-pill workspace-pill--active`:`workspace-pill`,onClick:()=>a(e=>({...e,kind:n.kind??`all`,status:n.status??`all`})),children:[n.label,` (`,r[n.countKey],`)`]},n.label)})})]})}function Oy({analysis:e,runsViewState:t,onRunsViewStateChange:n,onInvestigationSelectionChange:r,onNavigateTo:i}){let a=(0,c.useMemo)(()=>dy(e.executions),[e.executions]),o=a.allColumns.length>0,s=(0,c.useMemo)(()=>t.showAdapterMetrics&&o?a.visibleColumns:[],[a.visibleColumns,o,t.showAdapterMetrics]),l=(0,c.useMemo)(()=>sa(e.executions.map(e=>e.semantics)),[e.executions]),d=(0,c.useMemo)(()=>t.showAdapterMetrics&&o?a.overflowColumns:[],[a.overflowColumns,o,t.showAdapterMetrics]);(0,c.useEffect)(()=>{let e=t.sortBy;ly(e)&&!s.some(t=>t.id===e&&t.isScalar)&&n(e=>({...e,sortBy:`attention`,sortDirection:`desc`}))},[n,t.sortBy,s]),(0,c.useEffect)(()=>{!o&&t.showAdapterMetrics&&n(e=>({...e,showAdapterMetrics:!1}))},[o,n,t.showAdapterMetrics]);let f=oy(e.executions,t,!0),p=e.executions.find(e=>e.uniqueId===t.selectedExecutionId)??null;return(0,u.jsx)(Ci,{title:`Runs`,description:`Execution and quality evidence across models, tests, seeds, snapshots, and operations.`,toolbar:(0,u.jsx)(Dy,{runsViewState:t,runsResults:f,adapterColumnLayout:a,adapterMetricsAvailable:o,availableMaterializationKinds:l,onRunsViewStateChange:n}),inspector:p?(0,u.jsx)(hy,{row:p,visibleColumns:s,overflowColumns:d,onNavigateTo:i}):null,className:`runs-view`,children:(0,u.jsx)(Cy,{analysis:e,runsResults:f,runsViewState:t,adapterColumns:s,onRunsViewStateChange:n,onInvestigationSelectionChange:r})})}var $={resourceTypeSummaryAriaLabel:`Run outcomes for executed dbt assets (non-test resources such as models and sources), grouped by resource type. Counts are how many assets succeeded versus had warnings or failures. These are not dbt test pass or fail totals.`,resourceTypeSummaryTitle:`Run outcomes for executed dbt assets by type (excludes tests). Not dbt test pass or fail totals.`,resourceTypeSummaryItemTitle(e){return`${e}: executed asset run outcomes for this type, not dbt test totals.`},treeTestStatsTitle:`Attention-only rollup of executed dbt test outcomes for this folder or row: failed or errored, warning, and dbt-skipped. Passing tests and tests with no run result (not executed) are not shown here. A test that depends on multiple resources may be counted more than once in folder totals.`,treeTestStatsBranchAriaLabel:`Dbt test attention rollup for resources in this folder: failed or error, warning, and skipped counts only. Passing tests and not-executed tests are not shown. Tests with multiple upstream dependencies may be counted more than once when summed at higher folders.`,treeTestStatsLeafAriaLabel:`Dbt test attention outcomes for this resource: failed or error, warning, and skipped only. Passing tests and not-executed tests are not shown.`,treeTestStatErrorTitle(e){return`Failed or errored dbt test attachments: ${e}`},treeTestStatWarnTitle(e){return`Warning dbt test attachments: ${e}`},treeTestStatSkippedTitle(e){return`Dbt skipped or no-op test attachments: ${e}. Folder rollups may count one test multiple times when it depends on several resources.`},treeEmptyHeadline:`No resources found`,treeEmptyDefaultSubtext:`Adjust filters or search to find matching branches or assets.`,treeEmptySearchSubtext:`Try clearing or changing the resource search box.`,treeEmptyResourceTypesSubtext:`One or more dbt resource types are narrowed; add types or reset type filters to see more assets.`,treeEmptyMaterializationSubtext:`Materialization filters are narrowing the tree; clear or broaden them to see more assets (values come from manifest metadata).`,treeEmptyExecutionFilterSubtext(e){switch(e){case`danger`:return`Execution status is Fail: only assets with a failed or errored result in this run are shown. Assets without a run row are treated as Not executed, not Fail. For models whose run succeeded but dbt tests failed, use Issues. Try Execution status All, or confirm run results are loaded for this workspace.`;case`issues`:return`Execution status is Issues: assets with a failed or errored run result, or with failed, warned, or skipped dbt test attachments in this run. Fail shows execution failures only.`;case`neutral`:return`Execution status is Not executed: only assets without a matching run result (or unknown status) are shown. Try All or confirm run results are loaded.`;case`positive`:return`Execution status is Success: only successful runs are shown. Try All or adjust other filters.`;case`warning`:return`Execution status is Warn: only warned runs are shown. Try All or adjust other filters.`;case`skipped`:return`Execution status is Skipped: only skipped runs are shown. Try All or adjust other filters.`;default:return``}},executionStatusSectionTitle:`Filter by run & tests`,executionStatusRunOutcomeSubLabel:`Run outcome`,executionStatusProblemsSubLabel:`Run + dbt tests`};function ky(e){switch(e){case`all`:return`All`;case`positive`:return`Success`;case`warning`:return`Warn`;case`danger`:return`Fail (run)`;case`skipped`:return`Skipped`;case`neutral`:return`Not executed`;case`issues`:return`Issues (run or tests)`;default:return e}}function Ay(e){return e===`all`?`Show all assets regardless of run outcome or attached dbt test results.`:$.treeEmptyExecutionFilterSubtext(e)}function jy(e){let t=[];return e.status!==`all`&&t.push($.treeEmptyExecutionFilterSubtext(e.status)),e.resourceQuery.trim()&&t.push($.treeEmptySearchSubtext),e.activeResourceTypeCount>0&&t.push($.treeEmptyResourceTypesSubtext),(e.activeMaterializationKindCount??0)>0&&t.push($.treeEmptyMaterializationSubtext),t.length===0?$.treeEmptyDefaultSubtext:t.join(` `)}var My=`dbt-tools.explorerFiltersExpanded`;function Ny(){try{let e=window.localStorage.getItem(My);if(e!==null)return e===`true`}catch{}return!1}function Py({filtersExpanded:e,setFiltersExpandedPersisted:t,activeFilterCount:n,filterSummary:r,resourceQuery:i,setResourceQuery:a,status:o,setStatus:s,availableResourceTypes:c,activeResourceTypes:l,toggleResourceType:d,availableMaterializationKinds:f,activeMaterializationKinds:p,toggleMaterializationKind:m}){return(0,u.jsxs)(`section`,{className:`explorer-filters`,"aria-label":`Explorer filters`,children:[(0,u.jsxs)(`button`,{type:`button`,className:`explorer-filters__toggle`,"aria-expanded":e,onClick:()=>t(!e),children:[(0,u.jsxs)(`span`,{className:`explorer-filters__toggle-copy`,children:[(0,u.jsx)(`span`,{className:`explorer-filters__toggle-label`,children:`Filters`}),(0,u.jsx)(`span`,{className:`explorer-filters__toggle-summary`,children:r})]}),(0,u.jsxs)(`span`,{className:`explorer-filters__toggle-meta`,children:[n>0&&(0,u.jsx)(`span`,{className:`explorer-filters__badge`,children:n}),(0,u.jsx)(`span`,{className:`explorer-filters__chevron${e?` explorer-filters__chevron--expanded`:``}`,"aria-hidden":`true`,children:`▾`})]})]}),e&&(0,u.jsxs)(`div`,{className:`explorer-filter-stack`,children:[(0,u.jsxs)(`label`,{className:`workspace-search`,children:[(0,u.jsx)(`span`,{children:`Search resources`}),(0,u.jsx)(`input`,{value:i,onChange:e=>a(e.target.value),placeholder:`Filter tree by name, path, type, or id`})]}),(0,u.jsxs)(`div`,{className:`explorer-filter-group`,children:[(0,u.jsx)(`span`,{className:`explorer-filter-group__label`,children:$.executionStatusSectionTitle}),(0,u.jsxs)(`div`,{className:`explorer-status-filters`,children:[(0,u.jsxs)(`div`,{className:`explorer-status-filters__block`,children:[(0,u.jsx)(`span`,{className:`explorer-status-filters__sublabel`,id:`explorer-status-run-outcome-label`,children:$.executionStatusRunOutcomeSubLabel}),(0,u.jsx)(`div`,{className:`pill-row`,role:`group`,"aria-labelledby":`explorer-status-run-outcome-label`,children:[`all`,`positive`,`warning`,`danger`,`skipped`,`neutral`].map(e=>(0,u.jsx)(`button`,{type:`button`,className:o===e?`workspace-pill workspace-pill--active`:`workspace-pill`,title:Ay(e),"aria-label":`${ky(e)}. ${Ay(e)}`,onClick:()=>s(e),children:ky(e)},e))})]}),(0,u.jsxs)(`div`,{className:`explorer-status-filters__block explorer-status-filters__block--problems`,children:[(0,u.jsx)(`span`,{className:`explorer-status-filters__sublabel`,id:`explorer-status-problems-label`,children:$.executionStatusProblemsSubLabel}),(0,u.jsx)(`div`,{className:`pill-row`,role:`group`,"aria-labelledby":`explorer-status-problems-label`,children:(0,u.jsx)(`button`,{type:`button`,className:o===`issues`?`workspace-pill workspace-pill--active`:`workspace-pill`,title:Ay(`issues`),"aria-label":`${ky(`issues`)}. ${Ay(`issues`)}`,onClick:()=>s(`issues`),children:ky(`issues`)})})]})]})]}),c.length>0&&(0,u.jsxs)(`div`,{className:`explorer-filter-group`,children:[(0,u.jsx)(`span`,{className:`explorer-filter-group__label`,children:`dbt resource type`}),(0,u.jsx)(`div`,{className:`pill-row`,children:c.map(e=>(0,u.jsx)(`button`,{type:`button`,className:l.size===0||l.has(e)?`workspace-pill workspace-pill--active`:`workspace-pill`,onClick:()=>d(e),children:Dr(e)},e))})]}),f.length>0&&(0,u.jsxs)(`div`,{className:`explorer-filter-group`,children:[(0,u.jsx)(`span`,{className:`explorer-filter-group__label`,children:`Materialization (manifest)`}),(0,u.jsx)(wy,{kinds:f,activeKinds:p,onToggleKind:m,buttonTitle:`Filter by normalized config.materialized / resource kind`})]})]})]})}function Fy(e){let t=Dr(e.resourceType),n=xa(e);return n?`${e.name}, ${t}, file ${n}`:`${e.name}, ${t}`}function Iy({testStats:e,variant:t}){if(!pa(e))return null;let n=t===`branch`?$.treeTestStatsBranchAriaLabel:$.treeTestStatsLeafAriaLabel;return(0,u.jsxs)(`span`,{className:`explorer-tree__test-stats-wrap`,role:`group`,"aria-label":n,title:$.treeTestStatsTitle,children:[(0,u.jsx)(`span`,{className:`explorer-tree__test-stats-label`,"aria-hidden":`true`,children:`Test issues`}),(0,u.jsxs)(`span`,{className:`explorer-tree__test-stats`,children:[e.error>0&&(0,u.jsxs)(`span`,{className:`explorer-tree__test-stat explorer-tree__test-stat--fail`,title:$.treeTestStatErrorTitle(e.error),children:[`✗`,e.error]}),e.warn>0&&(0,u.jsxs)(`span`,{className:`explorer-tree__test-stat explorer-tree__test-stat--warn`,title:$.treeTestStatWarnTitle(e.warn),children:[`!`,e.warn]}),e.skipped>0&&(0,u.jsxs)(`span`,{className:`explorer-tree__test-stat explorer-tree__test-stat--skipped`,title:$.treeTestStatSkippedTitle(e.skipped),children:[`−`,e.skipped]})]})]})}function Ly({virtualRow:e,measureRow:t,children:n}){return(0,u.jsx)(`div`,{"data-index":e.index,ref:t,className:`explorer-tree__virtual-row`,style:{position:`absolute`,top:0,left:0,width:`100%`,transform:`translateY(${e.start}px)`},children:n})}function Ry({treeRows:e,explorerMode:t,expandedNodeIds:n,toggleExpandedNode:r,selectedResourceId:i,setSelectedResourceId:a,treeEmptyDisplay:o}){let l=(0,c.useRef)(null),d=s({count:e.length,getScrollElement:()=>l.current,estimateSize:()=>30,overscan:16}),f=d.measureElement;return e.length===0?(0,u.jsx)(`div`,{ref:l,className:`explorer-tree`,children:(0,u.jsx)($r,{icon:`🔍`,headline:o?.headline??$.treeEmptyHeadline,subtext:o?.subtext??$.treeEmptyDefaultSubtext})}):(0,u.jsx)(`div`,{ref:l,className:`explorer-tree`,children:(0,u.jsx)(`div`,{className:`explorer-tree__virtual-spacer`,style:{height:d.getTotalSize(),width:`100%`,position:`relative`},children:d.getVirtualItems().map(o=>{let s=e[o.index];if(!s)return null;let{node:c,depth:l}=s;if(c.kind===`branch`){let e=n.has(c.id);return(0,u.jsx)(Ly,{virtualRow:o,measureRow:f,children:(0,u.jsxs)(`button`,{type:`button`,className:`explorer-tree__row explorer-tree__row--branch`,style:{paddingLeft:`${.9+l*1.05}rem`},onClick:()=>r(c.id),children:[(0,u.jsx)(`span`,{className:`explorer-tree__chevron${e?` explorer-tree__chevron--expanded`:``}`,"aria-hidden":`true`,children:`▸`}),(0,u.jsx)(`span`,{className:`explorer-tree__folder`,"aria-hidden":`true`,children:(0,u.jsx)(Si,{mode:t,depth:l})}),(0,u.jsx)(`span`,{className:`explorer-tree__label`,children:c.label}),c.testStats&&(0,u.jsx)(Iy,{testStats:c.testStats,variant:`branch`})]})},o.key)}let d=c.resource;return(0,u.jsx)(Ly,{virtualRow:o,measureRow:f,children:(0,u.jsxs)(`button`,{type:`button`,className:d.uniqueId===i?`explorer-tree__row explorer-tree__row--leaf explorer-tree__row--active`:`explorer-tree__row explorer-tree__row--leaf`,style:{paddingLeft:`${.9+l*1.05}rem`},onClick:()=>a(d.uniqueId),title:d.uniqueId,"aria-label":Fy(d),children:[(0,u.jsx)(`span`,{className:`explorer-tree__leaf-icon`,"aria-hidden":`true`,children:(0,u.jsx)(xi,{resourceType:d.resourceType})}),(0,u.jsx)(`span`,{className:`explorer-tree__resource-body`,children:(0,u.jsx)(`span`,{className:`explorer-tree__label`,children:d.name})}),d.semantics?(0,u.jsx)(ua,{semantics:d.semantics,variant:`compact`}):null,c.testStats&&(0,u.jsx)(Iy,{testStats:c.testStats,variant:`leaf`})]})},o.key)})})})}function zy({mode:e}){return e===`project`?(0,u.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,children:(0,u.jsx)(`path`,{d:`M3.5 7.5h6l1.8 2h8.7v7.8a1.2 1.2 0 0 1-1.2 1.2H4.7a1.2 1.2 0 0 1-1.2-1.2V8.7a1.2 1.2 0 0 1 1.2-1.2Z`})}):e===`database`?(0,u.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,children:[(0,u.jsx)(`ellipse`,{cx:`12`,cy:`6.2`,rx:`6.5`,ry:`2.7`}),(0,u.jsx)(`path`,{d:`M5.5 6.2v5.6c0 1.5 2.9 2.7 6.5 2.7s6.5-1.2 6.5-2.7V6.2`}),(0,u.jsx)(`path`,{d:`M5.5 11.8v5.8c0 1.5 2.9 2.7 6.5 2.7s6.5-1.2 6.5-2.7v-5.8`})]}):null}function By({resources:e}){let t=e.filter(e=>!H.has(e.resourceType)&&e.statusTone!==`neutral`);if(t.length===0)return null;let n=new Map;for(let e of t){let t=n.get(e.resourceType)??{pass:0,fail:0};e.statusTone===`positive`?t.pass++:(e.statusTone===`danger`||e.statusTone===`warning`)&&t.fail++,n.set(e.resourceType,t)}let r=Array.from(n.entries()).sort(([e],[t])=>e.localeCompare(t));return(0,u.jsx)(`div`,{className:`resource-type-summary`,"aria-label":$.resourceTypeSummaryAriaLabel,title:$.resourceTypeSummaryTitle,children:r.map(([e,{pass:t,fail:n}])=>{let r=Dr(e);return(0,u.jsxs)(`span`,{className:`resource-type-summary__item`,title:$.resourceTypeSummaryItemTitle(r),children:[(0,u.jsx)(`span`,{className:`resource-type-summary__type`,children:r}),t>0&&(0,u.jsxs)(`span`,{className:`resource-type-summary__pass`,children:[`✓`,t]}),n>0&&(0,u.jsxs)(`span`,{className:`resource-type-summary__fail`,children:[`✗`,n]})]},e)})})}function Vy({treeRows:e,filteredResources:t,totalResources:n,matchedResources:r,explorerMode:i,setExplorerMode:a,status:o,setStatus:s,availableResourceTypes:l,activeResourceTypes:d,toggleResourceType:f,availableMaterializationKinds:p,activeMaterializationKinds:m,toggleMaterializationKind:h,resourceQuery:g,setResourceQuery:_,selectedResourceId:v,expandedNodeIds:y,toggleExpandedNode:b,setSelectedResourceId:x}){let[S,C]=(0,c.useState)(Ny),w=e=>{C(e);try{window.localStorage.setItem(My,String(e))}catch{}},T=(g.trim()?1:0)+(o===`all`?0:1)+(d.size>0?1:0)+(m.size>0?1:0),E=T>0?`${T} active`:`Search, status, and type`;return(0,u.jsxs)(`aside`,{className:`explorer-pane`,children:[(0,u.jsxs)(`div`,{className:`explorer-pane__header`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`p`,{className:`eyebrow`,children:`Asset explorer`}),(0,u.jsx)(`h2`,{children:`Workspace inventory`})]}),(0,u.jsxs)(`div`,{className:`explorer-pane__count`,children:[r,r!==n&&(0,u.jsxs)(`span`,{className:`explorer-pane__count-subtext`,children:[`of `,n]})]})]}),(0,u.jsx)(`div`,{className:`explorer-mode-tabs`,role:`tablist`,"aria-label":`Explorer modes`,children:[`project`,`database`].map(e=>(0,u.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":i===e,className:i===e?`explorer-mode-tab explorer-mode-tab--active`:`explorer-mode-tab`,onClick:()=>a(e),children:[(0,u.jsx)(`span`,{className:`explorer-mode-tab__icon`,"aria-hidden":`true`,children:(0,u.jsx)(zy,{mode:e})}),wr[e]]},e))}),(0,u.jsx)(Py,{filtersExpanded:S,setFiltersExpandedPersisted:w,activeFilterCount:T,filterSummary:E,resourceQuery:g,setResourceQuery:_,status:o,setStatus:s,availableResourceTypes:l,activeResourceTypes:d,toggleResourceType:f,availableMaterializationKinds:p,activeMaterializationKinds:m,toggleMaterializationKind:h}),(0,u.jsx)(By,{resources:t}),(0,u.jsx)(Ry,{treeRows:e,explorerMode:i,expandedNodeIds:y,toggleExpandedNode:b,selectedResourceId:v,setSelectedResourceId:x,treeEmptyDisplay:e.length===0?{headline:$.treeEmptyHeadline,subtext:jy({status:o,resourceQuery:g,activeResourceTypeCount:d.size,activeMaterializationKindCount:m.size})}:void 0})]})}function Hy(e,t,n,r,i,a,o){(0,c.useEffect)(()=>{if(e.length===0||a==null)return;let t=Ma(e,a);t.size!==0&&o(e=>[...t].filter(t=>!e.expandedNodeIds.has(t)).length===0?e:{...e,expandedNodeIds:new Set([...e.expandedNodeIds,...t])})},[e,o,a]),(0,c.useEffect)(()=>{if(i!==`project`||a!=null||e.length===0||n.size>0)return;let s=Ea(r);t.has(s)&&o(e=>e.explorerMode!==`project`||e.selectedResourceId!=null||e.expandedNodeIds.has(s)?e:{...e,expandedNodeIds:new Set([...e.expandedNodeIds,s])})},[t,i,n.size,e.length,o,r,a])}function Uy(e){return e===`inventory`}function Wy({analysis:e,projectName:t,activeView:n,assetViewState:r,onAssetViewStateChange:i,onInvestigationSelectionChange:a}){let o=(0,c.useMemo)(()=>r.explorerMode!==`project`||t==null?e.resources:e.resources.filter(e=>Hr(e,t)),[e.resources,r.explorerMode,t]),s=(0,c.useMemo)(()=>Array.from(new Set(o.map(e=>e.resourceType))).sort(),[o]),l=(0,c.useMemo)(()=>sa(o.map(e=>e.semantics)),[o]),d=(0,c.useMemo)(()=>ma(o,e.dependencyIndex),[e.dependencyIndex,o]),f=(0,c.useMemo)(()=>o.filter(e=>Ir(e,r.status,d)&&Lr(e,r.resourceTypes)&&Rr(e,r.materializationKinds)&&Fr(e,r.resourceQuery)),[r.materializationKinds,r.resourceQuery,r.resourceTypes,r.status,d,o]),p=(0,c.useMemo)(()=>Da(f,r.explorerMode,t,e.dependencyIndex),[e.dependencyIndex,r.explorerMode,f,t]),m=(0,c.useMemo)(()=>ka(p),[p]),h=(0,c.useMemo)(()=>new Set([...r.expandedNodeIds].filter(e=>m.has(e))),[m,r.expandedNodeIds]),g=(0,c.useMemo)(()=>Oa(p,h),[h,p]),_=(0,c.useMemo)(()=>Aa(p),[p]),v=r.selectedResourceId;return Hy(p,m,h,t,r.explorerMode,v,i),{explorerPane:Uy(n)?(0,u.jsx)(Vy,{treeRows:g,filteredResources:f,totalResources:o.length,matchedResources:_.length,explorerMode:r.explorerMode,setExplorerMode:e=>i(t=>({...t,explorerMode:e})),status:r.status,setStatus:e=>i(t=>({...t,status:e})),availableResourceTypes:s,activeResourceTypes:r.resourceTypes,toggleResourceType:e=>i(t=>{let n=new Set(t.resourceTypes);return n.has(e)?n.delete(e):n.add(e),{...t,resourceTypes:n}}),availableMaterializationKinds:l,activeMaterializationKinds:r.materializationKinds,toggleMaterializationKind:e=>i(t=>{let n=new Set(t.materializationKinds);return n.has(e)?n.delete(e):n.add(e),{...t,materializationKinds:n}}),resourceQuery:r.resourceQuery,setResourceQuery:e=>i(t=>({...t,resourceQuery:e})),selectedResourceId:v,expandedNodeIds:h,toggleExpandedNode:e=>i(t=>{let n=new Set(t.expandedNodeIds);return n.has(e)?n.delete(e):n.add(e),{...t,expandedNodeIds:n}}),setSelectedResourceId:e=>{i(t=>({...t,selectedResourceId:e})),a(t=>({...t,selectedResourceId:e,sourceLens:`inventory`}))}}):null}}function Gy({analysis:e,activeView:t,analysisSource:n,overviewFilters:r,onOverviewFiltersChange:i,timelineFilters:a,onTimelineFiltersChange:o,assetViewState:s,onAssetViewStateChange:c,runsViewState:l,onRunsViewStateChange:d,lineageViewState:f,onLineageViewStateChange:p,onInvestigationSelectionChange:m,onNavigateTo:h,workspaceSignals:g}){let _=e.projectName??Vr(e.executions),{explorerPane:v}=Wy({analysis:e,projectName:_,activeView:t,assetViewState:s,onAssetViewStateChange:c,onInvestigationSelectionChange:m}),y=s.selectedResourceId,b=e.resources.find(e=>e.uniqueId===y)??null;return(0,u.jsxs)(`div`,{className:`workspace-layout${v?``:` workspace-layout--full`}`,children:[v,(0,u.jsxs)(`div`,{className:`workspace-main-panel`,children:[t===`health`&&(0,u.jsx)(la,{analysis:e,projectName:_,analysisSource:n,filters:r,setFilters:i,workspaceSignals:g}),t===`inventory`&&(0,u.jsx)(Gg,{analysis:e,resource:b,onSelectResource:e=>c(t=>({...t,selectedResourceId:e})),assetViewState:{...s,selectedResourceId:y},onAssetViewStateChange:c,lineageViewState:f,onLineageViewStateChange:p,onInvestigationSelectionChange:m,onNavigateTo:h}),t===`runs`&&(0,u.jsx)(Oy,{analysis:e,runsViewState:l,onRunsViewStateChange:d,onInvestigationSelectionChange:m,onNavigateTo:h}),t===`timeline`&&(0,u.jsx)(ry,{analysis:e,filters:a,setFilters:o,onInvestigationSelectionChange:m})]})]})}var Ky=(0,c.createContext)({toast:()=>{}}),qy=0,Jy=4e3;function Yy({children:e}){let[t,n]=(0,c.useState)([]),r=(0,c.useCallback)((e,t=`neutral`)=>{let r=++qy;n(n=>[...n,{id:r,message:e,tone:t}]),setTimeout(()=>{n(e=>e.filter(e=>e.id!==r))},Jy)},[]);function i(e){n(t=>t.filter(t=>t.id!==e))}return(0,u.jsxs)(Ky.Provider,{value:{toast:r},children:[e,t.length>0&&(0,u.jsx)(`div`,{className:`toast-portal`,role:`status`,"aria-live":`polite`,children:t.map(e=>(0,u.jsxs)(`div`,{className:`toast toast--${e.tone}`,children:[(0,u.jsx)(`span`,{className:`toast__dot`,"aria-hidden":`true`}),(0,u.jsx)(`span`,{className:`toast__message`,children:e.message}),(0,u.jsx)(`button`,{type:`button`,className:`toast__dismiss`,"aria-label":`Dismiss notification`,onClick:()=>i(e.id),children:`✕`})]},e.id))})]})}function Xy(){return(0,c.useContext)(Ky)}var Zy={manifest:`/api/manifest.json`,runResults:`/api/run_results.json`,catalog:`/api/catalog.json`,sources:`/api/sources.json`},Qy=[{manifest:`/api/artifacts/current/manifest.json`,runResults:`/api/artifacts/current/run_results.json`,catalog:`/api/artifacts/current/catalog.json`,sources:`/api/artifacts/current/sources.json`},Zy];function $y(){return{checkedAtMs:Date.now(),remoteProvider:null,remoteLocation:null,pollIntervalMs:null,currentRun:null,pendingRun:null,supportsSwitch:!1,needsSelection:!1,candidates:void 0,discoveryError:null,sourceKind:null,locationDisplay:null,missingOptionalArtifacts:void 0}}function eb(e,t,n){return{mode:e,currentSource:t,label:n,...$y()}}async function tb(e){let t=await fetch(e);if(!t.ok)return null;let n=t.headers?.get?.(`content-type`)?.toLowerCase();return n!=null&&!n.includes(`application/json`)?null:t.arrayBuffer()}async function nb(e){try{return await tb(e)}catch{return null}}async function rb(e){try{return await tb(e)}catch{return null}}async function ib(e){let[t,n,r,i]=await Promise.all([nb(e.manifest),nb(e.runResults),rb(e.catalog),rb(e.sources)]);return t==null||n==null?null:{manifestBytes:t,runResultsBytes:n,...r==null?{}:{catalogBytes:r},...i==null?{}:{sourcesBytes:i}}}async function ab(e=Qy){for(let t of e){let e=await ib(t);if(e!=null)return e}return null}async function ob(){let e=await ab([Zy]);return e==null?null:C(e,`preload`)}async function sb(){let e=await ob();return{status:eb(e==null?`none`:`preload`,e==null?null:`preload`,e==null?`Waiting for artifacts`:`Live target`),result:e}}async function cb(){let e=await fetch(`/api/artifact-source`);if(!e.ok)throw Error(`Failed to load artifact source status`);return await e.json()}async function lb(e=`preload`){let t=await ab();return t==null?null:C(t,e)}async function ub(){let e;try{e=await fetch(`/api/artifact-source`)}catch{return sb()}if(e.status===404||!e.ok)return sb();let t;try{t=await e.json()}catch{return sb()}return t.currentSource==null?{status:t,result:null}:{status:t,result:await lb(t.currentSource)}}async function db(e){let t=await fetch(`/api/artifact-source/switch`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e?{runId:e}:{})});if(!t.ok)throw Error(`Failed to switch artifact source run`);return await t.json()}async function fb(e,t){let n=await fetch(`/api/artifact-source/discover`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({type:e,location:t})}),r=await n.json().catch(()=>({}));if(!n.ok){let e=typeof r.error==`string`&&r.error.trim()!==``?r.error:`Failed to configure artifact source`;throw Error(e)}return r}async function pb(e,t,n){let r=await fetch(`/api/artifact-source/configure`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({type:e,location:t,...n!=null&&n.trim()!==``?{runId:n}:{}})}),i=await r.json().catch(()=>({}));if(!r.ok){let e=typeof i.error==`string`&&i.error.trim()!==``?i.error:`Failed to configure artifact source`;throw Error(e)}return i}function mb(e){return e===`local`?`/path/to/target or relative/path`:e===`s3`?`s3://bucket/prefix or bucket/prefix`:`gs://bucket/prefix or bucket/prefix`}function hb(e){let t=e.selectedRunId!=null&&e.selectedRunId.trim()!==``;return e.discoverLoading?`Scanning for artifact runs…`:e.discoveryError?e.discoveryError:e.candidateRunIds.length>0&&t?`Ready to load the workspace.`:e.candidateRunIds.length>1&&!t?`Pick a candidate set, then load.`:e.location.trim()===``?`Enter a location, then press Enter or move focus away to scan.`:e.candidateRunIds.length===0?`Press Enter or leave the Location field to scan for artifact runs.`:`Press Enter or leave the field to refresh the scan, then load.`}function gb(e){if(e.loadLoading)return`Loading artifact workspace…`;if(e.canLoad)return;if(e.discoverLoading)return`Scanning for artifact runs…`;if(e.discoveryError!=null)return e.discoveryError;if(e.location.trim()===``)return`Enter a path, then press Enter or leave the Location field to scan.`;if(e.candidateRunIds.length===0)return`Press Enter or blur Location to scan, then click Load workspace.`;let t=e.selectedRunId!=null&&e.selectedRunId.trim()!==``;return e.candidateRunIds.length>1&&!t?`Pick a candidate run, then click Load workspace.`:`Press Enter or blur Location to scan, then click Load workspace.`}function _b({readinessRegionId:e,readinessLabel:t,sourceKind:n,onSourceKindChange:r,location:i,onLocationChange:a,onLocationBlur:o,onLocationKeyDown:s,candidateRunIds:c,selectedRunId:l,onSelectRunId:d,discoverLoading:f,canLoad:p,loadLoading:m,loadWorkspaceHint:h,onLoadWorkspace:g}){return(0,u.jsxs)(`div`,{className:`upload-panel`,children:[(0,u.jsxs)(`div`,{className:`upload-panel__header`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`p`,{className:`eyebrow`,children:`Artifact source`}),(0,u.jsx)(`h3`,{children:`Configure directory or prefix`})]}),(0,u.jsx)(`span`,{id:e,className:`upload-panel__status`,role:`status`,children:f?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(Ig,{size:16}),` `,t]}):t})]}),(0,u.jsxs)(`div`,{className:`upload-panel__inputs artifact-load-panel__inputs`,children:[(0,u.jsxs)(`div`,{className:`file-input-card`,children:[(0,u.jsx)(`label`,{htmlFor:`artifact-source-kind`,children:`Source type`}),(0,u.jsxs)(`select`,{id:`artifact-source-kind`,value:n,onChange:e=>r(e.target.value),children:[(0,u.jsx)(`option`,{value:`local`,children:`Local directory`}),(0,u.jsx)(`option`,{value:`s3`,children:`Amazon S3`}),(0,u.jsx)(`option`,{value:`gcs`,children:`Google Cloud Storage`})]})]}),(0,u.jsxs)(`div`,{className:`file-input-card`,children:[(0,u.jsx)(`label`,{htmlFor:`artifact-location-input`,children:`Location`}),(0,u.jsx)(`input`,{id:`artifact-location-input`,type:`text`,autoComplete:`off`,placeholder:mb(n),value:i,onChange:e=>a(e.target.value),onBlur:o,onKeyDown:s})]}),c.length>0?(0,u.jsxs)(`fieldset`,{className:`file-input-card`,children:[(0,u.jsxs)(`legend`,{children:[`Candidate sets`,c.length>1?` — choose one before loading.`:null]}),c.map(e=>(0,u.jsxs)(`label`,{className:`artifact-load-panel__radio-row`,htmlFor:`artifact-run-${e}`,children:[(0,u.jsx)(`input`,{id:`artifact-run-${e}`,type:`radio`,name:`artifact-run`,value:e,checked:l===e,onChange:()=>d(e)}),(0,u.jsx)(`span`,{children:e})]},e))]}):null]}),(0,u.jsxs)(`div`,{className:`upload-panel__tips`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`strong`,{children:`Local paths`}),(0,u.jsxs)(`span`,{children:[`Resolved on the machine running the dev server or`,` `,(0,u.jsx)(`code`,{children:`dbt-tools-web`}),`, not in your browser.`]})]}),(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`strong`,{children:`S3 and GCS`}),(0,u.jsx)(`span`,{children:`Use default SDK credential chains on the server. UI never receives cloud keys.`})]})]}),(0,u.jsx)(`div`,{className:`artifact-load-panel__actions artifact-load-panel__actions--load-only`,children:(0,u.jsx)(`button`,{type:`button`,className:`primary-action`,disabled:!p||c.length===0||m,"aria-busy":m,"aria-describedby":e,title:h??void 0,onClick:()=>{g()},children:m?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(Ig,{size:16}),` Loading…`]}):`Load workspace`})})]})}var vb=[{title:`Health-first overview`,body:`Spot failing nodes, long-running bottlenecks, and critical-path pressure before opening individual assets.`},{title:`Catalog-style context`,body:`Browse lineage-adjacent metadata such as descriptions, packages, execution status, and dependency depth in one flow.`},{title:`Timeline investigation`,body:`Shift from summary to execution sequencing without leaving the workspace, inspired by dbt docs and observability tools.`}];function yb(){return(0,u.jsxs)(`div`,{className:`upload-hero__copy`,children:[(0,u.jsx)(`p`,{className:`eyebrow`,children:`Load artifacts`}),(0,u.jsx)(`h2`,{children:`Point the workspace at a directory or cloud prefix that contains dbt JSON artifacts.`}),(0,u.jsxs)(`p`,{children:[`The server discovers `,(0,u.jsx)(`code`,{children:`manifest.json`}),` and`,` `,(0,u.jsx)(`code`,{children:`run_results.json`}),` (required), plus optional`,` `,(0,u.jsx)(`code`,{children:`catalog.json`}),` and `,(0,u.jsx)(`code`,{children:`sources.json`}),`. Cloud access uses server-side credentials only.`]}),(0,u.jsxs)(`div`,{className:`upload-hero__callout`,children:[(0,u.jsx)(`span`,{className:`upload-hero__callout-badge`,children:`Layout`}),(0,u.jsx)(`strong`,{children:`Artifacts at the location root or one subdirectory deep.`}),(0,u.jsx)(`p`,{children:`Multiple complete pairs under the same location require an explicit choice—nothing is auto-picked when several candidates exist.`})]}),(0,u.jsx)(`div`,{className:`upload-feature-grid`,children:vb.map(e=>(0,u.jsxs)(`article`,{className:`upload-feature-card`,children:[(0,u.jsx)(`strong`,{children:e.title}),(0,u.jsx)(`p`,{children:e.body})]},e.title))})]})}function bb({onManagedLoad:e,onError:t}){let{toast:n}=Xy(),r=(0,c.useId)(),[i,a]=(0,c.useState)(`local`),[o,s]=(0,c.useState)(``),[l,d]=(0,c.useState)(!1),[f,p]=(0,c.useState)(!1),[m,h]=(0,c.useState)([]),[g,_]=(0,c.useState)(null),[v,y]=(0,c.useState)(null),b=(0,c.useRef)(o),x=(0,c.useRef)(i);b.current=o,x.current=i;let S=(0,c.useRef)(0),C=(0,c.useRef)(``),w=(0,c.useMemo)(()=>({discoverLoading:l,discoveryError:v,candidateRunIds:m,selectedRunId:g,location:o}),[m,l,v,o,g]),T=(0,c.useMemo)(()=>hb(w),[w]),E=m.length>0&&g!=null&&g.trim()!==``&&!f&&v==null,D=(0,c.useMemo)(()=>gb({...w,loadLoading:f,canLoad:E}),[E,f,w]),O=(0,c.useCallback)(async r=>{if(r.trim()===``){t(`Select a candidate artifact set.`);return}p(!0),t(null);try{let i=await pb(x.current,b.current.trim(),r),a=i.currentSource;if(a!==`preload`&&a!==`remote`){t(`Artifacts are not ready to load.`);return}let o=i.missingOptionalArtifacts??{missingCatalog:!1,missingSources:!1};if(o.missingCatalog||o.missingSources){let e=[];o.missingCatalog&&e.push(`catalog.json`),o.missingSources&&e.push(`sources.json`),n(`Optional artifacts not loaded: ${e.join(`, `)}. Related inventory panels may be limited.`,`positive`)}let s=await lb(a);if(s==null){t(`Could not read artifact bytes from the server.`);return}e(s,a,o)}catch(e){let r=e instanceof Error?e.message:`Failed to load artifacts.`;t(r),n(r,`danger`)}finally{p(!1)}},[t,e,n]),k=(0,c.useCallback)(async e=>{let n=x.current,r=b.current.trim(),i=`${n}|${r}`;if(r===``){t(`Enter a directory or bucket prefix.`);return}if(!e&&i===C.current)return;let a=++S.current;d(!0),t(null),y(null),h([]),_(null);try{let e=await fb(n,r);if(a!==S.current)return;if(e.discoveryError!=null){y(e.discoveryError),t(e.discoveryError);return}let o=e.candidates?.map(e=>e.runId)??[],s=e.needsSelection===!0;h(o),o.length===1?_(o[0]):o.length>1&&_(null),C.current=i,o.length===1&&!s&&await O(o[0])}catch(e){if(a!==S.current)return;let n=e instanceof Error?e.message:`Discovery failed.`;y(n),t(n)}finally{a===S.current&&d(!1)}},[O,t]);async function A(){if(g==null||g.trim()===``){t(`Select a candidate artifact set.`);return}await O(g)}return(0,u.jsxs)(`section`,{className:`upload-hero`,children:[(0,u.jsx)(yb,{}),(0,u.jsx)(_b,{readinessRegionId:r,readinessLabel:T,sourceKind:i,onSourceKindChange:e=>{a(e),h([]),_(null),y(null),C.current=``,t(null)},location:o,onLocationChange:s,onLocationBlur:()=>{b.current.trim()!==``&&k(!1)},onLocationKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),k(!1))},candidateRunIds:m,selectedRunId:g,onSelectRunId:_,discoverLoading:l,canLoad:E,loadLoading:f,loadWorkspaceHint:D,onLoadWorkspace:()=>{A()}})]})}function xb({className:e,style:t}){return(0,u.jsx)(`div`,{className:[`skeleton`,e].filter(Boolean).join(` `),style:t,"aria-hidden":`true`})}function Sb(){return(0,u.jsxs)(`div`,{className:`loading-card`,children:[(0,u.jsx)(xb,{className:`loading-card__skeleton-icon`}),(0,u.jsxs)(`div`,{children:[(0,u.jsx)(xb,{className:`loading-card__skeleton-title`}),(0,u.jsx)(xb,{className:`loading-card__skeleton-body`})]})]})}var Cb=`workspace-pill workspace-pill--active`,wb=`workspace-pill`;function Tb(e){return e?Cb:wb}function Eb({open:e,onClose:t,returnFocusRef:n,onManagedAnalysisLoaded:r,onError:i}){let a=(0,c.useRef)(null),o=(0,c.useRef)(!1);return(0,c.useEffect)(()=>{if(!e){o.current&&n.current?.focus(),o.current=!1;return}o.current=!0,a.current?.focus();let r=e=>{e.key===`Escape`&&(e.preventDefault(),t())};document.addEventListener(`keydown`,r);let i=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.removeEventListener(`keydown`,r),document.body.style.overflow=i}},[e,t,n]),e?(0,u.jsxs)(`div`,{className:`settings-artifact-dialog`,"aria-hidden":!1,children:[(0,u.jsx)(`button`,{type:`button`,className:`settings-artifact-dialog__backdrop`,"aria-label":`Close change location dialog`,onClick:()=>{i(null),t()}}),(0,u.jsxs)(`div`,{ref:a,className:`settings-artifact-dialog__panel`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`settings-artifact-dialog-title`,tabIndex:-1,children:[(0,u.jsxs)(`header`,{className:`settings-artifact-dialog__header`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`p`,{className:`eyebrow`,children:`Artifacts`}),(0,u.jsx)(`h2`,{id:`settings-artifact-dialog-title`,children:`Change artifact location`}),(0,u.jsx)(`p`,{className:`settings-artifact-dialog__lede`,children:`Use the same directory or cloud prefix flow as the main workspace load screen. Credentials stay on the server.`})]}),(0,u.jsx)(`button`,{type:`button`,className:`settings-artifact-dialog__close`,"aria-label":`Close`,onClick:()=>{i(null),t()},children:(0,u.jsx)(`span`,{"aria-hidden":`true`,children:`×`})})]}),(0,u.jsx)(`div`,{className:`settings-artifact-dialog__body`,children:(0,u.jsx)(bb,{onManagedLoad:r,onError:i})})]})]}):null}function Db({analysisSource:e,executionCount:t}){return(0,u.jsxs)(`section`,{className:`settings-hero`,"aria-label":`Workspace preferences`,children:[(0,u.jsx)(`p`,{className:`eyebrow`,children:`Workspace profile`}),(0,u.jsx)(`h3`,{children:`Configure how this console looks and behaves by default.`}),(0,u.jsx)(`p`,{children:`Changes save locally and apply to the current workspace immediately when the relevant view is open.`}),(0,u.jsxs)(`div`,{className:`settings-chip-row`,children:[(0,u.jsx)(`span`,{className:`app-badge`,children:j(e)}),(0,u.jsx)(`span`,{className:`settings-chip`,children:t==null?`No artifacts loaded`:`${t} executions loaded`})]})]})}function Ob({themePreference:e,onThemeChange:t}){return(0,u.jsx)(yi,{title:`Appearance`,subtitle:`Choose how the workspace chrome should render by default.`,children:(0,u.jsxs)(`div`,{className:`settings-field-group`,children:[(0,u.jsx)(`span`,{className:`settings-field-label`,children:`Theme`}),(0,u.jsx)(`div`,{className:`settings-segmented`,children:[`system`,`light`,`dark`].map(n=>(0,u.jsx)(`button`,{type:`button`,className:Tb(e===n),onClick:()=>t(n),children:n===`system`?`System`:n.charAt(0).toUpperCase()+n.slice(1)},n))})]})})}function kb({analysisSource:e,executionCount:t,artifactLocationSnapshot:n,onOpenChangeLocation:r,changeLocationTriggerRef:i,pendingRemoteRun:a,acceptingRemoteRun:o,onAcceptPendingRemoteRun:s}){let c=A(n?.sourceKind),l=n?.locationDisplay!=null&&n.locationDisplay.trim()!==``?n.locationDisplay:null;return(0,u.jsx)(yi,{title:`Session`,subtitle:`Current artifact source and data-loading controls.`,children:(0,u.jsxs)(`div`,{className:`settings-stack`,children:[(0,u.jsxs)(`div`,{className:`settings-readout`,children:[(0,u.jsx)(`span`,{className:`settings-field-label`,children:`Current source`}),(0,u.jsx)(`strong`,{children:j(e)}),(0,u.jsx)(`p`,{children:t==null?`Load artifacts to unlock analysis views.`:`${t} executions are available in this session.`})]}),(0,u.jsxs)(`div`,{className:`settings-readout`,children:[(0,u.jsx)(`span`,{className:`settings-field-label`,children:`Configured location`}),l==null?c==null?(0,u.jsx)(`p`,{className:`settings-readout-muted`,children:`Nothing configured yet. Use Change location… to open the load wizard and point this session at a directory or cloud prefix.`}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`strong`,{children:c}),(0,u.jsx)(`p`,{className:`settings-readout-muted`,children:`Path label was not returned for this session.`})]}):(0,u.jsxs)(u.Fragment,{children:[c==null?null:(0,u.jsx)(`strong`,{children:c}),(0,u.jsx)(`p`,{className:`settings-mono-path settings-session__path`,title:l,children:l})]})]}),(0,u.jsx)(`div`,{className:`settings-session__actions`,children:(0,u.jsx)(`button`,{ref:i,type:`button`,className:`primary-action settings-primary-action`,onClick:r,children:`Change location…`})}),a&&(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:()=>void s(),disabled:o,children:o?`Switching…`:`Load ${a.label}`})]})})}function Ab({preferences:e,setPreferences:t}){return(0,u.jsx)(yi,{title:`Shell Defaults`,subtitle:`Control the default shape of the workspace chrome.`,children:(0,u.jsxs)(`div`,{className:`settings-field-group`,children:[(0,u.jsx)(`span`,{className:`settings-field-label`,children:`Sidebar`}),(0,u.jsxs)(`div`,{className:`settings-segmented`,children:[(0,u.jsx)(`button`,{type:`button`,className:Tb(!e.sidebarCollapsedDefault),onClick:()=>t(e=>({...e,sidebarCollapsedDefault:!1})),children:`Expanded`}),(0,u.jsx)(`button`,{type:`button`,className:Tb(e.sidebarCollapsedDefault),onClick:()=>t(e=>({...e,sidebarCollapsedDefault:!0})),children:`Collapsed`})]})]})})}function jb({preferences:e,setPreferences:t}){return(0,u.jsx)(yi,{title:`Timeline Defaults`,subtitle:`Set the default execution timeline filters and dependency focus.`,children:(0,u.jsxs)(`div`,{className:`settings-stack`,children:[(0,u.jsxs)(`div`,{className:`settings-inline-grid`,children:[(0,u.jsxs)(`label`,{className:`settings-toggle`,children:[(0,u.jsx)(`input`,{type:`checkbox`,checked:e.timelineDefaults.showTests,onChange:e=>t(t=>({...t,timelineDefaults:{...t.timelineDefaults,showTests:e.target.checked}}))}),(0,u.jsx)(`span`,{children:`Show tests by default`})]}),(0,u.jsxs)(`label`,{className:`settings-toggle`,children:[(0,u.jsx)(`input`,{type:`checkbox`,checked:e.timelineDefaults.failuresOnly,onChange:e=>t(t=>({...t,timelineDefaults:{...t.timelineDefaults,failuresOnly:e.target.checked}}))}),(0,u.jsx)(`span`,{children:`Start with failures-only emphasis`})]})]}),(0,u.jsxs)(`div`,{className:`settings-inline-grid`,children:[(0,u.jsxs)(`label`,{className:`settings-field`,children:[(0,u.jsx)(`span`,{className:`settings-field-label`,children:`Dependency direction`}),(0,u.jsxs)(`select`,{value:e.timelineDefaults.dependencyDirection,onChange:e=>t(t=>({...t,timelineDefaults:{...t.timelineDefaults,dependencyDirection:e.target.value}})),children:[(0,u.jsx)(`option`,{value:`upstream`,children:`Upstream`}),(0,u.jsx)(`option`,{value:`both`,children:`Both`}),(0,u.jsx)(`option`,{value:`downstream`,children:`Downstream`})]})]}),(0,u.jsxs)(`label`,{className:`settings-field`,children:[(0,u.jsx)(`span`,{className:`settings-field-label`,children:`Dependency depth`}),(0,u.jsx)(`input`,{type:`number`,min:`1`,max:`10`,value:e.timelineDefaults.dependencyDepthHops,onChange:e=>t(t=>({...t,timelineDefaults:{...t.timelineDefaults,dependencyDepthHops:Math.max(1,Math.min(10,Number(e.target.value)||1))}}))})]})]})]})})}function Mb({preferences:e,setPreferences:t}){return(0,u.jsx)(yi,{title:`Inventory Defaults`,subtitle:`Choose how asset exploration and lineage open by default.`,children:(0,u.jsxs)(`div`,{className:`settings-stack`,children:[(0,u.jsxs)(`div`,{className:`settings-inline-grid`,children:[(0,u.jsxs)(`label`,{className:`settings-field`,children:[(0,u.jsx)(`span`,{className:`settings-field-label`,children:`Explorer mode`}),(0,u.jsxs)(`select`,{value:e.inventoryDefaults.explorerMode,onChange:e=>t(t=>({...t,inventoryDefaults:{...t.inventoryDefaults,explorerMode:e.target.value}})),children:[(0,u.jsx)(`option`,{value:`project`,children:`Project`}),(0,u.jsx)(`option`,{value:`database`,children:`Database`})]})]}),(0,u.jsxs)(`label`,{className:`settings-field`,children:[(0,u.jsx)(`span`,{className:`settings-field-label`,children:`Lineage lens`}),(0,u.jsxs)(`select`,{value:e.inventoryDefaults.lineageLensMode,onChange:e=>t(t=>({...t,inventoryDefaults:{...t.inventoryDefaults,lineageLensMode:e.target.value}})),children:[(0,u.jsx)(`option`,{value:`type`,children:`Type`}),(0,u.jsx)(`option`,{value:`status`,children:`Status`}),(0,u.jsx)(`option`,{value:`coverage`,children:`Coverage`})]})]})]}),(0,u.jsxs)(`div`,{className:`settings-inline-grid`,children:[(0,u.jsxs)(`label`,{className:`settings-field`,children:[(0,u.jsx)(`span`,{className:`settings-field-label`,children:`Upstream depth`}),(0,u.jsx)(`input`,{type:`number`,min:`1`,max:`10`,value:e.inventoryDefaults.lineageUpstreamDepth,onChange:e=>t(t=>({...t,inventoryDefaults:{...t.inventoryDefaults,lineageUpstreamDepth:Math.max(1,Math.min(10,Number(e.target.value)||1))}}))})]}),(0,u.jsxs)(`label`,{className:`settings-field`,children:[(0,u.jsx)(`span`,{className:`settings-field-label`,children:`Downstream depth`}),(0,u.jsx)(`input`,{type:`number`,min:`1`,max:`10`,value:e.inventoryDefaults.lineageDownstreamDepth,onChange:e=>t(t=>({...t,inventoryDefaults:{...t.inventoryDefaults,lineageDownstreamDepth:Math.max(1,Math.min(10,Number(e.target.value)||1))}}))})]})]}),(0,u.jsxs)(`label`,{className:`settings-toggle`,children:[(0,u.jsx)(`input`,{type:`checkbox`,checked:e.inventoryDefaults.allDepsMode,onChange:e=>t(t=>({...t,inventoryDefaults:{...t.inventoryDefaults,allDepsMode:e.target.checked}}))}),(0,u.jsx)(`span`,{children:`Open lineage with all dependencies expanded`})]})]})})}function Nb({preferences:e,setPreferences:t,themePreference:n,setThemePreference:r,analysisSource:i,artifactLocationSnapshot:a,executionCount:o,onManagedAnalysisLoaded:s,onError:l,pendingRemoteRun:d,acceptingRemoteRun:f,onAcceptPendingRemoteRun:p}){let[m,h]=(0,c.useState)(!1),g=(0,c.useRef)(null),_=(0,c.useCallback)((e,t,n)=>{h(!1),s(e,t,n)},[s]);return(0,u.jsxs)(Ci,{title:`Settings`,description:`Workspace defaults, visual preferences, and session controls.`,className:`settings-view`,children:[(0,u.jsx)(Eb,{open:m,onClose:()=>{l(null),h(!1)},returnFocusRef:g,onManagedAnalysisLoaded:_,onError:l}),(0,u.jsxs)(`div`,{className:`settings-grid`,children:[(0,u.jsx)(Db,{analysisSource:i,executionCount:o}),(0,u.jsx)(Ob,{themePreference:n,onThemeChange:e=>{r(e),t(t=>({...t,theme:e}))}}),(0,u.jsx)(kb,{analysisSource:i,executionCount:o,artifactLocationSnapshot:a,onOpenChangeLocation:()=>h(!0),changeLocationTriggerRef:g,pendingRemoteRun:d,acceptingRemoteRun:f,onAcceptPendingRemoteRun:p}),(0,u.jsx)(Ab,{preferences:e,setPreferences:t}),(0,u.jsx)(jb,{preferences:e,setPreferences:t}),(0,u.jsx)(Mb,{preferences:e,setPreferences:t})]})]})}function Pb({kind:e}){let t={fill:`none`,stroke:`currentColor`,strokeWidth:1.8,strokeLinecap:`round`,strokeLinejoin:`round`};return e===`invocation`?(0,u.jsxs)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,u.jsx)(`path`,{...t,d:`M20 12.5V7a2 2 0 0 0-2-2h-6.2a2 2 0 0 0-1.4.58l-4.82 4.82A2 2 0 0 0 5 11.82V17a2 2 0 0 0 2 2h5.5`}),(0,u.jsx)(`path`,{...t,d:`M9 5v4a2 2 0 0 1-2 2H5`}),(0,u.jsx)(`circle`,{...t,cx:`17.5`,cy:`17.5`,r:`3.5`})]}):e===`time`?(0,u.jsxs)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,u.jsx)(`circle`,{...t,cx:`12`,cy:`12`,r:`8`}),(0,u.jsx)(`path`,{...t,d:`M12 7.8v4.6l3 1.8`})]}):e===`project`?(0,u.jsx)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,u.jsx)(`path`,{...t,d:`M3.5 8.5a2 2 0 0 1 2-2h3l1.4 1.7h8.6a2 2 0 0 1 2 2v7.5a2 2 0 0 1-2 2h-13a2 2 0 0 1-2-2z`})}):(0,u.jsxs)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,u.jsx)(`path`,{...t,d:`M11.25 4.75 5.5 7.7v4.55c0 3.65 2.7 6.95 6.5 7.95 3.8-1 6.5-4.3 6.5-7.95V7.7z`}),(0,u.jsx)(`path`,{...t,d:`M9.4 12.15 11.2 14l3.35-3.45`})]})}function Fb(e,t){let n=e?.projectName??null,r=e?.invocationId??null,i=e?.warehouseType??null,a=e?jr(e):null,o=a==null?null:Ar(a);return{label:n??`Workspace session`,subtitle:n==null&&r==null&&o==null?`Load artifacts to populate session details.`:null,summaryItems:[r?{key:`invocation`,label:`Invocation ID`,value:r,icon:`invocation`}:null,o?{key:`timestamp`,label:`Timestamp`,value:o,icon:`time`}:null,{key:`source`,label:`Source mode`,value:j(t),icon:`source`},i?{key:`warehouse`,label:`Warehouse type`,value:i.charAt(0).toUpperCase()+i.slice(1),icon:`project`}:null].filter(e=>e!=null)}}function Ib({summaryItems:e}){return(0,u.jsx)(`div`,{className:`app-header__summary-grid`,"aria-label":`Session metadata`,children:e.map(e=>(0,u.jsxs)(`div`,{className:`app-header__summary-item`,children:[(0,u.jsx)(`span`,{className:`app-header__summary-icon`,children:(0,u.jsx)(Pb,{kind:e.icon})}),(0,u.jsxs)(`span`,{className:`app-header__summary-copy`,children:[(0,u.jsx)(`span`,{className:`app-header__summary-label`,children:e.label}),(0,u.jsx)(`strong`,{className:`app-header__summary-value`,children:e.value})]})]},e.key))})}function Lb({header:e}){return(0,u.jsxs)(`div`,{className:`app-header__identity`,children:[(0,u.jsx)(`p`,{className:`eyebrow`,title:e.label,children:e.label}),e.subtitle?(0,u.jsx)(`p`,{className:`app-header__subheadline`,children:e.subtitle}):null,(0,u.jsx)(Ib,{summaryItems:e.summaryItems})]})}function Rb({analysis:e,searchState:t,setSearchState:n,omniboxResults:r,handleNavigateTo:i}){let a=t.query.trim().length>0;return(0,u.jsxs)(`div`,{className:`app-header__omnibox`,children:[(0,u.jsx)(`label`,{className:`app-header__search-control`,children:(0,u.jsxs)(`div`,{className:`app-header__search-shell`,children:[(0,u.jsxs)(`svg`,{className:`workspace-search__icon`,viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,u.jsx)(`circle`,{cx:`11`,cy:`11`,r:`6.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`}),(0,u.jsx)(`path`,{d:`M16 16l4 4`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`})]}),(0,u.jsx)(`input`,{value:t.query,onFocus:()=>n(e=>({...e,isOpen:!0})),onChange:e=>n(t=>({...t,query:e.target.value,isOpen:!0})),placeholder:`Search runs, pipelines, assets...`,"aria-label":`Global search`})]})}),t.isOpen&&e&&(0,u.jsx)(`div`,{className:`omnibox-results`,children:r.loading&&a?(0,u.jsx)(`div`,{className:`omnibox-results__empty`,children:`Searching…`}):r.results.length>0?r.results.map(e=>(0,u.jsxs)(`button`,{type:`button`,className:`omnibox-results__item`,onClick:()=>{n(t=>({...t,isOpen:!1,recentResourceIds:[e.uniqueId,...t.recentResourceIds.filter(t=>t!==e.uniqueId)].slice(0,8)})),i(`inventory`,{resourceId:e.uniqueId,assetTab:`summary`})},children:[(0,u.jsx)(`strong`,{children:e.name}),(0,u.jsx)(`span`,{children:e.resourceType})]},e.uniqueId)):(0,u.jsx)(`div`,{className:`omnibox-results__empty`,children:a?`No matching resources`:`Recent items will appear here`})})]})}function zb({activeView:e,analysis:t,analysisSource:n,artifactLocationSnapshot:r,preloadLoading:i,pendingRemoteRun:a,acceptingRemoteRun:o,preferences:s,setPreferences:c,themePreference:l,setThemePreference:d,onManagedAnalysisLoaded:f,onError:p,onAcceptPendingRemoteRun:m,workspaceSignals:h,overviewFilters:g,setOverviewFilters:_,timelineFilters:v,setTimelineFilters:y,assetViewState:b,setAssetViewState:x,runsViewState:S,setRunsViewState:C,lineageViewState:w,setLineageViewState:T,setInvestigationSelection:E,handleNavigateTo:D}){return e===`settings`?(0,u.jsx)(Nb,{preferences:s,setPreferences:c,themePreference:l,setThemePreference:d,analysisSource:n,artifactLocationSnapshot:r,executionCount:t?.summary.total_nodes??null,onManagedAnalysisLoaded:f,onError:p,pendingRemoteRun:a,acceptingRemoteRun:o,onAcceptPendingRemoteRun:m}):t?(0,u.jsx)(Gy,{analysis:t,activeView:e,analysisSource:n,overviewFilters:g,onOverviewFiltersChange:_,timelineFilters:v,onTimelineFiltersChange:y,assetViewState:b,onAssetViewStateChange:x,runsViewState:S,onRunsViewStateChange:C,lineageViewState:w,onLineageViewStateChange:T,onInvestigationSelectionChange:E,onNavigateTo:D,workspaceSignals:h}):i?(0,u.jsx)(Sb,{}):(0,u.jsx)(bb,{onManagedLoad:f,onError:p})}function Bb({workspace:e,analysis:t,analysisSource:n,artifactLocationSnapshot:r,error:i,preloadLoading:a,pendingRemoteRun:o,acceptingRemoteRun:s,onManagedAnalysisLoaded:c,onError:l,onAcceptPendingRemoteRun:f,themePreference:p,setThemePreference:m,preferences:h,setPreferences:g,workspaceSignals:_}){let{activeView:v,sidebarCollapsed:y,setSidebarCollapsed:b,sidebarOpen:x,setSidebarOpen:S,overviewFilters:C,setOverviewFilters:w,timelineFilters:T,setTimelineFilters:E,assetViewState:D,setAssetViewState:k,runsViewState:A,setRunsViewState:j,lineageViewState:M,setLineageViewState:N,searchState:P,setSearchState:ee,setInvestigationSelection:F,setNavigationTarget:te,handleNavigateTo:ne,frameClass:re}=e,ie=O(t,P),ae=Fb(t,n);return(0,u.jsxs)(`div`,{className:re,children:[x&&(0,u.jsx)(`div`,{className:`sidebar-backdrop`,role:`presentation`,onClick:()=>S(!1)}),(0,u.jsx)(xe,{activeView:v,setNavigationTarget:te,sidebarCollapsed:y,setSidebarCollapsed:b,onNavigate:()=>S(!1),analysis:t,analysisSource:n}),(0,u.jsxs)(`main`,{className:`app-main`,children:[(0,u.jsxs)(`header`,{className:`app-header app-header--workspace`,children:[(0,u.jsx)(`button`,{type:`button`,className:`hamburger-btn`,"aria-label":`Open navigation`,"aria-expanded":x,"aria-controls":`app-sidebar`,onClick:()=>S(!0),children:(0,u.jsx)(`span`,{"aria-hidden":`true`,children:`☰`})}),(0,u.jsx)(Lb,{header:ae}),(0,u.jsx)(Rb,{analysis:t,searchState:P,setSearchState:ee,omniboxResults:ie,handleNavigateTo:ne})]}),i&&(0,u.jsx)(d,{message:i}),(0,u.jsx)(Se,{pendingRemoteRun:o,acceptingRemoteRun:s,onAcceptPendingRemoteRun:f}),(0,u.jsx)(zb,{activeView:v,analysis:t,analysisSource:n,artifactLocationSnapshot:r,preloadLoading:a,pendingRemoteRun:o,acceptingRemoteRun:s,preferences:h,setPreferences:g,themePreference:p,setThemePreference:m,onManagedAnalysisLoaded:c,onError:l,onAcceptPendingRemoteRun:f,workspaceSignals:_,overviewFilters:C,setOverviewFilters:w,timelineFilters:T,setTimelineFilters:E,assetViewState:D,setAssetViewState:k,runsViewState:A,setRunsViewState:j,lineageViewState:M,setLineageViewState:N,setInvestigationSelection:F,handleNavigateTo:ne})]})]})}function Vb(e,t,n){return t===`preload`?{value:`Live target`,detail:`Synced from DBT_TOOLS_TARGET_DIR with ${e.graphSummary.totalEdges} dependency edges ready for investigation.`}:t===`remote`?{value:`Remote source`,detail:`Managed from remote object storage with ${e.graphSummary.totalEdges} dependency edges ready for investigation.`}:{value:`Artifact upload`,detail:`${e.summary.total_nodes} executions loaded from local artifacts${n>0?`, including ${n} tests`:``}.`}}function Hb(e,t){let n=e.executions.filter(e=>e.statusTone===`danger`).length,r=e.executions.filter(e=>e.statusTone===`warning`).length,i=e.executions.filter(e=>[`test`,`unit_test`].includes(e.resourceType)).length,a=e.resources.filter(e=>!!e.description?.trim()).length,o=e.resources.length>0?Math.round(a/e.resources.length*100):0,s=Vb(e,t,i);return[{label:`Run posture`,value:n>0?`${n} failing`:r>0?`${r} warning`:`Healthy`,detail:n>0?`Prioritize failing nodes before reviewing downstream impact.`:r>0?`Warnings detected; review tests and exposures next.`:`No failing nodes surfaced in this run.`,tone:n>0?`danger`:r>0?`warning`:`positive`},{label:`Metadata coverage`,value:`${o}%`,detail:`${a} of ${e.resources.length} resources include descriptions for catalog-style discovery.`,tone:o>=70?`positive`:o>=35?`warning`:`neutral`},{label:`Workspace mode`,value:s.value,detail:s.detail,tone:`neutral`}]}function Ub({setPreloadLoading:e,setAnalysis:t,setAnalysisSource:n,setPendingRemoteRun:r,setRemotePollIntervalMs:i,setError:a,pendingMetricsRef:o,setArtifactCapability:s,onArtifactSourceStatus:l}){let u=(0,c.useRef)(!1);(0,c.useEffect)(()=>{u.current||(u.current=!0,p(`Preload: fetching current managed artifacts`),ub().then(({result:c,status:u})=>{e(!1),r(u.pendingRun),i(u.pollIntervalMs),l?.(u),c?(p(`Preload: success, analysis loaded`),o.current=c.metrics,t(c.analysis),n(u.currentSource),a(null),s(u.missingOptionalArtifacts??{missingCatalog:!1,missingSources:!1})):(n(u.currentSource),s({missingCatalog:!1,missingSources:!1}))}).catch(t=>{e(!1),p(`Preload: error`,t),a(t instanceof Error?t.message:`Failed to load artifacts from server`)}))},[o,e,t,n,r,i,a,s,l])}function Wb(e,t,n,r){(0,c.useEffect)(()=>{},[e,r,t,n])}function Gb(e,t,n,r,i){(0,c.useEffect)(()=>{if(e!==`remote`){t(null),n(null);return}let a=!1,o=async()=>{try{let e=await cb();a||(t(e.pendingRun),n(e.pollIntervalMs),i?.(e))}catch(e){p(`Artifact source poll failed`,e)}};o();let s=window.setInterval(()=>{o()},r??3e4);return()=>{a=!0,window.clearInterval(s)}},[e,r,t,n,i])}function Kb(){let[e,t]=(0,c.useState)(null),[n,r]=(0,c.useState)(null),[i,a]=(0,c.useState)(null),[o,s]=(0,c.useState)(!0),[l,u]=(0,c.useState)(null),[d,f]=(0,c.useState)(!1),[g,_]=(0,c.useState)(null),[v,y]=(0,c.useState)({missingCatalog:!1,missingSources:!1}),[b,x]=(0,c.useState)(null),S=(0,c.useRef)(null),C=(0,c.useCallback)(e=>{x(t=>{let n=k(e);return n==null&&t==null||n!=null&&t!=null&&n.sourceKind===t.sourceKind&&n.locationDisplay===t.locationDisplay?t:n})},[]);return Ub({setPreloadLoading:s,setAnalysis:t,setAnalysisSource:a,setPendingRemoteRun:u,setRemotePollIntervalMs:_,setError:r,pendingMetricsRef:S,setArtifactCapability:y,onArtifactSourceStatus:C}),Wb(i,t,r,S),Gb(i,u,_,g,C),(0,c.useEffect)(()=>{if(e==null||S.current==null)return;let t=S.current;S.current=null,requestAnimationFrame(()=>{let e=`analysis-load:${t.requestId}:interactive`,n=`analysis-load:${t.requestId}:first-interactive-frame`;m(e),h(n,t.dispatchMarkName,e),p(`Analysis load metrics`,{requestId:t.requestId,source:t.source,timings:t.timings})})},[e]),{analysis:e,analysisSource:i,artifactLocationSnapshot:b,artifactCapability:v,error:n,preloadLoading:o,pendingRemoteRun:l,acceptingRemoteRun:d,onLoadDifferent:()=>{t(null),a(null),u(null),_(null),r(null),x(null),y({missingCatalog:!1,missingSources:!1})},onManagedAnalysisLoaded:(e,n,r)=>{S.current=e.metrics,a(n),u(null),t(e.analysis),y(r),cb().then(C).catch(()=>{})},onError:r,onAcceptPendingRemoteRun:async()=>{if(l!=null){f(!0);try{let e=await db(l.runId),n=await lb(`remote`);n!=null&&(S.current=n.metrics,t(n.analysis),a(e.currentSource),_(e.pollIntervalMs),r(null),y(e.missingOptionalArtifacts??{missingCatalog:!1,missingSources:!1})),u(e.pendingRun),C(e)}catch(e){r(e instanceof Error?e.message:`Failed to switch remote artifact run`)}finally{f(!1)}}}}}var qb=`dbt-tools.workspacePreferences`,Jb={theme:`system`,sidebarCollapsedDefault:!0,timelineDefaults:{showTests:!1,failuresOnly:!1,dependencyDirection:`both`,dependencyDepthHops:2},inventoryDefaults:{explorerMode:`project`,lineageLensMode:`type`,lineageUpstreamDepth:2,lineageDownstreamDepth:2,allDepsMode:!1}};function Yb(e,t){return typeof e!=`number`||!Number.isFinite(e)?t:Math.max(1,Math.min(10,Math.round(e)))}function Xb(e){return e===`upstream`||e===`both`||e===`downstream`}function Zb(e){return e===`project`||e===`database`}function Qb(e){return e===`status`||e===`type`||e===`coverage`}function $b(e){return e===`light`||e===`dark`||e===`system`}function ex(e){if(!e)return Jb;try{let t=JSON.parse(e);return{theme:$b(t.theme)?t.theme:Jb.theme,sidebarCollapsedDefault:typeof t.sidebarCollapsedDefault==`boolean`?t.sidebarCollapsedDefault:Jb.sidebarCollapsedDefault,timelineDefaults:{showTests:typeof t.timelineDefaults?.showTests==`boolean`?t.timelineDefaults.showTests:Jb.timelineDefaults.showTests,failuresOnly:typeof t.timelineDefaults?.failuresOnly==`boolean`?t.timelineDefaults.failuresOnly:Jb.timelineDefaults.failuresOnly,dependencyDirection:Xb(t.timelineDefaults?.dependencyDirection)?t.timelineDefaults.dependencyDirection:Jb.timelineDefaults.dependencyDirection,dependencyDepthHops:Yb(t.timelineDefaults?.dependencyDepthHops,Jb.timelineDefaults.dependencyDepthHops)},inventoryDefaults:{explorerMode:Zb(t.inventoryDefaults?.explorerMode)?t.inventoryDefaults.explorerMode:Jb.inventoryDefaults.explorerMode,lineageLensMode:Qb(t.inventoryDefaults?.lineageLensMode)?t.inventoryDefaults.lineageLensMode:Jb.inventoryDefaults.lineageLensMode,lineageUpstreamDepth:Yb(t.inventoryDefaults?.lineageUpstreamDepth,Jb.inventoryDefaults.lineageUpstreamDepth),lineageDownstreamDepth:Yb(t.inventoryDefaults?.lineageDownstreamDepth,Jb.inventoryDefaults.lineageDownstreamDepth),allDepsMode:typeof t.inventoryDefaults?.allDepsMode==`boolean`?t.inventoryDefaults.allDepsMode:Jb.inventoryDefaults.allDepsMode}}}catch{return Jb}}function tx(){let[e,t]=(0,c.useState)(()=>{try{return ex(window.localStorage.getItem(qb))}catch{return Jb}});return(0,c.useEffect)(()=>{try{window.localStorage.setItem(qb,JSON.stringify(e))}catch{}},[e]),{preferences:e,setPreferences:t}}function nx(e,t){let n=t!==e.selectedExecutionId;return{...e,selectedExecutionId:t,...n?{neighborhoodRowsShowAll:!1}:{}}}var rx=(e,t)=>({activeTab:se(e),expandedNodeIds:new Set,explorerMode:t?.inventoryDefaults.explorerMode??`project`,status:`all`,resourceTypes:new Set,materializationKinds:new Set,resourceQuery:``,selectedResourceId:ie(e),upstreamDepth:de(e)??t?.inventoryDefaults.lineageUpstreamDepth??2,downstreamDepth:fe(e)??t?.inventoryDefaults.lineageDownstreamDepth??2,allDepsMode:pe(e)??t?.inventoryDefaults.allDepsMode??!1,lensMode:ue(e)??t?.inventoryDefaults.lineageLensMode??`type`,activeLegendKeys:new Set}),ix=e=>{let t=re(e);return{kind:ce(e)??`all`,status:`all`,query:``,resourceTypes:new Set,materializationKinds:new Set,threadIds:new Set,durationBand:`all`,sortBy:`attention`,sortDirection:`desc`,groupBy:`none`,selectedExecutionId:t===`runs`?ae(e):null,showAdapterMetrics:t===`runs`?le(e):!1}},ax=(e,t)=>{let n=re(e),r=n===`runs`||n===`timeline`?ae(e):null;return{query:``,activeStatuses:new Set,activeTypes:new Set,selectedExecutionId:r,showTests:t?.timelineDefaults.showTests??!1,failuresOnly:t?.timelineDefaults.failuresOnly??!1,dependencyDirection:t?.timelineDefaults.dependencyDirection??`both`,dependencyDepthHops:t?.timelineDefaults.dependencyDepthHops??2,timeWindow:null,neighborhoodRowsShowAll:!1}};function ox(e){let t=new URLSearchParams(e);if(re(e)!==`inventory`)return null;let n=[],r=t.get(`q`)?.trim()??``;r!==``&&n.push(r);for(let e of[`type`,`package`,`tag`,`path`]){let r=t.get(e)?.trim()??``;r!==``&&n.push(`${e}:${r}`)}return n.join(` `).trim()}function sx(e,t){let n=ox(e);return n===null?t:{...t,resourceQuery:n}}var cx=e=>{let t=re(e)??`health`,n=ie(e),r=ae(e);return{selectedResourceId:n,selectedExecutionId:t===`runs`||t===`timeline`?r:null,sourceLens:null}};function lx(e,t){return{activeView:re(e)??`health`,assetViewState:sx(e,rx(e,t)),runsViewState:ix(e),timelineFilters:ax(e,t),lineageViewState:{...he(e),upstreamDepth:de(e)??t?.inventoryDefaults.lineageUpstreamDepth??2,downstreamDepth:fe(e)??t?.inventoryDefaults.lineageDownstreamDepth??2,allDepsMode:pe(e)??t?.inventoryDefaults.allDepsMode??!1,lensMode:ue(e)??t?.inventoryDefaults.lineageLensMode??`type`},investigationSelection:cx(e)}}function ux(e){let t=re(e),n=ie(e),r=ae(e);return{activeView:t??void 0,assetViewState:t=>sx(e,{...t,selectedResourceId:n,activeTab:se(e)}),runsViewState:n=>({...n,kind:ce(e)??n.kind,selectedExecutionId:t===`runs`?r:null,showAdapterMetrics:t===`runs`?le(e):n.showAdapterMetrics}),timelineFilters:e=>nx(e,t===`timeline`?r:null),lineageViewState:he(e),investigationSelection:e=>({...e,selectedResourceId:n,selectedExecutionId:t===`runs`||t===`timeline`?r:null,sourceLens:e.sourceLens})}}var dx=[`resource`,`assetTab`,`selected`,`kind`,`adapter`,`up`,`down`,`allDeps`,`lens`,`q`];function fx(e,t){for(let n of dx)t?.has(n)||e.searchParams.delete(n)}function px(e,t,n){t.selectedResourceId?e.searchParams.set(`resource`,t.selectedResourceId):e.searchParams.delete(`resource`),e.searchParams.set(`assetTab`,t.activeTab);let r=t.resourceQuery.trim();r===``?e.searchParams.delete(`q`):e.searchParams.set(`q`,r),e.searchParams.delete(`kind`),t.activeTab===`lineage`?(n.selectedResourceId?e.searchParams.set(`selected`,n.selectedResourceId):e.searchParams.delete(`selected`),e.searchParams.set(`up`,String(n.upstreamDepth)),e.searchParams.set(`down`,String(n.downstreamDepth)),e.searchParams.set(`allDeps`,n.allDepsMode?`1`:`0`),e.searchParams.set(`lens`,n.lensMode)):fx(e,new Set([`resource`,`assetTab`,`q`]))}function mx(e,t){e.searchParams.set(`kind`,t.kind),t.selectedExecutionId?e.searchParams.set(`selected`,t.selectedExecutionId):e.searchParams.delete(`selected`),t.showAdapterMetrics?e.searchParams.delete(`adapter`):e.searchParams.set(`adapter`,`0`),fx(e,new Set([`kind`,`selected`,`adapter`]))}function hx(e,t){t?e.searchParams.set(`selected`,t):e.searchParams.delete(`selected`),fx(e,new Set([`selected`]))}function gx(e){let{pathname:t,hash:n,activeView:r,assetViewState:i,runsViewState:a,timelineSelectedExecutionId:o,lineageViewState:s}=e,c=new URL(`http://local.invalid${t}${n}`);return c.searchParams.set(`view`,r),r===`inventory`?px(c,i,s):r===`runs`?mx(c,a):r===`timeline`?hx(c,o):fx(c),`${t}${c.search}${n}`}function _x(e){let t=(0,c.useRef)(!1),n=lx(window.location.search,e),[r,i]=(0,c.useState)(()=>n.activeView),[a,o]=(0,c.useState)(()=>_e(e.sidebarCollapsedDefault)),[s,l]=(0,c.useState)(!1),[u,d]=(0,c.useState)({status:`all`,resourceTypes:new Set,query:``}),[f,p]=(0,c.useState)(()=>n.timelineFilters),[m,h]=(0,c.useState)(()=>n.assetViewState),[g,_]=(0,c.useState)(()=>n.runsViewState),[v,y]=(0,c.useState)(()=>n.lineageViewState),[b,x]=(0,c.useState)({query:``,recentResourceIds:[],isOpen:!1}),[S,C]=(0,c.useState)(()=>n.investigationSelection),w=(0,c.useCallback)(e=>{o(t=>{let n=e(t);try{window.localStorage.setItem(ge,String(n))}catch{}return n})},[]),T=(0,c.useCallback)(e=>{i(e.view===`search`?`inventory`:e.view)},[]),E=(0,c.useCallback)((e,t)=>{i(e),t?.resourceId?(h(e=>({...e,selectedResourceId:t.resourceId??e.selectedResourceId,activeTab:t.assetTab??e.activeTab})),y(e=>({...e,rootResourceId:t.rootResourceId??t.resourceId??e.rootResourceId,selectedResourceId:t.resourceId??e.selectedResourceId}))):t?.assetTab&&e===`inventory`&&h(e=>({...e,activeTab:t.assetTab??e.activeTab})),t?.executionId&&(_(e=>({...e,selectedExecutionId:t.executionId??e.selectedExecutionId})),p(e=>nx(e,t.executionId??e.selectedExecutionId))),e===`runs`&&t?.resourceId&&_(e=>({...e,query:t.resourceId??e.query})),C(n=>({selectedResourceId:t?.resourceId??n.selectedResourceId,selectedExecutionId:t?.executionId??n.selectedExecutionId,sourceLens:e}))},[]);return(0,c.useEffect)(()=>{let e=gx({pathname:window.location.pathname,hash:window.location.hash,activeView:r,assetViewState:m,runsViewState:g,timelineSelectedExecutionId:f.selectedExecutionId,lineageViewState:v});e!==`${window.location.pathname}${window.location.search}${window.location.hash}`&&window.history.pushState(null,``,e)},[r,m,g,f.selectedExecutionId,v]),(0,c.useEffect)(()=>{let e=()=>{let e=ux(window.location.search);e.activeView!==void 0&&i(e.activeView),h(t=>e.assetViewState(t)),_(t=>e.runsViewState(t)),p(t=>e.timelineFilters(t)),y(e.lineageViewState),C(t=>e.investigationSelection(t))};return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]),(0,c.useEffect)(()=>{if(!t.current){t.current=!0;return}p(t=>({...t,showTests:e.timelineDefaults.showTests,failuresOnly:e.timelineDefaults.failuresOnly,dependencyDirection:e.timelineDefaults.dependencyDirection,dependencyDepthHops:e.timelineDefaults.dependencyDepthHops})),h(t=>({...t,explorerMode:e.inventoryDefaults.explorerMode})),y(t=>({...t,upstreamDepth:e.inventoryDefaults.lineageUpstreamDepth,downstreamDepth:e.inventoryDefaults.lineageDownstreamDepth,allDepsMode:e.inventoryDefaults.allDepsMode,lensMode:e.inventoryDefaults.lineageLensMode})),o(e.sidebarCollapsedDefault);try{window.localStorage.setItem(ge,String(e.sidebarCollapsedDefault))}catch{}},[e]),(0,c.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`k`&&(e.preventDefault(),x(e=>({...e,isOpen:!0}))),e.key===`Escape`&&(l(!1),x(e=>({...e,isOpen:!1})))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),{activeView:r,sidebarCollapsed:a,setSidebarCollapsed:w,sidebarOpen:s,setSidebarOpen:l,overviewFilters:u,setOverviewFilters:d,timelineFilters:f,setTimelineFilters:p,assetViewState:m,setAssetViewState:h,runsViewState:g,setRunsViewState:_,lineageViewState:v,setLineageViewState:y,searchState:b,setSearchState:x,investigationSelection:S,setInvestigationSelection:C,setNavigationTarget:T,handleNavigateTo:E,frameClass:[`app-frame`,a?`app-frame--sidebar-collapsed`:``,s?`app-frame--nav-open`:``].filter(Boolean).join(` `)}}function vx(){let{toast:e}=Xy(),{preferences:t,setPreferences:n}=tx(),r=_x(t),{analysis:i,analysisSource:a,artifactLocationSnapshot:o,error:s,preloadLoading:l,pendingRemoteRun:d,acceptingRemoteRun:f,onManagedAnalysisLoaded:p,artifactCapability:m,onError:h,onAcceptPendingRemoteRun:g}=Kb(),{themePreference:_,setThemePreference:v}=fi();(0,c.useEffect)(()=>{t.theme!==_&&v(t.theme)},[t.theme,v,_]);let y=(0,c.useRef)(null);(0,c.useEffect)(()=>{i&&!y.current&&a===`preload`&&e(`Workspace loaded — ${i.summary.total_nodes} executions`,`positive`),i&&!y.current&&a===`remote`&&e(`Remote workspace loaded — ${i.summary.total_nodes} executions`,`positive`),y.current=i},[i,a,e]);let b=(0,c.useRef)(null);(0,c.useEffect)(()=>{if(d==null){b.current=null;return}b.current!==d.runId&&(b.current=d.runId,e(`A newer remote run is available: ${d.label}`,`warning`))},[d,e]);let x=i?Hb(i,a):[];return(0,u.jsx)(Eg.Provider,{value:m,children:(0,u.jsx)(Bb,{workspace:r,analysis:i,analysisSource:a,artifactLocationSnapshot:o,error:s,preloadLoading:l,pendingRemoteRun:d,acceptingRemoteRun:f,onManagedAnalysisLoaded:p,onError:h,onAcceptPendingRemoteRun:g,themePreference:_,setPreferences:n,preferences:t,setThemePreference:v,workspaceSignals:x})})}function yx(){return(0,u.jsx)(Yy,{children:(0,u.jsx)(vx,{})})}(0,l.createRoot)(document.getElementById(`root`)).render((0,u.jsx)(c.StrictMode,{children:(0,u.jsx)(yx,{})}));
|