(window.webpackJsonp=window.webpackJsonp||[]).push([[205,206],{1008:function(e,t,n){"use strict";n.r(t),n.d(t,"useDatasetViewModel",(function(){return o}));n(19);var a=n(175),s=n(47),r=n(283),o=function useDatasetViewModel(){var e=Object(a.d)(!1),t=Object(a.h)().value.params.id;return{datasetId:t,isLoadingDataset:e,handleError:function handleError(e){var n="";switch(e){case r.a.ERROR_FETCHING_DATASET_INFO:n="Can't get dataset info for dataset_id: ".concat(t);break;case r.a.ERROR_FETCHING_WORKSPACE_INFO:n="Can't get workspace info for dataset_id: ".concat(t);break;default:n="There was an error on fetching dataset info and workspace info. Please try again"}var a={message:n,numberOfChars:n.length,type:"error"};s.a.dispatch("notify",a)},createRootBreadCrumbs:function createRootBreadCrumbs(e){return[{link:{name:"datasets"},name:"Home"},{link:{path:"/datasets?workspaces=".concat(e.workspace)},name:e.workspace},{link:{path:"annotation-mode"},name:e.name}]}}}},1292:function(e,t,n){"use strict";n.r(t),n.d(t,"useDatasetSettingViewModel",(function(){return f}));var a=n(31),s=(n(16),n(8),n(34),n(789)),r=n(48),o=n(175),i=n(1008),c=n(299),u=n(296),d=n(895),__awaiter=function(e,t,n,a){return new(n||(n=Promise))((function(s,r){function fulfilled(e){try{step(a.next(e))}catch(e){r(e)}}function rejected(e){try{step(a.throw(e))}catch(e){r(e)}}function step(e){e.done?s(e.value):function adopt(e){return e instanceof n?e:new n((function(t){t(e)}))}(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))},f=function useDatasetSettingViewModel(){var e=Object(o.i)(),t=Object(d.b)().isAdminOrOwnerRole,n=Object(u.a)().state,f=Object(r.useResolve)(c.a),l=Object(i.useDatasetViewModel)(),p=l.datasetId,m=l.isLoadingDataset,g=l.handleError,w=l.createRootBreadCrumbs,b=Object(s.a)((function(){return[].concat(Object(a.a)(w(n.dataset)),[{link:{},name:"settings"}])}));return Object(s.b)((function(){!function loadDatasetSetting(){__awaiter(void 0,void 0,void 0,regeneratorRuntime.mark((function _callee(){return regeneratorRuntime.wrap((function _callee$(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,m.value=!0,t.next=4,f.execute(p);case 4:t.next=10;break;case 6:t.prev=6,t.t0=t.catch(0),g(t.t0.response),e.push("/");case 10:return t.prev=10,m.value=!1,t.finish(10);case 13:case"end":return t.stop()}}),_callee,null,[[0,6,10,13]])})))}()})),{isLoadingDataset:m,breadcrumbs:b,tabs:[{id:"info",name:"Info",component:"settingsInfo"},{id:"fields",name:"Fields",component:"settingsFields"},{id:"questions",name:"Questions",component:"settingsQuestions"},{id:"danger-zone",name:"Danger zone",component:"settingsDangerZone"}],isAdminOrOwnerRole:t,datasetId:p,datasetSetting:n}}},789:function(e,t,n){"use strict";var a=n(0);n.d(t,"a",(function(){return a.computed})),n.d(t,"b",(function(){return a.onBeforeMount})),n.d(t,"c",(function(){return a.onMounted})),n.d(t,"d",(function(){return a.onUnmounted})),n.d(t,"e",(function(){return a.ref}));a.default,a.default.util.warn},895:function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return o})),n.d(t,"c",(function(){return i}));var a=n(175),s=n(789),r=function useRole(){var e=Object(a.f)().$auth;return{isAdminOrOwnerRole:Object(s.a)((function(){var t=e.user.role;return"admin"===t||"owner"===t}))}},o=(n(79),n(19),n(34),{datasets:"datasets"}),i=function useRoutes(){var e=Object(a.i)(),t=function isOldTask(e){return["TokenClassification","TextClassification","Text2Text"].includes(e)};return{goToDatasetsList:function goToDatasetsList(){e.push({path:"/".concat(o.datasets)})},goToSetting:function goToSetting(n){var a=n.task,s=n.workspace,r=n.name,o=n.id;t(a)?e.push({name:"datasets-workspace-dataset-settings",params:{workspace:s,dataset:r}}):e.push({name:"dataset-id-settings",params:{id:o}})},getDatasetLink:function getDatasetLink(e){var n=e.task,a=e.name,s=e.workspace,r=e.id;return t(n)?"/datasets/".concat(s,"/").concat(a):"/dataset/".concat(r,"/annotation-mode")}}}}}]);