'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index = require('./index-7cdf1df1.js');
require('./index-c2a077ae.js');
require('./InterceptorHandler-09a1e84b.js');
require('./data-model-f9df493f.js');
require('./app-config-9060e777.js');
require('./BaseField-f50bb8f0.js');
require('./FieldModelGenerator-5a321a60.js');
require('./date-8e8ca89a.js');
require('./index-e79eb186.js');
require('./table-config-b20b4da1.js');
require('./string-9e6ebf63.js');
require('./membership-config-47f4733e.js');
require('./User-ed078a17.js');
require('./membership-20a2241e.js');
require('./_commonjsHelpers-206db00d.js');
require('./kimlikApi-6a581864.js');
require('./data-transfer-field-025bce2f.js');
require('./filter-52876f3c.js');
const dataApi = require('./dataApi-5225d8e2.js');
const cookie = require('./cookie-8a49bf23.js');
const index$1 = require('./index-6e5eb542.js');
require('./models-5557deb9.js');
require('./index-17c935e7.js');
require('./ValidatorLength-06e5c6f8.js');
require('./form-view-config-cc5244bd.js');
require('./view-config-f8b4b929.js');
require('./actions-d7eabd95.js');
require('./list-fetch-state-4917b40d.js');
require('./attachment-c2bc9126.js');
require('./instance-adc7fc02.js');
const utils = require('./utils-8a41ac3c.js');
const uye = require('./uye-709d7dba.js');
require('./spaces-5c8e9d99.js');
require('./detail-view-config-b47f4106.js');
require('./index-35a4d634.js');
require('./table-list-view-config-1c3d8326.js');
require('./nested-14baa4ef.js');

const MentornityConsoleApp = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
    this.path = '/';
    this.navigate = (config) => {
      this.logger.debugGroup('navigate', {
        from: this.path,
        to: config.path,
      });
      this.path = config.path;
    };
  }
  componentWillLoad() {
    const defaultHeaders = {
      'Session-Token': 'NTdiMzY3NjBlNjNiY2UxZWViMDAwMDA0',
    };
    if (index$1.getSessionData().token) {
      defaultHeaders['Authorization'] = `Bearer ${index$1.getSessionData().token}`;
    }
    this.path = location.pathname;
    this.storage = new cookie.CookieStorage();
    this.logger = new utils.Logger('MentornityConsoleApp').setLevel('debug');
    this.logger.infoGroup('componentWillLoad');
    // TODO these are also set in mentornity-console-app-context-injector. WFT? I'm too tired to refactor it now.
    // this.apiAtama = new AtamaApiImpl('', defaultHeaders);
    this.apiData = new dataApi.DataApiImpl(uye.dataApiEndpoint);
    this.apiKimlik = new uye.KimlikApiMentornity(uye.mentornityApiEndpoint, defaultHeaders);
    this.apiUye = new uye.UyeApiMentornity(uye.mentornityApiEndpoint, defaultHeaders);
  }
  render() {
    return (index.h(index.Host, null, index.h("dvn-app-root", { apiAtama: this.apiAtama, apiData: this.apiData, apiKimlik: this.apiKimlik, apiUye: this.apiUye, navigate: this.navigate, path: this.path, logger: this.logger, storage: this.storage })));
  }
  static get assetsDirs() { return ["assets"]; }
};

exports.mentornity_console_app = MentornityConsoleApp;
