mage-ai 0.9.65__py3-none-any.whl → 0.9.67__py3-none-any.whl
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.
Potentially problematic release.
This version of mage-ai might be problematic. Click here for more details.
- mage_ai/api/monitors/BaseMonitor.py +38 -16
- mage_ai/api/policies/BackfillPolicy.py +1 -0
- mage_ai/api/resources/OauthResource.py +13 -5
- mage_ai/api/resources/SessionResource.py +6 -4
- mage_ai/authentication/ldap.py +19 -9
- mage_ai/authentication/oauth/constants.py +8 -14
- mage_ai/authentication/oauth/utils.py +18 -6
- mage_ai/authentication/providers/active_directory.py +21 -16
- mage_ai/authentication/providers/azure_devops.py +18 -0
- mage_ai/authentication/providers/bitbucket.py +10 -9
- mage_ai/authentication/providers/constants.py +2 -0
- mage_ai/authentication/providers/ghe.py +5 -9
- mage_ai/authentication/providers/gitlab.py +6 -9
- mage_ai/authentication/providers/google.py +9 -6
- mage_ai/authentication/providers/oidc.py +6 -4
- mage_ai/authentication/providers/okta.py +9 -6
- mage_ai/cluster_manager/kubernetes/workload_manager.py +10 -0
- mage_ai/cluster_manager/workspace/base.py +6 -1
- mage_ai/cluster_manager/workspace/kubernetes.py +3 -0
- mage_ai/data_preparation/decorators.py +15 -0
- mage_ai/data_preparation/executors/streaming_pipeline_executor.py +22 -12
- mage_ai/data_preparation/git/__init__.py +10 -1
- mage_ai/data_preparation/git/api.py +3 -0
- mage_ai/data_preparation/git/clients/azure_devops.py +106 -0
- mage_ai/data_preparation/git/clients/base.py +6 -0
- mage_ai/data_preparation/git/clients/gitlab.py +3 -2
- mage_ai/data_preparation/git/utils.py +31 -29
- mage_ai/data_preparation/models/block/__init__.py +27 -18
- mage_ai/data_preparation/models/block/dbt/block_sql.py +164 -0
- mage_ai/data_preparation/models/block/dynamic/variables.py +1 -2
- mage_ai/data_preparation/models/pipeline.py +3 -3
- mage_ai/data_preparation/models/triggers/__init__.py +6 -1
- mage_ai/data_preparation/preferences.py +42 -37
- mage_ai/data_preparation/repo_manager.py +21 -0
- mage_ai/data_preparation/storage/gcs_storage.py +27 -2
- mage_ai/data_preparation/storage/local_storage.py +18 -3
- mage_ai/data_preparation/storage/s3_storage.py +7 -2
- mage_ai/data_preparation/templates/data_loaders/streaming/generic_python.py +23 -0
- mage_ai/data_preparation/templates/main/metadata.yaml +6 -0
- mage_ai/data_preparation/templates/template.py +6 -2
- mage_ai/data_preparation/variable_manager.py +2 -1
- mage_ai/io/base.py +3 -0
- mage_ai/io/bigquery.py +2 -0
- mage_ai/io/export_utils.py +14 -9
- mage_ai/io/mssql.py +104 -25
- mage_ai/io/mysql.py +10 -9
- mage_ai/io/oracledb.py +14 -2
- mage_ai/io/postgres.py +3 -0
- mage_ai/io/sql.py +14 -6
- mage_ai/io/trino.py +10 -8
- mage_ai/orchestration/db/migrations/versions/90d978a8aef8_update_unique_constraint_for_secret.py +11 -5
- mage_ai/orchestration/db/models/schedules.py +25 -1
- mage_ai/orchestration/db/models/schedules_project_platform.py +24 -1
- mage_ai/orchestration/job_manager.py +6 -1
- mage_ai/orchestration/pipeline_scheduler_original.py +16 -10
- mage_ai/server/constants.py +1 -1
- mage_ai/server/file_observer.py +10 -0
- mage_ai/server/frontend_dist/404.html +2 -2
- mage_ai/server/frontend_dist/_next/static/chunks/{1557-a754b04510d50b80.js → 1557-01f0843dc6ac4971.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/9440-4069842b90d4b801.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/_app-1c1ffd928f5a00f7.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/index-b7b8695a7f9efde2.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/oauth-30e34ee15d410331.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-ff4bd7a8ec3bab40.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-aaf393c86fc1bda3.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/{edit-8d32ac7e8f023779.js → edit-36377e679da2cd91.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/logs-3f5c14076ddde20e.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/{triggers-fe08120d9a6fb1b0.js → triggers-f508c2f261297724.js} +1 -1
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/pipelines-bcdb4ad41dd4c7d5.js → frontend_dist/_next/static/chunks/pages/pipelines-f99e99aa8f45529c.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/{sign-in-19b36600d908b711.js → sign-in-7d38b2f7c3e918a1.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/version-control-5753fac7c1bfdc88.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/{webpack-ac7fdc472bedf682.js → webpack-d079359c241db804.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/{ZMrJfDouIX5AMb_RteRbL → vPsMu6Fi2zrHaf2fRXKRO}/_buildManifest.js +1 -1
- mage_ai/server/frontend_dist/block-layout.html +2 -2
- mage_ai/server/frontend_dist/compute.html +2 -2
- mage_ai/server/frontend_dist/files.html +2 -2
- mage_ai/server/frontend_dist/global-data-products/[...slug].html +2 -2
- mage_ai/server/frontend_dist/global-data-products.html +2 -2
- mage_ai/server/frontend_dist/global-hooks/[...slug].html +2 -2
- mage_ai/server/frontend_dist/global-hooks.html +2 -2
- mage_ai/server/frontend_dist/index.html +2 -2
- mage_ai/server/frontend_dist/manage/files.html +2 -2
- mage_ai/server/frontend_dist/manage/settings.html +2 -2
- mage_ai/server/frontend_dist/manage/users/[user].html +2 -2
- mage_ai/server/frontend_dist/manage/users/new.html +2 -2
- mage_ai/server/frontend_dist/manage/users.html +2 -2
- mage_ai/server/frontend_dist/manage.html +2 -2
- mage_ai/server/frontend_dist/oauth.html +2 -2
- mage_ai/server/frontend_dist/overview.html +2 -2
- mage_ai/server/frontend_dist/pipeline-runs.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills/[...slug].html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/dashboard.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/edit.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/logs.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runs.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runtime.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/runs/[run].html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/runs.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/settings.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/syncs.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers/[...slug].html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline].html +2 -2
- mage_ai/server/frontend_dist/pipelines.html +2 -2
- mage_ai/server/frontend_dist/platform/global-hooks/[...slug].html +2 -2
- mage_ai/server/frontend_dist/platform/global-hooks.html +2 -2
- mage_ai/server/frontend_dist/settings/account/profile.html +2 -2
- mage_ai/server/frontend_dist/settings/platform/preferences.html +2 -2
- mage_ai/server/frontend_dist/settings/platform/settings.html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/permissions/[...slug].html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/permissions.html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/preferences.html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/roles/[...slug].html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/roles.html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/sync-data.html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/users/[...slug].html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/users.html +2 -2
- mage_ai/server/frontend_dist/settings.html +2 -2
- mage_ai/server/frontend_dist/sign-in.html +2 -2
- mage_ai/server/frontend_dist/templates/[...slug].html +2 -2
- mage_ai/server/frontend_dist/templates.html +2 -2
- mage_ai/server/frontend_dist/terminal.html +2 -2
- mage_ai/server/frontend_dist/test.html +2 -2
- mage_ai/server/frontend_dist/triggers.html +2 -2
- mage_ai/server/frontend_dist/version-control.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/404.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{1557-a754b04510d50b80.js → 1557-01f0843dc6ac4971.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9440-4069842b90d4b801.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/_app-1c1ffd928f5a00f7.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/index-b7b8695a7f9efde2.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/oauth-30e34ee15d410331.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-ff4bd7a8ec3bab40.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills-aaf393c86fc1bda3.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/{edit-8d32ac7e8f023779.js → edit-36377e679da2cd91.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/logs-3f5c14076ddde20e.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/{triggers-fe08120d9a6fb1b0.js → triggers-f508c2f261297724.js} +1 -1
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/pipelines-bcdb4ad41dd4c7d5.js → frontend_dist_base_path_template/_next/static/chunks/pages/pipelines-f99e99aa8f45529c.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{sign-in-19b36600d908b711.js → sign-in-7d38b2f7c3e918a1.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/version-control-5753fac7c1bfdc88.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{webpack-481689d9989710cd.js → webpack-68c003fb6a175cd7.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/{QYwFH4sievaq5XyUjRriy → khKiaJtwrslgMmp4YSa1f}/_buildManifest.js +1 -1
- mage_ai/server/frontend_dist_base_path_template/block-layout.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/compute.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/files.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/global-data-products/[...slug].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/global-data-products.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/global-hooks/[...slug].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/global-hooks.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/index.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/manage/files.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/manage/settings.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/manage/users/[user].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/manage/users/new.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/manage/users.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/manage.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/oauth.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/overview.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipeline-runs.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills/[...slug].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/dashboard.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/edit.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/logs.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runs.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runtime.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs/[run].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/settings.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/syncs.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers/[...slug].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/platform/global-hooks/[...slug].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/platform/global-hooks.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/account/profile.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/platform/preferences.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/platform/settings.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions/[...slug].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/preferences.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles/[...slug].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/sync-data.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/users/[...slug].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/users.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/sign-in.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/templates/[...slug].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/templates.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/terminal.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/test.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/triggers.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/version-control.html +2 -2
- mage_ai/server/server.py +117 -87
- mage_ai/server/utils/output_display.py +6 -1
- mage_ai/services/aws/s3/s3.py +8 -2
- mage_ai/services/slack/slack.py +8 -8
- mage_ai/settings/__init__.py +36 -186
- mage_ai/settings/backends.py +95 -0
- mage_ai/settings/keys/__init__.py +1 -0
- mage_ai/settings/keys/auth.py +76 -0
- mage_ai/settings/server.py +187 -0
- mage_ai/shared/io.py +2 -2
- mage_ai/shared/logger.py +12 -6
- mage_ai/streaming/sources/base_python.py +30 -0
- mage_ai/streaming/sources/source_factory.py +25 -0
- mage_ai/tests/api/endpoints/test_oauths.py +13 -5
- mage_ai/tests/api/operations/test_operations.py +2 -2
- mage_ai/tests/api/operations/test_sessions.py +83 -48
- mage_ai/tests/authentication/oauth/test_utils.py +56 -6
- mage_ai/tests/authentication/providers/test_active_directory.py +9 -15
- mage_ai/tests/data_preparation/models/test_block.py +39 -2
- mage_ai/tests/orchestration/db/models/test_schedules.py +33 -1
- {mage_ai-0.9.65.dist-info → mage_ai-0.9.67.dist-info}/METADATA +2 -1
- {mage_ai-0.9.65.dist-info → mage_ai-0.9.67.dist-info}/RECORD +225 -217
- {mage_ai-0.9.65.dist-info → mage_ai-0.9.67.dist-info}/WHEEL +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/9440-2bcbdc765ed82062.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/_app-2ae1d919333f01fe.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/index-64851458dde54ad9.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/oauth-abe5ba687cb93509.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-22e49726eeed16ae.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-c74507dce89b41a2.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/logs-cf656cbe37ecaacc.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/version-control-690206d30d8b412b.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9440-2bcbdc765ed82062.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/_app-2ae1d919333f01fe.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/index-64851458dde54ad9.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/oauth-abe5ba687cb93509.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-22e49726eeed16ae.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills-c74507dce89b41a2.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/logs-cf656cbe37ecaacc.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/version-control-690206d30d8b412b.js +0 -1
- mage_ai/settings/sso.py +0 -27
- /mage_ai/server/frontend_dist/_next/static/{ZMrJfDouIX5AMb_RteRbL → vPsMu6Fi2zrHaf2fRXKRO}/_ssgManifest.js +0 -0
- /mage_ai/server/frontend_dist_base_path_template/_next/static/{QYwFH4sievaq5XyUjRriy → khKiaJtwrslgMmp4YSa1f}/_ssgManifest.js +0 -0
- {mage_ai-0.9.65.dist-info → mage_ai-0.9.67.dist-info}/LICENSE +0 -0
- {mage_ai-0.9.65.dist-info → mage_ai-0.9.67.dist-info}/entry_points.txt +0 -0
- {mage_ai-0.9.65.dist-info → mage_ai-0.9.67.dist-info}/top_level.txt +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9440],{39440:function(e,n,t){t.d(n,{Z:function(){return he}});var o=t(21831),i=t(82394),l=t(75582),r=t(65701),u=t(1254),c=t(82684),a=t(69864),d=t(10975),s=t(14567),f=t(47041),h=t(70515),v=t(28598),m=3*h.iI;var p=function(e){e.blockLayoutItem;var n=e.buildChart,t=e.height,o=e.width,i=(0,c.useMemo)((function(){return t-(f.nn+m)}),[t]),l=(0,c.useMemo)((function(){return null===n||void 0===n?void 0:n({height:i,width:o})}),[n,i,o]);return(0,v.jsx)(v.Fragment,{children:l})},x=t(75399),g=t(71180),b=t(4006),j=t(97618),y=t(55485),Z=t(46732),k=t(72473),_=t(25976),C=t(44897),P=t(42631),I=3*h.iI,w=_.default.div.withConfig({displayName:"indexstyle__DividerStyle",componentId:"sc-17acf36-0"})(["display:flex;position:relative;",";",";"],(function(e){return!e.horizontal&&"\n height: 100%;\n justify-content: center;\n width: ".concat(I,"px;\n ")}),(function(e){return e.horizontal&&"\n align-items: center;\n height: ".concat(I,"px;\n margin-left: ").concat(I,"px;\n margin-right: ").concat(I,"px;\n width: calc(100% - ").concat(2*I,"px);\n ")})),O=_.default.div.withConfig({displayName:"indexstyle__BarStyle",componentId:"sc-17acf36-1"})(["border-radius:","px;"," ",";",";"],P.Ro,(function(e){return"\n background-color: ".concat((e.theme||C.Z).accent.blueLight,";\n ")}),(function(e){return!e.horizontal&&"\n height: 100%;\n width: ".concat(.5*h.iI,"px;\n ")}),(function(e){return e.horizontal&&"\n height: ".concat(.5*h.iI,"px;\n width: 100%;\n ")})),S=_.default.a.withConfig({displayName:"indexstyle__ButtonStyle",componentId:"sc-17acf36-2"})(["align-items:center;border-radius:50%;display:flex;height:","px;justify-content:center;position:absolute;width:","px;"," ",";",";"],3*h.iI,3*h.iI,(function(e){return"\n background-color: ".concat((e.theme||C.Z).background.page,";\n border: ").concat(P.mP,"px solid ").concat((e.theme||C.Z).accent.blueLight,";\n box-shadow:\n 0 0 0 ").concat(P.mP,"px ").concat((e.theme||C.Z).background.page,";\n\n &:hover {\n background-color: ").concat((e.theme||C.Z).interactive.linkPrimary,";\n border: ").concat(P.mP,"px solid ").concat((e.theme||C.Z).interactive.linkPrimary,";\n cursor: pointer;\n }\n ")}),(function(e){return!e.horizontal&&"\n top: ".concat(3*h.iI,"px;\n ")}),(function(e){return e.horizontal&&"\n left: ".concat(3*h.iI,"px;\n ")}));var M=function(e){var n=e.horizontal,t=e.onClickAdd,o=(0,c.useState)(!1),i=o[0],l=o[1];return(0,v.jsx)(w,{horizontal:n,onMouseEnter:function(){return l(!0)},onMouseLeave:function(){return l(!1)},children:i&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(S,{horizontal:n,href:"#",onClick:function(e){e.preventDefault(),null===t||void 0===t||t()},children:(0,v.jsx)(k.Add,{size:2*h.iI})}),(0,v.jsx)(O,{horizontal:n})]})})},E=t(38276),L=t(4190),N=t(30160),R=t(17488),D=t(35686),B=2*(P.YF+h.cd*h.iI)+I,U=_.default.div.withConfig({displayName:"indexstyle__ItemStyle",componentId:"sc-rcft6g-0"})(["border-radius:","px;padding:","px;",""],P.Ro,h.cd*h.iI,(function(e){return"\n border: ".concat(P.YF,"px ").concat(P.M8," ").concat((e.theme||C.Z).interactive.defaultBorder,";\n background-color: ").concat((e.theme||C.Z).background.chartBlock,";\n ")})),H=t(35058);function A(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function F(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?A(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):A(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var W=function(e){var n,t,o=e.block,r=e.blockLayoutItem,u=void 0===r?null:r,a=e.blockUUID,f=e.columnIndex,m=e.columnLayoutSettings,_=e.columnsInRow,C=e.createNewBlockItem,P=e.detail,w=e.disableDrag,O=e.first,S=e.height,A=e.isLoading,W=e.onDrop,q=e.onSave,z=e.pageBlockLayoutUUID,T=e.removeBlockLayoutItem,J=e.rowIndex,K=e.setSelectedBlockItem,V=e.updateLayout,Y=e.width,G=(0,c.useRef)(null),X=(0,c.useState)(!1),Q=X[0],$=X[1],ee=(0,c.useState)(!1),ne=ee[0],te=ee[1],oe=(0,c.useState)(!1),ie=oe[0],le=oe[1],re=(0,c.useState)(m)[0],ue=(0,c.useState)(null),ce=ue[0],ae=ue[1],de=(0,c.useMemo)((function(){return u||ce}),[u,ce]),se=(0,c.useState)(null),fe=se[0],he=se[1],ve=(0,c.useMemo)((function(){return(null===de||void 0===de?void 0:de.data)||fe}),[de,fe]),me=(0,c.useMemo)((function(){var e,n=null===de||void 0===de||null===(e=de.data_source)||void 0===e?void 0:e.refresh_interval;return n?Math.max(n,1e3):n}),[de]),pe=D.ZP.block_layout_items.page_block_layouts.detail(!u&&encodeURIComponent(z),!u&&encodeURIComponent(a),{},{refreshInterval:me,revalidateOnFocus:!me}).data;(0,c.useEffect)((function(){de||(o?ae(o):null!==pe&&void 0!==pe&&pe.block_layout_item&&ae(null===pe||void 0===pe?void 0:pe.block_layout_item))}),[o,de,pe]),(0,c.useEffect)((function(){var e,n;null!==pe&&void 0!==pe&&null!==(e=pe.block_layout_item)&&void 0!==e&&e.data&&he(null===pe||void 0===pe||null===(n=pe.block_layout_item)||void 0===n?void 0:n.data)}),[null===pe||void 0===pe||null===(n=pe.block_layout_item)||void 0===n?void 0:n.data]);var xe=(0,c.useCallback)((function(e){var n,t=e.height,o=e.width;if(!ve)return null;var l=null===ve||void 0===ve?void 0:ve.render;if(l){var r=null===ve||void 0===ve?void 0:ve.render_type;if(x.hN.JPEG===r||x.hN.JPG===r)return(0,v.jsx)("img",{height:t,src:"data:image/jpeg;base64,".concat(l),width:o});if(x.hN.PNG===r)return(0,v.jsx)("img",{height:t,src:"data:image/png;base64,".concat(l),width:o});if(x.hN.HTML===r)return(0,v.jsx)("iframe",{srcdoc:l,style:{height:t,width:o}})}return(0,v.jsx)(b.Z,{block:F(F({},de),{},{configuration:F(F({},null===de||void 0===de?void 0:de.configuration),{},(0,i.Z)({},H.JJ,t))}),data:ve,width:o,xAxisLabel:null===de||void 0===de||null===(n=de.configuration)||void 0===n?void 0:n.x_axis_label})}),[de,ve]),ge=(0,d.c)((function(){return{collect:function(e){return{isDragging:!!e.isDragging()}},item:{blockLayoutItem:de,columnIndex:f,rowIndex:J},type:"BlockLayoutItem"}}),[de,f,J]),be=(0,l.Z)(ge,2),je=be[0],ye=be[1],Ze=(0,s.L)((function(){return{accept:"BlockLayoutItem",drop:function(e){return null===W||void 0===W?void 0:W(e)}}}),[W]),ke=(0,l.Z)(Ze,2)[1];return P?(0,v.jsx)(p,{blockLayoutItem:de,buildChart:xe,height:S,width:Y}):(0,v.jsxs)(v.Fragment,{children:[O&&(0,v.jsx)(M,{onClickAdd:function(){return C({columnIndex:f,rowIndex:J})}}),(0,v.jsx)(j.Z,{flex:1,flexDirection:"column",children:(0,v.jsx)("div",{onMouseEnter:function(){return le(!0)},onMouseLeave:function(){return le(!1)},ref:ke,children:(0,v.jsxs)(U,F(F({},je),{},{ref:w?null:ye,children:[(0,v.jsx)(E.Z,{mb:1,children:(0,v.jsxs)(y.ZP,{alignContent:"center",justifyContent:"space-between",children:[(0,v.jsx)(E.Z,{py:1,children:(0,v.jsx)(N.ZP,{bold:!0,default:!0,children:(null===de||void 0===de?void 0:de.name)||a})}),(0,v.jsx)("div",{children:(0,v.jsx)(Z.Z,{items:[{label:function(){return"Edit content"},onClick:function(){return null===K||void 0===K?void 0:K(de)},uuid:"Edit content"},{label:function(){return"Change height and/or width"},onClick:function(){return te(!0)},uuid:"Change"},{label:function(){return"Remove chart"},onClick:function(){return null===T||void 0===T?void 0:T()},uuid:"Remove chart"}],onClickCallback:function(){return $(!1)},onClickOutside:function(){return $(!1)},open:Q,parentRef:G,rightOffset:0,uuid:"BlockLayoutItem/".concat(a),children:(ie||Q)&&(0,v.jsx)(g.ZP,{disabled:A,iconOnly:!0,loading:A,noBackground:!0,onClick:function(){$(!0)},children:(0,v.jsx)(k.Ellipsis,{default:!0,size:2*h.iI})})})})]})}),ne&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(y.ZP,{alignItems:"center",fullWidth:!0,children:[(0,v.jsxs)(j.Z,{flex:1,flexDirection:"column",children:[(0,v.jsx)(N.ZP,{bold:!0,muted:!0,small:!0,children:"Width (flex box)"}),(0,v.jsx)(R.Z,{compact:!0,fullWidth:!0,onChange:function(e){return null===V||void 0===V?void 0:V(F(F({},m),{},{width:"undefined"!==typeof e.target.value?Number(e.target.value):e.target.value}))},primary:!0,setContentOnMount:!0,small:!0,type:"number",value:(null===m||void 0===m?void 0:m.width)||""})]}),(0,v.jsx)(E.Z,{mr:1}),(0,v.jsxs)(j.Z,{flex:1,flexDirection:"column",children:[(0,v.jsx)(N.ZP,{bold:!0,muted:!0,small:!0,children:"Max width (%)"}),(0,v.jsx)(R.Z,{compact:!0,fullWidth:!0,label:"Max width percentage",onChange:function(e){return null===V||void 0===V?void 0:V(F(F({},m),{},{max_width_percentage:"undefined"!==typeof e.target.value?Number(e.target.value):e.target.value}))},primary:!0,setContentOnMount:!0,small:!0,type:"number",value:(null===m||void 0===m?void 0:m.max_width_percentage)||""})]}),(0,v.jsx)(E.Z,{mr:1}),(0,v.jsxs)(j.Z,{flex:1,flexDirection:"column",children:[(0,v.jsx)(N.ZP,{bold:!0,muted:!0,small:!0,children:"Height (pixels)"}),(0,v.jsx)(R.Z,{compact:!0,fullWidth:!0,onChange:function(e){return null===V||void 0===V?void 0:V(F(F({},m),{},{height:"undefined"!==typeof e.target.value?Number(e.target.value):e.target.value}))},primary:!0,setContentOnMount:!0,small:!0,type:"number",value:(null===m||void 0===m?void 0:m.height)||""})]})]}),(0,v.jsx)(E.Z,{mt:h.cd,children:(0,v.jsxs)(y.ZP,{alignItems:"center",justifyContent:"flex-end",children:[(0,v.jsx)(g.ZP,{compact:!0,onClick:function(){null===q||void 0===q||q(),te(!1)},primary:!0,small:!0,children:"Save"}),(0,v.jsx)(E.Z,{mr:1}),(0,v.jsx)(g.ZP,{compact:!0,onClick:function(){te(!1),null===V||void 0===V||V(re)},small:!0,children:"Cancel"})]})})]}),!pe&&!ve&&(0,v.jsx)(L.Z,{inverted:!0}),ve&&xe({height:S||(null===de||void 0===de||null===(t=de.configuration)||void 0===t?void 0:t[H.JJ]),width:Y-(B+1)-(_?I/_:0)})]}))})}),(0,v.jsx)(M,{onClickAdd:function(){return C({columnIndex:f+1,rowIndex:J})}})]})},q=t(44425),z=t(54750),T=t(31882),J=t(10305),K=t(44085),V=t(85108),Y=t(81728),G=t(86735);function X(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Q(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?X(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):X(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var $=function(e){var n=e.block,t=e.updateConfiguration,o=n||{},r=o.data,u=o.configuration,a=(u||{}).chart_type,d=(r||{}).columns,s=V.G8[a],f=(0,c.useMemo)((function(){return Object.entries(s||{}).reduce((function(e,n){var o=(0,l.Z)(n,2),r=o[0],c=o[1];return Q(Q({},e),{},(0,i.Z)({},r,c.map((function(e){var n,o=e.autoRun,l=e.label,r=e.monospace,c=e.options,a=e.settings,s=void 0===a?{}:a,f=e.type,h=e.uuid,m={fullWidth:!0,key:h,label:(0,Y.kC)(l()),monospace:r,onChange:function(e){return t((0,i.Z)({},h,e.target.value),{autoRun:o})},value:(null===u||void 0===u?void 0:u[h])||""};if(V.VR.COLUMNS===f){var p=u[h]||[];n=(0,v.jsxs)(v.Fragment,{children:[(!s.maxValues||p.length<s.maxValues)&&(0,v.jsx)(K.Z,Q(Q({},m),{},{onChange:function(e){var n=u[h]||[],l=e.target.value;n.includes(l)?n=(0,G.Od)(n,(function(e){return e===l})):n.push(l),t((0,i.Z)({},h,n),{autoRun:o})},value:null,children:(0,G.YC)((d||[]).filter((function(e){return!p.includes(e)})),(function(e){return e})).map((function(e){return(0,v.jsx)("option",{value:e,children:e},e)}))})),p.map((function(e){return(0,v.jsx)("div",{style:{display:"inline-block",marginRight:2,marginTop:2},children:(0,v.jsx)(T.Z,{label:e,onClick:function(){t((0,i.Z)({},h,(0,G.Od)(p,(function(n){return n===e}))),{autoRun:o})}})},e)}))]})}else if(V.VR.METRICS===f){var x=u[h]||[];n=(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(N.ZP,{bold:!0,children:"Metrics"}),(0,v.jsx)(N.ZP,{muted:!0,small:!0,children:"Select a column and an aggregation function."}),(0,v.jsxs)(J.Z,{onChange:function(e,n){var l=n.resetValues,r=n.setValues;2===e.filter((function(e){return!!e})).length&&(x.find((function(n){var t=n.aggregation;return n.column===e[1]&&t===e[0]}))||(t((0,i.Z)({},h,x.concat({aggregation:e[0],column:e[1]})),{autoRun:o}),r([null,null]),l()))},children:[(0,v.jsx)(K.Z,Q(Q({},m),{},{label:"aggregation",children:(0,G.YC)(H.bn,(function(e){return e})).map((function(e){return(0,v.jsx)("option",{value:e,children:e},e)}))})),(0,v.jsx)(K.Z,Q(Q({},m),{},{label:"column",children:(0,G.YC)(d||[],(function(e){return e})).map((function(e){return(0,v.jsx)("option",{value:e,children:e},e)}))}))]}),x.map((function(e){var n=e.aggregation,l=e.column;return(0,v.jsx)("div",{style:{display:"inline-block",marginRight:2,marginTop:2},children:(0,v.jsx)(T.Z,{label:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(N.ZP,{inline:!0,monospace:!0,children:[n,"("]}),l,(0,v.jsx)(N.ZP,{inline:!0,monospace:!0,children:")"})]}),onClick:function(){t((0,i.Z)({},h,(0,G.Od)(x,(function(e){var t=e.aggregation,o=e.column;return n===t&&l===o}))),{autoRun:o})}})},"".concat(n,"(").concat(l,")"))}))]})}else n=c?(0,v.jsx)(K.Z,Q(Q({},m),{},{children:c.map((function(e){return(0,v.jsx)("option",{value:e,children:e},e)}))})):(0,v.jsx)(R.Z,Q(Q({},m),{},{type:f}));return(0,v.jsx)(E.Z,{mb:1,children:n},h)}))))}),{noCode:[]})}),[d,u,s,t]),h=(f.code,f.noCode);return(0,v.jsx)(v.Fragment,{children:h})},ee=t(89083),ne=t(15338),te=t(85854),oe=t(48670),ie=t(62547),le=t(2842),re=t(53808),ue=t(42122),ce=t(72619),ae=t(23780),de=t(19183);function se(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function fe(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?se(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):se(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var he=function(e){var n,t=e.leftOffset,d=e.pageBlockLayoutTemplate,s=e.topOffset,m=e.uuid,p=(0,ae.VI)(null,{},[],{uuid:"BlockLayout/".concat(m)}),b=(0,l.Z)(p,1)[0],Z=(0,c.useState)({}),_=(Z[0],Z[1],(0,c.useState)(null)),C=_[0],P=_[1],I=(0,c.useState)(!1),w=(I[0],I[1],(0,c.useRef)(null),"block_layout_after_width_".concat(m)),O="block_layout_before_width_".concat(m),S=(0,c.useRef)(null),B=(0,c.useState)((0,re.U2)(w,40*h.iI)),U=B[0],A=B[1],F=(0,c.useState)(!1),T=F[0],J=F[1],V=(0,c.useState)(Math.max((0,re.U2)(O),50*h.iI)),X=V[0],Q=V[1],se=(0,c.useState)(!1),he=se[0],ve=se[1],me=(0,c.useRef)(null),pe=(0,de.i)(),xe=(0,c.useState)(null),ge=xe[0],be=xe[1],je=(0,c.useState)(null),ye=je[0],Ze=je[1],ke=(0,c.useMemo)((function(){var e;return null===ge||void 0===ge||null===(e=ge.data_source)||void 0===e?void 0:e.refresh_interval}),[ge]),_e=D.ZP.block_layout_items.page_block_layouts.detail(ge&&encodeURIComponent(m),ge&&encodeURIComponent(null===ge||void 0===ge?void 0:ge.uuid),{configuration_override:encodeURIComponent(JSON.stringify((null===C||void 0===C?void 0:C.configuration)||"")),data_source_override:encodeURIComponent(JSON.stringify((null===C||void 0===C?void 0:C.data_source)||""))},{refreshInterval:ke,revalidateOnFocus:!ke}),Ce=_e.data,Pe=_e.mutate,Ie=(0,c.useMemo)((function(){return null===Ce||void 0===Ce?void 0:Ce.block_layout_item}),[Ce]);(0,c.useEffect)((function(){var e;null!==Ie&&void 0!==Ie&&null!==(e=Ie.data)&&void 0!==e&&e.error&&b({response:null===Ie||void 0===Ie?void 0:Ie.data})}),[Ie,b]);var we=(0,c.useCallback)((function(e){Pe(),P(e)}),[Pe,P]),Oe=(0,c.useCallback)((function(e){we((function(n){var t=fe(fe({},n),e);return"undefined"===typeof(null===t||void 0===t?void 0:t.name_new)&&(t.name_new=null===t||void 0===t?void 0:t.name),t})),be(e)}),[we,be]),Se=D.ZP.page_block_layouts.detail(encodeURIComponent(m)).data,Me=(0,c.useState)(null),Ee=Me[0],Le=Me[1],Ne=(0,c.useMemo)((function(){return null===Ee||void 0===Ee?void 0:Ee.layout}),[Ee]),Re=(0,c.useCallback)((function(e){Le((function(n){return fe(fe({},n),{},{layout:e})}))}),[Le]);(0,c.useEffect)((function(){null!==Se&&void 0!==Se&&Se.page_block_layout&&Le(null===Se||void 0===Se?void 0:Se.page_block_layout)}),[Se]);var De=(0,a.Db)(D.ZP.page_block_layouts.useUpdate(encodeURIComponent(m)),{onSuccess:function(e){return(0,ce.wD)(e,{callback:function(e){var n=e.page_block_layout,t=n.blocks;Le(n);var o=Object.values(t).find((function(e){return e.name===(null===C||void 0===C?void 0:C.name_new)}));o&&Oe(o),Ze(null),Pe()},onErrorCallback:function(e,n){return b({errors:n,response:e})}})}}),Be=(0,l.Z)(De,2),Ue=Be[0],He=Be[1].isLoading,Ae=(0,c.useCallback)((function(e){return Ue({page_block_layout:{blocks:fe(fe({},null===Ee||void 0===Ee?void 0:Ee.blocks),{},(0,i.Z)({},null===e||void 0===e?void 0:e.uuid,(0,ue.gR)(e,["data"]))),layout:null===Ee||void 0===Ee?void 0:Ee.layout}})}),[Ee,Ue]),Fe=(0,c.useCallback)((function(){return Ue({page_block_layout:{blocks:null===Ee||void 0===Ee?void 0:Ee.blocks,layout:null===Ee||void 0===Ee?void 0:Ee.layout}})}),[Ee,Ue]),We=(0,c.useMemo)((function(){return null===Ee||void 0===Ee?void 0:Ee.blocks}),[Ee]),qe=(0,c.useCallback)((function(e,n,t){var i=(0,o.Z)(Ne);i[e][n]=t,Re(i)}),[Ne,Re]),ze=(0,c.useState)(null),Te=ze[0],Je=ze[1],Ke=(0,c.useState)(null),Ve=Ke[0],Ye=Ke[1];(0,c.useEffect)((function(){var e;null===S||void 0===S||!S.current||T||he||Je(null===S||void 0===S||null===(e=S.current)||void 0===e?void 0:e.getBoundingClientRect())}),[T,he,S,ge,pe]),(0,c.useEffect)((function(){var e;null!==me&&void 0!==me&&me.current&&Ye(null===me||void 0===me||null===(e=me.current)||void 0===e?void 0:e.getBoundingClientRect())}),[me,ge,pe]),(0,c.useEffect)((function(){T||(0,re.t8)(w,U)}),[T,U,w]),(0,c.useEffect)((function(){he||(0,re.t8)(O,X)}),[he,X,O]);var Ge=(0,c.useCallback)((function(e,n,t){var i=fe({},null===Ee||void 0===Ee?void 0:Ee.blocks);null===i||void 0===i||delete i[e];var l=(0,o.Z)(null===Ee||void 0===Ee?void 0:Ee.layout),r=l[n]||[],u=(0,G.oM)(r,t);0===(null===u||void 0===u?void 0:u.length)?l=(0,G.oM)(l,n):l[n]=u,Ze(e),Ue({page_block_layout:{blocks:i,layout:l}})}),[Ee,Ue]),Xe=(0,c.useCallback)((function(e,n,t,i){var l=(0,o.Z)(Ne||[]),r=l[e]||[],u=r[n];if(e===t&&n!==i){var c=(0,G.oM)(r,n);l[e]=(0,G.Hk)(u,i>n?i:i-1,c)}else{var a=(0,G.oM)(r,n);l[e]=a;var d=(0,G.Hk)(u,i,l[t]);l[t]=d,0===(null===a||void 0===a?void 0:a.length)&&(l=(0,G.oM)(l,e))}e===t&&n===i||Ue({page_block_layout:{blocks:null===Ee||void 0===Ee?void 0:Ee.blocks,layout:l}})}),[Ne,Ee,Ue]),Qe=(0,c.useCallback)((function(e){var n=(0,Y.Y6)(),t={name:n,type:q.tf.CHART,uuid:(0,Y.kE)(n)},l=(0,o.Z)(Ne||[]),r={block_uuid:t.uuid,width:1};if(e){var u=e||{},c=u.columnIndex,a=void 0===c?0:c,d=u.rowIndex,s=u.rowIndexInsert;"undefined"!==typeof s?l=(0,G.Hk)([r],s,l):l[d]=(0,G.Hk)(r,a,l[d])}else l.push([r]);Ue({page_block_layout:{blocks:fe(fe({},null===Ee||void 0===Ee?void 0:Ee.blocks),{},(0,i.Z)({},t.uuid,t)),layout:l}}),Oe(t)}),[Ne,Ee,Oe,Ue]),$e=(0,c.useMemo)((function(){var e=[];return null===Ne||void 0===Ne||Ne.forEach((function(n,t){var o=[],i=(0,G.Sm)(null===n||void 0===n?void 0:n.map((function(e){return e.width||0})));n.forEach((function(e,l){var r=e.block_uuid,u=e.height,c=e.max_width_percentage,a=e.width,d=null===We||void 0===We?void 0:We[r],s="undefined"!==typeof c&&null!==c?c>=0?c/100:c:null,h=a/i,p=s&&h>s?s:h,x=(null===Te||void 0===Te?void 0:Te.width)-f.nn;o.push((0,v.jsx)(j.Z,{flexBasis:"".concat(Math.floor(100*p),"%"),children:(0,v.jsx)(W,{block:d,blockUUID:r,columnIndex:l,columnLayoutSettings:e,columnsInRow:null===n||void 0===n?void 0:n.length,createNewBlockItem:Qe,first:0===l,height:u,isLoading:ye===r&&He,onDrop:function(e){var n=e.columnIndex,o=e.rowIndex;Xe(o,n,t,l)},onSave:Fe,pageBlockLayoutUUID:m,removeBlockLayoutItem:function(){return Ge(r,t,l)},rowIndex:t,setSelectedBlockItem:Oe,updateLayout:function(e){return qe(t,l,e)},width:Math.floor(p*x)})},"row-".concat(t,"-column-").concat(l,"-").concat(r)))})),0===t&&e.push((0,v.jsx)(M,{horizontal:!0,onClickAdd:function(){return Qe({rowIndexInsert:t})}},"layout-divider-".concat(t,"-top"))),e.push((0,v.jsx)(y.ZP,{children:o},"row-".concat(t))),e.push((0,v.jsx)(M,{horizontal:!0,onClickAdd:function(){return Qe({rowIndexInsert:t+1})}},"layout-divider-".concat(t,"-bottom")))})),e}),[We,Te,Qe,ye,He,Ne,Xe,Ge,Fe,Oe,qe,m]),en=(0,c.useMemo)((function(){return Se&&0===(null===Ne||void 0===Ne?void 0:Ne.length)}),[Se,Ne]),nn=(0,c.useMemo)((function(){return(0,v.jsx)(y.ZP,{justifyContent:"center",children:(0,v.jsxs)(E.Z,{my:3*h.HN,px:h.cd,children:[(0,v.jsxs)(E.Z,{mb:h.Mq,children:[(0,v.jsx)(E.Z,{mb:1,children:(0,v.jsx)(te.Z,{center:!0,children:"Create a custom dashboard"})}),(0,v.jsx)(N.ZP,{center:!0,default:!0,children:"Add customizable charts with the exact insights you need."}),d&&(0,v.jsx)(N.ZP,{center:!0,default:!0,children:"Start with a recommended set or freely define your own."})]}),(0,v.jsxs)(y.ZP,{alignContent:"center",justifyContent:"center",children:[d&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(g.ZP,{onClick:function(){return Ue({page_block_layout:d})},primary:!0,children:"Add recommended charts"}),(0,v.jsx)(E.Z,{mr:1})]}),(0,v.jsx)(g.ZP,{onClick:function(){return Qe()},primary:!d,secondary:!!d,children:"Create new chart"})]})]})})}),[Qe,d,Ue]),tn=(0,c.useMemo)((function(){return(null===Te||void 0===Te?void 0:Te.height)-(null===Ve||void 0===Ve?void 0:Ve.height)}),[Te,Ve]),on=(0,c.useMemo)((function(){return!ge}),[ge]),ln=D.ZP.pipelines.detail(null===C||void 0===C||null===(n=C.data_source)||void 0===n?void 0:n.pipeline_uuid).data,rn=(0,c.useMemo)((function(){return null===ln||void 0===ln?void 0:ln.pipeline}),[ln]),un=(0,c.useMemo)((function(){return(0,G.YC)((null===rn||void 0===rn?void 0:rn.blocks)||[],"uuid")}),[rn]),cn=D.ZP.pipelines.list().data,an=(0,c.useMemo)((function(){return(0,G.YC)((null===cn||void 0===cn?void 0:cn.pipelines)||[],"uuid")}),[cn]),dn=D.ZP.pipeline_schedules.pipelines.list(null===rn||void 0===rn?void 0:rn.uuid).data,sn=(0,c.useMemo)((function(){return null===dn||void 0===dn?void 0:dn.pipeline_schedules}),[dn]),fn=(0,c.useMemo)((function(){return fe(fe(fe({},ge),C),{},{data:fe(fe(fe({},null===ge||void 0===ge?void 0:ge.data),null===C||void 0===C?void 0:C.data),null===Ie||void 0===Ie?void 0:Ie.data)})}),[Ie,C,ge]),hn=(0,c.useMemo)((function(){var e,n,t,o,i,l,r,u,c,a,d,f,m;return on?null:(0,v.jsxs)("div",{style:{paddingBottom:h.Mq*h.iI,paddingTop:"undefined"===typeof s?le.Wi:0},children:[(0,v.jsxs)(E.Z,{mt:h.Mq,px:h.cd,children:[(0,v.jsxs)(E.Z,{mb:1,children:[(0,v.jsx)(N.ZP,{bold:!0,children:"Chart name"}),(0,v.jsx)(N.ZP,{muted:!0,small:!0,children:"Human readable name for your chart."})]}),(0,v.jsx)(R.Z,{onChange:function(e){return we((function(n){return fe(fe({},n),{},{name_new:e.target.value})}))},placeholder:"Type name for chart...",primary:!0,setContentOnMount:!0,value:(null===C||void 0===C?void 0:C.name)||""})]}),(0,v.jsxs)(E.Z,{mt:h.Mq,px:h.cd,children:[(0,v.jsxs)(E.Z,{mb:1,children:[(0,v.jsx)(N.ZP,{bold:!0,children:"Chart type"}),(0,v.jsx)(N.ZP,{muted:!0,small:!0,children:"Choose how you want to display your data."})]}),(0,v.jsx)(K.Z,{onChange:function(e){return we((function(n){return fe(fe({},n),{},{configuration:{chart_type:e.target.value}})}))},placeholder:"Select chart type",primary:!0,value:(null===C||void 0===C||null===(e=C.configuration)||void 0===e?void 0:e.chart_type)||"",children:H.CK.concat(H.oV.CUSTOM).map((function(e){return(0,v.jsx)("option",{value:e,children:(0,Y.kC)(e)},e)}))})]}),(0,v.jsx)(E.Z,{mt:h.Mq,children:(0,v.jsx)(ne.Z,{light:!0})}),(0,v.jsx)(E.Z,{mt:h.Mq,px:h.cd,children:(0,v.jsx)(te.Z,{children:"Data source"})}),(0,v.jsxs)(E.Z,{mt:h.Mq,px:h.cd,children:[(0,v.jsxs)(E.Z,{mb:1,children:[(0,v.jsx)(N.ZP,{bold:!0,children:"Data source type"}),(0,v.jsx)(N.ZP,{muted:!0,small:!0,children:"Configure where the data for this chart comes from."})]}),(0,v.jsx)(K.Z,{onChange:function(e){return we((function(n){return fe(fe({},n),{},{data_source:fe(fe({},null===n||void 0===n?void 0:n.data_source),{},{type:e.target.value})})}))},placeholder:"Select data source type",primary:!0,value:(null===C||void 0===C||null===(n=C.data_source)||void 0===n?void 0:n.type)||"",children:x.tW.map((function(e){return(0,v.jsx)("option",{value:e,children:(0,Y.kC)(x.Qj[e])},e)}))})]}),[x.XO.BLOCK,x.XO.BLOCK_RUNS,x.XO.PIPELINE_RUNS,x.XO.PIPELINE_SCHEDULES].includes(null===C||void 0===C||null===(t=C.data_source)||void 0===t?void 0:t.type)&&(0,v.jsx)(v.Fragment,{children:(0,v.jsxs)(E.Z,{mt:h.Mq,px:h.cd,children:[(0,v.jsxs)(E.Z,{mb:1,children:[(0,v.jsx)(N.ZP,{bold:!0,children:"Pipeline UUID"}),(0,v.jsx)(N.ZP,{muted:!0,small:!0,children:"Select the pipeline the data source comes from."})]}),(0,v.jsxs)(K.Z,{monospace:!0,onChange:function(e){return we((function(n){return fe(fe({},n),{},{data_source:fe(fe({},null===n||void 0===n?void 0:n.data_source),{},{block_uuid:null,pipeline_schedule_id:null,pipeline_uuid:e.target.value})})}))},primary:!0,value:(null===C||void 0===C||null===(o=C.data_source)||void 0===o?void 0:o.pipeline_uuid)||"",children:[(0,v.jsx)("option",{value:null}),null===an||void 0===an?void 0:an.map((function(e){var n=e.uuid;return(0,v.jsx)("option",{value:n,children:n},n)}))]})]})}),[x.XO.PIPELINE_RUNS].includes(null===C||void 0===C||null===(i=C.data_source)||void 0===i?void 0:i.type)&&(0,v.jsx)(v.Fragment,{children:(0,v.jsxs)(E.Z,{mt:h.Mq,px:h.cd,children:[(0,v.jsxs)(E.Z,{mb:1,children:[(0,v.jsx)(N.ZP,{bold:!0,children:"Trigger"}),(0,v.jsx)(N.ZP,{muted:!0,small:!0,children:"Select the trigger that the pipeline runs should belong to."})]}),(0,v.jsxs)(K.Z,{monospace:!0,onChange:function(e){return we((function(n){return fe(fe({},n),{},{data_source:fe(fe({},null===n||void 0===n?void 0:n.data_source),{},{pipeline_schedule_id:e.target.value})})}))},primary:!0,value:(null===C||void 0===C||null===(l=C.data_source)||void 0===l?void 0:l.pipeline_schedule_id)||"",children:[(0,v.jsx)("option",{value:null}),null===sn||void 0===sn?void 0:sn.map((function(e){var n=e.id,t=e.name;return(0,v.jsx)("option",{value:n,children:t},n)}))]})]})}),x.XO.BLOCK===(null===C||void 0===C||null===(r=C.data_source)||void 0===r?void 0:r.type)&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(E.Z,{mt:h.Mq,px:h.cd,children:[(0,v.jsxs)(E.Z,{mb:1,children:[(0,v.jsx)(N.ZP,{bold:!0,children:"Block UUID"}),(0,v.jsx)(N.ZP,{muted:!0,small:!0,children:"Select the block the data source comes from."})]}),(0,v.jsxs)(K.Z,{monospace:!0,onChange:function(e){return we((function(n){return fe(fe({},n),{},{data_source:fe(fe({},null===n||void 0===n?void 0:n.data_source),{},{block_uuid:e.target.value})})}))},primary:!0,value:(null===C||void 0===C||null===(u=C.data_source)||void 0===u?void 0:u.block_uuid)||"",children:[(0,v.jsx)("option",{value:null}),null===un||void 0===un?void 0:un.map((function(e){var n=e.uuid;return(0,v.jsx)("option",{value:n,children:n},n)}))]})]}),(0,v.jsxs)(E.Z,{mt:h.Mq,px:h.cd,children:[(0,v.jsxs)(E.Z,{mb:1,children:[(0,v.jsx)(N.ZP,{bold:!0,children:"Partitions"}),(0,v.jsx)(N.ZP,{muted:!0,small:!0,children:"Enter a positive or a negative number. If positive, then data from the block will be the most recent N partitions. If negative, then data from the block will be the oldest N partitions."}),(0,v.jsx)(E.Z,{mt:1,children:(0,v.jsx)(N.ZP,{muted:!0,small:!0,children:"Leave blank if you want the chart to execute the block and display the data produced from that ad hoc block execution."})})]}),(0,v.jsx)(R.Z,{monospace:!0,onChange:function(e){return we((function(n){return fe(fe({},n),{},{data_source:fe(fe({},null===n||void 0===n?void 0:n.data_source),{},{partitions:"undefined"!==typeof e.target.value?Number(e.target.value):e.target.value})})}))},placeholder:"Enter number of partitions",primary:!0,setContentOnMount:!0,type:"number",value:(null===C||void 0===C||null===(c=C.data_source)||void 0===c?void 0:c.partitions)||""})]})]}),(0,v.jsxs)(E.Z,{mt:h.Mq,px:h.cd,children:[(0,v.jsxs)(E.Z,{mb:1,children:[(0,v.jsx)(N.ZP,{bold:!0,children:"Refresh interval"}),(0,v.jsx)(N.ZP,{muted:!0,small:!0,children:"How frequent do you want this chart to automatically fetch new data from its data source? Enter a number in milliseconds (e.g. 1000ms is 1 second)."})]}),(0,v.jsx)(R.Z,{monospace:!0,onChange:function(e){return we((function(n){return fe(fe({},n),{},{data_source:fe(fe({},null===n||void 0===n?void 0:n.data_source),{},{refresh_interval:e.target.value})})}))},placeholder:"Enter number for refresh interval",primary:!0,setContentOnMount:!0,type:"number",value:(null===C||void 0===C||null===(a=C.data_source)||void 0===a?void 0:a.refresh_interval)||6e4})]}),(0,v.jsx)(E.Z,{mt:h.Mq,children:(0,v.jsx)(ne.Z,{light:!0})}),(0,v.jsx)(E.Z,{mt:h.Mq,px:h.cd,children:(0,v.jsx)(te.Z,{children:"Chart display settings"})}),(0,v.jsx)(E.Z,{mt:h.Mq,px:h.cd,children:null!==fn&&void 0!==fn&&fn.data_source?(0,v.jsxs)(N.ZP,{default:!0,children:["Number of columns from data source: ","undefined"!==typeof(null===fn||void 0===fn||null===(d=fn.data)||void 0===d?void 0:d.columns)?(0,v.jsx)(N.ZP,{bold:!0,inline:!0,monospace:!0,children:null===fn||void 0===fn||null===(f=fn.data)||void 0===f||null===(m=f.columns)||void 0===m?void 0:m.length}):(0,v.jsx)(E.Z,{mt:1,children:(0,v.jsx)(L.Z,{inverted:!0,small:!0})})]}):(0,v.jsx)(N.ZP,{default:!0,children:"Please select a data source type above."})}),(0,v.jsx)(E.Z,{mt:h.Mq,px:h.cd,children:(0,v.jsx)($,{block:fn,updateConfiguration:function(e){we((function(n){return fe(fe({},n),{},{configuration:fe(fe({},null===n||void 0===n?void 0:n.configuration),e)})}))}})})]})}),[on,fn,un,C,sn,an,we,s]),vn=(0,c.useMemo)((function(){return ge&&(0,v.jsxs)(E.Z,{py:h.cd,children:[(0,v.jsxs)(E.Z,{mb:h.Mq,px:h.cd,children:[(0,v.jsx)(E.Z,{mb:1,children:(0,v.jsx)(te.Z,{children:"Custom code"})}),(0,v.jsxs)(N.ZP,{default:!0,children:["Write code for custom data sources, parsing, etc. For more information on what is possible, please check out the ",(0,v.jsx)(oe.Z,{href:"https://docs.mage.ai/visualizations/dashboards#custom-code-for-chart",openNewWindow:!0,children:"chart documentation"}),"."]})]}),(0,v.jsx)(ee.Z,{autoHeight:!0,block:ge,onChange:function(e){we((function(n){return fe(fe({},n),{},{content:e})}))},value:(null===C||void 0===C?void 0:C.content)||(null===Ie||void 0===Ie?void 0:Ie.content)||"",width:"100%"})]})}),[Ie,C,ge,we]);return(0,v.jsxs)(ie.Z,{after:vn,afterHeightOffset:s||0,afterHidden:on,afterMousedownActive:T,afterWidth:U,before:hn,beforeDraggableTopOffset:s?s-le.Wi:0,beforeFooter:!on&&(0,v.jsx)(E.Z,{p:h.cd,children:(0,v.jsxs)(y.ZP,{children:[(0,v.jsx)(g.ZP,{fullWidth:!0,loading:He,onClick:function(){return Ae(C)},primary:!0,children:"Save changes"}),(0,v.jsx)(E.Z,{mr:1}),(0,v.jsx)(g.ZP,{fullWidth:!0,onClick:function(){return Oe(null)},secondary:!0,children:"Back to dashboard"})]})}),beforeHeader:(0,v.jsx)(v.Fragment,{children:(0,v.jsx)(z.Z,{breadcrumbs:[{label:function(){return"Back to dashboard"},onClick:function(){return Oe(null)}},{bold:!0,label:function(){return(null===ge||void 0===ge?void 0:ge.name)||(null===ge||void 0===ge?void 0:ge.uuid)}}]})}),beforeHeaderOffset:6*h.iI,beforeHeightOffset:s||0,beforeHidden:on,beforeMousedownActive:he,beforeWidth:X,contained:!0,excludeOffsetFromBeforeDraggableLeft:!0,headerOffset:s||0,hideAfterCompletely:!0,hideBeforeCompletely:!0,leftOffset:t||0,mainContainerRef:S,setAfterMousedownActive:J,setAfterWidth:A,setBeforeMousedownActive:ve,setBeforeWidth:Q,children:[(0,v.jsx)("div",{ref:me,children:(0,v.jsxs)(y.ZP,{justifyContent:"space-between",children:[(0,v.jsx)(j.Z,{flex:1}),on&&!en&&(0,v.jsx)(E.Z,{p:h.cd,children:(0,v.jsx)(g.ZP,{beforeIcon:(0,v.jsx)(k.Add,{size:2*h.iI}),onClick:function(){return Qe()},primary:!0,children:"Create new chart"})})]})}),(0,v.jsxs)(r.W,{backend:u.PD,children:[ge&&(0,v.jsx)(W,{block:ge,blockLayoutItem:fe(fe({},Ie),{},{configuration:fe(fe({},null===Ie||void 0===Ie?void 0:Ie.configuration),null===C||void 0===C?void 0:C.configuration),data_source:fe(fe({},null===Ie||void 0===Ie?void 0:Ie.data_source),null===C||void 0===C?void 0:C.data_source)}),blockUUID:null===ge||void 0===ge?void 0:ge.uuid,detail:!0,disableDrag:!0,height:tn,pageBlockLayoutUUID:m,setSelectedBlockItem:Oe,width:null===Te||void 0===Te?void 0:Te.width}),!ge&&!en&&$e,!ge&&en&&nn]}),(0,v.jsx)(E.Z,{mb:2})]})}},75399:function(e,n,t){t.d(n,{Qj:function(){return c},XO:function(){return i},hN:function(){return l},tW:function(){return u}});var o,i,l,r=t(82394);!function(e){e.BLOCK="block",e.BLOCK_RUNS="block_runs",e.CHART_CODE="chart_code",e.PIPELINES="pipelines",e.PIPELINE_RUNS="pipeline_runs",e.PIPELINE_SCHEDULES="pipeline_schedules"}(i||(i={})),function(e){e.HTML="html",e.JPEG="jpeg",e.JPG="jpg",e.PNG="png"}(l||(l={}));var u=[i.BLOCK,i.BLOCK_RUNS,i.CHART_CODE,i.PIPELINES,i.PIPELINE_RUNS,i.PIPELINE_SCHEDULES],c=(o={},(0,r.Z)(o,i.BLOCK,"Block data output"),(0,r.Z)(o,i.BLOCK_RUNS,"Block runs"),(0,r.Z)(o,i.CHART_CODE,"Custom code"),(0,r.Z)(o,i.PIPELINES,"Pipelines"),(0,r.Z)(o,i.PIPELINE_RUNS,"Pipeline runs"),(0,r.Z)(o,i.PIPELINE_SCHEDULES,"Triggers"),o)}}]);
|