{
  "version": 3,
  "sources": ["../../src/index.tsx", "../../src/utils.ts", "../../src/datatypes.ts", "../../src/schema.tsx", "../../src/datasources.ts", "../../src/components.ts"],
  "sourcesContent": ["export * from './components.js'\nexport * from './datasources.js'\nexport * from './datatypes.js'\nexport * from './schema.js'\nexport * from './utils.js'\n", "/** Converts the keys of an object to kebab case. */\nexport const objectKeysToKebabCase = (object: Record<string, any> = {}) =>\n  Object.keys(object).reduce(\n    (acc, key) =>\n      Object.assign(acc, {\n        [toKebabCase(key)]: object[key]\n      }),\n    {} as Record<string, any>\n  )\nexport const objectKeysToCamelCase = (object: Record<string, any> = {}) =>\n  Object.keys(object).reduce(\n    (acc, key) =>\n      Object.assign(acc, {\n        [toCamelCase(key)]: object[key]\n      }),\n    {} as Record<string, any>\n  )\n\nexport function toKebabCase(str: string) {\n  const KEBAB_REGEX = /[A-Z\\u00C0-\\u00D6\\u00D8-\\u00DE]/g\n  return toCamelCase(str).replace(KEBAB_REGEX, function (match) {\n    return '-' + match.toLowerCase()\n  })\n}\nexport function toCamelCase(input: string): string {\n  input = input.replace(/[-_ ]+/g, ' ')\n  input = input.charAt(0).toLowerCase() + input.slice(1)\n  return input\n    .split(/\\s+/)\n    .map((word, index) => (index === 0 ? word : word.charAt(0).toUpperCase() + word.slice(1)))\n    .join('')\n}\n", "import { ExternalComponentSchemaProperty } from './components.js'\nimport { JSONSchema } from './schema.js'\n\nexport type ExternalComponentSchemaHandler = (\n  property: ExternalComponentSchemaProperty\n) => ExternalComponentSchemaProperty\n\n/**\n * Defines a custom data type, that can be expanded into multiple properties. Handler is defined as a function that\n * accepts all the nested properties and returns a new schema. This can be used to define nested structures that\n * redirect the properties to a nested definition, like Item does.\n *\n * `ui` property can be returned as well to customize UI settings for the type (accepts parameters of `ui:options` of UI\n * Schema (https://rjsf-team.github.io/react-jsonschema-form/docs/api-reference/uiSchema/) )\n *\n * A name of a custom type has to start with a capital letter.\n *\n * @param handler\n * @see https://doc.sitecore.com/xmc/en/developers/xm-cloud/the-simple-field-types.html\n *      https://doc.sitecore.com/xmc/en/developers/xm-cloud/the-link-field-types.html\n * @example\n *\n *   registerDataType(\n *     (schema) => ({\n *       type: 'string',\n *       description: 'My custom data type',\n *       ...schema\n *     }),\n *     { name: 'MyDataType' }\n *   )\n *\n *   registerComponent(MyComponent, {\n *     name: 'MyComponent',\n *     properties: {\n *       myField: {\n *         type: 'MyDataType',\n *         title: 'Title will mix with the description'\n *       }\n *     }\n *   })\n *\n */\nexport function registerDataType(\n  handler: ExternalComponentSchemaHandler,\n  {\n    name\n  }: {\n    name: string\n  }\n) {\n  if (name.charAt(0) != name.charAt(0).toUpperCase()) {\n    throw new Error('Custom types must start with a capital letter')\n  }\n  BYOCDataTypes[name] = handler\n}\n\n/**\n * Using `registerDataType` BYOC defines set of data types that are available in XM cloud.\n * It includes simple types like Date, String, etc, and then complex types link Link, Item and List.\n *\n * Custom types start with a capital letter.\n * - Top level field values are accessed directly by their names.\n * - Nested fields inside Item, can be accessed via `item.fields.<fieldName>.value` notation, or using\n * `getFieldValue(item.fields,\n * 'fieldName', defaultValue)` JSS helper.\n * - List items are accessed via `list[0].fields.<fieldName>.value` notation.\n *\n * When describing types of properties in components, you can use types provided by JSS: Field<...> and LinkField,\n * ItemField, ListField, ImageField, etc. The following is a list of all types, their respective JSS types and data\n * shapes.\n * | Type                | Typescript       | Shape |\n * | ------------------- | ---------------- | ----- |\n * | File                | FileField        | { src: string, title: string, displayName: string } |\n * | Date                | Field<string>    | \"2021-01-01T00:00:00.000Z\" |\n * | Datetime            | Field<string>    | \"2021-01-01T00:00:00.000Z\" |\n * | RichText            | Field<string>    | \"<p>Some text</p>\" |\n * | SingleLineText      | Field<string>    | \"Some text\" |\n * | MultiLineText       | Field<string>    | \"Some\\ntext\" |\n * | Image               | ImageField       | { src: string, ... } |\n * | Checkbox            | Field<boolean>   | true |\n * | Item                | Item             | { name: string, displayName: string, id: string, url: string, fields: { [key: string]: Field<any> } } |\n * | List                | Item[]           | { name: string, displayName: string, id: string, url: string, fields: { [key: string]: Field<any> } }[] |\n * | Link                | LinkField        | { href: string, text: string, linktype: string, title: string, class: string, target: string, anchor: string, querystring: string } |\n * | DropLink            | Item             | { name: string, displayName: string, id: string, url: string, fields: { [key: string]: Field<any> } } |\n * | DropTree            | Item             | { name: string, displayName: string, id: string, url: string, fields: { [key: string]: Field<any> } } |\n * | String              | Field<string>    | \"Some text\" |\n * | Number              | Field<number>    | 123 |\n * | Integer             | Field<number>    | 123 |\n * | Boolean             | Field<boolean>   | true |\n *\n * @example\n *\n * registerComponent(MyComponent, {\n *   name: 'MyComponent',\n *   description: 'Description of my example component',\n *   properties: {\n *     myField: {\n *       type: 'Datetime',\n *       title: 'My Field'\n *     },\n *     activities: {\n *       type: 'List',\n *       properties: {\n *         name: {\n *            type: 'String',\n *            title: 'Name of a person'\n *         },\n *         rank: {\n *           type: 'Number',\n *           description: 'Numerical rank, like 1, 2, 3, etc'\n *         }\n *       }\n *     },\n *     myItem: {\n *        type: 'Item',\n *        properties: {\n *          nestedField: {\n *            type: 'Number'\n *            title: 'Nested Field\n *         }\n *       }\n *     }\n *   }\n * })\n *\n *\n * function MyComponebnt(props: {myField: string, myItem: { fields: { nestedField: number } }, activities: { fields: { name: string, rank: number } }[] }) {\n *   return <>\n *    <div>{props.myField}</div>\n *    <div>{props.myItem.fields.nestedField} or {getFieldValue(props.myItem.fields, 'nestedField')}</div>\n *  </>\n * }\n *\n */\nexport const BYOCDataTypes: Record<string, ExternalComponentSchemaHandler> = {}\n\n/** Standard definition of a link */\nconst XMLinkHandler = () => ({\n  type: 'object',\n  properties: {\n    href: {\n      required: true,\n      type: 'string',\n      title: 'URL',\n      description:\n        'The URL of the link, except for media items, for which the Url property contains the path to the media item relative to /Sitecore/Media Library.'\n    },\n    text: { type: 'string', title: 'Text', description: 'The text content of the HTML <a> element.' },\n    linktype: {\n      type: 'string',\n      enum: ['internal', 'external', 'media', 'anchor', 'mailto', 'javascript'],\n      default: 'internal',\n      title: 'Target',\n      description: 'The target attribute of the HTML <a> element.'\n    },\n    title: { type: 'string', title: 'Title', description: 'The title attribute of the HTML <a> element.' },\n    //className: { type: 'string', title: 'Class Name', description: 'The class attribute of the HTML <a> element.' },\n    class: { type: 'string', title: 'Class Name', description: 'The class attribute of the HTML <a> element.' },\n    target: {\n      type: 'string',\n      title: 'Target',\n      description: 'The target attribute of the HTML <a> element.',\n      enum: ['', '_blank', '_self', '_parent', '_top']\n    },\n    anchor: {\n      type: 'string',\n      title: 'Anchor',\n      description: 'The name attribute of the HTML <a> element, without the leading hash character (\u201C#\u201D).'\n    },\n    querystring: { type: 'string', title: 'Query String', description: 'Query string parameters to add to the URL.' }\n  }\n})\n\nconst ItemHandler = ({ properties, ...schema }: ExternalComponentSchemaProperty) => ({\n  ...schema,\n  type: 'object',\n  properties: {\n    name: { type: 'string' },\n    displayName: { type: 'string' },\n    id: { type: 'string' },\n    url: { type: 'string' },\n    fields: propertiesToFields(properties)\n  }\n})\n\nfunction propertiesToFields(properties: Record<string, JSONSchema> | undefined = {}) {\n  return {\n    type: 'object',\n    properties: Object.keys(properties).reduce((fields, key) => {\n      const { title, ...rest } = properties[key]\n      return {\n        ...fields,\n        [key]: {\n          type: 'object',\n          properties: {\n            value: {\n              title: title || key,\n              ...properties[key]\n            }\n          }\n        }\n      }\n    }, {})\n  }\n}\n\nexport const XMTypes = {\n  Link: XMLinkHandler,\n  DropLink: ItemHandler,\n  DropTree: ItemHandler,\n  File: () => ({\n    type: 'object',\n    properties: {\n      src: { type: 'string', title: 'Source', description: 'The URL of the file.' },\n      title: { type: 'string', title: 'Title', description: 'Title of a file' },\n      displayName: { type: 'string', title: 'Display name', description: 'Display name of a file' }\n    }\n  }),\n  Date: () => ({\n    type: 'string',\n    format: 'date'\n  }),\n  Datetime: () => ({\n    type: 'string',\n    format: 'date-time'\n  }),\n  RichText: () => ({\n    type: 'string'\n  }),\n  Image: (schema: ExternalComponentSchemaProperty) => ({\n    type: 'object',\n    properties: {\n      src: { type: 'string' },\n      ...schema.properties\n    }\n  }),\n  SingleLineText: () => {\n    type: 'string'\n  },\n  MultiLineText: () => ({\n    type: 'string'\n  }),\n  Checkbox: () => ({\n    type: 'boolean'\n  }),\n  String: () => ({\n    type: 'string'\n  }),\n  Number: () => ({\n    type: 'number'\n  }),\n  Boolean: () => ({\n    type: 'boolean'\n  }),\n  Item: ItemHandler,\n  List: ({ properties, ...schema }: ExternalComponentSchemaProperty) => ({\n    ...schema,\n    type: 'array',\n    items: {\n      type: 'object',\n      properties: {\n        name: { type: 'string' },\n        displayName: { type: 'string' },\n        id: { type: 'string' },\n        url: { type: 'string' },\n        fields: propertiesToFields(properties)\n      }\n    }\n  })\n} as const\n\n// Register all default XM data types\nObject.keys(XMTypes).forEach((property) => {\n  registerDataType(XMTypes[property as keyof typeof XMTypes] as ExternalComponentSchemaHandler, { name: property })\n})\n\nexport type XMTypes = typeof XMTypes\n", "import type { UiSchema } from '@rjsf/utils'\n\n/** Simplified JSON schema for improved suggestions */\nimport { JSONSchema7, JSONSchema7Type, JSONSchema7TypeName } from 'json-schema'\nimport { toCamelCase, toKebabCase } from './utils.js'\nimport { BYOCDataTypes } from './datatypes.js'\nexport type JSONSchema7GenericKeys = Exclude<\n  keyof JSONSchema7,\n  // Type-specific properties\n  | 'items'\n  | 'additionalItems'\n  | 'properties'\n  | 'additionalProperties'\n  | 'patternProperties'\n  | 'dependencies'\n  | 'required'\n  | 'minProperties'\n  | 'maxProperties'\n  | 'minItems'\n  | 'maxItems'\n  | 'uniqueItems'\n  | 'minLength'\n  | 'maxLength'\n  | 'pattern'\n  | 'format'\n  | 'minimum'\n  | 'maximum'\n  | 'multipleOf'\n  | 'exclusiveMinimum'\n  | 'exclusiveMaximum'\n  | 'propertyNames'\n  | 'contains'\n  // Rarely used or more obscure properties\n  | '$schema'\n  | 'definitions'\n  | '$defs'\n  | '$comment'\n  | 'const'\n  | 'examples'\n  | 'readOnly'\n  | 'writeOnly'\n  | 'contentMediaType'\n  | 'contentEncoding'\n  | 'if'\n  | 'then'\n  | 'else'\n  | 'allOf'\n  | 'anyOf'\n  | 'oneOf'\n  | 'not'\n  // Advanced features\n  | '$ref'\n  | '$id'\n>\n\n/** Schema for common properties. */\nexport interface BaseSchema<T extends JSONSchema7TypeName> extends Pick<JSONSchema7, JSONSchema7GenericKeys> {\n  /** The type of data. */\n  type: T\n  [key: string]: any\n}\n\n/** Schema for string type properties. */\nexport interface StringSchema extends BaseSchema<'string'> {\n  /** Minimum length of the string. */\n  minLength?: number\n  /** Maximum length of the string. */\n  maxLength?: number\n  /** A regex pattern the string should match. */\n  pattern?: string\n  /** Named format the string should adhere to. */\n  format?: string\n}\n\n/** Schema for number type properties. */\nexport interface NumberSchema extends BaseSchema<'number' | 'integer'> {\n  /** Minimum value of the number. */\n  minimum?: number\n  /** Maximum value of the number. */\n  maximum?: number\n  /** The number should be a multiple of this value. */\n  multipleOf?: number\n}\n\n/** Schema for object type properties. */\nexport interface ObjectSchema extends BaseSchema<'object'> {\n  /** Properties of the object. */\n  properties?: Record<string, JSONSchema>\n  /** Additional properties not covered by 'properties'. */\n  additionalProperties?: JSONSchema | boolean\n  /** Array of required properties. */\n  required?: string[]\n  /** Minimum number of properties. */\n  minProperties?: number\n  /** Maximum number of properties. */\n  maxProperties?: number\n  /** Properties matching the patterns. */\n  patternProperties?: Record<string, JSONSchema>\n  /** Property dependencies. */\n  dependencies?: Record<string, JSONSchema | string[]>\n}\n\n/** Schema for array type properties. */\nexport interface ArraySchema extends BaseSchema<'array'> {\n  /** Items in the array. */\n  items?: JSONSchema | JSONSchema[]\n  /** Additional items not covered by 'items'. */\n  additionalItems?: JSONSchema | boolean\n  /** Minimum number of items. */\n  minItems?: number\n  /** Maximum number of items. */\n  maxItems?: number\n  /** All items should be unique. */\n  uniqueItems?: boolean\n}\n\n/** Schema for boolean type properties. */\nexport interface BooleanSchema extends BaseSchema<'boolean'> {}\n\n/** Schema for null type properties. */\nexport interface NullSchema extends BaseSchema<'null'> {}\n\n/** Definition of JSON Schema type. */\nexport type JSONSchema = StringSchema | NumberSchema | ObjectSchema | ArraySchema | BooleanSchema | NullSchema\n\n/**\n * JSON Schema is limited in describing how a given data type should be rendered as a form input component. That's why\n * this library introduces the concept of uiSchema.\n *\n * A UI schema is basically an object literal providing information on how the form should be rendered, while the JSON\n * schema tells what.\n *\n * @see https://rjsf-team.github.io/react-jsonschema-form/docs/api-reference/uiSchema\n * @example\n *\n * {\n *       // Present color choices as radio buttons\n *       color: { 'ui:widget': 'radio' },\n *       // Text is a textarea with 5 rows\n *       text: { 'ui:widget': 'textarea', 'ui:options': { rows: 5 } },\n *       // Count is a number field with spinner button\n *       count: { 'ui:widget': 'updown' }\n *     },\n *\n */\n\nexport type UISchema = UiSchema\nexport type JSONSchemaConstruct = Partial<ArraySchema | ObjectSchema>\n\n/**\n * Iterate JSON schema including nested constructs like oneOf, allOf, if, then, etc. creating a copy in process.\n *  */\nexport function traverseSchema(\n  schema: JSONSchemaConstruct,\n  callback: (value: JSONSchemaConstruct) => JSONSchemaConstruct\n): JSONSchemaConstruct {\n  var traversed = {} as Partial<ArraySchema | ObjectSchema>\n  for (var property in schema) {\n    const value = schema[property]\n    if (value && typeof value === 'object') {\n      if (Array.isArray(value)) {\n        traversed[property] = value.map((item) =>\n          typeof item === 'object' && item ? traverseSchema(item, callback) : item\n        )\n      } else {\n        traversed[property] = traverseSchema(callback(value), callback)\n      }\n    } else {\n      traversed[property] = schema[property]\n    }\n  }\n  return traversed\n}\n\n/**\n * Normalizes schema and assigns default values. It will traverse schema to normalize nested constructs.\n */\nexport function transformSchema(schema: Partial<ObjectSchema | ArraySchema>, defaults: Record<string, any> = {}) {\n  schema = transformSchemaObject({\n    /** 1. Assign schema type unless given */\n    type: 'object',\n    /** 2. Ensure that properties is not null */\n    properties: {},\n    required: [],\n    ...schema\n  })\n  // Iterate nested constructs, without passing the defaults object\n  return traverseSchema(schema, (construct) =>\n    construct.properties ? transformSchemaObject(construct, defaults) : construct\n  )\n}\n/**\n * Normalizes schema and assigns default values\n */\nexport function transformSchemaObject(\n  schema: Partial<ObjectSchema | ArraySchema>,\n  defaults: Record<string, any> = {}\n): ObjectSchema | ArraySchema {\n  const transformed = { ...schema }\n  if (transformed.properties) {\n    transformed.required = schema.required?.slice() || []\n    transformed.properties = Object.keys(transformed.properties).reduce((acc: ObjectSchema['properties'], key) => {\n      const given = transformed.properties[key]\n      const custom = BYOCDataTypes[given?.type]?.(given)\n      const property = {\n        ...custom,\n        ...given,\n        type: custom?.type || given.type,\n        /** 3. Assign default value from the explicit defaults object*/\n        default: defaults.hasOwnProperty(key) ? defaults[key] : given.default,\n        /** 4. Generate fallback title */\n        title:\n          given.title ||\n          toKebabCase(key)\n            .split('-')\n            .map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n            .join(' ')\n      }\n      if (given?.properties || custom?.properties) {\n        property.properties = {\n          ...(custom?.properties || given?.properties)\n        }\n        // Auto-merge property definitions if their names match. Will bail out when expanding nested objects like Item and List\n        Object.keys(custom?.properties || {}).forEach((subKey) => {\n          property.properties[subKey] = { ...custom?.properties?.[subKey], ...given?.properties?.[subKey] }\n        })\n      }\n      if (given?.items || custom?.items) {\n        property.items = custom?.items || given?.items\n      }\n      if (property.default === undefined) {\n        delete property.default\n      }\n      if ('required' in property && typeof property.required == 'boolean') {\n        if (transformed.required.indexOf(key) == -1) {\n          transformed.required.push(key)\n        }\n        delete property.required\n      }\n      return Object.assign(acc as any, {\n        [key]: property\n      })\n    }, {}) as Partial<ObjectSchema>\n  }\n  return {\n    type: 'object',\n    ...transformed\n  } as ObjectSchema\n}\n/** Make UI schema assumptions to improve the ui */\nexport const transformUiSchema = (uiSchema: UISchema, properties: Record<string, any>) => {\n  let transformed: UISchema = {\n    ...uiSchema\n  }\n\n  for (var property in properties) {\n    if (typeof properties[property] != 'object' || !properties[property]) {\n      continue\n    }\n    if (properties[property]?.type == 'integer' || properties[property]?.type == 'number') {\n      transformed[property] = {\n        ...transformed[property],\n        'ui:options': {\n          widget: 'updown'\n        }\n      }\n    }\n    if (properties[property]?.ui) {\n      transformed[property] = {\n        ...transformed[property],\n        'ui:options': {\n          ...transformed[property]?.['ui:options'],\n          ...properties[property].ui\n        }\n      }\n    }\n    transformed = {\n      ...transformed,\n      [property]: properties[property].items\n        ? { items: transformUiSchema(transformed[property], properties[property].items.properties) }\n        : transformUiSchema(transformed[property], properties[property].properties || {})\n    }\n  }\n\n  return transformed\n}\n\n/** Parses a property value based on its property name and type defined in the JSON properties object. */\nexport function parseValue(value: any, type: JSONSchema['type']) {\n  switch (type) {\n    case 'string':\n      return value\n    case 'object':\n      try {\n        return typeof value == 'object' && value != null ? value : JSON.parse(value)\n      } catch (e) {\n        return null\n      }\n    case 'array':\n      try {\n        return Array.isArray(value) ? value : JSON.parse(value)\n      } catch (e) {\n        return null\n      }\n    case 'number':\n      return parseFloat(value)\n    case 'integer':\n      return parseInt(value)\n    case 'boolean':\n      return value == 'true' || value == '1'\n    default:\n      return value\n  }\n}\n\n/** Transform properties to match the schema types of a specified component. It will parse json for objects and arrays. */\nexport function parseSchemaProperties(schema: JSONSchema, props: Record<string, string>): any {\n  return Object.keys(props).reduce((prev, name) => {\n    const value = props[name]\n    const prop = toCamelCase(name)\n    const definition = schema?.properties[prop]\n    const type = definition?.type\n    const parsed = parseValue(value, type)\n    if (parsed != null && !name.startsWith('data-attribute') && !['class', 'id', 'contenteditable'].includes(name)) {\n      return { ...prev, [prop]: parsed }\n    } else {\n      return prev\n    }\n  }, {})\n}\n/**\n * 1. Transform properties to match the schema types of a specified component. It will parse json for objects and arrays.\n * 2. Combine it with default values as defined by the schema\n */\nexport function getSchemaProperties(schema: JSONSchema, props: Record<string, string>): any {\n  return {\n    ...getSchemaDefaults(schema),\n    ...parseSchemaProperties(schema, props)\n  }\n}\n/** Get properties with their default non-null values*/\nexport function getSchemaDefaults(schema: JSONSchema): any {\n  return Object.keys(schema.properties).reduce((prev, prop) => {\n    if (schema.properties[prop]?.default != null) {\n      return { ...prev, [prop]: schema.properties[prop]?.default }\n    } else {\n      return prev\n    }\n  }, {})\n}\n", "import { DataSettings } from './lib/types.js'\nimport { ArraySchema, JSONSchema, ObjectSchema, transformSchema } from './schema.js'\n\nexport type DataHandler = (settings: DataSettings) => Partial<DataSettings> | Promise<any>\nexport type RequestConfigurator = (resource: RequestInfo, options?: RequestInit) => Promise<Response> // DROP THIS\n// Store registered datasources in a global variable BYOCDatasources for external access\n// On the clientside the datasource registry is shared via global variable, on server it doesnt to avoid breaking next.js\nexport const registeredDatasources: Record<string, RegisteredDatasource> =\n  typeof window != 'undefined' ? (window.BYOCDatasources ||= {}) : {}\n\n/**\n * Registers a custom datasource with the provided function and schema.\n *\n * @param handler               - A function that returns the DataSettings settings.\n * @param options               - Options for the datasource. Includes the datasource id, schema, and other\n *                              metadata.\n * @param {string} options.id            - Unique identifier of the datasource.\n * @param {string} [options.name]        - (Optional) Internal name of a datasource. Defaults to the id.\n * @param {string} [options.sample]      - (Optional) Sample data for the datasource (alternative to schema).\n * @param {string} [options.type]        - (Optional) JSON Schema type (array or object).\n * @param {string} [options.properties]  - (Optional) JSON Schema properties definition.\n * @param {string} [options.schema]      - (Optional) Whole JSON Schema definition.\n * @returns Void.\n * @example\n *\n *   // HTTP-based datasource, described by schema\n *\n *   registerDatasource(\n *     () => ({\n *       url: 'https://api.sampleapis.com/wines/reds'\n *     }),\n *     {\n *       id: 'http-and-schema',\n *       name: 'Wines via HTTP',\n *       description: 'List of red wines fetched by HTTP, each with `wine`, `price` and `id` property',\n *       type: 'array',\n *       properties: {\n *         wine: { type: 'string' },\n *         price: { type: 'string' },\n *         id: { type: 'number' }\n *       }\n *     }\n *   )\n *\n * @example\n *\n * // When datasource is registered with ID of a datasource that exist in the library, it can adjust the data settings of the\n * original request.\n *\n * registerDatasource(\n *   // settings will contain DataSettings as specified via UI in Components app\n *   (settings) => ({\n *     ...settings,\n *     params: {\n *       // add ?page=2 parameter to the original URL\n *       ...settings.params,\n *       page: 2\n *     },\n *     headers: {\n *       // add Authorization header in addition to original headers\n *       ...settings.headers,\n *       Authorization: 'Bearer token'\n *     }\n *   }),\n *   {\n *     // ID of a datasource as created in UI (can be visible in the address bar URL) to be extended\n *     // No other options are specified in this case.\n *     id: 'aBcDaaa23a'\n *   }\n * )\n *\n * @example\n *\n *   import { promises as fs } from 'fs'\n *   // Async handlers supposed to return data itself instead of DataSettings\n *\n *   registerDatasource(\n *     async () => {\n *       return JSON.parse(await fs.readFile('wines.json', 'utf-8'))\n *     },\n *     {\n *       id: 'file-and-sample',\n *       name: 'Wines from JSON file',\n *       description: 'JSON file read and parsed from file (no HTTP request is made), with sample data',\n *       sample: [\n *         { wine: 'Emporda 2012', id: 1, price: '$250' },\n *         { wine: 'P\u00EAra-Manca Tinto 1990', id: 2, price: '$312' }\n *       ]\n *     }\n *   )\n *\n */\nexport function registerDatasource(\n  handler: DataHandler,\n  options: {\n    sample?: any\n    schema?: ArraySchema | ObjectSchema\n    id: string\n    name?: string\n    description?: string\n    title?: string\n    properties?: JSONSchema['properties']\n    type?: 'array' | 'object'\n  }\n) {\n  if (typeof handler !== 'function') {\n    throw new Error(\n      `The first argument of registerDatasource must be a function returning DataSettings or Promise of data`\n    )\n  }\n\n  if (!options.id) {\n    throw new Error(`Missing 'id' property in input`)\n  }\n\n  const idRegex = /^[a-zA-Z0-9-_]+$/\n  if (!idRegex.test(options.id)) {\n    throw new Error(\n      `Invalid 'id' property in input. 'id' should only contain alphanumeric characters, hyphens, and underscores.`\n    )\n  }\n\n  //if (getDatasource(options.id)?.handler != null) {\n  //  throw new Error(`Datasource with id ${options.id} already registered`)\n  //}\n\n  registeredDatasources[options.id] = {\n    ...normalizeDatasourceOptions(options),\n    handler\n  }\n\n  setRegistrationCallback()\n}\nexport type DatasourceOptionsInput = Parameters<typeof registerDatasource>[1]\n\n/**\n * Returns the registered datasource with the provided id.\n *\n * @param id  - The id of the registered datasource.\n * @returns The registered datasource.\n */\nexport function getDatasource(id: RegisteredDatasource['id']) {\n  return registeredDatasources[id]\n}\n\n/**\n * Normalizes the datasource options. If the schema is not provided, it will be derived from the properties.\n *\n * @param datasourceOptions  - The datasource options.\n * @returns The normalized datasource options.\n */\nfunction normalizeDatasourceOptions(datasourceOptions: DatasourceOptionsInput) {\n  const { id, name, title, properties, sample, schema, description = null, type = 'object' } = datasourceOptions\n\n  return {\n    id,\n    description,\n    sample,\n    name: name || title || id,\n    handler: ((settings) => settings) as DataHandler,\n    schema:\n      schema || properties\n        ? transformSchema({\n            ...(schema || { properties, type }),\n            title: schema?.title || title || name\n          })\n        : undefined\n  }\n}\n\nexport type RegisteredDatasource = ReturnType<typeof normalizeDatasourceOptions>\n\nvar registrationCallback: ReturnType<typeof setTimeout>\nvar datasourceRegistrationAcknowledged = false\nvar datasourceRegistrationRetryCount = 0\nvar datasourceAckListenerAdded = false\n// Extended retry configuration to ensure reliable datasource registration\n// Total retry window: ~30 seconds (150 retries \u00D7 200ms)\n// This addresses race conditions where parent window listener may not be ready immediately\nconst DATASOURCE_MAX_RETRY_ATTEMPTS = 150\nconst DATASOURCE_RETRY_INTERVAL = 200 // ms\n\n/**\n * Set up acknowledgment listener for datasource registration.\n * This listener receives confirmation from the parent window that datasources were registered.\n */\nfunction setupDatasourceAckListener() {\n  if (typeof window === 'undefined' || datasourceAckListenerAdded) return\n\n  datasourceAckListenerAdded = true\n  window.addEventListener('message', (event) => {\n    try {\n      const data = typeof event.data === 'string' ? JSON.parse(event.data) : event.data\n      if (data.action === 'register-datasources-ack') {\n        datasourceRegistrationAcknowledged = true\n        datasourceRegistrationRetryCount = 0\n        clearTimeout(registrationCallback)\n      }\n    } catch (e) {\n      // Ignore parse errors from other messages\n    }\n  })\n}\n\n/**\n * Sends datasource registration to parent window with retry logic.\n * Retries up to DATASOURCE_MAX_RETRY_ATTEMPTS times until acknowledgment is received.\n */\nfunction setRegistrationCallback() {\n  clearTimeout(registrationCallback)\n\n  if (typeof window !== 'undefined' && window.parent !== window) {\n    // Set up acknowledgment listener on first call\n    setupDatasourceAckListener()\n\n    // Reset acknowledgment state when new registration is triggered\n    datasourceRegistrationAcknowledged = false\n    datasourceRegistrationRetryCount = 0\n\n    const sendRegistration = () => {\n      // Stop if already acknowledged or max retries reached\n      if (datasourceRegistrationAcknowledged) {\n        return\n      }\n\n      if (datasourceRegistrationRetryCount >= DATASOURCE_MAX_RETRY_ATTEMPTS) {\n        // Max retries reached, stop trying but don't log error to avoid noise\n        return\n      }\n\n      // Send datasources to parent window\n      window.parent?.postMessage(\n        JSON.stringify({\n          action: 'register-datasources',\n          data: Object.values(registeredDatasources)\n        }),\n        '*'\n      )\n\n      datasourceRegistrationRetryCount++\n\n      // Schedule next retry if not acknowledged\n      if (!datasourceRegistrationAcknowledged && datasourceRegistrationRetryCount < DATASOURCE_MAX_RETRY_ATTEMPTS) {\n        registrationCallback = setTimeout(sendRegistration, DATASOURCE_RETRY_INTERVAL)\n      }\n    }\n\n    // Initial delay before first send (maintains original behavior)\n    registrationCallback = setTimeout(sendRegistration, 30)\n  }\n}\nsetRegistrationCallback()\n\n/**\n * For given datasource id and original settings, either returns adjusted settings or a promise of data.\n */\nexport function customizeDataSettings(\n  id: RegisteredDatasource['id'],\n  settings: DataSettings\n): Partial<DataSettings> | Promise<any> {\n  const datasource = registeredDatasources[id]\n\n  if (datasource?.handler) {\n    return datasource.handler(settings)\n  }\n\n  return settings\n}\n\ndeclare global {\n  interface Window {\n    BYOCDatasources: Record<string, RegisteredDatasource>\n  }\n}\n", "import { getDatasource, registerDatasource } from './datasources.js'\nimport { XMTypes } from './datatypes.js'\nimport {\n  getSchemaProperties,\n  JSONSchema,\n  ObjectSchema,\n  parseValue,\n  transformSchema,\n  transformUiSchema,\n  UISchema\n} from './schema.js'\nimport { objectKeysToKebabCase, toKebabCase } from './utils.js'\n\n/** Normalized BYOC component */\nexport interface MinimalComponentProps {\n  componentName: string\n  uid?: string\n  datasources?: Record<string, any>\n  [prop: string]: any\n}\n\nexport interface ContextProperties {\n  [key: string]: any\n}\n\n/**\n * Component use [JSON Schema]{@link https://json-schema.org}, which is a declarative language that allows you to\n * annotate and validate JSON documents.\n *\n * In context of external components it is used to describe properties that component accept. It is used for documenting\n * options, parsing the values and generating the configuration UI. It is possible to provide [UI\n * Schema]{@link https://rjsf-team.github.io/react-jsonschema-form/docs/api-reference/uiSchema} as well to fine tune the\n * form UI.\n *\n * @param {string}                   title                 Component name as presented to the user.\n * @param {JSONSchema['properties']} properties            Object of properties.\n * @param {JSONSchema['type']}       properties[].type     JSON Schema type of a property.\n * @param {string}                   [properties[].title]  Optional title displayed to the user.\n * @param {string}                   [group]               Optional Image to be displayed in the UI.\n * @param {string}                   [thumbnail]           Optional title displayed to the user.\n * @param {UISchema}                 [ui]                  Optional component groupping.\n * @see https://json-schema.org\n * @see https://rjsf-team.github.io/react-jsonschema-form/docs/api-reference/uiSchema\n * @example\n *\n * {\n *     // Name of a component as it will be presented to the user\n *     title: 'My Component',\n *     // Optional: Thumbnail image for component to be displayed in UI\n *     thumbnail: 'http://examaple.com/component.jpg',\n *     // Optional: Group components by name\n *     group: 'Assorted components',\n *     // Definitions of three configurable properties that MyComponent accepts\n *     properties: {\n *       // Color is a string, but only Red/Green/Blue are allowed\n *       color: { type: 'string', enum: ['red', 'green', 'blue'] },\n *       // Text is a property labelled as \"Text summary\"\n *       text: { type: 'string', title: 'Text summary' },\n *       // Count is a number with 1 as default value\n *       count: { type: 'number', default: 1 }\n *     },\n *     // Optional UI schema customization\n *     ui: },\n *     // Color and text area required properties\n *     required: ['color', 'text']\n *   })\n *\n */\ntype UppercaseLetters =\n  | 'A'\n  | 'B'\n  | 'C'\n  | 'D'\n  | 'E'\n  | 'F'\n  | 'G'\n  | 'H'\n  | 'I'\n  | 'J'\n  | 'K'\n  | 'L'\n  | 'M'\n  | 'N'\n  | 'O'\n  | 'P'\n  | 'Q'\n  | 'R'\n  | 'S'\n  | 'T'\n  | 'U'\n  | 'V'\n  | 'W'\n  | 'X'\n  | 'Y'\n  | 'Z'\n\n/** Custom types start with uppercase letter */\nexport type ExternalComponentCustomType = keyof XMTypes | `${UppercaseLetters}${string}`\nexport type ExternalComponentSchemaProperty = ObjectSchema & { isHidden?: boolean; ui?: UISchema }\nexport type ExternalComponentOptions<T> = Omit<Partial<JSONSchema>, 'properties'> & {\n  /**  Optional unique identifier of a component (falls back to name if not provided) */\n  id?: string\n  /**  Internal name of a component */\n  name: string\n  /** Description of a component */\n  description?: string\n  /** Title of a component as it will be presented to the user */\n  title?: string\n  /** Object containing JSONSchema definitions of properties for instances of the component. */\n  properties?: {\n    /** Single property */\n    [propertyName in keyof T]?: Omit<JSONSchema, 'type'> & {\n      /** Type of the property (string, array, object, number, integer, null) */\n      type: JSONSchema['type'] | ExternalComponentCustomType\n      /** Optional title displayed to the user */\n      title?: JSONSchema['title']\n      /** Hide property configuration from UI  */\n      isHidden?: boolean\n      /** Default value for a property, should be valid and of correct type */\n      default?: any\n    }\n  }\n  /** Optional thumbnail to be displayed in the UI when listing components */\n  thumbnail?: string\n  /** Name of a collection to group components by (default: Ungroupped) */\n  group?: string\n  /** Hide component from the UI */\n  isHidden?: boolean\n  /** List of datasource IDs that component supports */\n  datasourceIds?: string[]\n  /** Key/value list of links to be displayed in BYOC Marketplace */\n  links?: Record<string, string>\n  /** Key/value list of links to be displayed in BYOC Marketplace */\n  meta?: Record<string, string>\n  /**\n   * UI Schema providing customization of form UI.\n   *\n   * @see https://json-schema.org\n   */\n  ui?: UISchema\n}\n\nexport type ExternalComponentHandler<P = any> =\n  | React.ComponentType<P>\n  | ((props: P) => Promise<React.ReactElement>)\n  | WebComponent\n  | null\n\nexport type WebComponent = typeof WebComponent\n\nexport function normalizeOptions<P>(\n  options: ExternalComponentOptions<P>,\n  component?: ExternalComponentHandler<P>,\n  defaults?: any\n) {\n  /**\n   * Usually property schema *is* the options, and ui schema is in `options.ui` property. This function normalizes schemas,\n   * as stores them as `uiSchema` and `schema` properties respectively. The registerComponent() call can be made with previously\n   * normalized properties (e.g. in parent frame), so it has to supports those as well.\n   */\n  const {\n    thumbnail = 'https://feaasstatic.blob.core.windows.net/assets/thumbnails/byoc.svg',\n    name,\n    id = options.name,\n    group = null,\n    ui,\n    isHidden = false,\n    datasourceIds = [],\n    links = {},\n    meta = {},\n    uiSchema: explicitUISchema,\n    schema: explicitSchema,\n    ...schemaOptions\n  } = options\n  const schemaBase = explicitSchema || schemaOptions || {}\n  const useSchemaBase = explicitUISchema || ui || {}\n  const schema = transformSchema(\n    { description: 'External component', ...schemaBase, type: 'object' },\n    defaults\n  ) as ObjectSchema\n  const uiSchema = transformUiSchema(useSchemaBase, schema.properties || {})\n  return {\n    component: component || (() => null),\n    name,\n    schema,\n    uiSchema,\n    thumbnail,\n    group: group || 'Default collection',\n    isHidden,\n    id,\n    datasourceIds,\n    links,\n    meta,\n    title: schema?.title || schemaOptions?.title || name\n  }\n}\nexport type ExternalComponent<P = any> = ReturnType<typeof normalizeOptions<P>>\n\nvar registrationCallback: ReturnType<typeof setTimeout>\nvar componentRegistrationAcknowledged = false\nvar componentRegistrationRetryCount = 0\nvar componentAckListenerAdded = false\n// Extended retry configuration to ensure reliable component registration\n// Total retry window: ~30 seconds (150 retries \u00D7 200ms)\n// This addresses race conditions where parent window listener may not be ready immediately\nconst COMPONENT_MAX_RETRY_ATTEMPTS = 150\nconst COMPONENT_RETRY_INTERVAL = 200 // ms\n\n// Shim in case it's required in node.js environment\nexport const WebComponent = (typeof HTMLElement != 'undefined'\n  ? HTMLElement\n  : // @ts-ignore\n  typeof windowJSDOM != 'undefined'\n  ? // @ts-ignore\n    (windowJSDOM.HTMLElement as typeof HTMLElement)\n  : (class {\n      setAttribute() {}\n    } as unknown as typeof HTMLElement)) as any as typeof HTMLElement\n\n// Store registered components in a global variable BYOCComponents for external access\n// On the clientside the component registry is shared via global variable, on server it doesnt to avoid breaking next.js\nexport const registered: Record<string, ExternalComponent> =\n  typeof window != 'undefined' ? (window.BYOCComponents ||= {}) : {}\n\n/**\n * Register React component to be renderable as Sitecore component (in Components and Pages). Properties are defined as\n * {@link https://json-schema.org JSON Schema}, from which a configuration form will be produced using\n * {@link https://rjsf-team.github.io/react-jsonschema-form/ RJSF library}. The library allows passing a\n * {@link https://rjsf-team.github.io/react-jsonschema-form/docs/api-reference/uiSchema UI Schema} that allows tight\n * customization of form widgets, styles and behavior.\n *\n * Schema properties supports `default` option which provides a fallback value. Alternatively default properties can be\n * passed as plain javascript object as third argument to `registerComponent` call.\n *\n * It is possible to generate same component and schema with different defaults, as separate components by altering the\n * `id` property. This is used for to expand generic component like Form into different specific Form instances.\n *\n * @param {React.ComponentType}      component                     React component that will be rendered.\n * @param {string}                   options.title                 Component name as presented to the user.\n * @param {JSONSchema['properties']} options.properties            Object of properties.\n * @param {JSONSchema['type']}       options.properties[].type     JSON Schema type of a property.\n * @param {string}                   [options.properties[].title]  Optional title displayed to the user.\n * @param {string}                   [options.group]               Optional Image to be displayed in the UI.\n * @param {string}                   [options.thumbnail]           Optional title displayed to the user.\n * @param {string}                   [options.isHidden]            Optionally hide from the UI.\n * @param {UISchema}                 [options.ui]                  Optional component groupping.\n * @param {string[]}                 [options.datasourceIds]       List of datasource id component requires.\n * @see https://rjsf-team.github.io/react-jsonschema-form/docs/api-reference/uiSchema\n * @see https://json-schema.org\n * @example\n *\n *   FEAAS.External.registerComponent(\n *     MyComponent,\n *     {\n *       // Name of a component as it will be used internally\n *       name: 'MyComponent',\n *       // Title of a component as it will be presented to the user\n *       title: 'My Component',\n *       // Optional: Thumbnail image for component to be displayed in UI\n *       thumbnail: 'http://examaple.com/component.jpg',\n *       // Optional: Group components in the UI\n *       group: 'Assorted components',\n *       // Definitions of three configurable properties that MyComponent accepts\n *       properties: {\n *         // Color is a string, but only Red/Green/Blue are allowed\n *         color: { type: 'string', enum: ['red', 'green', 'blue'] },\n *         // Text is a property labelled as \"Text summary\"\n *         text: { type: 'string', title: 'Text summary' },\n *         // Count is a number with 1 as default value\n *         count: { type: 'number', default: 1 }\n *       },\n *       // Optional UI schema customization\n *       ui: {\n *         // Present color choices as radio buttons\n *         color: { 'ui:widget': 'radio' },\n *         // Text is a textarea with 5 rows\n *         text: { 'ui:widget': 'textarea', 'ui:options': { rows: 5 } },\n *         // Count is a number field with spinner button\n *         count: { 'ui:widget': 'updown' }\n *       },\n *       // Color and text area required properties\n *       required: ['color', 'text']\n *     },\n *     { text: 'Default text' }\n *   )\n *\n */\nexport function registerComponent<T>(\n  component: ExternalComponentHandler<T>,\n  options: ExternalComponentOptions<T>,\n  defaults: any = {}\n) {\n  if (!options?.name)\n    throw new Error(\n      'Could not register external component. Please make sure you provide a name in the options' +\n        JSON.stringify(options)\n    )\n  const normalizedOptions = normalizeOptions(options, component, defaults)\n  registered[normalizedOptions.id] = normalizedOptions\n  if (isWebComponent(component)) {\n    BYOCRegistration.register('byoc-' + toKebabCase(options.name), undefined, component)\n  }\n  setRegistrationCallback()\n}\n\nexport function isWebComponent(object: any): object is WebComponent {\n  return object && 'prototype' in object && 'setAttribute' in object.prototype\n}\n\nexport type RegisteredComponents = {\n  [id: string]: ExternalComponent\n}\n\n/** Transform properties to proper types and merge them with default values */\nexport function getComponentProperties(\n  id: string | ExternalComponent,\n  props: Record<string, any> = {}\n): Record<string, any> {\n  const schema = getComponent(id)?.schema\n  return schema ? getSchemaProperties(schema, props) : props\n}\n\nexport function getComponentConfigurablePropertyNames(id: string | ExternalComponent): string[] {\n  const definition = getComponent(id)\n  return Object.keys(definition?.schema.properties || {}).filter((prop) => {\n    return definition?.uiSchema?.[prop]?.['ui:widget'] != 'hidden'\n  })\n}\n\n/**\n * Resolve a component by its id in one of two formats:\n * - Simple id like `ComponentName` returns the registered component\n * - Complex id like `ComponentName?prop=value` returns a combination of:\n *   - `ComponentName` component if registered\n *   - `ComponentName?prop=value` component if registered\n *   - Default values provided in query string\n *\n * The latter approach allows registering a generic component under simple name, and its overloads\n * which will be presented as individual components to the user.\n */\nexport function getComponent(id: string | ExternalComponent) {\n  if (typeof id != 'string') {\n    if (id && 'schema' in id) return id\n    throw new Error(`Component name should be a string, got ${typeof id}`)\n  }\n  const [name, query] = id.split('?')\n  var base = registered[name]\n  // Deal with query string\n  if (query) {\n    // if component is registered with query string, merge two component definitions\n    const overload = registered[id]\n    if (!overload && !base) return null\n    if (overload) base = { ...base, ...overload, component: overload.component || base?.component }\n\n    // merge query string as default values\n    query.split(/\\&/g).forEach((pair) => {\n      const [k, v] = pair.split('=')\n      const propertyDefinition = base.schema.properties?.[k] || {\n        type: 'string'\n      }\n      // merge in k/v pair as default value\n      base = {\n        ...base,\n        schema: {\n          ...base.schema,\n          properties: {\n            ...base.schema.properties,\n            [k]: {\n              ...propertyDefinition,\n              default: parseValue(decodeURIComponent(v), propertyDefinition.type)\n            }\n          }\n        },\n        uiSchema: {\n          ...base.uiSchema,\n          // hide preconfigured properties\n          [k]: {\n            ...base.uiSchema[k],\n            'ui:widget': base.uiSchema[k]?.['ui:widget'] ?? 'hidden'\n          }\n        }\n      }\n    })\n  }\n  return base\n}\n\n/**\n * Retrieves properties for a component, including context properties component's defaults.\n *\n * @param props  - The component props.\n * @returns An object containing the attributes, properties, and merged properties.\n */\nexport function getMergedComponentProperties(props: MinimalComponentProps) {\n  const {\n    componentName,\n    className,\n    fallbackWrapper,\n    fallback,\n    suppressHydrationWarning,\n    _dynamic,\n    datasources,\n    ...givenProps\n  } = props\n  try {\n    var parsedDatasources = typeof datasources == 'string' ? JSON.parse(datasources) : datasources\n  } catch (e) {}\n  // find first datasources with object data, use it as a source of properties\n  const dataProperties: any = Object.values(parsedDatasources || {}).find(\n    (v) => v && !Array.isArray(v) && Object.keys(v).length > 0\n  )\n  const properties = {\n    ...dataProperties,\n    ...getComponentProperties(componentName, { ...dataProperties, ...givenProps }),\n    ...(parsedDatasources ? { datasources: parsedDatasources } : {})\n  }\n  const attributes = {\n    'data-external-id': componentName,\n    ...objectKeysToKebabCase(properties),\n    suppressHydrationWarning: true,\n    class: className\n  }\n  serializedContextProperties.forEach((key) => {\n    Object.assign(attributes, { [toKebabCase(key)]: contextProperties[key] })\n  })\n  // serialize json properties\n  Object.keys(attributes).forEach((key) => {\n    const value = attributes[key as keyof typeof attributes]\n    if (value && typeof value == 'object' && key != 'class' && key != 'children') {\n      try {\n        Object.assign(attributes, { [key]: JSON.stringify(value) })\n      } catch (e) {\n        delete attributes[key as keyof typeof attributes]\n      }\n    }\n    if (typeof value == 'function' || value == null) {\n      delete attributes[key as keyof typeof attributes]\n    }\n  })\n  return {\n    /** HTML attributes in kebab case, including strings and explicitly passed objects in json format */\n    attributes,\n    /** React properties combined with datasources */\n    properties,\n    /** React properties combined with datasources and context properties */\n    merged: { ...contextProperties, ...properties }\n  }\n}\n\n/**\n * Set up acknowledgment listener for component registration.\n * This listener receives confirmation from the parent window that components were registered.\n */\nfunction setupComponentAckListener() {\n  if (typeof window === 'undefined' || componentAckListenerAdded) return\n\n  componentAckListenerAdded = true\n  window.addEventListener('message', (event) => {\n    try {\n      const data = typeof event.data === 'string' ? JSON.parse(event.data) : event.data\n      if (data.action === 'register-components-ack') {\n        componentRegistrationAcknowledged = true\n        componentRegistrationRetryCount = 0\n        clearTimeout(registrationCallback)\n      }\n    } catch (e) {\n      // Ignore parse errors from other messages\n    }\n  })\n}\n\n/**\n * Sends component registration to parent window with retry logic.\n * Retries up to COMPONENT_MAX_RETRY_ATTEMPTS times until acknowledgment is received.\n */\nexport function setRegistrationCallback() {\n  clearTimeout(registrationCallback)\n\n  if (typeof window !== 'undefined' && window.parent !== window) {\n    // Set up acknowledgment listener on first call\n    setupComponentAckListener()\n\n    // Reset acknowledgment state when new registration is triggered\n    componentRegistrationAcknowledged = false\n    componentRegistrationRetryCount = 0\n\n    const sendRegistration = () => {\n      // Stop if already acknowledged or max retries reached\n      if (componentRegistrationAcknowledged) {\n        return\n      }\n\n      if (componentRegistrationRetryCount >= COMPONENT_MAX_RETRY_ATTEMPTS) {\n        // Max retries reached, stop trying but don't log error to avoid noise\n        return\n      }\n\n      // Send components to parent window\n      window.parent?.postMessage(\n        JSON.stringify({\n          action: 'register-components',\n          data: Object.values(registered)\n        }),\n        '*'\n      )\n\n      componentRegistrationRetryCount++\n\n      // Schedule next retry if not acknowledged\n      if (!componentRegistrationAcknowledged && componentRegistrationRetryCount < COMPONENT_MAX_RETRY_ATTEMPTS) {\n        registrationCallback = setTimeout(sendRegistration, COMPONENT_RETRY_INTERVAL)\n      }\n    }\n\n    // Initial delay before first send (maintains original behavior)\n    registrationCallback = setTimeout(sendRegistration, 30)\n  }\n}\nsetRegistrationCallback()\n\n// Register schemas passed as <byoc-registration components=... />\n// It extends the web component in case it already was registered by different name\nexport class BYOCRegistration extends WebComponent {\n  connectedCallback() {\n    try {\n      ;(JSON.parse(String(this.getAttribute('components'))) as any[]).forEach((component) => {\n        if (!getComponent(component.id)) registerComponent(null, component)\n      })\n      ;(JSON.parse(String(this.getAttribute('datasources'))) as any[]).forEach((datasource) => {\n        if (!getDatasource(datasource.id)) registerDatasource((settings) => settings, datasource)\n      })\n    } catch (e) {}\n  }\n  static register(tagName: string, win?: Window, component: WebComponent = this) {\n    if (win == null) win = typeof window != 'undefined' ? window : undefined\n    if (win && !win.customElements.get(tagName)) {\n      win.customElements.define(tagName, class extends component {})\n    }\n  }\n}\n\nexport var contextProperties: ContextProperties = {}\nexport function setContextProperties(props: ContextProperties) {\n  contextProperties = props\n}\n\nexport const serializedContextProperties = ['sitecoreEdgeUrl', 'sitecoreEdgeContextId']\n\nBYOCRegistration.register('byoc-registration')\n\ndeclare global {\n  namespace JSX {\n    interface IntrinsicElements {\n      'byoc-registration': {\n        suppressHydrationWarning?: boolean\n        components: string\n        datasources: string\n      }\n    }\n  }\n  interface Window {\n    BYOCComponents: RegisteredComponents\n    BYOCComponentsFrozen: boolean\n    BYOCWebComponent: typeof HTMLElement\n  }\n}\n"],
  "mappings": "mbAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,mBAAAE,EAAA,qBAAAC,EAAA,iBAAAC,GAAA,YAAAC,EAAA,sBAAAC,EAAA,0BAAAC,GA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EiF,GAAO,OAAMA,EAAM,OAAO,QAAU,YAAc,OAAS,QAC3DA,GAAO,CAACA,EAAI,eAAe,IAAID,CAAO,GACxCC,EAAI,eAAe,OAAOD,EAAS,cAAchF,CAAS,EAAG,CAEjE,GAGSuE,EAAuC,CAAA,EAC5C,SAAUW,GAAqB7C,EAAwB,CAC3DkC,EAAoBlC,CACtB,CAEO,IAAMgC,GAA8B,CAAC,kBAAmB,uBAAuB,EAEtFrC,EAAiB,SAAS,mBAAmB",
  "names": ["index_exports", "__export", "BYOCDataTypes", "BYOCRegistration", "WebComponent", "XMTypes", "contextProperties", "customizeDataSettings", "getComponent", "getComponentConfigurablePropertyNames", "getComponentProperties", "getDatasource", "getMergedComponentProperties", "getSchemaDefaults", "getSchemaProperties", "isWebComponent", "normalizeOptions", "objectKeysToCamelCase", "objectKeysToKebabCase", "parseSchemaProperties", "parseValue", "registerComponent", "registerDataType", "registerDatasource", "registered", "registeredDatasources", "serializedContextProperties", "setContextProperties", "setRegistrationCallback", "toCamelCase", "toKebabCase", "transformSchema", "transformSchemaObject", "transformUiSchema", "traverseSchema", "__toCommonJS", "objectKeysToKebabCase", "object", "acc", "key", "toKebabCase", "objectKeysToCamelCase", "toCamelCase", "str", "KEBAB_REGEX", "match", "input", "word", "index", "registerDataType", "handler", "name", "BYOCDataTypes", "XMLinkHandler", "ItemHandler", "_a", "properties", "schema", "__rest", "propertiesToFields", "fields", "key", "title", "rest", "XMTypes", "property", "traverseSchema", "schema", "callback", "traversed", "property", "value", "item", "transformSchema", "defaults", "transformSchemaObject", "construct", "transformed", "_a", "acc", "key", "given", "custom", "BYOCDataTypes", "toKebabCase", "word", "subKey", "_b", "transformUiSchema", "uiSchema", "properties", "_c", "_d", "parseValue", "type", "e", "parseSchemaProperties", "props", "prev", "name", "prop", "toCamelCase", "definition", "parsed", "getSchemaProperties", "getSchemaDefaults", "registeredDatasources", "registerDatasource", "handler", "options", "normalizeDatasourceOptions", "setRegistrationCallback", "getDatasource", "id", "datasourceOptions", "name", "title", "properties", "sample", "schema", "description", "type", "settings", "transformSchema", "registrationCallback", "datasourceRegistrationAcknowledged", "datasourceRegistrationRetryCount", "datasourceAckListenerAdded", "DATASOURCE_MAX_RETRY_ATTEMPTS", "DATASOURCE_RETRY_INTERVAL", "setupDatasourceAckListener", "event", "e", "sendRegistration", "_a", "customizeDataSettings", "datasource", "normalizeOptions", "options", "component", "defaults", "thumbnail", "name", "id", "group", "ui", "isHidden", "datasourceIds", "links", "meta", "explicitUISchema", "explicitSchema", "schemaOptions", "__rest", "schemaBase", "useSchemaBase", "schema", "transformSchema", "uiSchema", "transformUiSchema", "registrationCallback", "componentRegistrationAcknowledged", "componentRegistrationRetryCount", "componentAckListenerAdded", "COMPONENT_MAX_RETRY_ATTEMPTS", "COMPONENT_RETRY_INTERVAL", "WebComponent", "registered", "registerComponent", "normalizedOptions", "isWebComponent", "BYOCRegistration", "toKebabCase", "setRegistrationCallback", "object", "getComponentProperties", "props", "_a", "getComponent", "getSchemaProperties", "getComponentConfigurablePropertyNames", "definition", "prop", "_b", "query", "base", "overload", "pair", "k", "v", "propertyDefinition", "parseValue", "_c", "getMergedComponentProperties", "componentName", "className", "fallbackWrapper", "fallback", "suppressHydrationWarning", "_dynamic", "datasources", "givenProps", "parsedDatasources", "e", "dataProperties", "properties", "attributes", "objectKeysToKebabCase", "serializedContextProperties", "key", "contextProperties", "value", "setupComponentAckListener", "event", "sendRegistration", "datasource", "getDatasource", "registerDatasource", "settings", "tagName", "win", "setContextProperties"]
}
