'use strict';

var key = require('../../constants/key.js');
var index = require('../../hooks/base/useGlobalConfig/index.js');
var createModes = require('./http/createModes.js');

const getTenantType = () => {
  const hostname = typeof window !== "undefined" ? window.location.hostname : "";
  const importMetaEnv = index.useGlobalConfig("env");
  const mode = importMetaEnv.value[key.resetEnvMode];
  if (mode && createModes.envConfigs[mode]) {
    return createModes.envConfigs[mode].tenant;
  }
  const envConfig = Object.values(createModes.envConfigs).find((config) => config.domain === hostname);
  if (envConfig) {
    return envConfig.tenant;
  }
  return "giikin";
};
const isGiiktok = () => getTenantType() === "giiktok";
const isGiikin = () => getTenantType() === "giikin";

exports.getTenantType = getTenantType;
exports.isGiikin = isGiikin;
exports.isGiiktok = isGiiktok;
//# sourceMappingURL=tenant.js.map
