@overturo/js 0.0.0-stage → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +391 -2
- package/dist/field/index.cjs +1290 -0
- package/dist/field/index.cjs.map +1 -0
- package/dist/field/index.d.cts +176 -0
- package/dist/field/index.d.ts +176 -0
- package/dist/field/index.js +1251 -0
- package/dist/field/index.js.map +1 -0
- package/dist/index.cjs +4625 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1366 -0
- package/dist/index.d.ts +1366 -0
- package/dist/index.js +4583 -0
- package/dist/index.js.map +1 -0
- package/dist/overturo-field.global.js +2 -0
- package/dist/overturo.global.js +2 -0
- package/package.json +80 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../node_modules/ajv-formats/src/formats.ts","../node_modules/ajv/lib/runtime/ucs2length.ts","../src/constants.ts","../src/errors.ts","../src/api.ts","../src/approvals_facade.ts","../src/consent_facade.ts","../src/forms/intercept.ts","../src/forms/presentation.ts","../src/forms/snapshot.ts","../src/forms.ts","../src/signing_facade.ts","../src/dom.ts","../src/generated/postmessage-v2/envelope.js","../src/generated/postmessage-v2/ready.js","../src/generated/postmessage-v2/resize.js","../src/generated/postmessage-v2/cancel.js","../src/generated/postmessage-v2/consent/state.js","../src/generated/postmessage-v2/consent/complete.js","../src/generated/postmessage-v2/consent/error.js","../src/generated/postmessage-v2/consent/deadline.js","../src/generated/postmessage-v2/approval/state.js","../src/generated/postmessage-v2/approval/complete.js","../src/generated/postmessage-v2/approval/error.js","../src/generated/postmessage-v2/approval/deadline.js","../src/generated/postmessage-v2/signature/state.js","../src/generated/postmessage-v2/signature/complete.js","../src/generated/postmessage-v2/signature/error.js","../src/generated/postmessage-v2/signature/deadline.js","../src/postmessage_v2.ts","../src/decisions.ts","../src/embed.ts","../src/popup.ts","../src/preview.ts","../src/redirect.ts","../src/setup.ts","../src/overturo.ts","../src/element_base.ts","../src/elements/decision_element.ts","../src/elements/index.ts"],"sourcesContent":["import type {Format, FormatDefinition} from \"ajv\"\nimport type {FormatValidator, FormatCompare} from \"ajv/dist/types\"\n\nexport type FormatMode = \"fast\" | \"full\"\n\nexport type FormatName =\n | \"date\"\n | \"time\"\n | \"date-time\"\n | \"iso-time\"\n | \"iso-date-time\"\n | \"duration\"\n | \"uri\"\n | \"uri-reference\"\n | \"uri-template\"\n | \"url\"\n | \"email\"\n | \"hostname\"\n | \"ipv4\"\n | \"ipv6\"\n | \"regex\"\n | \"uuid\"\n | \"json-pointer\"\n | \"json-pointer-uri-fragment\"\n | \"relative-json-pointer\"\n | \"byte\"\n | \"int32\"\n | \"int64\"\n | \"float\"\n | \"double\"\n | \"password\"\n | \"binary\"\n\nexport type DefinedFormats = {\n [key in FormatName]: Format\n}\n\nfunction fmtDef(\n validate: RegExp | FormatValidator<string>,\n compare: FormatCompare<string>\n): FormatDefinition<string> {\n return {validate, compare}\n}\n\nexport const fullFormats: DefinedFormats = {\n // date: http://tools.ietf.org/html/rfc3339#section-5.6\n date: fmtDef(date, compareDate),\n // date-time: http://tools.ietf.org/html/rfc3339#section-5.6\n time: fmtDef(getTime(true), compareTime),\n \"date-time\": fmtDef(getDateTime(true), compareDateTime),\n \"iso-time\": fmtDef(getTime(), compareIsoTime),\n \"iso-date-time\": fmtDef(getDateTime(), compareIsoDateTime),\n // duration: https://tools.ietf.org/html/rfc3339#appendix-A\n duration: /^P(?!$)((\\d+Y)?(\\d+M)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+S)?)?|(\\d+W)?)$/,\n uri,\n \"uri-reference\":\n /^(?:[a-z][a-z0-9+\\-.]*:)?(?:\\/?\\/(?:(?:[a-z0-9\\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{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"'<>%\\\\^`{|}]|%[0-9a-f]{2})|\\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\\*)?)*\\})*$/i,\n // For the source: https://gist.github.com/dperini/729294\n // For test cases: https://mathiasbynens.be/demo/url-regex\n url: /^(?:https?|ftp):\\/\\/(?:\\S+(?::\\S*)?@)?(?:(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z0-9\\u{00a1}-\\u{ffff}]+-)*[a-z0-9\\u{00a1}-\\u{ffff}]+)(?:\\.(?:[a-z0-9\\u{00a1}-\\u{ffff}]+-)*[a-z0-9\\u{00a1}-\\u{ffff}]+)*(?:\\.(?:[a-z\\u{00a1}-\\u{ffff}]{2,})))(?::\\d{2,5})?(?:\\/[^\\s]*)?$/iu,\n email:\n /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,\n hostname:\n /^(?=.{1,253}\\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\\.?$/i,\n // optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html\n ipv4: /^(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)\\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\d)){3}))|:)))$/i,\n regex,\n // uuid: http://tools.ietf.org/html/rfc4122\n uuid: /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,\n // JSON-pointer: https://tools.ietf.org/html/rfc6901\n // uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A\n \"json-pointer\": /^(?:\\/(?:[^~/]|~0|~1)*)*$/,\n \"json-pointer-uri-fragment\": /^#(?:\\/(?:[a-z0-9_\\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,\n // relative JSON-pointer: http://tools.ietf.org/html/draft-luff-relative-json-pointer-00\n \"relative-json-pointer\": /^(?:0|[1-9][0-9]*)(?:#|(?:\\/(?:[^~/]|~0|~1)*)*)$/,\n // the following formats are used by the openapi specification: https://spec.openapis.org/oas/v3.0.0#data-types\n // byte: https://github.com/miguelmota/is-base64\n byte,\n // signed 32 bit integer\n int32: {type: \"number\", validate: validateInt32},\n // signed 64 bit integer\n int64: {type: \"number\", validate: validateInt64},\n // C-type float\n float: {type: \"number\", validate: validateNumber},\n // C-type double\n double: {type: \"number\", validate: validateNumber},\n // hint to the UI to hide input strings\n password: true,\n // unchecked string payload\n binary: true,\n}\n\nexport const fastFormats: DefinedFormats = {\n ...fullFormats,\n date: fmtDef(/^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\d$/, compareDate),\n time: fmtDef(\n /^(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)(?:\\.\\d+)?(?:z|[+-]\\d\\d(?::?\\d\\d)?)$/i,\n compareTime\n ),\n \"date-time\": fmtDef(\n /^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\dt(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)(?:\\.\\d+)?(?:z|[+-]\\d\\d(?::?\\d\\d)?)$/i,\n compareDateTime\n ),\n \"iso-time\": fmtDef(\n /^(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)(?:\\.\\d+)?(?:z|[+-]\\d\\d(?::?\\d\\d)?)?$/i,\n compareIsoTime\n ),\n \"iso-date-time\": fmtDef(\n /^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\d[t\\s](?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)(?:\\.\\d+)?(?:z|[+-]\\d\\d(?::?\\d\\d)?)?$/i,\n compareIsoDateTime\n ),\n // uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js\n uri: /^(?:[a-z][a-z0-9+\\-.]*:)(?:\\/?\\/)?[^\\s]*$/i,\n \"uri-reference\": /^(?:(?:[a-z][a-z0-9+\\-.]*:)?\\/?\\/)?(?:[^\\\\\\s#][^\\s#]*)?(?:#[^\\\\\\s]*)?$/i,\n // email (sources from jsen validator):\n // http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363\n // http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'wilful violation')\n email:\n /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,\n}\n\nexport const formatNames = Object.keys(fullFormats) as FormatName[]\n\nfunction isLeapYear(year: number): boolean {\n // https://tools.ietf.org/html/rfc3339#appendix-C\n return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0)\n}\n\nconst DATE = /^(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)$/\nconst DAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]\n\nfunction date(str: string): boolean {\n // full-date from http://tools.ietf.org/html/rfc3339#section-5.6\n const matches: string[] | null = DATE.exec(str)\n if (!matches) return false\n const year: number = +matches[1]\n const month: number = +matches[2]\n const day: number = +matches[3]\n return (\n month >= 1 &&\n month <= 12 &&\n day >= 1 &&\n day <= (month === 2 && isLeapYear(year) ? 29 : DAYS[month])\n )\n}\n\nfunction compareDate(d1: string, d2: string): number | undefined {\n if (!(d1 && d2)) return undefined\n if (d1 > d2) return 1\n if (d1 < d2) return -1\n return 0\n}\n\nconst TIME = /^(\\d\\d):(\\d\\d):(\\d\\d(?:\\.\\d+)?)(z|([+-])(\\d\\d)(?::?(\\d\\d))?)?$/i\n\nfunction getTime(strictTimeZone?: boolean): (str: string) => boolean {\n return function time(str: string): boolean {\n const matches: string[] | null = TIME.exec(str)\n if (!matches) return false\n const hr: number = +matches[1]\n const min: number = +matches[2]\n const sec: number = +matches[3]\n const tz: string | undefined = matches[4]\n const tzSign: number = matches[5] === \"-\" ? -1 : 1\n const tzH: number = +(matches[6] || 0)\n const tzM: number = +(matches[7] || 0)\n if (tzH > 23 || tzM > 59 || (strictTimeZone && !tz)) return false\n if (hr <= 23 && min <= 59 && sec < 60) return true\n // leap second\n const utcMin = min - tzM * tzSign\n const utcHr = hr - tzH * tzSign - (utcMin < 0 ? 1 : 0)\n return (utcHr === 23 || utcHr === -1) && (utcMin === 59 || utcMin === -1) && sec < 61\n }\n}\n\nfunction compareTime(s1: string, s2: string): number | undefined {\n if (!(s1 && s2)) return undefined\n const t1 = new Date(\"2020-01-01T\" + s1).valueOf()\n const t2 = new Date(\"2020-01-01T\" + s2).valueOf()\n if (!(t1 && t2)) return undefined\n return t1 - t2\n}\n\nfunction compareIsoTime(t1: string, t2: string): number | undefined {\n if (!(t1 && t2)) return undefined\n const a1 = TIME.exec(t1)\n const a2 = TIME.exec(t2)\n if (!(a1 && a2)) return undefined\n t1 = a1[1] + a1[2] + a1[3]\n t2 = a2[1] + a2[2] + a2[3]\n if (t1 > t2) return 1\n if (t1 < t2) return -1\n return 0\n}\n\nconst DATE_TIME_SEPARATOR = /t|\\s/i\nfunction getDateTime(strictTimeZone?: boolean): (str: string) => boolean {\n const time = getTime(strictTimeZone)\n\n return function date_time(str: string): boolean {\n // http://tools.ietf.org/html/rfc3339#section-5.6\n const dateTime: string[] = str.split(DATE_TIME_SEPARATOR)\n return dateTime.length === 2 && date(dateTime[0]) && time(dateTime[1])\n }\n}\n\nfunction compareDateTime(dt1: string, dt2: string): number | undefined {\n if (!(dt1 && dt2)) return undefined\n const d1 = new Date(dt1).valueOf()\n const d2 = new Date(dt2).valueOf()\n if (!(d1 && d2)) return undefined\n return d1 - d2\n}\n\nfunction compareIsoDateTime(dt1: string, dt2: string): number | undefined {\n if (!(dt1 && dt2)) return undefined\n const [d1, t1] = dt1.split(DATE_TIME_SEPARATOR)\n const [d2, t2] = dt2.split(DATE_TIME_SEPARATOR)\n const res = compareDate(d1, d2)\n if (res === undefined) return undefined\n return res || compareTime(t1, t2)\n}\n\nconst NOT_URI_FRAGMENT = /\\/|:/\nconst URI =\n /^(?:[a-z][a-z0-9+\\-.]*:)(?:\\/?\\/(?:(?:[a-z0-9\\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\\.[a-z0-9\\-._~!$&'()*+,;=:]+)\\]|(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)|(?:[a-z0-9\\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\\d*)?(?:\\/(?:[a-z0-9\\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\\/(?:(?:[a-z0-9\\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\\/(?:[a-z0-9\\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\\/(?:[a-z0-9\\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\\?(?:[a-z0-9\\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i\n\nfunction uri(str: string): boolean {\n // http://jmrware.com/articles/2009/uri_regexp/URI_regex.html + optional protocol + required \".\"\n return NOT_URI_FRAGMENT.test(str) && URI.test(str)\n}\n\nconst BYTE = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm\n\nfunction byte(str: string): boolean {\n BYTE.lastIndex = 0\n return BYTE.test(str)\n}\n\nconst MIN_INT32 = -(2 ** 31)\nconst MAX_INT32 = 2 ** 31 - 1\n\nfunction validateInt32(value: number): boolean {\n return Number.isInteger(value) && value <= MAX_INT32 && value >= MIN_INT32\n}\n\nfunction validateInt64(value: number): boolean {\n // JSON and javascript max Int is 2**53, so any int that passes isInteger is valid for Int64\n return Number.isInteger(value)\n}\n\nfunction validateNumber(): boolean {\n return true\n}\n\nconst Z_ANCHOR = /[^\\\\]\\\\Z/\nfunction regex(str: string): boolean {\n if (Z_ANCHOR.test(str)) return false\n try {\n new RegExp(str)\n return true\n } catch (e) {\n return false\n }\n}\n","// https://mathiasbynens.be/notes/javascript-encoding\n// https://github.com/bestiejs/punycode.js - punycode.ucs2.decode\nexport default function ucs2length(str: string): number {\n const len = str.length\n let length = 0\n let pos = 0\n let value: number\n while (pos < len) {\n length++\n value = str.charCodeAt(pos++)\n if (value >= 0xd800 && value <= 0xdbff && pos < len) {\n // high surrogate, and there is a next character\n value = str.charCodeAt(pos)\n if ((value & 0xfc00) === 0xdc00) pos++ // low surrogate\n }\n }\n return length\n}\n\nucs2length.code = 'require(\"ajv/dist/runtime/ucs2length\").default'\n","/**\n * Current protocol version for postMessage communication.\n *\n * Parity invariant: this constant MUST match the `PROTOCOL_VERSION` declared\n * by the decision page's frame messaging.\n * Enforced by `spec/lib/protocol_version_parity_spec.rb`.\n */\nexport const PROTOCOL_VERSION = 2\n\n/**\n * postMessage event types — protocol v2 (`overturo:*` namespace, kind-aware).\n *\n * Seven closed-enum types. Adding a type is a protocol version change.\n * Pinned decisions.\n */\nexport const MESSAGE_TYPES_V2 = {\n READY: \"overturo:ready\",\n STATE: \"overturo:state\",\n COMPLETE: \"overturo:complete\",\n CANCEL: \"overturo:cancel\",\n ERROR: \"overturo:error\",\n RESIZE: \"overturo:resize\",\n DEADLINE: \"overturo:deadline\",\n} as const\n\nexport type MessageTypeV2 = (typeof MESSAGE_TYPES_V2)[keyof typeof MESSAGE_TYPES_V2]\n\n/** Default iframe styles for embed mode. */\nexport const EMBED_DEFAULTS = {\n width: \"100%\",\n minHeight: \"400px\",\n maxHeight: \"none\",\n border: \"none\",\n borderRadius: \"0\",\n background: \"transparent\",\n} as const\n\n/** Allowed style keys for embed iframe (whitelist). */\nexport const EMBED_STYLE_KEYS = Object.keys(EMBED_DEFAULTS) as ReadonlyArray<keyof typeof EMBED_DEFAULTS>\n\n/** Default popup window dimensions. */\nexport const POPUP_DEFAULTS = {\n width: 500,\n height: 700,\n} as const\n\n/** postMessage event types for AccordSetup bridge controller. */\nexport const SETUP_MESSAGE_TYPES = {\n READY: \"overturoid:ready\",\n RESIZE: \"overturoid:resize\",\n STEP: \"overturoid:setup:step\",\n CREATED: \"overturoid:setup:created\",\n CANCEL: \"overturoid:cancel\",\n ERROR: \"overturoid:error\",\n PING: \"overturoid:ping\",\n HEARTBEAT: \"overturoid:heartbeat\",\n} as const\n\n/** Default popup dimensions for AccordSetup. */\nexport const SETUP_POPUP_DEFAULTS = {\n width: 600,\n height: 800,\n} as const\n\n/** API path for consent sessions. */\nexport const API_PATH = \"/api/v1/consent_sessions\"\n\n/**\n * kind-agnostic decisions API path . The v0\n * `/api/v1/consent_sessions` path is preserved as a server-side alias\n * during the alias window; the SDK calls the canonical\n * `/api/v1/decisions` path from `decisions.createSession`.\n */\nexport const DECISIONS_API_PATH = \"/api/v1/decisions\"\n\n/**\n * Decisions flow path on the trust host: `${flowBaseUrl}/decisions/:token`\n * for popup/redirect, `${flowBaseUrl}/decisions/:token/embed` for embed.\n */\nexport const DECISIONS_FLOW_PATH = \"/decisions\"\n\n/** The participant's own meeting pair (status / withdrawal) — publishable key + session token. */\nexport const MEETING_CONSENTS_API_PATH = \"/api/v1/meeting_consents\"\n\n/** API path for accord setup sessions. */\nexport const SETUP_API_PATH = \"/api/v1/accord_setup_sessions\"\n\n/**\n * API path for preview tokens — top-level, not nested under consent_sessions.\n * Used by previewTemplate (a flow template) and previewSetup (a setup session).\n * The route is declared in `config/routes/api_core.rb` as\n * POST only.\n */\nexport const PREVIEW_TOKENS_PATH = \"/api/v1/preview_tokens\"\n\n/** Default base URL. */\nexport const DEFAULT_BASE_URL = \"https://overturo.com\"\n\n/** The v2 family's type prefix; an envelope of another family on the same page is not ours to validate. */\nexport const MESSAGE_PREFIX_V2 = \"overturo:\"\n\n/** True for a message whose `type` names another protocol family (dropped silently, never a protocol violation). */\nexport function isForeignEnvelope(data: unknown): boolean {\n const type = (data as { type?: unknown } | null)?.type\n return typeof type === \"string\" && !type.startsWith(MESSAGE_PREFIX_V2)\n}\n\n/** Default request timeout in milliseconds (30 seconds). */\nexport const DEFAULT_TIMEOUT = 30_000\n\n/** 202 — the embedded consent field element (registered by the separate `@overturo/js/field` entry). */\nexport const CONSENT_FIELD_ELEMENT_NAME = \"overturo-consent-field\"\n","/** Base error class for all Overturo SDK errors. */\nexport class OverturoError extends Error {\n constructor(message: string) {\n super(message)\n this.name = \"OverturoError\"\n }\n}\n\n/** Thrown when required parameters are missing or invalid. */\nexport class OverturoValidationError extends OverturoError {\n constructor(message: string) {\n super(message)\n this.name = \"OverturoValidationError\"\n }\n}\n\n/** Thrown when the API returns a 4xx or 5xx response. */\nexport class OverturoApiError extends OverturoError {\n /** HTTP status code. */\n status: number\n /** Parsed response body, if available. */\n body: unknown\n\n constructor(message: string, status: number, body: unknown) {\n super(message)\n this.name = \"OverturoApiError\"\n this.status = status\n this.body = body\n }\n}\n\n/** Thrown when a network error prevents the request from completing. */\nexport class OverturoNetworkError extends OverturoError {\n /** The original error that caused the failure. */\n cause: unknown\n\n constructor(message: string, cause: unknown) {\n super(message)\n this.name = \"OverturoNetworkError\"\n this.cause = cause\n }\n}\n\n/** Thrown when an operation times out. */\nexport class OverturoTimeoutError extends OverturoError {\n constructor(message: string = \"Operation timed out\") {\n super(message)\n this.name = \"OverturoTimeoutError\"\n }\n}\n\n/**\n * OAP denial category vocabulary.\n *\n * Cascade-relevant errors returned by OAP endpoints carry one of these\n * values. Non-cascade errors (validation, conflict, internal) omit the\n * field.\n */\nexport type OapDenialCategory = \"authorization_denied\" | \"intent_denied\" | \"trajectory_denied\"\n\n/**\n * Shape of a single OAP error envelope as rendered by the server.\n * Surfaced through {@link OapDenied} so callers can introspect the\n * full envelope without re-parsing the response body.\n */\nexport interface OapErrorEnvelope {\n reason_code: string\n message: string\n detail?: Record<string, unknown>\n failed_bound?: string\n denial_category?: OapDenialCategory\n cascade_step?: number\n request_id?: string\n negotiable?: boolean\n negotiate_url?: string\n documentation_url?: string\n}\n\n/**\n * Thrown when an OAP-protocol endpoint returns a denial.\n *\n * Carries the structured fields from the OAP error envelope. The\n * three subclasses below map 1:1 to {@link OapDenialCategory} so\n * callers can `catch (e: OapIntentDenied)` directly.\n */\nexport class OapDenied extends OverturoApiError {\n reason_code: string\n failed_bound: string | undefined\n denial_category: OapDenialCategory | undefined\n cascade_step: number | undefined\n detail: Record<string, unknown> | undefined\n\n constructor(envelope: OapErrorEnvelope, status: number, body: unknown) {\n super(envelope.message, status, body)\n this.name = \"OapDenied\"\n this.reason_code = envelope.reason_code\n this.failed_bound = envelope.failed_bound\n this.denial_category = envelope.denial_category\n this.cascade_step = envelope.cascade_step\n this.detail = envelope.detail\n }\n\n /**\n * Build the most-specific subclass for the envelope. Reason-code\n * dispatch takes precedence over category dispatch so the most\n * specific subclass wins (sequence denials are\n * trajectory_denied but get their own subclass).\n */\n static fromEnvelope(envelope: OapErrorEnvelope, status: number, body: unknown): OapDenied {\n if (envelope.reason_code === \"sequence_prohibited\" || envelope.reason_code === \"sequence_missing_predecessor\") {\n return new OapSequenceDenied(envelope, status, body)\n }\n switch (envelope.denial_category) {\n case \"authorization_denied\":\n return new OapAuthorizationDenied(envelope, status, body)\n case \"intent_denied\":\n return new OapIntentDenied(envelope, status, body)\n case \"trajectory_denied\":\n return new OapTrajectoryDenied(envelope, status, body)\n default:\n return new OapDenied(envelope, status, body)\n }\n }\n}\n\n/** denial_category == \"authorization_denied\" — OAuth/DPoP layer rejected. */\nexport class OapAuthorizationDenied extends OapDenied {\n constructor(envelope: OapErrorEnvelope, status: number, body: unknown) {\n super(envelope, status, body)\n this.name = \"OapAuthorizationDenied\"\n }\n}\n\n/** denial_category == \"intent_denied\" — request fell outside grant bounds. */\nexport class OapIntentDenied extends OapDenied {\n constructor(envelope: OapErrorEnvelope, status: number, body: unknown) {\n super(envelope, status, body)\n this.name = \"OapIntentDenied\"\n }\n}\n\n/** denial_category == \"trajectory_denied\" — execution history blocked. */\nexport class OapTrajectoryDenied extends OapDenied {\n constructor(envelope: OapErrorEnvelope, status: number, body: unknown) {\n super(envelope, status, body)\n this.name = \"OapTrajectoryDenied\"\n }\n}\n\n/**\n * 2 — sequence_bounds violation\n * (`sequence_prohibited` / `sequence_missing_predecessor`). A\n * trajectory denial with a structural-ordering flavour.\n */\nexport class OapSequenceDenied extends OapTrajectoryDenied {\n constructor(envelope: OapErrorEnvelope, status: number, body: unknown) {\n super(envelope, status, body)\n this.name = \"OapSequenceDenied\"\n }\n}\n","import { DEFAULT_TIMEOUT } from \"./constants\"\nimport { OverturoApiError, OverturoNetworkError, OverturoTimeoutError } from \"./errors\"\n\n// Two error envelopes ship across the surface:\n// * Flat: { \"error\": \"Invalid publishable key\" } (auth layer)\n// * Structured: { \"error\": { \"code\": \"x\", \"message\": \"y\" } } (canonical)\n// Prior code stringified the structured envelope to \"[object Object]\"\n// and hid the real failure. Walk a small precedence chain.\nexport function extractErrorMessage(body: unknown, status: number): string {\n if (body && typeof body === \"object\") {\n const raw = (body as Record<string, unknown>).error\n if (typeof raw === \"string\" && raw.length > 0) return raw\n if (raw && typeof raw === \"object\") {\n const inner = raw as Record<string, unknown>\n if (typeof inner.message === \"string\" && inner.message.length > 0) {\n return typeof inner.code === \"string\" && inner.code.length > 0\n ? `${inner.code}: ${inner.message}`\n : inner.message\n }\n // Validation-failure envelope shape:\n // { code: \"validation_failed\", errors: { field: [\"msg\", ...] } }\n // Surface the first concrete validation reason so the failure\n // message names a specific field rather than just the code.\n if (inner.errors && typeof inner.errors === \"object\") {\n const firstField = Object.keys(inner.errors)[0]\n if (firstField) {\n const msgs = (inner.errors as Record<string, unknown>)[firstField]\n const first = Array.isArray(msgs) ? msgs[0] : msgs\n if (typeof first === \"string\") {\n const codePrefix = typeof inner.code === \"string\" && inner.code.length > 0 ? `${inner.code}: ` : \"\"\n return `${codePrefix}${firstField} ${first}`\n }\n }\n }\n if (typeof inner.code === \"string\" && inner.code.length > 0) {\n return inner.code\n }\n }\n const topMessage = (body as Record<string, unknown>).message\n if (typeof topMessage === \"string\" && topMessage.length > 0) return topMessage\n }\n return `HTTP ${status}`\n}\n\nexport interface ApiClientOptions {\n baseUrl: string\n publishableKey: string\n apiKey?: string\n /** Request timeout in milliseconds. 0 disables timeout. */\n timeout?: number\n}\n\n/**\n * Converts a camelCase string to snake_case.\n */\nfunction camelToSnake(str: string): string {\n return str.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`)\n}\n\n/**\n * Converts a snake_case string to camelCase.\n */\nfunction snakeToCamel(str: string): string {\n return str.replace(/_([a-z])/g, (_, letter: string) => letter.toUpperCase())\n}\n\n/**\n * Recursively converts object keys from camelCase to snake_case.\n */\nexport function toSnakeCase(obj: unknown): unknown {\n if (Array.isArray(obj)) {\n return obj.map(toSnakeCase)\n }\n if (obj !== null && typeof obj === \"object\") {\n const result: Record<string, unknown> = {}\n for (const [key, value] of Object.entries(obj as Record<string, unknown>)) {\n result[camelToSnake(key)] = toSnakeCase(value)\n }\n return result\n }\n return obj\n}\n\n/**\n * Recursively converts object keys from snake_case to camelCase.\n */\nexport function toCamelCase(obj: unknown): unknown {\n if (Array.isArray(obj)) {\n return obj.map(toCamelCase)\n }\n if (obj !== null && typeof obj === \"object\") {\n const result: Record<string, unknown> = {}\n for (const [key, value] of Object.entries(obj as Record<string, unknown>)) {\n result[snakeToCamel(key)] = toCamelCase(value)\n }\n return result\n }\n return obj\n}\n\n/**\n * Fetch-based HTTP client with automatic case conversion, timeout, and error handling.\n */\nexport class ApiClient {\n private baseUrl: string\n private publishableKey: string\n private apiKey?: string\n private timeout: number\n\n constructor(options: ApiClientOptions) {\n this.baseUrl = options.baseUrl\n this.publishableKey = options.publishableKey\n this.apiKey = options.apiKey\n this.timeout = options.timeout ?? DEFAULT_TIMEOUT\n }\n\n async get<T>(path: string): Promise<T> {\n return this.request<T>(\"GET\", path)\n }\n\n async post<T>(path: string, body?: Record<string, unknown>): Promise<T> {\n return this.request<T>(\"POST\", path, body)\n }\n\n /**\n * GET that returns the raw Response object without JSON parsing, case\n * conversion or error throwing. Used where part of the body must stay\n * verbatim (keys that are data, such as purpose names).\n */\n async rawGet(path: string): Promise<Response> {\n return this.rawRequest(\"GET\", path)\n }\n\n /**\n * POST that returns the raw Response object without JSON parsing or error throwing.\n * Used by exchange() to handle HTTP 202 (fulfillment pending) with retry logic.\n */\n async rawPost(path: string, body: Record<string, unknown>): Promise<Response> {\n return this.rawRequest(\"POST\", path, body)\n }\n\n private async rawRequest(method: \"GET\" | \"POST\", path: string, body?: Record<string, unknown>): Promise<Response> {\n const url = `${this.baseUrl}${path}`\n const headers: Record<string, string> = {\n \"Content-Type\": \"application/json\",\n \"X-Publishable-Key\": this.publishableKey,\n }\n\n if (this.apiKey) {\n headers[\"Authorization\"] = `Bearer ${this.apiKey}`\n }\n\n const controller = new AbortController()\n let timeoutId: ReturnType<typeof setTimeout> | undefined\n\n if (this.timeout > 0) {\n timeoutId = setTimeout(() => controller.abort(), this.timeout)\n }\n\n try {\n return await fetch(url, {\n method,\n headers,\n body: body === undefined ? undefined : JSON.stringify(toSnakeCase(body)),\n signal: controller.signal,\n })\n } catch (error) {\n if (error instanceof DOMException && error.name === \"AbortError\") {\n throw new OverturoTimeoutError(`Request timed out after ${this.timeout}ms`)\n }\n throw new OverturoNetworkError(\"Network request failed\", error)\n } finally {\n if (timeoutId !== undefined) clearTimeout(timeoutId)\n }\n }\n\n private async request<T>(method: string, path: string, body?: Record<string, unknown>): Promise<T> {\n const url = `${this.baseUrl}${path}`\n const headers: Record<string, string> = {\n \"Content-Type\": \"application/json\",\n \"X-Publishable-Key\": this.publishableKey,\n }\n\n if (this.apiKey) {\n headers[\"Authorization\"] = `Bearer ${this.apiKey}`\n }\n\n const controller = new AbortController()\n let timeoutId: ReturnType<typeof setTimeout> | undefined\n\n if (this.timeout > 0) {\n timeoutId = setTimeout(() => controller.abort(), this.timeout)\n }\n\n let response: Response\n try {\n response = await fetch(url, {\n method,\n headers,\n body: body ? JSON.stringify(toSnakeCase(body)) : undefined,\n signal: controller.signal,\n })\n } catch (error) {\n if (error instanceof DOMException && error.name === \"AbortError\") {\n throw new OverturoTimeoutError(`Request timed out after ${this.timeout}ms`)\n }\n throw new OverturoNetworkError(\"Network request failed\", error)\n } finally {\n if (timeoutId !== undefined) clearTimeout(timeoutId)\n }\n\n if (!response.ok) {\n let responseBody: unknown\n try {\n responseBody = await response.json()\n } catch {\n responseBody = null\n }\n const message = extractErrorMessage(responseBody, response.status)\n throw new OverturoApiError(message, response.status, responseBody)\n }\n\n const text = await response.text()\n if (!text) {\n return {} as T\n }\n\n return toCamelCase(JSON.parse(text)) as T\n }\n}\n","// `approvals` facade. Pre-`kind: \"approval\"` shim over\n// the decisions primitive. Adds `onCounter` for the three-outcome\n// flow + `deadline(token)` for remaining-time queries.\n//\n// Plan: Phase C.\n\nimport type { ApiClient } from \"./api\"\nimport { DECISIONS_API_PATH } from \"./constants\"\nimport type { Decisions } from \"./decisions\"\nimport { OverturoValidationError } from \"./errors\"\nimport type { ApprovalsNamespace, ApprovalsOpenOptions, DecisionMode, DecisionToken, DecisionsHandle } from \"./types\"\n\nexport class ApprovalsFacade implements ApprovalsNamespace {\n readonly #decisions: Decisions\n readonly #api: ApiClient\n\n constructor(decisions: Decisions, api: ApiClient) {\n this.#decisions = decisions\n this.#api = api\n }\n\n async open(opts: ApprovalsOpenOptions): Promise<DecisionsHandle> {\n if (!opts.escalationId) {\n throw new OverturoValidationError(\"escalationId is required\")\n }\n const mode = opts.mode ?? \"embed\"\n const session = await this.#decisions.createSession({\n kind: \"approval\",\n subjectRef: opts.escalationId,\n mode,\n embedOrigin: opts.embedOrigin,\n state: opts.state,\n redirectUri: opts.redirectUri,\n })\n if (mode === \"popup\") {\n return this.#decisions.popup({\n token: session.token,\n onComplete: (outcome) => {\n if (outcome.kind === \"approval\") opts.onComplete?.(outcome)\n },\n onCancel: opts.onCancel,\n onError: opts.onError,\n })\n }\n if (mode === \"redirect\") {\n const url = this.#decisions.url({ token: session.token, mode: \"redirect\" })\n window.location.href = url\n return {\n token: session.token,\n mode: \"redirect\",\n destroy: async () => {},\n }\n }\n return this.#decisions.embed({\n token: session.token,\n container: opts.container,\n style: opts.style,\n loading: opts.loading,\n onReady: opts.onReady,\n onState: (_kind, payload) => opts.onState?.(payload),\n onComplete: (outcome) => {\n if (outcome.kind === \"approval\") opts.onComplete?.(outcome)\n },\n onCancel: opts.onCancel,\n onError: opts.onError,\n onDeadline: opts.onDeadline,\n onCounter: opts.onCounter,\n })\n }\n\n url(opts: { escalationId: string; mode?: DecisionMode }): string {\n return this.#decisions.url({\n token: opts.escalationId as unknown as DecisionToken,\n mode: opts.mode,\n })\n }\n\n /**\n * Polls `${decisions_api}/:token` for deadline metadata. Returns the\n * computed remainingMs alongside the absolute deadlineAt for clock-\n * skew tolerance in consumers.\n */\n async deadline(token: DecisionToken): Promise<{ remainingMs: number; deadlineAt: string }> {\n if (!token) {\n throw new OverturoValidationError(\"token is required for deadline\")\n }\n const status = await this.#api.get<{ deadlineAt: string }>(`${DECISIONS_API_PATH}/${token}`)\n return {\n remainingMs: Math.max(0, new Date(status.deadlineAt).getTime() - Date.now()),\n deadlineAt: status.deadlineAt,\n }\n }\n}\n","// `consent` facade. Pre-`kind: \"consent\"` shim over the\n// decisions primitive. Preserves v0 callback names (`onComplete`,\n// `onCancel`, `onError`, `onStep`) so internal migration is one rename.\n//\n// Plan: Phase B.\n\nimport type { Decisions } from \"./decisions\"\nimport { OverturoValidationError } from \"./errors\"\nimport type {\n ConsentNamespace,\n ConsentOpenOptions,\n DecisionMode,\n DecisionToken,\n DecisionsHandle,\n FlowDisclosures,\n} from \"./types\"\n\nexport class ConsentFacade implements ConsentNamespace {\n readonly #decisions: Decisions\n\n constructor(decisions: Decisions) {\n this.#decisions = decisions\n }\n\n /**\n * Creates a consent session and mounts the iframe in one call.\n * Bridges v0's `onStep(payload)` to v1's `onState(kind, payload)`\n * so existing call sites keep working with a single rename.\n */\n async open(opts: ConsentOpenOptions): Promise<DecisionsHandle> {\n if (!opts.flowId) {\n throw new OverturoValidationError(\"flowId is required\")\n }\n const mode = opts.mode ?? \"embed\"\n const session = await this.#decisions.createSession({\n kind: \"consent\",\n subjectRef: opts.flowId,\n mode,\n embedOrigin: opts.embedOrigin,\n scope: opts.scope,\n state: opts.state,\n nonce: opts.nonce,\n redirectUri: opts.redirectUri,\n })\n if (mode === \"popup\") {\n return this.#decisions.popup({\n token: session.token,\n onComplete: (outcome) => {\n if (outcome.kind === \"consent\") opts.onComplete?.(outcome)\n },\n onCancel: opts.onCancel,\n onError: opts.onError,\n })\n }\n if (mode === \"redirect\") {\n const url = this.#decisions.url({ token: session.token, mode: \"redirect\" })\n window.location.href = url\n // The caller's continuation is irrelevant — navigation tears down\n // the page. Return a sealed handle for type-shape consistency.\n return {\n token: session.token,\n mode: \"redirect\",\n destroy: async () => {},\n }\n }\n return this.#decisions.embed({\n token: session.token,\n container: opts.container,\n style: opts.style,\n loading: opts.loading,\n onReady: opts.onReady,\n onState: (_kind, payload) => opts.onStep?.(payload),\n onComplete: (outcome) => {\n if (outcome.kind === \"consent\") opts.onComplete?.(outcome)\n },\n onCancel: opts.onCancel,\n onError: opts.onError,\n })\n }\n\n url(opts: { flowId: string; mode?: DecisionMode }): string {\n // We don't have a token before createSession runs, but the URL\n // helper is useful for consumers that want to build redirect\n // links from a flowId server-side. Return the canonical flow URL\n // shape; the trust host resolves flowId → token internally.\n return this.#decisions.url({\n token: opts.flowId as unknown as DecisionToken,\n mode: opts.mode,\n })\n }\n\n /**\n * pre-flight disclosure discovery. Thin delegate to\n * `decisions.discover` so the kind facades stay symmetric.\n */\n discover(opts: { flowId: string; locale?: string }): Promise<FlowDisclosures> {\n return this.#decisions.discover(opts)\n }\n}\n","import { OverturoValidationError } from \"../errors\"\n\n/** 201 — the hidden input that carries the capture token to the organisation's server. */\nexport const DEFAULT_TOKEN_FIELD = \"overturo_capture_token\"\n/** One-shot marker for the re-entrant submit the facade itself triggers; cleared as soon as it is seen. */\nexport const CAPTURED_MARK = \"overturoCaptured\"\n/** The capture never holds the form longer than this (ms): the form submits either way. */\nexport const CAPTURE_TIMEOUT_MS = 5_000\n\nexport interface InterceptOptions {\n tokenFieldName?: string\n submitAfterCapture?: boolean\n onError?: (error: Error) => void\n}\n\nexport interface InterceptContext {\n submitter: HTMLElement | null\n}\n\n/** One interception per form: a second attach without a detach would make two handlers re-submit each other forever. */\nconst attached = new WeakMap<HTMLFormElement, true>()\n\n/**\n * 201 D4 Level B / 202 D9 — the one submit interception both capture shapes\n * share: one-shot re-entry, an in-flight guard, the timeout, the clicked\n * button travelling with the re-submit, the hidden token input. `run` does\n * the capture (from the DOM for the snippet, through the field element for\n * the embedded field) and returns the token; whatever happens, the form\n * submits afterwards unless `submitAfterCapture` is false.\n */\nexport function interceptSubmit(\n form: HTMLFormElement,\n opts: InterceptOptions,\n run: (ctx: InterceptContext) => Promise<{ token: string }>\n): () => void {\n if (attached.has(form)) {\n throw new OverturoValidationError(\"duplicate_attach: this form already has a capture interception; detach it before attaching again\")\n }\n attached.set(form, true)\n let inFlight = false\n const tokenField = opts.tokenFieldName ?? DEFAULT_TOKEN_FIELD\n const handler = (ev: Event) => {\n if (form.dataset[CAPTURED_MARK] === \"1\") {\n // The re-entrant submit the interception itself triggered: let it through once,\n // and forget it — the next real submit captures again.\n delete form.dataset[CAPTURED_MARK]\n return\n }\n ev.preventDefault()\n ev.stopImmediatePropagation()\n if (inFlight) return // a second click while the capture is in flight: the first one answers\n inFlight = true\n form.querySelector(`input[name=\"${tokenField}\"]`)?.remove() // never carry a stale token\n const submitter = (ev as SubmitEvent).submitter ?? null\n void (async () => {\n try {\n const { token } = await withTimeout(run({ submitter }), CAPTURE_TIMEOUT_MS)\n setHiddenInput(form, tokenField, token)\n } catch (e) {\n opts.onError?.(e as Error) // the form still submits\n } finally {\n inFlight = false\n if (opts.submitAfterCapture !== false) {\n form.dataset[CAPTURED_MARK] = \"1\"\n resubmit(form, submitter)\n }\n }\n })()\n }\n form.addEventListener(\"submit\", handler, { capture: true })\n return () => {\n attached.delete(form)\n form.removeEventListener(\"submit\", handler, { capture: true })\n delete form.dataset[CAPTURED_MARK]\n form.querySelector(`input[name=\"${tokenField}\"]`)?.remove()\n }\n}\n\n/** The capture never holds the form hostage: past the limit the form submits without a token. */\nexport function withTimeout<T>(promise: Promise<T>, ms: number): Promise<T> {\n return new Promise<T>((resolve, reject) => {\n const timer = setTimeout(\n () => reject(new OverturoValidationError(`capture timed out after ${ms} ms; the form submits without a capture token`)),\n ms\n )\n promise.then(\n (v) => {\n clearTimeout(timer)\n resolve(v)\n },\n (e) => {\n clearTimeout(timer)\n reject(e)\n }\n )\n })\n}\n\n/** Re-submits the way the person did: the clicked button's name/value and formaction travel with it. */\nexport function resubmit(form: HTMLFormElement, submitter: HTMLElement | null): void {\n if (submitter && submitter.isConnected && typeof form.requestSubmit === \"function\") {\n try {\n form.requestSubmit(submitter)\n return\n } catch {\n /* fall through: an unusual submitter; the plain re-submit follows */\n }\n }\n if (typeof form.requestSubmit === \"function\") form.requestSubmit()\n else if (submitter && typeof (submitter as HTMLButtonElement).click === \"function\") (submitter as HTMLButtonElement).click()\n else form.submit()\n}\n\nexport function resolveForm(form: HTMLFormElement | string): HTMLFormElement {\n const el = typeof form === \"string\" ? document.querySelector(form) : form\n if (!(el instanceof HTMLFormElement)) throw new OverturoValidationError(\"form must resolve to a <form> element\")\n return el\n}\n\nexport function setHiddenInput(form: HTMLFormElement, name: string, value: string): void {\n let input = form.querySelector<HTMLInputElement>(`input[name=\"${name}\"]`)\n if (!input) {\n input = document.createElement(\"input\")\n input.type = \"hidden\"\n input.name = name\n form.appendChild(input)\n }\n input.value = value\n}\n","/**\n * 201 D12 — the decision and the presentation of one mapped form control, as\n * observed in the DOM at submit: ticked → granted, unticked → declined (never\n * silence), with the default-ticked and required flags the server's matrix\n * refuses for a consent purpose. Only checkable controls are read; anything\n * else is declined (a text field is never a consent).\n */\nexport interface AttestedDecision {\n decision: \"granted\" | \"declined\"\n default_checked: boolean\n mandatory: boolean\n}\n\nexport function resolveControl(root: ParentNode, selector: string): HTMLInputElement | null {\n const el = root.querySelector(selector)\n return el instanceof HTMLInputElement ? el : null\n}\n\nexport function presentationFor(control: HTMLInputElement | null, initiallyChecked?: boolean): AttestedDecision {\n if (!control || (control.type !== \"checkbox\" && control.type !== \"radio\")) {\n return { decision: \"declined\", default_checked: false, mandatory: false }\n }\n return {\n decision: control.checked ? \"granted\" : \"declined\",\n // Shown ticked by default: the HTML attribute, or a script that ticked it before the person saw it.\n default_checked: control.defaultChecked || initiallyChecked === true,\n mandatory: mandatoryFor(control),\n }\n}\n\n/**\n * `required` on a lone checkbox means the person had to tick it. `required` on a\n * radio whose group offers another option (a \"No\") means the person had to\n * choose — which is a decision, not a mandatory consent.\n */\nfunction mandatoryFor(control: HTMLInputElement): boolean {\n if (!control.required) return false\n if (control.type !== \"radio\" || !control.name) return true\n const root: ParentNode = control.form ?? control.ownerDocument\n const group = Array.from(root.querySelectorAll<HTMLInputElement>('input[type=\"radio\"]')).filter((r) => r.name === control.name)\n return group.length <= 1\n}\n\n/** Every mapped purpose → its attested decision. */\nexport function decisionsFor(\n form: HTMLFormElement,\n map: Record<string, string>,\n initiallyChecked: Record<string, boolean> = {}\n): Record<string, AttestedDecision> {\n const out: Record<string, AttestedDecision> = {}\n for (const [purpose, selector] of Object.entries(map)) {\n out[purpose] = presentationFor(resolveControl(form, selector), initiallyChecked[purpose])\n }\n return out\n}\n","/**\n * 201 — the sanitised form snapshot: the consent controls (with their checked\n * state) and the labels around them, every other input's value stripped,\n * scripts and inline handlers removed, capped at 16 KB. The subject field is\n * sent as a field, never inside the snapshot.\n */\nexport const SNAPSHOT_MAX_BYTES = 16 * 1024\n\nconst VALUE_BEARING = \"input, textarea, select\"\nconst EVENT_ATTR = /^on/i\nconst FREE_TEXT_ATTRS = new Set([\"title\", \"aria-label\", \"aria-description\"])\n\nexport function sanitisedSnapshot(form: HTMLFormElement, consentSelectors: string[]): string {\n const clone = form.cloneNode(true) as HTMLFormElement\n const keep = new Set<Element>()\n for (const selector of consentSelectors) {\n const el = clone.querySelector(selector)\n if (el) keep.add(el)\n }\n\n clone.querySelectorAll(\"script, style, iframe, object, embed\").forEach((el) => el.remove())\n ;[clone, ...Array.from(clone.querySelectorAll(\"*\"))].forEach((el) => {\n for (const attr of Array.from(el.attributes)) {\n const name = attr.name.toLowerCase()\n // Inline handlers, embedded documents and free-text attributes an\n // integrator may have put a value into (data-*, title, aria-label).\n if (EVENT_ATTR.test(name) || name === \"srcdoc\" || name.startsWith(\"data-\") || FREE_TEXT_ATTRS.has(name)) {\n el.removeAttribute(attr.name)\n }\n }\n })\n\n clone.querySelectorAll(VALUE_BEARING).forEach((node) => {\n const el = node as HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement\n if (keep.has(el)) {\n // A consent control keeps its checked state and loses any value text.\n const input = el as HTMLInputElement\n if (input.checked) input.setAttribute(\"checked\", \"\")\n else input.removeAttribute(\"checked\")\n el.removeAttribute(\"value\")\n return\n }\n el.removeAttribute(\"value\")\n el.removeAttribute(\"placeholder\")\n if (el instanceof HTMLTextAreaElement) el.textContent = \"\"\n if (el instanceof HTMLSelectElement) {\n el.querySelectorAll(\"option\").forEach((o) => {\n o.removeAttribute(\"selected\")\n o.removeAttribute(\"value\")\n })\n }\n if (el instanceof HTMLInputElement) {\n el.removeAttribute(\"checked\")\n if (el.type === \"hidden\") el.remove()\n }\n })\n\n const html = clone.outerHTML\n return truncateUtf8(html, SNAPSHOT_MAX_BYTES)\n}\n\nfunction truncateUtf8(text: string, maxBytes: number): string {\n const encoder = new TextEncoder()\n if (encoder.encode(text).byteLength <= maxBytes) return text\n let out = text\n while (encoder.encode(out).byteLength > maxBytes) {\n out = out.slice(0, Math.floor(out.length * 0.9))\n }\n return out\n}\n","import type { ApiClient } from \"./api\"\nimport { CONSENT_FIELD_ELEMENT_NAME } from \"./constants\"\nimport type { Decisions } from \"./decisions\"\nimport { OverturoValidationError } from \"./errors\"\nimport { interceptSubmit, resolveForm } from \"./forms/intercept\"\nimport { decisionsFor, resolveControl } from \"./forms/presentation\"\nimport { sanitisedSnapshot } from \"./forms/snapshot\"\nimport type { DecisionToken, FormCaptureOptions, FormCaptureResult } from \"./types\"\n\n/** 201 — the one-call capture endpoint. */\nconst CAPTURE_PATH = \"/api/v1/decisions/capture\"\n\ninterface CaptureResponse {\n capture: {\n sessionToken: string\n attestationId: string\n committed: boolean\n wordingVerdict?: string | null\n recordId?: string | null\n }\n}\n\n/** 202 — what the facade needs from `<overturo-consent-field>` (the field entry is loaded explicitly; the core never imports it). */\ninterface ConsentFieldLike extends HTMLElement {\n attachTo(form: HTMLFormElement, opts: FormCaptureOptions, client: { flowBaseUrl: string; publishableKey: string }): () => void\n}\n\n/**\n * 201 D4 Level B — Form Capture: the organisation keeps its form; Overturo\n * keeps the record. `attach` intercepts the form's submit, reads the mapped\n * consent controls (decision + presentation as shown), posts one capture\n * with the publishable key, writes the capture token into a hidden input and\n * lets the submission proceed. If Overturo is unreachable the form still\n * submits and `onError` fires. Writes nothing to client storage.\n *\n * @example\n * ```ts\n * overturo.forms.attach({\n * flowId: \"flw_...\",\n * form: \"#signup\",\n * map: { marketing: \"#marketing_opt_in\", analytics: \"#analytics\" },\n * subjectField: \"#email\",\n * })\n * ```\n */\nexport class FormsFacade {\n constructor(\n private readonly api: ApiClient,\n private readonly decisions: Decisions,\n private readonly flowBaseUrl: string,\n private readonly publishableKey: string\n ) {}\n\n /** Wires the capture onto the form; returns a detach function. */\n attach(opts: FormCaptureOptions): () => void {\n if (!opts.flowId) throw new OverturoValidationError(\"flowId is required\")\n const form = resolveForm(opts.form)\n if (opts.field) return this.attachField(form, opts)\n const map = opts.map\n if (!map || Object.keys(map).length === 0) throw new OverturoValidationError(\"map must name at least one purpose (or pass field)\")\n // What the person first saw: a control ticked by script at load counts as\n // shown ticked by default, whatever its HTML attribute says.\n const initiallyChecked = initialCheckedState(form, map)\n if (opts.wording) void this.writeWording(form, opts)\n return interceptSubmit(form, opts, async () => {\n const unresolved = Object.entries(map).filter(([, selector]) => !resolveControl(form, selector))\n if (unresolved.length) {\n throw new OverturoValidationError(`consent control not found for: ${unresolved.map(([p]) => p).join(\", \")}`)\n }\n const body = this.buildCaptureBody(form, opts, initiallyChecked)\n const digests = await this.labelDigests(form, opts)\n if (digests) body.noticeHashes = digests\n const raw = await this.api.post<CaptureResponse>(CAPTURE_PATH, body)\n const result: FormCaptureResult = {\n token: raw.capture.sessionToken as DecisionToken,\n attestationId: raw.capture.attestationId,\n committed: raw.capture.committed,\n wordingVerdict: raw.capture.wordingVerdict ?? null,\n recordId: raw.capture.recordId ?? null,\n }\n opts.onCaptured?.(result)\n return { token: result.token }\n })\n }\n\n /**\n * 202 D9 — the embedded consent field: the control is Overturo-rendered\n * inside the form, so the element does the capture from its own frame. The\n * field entry (`@overturo/js/field` / `overturo-field.js`) must be loaded;\n * one field per flow per form.\n */\n private attachField(form: HTMLFormElement, opts: FormCaptureOptions): () => void {\n const element = resolveField(form, opts.field!)\n const flow = element.getAttribute(\"flow\")\n if (flow && flow !== opts.flowId) throw new OverturoValidationError(\"the field's flow attribute must match flowId\")\n const duplicate = Array.from(form.querySelectorAll(CONSENT_FIELD_ELEMENT_NAME)).some(\n (el) => el !== element && (el.getAttribute(\"flow\") || opts.flowId) === opts.flowId\n )\n if (duplicate) throw new OverturoValidationError(\"duplicate_field: one consent field per flow per form\")\n return element.attachTo(form, opts, { flowBaseUrl: this.flowBaseUrl, publishableKey: this.publishableKey })\n }\n\n /** Builds the capture body the way `attach` does — exposed for integrators who post themselves. */\n buildCaptureBody(\n form: HTMLFormElement,\n opts: FormCaptureOptions,\n initiallyChecked: Record<string, boolean> = {}\n ): Record<string, unknown> {\n const subject = resolveControl(form, opts.subjectField)\n const external = opts.externalIdField ? resolveControl(form, opts.externalIdField) : null\n const map = opts.map ?? {}\n const body: Record<string, unknown> = {\n flowId: opts.flowId,\n decisions: decisionsFor(form, map, initiallyChecked),\n subject: {\n email: subject?.value?.trim() || undefined,\n externalId: external?.value?.trim() || undefined,\n },\n snapshot: sanitisedSnapshot(form, Object.values(map)),\n pageUrl: typeof window !== \"undefined\" ? window.location.href : undefined,\n formId: form.getAttribute(\"id\") || undefined,\n }\n if (opts.commit) body.commit = true\n if (opts.locale) body.locale = opts.locale\n return body\n }\n\n /**\n * 201 D11 — the digest of each mapped label's text as the person saw it\n * (a 256-bit digest of the trimmed text — the algorithm the forms\n * documentation publishes), so the record can\n * say whether the form's wording matched the wording published for the flow.\n * Needs `labels` (purpose → label selector) and WebCrypto; otherwise nothing is attested.\n */\n async labelDigests(form: HTMLFormElement, opts: FormCaptureOptions): Promise<Record<string, string> | undefined> {\n const labels = opts.labels ?? opts.wording\n if (!labels || typeof crypto === \"undefined\" || !crypto.subtle) return undefined\n const out: Record<string, string> = {}\n for (const [purpose, selector] of Object.entries(labels)) {\n const text = form.querySelector(selector)?.textContent?.trim()\n if (!text) continue\n const digest = await crypto.subtle.digest(\"SHA-256\", new TextEncoder().encode(text)) // audit-public-language: allow (the WebCrypto algorithm identifier)\n out[purpose] = Array.from(new Uint8Array(digest))\n .map((b) => b.toString(16).padStart(2, \"0\"))\n .join(\"\")\n }\n return Object.keys(out).length ? out : undefined\n }\n\n /** 201 D11 — writes the published wording into the labels the integrator names. */\n async writeWording(form: HTMLFormElement, opts: FormCaptureOptions): Promise<void> {\n if (!opts.wording) return\n try {\n const disclosures = await this.decisions.discover({ flowId: opts.flowId, locale: opts.locale })\n for (const [purpose, selector] of Object.entries(opts.wording)) {\n const target = form.querySelector(selector)\n const row = disclosures.purposes.find((p) => p.name === purpose)\n if (target && row) replaceText(target, row.description ?? row.label)\n }\n } catch (e) {\n opts.onError?.(e as Error)\n }\n }\n}\n\n/** Replaces the text of a label without removing a control nested inside it. */\nfunction replaceText(target: Element, text: string): void {\n const textNodes = Array.from(target.childNodes).filter((n) => n.nodeType === Node.TEXT_NODE)\n if (textNodes.length === 0 || target.children.length === 0) {\n if (target.children.length === 0) target.textContent = text\n else target.appendChild(document.createTextNode(\" \" + text))\n return\n }\n textNodes.forEach((n, i) => {\n n.textContent = i === 0 ? text : \"\"\n })\n}\n\nfunction initialCheckedState(form: HTMLFormElement, map: Record<string, string>): Record<string, boolean> {\n const out: Record<string, boolean> = {}\n for (const [purpose, selector] of Object.entries(map)) {\n const control = resolveControl(form, selector)\n if (control) out[purpose] = control.checked\n }\n return out\n}\n\nfunction resolveField(form: HTMLFormElement, field: HTMLElement | string): ConsentFieldLike {\n const el = typeof field === \"string\" ? form.querySelector(field) || document.querySelector(field) : field\n if (!(el instanceof HTMLElement) || el.tagName.toLowerCase() !== CONSENT_FIELD_ELEMENT_NAME) {\n throw new OverturoValidationError(`field must resolve to an <${CONSENT_FIELD_ELEMENT_NAME}> element`)\n }\n if (typeof (el as ConsentFieldLike).attachTo !== \"function\") {\n throw new OverturoValidationError(\"field_entry_not_loaded: load @overturo/js/field (overturo-field.js) before attaching a field\")\n }\n return el as ConsentFieldLike\n}\n","// `signing` facade. `kind: \"signature_request\"` shim over the\n// decisions primitive, for cross-border legal signing. Mirrors the\n// approvals facade: three delivery modes, kind-guarded completion, `deadline`,\n// and an `onCounter` callback (signing carries no proposal payload). Assurance +\n// progress ride the STATE payload; there is no home-country field.\n//\n\nimport type { ApiClient } from \"./api\"\nimport { DECISIONS_API_PATH } from \"./constants\"\nimport type { Decisions } from \"./decisions\"\nimport { OverturoValidationError } from \"./errors\"\nimport type {\n DecisionMode,\n DecisionToken,\n DecisionsHandle,\n SignatureStatePayload,\n SigningNamespace,\n SigningOpenOptions,\n} from \"./types\"\n\nexport class SigningFacade implements SigningNamespace {\n readonly #decisions: Decisions\n readonly #api: ApiClient\n\n constructor(decisions: Decisions, api: ApiClient) {\n this.#decisions = decisions\n this.#api = api\n }\n\n async open(opts: SigningOpenOptions): Promise<DecisionsHandle> {\n if (!opts.signatureRef) {\n throw new OverturoValidationError(\"signatureRef is required\")\n }\n const mode = opts.mode ?? \"embed\"\n const session = await this.#decisions.createSession({\n kind: \"signature_request\",\n subjectRef: opts.signatureRef,\n mode,\n embedOrigin: opts.embedOrigin,\n state: opts.state,\n redirectUri: opts.redirectUri,\n })\n if (mode === \"popup\") {\n return this.#decisions.popup({\n token: session.token,\n onComplete: (outcome) => {\n if (outcome.kind === \"signature_request\") opts.onComplete?.(outcome)\n },\n onCancel: opts.onCancel,\n onError: opts.onError,\n })\n }\n if (mode === \"redirect\") {\n const url = this.#decisions.url({ token: session.token, mode: \"redirect\" })\n window.location.href = url\n return {\n token: session.token,\n mode: \"redirect\",\n destroy: async () => {},\n }\n }\n return this.#decisions.embed({\n token: session.token,\n container: opts.container,\n style: opts.style,\n loading: opts.loading,\n onReady: opts.onReady,\n onState: (_kind, payload) => opts.onState?.(payload as unknown as SignatureStatePayload),\n onComplete: (outcome) => {\n if (outcome.kind === \"signature_request\") opts.onComplete?.(outcome)\n },\n onCancel: opts.onCancel,\n onError: opts.onError,\n onDeadline: opts.onDeadline,\n onCounter: opts.onCounter,\n })\n }\n\n url(opts: { signatureRef: string; mode?: DecisionMode }): string {\n return this.#decisions.url({\n token: opts.signatureRef as unknown as DecisionToken,\n mode: opts.mode,\n })\n }\n\n /**\n * Polls `${decisions_api}/:token` for deadline metadata. Returns the\n * computed remainingMs alongside the absolute deadlineAt for clock-\n * skew tolerance in consumers.\n */\n async deadline(token: DecisionToken): Promise<{ remainingMs: number; deadlineAt: string }> {\n if (!token) {\n throw new OverturoValidationError(\"token is required for deadline\")\n }\n const status = await this.#api.get<{ deadlineAt: string }>(`${DECISIONS_API_PATH}/${token}`)\n return {\n remainingMs: Math.max(0, new Date(status.deadlineAt).getTime() - Date.now()),\n deadlineAt: status.deadlineAt,\n }\n }\n}\n","import { EMBED_STYLE_KEYS } from \"./constants\"\nimport { OverturoValidationError } from \"./errors\"\nimport type { EmbedStyle } from \"./types\"\n\n/**\n * Resolves a container from a CSS selector or HTMLElement.\n * @throws {OverturoValidationError} if the selector doesn't match any element\n */\nexport function resolveContainer(container: string | HTMLElement): HTMLElement {\n if (typeof container === \"string\") {\n const el = document.querySelector<HTMLElement>(container)\n if (!el) {\n throw new OverturoValidationError(`Container element not found: \"${container}\"`)\n }\n return el\n }\n return container\n}\n\n/**\n * Applies whitelisted style overrides to an element.\n * Only keys in EMBED_STYLE_KEYS are applied — all others are ignored.\n */\nexport function applyStyle(el: HTMLElement, defaults: Record<string, string>, overrides?: EmbedStyle): void {\n const style: Record<string, string> = { ...defaults }\n if (overrides) {\n for (const key of EMBED_STYLE_KEYS) {\n if (key in overrides) {\n style[key] = overrides[key as keyof EmbedStyle] as string\n }\n }\n }\n for (const [key, value] of Object.entries(style)) {\n ;(el.style as unknown as Record<string, string>)[key] = value\n }\n}\n","\"use strict\";export const validate = validate29;export default validate29;const schema40 = {\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"$id\":\"https://schemas.overturo.com/postmessage-v2/envelope.json\",\"title\":\"TrustSurface postMessage envelope v2\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"kind\",\"version\",\"payload\",\"ts\",\"message_id\"],\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"overturo:ready\",\"overturo:state\",\"overturo:complete\",\"overturo:cancel\",\"overturo:error\",\"overturo:resize\",\"overturo:deadline\"]},\"kind\":{\"type\":\"string\",\"enum\":[\"consent\",\"approval\",\"signature_request\"]},\"version\":{\"type\":\"integer\",\"const\":2},\"payload\":{\"type\":\"object\",\"additionalProperties\":true},\"ts\":{\"type\":\"string\",\"format\":\"date-time\"},\"message_id\":{\"type\":\"string\",\"pattern\":\"^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$\"}}};const formats0 = require(\"ajv-formats/dist/formats\").fullFormats[\"date-time\"];const pattern4 = new RegExp(\"^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$\", \"u\");function validate29(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL=\"https://schemas.overturo.com/postmessage-v2/envelope.json\" */;let vErrors = null;let errors = 0;const evaluated0 = validate29.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.type === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"type\"},message:\"must have required property '\"+\"type\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.kind === undefined){const err1 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"kind\"},message:\"must have required property '\"+\"kind\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.version === undefined){const err2 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"version\"},message:\"must have required property '\"+\"version\"+\"'\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.payload === undefined){const err3 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"payload\"},message:\"must have required property '\"+\"payload\"+\"'\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.ts === undefined){const err4 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"ts\"},message:\"must have required property '\"+\"ts\"+\"'\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.message_id === undefined){const err5 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"message_id\"},message:\"must have required property '\"+\"message_id\"+\"'\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}for(const key0 in data){if(!((((((key0 === \"type\") || (key0 === \"kind\")) || (key0 === \"version\")) || (key0 === \"payload\")) || (key0 === \"ts\")) || (key0 === \"message_id\"))){const err6 = {instancePath,schemaPath:\"#/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key0},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.type !== undefined){let data0 = data.type;if(typeof data0 !== \"string\"){const err7 = {instancePath:instancePath+\"/type\",schemaPath:\"#/properties/type/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(!(((((((data0 === \"overturo:ready\") || (data0 === \"overturo:state\")) || (data0 === \"overturo:complete\")) || (data0 === \"overturo:cancel\")) || (data0 === \"overturo:error\")) || (data0 === \"overturo:resize\")) || (data0 === \"overturo:deadline\"))){const err8 = {instancePath:instancePath+\"/type\",schemaPath:\"#/properties/type/enum\",keyword:\"enum\",params:{allowedValues: schema40.properties.type.enum},message:\"must be equal to one of the allowed values\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.kind !== undefined){let data1 = data.kind;if(typeof data1 !== \"string\"){const err9 = {instancePath:instancePath+\"/kind\",schemaPath:\"#/properties/kind/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}if(!(((data1 === \"consent\") || (data1 === \"approval\")) || (data1 === \"signature_request\"))){const err10 = {instancePath:instancePath+\"/kind\",schemaPath:\"#/properties/kind/enum\",keyword:\"enum\",params:{allowedValues: schema40.properties.kind.enum},message:\"must be equal to one of the allowed values\"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(data.version !== undefined){let data2 = data.version;if(!((typeof data2 == \"number\") && (!(data2 % 1) && !isNaN(data2)))){const err11 = {instancePath:instancePath+\"/version\",schemaPath:\"#/properties/version/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}if(2 !== data2){const err12 = {instancePath:instancePath+\"/version\",schemaPath:\"#/properties/version/const\",keyword:\"const\",params:{allowedValue: 2},message:\"must be equal to constant\"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.payload !== undefined){let data3 = data.payload;if(data3 && typeof data3 == \"object\" && !Array.isArray(data3)){}else {const err13 = {instancePath:instancePath+\"/payload\",schemaPath:\"#/properties/payload/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data.ts !== undefined){let data4 = data.ts;if(typeof data4 === \"string\"){if(!(formats0.validate(data4))){const err14 = {instancePath:instancePath+\"/ts\",schemaPath:\"#/properties/ts/format\",keyword:\"format\",params:{format: \"date-time\"},message:\"must match format \\\"\"+\"date-time\"+\"\\\"\"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}else {const err15 = {instancePath:instancePath+\"/ts\",schemaPath:\"#/properties/ts/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}if(data.message_id !== undefined){let data5 = data.message_id;if(typeof data5 === \"string\"){if(!pattern4.test(data5)){const err16 = {instancePath:instancePath+\"/message_id\",schemaPath:\"#/properties/message_id/pattern\",keyword:\"pattern\",params:{pattern: \"^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$\"},message:\"must match pattern \\\"\"+\"^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$\"+\"\\\"\"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}else {const err17 = {instancePath:instancePath+\"/message_id\",schemaPath:\"#/properties/message_id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}}else {const err18 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}validate29.errors = vErrors;return errors === 0;}validate29.evaluated = {\"props\":true,\"dynamicProps\":false,\"dynamicItems\":false};","\"use strict\";export const validate = validate30;export default validate30;const schema41 = {\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"$id\":\"https://schemas.overturo.com/postmessage-v2/ready.json\",\"title\":\"READY payload (kind-agnostic; branding fields vary per application)\",\"type\":\"object\",\"additionalProperties\":true,\"required\":[\"kind\",\"session_token\",\"deadline_at\",\"branding\",\"mode\",\"locale\"],\"properties\":{\"kind\":{\"type\":\"string\",\"enum\":[\"consent\",\"approval\",\"signature_request\"]},\"session_token\":{\"type\":\"string\",\"minLength\":43,\"maxLength\":43},\"deadline_at\":{\"type\":[\"string\",\"null\"],\"format\":\"date-time\"},\"branding\":{\"type\":\"object\",\"additionalProperties\":true,\"required\":[\"application_name\"],\"properties\":{\"application_name\":{\"type\":\"string\"},\"logo_url\":{\"type\":[\"string\",\"null\"]},\"primary_color\":{\"type\":[\"string\",\"null\"]}}},\"mode\":{\"type\":\"string\",\"enum\":[\"embed\",\"popup\",\"redirect\"]},\"locale\":{\"type\":\"string\"}}};const func1 = require(\"ajv/dist/runtime/ucs2length\").default;const formats0 = require(\"ajv-formats/dist/formats\").fullFormats[\"date-time\"];function validate30(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL=\"https://schemas.overturo.com/postmessage-v2/ready.json\" */;let vErrors = null;let errors = 0;const evaluated0 = validate30.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.kind === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"kind\"},message:\"must have required property '\"+\"kind\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.session_token === undefined){const err1 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"session_token\"},message:\"must have required property '\"+\"session_token\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.deadline_at === undefined){const err2 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"deadline_at\"},message:\"must have required property '\"+\"deadline_at\"+\"'\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.branding === undefined){const err3 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"branding\"},message:\"must have required property '\"+\"branding\"+\"'\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.mode === undefined){const err4 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"mode\"},message:\"must have required property '\"+\"mode\"+\"'\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.locale === undefined){const err5 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"locale\"},message:\"must have required property '\"+\"locale\"+\"'\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(data.kind !== undefined){let data0 = data.kind;if(typeof data0 !== \"string\"){const err6 = {instancePath:instancePath+\"/kind\",schemaPath:\"#/properties/kind/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(!(((data0 === \"consent\") || (data0 === \"approval\")) || (data0 === \"signature_request\"))){const err7 = {instancePath:instancePath+\"/kind\",schemaPath:\"#/properties/kind/enum\",keyword:\"enum\",params:{allowedValues: schema41.properties.kind.enum},message:\"must be equal to one of the allowed values\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.session_token !== undefined){let data1 = data.session_token;if(typeof data1 === \"string\"){if(func1(data1) > 43){const err8 = {instancePath:instancePath+\"/session_token\",schemaPath:\"#/properties/session_token/maxLength\",keyword:\"maxLength\",params:{limit: 43},message:\"must NOT have more than 43 characters\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}if(func1(data1) < 43){const err9 = {instancePath:instancePath+\"/session_token\",schemaPath:\"#/properties/session_token/minLength\",keyword:\"minLength\",params:{limit: 43},message:\"must NOT have fewer than 43 characters\"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}else {const err10 = {instancePath:instancePath+\"/session_token\",schemaPath:\"#/properties/session_token/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(data.deadline_at !== undefined){let data2 = data.deadline_at;if((typeof data2 !== \"string\") && (data2 !== null)){const err11 = {instancePath:instancePath+\"/deadline_at\",schemaPath:\"#/properties/deadline_at/type\",keyword:\"type\",params:{type: schema41.properties.deadline_at.type},message:\"must be string,null\"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}if(typeof data2 === \"string\"){if(!(formats0.validate(data2))){const err12 = {instancePath:instancePath+\"/deadline_at\",schemaPath:\"#/properties/deadline_at/format\",keyword:\"format\",params:{format: \"date-time\"},message:\"must match format \\\"\"+\"date-time\"+\"\\\"\"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}}if(data.branding !== undefined){let data3 = data.branding;if(data3 && typeof data3 == \"object\" && !Array.isArray(data3)){if(data3.application_name === undefined){const err13 = {instancePath:instancePath+\"/branding\",schemaPath:\"#/properties/branding/required\",keyword:\"required\",params:{missingProperty: \"application_name\"},message:\"must have required property '\"+\"application_name\"+\"'\"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}if(data3.application_name !== undefined){if(typeof data3.application_name !== \"string\"){const err14 = {instancePath:instancePath+\"/branding/application_name\",schemaPath:\"#/properties/branding/properties/application_name/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}if(data3.logo_url !== undefined){let data5 = data3.logo_url;if((typeof data5 !== \"string\") && (data5 !== null)){const err15 = {instancePath:instancePath+\"/branding/logo_url\",schemaPath:\"#/properties/branding/properties/logo_url/type\",keyword:\"type\",params:{type: schema41.properties.branding.properties.logo_url.type},message:\"must be string,null\"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}if(data3.primary_color !== undefined){let data6 = data3.primary_color;if((typeof data6 !== \"string\") && (data6 !== null)){const err16 = {instancePath:instancePath+\"/branding/primary_color\",schemaPath:\"#/properties/branding/properties/primary_color/type\",keyword:\"type\",params:{type: schema41.properties.branding.properties.primary_color.type},message:\"must be string,null\"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}}else {const err17 = {instancePath:instancePath+\"/branding\",schemaPath:\"#/properties/branding/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}if(data.mode !== undefined){let data7 = data.mode;if(typeof data7 !== \"string\"){const err18 = {instancePath:instancePath+\"/mode\",schemaPath:\"#/properties/mode/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}if(!(((data7 === \"embed\") || (data7 === \"popup\")) || (data7 === \"redirect\"))){const err19 = {instancePath:instancePath+\"/mode\",schemaPath:\"#/properties/mode/enum\",keyword:\"enum\",params:{allowedValues: schema41.properties.mode.enum},message:\"must be equal to one of the allowed values\"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}}if(data.locale !== undefined){if(typeof data.locale !== \"string\"){const err20 = {instancePath:instancePath+\"/locale\",schemaPath:\"#/properties/locale/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}}else {const err21 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}validate30.errors = vErrors;return errors === 0;}validate30.evaluated = {\"props\":true,\"dynamicProps\":false,\"dynamicItems\":false};","\"use strict\";export const validate = validate31;export default validate31;const schema42 = {\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"$id\":\"https://schemas.overturo.com/postmessage-v2/resize.json\",\"title\":\"RESIZE payload (kind-agnostic)\",\"type\":\"object\",\"additionalProperties\":true,\"required\":[\"height\"],\"properties\":{\"height\":{\"type\":\"integer\",\"minimum\":0}}};function validate31(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL=\"https://schemas.overturo.com/postmessage-v2/resize.json\" */;let vErrors = null;let errors = 0;const evaluated0 = validate31.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.height === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"height\"},message:\"must have required property '\"+\"height\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.height !== undefined){let data0 = data.height;if(!((typeof data0 == \"number\") && (!(data0 % 1) && !isNaN(data0)))){const err1 = {instancePath:instancePath+\"/height\",schemaPath:\"#/properties/height/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(typeof data0 == \"number\"){if(data0 < 0 || isNaN(data0)){const err2 = {instancePath:instancePath+\"/height\",schemaPath:\"#/properties/height/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: 0},message:\"must be >= 0\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}}}else {const err3 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}validate31.errors = vErrors;return errors === 0;}validate31.evaluated = {\"props\":true,\"dynamicProps\":false,\"dynamicItems\":false};","\"use strict\";export const validate = validate24;export default validate24;const schema35 = {\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"$id\":\"https://schemas.overturo.com/postmessage-v2/cancel.json\",\"title\":\"CANCEL payload (kind-agnostic — bidirectional)\",\"type\":\"object\",\"additionalProperties\":true,\"required\":[\"reason\",\"cancelled_by\"],\"properties\":{\"reason\":{\"type\":\"string\",\"enum\":[\"user_declined\",\"principal_navigated_away\",\"host_requested\",\"system_revoked\"]},\"cancelled_by\":{\"type\":\"string\",\"enum\":[\"principal\",\"host\",\"system\"]}}};function validate24(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL=\"https://schemas.overturo.com/postmessage-v2/cancel.json\" */;let vErrors = null;let errors = 0;const evaluated0 = validate24.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.reason === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"reason\"},message:\"must have required property '\"+\"reason\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.cancelled_by === undefined){const err1 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"cancelled_by\"},message:\"must have required property '\"+\"cancelled_by\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.reason !== undefined){let data0 = data.reason;if(typeof data0 !== \"string\"){const err2 = {instancePath:instancePath+\"/reason\",schemaPath:\"#/properties/reason/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(!((((data0 === \"user_declined\") || (data0 === \"principal_navigated_away\")) || (data0 === \"host_requested\")) || (data0 === \"system_revoked\"))){const err3 = {instancePath:instancePath+\"/reason\",schemaPath:\"#/properties/reason/enum\",keyword:\"enum\",params:{allowedValues: schema35.properties.reason.enum},message:\"must be equal to one of the allowed values\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.cancelled_by !== undefined){let data1 = data.cancelled_by;if(typeof data1 !== \"string\"){const err4 = {instancePath:instancePath+\"/cancelled_by\",schemaPath:\"#/properties/cancelled_by/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(!(((data1 === \"principal\") || (data1 === \"host\")) || (data1 === \"system\"))){const err5 = {instancePath:instancePath+\"/cancelled_by\",schemaPath:\"#/properties/cancelled_by/enum\",keyword:\"enum\",params:{allowedValues: schema35.properties.cancelled_by.enum},message:\"must be equal to one of the allowed values\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}}else {const err6 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}validate24.errors = vErrors;return errors === 0;}validate24.evaluated = {\"props\":true,\"dynamicProps\":false,\"dynamicItems\":false};","\"use strict\";export const validate = validate28;export default validate28;const schema39 = {\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"$id\":\"https://schemas.overturo.com/postmessage-v2/consent/state.json\",\"title\":\"consent STATE payload\",\"type\":\"object\",\"additionalProperties\":true,\"required\":[\"from\",\"to\",\"step_index\",\"total_steps\"],\"properties\":{\"from\":{\"type\":[\"string\",\"null\"]},\"to\":{\"type\":\"string\"},\"step_index\":{\"type\":\"integer\",\"minimum\":0},\"total_steps\":{\"type\":\"integer\",\"minimum\":1},\"kind_payload\":{\"type\":\"object\",\"additionalProperties\":true}}};function validate28(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL=\"https://schemas.overturo.com/postmessage-v2/consent/state.json\" */;let vErrors = null;let errors = 0;const evaluated0 = validate28.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.from === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"from\"},message:\"must have required property '\"+\"from\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.to === undefined){const err1 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"to\"},message:\"must have required property '\"+\"to\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.step_index === undefined){const err2 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"step_index\"},message:\"must have required property '\"+\"step_index\"+\"'\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.total_steps === undefined){const err3 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"total_steps\"},message:\"must have required property '\"+\"total_steps\"+\"'\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.from !== undefined){let data0 = data.from;if((typeof data0 !== \"string\") && (data0 !== null)){const err4 = {instancePath:instancePath+\"/from\",schemaPath:\"#/properties/from/type\",keyword:\"type\",params:{type: schema39.properties.from.type},message:\"must be string,null\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.to !== undefined){if(typeof data.to !== \"string\"){const err5 = {instancePath:instancePath+\"/to\",schemaPath:\"#/properties/to/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}if(data.step_index !== undefined){let data2 = data.step_index;if(!((typeof data2 == \"number\") && (!(data2 % 1) && !isNaN(data2)))){const err6 = {instancePath:instancePath+\"/step_index\",schemaPath:\"#/properties/step_index/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(typeof data2 == \"number\"){if(data2 < 0 || isNaN(data2)){const err7 = {instancePath:instancePath+\"/step_index\",schemaPath:\"#/properties/step_index/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: 0},message:\"must be >= 0\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}}if(data.total_steps !== undefined){let data3 = data.total_steps;if(!((typeof data3 == \"number\") && (!(data3 % 1) && !isNaN(data3)))){const err8 = {instancePath:instancePath+\"/total_steps\",schemaPath:\"#/properties/total_steps/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}if(typeof data3 == \"number\"){if(data3 < 1 || isNaN(data3)){const err9 = {instancePath:instancePath+\"/total_steps\",schemaPath:\"#/properties/total_steps/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: 1},message:\"must be >= 1\"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}}if(data.kind_payload !== undefined){let data4 = data.kind_payload;if(data4 && typeof data4 == \"object\" && !Array.isArray(data4)){}else {const err10 = {instancePath:instancePath+\"/kind_payload\",schemaPath:\"#/properties/kind_payload/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}}else {const err11 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}validate28.errors = vErrors;return errors === 0;}validate28.evaluated = {\"props\":true,\"dynamicProps\":false,\"dynamicItems\":false};","\"use strict\";export const validate = validate25;export default validate25;const schema36 = {\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"$id\":\"https://schemas.overturo.com/postmessage-v2/consent/complete.json\",\"title\":\"consent COMPLETE payload\",\"type\":\"object\",\"additionalProperties\":true,\"required\":[\"outcome\",\"completed_at\"],\"properties\":{\"outcome\":{\"type\":\"string\",\"enum\":[\"granted\",\"declined\"]},\"exchange_token\":{\"type\":[\"string\",\"null\"],\"description\":\"Consent token the host exchanges via POST /api/v1/decisions/:token/exchange\"},\"completed_at\":{\"type\":\"string\",\"format\":\"date-time\"}}};const formats0 = require(\"ajv-formats/dist/formats\").fullFormats[\"date-time\"];function validate25(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL=\"https://schemas.overturo.com/postmessage-v2/consent/complete.json\" */;let vErrors = null;let errors = 0;const evaluated0 = validate25.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.outcome === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"outcome\"},message:\"must have required property '\"+\"outcome\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.completed_at === undefined){const err1 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"completed_at\"},message:\"must have required property '\"+\"completed_at\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.outcome !== undefined){let data0 = data.outcome;if(typeof data0 !== \"string\"){const err2 = {instancePath:instancePath+\"/outcome\",schemaPath:\"#/properties/outcome/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(!((data0 === \"granted\") || (data0 === \"declined\"))){const err3 = {instancePath:instancePath+\"/outcome\",schemaPath:\"#/properties/outcome/enum\",keyword:\"enum\",params:{allowedValues: schema36.properties.outcome.enum},message:\"must be equal to one of the allowed values\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.exchange_token !== undefined){let data1 = data.exchange_token;if((typeof data1 !== \"string\") && (data1 !== null)){const err4 = {instancePath:instancePath+\"/exchange_token\",schemaPath:\"#/properties/exchange_token/type\",keyword:\"type\",params:{type: schema36.properties.exchange_token.type},message:\"must be string,null\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.completed_at !== undefined){let data2 = data.completed_at;if(typeof data2 === \"string\"){if(!(formats0.validate(data2))){const err5 = {instancePath:instancePath+\"/completed_at\",schemaPath:\"#/properties/completed_at/format\",keyword:\"format\",params:{format: \"date-time\"},message:\"must match format \\\"\"+\"date-time\"+\"\\\"\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+\"/completed_at\",schemaPath:\"#/properties/completed_at/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}}else {const err7 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate25.errors = vErrors;return errors === 0;}validate25.evaluated = {\"props\":true,\"dynamicProps\":false,\"dynamicItems\":false};","\"use strict\";export const validate = validate27;export default validate27;const schema38 = {\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"$id\":\"https://schemas.overturo.com/postmessage-v2/consent/error.json\",\"title\":\"consent ERROR payload\",\"type\":\"object\",\"additionalProperties\":true,\"required\":[\"code\",\"message\",\"fatal\"],\"properties\":{\"code\":{\"type\":\"string\"},\"message\":{\"type\":\"string\"},\"fatal\":{\"type\":\"boolean\"},\"recoverable_via\":{\"type\":[\"string\",\"null\"],\"enum\":[\"reload\",\"new_session\",null]}}};function validate27(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL=\"https://schemas.overturo.com/postmessage-v2/consent/error.json\" */;let vErrors = null;let errors = 0;const evaluated0 = validate27.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.code === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"code\"},message:\"must have required property '\"+\"code\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.message === undefined){const err1 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"message\"},message:\"must have required property '\"+\"message\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.fatal === undefined){const err2 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"fatal\"},message:\"must have required property '\"+\"fatal\"+\"'\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.code !== undefined){if(typeof data.code !== \"string\"){const err3 = {instancePath:instancePath+\"/code\",schemaPath:\"#/properties/code/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.message !== undefined){if(typeof data.message !== \"string\"){const err4 = {instancePath:instancePath+\"/message\",schemaPath:\"#/properties/message/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.fatal !== undefined){if(typeof data.fatal !== \"boolean\"){const err5 = {instancePath:instancePath+\"/fatal\",schemaPath:\"#/properties/fatal/type\",keyword:\"type\",params:{type: \"boolean\"},message:\"must be boolean\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}if(data.recoverable_via !== undefined){let data3 = data.recoverable_via;if((typeof data3 !== \"string\") && (data3 !== null)){const err6 = {instancePath:instancePath+\"/recoverable_via\",schemaPath:\"#/properties/recoverable_via/type\",keyword:\"type\",params:{type: schema38.properties.recoverable_via.type},message:\"must be string,null\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(!(((data3 === \"reload\") || (data3 === \"new_session\")) || (data3 === null))){const err7 = {instancePath:instancePath+\"/recoverable_via\",schemaPath:\"#/properties/recoverable_via/enum\",keyword:\"enum\",params:{allowedValues: schema38.properties.recoverable_via.enum},message:\"must be equal to one of the allowed values\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}}else {const err8 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}validate27.errors = vErrors;return errors === 0;}validate27.evaluated = {\"props\":true,\"dynamicProps\":false,\"dynamicItems\":false};","\"use strict\";export const validate = validate26;export default validate26;const schema37 = {\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"$id\":\"https://schemas.overturo.com/postmessage-v2/consent/deadline.json\",\"title\":\"consent DEADLINE payload\",\"type\":\"object\",\"additionalProperties\":true,\"required\":[\"remaining_seconds\",\"level\",\"deadline_at\"],\"properties\":{\"remaining_seconds\":{\"type\":\"integer\",\"minimum\":0},\"level\":{\"type\":\"string\",\"enum\":[\"warning\",\"expired\"]},\"deadline_at\":{\"type\":\"string\",\"format\":\"date-time\"}}};const formats0 = require(\"ajv-formats/dist/formats\").fullFormats[\"date-time\"];function validate26(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL=\"https://schemas.overturo.com/postmessage-v2/consent/deadline.json\" */;let vErrors = null;let errors = 0;const evaluated0 = validate26.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.remaining_seconds === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"remaining_seconds\"},message:\"must have required property '\"+\"remaining_seconds\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.level === undefined){const err1 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"level\"},message:\"must have required property '\"+\"level\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.deadline_at === undefined){const err2 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"deadline_at\"},message:\"must have required property '\"+\"deadline_at\"+\"'\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.remaining_seconds !== undefined){let data0 = data.remaining_seconds;if(!((typeof data0 == \"number\") && (!(data0 % 1) && !isNaN(data0)))){const err3 = {instancePath:instancePath+\"/remaining_seconds\",schemaPath:\"#/properties/remaining_seconds/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(typeof data0 == \"number\"){if(data0 < 0 || isNaN(data0)){const err4 = {instancePath:instancePath+\"/remaining_seconds\",schemaPath:\"#/properties/remaining_seconds/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: 0},message:\"must be >= 0\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}}if(data.level !== undefined){let data1 = data.level;if(typeof data1 !== \"string\"){const err5 = {instancePath:instancePath+\"/level\",schemaPath:\"#/properties/level/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(!((data1 === \"warning\") || (data1 === \"expired\"))){const err6 = {instancePath:instancePath+\"/level\",schemaPath:\"#/properties/level/enum\",keyword:\"enum\",params:{allowedValues: schema37.properties.level.enum},message:\"must be equal to one of the allowed values\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.deadline_at !== undefined){let data2 = data.deadline_at;if(typeof data2 === \"string\"){if(!(formats0.validate(data2))){const err7 = {instancePath:instancePath+\"/deadline_at\",schemaPath:\"#/properties/deadline_at/format\",keyword:\"format\",params:{format: \"date-time\"},message:\"must match format \\\"\"+\"date-time\"+\"\\\"\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}else {const err8 = {instancePath:instancePath+\"/deadline_at\",schemaPath:\"#/properties/deadline_at/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}}else {const err9 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}validate26.errors = vErrors;return errors === 0;}validate26.evaluated = {\"props\":true,\"dynamicProps\":false,\"dynamicItems\":false};","\"use strict\";export const validate = validate23;export default validate23;const schema34 = {\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"$id\":\"https://schemas.overturo.com/postmessage-v2/approval/state.json\",\"title\":\"approval STATE payload\",\"type\":\"object\",\"additionalProperties\":true,\"required\":[\"from\",\"to\",\"kind_payload\"],\"properties\":{\"from\":{\"type\":[\"string\",\"null\"]},\"to\":{\"type\":\"string\",\"enum\":[\"pending\",\"opened\",\"in_progress\",\"approved\",\"denied\",\"expired\"]},\"kind_payload\":{\"type\":\"object\",\"additionalProperties\":true,\"required\":[\"agent_id\",\"action_class\",\"scope_invoked\"],\"properties\":{\"agent_id\":{\"type\":\"string\"},\"action_class\":{\"type\":\"string\"},\"bounded_authority\":{\"type\":\"object\",\"additionalProperties\":true},\"scope_invoked\":{\"type\":\"string\"},\"value_invoked\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":true}}}}};function validate23(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL=\"https://schemas.overturo.com/postmessage-v2/approval/state.json\" */;let vErrors = null;let errors = 0;const evaluated0 = validate23.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.from === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"from\"},message:\"must have required property '\"+\"from\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.to === undefined){const err1 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"to\"},message:\"must have required property '\"+\"to\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.kind_payload === undefined){const err2 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"kind_payload\"},message:\"must have required property '\"+\"kind_payload\"+\"'\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.from !== undefined){let data0 = data.from;if((typeof data0 !== \"string\") && (data0 !== null)){const err3 = {instancePath:instancePath+\"/from\",schemaPath:\"#/properties/from/type\",keyword:\"type\",params:{type: schema34.properties.from.type},message:\"must be string,null\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.to !== undefined){let data1 = data.to;if(typeof data1 !== \"string\"){const err4 = {instancePath:instancePath+\"/to\",schemaPath:\"#/properties/to/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(!((((((data1 === \"pending\") || (data1 === \"opened\")) || (data1 === \"in_progress\")) || (data1 === \"approved\")) || (data1 === \"denied\")) || (data1 === \"expired\"))){const err5 = {instancePath:instancePath+\"/to\",schemaPath:\"#/properties/to/enum\",keyword:\"enum\",params:{allowedValues: schema34.properties.to.enum},message:\"must be equal to one of the allowed values\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}if(data.kind_payload !== undefined){let data2 = data.kind_payload;if(data2 && typeof data2 == \"object\" && !Array.isArray(data2)){if(data2.agent_id === undefined){const err6 = {instancePath:instancePath+\"/kind_payload\",schemaPath:\"#/properties/kind_payload/required\",keyword:\"required\",params:{missingProperty: \"agent_id\"},message:\"must have required property '\"+\"agent_id\"+\"'\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(data2.action_class === undefined){const err7 = {instancePath:instancePath+\"/kind_payload\",schemaPath:\"#/properties/kind_payload/required\",keyword:\"required\",params:{missingProperty: \"action_class\"},message:\"must have required property '\"+\"action_class\"+\"'\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(data2.scope_invoked === undefined){const err8 = {instancePath:instancePath+\"/kind_payload\",schemaPath:\"#/properties/kind_payload/required\",keyword:\"required\",params:{missingProperty: \"scope_invoked\"},message:\"must have required property '\"+\"scope_invoked\"+\"'\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}if(data2.agent_id !== undefined){if(typeof data2.agent_id !== \"string\"){const err9 = {instancePath:instancePath+\"/kind_payload/agent_id\",schemaPath:\"#/properties/kind_payload/properties/agent_id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data2.action_class !== undefined){if(typeof data2.action_class !== \"string\"){const err10 = {instancePath:instancePath+\"/kind_payload/action_class\",schemaPath:\"#/properties/kind_payload/properties/action_class/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(data2.bounded_authority !== undefined){let data5 = data2.bounded_authority;if(data5 && typeof data5 == \"object\" && !Array.isArray(data5)){}else {const err11 = {instancePath:instancePath+\"/kind_payload/bounded_authority\",schemaPath:\"#/properties/kind_payload/properties/bounded_authority/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}if(data2.scope_invoked !== undefined){if(typeof data2.scope_invoked !== \"string\"){const err12 = {instancePath:instancePath+\"/kind_payload/scope_invoked\",schemaPath:\"#/properties/kind_payload/properties/scope_invoked/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data2.value_invoked !== undefined){let data7 = data2.value_invoked;if((!(data7 && typeof data7 == \"object\" && !Array.isArray(data7))) && (data7 !== null)){const err13 = {instancePath:instancePath+\"/kind_payload/value_invoked\",schemaPath:\"#/properties/kind_payload/properties/value_invoked/type\",keyword:\"type\",params:{type: schema34.properties.kind_payload.properties.value_invoked.type},message:\"must be object,null\"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}}else {const err14 = {instancePath:instancePath+\"/kind_payload\",schemaPath:\"#/properties/kind_payload/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}}else {const err15 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}validate23.errors = vErrors;return errors === 0;}validate23.evaluated = {\"props\":true,\"dynamicProps\":false,\"dynamicItems\":false};","\"use strict\";export const validate = validate20;export default validate20;const schema31 = {\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"$id\":\"https://schemas.overturo.com/postmessage-v2/approval/complete.json\",\"title\":\"approval COMPLETE payload\",\"type\":\"object\",\"additionalProperties\":true,\"required\":[\"outcome\",\"completed_at\"],\"properties\":{\"outcome\":{\"type\":\"string\",\"enum\":[\"approved\",\"denied\"]},\"exchange_token\":{\"type\":[\"string\",\"null\"],\"description\":\"Approval-decision exchange token; host calls POST /api/v1/decisions/:token/exchange\"},\"completed_at\":{\"type\":\"string\",\"format\":\"date-time\"}}};const formats0 = require(\"ajv-formats/dist/formats\").fullFormats[\"date-time\"];function validate20(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL=\"https://schemas.overturo.com/postmessage-v2/approval/complete.json\" */;let vErrors = null;let errors = 0;const evaluated0 = validate20.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.outcome === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"outcome\"},message:\"must have required property '\"+\"outcome\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.completed_at === undefined){const err1 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"completed_at\"},message:\"must have required property '\"+\"completed_at\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.outcome !== undefined){let data0 = data.outcome;if(typeof data0 !== \"string\"){const err2 = {instancePath:instancePath+\"/outcome\",schemaPath:\"#/properties/outcome/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(!((data0 === \"approved\") || (data0 === \"denied\"))){const err3 = {instancePath:instancePath+\"/outcome\",schemaPath:\"#/properties/outcome/enum\",keyword:\"enum\",params:{allowedValues: schema31.properties.outcome.enum},message:\"must be equal to one of the allowed values\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.exchange_token !== undefined){let data1 = data.exchange_token;if((typeof data1 !== \"string\") && (data1 !== null)){const err4 = {instancePath:instancePath+\"/exchange_token\",schemaPath:\"#/properties/exchange_token/type\",keyword:\"type\",params:{type: schema31.properties.exchange_token.type},message:\"must be string,null\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.completed_at !== undefined){let data2 = data.completed_at;if(typeof data2 === \"string\"){if(!(formats0.validate(data2))){const err5 = {instancePath:instancePath+\"/completed_at\",schemaPath:\"#/properties/completed_at/format\",keyword:\"format\",params:{format: \"date-time\"},message:\"must match format \\\"\"+\"date-time\"+\"\\\"\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+\"/completed_at\",schemaPath:\"#/properties/completed_at/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}}else {const err7 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate20.errors = vErrors;return errors === 0;}validate20.evaluated = {\"props\":true,\"dynamicProps\":false,\"dynamicItems\":false};","\"use strict\";export const validate = validate22;export default validate22;const schema33 = {\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"$id\":\"https://schemas.overturo.com/postmessage-v2/approval/error.json\",\"title\":\"approval ERROR payload\",\"type\":\"object\",\"additionalProperties\":true,\"required\":[\"code\",\"message\",\"fatal\"],\"properties\":{\"code\":{\"type\":\"string\"},\"message\":{\"type\":\"string\"},\"fatal\":{\"type\":\"boolean\"},\"recoverable_via\":{\"type\":[\"string\",\"null\"],\"enum\":[\"reload\",\"new_session\",null]}}};function validate22(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL=\"https://schemas.overturo.com/postmessage-v2/approval/error.json\" */;let vErrors = null;let errors = 0;const evaluated0 = validate22.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.code === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"code\"},message:\"must have required property '\"+\"code\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.message === undefined){const err1 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"message\"},message:\"must have required property '\"+\"message\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.fatal === undefined){const err2 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"fatal\"},message:\"must have required property '\"+\"fatal\"+\"'\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.code !== undefined){if(typeof data.code !== \"string\"){const err3 = {instancePath:instancePath+\"/code\",schemaPath:\"#/properties/code/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.message !== undefined){if(typeof data.message !== \"string\"){const err4 = {instancePath:instancePath+\"/message\",schemaPath:\"#/properties/message/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.fatal !== undefined){if(typeof data.fatal !== \"boolean\"){const err5 = {instancePath:instancePath+\"/fatal\",schemaPath:\"#/properties/fatal/type\",keyword:\"type\",params:{type: \"boolean\"},message:\"must be boolean\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}if(data.recoverable_via !== undefined){let data3 = data.recoverable_via;if((typeof data3 !== \"string\") && (data3 !== null)){const err6 = {instancePath:instancePath+\"/recoverable_via\",schemaPath:\"#/properties/recoverable_via/type\",keyword:\"type\",params:{type: schema33.properties.recoverable_via.type},message:\"must be string,null\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(!(((data3 === \"reload\") || (data3 === \"new_session\")) || (data3 === null))){const err7 = {instancePath:instancePath+\"/recoverable_via\",schemaPath:\"#/properties/recoverable_via/enum\",keyword:\"enum\",params:{allowedValues: schema33.properties.recoverable_via.enum},message:\"must be equal to one of the allowed values\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}}else {const err8 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}validate22.errors = vErrors;return errors === 0;}validate22.evaluated = {\"props\":true,\"dynamicProps\":false,\"dynamicItems\":false};","\"use strict\";export const validate = validate21;export default validate21;const schema32 = {\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"$id\":\"https://schemas.overturo.com/postmessage-v2/approval/deadline.json\",\"title\":\"approval DEADLINE payload\",\"type\":\"object\",\"additionalProperties\":true,\"required\":[\"remaining_seconds\",\"level\",\"deadline_at\"],\"properties\":{\"remaining_seconds\":{\"type\":\"integer\",\"minimum\":0},\"level\":{\"type\":\"string\",\"enum\":[\"warning\",\"expired\"]},\"deadline_at\":{\"type\":\"string\",\"format\":\"date-time\"}}};const formats0 = require(\"ajv-formats/dist/formats\").fullFormats[\"date-time\"];function validate21(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL=\"https://schemas.overturo.com/postmessage-v2/approval/deadline.json\" */;let vErrors = null;let errors = 0;const evaluated0 = validate21.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.remaining_seconds === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"remaining_seconds\"},message:\"must have required property '\"+\"remaining_seconds\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.level === undefined){const err1 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"level\"},message:\"must have required property '\"+\"level\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.deadline_at === undefined){const err2 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"deadline_at\"},message:\"must have required property '\"+\"deadline_at\"+\"'\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.remaining_seconds !== undefined){let data0 = data.remaining_seconds;if(!((typeof data0 == \"number\") && (!(data0 % 1) && !isNaN(data0)))){const err3 = {instancePath:instancePath+\"/remaining_seconds\",schemaPath:\"#/properties/remaining_seconds/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(typeof data0 == \"number\"){if(data0 < 0 || isNaN(data0)){const err4 = {instancePath:instancePath+\"/remaining_seconds\",schemaPath:\"#/properties/remaining_seconds/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: 0},message:\"must be >= 0\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}}if(data.level !== undefined){let data1 = data.level;if(typeof data1 !== \"string\"){const err5 = {instancePath:instancePath+\"/level\",schemaPath:\"#/properties/level/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(!((data1 === \"warning\") || (data1 === \"expired\"))){const err6 = {instancePath:instancePath+\"/level\",schemaPath:\"#/properties/level/enum\",keyword:\"enum\",params:{allowedValues: schema32.properties.level.enum},message:\"must be equal to one of the allowed values\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.deadline_at !== undefined){let data2 = data.deadline_at;if(typeof data2 === \"string\"){if(!(formats0.validate(data2))){const err7 = {instancePath:instancePath+\"/deadline_at\",schemaPath:\"#/properties/deadline_at/format\",keyword:\"format\",params:{format: \"date-time\"},message:\"must match format \\\"\"+\"date-time\"+\"\\\"\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}else {const err8 = {instancePath:instancePath+\"/deadline_at\",schemaPath:\"#/properties/deadline_at/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}}else {const err9 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}validate21.errors = vErrors;return errors === 0;}validate21.evaluated = {\"props\":true,\"dynamicProps\":false,\"dynamicItems\":false};","\"use strict\";export const validate = validate35;export default validate35;const schema46 = {\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"$id\":\"https://schemas.overturo.com/postmessage-v2/signature/state.json\",\"title\":\"signature STATE payload\",\"type\":\"object\",\"additionalProperties\":true,\"required\":[\"from\",\"to\",\"kind_payload\"],\"properties\":{\"from\":{\"type\":[\"string\",\"null\"]},\"to\":{\"type\":\"string\",\"enum\":[\"pending\",\"opened\",\"in_progress\",\"signed\",\"declined\",\"expired\"]},\"kind_payload\":{\"type\":\"object\",\"additionalProperties\":true,\"required\":[\"required_assurance_level\"],\"properties\":{\"required_assurance_level\":{\"type\":\"string\",\"enum\":[\"integrity_proof\",\"advanced\",\"qualified\"]},\"participant_role\":{\"type\":[\"string\",\"null\"]}}}}};function validate35(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL=\"https://schemas.overturo.com/postmessage-v2/signature/state.json\" */;let vErrors = null;let errors = 0;const evaluated0 = validate35.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.from === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"from\"},message:\"must have required property '\"+\"from\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.to === undefined){const err1 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"to\"},message:\"must have required property '\"+\"to\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.kind_payload === undefined){const err2 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"kind_payload\"},message:\"must have required property '\"+\"kind_payload\"+\"'\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.from !== undefined){let data0 = data.from;if((typeof data0 !== \"string\") && (data0 !== null)){const err3 = {instancePath:instancePath+\"/from\",schemaPath:\"#/properties/from/type\",keyword:\"type\",params:{type: schema46.properties.from.type},message:\"must be string,null\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.to !== undefined){let data1 = data.to;if(typeof data1 !== \"string\"){const err4 = {instancePath:instancePath+\"/to\",schemaPath:\"#/properties/to/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(!((((((data1 === \"pending\") || (data1 === \"opened\")) || (data1 === \"in_progress\")) || (data1 === \"signed\")) || (data1 === \"declined\")) || (data1 === \"expired\"))){const err5 = {instancePath:instancePath+\"/to\",schemaPath:\"#/properties/to/enum\",keyword:\"enum\",params:{allowedValues: schema46.properties.to.enum},message:\"must be equal to one of the allowed values\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}if(data.kind_payload !== undefined){let data2 = data.kind_payload;if(data2 && typeof data2 == \"object\" && !Array.isArray(data2)){if(data2.required_assurance_level === undefined){const err6 = {instancePath:instancePath+\"/kind_payload\",schemaPath:\"#/properties/kind_payload/required\",keyword:\"required\",params:{missingProperty: \"required_assurance_level\"},message:\"must have required property '\"+\"required_assurance_level\"+\"'\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(data2.required_assurance_level !== undefined){let data3 = data2.required_assurance_level;if(typeof data3 !== \"string\"){const err7 = {instancePath:instancePath+\"/kind_payload/required_assurance_level\",schemaPath:\"#/properties/kind_payload/properties/required_assurance_level/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(!(((data3 === \"integrity_proof\") || (data3 === \"advanced\")) || (data3 === \"qualified\"))){const err8 = {instancePath:instancePath+\"/kind_payload/required_assurance_level\",schemaPath:\"#/properties/kind_payload/properties/required_assurance_level/enum\",keyword:\"enum\",params:{allowedValues: schema46.properties.kind_payload.properties.required_assurance_level.enum},message:\"must be equal to one of the allowed values\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data2.participant_role !== undefined){let data4 = data2.participant_role;if((typeof data4 !== \"string\") && (data4 !== null)){const err9 = {instancePath:instancePath+\"/kind_payload/participant_role\",schemaPath:\"#/properties/kind_payload/properties/participant_role/type\",keyword:\"type\",params:{type: schema46.properties.kind_payload.properties.participant_role.type},message:\"must be string,null\"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}}else {const err10 = {instancePath:instancePath+\"/kind_payload\",schemaPath:\"#/properties/kind_payload/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}}else {const err11 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}validate35.errors = vErrors;return errors === 0;}validate35.evaluated = {\"props\":true,\"dynamicProps\":false,\"dynamicItems\":false};","\"use strict\";export const validate = validate32;export default validate32;const schema43 = {\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"$id\":\"https://schemas.overturo.com/postmessage-v2/signature/complete.json\",\"title\":\"signature COMPLETE payload\",\"type\":\"object\",\"additionalProperties\":true,\"required\":[\"outcome\",\"completed_at\"],\"properties\":{\"outcome\":{\"type\":\"string\",\"enum\":[\"signed\",\"declined\",\"countered\"]},\"assurance_level\":{\"type\":[\"string\",\"null\"],\"enum\":[\"integrity_proof\",\"advanced\",\"qualified\",null],\"description\":\"The signature assurance level recorded on the agreement.\"},\"completed_at\":{\"type\":\"string\",\"format\":\"date-time\"}}};const formats0 = require(\"ajv-formats/dist/formats\").fullFormats[\"date-time\"];function validate32(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL=\"https://schemas.overturo.com/postmessage-v2/signature/complete.json\" */;let vErrors = null;let errors = 0;const evaluated0 = validate32.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.outcome === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"outcome\"},message:\"must have required property '\"+\"outcome\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.completed_at === undefined){const err1 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"completed_at\"},message:\"must have required property '\"+\"completed_at\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.outcome !== undefined){let data0 = data.outcome;if(typeof data0 !== \"string\"){const err2 = {instancePath:instancePath+\"/outcome\",schemaPath:\"#/properties/outcome/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(!(((data0 === \"signed\") || (data0 === \"declined\")) || (data0 === \"countered\"))){const err3 = {instancePath:instancePath+\"/outcome\",schemaPath:\"#/properties/outcome/enum\",keyword:\"enum\",params:{allowedValues: schema43.properties.outcome.enum},message:\"must be equal to one of the allowed values\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.assurance_level !== undefined){let data1 = data.assurance_level;if((typeof data1 !== \"string\") && (data1 !== null)){const err4 = {instancePath:instancePath+\"/assurance_level\",schemaPath:\"#/properties/assurance_level/type\",keyword:\"type\",params:{type: schema43.properties.assurance_level.type},message:\"must be string,null\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(!((((data1 === \"integrity_proof\") || (data1 === \"advanced\")) || (data1 === \"qualified\")) || (data1 === null))){const err5 = {instancePath:instancePath+\"/assurance_level\",schemaPath:\"#/properties/assurance_level/enum\",keyword:\"enum\",params:{allowedValues: schema43.properties.assurance_level.enum},message:\"must be equal to one of the allowed values\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}if(data.completed_at !== undefined){let data2 = data.completed_at;if(typeof data2 === \"string\"){if(!(formats0.validate(data2))){const err6 = {instancePath:instancePath+\"/completed_at\",schemaPath:\"#/properties/completed_at/format\",keyword:\"format\",params:{format: \"date-time\"},message:\"must match format \\\"\"+\"date-time\"+\"\\\"\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+\"/completed_at\",schemaPath:\"#/properties/completed_at/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}}else {const err8 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}validate32.errors = vErrors;return errors === 0;}validate32.evaluated = {\"props\":true,\"dynamicProps\":false,\"dynamicItems\":false};","\"use strict\";export const validate = validate34;export default validate34;const schema45 = {\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"$id\":\"https://schemas.overturo.com/postmessage-v2/signature/error.json\",\"title\":\"signature ERROR payload\",\"type\":\"object\",\"additionalProperties\":true,\"required\":[\"code\",\"message\",\"fatal\"],\"properties\":{\"code\":{\"type\":\"string\"},\"message\":{\"type\":\"string\"},\"fatal\":{\"type\":\"boolean\"},\"recoverable_via\":{\"type\":[\"string\",\"null\"],\"enum\":[\"reload\",\"new_session\",null]}}};function validate34(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL=\"https://schemas.overturo.com/postmessage-v2/signature/error.json\" */;let vErrors = null;let errors = 0;const evaluated0 = validate34.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.code === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"code\"},message:\"must have required property '\"+\"code\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.message === undefined){const err1 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"message\"},message:\"must have required property '\"+\"message\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.fatal === undefined){const err2 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"fatal\"},message:\"must have required property '\"+\"fatal\"+\"'\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.code !== undefined){if(typeof data.code !== \"string\"){const err3 = {instancePath:instancePath+\"/code\",schemaPath:\"#/properties/code/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.message !== undefined){if(typeof data.message !== \"string\"){const err4 = {instancePath:instancePath+\"/message\",schemaPath:\"#/properties/message/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.fatal !== undefined){if(typeof data.fatal !== \"boolean\"){const err5 = {instancePath:instancePath+\"/fatal\",schemaPath:\"#/properties/fatal/type\",keyword:\"type\",params:{type: \"boolean\"},message:\"must be boolean\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}if(data.recoverable_via !== undefined){let data3 = data.recoverable_via;if((typeof data3 !== \"string\") && (data3 !== null)){const err6 = {instancePath:instancePath+\"/recoverable_via\",schemaPath:\"#/properties/recoverable_via/type\",keyword:\"type\",params:{type: schema45.properties.recoverable_via.type},message:\"must be string,null\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(!(((data3 === \"reload\") || (data3 === \"new_session\")) || (data3 === null))){const err7 = {instancePath:instancePath+\"/recoverable_via\",schemaPath:\"#/properties/recoverable_via/enum\",keyword:\"enum\",params:{allowedValues: schema45.properties.recoverable_via.enum},message:\"must be equal to one of the allowed values\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}}else {const err8 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}validate34.errors = vErrors;return errors === 0;}validate34.evaluated = {\"props\":true,\"dynamicProps\":false,\"dynamicItems\":false};","\"use strict\";export const validate = validate33;export default validate33;const schema44 = {\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"$id\":\"https://schemas.overturo.com/postmessage-v2/signature/deadline.json\",\"title\":\"signature DEADLINE payload\",\"type\":\"object\",\"additionalProperties\":true,\"required\":[\"remaining_seconds\",\"level\",\"deadline_at\"],\"properties\":{\"remaining_seconds\":{\"type\":\"integer\",\"minimum\":0},\"level\":{\"type\":\"string\",\"enum\":[\"warning\",\"expired\"]},\"deadline_at\":{\"type\":\"string\",\"format\":\"date-time\"}}};const formats0 = require(\"ajv-formats/dist/formats\").fullFormats[\"date-time\"];function validate33(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL=\"https://schemas.overturo.com/postmessage-v2/signature/deadline.json\" */;let vErrors = null;let errors = 0;const evaluated0 = validate33.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.remaining_seconds === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"remaining_seconds\"},message:\"must have required property '\"+\"remaining_seconds\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.level === undefined){const err1 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"level\"},message:\"must have required property '\"+\"level\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.deadline_at === undefined){const err2 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"deadline_at\"},message:\"must have required property '\"+\"deadline_at\"+\"'\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.remaining_seconds !== undefined){let data0 = data.remaining_seconds;if(!((typeof data0 == \"number\") && (!(data0 % 1) && !isNaN(data0)))){const err3 = {instancePath:instancePath+\"/remaining_seconds\",schemaPath:\"#/properties/remaining_seconds/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(typeof data0 == \"number\"){if(data0 < 0 || isNaN(data0)){const err4 = {instancePath:instancePath+\"/remaining_seconds\",schemaPath:\"#/properties/remaining_seconds/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: 0},message:\"must be >= 0\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}}if(data.level !== undefined){let data1 = data.level;if(typeof data1 !== \"string\"){const err5 = {instancePath:instancePath+\"/level\",schemaPath:\"#/properties/level/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(!((data1 === \"warning\") || (data1 === \"expired\"))){const err6 = {instancePath:instancePath+\"/level\",schemaPath:\"#/properties/level/enum\",keyword:\"enum\",params:{allowedValues: schema44.properties.level.enum},message:\"must be equal to one of the allowed values\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.deadline_at !== undefined){let data2 = data.deadline_at;if(typeof data2 === \"string\"){if(!(formats0.validate(data2))){const err7 = {instancePath:instancePath+\"/deadline_at\",schemaPath:\"#/properties/deadline_at/format\",keyword:\"format\",params:{format: \"date-time\"},message:\"must match format \\\"\"+\"date-time\"+\"\\\"\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}else {const err8 = {instancePath:instancePath+\"/deadline_at\",schemaPath:\"#/properties/deadline_at/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}}else {const err9 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}validate33.errors = vErrors;return errors === 0;}validate33.evaluated = {\"props\":true,\"dynamicProps\":false,\"dynamicItems\":false};","// postMessage v2 validator helper.\n//\n// Wraps Ajv standalone-compiled validators. The compiled .js modules live at\n// src/generated/postmessage-v2/ and are committed-but-derived: run\n// `yarn build:schemas` to regenerate after editing a schema. Each .js file\n// ships an auto-generated .d.ts sibling so this module's imports type-check\n// without `@ts-expect-error` suppressions.\n//\n\nimport envelopeValidator from \"./generated/postmessage-v2/envelope.js\"\nimport readyValidator from \"./generated/postmessage-v2/ready.js\"\nimport resizeValidator from \"./generated/postmessage-v2/resize.js\"\nimport cancelValidator from \"./generated/postmessage-v2/cancel.js\"\nimport consentStateValidator from \"./generated/postmessage-v2/consent/state.js\"\nimport consentCompleteValidator from \"./generated/postmessage-v2/consent/complete.js\"\nimport consentErrorValidator from \"./generated/postmessage-v2/consent/error.js\"\nimport consentDeadlineValidator from \"./generated/postmessage-v2/consent/deadline.js\"\nimport approvalStateValidator from \"./generated/postmessage-v2/approval/state.js\"\nimport approvalCompleteValidator from \"./generated/postmessage-v2/approval/complete.js\"\nimport approvalErrorValidator from \"./generated/postmessage-v2/approval/error.js\"\nimport approvalDeadlineValidator from \"./generated/postmessage-v2/approval/deadline.js\"\n// signing kind. Validators generated by `yarn build:schemas` from the\n// authored schemas/postmessage-v2/signature/*.json (committed-but-derived).\nimport signatureStateValidator from \"./generated/postmessage-v2/signature/state.js\"\nimport signatureCompleteValidator from \"./generated/postmessage-v2/signature/complete.js\"\nimport signatureErrorValidator from \"./generated/postmessage-v2/signature/error.js\"\nimport signatureDeadlineValidator from \"./generated/postmessage-v2/signature/deadline.js\"\n\nimport { MESSAGE_TYPES_V2 } from \"./constants\"\n\nexport type DecisionKind = \"consent\" | \"approval\" | \"signature_request\"\n\nexport interface Envelope {\n type: string\n kind: DecisionKind\n version: 2\n payload: Record<string, unknown>\n ts: string\n message_id: string\n}\n\nexport interface ValidationError {\n instancePath?: string\n schemaPath?: string\n keyword?: string\n message?: string\n params?: Record<string, unknown>\n}\n\nexport interface ValidationResult {\n valid: boolean\n errors: ValidationError[] | null\n}\n\ninterface ValidatorFn {\n (data: unknown): boolean\n errors?: ValidationError[] | null\n}\n\nconst VALIDATORS: Record<string, Record<string, ValidatorFn>> = {\n [MESSAGE_TYPES_V2.READY]: { _agnostic: readyValidator as ValidatorFn },\n [MESSAGE_TYPES_V2.RESIZE]: { _agnostic: resizeValidator as ValidatorFn },\n [MESSAGE_TYPES_V2.CANCEL]: { _agnostic: cancelValidator as ValidatorFn },\n [MESSAGE_TYPES_V2.STATE]: {\n consent: consentStateValidator as ValidatorFn,\n approval: approvalStateValidator as ValidatorFn,\n signature_request: signatureStateValidator as ValidatorFn,\n },\n [MESSAGE_TYPES_V2.COMPLETE]: {\n consent: consentCompleteValidator as ValidatorFn,\n approval: approvalCompleteValidator as ValidatorFn,\n signature_request: signatureCompleteValidator as ValidatorFn,\n },\n [MESSAGE_TYPES_V2.ERROR]: {\n consent: consentErrorValidator as ValidatorFn,\n approval: approvalErrorValidator as ValidatorFn,\n signature_request: signatureErrorValidator as ValidatorFn,\n },\n [MESSAGE_TYPES_V2.DEADLINE]: {\n consent: consentDeadlineValidator as ValidatorFn,\n approval: approvalDeadlineValidator as ValidatorFn,\n signature_request: signatureDeadlineValidator as ValidatorFn,\n },\n}\n\nconst envelopeFn = envelopeValidator as ValidatorFn\n\n/**\n * Validate just the top-level envelope (type, kind, version, payload, ts, message_id).\n * Per-payload validation requires {@link validatePayload}.\n */\nexport function validateEnvelope(message: unknown): ValidationResult {\n const valid = envelopeFn(message)\n return { valid, errors: valid ? null : (envelopeFn.errors ?? null) }\n}\n\n/**\n * Validate just the payload of an already-envelope-valid message.\n * Routes by `message.type` and (for kind-specific types) `message.kind`.\n */\nexport function validatePayload(message: Envelope): ValidationResult {\n const typeMap = VALIDATORS[message.type]\n if (!typeMap) {\n return { valid: false, errors: [{ message: `Unknown type ${message.type}` }] }\n }\n const validator = typeMap._agnostic ?? typeMap[message.kind]\n if (!validator) {\n return {\n valid: false,\n errors: [{ message: `No validator for ${message.type}/${message.kind}` }],\n }\n }\n const valid = validator(message.payload)\n return { valid, errors: valid ? null : (validator.errors ?? null) }\n}\n\n/**\n * Validate envelope first, then payload. Short-circuits on envelope failure.\n */\nexport function validate(message: unknown): ValidationResult {\n const envelopeResult = validateEnvelope(message)\n if (!envelopeResult.valid) return envelopeResult\n return validatePayload(message as Envelope)\n}\n","// `decisions` primitive. Kind-agnostic API surface.\n//\n// The primitive owns the lifecycle plumbing (session creation, iframe /\n// popup / redirect dispatch, postMessage envelope handling, exchange,\n// cancel) without baking in `consent`-vs-`approval` ergonomics. The\n// kind facades (`consent.open`, `approvals.open`) are thin shims on\n// top.\n//\n\nimport type { ApiClient } from \"./api\"\nimport { DECISIONS_API_PATH, DECISIONS_FLOW_PATH, EMBED_DEFAULTS, MESSAGE_TYPES_V2, POPUP_DEFAULTS, isForeignEnvelope } from \"./constants\"\nimport { applyStyle, resolveContainer } from \"./dom\"\nimport { OverturoApiError, OverturoError, OverturoValidationError } from \"./errors\"\nimport { validate, type Envelope } from \"./postmessage_v2\"\nimport type {\n DecisionExchange,\n DecisionKind,\n DecisionOutcome,\n DecisionPayload,\n DecisionToken,\n DecisionsCreateSessionInput,\n DecisionsEmbedOptions,\n DecisionsExchangeInput,\n DecisionsHandle,\n DecisionsNamespace,\n DecisionsPopupOptions,\n DecisionsSession,\n DecisionMode,\n FlowDisclosures,\n} from \"./types\"\n\ninterface DecisionsConfig {\n api: ApiClient\n flowBaseUrl: string\n debug: boolean\n}\n\n/**\n * Implementation of the kind-agnostic decisions namespace. Exposed\n * to consumers as `Overturo#decisions`.\n *\n * The class tracks every live `DecisionsHandle` it creates so\n * `Overturo#destroy()` can tear them all down at once.\n */\nexport class Decisions implements DecisionsNamespace {\n readonly #api: ApiClient\n readonly #flowBaseUrl: string\n readonly #debug: boolean\n readonly #liveHandles = new Set<DecisionsHandle>()\n\n constructor(config: DecisionsConfig) {\n this.#api = config.api\n this.#flowBaseUrl = config.flowBaseUrl\n this.#debug = config.debug\n }\n\n /**\n * Returns the canonical decisions URL for a token. `mode=\"embed\"`\n * gets the `/embed` suffix; `popup` and `redirect` use the bare\n * path (the server-rendered page handles both).\n */\n url(opts: { token: DecisionToken; mode?: DecisionMode }): string {\n const tail = opts.mode === \"embed\" ? \"/embed\" : \"\"\n return `${this.#flowBaseUrl}${DECISIONS_FLOW_PATH}/${opts.token}${tail}`\n }\n\n /**\n * Creates a new decisions session via `POST /api/v1/decisions`.\n * Wraps the legacy v0 API client's snake-case helpers so existing\n * tests around case conversion keep working.\n */\n async createSession(input: DecisionsCreateSessionInput): Promise<DecisionsSession> {\n if (!input.subjectRef) {\n throw new OverturoValidationError(\"subjectRef is required\")\n }\n const embedOrigin = input.embedOrigin ?? (typeof window !== \"undefined\" ? window.location.origin : undefined)\n\n // Both kinds share `state` and `redirectUri`; the discriminated\n // union types narrow per-kind for static safety, but the wire\n // shape carries the same fields regardless. Pass through both\n // unconditionally so partner integrators using runtime-built\n // input objects (where `\"state\" in input` may not reflect the\n // declared type) still get their values delivered.\n // Wire field is `delivery_mode` per the server contract. We accept\n // `mode` on the public input for terseness, then surface it on the\n // wire as `deliveryMode` so the API client's snake-case pass renders\n // it as `delivery_mode`. The response still echoes `mode` (server\n // convention diverges from request — see decision_token_json).\n const body: Record<string, unknown> = {\n kind: input.kind,\n subjectRef: input.subjectRef,\n deliveryMode: input.mode ?? \"embed\",\n embedOrigin,\n state: input.state,\n redirectUri: input.redirectUri,\n }\n if (input.kind === \"consent\") {\n body.scope = input.scope\n body.nonce = input.nonce\n }\n\n // The server returns the canonical `{decision: {...}}` envelope per\n // the decisions API. The body\n // uses `session_token`/`deadline_at`/`embed_url`/`decision_url` field\n // names; after the API client's toCamelCase pass we read\n // `sessionToken`/`deadlineAt`/`embedUrl`/`decisionUrl`. Field\n // `mode` is the response convention (different from the request's\n // `delivery_mode` — the server intentionally diverges).\n const envelope = await this.#api.post<{\n decision: {\n sessionToken: string\n kind: DecisionKind\n mode: DecisionMode\n deadlineAt?: string\n embedUrl: string\n decisionUrl?: string\n }\n }>(DECISIONS_API_PATH, body)\n const raw = envelope.decision\n\n if (this.#debug) {\n // eslint-disable-next-line no-console\n console.debug(\"[overturo:sdk]\", \"session_created\", {\n kind: raw.kind,\n mode: raw.mode,\n })\n }\n return {\n token: raw.sessionToken as DecisionToken,\n kind: raw.kind,\n mode: raw.mode,\n expiresAt: raw.deadlineAt ?? \"\",\n embedUrl: raw.embedUrl,\n }\n }\n\n /**\n * pre-flight disclosure discovery. Fetches what the decision screen\n * will present for a flow, BEFORE any session exists: purposes, fields,\n * steps, the action label, expiry, and application branding, in public\n * vocabulary and the requested locale. The recommended first call in the\n * embed flow: discover -> createSession -> (SDK reads config).\n *\n * Publishable-key authenticated — the ApiClient already sends\n * `X-Publishable-Key` (api.ts); the server ignores any bearer header on this\n * endpoint. An unknown / foreign / non-consent flow answers a uniform 404\n * (OverturoApiError, status 404).\n */\n async discover(opts: { flowId: string; locale?: string }): Promise<FlowDisclosures> {\n if (!opts.flowId) {\n throw new OverturoValidationError(\"flowId is required\")\n }\n const qs = opts.locale ? `?locale=${encodeURIComponent(opts.locale)}` : \"\"\n // The server returns the `{flow: {...}}` envelope (ResponseNormalization\n // renames accord -> flow). ApiClient.get already ran toCamelCase, so the\n // decoded object is camelCase FlowDisclosures.\n const envelope = await this.#api.get<{ flow: FlowDisclosures }>(\n `${DECISIONS_API_PATH}/flows/${encodeURIComponent(opts.flowId)}/disclosures${qs}`\n )\n // Guard an envelope-less 200 (a proxy/gateway misconfig — the server is\n // fail-closed): a typed error, never a silent `undefined`.\n if (!envelope || typeof envelope !== \"object\" || !(\"flow\" in envelope)) {\n throw new OverturoApiError(\"Malformed discovery response: missing 'flow'\", 200, envelope)\n }\n return envelope.flow\n }\n\n /**\n * Mounts the decisions flow inside an iframe under `opts.container`.\n * Validates inbound v2 envelopes; drops on origin mismatch /\n * schema-invalid. Returns a handle whose `.destroy()` tears down\n * the iframe + listener.\n */\n embed(opts: DecisionsEmbedOptions): DecisionsHandle {\n if (!opts.token) {\n throw new OverturoValidationError(\"token is required\")\n }\n const url = this.url({ token: opts.token, mode: \"embed\" })\n const expectedOrigin = new URL(url).origin\n const container = resolveContainer(opts.container)\n\n container.innerHTML = \"\"\n if (opts.loading) {\n const loadingEl = document.createElement(\"div\")\n loadingEl.setAttribute(\"data-overturo-loading\", \"\")\n if (typeof opts.loading === \"string\") {\n loadingEl.innerHTML = opts.loading\n } else {\n loadingEl.appendChild(opts.loading)\n }\n container.appendChild(loadingEl)\n }\n\n const iframe = document.createElement(\"iframe\")\n iframe.src = url\n // No `allow=` attribute. Earlier versions set `allow=\"popups\"`,\n // but `popups` is not a Permissions-Policy feature (browsers\n // warn \"Unrecognized feature: 'popups'\"). Popup-opening permission\n // for sandboxed iframes is governed by `allow-popups` in `sandbox`,\n // which we set below.\n iframe.setAttribute(\"sandbox\", \"allow-scripts allow-forms allow-same-origin allow-popups\")\n applyStyle(iframe, { ...EMBED_DEFAULTS }, opts.style)\n\n const clearLoading = (): void => {\n const loadingChild = container.querySelector(\"[data-overturo-loading]\")\n if (loadingChild) container.removeChild(loadingChild)\n }\n iframe.addEventListener(\"load\", clearLoading)\n // Network-level failure surfaces as the iframe firing `error`\n // (rare — usually CSP rejection or blocked origin). Clear loading\n // + bubble through `onError` with a stable code so integrators can\n // distinguish from server-emitted ERROR envelopes.\n iframe.addEventListener(\"error\", () => {\n clearLoading()\n opts.onError?.({\n code: \"iframe_load_failed\",\n message: \"The trust-host iframe failed to load.\",\n } as DecisionPayload)\n })\n\n const ac = new AbortController()\n const onMessage = (event: MessageEvent): void => {\n if (event.origin !== expectedOrigin || isForeignEnvelope(event.data)) return\n const result = validate(event.data)\n if (!result.valid) {\n opts.onError?.({\n code: \"protocol_violation\",\n errors: result.errors,\n } as DecisionPayload)\n if (this.#debug) {\n // eslint-disable-next-line no-console\n console.debug(\"[overturo:sdk]\", \"envelope_dropped\", {\n reason: \"schema_invalid\",\n })\n }\n return\n }\n this.#dispatch(event.data as Envelope, opts, iframe)\n }\n window.addEventListener(\"message\", onMessage, { signal: ac.signal })\n container.appendChild(iframe)\n\n const handle: DecisionsHandle = {\n token: opts.token,\n mode: \"embed\",\n destroy: async () => {\n ac.abort()\n if (iframe.parentNode) iframe.parentNode.removeChild(iframe)\n this.#liveHandles.delete(handle)\n if (this.#debug) {\n // eslint-disable-next-line no-console\n console.debug(\"[overturo:sdk]\", \"iframe_destroyed\", {})\n }\n },\n }\n this.#liveHandles.add(handle)\n if (this.#debug) {\n // eslint-disable-next-line no-console\n console.debug(\"[overturo:sdk]\", \"iframe_mounted\", {\n sandboxAttr: iframe.getAttribute(\"sandbox\"),\n })\n }\n return handle\n }\n\n /**\n * Opens the decisions flow in a popup window. Caller MUST invoke this\n * synchronously from a user-action handler or browsers will block.\n */\n popup(opts: DecisionsPopupOptions): DecisionsHandle {\n if (!opts.token) {\n throw new OverturoValidationError(\"token is required\")\n }\n const url = this.url({ token: opts.token, mode: \"popup\" })\n const expectedOrigin = new URL(url).origin\n const width = opts.width ?? POPUP_DEFAULTS.width\n const height = opts.height ?? POPUP_DEFAULTS.height\n const left = Math.round((screen.width - width) / 2)\n const top = Math.round((screen.height - height) / 2)\n\n // No `noopener,noreferrer` — the popup IS our trust surface and\n // sends results back via `window.opener.postMessage(...)`. With\n // noopener the opener reference is nulled, the postMessage never\n // round-trips, AND Chrome returns null from window.open so this\n // path would always throw \"Popup was blocked\".\n const features = `width=${width},height=${height},left=${left},top=${top},scrollbars=yes,status=yes`\n const win = window.open(url, \"_blank\", features)\n if (!win) {\n if (this.#debug) {\n // eslint-disable-next-line no-console\n console.debug(\"[overturo:sdk]\", \"popup_blocked\", {})\n }\n throw new OverturoError(\"Popup was blocked by the browser. Allow popups for this site and try again.\")\n }\n if (this.#debug) {\n // eslint-disable-next-line no-console\n console.debug(\"[overturo:sdk]\", \"popup_opened\", { features })\n }\n\n const ac = new AbortController()\n const onMessage = (event: MessageEvent): void => {\n if (event.origin !== expectedOrigin || isForeignEnvelope(event.data)) return\n const result = validate(event.data)\n if (!result.valid) {\n opts.onError?.({ code: \"protocol_violation\" } as DecisionPayload)\n return\n }\n const envelope = event.data as Envelope\n switch (envelope.type) {\n case MESSAGE_TYPES_V2.COMPLETE:\n opts.onComplete?.(buildOutcome(envelope.kind, envelope.payload))\n handle.destroy()\n break\n case MESSAGE_TYPES_V2.CANCEL:\n opts.onCancel?.(envelope.payload as DecisionPayload)\n handle.destroy()\n break\n case MESSAGE_TYPES_V2.ERROR:\n opts.onError?.(envelope.payload as DecisionPayload)\n break\n }\n }\n window.addEventListener(\"message\", onMessage, { signal: ac.signal })\n\n // User-closed-popup detection. The browser doesn't fire a message\n // when the user closes a popup manually, so without polling we'd\n // leak the message listener and never tell the integrator the user\n // bailed. 500ms is the cheapest interval that doesn't visibly\n // delay legitimate completion (which races via postMessage anyway).\n let closeTimer: ReturnType<typeof setInterval> | null = setInterval(() => {\n if (win.closed) {\n if (closeTimer) {\n clearInterval(closeTimer)\n closeTimer = null\n }\n opts.onCancel?.({ reason: \"user_closed_popup\" } as DecisionPayload)\n handle.destroy()\n }\n }, 500)\n\n const handle: DecisionsHandle = {\n token: opts.token,\n mode: \"popup\",\n destroy: async () => {\n if (closeTimer) {\n clearInterval(closeTimer)\n closeTimer = null\n }\n ac.abort()\n if (win && !win.closed) win.close()\n this.#liveHandles.delete(handle)\n },\n }\n this.#liveHandles.add(handle)\n return handle\n }\n\n /**\n * Exchanges a completed decision's token for the per-kind receipt.\n * Server returns a discriminated union; the SDK preserves the\n * discriminator so consumers using strict TypeScript get narrowing.\n */\n async exchange(input: DecisionsExchangeInput): Promise<DecisionExchange> {\n if (!input.token || !input.exchangeToken) {\n throw new OverturoValidationError(\"token and exchangeToken are required for exchange\")\n }\n const path = `${DECISIONS_API_PATH}/${input.token}/exchange`\n const raw = await this.#api.post<DecisionExchange>(path, {\n exchangeToken: input.exchangeToken,\n })\n return raw\n }\n\n /**\n * Asks the server to mark a session as cancelled. Idempotent on\n * already-terminal sessions.\n */\n async cancel(token: DecisionToken): Promise<void> {\n if (!token) {\n throw new OverturoValidationError(\"token is required for cancel\")\n }\n await this.#api.post(`${DECISIONS_API_PATH}/${token}/cancel`, {})\n }\n\n /**\n * Tears down every live handle (embed or popup) this client created.\n * Called by `Overturo#destroy()`. Errors during destroy are swallowed\n * — we want best-effort cleanup, not a half-destroyed state.\n */\n async destroyAll(): Promise<void> {\n const handles = [...this.#liveHandles]\n await Promise.allSettled(handles.map((h) => h.destroy()))\n this.#liveHandles.clear()\n }\n\n #dispatch(envelope: Envelope, opts: DecisionsEmbedOptions, iframe: HTMLIFrameElement): void {\n // approval counter-proposal arrives in STATE with\n // `phase: \"countered\"`. Surface ONLY through `onCounter` to keep\n // the contract clean (no double-fire of onState + onCounter).\n // If the integrator wants the raw STATE payload too, they can\n // implement onState themselves — the `payload` is the same shape.\n const isCounterState =\n envelope.type === MESSAGE_TYPES_V2.STATE &&\n envelope.kind === \"approval\" &&\n (envelope.payload as { phase?: string })?.phase === \"countered\"\n\n switch (envelope.type) {\n case MESSAGE_TYPES_V2.READY:\n opts.onReady?.(envelope.payload as DecisionPayload)\n break\n case MESSAGE_TYPES_V2.STATE:\n if (isCounterState) {\n opts.onCounter?.(envelope.payload as DecisionPayload)\n } else {\n opts.onState?.(envelope.kind, envelope.payload as DecisionPayload)\n }\n break\n case MESSAGE_TYPES_V2.RESIZE: {\n const height = (envelope.payload as { height?: number }).height\n if (typeof height === \"number\") {\n iframe.style.height = `${height}px`\n opts.onResize?.(height)\n }\n break\n }\n case MESSAGE_TYPES_V2.COMPLETE:\n opts.onComplete?.(buildOutcome(envelope.kind, envelope.payload))\n break\n case MESSAGE_TYPES_V2.CANCEL:\n opts.onCancel?.(envelope.payload as DecisionPayload)\n break\n case MESSAGE_TYPES_V2.ERROR:\n opts.onError?.(envelope.payload as DecisionPayload)\n break\n case MESSAGE_TYPES_V2.DEADLINE:\n opts.onDeadline?.(envelope.payload as DecisionPayload)\n break\n }\n if (this.#debug) {\n // eslint-disable-next-line no-console\n console.debug(\"[overturo:sdk]\", \"envelope_received\", {\n type: envelope.type,\n kind: envelope.kind,\n })\n }\n }\n}\n\n/**\n * Coerces a server COMPLETE payload into the kind-discriminated\n * `DecisionOutcome` type. Server already enforces shape via the\n * generated v2 schemas; this is the SDK-side narrowing layer.\n */\nexport function buildOutcome(kind: DecisionKind, payload: unknown): DecisionOutcome {\n const p = (payload ?? {}) as Record<string, unknown>\n // The COMPLETE wire payload is snake_case per consent|approval/complete.json:\n // `outcome` (the result) + `exchange_token` (the token the host exchanges,\n // i.e. the SDK's `consentToken`/`escalationToken`) + `completed_at`. Read the\n // wire fields directly; camelCase is accepted defensively. (Declines arrive as\n // CANCEL, not COMPLETE — but the schema permits `declined`/`denied` here, so\n // map the real outcome rather than defaulting it.)\n if (kind === \"consent\") {\n return {\n kind: \"consent\",\n result: ((p.outcome ?? p.result) as \"granted\" | \"declined\") ?? \"granted\",\n consentToken: (p.exchange_token ?? p.consentToken) as string | undefined,\n purposesGranted: p.purposesGranted as string[] | undefined,\n purposesDeclined: p.purposesDeclined as string[] | undefined,\n }\n }\n // signing kind. The COMPLETE wire payload is snake_case per\n // `signature/complete.json` (`outcome`/`assurance_level`/`completed_at`),\n // validated before dispatch; read it directly (camelCase accepted defensively).\n // `expired` is never a completion outcome — only signed/declined/countered.\n if (kind === \"signature_request\") {\n return {\n kind: \"signature_request\",\n result: ((p.outcome ?? p.result) as \"signed\" | \"declined\" | \"countered\") ?? \"signed\",\n assuranceLevel: (p.assurance_level ?? p.assuranceLevel) as\n | \"integrity_proof\"\n | \"advanced\"\n | \"qualified\"\n | null\n | undefined,\n completedAt: (p.completed_at ?? p.completedAt) as string | undefined,\n }\n }\n return {\n kind: \"approval\",\n result: ((p.outcome ?? p.result) as \"approved\" | \"denied\" | \"countered\") ?? \"approved\",\n escalationToken: (p.exchange_token ?? p.escalationToken) as string | undefined,\n counterProposal: p.counterProposal as Record<string, unknown> | undefined,\n }\n}\n","import { EMBED_DEFAULTS, MESSAGE_TYPES_V2 } from \"./constants\"\nimport { resolveContainer, applyStyle } from \"./dom\"\nimport { validate, type Envelope } from \"./postmessage_v2\"\nimport type { EmbedHandle, EmbedOptions } from \"./types\"\n\n/**\n * Creates an embedded consent or approval flow in an iframe.\n *\n * Consumer dispatch is now kind-aware: the host's callbacks\n * receive the kind discriminator alongside the payload so a single SDK can\n * route consent-shaped vs. approval-shaped completions correctly. Inbound\n * messages are validated against the v2 envelope + per-kind-per-type\n * schemas; invalid envelopes are dropped (warn-logged in development).\n */\nexport function createEmbed(baseUrl: string, options: EmbedOptions): EmbedHandle {\n const container = resolveContainer(options.container)\n const expectedOrigin = new URL(baseUrl).origin\n const embedUrl = `${baseUrl}/accord/embed/${options.sessionToken}`\n\n container.innerHTML = \"\"\n if (options.loading) {\n const loadingEl = document.createElement(\"div\")\n loadingEl.setAttribute(\"data-overturo-loading\", \"\")\n if (typeof options.loading === \"string\") {\n loadingEl.innerHTML = options.loading\n } else {\n loadingEl.appendChild(options.loading)\n }\n container.appendChild(loadingEl)\n }\n\n const iframe = document.createElement(\"iframe\")\n iframe.src = embedUrl\n // No `allow=` — `popups` is not a Permissions-Policy feature.\n // Popup-opening is governed by sandbox's allow-popups below.\n iframe.setAttribute(\"sandbox\", \"allow-scripts allow-forms allow-same-origin allow-popups\")\n\n applyStyle(iframe, { ...EMBED_DEFAULTS }, options.style)\n\n iframe.addEventListener(\"load\", () => {\n const loadingChild = container.querySelector(\"[data-overturo-loading]\")\n if (loadingChild) container.removeChild(loadingChild)\n })\n\n const ac = new AbortController()\n\n function handleMessage(event: MessageEvent): void {\n if (event.origin !== expectedOrigin) return\n\n const result = validate(event.data)\n if (!result.valid) return\n\n const envelope = event.data as Envelope\n\n switch (envelope.type) {\n case MESSAGE_TYPES_V2.READY:\n options.onReady?.(envelope.payload)\n break\n case MESSAGE_TYPES_V2.RESIZE: {\n const height = (envelope.payload as { height?: number }).height\n if (typeof height === \"number\") {\n iframe.style.height = `${height}px`\n options.onResize?.(height)\n }\n break\n }\n case MESSAGE_TYPES_V2.STATE:\n options.onState?.(envelope.kind, envelope.payload)\n break\n case MESSAGE_TYPES_V2.DEADLINE:\n options.onDeadline?.(envelope.payload)\n break\n case MESSAGE_TYPES_V2.COMPLETE:\n options.onComplete?.(envelope.kind, envelope.payload)\n break\n case MESSAGE_TYPES_V2.CANCEL:\n options.onCancel?.(envelope.payload)\n break\n case MESSAGE_TYPES_V2.ERROR:\n options.onError?.(envelope.payload)\n break\n }\n }\n\n window.addEventListener(\"message\", handleMessage, { signal: ac.signal })\n container.appendChild(iframe)\n\n return {\n iframe,\n destroy(): void {\n ac.abort()\n if (iframe.parentNode) {\n iframe.parentNode.removeChild(iframe)\n }\n },\n }\n}\n","import { MESSAGE_TYPES_V2, POPUP_DEFAULTS } from \"./constants\"\nimport { OverturoError, OverturoValidationError } from \"./errors\"\nimport { validate, type Envelope } from \"./postmessage_v2\"\nimport type { PopupHandle, PopupOptions } from \"./types\"\n\nlet popupCounter = 0\n\n/**\n * Opens a consent or approval flow in a popup window.\n *\n * Validates inbound v2 envelopes and routes terminal types\n * (COMPLETE, CANCEL, ERROR) to the host callbacks with kind discrimination.\n */\nexport function createPopup(baseUrl: string, options: PopupOptions): PopupHandle {\n if (!options.sessionToken) {\n throw new OverturoValidationError(\"sessionToken is required for popup mode\")\n }\n\n const embedUrl = `${baseUrl}/accord/embed/${options.sessionToken}`\n const width = options.width ?? POPUP_DEFAULTS.width\n const height = options.height ?? POPUP_DEFAULTS.height\n const left = Math.round((screen.width - width) / 2)\n const top = Math.round((screen.height - height) / 2)\n\n const windowName = `overturo_decision_${++popupCounter}`\n const popup = window.open(\n embedUrl,\n windowName,\n `width=${width},height=${height},left=${left},top=${top},scrollbars=yes,status=yes`\n )\n\n if (!popup) {\n throw new OverturoError(\"Popup was blocked by the browser. Allow popups for this site and try again.\")\n }\n\n const expectedOrigin = new URL(baseUrl).origin\n const ac = new AbortController()\n\n function handleMessage(event: MessageEvent): void {\n if (event.origin !== expectedOrigin) return\n\n const result = validate(event.data)\n if (!result.valid) return\n\n const envelope = event.data as Envelope\n\n switch (envelope.type) {\n case MESSAGE_TYPES_V2.COMPLETE:\n options.onComplete?.(envelope.kind, envelope.payload)\n cleanup()\n break\n case MESSAGE_TYPES_V2.CANCEL:\n options.onCancel?.(envelope.payload)\n cleanup()\n break\n case MESSAGE_TYPES_V2.ERROR:\n options.onError?.(envelope.payload)\n break\n }\n }\n\n function cleanup(): void {\n ac.abort()\n if (popup && !popup.closed) popup.close()\n }\n\n window.addEventListener(\"message\", handleMessage, { signal: ac.signal })\n\n return { close: cleanup }\n}\n","import type { PreviewOptions, PreviewHandle, EmbedStyle } from \"./types\"\n\nconst VIEWPORTS: Record<string, { width: number | null; height: number }> = {\n mobile: { width: 375, height: 667 },\n tablet: { width: 768, height: 1024 },\n desktop: { width: null, height: 800 },\n}\n\n/**\n * Renders a preview iframe inside a container.\n *\n * @param previewUrl - The full URL to the preview endpoint (e.g., /preview/prv_abc123)\n * @param options - Preview rendering options\n * @returns A handle for controlling the preview iframe\n */\nexport function renderPreview(previewUrl: string, options: PreviewOptions): PreviewHandle {\n const container = resolveContainer(options.container)\n let currentDevice = options.device || \"desktop\"\n let currentTheme = options.theme || \"default\"\n let currentLocale = options.locale\n\n // Build initial URL with params\n const url = buildUrl(previewUrl, currentTheme, currentDevice, currentLocale)\n\n // Show loading state\n if (options.loading) {\n showLoading(container, options.loading)\n }\n\n // Create iframe\n const iframe = document.createElement(\"iframe\")\n iframe.src = url\n iframe.sandbox.add(\"allow-scripts\", \"allow-same-origin\")\n iframe.style.border = \"none\"\n iframe.title = \"Preview\"\n\n applyViewport(iframe, currentDevice)\n applyStyle(iframe, options.style)\n\n iframe.addEventListener(\n \"load\",\n () => {\n // Remove loading state once content loads\n const loader = container.querySelector(\"[data-preview-loading]\")\n if (loader) loader.remove()\n },\n { once: true }\n )\n\n container.appendChild(iframe)\n\n const handle: PreviewHandle = {\n iframe,\n\n setDevice(device: \"mobile\" | \"tablet\" | \"desktop\") {\n currentDevice = device\n applyViewport(iframe, device)\n iframe.src = buildUrl(previewUrl, currentTheme, currentDevice, currentLocale)\n },\n\n setTheme(theme: string) {\n currentTheme = theme\n iframe.src = buildUrl(previewUrl, currentTheme, currentDevice, currentLocale)\n },\n\n destroy() {\n iframe.remove()\n },\n }\n\n return handle\n}\n\nfunction resolveContainer(target: string | HTMLElement): HTMLElement {\n if (typeof target === \"string\") {\n const el = document.querySelector<HTMLElement>(target)\n if (!el) throw new Error(`Preview container not found: ${target}`)\n return el\n }\n return target\n}\n\nfunction buildUrl(base: string, theme: string, device: string, locale?: string): string {\n const url = new URL(base, window.location.origin)\n url.searchParams.set(\"theme\", theme)\n url.searchParams.set(\"device\", device)\n if (locale) url.searchParams.set(\"locale\", locale)\n return url.toString()\n}\n\nfunction applyViewport(iframe: HTMLIFrameElement, device: string): void {\n const vp = VIEWPORTS[device] || VIEWPORTS.desktop\n if (vp.width) {\n iframe.style.width = `${vp.width}px`\n iframe.style.maxWidth = \"100%\"\n } else {\n iframe.style.width = \"100%\"\n iframe.style.maxWidth = \"none\"\n }\n iframe.style.height = `${vp.height}px`\n}\n\nfunction applyStyle(iframe: HTMLIFrameElement, style?: EmbedStyle): void {\n if (!style) return\n if (style.width) iframe.style.width = style.width\n if (style.minHeight) iframe.style.minHeight = style.minHeight\n if (style.maxHeight) iframe.style.maxHeight = style.maxHeight\n if (style.borderRadius) iframe.style.borderRadius = style.borderRadius\n if (style.border) iframe.style.border = style.border\n if (style.background) iframe.style.background = style.background\n}\n\nfunction showLoading(container: HTMLElement, loading: string | HTMLElement): void {\n const wrapper = document.createElement(\"div\")\n wrapper.setAttribute(\"data-preview-loading\", \"\")\n if (typeof loading === \"string\") {\n wrapper.textContent = loading\n } else {\n wrapper.appendChild(loading)\n }\n container.appendChild(wrapper)\n}\n","import { OverturoValidationError } from \"./errors\"\nimport type { RedirectOptions } from \"./types\"\n\n/**\n * Redirects the current page to a consent flow.\n */\nexport function performRedirect(baseUrl: string, options: RedirectOptions): void {\n if (!options.flowId) {\n throw new OverturoValidationError(\"flowId is required for redirect mode\")\n }\n if (!options.redirectUri) {\n throw new OverturoValidationError(\"redirectUri is required for redirect mode\")\n }\n\n const url = new URL(`${baseUrl}/accord/${options.flowId}`)\n const params = new URLSearchParams()\n\n params.set(\"redirect_uri\", options.redirectUri)\n if (options.state) params.set(\"state\", options.state)\n if (options.nonce) params.set(\"nonce\", options.nonce)\n if (options.scope) params.set(\"scope\", options.scope)\n\n url.search = params.toString()\n window.location.href = url.toString()\n}\n","import { EMBED_DEFAULTS, SETUP_MESSAGE_TYPES, SETUP_POPUP_DEFAULTS } from \"./constants\"\nimport { resolveContainer, applyStyle } from \"./dom\"\nimport type {\n AccordSetupOptions,\n AccordSetupPopupOptions,\n AccordSetupRedirectOptions,\n AccordSetupResult,\n SetupHandle,\n SetupPopupHandle,\n SetupStep,\n} from \"./types\"\n\n/**\n * Creates an AccordSetup wizard embedded in an iframe.\n *\n * @param baseUrl - The Overturo base URL\n * @param options - Setup options including session token, container, and callbacks\n * @returns Handle with iframe reference and destroy method\n */\nexport function createSetupEmbed(baseUrl: string, options: AccordSetupOptions & { sessionToken: string }): SetupHandle {\n const container = resolveContainer(options.container)\n const expectedOrigin = new URL(baseUrl).origin\n const embedUrl = `${baseUrl}/accord_setup/embed/${options.sessionToken}`\n\n // Clear container and show loading state\n container.innerHTML = \"\"\n if (options.loading) {\n const loadingEl = document.createElement(\"div\")\n loadingEl.setAttribute(\"data-overturo-loading\", \"\")\n if (typeof options.loading === \"string\") {\n loadingEl.innerHTML = options.loading\n } else {\n loadingEl.appendChild(options.loading)\n }\n container.appendChild(loadingEl)\n }\n\n const iframe = document.createElement(\"iframe\")\n iframe.src = embedUrl\n iframe.setAttribute(\"allow\", \"popups\")\n iframe.setAttribute(\"sandbox\", \"allow-scripts allow-forms allow-same-origin allow-popups\")\n\n applyStyle(iframe, { ...EMBED_DEFAULTS }, options.style)\n\n // Remove loading state when iframe loads\n iframe.addEventListener(\"load\", () => {\n const loadingChild = container.querySelector(\"[data-overturo-loading]\")\n if (loadingChild) container.removeChild(loadingChild)\n })\n\n const ac = new AbortController()\n\n function handleMessage(event: MessageEvent): void {\n if (event.origin !== expectedOrigin) return\n\n const data = event.data\n if (!data || !data.type) return\n\n switch (data.type) {\n case SETUP_MESSAGE_TYPES.READY:\n options.onReady?.()\n break\n case SETUP_MESSAGE_TYPES.RESIZE:\n if (data.height) {\n iframe.style.height = `${data.height}px`\n options.onResize?.(data.height)\n }\n break\n case SETUP_MESSAGE_TYPES.STEP:\n options.onStep?.({\n key: data.step,\n index: data.stepIndex,\n total: data.totalSteps,\n } as SetupStep)\n break\n case SETUP_MESSAGE_TYPES.CREATED:\n options.onCreated?.({\n accordId: data.accordId,\n flowId: data.flowId,\n } as AccordSetupResult)\n break\n case SETUP_MESSAGE_TYPES.CANCEL:\n options.onCancel?.()\n break\n case SETUP_MESSAGE_TYPES.ERROR:\n options.onError?.(data.error)\n break\n }\n }\n\n window.addEventListener(\"message\", handleMessage, { signal: ac.signal })\n container.appendChild(iframe)\n\n return {\n iframe,\n destroy(): void {\n ac.abort()\n if (iframe.parentNode) {\n iframe.parentNode.removeChild(iframe)\n }\n },\n }\n}\n\n/**\n * Opens the AccordSetup wizard in a popup window.\n *\n * @param baseUrl - The Overturo base URL\n * @param options - Popup options including session token and callbacks\n * @returns Handle with close method\n */\nexport function createSetupPopup(\n baseUrl: string,\n options: AccordSetupPopupOptions & { sessionToken: string }\n): SetupPopupHandle {\n const embedUrl = `${baseUrl}/accord_setup/embed/${options.sessionToken}`\n const expectedOrigin = new URL(baseUrl).origin\n\n const w = options.width ?? SETUP_POPUP_DEFAULTS.width\n const h = options.height ?? SETUP_POPUP_DEFAULTS.height\n const left = Math.round((screen.width - w) / 2)\n const top = Math.round((screen.height - h) / 2)\n\n const popup = window.open(\n embedUrl,\n \"accord_setup_popup\",\n `width=${w},height=${h},left=${left},top=${top},scrollbars=yes`\n )\n\n const ac = new AbortController()\n let pollTimer: ReturnType<typeof setInterval> | null = null\n\n function handleMessage(event: MessageEvent): void {\n if (event.origin !== expectedOrigin) return\n\n const data = event.data\n if (!data || !data.type) return\n\n switch (data.type) {\n case SETUP_MESSAGE_TYPES.CREATED:\n options.onCreated?.({\n accordId: data.accordId,\n flowId: data.flowId,\n })\n cleanup()\n break\n case SETUP_MESSAGE_TYPES.CANCEL:\n options.onCancel?.()\n cleanup()\n break\n case SETUP_MESSAGE_TYPES.ERROR:\n options.onError?.(data.error)\n break\n }\n }\n\n function cleanup(): void {\n ac.abort()\n if (pollTimer) clearInterval(pollTimer)\n }\n\n window.addEventListener(\"message\", handleMessage, { signal: ac.signal })\n\n // Poll for popup close (user closed window manually)\n pollTimer = setInterval(() => {\n if (popup && popup.closed) {\n options.onCancel?.()\n cleanup()\n }\n }, 500)\n\n return {\n close(): void {\n popup?.close()\n cleanup()\n },\n }\n}\n\n/**\n * Redirects to the AccordSetup wizard (full-page navigation).\n *\n * @param baseUrl - The Overturo base URL\n * @param options - Redirect options including session token\n */\nexport function setupRedirect(baseUrl: string, options: AccordSetupRedirectOptions & { sessionToken: string }): void {\n const embedUrl = `${baseUrl}/accord_setup/embed/${options.sessionToken}`\n window.location.href = embedUrl\n}\n","import { ApiClient, extractErrorMessage, toCamelCase } from \"./api\"\nimport { ApprovalsFacade } from \"./approvals_facade\"\nimport { ConsentFacade } from \"./consent_facade\"\nimport { FormsFacade } from \"./forms\"\nimport { SigningFacade } from \"./signing_facade\"\nimport { API_PATH, DEFAULT_BASE_URL, MEETING_CONSENTS_API_PATH, PREVIEW_TOKENS_PATH, SETUP_API_PATH } from \"./constants\"\nimport { Decisions } from \"./decisions\"\nimport { createEmbed } from \"./embed\"\nimport { OverturoApiError, OverturoValidationError } from \"./errors\"\nimport { createPopup } from \"./popup\"\nimport { renderPreview } from \"./preview\"\nimport { performRedirect } from \"./redirect\"\nimport { createSetupEmbed, createSetupPopup, setupRedirect } from \"./setup\"\nimport type {\n AccordSetupOptions,\n AccordSetupPopupOptions,\n AccordSetupRedirectOptions,\n CreateSessionParams,\n CreateSetupSessionParams,\n EmbedHandle,\n EmbedOptions,\n ExchangeParams,\n ExchangeResult,\n OverturoOptions,\n PopupHandle,\n PopupOptions,\n PreviewHandle,\n PreviewSetupOptions,\n PreviewTemplateOptions,\n RedirectOptions,\n Session,\n SessionStatus,\n SetupHandle,\n SetupPopupHandle,\n SetupSession,\n MeetingParticipantStatus,\n} from \"./types\"\n\n/**\n * The main Overturo client for initiating consent flows and exchanging tokens.\n *\n * @example\n * ```ts\n * const overturo = new Overturo({ publishableKey: \"pk_live_...\" });\n *\n * // High-level: create session + embed in one call\n * const flow = await overturo.consent({\n * flowId: \"flw_...\",\n * container: \"#consent\",\n * onComplete: (result) => console.log(result.consentToken),\n * });\n *\n * // Low-level: manual session + embed\n * const session = await overturo.createSession({ flowId: \"flw_...\" });\n * const widget = overturo.embed({ sessionToken: session.sessionToken, container: \"#el\" });\n * ```\n */\nexport class Overturo {\n private api: ApiClient\n private baseUrl: string\n // Host that serves consent flows + iframes. Falls back to baseUrl\n // when not explicitly configured — production has both on one host\n // (overturo.com), so this distinction only matters in dev (trust\n // subdomain on a separate port) or for partners with a custom\n // multi-host setup.\n private flowBaseUrl: string\n private debugFlag: boolean\n // `decisions` primitive + `consent` / `approvals`\n // facades. Constructed eagerly so consumers can reach them as\n // `client.decisions.embed(…)` / `client.consent.open(…)` etc.\n readonly decisions: Decisions\n readonly consent: ConsentFacade\n readonly approvals: ApprovalsFacade\n readonly signing: SigningFacade\n /** 201 — Form Capture: the organisation keeps its form; Overturo keeps the record. */\n readonly forms: FormsFacade\n\n constructor(options: OverturoOptions) {\n if (!options.publishableKey) {\n throw new OverturoValidationError(\"publishableKey is required\")\n }\n\n this.baseUrl = (options.baseUrl ?? DEFAULT_BASE_URL).replace(/\\/+$/, \"\")\n this.flowBaseUrl = (options.flowBaseUrl ?? this.baseUrl).replace(/\\/+$/, \"\")\n this.debugFlag = options.debug === true\n\n this.api = new ApiClient({\n baseUrl: this.baseUrl,\n publishableKey: options.publishableKey,\n apiKey: options.apiKey,\n timeout: options.timeout,\n })\n\n this.decisions = new Decisions({\n api: this.api,\n flowBaseUrl: this.flowBaseUrl,\n debug: this.debugFlag,\n })\n this.consent = new ConsentFacade(this.decisions)\n this.approvals = new ApprovalsFacade(this.decisions, this.api)\n this.signing = new SigningFacade(this.decisions, this.api)\n this.forms = new FormsFacade(this.api, this.decisions, this.flowBaseUrl, options.publishableKey)\n\n if (this.debugFlag && typeof window !== \"undefined\") {\n const url = new URL(this.baseUrl)\n // localhost, 127.0.0.1, *.lvh.me, and *.localhost are all\n // well-known dev hostnames that always resolve to 127.0.0.1.\n // No need to warn about HTTP on them.\n const devHosts =\n url.hostname === \"localhost\" ||\n url.hostname === \"127.0.0.1\" ||\n url.hostname === \"lvh.me\" ||\n url.hostname.endsWith(\".lvh.me\") ||\n url.hostname.endsWith(\".localhost\")\n if (url.protocol === \"http:\" && !devHosts) {\n // eslint-disable-next-line no-console\n console.warn(\n \"[overturo:sdk]\",\n \"OVERTURO_INSECURE_HOST\",\n `API host ${url.host} is not HTTPS; treat this as dev-only.`\n )\n }\n }\n }\n\n /**\n * Tears down every live decisions handle (embed iframes + popups).\n * Best-effort: errors during teardown are swallowed.\n *\n * @since 1.0.0\n */\n async destroy(): Promise<void> {\n await this.decisions.destroyAll()\n }\n\n // v0's `Overturo#consent({...})` method is REPLACED\n // by the `consent` facade property declared above. Consumers must\n // migrate `client.consent({...})` → `client.consent.open({...})`.\n // The migration is documented in CHANGELOG.md and the developer\n // portal. Calling `client.consent(...)`\n // as a function now raises `TypeError` (consent is an object, not\n // a function); we accept this surprise per the spec's \"v0 callers\n // break\" pre-production stance.\n\n /**\n * Creates a new consent session.\n * The flowId is sent as accord_id to the server (automatic parameter aliasing).\n */\n async createSession(params: CreateSessionParams): Promise<Session> {\n return this.api.post<Session>(API_PATH, {\n accordId: params.flowId,\n deliveryMode: params.deliveryMode,\n embedOrigin: params.embedOrigin,\n redirectUri: params.redirectUri,\n state: params.state,\n nonce: params.nonce,\n scope: params.scope,\n skipSteps: params.skipSteps,\n })\n }\n\n /**\n * Retrieves the status of an existing consent session.\n */\n async getSession(sessionToken: string): Promise<SessionStatus> {\n return this.api.get<SessionStatus>(`${API_PATH}/${sessionToken}`)\n }\n\n /**\n * This participant's consent status for ONE meeting (the meeting's own\n * window and platform ride along). Identified by the participant's own\n * session token — never lists other participants.\n */\n async getMeetingParticipantStatus(meetingId: string, sessionToken: string): Promise<MeetingParticipantStatus> {\n if (!meetingId) throw new OverturoValidationError(\"meetingId is required\")\n if (!sessionToken) throw new OverturoValidationError(\"sessionToken is required\")\n const response = await this.api.rawGet(\n `${MEETING_CONSENTS_API_PATH}/${encodeURIComponent(meetingId)}/status?session_token=${encodeURIComponent(sessionToken)}`\n )\n return this.decodeParticipantStatus(response)\n }\n\n /**\n * Withdraws this participant's consent for ONE meeting. The host is told;\n * the record keeps the withdrawal.\n */\n async withdrawMeetingConsent(meetingId: string, sessionToken: string): Promise<MeetingParticipantStatus> {\n if (!meetingId) throw new OverturoValidationError(\"meetingId is required\")\n if (!sessionToken) throw new OverturoValidationError(\"sessionToken is required\")\n const response = await this.api.rawPost(`${MEETING_CONSENTS_API_PATH}/${encodeURIComponent(meetingId)}/revoke`, {\n sessionToken,\n })\n return this.decodeParticipantStatus(response)\n }\n\n // Purpose names are data, not keys: everything camelCases except `purposes`.\n private async decodeParticipantStatus(response: Response): Promise<MeetingParticipantStatus> {\n if (!response.ok) {\n let responseBody: unknown\n try {\n responseBody = await response.json()\n } catch {\n responseBody = null\n }\n throw new OverturoApiError(extractErrorMessage(responseBody, response.status), response.status, responseBody)\n }\n const raw = JSON.parse(await response.text()) as Record<string, unknown>\n const purposes = (raw.purposes ?? {}) as Record<string, string>\n const decoded = toCamelCase({ ...raw, purposes: {} }) as MeetingParticipantStatus\n return { ...decoded, purposes: { ...purposes } }\n }\n\n /**\n * Embeds a consent flow in an iframe.\n * Requires a sessionToken from createSession().\n */\n embed(options: EmbedOptions): EmbedHandle {\n return createEmbed(this.flowBaseUrl, options)\n }\n\n /**\n * Opens a consent flow in a popup window.\n * Requires a sessionToken from createSession().\n *\n * @throws {OverturoError} If the browser blocks the popup.\n */\n popup(options: PopupOptions): PopupHandle {\n return createPopup(this.flowBaseUrl, options)\n }\n\n /**\n * Redirects to a consent flow (full-page navigation).\n * No session token needed — the server creates one on arrival.\n */\n redirect(options: RedirectOptions): void {\n performRedirect(this.flowBaseUrl, options)\n }\n\n /**\n * Exchanges a consent token for claims, attestations, credentials, and tokens.\n * Best used server-side with apiKey set.\n *\n * Handles HTTP 202 (fulfillment pending) transparently by retrying with\n * the Retry-After interval until the server returns the full result.\n */\n async exchange(params: ExchangeParams): Promise<ExchangeResult> {\n const maxRetries = 5\n const path = `${API_PATH}/${params.sessionToken}/exchange`\n const body = { consentToken: params.consentToken }\n\n for (let attempt = 0; attempt <= maxRetries; attempt++) {\n const response = await this.api.rawPost(path, body)\n\n if (response.status === 202) {\n if (attempt === maxRetries) {\n throw new OverturoApiError(\"Exchange timeout: fulfillment still pending\", 202, null)\n }\n const retryAfter = parseInt(response.headers.get(\"Retry-After\") || \"1\", 10)\n await new Promise((resolve) => setTimeout(resolve, retryAfter * 1000))\n continue\n }\n\n if (!response.ok) {\n let responseBody: unknown\n try {\n responseBody = await response.json()\n } catch {\n responseBody = null\n }\n const message = extractErrorMessage(responseBody, response.status)\n throw new OverturoApiError(\n message === `HTTP ${response.status}` ? `Exchange failed: HTTP ${response.status}` : message,\n response.status,\n responseBody\n )\n }\n\n const text = await response.text()\n return toCamelCase(JSON.parse(text)) as ExchangeResult\n }\n\n throw new OverturoApiError(\"Exchange failed: max retries exceeded\", 202, null)\n }\n\n // ── AccordSetup Methods ──────────────────────────────\n\n /**\n * Creates a new AccordSetup session via the API.\n * Lower-level than accordSetup() — use when you need manual control.\n */\n async createSetupSession(params: CreateSetupSessionParams): Promise<SetupSession> {\n return this.api.post<SetupSession>(SETUP_API_PATH, {\n solution: params.solution,\n vertical: params.vertical,\n archetype: params.archetype,\n templateKey: params.templateKey,\n deliveryMode: params.deliveryMode || \"embed\",\n embedOrigin: params.embedOrigin || (typeof window !== \"undefined\" ? window.location.origin : undefined),\n redirectUri: params.redirectUri,\n state: params.state,\n locale: params.locale || (typeof navigator !== \"undefined\" ? navigator.language : undefined),\n constraints: params.constraints,\n presetId: params.presetId,\n })\n }\n\n /**\n * High-level: creates a setup session and embeds the wizard in an iframe.\n *\n * @example\n * ```ts\n * const handle = await overturo.accordSetup({\n * solution: \"meetings\",\n * container: \"#setup\",\n * onCreated: ({ flowId }) => console.log(\"Created:\", flowId),\n * });\n * ```\n */\n async accordSetup(options: AccordSetupOptions): Promise<SetupHandle> {\n const session = await this.createSetupSession(this.buildSetupParams(options, \"embed\"))\n\n return createSetupEmbed(this.flowBaseUrl, {\n ...options,\n sessionToken: session.sessionToken,\n })\n }\n\n /**\n * Creates a setup session and opens the wizard in a popup window.\n */\n async accordSetupPopup(options: AccordSetupPopupOptions): Promise<SetupPopupHandle> {\n const session = await this.createSetupSession(this.buildSetupParams(options, \"popup\"))\n\n return createSetupPopup(this.flowBaseUrl, {\n ...options,\n sessionToken: session.sessionToken,\n })\n }\n\n /**\n * Creates a setup session and redirects to the wizard (full-page navigation).\n * On completion, the user is redirected back to `redirectUri` with query params.\n */\n async accordSetupRedirect(options: AccordSetupRedirectOptions): Promise<void> {\n const session = await this.createSetupSession({\n ...this.buildSetupParams(options, \"redirect\"),\n redirectUri: options.redirectUri,\n state: options.state,\n })\n\n setupRedirect(this.flowBaseUrl, {\n ...options,\n sessionToken: session.sessionToken,\n })\n }\n\n // ── Preview ────────────────────────────────────────────────────────\n\n /**\n * Preview a template in an iframe.\n *\n * Creates a preview token via the API, then renders the preview in the\n * specified container. Returns a handle for controlling the preview.\n *\n * @example\n * ```ts\n * const preview = await overturo.previewTemplate({\n * templateId: \"tpl_abc123\",\n * container: \"#preview\",\n * device: \"mobile\",\n * theme: \"corporate\",\n * });\n * preview.setDevice(\"desktop\");\n * preview.destroy();\n * ```\n */\n async previewTemplate(options: PreviewTemplateOptions): Promise<PreviewHandle> {\n if (!options.templateId) throw new OverturoValidationError(\"templateId is required\")\n if (!options.container) throw new OverturoValidationError(\"container is required\")\n\n const response = await this.api.post<{ preview_url: string; token: string; expires_at: string }>(\n PREVIEW_TOKENS_PATH,\n {\n previewable_type: \"template\",\n previewable_id: options.templateId,\n theme: options.theme,\n device: options.device,\n locale: options.locale,\n }\n )\n\n return renderPreview(response.preview_url, options)\n }\n\n /**\n * Preview a setup session in an iframe.\n *\n * Creates a preview token via the API for the specified setup session,\n * then renders the preview in the specified container.\n *\n * @example\n * ```ts\n * const preview = await overturo.previewSetup({\n * sessionToken: \"acs_abc123\",\n * container: \"#preview\",\n * });\n * preview.setTheme(\"dark\");\n * preview.destroy();\n * ```\n */\n async previewSetup(options: PreviewSetupOptions): Promise<PreviewHandle> {\n if (!options.sessionToken) throw new OverturoValidationError(\"sessionToken is required\")\n if (!options.container) throw new OverturoValidationError(\"container is required\")\n\n const response = await this.api.post<{ preview_url: string; token: string; expires_at: string }>(\n PREVIEW_TOKENS_PATH,\n {\n previewable_type: \"setup_session\",\n previewable_id: options.sessionToken,\n theme: options.theme,\n device: options.device,\n locale: options.locale,\n }\n )\n\n return renderPreview(response.preview_url, options)\n }\n\n /**\n * Builds common CreateSetupSessionParams from any setup options variant.\n */\n private buildSetupParams(\n options: {\n solution?: string\n archetype?: string\n templateKey?: string\n constraints?: import(\"./types\").SetupConstraints\n presetId?: string\n locale?: string\n vertical?: string\n },\n deliveryMode: \"embed\" | \"popup\" | \"redirect\"\n ): CreateSetupSessionParams {\n return {\n solution: options.solution,\n vertical: options.vertical,\n archetype: options.archetype,\n templateKey: options.templateKey,\n deliveryMode,\n locale: options.locale,\n constraints: options.constraints,\n presetId: options.presetId,\n }\n }\n}\n","// A custom element class is evaluated when its module loads, and\n// `class X extends HTMLElement` throws where no DOM exists: a server render,\n// a Node test, the package entry imported on a server. The elements extend\n// this base instead — HTMLElement when the host has one, otherwise an inert\n// class that is never registered (`register*Element` already returns when\n// there is no `customElements`).\nexport const ElementBase: typeof HTMLElement =\n typeof HTMLElement === \"undefined\" ? (class {} as unknown as typeof HTMLElement) : HTMLElement\n","// `<overturo-decision>` custom element. NET-NEW\n// (no `<overturoid-button>` exists in v0 despite CLAUDE.md's claim).\n//\n// Usage:\n// <overturo-decision token=\"ds_…\" mode=\"embed\"></overturo-decision>\n// document.querySelector(\"overturo-decision\")\n// .addEventListener(\"decision:complete\", (e) => console.log(e.detail));\n//\n// Plan: Phase D.\n\nimport { validate, type Envelope } from \"../postmessage_v2\"\nimport { MESSAGE_TYPES_V2, isForeignEnvelope } from \"../constants\"\nimport type { DecisionMode } from \"../types\"\nimport { ElementBase } from \"../element_base\"\n\nexport const ELEMENT_NAME = \"overturo-decision\"\nexport const ALREADY_DEFINED_CODE = \"OVERTURO_ELEMENT_ALREADY_DEFINED\"\n\n/**\n * Reads `token` + `mode` + `theme` attributes; mounts the trust-host\n * iframe under a Shadow DOM root; emits CustomEvents for every\n * lifecycle transition. Consumers can subscribe with bare DOM APIs\n * (no SDK initialisation required for the simple case).\n *\n * Events fired (all CustomEvent):\n * `decision:ready` — `detail` is the READY payload\n * `decision:state` — `detail = {kind, payload}`\n * `decision:complete` — `detail = {kind, payload}`\n * `decision:cancel` — `detail` is the CANCEL payload\n * `decision:error` — `detail` is the ERROR payload\n * `decision:deadline` — `detail` is the DEADLINE payload\n */\nexport class DecisionElement extends ElementBase {\n static observedAttributes = [\"token\", \"mode\", \"theme\", \"flow-base-url\"]\n\n #shadow: ShadowRoot\n #iframe: HTMLIFrameElement | null = null\n #ac: AbortController | null = null\n #errorRegion: HTMLDivElement | null = null\n\n constructor() {\n super()\n this.#shadow = this.attachShadow({ mode: \"open\" })\n }\n\n connectedCallback(): void {\n if (!this.hasAttribute(\"role\")) this.setAttribute(\"role\", \"region\")\n if (!this.hasAttribute(\"aria-label\")) {\n this.setAttribute(\"aria-label\", \"Loading decision\")\n }\n this.setAttribute(\"aria-busy\", \"true\")\n if (!this.hasAttribute(\"tabindex\")) this.setAttribute(\"tabindex\", \"0\")\n this.addEventListener(\"keydown\", this.#onKey)\n this.#mount()\n }\n\n disconnectedCallback(): void {\n this.removeEventListener(\"keydown\", this.#onKey)\n this.#teardown()\n }\n\n attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void {\n if (oldValue === newValue) return\n if (!this.isConnected) return\n if (name === \"token\" || name === \"mode\" || name === \"flow-base-url\" || name === \"theme\") {\n // `theme` re-mounts so the iframe URL picks up the new\n // ?theme= query param. Costlier than CSS hot-swap but the\n // trust-host renders themed templates server-side; client-side\n // swap would require a postMessage round-trip and a kind-aware\n // theme schema, both out of v1 scope.\n this.#teardown()\n this.#mount()\n }\n }\n\n #mount(): void {\n const token = this.getAttribute(\"token\")\n if (!token) return // wait for attribute\n const mode = (this.getAttribute(\"mode\") as DecisionMode) ?? \"embed\"\n const flowBaseUrl = this.getAttribute(\"flow-base-url\") ?? defaultFlowBaseUrl()\n if (mode !== \"embed\") {\n // Popup + redirect modes don't make sense without JS interaction;\n // the element falls back to rendering a link the user clicks.\n this.#renderClickToOpen(flowBaseUrl, token, mode)\n return\n }\n\n // Append `?theme=…` to the URL if the host page set the `theme`\n // attribute. The trust-host server reads it from the query string\n // and applies the matching theme tokens. Unknown themes fall back\n // to the surface's default — no client-side validation needed.\n const themeAttr = this.getAttribute(\"theme\")\n const baseUrl = `${flowBaseUrl.replace(/\\/+$/, \"\")}/decisions/${token}/embed`\n const url = themeAttr ? `${baseUrl}?theme=${encodeURIComponent(themeAttr)}` : baseUrl\n const expectedOrigin = new URL(url).origin\n\n const iframe = document.createElement(\"iframe\")\n iframe.src = url\n iframe.title = \"Overturo decision form\"\n iframe.setAttribute(\"allow\", \"popups\")\n iframe.setAttribute(\"sandbox\", \"allow-scripts allow-forms allow-same-origin allow-popups\")\n iframe.style.cssText = \"width:100%;min-height:400px;border:0;background:transparent;\"\n if (themeAttr) iframe.dataset.theme = themeAttr\n const nonce = readCspNonce()\n if (nonce) iframe.setAttribute(\"nonce\", nonce)\n\n // Iframe-level error (CSP rejection, blocked origin). Match\n // decisions.embed's error handling: bubble an event with stable\n // code so consumers don't have to distinguish in the message\n // handler.\n iframe.addEventListener(\"error\", () => {\n this.dispatchEvent(\n new CustomEvent(\"decision:error\", {\n detail: {\n code: \"iframe_load_failed\",\n message: \"The trust-host iframe failed to load.\",\n },\n bubbles: true,\n composed: true,\n })\n )\n this.setAttribute(\"aria-busy\", \"false\")\n })\n\n this.#ac = new AbortController()\n const onMessage = (event: MessageEvent): void => {\n if (event.origin !== expectedOrigin || isForeignEnvelope(event.data)) return\n const result = validate(event.data)\n if (!result.valid) {\n this.#emitError({ code: \"protocol_violation\" })\n return\n }\n this.#handleEnvelope(event.data as Envelope, iframe)\n }\n window.addEventListener(\"message\", onMessage, { signal: this.#ac.signal })\n\n this.#iframe = iframe\n this.#shadow.appendChild(iframe)\n }\n\n #renderClickToOpen(flowBaseUrl: string, token: string, mode: DecisionMode): void {\n const a = document.createElement(\"a\")\n a.href = `${flowBaseUrl.replace(/\\/+$/, \"\")}/decisions/${token}`\n a.target = mode === \"popup\" ? \"_blank\" : \"_self\"\n a.rel = \"noopener noreferrer\"\n a.textContent = \"Open decision\"\n a.style.cssText = \"display:inline-block;padding:0.5em 1em;text-decoration:none;\"\n this.#shadow.appendChild(a)\n this.setAttribute(\"aria-busy\", \"false\")\n }\n\n #handleEnvelope(envelope: Envelope, iframe: HTMLIFrameElement): void {\n switch (envelope.type) {\n case MESSAGE_TYPES_V2.READY: {\n this.setAttribute(\"aria-busy\", \"false\")\n // Prefer `payload.title` then fall back to the\n // branding application_name from the schema-required `branding`\n // object. The trust-host MAY ship either; we read both.\n const payload = (envelope.payload ?? {}) as {\n title?: string\n branding?: { application_name?: string }\n }\n const labelSource =\n (typeof payload.title === \"string\" ? payload.title : null) ?? payload.branding?.application_name ?? null\n if (labelSource) {\n this.setAttribute(\"aria-label\", labelSource)\n }\n this.dispatchEvent(new CustomEvent(\"decision:ready\", { detail: envelope.payload }))\n break\n }\n case MESSAGE_TYPES_V2.STATE:\n this.dispatchEvent(\n new CustomEvent(\"decision:state\", {\n detail: { kind: envelope.kind, payload: envelope.payload },\n })\n )\n break\n case MESSAGE_TYPES_V2.RESIZE: {\n const height = (envelope.payload as { height?: number }).height\n if (typeof height === \"number\") iframe.style.height = `${height}px`\n break\n }\n case MESSAGE_TYPES_V2.COMPLETE:\n this.dispatchEvent(\n new CustomEvent(\"decision:complete\", {\n detail: { kind: envelope.kind, payload: envelope.payload },\n bubbles: true,\n composed: true,\n })\n )\n break\n case MESSAGE_TYPES_V2.CANCEL:\n this.dispatchEvent(\n new CustomEvent(\"decision:cancel\", {\n detail: envelope.payload,\n bubbles: true,\n composed: true,\n })\n )\n break\n case MESSAGE_TYPES_V2.ERROR:\n this.#emitError(envelope.payload as Record<string, unknown>)\n break\n case MESSAGE_TYPES_V2.DEADLINE:\n this.dispatchEvent(new CustomEvent(\"decision:deadline\", { detail: envelope.payload }))\n break\n }\n }\n\n #emitError(payload: Record<string, unknown>): void {\n this.dispatchEvent(new CustomEvent(\"decision:error\", { detail: payload, bubbles: true }))\n // Screen-reader announcement (\"screen-reader-only\").\n if (!this.#errorRegion) {\n this.#errorRegion = document.createElement(\"div\")\n this.#errorRegion.setAttribute(\"role\", \"alert\")\n this.#errorRegion.setAttribute(\"aria-live\", \"assertive\")\n this.#errorRegion.style.cssText = \"position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);\"\n this.#shadow.appendChild(this.#errorRegion)\n }\n const msg =\n typeof payload.message === \"string\" ? (payload.message as string) : \"An error occurred. Please try again.\"\n this.#errorRegion.textContent = msg\n // Auto-clear so a subsequent error fires another announcement.\n window.setTimeout(() => {\n if (this.#errorRegion) this.#errorRegion.textContent = \"\"\n }, 30_000)\n }\n\n #teardown(): void {\n if (this.#ac) {\n this.#ac.abort()\n this.#ac = null\n }\n if (this.#iframe && this.#iframe.parentNode) {\n this.#iframe.parentNode.removeChild(this.#iframe)\n }\n this.#iframe = null\n // Reset slotted error region (but keep the host's aria attributes\n // so consumers see a stable shape across re-mounts).\n if (this.#errorRegion) {\n this.#errorRegion.textContent = \"\"\n }\n this.setAttribute(\"aria-busy\", \"true\")\n }\n\n #onKey = (event: KeyboardEvent): void => {\n if (event.key === \"Escape\") {\n this.dispatchEvent(\n new CustomEvent(\"decision:cancel\", {\n detail: { reason: \"user_pressed_esc\" },\n bubbles: true,\n composed: true,\n })\n )\n this.#teardown()\n }\n }\n}\n\nfunction readCspNonce(): string | null {\n if (typeof document === \"undefined\") return null\n const meta = document.querySelector('meta[name=\"csp-nonce\"]')\n return meta?.getAttribute(\"content\") ?? null\n}\n\nfunction defaultFlowBaseUrl(): string {\n // Best-effort: same-origin. Consumers using a different trust host\n // MUST set the `flow-base-url` attribute (e.g. via a small inline\n // script that mirrors the SDK constructor's `flowBaseUrl`).\n if (typeof window !== \"undefined\") return window.location.origin\n return \"https://overturo.com\"\n}\n\n/**\n * Default registration. Side-effect import from `src/elements/index.ts`\n * triggers this on bundle load. Skipped (with a console warning) if\n * the element is already registered.\n */\nexport function registerDecisionElement(): void {\n if (typeof customElements === \"undefined\") return\n if (customElements.get(ELEMENT_NAME)) {\n // eslint-disable-next-line no-console\n console.warn(\"[overturo:sdk]\", ALREADY_DEFINED_CODE, `<${ELEMENT_NAME}> already registered; skipping.`)\n return\n }\n customElements.define(ELEMENT_NAME, DecisionElement)\n}\n","// element registration side effect. Importing\n// `@overturo/js/elements` triggers `customElements.define(\"overturo-decision\", …)`.\n// The default barrel (`src/index.ts`) re-exports this so the IIFE\n// bundle auto-registers; module consumers can opt out by importing\n// `{Overturo}` from \"@overturo/js/core\" (planned post-v1 — out of\n// v1 scope; documented as a follow-up).\n//\n\nexport { DecisionElement, ELEMENT_NAME, ALREADY_DEFINED_CODE, registerDecisionElement } from \"./decision_element\"\n\nimport { registerDecisionElement } from \"./decision_element\"\n\nregisterDecisionElement()\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAqCA,aAAS,OACPA,WACA,SAA8B;AAE9B,aAAO,EAAC,UAAAA,WAAU,QAAO;IAC3B;AAEa,YAAA,cAA8B;;MAEzC,MAAM,OAAO,MAAM,WAAW;;MAE9B,MAAM,OAAO,QAAQ,IAAI,GAAG,WAAW;MACvC,aAAa,OAAO,YAAY,IAAI,GAAG,eAAe;MACtD,YAAY,OAAO,QAAO,GAAI,cAAc;MAC5C,iBAAiB,OAAO,YAAW,GAAI,kBAAkB;;MAEzD,UAAU;MACV;MACA,iBACE;;MAEF,gBACE;;;MAGF,KAAK;MACL,OACE;MACF,UACE;;MAEF,MAAM;MACN,MAAM;MACN;;MAEA,MAAM;;;MAGN,gBAAgB;MAChB,6BAA6B;;MAE7B,yBAAyB;;;MAGzB;;MAEA,OAAO,EAAC,MAAM,UAAU,UAAU,cAAa;;MAE/C,OAAO,EAAC,MAAM,UAAU,UAAU,cAAa;;MAE/C,OAAO,EAAC,MAAM,UAAU,UAAU,eAAc;;MAEhD,QAAQ,EAAC,MAAM,UAAU,UAAU,eAAc;;MAEjD,UAAU;;MAEV,QAAQ;;AAGG,YAAA,cAA8B;MACzC,GAAG,QAAA;MACH,MAAM,OAAO,8BAA8B,WAAW;MACtD,MAAM,OACJ,8EACA,WAAW;MAEb,aAAa,OACX,uGACA,eAAe;MAEjB,YAAY,OACV,+EACA,cAAc;MAEhB,iBAAiB,OACf,4GACA,kBAAkB;;MAGpB,KAAK;MACL,iBAAiB;;;;MAIjB,OACE;;AAGS,YAAA,cAAc,OAAO,KAAK,QAAA,WAAW;AAElD,aAAS,WAAW,MAAY;AAE9B,aAAO,OAAO,MAAM,MAAM,OAAO,QAAQ,KAAK,OAAO,QAAQ;IAC/D;AAEA,QAAM,OAAO;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ete_default","formats0","error_default","deadline_default","formats0","state_default","complete_default","formats0","error_default","deadline_default","formats0","state_default","complete_default","error_default","deadline_default","_api","resolveContainer","applyStyle"]}
|