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

  var _reporterNs, _cclegacy, __checkObsolete__, __checkObsoleteInNamespace__, _cc, TextureAssembler, _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _crd, cc, ccclass, property, TexturePlus;

  function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }

  function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }

  function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and runs after the decorators transform.'); }

  function _reportPossibleCrUseOfTextureAssembler(extras) {
    _reporterNs.report("TextureAssembler", "../Assemblers/TextureAssembler", _context.meta, extras);
  }

  return {
    setters: [function (_unresolved_) {
      _reporterNs = _unresolved_;
    }, function (_cc2) {
      _cclegacy = _cc2.cclegacy;
      __checkObsolete__ = _cc2.__checkObsolete__;
      __checkObsoleteInNamespace__ = _cc2.__checkObsoleteInNamespace__;
      _cc = _cc2;
    }, function (_unresolved_2) {
      TextureAssembler = _unresolved_2.TextureAssembler;
    }],
    execute: function () {
      _crd = true;

      _cclegacy._RF.push({}, "58ad8KR/hRJi7EtoZ+PAyOU", "TexturePlus", undefined);

      __checkObsolete__(['IAssembler']);

      cc = __checkObsoleteInNamespace__(_cc);
      ({
        ccclass,
        property
      } = cc._decorator);

      _export("default", TexturePlus = (_dec = property(cc.Vec2), _dec2 = property(cc.Vec2), _dec3 = property(cc.Vec2), _dec4 = property(cc.Vec2), _dec5 = property(cc.Vec2), _dec6 = property(cc.Vec2), _dec7 = property(cc.Vec2), _dec8 = property(cc.Vec2), _dec9 = property(cc.Vec2), _dec10 = property(cc.Vec2), _dec11 = property(cc.CCBoolean), ccclass(_class = (_class2 = class TexturePlus extends cc.Sprite {
        constructor() {
          super(...arguments);

          _initializerDefineProperty(this, "v1", _descriptor, this);

          _initializerDefineProperty(this, "v2", _descriptor2, this);

          _initializerDefineProperty(this, "v3", _descriptor3, this);

          _initializerDefineProperty(this, "v4", _descriptor4, this);

          _initializerDefineProperty(this, "v5", _descriptor5, this);

          _initializerDefineProperty(this, "v6", _descriptor6, this);

          _initializerDefineProperty(this, "v8", _descriptor7, this);

          _initializerDefineProperty(this, "v9", _descriptor8, this);

          _initializerDefineProperty(this, "v10", _descriptor9, this);

          _initializerDefineProperty(this, "v11", _descriptor10, this);

          _initializerDefineProperty(this, "flipX", _descriptor11, this);

          this.v0 = cc.v2();
          this.v7 = cc.v2(0, 1);
          this.indices = [];
          this.uvList = [cc.v2(0, 0), cc.v2(0.4, 0), cc.v2(0.8, 0), cc.v2(1, 0), cc.v2(1, 0.4), cc.v2(1, 1), cc.v2(0.4, 1), cc.v2(0, 1), cc.v2(0.2, 0), cc.v2(0.6, 0), cc.v2(1, 0.6), cc.v2(0.7, 1)];
          this.uvList2 = [];
          this._assembler = null;
        }

        onLoad() {
          this.uvList2 = [this.v0, this.v1, this.v2, this.v3, this.v4, this.v5, this.v6, this.v7, this.v8, this.v9, this.v10, this.v11];

          for (var i = 0; i < this.uvList2.length; ++i) {
            this.uvList2[i].set(this.uvList[i]);
          }
        }

        _flushAssembler() {
          // macro.UI_GPU_DRIVEN
          var assembler = _crd && TextureAssembler === void 0 ? (_reportPossibleCrUseOfTextureAssembler({
            error: Error()
          }), TextureAssembler) : TextureAssembler;

          if (this._assembler !== assembler) {
            this.destroyRenderData();
            this._assembler = assembler;
          }

          if (!this._renderData) {
            this.updateRenderData();
          }
        }

        UpdateVerticies() {
          this.indices.length = 0; //  Right bottom triangle

          this.uvList2 = [this.v0, this.v1, this.v2, this.v3, this.v4, this.v5, this.v6, this.v7, this.v8, this.v9, this.v10, this.v11];
          this.AddTriangle(2, this.v2, 4, this.v4, 3, this.v3); //  Left top triangle

          this.AddTriangle(0, this.v0, 7, this.v7, 6, this.v6);
          this.AddQuad(9, this.v9, 10, this.v10, 4, this.v4, 2, this.v2);
          this.AddQuad(1, this.v1, 5, this.v5, 10, this.v10, 9, this.v9);
          this.AddQuad(8, this.v8, 11, this.v11, 5, this.v5, 1, this.v1);
          this.AddQuad(0, this.v0, 6, this.v6, 11, this.v11, 8, this.v8);

          if (this._assembler && this.renderData) {
            this._assembler.updateVertexData(this);
          }
        }

        lateUpdate(dt) {
          this.UpdateVerticies();
        }

        AddTriangle(textureIndex0, pos0, textureIndex1, pos1, textureIndex2, pos2) {
          this.indices.push(textureIndex0);

          if (!this.flipX) {
            this.indices.push(textureIndex1);
            this.indices.push(textureIndex2);
          } else {
            this.indices.push(textureIndex2);
            this.indices.push(textureIndex1);
          }
        }

        AddQuad(textureIndex0, pos0, textureIndex1, pos1, textureIndex2, pos2, textureIndex3, pos3) {
          var v0 = textureIndex0;
          var v1 = textureIndex1;
          var v2 = textureIndex2;
          var v3 = textureIndex3;
          this.indices.push(v0);

          if (!this.flipX) {
            this.indices.push(v1);
            this.indices.push(v2);
          } else {
            this.indices.push(v2);
            this.indices.push(v1);
          }

          this.indices.push(v0);

          if (!this.flipX) {
            this.indices.push(v2);
            this.indices.push(v3);
          } else {
            this.indices.push(v3);
            this.indices.push(v2);
          }
        }

        updateRenderData() {
          this.UpdateVerticies();

          if (this._assembler && this._assembler.createData) {
            this._renderData = this._assembler.createData(this);
            this._renderData.material = this.customMaterial;
            this.markForUpdateRenderData();

            if (this.spriteFrame) {
              this._assembler.updateUVs(this);
            }

            this._updateColor();
          }
        }

      }, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "v1", [_dec], {
        configurable: true,
        enumerable: true,
        writable: true,
        initializer: function initializer() {
          return cc.v2();
        }
      }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "v2", [_dec2], {
        configurable: true,
        enumerable: true,
        writable: true,
        initializer: function initializer() {
          return cc.v2();
        }
      }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "v3", [_dec3], {
        configurable: true,
        enumerable: true,
        writable: true,
        initializer: function initializer() {
          return cc.v2();
        }
      }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "v4", [_dec4], {
        configurable: true,
        enumerable: true,
        writable: true,
        initializer: function initializer() {
          return cc.v2();
        }
      }), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "v5", [_dec5], {
        configurable: true,
        enumerable: true,
        writable: true,
        initializer: function initializer() {
          return cc.v2();
        }
      }), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "v6", [_dec6], {
        configurable: true,
        enumerable: true,
        writable: true,
        initializer: function initializer() {
          return cc.v2();
        }
      }), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, "v8", [_dec7], {
        configurable: true,
        enumerable: true,
        writable: true,
        initializer: function initializer() {
          return cc.v2();
        }
      }), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, "v9", [_dec8], {
        configurable: true,
        enumerable: true,
        writable: true,
        initializer: function initializer() {
          return cc.v2();
        }
      }), _descriptor9 = _applyDecoratedDescriptor(_class2.prototype, "v10", [_dec9], {
        configurable: true,
        enumerable: true,
        writable: true,
        initializer: function initializer() {
          return cc.v2();
        }
      }), _descriptor10 = _applyDecoratedDescriptor(_class2.prototype, "v11", [_dec10], {
        configurable: true,
        enumerable: true,
        writable: true,
        initializer: function initializer() {
          return cc.v2();
        }
      }), _descriptor11 = _applyDecoratedDescriptor(_class2.prototype, "flipX", [_dec11], {
        configurable: true,
        enumerable: true,
        writable: true,
        initializer: function initializer() {
          return false;
        }
      })), _class2)) || _class));

      _cclegacy._RF.pop();

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