import { createRequire as _createRequire } from 'node:module';
const require = _createRequire(import.meta.url);
import {
  PlatformLink
} from "./chunk-ICWL3WXV.js";
import {
  deploymentTopologySchema,
  getDeploymentTopologyPath,
  useProjectModel
} from "./chunk-BYP4JZFS.js";
import {
  useHttpClient
} from "./chunk-BRX4HWJE.js";
import {
  usePanoramaMethodLogger
} from "./chunk-ZBFOAJ5H.js";
import {
  isHttpError,
  isHttpValidationError,
  pRetry,
  resolveUrl,
  serializer,
  toURLSearchParams
} from "./chunk-YHFCDWGT.js";
import {
  Text
} from "./chunk-QK47PIWK.js";
import {
  require_react
} from "./chunk-TODKQSCF.js";
import {
  getTestOverrides
} from "./chunk-XZUGLEBK.js";
import {
  pathExists,
  readJson,
  writeJson
} from "./chunk-AYCGCYN3.js";
import {
  external_exports
} from "./chunk-SDLCFZRL.js";
import {
  CliError,
  CliErrorCode,
  require_lib
} from "./chunk-WGV2XQSB.js";
import {
  __toESM,
  init_esm_shims
} from "./chunk-EXLZF52D.js";

// ../dev-center-overrides-client/src/useDevCenterOverridesClient.ts
init_esm_shims();
var import_react = __toESM(require_react(), 1);

// ../dev-center-overrides-client/src/client.ts
init_esm_shims();
import { randomUUID } from "node:crypto";

// ../../node_modules/@wix/ambassador-ctp-gradual-rollout-v1-baas-release/es/build/http.impl.js
init_esm_shims();
var _releaseRequest = {};
var _releaseResponse = {};
function resolveComWixCtpAppsReleaseManagerBassServiceUrl(opts) {
  var domainToMappings = {
    "api._api_base_domain_": [
      {
        srcPath: "/apps-release-manager-service-web",
        destPath: ""
      }
    ],
    "bo._base_domain_": [
      {
        srcPath: "/apps-release-manager-service-web",
        destPath: ""
      }
    ],
    "wixbo.ai": [
      {
        srcPath: "/apps-release-manager-service-web",
        destPath: ""
      }
    ],
    "wix-bo.com": [
      {
        srcPath: "/apps-release-manager-service-web",
        destPath: ""
      }
    ],
    "www._base_domain_": [
      {
        srcPath: "/apps-release-manager-service-web/artifacts-release-manager/app-releases",
        destPath: "/artifacts-release-manager/app-releases"
      },
      {
        srcPath: "/_api/apps-release-manager-service-web/artifacts-release-manager/app-releases",
        destPath: "/artifacts-release-manager/app-releases"
      },
      {
        srcPath: "/apps-release-manager-service-web/apps/create",
        destPath: "/apps/create"
      },
      {
        srcPath: "/apps-release-manager-service-web/apps/promote",
        destPath: "/apps/promote"
      },
      {
        srcPath: "/apps-release-manager-service-web/apps/tags",
        destPath: "/apps/tags"
      },
      {
        srcPath: "/apps-release-manager-service-web/apps/create-components",
        destPath: "/apps/create-components"
      },
      {
        srcPath: "/apps-release-manager-service-web/apps/commit",
        destPath: "/apps/commit"
      },
      {
        srcPath: "/apps-release-manager-service-web/apps/promote-app-version",
        destPath: "/apps/promote-app-version"
      }
    ],
    "manage._base_domain_": [
      {
        srcPath: "/apps-release-manager-service-web/apps/promote",
        destPath: "/apps/promote"
      },
      {
        srcPath: "/apps-release-manager-service-web/apps/create",
        destPath: "/apps/create"
      },
      {
        srcPath: "/apps-release-manager-service-web/apps/tags",
        destPath: "/apps/tags"
      },
      {
        srcPath: "/apps-release-manager-service-web/apps/create-components",
        destPath: "/apps/create-components"
      },
      {
        srcPath: "/apps-release-manager-service-web/apps/commit",
        destPath: "/apps/commit"
      },
      {
        srcPath: "/apps-release-manager-service-web/apps/promote-app-version",
        destPath: "/apps/promote-app-version"
      },
      {
        srcPath: "/apps-release-manager-service-web/apps/release",
        destPath: "/apps/release"
      }
    ]
  };
  return resolveUrl(Object.assign(opts, { domainToMappings }));
}
function release(payload) {
  var _a = serializer(_releaseRequest, {}), toReq = _a.toJSON, fromReq = _a.fromJSON;
  var fromRes = serializer(_releaseResponse, {}).fromJSON;
  function __release(_a2) {
    var host = _a2.host;
    var serializedData = toReq(payload);
    var metadata = {
      entityFqdn: "wix.ctp.gradual_rollout.v1.baas_release",
      method: "POST",
      methodFqn: "com.wix.ctp.AppsReleaseManagerBassService.Release",
      migrationOptions: {
        optInTransformResponse: true
      },
      url: resolveComWixCtpAppsReleaseManagerBassServiceUrl({
        protoPath: "/apps/release/{appId}/{componentOverrideId}",
        data: serializedData,
        host
      }),
      data: serializedData,
      transformResponse: fromRes
    };
    return metadata;
  }
  __release.fromReq = fromReq;
  __release.__isAmbassador = true;
  return __release;
}

// ../../node_modules/@wix/ambassador-devcenter-apps-v1-app-version/es/build/http.impl.js
init_esm_shims();
var _appVersion = {
  createdDate: "google.protobuf.Timestamp",
  updatedDate: "google.protobuf.Timestamp"
};
var _getLatestProductionVersionRequest = {};
var _getLatestProductionVersionResponse = { appVersion: "_appVersion" };
var _promoteAppVersionFromDraftToProductionRequest = {};
var _promoteAppVersionFromDraftToProductionResponse = {
  appVersion: "_appVersion"
};
var _suggestNextVersionsRequest = {};
var _suggestNextVersionsResponse = {};
function resolveWixDevcenterAppsVersionsV1AppVersionsServiceUrl(opts) {
  var domainToMappings = {
    "bo._base_domain_": [
      {
        srcPath: "/app-versions",
        destPath: ""
      }
    ],
    "wixbo.ai": [
      {
        srcPath: "/app-versions",
        destPath: ""
      }
    ],
    "wix-bo.com": [
      {
        srcPath: "/app-versions",
        destPath: ""
      }
    ],
    "dev._base_domain_": [
      {
        srcPath: "/app-versions",
        destPath: ""
      }
    ],
    "editor._base_domain_": [
      {
        srcPath: "/_api/app-versions",
        destPath: ""
      }
    ],
    "blocks._base_domain_": [
      {
        srcPath: "/_api/app-versions",
        destPath: ""
      }
    ],
    "create.editorx": [
      {
        srcPath: "/_api/app-versions",
        destPath: ""
      }
    ],
    "manage._base_domain_": [
      {
        srcPath: "/_api/app-versions",
        destPath: ""
      }
    ],
    "www.wixapis.com": [
      {
        srcPath: "/apps/v1/app-versions",
        destPath: ""
      }
    ],
    "*.dev.wix-code.com": [
      {
        srcPath: "/apps/v1/app-versions",
        destPath: ""
      }
    ]
  };
  return resolveUrl(Object.assign(opts, { domainToMappings }));
}
function suggestNextVersions(payload) {
  var _a = serializer(_suggestNextVersionsRequest, {}), toReq = _a.toJSON, fromReq = _a.fromJSON;
  var fromRes = serializer(_suggestNextVersionsResponse, {}).fromJSON;
  function __suggestNextVersions(_a2) {
    var host = _a2.host;
    var serializedData = toReq(payload);
    var metadata = {
      entityFqdn: "wix.devcenter.apps.v1.app_version",
      method: "GET",
      methodFqn: "wix.devcenter.apps.versions.v1.AppVersionsService.SuggestNextVersions",
      migrationOptions: {
        optInTransformResponse: true
      },
      url: resolveWixDevcenterAppsVersionsV1AppVersionsServiceUrl({
        protoPath: "/v1/app-versions/suggest-next-versions",
        data: serializedData,
        host
      }),
      params: toURLSearchParams(serializedData),
      transformResponse: fromRes
    };
    return metadata;
  }
  __suggestNextVersions.fromReq = fromReq;
  __suggestNextVersions.__isAmbassador = true;
  return __suggestNextVersions;
}
function getLatestProductionVersion(payload) {
  var _a = serializer(_getLatestProductionVersionRequest, {}), toReq = _a.toJSON, fromReq = _a.fromJSON;
  var fromRes = serializer(_getLatestProductionVersionResponse, { _appVersion }).fromJSON;
  function __getLatestProductionVersion(_a2) {
    var host = _a2.host;
    var serializedData = toReq(payload);
    var metadata = {
      entityFqdn: "wix.devcenter.apps.v1.app_version",
      method: "GET",
      methodFqn: "wix.devcenter.apps.versions.v1.AppVersionsService.GetLatestProductionVersion",
      migrationOptions: {
        optInTransformResponse: true
      },
      url: resolveWixDevcenterAppsVersionsV1AppVersionsServiceUrl({
        protoPath: "/v1/app-versions/get-latest-production",
        data: serializedData,
        host
      }),
      params: toURLSearchParams(serializedData),
      transformResponse: fromRes
    };
    return metadata;
  }
  __getLatestProductionVersion.fromReq = fromReq;
  __getLatestProductionVersion.__isAmbassador = true;
  return __getLatestProductionVersion;
}
function promoteAppVersionFromDraftToProduction(payload) {
  var _a = serializer(_promoteAppVersionFromDraftToProductionRequest, {}), toReq = _a.toJSON, fromReq = _a.fromJSON;
  var fromRes = serializer(_promoteAppVersionFromDraftToProductionResponse, { _appVersion }).fromJSON;
  function __promoteAppVersionFromDraftToProduction(_a2) {
    var host = _a2.host;
    var serializedData = toReq(payload);
    var metadata = {
      entityFqdn: "wix.devcenter.apps.v1.app_version",
      method: "POST",
      methodFqn: "wix.devcenter.apps.versions.v1.AppVersionsService.PromoteAppVersionFromDraftToProduction",
      migrationOptions: {
        optInTransformResponse: true
      },
      url: resolveWixDevcenterAppsVersionsV1AppVersionsServiceUrl({
        protoPath: "/v1/app-versions/promote-from-draft",
        data: serializedData,
        host
      }),
      data: serializedData,
      transformResponse: fromRes
    };
    return metadata;
  }
  __promoteAppVersionFromDraftToProduction.fromReq = fromReq;
  __promoteAppVersionFromDraftToProduction.__isAmbassador = true;
  return __promoteAppVersionFromDraftToProduction;
}

