(window.webpackJsonp=window.webpackJsonp||[]).push([[58],{"./documentation/controllers/DocumentationContextBarController.js":function(t,e,i){"use strict";i.r(e),i.d(e,"default",(function(){return s}));var o,r=i("./documentation/stores/DocumentationContextBarStore.js"),n=i("../../node_modules/mobx/lib/mobx.module.js"),a=i("./js/stores/get-store.js");let s=(c=(o=class{constructor(){this.entityId=void 0,this.entityUid=void 0,this.entityType=void 0,this.owner=void 0,this.contextData=void 0,this.unsavedDescription=null,this.updateUnsavedDescription=t=>{this.unsavedDescription=t}}get store(){const t=Object(a.getStore)("ActiveWorkspaceSessionStore").activeEditor,e=Object(a.getStore)("EditorStore").find(t);if(e){const t=e.resource,i="v2implview://stubView/";if(t.startsWith(i)){const[e,o]=t.replace(i,"").split("/");return new r.default(e,o,this.contextData)}}return null}setContextData(t){this.contextData=t}willDestroy(){this.codegen=void 0}get contextBarUnsavedDescription(){return this.unsavedDescription}}).prototype,l="store",u=[n.computed],d=Object.getOwnPropertyDescriptor(o.prototype,"store"),p=o.prototype,T={},Object.keys(d).forEach((function(t){T[t]=d[t]})),T.enumerable=!!T.enumerable,T.configurable=!!T.configurable,("value"in T||T.initializer)&&(T.writable=!0),T=u.slice().reverse().reduce((function(t,e){return e(c,l,t)||t}),T),p&&void 0!==T.initializer&&(T.value=T.initializer?T.initializer.call(p):void 0,T.initializer=void 0),void 0===T.initializer&&(Object.defineProperty(c,l,T),T=null),o);var c,l,u,d,p,T},"./documentation/stores/DocumentationContextBarStore.js":function(t,e,i){"use strict";i.r(e),i.d(e,"default",(function(){return u}));var o,r,n,a=i("../../node_modules/mobx/lib/mobx.module.js"),s=i("./documentation/constants.js"),c=i("./documentation/stores/DocumentationMasterStore.js");function l(t,e,i,o,r){var n={};return Object.keys(o).forEach((function(t){n[t]=o[t]})),n.enumerable=!!n.enumerable,n.configurable=!!n.configurable,("value"in n||n.initializer)&&(n.writable=!0),n=i.slice().reverse().reduce((function(i,o){return o(t,e,i)||i}),n),r&&void 0!==n.initializer&&(n.value=n.initializer?n.initializer.call(r):void 0,n.initializer=void 0),void 0===n.initializer&&(Object.defineProperty(t,e,n),n=null),n}let u=(n=r=class{constructor(t,e,i){this.entityType=t,this.entityUid=e,this.contextData=i,this.masterStore=c.default.getInstance()}get isOffline(){return this.masterStore.isOffline}get isEditable(){return this.masterStore.isEditable}get activeEnvironmentVariables(){return this.masterStore.activeEnvironmentVariables}get isUserMemberOfActiveWorkspace(){return this.masterStore.isUserMemberOfActiveWorkspace}get entityData(){if(this.entityType&&!s.DOCUMENTATION_ENTITY[this.entityType.toUpperCase()])return{isLoading:!1,error:null,data:null};let{data:t,status:e}=this.masterStore.getData({uid:this.entityUid,type:this.entityType,parentCollectionUid:this.contextData&&(this.contextData.parentCollectionUid||this.contextData.collectionUid),versionTag:s.DOCUMENTATION_LATEST_VERSION_STRING},{withPublishedData:!0,source:"contextBar"});return{isLoading:e===s.DOCUMENTATION_STATUS.LOADING,error:e===s.DOCUMENTATION_STATUS.ERROR,data:t}}get parentCollectionData(){if(this.entityType&&!s.DOCUMENTATION_ENTITY[this.entityType.toUpperCase()])return{isLoading:!1,error:null,data:null};const{data:t}=this.entityData;return this.entityType===s.DOCUMENTATION_ENTITY.COLLECTION?t:t?this.masterStore.getData({uid:this.contextData&&(this.contextData.parentCollectionUid||this.contextData.collectionUid),type:s.DOCUMENTATION_ENTITY.COLLECTION,versionTag:s.DOCUMENTATION_LATEST_VERSION_STRING},{source:"contextBar"}).data:void 0}isEntityLoading(t){return this.masterStore.loadingStateForEntity[t]}updateLoadingStateForEntity(t,e=!1){this.masterStore.updateLoadingStateForEntity(t,e)}async updateDescription(t){this.masterStore.updateLoadingStateForEntity(this.entityUid,!0),await this.masterStore.updateDescription({type:this.entityType,uid:this.entityUid},t).then((()=>{this.masterStore.updateLoadingStateForEntity(this.entityUid,!1)}))}},r.masterStoreGetMethod={[s.DOCUMENTATION_ENTITY.COLLECTION]:"getCollection",[s.DOCUMENTATION_ENTITY.FOLDER]:"getFolder",[s.DOCUMENTATION_ENTITY.REQUEST]:"getRequest"},l((o=n).prototype,"entityData",[a.computed],Object.getOwnPropertyDescriptor(o.prototype,"entityData"),o.prototype),l(o.prototype,"parentCollectionData",[a.computed],Object.getOwnPropertyDescriptor(o.prototype,"parentCollectionData"),o.prototype),o)}}]);