{"version":3,"sources":["jsdelivr-header.js","/npm/@wix/auto_sdk_groups_rules@1.0.22/index.ts","/npm/@wix/auto_sdk_groups_rules@1.0.22/src/social-groups-v2-group-rules-rules.public.ts","/npm/@wix/auto_sdk_groups_rules@1.0.22/src/social-groups-v2-group-rules-rules.universal.ts","/npm/@wix/auto_sdk_groups_rules@1.0.22/src/social-groups-v2-group-rules-rules.http.ts","/npm/@wix/auto_sdk_groups_rules@1.0.22/src/social-groups-v2-group-rules-rules.context.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,8iBCNA,cAAA,GAAA,SAAA,cAAA,CAAA,oBAAA,IAAA,oBAAA,wBAAA,IAAA,yBAAA,UAAA,IAAA,WAAA,oBAAA,IAAA,uBAAA,OAAA,QAAA,aAAA,eCAA,IAAA,+BAAwD,QAAA,2CACxD,iBAAqD,QAAA,8CACrD,uBAA+B,QAAA,oDAC/B,iBAA8D,QAAA,kBCH9D,uBAAoD,QAAA,oCACpD,8BAGO,QAAA,2CCJP,oBAAkC,QAAA,iCAClC,qBAA2B,QAAA,iCAI3B,SAAS,gDACP,GAqKA,SAAO,qBAAA,YAAW,OAAO,OAAO,EAAM,CAAE,iBAnKf,CACvB,wBAAyB,CACvB,CACE,QAAS,wBACT,SAAU,KAGd,EAAG,CACD,CACE,QAAS,yBACT,SAAU,WAEZ,CACE,QAAS,yBACT,SAAU,OAEZ,CACE,QAAS,6BACT,SAAU,YAGd,qBAAsB,CACpB,CACE,QAAS,qBACT,SAAU,QAEZ,CACE,QAAS,yBACT,SAAU,QAGd,oBAAqB,CACnB,CACE,QAAS,qBACT,SAAU,QAEZ,CACE,QAAS,yBACT,SAAU,OAEZ,CACE,QAAS,yBACT,SAAU,YAGd,uBAAwB,CACtB,CACE,QAAS,0BACT,SAAU,QAEZ,CACE,QAAS,yBACT,SAAU,OAEZ,CACE,QAAS,6BACT,SAAU,YAGd,uBAAwB,CACtB,CACE,QAAS,0BACT,SAAU,QAEZ,CACE,QA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BAAiC,QAAA,iCACjC,gCAAkC,QAAA,6CAQrB,YAEK,EAAA,qBAAA,kBAAiB,YACtB,0BAGK,EAAA,qBAAA,kBAAiB,0BAItB,sBAGsC,EAAA,gCAAA,mBACjD","file":"/npm/@wix/auto_sdk_groups_rules@1.0.22/build/cjs/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.51.2.\n * Original file: /npm/@wix/auto_sdk_groups_rules@1.0.22/build/cjs/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","export * from './src/social-groups-v2-group-rules-rules.context.js';\n","import { renameKeysFromRESTResponseToSDKResponse } from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { EventDefinition, HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n  CreateOrReplaceAllRulesOptions,\n  CreateOrReplaceAllRulesResponse,\n  GroupRulesUpdatedEnvelope,\n  ListRulesResponse,\n  createOrReplaceAllRules as universalCreateOrReplaceAllRules,\n  listRules as universalListRules,\n} from './social-groups-v2-group-rules-rules.universal.js';\n\nconst TRANSFORM_PATHS_0 = [{ path: 'metadata.eventTime' }];\nexport const __metadata = { PACKAGE_NAME: '@wix/groups' };\n\nexport function listRules(httpClient: HttpClient): ListRulesSignature {\n  return (groupId: string) =>\n    universalListRules(\n      groupId,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface ListRulesSignature {\n  /**\n   * Retrieves a group's rules.\n   *\n   * >**Note:**\n   * >This endpoint requires [visitor or member authentication](https://dev.wix.com/docs/rest/articles/getting-started/access-types-and-permissions).\n   * @param - Group ID.\n   */\n  (groupId: string): Promise<\n    NonNullablePaths<\n      ListRulesResponse,\n      `rules` | `rules.${number}.title` | `rules.${number}.description`,\n      2\n    >\n  >;\n}\n\nexport function createOrReplaceAllRules(\n  httpClient: HttpClient\n): CreateOrReplaceAllRulesSignature {\n  return (groupId: string, options?: CreateOrReplaceAllRulesOptions) =>\n    universalCreateOrReplaceAllRules(\n      groupId,\n      options,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface CreateOrReplaceAllRulesSignature {\n  /**\n   * Creates rules if no rules have been set up. Otherwise, replaces all existing rules.\n   *\n   * > **Notes:**\n   * > + Only group admins can create or replace rules.\n   * > + This endpoint requires [visitor or member authentication](https://dev.wix.com/docs/rest/articles/getting-started/access-types-and-permissions).\n   * @param - Group ID.\n   */\n  (groupId: string, options?: CreateOrReplaceAllRulesOptions): Promise<\n    NonNullablePaths<\n      CreateOrReplaceAllRulesResponse,\n      | `groupId`\n      | `rules`\n      | `rules.${number}.title`\n      | `rules.${number}.description`,\n      2\n    >\n  >;\n}\n\nexport const onGroupRulesUpdated = /*#__PURE__*/ EventDefinition(\n  'wix.social_groups.v2.group_rules_updated',\n  true,\n  (event: GroupRulesUpdatedEnvelope) =>\n    renameKeysFromRESTResponseToSDKResponse(\n      transformPaths(event, [\n        {\n          transformFn: transformRESTTimestampToSDKTimestamp,\n          paths: TRANSFORM_PATHS_0,\n        },\n      ])\n    )\n)<GroupRulesUpdatedEnvelope>();\n\nexport {\n  AccountInfo,\n  AccountInfoMetadata,\n  ActionEvent,\n  BaseEventMetadata,\n  CreateOrReplaceAllRulesOptions,\n  CreateOrReplaceAllRulesRequest,\n  CreateOrReplaceAllRulesResponse,\n  DomainEvent,\n  DomainEventBodyOneOf,\n  Empty,\n  EntityCreatedEvent,\n  EntityDeletedEvent,\n  EntityUpdatedEvent,\n  EventMetadata,\n  GroupRule,\n  GroupRules,\n  GroupRulesUpdatedEnvelope,\n  IdentificationData,\n  IdentificationDataIdOneOf,\n  ListRulesRequest,\n  ListRulesResponse,\n  ListTemplatesResponse,\n  MessageEnvelope,\n  RestoreInfo,\n  WebhookIdentityType,\n} from './social-groups-v2-group-rules-rules.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n  renameKeysFromSDKRequestToRESTRequest,\n  renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixSocialGroupsV2GroupRules from './social-groups-v2-group-rules-rules.http.js';\n\n/**\n * Guidelines ensuring that members post responsibly and respectfully. Site owners can set up Group Rules in the dashboard.\n * >**Note:** Only admins can update the group rules.\n */\nexport interface GroupRules {\n  /**\n   * Group rules.\n   * @maxSize 100\n   */\n  rules?: GroupRule[];\n}\n\nexport interface GroupRule {\n  /** Rule title. */\n  title?: string;\n  /** Rule description. */\n  description?: string;\n}\n\nexport interface ListRulesRequest {\n  /**\n   * Group ID.\n   * @format GUID\n   */\n  groupId: string;\n}\n\nexport interface ListRulesResponse {\n  /**\n   * Retrieved rules.\n   * @maxSize 100\n   */\n  rules?: GroupRule[];\n}\n\nexport interface CreateOrReplaceAllRulesRequest {\n  /**\n   * Group ID.\n   * @format GUID\n   */\n  groupId: string;\n  /**\n   * New rules.\n   * @maxSize 100\n   */\n  rules?: GroupRule[];\n}\n\nexport interface CreateOrReplaceAllRulesResponse {\n  /**\n   * Group ID.\n   * @format GUID\n   */\n  groupId?: string;\n  /**\n   * Rules.\n   * @maxSize 100\n   */\n  rules?: GroupRule[];\n}\n\nexport interface Empty {}\n\nexport interface ListTemplatesResponse {\n  /**\n   * Retrieved rule templates.\n   * @maxSize 100\n   */\n  rules?: GroupRule[];\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n  createdEvent?: EntityCreatedEvent;\n  updatedEvent?: EntityUpdatedEvent;\n  deletedEvent?: EntityDeletedEvent;\n  actionEvent?: ActionEvent;\n  /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n  _id?: string;\n  /**\n   * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n   * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n   */\n  entityFqdn?: string;\n  /**\n   * Event action name, placed at the top level to make it easier for users to dispatch messages.\n   * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n   */\n  slug?: string;\n  /** ID of the entity associated with the event. */\n  entityId?: string;\n  /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n  eventTime?: Date | null;\n  /**\n   * Whether the event was triggered as a result of a privacy regulation application\n   * (for example, GDPR).\n   */\n  triggeredByAnonymizeRequest?: boolean | null;\n  /** If present, indicates the action that triggered the event. */\n  originatedFrom?: string | null;\n  /**\n   * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number.\n   * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n   */\n  entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n  createdEvent?: EntityCreatedEvent;\n  updatedEvent?: EntityUpdatedEvent;\n  deletedEvent?: EntityDeletedEvent;\n  actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n  entity?: string;\n}\n\nexport interface RestoreInfo {\n  deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n  /**\n   * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n   * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n   * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n   */\n  currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n  /** Entity that was deleted. */\n  deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n  body?: string;\n}\n\nexport interface MessageEnvelope {\n  /**\n   * App instance ID.\n   * @format GUID\n   */\n  instanceId?: string | null;\n  /**\n   * Event type.\n   * @maxLength 150\n   */\n  eventType?: string;\n  /** The identification type and identity data. */\n  identity?: IdentificationData;\n  /** Stringify payload. */\n  data?: string;\n  /** Details related to the account */\n  accountInfo?: AccountInfo;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n  /**\n   * ID of a site visitor that has not logged in to the site.\n   * @format GUID\n   */\n  anonymousVisitorId?: string;\n  /**\n   * ID of a site visitor that has logged in to the site.\n   * @format GUID\n   */\n  memberId?: string;\n  /**\n   * ID of a Wix user (site owner, contributor, etc.).\n   * @format GUID\n   */\n  wixUserId?: string;\n  /**\n   * ID of an app.\n   * @format GUID\n   */\n  appId?: string;\n  /** @readonly */\n  identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n  /**\n   * ID of a site visitor that has not logged in to the site.\n   * @format GUID\n   */\n  anonymousVisitorId?: string;\n  /**\n   * ID of a site visitor that has logged in to the site.\n   * @format GUID\n   */\n  memberId?: string;\n  /**\n   * ID of a Wix user (site owner, contributor, etc.).\n   * @format GUID\n   */\n  wixUserId?: string;\n  /**\n   * ID of an app.\n   * @format GUID\n   */\n  appId?: string;\n}\n\nexport enum WebhookIdentityType {\n  UNKNOWN = 'UNKNOWN',\n  ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n  MEMBER = 'MEMBER',\n  WIX_USER = 'WIX_USER',\n  APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n  | WebhookIdentityType\n  | 'UNKNOWN'\n  | 'ANONYMOUS_VISITOR'\n  | 'MEMBER'\n  | 'WIX_USER'\n  | 'APP';\n\nexport interface AccountInfo {\n  /**\n   * ID of the Wix account associated with the event.\n   * @format GUID\n   */\n  accountId?: string | null;\n  /**\n   * ID of the parent Wix account. Only included when accountId belongs to a child account.\n   * @format GUID\n   */\n  parentAccountId?: string | null;\n  /**\n   * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.\n   * @format GUID\n   */\n  siteId?: string | null;\n}\n\nexport interface BaseEventMetadata {\n  /**\n   * App instance ID.\n   * @format GUID\n   */\n  instanceId?: string | null;\n  /**\n   * Event type.\n   * @maxLength 150\n   */\n  eventType?: string;\n  /** The identification type and identity data. */\n  identity?: IdentificationData;\n  /** Details related to the account */\n  accountInfo?: AccountInfo;\n}\n\nexport interface EventMetadata extends BaseEventMetadata {\n  /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n  _id?: string;\n  /**\n   * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n   * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n   */\n  entityFqdn?: string;\n  /**\n   * Event action name, placed at the top level to make it easier for users to dispatch messages.\n   * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n   */\n  slug?: string;\n  /** ID of the entity associated with the event. */\n  entityId?: string;\n  /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n  eventTime?: Date | null;\n  /**\n   * Whether the event was triggered as a result of a privacy regulation application\n   * (for example, GDPR).\n   */\n  triggeredByAnonymizeRequest?: boolean | null;\n  /** If present, indicates the action that triggered the event. */\n  originatedFrom?: string | null;\n  /**\n   * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number.\n   * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n   */\n  entityEventSequence?: string | null;\n  accountInfo?: AccountInfoMetadata;\n}\n\nexport interface AccountInfoMetadata {\n  /** ID of the Wix account associated with the event */\n  accountId: string;\n  /** ID of the Wix site associated with the event. Only included when the event is tied to a specific site. */\n  siteId?: string;\n  /** ID of the parent Wix account. Only included when 'accountId' belongs to a child account. */\n  parentAccountId?: string;\n}\n\nexport interface GroupRulesUpdatedEnvelope {\n  entity: GroupRules;\n  metadata: EventMetadata;\n}\n\n/**\n * Triggered when rules are updated.\n * @webhook\n * @eventType wix.social_groups.v2.group_rules_updated\n * @serviceIdentifier wix.social.groups.api.v2.GroupRulesService\n * @slug updated\n */\nexport declare function onGroupRulesUpdated(\n  handler: (event: GroupRulesUpdatedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Retrieves a group's rules.\n *\n * >**Note:**\n * >This endpoint requires [visitor or member authentication](https://dev.wix.com/docs/rest/articles/getting-started/access-types-and-permissions).\n * @param groupId - Group ID.\n * @public\n * @requiredField groupId\n * @fqn wix.social.groups.api.v2.GroupRulesService.ListRules\n */\nexport async function listRules(\n  groupId: string\n): Promise<\n  NonNullablePaths<\n    ListRulesResponse,\n    `rules` | `rules.${number}.title` | `rules.${number}.description`,\n    2\n  >\n> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[1] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({ groupId: groupId });\n\n  const reqOpts = ambassadorWixSocialGroupsV2GroupRules.listRules(payload);\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: { groupId: '$[0]' },\n        singleArgumentUnchanged: false,\n      },\n      ['groupId']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\n/**\n * Creates rules if no rules have been set up. Otherwise, replaces all existing rules.\n *\n * > **Notes:**\n * > + Only group admins can create or replace rules.\n * > + This endpoint requires [visitor or member authentication](https://dev.wix.com/docs/rest/articles/getting-started/access-types-and-permissions).\n * @param groupId - Group ID.\n * @public\n * @requiredField groupId\n * @fqn wix.social.groups.api.v2.GroupRulesService.CreateOrReplaceAllRules\n */\nexport async function createOrReplaceAllRules(\n  groupId: string,\n  options?: CreateOrReplaceAllRulesOptions\n): Promise<\n  NonNullablePaths<\n    CreateOrReplaceAllRulesResponse,\n    | `groupId`\n    | `rules`\n    | `rules.${number}.title`\n    | `rules.${number}.description`,\n    2\n  >\n> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[2] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({\n    groupId: groupId,\n    rules: options?.rules,\n  });\n\n  const reqOpts =\n    ambassadorWixSocialGroupsV2GroupRules.createOrReplaceAllRules(payload);\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: { groupId: '$[0]', rules: '$[1].rules' },\n        singleArgumentUnchanged: false,\n      },\n      ['groupId', 'options']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\nexport interface CreateOrReplaceAllRulesOptions {\n  /**\n   * New rules.\n   * @maxSize 100\n   */\n  rules?: GroupRule[];\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixSocialGroupsApiV2GroupRulesServiceUrl(\n  opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n  const domainToMappings = {\n    'api._api_base_domain_': [\n      {\n        srcPath: '/social-groups-server',\n        destPath: '',\n      },\n    ],\n    _: [\n      {\n        srcPath: '/_api/social-groups/v1',\n        destPath: '/api/v1',\n      },\n      {\n        srcPath: '/_api/social-groups/v2',\n        destPath: '/v2',\n      },\n      {\n        srcPath: '/_api/social-groups/api/v1',\n        destPath: '/api/v1',\n      },\n    ],\n    'groups.wixapps.net': [\n      {\n        srcPath: '/social-groups/api',\n        destPath: '/api',\n      },\n      {\n        srcPath: '/_api/social-groups/v2',\n        destPath: '/v2',\n      },\n    ],\n    'www._base_domain_': [\n      {\n        srcPath: '/social-groups/api',\n        destPath: '/api',\n      },\n      {\n        srcPath: '/_api/social-groups/v2',\n        destPath: '/v2',\n      },\n      {\n        srcPath: '/_api/social-groups/v1',\n        destPath: '/api/v1',\n      },\n    ],\n    'editor._base_domain_': [\n      {\n        srcPath: '/_api/social-groups-web',\n        destPath: '/api',\n      },\n      {\n        srcPath: '/_api/social-groups/v2',\n        destPath: '/v2',\n      },\n      {\n        srcPath: '/_api/social-groups/api/v1',\n        destPath: '/api/v1',\n      },\n    ],\n    'blocks._base_domain_': [\n      {\n        srcPath: '/_api/social-groups-web',\n        destPath: '/api',\n      },\n      {\n        srcPath: '/_api/social-groups/v2',\n        destPath: '/v2',\n      },\n      {\n        srcPath: '/_api/social-groups/api/v1',\n        destPath: '/api/v1',\n      },\n    ],\n    'create.editorx': [\n      {\n        srcPath: '/_api/social-groups-web',\n        destPath: '/api',\n      },\n      {\n        srcPath: '/_api/social-groups/v2',\n        destPath: '/v2',\n      },\n      {\n        srcPath: '/_api/social-groups/api/v1',\n        destPath: '/api/v1',\n      },\n    ],\n    '*.dev.wix-code.com': [\n      {\n        srcPath: '/_api/social-groups/v1',\n        destPath: '/api/v1',\n      },\n      {\n        srcPath: '/_api/social-groups/api/v1',\n        destPath: '/api/v1',\n      },\n      {\n        srcPath: '/_api/social-groups/v2',\n        destPath: '/v2',\n      },\n    ],\n    'manage._base_domain_': [\n      {\n        srcPath: '/social-groups/api',\n        destPath: '/api',\n      },\n      {\n        srcPath: '/_api/social-groups',\n        destPath: '/api',\n      },\n      {\n        srcPath: '/_api/social-groups/v2',\n        destPath: '/v2',\n      },\n      {\n        srcPath: '/_api/social-groups/api/v1',\n        destPath: '/api/v1',\n      },\n      {\n        srcPath: '/social-groups/api/v1',\n        destPath: '/api/v1',\n      },\n      {\n        srcPath: '/social-groups/api/v2',\n        destPath: '/v2',\n      },\n      {\n        srcPath: '/_api/social-groups/v1',\n        destPath: '/api/v1',\n      },\n    ],\n    'editor-flow.wixapps.net': [\n      {\n        srcPath: '/_api/social-groups/v2',\n        destPath: '/v2',\n      },\n    ],\n    'www.wixapis.com': [\n      {\n        srcPath: '/social-groups/v2',\n        destPath: '/v2',\n      },\n    ],\n    'editor.wixapps.net': [\n      {\n        srcPath: '/_api/social-groups/v2',\n        destPath: '/v2',\n      },\n      {\n        srcPath: '/_api/social-groups/v1',\n        destPath: '/api/v1',\n      },\n      {\n        srcPath: '/social-groups/api/v1',\n        destPath: '/api/v1',\n      },\n      {\n        srcPath: '/_api/social-groups/api/v1',\n        destPath: '/api/v1',\n      },\n    ],\n  };\n\n  return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_groups_rules';\n\n/**\n * Retrieves a group's rules.\n *\n * >**Note:**\n * >This endpoint requires [visitor or member authentication](https://dev.wix.com/docs/rest/articles/getting-started/access-types-and-permissions).\n */\nexport function listRules(payload: object): RequestOptionsFactory<any> {\n  function __listRules({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.social_groups.v2.group_rules',\n      method: 'GET' as any,\n      methodFqn: 'wix.social.groups.api.v2.GroupRulesService.ListRules',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveWixSocialGroupsApiV2GroupRulesServiceUrl({\n        protoPath: '/v2/rules/{groupId}',\n        data: payload,\n        host,\n      }),\n      params: toURLSearchParams(payload),\n    };\n\n    return metadata;\n  }\n\n  return __listRules;\n}\n\n/**\n * Creates rules if no rules have been set up. Otherwise, replaces all existing rules.\n *\n * > **Notes:**\n * > + Only group admins can create or replace rules.\n * > + This endpoint requires [visitor or member authentication](https://dev.wix.com/docs/rest/articles/getting-started/access-types-and-permissions).\n */\nexport function createOrReplaceAllRules(\n  payload: object\n): RequestOptionsFactory<any> {\n  function __createOrReplaceAllRules({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.social_groups.v2.group_rules',\n      method: 'PUT' as any,\n      methodFqn:\n        'wix.social.groups.api.v2.GroupRulesService.CreateOrReplaceAllRules',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveWixSocialGroupsApiV2GroupRulesServiceUrl({\n        protoPath: '/v2/rules/{groupId}',\n        data: payload,\n        host,\n      }),\n      data: payload,\n    };\n\n    return metadata;\n  }\n\n  return __createOrReplaceAllRules;\n}\n","import {\n  listRules as publicListRules,\n  createOrReplaceAllRules as publicCreateOrReplaceAllRules,\n} from './social-groups-v2-group-rules-rules.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { createEventModule } from '@wix/sdk-runtime/event-definition-modules';\nimport {\n  BuildRESTFunction,\n  MaybeContext,\n  BuildEventDefinition,\n} from '@wix/sdk-types';\nimport { onGroupRulesUpdated as publicOnGroupRulesUpdated } from './social-groups-v2-group-rules-rules.public.js';\n\nexport const listRules: MaybeContext<\n  BuildRESTFunction<typeof publicListRules> & typeof publicListRules\n> = /*#__PURE__*/ createRESTModule(publicListRules);\nexport const createOrReplaceAllRules: MaybeContext<\n  BuildRESTFunction<typeof publicCreateOrReplaceAllRules> &\n    typeof publicCreateOrReplaceAllRules\n> = /*#__PURE__*/ createRESTModule(publicCreateOrReplaceAllRules);\n/**\n * Triggered when rules are updated.\n */\nexport const onGroupRulesUpdated: BuildEventDefinition<\n  typeof publicOnGroupRulesUpdated\n> &\n  typeof publicOnGroupRulesUpdated = /*#__PURE__*/ createEventModule(\n  publicOnGroupRulesUpdated\n);\n\nexport { WebhookIdentityType } from './social-groups-v2-group-rules-rules.universal.js';\nexport {\n  GroupRules,\n  GroupRule,\n  ListRulesRequest,\n  ListRulesResponse,\n  CreateOrReplaceAllRulesRequest,\n  CreateOrReplaceAllRulesResponse,\n  Empty,\n  ListTemplatesResponse,\n  DomainEvent,\n  DomainEventBodyOneOf,\n  EntityCreatedEvent,\n  RestoreInfo,\n  EntityUpdatedEvent,\n  EntityDeletedEvent,\n  ActionEvent,\n  MessageEnvelope,\n  IdentificationData,\n  IdentificationDataIdOneOf,\n  AccountInfo,\n  BaseEventMetadata,\n  EventMetadata,\n  AccountInfoMetadata,\n  GroupRulesUpdatedEnvelope,\n  CreateOrReplaceAllRulesOptions,\n} from './social-groups-v2-group-rules-rules.universal.js';\nexport { WebhookIdentityTypeWithLiterals } from './social-groups-v2-group-rules-rules.universal.js';\n"]}