// ../../node_modules/@wix/ambassador-devcenter-apps-v1-app-version/es/build/types.impl.js
init_esm_shims();
var State;
(function(State2) {
  State2["UNKNOWN_STATE"] = "UNKNOWN_STATE";
  State2["UNLOCKED_DRAFT"] = "UNLOCKED_DRAFT";
  State2["LOCKED_DRAFT"] = "LOCKED_DRAFT";
  State2["PRODUCTION"] = "PRODUCTION";
})(State || (State = {}));
var Status;
(function(Status2) {
  Status2["UNKNOWN"] = "UNKNOWN";
  Status2["DEPRECATED"] = "DEPRECATED";
  Status2["ARCHIVED"] = "ARCHIVED";
})(Status || (Status = {}));
var OriginatedBy;
(function(OriginatedBy2) {
  OriginatedBy2["ORIGIN_UNKNOWN"] = "ORIGIN_UNKNOWN";
  OriginatedBy2["COMPONENT"] = "COMPONENT";
  OriginatedBy2["PERMISSION"] = "PERMISSION";
  OriginatedBy2["TRANSLATIONS"] = "TRANSLATIONS";
  OriginatedBy2["EXPERIMENT"] = "EXPERIMENT";
  OriginatedBy2["APP_DEPENDENCIES"] = "APP_DEPENDENCIES";
  OriginatedBy2["PRICING_PLAN"] = "PRICING_PLAN";
  OriginatedBy2["APP"] = "APP";
})(OriginatedBy || (OriginatedBy = {}));
var CreatedByType;
(function(CreatedByType2) {
  CreatedByType2["UNKNOWN_CREATED_BY"] = "UNKNOWN_CREATED_BY";
  CreatedByType2["USER"] = "USER";
  CreatedByType2["SERVICE"] = "SERVICE";
  CreatedByType2["ACCOUNT"] = "ACCOUNT";
})(CreatedByType || (CreatedByType = {}));
var PromoteStrategy;
(function(PromoteStrategy2) {
  PromoteStrategy2["UNKNOWN_STRATEGY"] = "UNKNOWN_STRATEGY";
  PromoteStrategy2["ENTIRE_APP"] = "ENTIRE_APP";
})(PromoteStrategy || (PromoteStrategy = {}));
var VersionStatus;
(function(VersionStatus2) {
  VersionStatus2["NONE_STATUS"] = "NONE_STATUS";
  VersionStatus2["DRAFT"] = "DRAFT";
  VersionStatus2["SUBMITTED"] = "SUBMITTED";
  VersionStatus2["IN_REVIEW"] = "IN_REVIEW";
  VersionStatus2["APPROVED"] = "APPROVED";
  VersionStatus2["PUBLISHED"] = "PUBLISHED";
  VersionStatus2["DECLINED"] = "DECLINED";
  VersionStatus2["ARCHIVED"] = "ARCHIVED";
  VersionStatus2["HIDDEN"] = "HIDDEN";
  VersionStatus2["RELEASED"] = "RELEASED";
})(VersionStatus || (VersionStatus = {}));
var SortOrder;
(function(SortOrder2) {
  SortOrder2["ASC"] = "ASC";
  SortOrder2["DESC"] = "DESC";
})(SortOrder || (SortOrder = {}));
var V1Status;
(function(V1Status2) {
  V1Status2["ACTIVE"] = "ACTIVE";
  V1Status2["DEPRECATED"] = "DEPRECATED";
  V1Status2["ARCHIVED"] = "ARCHIVED";
})(V1Status || (V1Status = {}));
var AppType;
(function(AppType2) {
  AppType2["SITE_APP"] = "SITE_APP";
  AppType2["API_KEY"] = "API_KEY";
  AppType2["VELO_APP"] = "VELO_APP";
  AppType2["PRIVATE_APP"] = "PRIVATE_APP";
  AppType2["HEADLESS"] = "HEADLESS";
  AppType2["FUNCTION_ACTIVATION_APP"] = "FUNCTION_ACTIVATION_APP";
})(AppType || (AppType = {}));
var CreatedByCreatedByType;
(function(CreatedByCreatedByType2) {
  CreatedByCreatedByType2["USER"] = "USER";
  CreatedByCreatedByType2["APP"] = "APP";
  CreatedByCreatedByType2["CODE_GEN"] = "CODE_GEN";
  CreatedByCreatedByType2["APP_BUILDER_SELF_HOSTED"] = "APP_BUILDER_SELF_HOSTED";
})(CreatedByCreatedByType || (CreatedByCreatedByType = {}));
var ShowConsentBehaviour;
(function(ShowConsentBehaviour2) {
  ShowConsentBehaviour2["DEFAULT_BEHAVIOUR"] = "DEFAULT_BEHAVIOUR";
  ShowConsentBehaviour2["SHOW_CONSENT"] = "SHOW_CONSENT";
  ShowConsentBehaviour2["SKIP_CONSENT"] = "SKIP_CONSENT";
})(ShowConsentBehaviour || (ShowConsentBehaviour = {}));
var RedirectTarget;
(function(RedirectTarget2) {
  RedirectTarget2["UNKNOWN_REDIRECT_TARGET"] = "UNKNOWN_REDIRECT_TARGET";
  RedirectTarget2["DASHBOARD"] = "DASHBOARD";
  RedirectTarget2["EDITOR"] = "EDITOR";
})(RedirectTarget || (RedirectTarget = {}));
var OpenButtonAction;
(function(OpenButtonAction2) {
  OpenButtonAction2["UNKNOWN_ACTION"] = "UNKNOWN_ACTION";
  OpenButtonAction2["OPEN_COMPONENT_ID"] = "OPEN_COMPONENT_ID";
})(OpenButtonAction || (OpenButtonAction = {}));
var UninstallActions;
(function(UninstallActions2) {
  UninstallActions2["NONE_ACTION"] = "NONE_ACTION";
  UninstallActions2["NO_ACTION"] = "NO_ACTION";
  UninstallActions2["REMOVE_ALL_PRODUCT"] = "REMOVE_ALL_PRODUCT";
  UninstallActions2["SHIPPING_RATES_REGION"] = "SHIPPING_RATES_REGION";
})(UninstallActions || (UninstallActions = {}));
var PlanStatus;
(function(PlanStatus2) {
  PlanStatus2["UNKNOWN"] = "UNKNOWN";
  PlanStatus2["VISIBLE"] = "VISIBLE";
  PlanStatus2["HIDDEN"] = "HIDDEN";
})(PlanStatus || (PlanStatus = {}));
var PlanDescription;
(function(PlanDescription2) {
  PlanDescription2["UNKNOWN_DESCRIPTION"] = "UNKNOWN_DESCRIPTION";
  PlanDescription2["BENEFITS"] = "BENEFITS";
  PlanDescription2["CUSTOM_TEXT"] = "CUSTOM_TEXT";
})(PlanDescription || (PlanDescription = {}));
var BusinessModel;
(function(BusinessModel2) {
  BusinessModel2["None"] = "None";
  BusinessModel2["FREEMIUM"] = "FREEMIUM";
  BusinessModel2["PREMIUM"] = "PREMIUM";
  BusinessModel2["FREE"] = "FREE";
  BusinessModel2["WIX_PREMIUM"] = "WIX_PREMIUM";
  BusinessModel2["DYNAMIC"] = "DYNAMIC";
})(BusinessModel || (BusinessModel = {}));
var Action;
(function(Action2) {
  Action2["CREATED"] = "CREATED";
  Action2["UPDATED"] = "UPDATED";
  Action2["RESTORED"] = "RESTORED";
  Action2["DELETED"] = "DELETED";
})(Action || (Action = {}));
var WebhookIdentityType;
(function(WebhookIdentityType2) {
  WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
  WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
  WebhookIdentityType2["MEMBER"] = "MEMBER";
  WebhookIdentityType2["WIX_USER"] = "WIX_USER";
  WebhookIdentityType2["APP"] = "APP";
})(WebhookIdentityType || (WebhookIdentityType = {}));

