@heycar/heycars-map 0.9.0 → 0.9.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -9,7 +9,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
9
9
  const Vue = require("vue");
10
10
  const style = "";
11
11
  const name = "@heycar/heycars-map";
12
- const version = "0.9.0";
12
+ const version = "0.9.3";
13
13
  const type = "module";
14
14
  const scripts = {
15
15
  dev: "vite -c vite.config.dev.ts",
@@ -1100,19 +1100,81 @@ const isPlace = (place) => {
1100
1100
  return place.lng !== void 0 && place.lat !== void 0;
1101
1101
  };
1102
1102
  const sleep = (milliSeconds) => new Promise((resolve) => setTimeout(resolve, milliSeconds));
1103
- const assertPoint = (point) => {
1103
+ function assertPoint(point) {
1104
1104
  if (Array.isArray(point) && point.length === 2 && typeof point[0] === "number" && typeof point[1] === "number")
1105
1105
  return;
1106
1106
  throw new Error(`Assertion Error: expect type [number, number], actual is ${point}`);
1107
- };
1108
- const assertAngle = (angle) => {
1107
+ }
1108
+ function assertAngle(angle) {
1109
1109
  if (typeof angle === "number" || typeof angle === "undefined")
1110
1110
  return;
1111
1111
  throw new Error(`Assertion Error: expect type number | undefined, actual is ${angle}`);
1112
- };
1112
+ }
1113
+ function assertZone(zone) {
1114
+ try {
1115
+ if (Array.isArray(zone == null ? void 0 : zone.path) && zone.path.every(assertPoint))
1116
+ return;
1117
+ } catch (err) {
1118
+ throw new Error(`Assertion Error: expect type Zone, actual is ${JSON.stringify(zone)}`);
1119
+ }
1120
+ }
1113
1121
  const isLatLngLiteral = (value) => {
1114
1122
  return value != null && typeof value === "object" && Number.isFinite(value.lat) && Number.isFinite(value.lng);
1115
1123
  };
1124
+ function defered() {
1125
+ const defer = {};
1126
+ const promise = new Promise((resolve, reject) => {
1127
+ defer.state = "pending";
1128
+ defer.resolve = async (value) => {
1129
+ try {
1130
+ const result = await value;
1131
+ defer.state = "fulfilled";
1132
+ return resolve(result);
1133
+ } catch (err) {
1134
+ defer.state = "rejected";
1135
+ reject(err);
1136
+ }
1137
+ };
1138
+ defer.reject = (reason) => {
1139
+ defer.state = "rejected";
1140
+ return reject(reason);
1141
+ };
1142
+ });
1143
+ return Object.assign(promise, defer);
1144
+ }
1145
+ const pausableSleep = (milliSeconds) => {
1146
+ const sleepDefered = defered();
1147
+ let id = setTimeout(sleepDefered.resolve, milliSeconds);
1148
+ let isPaused = false;
1149
+ const pause = () => {
1150
+ if (isPaused || sleepDefered.state === "fulfilled")
1151
+ return;
1152
+ console.log("pause");
1153
+ isPaused = true;
1154
+ clearTimeout(id);
1155
+ };
1156
+ const restart = () => {
1157
+ if (sleepDefered.state === "fulfilled")
1158
+ return;
1159
+ console.log("restart");
1160
+ isPaused = false;
1161
+ clearTimeout(id);
1162
+ id = setTimeout(sleepDefered.resolve, milliSeconds);
1163
+ };
1164
+ return { sleepPromise: sleepDefered, pause, restart };
1165
+ };
1166
+ const MAX_ANIMATION_DISTANCE_VW = 100;
1167
+ const MIN_ANIMATION_DURATION = 400;
1168
+ const ANIMATION_DURATION_FOR_100VW = 800;
1169
+ const ANIMATION_DURATION_PER_ZOOM = 400;
1170
+ const BEIJIN_POINT = [116.2317, 39.5427];
1171
+ const ZINDEX_BUBBLE_LAYER = 50;
1172
+ const ZINDEX_START_END_LOGO_LAYER = 40;
1173
+ const ZINDEX_PLACE_LAYER = 30;
1174
+ const ZINDEX_CAR_LAYER = 21;
1175
+ const ZINDEX_PASSENGER_LAYER = 20;
1176
+ const ZINDEX_LINE_LAYER = 12;
1177
+ const ZINDEX_GREEN_ZONE = 10;
1116
1178
  const vec2lnglat = ([lng, lat]) => ({
1117
1179
  lng: Number(lng),
1118
1180
  lat: Number(lat)
@@ -1184,6 +1246,9 @@ const isGeoPositionEqual = (p1, p2) => {
1184
1246
  return false;
1185
1247
  return p1.coords.longitude === p2.coords.longitude && p1.coords.latitude === p2.coords.latitude;
1186
1248
  };
1249
+ const isZoneEqual = (z1, z2) => {
1250
+ return z1.path.every((point, idx) => isPointEqual(point, z2 == null ? void 0 : z2.path[idx]));
1251
+ };
1187
1252
  const amapPlaceName2DisplayName = (name2, options) => {
1188
1253
  const { isChina, province, city, district, township } = options;
1189
1254
  if (!name2)
@@ -1198,6 +1263,12 @@ const amapPlaceName2DisplayName = (name2, options) => {
1198
1263
  }
1199
1264
  return result;
1200
1265
  };
1266
+ const distanceVw2animationDuration = (distance) => {
1267
+ return Math.max(MIN_ANIMATION_DURATION, ANIMATION_DURATION_FOR_100VW * distance / 100);
1268
+ };
1269
+ const deltaZoom2animationDuration = (deltaZoom) => {
1270
+ return Math.max(MIN_ANIMATION_DURATION * 4, Math.abs(deltaZoom) * ANIMATION_DURATION_PER_ZOOM);
1271
+ };
1201
1272
  const toPlaceType = (maybePlace) => {
1202
1273
  var _a;
1203
1274
  const lng = Number(maybePlace.lng);
@@ -2203,15 +2274,6 @@ function detectWebGL() {
2203
2274
  }
2204
2275
  return "NOT_SUPPORTED";
2205
2276
  }
2206
- const MAX_ANIMATION_DISTANCE_VW = 100;
2207
- const BEIJIN_POINT = [116.2317, 39.5427];
2208
- const ZINDEX_BUBBLE_LAYER = 50;
2209
- const ZINDEX_START_END_LOGO_LAYER = 40;
2210
- const ZINDEX_PLACE_LAYER = 30;
2211
- const ZINDEX_CAR_LAYER = 21;
2212
- const ZINDEX_PASSENGER_LAYER = 20;
2213
- const ZINDEX_LINE_LAYER = 12;
2214
- const ZINDEX_GREEN_ZONE = 10;
2215
2277
  const useAmapLngLatToVw = (props) => {
2216
2278
  const apiMapLngLatToVw = (point) => {
2217
2279
  const amap2 = props.mapRef.value;
@@ -2347,8 +2409,13 @@ const Amap = defineSetup(function Amap2(props, { slots, emit }) {
2347
2409
  const map = mapRef.value;
2348
2410
  if (!center || !map)
2349
2411
  return;
2350
- const immediately = prevCenter ? apiMapDistanceVwOfPoints(center, prevCenter) > MAX_ANIMATION_DISTANCE_VW : true;
2351
- map.setCenter(center, immediately);
2412
+ if (!prevCenter)
2413
+ return map.setCenter(center, true);
2414
+ const distanceVw = apiMapDistanceVwOfPoints(center, prevCenter);
2415
+ if (distanceVw > MAX_ANIMATION_DISTANCE_VW)
2416
+ return map.setCenter(center, true);
2417
+ const duration = distanceVw2animationDuration(distanceVw);
2418
+ map.setCenter(center, false, duration);
2352
2419
  }
2353
2420
  );
2354
2421
  Vue.watch(
@@ -3147,6 +3214,36 @@ const useMapFitView = (props) => {
3147
3214
  const { supplier } = useMapSupplier();
3148
3215
  return supplier === "gmap" ? useGmapFitView(props) : useAmapFitView(props);
3149
3216
  };
3217
+ const useAmapTouchEvent = () => {
3218
+ const mapRef = useAmap();
3219
+ const addMapEventListener = (name2, handler) => {
3220
+ var _a;
3221
+ return (_a = mapRef == null ? void 0 : mapRef.value) == null ? void 0 : _a.on(name2, handler);
3222
+ };
3223
+ const removeMapEventListener = (name2, handler) => {
3224
+ var _a;
3225
+ return (_a = mapRef == null ? void 0 : mapRef.value) == null ? void 0 : _a.off(name2, handler);
3226
+ };
3227
+ return { addMapEventListener, removeMapEventListener };
3228
+ };
3229
+ const useGmapTouchEvent = () => {
3230
+ const mapRef = useGmap();
3231
+ const addMapEventListener = (name2, handler) => {
3232
+ var _a;
3233
+ const container = (_a = mapRef == null ? void 0 : mapRef.value) == null ? void 0 : _a.getDiv();
3234
+ return container == null ? void 0 : container.addEventListener(name2, handler);
3235
+ };
3236
+ const removeMapEventListener = (name2, handler) => {
3237
+ var _a;
3238
+ const container = (_a = mapRef == null ? void 0 : mapRef.value) == null ? void 0 : _a.getDiv();
3239
+ return container == null ? void 0 : container.removeEventListener(name2, handler);
3240
+ };
3241
+ return { addMapEventListener, removeMapEventListener };
3242
+ };
3243
+ const useMapTouchEvent = () => {
3244
+ const { supplier } = useMapSupplier();
3245
+ return supplier === "gmap" ? useGmapTouchEvent() : useAmapTouchEvent();
3246
+ };
3150
3247
  defineSetup(function FitView(props, {
3151
3248
  slots
3152
3249
  }) {
@@ -3199,7 +3296,7 @@ function createFittableRegisterOverlay(registerOverlay) {
3199
3296
  setFitView
3200
3297
  };
3201
3298
  }
3202
- const KeyedFitView = defineSetup(function KeyedFitView2(props, {
3299
+ defineSetup(function KeyedFitView(props, {
3203
3300
  slots
3204
3301
  }) {
3205
3302
  const mapMountedPromise = useMapMountedPromise();
@@ -3220,7 +3317,51 @@ const KeyedFitView = defineSetup(function KeyedFitView2(props, {
3220
3317
  return Vue.h("div", [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
3221
3318
  };
3222
3319
  });
3320
+ const InterruptableIntervalFitView = defineSetup(function InterruptableIntervalFitView2(props) {
3321
+ const {
3322
+ registerOverlay
3323
+ } = props;
3324
+ const mapMountedPromise = useMapMountedPromise();
3325
+ const {
3326
+ addMapEventListener,
3327
+ removeMapEventListener
3328
+ } = useMapTouchEvent();
3329
+ Vue.watch(() => 0, async (_1, _2, onCleanup) => {
3330
+ await mapMountedPromise;
3331
+ let skip = false;
3332
+ let pause;
3333
+ let restart;
3334
+ let sleepPromise;
3335
+ const handleTouchStartOrMove = () => pause();
3336
+ const handleTouchEnd = () => restart();
3337
+ addMapEventListener("touchstart", handleTouchStartOrMove);
3338
+ addMapEventListener("touchmove", handleTouchStartOrMove);
3339
+ addMapEventListener("touchend", handleTouchEnd);
3340
+ onCleanup(() => {
3341
+ skip = true;
3342
+ removeEventListener("touchstart", handleTouchStartOrMove);
3343
+ removeMapEventListener("touchmove", handleTouchStartOrMove);
3344
+ removeMapEventListener("touchend", handleTouchEnd);
3345
+ });
3346
+ while (!skip) {
3347
+ ({
3348
+ pause,
3349
+ restart,
3350
+ sleepPromise
3351
+ } = pausableSleep(props.interval));
3352
+ await sleepPromise;
3353
+ console.log("InterruptableIntervalFitView setFitView");
3354
+ registerOverlay.setFitView();
3355
+ }
3356
+ }, {
3357
+ immediate: true,
3358
+ flush: "post"
3359
+ });
3360
+ return () => null;
3361
+ });
3362
+ const imgEndPointEn = "data:image/svg+xml;base64,PHN2ZyB3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I+PHRzcGFuIHg9IjUiIHk9IjE1LjYyNCI+6LW3PC90c3Bhbj48L3RleHQ+PC9nPjwvc3ZnPg==";
3225
3366
  const StartEndPoint_css_ts_vanilla = "";
3226
3367
  var arrowRight = createRuntimeFn({ defaultClassName: "_4a4ovka", variantClassNames: { withArrow: { true: "_4a4ovkb", false: "_4a4ovkc" } }, defaultVariants: {}, compoundVariants: [] });
@@ -3240,9 +3381,10 @@ const AStartEndPoint = defineSetup(function AStartEndPoint2(props, {
3240
3381
  withArrow = false,
3241
3382
  title,
3242
3383
  description,
3243
- type: type2
3384
+ type: type2,
3385
+ language
3244
3386
  } = props;
3245
- const icon = type2 === "start" ? imgStartPoint : imgEndPoint;
3387
+ const icon = type2 === "start" ? language === "zh" ? imgStartPoint : imgStartPointEn : language === "zh" ? imgEndPoint : imgEndPointEn;
3246
3388
  const descriptionRow = !description ? "" : decodeAsterisk(description).map((item) => item.type === "normal" ? item.value : `<span class="${pointInfoBoxEmphasize$1}">${item.value}</span>`).join("");
3247
3389
  if (!description && !title)
3248
3390
  return `<img class="AStartEndPoint ${pointIcon({
@@ -3307,9 +3449,10 @@ const GStartEndPoint = defineSetup(function GStartEndPoint2(props, {
3307
3449
  withArrow = false,
3308
3450
  title,
3309
3451
  description,
3310
- type: type2
3452
+ type: type2,
3453
+ language = "zh"
3311
3454
  } = props;
3312
- const icon = type2 === "start" ? imgStartPoint : imgEndPoint;
3455
+ const icon = type2 === "start" ? language === "zh" ? imgStartPoint : imgStartPointEn : language === "zh" ? imgEndPoint : imgEndPointEn;
3313
3456
  const descriptionRow = !description ? "" : decodeAsterisk(description).map((item) => item.type === "normal" ? item.value : `<span class="${pointInfoBoxEmphasize$1}">${item.value}</span>`).join("");
3314
3457
  if (!description && !title)
3315
3458
  return createDom("img", {
@@ -3391,6 +3534,9 @@ const BusinessQuotingMap = defineLagecySetup(function BusinessQuotingMap2(props,
3391
3534
  mapRef,
3392
3535
  renderDescription
3393
3536
  } = props;
3537
+ const {
3538
+ language
3539
+ } = useMapSupplier();
3394
3540
  const fittableRegistryOverlay = createFittableRegisterOverlay(registerOverlay);
3395
3541
  const deferedSetFitView = pipeDefer(registerOverlay.setFitView);
3396
3542
  return () => {
@@ -3419,7 +3565,8 @@ const BusinessQuotingMap = defineLagecySetup(function BusinessQuotingMap2(props,
3419
3565
  "position": from,
3420
3566
  "title": fromPlace.displayName,
3421
3567
  "description": fromDescription,
3422
- "withArrow": true
3568
+ "withArrow": true,
3569
+ "language": language
3423
3570
  },
3424
3571
  "on": {
3425
3572
  "click": () => emit("clickStartPoint", fromPlace)
@@ -3446,7 +3593,8 @@ const BusinessQuotingMap = defineLagecySetup(function BusinessQuotingMap2(props,
3446
3593
  distance,
3447
3594
  duration
3448
3595
  }),
3449
- "withArrow": true
3596
+ "withArrow": true,
3597
+ "language": language
3450
3598
  },
3451
3599
  "on": {
3452
3600
  "click": () => emit("clickEndPoint", toPlace)
@@ -3875,8 +4023,6 @@ const useGeoLocation = (props) => {
3875
4023
  geoReady: readyRef
3876
4024
  };
3877
4025
  };
3878
- const MAX_AMAP_PAN_TO_ANIMATE_DURATION = 500;
3879
- const MIN_AMAP_PAN_TO_ANIMATE_DURATION = 100;
3880
4026
  const useHeycarAmap = () => {
3881
4027
  const amapRef = Vue.shallowRef();
3882
4028
  const amapElementRef = Vue.shallowRef();
@@ -3893,10 +4039,7 @@ const useHeycarAmap = () => {
3893
4039
  const distanceVw = apiMapDistanceVwOfPoints(value, [lng, lat]);
3894
4040
  const shouldAnimate = distanceVw < MAX_ANIMATION_DISTANCE_VW;
3895
4041
  if (shouldAnimate) {
3896
- const duration = Math.max(
3897
- MIN_AMAP_PAN_TO_ANIMATE_DURATION,
3898
- Math.floor(MAX_AMAP_PAN_TO_ANIMATE_DURATION * distanceVw / MAX_ANIMATION_DISTANCE_VW)
3899
- );
4042
+ const duration = distanceVw2animationDuration(distanceVw);
3900
4043
  amap2.panTo(value, duration);
3901
4044
  await sleep(duration);
3902
4045
  } else {
@@ -4022,6 +4165,49 @@ const useMapDrag = (props) => {
4022
4165
  const { supplier } = useMapSupplier();
4023
4166
  return supplier === "gmap" ? useGmapDrag(props) : useAmapDrag(props);
4024
4167
  };
4168
+ const useAmapGeometry = () => {
4169
+ const payload = useMapSupplier();
4170
+ const apiMapDistance = (from, to) => {
4171
+ if (payload.status !== Status.SUCCESS)
4172
+ return void 0;
4173
+ return AMap.GeometryUtil.distance(from, to);
4174
+ };
4175
+ const apiMapDistanceToLine = (from, line) => {
4176
+ if (payload.status !== Status.SUCCESS)
4177
+ return void 0;
4178
+ return AMap.GeometryUtil.distanceToLine(from, line);
4179
+ };
4180
+ const apiMapIsPointInRing = (point, path) => {
4181
+ if (payload.status !== Status.SUCCESS)
4182
+ return void 0;
4183
+ return AMap.GeometryUtil.isPointInRing(point, path);
4184
+ };
4185
+ return { apiMapDistance, apiMapDistanceToLine, apiMapIsPointInRing };
4186
+ };
4187
+ const useGmapGeometry = () => {
4188
+ const payload = useMapSupplier();
4189
+ const apiMapDistance = (from, to) => {
4190
+ if (payload.status !== Status.SUCCESS)
4191
+ return void 0;
4192
+ return google.maps.geometry.spherical.computeDistanceBetween(vec2lnglat(from), vec2lnglat(to));
4193
+ };
4194
+ const apiMapDistanceToLine = (from, line) => {
4195
+ if (payload.status !== Status.SUCCESS)
4196
+ return void 0;
4197
+ return 0;
4198
+ };
4199
+ const apiMapIsPointInRing = (point, path) => {
4200
+ if (payload.status !== Status.SUCCESS)
4201
+ return void 0;
4202
+ const polygon = new google.maps.Polygon({ paths: path.map(vec2lnglat) });
4203
+ return google.maps.geometry.poly.containsLocation(vec2lnglat(point), polygon);
4204
+ };
4205
+ return { apiMapDistance, apiMapDistanceToLine, apiMapIsPointInRing };
4206
+ };
4207
+ const useMapGeometry = () => {
4208
+ const { supplier } = useMapSupplier();
4209
+ return supplier === "gmap" ? useGmapGeometry() : useAmapGeometry();
4210
+ };
4025
4211
  const chinaBounds = [
4026
4212
  [
4027
4213
  108.03446,
@@ -5541,12 +5727,9 @@ const useAmapPlace = (props) => {
5541
5727
  place.name = value.name;
5542
5728
  place.displayName = value.displayName;
5543
5729
  };
5544
- Vue.watch(
5545
- () => [placeKey.value],
5546
- async () => {
5547
- await readyPromise;
5730
+ const getPlaceByRegeo = ([lng, lat]) => {
5731
+ return new Promise((resolve, reject) => {
5548
5732
  const geocoder = new AMap.Geocoder({ lang: language === "en" ? "en" : "zh_cn" });
5549
- const [lng, lat] = pointRef.value;
5550
5733
  const isChina = inChina([lng, lat]);
5551
5734
  geocoder.getAddress(new AMap.LngLat(lng, lat), (status, result) => {
5552
5735
  switch (status) {
@@ -5554,30 +5737,30 @@ const useAmapPlace = (props) => {
5554
5737
  const { formattedAddress, addressComponent } = result.regeocode;
5555
5738
  const name2 = formattedAddress ? formattedAddress : emptyPlaceName;
5556
5739
  const displayName = amapPlaceName2DisplayName(name2, { isChina, ...addressComponent });
5557
- place.name = name2;
5558
- place.displayName = displayName;
5559
- place.lng = lng;
5560
- place.lat = lat;
5561
- onChange == null ? void 0 : onChange({ lng, lat, name: name2, displayName });
5740
+ resolve({ lng, lat, name: name2, displayName });
5562
5741
  return;
5563
5742
  }
5564
5743
  case "no_data": {
5565
5744
  const name2 = emptyPlaceName;
5566
5745
  const displayName = emptyPlaceName;
5567
- place.name = name2;
5568
- place.displayName = displayName;
5569
- place.lng = lng;
5570
- place.lat = lat;
5571
- onChange == null ? void 0 : onChange({ lng, lat, name: name2, displayName });
5746
+ resolve({ lng, lat, name: name2, displayName });
5572
5747
  return;
5573
5748
  }
5574
5749
  case "error":
5575
- throw result;
5750
+ reject(result);
5576
5751
  }
5577
5752
  });
5753
+ });
5754
+ };
5755
+ Vue.watch(
5756
+ () => [placeKey.value],
5757
+ async () => {
5758
+ await readyPromise;
5759
+ const resultPlace = await getPlaceByRegeo(pointRef.value);
5760
+ onChange == null ? void 0 : onChange(resultPlace);
5578
5761
  }
5579
5762
  );
5580
- return { place, updatePlace, setPlace };
5763
+ return { place, updatePlace, setPlace, getPlaceByRegeo };
5581
5764
  };
5582
5765
  const useGmapPlace = (props) => {
5583
5766
  const { onChange, emptyPlaceName } = props;
@@ -5601,214 +5784,182 @@ const useGmapPlace = (props) => {
5601
5784
  place.name = value.name;
5602
5785
  place.displayName = value.displayName;
5603
5786
  };
5787
+ const getPlaceByRegeo = ([lng, lat]) => {
5788
+ return new Promise((resolve, reject) => {
5789
+ const geocoder = new google.maps.Geocoder();
5790
+ geocoder.geocode({ language, location: { lng, lat } }).then(({ results }) => {
5791
+ const name2 = results[0].formatted_address ? results[0].formatted_address : emptyPlaceName;
5792
+ const displayName = name2;
5793
+ resolve({ lng, lat, name: name2, displayName });
5794
+ }).catch(reject);
5795
+ });
5796
+ };
5604
5797
  Vue.watch(
5605
5798
  () => placeKey.value,
5606
5799
  async () => {
5607
5800
  await readyPromise;
5608
- const geocoder = new google.maps.Geocoder();
5609
- const [lng, lat] = pointRef.value;
5610
- const { results } = await geocoder.geocode({ language, location: { lng, lat } });
5611
- const name2 = results[0].formatted_address ? results[0].formatted_address : emptyPlaceName;
5612
- const displayName = name2;
5613
- place.lng = lng;
5614
- place.lat = lat;
5615
- place.name = name2;
5616
- place.displayName = displayName;
5617
- onChange == null ? void 0 : onChange({ lng, lat, name: name2, displayName });
5801
+ const resultPlace = await getPlaceByRegeo(pointRef.value);
5802
+ onChange == null ? void 0 : onChange(resultPlace);
5618
5803
  }
5619
5804
  );
5620
- return { place, updatePlace, setPlace };
5805
+ return { place, updatePlace, setPlace, getPlaceByRegeo };
5621
5806
  };
5622
5807
  const useMapPlace = (props) => {
5623
5808
  const { supplier } = useMapSupplier();
5624
5809
  return supplier === "gmap" ? useGmapPlace(props) : useAmapPlace(props);
5625
5810
  };
5626
- const findAmapNearestPlace = (place, candidates) => {
5627
- let shortestDistance = Infinity;
5628
- let shortestPlace = place;
5629
- for (const candidate of candidates) {
5630
- const distance = AMap.GeometryUtil.distance(place2point(place), place2point(candidate));
5631
- if (distance >= shortestDistance)
5632
- continue;
5633
- shortestPlace = candidate;
5634
- shortestDistance = distance;
5635
- }
5636
- return { shortestPlace, shortestDistance };
5637
- };
5638
- const findGmapNearestPlace = (place, candidates) => {
5811
+ function findNearestPlace(place, candidates, distanceFn) {
5812
+ var _a;
5639
5813
  let shortestDistance = Infinity;
5640
5814
  let shortestPlace = place;
5641
5815
  for (const candidate of candidates) {
5642
- const distance = google.maps.geometry.spherical.computeDistanceBetween(place, candidate);
5816
+ const distance = (_a = distanceFn(place2point(place), place2point(candidate))) != null ? _a : Infinity;
5643
5817
  if (distance >= shortestDistance)
5644
5818
  continue;
5645
5819
  shortestPlace = candidate;
5646
5820
  shortestDistance = distance;
5647
5821
  }
5648
5822
  return { shortestPlace, shortestDistance };
5649
- };
5650
- const useAmapRecomendPlace = (props) => {
5651
- const { pointRef, getRecomendPlace, getLimit, context: context2, emptyPlaceName, onChange, onChangePlace } = props;
5823
+ }
5824
+ const useMapRecomendPlace = (props) => {
5825
+ const {
5826
+ defaultPoint,
5827
+ getRecomendPlace,
5828
+ getLimit,
5829
+ context: context2,
5830
+ emptyPlaceName,
5831
+ onChange,
5832
+ onChangePlace
5833
+ } = props;
5652
5834
  const availableRef = Vue.ref(true);
5653
5835
  const placeCandidatesRef = Vue.ref([]);
5654
5836
  const zoneRef = Vue.ref();
5655
- const { idx: recomendPlaceKey, update: updateRecommendPlaceKey } = useUpdate();
5656
- const { readyPromise } = useMapSupplier();
5657
- const { place, updatePlace, setPlace } = useAmapPlace({
5837
+ const { apiMapIsPointInRing, apiMapDistance } = useMapGeometry();
5838
+ const { getPlaceByRegeo } = useAmapPlace({
5658
5839
  emptyPlaceName,
5659
- pointRef,
5660
- onChange: onChangePlace
5840
+ pointRef: Vue.ref([...defaultPoint])
5841
+ });
5842
+ const recomendPlace = Vue.reactive({
5843
+ lng: defaultPoint[0],
5844
+ lat: defaultPoint[1],
5845
+ name: "",
5846
+ displayName: ""
5661
5847
  });
5662
- const recomendPlace = Vue.reactive({ ...place });
5663
5848
  const isElectedRef = Vue.computed(() => {
5664
- const point = pointRef.value;
5849
+ const recomendPoint = place2point(recomendPlace);
5665
5850
  return placeCandidatesRef.value.some(
5666
- (candidate) => isPointEqual(place2point(candidate), point)
5851
+ (candidate) => isPointEqual(place2point(candidate), recomendPoint)
5667
5852
  );
5668
5853
  });
5669
- const updatePlaceCandidates = async (place2) => {
5854
+ const findAttachedPlace = async (place) => {
5670
5855
  var _a;
5671
5856
  const {
5672
5857
  places: inputPlaceCandidates,
5673
5858
  zone,
5674
- available
5675
- } = (_a = await getRecomendPlace({ ...place2 }, context2)) != null ? _a : {};
5859
+ available = false
5860
+ } = (_a = await getRecomendPlace({ ...place }, context2)) != null ? _a : {};
5676
5861
  const placeCandidates = inputPlaceCandidates == null ? void 0 : inputPlaceCandidates.map(toPlaceType);
5677
- availableRef.value = !!available;
5678
- zoneRef.value = zone;
5679
- placeCandidatesRef.value = placeCandidates != null ? placeCandidates : [];
5862
+ if (!available || !placeCandidates) {
5863
+ return { place: { ...place }, zone, candidates: [], available };
5864
+ }
5865
+ const { shortestPlace, shortestDistance } = findNearestPlace(
5866
+ place,
5867
+ placeCandidates,
5868
+ apiMapDistance
5869
+ );
5870
+ const limit = getLimit(context2);
5871
+ const resultPlace = zone || shortestDistance <= limit ? shortestPlace : place;
5872
+ return { place: { ...resultPlace }, zone, candidates: placeCandidates, available };
5873
+ };
5874
+ const getRecommendPlaceZoneState = async (point, prevState) => {
5875
+ const zone = zoneRef.value;
5876
+ if (!zone || !apiMapIsPointInRing(point, zone.path)) {
5877
+ const reGeoPlace = await getPlaceByRegeo(point);
5878
+ const {
5879
+ place: resultPlace2,
5880
+ candidates,
5881
+ available,
5882
+ zone: zone2
5883
+ } = await findAttachedPlace(reGeoPlace);
5884
+ return { place: { ...resultPlace2 }, zone: zone2, available, candidates };
5885
+ }
5886
+ const [lng, lat] = point;
5887
+ const { shortestPlace: resultPlace } = findNearestPlace(
5888
+ { lng, lat, name: "", displayName: "" },
5889
+ placeCandidatesRef.value,
5890
+ apiMapDistance
5891
+ );
5680
5892
  return {
5681
- inputPlace: { ...place2 },
5682
- isInZone: !!zone,
5683
- place: place2
5893
+ place: { ...resultPlace },
5894
+ zone,
5895
+ available: prevState.available,
5896
+ candidates: prevState.candidates
5684
5897
  };
5685
5898
  };
5686
- const updateRecommendPlace = (place2) => {
5687
- setPlace(place2);
5688
- updateRecommendPlaceKey();
5689
- };
5690
- const setPlaceCandidatesAndZone = ({
5691
- zone,
5692
- places: inputPlaceCandidates
5693
- }) => {
5694
- const placeCandidates = inputPlaceCandidates == null ? void 0 : inputPlaceCandidates.map(toPlaceType);
5695
- zoneRef.value = zone ? zone : void 0;
5696
- placeCandidatesRef.value = placeCandidates != null ? placeCandidates : [];
5697
- };
5698
- Vue.watch(
5699
- () => recomendPlaceKey.value,
5700
- async () => {
5701
- var _a;
5702
- await readyPromise;
5703
- const {
5704
- places: inputPlaceCandidates,
5705
- zone,
5706
- available
5707
- } = (_a = await getRecomendPlace({ ...place }, context2)) != null ? _a : {};
5708
- const placeCandidates = inputPlaceCandidates == null ? void 0 : inputPlaceCandidates.map(toPlaceType);
5709
- if (!available || !placeCandidates) {
5710
- availableRef.value = !!available;
5711
- zoneRef.value = zone;
5712
- placeCandidatesRef.value = [];
5713
- Object.assign(recomendPlace, { ...place });
5714
- onChange == null ? void 0 : onChange({ place: { ...place }, inputPlace: { ...place }, isInZone: !!zone });
5715
- return;
5716
- }
5717
- const { shortestPlace, shortestDistance } = findAmapNearestPlace(place, placeCandidates);
5718
- const limit = getLimit(context2);
5719
- const resultPlace = zone || shortestDistance <= limit ? shortestPlace : place;
5720
- availableRef.value = !!available;
5721
- zoneRef.value = zone;
5722
- placeCandidatesRef.value = placeCandidates;
5723
- Object.assign(recomendPlace, { ...resultPlace });
5724
- onChange == null ? void 0 : onChange({ place: { ...resultPlace }, inputPlace: { ...place }, isInZone: !!zone });
5725
- }
5726
- );
5727
- return {
5728
- zoneRef,
5729
- recomendPlace,
5730
- placeCandidates: placeCandidatesRef,
5731
- availableRef,
5732
- isElectedRef,
5733
- updateRecommendPlace,
5734
- updatePlaceCandidates,
5735
- updatePlace,
5736
- setPlaceCandidatesAndZone
5899
+ const updatePlace = async (point) => {
5900
+ const {
5901
+ place: resultPlace,
5902
+ candidates,
5903
+ zone,
5904
+ available
5905
+ } = await getRecommendPlaceZoneState(point, {
5906
+ place: recomendPlace,
5907
+ available: availableRef.value,
5908
+ candidates: placeCandidatesRef.value,
5909
+ zone: zoneRef.value
5910
+ });
5911
+ const isSameZone = !!zone && isZoneEqual(zone, zoneRef.value);
5912
+ availableRef.value = available;
5913
+ zoneRef.value = zone;
5914
+ placeCandidatesRef.value = candidates;
5915
+ Object.assign(recomendPlace, { ...resultPlace });
5916
+ onChangePlace == null ? void 0 : onChangePlace({ ...resultPlace });
5917
+ const inputPlace = { name: "", displayName: "", lng: point[0], lat: point[1] };
5918
+ onChange == null ? void 0 : onChange({ place: { ...resultPlace }, inputPlace, isInZone: !!zone, isSameZone });
5737
5919
  };
5738
- };
5739
- const useGmapRecomendPlace = (props) => {
5740
- const { pointRef, getRecomendPlace, getLimit, context: context2, emptyPlaceName, onChange, onChangePlace } = props;
5741
- const availableRef = Vue.ref(true);
5742
- const placeCandidatesRef = Vue.ref([]);
5743
- const zoneRef = Vue.ref();
5744
- const { idx: recomendPlaceKey, update: updateRecommendPlaceKey } = useUpdate();
5745
- const { readyPromise } = useMapSupplier();
5746
- const { place, updatePlace, setPlace } = useGmapPlace({
5747
- emptyPlaceName,
5748
- pointRef,
5749
- onChange: onChangePlace
5750
- });
5751
- const recomendPlace = Vue.reactive({ ...place });
5752
- const isElectedRef = Vue.computed(() => {
5753
- const point = pointRef.value;
5754
- return placeCandidatesRef.value.some(
5755
- (candidate) => isPointEqual(place2point(candidate), point)
5756
- );
5757
- });
5758
- const updatePlaceCandidates = async (place2) => {
5920
+ const updatePlaceCandidates = async (place) => {
5759
5921
  var _a;
5760
5922
  const {
5761
5923
  places: inputPlaceCandidates,
5762
5924
  zone,
5763
5925
  available
5764
- } = (_a = await getRecomendPlace({ ...place2 }, context2)) != null ? _a : {};
5926
+ } = (_a = await getRecomendPlace({ ...place }, context2)) != null ? _a : {};
5927
+ const isSameZone = !!zone && isZoneEqual(zone, zoneRef.value);
5765
5928
  const placeCandidates = inputPlaceCandidates == null ? void 0 : inputPlaceCandidates.map(toPlaceType);
5766
5929
  availableRef.value = !!available;
5767
5930
  zoneRef.value = zone;
5768
5931
  placeCandidatesRef.value = placeCandidates != null ? placeCandidates : [];
5769
5932
  return {
5770
- inputPlace: { ...place2 },
5933
+ inputPlace: { ...place },
5771
5934
  isInZone: !!zone,
5772
- place: place2
5935
+ place,
5936
+ isSameZone
5773
5937
  };
5774
5938
  };
5775
- const updateRecommendPlace = (place2) => {
5776
- setPlace(place2);
5777
- updateRecommendPlaceKey();
5939
+ const updateRecommendPlace = async (place) => {
5940
+ const { place: resultPlace, candidates, available, zone } = await findAttachedPlace(place);
5941
+ const isSameZone = !!zone && isZoneEqual(zone, zoneRef.value);
5942
+ availableRef.value = available;
5943
+ zoneRef.value = zone;
5944
+ placeCandidatesRef.value = candidates;
5945
+ Object.assign(recomendPlace, { ...resultPlace });
5946
+ onChangePlace == null ? void 0 : onChangePlace({ ...resultPlace });
5947
+ onChange == null ? void 0 : onChange({
5948
+ place: { ...resultPlace },
5949
+ inputPlace: { ...place },
5950
+ isInZone: !!zone,
5951
+ isSameZone
5952
+ });
5778
5953
  };
5779
- const setPlaceCandidatesAndZone = ({ zone, places }) => {
5780
- placeCandidatesRef.value = places != null ? places : [];
5954
+ const setPlaceCandidatesAndZone = ({
5955
+ zone,
5956
+ places: inputPlaceCandidates
5957
+ }) => {
5958
+ const placeCandidates = inputPlaceCandidates == null ? void 0 : inputPlaceCandidates.map(toPlaceType);
5959
+ availableRef.value = true;
5781
5960
  zoneRef.value = zone ? zone : void 0;
5961
+ placeCandidatesRef.value = placeCandidates != null ? placeCandidates : [];
5782
5962
  };
5783
- Vue.watch(
5784
- () => recomendPlaceKey.value,
5785
- async () => {
5786
- var _a;
5787
- await readyPromise;
5788
- const {
5789
- places: inputPlaceCandidates,
5790
- zone,
5791
- available
5792
- } = (_a = await getRecomendPlace({ ...place }, context2)) != null ? _a : {};
5793
- const placeCandidates = inputPlaceCandidates == null ? void 0 : inputPlaceCandidates.map(toPlaceType);
5794
- if (!available || !placeCandidates) {
5795
- availableRef.value = !!available;
5796
- zoneRef.value = zone;
5797
- placeCandidatesRef.value = [];
5798
- Object.assign(recomendPlace, { ...place });
5799
- onChange == null ? void 0 : onChange({ place: { ...place }, inputPlace: { ...place }, isInZone: !!zone });
5800
- return;
5801
- }
5802
- const { shortestPlace, shortestDistance } = findGmapNearestPlace(place, placeCandidates);
5803
- const limit = getLimit(context2);
5804
- const resultPlace = shortestDistance > limit ? place : shortestPlace;
5805
- availableRef.value = !!available;
5806
- zoneRef.value = zone;
5807
- placeCandidatesRef.value = placeCandidates;
5808
- Object.assign(recomendPlace, { ...resultPlace });
5809
- onChange == null ? void 0 : onChange({ place: { ...resultPlace }, inputPlace: { ...place }, isInZone: !!zone });
5810
- }
5811
- );
5812
5963
  return {
5813
5964
  zoneRef,
5814
5965
  recomendPlace,
@@ -5821,20 +5972,19 @@ const useGmapRecomendPlace = (props) => {
5821
5972
  setPlaceCandidatesAndZone
5822
5973
  };
5823
5974
  };
5824
- const useMapRecomendPlace = (props) => {
5825
- const { supplier } = useMapSupplier();
5826
- return supplier === "gmap" ? useGmapRecomendPlace(props) : useAmapRecomendPlace(props);
5827
- };
5828
5975
  const GOOGLE_MAP_ZOOM_CHANGE_DEBOUNCE_TIMEOUT = 50;
5829
5976
  const DEFAULT_ZOOM$1 = 13;
5830
5977
  const useAmapZoom = (props) => {
5831
5978
  var _a, _b, _c;
5832
5979
  const { onChange, mapRef, defaultValue } = props;
5833
5980
  const zoomRef = Vue.ref((_c = (_b = (_a = mapRef.value) == null ? void 0 : _a.getZoom()) != null ? _b : defaultValue) != null ? _c : DEFAULT_ZOOM$1);
5834
- const setZoom = (v) => {
5835
- var _a2;
5981
+ const setZoom = (v, immediate = false) => {
5982
+ var _a2, _b2;
5983
+ const duration = deltaZoom2animationDuration(v - zoomRef.value);
5836
5984
  zoomRef.value = v;
5837
- (_a2 = mapRef.value) == null ? void 0 : _a2.setZoom(v, true);
5985
+ if (immediate)
5986
+ return (_a2 = mapRef.value) == null ? void 0 : _a2.setZoom(v, true);
5987
+ (_b2 = mapRef.value) == null ? void 0 : _b2.setZoom(v, false, duration);
5838
5988
  };
5839
5989
  const handleZoomEnd = (_, { target }) => {
5840
5990
  const zoom = target.getZoom();
@@ -6142,10 +6292,9 @@ const ConditionalFittablePassengerCircle = defineSetup(function ConditionalFitta
6142
6292
  "size": "small",
6143
6293
  "registerOverlay": registerOverlay
6144
6294
  }
6145
- }), Vue.h(KeyedFitView, {
6295
+ }), Vue.h(FitViewOnce, {
6146
6296
  "attrs": {
6147
- "registerOverlay": registerOverlay,
6148
- "fitViewKey": JSON.stringify(position)
6297
+ "registerOverlay": registerOverlay
6149
6298
  }
6150
6299
  })]);
6151
6300
  };
@@ -6567,7 +6716,6 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
6567
6716
  name: geoLoadingTitle,
6568
6717
  displayName: geoLoadingTitle
6569
6718
  });
6570
- const centerPoint = Vue.computed(() => [centerPlace.lng, centerPlace.lat]);
6571
6719
  const centerSource = {
6572
6720
  source: "geo"
6573
6721
  };
@@ -6578,25 +6726,19 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
6578
6726
  const setCenterPlaceByUserSpecified = async (input) => {
6579
6727
  centerSource.source = "api";
6580
6728
  const place = toPlaceType(input);
6581
- centerPlace.lng = place.lng;
6582
- centerPlace.lat = place.lat;
6583
- centerPlace.name = place.name;
6584
- centerPlace.displayName = place.displayName;
6585
- emit("changePlace", {
6586
- ...place
6587
- });
6729
+ Object.assign(centerPlace, place);
6588
6730
  updateRecommendPlace(place);
6589
6731
  };
6590
6732
  const setCenterPlaceByUserSpecifiedInZone = ({
6591
- place,
6733
+ place: input,
6592
6734
  recommends
6593
6735
  }) => {
6594
- centerPlace.lng = place.lng;
6595
- centerPlace.lat = place.lat;
6596
- centerPlace.name = place.name;
6597
- centerPlace.displayName = place.displayName;
6736
+ const place = toPlaceType(input);
6737
+ assertZone(recommends.zone);
6738
+ Object.assign(centerPlace, place);
6598
6739
  setPlaceCandidatesAndZone(recommends);
6599
- setZoom(ZONE_ZOOM);
6740
+ if (!isZoneEqual(recommends.zone, zoneRef.value))
6741
+ setZoom(ZONE_ZOOM);
6600
6742
  emit("changePlace", {
6601
6743
  ...place
6602
6744
  });
@@ -6604,12 +6746,7 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
6604
6746
  const panToCenterByPlace = async (place) => {
6605
6747
  centerSource.source = "api";
6606
6748
  await panTo(place2point(place));
6607
- centerPlace.lng = place.lng;
6608
- centerPlace.lat = place.lat;
6609
- centerPlace.name = place.name;
6610
- centerPlace.displayName = place.displayName;
6611
- if (zoneRef.value)
6612
- setZoom(ZONE_ZOOM);
6749
+ Object.assign(centerPlace, place);
6613
6750
  emit("changePlace", {
6614
6751
  ...place
6615
6752
  });
@@ -6620,7 +6757,8 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
6620
6757
  inputPlace: {
6621
6758
  ...place
6622
6759
  },
6623
- isInZone: !!zoneRef.value
6760
+ isInZone: !!zoneRef.value,
6761
+ isSameZone: !!zoneRef.value
6624
6762
  });
6625
6763
  };
6626
6764
  const defaultCenterPlacePromise = new Promise((resolve) => {
@@ -6638,18 +6776,21 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
6638
6776
  } = useGeoLocation({
6639
6777
  geoDefaultPosition,
6640
6778
  onLoad: async (value) => {
6779
+ const [lng, lat] = value.position;
6641
6780
  await readyPromise;
6642
6781
  centerSource.source = "geo";
6782
+ centerPlace.lng = lng;
6783
+ centerPlace.lat = lat;
6643
6784
  updatePlace(value.position);
6644
6785
  emit("loadGeoLocation", value);
6645
6786
  },
6646
6787
  onLoadDefault: async (value) => {
6647
6788
  await readyPromise;
6648
- const place = await defaultCenterPlacePromise;
6789
+ const inputPlace = await defaultCenterPlacePromise;
6649
6790
  centerSource.source = "geo";
6650
6791
  emit("loadDefaultGeoLocation", value);
6651
- if (place) {
6652
- await setCenterPlaceByUserSpecified(place);
6792
+ if (inputPlace) {
6793
+ await setCenterPlaceByUserSpecified(inputPlace);
6653
6794
  } else {
6654
6795
  updatePlace(value.position);
6655
6796
  }
@@ -6684,7 +6825,7 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
6684
6825
  availableRef,
6685
6826
  isElectedRef
6686
6827
  } = useMapRecomendPlace({
6687
- pointRef: centerPoint,
6828
+ defaultPoint: place2point(centerPlace),
6688
6829
  emptyPlaceName: DEFAULT_PLACE_NAME,
6689
6830
  context: centerSource,
6690
6831
  getRecomendPlace: pipedGetRecomendPlace,
@@ -6701,29 +6842,27 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
6701
6842
  throw new Error(`MyError: should not call getLimit on source: ${source}`);
6702
6843
  }
6703
6844
  },
6704
- onChangePlace: (place) => {
6705
- if (centerSource.source !== "recomend") {
6706
- updateRecommendPlace(place);
6707
- }
6708
- emit("changePlace", place);
6709
- },
6845
+ onChangePlace: (place) => emit("changePlace", place),
6710
6846
  onChange: async ({
6711
6847
  place,
6712
6848
  inputPlace,
6713
- isInZone
6849
+ isInZone,
6850
+ isSameZone
6714
6851
  }) => {
6852
+ debugger;
6715
6853
  centerSource.source = "recomend";
6716
6854
  if (isPlaceEqual(place, centerPlace))
6717
6855
  panTo(place2point(place));
6718
6856
  Object.assign(centerPlace, {
6719
6857
  ...place
6720
6858
  });
6721
- if (isInZone)
6859
+ if (isInZone && !isSameZone)
6722
6860
  setZoom(ZONE_ZOOM);
6723
6861
  emit("changeRecomandPlace", {
6724
6862
  place,
6725
6863
  inputPlace,
6726
- isInZone
6864
+ isInZone,
6865
+ isSameZone
6727
6866
  });
6728
6867
  }
6729
6868
  });
@@ -6746,7 +6885,7 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
6746
6885
  const description = !availableRef.value ? void 0 : isElectedRef.value ? recomendDescription : void 0;
6747
6886
  return Vue.h(HeycarMap, {
6748
6887
  "attrs": {
6749
- "center": centerPoint.value,
6888
+ "center": place2point(centerPlace),
6750
6889
  "zoom": zoomRef.value,
6751
6890
  "touchZoomCenter": true,
6752
6891
  "mapRef": setMap,
@@ -6822,7 +6961,6 @@ const BusinessReselectPlaceMap = defineLagecySetup(function BusinessReselectPlac
6822
6961
  name: defaultPlace.name,
6823
6962
  displayName: defaultPlace.displayName
6824
6963
  });
6825
- const centerPoint = Vue.computed(() => [centerPlace.lng, centerPlace.lat]);
6826
6964
  const centerSource = {
6827
6965
  source: "default"
6828
6966
  };
@@ -6833,24 +6971,18 @@ const BusinessReselectPlaceMap = defineLagecySetup(function BusinessReselectPlac
6833
6971
  const setCenterPlaceByUserSpecified = async (input) => {
6834
6972
  centerSource.source = "api";
6835
6973
  const place = toPlaceType(input);
6836
- centerPlace.lng = place.lng;
6837
- centerPlace.lat = place.lat;
6838
- centerPlace.name = place.name;
6839
- centerPlace.displayName = place.displayName;
6840
- emit("changePlace", {
6841
- ...place
6842
- });
6974
+ Object.assign(centerPlace, place);
6843
6975
  updateRecommendPlace(place);
6844
6976
  };
6845
6977
  const setCenterPlaceByUserSpecifiedInZone = ({
6846
- place,
6978
+ place: input,
6847
6979
  recommends
6848
6980
  }) => {
6849
- centerPlace.lng = place.lng;
6850
- centerPlace.lat = place.lat;
6851
- centerPlace.name = place.name;
6852
- centerPlace.displayName = place.displayName;
6853
- setZoom(ZONE_ZOOM);
6981
+ const place = toPlaceType(input);
6982
+ assertZone(recommends.zone);
6983
+ Object.assign(centerPlace, place);
6984
+ if (!isZoneEqual(recommends.zone, zoneRef.value))
6985
+ setZoom(ZONE_ZOOM);
6854
6986
  setPlaceCandidatesAndZone(recommends);
6855
6987
  emit("changePlace", {
6856
6988
  ...place
@@ -6863,8 +6995,6 @@ const BusinessReselectPlaceMap = defineLagecySetup(function BusinessReselectPlac
6863
6995
  centerPlace.lat = place.lat;
6864
6996
  centerPlace.name = place.name;
6865
6997
  centerPlace.displayName = place.displayName;
6866
- if (zoneRef.value)
6867
- setZoom(ZONE_ZOOM);
6868
6998
  emit("changePlace", {
6869
6999
  ...place
6870
7000
  });
@@ -6875,7 +7005,8 @@ const BusinessReselectPlaceMap = defineLagecySetup(function BusinessReselectPlac
6875
7005
  inputPlace: {
6876
7006
  ...place
6877
7007
  },
6878
- isInZone: !!zoneRef.value
7008
+ isInZone: !!zoneRef.value,
7009
+ isSameZone: !!zoneRef.value
6879
7010
  });
6880
7011
  };
6881
7012
  const {
@@ -6918,7 +7049,7 @@ const BusinessReselectPlaceMap = defineLagecySetup(function BusinessReselectPlac
6918
7049
  availableRef,
6919
7050
  isElectedRef
6920
7051
  } = useMapRecomendPlace({
6921
- pointRef: centerPoint,
7052
+ defaultPoint: place2point(centerPlace),
6922
7053
  emptyPlaceName: DEFAULT_PLACE_NAME,
6923
7054
  context: centerSource,
6924
7055
  getRecomendPlace: pipedGetRecomendPlace,
@@ -6935,16 +7066,12 @@ const BusinessReselectPlaceMap = defineLagecySetup(function BusinessReselectPlac
6935
7066
  throw new Error(`MyError: should not call getLimit on source: ${source}`);
6936
7067
  }
6937
7068
  },
6938
- onChangePlace: (place) => {
6939
- if (centerSource.source !== "recomend") {
6940
- updateRecommendPlace(place);
6941
- }
6942
- emit("changePlace", place);
6943
- },
7069
+ onChangePlace: (place) => emit("changePlace", place),
6944
7070
  onChange: async ({
6945
7071
  place,
6946
7072
  inputPlace,
6947
- isInZone
7073
+ isInZone,
7074
+ isSameZone
6948
7075
  }) => {
6949
7076
  centerSource.source = "recomend";
6950
7077
  if (isPlaceEqual(place, centerPlace))
@@ -6952,12 +7079,13 @@ const BusinessReselectPlaceMap = defineLagecySetup(function BusinessReselectPlac
6952
7079
  Object.assign(centerPlace, {
6953
7080
  ...place
6954
7081
  });
6955
- if (isInZone)
7082
+ if (isInZone && !isSameZone)
6956
7083
  setZoom(ZONE_ZOOM);
6957
7084
  emit("changeRecomandPlace", {
6958
7085
  place,
6959
7086
  inputPlace,
6960
- isInZone
7087
+ isInZone,
7088
+ isSameZone
6961
7089
  });
6962
7090
  }
6963
7091
  });
@@ -6983,7 +7111,7 @@ const BusinessReselectPlaceMap = defineLagecySetup(function BusinessReselectPlac
6983
7111
  const description = !availableRef.value ? void 0 : isElectedRef.value ? recomendDescription : void 0;
6984
7112
  return Vue.h(HeycarMap, {
6985
7113
  "attrs": {
6986
- "center": centerPoint.value,
7114
+ "center": place2point(centerPlace),
6987
7115
  "zoom": zoomRef.value,
6988
7116
  "touchZoomCenter": true,
6989
7117
  "mapRef": setMap,
@@ -7018,38 +7146,6 @@ const BusinessReselectPlaceMap = defineLagecySetup(function BusinessReselectPlac
7018
7146
  })]);
7019
7147
  };
7020
7148
  }).props(["loading", "fallback", "log", "defaultPlace", "unavailableTitle", "recomendDescription", "getRecomendPlace", "mapContext"]);
7021
- const useAmapGeometry = () => {
7022
- const payload = useMapSupplier();
7023
- const apiMapDistance = (from, to) => {
7024
- if (payload.status !== Status.SUCCESS)
7025
- return void 0;
7026
- return AMap.GeometryUtil.distance(from, to);
7027
- };
7028
- const apiMapDistanceToLine = (from, line) => {
7029
- if (payload.status !== Status.SUCCESS)
7030
- return void 0;
7031
- return AMap.GeometryUtil.distanceToLine(from, line);
7032
- };
7033
- return { apiMapDistance, apiMapDistanceToLine };
7034
- };
7035
- const useGmapGeometry = () => {
7036
- const payload = useMapSupplier();
7037
- const apiMapDistance = (from, to) => {
7038
- if (payload.status !== Status.SUCCESS)
7039
- return void 0;
7040
- return google.maps.geometry.spherical.computeDistanceBetween(vec2lnglat(from), vec2lnglat(to));
7041
- };
7042
- const apiMapDistanceToLine = (from, line) => {
7043
- if (payload.status !== Status.SUCCESS)
7044
- return void 0;
7045
- return 0;
7046
- };
7047
- return { apiMapDistance, apiMapDistanceToLine };
7048
- };
7049
- const useMapGeometry = () => {
7050
- const { supplier } = useMapSupplier();
7051
- return supplier === "gmap" ? useGmapGeometry() : useAmapGeometry();
7052
- };
7053
7149
  const imgTaxicar = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iNDQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxkZWZzPjxwYXRoIGQ9Ik0zNC4wODcgMTAuOTZjMCAyLjM2OS0uMDU0IDIuOTgtLjc4MiAzLjcwNC0uNzkzLjc5LTUuMjM2LjgzMy01LjIzNi44MzNsLTQuMTE2LjE5Mi05Ljg5Ni0uMTQ0cy03Ljc5LS4wMjYtOS4xMzEtLjAyNmMtMS4zNDIgMC0yLjQwNi0uODQ3LTIuNDA2LS44NDdDLjE0IDEyLjkzMiAwIDExLjA5IDAgMTEuMDlWNS44NnMuMTQtMS44NDIgMi41Mi0zLjU4M2MwIDAgMS4wNjQtLjg0NiAyLjQwNi0uODQ2IDEuMzQxIDAgOS4xMy0uMDI2IDkuMTMtLjAyNmw5Ljg5Ny0uMTQ0IDQuMTE2LjE5MnM0LjQ4NCAwIDUuMjM2LjgzM2MuNzc4Ljg2Ljc4MiAxLjM3Ljc4MiAzLjc0djQuOTM0eiIgaWQ9InByZWZpeF9fYiIvPjxwYXRoIGQ9Ik0wIDEuNDkzUzUuNy4xOCA4LjcxOS4wNWMzLjAyLS4xMzEgMy40Ny4wMTcgNS4yODIuMjEuNTA3LjA1MSAzLjI2LjkxIDMuMjYuOTFsLTcuMzAzLjNMMCAxLjQ5NHoiIGlkPSJwcmVmaXhfX2MiLz48cGF0aCBkPSJNMTAuMDggMi44MTVDOS4yOTUgNC40ODMgOC44NSA2LjQyMyA4Ljg1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illa = "";
7055
7151
  var carIcon = "_65j3sr1";
@@ -7394,6 +7490,7 @@ const WaveCircle = defineSetup(function WaveCircle2(props) {
7394
7490
  const PASSENGER_DISTANCE_MAX = 2e3;
7395
7491
  const PASSENGER_DISTANCE_MIN = 10;
7396
7492
  const CAR_DISTANCE_MIN = 100;
7493
+ const AUTO_FIT_VIEW_INTERVAL = 15e3;
7397
7494
  const carDurationWithinMinDistance = (distance) => Math.floor(distance / 5);
7398
7495
  const SectionDispatching = defineSetup(function SectionDispatching2(props) {
7399
7496
  return () => {
@@ -7402,12 +7499,16 @@ const SectionDispatching = defineSetup(function SectionDispatching2(props) {
7402
7499
  title,
7403
7500
  registerOverlay
7404
7501
  } = props;
7502
+ const {
7503
+ language
7504
+ } = useMapSupplier();
7405
7505
  const from = place2point(fromPlace);
7406
7506
  return Vue.h("div", [Vue.h(StartEndPoint, {
7407
7507
  "attrs": {
7408
7508
  "type": "start",
7409
7509
  "position": from,
7410
7510
  "title": title,
7511
+ "language": language,
7411
7512
  "registerOverlay": registerOverlay
7412
7513
  }
7413
7514
  }), Vue.h(WaveCircle, {
@@ -7424,10 +7525,18 @@ const SectionDispatching = defineSetup(function SectionDispatching2(props) {
7424
7525
  "attrs": {
7425
7526
  "registerOverlay": registerOverlay
7426
7527
  }
7528
+ }), Vue.h(InterruptableIntervalFitView, {
7529
+ "attrs": {
7530
+ "interval": AUTO_FIT_VIEW_INTERVAL,
7531
+ "registerOverlay": registerOverlay
7532
+ }
7427
7533
  })]);
7428
7534
  };
7429
7535
  });
7430
7536
  const SectionConfirmed = defineSetup(function SectionConfirmed2(props) {
7537
+ const {
7538
+ language
7539
+ } = useMapSupplier();
7431
7540
  const {
7432
7541
  apiMapDistance
7433
7542
  } = useMapGeometry();
@@ -7465,13 +7574,15 @@ const SectionConfirmed = defineSetup(function SectionConfirmed2(props) {
7465
7574
  "attrs": {
7466
7575
  "type": "start",
7467
7576
  "registerOverlay": registerOverlay,
7468
- "position": from
7577
+ "position": from,
7578
+ "language": language
7469
7579
  }
7470
7580
  }), Vue.h(StartEndPoint, {
7471
7581
  "attrs": {
7472
7582
  "type": "end",
7473
7583
  "registerOverlay": registerOverlay,
7474
- "position": to
7584
+ "position": to,
7585
+ "language": language
7475
7586
  }
7476
7587
  }), Vue.h(PlaceCircle, {
7477
7588
  "attrs": {
@@ -7489,10 +7600,22 @@ const SectionConfirmed = defineSetup(function SectionConfirmed2(props) {
7489
7600
  "attrs": {
7490
7601
  "registerOverlay": registerOverlay
7491
7602
  }
7603
+ }), Vue.h(InterruptableIntervalFitView, {
7604
+ "attrs": {
7605
+ "interval": AUTO_FIT_VIEW_INTERVAL,
7606
+ "registerOverlay": registerOverlay
7607
+ }
7492
7608
  })]);
7493
7609
  };
7494
7610
  });
7495
7611
  const SectionDriverStartService = defineSetup(function SectionDriverStartService2(props) {
7612
+ const {
7613
+ registerOverlay
7614
+ } = props;
7615
+ const fittableRegistryOverlay = createFittableRegisterOverlay(registerOverlay);
7616
+ const {
7617
+ language
7618
+ } = useMapSupplier();
7496
7619
  const {
7497
7620
  apiMapDistance
7498
7621
  } = useMapGeometry();
@@ -7503,8 +7626,7 @@ const SectionDriverStartService = defineSetup(function SectionDriverStartService
7503
7626
  carAngle,
7504
7627
  passengerPosition,
7505
7628
  passengerAngle,
7506
- renderTitle,
7507
- registerOverlay
7629
+ renderTitle
7508
7630
  } = props;
7509
7631
  const from = place2point(fromPlace);
7510
7632
  const passengerDistance = passengerPosition ? apiMapDistance(passengerPosition, from) : void 0;
@@ -7520,7 +7642,8 @@ const SectionDriverStartService = defineSetup(function SectionDriverStartService
7520
7642
  "attrs": {
7521
7643
  "type": "start",
7522
7644
  "position": from,
7523
- "registerOverlay": registerOverlay
7645
+ "registerOverlay": registerOverlay,
7646
+ "language": language
7524
7647
  }
7525
7648
  }), Vue.h(PlaceCircle, {
7526
7649
  "attrs": {
@@ -7538,7 +7661,7 @@ const SectionDriverStartService = defineSetup(function SectionDriverStartService
7538
7661
  distance,
7539
7662
  duration
7540
7663
  }) => {
7541
- var _a, _b;
7664
+ var _a;
7542
7665
  spaceLog("angleDifference", "carPosition, routeAngle, driverAngle = ", carPosition, angle, carAngle);
7543
7666
  return [Vue.h(DrivingLine, {
7544
7667
  "attrs": {
@@ -7552,12 +7675,7 @@ const SectionDriverStartService = defineSetup(function SectionDriverStartService
7552
7675
  distance,
7553
7676
  duration
7554
7677
  }),
7555
- "registerOverlay": registerOverlay
7556
- }
7557
- }), Vue.h(KeyedFitView, {
7558
- "attrs": {
7559
- "registerOverlay": registerOverlay,
7560
- "fitViewKey": JSON.stringify((_b = path[0]) != null ? _b : carPosition)
7678
+ "registerOverlay": fittableRegistryOverlay
7561
7679
  }
7562
7680
  })];
7563
7681
  }
@@ -7570,12 +7688,7 @@ const SectionDriverStartService = defineSetup(function SectionDriverStartService
7570
7688
  distance: carDistance,
7571
7689
  duration: carDurationWithinMinDistance(carDistance)
7572
7690
  }),
7573
- "registerOverlay": registerOverlay
7574
- }
7575
- }), Vue.h(KeyedFitView, {
7576
- "attrs": {
7577
- "registerOverlay": registerOverlay,
7578
- "fitViewKey": JSON.stringify(carPosition)
7691
+ "registerOverlay": fittableRegistryOverlay
7579
7692
  }
7580
7693
  })], !!passengerPosition && passengerDistance && passengerDistance < PASSENGER_DISTANCE_MAX && passengerDistance > PASSENGER_DISTANCE_MIN && Vue.h(WalkingRoute, {
7581
7694
  "attrs": {
@@ -7593,6 +7706,11 @@ const SectionDriverStartService = defineSetup(function SectionDriverStartService
7593
7706
  "attrs": {
7594
7707
  "registerOverlay": registerOverlay
7595
7708
  }
7709
+ }), Vue.h(InterruptableIntervalFitView, {
7710
+ "attrs": {
7711
+ "interval": AUTO_FIT_VIEW_INTERVAL,
7712
+ "registerOverlay": registerOverlay
7713
+ }
7596
7714
  })]);
7597
7715
  };
7598
7716
  });
@@ -7600,6 +7718,9 @@ const SectionBookDispatched = defineSetup(function SectionBookDispatched2(props)
7600
7718
  const {
7601
7719
  apiMapDistance
7602
7720
  } = useMapGeometry();
7721
+ const {
7722
+ language
7723
+ } = useMapSupplier();
7603
7724
  return () => {
7604
7725
  const {
7605
7726
  from: fromPlace,
@@ -7646,13 +7767,15 @@ const SectionBookDispatched = defineSetup(function SectionBookDispatched2(props)
7646
7767
  "attrs": {
7647
7768
  "type": "start",
7648
7769
  "registerOverlay": registerOverlay,
7649
- "position": from
7770
+ "position": from,
7771
+ "language": language
7650
7772
  }
7651
7773
  }), Vue.h(StartEndPoint, {
7652
7774
  "attrs": {
7653
7775
  "type": "end",
7654
7776
  "registerOverlay": registerOverlay,
7655
- "position": to
7777
+ "position": to,
7778
+ "language": language
7656
7779
  }
7657
7780
  }), Vue.h(PlaceCircle, {
7658
7781
  "attrs": {
@@ -7670,10 +7793,22 @@ const SectionBookDispatched = defineSetup(function SectionBookDispatched2(props)
7670
7793
  "attrs": {
7671
7794
  "registerOverlay": registerOverlay
7672
7795
  }
7796
+ }), Vue.h(InterruptableIntervalFitView, {
7797
+ "attrs": {
7798
+ "interval": AUTO_FIT_VIEW_INTERVAL,
7799
+ "registerOverlay": registerOverlay
7800
+ }
7673
7801
  })]);
7674
7802
  };
7675
7803
  });
7676
7804
  const SectionDriverArrived = defineSetup(function SectionDriverArrived2(props) {
7805
+ const {
7806
+ registerOverlay
7807
+ } = props;
7808
+ const fittableRegistryOverlay = createFittableRegisterOverlay(registerOverlay);
7809
+ const {
7810
+ language
7811
+ } = useMapSupplier();
7677
7812
  const {
7678
7813
  apiMapDistance
7679
7814
  } = useMapGeometry();
@@ -7684,8 +7819,7 @@ const SectionDriverArrived = defineSetup(function SectionDriverArrived2(props) {
7684
7819
  carAngle,
7685
7820
  passengerPosition,
7686
7821
  passengerAngle,
7687
- title,
7688
- registerOverlay
7822
+ title
7689
7823
  } = props;
7690
7824
  const from = place2point(fromPlace);
7691
7825
  const passengerDistance = passengerPosition ? apiMapDistance(passengerPosition, from) : void 0;
@@ -7713,18 +7847,14 @@ const SectionDriverArrived = defineSetup(function SectionDriverArrived2(props) {
7713
7847
  "position": carPosition,
7714
7848
  "angle": carAngle,
7715
7849
  "title": title,
7716
- "registerOverlay": registerOverlay
7717
- }
7718
- }), Vue.h(KeyedFitView, {
7719
- "attrs": {
7720
- "registerOverlay": registerOverlay,
7721
- "fitViewKey": JSON.stringify(carPosition)
7850
+ "registerOverlay": fittableRegistryOverlay
7722
7851
  }
7723
7852
  })], Vue.h(StartEndPoint, {
7724
7853
  "attrs": {
7725
7854
  "type": "start",
7726
7855
  "position": from,
7727
- "registerOverlay": registerOverlay
7856
+ "registerOverlay": registerOverlay,
7857
+ "language": language
7728
7858
  }
7729
7859
  }), Vue.h(PlaceCircle, {
7730
7860
  "attrs": {
@@ -7736,19 +7866,30 @@ const SectionDriverArrived = defineSetup(function SectionDriverArrived2(props) {
7736
7866
  "attrs": {
7737
7867
  "registerOverlay": registerOverlay
7738
7868
  }
7869
+ }), Vue.h(InterruptableIntervalFitView, {
7870
+ "attrs": {
7871
+ "interval": AUTO_FIT_VIEW_INTERVAL,
7872
+ "registerOverlay": registerOverlay
7873
+ }
7739
7874
  })]);
7740
7875
  };
7741
7876
  });
7742
7877
  const SectionInService = defineSetup(function SectionInService2(props) {
7878
+ const {
7879
+ registerOverlay
7880
+ } = props;
7881
+ const fittableRegistryOverlay = createFittableRegisterOverlay(registerOverlay);
7743
7882
  return () => {
7744
7883
  const {
7745
7884
  to: toPlace,
7746
7885
  carPosition,
7747
7886
  carAngle,
7748
- renderTitle,
7749
- registerOverlay
7887
+ renderTitle
7750
7888
  } = props;
7751
7889
  const to = place2point(toPlace);
7890
+ const {
7891
+ language
7892
+ } = useMapSupplier();
7752
7893
  const {
7753
7894
  apiMapDistance
7754
7895
  } = useMapGeometry();
@@ -7763,7 +7904,7 @@ const SectionInService = defineSetup(function SectionInService2(props) {
7763
7904
  distance,
7764
7905
  duration
7765
7906
  }) => {
7766
- var _a, _b;
7907
+ var _a;
7767
7908
  spaceLog("angleDifference", "carPosition, routeAngle, driverAngle = ", carPosition, angle, carAngle);
7768
7909
  return [Vue.h(DrivingLine, {
7769
7910
  "attrs": {
@@ -7777,12 +7918,7 @@ const SectionInService = defineSetup(function SectionInService2(props) {
7777
7918
  distance,
7778
7919
  duration
7779
7920
  }),
7780
- "registerOverlay": registerOverlay
7781
- }
7782
- }), Vue.h(KeyedFitView, {
7783
- "attrs": {
7784
- "registerOverlay": registerOverlay,
7785
- "fitViewKey": JSON.stringify((_b = path[0]) != null ? _b : carPosition)
7921
+ "registerOverlay": fittableRegistryOverlay
7786
7922
  }
7787
7923
  })];
7788
7924
  }
@@ -7795,18 +7931,14 @@ const SectionInService = defineSetup(function SectionInService2(props) {
7795
7931
  distance: carDistance,
7796
7932
  duration: carDurationWithinMinDistance(carDistance)
7797
7933
  }),
7798
- "registerOverlay": registerOverlay
7799
- }
7800
- }), Vue.h(KeyedFitView, {
7801
- "attrs": {
7802
- "registerOverlay": registerOverlay,
7803
- "fitViewKey": JSON.stringify(carPosition)
7934
+ "registerOverlay": fittableRegistryOverlay
7804
7935
  }
7805
7936
  })], Vue.h(StartEndPoint, {
7806
7937
  "attrs": {
7807
7938
  "type": "end",
7808
7939
  "position": to,
7809
- "registerOverlay": registerOverlay
7940
+ "registerOverlay": registerOverlay,
7941
+ "language": language
7810
7942
  }
7811
7943
  }), Vue.h(PlaceCircle, {
7812
7944
  "attrs": {
@@ -7818,10 +7950,18 @@ const SectionInService = defineSetup(function SectionInService2(props) {
7818
7950
  "attrs": {
7819
7951
  "registerOverlay": registerOverlay
7820
7952
  }
7953
+ }), Vue.h(InterruptableIntervalFitView, {
7954
+ "attrs": {
7955
+ "interval": AUTO_FIT_VIEW_INTERVAL,
7956
+ "registerOverlay": registerOverlay
7957
+ }
7821
7958
  })]);
7822
7959
  };
7823
7960
  });
7824
7961
  const SectionCanceled = defineSetup(function SectionCanceled2(props) {
7962
+ const {
7963
+ language
7964
+ } = useMapSupplier();
7825
7965
  return () => {
7826
7966
  const {
7827
7967
  from: fromPlace,
@@ -7834,13 +7974,15 @@ const SectionCanceled = defineSetup(function SectionCanceled2(props) {
7834
7974
  "attrs": {
7835
7975
  "type": "start",
7836
7976
  "position": from,
7837
- "registerOverlay": registerOverlay
7977
+ "registerOverlay": registerOverlay,
7978
+ "language": language
7838
7979
  }
7839
7980
  }), Vue.h(StartEndPoint, {
7840
7981
  "attrs": {
7841
7982
  "type": "end",
7842
7983
  "position": to,
7843
- "registerOverlay": registerOverlay
7984
+ "registerOverlay": registerOverlay,
7985
+ "language": language
7844
7986
  }
7845
7987
  }), Vue.h(PlaceCircle, {
7846
7988
  "attrs": {
@@ -7858,10 +8000,18 @@ const SectionCanceled = defineSetup(function SectionCanceled2(props) {
7858
8000
  "attrs": {
7859
8001
  "registerOverlay": registerOverlay
7860
8002
  }
8003
+ }), Vue.h(InterruptableIntervalFitView, {
8004
+ "attrs": {
8005
+ "interval": AUTO_FIT_VIEW_INTERVAL,
8006
+ "registerOverlay": registerOverlay
8007
+ }
7861
8008
  })]);
7862
8009
  };
7863
8010
  });
7864
8011
  const SectionEndService = defineSetup(function SectionEndService2(props) {
8012
+ const {
8013
+ language
8014
+ } = useMapSupplier();
7865
8015
  return () => {
7866
8016
  const {
7867
8017
  from: fromPlace,
@@ -7887,13 +8037,15 @@ const SectionEndService = defineSetup(function SectionEndService2(props) {
7887
8037
  "attrs": {
7888
8038
  "type": "start",
7889
8039
  "position": from,
7890
- "registerOverlay": registerOverlay
8040
+ "registerOverlay": registerOverlay,
8041
+ "language": language
7891
8042
  }
7892
8043
  }), Vue.h(StartEndPoint, {
7893
8044
  "attrs": {
7894
8045
  "type": "end",
7895
8046
  "position": to,
7896
- "registerOverlay": registerOverlay
8047
+ "registerOverlay": registerOverlay,
8048
+ "language": language
7897
8049
  }
7898
8050
  }), Vue.h(PlaceCircle, {
7899
8051
  "attrs": {
@@ -7911,6 +8063,11 @@ const SectionEndService = defineSetup(function SectionEndService2(props) {
7911
8063
  "attrs": {
7912
8064
  "registerOverlay": registerOverlay
7913
8065
  }
8066
+ }), Vue.h(InterruptableIntervalFitView, {
8067
+ "attrs": {
8068
+ "interval": AUTO_FIT_VIEW_INTERVAL,
8069
+ "registerOverlay": registerOverlay
8070
+ }
7914
8071
  })]);
7915
8072
  };
7916
8073
  });