"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.synapse = void 0;
var _Core = require("../../../../Core.constants");
const synapse = function () {
  let _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
    event = _ref.event,
    instances = _ref.instances,
    _ref$origin = _ref.origin,
    _ref$origin2 = _ref$origin === void 0 ? {} : _ref$origin,
    commissionCode = _ref$origin2.commissionCode,
    _ref$urlParams = _ref.urlParams,
    _ref$urlParams2 = _ref$urlParams === void 0 ? {} : _ref$urlParams,
    fingerprint = _ref$urlParams2.fingerprint;
  if (commissionCode !== _Core.SYNAPSE_COMMISSION_CODE || !fingerprint) return;
  window.gtag('event', event, {
    chat_source: fingerprint.includes('whatsapp') ? 'whatsapp' : 'sarai',
    send_to: instances.map(function () {
      let _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
        idAnalytics = _ref2.idAnalytics;
      return idAnalytics;
    })
  });
};
exports.synapse = synapse;
//# sourceMappingURL=synapse.js.map