System.register("chunks:///_virtual/HitColor.ts",["cc"],(function(t){var e,r,i,n,o,s,c;return{setters:[function(t){e=t.cclegacy,r=t.Sprite,i=t.v2,n=t.UITransform,o=t.gfx,s=t.director,c=t.math}],execute:function(){e._RF.push({},"8e6a8AvadBB0pLFoX2HDsDc","HitColor",void 0);function h(t,e){const o=t.clone(),s=e.getComponent(r),c=e.getComponent(n);c.convertToNodeSpaceAR(o,o),o.x+=c.anchorX*c.width,o.y=c.height-(o.y+c.anchorY*c.height);const h=s.spriteFrame.packable,a=(s.spriteFrame.offset,s.spriteFrame.rect),u=s.spriteFrame.texture,f=(s.trim?a.width:h?c.width:u.width)/c.width,x=(s.trim?a.height:h?c.height:u.height)/c.height,l=Math.round(o.x*f+(s.trim?a.x:0)),m=Math.round(o.y*x+(s.trim?a.y:0));return i(l,m)}t("HitColor",class{static hitTestAll(t,e){if(this.hitTest(t,e))return!0;for(var r=0;r<e.children.length;r++){var i=e.children[r];if(i.active&&this.hitTestAll(t,i))return!0}return!1}static hitTest(t,e,i=0){const n=e.getComponent(r);if(!n||!n.spriteFrame)return!1;const o=h(t,e),s=f(n.spriteFrame.texture,o.x,o.y);return s&&s.a>i}static hitColor(t,e){const i=h(t,e);return f(e.getComponent(r).spriteFrame.texture,i.x,i.y)}});const a=new Uint8Array(4),u=new o.BufferTextureCopy;function f(t,e,r,i){var n;const h=t.getGFXTexture();if(!h)return null;!function(t){const e=o.Format;t>=e.ASTC_RGBA_4X4&&t<=e.ASTC_SRGBA_12X12||t>=e.BC1&&t<=e.BC7||t>=e.ETC_RGB8&&e.ETC2_SRGB8_A8}(h.info.format);return u.texOffset.x=e,u.texOffset.y=r,null==(n=s.root)||n.device.copyTextureToBuffers(h,[a],[u]),new c.Color(...a)}u.texOffset.x=0,u.texOffset.y=0,u.texExtent.width=1,u.texExtent.height=1,e._RF.pop()}}}));

System.register("chunks:///_virtual/main",["./HitColor.ts","./Main.ts"],(function(){return{setters:[null,null],execute:function(){}}}));

System.register("chunks:///_virtual/Main.ts",["cc","./HitColor.ts"],(function(t){var e,o,n,c,s,i;return{setters:[function(t){e=t.cclegacy,o=t.Component,n=t.Node,c=t.Vec3,s=t._decorator},function(t){i=t.HitColor}],execute:function(){var a;e._RF.push({},"f58c6In1cRF+qSKmNVTGBZ3","Main",void 0);const{ccclass:r,property:l}=s;t("Main",r("Main")(a=class extends o{start(){}update(t){}onLoad(){console.log("AAAAAAA");let t=this.node.getChildByName("btn");t.on(n.EventType.TOUCH_END,(e=>{var o=e.touch.getUILocation(),n=new c(o.x,o.y,1e3);let s=i.hitTest(n,t);console.log(n,s)}),this)}})||a);e._RF.pop()}}}));

(function(r) {
  r('virtual:///prerequisite-imports/main', 'chunks:///_virtual/main'); 
})(function(mid, cid) {
    System.register(mid, [cid], function (_export, _context) {
    return {
        setters: [function(_m) {
            var _exportObj = {};

            for (var _key in _m) {
              if (_key !== "default" && _key !== "__esModule") _exportObj[_key] = _m[_key];
            }
      
            _export(_exportObj);
        }],
        execute: function () { }
    };
    });
});
//# sourceMappingURL=index.js.map