// ../../node_modules/@wix/ambassador-devcenter-components-overrides-v1-components-override/es/build/http.impl.js
init_esm_shims();
var __Array = {
  checkboxGroupOptions: "_checkboxGroup",
  tagsOptions: "_tags",
  validation: "_arrayType"
};
var __Boolean = { checkboxOptions: "_checkbox" };
var __Number = {
  numberInputOptions: "_numberInput",
  ratingInputOptions: "_ratingInput",
  validation: "_numberType"
};
var __Object = { validation: "_objectType" };
var __String = {
  textInputOptions: "_textInput",
  radioGroupOptions: "_radioGroup",
  dropdownOptions: "_dropdown",
  dateTimeOptions: "_dateTimeInput",
  phoneInputOptions: "_phoneInput",
  dateInputOptions: "_dateInput",
  timeInputOptions: "_timeInput",
  datePickerOptions: "_datePicker",
  passwordOptions: "_password"
};
var _actionProviderSPIConfig = { actionConfig: "_actionSPIConfig" };
var _actionSPIConfig = { icon: "_commonImage" };
var _address = { multilineAddressOptions: "_multilineAddress" };
var _adminConfigurableTextInput = {
  requiredSettings: "google.protobuf.FieldMask",
  adminConfigurableSettings: "google.protobuf.FieldMask"
};
var _andCondition = { conditions: "_conditionNode" };
var _api_Number = {
  minimum: "google.protobuf.FloatValue",
  maximum: "google.protobuf.FloatValue",
  multipleOf: "google.protobuf.FloatValue"
};
var _apiArrayItems = { data: "_dataItems", dataItem: "_dataItem" };
var _apiContext = { items: "Map#_contextItem" };
var _appEmbedData = { image: "_media" };
var _appointment = { description: "_richContent" };
var _arrayItems = {
  numberOptions: "_numberType",
  objectOptions: "_objectType"
};
var _arrayOptions = {
  objectOptions: "_objectOptions",
  arrayOptions: "_arrayOptions"
};
var _arrayType = { items: "_arrayItems" };
var _audioData = { audio: "_media", coverImage: "_media" };
var _authenticatorConfig = { expectedInputs: "_expectedInputs" };
var _backdrop = { gradient: "_v1Gradient" };
var _background = { image: "_media" };
var _backgroundImage = { media: "_media" };
var _breakPoint = { items: "_itemLayout" };
var _breakpointPresetStyleOverrides = {
  default: "_presetStyleOverrides",
  small: "_presetStyleOverrides"
};
var _buttonData = { styles: "_styles" };
var _cardData = {
  background: "_cardDataBackground",
  backgroundImage: "_cardDataBackgroundImage"
};
var _cardDataBackground = { gradient: "_v1Gradient" };
var _cardDataBackgroundImage = { media: "_media" };
var _checkbox = { label: "_richContent" };
var _checkboxGroup = {
  description: "_richContent",
  options: "_option",
  media: "_mediaItem"
};
var _collection = { fields: "_dataComponentField" };
var _commitOverrideRequest = {};
var _commitOverrideResponse = {};
var _commonImage = {
  urlExpirationDate: "google.protobuf.Timestamp",
  focalPoint: "_focalPoint"
};
var _componentData = {
  widgetComponentData: "_widgetComponentData",
  widgetOutOfIframeData: "_widgetOutOfIframeComponentData",
  studioWidgetComponentData: "_studioWidgetComponentData",
  dataComponent: "_dataComponent",
  shippingLabelCarrier: "_shippingLabelCarrierSpiConfig",
  fictionalShippingProvider: "_shippingProviderConfig",
  automationsActionProvider: "_actionProviderSPIConfig",
  identityAuthenticator: "_authenticatorConfig",
  devCenterTestingComponent: "_devCenterTestingComponentData",
  multilingualTranslationSchema: "_multilingualTranslationSchema",
  formTemplate: "_formTemplate",
  functionsShopPriceProvider: "_functionsShopPriceSpiConfig",
  function: "_function",
  papiProvider: "_pluginConfig",
  multilingualTranslationSchemaGroup: "_schemaGroup",
  editorReactComponent: "_editorReactComponent",
  editorContextProvider: "_editorContextProvider",
  editorFunctionLibrary: "_editorFunctionLibrary"
};
var _componentExperiment = { updateComponentOptions: "_updateComponent" };
var _componentsOverride = {
  createdDate: "google.protobuf.Timestamp",
  modifiedComponents: "_modifiedComponent",
  experiments: "_componentExperiment"
};
var _conditionNode = { and: "_andCondition", or: "_orCondition" };
var _contextArrayItems = { item: "_contextItem" };
var _contextDataItems = { items: "Map#_contextItem" };
var _contextItem = {
  arrayItems: "_contextArrayItems",
  data: "_contextDataItems",
  function: "_editorFunction"
};
var _createComponentsOverrideRequest = {
  componentsOverride: "_componentsOverride"
};
var _createComponentsOverrideResponse = {
  componentsOverride: "_componentsOverride"
};
var _cssCustomPropertyItem = { number: "_cssNumber" };
var _cssNumber = {
  minimum: "google.protobuf.FloatValue",
  maximum: "google.protobuf.FloatValue",
  multipleOf: "google.protobuf.FloatValue"
};
var _dataComponent = { collections: "_collection" };
var _dataComponentField = {
  objectOptions: "_objectOptions",
  arrayOptions: "_arrayOptions"
};
var _dataItem = {
  number: "_api_Number",
  arrayItems: "_apiArrayItems",
  data: "_dataItems",
  function: "_editorFunction"
};
var _dataItems = { items: "Map#_dataItem" };
var _dateInput = { description: "_richContent", media: "_mediaItem" };
var _datePicker = { description: "_richContent", media: "_mediaItem" };
var _dateTimeInput = { description: "_richContent", media: "_mediaItem" };
var _description = { representativeImage: "_commonImage" };
var _design = { poll: "_pollDesign" };
var _devCenterTestingComponentData = {
  translatableMessageInOneOf: "_messageContainingTranslatables",
  translatableMessage: "_messageContainingTranslatables",
  mapOfTranslatableMessages: "Map#_messageContainingTranslatables",
  translatableRichContent: "_richContent",
  nonTranslatableRichContent: "_richContent",
  richContentMap: "Map#_richContent"
};
var _displayField = { richContentOptions: "_richContentOptions" };
var _donationInput = { description: "_richContent", media: "_mediaItem" };
var _dropdown = { description: "_richContent", media: "_mediaItem" };
var _editorContextProvider = {
  context: "_apiContext",
  data: "Map#_dataItem"
};
var _editorElement = {
  data: "Map#_dataItem",
  contexts: "Map#_apiContext",
  elements: "Map#_elementItem",
  presets: "Map#_presetItem",
  cssCustomProperties: "Map#_cssCustomPropertyItem"
};
var _editorFunction = {
  parameters: "_functionParameter",
  returns: "_functionReturnType"
};
var _editorFunctionLibrary = { functions: "Map#_editorFunction" };
var _editorPresence = { presetsEditorPresence: "_presetEditorPresence" };
var _editorReactComponent = { editorElement: "_editorElement" };
var _elementItem = {
  inlineElement: "_inlineElement",
  refElement: "_refElement"
};
var _elementStyleOverrides = { elements: "Map#_elementStyleOverrides" };
var _expectedInputs = {
  expectedStartInputs: "_predefinedExpectedInput",
  expectedVerifyInputs: "_predefinedExpectedInput"
};
var _field = { inputOptions: "_inputField", displayOptions: "_displayField" };
var _fileUpload = { description: "_richContent", media: "_mediaItem" };
var _fixedPayment = { description: "_richContent", media: "_mediaItem" };
var _focalPoint = { x: "DOUBLE", y: "DOUBLE" };
var _formLayout = {
  large: "_breakPoint",
  medium: "_breakPoint",
  small: "_breakPoint"
};
var _formTemplate = {
  createdDate: "google.protobuf.Timestamp",
  updatedDate: "google.protobuf.Timestamp",
  fields: "_field",
  deletedFields: "_field",
  steps: "_step",
  rules: "_v2Rule",
  submitSettings: "_submitSettings"
};
var _function = { description: "_description" };
var _functionParameter = {
  arrayItems: "_functionParameterArrayItems",
  data: "_functionParameterItems",
  function: "_editorFunction"
};
var _functionParameterArrayItems = { item: "_functionParameter" };
var _functionParameterItems = { items: "Map#_functionParameter" };
var _functionReturnType = {
  arrayItems: "_functionParameterArrayItems",
  data: "_functionParameterItems"
};
var _functionsShopPriceSpiConfig = {
  shopNumber: "google.protobuf.DoubleValue"
};
var _galleryData = { items: "_item", options: "_galleryOptions" };
var _galleryOptions = { item: "_itemStyle" };
var _getComponentsOverrideRequest = {};
var _getComponentsOverrideResponse = {
  componentsOverride: "_componentsOverride"
};
var _group = { items: "_itemLayout" };
var _image = { urlExpirationDate: "google.protobuf.Timestamp" };
var _imageData = { image: "_media" };
var _inlineElement = {
  style: "Map#_styleItem",
  data: "Map#_dataItem",
  elements: "Map#_elementItem",
  presets: "Map#_presetItem",
  cssCustomProperties: "Map#_cssCustomPropertyItem"
};
var _inputField = {
  stringOptions: "__String",
  numberOptions: "__Number",
  booleanOptions: "__Boolean",
  arrayOptions: "__Array",
  objectOptions: "__Object",
  wixFileOptions: "_wixFile",
  paymentOptions: "_payment",
  multilineAddressOptions: "_address",
  schedulingOptions: "_scheduling",
  addressOptions: "_address"
};
var _item = { image: "_itemImage", video: "_video" };
var _itemImage = { media: "_media" };
var _itemLayout = { group: "_group" };
var _itemStyle = { ratio: "google.protobuf.DoubleValue" };
var _layoutData = {
  backgroundImage: "_backgroundImage",
  backdropImage: "_backgroundImage",
  background: "_layoutDataBackground",
  backdrop: "_backdrop"
};
var _layoutDataBackground = { gradient: "_v1Gradient" };
var _mapData = { mapSettings: "_mapSettings" };
var _mapSettings = {
  lat: "google.protobuf.DoubleValue",
  lng: "google.protobuf.DoubleValue"
};
var _media = { duration: "google.protobuf.DoubleValue" };
var _mediaItem = { image: "_upstreamWixCommonImage" };
var _messageContainingTranslatables = {
  innerTranslatableRichContent: "_richContent"
};
var _modifiedComponent = { data: "_componentData" };
var _multilineAddress = { description: "_richContent" };
var _multilingualTranslationSchema = { referenceData: "_schema" };
var _node = {
  buttonData: "_buttonData",
  galleryData: "_galleryData",
  imageData: "_imageData",
  mapData: "_mapData",
  pollData: "_pollData",
  appEmbedData: "_appEmbedData",
  videoData: "_videoData",
  audioData: "_audioData",
  layoutData: "_layoutData",
  shapeData: "_shapeData",
  cardData: "_cardData",
  tocData: "_tocData",
  nodes: "_node"
};
var _numberInput = {
  default: "google.protobuf.DoubleValue",
  description: "_richContent",
  media: "_mediaItem"
};
var _numberType = {
  maximum: "google.protobuf.DoubleValue",
  minimum: "google.protobuf.DoubleValue",
  multipleOf: "google.protobuf.DoubleValue",
  enum: "google.protobuf.DoubleValue"
};
var _objectField = {
  objectOptions: "_objectOptions",
  arrayOptions: "_arrayOptions"
};
var _objectOptions = { fields: "_objectField" };
var _objectType = { properties: "Map#_propertiesType" };
var _option = { media: "_mediaItem" };
var _orCondition = { conditions: "_conditionNode" };
var _packageDimension = {
  width: "DOUBLE",
  length: "DOUBLE",
  height: "google.protobuf.DoubleValue"
};
var _packageType = { dimension: "_packageDimension", image: "_image" };
var _password = { description: "_richContent", media: "_mediaItem" };
var _payment = {
  checkboxGroupOptions: "_productCheckboxGroup",
  donationInputOptions: "_donationInput",
  paymentInputOptions: "_paymentInput",
  fixedPaymentOptions: "_fixedPayment"
};
var _paymentInput = {
  default: "google.protobuf.DoubleValue",
  description: "_richContent",
  media: "_mediaItem"
};
var _phoneInput = { description: "_richContent", media: "_mediaItem" };
var _pluginConfig = { startingEnforcementDate: "google.protobuf.Timestamp" };
var _poll = { image: "_media", options: "_pollOption" };
var _pollData = { poll: "_poll", design: "_design" };
var _pollDesign = { background: "_background" };
var _pollOption = { image: "_media" };
var _predefinedExpectedInput = {
  configuration: "_predefinedExpectedInputConfiguration"
};
var _predefinedExpectedInputConfiguration = {
  textInput: "_adminConfigurableTextInput"
};
var _presetEditorPresence = { wixMediaThumbnail: "_commonImage" };
var _presetElementDefaults = { elements: "Map#_presetInnerElementDefaults" };
var _presetInnerElementDefaults = {
  elements: "Map#_presetInnerElementDefaults"
};
var _presetItem = {
  styleOverrides: "_breakpointPresetStyleOverrides",
  presetDefaults: "_presetElementDefaults"
};
var _presetStyleOverrides = { elements: "Map#_elementStyleOverrides" };
var _productCheckboxGroup = {
  description: "_richContent",
  options: "_productCheckboxGroupOption",
  media: "_mediaItem"
};
var _productCheckboxGroupOption = { media: "_mediaItem" };
var _propertiesType = {
  numberOptions: "_numberType",
  arrayOptions: "_arrayType"
};
var _radioGroup = { description: "_richContent", media: "_mediaItem" };
var _ratingInput = { description: "_richContent", media: "_mediaItem" };
var _refElement = {
  resolvedElement: "_inlineElement",
  elements: "Map#_refInnerElementDefaults"
};
var _refInnerElementDefaults = { elements: "Map#_refInnerElementDefaults" };
var _richContent = { nodes: "_node", metadata: "_v1Metadata" };
var _richContentOptions = { richContent: "_richContent" };
var _scheduling = { appointmentOptions: "_appointment" };
var _schema = {
  createdDate: "google.protobuf.Timestamp",
  updatedDate: "google.protobuf.Timestamp",
  fields: "Map#_v1SchemaField"
};
var _schemaGroup = {
  createdDate: "google.protobuf.Timestamp",
  updatedDate: "google.protobuf.Timestamp"
};
var _shapeData = { shape: "_media" };
var _shippingLabelCarrierSpiConfig = { packageTypes: "_packageType" };
var _shippingProviderConfig = { shippingPrice: "DOUBLE" };
var _signature = { description: "_richContent", media: "_mediaItem" };
var _step = { layout: "_formLayout" };
var _stop = { position: "google.protobuf.DoubleValue" };
var _studioWidgetComponentData = {
  widgetDisplay: "_widgetDisplay",
  editorPresence: "_editorPresence"
};
var _styleItem = { number: "_cssNumber" };
var _styles = {
  background: "_stylesBackground",
  backgroundHover: "_stylesBackground"
};
var _stylesBackground = { gradient: "_v1Gradient" };
var _submitSettings = { thankYouMessageOptions: "_thankYouMessageOptions" };
var _tags = {
  description: "_richContent",
  options: "_tagsOption",
  media: "_mediaItem"
};
var _tagsOption = { media: "_mediaItem" };
var _textInput = { description: "_richContent", media: "_mediaItem" };
var _thankYouMessageOptions = { richContent: "_richContent" };
var _timeInput = { description: "_richContent", media: "_mediaItem" };
var _tocData = {
  fontSize: "google.protobuf.DoubleValue",
  itemSpacing: "google.protobuf.DoubleValue"
};
var _updateComponent = { data: "_componentData" };
var _updateComponentsOverrideRequest = {
  fieldMask: "google.protobuf.FieldMask",
  componentsOverride: "_componentsOverride"
};
var _updateComponentsOverrideResponse = {
  componentsOverride: "_componentsOverride"
};
var _upstreamWixCommonImage = {
  urlExpirationDate: "google.protobuf.Timestamp"
};
var _v1Gradient = {
  centerX: "google.protobuf.DoubleValue",
  centerY: "google.protobuf.DoubleValue",
  stops: "_stop"
};
var _v1Metadata = {
  createdTimestamp: "google.protobuf.Timestamp",
  updatedTimestamp: "google.protobuf.Timestamp"
};
var _v1SchemaField = { index: "google.protobuf.DoubleValue" };
var _v2Rule = { expression: "_conditionNode" };
var _video = { media: "_media", thumbnail: "_media" };
var _videoData = { video: "_media", thumbnail: "_media" };
var _widgetComponentData = { widgetDisplay: "_widgetDisplay" };
var _widgetDisplay = { price: "google.protobuf.FloatValue" };
var _widgetOutOfIframeComponentData = { widgetData: "_widgetComponentData" };
var _wixFile = {
  fileUploadOptions: "_fileUpload",
  signatureOptions: "_signature"
};
function resolveWixDevcenterComponentsOverridesV1ComponentsOverridesServiceUrl(opts) {
  var domainToMappings = {
    "editor._base_domain_": [
      {
        srcPath: "/_api/components-overrides",
        destPath: ""
      }
    ],
    "blocks._base_domain_": [
      {
        srcPath: "/_api/components-overrides",
        destPath: ""
      }
    ],
    "create.editorx": [
      {
        srcPath: "/_api/components-overrides",
        destPath: ""
      }
    ],
    "www.wixapis.com": [
      {
        srcPath: "/apps/components-overrides/v1/components-override",
        destPath: ""
      }
    ],
    "*.dev.wix-code.com": [
      {
        srcPath: "/apps/components-overrides/v1/components-override",
        destPath: ""
      }
    ],
    "manage._base_domain_": [
      {
        srcPath: "/_api/components-overrides",
        destPath: ""
      }
    ]
  };
  return resolveUrl(Object.assign(opts, { domainToMappings }));
}
function createComponentsOverride(payload) {
  var _a = serializer(_createComponentsOverrideRequest, {
    __Array,
    __Boolean,
    __Number,
    __Object,
    __String,
    _actionProviderSPIConfig,
    _actionSPIConfig,
    _address,
    _adminConfigurableTextInput,
    _andCondition,
    _apiArrayItems,
    _apiContext,
    _api_Number,
    _appEmbedData,
    _appointment,
    _arrayItems,
    _arrayOptions,
    _arrayType,
    _audioData,
    _authenticatorConfig,
    _backdrop,
    _background,
    _backgroundImage,
    _breakPoint,
    _breakpointPresetStyleOverrides,
    _buttonData,
    _cardData,
    _cardDataBackground,
    _cardDataBackgroundImage,
    _checkbox,
    _checkboxGroup,
    _collection,
    _commonImage,
    _componentData,
    _componentExperiment,
    _componentsOverride,
    _conditionNode,
    _contextArrayItems,
    _contextDataItems,
    _contextItem,
    _cssCustomPropertyItem,
    _cssNumber,
    _dataComponent,
    _dataComponentField,
    _dataItem,
    _dataItems,
    _dateInput,
    _datePicker,
    _dateTimeInput,
    _description,
    _design,
    _devCenterTestingComponentData,
    _displayField,
    _donationInput,
    _dropdown,
    _editorContextProvider,
    _editorElement,
    _editorFunction,
    _editorFunctionLibrary,
    _editorPresence,
    _editorReactComponent,
    _elementItem,
    _elementStyleOverrides,
    _expectedInputs,
    _field,
    _fileUpload,
    _fixedPayment,
    _focalPoint,
    _formLayout,
    _formTemplate,
    _function,
    _functionParameter,
    _functionParameterArrayItems,
    _functionParameterItems,
    _functionReturnType,
    _functionsShopPriceSpiConfig,
    _galleryData,
    _galleryOptions,
    _group,
    _image,
    _imageData,
    _inlineElement,
    _inputField,
    _item,
    _itemImage,
    _itemLayout,
    _itemStyle,
    _layoutData,
    _layoutDataBackground,
    _mapData,
    _mapSettings,
    _media,
    _mediaItem,
    _messageContainingTranslatables,
    _modifiedComponent,
    _multilineAddress,
    _multilingualTranslationSchema,
    _node,
    _numberInput,
    _numberType,
    _objectField,
    _objectOptions,
    _objectType,
    _option,
    _orCondition,
    _packageDimension,
    _packageType,
    _password,
    _payment,
    _paymentInput,
    _phoneInput,
    _pluginConfig,
    _poll,
    _pollData,
    _pollDesign,
    _pollOption,
    _predefinedExpectedInput,
    _predefinedExpectedInputConfiguration,
    _presetEditorPresence,
    _presetElementDefaults,
    _presetInnerElementDefaults,
    _presetItem,
    _presetStyleOverrides,
    _productCheckboxGroup,
    _productCheckboxGroupOption,
    _propertiesType,
    _radioGroup,
    _ratingInput,
    _refElement,
    _refInnerElementDefaults,
    _richContent,
    _richContentOptions,
    _scheduling,
    _schema,
    _schemaGroup,
    _shapeData,
    _shippingLabelCarrierSpiConfig,
    _shippingProviderConfig,
    _signature,
    _step,
    _stop,
    _studioWidgetComponentData,
    _styleItem,
    _styles,
    _stylesBackground,
    _submitSettings,
    _tags,
    _tagsOption,
    _textInput,
    _thankYouMessageOptions,
    _timeInput,
    _tocData,
    _updateComponent,
    _upstreamWixCommonImage,
    _v1Gradient,
    _v1Metadata,
    _v1SchemaField,
    _v2Rule,
    _video,
    _videoData,
    _widgetComponentData,
    _widgetDisplay,
    _widgetOutOfIframeComponentData,
    _wixFile
  }), toReq = _a.toJSON, fromReq = _a.fromJSON;
  var fromRes = serializer(_createComponentsOverrideResponse, {
    __Array,
    __Boolean,
    __Number,
    __Object,
    __String,
    _actionProviderSPIConfig,
    _actionSPIConfig,
    _address,
    _adminConfigurableTextInput,
    _andCondition,
    _apiArrayItems,
    _apiContext,
    _api_Number,
    _appEmbedData,
    _appointment,
    _arrayItems,
    _arrayOptions,
    _arrayType,
    _audioData,
    _authenticatorConfig,
    _backdrop,
    _background,
    _backgroundImage,
    _breakPoint,
    _breakpointPresetStyleOverrides,
    _buttonData,
    _cardData,
    _cardDataBackground,
    _cardDataBackgroundImage,
    _checkbox,
    _checkboxGroup,
    _collection,
    _commonImage,
    _componentData,
    _componentExperiment,
    _componentsOverride,
    _conditionNode,
    _contextArrayItems,
    _contextDataItems,
    _contextItem,
    _cssCustomPropertyItem,
    _cssNumber,
    _dataComponent,
    _dataComponentField,
    _dataItem,
    _dataItems,
    _dateInput,
    _datePicker,
    _dateTimeInput,
    _description,
    _design,
    _devCenterTestingComponentData,
    _displayField,
    _donationInput,
    _dropdown,
    _editorContextProvider,
    _editorElement,
    _editorFunction,
    _editorFunctionLibrary,
    _editorPresence,
    _editorReactComponent,
    _elementItem,
    _elementStyleOverrides,
    _expectedInputs,
    _field,
    _fileUpload,
    _fixedPayment,
    _focalPoint,
    _formLayout,
    _formTemplate,
    _function,
    _functionParameter,
    _functionParameterArrayItems,
    _functionParameterItems,
    _functionReturnType,
    _functionsShopPriceSpiConfig,
    _galleryData,
    _galleryOptions,
    _group,
    _image,
    _imageData,
    _inlineElement,
    _inputField,
    _item,
    _itemImage,
    _itemLayout,
    _itemStyle,
    _layoutData,
    _layoutDataBackground,
    _mapData,
    _mapSettings,
    _media,
    _mediaItem,
    _messageContainingTranslatables,
    _modifiedComponent,
    _multilineAddress,
    _multilingualTranslationSchema,
    _node,
    _numberInput,
    _numberType,
    _objectField,
    _objectOptions,
    _objectType,
    _option,
    _orCondition,
    _packageDimension,
    _packageType,
    _password,
    _payment,
    _paymentInput,
    _phoneInput,
    _pluginConfig,
    _poll,
    _pollData,
    _pollDesign,
    _pollOption,
    _predefinedExpectedInput,
    _predefinedExpectedInputConfiguration,
    _presetEditorPresence,
    _presetElementDefaults,
    _presetInnerElementDefaults,
    _presetItem,
    _presetStyleOverrides,
    _productCheckboxGroup,
    _productCheckboxGroupOption,
    _propertiesType,
    _radioGroup,
    _ratingInput,
    _refElement,
    _refInnerElementDefaults,
    _richContent,
    _richContentOptions,
    _scheduling,
    _schema,
    _schemaGroup,
    _shapeData,
    _shippingLabelCarrierSpiConfig,
    _shippingProviderConfig,
    _signature,
    _step,
    _stop,
    _studioWidgetComponentData,
    _styleItem,
    _styles,
    _stylesBackground,
    _submitSettings,
    _tags,
    _tagsOption,
    _textInput,
    _thankYouMessageOptions,
    _timeInput,
    _tocData,
    _updateComponent,
    _upstreamWixCommonImage,
    _v1Gradient,
    _v1Metadata,
    _v1SchemaField,
    _v2Rule,
    _video,
    _videoData,
    _widgetComponentData,
    _widgetDisplay,
    _widgetOutOfIframeComponentData,
    _wixFile
  }).fromJSON;
  function __createComponentsOverride(_a2) {
    var host = _a2.host;
    var serializedData = toReq(payload);
    var metadata = {
      entityFqdn: "wix.devcenter.components_overrides.v1.components_override",
      method: "POST",
      methodFqn: "wix.devcenter.components.overrides.v1.ComponentsOverridesService.CreateComponentsOverride",
      migrationOptions: {
        optInTransformResponse: true
      },
      url: resolveWixDevcenterComponentsOverridesV1ComponentsOverridesServiceUrl({ protoPath: "/v1/components-override", data: serializedData, host }),
      data: serializedData,
      transformResponse: fromRes
    };
    return metadata;
  }
  __createComponentsOverride.fromReq = fromReq;
  __createComponentsOverride.__isAmbassador = true;
  return __createComponentsOverride;
}
function getComponentsOverride(payload) {
  var _a = serializer(_getComponentsOverrideRequest, {}), toReq = _a.toJSON, fromReq = _a.fromJSON;
  var fromRes = serializer(_getComponentsOverrideResponse, {
    __Array,
    __Boolean,
    __Number,
    __Object,
    __String,
    _actionProviderSPIConfig,
    _actionSPIConfig,
    _address,
    _adminConfigurableTextInput,
    _andCondition,
    _apiArrayItems,
    _apiContext,
    _api_Number,
    _appEmbedData,
    _appointment,
    _arrayItems,
    _arrayOptions,
    _arrayType,
    _audioData,
    _authenticatorConfig,
    _backdrop,
    _background,
    _backgroundImage,
    _breakPoint,
    _breakpointPresetStyleOverrides,
    _buttonData,
    _cardData,
    _cardDataBackground,
    _cardDataBackgroundImage,
    _checkbox,
    _checkboxGroup,
    _collection,
    _commonImage,
    _componentData,
    _componentExperiment,
    _componentsOverride,
    _conditionNode,
    _contextArrayItems,
    _contextDataItems,
    _contextItem,
    _cssCustomPropertyItem,
    _cssNumber,
    _dataComponent,
    _dataComponentField,
    _dataItem,
    _dataItems,
    _dateInput,
    _datePicker,
    _dateTimeInput,
    _description,
    _design,
    _devCenterTestingComponentData,
    _displayField,
    _donationInput,
    _dropdown,
    _editorContextProvider,
    _editorElement,
    _editorFunction,
    _editorFunctionLibrary,
    _editorPresence,
    _editorReactComponent,
    _elementItem,
    _elementStyleOverrides,
    _expectedInputs,
    _field,
    _fileUpload,
    _fixedPayment,
    _focalPoint,
    _formLayout,
    _formTemplate,
    _function,
    _functionParameter,
    _functionParameterArrayItems,
    _functionParameterItems,
    _functionReturnType,
    _functionsShopPriceSpiConfig,
    _galleryData,
    _galleryOptions,
    _group,
    _image,
    _imageData,
    _inlineElement,
    _inputField,
    _item,
    _itemImage,
    _itemLayout,
    _itemStyle,
    _layoutData,
    _layoutDataBackground,
    _mapData,
    _mapSettings,
    _media,
    _mediaItem,
    _messageContainingTranslatables,
    _modifiedComponent,
    _multilineAddress,
    _multilingualTranslationSchema,
    _node,
    _numberInput,
    _numberType,
    _objectField,
    _objectOptions,
    _objectType,
    _option,
    _orCondition,
    _packageDimension,
    _packageType,
    _password,
    _payment,
    _paymentInput,
    _phoneInput,
    _pluginConfig,
    _poll,
    _pollData,
    _pollDesign,
    _pollOption,
    _predefinedExpectedInput,
    _predefinedExpectedInputConfiguration,
    _presetEditorPresence,
    _presetElementDefaults,
    _presetInnerElementDefaults,
    _presetItem,
    _presetStyleOverrides,
    _productCheckboxGroup,
    _productCheckboxGroupOption,
    _propertiesType,
    _radioGroup,
    _ratingInput,
    _refElement,
    _refInnerElementDefaults,
    _richContent,
    _richContentOptions,
    _scheduling,
    _schema,
    _schemaGroup,
    _shapeData,
    _shippingLabelCarrierSpiConfig,
    _shippingProviderConfig,
    _signature,
    _step,
    _stop,
    _studioWidgetComponentData,
    _styleItem,
    _styles,
    _stylesBackground,
    _submitSettings,
    _tags,
    _tagsOption,
    _textInput,
    _thankYouMessageOptions,
    _timeInput,
    _tocData,
    _updateComponent,
    _upstreamWixCommonImage,
    _v1Gradient,
    _v1Metadata,
    _v1SchemaField,
    _v2Rule,
    _video,
    _videoData,
    _widgetComponentData,
    _widgetDisplay,
    _widgetOutOfIframeComponentData,
    _wixFile
  }).fromJSON;
  function __getComponentsOverride(_a2) {
    var host = _a2.host;
    var serializedData = toReq(payload);
    var metadata = {
      entityFqdn: "wix.devcenter.components_overrides.v1.components_override",
      method: "GET",
      methodFqn: "wix.devcenter.components.overrides.v1.ComponentsOverridesService.GetComponentsOverride",
      migrationOptions: {
        optInTransformResponse: true
      },
      url: resolveWixDevcenterComponentsOverridesV1ComponentsOverridesServiceUrl({
        protoPath: "/v1/components-override/{componentsOverrideId}",
        data: serializedData,
        host
      }),
      params: toURLSearchParams(serializedData),
      transformResponse: fromRes
    };
    return metadata;
  }
  __getComponentsOverride.fromReq = fromReq;
  __getComponentsOverride.__isAmbassador = true;
  return __getComponentsOverride;
}
function updateComponentsOverrides(payload) {
  var _a = serializer(_updateComponentsOverrideRequest, {
    __Array,
    __Boolean,
    __Number,
    __Object,
    __String,
    _actionProviderSPIConfig,
    _actionSPIConfig,
    _address,
    _adminConfigurableTextInput,
    _andCondition,
    _apiArrayItems,
    _apiContext,
    _api_Number,
    _appEmbedData,
    _appointment,
    _arrayItems,
    _arrayOptions,
    _arrayType,
    _audioData,
    _authenticatorConfig,
    _backdrop,
    _background,
    _backgroundImage,
    _breakPoint,
    _breakpointPresetStyleOverrides,
    _buttonData,
    _cardData,
    _cardDataBackground,
    _cardDataBackgroundImage,
    _checkbox,
    _checkboxGroup,
    _collection,
    _commonImage,
    _componentData,
    _componentExperiment,
    _componentsOverride,
    _conditionNode,
    _contextArrayItems,
    _contextDataItems,
    _contextItem,
    _cssCustomPropertyItem,
    _cssNumber,
    _dataComponent,
    _dataComponentField,
    _dataItem,
    _dataItems,
    _dateInput,
    _datePicker,
    _dateTimeInput,
    _description,
    _design,
    _devCenterTestingComponentData,
    _displayField,
    _donationInput,
    _dropdown,
    _editorContextProvider,
    _editorElement,
    _editorFunction,
    _editorFunctionLibrary,
    _editorPresence,
    _editorReactComponent,
    _elementItem,
    _elementStyleOverrides,
    _expectedInputs,
    _field,
    _fileUpload,
    _fixedPayment,
    _focalPoint,
    _formLayout,
    _formTemplate,
    _function,
    _functionParameter,
    _functionParameterArrayItems,
    _functionParameterItems,
    _functionReturnType,
    _functionsShopPriceSpiConfig,
    _galleryData,
    _galleryOptions,
    _group,
    _image,
    _imageData,
    _inlineElement,
    _inputField,
    _item,
    _itemImage,
    _itemLayout,
    _itemStyle,
    _layoutData,
    _layoutDataBackground,
    _mapData,
    _mapSettings,
    _media,
    _mediaItem,
    _messageContainingTranslatables,
    _modifiedComponent,
    _multilineAddress,
    _multilingualTranslationSchema,
    _node,
    _numberInput,
    _numberType,
    _objectField,
    _objectOptions,
    _objectType,
    _option,
    _orCondition,
    _packageDimension,
    _packageType,
    _password,
    _payment,
    _paymentInput,
    _phoneInput,
    _pluginConfig,
    _poll,
    _pollData,
    _pollDesign,
    _pollOption,
    _predefinedExpectedInput,
    _predefinedExpectedInputConfiguration,
    _presetEditorPresence,
    _presetElementDefaults,
    _presetInnerElementDefaults,
    _presetItem,
    _presetStyleOverrides,
    _productCheckboxGroup,
    _productCheckboxGroupOption,
    _propertiesType,
    _radioGroup,
    _ratingInput,
    _refElement,
    _refInnerElementDefaults,
    _richContent,
    _richContentOptions,
    _scheduling,
    _schema,
    _schemaGroup,
    _shapeData,
    _shippingLabelCarrierSpiConfig,
    _shippingProviderConfig,
    _signature,
    _step,
    _stop,
    _studioWidgetComponentData,
    _styleItem,
    _styles,
    _stylesBackground,
    _submitSettings,
    _tags,
    _tagsOption,
    _textInput,
    _thankYouMessageOptions,
    _timeInput,
    _tocData,
    _updateComponent,
    _upstreamWixCommonImage,
    _v1Gradient,
    _v1Metadata,
    _v1SchemaField,
    _v2Rule,
    _video,
    _videoData,
    _widgetComponentData,
    _widgetDisplay,
    _widgetOutOfIframeComponentData,
    _wixFile
  }), toReq = _a.toJSON, fromReq = _a.fromJSON;
  var fromRes = serializer(_updateComponentsOverrideResponse, {
    __Array,
    __Boolean,
    __Number,
    __Object,
    __String,
    _actionProviderSPIConfig,
    _actionSPIConfig,
    _address,
    _adminConfigurableTextInput,
    _andCondition,
    _apiArrayItems,
    _apiContext,
    _api_Number,
    _appEmbedData,
    _appointment,
    _arrayItems,
    _arrayOptions,
    _arrayType,
    _audioData,
    _authenticatorConfig,
    _backdrop,
    _background,
    _backgroundImage,
    _breakPoint,
    _breakpointPresetStyleOverrides,
    _buttonData,
    _cardData,
    _cardDataBackground,
    _cardDataBackgroundImage,
    _checkbox,
    _checkboxGroup,
    _collection,
    _commonImage,
    _componentData,
    _componentExperiment,
    _componentsOverride,
    _conditionNode,
    _contextArrayItems,
    _contextDataItems,
    _contextItem,
    _cssCustomPropertyItem,
    _cssNumber,
    _dataComponent,
    _dataComponentField,
    _dataItem,
    _dataItems,
    _dateInput,
    _datePicker,
    _dateTimeInput,
    _description,
    _design,
    _devCenterTestingComponentData,
    _displayField,
    _donationInput,
    _dropdown,
    _editorContextProvider,
    _editorElement,
    _editorFunction,
    _editorFunctionLibrary,
    _editorPresence,
    _editorReactComponent,
    _elementItem,
    _elementStyleOverrides,
    _expectedInputs,
    _field,
    _fileUpload,
    _fixedPayment,
    _focalPoint,
    _formLayout,
    _formTemplate,
    _function,
    _functionParameter,
    _functionParameterArrayItems,
    _functionParameterItems,
    _functionReturnType,
    _functionsShopPriceSpiConfig,
    _galleryData,
    _galleryOptions,
    _group,
    _image,
    _imageData,
    _inlineElement,
    _inputField,
    _item,
    _itemImage,
    _itemLayout,
    _itemStyle,
    _layoutData,
    _layoutDataBackground,
    _mapData,
    _mapSettings,
    _media,
    _mediaItem,
    _messageContainingTranslatables,
    _modifiedComponent,
    _multilineAddress,
    _multilingualTranslationSchema,
    _node,
    _numberInput,
    _numberType,
    _objectField,
    _objectOptions,
    _objectType,
    _option,
    _orCondition,
    _packageDimension,
    _packageType,
    _password,
    _payment,
    _paymentInput,
    _phoneInput,
    _pluginConfig,
    _poll,
    _pollData,
    _pollDesign,
    _pollOption,
    _predefinedExpectedInput,
    _predefinedExpectedInputConfiguration,
    _presetEditorPresence,
    _presetElementDefaults,
    _presetInnerElementDefaults,
    _presetItem,
    _presetStyleOverrides,
    _productCheckboxGroup,
    _productCheckboxGroupOption,
    _propertiesType,
    _radioGroup,
    _ratingInput,
    _refElement,
    _refInnerElementDefaults,
    _richContent,
    _richContentOptions,
    _scheduling,
    _schema,
    _schemaGroup,
    _shapeData,
    _shippingLabelCarrierSpiConfig,
    _shippingProviderConfig,
    _signature,
    _step,
    _stop,
    _studioWidgetComponentData,
    _styleItem,
    _styles,
    _stylesBackground,
    _submitSettings,
    _tags,
    _tagsOption,
    _textInput,
    _thankYouMessageOptions,
    _timeInput,
    _tocData,
    _updateComponent,
    _upstreamWixCommonImage,
    _v1Gradient,
    _v1Metadata,
    _v1SchemaField,
    _v2Rule,
    _video,
    _videoData,
    _widgetComponentData,
    _widgetDisplay,
    _widgetOutOfIframeComponentData,
    _wixFile
  }).fromJSON;
  function __updateComponentsOverrides(_a2) {
    var host = _a2.host;
    var serializedData = toReq(payload);
    var metadata = {
      entityFqdn: "wix.devcenter.components_overrides.v1.components_override",
      method: "PATCH",
      methodFqn: "wix.devcenter.components.overrides.v1.ComponentsOverridesService.UpdateComponentsOverrides",
      migrationOptions: {
        optInTransformResponse: true
      },
      url: resolveWixDevcenterComponentsOverridesV1ComponentsOverridesServiceUrl({
        protoPath: "/v1/components-override/{componentsOverride.id}",
        data: serializedData,
        host
      }),
      data: serializedData,
      transformResponse: fromRes
    };
    return metadata;
  }
  __updateComponentsOverrides.fromReq = fromReq;
  __updateComponentsOverrides.__isAmbassador = true;
  return __updateComponentsOverrides;
}
function commitOverride(payload) {
  var _a = serializer(_commitOverrideRequest, {}), toReq = _a.toJSON, fromReq = _a.fromJSON;
  var fromRes = serializer(_commitOverrideResponse, {}).fromJSON;
  function __commitOverride(_a2) {
    var host = _a2.host;
    var serializedData = toReq(payload);
    var metadata = {
      entityFqdn: "wix.devcenter.components_overrides.v1.components_override",
      method: "POST",
      methodFqn: "wix.devcenter.components.overrides.v1.ComponentsOverridesService.CommitOverride",
      migrationOptions: {
        optInTransformResponse: true
      },
      url: resolveWixDevcenterComponentsOverridesV1ComponentsOverridesServiceUrl({
        protoPath: "/v1/components-override/commit",
        data: serializedData,
        host
      }),
      data: serializedData,
      transformResponse: fromRes
    };
    return metadata;
  }
  __commitOverride.fromReq = fromReq;
  __commitOverride.__isAmbassador = true;
  return __commitOverride;
}

