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

  var _cclegacy, _decorator, Component, _dec, _class, _crd, ccclass, property, Util;

  return {
    setters: [function (_cc) {
      _cclegacy = _cc.cclegacy;
      _decorator = _cc._decorator;
      Component = _cc.Component;
    }],
    execute: function () {
      _crd = true;

      _cclegacy._RF.push({}, "ab65apKhRlB06jeO5LQbX/s", "Util", undefined);

      ({
        ccclass,
        property
      } = _decorator);

      _export("Util", Util = (_dec = ccclass('Util'), _dec(_class = class Util extends Component {
        /**
          * 两个值之间
          * @param num 区间值
          * @param min 最小值
          * @param max 最大值
          * @returns 
          */
        static mathfClamp(num, min, max) {
          if (num <= min) {
            num = min;
          }

          if (num >= max) {
            num = max;
          }

          return num;
        }
        /**
         * 获取随机数
         * @param start 开始
         * @param end 结束
         * @param fixed 保留几位小数
         * @returns 
         */


        static getRandom(start, end, fixed) {
          if (fixed === void 0) {
            fixed = 0;
          }

          var differ = end - start;
          var random = Math.random();
          return (start + differ * random).toFixed(fixed);
        }
        /**
         * 获取地址的参数id
         * @param variable 参数
         * @returns 
         */


        static getQueryVariable(variable) {
          var query = window.location.search.substring(1);
          var vars = query.split("&");

          for (var i = 0; i < vars.length; i++) {
            var pair = vars[i].split("=");

            if (pair[0] == variable) {
              return pair[1];
            }
          }

          return false;
        }

      }) || _class));

      _cclegacy._RF.pop();

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