{"version":3,"file":"setConflictHandler.mjs","sources":["../../../../../../src/inAppMessaging/providers/pinpoint/apis/setConflictHandler.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { assertIsInitialized } from '../../../utils';\nimport { setConflictHandler as setConflictHandlerInteral } from '../utils';\n/**\n * Set a conflict handler that will be used to resolve conflicts that may emerge\n * when matching events with synced messages.\n *\n * @deprecated AWS will end support for Amazon Pinpoint on October 30, 2026.\n *\n * @remark\n * The conflict handler is not persisted across app restarts and so must be set again before dispatching an event for\n * any custom handling to take effect.\n *\n * @throws validation: {@link InAppMessagingValidationErrorCode} - Thrown when the provided parameters or library\n * configuration is incorrect, or if In App messaging hasn't been initialized.\n *\n * @param input The input object that holds the conflict handler to be used.\n *\n * @example\n * ```ts\n * // Sync messages before dispatching an event\n * await syncMessages();\n *\n * // Example custom conflict handler\n * const myConflictHandler = (messages) => {\n * \t\t// Return a random message\n * \t\tconst randomIndex = Math.floor(Math.random() * messages.length);\n * \t\treturn messages[randomIndex];\n *  };\n *\n * // Set the conflict handler\n * setConflictHandler(myConflictHandler);\n *\n * // Dispatch an event\n * await dispatchEvent({ name: 'test_event' });\n * ```\n */\nexport function setConflictHandler(input) {\n    assertIsInitialized();\n    setConflictHandlerInteral(input);\n}\n"],"names":["setConflictHandlerInteral"],"mappings":";;;;;;;AAAA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,kBAAkB,CAAC,KAAK,EAAE;AAC1C,IAAI,mBAAmB,EAAE;AACzB,IAAIA,oBAAyB,CAAC,KAAK,CAAC;AACpC;;;;"}