@gui-chat-plugin/google-map 0.3.0 → 0.3.1
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/README.md +15 -7
- package/dist/core/types.d.ts +2 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/vue/View.vue.d.ts.map +1 -1
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +307 -270
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -65,7 +65,7 @@ interface MapToolData {
|
|
|
65
65
|
|
|
66
66
|
## Google Maps API Setup
|
|
67
67
|
|
|
68
|
-
This plugin requires a Google Maps API key with
|
|
68
|
+
This plugin requires a Google Maps API key with several APIs enabled.
|
|
69
69
|
|
|
70
70
|
### Step 1: Create a Google Cloud Project
|
|
71
71
|
|
|
@@ -73,12 +73,20 @@ This plugin requires a Google Maps API key with the **Maps Embed API** enabled.
|
|
|
73
73
|
2. Create a new project or select an existing one
|
|
74
74
|
3. Make sure billing is enabled for the project
|
|
75
75
|
|
|
76
|
-
### Step 2: Enable
|
|
76
|
+
### Step 2: Enable Required APIs
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
78
|
+
This plugin requires the following 4 APIs. Enable all of them:
|
|
79
|
+
|
|
80
|
+
| API | Purpose | Enable Link |
|
|
81
|
+
|-----|---------|-------------|
|
|
82
|
+
| **Maps JavaScript API** | Interactive map, markers, controls | [Enable](https://console.cloud.google.com/apis/library/maps-backend.googleapis.com) |
|
|
83
|
+
| **Places API (New)** | Search locations by name | [Enable](https://console.cloud.google.com/apis/library/places-backend.googleapis.com) |
|
|
84
|
+
| **Directions API** | Route calculation between points | [Enable](https://console.cloud.google.com/apis/library/directions-backend.googleapis.com) |
|
|
85
|
+
| **Geocoding API** | Convert addresses to coordinates | [Enable](https://console.cloud.google.com/apis/library/geocoding-backend.googleapis.com) |
|
|
86
|
+
|
|
87
|
+
> **Note**: You can use either "Places API" (legacy) or "Places API (New)".
|
|
88
|
+
|
|
89
|
+
> **Troubleshooting**: If the map doesn't work, check [APIs & Services > Enabled APIs](https://console.cloud.google.com/apis/dashboard) to verify all 4 APIs are enabled. Also check if any API has quota limits or restrictions in its settings.
|
|
82
90
|
|
|
83
91
|
### Step 3: Create an API Key
|
|
84
92
|
|
|
@@ -87,7 +95,7 @@ This plugin requires a Google Maps API key with the **Maps Embed API** enabled.
|
|
|
87
95
|
3. Copy the generated API key
|
|
88
96
|
4. (Recommended) Click **Edit API key** to add restrictions:
|
|
89
97
|
- **Application restrictions**: HTTP referrers (for web apps)
|
|
90
|
-
- **API restrictions**: Restrict to
|
|
98
|
+
- **API restrictions**: Restrict to the 4 APIs above
|
|
91
99
|
|
|
92
100
|
### Step 4: Configure the Plugin
|
|
93
101
|
|
package/dist/core/types.d.ts
CHANGED
package/dist/core/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,SAAS,GACjB,cAAc,GACd,WAAW,GACX,SAAS,GACT,WAAW,GACX,cAAc,GACd,YAAY,GACZ,eAAe,CAAC;AAGpB,MAAM,MAAM,SAAS,GACjB,YAAY,GACZ,SAAS,GACT,gBAAgB,GAChB,UAAU,GACV,aAAa,GACb,KAAK,GACL,QAAQ,GACR,MAAM,GACN,KAAK,GACL,cAAc,GACd,eAAe,GACf,YAAY,GACZ,eAAe,GACf,aAAa,GACb,MAAM,GACN,YAAY,GACZ,YAAY,GACZ,YAAY,GACZ,YAAY,GACZ,UAAU,GACV,QAAQ,GACR,UAAU,GACV,QAAQ,GACR,WAAW,GACX,gBAAgB,GAChB,mBAAmB,GACnB,YAAY,GACZ,SAAS,GACT,kBAAkB,GAClB,QAAQ,GACR,WAAW,GACX,aAAa,GACb,mBAAmB,GACnB,SAAS,GACT,cAAc,GACd,SAAS,GACT,cAAc,GACd,iBAAiB,GACjB,aAAa,GACb,KAAK,GACL,WAAW,GACX,gBAAgB,GAChB,cAAc,GACd,kBAAkB,GAClB,UAAU,GACV,kBAAkB,GAClB,eAAe,GACf,SAAS,GACT,QAAQ,GACR,SAAS,GACT,oBAAoB,GACpB,cAAc,GACd,yBAAyB,GACzB,WAAW,GACX,SAAS,GACT,eAAe,GACf,eAAe,GACf,QAAQ,GACR,cAAc,GACd,eAAe,GACf,gBAAgB,GAChB,QAAQ,GACR,YAAY,GACZ,SAAS,GACT,MAAM,GACN,SAAS,GACT,WAAW,GACX,UAAU,GACV,iBAAiB,GACjB,SAAS,GACT,QAAQ,GACR,aAAa,GACb,gBAAgB,GAChB,oBAAoB,GACpB,YAAY,GACZ,oBAAoB,GACpB,SAAS,GACT,QAAQ,GACR,kBAAkB,GAClB,YAAY,GACZ,eAAe,GACf,KAAK,GACL,SAAS,GACT,SAAS,GACT,OAAO,GACP,gBAAgB,GAChB,aAAa,GACb,WAAW,GACX,YAAY,GACZ,oBAAoB,GACpB,eAAe,GACf,iBAAiB,GACjB,eAAe,GACf,YAAY,GACZ,iBAAiB,GACjB,KAAK,CAAC;AAGV,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,CAAC;AAGzE,MAAM,WAAW,MAAM;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb;AAGD,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAGD,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAGD,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,SAAS,GACjB,cAAc,GACd,WAAW,GACX,SAAS,GACT,WAAW,GACX,cAAc,GACd,YAAY,GACZ,eAAe,CAAC;AAGpB,MAAM,MAAM,SAAS,GACjB,YAAY,GACZ,SAAS,GACT,gBAAgB,GAChB,UAAU,GACV,aAAa,GACb,KAAK,GACL,QAAQ,GACR,MAAM,GACN,KAAK,GACL,cAAc,GACd,eAAe,GACf,YAAY,GACZ,eAAe,GACf,aAAa,GACb,MAAM,GACN,YAAY,GACZ,YAAY,GACZ,YAAY,GACZ,YAAY,GACZ,UAAU,GACV,QAAQ,GACR,UAAU,GACV,QAAQ,GACR,WAAW,GACX,gBAAgB,GAChB,mBAAmB,GACnB,YAAY,GACZ,SAAS,GACT,kBAAkB,GAClB,QAAQ,GACR,WAAW,GACX,aAAa,GACb,mBAAmB,GACnB,SAAS,GACT,cAAc,GACd,SAAS,GACT,cAAc,GACd,iBAAiB,GACjB,aAAa,GACb,KAAK,GACL,WAAW,GACX,gBAAgB,GAChB,cAAc,GACd,kBAAkB,GAClB,UAAU,GACV,kBAAkB,GAClB,eAAe,GACf,SAAS,GACT,QAAQ,GACR,SAAS,GACT,oBAAoB,GACpB,cAAc,GACd,yBAAyB,GACzB,WAAW,GACX,SAAS,GACT,eAAe,GACf,eAAe,GACf,QAAQ,GACR,cAAc,GACd,eAAe,GACf,gBAAgB,GAChB,QAAQ,GACR,YAAY,GACZ,SAAS,GACT,MAAM,GACN,SAAS,GACT,WAAW,GACX,UAAU,GACV,iBAAiB,GACjB,SAAS,GACT,QAAQ,GACR,aAAa,GACb,gBAAgB,GAChB,oBAAoB,GACpB,YAAY,GACZ,oBAAoB,GACpB,SAAS,GACT,QAAQ,GACR,kBAAkB,GAClB,YAAY,GACZ,eAAe,GACf,KAAK,GACL,SAAS,GACT,SAAS,GACT,OAAO,GACP,gBAAgB,GAChB,aAAa,GACb,WAAW,GACX,YAAY,GACZ,oBAAoB,GACpB,eAAe,GACf,iBAAiB,GACjB,eAAe,GACf,YAAY,GACZ,iBAAiB,GACjB,KAAK,CAAC;AAGV,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,CAAC;AAGzE,MAAM,WAAW,MAAM;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb;AAGD,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAGD,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAGD,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAGD,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAGD,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,SAAS,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB;AAGD,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,SAAS,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC;IACvB,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC;IACvB,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAGD,MAAM,WAAW,OAAO;IACtB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-space-y-reverse:0;--tw-border-style:solid;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-100:oklch(93.6% .032 17.717);--color-red-300:oklch(80.8% .114 19.571);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-orange-50:oklch(98% .016 73.684);--color-orange-600:oklch(64.6% .222 41.116);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-600:oklch(66.6% .179 58.318);--color-yellow-50:oklch(98.7% .026 102.212);--color-yellow-500:oklch(79.5% .184 86.047);--color-yellow-700:oklch(55.4% .135 66.442);--color-green-50:oklch(98.2% .018 155.826);--color-green-600:oklch(62.7% .194 149.214);--color-emerald-50:oklch(97.9% .021 166.113);--color-emerald-100:oklch(95% .052 163.051);--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-800:oklch(43.2% .095 166.913);--color-blue-50:oklch(97% .014 254.604);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-indigo-100:oklch(93% .034 272.788);--color-indigo-200:oklch(87% .065 274.039);--color-indigo-300:oklch(78.5% .115 274.713);--color-indigo-500:oklch(58.5% .233 277.117);--color-indigo-600:oklch(51.1% .262 276.966);--color-indigo-700:oklch(45.7% .24 277.023);--color-purple-50:oklch(97.7% .014 308.299);--color-purple-600:oklch(55.8% .288 302.321);--color-slate-900:oklch(20.8% .042 265.755);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-white:#fff;--spacing:.25rem;--container-3xl:48rem;--container-6xl:72rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--radius-md:.375rem;--radius-lg:.5rem;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.absolute{position:absolute}.relative{position:relative}.inset-0{inset:calc(var(--spacing)*0)}.top-4{top:calc(var(--spacing)*4)}.right-4{right:calc(var(--spacing)*4)}.bottom-4{bottom:calc(var(--spacing)*4)}.left-4{left:calc(var(--spacing)*4)}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.m-0{margin:calc(var(--spacing)*0)}.mx-auto{margin-inline:auto}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mr-1{margin-right:calc(var(--spacing)*1)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-5{margin-bottom:calc(var(--spacing)*5)}.mb-8{margin-bottom:calc(var(--spacing)*8)}.ml-auto{margin-left:auto}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.inline-block{display:inline-block}.h-4{height:calc(var(--spacing)*4)}.h-8{height:calc(var(--spacing)*8)}.h-96{height:calc(var(--spacing)*96)}.h-\[600px\]{height:600px}.h-full{height:100%}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-screen{min-height:100vh}.w-4{width:calc(var(--spacing)*4)}.w-8{width:calc(var(--spacing)*8)}.w-24{width:calc(var(--spacing)*24)}.w-80{width:calc(var(--spacing)*80)}.w-\[100px\]{width:100px}.w-full{width:100%}.max-w-3xl{max-width:var(--container-3xl)}.max-w-6xl{max-width:var(--container-6xl)}.max-w-\[85\%\]{max-width:85%}.max-w-\[200px\]{max-width:200px}.flex-1{flex:1}.animate-pulse{animation:var(--animate-pulse)}.cursor-pointer{cursor:pointer}.resize-y{resize:vertical}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-1{gap:calc(var(--spacing)*1)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-none{--tw-border-style:none;border-style:none}.border-emerald-200{border-color:var(--color-emerald-200)}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.border-indigo-200{border-color:var(--color-indigo-200)}.border-red-300{border-color:var(--color-red-300)}.bg-\[\#1a1a2e\]{background-color:#1a1a2e}.bg-amber-50{background-color:var(--color-amber-50)}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-600{background-color:var(--color-blue-600)}.bg-emerald-50{background-color:var(--color-emerald-50)}.bg-emerald-100{background-color:var(--color-emerald-100)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-200{background-color:var(--color-gray-200)}.bg-green-50{background-color:var(--color-green-50)}.bg-indigo-100{background-color:var(--color-indigo-100)}.bg-indigo-600{background-color:var(--color-indigo-600)}.bg-orange-50{background-color:var(--color-orange-50)}.bg-purple-50{background-color:var(--color-purple-50)}.bg-red-100{background-color:var(--color-red-100)}.bg-slate-900{background-color:var(--color-slate-900)}.bg-white{background-color:var(--color-white)}.bg-yellow-50{background-color:var(--color-yellow-50)}.p-2{padding:calc(var(--spacing)*2)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-5{padding:calc(var(--spacing)*5)}.p-8{padding:calc(var(--spacing)*8)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-1\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.whitespace-pre-wrap{white-space:pre-wrap}.text-amber-600{color:var(--color-amber-600)}.text-blue-600{color:var(--color-blue-600)}.text-emerald-800{color:var(--color-emerald-800)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-800{color:var(--color-gray-800)}.text-green-600{color:var(--color-green-600)}.text-indigo-600{color:var(--color-indigo-600)}.text-indigo-700{color:var(--color-indigo-700)}.text-orange-600{color:var(--color-orange-600)}.text-purple-600{color:var(--color-purple-600)}.text-red-600{color:var(--color-red-600)}.text-red-700{color:var(--color-red-700)}.text-white{color:var(--color-white)}.text-yellow-500{color:var(--color-yellow-500)}.text-yellow-700{color:var(--color-yellow-700)}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}@media(hover:hover){.hover\:border-indigo-300:hover{border-color:var(--color-indigo-300)}.hover\:bg-blue-700:hover{background-color:var(--color-blue-700)}.hover\:bg-gray-50:hover{background-color:var(--color-gray-50)}.hover\:bg-gray-100:hover{background-color:var(--color-gray-100)}.hover\:bg-gray-300:hover{background-color:var(--color-gray-300)}.hover\:bg-indigo-200:hover{background-color:var(--color-indigo-200)}.hover\:bg-indigo-700:hover{background-color:var(--color-indigo-700)}}.focus\:border-indigo-500:focus{border-color:var(--color-indigo-500)}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-\[3px\]:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-indigo-500:focus{--tw-ring-color:var(--color-indigo-500)}.focus\:ring-indigo-500\/10:focus{--tw-ring-color:#625fff1a}@supports (color:color-mix(in lab,red,red)){.focus\:ring-indigo-500\/10:focus{--tw-ring-color:color-mix(in oklab,var(--color-indigo-500)10%,transparent)}}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:bg-gray-100:disabled{background-color:var(--color-gray-100)}.disabled\:bg-gray-400:disabled{background-color:var(--color-gray-400)}@media(min-width:64rem){.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@keyframes pulse{50%{opacity:.5}}
|
|
1
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-space-y-reverse:0;--tw-border-style:solid;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-100:oklch(93.6% .032 17.717);--color-red-300:oklch(80.8% .114 19.571);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-orange-50:oklch(98% .016 73.684);--color-orange-600:oklch(64.6% .222 41.116);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-600:oklch(66.6% .179 58.318);--color-yellow-50:oklch(98.7% .026 102.212);--color-yellow-500:oklch(79.5% .184 86.047);--color-yellow-700:oklch(55.4% .135 66.442);--color-green-50:oklch(98.2% .018 155.826);--color-green-600:oklch(62.7% .194 149.214);--color-emerald-50:oklch(97.9% .021 166.113);--color-emerald-100:oklch(95% .052 163.051);--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-800:oklch(43.2% .095 166.913);--color-blue-50:oklch(97% .014 254.604);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-indigo-100:oklch(93% .034 272.788);--color-indigo-200:oklch(87% .065 274.039);--color-indigo-300:oklch(78.5% .115 274.713);--color-indigo-500:oklch(58.5% .233 277.117);--color-indigo-600:oklch(51.1% .262 276.966);--color-indigo-700:oklch(45.7% .24 277.023);--color-purple-50:oklch(97.7% .014 308.299);--color-purple-600:oklch(55.8% .288 302.321);--color-slate-900:oklch(20.8% .042 265.755);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-white:#fff;--spacing:.25rem;--container-3xl:48rem;--container-6xl:72rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--radius-md:.375rem;--radius-lg:.5rem;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.absolute{position:absolute}.relative{position:relative}.inset-0{inset:calc(var(--spacing)*0)}.top-4{top:calc(var(--spacing)*4)}.right-4{right:calc(var(--spacing)*4)}.bottom-4{bottom:calc(var(--spacing)*4)}.left-4{left:calc(var(--spacing)*4)}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.m-0{margin:calc(var(--spacing)*0)}.mx-auto{margin-inline:auto}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mr-1{margin-right:calc(var(--spacing)*1)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-5{margin-bottom:calc(var(--spacing)*5)}.mb-8{margin-bottom:calc(var(--spacing)*8)}.ml-auto{margin-left:auto}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.inline-block{display:inline-block}.h-4{height:calc(var(--spacing)*4)}.h-8{height:calc(var(--spacing)*8)}.h-96{height:calc(var(--spacing)*96)}.h-\[600px\]{height:600px}.h-full{height:100%}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-screen{min-height:100vh}.w-4{width:calc(var(--spacing)*4)}.w-8{width:calc(var(--spacing)*8)}.w-24{width:calc(var(--spacing)*24)}.w-80{width:calc(var(--spacing)*80)}.w-\[100px\]{width:100px}.w-full{width:100%}.max-w-3xl{max-width:var(--container-3xl)}.max-w-6xl{max-width:var(--container-6xl)}.max-w-\[85\%\]{max-width:85%}.max-w-\[200px\]{max-width:200px}.flex-1{flex:1}.animate-pulse{animation:var(--animate-pulse)}.cursor-pointer{cursor:pointer}.resize-y{resize:vertical}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-1{gap:calc(var(--spacing)*1)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-none{--tw-border-style:none;border-style:none}.border-emerald-200{border-color:var(--color-emerald-200)}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.border-indigo-200{border-color:var(--color-indigo-200)}.border-red-300{border-color:var(--color-red-300)}.bg-\[\#1a1a2e\]{background-color:#1a1a2e}.bg-amber-50{background-color:var(--color-amber-50)}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-600{background-color:var(--color-blue-600)}.bg-emerald-50{background-color:var(--color-emerald-50)}.bg-emerald-100{background-color:var(--color-emerald-100)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-200{background-color:var(--color-gray-200)}.bg-green-50{background-color:var(--color-green-50)}.bg-indigo-100{background-color:var(--color-indigo-100)}.bg-indigo-600{background-color:var(--color-indigo-600)}.bg-orange-50{background-color:var(--color-orange-50)}.bg-purple-50{background-color:var(--color-purple-50)}.bg-red-100{background-color:var(--color-red-100)}.bg-slate-900{background-color:var(--color-slate-900)}.bg-white{background-color:var(--color-white)}.bg-yellow-50{background-color:var(--color-yellow-50)}.p-2{padding:calc(var(--spacing)*2)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-5{padding:calc(var(--spacing)*5)}.p-8{padding:calc(var(--spacing)*8)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-1\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.whitespace-pre-wrap{white-space:pre-wrap}.text-amber-600{color:var(--color-amber-600)}.text-blue-600{color:var(--color-blue-600)}.text-emerald-800{color:var(--color-emerald-800)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-800{color:var(--color-gray-800)}.text-green-600{color:var(--color-green-600)}.text-indigo-600{color:var(--color-indigo-600)}.text-indigo-700{color:var(--color-indigo-700)}.text-orange-600{color:var(--color-orange-600)}.text-purple-600{color:var(--color-purple-600)}.text-red-600{color:var(--color-red-600)}.text-red-700{color:var(--color-red-700)}.text-white{color:var(--color-white)}.text-yellow-500{color:var(--color-yellow-500)}.text-yellow-700{color:var(--color-yellow-700)}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}@media(hover:hover){.hover\:border-indigo-300:hover{border-color:var(--color-indigo-300)}.hover\:bg-blue-50:hover{background-color:var(--color-blue-50)}.hover\:bg-blue-700:hover{background-color:var(--color-blue-700)}.hover\:bg-gray-50:hover{background-color:var(--color-gray-50)}.hover\:bg-gray-100:hover{background-color:var(--color-gray-100)}.hover\:bg-gray-300:hover{background-color:var(--color-gray-300)}.hover\:bg-indigo-200:hover{background-color:var(--color-indigo-200)}.hover\:bg-indigo-700:hover{background-color:var(--color-indigo-700)}}.focus\:border-indigo-500:focus{border-color:var(--color-indigo-500)}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-\[3px\]:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-indigo-500:focus{--tw-ring-color:var(--color-indigo-500)}.focus\:ring-indigo-500\/10:focus{--tw-ring-color:#625fff1a}@supports (color:color-mix(in lab,red,red)){.focus\:ring-indigo-500\/10:focus{--tw-ring-color:color-mix(in oklab,var(--color-indigo-500)10%,transparent)}}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:bg-gray-100:disabled{background-color:var(--color-gray-100)}.disabled\:bg-gray-400:disabled{background-color:var(--color-gray-400)}@media(min-width:64rem){.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@keyframes pulse{50%{opacity:.5}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"View.vue.d.ts","sourceRoot":"","sources":["../../src/vue/View.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"View.vue.d.ts","sourceRoot":"","sources":["../../src/vue/View.vue"],"names":[],"mappings":"AAovBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EACV,WAAW,EACX,WAAW,EAMZ,MAAM,eAAe,CAAC;AAEvB,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,UAAU,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC;IAC/C,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,WAAW,KAAK,IAAI,CAAC;CAClD,CAAC;AAq9BF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
package/dist/vue.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const y=require("./core.cjs"),e=require("vue"),W={class:"w-full h-full bg-white flex flex-col relative"},J={class:"p-4 border-b border-gray-200"},X={class:"text-xl font-bold text-gray-800"},Y={key:0,class:"text-gray-600 text-sm"},ee={class:"flex-1 min-h-0 flex"},te={class:"flex-1 relative"},oe={key:1,class:"w-full h-full flex items-center justify-center bg-gray-100"},re={class:"text-center p-8"},ne=["href"],ae={key:2,class:"absolute inset-0 bg-white bg-opacity-75 flex items-center justify-center"},se={key:3,class:"absolute bottom-4 left-4 right-4 bg-red-100 border border-red-300 text-red-700 px-4 py-3 rounded"},le={key:4,class:"absolute top-4 right-4 flex flex-col gap-1"},ce={key:0,class:"w-80 border-l border-gray-200 overflow-y-auto"},ie={key:0,class:"p-4"},ue={class:"space-y-3"},de=["onClick"],me={class:"font-medium text-gray-800"},ge={class:"text-sm text-gray-600 mt-1"},pe={key:0,class:"flex items-center mt-1"},ve={class:"text-sm text-gray-600"},fe={key:0,class:"text-gray-400"},ye={key:1,class:"p-4"},ke={class:"bg-blue-50 rounded-lg p-3 mb-4"},he={class:"text-lg font-medium text-gray-800"},we={class:"text-gray-600"},be={class:"text-sm text-gray-600 mb-3"},xe={class:"space-y-2"},_e=["innerHTML"],Ee={class:"text-gray-500 mt-1"},Z=e.defineComponent({__name:"View",props:{selectedResult:{},googleMapKey:{},onUpdateResult:{type:Function}},setup(w){const c=w,k=e.ref(null),a=e.ref(null),v=e.ref(new Map),b=e.ref(null),x=e.ref(null),n=e.ref(null),g=e.ref(null),_=e.ref(!1),E=e.ref(null),h=e.ref([]),m=e.ref(null),C=e.ref(null),M=e.ref(15),z=e.computed(()=>{const t=c.selectedResult?.data?.action;return{showLocation:"Map Location",setCenter:"Map View",setZoom:"Map View",addMarker:"Map Marker",clearMarkers:"Map",findPlaces:"Place Search",getDirections:"Directions"}[t||"showLocation"]||"Map"}),B=e.computed(()=>{const t=c.selectedResult?.data;if(!t)return"";switch(t.action){case"showLocation":case"setCenter":case"addMarker":return S(t.location);case"setZoom":return`Zoom level: ${t.zoom}`;case"findPlaces":return t.searchQuery||t.placeType||"";case"getDirections":return`${t.origin} → ${t.destination}`;default:return""}}),A=e.computed(()=>h.value.length>0||m.value!==null),D=e.computed(()=>{const t=c.selectedResult?.data;if(!t?.location)return"";const o=S(t.location);return`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(o)}`}),S=t=>t?typeof t=="string"?t:`${t.lat}, ${t.lng}`:"",F=()=>{const t=[];return v.value.forEach((o,r)=>{const s=o.getPosition();s&&t.push({id:r,position:{lat:s.lat(),lng:s.lng()},title:o.getTitle()||void 0,label:typeof o.getLabel()=="string"?o.getLabel():o.getLabel()?.text})}),t},p=(t,o,r)=>{if(!c.onUpdateResult)return;const i={action:c.selectedResult?.data?.action||"showLocation",success:t,center:C.value||void 0,zoom:M.value,markers:F(),...r};o&&(i.error=o),c.onUpdateResult(i)},q=()=>new Promise((t,o)=>{if(typeof google<"u"&&google.maps){t();return}const r=document.querySelector('script[src*="maps.googleapis.com"]');if(r){r.addEventListener("load",()=>t()),r.addEventListener("error",()=>o(new Error("Failed to load Google Maps")));return}const s=document.createElement("script");s.src=`https://maps.googleapis.com/maps/api/js?key=${c.googleMapKey}&libraries=places`,s.async=!0,s.defer=!0,s.onload=()=>t(),s.onerror=()=>o(new Error("Failed to load Google Maps")),document.head.appendChild(s)}),K=async()=>{if(!(!k.value||!c.googleMapKey))try{await q();const t={lat:35.6812,lng:139.7671};a.value=new google.maps.Map(k.value,{center:t,zoom:M.value,mapTypeControl:!0,streetViewControl:!0,fullscreenControl:!0}),g.value=new google.maps.Geocoder,b.value=new google.maps.places.PlacesService(a.value),x.value=new google.maps.DirectionsService,n.value=new google.maps.DirectionsRenderer,n.value.setMap(a.value),a.value.addListener("center_changed",()=>{const o=a.value?.getCenter();o&&(C.value={lat:o.lat(),lng:o.lng()})}),a.value.addListener("zoom_changed",()=>{M.value=a.value?.getZoom()||15}),c.selectedResult?.data&&await O(c.selectedResult.data)}catch(t){E.value=t instanceof Error?t.message:"Failed to initialize map"}},P=async t=>typeof t!="string"?t:g.value?new Promise(o=>{g.value.geocode({address:t},(r,s)=>{if(s==="OK"&&r&&r[0]){const i=r[0].geometry.location;o({lat:i.lat(),lng:i.lng()})}else o(null)})}):null,V=(t,o,r,s)=>{const i=new google.maps.Marker({position:t,map:a.value,title:r,label:s?{text:s,color:"white"}:void 0,animation:google.maps.Animation.DROP});return v.value.set(o,i),i},R=()=>{v.value.forEach(t=>{t.setMap(null)}),v.value.clear()},O=async t=>{if(a.value){_.value=!0,E.value=null;try{switch(t.action){case"showLocation":case"setCenter":{if(!t.location)throw new Error("Location is required");const o=await P(t.location);if(!o)throw new Error("Could not find location");if(a.value.setCenter(o),C.value=o,t.action==="showLocation"){const r=`location_${Date.now()}`;V(o,r,typeof t.location=="string"?t.location:void 0)}p(!0);break}case"setZoom":{const o=t.zoom||15;a.value.setZoom(o),M.value=o,p(!0);break}case"addMarker":{if(!t.location)throw new Error("Location is required for marker");const o=await P(t.location);if(!o)throw new Error("Could not find location for marker");const r=t.marker?.id||`marker_${Date.now()}`;V(o,r,t.marker?.title,t.marker?.label),p(!0);break}case"clearMarkers":{R(),n.value?.setDirections({routes:[],request:{}}),h.value=[],m.value=null,p(!0);break}case"findPlaces":{await G(t.searchQuery,t.placeType);break}case"getDirections":{if(!t.origin||!t.destination)throw new Error("Origin and destination are required");await j(t.origin,t.destination,t.travelMode||"DRIVING");break}}}catch(o){const r=o instanceof Error?o.message:"An error occurred";E.value=r,p(!1,r)}finally{_.value=!1}}},G=async(t,o)=>{if(!b.value||!a.value)return;const r=a.value.getCenter();if(!r)return;const s={location:r,radius:5e3,query:t||o||""};return o&&!t&&(s.type=o),new Promise(i=>{b.value.textSearch(s,(f,L)=>{if(L===google.maps.places.PlacesServiceStatus.OK&&f){v.value.forEach((l,d)=>{d.startsWith("place_")&&(l.setMap(null),v.value.delete(d))});const u=f.slice(0,10).map((l,d)=>{const N=l.geometry?.location,T=N?{lat:N.lat(),lng:N.lng()}:{lat:0,lng:0};return N&&V(T,`place_${l.place_id}`,l.name,String(d+1)),{placeId:l.place_id||"",name:l.name||"",address:l.formatted_address||"",location:T,rating:l.rating,userRatingsTotal:l.user_ratings_total,types:l.types,openNow:l.opening_hours?.isOpen?.()}});if(h.value=u,m.value=null,u.length>0){const l=new google.maps.LatLngBounds;u.forEach(d=>{l.extend(d.location)}),a.value?.fitBounds(l)}p(!0,void 0,{places:u})}else p(!1,"No places found");i()})})},j=async(t,o,r)=>{if(!x.value||!n.value)return;const s={origin:t,destination:o,travelMode:r};return new Promise(i=>{x.value.route(s,(f,L)=>{if(L===google.maps.DirectionsStatus.OK&&f){n.value.setDirections(f);const u=f.routes[0]?.legs[0];if(u){const l={summary:f.routes[0].summary||"",distance:u.distance?.text||"",duration:u.duration?.text||"",startAddress:u.start_address||"",endAddress:u.end_address||"",steps:u.steps?.map(d=>({instruction:d.instructions||"",distance:d.distance?.text||"",duration:d.duration?.text||"",travelMode:d.travel_mode||""}))||[],polyline:f.routes[0].overview_polyline||""};m.value=l,h.value=[],p(!0,void 0,{route:l})}}else p(!1,"Could not find directions");i()})})},U=t=>{a.value&&(a.value.setCenter(t.location),a.value.setZoom(17))},Q=()=>{if(!a.value)return;const t=a.value.getZoom()||15;t<21&&a.value.setZoom(t+1)},H=()=>{if(!a.value)return;const t=a.value.getZoom()||15;t>1&&a.value.setZoom(t-1)};return e.watch(()=>c.selectedResult?.data,async t=>{t&&a.value&&await O(t)}),e.onMounted(()=>{c.googleMapKey&&K()}),e.onUnmounted(()=>{R()}),(t,o)=>(e.openBlock(),e.createElementBlock("div",W,[e.createElementVNode("div",J,[e.createElementVNode("h2",X,e.toDisplayString(z.value),1),B.value?(e.openBlock(),e.createElementBlock("p",Y,e.toDisplayString(B.value),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",ee,[e.createElementVNode("div",te,[w.googleMapKey?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"mapContainer",ref:k,class:"w-full h-full"},null,512)):(e.openBlock(),e.createElementBlock("div",oe,[e.createElementVNode("div",re,[o[0]||(o[0]=e.createElementVNode("div",{class:"text-gray-500 mb-4"},"Google Maps API key not configured",-1)),D.value?(e.openBlock(),e.createElementBlock("a",{key:0,href:D.value,target:"_blank",class:"inline-block px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors"}," Open in Google Maps ",8,ne)):e.createCommentVNode("",!0)])])),_.value?(e.openBlock(),e.createElementBlock("div",ae,[...o[1]||(o[1]=[e.createElementVNode("div",{class:"text-gray-600"},"Loading...",-1)])])):e.createCommentVNode("",!0),E.value?(e.openBlock(),e.createElementBlock("div",se,e.toDisplayString(E.value),1)):e.createCommentVNode("",!0),w.googleMapKey&&a.value?(e.openBlock(),e.createElementBlock("div",le,[e.createElementVNode("button",{onClick:Q,class:"w-8 h-8 bg-white border border-gray-300 rounded shadow text-lg font-bold text-gray-700 hover:bg-gray-100 flex items-center justify-center",title:"Zoom in"}," + "),e.createElementVNode("button",{onClick:H,class:"w-8 h-8 bg-white border border-gray-300 rounded shadow text-lg font-bold text-gray-700 hover:bg-gray-100 flex items-center justify-center",title:"Zoom out"}," − ")])):e.createCommentVNode("",!0)]),A.value?(e.openBlock(),e.createElementBlock("div",ce,[h.value.length>0?(e.openBlock(),e.createElementBlock("div",ie,[o[3]||(o[3]=e.createElementVNode("h3",{class:"font-semibold text-gray-800 mb-3"},"Search Results",-1)),e.createElementVNode("div",ue,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,r=>(e.openBlock(),e.createElementBlock("div",{key:r.placeId,class:"p-3 bg-gray-50 rounded-lg cursor-pointer hover:bg-gray-100 transition-colors",onClick:s=>U(r)},[e.createElementVNode("div",me,e.toDisplayString(r.name),1),e.createElementVNode("div",ge,e.toDisplayString(r.address),1),r.rating?(e.openBlock(),e.createElementBlock("div",pe,[o[2]||(o[2]=e.createElementVNode("span",{class:"text-yellow-500 mr-1"},"★",-1)),e.createElementVNode("span",ve,[e.createTextVNode(e.toDisplayString(r.rating.toFixed(1))+" ",1),r.userRatingsTotal?(e.openBlock(),e.createElementBlock("span",fe," ("+e.toDisplayString(r.userRatingsTotal)+") ",1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),r.openNow!==void 0?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass([r.openNow?"text-green-600":"text-red-600","text-sm mt-1"])},e.toDisplayString(r.openNow?"Open now":"Closed"),3)):e.createCommentVNode("",!0)],8,de))),128))])])):e.createCommentVNode("",!0),m.value?(e.openBlock(),e.createElementBlock("div",ye,[o[6]||(o[6]=e.createElementVNode("h3",{class:"font-semibold text-gray-800 mb-3"},"Directions",-1)),e.createElementVNode("div",ke,[e.createElementVNode("div",he,e.toDisplayString(m.value.distance),1),e.createElementVNode("div",we,e.toDisplayString(m.value.duration),1)]),e.createElementVNode("div",be,[e.createElementVNode("div",null,[o[4]||(o[4]=e.createElementVNode("strong",null,"From:",-1)),e.createTextVNode(" "+e.toDisplayString(m.value.startAddress),1)]),e.createElementVNode("div",null,[o[5]||(o[5]=e.createElementVNode("strong",null,"To:",-1)),e.createTextVNode(" "+e.toDisplayString(m.value.endAddress),1)])]),e.createElementVNode("div",xe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value.steps,(r,s)=>(e.openBlock(),e.createElementBlock("div",{key:s,class:"p-2 bg-gray-50 rounded text-sm"},[e.createElementVNode("div",{innerHTML:r.instruction,class:"text-gray-800"},null,8,_e),e.createElementVNode("div",Ee,e.toDisplayString(r.distance)+" · "+e.toDisplayString(r.duration),1)]))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])]))}}),Me={class:"text-xs text-gray-600 mt-1 truncate"},$=e.defineComponent({__name:"Preview",props:{result:{}},setup(w){const c=w,k=n=>n?typeof n=="string"?n:`${n.lat.toFixed(4)}, ${n.lng.toFixed(4)}`:"",a=e.computed(()=>{const n=c.result.data?.action;return{showLocation:"Map Location",setCenter:"Center Map",setZoom:"Zoom",addMarker:"Add Marker",clearMarkers:"Clear Markers",findPlaces:"Place Search",getDirections:"Directions"}[n||"showLocation"]||"Map"}),v=e.computed(()=>{const n=c.result.data;if(!n)return"";switch(n.action){case"showLocation":case"setCenter":case"addMarker":return k(n.location);case"setZoom":return`Level ${n.zoom}`;case"clearMarkers":return"All markers cleared";case"findPlaces":return n.searchQuery||n.placeType||"Search";case"getDirections":{const g=typeof n.origin=="string"?n.origin:"Start",_=typeof n.destination=="string"?n.destination:"End";return`${g} → ${_}`}default:return k(n.location)}}),b=e.computed(()=>{const n=c.result.data?.action;return{showLocation:"bg-blue-50",setCenter:"bg-blue-50",setZoom:"bg-purple-50",addMarker:"bg-green-50",clearMarkers:"bg-gray-50",findPlaces:"bg-yellow-50",getDirections:"bg-orange-50"}[n||"showLocation"]||"bg-blue-50"}),x=e.computed(()=>{const n=c.result.data?.action;return{showLocation:"text-blue-600",setCenter:"text-blue-600",setZoom:"text-purple-600",addMarker:"text-green-600",clearMarkers:"text-gray-600",findPlaces:"text-yellow-700",getDirections:"text-orange-600"}[n||"showLocation"]||"text-blue-600"});return(n,g)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["text-center p-4 rounded",b.value])},[e.createElementVNode("div",{class:e.normalizeClass(["font-medium",x.value])},e.toDisplayString(a.value),3),e.createElementVNode("div",Me,e.toDisplayString(v.value),1)],2))}}),I={...y.pluginCore,viewComponent:Z,previewComponent:$,samples:y.samples},Ne={plugin:I};exports.TOOL_DEFINITION=y.TOOL_DEFINITION;exports.TOOL_NAME=y.TOOL_NAME;exports.executeMap=y.executeMap;exports.pluginCore=y.pluginCore;exports.samples=y.samples;exports.Preview=$;exports.View=Z;exports.default=Ne;exports.plugin=I;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const h=require("./core.cjs"),e=require("vue"),Y={class:"w-full h-full bg-white flex flex-col relative"},ee={class:"p-4 border-b border-gray-200"},te={class:"text-xl font-bold text-gray-800"},oe={key:0,class:"text-gray-600 text-sm"},ne={class:"flex-1 min-h-0 flex"},re={class:"flex-1 relative"},ae={key:1,class:"w-full h-full flex items-center justify-center bg-gray-100"},se={class:"text-center p-8"},le=["href"],ce={key:2,class:"absolute inset-0 bg-white bg-opacity-75 flex items-center justify-center"},ie={key:3,class:"absolute bottom-4 left-4 right-4 bg-red-100 border border-red-300 text-red-700 px-4 py-3 rounded"},de={key:4,class:"absolute top-4 right-4 flex flex-col gap-1"},ue={key:0,class:"w-80 border-l border-gray-200 overflow-y-auto"},me={key:0,class:"p-4"},ge={class:"space-y-3"},pe=["onClick"],fe={class:"font-medium text-gray-800"},ve={class:"text-sm text-gray-600 mt-1"},ye={key:0,class:"flex items-center mt-1"},ke={class:"text-sm text-gray-600"},he={key:0,class:"text-gray-400"},we={key:1,class:"p-4"},be={class:"bg-blue-50 rounded-lg p-3 mb-4"},xe={class:"text-lg font-medium text-gray-800"},_e={class:"text-gray-600"},Ee={class:"text-sm text-gray-600 mb-3"},Me={class:"space-y-2"},Ne=["onClick"],Ce={class:"text-gray-800"},Ve={class:"text-gray-500 mt-1"},Z=e.defineComponent({__name:"View",props:{selectedResult:{},googleMapKey:{},onUpdateResult:{type:Function}},setup(x){const d=x,w=e.ref(null),r=e.ref(null),f=e.ref(new Map),_=e.ref(null),k=e.ref(null),a=e.ref(null);let y,E;const C=e.ref(!1),M=e.ref(null),b=e.ref([]),g=e.ref(null),V=e.ref(null),N=e.ref(15),z=e.computed(()=>{const t=d.selectedResult?.data?.action;return{showLocation:"Map Location",setCenter:"Map View",setZoom:"Map View",addMarker:"Map Marker",clearMarkers:"Map",findPlaces:"Place Search",getDirections:"Directions"}[t||"showLocation"]||"Map"}),D=e.computed(()=>{const t=d.selectedResult?.data;if(!t)return"";switch(t.action){case"showLocation":case"setCenter":case"addMarker":return S(t.location);case"setZoom":return`Zoom level: ${t.zoom}`;case"findPlaces":return t.searchQuery||t.placeType||"";case"getDirections":return`${t.origin} → ${t.destination}`;default:return""}}),F=e.computed(()=>b.value.length>0||g.value!==null),B=e.computed(()=>{const t=d.selectedResult?.data;if(!t?.location)return"";const o=S(t.location);return`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(o)}`}),S=t=>t?typeof t=="string"?t:`${t.lat}, ${t.lng}`:"",q=t=>new DOMParser().parseFromString(t,"text/html").body.textContent||"",K=()=>{const t=[];return f.value.forEach((o,n)=>{const s=o.position;if(s){const c=typeof s.lat=="function"?s.lat():s.lat,u=typeof s.lng=="function"?s.lng():s.lng;t.push({id:n,position:{lat:c,lng:u},title:o.title||void 0})}}),t},p=(t,o,n)=>{if(!d.onUpdateResult)return;const c={action:d.selectedResult?.data?.action||"showLocation",success:t,center:V.value||void 0,zoom:N.value,markers:K(),...n};o&&(c.error=o),d.onUpdateResult(c)},G=()=>new Promise((t,o)=>{if(typeof google<"u"&&google.maps&&typeof google.maps.importLibrary=="function"){t();return}const n=document.querySelector('script[src*="maps.googleapis.com"]'),s=1e4,c=50,u=l=>{typeof google<"u"&&google.maps&&typeof google.maps.importLibrary=="function"?t():Date.now()-l>s?o(new Error("Timeout waiting for Google Maps to load")):setTimeout(()=>u(l),c)};if(n){u(Date.now());return}const i=document.createElement("script");i.src=`https://maps.googleapis.com/maps/api/js?key=${d.googleMapKey}&loading=async`,i.async=!0,i.defer=!0,i.onload=()=>u(Date.now()),i.onerror=()=>o(new Error("Failed to load Google Maps")),document.head.appendChild(i)}),U=async()=>{if(!(!w.value||!d.googleMapKey)&&!r.value)try{await G();const t=await google.maps.importLibrary("marker"),o=await google.maps.importLibrary("places");y=t.AdvancedMarkerElement,E=o.Place;const n={lat:35.6812,lng:139.7671};r.value=new google.maps.Map(w.value,{center:n,zoom:N.value,mapTypeControl:!0,streetViewControl:!0,fullscreenControl:!0,mapId:"DEMO_MAP_ID"}),a.value=new google.maps.Geocoder,_.value=new google.maps.DirectionsService,k.value=new google.maps.DirectionsRenderer,k.value.setMap(r.value),r.value.addListener("center_changed",()=>{const s=r.value?.getCenter();s&&(V.value={lat:s.lat(),lng:s.lng()})}),r.value.addListener("zoom_changed",()=>{N.value=r.value?.getZoom()||15}),d.selectedResult?.data&&await T(d.selectedResult.data)}catch(t){M.value=t instanceof Error?t.message:"Failed to initialize map"}},R=async t=>typeof t!="string"?t:a.value?new Promise(o=>{a.value.geocode({address:t},(n,s)=>{if(s==="OK"&&n&&n[0]){const c=n[0].geometry.location;o({lat:c.lat(),lng:c.lng()})}else o(null)})}):null,L=(t,o,n,s)=>{let c;if(s){const i=document.createElement("div");i.className="marker-label",i.style.cssText="background: #4285f4; color: white; padding: 4px 8px; border-radius: 4px; font-weight: bold; font-size: 12px;",i.textContent=s,c=i}const u=new y({position:t,map:r.value,title:n,content:c});return f.value.set(o,u),u},P=()=>{f.value.forEach(t=>{t.map=null}),f.value.clear()},T=async t=>{if(r.value){C.value=!0,M.value=null;try{switch(t.action){case"showLocation":case"setCenter":{if(!t.location)throw new Error("Location is required");const o=await R(t.location);if(!o)throw new Error("Could not find location");if(r.value.setCenter(o),V.value=o,t.action==="showLocation"){const n=`location_${Date.now()}`;L(o,n,typeof t.location=="string"?t.location:void 0)}p(!0);break}case"setZoom":{const o=t.zoom||15;r.value.setZoom(o),N.value=o,p(!0);break}case"addMarker":{if(!t.location)throw new Error("Location is required for marker");const o=await R(t.location);if(!o)throw new Error("Could not find location for marker");const n=t.marker?.id||`marker_${Date.now()}`;L(o,n,t.marker?.title,t.marker?.label),p(!0);break}case"clearMarkers":{P(),k.value?.setDirections({routes:[],request:{}}),b.value=[],g.value=null,p(!0);break}case"findPlaces":{await j(t.searchQuery,t.placeType);break}case"getDirections":{if(!t.origin||!t.destination)throw new Error("Origin and destination are required");await Q(t.origin,t.destination,t.travelMode||"DRIVING");break}}}catch(o){const n=o instanceof Error?o.message:"An error occurred";M.value=n,p(!1,n)}finally{C.value=!1}}},j=async(t,o)=>{if(!r.value||!E)return;const n=r.value.getCenter();if(n)try{const s={textQuery:t||o||"",locationBias:{center:{lat:n.lat(),lng:n.lng()},radius:5e3},fields:["id","displayName","formattedAddress","location","rating","userRatingCount","types","regularOpeningHours"],maxResultCount:10};o&&!t&&(s.includedType=o);const{places:c}=await E.searchByText(s);if(c&&c.length>0){[...f.value.keys()].filter(l=>l.startsWith("place_")).forEach(l=>{const v=f.value.get(l);v&&(v.map=null,f.value.delete(l))});const i=c.map((l,v)=>{const m=l.location,O=m?{lat:m.lat(),lng:m.lng()}:{lat:0,lng:0};return m&&L(O,`place_${l.id}`,l.displayName||void 0,String(v+1)),{placeId:l.id||"",name:l.displayName||"",address:l.formattedAddress||"",location:O,rating:l.rating??void 0,userRatingsTotal:l.userRatingCount??void 0,types:l.types,openNow:void 0}});if(b.value=i,g.value=null,i.length>0){const l=new google.maps.LatLngBounds;i.forEach(v=>{l.extend(v.location)}),r.value?.fitBounds(l)}p(!0,void 0,{places:i})}else p(!1,"No places found")}catch{p(!1,"No places found")}},Q=async(t,o,n)=>{if(!_.value||!k.value)return;const s={origin:t,destination:o,travelMode:n};return new Promise(c=>{_.value.route(s,(u,i)=>{if(i===google.maps.DirectionsStatus.OK&&u){k.value.setDirections(u);const l=u.routes[0]?.legs[0];if(l){const v={summary:u.routes[0].summary||"",distance:l.distance?.text||"",duration:l.duration?.text||"",startAddress:l.start_address||"",endAddress:l.end_address||"",steps:l.steps?.map(m=>({instruction:m.instructions||"",distance:m.distance?.text||"",duration:m.duration?.text||"",travelMode:m.travel_mode||"",startLocation:m.start_location?{lat:m.start_location.lat(),lng:m.start_location.lng()}:void 0,endLocation:m.end_location?{lat:m.end_location.lat(),lng:m.end_location.lng()}:void 0}))||[],polyline:u.routes[0].overview_polyline||""};g.value=v,b.value=[],p(!0,void 0,{route:v})}}else p(!1,"Could not find directions");c()})})},H=t=>{r.value&&(r.value.setCenter(t.location),r.value.setZoom(17))},J=t=>{if(!r.value)return;const o=t.startLocation||t.endLocation;o&&(r.value.setCenter(o),r.value.setZoom(18))},W=()=>{if(!r.value)return;const t=r.value.getZoom()||15;t<21&&r.value.setZoom(t+1)},X=()=>{if(!r.value)return;const t=r.value.getZoom()||15;t>1&&r.value.setZoom(t-1)};let I=null;return e.watch(()=>d.selectedResult?.data,async t=>{if(t&&r.value){const o=JSON.stringify(t);if(o===I)return;I=o,await T(t)}}),e.onMounted(()=>{d.googleMapKey&&U()}),e.onUnmounted(()=>{P()}),(t,o)=>(e.openBlock(),e.createElementBlock("div",Y,[e.createElementVNode("div",ee,[e.createElementVNode("h2",te,e.toDisplayString(z.value),1),D.value?(e.openBlock(),e.createElementBlock("p",oe,e.toDisplayString(D.value),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",ne,[e.createElementVNode("div",re,[x.googleMapKey?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"mapContainer",ref:w,class:"w-full h-full"},null,512)):(e.openBlock(),e.createElementBlock("div",ae,[e.createElementVNode("div",se,[o[0]||(o[0]=e.createElementVNode("div",{class:"text-gray-500 mb-4"},"Google Maps API key not configured",-1)),B.value?(e.openBlock(),e.createElementBlock("a",{key:0,href:B.value,target:"_blank",class:"inline-block px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors"}," Open in Google Maps ",8,le)):e.createCommentVNode("",!0)])])),C.value?(e.openBlock(),e.createElementBlock("div",ce,[...o[1]||(o[1]=[e.createElementVNode("div",{class:"text-gray-600"},"Loading...",-1)])])):e.createCommentVNode("",!0),M.value?(e.openBlock(),e.createElementBlock("div",ie,e.toDisplayString(M.value),1)):e.createCommentVNode("",!0),x.googleMapKey&&r.value?(e.openBlock(),e.createElementBlock("div",de,[e.createElementVNode("button",{onClick:W,class:"w-8 h-8 bg-white border border-gray-300 rounded shadow text-lg font-bold text-gray-700 hover:bg-gray-100 flex items-center justify-center",title:"Zoom in"}," + "),e.createElementVNode("button",{onClick:X,class:"w-8 h-8 bg-white border border-gray-300 rounded shadow text-lg font-bold text-gray-700 hover:bg-gray-100 flex items-center justify-center",title:"Zoom out"}," − ")])):e.createCommentVNode("",!0)]),F.value?(e.openBlock(),e.createElementBlock("div",ue,[b.value.length>0?(e.openBlock(),e.createElementBlock("div",me,[o[3]||(o[3]=e.createElementVNode("h3",{class:"font-semibold text-gray-800 mb-3"},"Search Results",-1)),e.createElementVNode("div",ge,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,n=>(e.openBlock(),e.createElementBlock("div",{key:n.placeId,class:"p-3 bg-gray-50 rounded-lg cursor-pointer hover:bg-gray-100 transition-colors",onClick:s=>H(n)},[e.createElementVNode("div",fe,e.toDisplayString(n.name),1),e.createElementVNode("div",ve,e.toDisplayString(n.address),1),n.rating?(e.openBlock(),e.createElementBlock("div",ye,[o[2]||(o[2]=e.createElementVNode("span",{class:"text-yellow-500 mr-1"},"★",-1)),e.createElementVNode("span",ke,[e.createTextVNode(e.toDisplayString(n.rating.toFixed(1))+" ",1),n.userRatingsTotal?(e.openBlock(),e.createElementBlock("span",he," ("+e.toDisplayString(n.userRatingsTotal)+") ",1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),n.openNow!==void 0?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass([n.openNow?"text-green-600":"text-red-600","text-sm mt-1"])},e.toDisplayString(n.openNow?"Open now":"Closed"),3)):e.createCommentVNode("",!0)],8,pe))),128))])])):e.createCommentVNode("",!0),g.value?(e.openBlock(),e.createElementBlock("div",we,[o[6]||(o[6]=e.createElementVNode("h3",{class:"font-semibold text-gray-800 mb-3"},"Directions",-1)),e.createElementVNode("div",be,[e.createElementVNode("div",xe,e.toDisplayString(g.value.distance),1),e.createElementVNode("div",_e,e.toDisplayString(g.value.duration),1)]),e.createElementVNode("div",Ee,[e.createElementVNode("div",null,[o[4]||(o[4]=e.createElementVNode("strong",null,"From:",-1)),e.createTextVNode(" "+e.toDisplayString(g.value.startAddress),1)]),e.createElementVNode("div",null,[o[5]||(o[5]=e.createElementVNode("strong",null,"To:",-1)),e.createTextVNode(" "+e.toDisplayString(g.value.endAddress),1)])]),e.createElementVNode("div",Me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value.steps,(n,s)=>(e.openBlock(),e.createElementBlock("div",{key:s,class:"p-2 bg-gray-50 rounded text-sm cursor-pointer hover:bg-blue-50 transition-colors",onClick:c=>J(n)},[e.createElementVNode("div",Ce,e.toDisplayString(q(n.instruction)),1),e.createElementVNode("div",Ve,e.toDisplayString(n.distance)+" · "+e.toDisplayString(n.duration),1)],8,Ne))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])]))}}),Le={class:"text-xs text-gray-600 mt-1 truncate"},$=e.defineComponent({__name:"Preview",props:{result:{}},setup(x){const d=x,w=a=>a?typeof a=="string"?a:`${a.lat.toFixed(4)}, ${a.lng.toFixed(4)}`:"",r=e.computed(()=>{const a=d.result.data?.action;return{showLocation:"Map Location",setCenter:"Center Map",setZoom:"Zoom",addMarker:"Add Marker",clearMarkers:"Clear Markers",findPlaces:"Place Search",getDirections:"Directions"}[a||"showLocation"]||"Map"}),f=e.computed(()=>{const a=d.result.data;if(!a)return"";switch(a.action){case"showLocation":case"setCenter":case"addMarker":return w(a.location);case"setZoom":return`Level ${a.zoom}`;case"clearMarkers":return"All markers cleared";case"findPlaces":return a.searchQuery||a.placeType||"Search";case"getDirections":{const y=typeof a.origin=="string"?a.origin:"Start",E=typeof a.destination=="string"?a.destination:"End";return`${y} → ${E}`}default:return w(a.location)}}),_=e.computed(()=>{const a=d.result.data?.action;return{showLocation:"bg-blue-50",setCenter:"bg-blue-50",setZoom:"bg-purple-50",addMarker:"bg-green-50",clearMarkers:"bg-gray-50",findPlaces:"bg-yellow-50",getDirections:"bg-orange-50"}[a||"showLocation"]||"bg-blue-50"}),k=e.computed(()=>{const a=d.result.data?.action;return{showLocation:"text-blue-600",setCenter:"text-blue-600",setZoom:"text-purple-600",addMarker:"text-green-600",clearMarkers:"text-gray-600",findPlaces:"text-yellow-700",getDirections:"text-orange-600"}[a||"showLocation"]||"text-blue-600"});return(a,y)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["text-center p-4 rounded",_.value])},[e.createElementVNode("div",{class:e.normalizeClass(["font-medium",k.value])},e.toDisplayString(r.value),3),e.createElementVNode("div",Le,e.toDisplayString(f.value),1)],2))}}),A={...h.pluginCore,viewComponent:Z,previewComponent:$,samples:h.samples},De={plugin:A};exports.TOOL_DEFINITION=h.TOOL_DEFINITION;exports.TOOL_NAME=h.TOOL_NAME;exports.executeMap=h.executeMap;exports.pluginCore=h.pluginCore;exports.samples=h.samples;exports.Preview=$;exports.View=Z;exports.default=De;exports.plugin=A;
|
package/dist/vue.js
CHANGED
|
@@ -1,46 +1,48 @@
|
|
|
1
|
-
import { samples as
|
|
2
|
-
import { TOOL_DEFINITION as
|
|
3
|
-
import { defineComponent as j, ref as
|
|
4
|
-
const
|
|
1
|
+
import { samples as ae, pluginCore as le } from "./core.js";
|
|
2
|
+
import { TOOL_DEFINITION as Je, TOOL_NAME as We, executeMap as Xe } from "./core.js";
|
|
3
|
+
import { defineComponent as j, ref as p, computed as k, watch as ie, onMounted as ce, onUnmounted as ue, createElementBlock as c, openBlock as u, createElementVNode as s, createCommentVNode as y, toDisplayString as m, Fragment as U, renderList as B, createTextVNode as $, normalizeClass as T } from "vue";
|
|
4
|
+
const de = { class: "w-full h-full bg-white flex flex-col relative" }, ge = { class: "p-4 border-b border-gray-200" }, me = { class: "text-xl font-bold text-gray-800" }, ve = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "text-gray-600 text-sm"
|
|
7
|
-
},
|
|
7
|
+
}, fe = { class: "flex-1 min-h-0 flex" }, pe = { class: "flex-1 relative" }, ye = {
|
|
8
8
|
key: 1,
|
|
9
9
|
class: "w-full h-full flex items-center justify-center bg-gray-100"
|
|
10
|
-
},
|
|
10
|
+
}, he = { class: "text-center p-8" }, we = ["href"], be = {
|
|
11
11
|
key: 2,
|
|
12
12
|
class: "absolute inset-0 bg-white bg-opacity-75 flex items-center justify-center"
|
|
13
|
-
},
|
|
13
|
+
}, xe = {
|
|
14
14
|
key: 3,
|
|
15
15
|
class: "absolute bottom-4 left-4 right-4 bg-red-100 border border-red-300 text-red-700 px-4 py-3 rounded"
|
|
16
|
-
},
|
|
16
|
+
}, _e = {
|
|
17
17
|
key: 4,
|
|
18
18
|
class: "absolute top-4 right-4 flex flex-col gap-1"
|
|
19
|
-
},
|
|
19
|
+
}, ke = {
|
|
20
20
|
key: 0,
|
|
21
21
|
class: "w-80 border-l border-gray-200 overflow-y-auto"
|
|
22
|
-
},
|
|
22
|
+
}, Me = {
|
|
23
23
|
key: 0,
|
|
24
24
|
class: "p-4"
|
|
25
|
-
},
|
|
25
|
+
}, Ce = { class: "space-y-3" }, Le = ["onClick"], De = { class: "font-medium text-gray-800" }, Re = { class: "text-sm text-gray-600 mt-1" }, Ee = {
|
|
26
26
|
key: 0,
|
|
27
27
|
class: "flex items-center mt-1"
|
|
28
|
-
},
|
|
28
|
+
}, Pe = { class: "text-sm text-gray-600" }, Ie = {
|
|
29
29
|
key: 0,
|
|
30
30
|
class: "text-gray-400"
|
|
31
|
-
},
|
|
31
|
+
}, Se = {
|
|
32
32
|
key: 1,
|
|
33
33
|
class: "p-4"
|
|
34
|
-
},
|
|
34
|
+
}, Ze = { class: "bg-blue-50 rounded-lg p-3 mb-4" }, Ne = { class: "text-lg font-medium text-gray-800" }, $e = { class: "text-gray-600" }, Te = { class: "text-sm text-gray-600 mb-3" }, Ae = { class: "space-y-2" }, Oe = ["onClick"], ze = { class: "text-gray-800" }, Fe = { class: "text-gray-500 mt-1" }, Ve = /* @__PURE__ */ j({
|
|
35
35
|
__name: "View",
|
|
36
36
|
props: {
|
|
37
37
|
selectedResult: {},
|
|
38
38
|
googleMapKey: {},
|
|
39
39
|
onUpdateResult: { type: Function }
|
|
40
40
|
},
|
|
41
|
-
setup(
|
|
42
|
-
const
|
|
43
|
-
|
|
41
|
+
setup(D) {
|
|
42
|
+
const g = D, C = p(null), n = p(null), b = p(/* @__PURE__ */ new Map()), R = p(null), M = p(null), r = p(null);
|
|
43
|
+
let _, E;
|
|
44
|
+
const S = p(!1), P = p(null), L = p([]), h = p(null), Z = p(null), I = p(15), Q = k(() => {
|
|
45
|
+
const e = g.selectedResult?.data?.action;
|
|
44
46
|
return {
|
|
45
47
|
showLocation: "Map Location",
|
|
46
48
|
setCenter: "Map View",
|
|
@@ -50,14 +52,14 @@ const ie = { class: "w-full h-full bg-white flex flex-col relative" }, ce = { cl
|
|
|
50
52
|
findPlaces: "Place Search",
|
|
51
53
|
getDirections: "Directions"
|
|
52
54
|
}[e || "showLocation"] || "Map";
|
|
53
|
-
}),
|
|
54
|
-
const e =
|
|
55
|
+
}), A = k(() => {
|
|
56
|
+
const e = g.selectedResult?.data;
|
|
55
57
|
if (!e) return "";
|
|
56
58
|
switch (e.action) {
|
|
57
59
|
case "showLocation":
|
|
58
60
|
case "setCenter":
|
|
59
61
|
case "addMarker":
|
|
60
|
-
return
|
|
62
|
+
return z(e.location);
|
|
61
63
|
case "setZoom":
|
|
62
64
|
return `Zoom level: ${e.zoom}`;
|
|
63
65
|
case "findPlaces":
|
|
@@ -67,97 +69,111 @@ const ie = { class: "w-full h-full bg-white flex flex-col relative" }, ce = { cl
|
|
|
67
69
|
default:
|
|
68
70
|
return "";
|
|
69
71
|
}
|
|
70
|
-
}),
|
|
71
|
-
const e =
|
|
72
|
+
}), H = k(() => L.value.length > 0 || h.value !== null), O = k(() => {
|
|
73
|
+
const e = g.selectedResult?.data;
|
|
72
74
|
if (!e?.location) return "";
|
|
73
|
-
const t =
|
|
75
|
+
const t = z(e.location);
|
|
74
76
|
return `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(t)}`;
|
|
75
|
-
}),
|
|
77
|
+
}), z = (e) => e ? typeof e == "string" ? e : `${e.lat}, ${e.lng}` : "", J = (e) => new DOMParser().parseFromString(e, "text/html").body.textContent || "", W = () => {
|
|
76
78
|
const e = [];
|
|
77
79
|
return b.value.forEach((t, o) => {
|
|
78
|
-
const a = t.
|
|
79
|
-
a
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
80
|
+
const a = t.position;
|
|
81
|
+
if (a) {
|
|
82
|
+
const i = typeof a.lat == "function" ? a.lat() : a.lat, v = typeof a.lng == "function" ? a.lng() : a.lng;
|
|
83
|
+
e.push({
|
|
84
|
+
id: o,
|
|
85
|
+
position: { lat: i, lng: v },
|
|
86
|
+
title: t.title || void 0
|
|
87
|
+
});
|
|
88
|
+
}
|
|
85
89
|
}), e;
|
|
86
90
|
}, w = (e, t, o) => {
|
|
87
|
-
if (!
|
|
88
|
-
const
|
|
89
|
-
action:
|
|
91
|
+
if (!g.onUpdateResult) return;
|
|
92
|
+
const i = {
|
|
93
|
+
action: g.selectedResult?.data?.action || "showLocation",
|
|
90
94
|
success: e,
|
|
91
95
|
center: Z.value || void 0,
|
|
92
|
-
zoom:
|
|
93
|
-
markers:
|
|
96
|
+
zoom: I.value,
|
|
97
|
+
markers: W(),
|
|
94
98
|
...o
|
|
95
99
|
};
|
|
96
|
-
t && (
|
|
97
|
-
},
|
|
98
|
-
if (typeof google < "u" && google.maps) {
|
|
100
|
+
t && (i.error = t), g.onUpdateResult(i);
|
|
101
|
+
}, X = () => new Promise((e, t) => {
|
|
102
|
+
if (typeof google < "u" && google.maps && typeof google.maps.importLibrary == "function") {
|
|
99
103
|
e();
|
|
100
104
|
return;
|
|
101
105
|
}
|
|
102
106
|
const o = document.querySelector(
|
|
103
107
|
'script[src*="maps.googleapis.com"]'
|
|
104
|
-
)
|
|
108
|
+
), a = 1e4, i = 50, v = (l) => {
|
|
109
|
+
typeof google < "u" && google.maps && typeof google.maps.importLibrary == "function" ? e() : Date.now() - l > a ? t(new Error("Timeout waiting for Google Maps to load")) : setTimeout(() => v(l), i);
|
|
110
|
+
};
|
|
105
111
|
if (o) {
|
|
106
|
-
|
|
107
|
-
"error",
|
|
108
|
-
() => t(new Error("Failed to load Google Maps"))
|
|
109
|
-
);
|
|
112
|
+
v(Date.now());
|
|
110
113
|
return;
|
|
111
114
|
}
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
}),
|
|
115
|
-
if (!(!
|
|
115
|
+
const d = document.createElement("script");
|
|
116
|
+
d.src = `https://maps.googleapis.com/maps/api/js?key=${g.googleMapKey}&loading=async`, d.async = !0, d.defer = !0, d.onload = () => v(Date.now()), d.onerror = () => t(new Error("Failed to load Google Maps")), document.head.appendChild(d);
|
|
117
|
+
}), Y = async () => {
|
|
118
|
+
if (!(!C.value || !g.googleMapKey) && !n.value)
|
|
116
119
|
try {
|
|
117
|
-
await
|
|
118
|
-
const e =
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
await X();
|
|
121
|
+
const e = await google.maps.importLibrary(
|
|
122
|
+
"marker"
|
|
123
|
+
), t = await google.maps.importLibrary(
|
|
124
|
+
"places"
|
|
125
|
+
);
|
|
126
|
+
_ = e.AdvancedMarkerElement, E = t.Place;
|
|
127
|
+
const o = { lat: 35.6812, lng: 139.7671 };
|
|
128
|
+
n.value = new google.maps.Map(C.value, {
|
|
129
|
+
center: o,
|
|
130
|
+
zoom: I.value,
|
|
122
131
|
mapTypeControl: !0,
|
|
123
132
|
streetViewControl: !0,
|
|
124
|
-
fullscreenControl: !0
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
133
|
+
fullscreenControl: !0,
|
|
134
|
+
// DEMO_MAP_ID is Google's demo ID. For production, create your own at:
|
|
135
|
+
// https://console.cloud.google.com/google/maps-apis/studio/maps
|
|
136
|
+
mapId: "DEMO_MAP_ID"
|
|
137
|
+
}), r.value = new google.maps.Geocoder(), R.value = new google.maps.DirectionsService(), M.value = new google.maps.DirectionsRenderer(), M.value.setMap(n.value), n.value.addListener("center_changed", () => {
|
|
138
|
+
const a = n.value?.getCenter();
|
|
139
|
+
a && (Z.value = { lat: a.lat(), lng: a.lng() });
|
|
128
140
|
}), n.value.addListener("zoom_changed", () => {
|
|
129
|
-
|
|
130
|
-
}),
|
|
141
|
+
I.value = n.value?.getZoom() || 15;
|
|
142
|
+
}), g.selectedResult?.data && await K(g.selectedResult.data);
|
|
131
143
|
} catch (e) {
|
|
132
|
-
|
|
144
|
+
P.value = e instanceof Error ? e.message : "Failed to initialize map";
|
|
133
145
|
}
|
|
134
|
-
}, F = async (e) => typeof e != "string" ? e :
|
|
135
|
-
|
|
146
|
+
}, F = async (e) => typeof e != "string" ? e : r.value ? new Promise((t) => {
|
|
147
|
+
r.value.geocode(
|
|
136
148
|
{ address: e },
|
|
137
149
|
(o, a) => {
|
|
138
150
|
if (a === "OK" && o && o[0]) {
|
|
139
|
-
const
|
|
140
|
-
t({ lat:
|
|
151
|
+
const i = o[0].geometry.location;
|
|
152
|
+
t({ lat: i.lat(), lng: i.lng() });
|
|
141
153
|
} else
|
|
142
154
|
t(null);
|
|
143
155
|
}
|
|
144
156
|
);
|
|
145
|
-
}) : null,
|
|
146
|
-
|
|
157
|
+
}) : null, N = (e, t, o, a) => {
|
|
158
|
+
let i;
|
|
159
|
+
if (a) {
|
|
160
|
+
const d = document.createElement("div");
|
|
161
|
+
d.className = "marker-label", d.style.cssText = "background: #4285f4; color: white; padding: 4px 8px; border-radius: 4px; font-weight: bold; font-size: 12px;", d.textContent = a, i = d;
|
|
162
|
+
}
|
|
163
|
+
const v = new _({
|
|
147
164
|
position: e,
|
|
148
165
|
map: n.value,
|
|
149
166
|
title: o,
|
|
150
|
-
|
|
151
|
-
animation: google.maps.Animation.DROP
|
|
167
|
+
content: i
|
|
152
168
|
});
|
|
153
169
|
return b.value.set(t, v), v;
|
|
154
|
-
},
|
|
170
|
+
}, V = () => {
|
|
155
171
|
b.value.forEach((e) => {
|
|
156
|
-
e.
|
|
172
|
+
e.map = null;
|
|
157
173
|
}), b.value.clear();
|
|
158
|
-
},
|
|
174
|
+
}, K = async (e) => {
|
|
159
175
|
if (n.value) {
|
|
160
|
-
|
|
176
|
+
S.value = !0, P.value = null;
|
|
161
177
|
try {
|
|
162
178
|
switch (e.action) {
|
|
163
179
|
case "showLocation":
|
|
@@ -169,7 +185,7 @@ const ie = { class: "w-full h-full bg-white flex flex-col relative" }, ce = { cl
|
|
|
169
185
|
throw new Error("Could not find location");
|
|
170
186
|
if (n.value.setCenter(t), Z.value = t, e.action === "showLocation") {
|
|
171
187
|
const o = `location_${Date.now()}`;
|
|
172
|
-
|
|
188
|
+
N(
|
|
173
189
|
t,
|
|
174
190
|
o,
|
|
175
191
|
typeof e.location == "string" ? e.location : void 0
|
|
@@ -180,7 +196,7 @@ const ie = { class: "w-full h-full bg-white flex flex-col relative" }, ce = { cl
|
|
|
180
196
|
}
|
|
181
197
|
case "setZoom": {
|
|
182
198
|
const t = e.zoom || 15;
|
|
183
|
-
n.value.setZoom(t),
|
|
199
|
+
n.value.setZoom(t), I.value = t, w(!0);
|
|
184
200
|
break;
|
|
185
201
|
}
|
|
186
202
|
case "addMarker": {
|
|
@@ -190,24 +206,24 @@ const ie = { class: "w-full h-full bg-white flex flex-col relative" }, ce = { cl
|
|
|
190
206
|
if (!t)
|
|
191
207
|
throw new Error("Could not find location for marker");
|
|
192
208
|
const o = e.marker?.id || `marker_${Date.now()}`;
|
|
193
|
-
|
|
209
|
+
N(t, o, e.marker?.title, e.marker?.label), w(!0);
|
|
194
210
|
break;
|
|
195
211
|
}
|
|
196
212
|
case "clearMarkers": {
|
|
197
|
-
|
|
213
|
+
V(), M.value?.setDirections({
|
|
198
214
|
routes: [],
|
|
199
215
|
request: {}
|
|
200
|
-
}),
|
|
216
|
+
}), L.value = [], h.value = null, w(!0);
|
|
201
217
|
break;
|
|
202
218
|
}
|
|
203
219
|
case "findPlaces": {
|
|
204
|
-
await
|
|
220
|
+
await ee(e.searchQuery, e.placeType);
|
|
205
221
|
break;
|
|
206
222
|
}
|
|
207
223
|
case "getDirections": {
|
|
208
224
|
if (!e.origin || !e.destination)
|
|
209
225
|
throw new Error("Origin and destination are required");
|
|
210
|
-
await
|
|
226
|
+
await te(
|
|
211
227
|
e.origin,
|
|
212
228
|
e.destination,
|
|
213
229
|
e.travelMode || "DRIVING"
|
|
@@ -217,224 +233,245 @@ const ie = { class: "w-full h-full bg-white flex flex-col relative" }, ce = { cl
|
|
|
217
233
|
}
|
|
218
234
|
} catch (t) {
|
|
219
235
|
const o = t instanceof Error ? t.message : "An error occurred";
|
|
220
|
-
|
|
236
|
+
P.value = o, w(!1, o);
|
|
221
237
|
} finally {
|
|
222
|
-
|
|
238
|
+
S.value = !1;
|
|
223
239
|
}
|
|
224
240
|
}
|
|
225
|
-
},
|
|
226
|
-
if (!
|
|
241
|
+
}, ee = async (e, t) => {
|
|
242
|
+
if (!n.value || !E) return;
|
|
227
243
|
const o = n.value.getCenter();
|
|
228
|
-
if (
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
}
|
|
244
|
+
if (o)
|
|
245
|
+
try {
|
|
246
|
+
const a = {
|
|
247
|
+
textQuery: e || t || "",
|
|
248
|
+
locationBias: {
|
|
249
|
+
center: { lat: o.lat(), lng: o.lng() },
|
|
250
|
+
radius: 5e3
|
|
251
|
+
},
|
|
252
|
+
fields: ["id", "displayName", "formattedAddress", "location", "rating", "userRatingCount", "types", "regularOpeningHours"],
|
|
253
|
+
maxResultCount: 10
|
|
254
|
+
};
|
|
255
|
+
t && !e && (a.includedType = t);
|
|
256
|
+
const { places: i } = await E.searchByText(a);
|
|
257
|
+
if (i && i.length > 0) {
|
|
258
|
+
[...b.value.keys()].filter(
|
|
259
|
+
(l) => l.startsWith("place_")
|
|
260
|
+
).forEach((l) => {
|
|
261
|
+
const x = b.value.get(l);
|
|
262
|
+
x && (x.map = null, b.value.delete(l));
|
|
263
|
+
});
|
|
264
|
+
const d = i.map(
|
|
265
|
+
(l, x) => {
|
|
266
|
+
const f = l.location, G = f ? { lat: f.lat(), lng: f.lng() } : { lat: 0, lng: 0 };
|
|
267
|
+
return f && N(
|
|
268
|
+
G,
|
|
269
|
+
`place_${l.id}`,
|
|
270
|
+
l.displayName || void 0,
|
|
271
|
+
String(x + 1)
|
|
272
|
+
), {
|
|
273
|
+
placeId: l.id || "",
|
|
274
|
+
name: l.displayName || "",
|
|
275
|
+
address: l.formattedAddress || "",
|
|
276
|
+
location: G,
|
|
277
|
+
rating: l.rating ?? void 0,
|
|
278
|
+
userRatingsTotal: l.userRatingCount ?? void 0,
|
|
279
|
+
types: l.types,
|
|
280
|
+
// Note: isOpen() requires async call, omitting for now
|
|
281
|
+
openNow: void 0
|
|
282
|
+
};
|
|
267
283
|
}
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
284
|
+
);
|
|
285
|
+
if (L.value = d, h.value = null, d.length > 0) {
|
|
286
|
+
const l = new google.maps.LatLngBounds();
|
|
287
|
+
d.forEach((x) => {
|
|
288
|
+
l.extend(x.location);
|
|
289
|
+
}), n.value?.fitBounds(l);
|
|
290
|
+
}
|
|
291
|
+
w(!0, void 0, { places: d });
|
|
292
|
+
} else
|
|
293
|
+
w(!1, "No places found");
|
|
294
|
+
} catch {
|
|
295
|
+
w(!1, "No places found");
|
|
296
|
+
}
|
|
297
|
+
}, te = async (e, t, o) => {
|
|
298
|
+
if (!R.value || !M.value) return;
|
|
277
299
|
const a = {
|
|
278
300
|
origin: e,
|
|
279
301
|
destination: t,
|
|
280
302
|
travelMode: o
|
|
281
303
|
};
|
|
282
|
-
return new Promise((
|
|
283
|
-
|
|
304
|
+
return new Promise((i) => {
|
|
305
|
+
R.value.route(
|
|
284
306
|
a,
|
|
285
|
-
(
|
|
286
|
-
if (
|
|
287
|
-
|
|
288
|
-
const
|
|
289
|
-
if (
|
|
290
|
-
const
|
|
291
|
-
summary:
|
|
292
|
-
distance:
|
|
293
|
-
duration:
|
|
294
|
-
startAddress:
|
|
295
|
-
endAddress:
|
|
296
|
-
steps:
|
|
297
|
-
instruction:
|
|
298
|
-
distance:
|
|
299
|
-
duration:
|
|
300
|
-
travelMode:
|
|
307
|
+
(v, d) => {
|
|
308
|
+
if (d === google.maps.DirectionsStatus.OK && v) {
|
|
309
|
+
M.value.setDirections(v);
|
|
310
|
+
const l = v.routes[0]?.legs[0];
|
|
311
|
+
if (l) {
|
|
312
|
+
const x = {
|
|
313
|
+
summary: v.routes[0].summary || "",
|
|
314
|
+
distance: l.distance?.text || "",
|
|
315
|
+
duration: l.duration?.text || "",
|
|
316
|
+
startAddress: l.start_address || "",
|
|
317
|
+
endAddress: l.end_address || "",
|
|
318
|
+
steps: l.steps?.map((f) => ({
|
|
319
|
+
instruction: f.instructions || "",
|
|
320
|
+
distance: f.distance?.text || "",
|
|
321
|
+
duration: f.duration?.text || "",
|
|
322
|
+
travelMode: f.travel_mode || "",
|
|
323
|
+
startLocation: f.start_location ? {
|
|
324
|
+
lat: f.start_location.lat(),
|
|
325
|
+
lng: f.start_location.lng()
|
|
326
|
+
} : void 0,
|
|
327
|
+
endLocation: f.end_location ? {
|
|
328
|
+
lat: f.end_location.lat(),
|
|
329
|
+
lng: f.end_location.lng()
|
|
330
|
+
} : void 0
|
|
301
331
|
})) || [],
|
|
302
|
-
polyline:
|
|
332
|
+
polyline: v.routes[0].overview_polyline || ""
|
|
303
333
|
};
|
|
304
|
-
|
|
334
|
+
h.value = x, L.value = [], w(!0, void 0, { route: x });
|
|
305
335
|
}
|
|
306
336
|
} else
|
|
307
337
|
w(!1, "Could not find directions");
|
|
308
|
-
|
|
338
|
+
i();
|
|
309
339
|
}
|
|
310
340
|
);
|
|
311
341
|
});
|
|
312
|
-
},
|
|
342
|
+
}, oe = (e) => {
|
|
313
343
|
n.value && (n.value.setCenter(e.location), n.value.setZoom(17));
|
|
314
|
-
},
|
|
344
|
+
}, ne = (e) => {
|
|
345
|
+
if (!n.value) return;
|
|
346
|
+
const t = e.startLocation || e.endLocation;
|
|
347
|
+
t && (n.value.setCenter(t), n.value.setZoom(18));
|
|
348
|
+
}, se = () => {
|
|
315
349
|
if (!n.value) return;
|
|
316
350
|
const e = n.value.getZoom() || 15;
|
|
317
351
|
e < 21 && n.value.setZoom(e + 1);
|
|
318
|
-
},
|
|
352
|
+
}, re = () => {
|
|
319
353
|
if (!n.value) return;
|
|
320
354
|
const e = n.value.getZoom() || 15;
|
|
321
355
|
e > 1 && n.value.setZoom(e - 1);
|
|
322
356
|
};
|
|
323
|
-
|
|
324
|
-
|
|
357
|
+
let q = null;
|
|
358
|
+
return ie(
|
|
359
|
+
() => g.selectedResult?.data,
|
|
325
360
|
async (e) => {
|
|
326
|
-
e && n.value
|
|
361
|
+
if (e && n.value) {
|
|
362
|
+
const t = JSON.stringify(e);
|
|
363
|
+
if (t === q) return;
|
|
364
|
+
q = t, await K(e);
|
|
365
|
+
}
|
|
327
366
|
}
|
|
328
|
-
),
|
|
329
|
-
|
|
330
|
-
}),
|
|
331
|
-
|
|
332
|
-
}), (e, t) => (
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
367
|
+
), ce(() => {
|
|
368
|
+
g.googleMapKey && Y();
|
|
369
|
+
}), ue(() => {
|
|
370
|
+
V();
|
|
371
|
+
}), (e, t) => (u(), c("div", de, [
|
|
372
|
+
s("div", ge, [
|
|
373
|
+
s("h2", me, m(Q.value), 1),
|
|
374
|
+
A.value ? (u(), c("p", ve, m(A.value), 1)) : y("", !0)
|
|
336
375
|
]),
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
376
|
+
s("div", fe, [
|
|
377
|
+
s("div", pe, [
|
|
378
|
+
D.googleMapKey ? (u(), c("div", {
|
|
340
379
|
key: 0,
|
|
341
380
|
ref_key: "mapContainer",
|
|
342
|
-
ref:
|
|
381
|
+
ref: C,
|
|
343
382
|
class: "w-full h-full"
|
|
344
|
-
}, null, 512)) : (
|
|
345
|
-
|
|
346
|
-
t[0] || (t[0] =
|
|
347
|
-
|
|
383
|
+
}, null, 512)) : (u(), c("div", ye, [
|
|
384
|
+
s("div", he, [
|
|
385
|
+
t[0] || (t[0] = s("div", { class: "text-gray-500 mb-4" }, "Google Maps API key not configured", -1)),
|
|
386
|
+
O.value ? (u(), c("a", {
|
|
348
387
|
key: 0,
|
|
349
|
-
href:
|
|
388
|
+
href: O.value,
|
|
350
389
|
target: "_blank",
|
|
351
390
|
class: "inline-block px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors"
|
|
352
|
-
}, " Open in Google Maps ", 8,
|
|
391
|
+
}, " Open in Google Maps ", 8, we)) : y("", !0)
|
|
353
392
|
])
|
|
354
393
|
])),
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
])])) :
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
onClick:
|
|
394
|
+
S.value ? (u(), c("div", be, [...t[1] || (t[1] = [
|
|
395
|
+
s("div", { class: "text-gray-600" }, "Loading...", -1)
|
|
396
|
+
])])) : y("", !0),
|
|
397
|
+
P.value ? (u(), c("div", xe, m(P.value), 1)) : y("", !0),
|
|
398
|
+
D.googleMapKey && n.value ? (u(), c("div", _e, [
|
|
399
|
+
s("button", {
|
|
400
|
+
onClick: se,
|
|
362
401
|
class: "w-8 h-8 bg-white border border-gray-300 rounded shadow text-lg font-bold text-gray-700 hover:bg-gray-100 flex items-center justify-center",
|
|
363
402
|
title: "Zoom in"
|
|
364
403
|
}, " + "),
|
|
365
|
-
|
|
366
|
-
onClick:
|
|
404
|
+
s("button", {
|
|
405
|
+
onClick: re,
|
|
367
406
|
class: "w-8 h-8 bg-white border border-gray-300 rounded shadow text-lg font-bold text-gray-700 hover:bg-gray-100 flex items-center justify-center",
|
|
368
407
|
title: "Zoom out"
|
|
369
408
|
}, " − ")
|
|
370
|
-
])) :
|
|
409
|
+
])) : y("", !0)
|
|
371
410
|
]),
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
t[3] || (t[3] =
|
|
375
|
-
|
|
376
|
-
(
|
|
411
|
+
H.value ? (u(), c("div", ke, [
|
|
412
|
+
L.value.length > 0 ? (u(), c("div", Me, [
|
|
413
|
+
t[3] || (t[3] = s("h3", { class: "font-semibold text-gray-800 mb-3" }, "Search Results", -1)),
|
|
414
|
+
s("div", Ce, [
|
|
415
|
+
(u(!0), c(U, null, B(L.value, (o) => (u(), c("div", {
|
|
377
416
|
key: o.placeId,
|
|
378
417
|
class: "p-3 bg-gray-50 rounded-lg cursor-pointer hover:bg-gray-100 transition-colors",
|
|
379
|
-
onClick: (a) =>
|
|
418
|
+
onClick: (a) => oe(o)
|
|
380
419
|
}, [
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
o.rating ? (
|
|
384
|
-
t[2] || (t[2] =
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
o.userRatingsTotal ? (
|
|
420
|
+
s("div", De, m(o.name), 1),
|
|
421
|
+
s("div", Re, m(o.address), 1),
|
|
422
|
+
o.rating ? (u(), c("div", Ee, [
|
|
423
|
+
t[2] || (t[2] = s("span", { class: "text-yellow-500 mr-1" }, "★", -1)),
|
|
424
|
+
s("span", Pe, [
|
|
425
|
+
$(m(o.rating.toFixed(1)) + " ", 1),
|
|
426
|
+
o.userRatingsTotal ? (u(), c("span", Ie, " (" + m(o.userRatingsTotal) + ") ", 1)) : y("", !0)
|
|
388
427
|
])
|
|
389
|
-
])) :
|
|
390
|
-
o.openNow !== void 0 ? (
|
|
428
|
+
])) : y("", !0),
|
|
429
|
+
o.openNow !== void 0 ? (u(), c("div", {
|
|
391
430
|
key: 1,
|
|
392
|
-
class:
|
|
393
|
-
},
|
|
394
|
-
], 8,
|
|
431
|
+
class: T([o.openNow ? "text-green-600" : "text-red-600", "text-sm mt-1"])
|
|
432
|
+
}, m(o.openNow ? "Open now" : "Closed"), 3)) : y("", !0)
|
|
433
|
+
], 8, Le))), 128))
|
|
395
434
|
])
|
|
396
|
-
])) :
|
|
397
|
-
|
|
398
|
-
t[6] || (t[6] =
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
435
|
+
])) : y("", !0),
|
|
436
|
+
h.value ? (u(), c("div", Se, [
|
|
437
|
+
t[6] || (t[6] = s("h3", { class: "font-semibold text-gray-800 mb-3" }, "Directions", -1)),
|
|
438
|
+
s("div", Ze, [
|
|
439
|
+
s("div", Ne, m(h.value.distance), 1),
|
|
440
|
+
s("div", $e, m(h.value.duration), 1)
|
|
402
441
|
]),
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
t[4] || (t[4] =
|
|
406
|
-
|
|
442
|
+
s("div", Te, [
|
|
443
|
+
s("div", null, [
|
|
444
|
+
t[4] || (t[4] = s("strong", null, "From:", -1)),
|
|
445
|
+
$(" " + m(h.value.startAddress), 1)
|
|
407
446
|
]),
|
|
408
|
-
|
|
409
|
-
t[5] || (t[5] =
|
|
410
|
-
|
|
447
|
+
s("div", null, [
|
|
448
|
+
t[5] || (t[5] = s("strong", null, "To:", -1)),
|
|
449
|
+
$(" " + m(h.value.endAddress), 1)
|
|
411
450
|
])
|
|
412
451
|
]),
|
|
413
|
-
|
|
414
|
-
(
|
|
452
|
+
s("div", Ae, [
|
|
453
|
+
(u(!0), c(U, null, B(h.value.steps, (o, a) => (u(), c("div", {
|
|
415
454
|
key: a,
|
|
416
|
-
class: "p-2 bg-gray-50 rounded text-sm"
|
|
455
|
+
class: "p-2 bg-gray-50 rounded text-sm cursor-pointer hover:bg-blue-50 transition-colors",
|
|
456
|
+
onClick: (i) => ne(o)
|
|
417
457
|
}, [
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
}, null, 8, Te),
|
|
422
|
-
r("div", Ie, d(o.distance) + " · " + d(o.duration), 1)
|
|
423
|
-
]))), 128))
|
|
458
|
+
s("div", ze, m(J(o.instruction)), 1),
|
|
459
|
+
s("div", Fe, m(o.distance) + " · " + m(o.duration), 1)
|
|
460
|
+
], 8, Oe))), 128))
|
|
424
461
|
])
|
|
425
|
-
])) :
|
|
426
|
-
])) :
|
|
462
|
+
])) : y("", !0)
|
|
463
|
+
])) : y("", !0)
|
|
427
464
|
])
|
|
428
465
|
]));
|
|
429
466
|
}
|
|
430
|
-
}),
|
|
467
|
+
}), Ke = { class: "text-xs text-gray-600 mt-1 truncate" }, qe = /* @__PURE__ */ j({
|
|
431
468
|
__name: "Preview",
|
|
432
469
|
props: {
|
|
433
470
|
result: {}
|
|
434
471
|
},
|
|
435
|
-
setup(
|
|
436
|
-
const
|
|
437
|
-
const
|
|
472
|
+
setup(D) {
|
|
473
|
+
const g = D, C = (r) => r ? typeof r == "string" ? r : `${r.lat.toFixed(4)}, ${r.lng.toFixed(4)}` : "", n = k(() => {
|
|
474
|
+
const r = g.result.data?.action;
|
|
438
475
|
return {
|
|
439
476
|
showLocation: "Map Location",
|
|
440
477
|
setCenter: "Center Map",
|
|
@@ -443,30 +480,30 @@ const ie = { class: "w-full h-full bg-white flex flex-col relative" }, ce = { cl
|
|
|
443
480
|
clearMarkers: "Clear Markers",
|
|
444
481
|
findPlaces: "Place Search",
|
|
445
482
|
getDirections: "Directions"
|
|
446
|
-
}[
|
|
447
|
-
}), b =
|
|
448
|
-
const
|
|
449
|
-
if (!
|
|
450
|
-
switch (
|
|
483
|
+
}[r || "showLocation"] || "Map";
|
|
484
|
+
}), b = k(() => {
|
|
485
|
+
const r = g.result.data;
|
|
486
|
+
if (!r) return "";
|
|
487
|
+
switch (r.action) {
|
|
451
488
|
case "showLocation":
|
|
452
489
|
case "setCenter":
|
|
453
490
|
case "addMarker":
|
|
454
|
-
return
|
|
491
|
+
return C(r.location);
|
|
455
492
|
case "setZoom":
|
|
456
|
-
return `Level ${
|
|
493
|
+
return `Level ${r.zoom}`;
|
|
457
494
|
case "clearMarkers":
|
|
458
495
|
return "All markers cleared";
|
|
459
496
|
case "findPlaces":
|
|
460
|
-
return
|
|
497
|
+
return r.searchQuery || r.placeType || "Search";
|
|
461
498
|
case "getDirections": {
|
|
462
|
-
const
|
|
463
|
-
return `${
|
|
499
|
+
const _ = typeof r.origin == "string" ? r.origin : "Start", E = typeof r.destination == "string" ? r.destination : "End";
|
|
500
|
+
return `${_} → ${E}`;
|
|
464
501
|
}
|
|
465
502
|
default:
|
|
466
|
-
return
|
|
503
|
+
return C(r.location);
|
|
467
504
|
}
|
|
468
|
-
}),
|
|
469
|
-
const
|
|
505
|
+
}), R = k(() => {
|
|
506
|
+
const r = g.result.data?.action;
|
|
470
507
|
return {
|
|
471
508
|
showLocation: "bg-blue-50",
|
|
472
509
|
setCenter: "bg-blue-50",
|
|
@@ -475,9 +512,9 @@ const ie = { class: "w-full h-full bg-white flex flex-col relative" }, ce = { cl
|
|
|
475
512
|
clearMarkers: "bg-gray-50",
|
|
476
513
|
findPlaces: "bg-yellow-50",
|
|
477
514
|
getDirections: "bg-orange-50"
|
|
478
|
-
}[
|
|
479
|
-
}),
|
|
480
|
-
const
|
|
515
|
+
}[r || "showLocation"] || "bg-blue-50";
|
|
516
|
+
}), M = k(() => {
|
|
517
|
+
const r = g.result.data?.action;
|
|
481
518
|
return {
|
|
482
519
|
showLocation: "text-blue-600",
|
|
483
520
|
setCenter: "text-blue-600",
|
|
@@ -486,31 +523,31 @@ const ie = { class: "w-full h-full bg-white flex flex-col relative" }, ce = { cl
|
|
|
486
523
|
clearMarkers: "text-gray-600",
|
|
487
524
|
findPlaces: "text-yellow-700",
|
|
488
525
|
getDirections: "text-orange-600"
|
|
489
|
-
}[
|
|
526
|
+
}[r || "showLocation"] || "text-blue-600";
|
|
490
527
|
});
|
|
491
|
-
return (
|
|
492
|
-
class:
|
|
528
|
+
return (r, _) => (u(), c("div", {
|
|
529
|
+
class: T(["text-center p-4 rounded", R.value])
|
|
493
530
|
}, [
|
|
494
|
-
|
|
495
|
-
class:
|
|
496
|
-
},
|
|
497
|
-
|
|
531
|
+
s("div", {
|
|
532
|
+
class: T(["font-medium", M.value])
|
|
533
|
+
}, m(n.value), 3),
|
|
534
|
+
s("div", Ke, m(b.value), 1)
|
|
498
535
|
], 2));
|
|
499
536
|
}
|
|
500
|
-
}),
|
|
501
|
-
...
|
|
502
|
-
viewComponent:
|
|
503
|
-
previewComponent:
|
|
504
|
-
samples:
|
|
505
|
-
},
|
|
537
|
+
}), Ge = {
|
|
538
|
+
...le,
|
|
539
|
+
viewComponent: Ve,
|
|
540
|
+
previewComponent: qe,
|
|
541
|
+
samples: ae
|
|
542
|
+
}, je = { plugin: Ge };
|
|
506
543
|
export {
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
544
|
+
qe as Preview,
|
|
545
|
+
Je as TOOL_DEFINITION,
|
|
546
|
+
We as TOOL_NAME,
|
|
547
|
+
Ve as View,
|
|
548
|
+
je as default,
|
|
549
|
+
Xe as executeMap,
|
|
550
|
+
Ge as plugin,
|
|
551
|
+
le as pluginCore,
|
|
552
|
+
ae as samples
|
|
516
553
|
};
|