(function(){'use strict';var api={validate:function(data){if(!data||typeof data!=='object')return[['EVENT','Event data is missing or invalid']];var errors=[];var type=data.type||'unknown';var methodId=data.paymentMethod&&data.paymentMethod.id;var methodName=data.paymentMethod&&data.paymentMethod.name;var fields=data.paymentMethodFields;var country=data.country;if(!type||type==='unknown')errors.push(['TYPE','Invalid or missing event type']);if(!data.title)errors.push(['TITLE','Missing title']);return errors.length>0?errors:null;},validatePaymentMethod:function(methodId,eventType,fields){if(!methodId)return['Missing payment method ID'];if(!fields||Object.keys(fields).length===0)return['Missing payment method fields'];if(typeof PrimeBridge==='undefined'||!PrimeBridge.paymentMethods)return null;var method=PrimeBridge.paymentMethods.getById(methodId);if(!method)return['Unknown payment method: '+methodId];return PrimeBridge.paymentMethods.validate(methodId,eventType,fields)||null;},validateCountry:function(countryDisplay){if(!countryDisplay)return['Missing country'];if(!/[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(countryDisplay)&&(!PrimeBridge.countries||!PrimeBridge.countries.ready()))return null;if(!PrimeBridge.countries||!PrimeBridge.countries.ready())return null;var resolved=PrimeBridge.countries.resolve(countryDisplay.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]\s*/,''));if(!resolved)return['Country not found in registry: '+countryDisplay];return null;}};window.PrimeBridge=window.PrimeBridge||{};PrimeBridge.validator=api;})();