// ../dev-center-overrides-client/src/client.ts
var import_variant = __toESM(require_lib(), 1);

// ../dev-center-overrides-client/src/schemas.ts
init_esm_shims();
var nullToUndefined = external_exports.string().nullish().transform((v) => v ?? void 0);
var suggestNextVersionsResponseSchema = external_exports.object({
  nextMajor: external_exports.string().default(""),
  nextMinor: nullToUndefined
});
var promoteAppVersionFromDraftResponseSchema = external_exports.object({
  appVersion: external_exports.object({
    fullVersion: external_exports.string().nullish()
  })
});
var getComponentsOverrideResponseSchema = external_exports.object({
  componentsOverride: external_exports.object({
    appId: external_exports.string().optional(),
    externalId: external_exports.string().optional(),
    id: external_exports.string().optional()
  })
});
var getLatestProductionVersionResponseSchema = external_exports.object({
  appVersion: external_exports.object({
    version: external_exports.number()
  })
});
var releaseResponseSchema = external_exports.object({
  releaseBaseUrl: external_exports.string()
});

// ../dev-center-overrides-client/src/utils.ts
init_esm_shims();

// ../dev-center-overrides-client/src/isTrustedInternalErr.ts
init_esm_shims();
function isTrustedInternalErr(e) {
  if (isHttpError(e)) {
    const appError = e.response?.data?.details?.applicationError;
    if (appError?.description) {
      let errDescription;
      try {
        errDescription = JSON.parse(appError.description);
      } catch {
      }
      return errDescription?.results?.some(
        (result) => result.error?.startsWith("scriptAsset is not supported")
      );
    }
  }
  return false;
}

