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

  var _reporterNs, _cclegacy, __checkObsolete__, __checkObsoleteInNamespace__, tween, Vec3, oops, UIID, TipsManager, _crd, tips;

  function _reportPossibleCrUseOfUICallbacks(extras) {
    _reporterNs.report("UICallbacks", "../../../../../extensions/oops-plugin-framework/assets/core/gui/layer/Defines", _context.meta, extras);
  }

  function _reportPossibleCrUseOfoops(extras) {
    _reporterNs.report("oops", "../../../../../extensions/oops-plugin-framework/assets/core/Oops", _context.meta, extras);
  }

  function _reportPossibleCrUseOfUIID(extras) {
    _reporterNs.report("UIID", "../config/GameUIConfig", _context.meta, extras);
  }

  return {
    setters: [function (_unresolved_) {
      _reporterNs = _unresolved_;
    }, function (_cc) {
      _cclegacy = _cc.cclegacy;
      __checkObsolete__ = _cc.__checkObsolete__;
      __checkObsoleteInNamespace__ = _cc.__checkObsoleteInNamespace__;
      tween = _cc.tween;
      Vec3 = _cc.Vec3;
    }, function (_unresolved_2) {
      oops = _unresolved_2.oops;
    }, function (_unresolved_3) {
      UIID = _unresolved_3.UIID;
    }],
    execute: function () {
      _crd = true;

      _cclegacy._RF.push({}, "9748eriEcJOp6OSdnZ/qhs5", "TipsManager", undefined);
      /*
       * @Author: dgflash
       * @Date: 2021-07-03 16:13:17
       * @LastEditors: dgflash
       * @LastEditTime: 2022-08-05 10:13:47
       */


      __checkObsolete__(['Node', 'tween', 'Vec3']);

      /** 提示窗口管理 */
      TipsManager = class TipsManager {
        /**
         * 提示弹出窗口
         * @param content   提示内容文本或多语言关键字
         * @param onOk      确认回调
         * @param title     窗口标题文本或多语言关键字
         * @param okWord    确认按钮文本或多语言关键字
         */
        alert(content, onOk, title, okWord) {
          var operate = {
            title: title ? title : 'common_prompt_title',
            content: content,
            okWord: okWord ? okWord : 'common_prompt_ok',
            okFunc: onOk,
            needCancel: false
          };
          (_crd && oops === void 0 ? (_reportPossibleCrUseOfoops({
            error: Error()
          }), oops) : oops).gui.open((_crd && UIID === void 0 ? (_reportPossibleCrUseOfUIID({
            error: Error()
          }), UIID) : UIID).Alert, operate, tips.getPopCommonEffect());
        }
        /**
         * 确认弹出窗口
         * @param content   提示内容文本或多语言关键字
         * @param onOk      确认回调
         * @param onCancel  取消回调
         * @param title     窗口标题文本或多语言关键字
         * @param okWord    确认按钮文本或多语言关键字
         */


        confirm(content, onOk, onCancel, title, okWord) {
          var operate = {
            title: title ? title : 'common_prompt_title',
            content: content,
            okWord: okWord ? okWord : 'common_prompt_ok',
            cancelWord: 'common_prompt_cancal',
            okFunc: onOk,
            cancelFunc: onCancel,
            needCancel: true
          };
          (_crd && oops === void 0 ? (_reportPossibleCrUseOfoops({
            error: Error()
          }), oops) : oops).gui.open((_crd && UIID === void 0 ? (_reportPossibleCrUseOfUIID({
            error: Error()
          }), UIID) : UIID).Confirm, operate, tips.getPopCommonEffect());
        }
        /** 自定义弹窗动画 */


        getPopCommonEffect(callbacks) {
          var newCallbacks = {
            // 节点添加动画
            onAdded: (node, params) => {
              node.setScale(0.1, 0.1, 0.1);
              tween(node).to(0.2, {
                scale: new Vec3(1, 1, 1)
              }).start();
            },
            // 节点删除动画
            onBeforeRemove: (node, next) => {
              tween(node).to(0.2, {
                scale: new Vec3(0.1, 0.1, 0.1)
              }).call(next).start();
            }
          };

          if (callbacks) {
            if (callbacks && callbacks.onAdded) {
              var onAdded = callbacks.onAdded;

              callbacks.onAdded = (node, params) => {
                onAdded(node, params); // @ts-ignore

                newCallbacks.onAdded(node, params);
              };
            }

            if (callbacks && callbacks.onBeforeRemove) {
              var onBeforeRemove = callbacks.onBeforeRemove;

              callbacks.onBeforeRemove = (node, params) => {
                onBeforeRemove(node, params); // @ts-ignore

                newCallbacks.onBeforeRemove(node, params);
              };
            }

            return callbacks;
          }

          return newCallbacks;
        }

      };

      _export("tips", tips = new TipsManager());

      _cclegacy._RF.pop();

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