System.register(["__unresolved_0", "cc", "__unresolved_1", "__unresolved_2", "__unresolved_3", "__unresolved_4", "__unresolved_5", "__unresolved_6", "__unresolved_7", "__unresolved_8"], function (_export, _context) {
  "use strict";

  var _reporterNs, _cclegacy, __checkObsolete__, __checkObsoleteInNamespace__, _decorator, tween, v3, sp, BasePanel, Data, WindowManager, GameConst, BOX_TYPE, Utils, MsgHints, constants, audioManager, _dec, _class, _crd, ccclass, property, HallUI;

  function _reportPossibleCrUseOfBasePanel(extras) {
    _reporterNs.report("BasePanel", "../../core/component/BasePanel", _context.meta, extras);
  }

  function _reportPossibleCrUseOfData(extras) {
    _reporterNs.report("Data", "../../core/manager/Data", _context.meta, extras);
  }

  function _reportPossibleCrUseOfWindowManager(extras) {
    _reporterNs.report("WindowManager", "../../core/manager/WindowManager", _context.meta, extras);
  }

  function _reportPossibleCrUseOfGameConst(extras) {
    _reporterNs.report("GameConst", "../../core/common/GameConst", _context.meta, extras);
  }

  function _reportPossibleCrUseOfBOX_TYPE(extras) {
    _reporterNs.report("BOX_TYPE", "../../core/common/GameConst", _context.meta, extras);
  }

  function _reportPossibleCrUseOfUtils(extras) {
    _reporterNs.report("Utils", "../../core/utils/Utils", _context.meta, extras);
  }

  function _reportPossibleCrUseOfMsgHints(extras) {
    _reporterNs.report("MsgHints", "../../core/utils/MsgHints", _context.meta, extras);
  }

  function _reportPossibleCrUseOfBoxLayer(extras) {
    _reporterNs.report("BoxLayer", "./gameui/BoxLayer", _context.meta, extras);
  }

  function _reportPossibleCrUseOfconstants(extras) {
    _reporterNs.report("constants", "db://assets/data/constants", _context.meta, extras);
  }

  function _reportPossibleCrUseOfaudioManager(extras) {
    _reporterNs.report("audioManager", "db://assets/manager/audioManager", _context.meta, extras);
  }

  return {
    setters: [function (_unresolved_) {
      _reporterNs = _unresolved_;
    }, function (_cc) {
      _cclegacy = _cc.cclegacy;
      __checkObsolete__ = _cc.__checkObsolete__;
      __checkObsoleteInNamespace__ = _cc.__checkObsoleteInNamespace__;
      _decorator = _cc._decorator;
      tween = _cc.tween;
      v3 = _cc.v3;
      sp = _cc.sp;
    }, function (_unresolved_2) {
      BasePanel = _unresolved_2.default;
    }, function (_unresolved_3) {
      Data = _unresolved_3.default;
    }, function (_unresolved_4) {
      WindowManager = _unresolved_4.default;
    }, function (_unresolved_5) {
      GameConst = _unresolved_5.default;
      BOX_TYPE = _unresolved_5.BOX_TYPE;
    }, function (_unresolved_6) {
      Utils = _unresolved_6.default;
    }, function (_unresolved_7) {
      MsgHints = _unresolved_7.default;
    }, function (_unresolved_8) {
      constants = _unresolved_8.constants;
    }, function (_unresolved_9) {
      audioManager = _unresolved_9.default;
    }],
    execute: function () {
      _crd = true;

      _cclegacy._RF.push({}, "de92erMOJpMz67tMXfSPqCr", "HallUI", undefined);

      __checkObsolete__(['_decorator', 'tween', 'v3', 'sp']);

      ({
        ccclass,
        property
      } = _decorator);

      _export("HallUI", HallUI = (_dec = ccclass('HallUI'), _dec(_class = class HallUI extends (_crd && BasePanel === void 0 ? (_reportPossibleCrUseOfBasePanel({
        error: Error()
      }), BasePanel) : BasePanel) {
        onBtnClicked(event, customEventData) {
          (_crd && audioManager === void 0 ? (_reportPossibleCrUseOfaudioManager({
            error: Error()
          }), audioManager) : audioManager).playOneShot((_crd && constants === void 0 ? (_reportPossibleCrUseOfconstants({
            error: Error()
          }), constants) : constants).audios.btnclick);
          var btnName = event.target.name;

          switch (btnName) {
            case "btn_setting":
              // WindowManager.ins.open("NewPackOpenedLayer");
              (_crd && WindowManager === void 0 ? (_reportPossibleCrUseOfWindowManager({
                error: Error()
              }), WindowManager) : WindowManager).ins.open("SettingLayer");
              break;

            case "btn_play":
              (_crd && WindowManager === void 0 ? (_reportPossibleCrUseOfWindowManager({
                error: Error()
              }), WindowManager) : WindowManager).ins.open("LevelLayer");
              /*platformSystem.platform.showRewardVideo((b) => {
                  WindowManager.ins.open("LevelLayer");
              })*/

              break;

            case "btn_buy_life":
              if ((_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
                error: Error()
              }), Data) : Data).user.life >= (_crd && GameConst === void 0 ? (_reportPossibleCrUseOfGameConst({
                error: Error()
              }), GameConst) : GameConst).MAX_LIFE) {
                (_crd && MsgHints === void 0 ? (_reportPossibleCrUseOfMsgHints({
                  error: Error()
                }), MsgHints) : MsgHints).show("体力已满");
                return;
              }

              (_crd && WindowManager === void 0 ? (_reportPossibleCrUseOfWindowManager({
                error: Error()
              }), WindowManager) : WindowManager).ins.open("BuyLifeLayer");
              break;

            case "btn_buy_coin":
              (_crd && WindowManager === void 0 ? (_reportPossibleCrUseOfWindowManager({
                error: Error()
              }), WindowManager) : WindowManager).ins.open("BuyCoinLayer");
              break;

            case "full0":
              let info = (_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
                error: Error()
              }), Data) : Data).user.hasLvBox();
              (_crd && WindowManager === void 0 ? (_reportPossibleCrUseOfWindowManager({
                error: Error()
              }), WindowManager) : WindowManager).ins.open("BoxLayer").then(com => {
                com.setInfo((_crd && BOX_TYPE === void 0 ? (_reportPossibleCrUseOfBOX_TYPE({
                  error: Error()
                }), BOX_TYPE) : BOX_TYPE).LEVEL, (_crd && GameConst === void 0 ? (_reportPossibleCrUseOfGameConst({
                  error: Error()
                }), GameConst) : GameConst).getLvBoxReward(Math.floor((_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
                  error: Error()
                }), Data) : Data).user.lv / 10)));
              });
              break;

            case "full1":
              info = (_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
                error: Error()
              }), Data) : Data).user.hasStarBox();
              (_crd && WindowManager === void 0 ? (_reportPossibleCrUseOfWindowManager({
                error: Error()
              }), WindowManager) : WindowManager).ins.open("BoxLayer").then(com => {
                com.setInfo((_crd && BOX_TYPE === void 0 ? (_reportPossibleCrUseOfBOX_TYPE({
                  error: Error()
                }), BOX_TYPE) : BOX_TYPE).STAR, (_crd && GameConst === void 0 ? (_reportPossibleCrUseOfGameConst({
                  error: Error()
                }), GameConst) : GameConst).getStarBoxReward(Math.floor((_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
                  error: Error()
                }), Data) : Data).user.lv / 1000)));
              });
              break;
          }
        }

        start() {
          this.SetProgressBar("probar_lv", 0.1);
          let btn_play = this.GetNode("btn_play");
          tween(btn_play).sequence(tween(btn_play).to(1, {
            scale: v3(1.05, 1.05, 1.05)
          }), tween(btn_play).to(1, {
            scale: v3(1, 1, 1)
          })).repeatForever().start();
          (_crd && Utils === void 0 ? (_reportPossibleCrUseOfUtils({
            error: Error()
          }), Utils) : Utils).loadRes('effect_hecheng', "spine", sp.SkeletonData);
        }

        update() {
          if ((_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
            error: Error()
          }), Data) : Data).user.life >= (_crd && GameConst === void 0 ? (_reportPossibleCrUseOfGameConst({
            error: Error()
          }), GameConst) : GameConst).MAX_LIFE) {
            this.SetText("lbl_life_time", "已满");
          } else {
            if ((_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
              error: Error()
            }), Data) : Data).user.life_cost_time == 0) {
              (_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
                error: Error()
              }), Data) : Data).user.life_cost_time = Date.now();
            }

            let nLeft = (Date.now() - (_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
              error: Error()
            }), Data) : Data).user.life_cost_time) / 1000;
            let addLife = Math.floor(nLeft / 60 / (_crd && GameConst === void 0 ? (_reportPossibleCrUseOfGameConst({
              error: Error()
            }), GameConst) : GameConst).MAX_LIFE_RECOVERY_TIME);
            if (addLife > 0) (_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
              error: Error()
            }), Data) : Data).user.life += addLife;
            nLeft -= addLife * (_crd && GameConst === void 0 ? (_reportPossibleCrUseOfGameConst({
              error: Error()
            }), GameConst) : GameConst).MAX_LIFE_RECOVERY_TIME * 60;
            this.SetText("lbl_life_time", (_crd && Utils === void 0 ? (_reportPossibleCrUseOfUtils({
              error: Error()
            }), Utils) : Utils).getTimeStrByS((_crd && GameConst === void 0 ? (_reportPossibleCrUseOfGameConst({
              error: Error()
            }), GameConst) : GameConst).MAX_LIFE_RECOVERY_TIME * 60 - nLeft));
          }

          this.SetText("lbl_life", (_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
            error: Error()
          }), Data) : Data).user.life + "");
          this.SetText("lbl_coin", (_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
            error: Error()
          }), Data) : Data).user.coin + "");
          this.SetText("lbl_lv", (_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
            error: Error()
          }), Data) : Data).user.lv + "");
          this.SetText("lbl_lv_center", (_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
            error: Error()
          }), Data) : Data).user.lv + "");
          let info = (_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
            error: Error()
          }), Data) : Data).user.hasLvBox();
          this.GetGameObject("full0").active = info;
          let lvmin = (_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
            error: Error()
          }), Data) : Data).user.lv % 10;
          this.SetText("lbl_pro_lv", lvmin + "/10");
          this.SetProgressBar("lbl_pro_star", lvmin / 10);
          this.SetProgressBar("probar_lv_center", lvmin / 10);
          this.SetProgressBar("probar_lv", lvmin / 10);
          info = (_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
            error: Error()
          }), Data) : Data).user.hasStarBox();

          if (info) {
            this.SetText("probar_star", "满");
            this.SetProgressBar("probar_star", 1);
            this.GetGameObject("full1").active = true;
          } else {
            let starmin = (_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
              error: Error()
            }), Data) : Data).user.star % 1000;
            this.GetGameObject("full1").active = false;
            this.SetText("lbl_pro_star", starmin + "/1000");
            this.SetProgressBar("probar_star", starmin / 1000);
          }
        }

      }) || _class));

      _cclegacy._RF.pop();

      _crd = false;
    }
  };
});
//# sourceMappingURL=b390d90e67c82ba7bc8b491d16973661a8887ec6.js.map