// ../dev-center-overrides-client/src/utils.ts
var { AppPermissionDenied } = CliErrorCode;
function toModifiedComponents(components) {
  return components.map((comp) => ({
    componentId: comp.compId,
    data: comp.compData,
    name: comp.compName,
    type: comp.compType,
    createdBy: comp.createdBy,
    createdByVersion: comp.createdByVersion
  }));
}
function handleReleaseError(e, appId, fallbackCode) {
  if (isHttpError(e)) {
    if (e.response?.status === 403) {
      throw new CliError({
        cause: e,
        code: AppPermissionDenied({ appId })
      });
    }
    if (e.response?.status === 400 && isHttpValidationError(e)) {
      throw new CliError({
        cause: e,
        code: CliErrorCode.AppReleaseConfigViolations()
      });
    }
  }
  if (isTrustedInternalErr(e)) {
    throw new CliError({
      cause: e,
      code: CliErrorCode.TrustedAppIsNotMarkedAsInternal()
    });
  }
  throw new CliError({ cause: e, code: fallbackCode });
}

// ../dev-center-overrides-client/src/client.ts
var UpdateAppReleaseData = (0, import_variant.variant)({
  TagNotFound: (0, import_variant.fields)(),
  TagUpdated: {}
});
var DevCenterOverridesClient = class {
  constructor(httpClient) {
    this.httpClient = httpClient;
    const { minRetryTimeout, retries } = getTestOverrides();
    this.retryOptions = {
      maxTimeout: 3 * 1e3,
      minTimeout: minRetryTimeout,
      retries: retries ?? 3
    };
  }
  retryOptions;
  getAppLatestVersion = async (appId) => {
    try {
      const { data } = await this.httpClient.request(
        getLatestProductionVersion({ appId })
      );
      return getLatestProductionVersionResponseSchema.parse(data).appVersion.version;
    } catch {
      return 0;
    }
  };
  createAppRelease = async (manifest, projectId) => {
    const overrideId = randomUUID();
    const appVersion = await this.getAppLatestVersion(manifest.appId);
    try {
      await pRetry(
        () => this.httpClient.request(
          createComponentsOverride({
            componentsOverride: {
              appId: manifest.appId,
              appVersion,
              externalId: projectId,
              id: overrideId,
              modifiedComponents: toModifiedComponents(manifest.components)
            }
          })
        ),
        this.retryOptions
      );
      return overrideId;
    } catch (e) {
      handleReleaseError(
        e,
        manifest.appId,
        CliErrorCode.FailedToCreateAppRelease()
      );
    }
  };
  createLooseAppRelease = async (manifest, projectId) => {
    return this.createAppRelease(manifest, projectId);
  };
  updateAppRelease = async (manifest, tag) => {
    try {
      const appVersion = await this.getAppLatestVersion(manifest.appId);
      const { data: overrideData } = await this.httpClient.request(
        getComponentsOverride({ componentsOverrideId: tag })
      );
      const { componentsOverride } = getComponentsOverrideResponseSchema.parse(overrideData);
      await pRetry(
        () => this.httpClient.request(
          updateComponentsOverrides({
            componentsOverride: {
              appId: manifest.appId,
              appVersion,
              externalId: componentsOverride.externalId,
              id: tag,
              modifiedComponents: toModifiedComponents(manifest.components)
            },
            fieldMask: ["modifiedComponents", "appVersion"]
          })
        ),
        this.retryOptions
      );
      return UpdateAppReleaseData.TagUpdated();
    } catch (e) {
      if (isHttpError(e) && e.response?.status === 404) {
        return UpdateAppReleaseData.TagNotFound({ cause: e });
      }
      handleReleaseError(
        e,
        manifest.appId,
        CliErrorCode.FailedToUpdateAppRelease()
      );
    }
  };
  updateLooseAppRelease = async (manifest, tag) => {
    return this.updateAppRelease(manifest, tag);
  };
  createDraftVersion = async (appId, tag) => {
    try {
      await this.httpClient.request(
        commitOverride({ componentsOverrideId: tag, onlyEmitEvent: false })
      );
      const { data } = await this.httpClient.request(
        suggestNextVersions({ appId })
      );
      const { nextMajor, nextMinor } = suggestNextVersionsResponseSchema.parse(data);
      return { nextMajor, nextMinor };
    } catch (cause) {
      throw new CliError({
        cause,
        code: CliErrorCode.FailedToCreateDraftVersion()
      });
    }
  };
  releaseDraftVersion = async (appId, options) => {
    try {
      const { data } = await this.httpClient.request(
        promoteAppVersionFromDraftToProduction({
          appId,
          createNewMajor: options.createNewMajor,
          notes: options.notes,
          promoteStrategy: PromoteStrategy.ENTIRE_APP,
          version: options.latestMajor
        })
      );
      const { appVersion } = promoteAppVersionFromDraftResponseSchema.parse(data);
      return { releasedVersion: appVersion.fullVersion ?? "" };
    } catch (cause) {
      throw new CliError({
        cause,
        code: CliErrorCode.FailedToReleaseDraftVersion()
      });
    }
  };
  release = async (appId, componentOverrideId, options) => {
    try {
      const { comment, createMinorVersion } = options;
      const { data } = await this.httpClient.request(
        release({
          appId,
          componentOverrideId,
          createMinorVersion,
          notes: comment
        })
      );
      return releaseResponseSchema.parse(data).releaseBaseUrl;
    } catch (e) {
      throw new CliError({
        cause: e,
        code: CliErrorCode.FailedToReleaseHeadlessProject()
      });
    }
  };
};

