{"version":3,"sources":["../../src/atlas-v2-place-places.universal.ts","../../src/atlas-v2-place-places.http.ts","../../src/atlas-v2-place-places.public.ts","../../src/atlas-v2-place-places.context.ts"],"sourcesContent":["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 ambassadorWixAtlasV2Place from './atlas-v2-place-places.http.js';\nimport { transformRESTAddressToSDKAddress } from '@wix/sdk-runtime/transformations/address';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\n\nexport interface Place {\n  /** The given place id */\n  placeId?: string;\n  /** The Address object */\n  address?: Address;\n  /** The Place type. For example: airport, library etc... */\n  types?: string[];\n}\n\n/** Physical address */\nexport interface Address extends AddressStreetOneOf {\n  /** Street name and number. */\n  streetAddress?: StreetAddress;\n  /** Main address line, usually street and number as free text. */\n  addressLine1?: string | null;\n  /**\n   * Country code.\n   * @format COUNTRY\n   */\n  country?: string | null;\n  /** Subdivision. Usually a state, region, prefecture, or province code, according to [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2). */\n  subdivision?: string | null;\n  /** City name. */\n  city?: string | null;\n  /** Zip/postal code. */\n  postalCode?: string | null;\n  /** Free text providing more detailed address info. Usually contains Apt, Suite, and Floor. */\n  addressLine2?: string | null;\n}\n\n/** @oneof */\nexport interface AddressStreetOneOf {\n  /** Street name and number. */\n  streetAddress?: StreetAddress;\n  /** Main address line, usually street and number as free text. */\n  addressLine?: string | null;\n}\n\nexport interface StreetAddress {\n  /** Street number. */\n  number?: string;\n  /** Street name. */\n  name?: string;\n}\n\nexport interface AddressLocation {\n  /** Address latitude. */\n  latitude?: number | null;\n  /** Address longitude. */\n  longitude?: number | null;\n}\n\nexport interface Subdivision {\n  /** Short subdivision code. */\n  code?: string;\n  /** Subdivision full name. */\n  name?: string;\n}\n\nexport enum SubdivisionType {\n  UNKNOWN_SUBDIVISION_TYPE = 'UNKNOWN_SUBDIVISION_TYPE',\n  /** State */\n  ADMINISTRATIVE_AREA_LEVEL_1 = 'ADMINISTRATIVE_AREA_LEVEL_1',\n  /** County */\n  ADMINISTRATIVE_AREA_LEVEL_2 = 'ADMINISTRATIVE_AREA_LEVEL_2',\n  /** City/town */\n  ADMINISTRATIVE_AREA_LEVEL_3 = 'ADMINISTRATIVE_AREA_LEVEL_3',\n  /** Neighborhood/quarter */\n  ADMINISTRATIVE_AREA_LEVEL_4 = 'ADMINISTRATIVE_AREA_LEVEL_4',\n  /** Street/block */\n  ADMINISTRATIVE_AREA_LEVEL_5 = 'ADMINISTRATIVE_AREA_LEVEL_5',\n  /** ADMINISTRATIVE_AREA_LEVEL_0. Indicates the national political entity, and is typically the highest order type returned by the Geocoder. */\n  COUNTRY = 'COUNTRY',\n}\n\n/** @enumType */\nexport type SubdivisionTypeWithLiterals =\n  | SubdivisionType\n  | 'UNKNOWN_SUBDIVISION_TYPE'\n  | 'ADMINISTRATIVE_AREA_LEVEL_1'\n  | 'ADMINISTRATIVE_AREA_LEVEL_2'\n  | 'ADMINISTRATIVE_AREA_LEVEL_3'\n  | 'ADMINISTRATIVE_AREA_LEVEL_4'\n  | 'ADMINISTRATIVE_AREA_LEVEL_5'\n  | 'COUNTRY';\n\nexport interface GetPlaceRequest {\n  searchId: string;\n  /**\n   * A random string which identifies an autocomplete session for billing purposes. The session begins when the user starts typing a query, and concludes when they select a place and a call to Get Place is made. Once a session has concluded, the token is no longer valid. your app must generate a fresh token for each session.\n   * @format GUID\n   */\n  sessionToken?: string | null;\n}\n\nexport interface GetPlaceResponse {\n  place?: Place;\n}\n\n/**\n * Once you have a search_id from a autocomplete Search, you can request more details about a particular establishment or point of interest by initiating a get place request.\n * @public\n * @documentationMaturity preview\n * @requiredField searchId\n * @permissionId WIX_ATLAS.GET_PLACE\n * @applicableIdentity APP\n * @fqn com.wixpress.vi.atlas.service.v2.PlacesServiceV2.GetPlace\n */\nexport async function getPlace(\n  searchId: string,\n  options?: GetPlaceOptions\n): Promise<\n  NonNullablePaths<\n    GetPlaceResponse,\n    | `place.placeId`\n    | `place.address.streetAddress.number`\n    | `place.address.streetAddress.name`\n    | `place.types`,\n    5\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    searchId: searchId,\n    sessionToken: options?.sessionToken,\n  });\n\n  const reqOpts = ambassadorWixAtlasV2Place.getPlace(payload);\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(\n      transformPaths(result.data, [\n        {\n          transformFn: transformRESTAddressToSDKAddress,\n          paths: [{ path: 'place.address' }],\n        },\n      ])\n    )!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: {\n          searchId: '$[0]',\n          sessionToken: '$[1].sessionToken',\n        },\n        singleArgumentUnchanged: false,\n      },\n      ['searchId', 'options']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\nexport interface GetPlaceOptions {\n  /**\n   * A random string which identifies an autocomplete session for billing purposes. The session begins when the user starts typing a query, and concludes when they select a place and a call to Get Place is made. Once a session has concluded, the token is no longer valid. your app must generate a fresh token for each session.\n   * @format GUID\n   */\n  sessionToken?: string | null;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformRESTFloatToSDKFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixpressViAtlasServiceV2PlacesServiceV2Url(\n  opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n  const domainToMappings = {\n    'api._api_base_domain_': [\n      {\n        srcPath: '/wix-atlas-service-web',\n        destPath: '',\n      },\n    ],\n    'bo._base_domain_': [\n      {\n        srcPath: '/wix-atlas-service-web',\n        destPath: '',\n      },\n    ],\n    'wixbo.ai': [\n      {\n        srcPath: '/wix-atlas-service-web',\n        destPath: '',\n      },\n    ],\n    'wix-bo.com': [\n      {\n        srcPath: '/wix-atlas-service-web',\n        destPath: '',\n      },\n    ],\n    _: [\n      {\n        srcPath: '/api/wix-atlas-service-web',\n        destPath: '',\n      },\n      {\n        srcPath: '/_api/wix-atlas-service-web',\n        destPath: '',\n      },\n    ],\n    'www._base_domain_': [\n      {\n        srcPath: '/wix-atlas-service-web',\n        destPath: '',\n      },\n      {\n        srcPath: '/_api/wix-atlas-service-web',\n        destPath: '',\n      },\n      {\n        srcPath: '/api/wix-atlas-service-web',\n        destPath: '',\n      },\n    ],\n    'manage._base_domain_': [\n      {\n        srcPath: '/wix-atlas-service-web',\n        destPath: '',\n      },\n    ],\n    'editor._base_domain_': [\n      {\n        srcPath: '/wix-atlas-service-web',\n        destPath: '',\n      },\n      {\n        srcPath: '/api/wix-atlas-service-web',\n        destPath: '',\n      },\n    ],\n    'blocks._base_domain_': [\n      {\n        srcPath: '/wix-atlas-service-web',\n        destPath: '',\n      },\n      {\n        srcPath: '/api/wix-atlas-service-web',\n        destPath: '',\n      },\n    ],\n    'create.editorx': [\n      {\n        srcPath: '/wix-atlas-service-web',\n        destPath: '',\n      },\n      {\n        srcPath: '/api/wix-atlas-service-web',\n        destPath: '',\n      },\n    ],\n    'editor.wixapps.net': [\n      {\n        srcPath: '/api/wix-atlas-service-web',\n        destPath: '',\n      },\n    ],\n    '*.wixforms.com': [\n      {\n        srcPath: '/_api/wix-atlas-service-web',\n        destPath: '',\n      },\n    ],\n    'platform.rise.ai': [\n      {\n        srcPath: '/_api/wix-atlas-service-web',\n        destPath: '',\n      },\n      {\n        srcPath: '/wix-atlas-service-web',\n        destPath: '',\n      },\n    ],\n    'www.wixapis.com': [\n      {\n        srcPath: '/api/wix-atlas-service-web',\n        destPath: '',\n      },\n    ],\n  };\n\n  return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_atlas_places';\n\n/** Once you have a search_id from a autocomplete Search, you can request more details about a particular establishment or point of interest by initiating a get place request. */\nexport function getPlace(payload: object): RequestOptionsFactory<any> {\n  function __getPlace({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.atlas.v2.place',\n      method: 'GET' as any,\n      methodFqn: 'com.wixpress.vi.atlas.service.v2.PlacesServiceV2.GetPlace',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveComWixpressViAtlasServiceV2PlacesServiceV2Url({\n        protoPath: '/v2/place',\n        data: payload,\n        host,\n      }),\n      params: toURLSearchParams(payload),\n      transformResponse: (payload: any) =>\n        transformPaths(payload, [\n          {\n            transformFn: transformRESTFloatToSDKFloat,\n            paths: [\n              { path: 'place.address.geocode.latitude' },\n              { path: 'place.address.geocode.longitude' },\n            ],\n          },\n        ]),\n    };\n\n    return metadata;\n  }\n\n  return __getPlace;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n  GetPlaceOptions,\n  GetPlaceResponse,\n  getPlace as universalGetPlace,\n} from './atlas-v2-place-places.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/atlas' };\n\nexport function getPlace(httpClient: HttpClient): GetPlaceSignature {\n  return (searchId: string, options?: GetPlaceOptions) =>\n    universalGetPlace(\n      searchId,\n      options,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface GetPlaceSignature {\n  /**\n   * Once you have a search_id from a autocomplete Search, you can request more details about a particular establishment or point of interest by initiating a get place request.\n   */\n  (searchId: string, options?: GetPlaceOptions): Promise<\n    NonNullablePaths<\n      GetPlaceResponse,\n      | `place.placeId`\n      | `place.address.streetAddress.number`\n      | `place.address.streetAddress.name`\n      | `place.types`,\n      5\n    >\n  >;\n}\n\nexport {\n  Address,\n  AddressLocation,\n  AddressStreetOneOf,\n  GetPlaceOptions,\n  GetPlaceRequest,\n  GetPlaceResponse,\n  Place,\n  StreetAddress,\n  Subdivision,\n  SubdivisionType,\n} from './atlas-v2-place-places.universal.js';\n","import { getPlace as publicGetPlace } from './atlas-v2-place-places.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const getPlace: MaybeContext<\n  BuildRESTFunction<typeof publicGetPlace> & typeof publicGetPlace\n> = /*#__PURE__*/ createRESTModule(publicGetPlace);\n\nexport { SubdivisionType } from './atlas-v2-place-places.universal.js';\nexport {\n  Place,\n  Address,\n  AddressStreetOneOf,\n  StreetAddress,\n  AddressLocation,\n  Subdivision,\n  GetPlaceRequest,\n  GetPlaceResponse,\n  GetPlaceOptions,\n} from './atlas-v2-place-places.universal.js';\nexport { SubdivisionTypeWithLiterals } from './atlas-v2-place-places.universal.js';\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,yBAAyB;AAClC,SAAS,oCAAoC;AAC7C,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,qDACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,oBAAoB;AAAA,MAClB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,YAAY;AAAA,MACV;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,cAAc;AA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