shadow$provide.module$node_modules$pixi_DOT_js$lib$scene$sprite_nine_slice$NineSliceGeometry = function(global, require, module, exports) {
  global = require("module$node_modules$pixi_DOT_js$lib$scene$mesh_plane$PlaneGeometry");
  "use strict";
  const node_modules$pixi_DOT_js$lib$scene$sprite_nine_slice$NineSliceGeometry$classdecl$var52 = class extends global.PlaneGeometry {
    constructor(options = {}) {
      options = {...node_modules$pixi_DOT_js$lib$scene$sprite_nine_slice$NineSliceGeometry$classdecl$var52.defaultOptions, ...options};
      super({width:options.width, height:options.height, verticesX:4, verticesY:4});
      this._trimY = this._trimX = 0;
      this._trimWidth = options.originalWidth ?? node_modules$pixi_DOT_js$lib$scene$sprite_nine_slice$NineSliceGeometry$classdecl$var52.defaultOptions.originalWidth;
      this._trimHeight = options.originalHeight ?? node_modules$pixi_DOT_js$lib$scene$sprite_nine_slice$NineSliceGeometry$classdecl$var52.defaultOptions.originalHeight;
      this.update(options);
    }
    update(options) {
      this.width = options.width ?? this.width;
      this.height = options.height ?? this.height;
      this._originalWidth = options.originalWidth ?? this._originalWidth;
      this._originalHeight = options.originalHeight ?? this._originalHeight;
      this._leftWidth = options.leftWidth ?? this._leftWidth;
      this._rightWidth = options.rightWidth ?? this._rightWidth;
      this._topHeight = options.topHeight ?? this._topHeight;
      this._bottomHeight = options.bottomHeight ?? this._bottomHeight;
      this._anchorX = options.anchor?.x;
      this._anchorY = options.anchor?.y;
      void 0 !== options.trim ? (this._trimX = options.trim?.x ?? 0, this._trimY = options.trim?.y ?? 0, this._trimWidth = options.trim?.width ?? this._originalWidth, this._trimHeight = options.trim?.height ?? this._originalHeight) : (this._trimWidth = this._originalWidth, this._trimHeight = this._originalHeight);
      this.updateUvs();
      this.updatePositions();
    }
    updatePositions() {
      const p = this.positions, {width, height, _leftWidth, _rightWidth, _topHeight, _bottomHeight, _anchorX, _anchorY} = this;
      var w = _leftWidth + _rightWidth, h = _topHeight + _bottomHeight;
      w = Math.min(width > w ? 1 : width / w, height > h ? 1 : height / h);
      h = _anchorX * width;
      const anchorOffsetY = _anchorY * height;
      p[0] = p[8] = p[16] = p[24] = -h;
      p[2] = p[10] = p[18] = p[26] = _leftWidth * w - h;
      p[4] = p[12] = p[20] = p[28] = width - _rightWidth * w - h;
      p[6] = p[14] = p[22] = p[30] = width - h;
      p[1] = p[3] = p[5] = p[7] = -anchorOffsetY;
      p[9] = p[11] = p[13] = p[15] = _topHeight * w - anchorOffsetY;
      p[17] = p[19] = p[21] = p[23] = height - _bottomHeight * w - anchorOffsetY;
      p[25] = p[27] = p[29] = p[31] = height - anchorOffsetY;
      this.getBuffer("aPosition").update();
    }
    updateUvs() {
      const uvs = this.uvs;
      var origW = this._originalWidth, origH = this._originalHeight;
      const u0 = this._trimX / origW, v0 = this._trimY / origH, u1 = (this._trimX + this._trimWidth) / origW, v1 = (this._trimY + this._trimHeight) / origH;
      uvs[0] = uvs[8] = uvs[16] = uvs[24] = u0;
      uvs[1] = uvs[3] = uvs[5] = uvs[7] = v0;
      uvs[6] = uvs[14] = uvs[22] = uvs[30] = u1;
      uvs[25] = uvs[27] = uvs[29] = uvs[31] = v1;
      origW = 1 / origW;
      origH = 1 / origH;
      uvs[2] = uvs[10] = uvs[18] = uvs[26] = u0 + origW * this._leftWidth;
      uvs[9] = uvs[11] = uvs[13] = uvs[15] = v0 + origH * this._topHeight;
      uvs[4] = uvs[12] = uvs[20] = uvs[28] = u1 - origW * this._rightWidth;
      uvs[17] = uvs[19] = uvs[21] = uvs[23] = v1 - origH * this._bottomHeight;
      this.getBuffer("aUV").update();
    }
  };
  global = node_modules$pixi_DOT_js$lib$scene$sprite_nine_slice$NineSliceGeometry$classdecl$var52;
  global.defaultOptions = {width:100, height:100, leftWidth:10, topHeight:10, rightWidth:10, bottomHeight:10, originalWidth:100, originalHeight:100};
  exports.NineSliceGeometry = global;
};

//# sourceMappingURL=module$node_modules$pixi_DOT_js$lib$scene$sprite_nine_slice$NineSliceGeometry.js.map