// ../dev-center-overrides-client/src/useDevCenterOverridesClient.ts
function useDevCenterOverridesClient() {
  const httpClient = useHttpClient({ type: "backoffice" });
  const client = (0, import_react.useMemo)(
    () => new DevCenterOverridesClient(httpClient),
    [httpClient]
  );
  return usePanoramaMethodLogger(client);
}

// ../dev-center-overrides-client/src/index.ts
init_esm_shims();

// ../cli-astro-commands/src/components/PlatformLink/LinkClickTip.tsx
init_esm_shims();
var import_react2 = __toESM(require_react(), 1);
import process from "node:process";
var LinkClickTip = () => /* @__PURE__ */ import_react2.default.createElement(Text, { skin: "secondary" }, `Tip: click a link to open it (some terminals require ${process.platform === "darwin" ? "\u2318" : "Ctrl"}+click).`);

// ../cli-astro-commands/src/components/PlatformLink/RedirectLink.tsx
init_esm_shims();
var import_react3 = __toESM(require_react(), 1);

// ../cli-app-installer/src/index.ts
init_esm_shims();

// ../cli-app-installer/src/app-marker-url.ts
init_esm_shims();
function getAppMarketUrl({
  appId,
  versionOverrideId,
  postInstallationUrl
}) {
  const installerUrl = new URL("https://www.wix.com/app-installer");
  installerUrl.searchParams.set("appId", appId);
  installerUrl.searchParams.set("versionOverrideId", versionOverrideId);
  installerUrl.searchParams.set("postInstallationUrl", postInstallationUrl);
  return installerUrl.toString();
}

