"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.isPrincipal = exports.getToNowTime = void 0;

var _getLocale = require("../../utils/getLocale");

// @ts-nocheck
var isPrincipal = function isPrincipal(principalUser) {
  var _window$BSGlobal$logi;

  return ((_window$BSGlobal$logi = window.BSGlobal.loginUserInfo) === null || _window$BSGlobal$logi === void 0 ? void 0 : _window$BSGlobal$logi.Id) === principalUser.userId;
};

exports.isPrincipal = isPrincipal;

var getToNowTime = function getToNowTime(time) {
  var oldDateSecond = Math.floor(new Date(time).getTime() / 1000);
  var nowDateSecond = Math.floor(new Date() / 1000);
  var diffSecond = nowDateSecond - oldDateSecond;

  if (diffSecond < 60 * 60 * 24 * 7) {
    return "";
  }

  return "".concat((0, _getLocale.getLocale)("OKR_MyO_Pr_Butt_Lastupd")).concat(Math.floor(diffSecond / 60 / 60 / 24)).concat((0, _getLocale.getLocale)("OKR_MyO_Pr_Butt_dayago"));
};

exports.getToNowTime = getToNowTime;