@rsdoctor/components 1.5.2 → 1.5.3-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Charts/TreeMap.d.ts +1 -2
- package/dist/components/Charts/TreeMap.mjs +1 -14
- package/dist/components/Charts/TreeMap.mjs.map +1 -1
- package/dist/components/Loader/executions.mjs +138 -118
- package/dist/components/Loader/executions.mjs.map +1 -1
- package/dist/pages/BundleSize/components/index.mjs +390 -399
- package/dist/pages/BundleSize/components/index.mjs.map +1 -1
- package/dist/pages/BundleSize/components/index.module.mjs +0 -4
- package/dist/pages/BundleSize/components/index.module.mjs.map +1 -1
- package/dist/pages/BundleSize/components/index_module.css +0 -4
- package/dist/pages/BundleSize/components/index_module.css.map +1 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components/Loader/executions.mjs","sources":["../../../src/components/Loader/executions.tsx"],"sourcesContent":["import { ClockCircleTwoTone } from '@ant-design/icons';\nimport { SDK } from '@rsdoctor/types';\nimport {\n Col,\n Divider,\n Empty,\n List,\n Row,\n Space,\n Tabs,\n Tag,\n Timeline,\n Tooltip,\n Typography,\n} from 'antd';\nimport dayjs from 'dayjs';\nimport { PropsWithChildren, useCallback, useState } from 'react';\nimport InputIcon from 'src/common/svg/loader/input.svg';\nimport OutputIcon from 'src/common/svg/loader/output.svg';\nimport StepIcon from 'src/common/svg/loader/step.svg';\nimport { Size } from '../../constants';\nimport { beautifyPath, formatCosts, useTheme } from '../../utils';\nimport { CodeViewer, DiffViewer } from '../base';\nimport { Card } from '../Card';\nimport { CodeOpener } from '../Opener';\nimport { Title } from '../Title';\nimport styles from './Analysis/style.module.scss';\n\ninterface LoaderExecutionsProps {\n cwd: string;\n data: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetLoaderFileDetails>;\n index?: number;\n}\n\nconst LoaderPropsItem = ({\n loader,\n resource,\n cwd,\n}: {\n loader: SDK.LoaderTransformData & {\n costs: number;\n };\n resource: SDK.ResourceData;\n cwd: string;\n}): JSX.Element => {\n return (\n <Card\n title={'Loader Details'}\n style={{ border: 'none' }}\n extra={\n <Tag icon={<ClockCircleTwoTone />} color=\"default\">\n {dayjs(loader.startAt).format('YYYY-MM-DD HH:mm:ss')}\n </Tag>\n }\n >\n <Space direction=\"vertical\" style={{ width: '100%' }}>\n {loader.isPitch ? <Typography.Text code>pitch</Typography.Text> : null}\n <List size=\"large\" bordered>\n <List.Item>\n <Typography.Text strong>{'File Path'}</Typography.Text>\n <div>{beautifyPath(resource.path, cwd)}</div>\n </List.Item>\n <List.Item>\n <Typography.Text strong>{'Resource Path'}</Typography.Text>\n <CodeOpener cwd={cwd} url={resource.path} loc=\"\" disabled />\n </List.Item>\n <List.Item>\n <Typography.Text strong>{'Resource Query'}</Typography.Text>\n <div>{resource.queryRaw || '-'}</div>\n </List.Item>\n <List.Item>\n <Typography.Text strong>{'Duration'}</Typography.Text>\n <div>{formatCosts(loader.costs)}</div>\n </List.Item>\n <List.Item>\n <Typography.Text strong>{'Loader'}</Typography.Text>\n <div>\n <Typography.Text code>{loader.loader}</Typography.Text>\n </div>\n </List.Item>\n <List.Item>\n <Typography.Text strong>{'Loader Index'}</Typography.Text>\n <div>{`${loader.loaderIndex}`}</div>\n </List.Item>\n <List.Item>\n <Typography.Text strong>{'Loader Path'}</Typography.Text>\n <CodeOpener cwd={cwd} url={loader.path} loc=\"\" disabled />\n </List.Item>\n <List.Item>\n <div style={{ width: 180 }}>\n <Typography.Text strong>{'Options'}</Typography.Text>\n </div>\n <Divider type=\"vertical\" />\n <Typography.Paragraph\n ellipsis={{\n rows: 2,\n expandable: true,\n symbol: 'more',\n }}\n copyable\n >\n {JSON.stringify(loader.options || '-')}\n </Typography.Paragraph>\n </List.Item>\n </List>\n </Space>\n </Card>\n );\n};\n\nexport const LoaderExecutions = ({\n data,\n cwd,\n index,\n}: PropsWithChildren<LoaderExecutionsProps>): JSX.Element => {\n const { loaders, resource } = data;\n const [currentIndex, setCurrentIndex] = useState(index || 0);\n const { theme } = useTheme();\n const isLight = theme === 'light';\n const loader = loaders[currentIndex];\n const before = loader.input || '';\n const leftSpan = 5;\n const hasError = loader.errors && loader.errors.length;\n const [activeKey, setActiveKey] = useState('loaderDetails');\n const onChange = useCallback((key: string) => {\n setActiveKey(key);\n }, []);\n\n return (\n <Row className={styles.executions} style={{ height: '100%' }}>\n <Col\n span={leftSpan}\n style={{\n borderRight: isLight ? `1px solid #f0f0f0` : undefined,\n padding: Size.BasePadding,\n }}\n >\n <Space direction=\"vertical\" style={{ width: '100%' }}>\n <Title text=\"Executions\" />\n <Timeline mode=\"left\" style={{ marginTop: Size.BasePadding }}>\n {loaders.map((e, i, arr) => {\n const { loader, isPitch } = e;\n const costs = formatCosts(e.costs);\n return (\n <Timeline.Item\n dot={\n isPitch ? (\n <Tag style={{ marginLeft: 1, fontWeight: 500 }}>\n pitch\n </Tag>\n ) : (\n <ClockCircleTwoTone />\n )\n }\n style={{ paddingBottom: 10, textAlign: 'center' }}\n key={i}\n >\n <Row align=\"middle\" justify=\"space-between\" gutter={[0, 10]}>\n <Col span={24} className={styles.timeline}>\n <Tooltip title={loader} trigger=\"hover\">\n <div\n className={`${styles.box} ${currentIndex === i ? styles.selected : ''}`}\n onClick={() => {\n setCurrentIndex(i);\n }}\n style={{ textAlign: 'left' }}\n >\n <div>\n <Typography.Text style={{ color: '#000' }}>\n {costs.match(/[0-9]*\\.?[0-9]+/g)?.[0]}\n </Typography.Text>\n {` `}\n <Typography.Text\n style={{ color: 'rgba(0,0,0,0.45)' }}\n >\n {costs.match(/[a-zA-Z]+/g)}\n </Typography.Text>\n </div>\n <Typography.Text\n style={{ color: 'rgba(0,0,0,0.65)' }}\n className={styles.loader}\n >\n {loader}\n </Typography.Text>\n </div>\n </Tooltip>\n </Col>\n </Row>\n {i === arr.length - 1 ? null : (\n <div style={{ paddingTop: 10 }}>\n <StepIcon />\n </div>\n )}\n </Timeline.Item>\n );\n })}\n </Timeline>\n </Space>\n </Col>\n <Col span={24 - leftSpan} style={{ height: '100%' }}>\n <Tabs\n type=\"card\"\n defaultActiveKey=\"loaderDetails\"\n activeKey={activeKey}\n items={[\n {\n label: 'Loader Props',\n key: 'loaderProps',\n children: (\n <LoaderPropsItem\n loader={loader}\n resource={resource}\n cwd={cwd}\n />\n ),\n },\n {\n label: 'Loader Details',\n key: 'loaderDetails',\n children: (\n <div style={{ height: '100%' }}>\n {hasError ? (\n <Col span={24} style={{ height: '53%', minHeight: 400 }}>\n <div\n style={{\n padding: Size.BasePadding,\n borderTop: `1px solid ${isLight ? '#f0f0f0' : 'rgba(253, 253, 253, 0.12)'}`,\n borderBottom: `1px solid ${isLight ? '#f0f0f0' : 'rgba(253, 253, 253, 0.12)'}`,\n }}\n >\n <Title\n text={`the error stack of [${loader.loader}] ${loader.isPitch ? 'pitch' : ''}`}\n />\n </div>\n <div style={{ height: '90%' }}>\n <CodeViewer\n code={loader.errors[0].message}\n lang=\"javascript\"\n />\n </div>\n </Col>\n ) : (\n <Col span={24} style={{ height: '53%', minHeight: 400 }}>\n <div\n style={{\n display: 'flex',\n alignItems: 'center',\n padding: Size.BasePadding,\n borderBottom: `1px solid ${isLight ? '#f0f0f0' : 'rgba(253, 253, 253, 0.12)'}`,\n }}\n >\n <Title\n text={\n <>\n {`the result of [${loader.loader}] ${loader.isPitch ? 'pitch' : ''}`}\n {!loader.isPitch && (\n <span style={{ fontWeight: 400 }}>\n (\n <InputIcon\n style={{\n verticalAlign: 'middle',\n margin: '0 2px',\n }}\n />\n Input ⟷\n <OutputIcon\n style={{\n verticalAlign: 'middle',\n position: 'relative',\n top: -2,\n }}\n />\n Output)\n </span>\n )}\n </>\n }\n />\n <div style={{ flex: 1 }} />\n </div>\n {loader.isPitch ? (\n loader.result ? (\n <div style={{ height: '90%' }}>\n <CodeViewer\n isEmbed\n code={loader.result}\n filePath={resource.path}\n />\n </div>\n ) : (\n <Empty\n description={\n 'No loader result. If you use the Brief Mode, there will not have loader results.'\n }\n />\n )\n ) : (\n <div style={{ minHeight: '700px' }}>\n <div style={{ height: '40rem', overflow: 'hidden' }}>\n {!loader.result && !before ? (\n <Empty\n description={\n 'No loader result. If you use the Brief Mode, there will not have loader results.'\n }\n />\n ) : (\n <DiffViewer\n isEmbed\n original={before}\n modified={loader.result || ''}\n originalFilePath={resource.path}\n modifiedFilePath={resource.path}\n />\n )}\n </div>\n </div>\n )}\n </Col>\n )}\n </div>\n ),\n },\n ]}\n onChange={onChange}\n />\n </Col>\n </Row>\n );\n};\n"],"names":["LoaderPropsItem","loader","resource","cwd","Card","Tag","ClockCircleTwoTone","dayjs","Space","Typography","List","beautifyPath","CodeOpener","formatCosts","Divider","JSON","LoaderExecutions","data","index","loaders","currentIndex","setCurrentIndex","useState","theme","useTheme","isLight","before","leftSpan","hasError","activeKey","setActiveKey","onChange","useCallback","key","Row","styles","Col","undefined","Size","Title","Timeline","e","i","arr","isPitch","costs","Tooltip","StepIcon","Tabs","CodeViewer","InputIcon","OutputIcon","Empty","DiffViewer"],"mappings":";;;;;;;;;;;;;;;AAkCA,MAAMA,kBAAkB,CAAC,EACvBC,MAAM,EACNC,QAAQ,EACRC,GAAG,EAOJ,GACQ,WAAP,GACE,IAACC,MAAIA;QACH,OAAO;QACP,OAAO;YAAE,QAAQ;QAAO;QACxB,qBACE,IAACC,KAAGA;YAAC,oBAAM,IAACC,oBAAkBA,CAAAA;YAAK,OAAM;sBACtCC,MAAMN,OAAO,OAAO,EAAE,MAAM,CAAC;;kBAIlC,mBAACO,OAAKA;YAAC,WAAU;YAAW,OAAO;gBAAE,OAAO;YAAO;;gBAChDP,OAAO,OAAO,GAAG,WAAH,GAAG,IAACQ,WAAW,IAAI;oBAAC,MAAI;8BAAC;qBAA0B;8BAClE,KAACC,MAAIA;oBAAC,MAAK;oBAAQ,UAAQ;;sCACzB,KAACA,KAAK,IAAI;;8CACR,IAACD,WAAW,IAAI;oCAAC,QAAM;8CAAE;;8CACzB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AAO,OAAO,GACbA,OAAO,MAAM,GAAG,WAAH,GACX,IAAC;4CAAI,OAAO;gDAAE,QAAQ;4CAAM;sDAC1B,kBAACgD,YAAUA;gDACT,SAAO;gDACP,MAAMhD,OAAO,MAAM;gDACnB,UAAUC,SAAS,IAAI;;2DAI3B,IAACkD,OAAKA;4CACJ,aACE;2DAKN,IAAC;4CAAI,OAAO;gDAAE,WAAW;4CAAQ;sDAC/B,kBAAC;gDAAI,OAAO;oDAAE,QAAQ;oDAAS,UAAU;gDAAS;0DAC/C,AAACnD,OAAO,MAAM,IAAKyB,S,cAOlB,IAAC2B,YAAUA;oDACT,SAAO;oDACP,UAAU3B;oDACV,UAAUzB,OAAO,MAAM,IAAI;oDAC3B,kBAAkBC,SAAS,IAAI;oDAC/B,kBAAkBA,SAAS,IAAI;qDAZN,WAATwB,GAClB,IAAC0B,OAAKA;oDACJ,aACE;;;;;;;wBAmBtB;qBACD;oBACD,UAAUrB;;;;;AAKpB"}
|
|
1
|
+
{"version":3,"file":"components/Loader/executions.mjs","sources":["../../../src/components/Loader/executions.tsx"],"sourcesContent":["import { ClockCircleTwoTone } from '@ant-design/icons';\nimport { SDK } from '@rsdoctor/types';\nimport {\n Col,\n Divider,\n Empty,\n List,\n Row,\n Space,\n Tabs,\n Tag,\n Timeline,\n Tooltip,\n Typography,\n} from 'antd';\nimport dayjs from 'dayjs';\nimport { PropsWithChildren, useCallback, useState } from 'react';\nimport InputIcon from 'src/common/svg/loader/input.svg';\nimport OutputIcon from 'src/common/svg/loader/output.svg';\nimport StepIcon from 'src/common/svg/loader/step.svg';\nimport { Size } from '../../constants';\nimport { beautifyPath, formatCosts, useTheme } from '../../utils';\nimport { CodeViewer, DiffViewer } from '../base';\nimport { Card } from '../Card';\nimport { CodeOpener } from '../Opener';\nimport { Title } from '../Title';\nimport { ServerAPIProvider } from '../Manifest';\nimport styles from './Analysis/style.module.scss';\n\ninterface LoaderExecutionsProps {\n cwd: string;\n data: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetLoaderFileDetails>;\n index?: number;\n}\n\nconst LoaderPropsItem = ({\n loader,\n resource,\n cwd,\n}: {\n loader: Omit<SDK.LoaderTransformData, 'input' | 'result'> & {\n costs: number;\n };\n resource: SDK.ResourceData;\n cwd: string;\n}): JSX.Element => {\n return (\n <Card\n title={'Loader Details'}\n style={{ border: 'none' }}\n extra={\n <Tag icon={<ClockCircleTwoTone />} color=\"default\">\n {dayjs(loader.startAt).format('YYYY-MM-DD HH:mm:ss')}\n </Tag>\n }\n >\n <Space direction=\"vertical\" style={{ width: '100%' }}>\n {loader.isPitch ? <Typography.Text code>pitch</Typography.Text> : null}\n <List size=\"large\" bordered>\n <List.Item>\n <Typography.Text strong>{'File Path'}</Typography.Text>\n <div>{beautifyPath(resource.path, cwd)}</div>\n </List.Item>\n <List.Item>\n <Typography.Text strong>{'Resource Path'}</Typography.Text>\n <CodeOpener cwd={cwd} url={resource.path} loc=\"\" disabled />\n </List.Item>\n <List.Item>\n <Typography.Text strong>{'Resource Query'}</Typography.Text>\n <div>{resource.queryRaw || '-'}</div>\n </List.Item>\n <List.Item>\n <Typography.Text strong>{'Duration'}</Typography.Text>\n <div>{formatCosts(loader.costs)}</div>\n </List.Item>\n <List.Item>\n <Typography.Text strong>{'Loader'}</Typography.Text>\n <div>\n <Typography.Text code>{loader.loader}</Typography.Text>\n </div>\n </List.Item>\n <List.Item>\n <Typography.Text strong>{'Loader Index'}</Typography.Text>\n <div>{`${loader.loaderIndex}`}</div>\n </List.Item>\n <List.Item>\n <Typography.Text strong>{'Loader Path'}</Typography.Text>\n <CodeOpener cwd={cwd} url={loader.path} loc=\"\" disabled />\n </List.Item>\n <List.Item>\n <div style={{ width: 180 }}>\n <Typography.Text strong>{'Options'}</Typography.Text>\n </div>\n <Divider type=\"vertical\" />\n <Typography.Paragraph\n ellipsis={{\n rows: 2,\n expandable: true,\n symbol: 'more',\n }}\n copyable\n >\n {JSON.stringify(loader.options || '-')}\n </Typography.Paragraph>\n </List.Item>\n </List>\n </Space>\n </Card>\n );\n};\n\n// Component to render Loader Details content with lazy-loaded code\nconst LoaderDetailsContent = ({\n loader,\n resource,\n isLight,\n codeData,\n}: {\n loader: Omit<SDK.LoaderTransformData, 'input' | 'result'> & { costs: number };\n resource: SDK.ResourceData;\n isLight: boolean;\n codeData: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetLoaderFileInputAndOutput>;\n}): JSX.Element => {\n const hasError = loader.errors && loader.errors.length;\n const before = codeData?.input || '';\n const loaderResult = codeData?.output || '';\n\n return (\n <div style={{ height: '100%' }}>\n {hasError ? (\n <Col span={24} style={{ height: '53%', minHeight: 400 }}>\n <div\n style={{\n padding: Size.BasePadding,\n borderTop: `1px solid ${isLight ? '#f0f0f0' : 'rgba(253, 253, 253, 0.12)'}`,\n borderBottom: `1px solid ${isLight ? '#f0f0f0' : 'rgba(253, 253, 253, 0.12)'}`,\n }}\n >\n <Title\n text={`the error stack of [${loader.loader}] ${loader.isPitch ? 'pitch' : ''}`}\n />\n </div>\n <div style={{ height: '90%' }}>\n <CodeViewer code={loader.errors[0].message} lang=\"javascript\" />\n </div>\n </Col>\n ) : (\n <Col span={24} style={{ height: '53%', minHeight: 400 }}>\n <div\n style={{\n display: 'flex',\n alignItems: 'center',\n padding: Size.BasePadding,\n borderBottom: `1px solid ${isLight ? '#f0f0f0' : 'rgba(253, 253, 253, 0.12)'}`,\n }}\n >\n <Title\n text={\n <>\n {`the result of [${loader.loader}] ${loader.isPitch ? 'pitch' : ''}`}\n {!loader.isPitch && (\n <span style={{ fontWeight: 400 }}>\n (\n <InputIcon\n style={{\n verticalAlign: 'middle',\n margin: '0 2px',\n }}\n />\n Input ⟷\n <OutputIcon\n style={{\n verticalAlign: 'middle',\n position: 'relative',\n top: -2,\n }}\n />\n Output)\n </span>\n )}\n </>\n }\n />\n <div style={{ flex: 1 }} />\n </div>\n {loader.isPitch ? (\n loaderResult ? (\n <div style={{ height: '90%' }}>\n <CodeViewer\n isEmbed\n code={loaderResult}\n filePath={resource.path}\n />\n </div>\n ) : (\n <Empty\n description={\n 'No loader result. If you use the Brief Mode, there will not have loader results.'\n }\n />\n )\n ) : (\n <div style={{ minHeight: '700px' }}>\n <div style={{ height: '40rem', overflow: 'hidden' }}>\n {!loaderResult && !before ? (\n <Empty\n description={\n 'No loader result. If you use the Brief Mode, there will not have loader results.'\n }\n />\n ) : (\n <DiffViewer\n isEmbed\n original={before}\n modified={loaderResult || ''}\n originalFilePath={resource.path}\n modifiedFilePath={resource.path}\n />\n )}\n </div>\n </div>\n )}\n </Col>\n )}\n </div>\n );\n};\n\nexport const LoaderExecutions = ({\n data,\n cwd,\n index,\n}: PropsWithChildren<LoaderExecutionsProps>): JSX.Element => {\n const { loaders, resource } = data;\n const [currentIndex, setCurrentIndex] = useState(index || 0);\n const { theme } = useTheme();\n const isLight = theme === 'light';\n const loader = loaders[currentIndex];\n const leftSpan = 5;\n const [activeKey, setActiveKey] = useState('loaderDetails');\n const onChange = useCallback((key: string) => {\n setActiveKey(key);\n }, []);\n\n return (\n <Row className={styles.executions} style={{ height: '100%' }}>\n <Col\n span={leftSpan}\n style={{\n borderRight: isLight ? `1px solid #f0f0f0` : undefined,\n padding: Size.BasePadding,\n }}\n >\n <Space direction=\"vertical\" style={{ width: '100%' }}>\n <Title text=\"Executions\" />\n <Timeline mode=\"left\" style={{ marginTop: Size.BasePadding }}>\n {loaders.map((e, i, arr) => {\n const { loader, isPitch } = e;\n const costs = formatCosts(e.costs);\n return (\n <Timeline.Item\n dot={\n isPitch ? (\n <Tag style={{ marginLeft: 1, fontWeight: 500 }}>\n pitch\n </Tag>\n ) : (\n <ClockCircleTwoTone />\n )\n }\n style={{ paddingBottom: 10, textAlign: 'center' }}\n key={i}\n >\n <Row align=\"middle\" justify=\"space-between\" gutter={[0, 10]}>\n <Col span={24} className={styles.timeline}>\n <Tooltip title={loader} trigger=\"hover\">\n <div\n className={`${styles.box} ${currentIndex === i ? styles.selected : ''}`}\n onClick={() => {\n setCurrentIndex(i);\n }}\n style={{ textAlign: 'left' }}\n >\n <div>\n <Typography.Text style={{ color: '#000' }}>\n {costs.match(/[0-9]*\\.?[0-9]+/g)?.[0]}\n </Typography.Text>\n {` `}\n <Typography.Text\n style={{ color: 'rgba(0,0,0,0.45)' }}\n >\n {costs.match(/[a-zA-Z]+/g)}\n </Typography.Text>\n </div>\n <Typography.Text\n style={{ color: 'rgba(0,0,0,0.65)' }}\n className={styles.loader}\n >\n {loader}\n </Typography.Text>\n </div>\n </Tooltip>\n </Col>\n </Row>\n {i === arr.length - 1 ? null : (\n <div style={{ paddingTop: 10 }}>\n <StepIcon />\n </div>\n )}\n </Timeline.Item>\n );\n })}\n </Timeline>\n </Space>\n </Col>\n <Col span={24 - leftSpan} style={{ height: '100%' }}>\n <Tabs\n type=\"card\"\n defaultActiveKey=\"loaderDetails\"\n activeKey={activeKey}\n items={[\n {\n label: 'Loader Props',\n key: 'loaderProps',\n children: (\n <LoaderPropsItem\n loader={loader}\n resource={resource}\n cwd={cwd}\n />\n ),\n },\n {\n label: 'Loader Details',\n key: 'loaderDetails',\n children:\n activeKey === 'loaderDetails' ? (\n <ServerAPIProvider\n api={SDK.ServerAPI.API.GetLoaderFileInputAndOutput}\n body={{\n file: resource.path,\n loader: loader.loader,\n loaderIndex: loader.loaderIndex,\n }}\n showSkeleton={false}\n >\n {(codeData) => (\n <LoaderDetailsContent\n loader={loader}\n resource={resource}\n isLight={isLight}\n codeData={codeData}\n />\n )}\n </ServerAPIProvider>\n ) : null,\n },\n ]}\n onChange={onChange}\n />\n </Col>\n </Row>\n );\n};\n"],"names":["LoaderPropsItem","loader","resource","cwd","Card","Tag","ClockCircleTwoTone","dayjs","Space","Typography","List","beautifyPath","CodeOpener","formatCosts","Divider","JSON","LoaderDetailsContent","isLight","codeData","hasError","before","loaderResult","Col","Size","Title","CodeViewer","InputIcon","OutputIcon","Empty","DiffViewer","LoaderExecutions","data","index","loaders","currentIndex","setCurrentIndex","useState","theme","useTheme","leftSpan","activeKey","setActiveKey","onChange","useCallback","key","Row","styles","undefined","Timeline","e","i","arr","isPitch","costs","Tooltip","StepIcon","Tabs","ServerAPIProvider","SDK"],"mappings":";;;;;;;;;;;;;;;;;AAmCA,MAAMA,kBAAkB,CAAC,EACvBC,MAAM,EACNC,QAAQ,EACRC,GAAG,EAOJ,GACQ,WAAP,GACE,IAACC,MAAIA;QACH,OAAO;QACP,OAAO;YAAE,QAAQ;QAAO;QACxB,qBACE,IAACC,KAAGA;YAAC,oBAAM,IAACC,oBAAkBA,CAAAA;YAAK,OAAM;sBACtCC,MAAMN,OAAO,OAAO,EAAE,MAAM,CAAC;;kBAIlC,mBAACO,OAAKA;YAAC,WAAU;YAAW,OAAO;gBAAE,OAAO;YAAO;;gBAChDP,OAAO,OAAO,GAAG,WAAH,GAAG,IAACQ,WAAW,IAAI;oBAAC,MAAI;8BAAC;qBAA0B;8BAClE,KAACC,MAAIA;oBAAC,MAAK;oBAAQ,UAAQ;;sCACzB,KAACA,KAAK,IAAI;;8CACR,IAACD,WAAW,IAAI;oCAAC,QAAM;8CAAE;;8CACzB,IAAC;8CAAKE,aAAaT,SAAS,IAAI,EAAEC;;;;sCAEpC,KAACO,KAAK,IAAI;;8CACR,IAACD,WAAW,IAAI;oCAAC,QAAM;8CAAE;;8CACzB,IAACG,YAAUA;oCAAC,KAAKT;oCAAK,KAAKD,SAAS,IAAI;oCAAE,KAAI;oCAAG,UAAQ;;;;sCAE3D,KAACQ,KAAK,IAAI;;8CACR,IAACD,WAAW,IAAI;oCAAC,QAAM;8CAAE;;8CACzB,IAAC;8CAAKP,SAAS,QAAQ,IAAI;;;;sCAE7B,KAACQ,KAAK,IAAI;;8CACR,IAACD,WAAW,IAAI;oCAAC,QAAM;8CAAE;;8CACzB,IAAC;8CAAKI,YAAYZ,OAAO,KAAK;;;;sCAEhC,KAACS,KAAK,IAAI;;8CACR,IAACD,WAAW,IAAI;oCAAC,QAAM;8CAAE;;8CACzB,IAAC;8CACC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