// ../cli-app-installer/src/preview-url.ts
init_esm_shims();

// ../cli-app-installer/src/redirect-service-url.ts
init_esm_shims();
function getRedirectServiceUrl({
  platform,
  siteId,
  appId,
  versionOverrideId
}) {
  const redirectUrl = new URL(
    "https://dev.wix.com/wix-cli-redirect-service/redirect"
  );
  redirectUrl.searchParams.set("platform", platform);
  redirectUrl.searchParams.set("versionOverrideId", versionOverrideId);
  if (siteId) {
    redirectUrl.searchParams.set("tenantId", siteId);
  }
  if (appId) {
    redirectUrl.searchParams.set("appId", appId);
  }
  return redirectUrl.toString();
}

// ../cli-app-installer/src/preview-url.ts
function getAppPreviewUrl({
  appId,
  versionOverrideId,
  platform
}) {
  const redirectUrl = getRedirectServiceUrl({
    platform,
    versionOverrideId
  });
  return getAppMarketUrl({
    appId,
    versionOverrideId,
    postInstallationUrl: redirectUrl
  });
}

// ../cli-app-installer/src/site-url.ts
init_esm_shims();
function getSiteRedirectUrl(options) {
  return getRedirectServiceUrl(options);
}

// ../cli-astro-commands/src/components/PlatformLink/RedirectLink.tsx
var createRedirectLink = ({ siteId, ...options }) => {
  if (siteId != null) {
    return getSiteRedirectUrl({ ...options, siteId });
  }
  return getAppPreviewUrl(options);
};
var RedirectLink = ({
  platform,
  versionOverrideId,
  siteId
}) => {
  const { model } = useProjectModel();
  const url = createRedirectLink({
    platform,
    appId: model.config.appId,
    versionOverrideId,
    siteId
  });
  return /* @__PURE__ */ import_react3.default.createElement(PlatformLink, { platform, url });
};

