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

  var _reporterNs, _cclegacy, __checkObsolete__, __checkObsoleteInNamespace__, _decorator, Component, Prefab, director, instantiate, WindowManager, Utils, GameNode, platformSystem, _dec, _class, _class2, _crd, ccclass, property, Main;

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

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

  function _reportPossibleCrUseOfGameNode(extras) {
    _reporterNs.report("GameNode", "./GameNode", _context.meta, extras);
  }

  function _reportPossibleCrUseOfGameUI(extras) {
    _reporterNs.report("GameUI", "./GameUI", _context.meta, extras);
  }

  function _reportPossibleCrUseOfHallUI(extras) {
    _reporterNs.report("HallUI", "./HallUI", _context.meta, extras);
  }

  function _reportPossibleCrUseOfplatformSystem(extras) {
    _reporterNs.report("platformSystem", "db://assets/platform/platformSystem", _context.meta, extras);
  }

  return {
    setters: [function (_unresolved_) {
      _reporterNs = _unresolved_;
    }, function (_cc) {
      _cclegacy = _cc.cclegacy;
      __checkObsolete__ = _cc.__checkObsolete__;
      __checkObsoleteInNamespace__ = _cc.__checkObsoleteInNamespace__;
      _decorator = _cc._decorator;
      Component = _cc.Component;
      Prefab = _cc.Prefab;
      director = _cc.director;
      instantiate = _cc.instantiate;
    }, function (_unresolved_2) {
      WindowManager = _unresolved_2.default;
    }, function (_unresolved_3) {
      Utils = _unresolved_3.default;
    }, function (_unresolved_4) {
      GameNode = _unresolved_4.GameNode;
    }, function (_unresolved_5) {
      platformSystem = _unresolved_5.default;
    }],
    execute: function () {
      _crd = true;

      _cclegacy._RF.push({}, "7675d1ZGjVAxpV2MDKewYUv", "Main", undefined);

      __checkObsolete__(['_decorator', 'Component', 'Node', 'Prefab', 'director', 'instantiate', 'AudioSource']);

      ({
        ccclass,
        property
      } = _decorator);

      _export("Main", Main = (_dec = ccclass('Main'), _dec(_class = (_class2 = class Main extends Component {
        constructor() {
          super(...arguments);
          this._HallUI = null;
          this._GameUI = null;
          this._GameNode = null;
        }

        static Instance() {
          return Main._instance;
        }

        start() {
          Main._instance = this;
          (_crd && WindowManager === void 0 ? (_reportPossibleCrUseOfWindowManager({
            error: Error()
          }), WindowManager) : WindowManager).ins.register(this.node);
          (_crd && WindowManager === void 0 ? (_reportPossibleCrUseOfWindowManager({
            error: Error()
          }), WindowManager) : WindowManager).ins.open("HallUI").then(panle => {
            this._HallUI = panle;
          });
          (_crd && WindowManager === void 0 ? (_reportPossibleCrUseOfWindowManager({
            error: Error()
          }), WindowManager) : WindowManager).ins.open("GameUI").then(panle => {
            this._GameUI = panle;
            this._GameUI.node.active = false;
          });
          (_crd && Utils === void 0 ? (_reportPossibleCrUseOfUtils({
            error: Error()
          }), Utils) : Utils).loadRes("GameNode", "prefabs", Prefab, (err, res) => {
            this._GameNode = instantiate(res).getComponent(_crd && GameNode === void 0 ? (_reportPossibleCrUseOfGameNode({
              error: Error()
            }), GameNode) : GameNode);
            director.getScene().addChild(this._GameNode.node);
          });
        }

        play() {
          this._HallUI.node.active = false;
          this._GameUI.node.active = true;

          this._GameUI.restart();

          this._GameNode.node.active = true;

          this._GameNode.restart();

          (_crd && platformSystem === void 0 ? (_reportPossibleCrUseOfplatformSystem({
            error: Error()
          }), platformSystem) : platformSystem).platform.hideBannerAd();
        }

        backHall() {
          (_crd && platformSystem === void 0 ? (_reportPossibleCrUseOfplatformSystem({
            error: Error()
          }), platformSystem) : platformSystem).platform.showBannerAd();
          this._GameNode.node.active = false;
          this._HallUI.node.active = true;
          this._GameUI.node.active = false;
        }

      }, _class2._instance = null, _class2)) || _class));

      _cclegacy._RF.pop();

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