Liferay.Loader.define("frontend-js-web@5.0.33/liferay/CompatibilityEventProxy.es",["module","exports","require","frontend-js-metal-web$metal-state","./util/is_object"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(a("frontend-js-metal-web$metal-state")),s=n(a("./util/is_object"));function n(e){return e&&e.__esModule?e:{default:e}}class e extends i.default{constructor(e,t){super(e,t),this.eventTargets_=[],this.host=e.host,this.namespace=e.namespace,this.startCompatibility_()}addTarget(e){this.eventTargets_.push(e)}checkAttributeEvent_(e){return e.replace(this.adaptedEvents.match,this.adaptedEvents.replace)}emitCompatibleEvents_(e,t){this.eventTargets_.forEach((a=>{if(a.fire){const i=this.namespace?this.namespace+":"+e:e,n=a._yuievt.events[i];if((0,s.default)(t))try{t.target=this.host}catch(e){}let r;!this.emitFacade&&n&&(r=n.emitFacade,n.emitFacade=!1),a.fire(i,t),!this.emitFacade&&n&&(n.emitFacade=r)}}))}startCompatibility_(){this.host.on("*",((e,t)=>{t||(t=e);const a=this.checkAttributeEvent_(t.type);a!==t.type?(t.type=a,this.host.emit(a,e,t)):this.eventTargets_.length>0&&this.emitCompatibleEvents_(a,e)}))}}e.STATE={adaptedEvents:{value:{match:/(.*)(Changed)$/,replace:"$1Change"}},emitFacade:{value:!1}};var r=e;t.default=r}}));
//# sourceMappingURL=CompatibilityEventProxy.es.js.map