// ../cli-astro-commands/src/hooks/useUpdateDeploymentTopology.ts
init_esm_shims();
var import_react4 = __toESM(require_react(), 1);

// ../cli-astro-commands/src/files/topology.ts
init_esm_shims();
async function readDeploymentTopology(projectFolder) {
  const path = getDeploymentTopologyPath(projectFolder);
  if (await pathExists(path)) {
    try {
      const deployment = await readJson(path);
      return deploymentTopologySchema.parse(deployment);
    } catch {
    }
  }
  return {};
}
async function writeDeploymentTopologyEnvironment(projectFolder, environment, entry) {
  const topology = await readDeploymentTopology(projectFolder);
  topology[environment] = entry;
  const path = getDeploymentTopologyPath(projectFolder);
  await writeJson(path, topology, { spaces: 2 });
}

// ../cli-astro-commands/src/hooks/useUpdateDeploymentTopology.ts
function useUpdateDeploymentTopologyForSite(siteId) {
  const {
    model: { projectFolder }
  } = useProjectModel();
  return (0, import_react4.useCallback)(
    async ({
      environment,
      siteUrl,
      armTag
    }) => {
      await writeDeploymentTopologyEnvironment(projectFolder, environment, {
        id: armTag,
        site: { main: siteUrl },
        dashboard: {
          main: `https://manage.wix.com/dashboard/${siteId}?apps-override=${armTag}`
        }
      });
    },
    [projectFolder, siteId]
  );
}
function useUpdateDeploymentTopologyForApp(siteId) {
  const {
    model: { projectFolder, config }
  } = useProjectModel();
  return (0, import_react4.useCallback)(
    async ({ environment, armTag }) => {
      const makeUrl = (platform) => createRedirectLink({
        platform,
        appId: config.appId,
        versionOverrideId: armTag,
        siteId
      });
      await writeDeploymentTopologyEnvironment(projectFolder, environment, {
        id: armTag,
        site: { main: makeUrl("site") },
        editor: { main: makeUrl("editor") },
        dashboard: { main: makeUrl("dashboard") }
      });
    },
    [projectFolder, config.appId, siteId]
  );
}

export {
  useDevCenterOverridesClient,
  LinkClickTip,
  RedirectLink,
  useUpdateDeploymentTopologyForSite,
  useUpdateDeploymentTopologyForApp
};
//# sourceMappingURL=chunk-ZY6UYJ7A.js.map