{"version":3,"sources":["ui/pages/DbtCloud/DbtCloudPage.tsx"],"names":["DbtCloudPageComponent","useState","destinationsStore","listHidden","find","value","_type","dbtCloudData","setDbtCloudData","editorMode","setEditorMode","forceUpdate","useForceUpdate","status","EntitiesStoreStatus","GLOBAL_ERROR","errorMessage","GLOBAL_LOADING","sourcesStore","onSaveSucceded","onAfterSaveSucceded","paramsByProps","type","standalone","id","_id","DestinationsPage","observer"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAEA;AAEA;AAGA;AAEA;AAcA,GAAMA,sBAA+B,CAAG,QAAlCA,sBAAkC,EAAM,CAC5C,cAAwCC,sDAAQ,CAC9CC,6EAAiB,CAACC,UAAlB,CAA6BC,IAA7B,CAAkC,SAAAC,KAAK,QAAIA,MAAK,CAACC,KAAN,EAAe,UAAnB,EAAvC,CAD8C,CAAhD,oOAAOC,YAAP,eAAqBC,eAArB,eAGA,eAAoCP,sDAAQ,CAAEM,YAAY,CAAG,MAAH,CAAY,KAA1B,CAA5C,qOAAOE,UAAP,eAAmBC,aAAnB,eAEA,GAAMC,YAAW,CAAGC,oFAAc,EAAlC,CAEA,GAAIV,6EAAiB,CAACW,MAAlB,GAA6BC,gFAAmB,CAACC,YAArD,CAAmE,CACjE,mBAAO,8DAAC,+EAAD,EAAe,KAAK,CAAEb,6EAAiB,CAACc,YAAxC,EAAP,CACD,CAFD,IAEO,IACLd,6EAAiB,CAACW,MAAlB,GAA6BC,gFAAmB,CAACG,cAAjD,EACAC,mEAAY,CAACL,MAAb,GAAwBC,gFAAmB,CAACG,cAFvC,CAGL,CACA,mBAAO,8DAAC,8EAAD,IAAP,CACD,CACD,GAAME,eAAc,CAAG,QAAjBA,eAAiB,EAAY,CACjCX,eAAe,CAACN,6EAAiB,CAACC,UAAlB,CAA6BC,IAA7B,CAAkC,SAAAC,KAAK,QAAIA,MAAK,CAACC,KAAN,EAAe,UAAnB,EAAvC,CAAD,CAAf,CACAI,aAAa,CAAC,MAAD,CAAb,CACAC,WAAW,GACZ,CAJD,CAMA,GAAIJ,YAAJ,CAAkB,CAChB,mBACE,8DAAC,wHAAD,EAEIE,UAAU,CAAEA,UAFhB,CAGIW,mBAAmB,CAAED,cAHzB,CAIIE,aAAa,CAAE,CAAEC,IAAI,CAAE,UAAR,CAAoBC,UAAU,CAAE,MAAhC,CAAwCC,EAAE,CAAEjB,YAAY,CAACkB,GAAzD,CAJnB,EADF,CASD,CAVD,IAUO,CACL,mBACE,8DAAC,wHAAD,EAEIhB,UAAU,CAAEA,UAFhB,CAGIW,mBAAmB,CAAED,cAHzB,CAIIE,aAAa,CAAE,CAAEC,IAAI,CAAE,UAAR,CAAoBC,UAAU,CAAE,MAAhC,CAJnB,EADF,CASD,CACF,CA3CD,CA6CA,GAAMG,iBAAgB,CAAGC,wEAAQ,CAAC3B,qBAAD,CAAjC,CAEe0B,+EAAf,E","file":"static/js/163.00ba9a16.chunk.js","sourcesContent":["// @Libs\nimport { observer } from \"mobx-react-lite\"\n// @Pages\nimport { DestinationEditor } from \"../DestinationsPage/partials/DestinationEditor/DestinationEditor\"\n// @Store\nimport { destinationsStore } from \"stores/destinations\"\nimport { sourcesStore } from \"stores/sources\"\n// @Components\nimport { CenteredError, CenteredSpin } from \"lib/components/components\"\n// @Types\nimport { useState } from \"react\"\nimport { useForceUpdate } from \"../../../hooks/useForceUpdate\"\nimport { EntitiesStoreStatus } from \"stores/entitiesStore\"\n\nexport interface CollectionDestinationData {\n destinations: DestinationData[]\n _lastUpdated?: string\n}\n\nexport interface CommonDestinationPageProps {\n editorMode?: \"edit\" | \"add\"\n}\n\nconst DbtCloudPageComponent: React.FC = () => {\n const [dbtCloudData, setDbtCloudData] = useState(\n destinationsStore.listHidden.find(value => value._type == \"dbtcloud\")\n )\n const [editorMode, setEditorMode] = useState((dbtCloudData ? \"edit\" : \"add\") as \"edit\" | \"add\")\n\n const forceUpdate = useForceUpdate()\n\n if (destinationsStore.status === EntitiesStoreStatus.GLOBAL_ERROR) {\n return \n } else if (\n destinationsStore.status === EntitiesStoreStatus.GLOBAL_LOADING ||\n sourcesStore.status === EntitiesStoreStatus.GLOBAL_LOADING\n ) {\n return \n }\n const onSaveSucceded = function () {\n setDbtCloudData(destinationsStore.listHidden.find(value => value._type == \"dbtcloud\"))\n setEditorMode(\"edit\")\n forceUpdate()\n }\n\n if (dbtCloudData) {\n return (\n \n )\n } else {\n return (\n \n )\n }\n}\n\nconst DestinationsPage = observer(DbtCloudPageComponent)\n\nexport default DestinationsPage\n"],"sourceRoot":""}