'use strict';

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

const index = require('./index-1ee80297.js');
const dataApi = require('./dataApi-4c166e4e.js');
const index$2 = require('./index-b2910095.js');
const index$1 = require('./index-4d4f2dcf.js');
const cookie = require('./cookie-c4d9848a.js');
const uye = require('./uye-7885eb24.js');
require('./kimlikApi-1cd43caf.js');
require('./data-transfer-field-0ce05c1a.js');
require('./BaseField-d019ade6.js');
require('./filter-d5040f65.js');
require('./_commonjsHelpers-206db00d.js');
require('./utils-23fe6104.js');
require('./User-286a0714.js');
require('./data-model-c51de090.js');
require('./membership-14c44e7c.js');
require('./membership-config-6ba394cc.js');
require('./table-config-be88299b.js');
require('./FieldModelGenerator-2c39c8e9.js');
require('./index-42baafa9.js');
require('./index-a77c3004.js');
require('./date-25b104f6.js');
require('./index-521d07b9.js');
require('./index-9e7c4ca0.js');
require('./string-de672b69.js');
require('./app-config-e62f5843.js');
require('./spaces-4ce9857b.js');
require('./table-list-view-config-9651a6bc.js');
require('./index-30008542.js');
require('./attachment-3090e25e.js');
require('./InterceptorHandler-09a1e84b.js');
require('./view-config-c409ff28.js');
require('./detail-view-config-c107e694.js');
require('./models-19fd9c92.js');
require('./form-view-config-36f31520.js');
require('./ValidatorLength-06e5c6f8.js');
require('./actions-d7eabd95.js');
require('./instance-8904b0e4.js');
require('./nested-8980065f.js');
require('./index-b1edd71d.js');
require('./list-fetch-state-7befe791.js');
require('./time-zones-5b212929.js');

let 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.apiSozluk = new index$2.SozlukApi();
    this.storage = new cookie.CookieStorage();
    this.logger = new index$2.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);
    this.apiSozluk = new index$2.SozlukApi();
  }
  render() {
    return (index.h(index.Host, null, index.h("dvn-app-root", { apiAtama: this.apiAtama, apiData: this.apiData, apiKimlik: this.apiKimlik, apiSozluk: this.apiSozluk, 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;
