@querlo/sdk 1.0.0
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/LICENSE +21 -0
- package/QUERLO_SDK_GUIDE.md +167 -0
- package/README.md +55 -0
- package/dist/components/App.d.ts +6 -0
- package/dist/components/Chat.d.ts +14 -0
- package/dist/components/Imagepopup.d.ts +6 -0
- package/dist/icons.d.ts +7 -0
- package/dist/index.d.ts +3 -0
- package/dist/querlo-client.service.d.ts +79 -0
- package/dist/querlo-sdk.es.js +688 -0
- package/dist/querlo-sdk.umd.js +2 -0
- package/dist/referral.d.ts +1 -0
- package/dist/templates.d.ts +1 -0
- package/dist/utility.d.ts +6 -0
- package/package.json +53 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Querlo
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
# Querlo Chatbot SDK Reference Guide
|
|
2
|
+
|
|
3
|
+
This guide describes how to use the Querlo Client-Side SDK to embed, control, and interact with Querlo chatbots programmatically within your web applications.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Table of Contents
|
|
8
|
+
1. [Setup and Initialization](#setup-and-initialization)
|
|
9
|
+
2. [Embedding Chatbots](#embedding-chatbots)
|
|
10
|
+
3. [The Global `Querlo` Object](#the-global-querlo-object)
|
|
11
|
+
4. [Instance Control (Controller)](#instance-control-controller)
|
|
12
|
+
5. [Event System](#event-system)
|
|
13
|
+
6. [Complete Examples](#complete-examples)
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Setup and Initialization
|
|
18
|
+
|
|
19
|
+
To use the SDK, include the Querlo embed script in your HTML. Once loaded, it attaches a global `Querlo` object to the `window`.
|
|
20
|
+
|
|
21
|
+
### Loading the SDK
|
|
22
|
+
```html
|
|
23
|
+
<!-- Load the Querlo SDK -->
|
|
24
|
+
<script type="module" src="https://path-to-your-sdk/index.js"></script>
|
|
25
|
+
|
|
26
|
+
<!-- Optional: Wait for the SDK to be ready -->
|
|
27
|
+
<script>
|
|
28
|
+
window.addEventListener('querlo-ready', function(e) {
|
|
29
|
+
console.log('Querlo SDK is ready!', e.detail);
|
|
30
|
+
});
|
|
31
|
+
</script>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Embedding Chatbots
|
|
37
|
+
|
|
38
|
+
There are two ways to embed a chatbot:
|
|
39
|
+
|
|
40
|
+
### 1. Declarative (HTML)
|
|
41
|
+
Add a `div` with the class `querlo` and the necessary data attributes. The SDK will automatically find and initialize it.
|
|
42
|
+
|
|
43
|
+
```html
|
|
44
|
+
<div class="querlo"
|
|
45
|
+
data-id="YOUR_CHATBOT_ID"
|
|
46
|
+
data-template="esd"
|
|
47
|
+
data-main-color="#ff0000">
|
|
48
|
+
</div>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### 2. Programmatic (JavaScript)
|
|
52
|
+
Use the `Querlo.embed()` method to create an instance dynamically.
|
|
53
|
+
|
|
54
|
+
```javascript
|
|
55
|
+
const myChat = Querlo.embed({
|
|
56
|
+
id: 'YOUR_CHATBOT_ID',
|
|
57
|
+
template: 'inpage_popup',
|
|
58
|
+
container: '#chat-container', // Optional selector or element
|
|
59
|
+
mainColor: 'rgb(253, 168, 176)'
|
|
60
|
+
});
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## The Global `Querlo` Object
|
|
66
|
+
|
|
67
|
+
The `Querlo` object provides methods to control **all** instances on the page simultaneously.
|
|
68
|
+
|
|
69
|
+
| Method | Description |
|
|
70
|
+
| :--- | :--- |
|
|
71
|
+
| `embed(options)` | Initializes a new chatbot instance. Returns a [Controller](#instance-control-controller). |
|
|
72
|
+
| `open(fullscreen?)` | Opens all chatbot instances. If `fullscreen` is true, applies fullscreen mode. |
|
|
73
|
+
| `openFullscreen()` | Convenience method to open all instances in fullscreen. |
|
|
74
|
+
| `close()` | Closes all chatbot instances. |
|
|
75
|
+
| `sendMessage(text)` | Sends a text message to all active chatbots. |
|
|
76
|
+
| `setVariable(name, value)` | Sets a chat variable in all active chatbot sessions. |
|
|
77
|
+
| `on(event, callback)` | Subscribes to global events (see [Events](#event-system)). Returns an unsubscribe function. |
|
|
78
|
+
| `isLoading()` | Returns `true` if any chatbot is currently waiting for a network response. |
|
|
79
|
+
| `isWaiting()` | Returns `true` if any chatbot is waiting for user interaction. |
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## Instance Control (Controller)
|
|
84
|
+
|
|
85
|
+
When you call `Querlo.embed()`, it returns a controller for that specific instance. This allows you to manage multiple chatbots independently.
|
|
86
|
+
|
|
87
|
+
```javascript
|
|
88
|
+
const chat = Querlo.embed({ id: 'ABC_123' });
|
|
89
|
+
|
|
90
|
+
chat.open(); // Opens ONLY this instance
|
|
91
|
+
chat.close(); // Closes ONLY this instance
|
|
92
|
+
chat.sendMessage('Hi'); // Sends message to ONLY this instance
|
|
93
|
+
chat.destroy(); // Removes this instance from the DOM
|
|
94
|
+
console.log(chat.element); // Access the root HTMLElement
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Event System
|
|
100
|
+
|
|
101
|
+
The SDK uses an event-driven architecture to communicate back to your application.
|
|
102
|
+
|
|
103
|
+
### Subscribing to Events
|
|
104
|
+
```javascript
|
|
105
|
+
// Subscribe to a specific event
|
|
106
|
+
const removeListener = Querlo.on('BUILD_PAGE', (payload) => {
|
|
107
|
+
console.log('Page generated:', payload.page.title);
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
// To stop listening later:
|
|
111
|
+
removeListener();
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Common Events
|
|
115
|
+
|
|
116
|
+
| Event | Payload | Description |
|
|
117
|
+
| :--- | :--- | :--- |
|
|
118
|
+
| `BUILD_PAGE` | `BuildPagePayload` | Triggered when the chatbot generates a new content page. |
|
|
119
|
+
| `WAITING_REQUEST` | `MessageData` | Triggered when the chatbot stops and waits for user input. |
|
|
120
|
+
| `loading` | `boolean` | Triggered when the chatbot starts or finishes a network request. |
|
|
121
|
+
| `message` | `object` | Triggered for every incoming `postMessage` from the chatbot. |
|
|
122
|
+
| `OPEN` / `CLOSE` | `object` | Triggered when the chatbot UI state changes. |
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## Complete Examples
|
|
127
|
+
|
|
128
|
+
### Listening for Content Metadata
|
|
129
|
+
If your chatbot is configured to send custom data during a "BUILD_PAGE" event, you can capture it like this:
|
|
130
|
+
|
|
131
|
+
```javascript
|
|
132
|
+
Querlo.on('BUILD_PAGE', (payload) => {
|
|
133
|
+
const pageData = payload.page;
|
|
134
|
+
const missingInfo = payload.missing_info;
|
|
135
|
+
|
|
136
|
+
console.log(`User is on page: ${pageData.title}`);
|
|
137
|
+
|
|
138
|
+
if (missingInfo.length > 0) {
|
|
139
|
+
console.log('Chatbot is missing these fields:', missingInfo);
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Feeding Data from your Website
|
|
145
|
+
You can send variables back to the chatbot to personalize the conversation:
|
|
146
|
+
|
|
147
|
+
```javascript
|
|
148
|
+
// Example: Setting a user's name from your database
|
|
149
|
+
Querlo.setVariable('user_name', 'John Doe');
|
|
150
|
+
|
|
151
|
+
// Example: Sending a message as if the user typed it
|
|
152
|
+
window.getElementById('my-button').onclick = () => {
|
|
153
|
+
Querlo.sendMessage('Start the product tour');
|
|
154
|
+
};
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Multi-Chatbot Scenario
|
|
158
|
+
```javascript
|
|
159
|
+
const sidebarChat = Querlo.embed({ id: 'ID_1', template: 'esd' });
|
|
160
|
+
const assistantChat = Querlo.embed({ id: 'ID_2', template: 'inpage' });
|
|
161
|
+
|
|
162
|
+
// Open full screen specifically for the sidebar chat
|
|
163
|
+
sidebarChat.open(true);
|
|
164
|
+
|
|
165
|
+
// Close everything when user logs out
|
|
166
|
+
Querlo.close();
|
|
167
|
+
```
|
package/README.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Querlo Chatbot SDK
|
|
2
|
+
|
|
3
|
+
The Querlo Chatbot SDK allows you to embed and manage multiple highly-customizable chatbot instances on any webpage. It supports programmatic control, custom positioning, entry animations, and a premium fullscreen experience.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
### Via NPM (Recommended for Modern Bundlers)
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @querlo/sdk
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
```javascript
|
|
14
|
+
import Querlo from '@querlo/sdk';
|
|
15
|
+
|
|
16
|
+
// Progammatically embed a chatbot
|
|
17
|
+
const chat = Querlo.embed({
|
|
18
|
+
id: 'YOUR_BOT_ID',
|
|
19
|
+
template: 'esd',
|
|
20
|
+
mainColor: '#ff0000',
|
|
21
|
+
posX: 'right',
|
|
22
|
+
posY: 'bottom'
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
chat.open();
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Via Browser Script Tag
|
|
29
|
+
|
|
30
|
+
```html
|
|
31
|
+
<script src="https://cdn.example.com/@querlo/sdk/dist/querlo-sdk.umd.js"></script>
|
|
32
|
+
<script>
|
|
33
|
+
Querlo.embed({
|
|
34
|
+
id: 'YOUR_BOT_ID',
|
|
35
|
+
template: 'esd'
|
|
36
|
+
});
|
|
37
|
+
</script>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Features
|
|
41
|
+
|
|
42
|
+
- **Multi-Instance Support**: Run multiple chatbots on the same page without conflicts.
|
|
43
|
+
- **Programmatic API**: Control individual bots via a returned `controller`.
|
|
44
|
+
- **Global Commands**: Manage all onscreen bots with a single call (e.g., `Querlo.close()`).
|
|
45
|
+
- **Flexible Positioning**: Place bots in any corner (`top-left`, `top-right`, `bottom-left`, `bottom-right`).
|
|
46
|
+
- **Premium Aesthetics**: Smooth SVG-based entry animations and fluid fullscreen transitions.
|
|
47
|
+
- **CSS Injected by JS**: No need to link external CSS files; everything is bundled in the JS.
|
|
48
|
+
|
|
49
|
+
## Documentation
|
|
50
|
+
|
|
51
|
+
For a full reference of commands, events, and templates, please refer to the [QUERLO_SDK_GUIDE.md](./QUERLO_SDK_GUIDE.md).
|
|
52
|
+
|
|
53
|
+
## License
|
|
54
|
+
|
|
55
|
+
MIT
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Component, RenderableProps } from 'preact';
|
|
2
|
+
export default class Chat extends Component<any, any> {
|
|
3
|
+
constructor();
|
|
4
|
+
toggle: (e: any, forceFullscreen?: boolean) => void;
|
|
5
|
+
toggleHoverColor: (event: any, color: string) => void;
|
|
6
|
+
toggleFullscreen: (e: Event) => void;
|
|
7
|
+
componentDidMount(): void;
|
|
8
|
+
componentWillUnmount(): void;
|
|
9
|
+
handleScopedCommand: (e: CustomEvent) => void;
|
|
10
|
+
closeImagePopup: () => void;
|
|
11
|
+
receiveMessage: (e: any) => void;
|
|
12
|
+
stopPropagation: (e: Event) => void;
|
|
13
|
+
render(props: RenderableProps<any>, state: Readonly<any>): any;
|
|
14
|
+
}
|
package/dist/icons.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { h } from 'preact';
|
|
2
|
+
export declare function Iconcomment(): h.JSX.Element;
|
|
3
|
+
export declare function Iconwindowminimize(): h.JSX.Element;
|
|
4
|
+
export declare function Iconwindowmaximize(): h.JSX.Element;
|
|
5
|
+
export declare function Iconhelp(): h.JSX.Element;
|
|
6
|
+
export declare function Iconcancel(): h.JSX.Element;
|
|
7
|
+
export declare const svg_icons: h.JSX.Element;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
export interface QuerloEmbedOptions {
|
|
2
|
+
id: string;
|
|
3
|
+
width?: string;
|
|
4
|
+
height?: string;
|
|
5
|
+
template?: string;
|
|
6
|
+
posX?: string;
|
|
7
|
+
posY?: string;
|
|
8
|
+
mainColor?: string;
|
|
9
|
+
speakerImg?: string;
|
|
10
|
+
speakerName?: string;
|
|
11
|
+
introTxt?: string;
|
|
12
|
+
delay?: string;
|
|
13
|
+
container?: string | HTMLElement;
|
|
14
|
+
}
|
|
15
|
+
export interface QuerloController {
|
|
16
|
+
open: (fullscreen?: boolean) => void;
|
|
17
|
+
close: () => void;
|
|
18
|
+
sendMessage: (text: string) => void;
|
|
19
|
+
setVariable: (varName: string, varContent: any) => void;
|
|
20
|
+
destroy: () => void;
|
|
21
|
+
element: HTMLElement;
|
|
22
|
+
}
|
|
23
|
+
export interface QuerloIncomingMessage {
|
|
24
|
+
querloMessageType: string;
|
|
25
|
+
querloMessageBody: any;
|
|
26
|
+
}
|
|
27
|
+
export interface BuildPagePayload {
|
|
28
|
+
page: any;
|
|
29
|
+
missing_info: string[];
|
|
30
|
+
version?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface QuerloEventListener {
|
|
33
|
+
(payload: any): void;
|
|
34
|
+
}
|
|
35
|
+
declare class QuerloClientAPIService {
|
|
36
|
+
private listeners;
|
|
37
|
+
private initialized;
|
|
38
|
+
private _loading;
|
|
39
|
+
private _chatbotWaiting;
|
|
40
|
+
private controllers;
|
|
41
|
+
constructor();
|
|
42
|
+
/**
|
|
43
|
+
* Initializes a new chatbot instance.
|
|
44
|
+
* @returns A controller object to interact with this specific instance.
|
|
45
|
+
*/
|
|
46
|
+
embed(options: QuerloEmbedOptions): QuerloController;
|
|
47
|
+
/**
|
|
48
|
+
* Shows ALL chatbot instances.
|
|
49
|
+
*/
|
|
50
|
+
open(fullscreen?: boolean): void;
|
|
51
|
+
/**
|
|
52
|
+
* Shows ALL chatbot instances in fullscreen mode.
|
|
53
|
+
*/
|
|
54
|
+
openFullscreen(): void;
|
|
55
|
+
/**
|
|
56
|
+
* Hides ALL chatbot instances.
|
|
57
|
+
*/
|
|
58
|
+
close(): void;
|
|
59
|
+
/**
|
|
60
|
+
* Sends a custom text message to ALL chatbot instances.
|
|
61
|
+
*/
|
|
62
|
+
sendMessage(text: string): void;
|
|
63
|
+
/**
|
|
64
|
+
* Sets a chat variable in ALL chatbot instances.
|
|
65
|
+
*/
|
|
66
|
+
setVariable(varName: string, varContent: any): void;
|
|
67
|
+
isLoading(): boolean;
|
|
68
|
+
isWaiting(): boolean;
|
|
69
|
+
on(event: string, callback: QuerloEventListener): () => void;
|
|
70
|
+
off(event: string, callback: QuerloEventListener): void;
|
|
71
|
+
private sendCommand;
|
|
72
|
+
private sendCommandToElement;
|
|
73
|
+
private initMessageListener;
|
|
74
|
+
private parseBuildPageEvent;
|
|
75
|
+
private normalizeMessage;
|
|
76
|
+
private emit;
|
|
77
|
+
}
|
|
78
|
+
export declare const QuerloAPI: QuerloClientAPIService;
|
|
79
|
+
export default QuerloAPI;
|
|
@@ -0,0 +1,688 @@
|
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.querlo{transition:all .5s cubic-bezier(.16,1,.3,1)}.querlo *{margin:0;padding:0;border:0;vertical-align:baseline;box-sizing:border-box;font-family:Roboto,Helvetica Neue,sans-serif;color:#444}.querlo .iframeWrp{transition:all .5s cubic-bezier(.16,1,.3,1)}.querlo iframe{display:none;width:100%;border-width:0}.querlo .querlo_open iframe{display:block}.querlo.esd{position:fixed;width:500px;background:none;z-index:9999;transition:all .5s cubic-bezier(.16,1,.3,1)}.querlo.esd.bottom{bottom:10px}.querlo.esd.top{top:10px}.querlo.esd.right{right:10px}.querlo.esd.left{left:10px}.querlo.esd.querlo_fullscreen{width:100%!important;height:100%!important;bottom:0!important;right:0!important;left:0!important;top:0!important}.querlo.esd.querlo_fullscreen .querlo_iframeWrp{height:calc(100% - 50px)!important;max-height:none}.querlo.esd.querlo_fullscreen .querlo_chatWrp,.querlo.esd.querlo_fullscreen .querlo_openWrp,.querlo.esd.querlo_fullscreen .querlo_bodyWrp{height:100%!important}.querlo.esd.querlo_fullscreen .querlo_avatar{margin:0 10px 10px 0;box-shadow:none}.querlo.esd.querlo_fullscreen .querlo_message{margin-bottom:10px}.querlo.esd.querlo_fullscreen .querlo_bodyWrp{box-shadow:none;border-radius:0;margin-bottom:0}.querlo.esd.querlo_fullscreen .querlo_copy{float:none;margin:0}.querlo.esd.querlo_fullscreen .querlo_number{margin:0 10px 10px 0}.querlo.esd.querlo_fullscreen .querlo_resizeButton{margin-right:68px!important}@media screen and (max-width:812px){.querlo.esd.querlo_fullscreen .querlo_resizeButton{display:none}}.querlo.esd .querlo_iframeWrp{background:#fff;height:calc(100vh - 90px);max-height:600px}.querlo.esd .querlo_iframeWrp iframe{height:100%}@media screen and (max-width:812px){.querlo.esd .querlo_iframeWrp{height:calc(100% - 50px);max-height:none}}.querlo.esd .querlo_chatWrp{position:relative}@media screen and (max-width:812px){.querlo.esd .querlo_chatWrp{height:100%}}@media screen and (max-width:812px){.querlo.esd .querlo_chatWrp.querlo_open{width:100%;height:100%;top:0;bottom:0;right:0;left:0;position:fixed}}.querlo.esd .querlo_chatBar{position:fixed}.querlo.esd.bottom .querlo_chatBar{bottom:10px}.querlo.esd.top .querlo_chatBar{top:10px}.querlo.esd.right .querlo_chatBar{right:10px}.querlo.esd.left .querlo_chatBar{left:10px}.querlo.esd .querlo_open .querlo_chatBar{display:none}.querlo.esd .querlo_message{padding:12px 16px 12px 18px;font-size:13px;color:#000;background:#fff;max-width:260px;box-shadow:0 0 10px #00000026,0 0 30px #0000004d;border-radius:5px;position:relative}@media screen and (max-width:812px){.querlo.esd .querlo_message{margin-bottom:10px}}.querlo.esd .querlo_message:after{content:"";position:absolute;width:0;height:0;border:10px solid transparent;margin-top:-5px}.querlo.esd.right .querlo_message{float:right;margin-right:10px}.querlo.esd.right .querlo_message:after{right:-10px;border-left-color:#fff}.querlo.esd.left .querlo_message{float:left;margin-left:10px}.querlo.esd.left .querlo_message:after{left:-10px;border-right-color:#fff}.querlo.esd.bottom .querlo_message:after{bottom:20px}.querlo.esd.top .querlo_message:after{top:20px}.querlo.esd .querlo_avatar{border-radius:50%;border:3px solid #f1592a;cursor:pointer;width:60px;height:60px;overflow:hidden;transition:all .3s;transform-origin:50% 50%;box-shadow:0 0 10px #00000026,0 0 30px #0000004d}@media screen and (max-width:812px){.querlo.esd .querlo_avatar{margin:0 10px 10px 0;box-shadow:none}}.querlo.esd .querlo_avatar img{width:100%}.querlo.esd.right .querlo_avatar{float:right}.querlo.esd.left .querlo_avatar{float:left}.querlo.esd .querlo_avatar:hover{width:60px;height:60px}.querlo.esd .querlo_openWrp{display:none}@media screen and (max-width:812px){.querlo.esd .querlo_openWrp{height:100%}}.querlo.esd .querlo_open .querlo_openWrp{display:block;animation-duration:.4s;animation-timing-function:cubic-bezier(.16,1,.3,1);animation-fill-mode:forwards}.querlo.esd .querlo_bodyWrp{box-shadow:0 0 10px #00000026,0 0 30px #0000004d;border-radius:5px;overflow:hidden}@media screen and (max-width:812px){.querlo.esd .querlo_bodyWrp{box-shadow:none;border-radius:0;height:100%}}.querlo.esd.bottom .querlo_bodyWrp{margin-bottom:10px}.querlo.esd.top .querlo_bodyWrp{margin-top:10px}.querlo.esd.top .querlo_openWrp{display:flex;flex-direction:column-reverse}.querlo.esd .querlo_header{background:#f1592a;color:#fff;height:50px;line-height:48px;font-size:16px;text-align:center}.querlo.esd .querlo_header .querlo_buttonsWrp{float:right;height:50px;display:flex;justify-content:center;align-items:center}.querlo.esd .querlo_header .querlo_buttonsWrp a{display:flex;justify-content:center;align-items:center;padding:10px 13px}.querlo.esd .querlo_header .querlo_buttonsWrp svg{fill:#fff;height:48px}.querlo.esd .querlo_header .querlo_buttonsWrp a:hover{background:#fff}.querlo.esd .querlo_copy{display:block;padding:10px;font-size:12px;background:#fff;text-decoration:none;color:#a8b6c2}@media screen and (max-width:812px){.querlo.esd .querlo_copy{float:none;margin:0}}.querlo.esd .querlo_copy span{font-size:12px;color:#23a7d6}.querlo.esd .querlo_copy:hover{background:#23a7d6;color:#fff}.querlo.esd .querlo_copy:hover span{color:#fff}.querlo.esd .querlo_number{position:absolute;width:20px;height:20px;right:-4px;top:-4px;border-radius:50%;color:#fff;font-size:11px;border:2px solid #fff;background:#f82d6c;line-height:18px;text-align:center}@media screen and (max-width:812px){.querlo.esd .querlo_number{margin:0 10px 10px 0}}.querlo.esd.top,.querlo.esd.top .querlo_openWrp{animation-name:qrlEntranceTop}.querlo.esd.bottom,.querlo.esd.bottom .querlo_openWrp{animation-name:qrlEntranceBottom}.querlo.esd footer{text-align:center}.qrlpulse{animation-iteration-count:infinite;animation-name:qrlpulse;animation-duration:2s;animation-fill-mode:both}@keyframes qrlpulse{0%{transform:scaleZ(1)}50%{transform:scale3d(1.05,1.05,1.05)}to{transform:scaleZ(1)}}.qrlfadeInUp{animation-name:qrlfadeInUp;animation-duration:1s;animation-delay:1s;animation-fill-mode:both}.qrlfadeInUp2{animation-name:qrlfadeInUp;animation-duration:.5s;animation-fill-mode:both}@keyframes qrlEntranceBottom{0%{opacity:0;transform:scale(.9) translateY(20px)}to{opacity:1;transform:scale(1) translateY(0)}}@keyframes qrlEntranceTop{0%{opacity:0;transform:scale(.9) translateY(-20px)}to{opacity:1;transform:scale(1) translateY(0)}}@keyframes qrlfadeInUp{0%{opacity:0;transform:translate3d(0,500px,0)}to{opacity:1;transform:none}}.querlo.inpage{display:flex;flex-direction:column}.querlo.inpage iframe{flex:1;display:block}.querlo .querlo_icon{display:inline-block;width:1em;height:1em;stroke-width:0;stroke:currentColor;fill:currentColor}.querlo .icon-help-circled{width:.857421875em}.querlo.inpage_popup{display:flex;flex-direction:column}.querlo.inpage_popup iframe{display:block}.querlo.inpage_popup .querlo_popup_center{flex:1;display:flex;flex-direction:column;transition:background-color .3s ease-in-out}.querlo.inpage_popup .querlo_popup_center.closed{position:relative;cursor:pointer}.querlo.inpage_popup .querlo_popup_center.closed iframe{flex:1;height:auto;pointer-events:none}.querlo.inpage_popup .querlo_popup_center.closed .querlo_overlay{position:absolute;top:0;left:0;width:100%;height:100%;z-index:10;background:transparent}.querlo.inpage_popup .querlo_popup_center.open{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);width:90%;max-width:800px;height:80vh;z-index:99999;box-shadow:0 0 20px #0000004d;background:#fff;border-radius:8px;overflow:hidden;animation:zoomIn .4s cubic-bezier(.16,1,.3,1) forwards}.querlo.inpage_popup .querlo_popup_center.open .querlo_overlay{display:none}.querlo.inpage_popup .querlo_popup_center.open iframe{width:100%;height:100%;border:none}.querlo.inpage_popup .querlo_popup_center.open .querlo_close_btn{position:absolute;top:10px;right:10px;width:30px;height:30px;background:#00000080;color:#fff;border-radius:50%;display:flex;align-items:center;justify-content:center;cursor:pointer;z-index:20;opacity:0;animation:fadeIn .3s ease-in-out .3s forwards}.querlo.inpage_popup .querlo_popup_center.open .querlo_close_btn svg{width:16px;height:16px;fill:#fff}.querlo.inpage_popup .querlo_popup_center.open .querlo_close_btn:hover{background:#000000b3}@media(max-width:768px){.querlo.inpage_popup .querlo_popup_center.open{width:100%;height:100%;max-width:none;max-height:none;border-radius:0}}@keyframes zoomIn{0%{position:fixed;top:var(--origin-top);left:var(--origin-left);width:var(--origin-width);height:var(--origin-height);transform:translate(0);border-radius:0}to{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);width:90%;max-width:990px;height:80vh;border-radius:8px}}@media(max-width:768px){@keyframes zoomIn{0%{position:fixed;top:var(--origin-top);left:var(--origin-left);width:var(--origin-width);height:var(--origin-height);transform:translate(0);border-radius:0}to{position:fixed;top:0;left:0;transform:translate(0);width:100%;height:100%;border-radius:0}}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.querlo .querlo_popup{position:fixed;top:0;left:0;right:0;bottom:0;background:#0003;display:flex;justify-content:center;align-items:center}.querlo .querlo_popup .querlo_contentWrp{border-radius:5px;width:95%;height:auto;background:#fff;overflow:hidden;box-shadow:0 2px 6px #0000002b}.querlo .querlo_popup .querlo_header{height:50px!important}.querlo .querlo_popup .querlo_close{background:none!important;box-shadow:none!important}.querlo .querlo_popup img{width:100%}.querlo .querlo_popup section{height:calc(100% - 60px);padding:15px!important}.querlo .querlo_popup section iframe{border:0;display:block;width:100%;height:100%}')),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
2
|
+
var le = Object.defineProperty;
|
|
3
|
+
var ae = (n, e, t) => e in n ? le(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
4
|
+
var y = (n, e, t) => ae(n, typeof e != "symbol" ? e + "" : e, t);
|
|
5
|
+
var A, m, Z, P, F, N = {}, J = [], ce = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;
|
|
6
|
+
function C(n, e) {
|
|
7
|
+
for (var t in e) n[t] = e[t];
|
|
8
|
+
return n;
|
|
9
|
+
}
|
|
10
|
+
function K(n) {
|
|
11
|
+
var e = n.parentNode;
|
|
12
|
+
e && e.removeChild(n);
|
|
13
|
+
}
|
|
14
|
+
function de(n, e, t) {
|
|
15
|
+
var i, r, o, a = {};
|
|
16
|
+
for (o in e) o == "key" ? i = e[o] : o == "ref" ? r = e[o] : a[o] = e[o];
|
|
17
|
+
if (arguments.length > 2 && (a.children = arguments.length > 3 ? A.call(arguments, 2) : t), typeof n == "function" && n.defaultProps != null) for (o in n.defaultProps) a[o] === void 0 && (a[o] = n.defaultProps[o]);
|
|
18
|
+
return L(n, a, i, r, null);
|
|
19
|
+
}
|
|
20
|
+
function L(n, e, t, i, r) {
|
|
21
|
+
var o = { type: n, props: e, key: t, ref: i, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, __h: null, constructor: void 0, __v: r ?? ++Z };
|
|
22
|
+
return r == null && m.vnode != null && m.vnode(o), o;
|
|
23
|
+
}
|
|
24
|
+
function U(n) {
|
|
25
|
+
return n.children;
|
|
26
|
+
}
|
|
27
|
+
function k(n, e) {
|
|
28
|
+
this.props = n, this.context = e;
|
|
29
|
+
}
|
|
30
|
+
function x(n, e) {
|
|
31
|
+
if (e == null) return n.__ ? x(n.__, n.__.__k.indexOf(n) + 1) : null;
|
|
32
|
+
for (var t; e < n.__k.length; e++) if ((t = n.__k[e]) != null && t.__e != null) return t.__e;
|
|
33
|
+
return typeof n.type == "function" ? x(n) : null;
|
|
34
|
+
}
|
|
35
|
+
function ee(n) {
|
|
36
|
+
var e, t;
|
|
37
|
+
if ((n = n.__) != null && n.__c != null) {
|
|
38
|
+
for (n.__e = n.__c.base = null, e = 0; e < n.__k.length; e++) if ((t = n.__k[e]) != null && t.__e != null) {
|
|
39
|
+
n.__e = n.__c.base = t.__e;
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
return ee(n);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function G(n) {
|
|
46
|
+
(!n.__d && (n.__d = !0) && P.push(n) && !z.__r++ || F !== m.debounceRendering) && ((F = m.debounceRendering) || setTimeout)(z);
|
|
47
|
+
}
|
|
48
|
+
function z() {
|
|
49
|
+
for (var n; z.__r = P.length; ) n = P.sort(function(e, t) {
|
|
50
|
+
return e.__v.__b - t.__v.__b;
|
|
51
|
+
}), P = [], n.some(function(e) {
|
|
52
|
+
var t, i, r, o, a, l;
|
|
53
|
+
e.__d && (a = (o = (t = e).__v).__e, (l = t.__P) && (i = [], (r = C({}, o)).__v = o.__v + 1, O(l, o, r, t.__n, l.ownerSVGElement !== void 0, o.__h != null ? [a] : null, i, a ?? x(o), o.__h), oe(i, o), o.__e != a && ee(o)));
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
function te(n, e, t, i, r, o, a, l, u, f) {
|
|
57
|
+
var s, p, _, d, h, E, g, v = i && i.__k || J, q = v.length;
|
|
58
|
+
for (t.__k = [], s = 0; s < e.length; s++) if ((d = t.__k[s] = (d = e[s]) == null || typeof d == "boolean" ? null : typeof d == "string" || typeof d == "number" || typeof d == "bigint" ? L(null, d, null, null, d) : Array.isArray(d) ? L(U, { children: d }, null, null, null) : d.__b > 0 ? L(d.type, d.props, d.key, null, d.__v) : d) != null) {
|
|
59
|
+
if (d.__ = t, d.__b = t.__b + 1, (_ = v[s]) === null || _ && d.key == _.key && d.type === _.type) v[s] = void 0;
|
|
60
|
+
else for (p = 0; p < q; p++) {
|
|
61
|
+
if ((_ = v[p]) && d.key == _.key && d.type === _.type) {
|
|
62
|
+
v[p] = void 0;
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
_ = null;
|
|
66
|
+
}
|
|
67
|
+
O(n, d, _ = _ || N, r, o, a, l, u, f), h = d.__e, (p = d.ref) && _.ref != p && (g || (g = []), _.ref && g.push(_.ref, null, d), g.push(p, d.__c || h, d)), h != null ? (E == null && (E = h), typeof d.type == "function" && d.__k === _.__k ? d.__d = u = ne(d, u, n) : u = ie(n, d, _, v, h, u), typeof t.type == "function" && (t.__d = u)) : u && _.__e == u && u.parentNode != n && (u = x(_));
|
|
68
|
+
}
|
|
69
|
+
for (t.__e = E, s = q; s--; ) v[s] != null && (typeof t.type == "function" && v[s].__e != null && v[s].__e == t.__d && (t.__d = x(i, s + 1)), se(v[s], v[s]));
|
|
70
|
+
if (g) for (s = 0; s < g.length; s++) re(g[s], g[++s], g[++s]);
|
|
71
|
+
}
|
|
72
|
+
function ne(n, e, t) {
|
|
73
|
+
for (var i, r = n.__k, o = 0; r && o < r.length; o++) (i = r[o]) && (i.__ = n, e = typeof i.type == "function" ? ne(i, e, t) : ie(t, i, i, r, i.__e, e));
|
|
74
|
+
return e;
|
|
75
|
+
}
|
|
76
|
+
function ie(n, e, t, i, r, o) {
|
|
77
|
+
var a, l, u;
|
|
78
|
+
if (e.__d !== void 0) a = e.__d, e.__d = void 0;
|
|
79
|
+
else if (t == null || r != o || r.parentNode == null) e: if (o == null || o.parentNode !== n) n.appendChild(r), a = null;
|
|
80
|
+
else {
|
|
81
|
+
for (l = o, u = 0; (l = l.nextSibling) && u < i.length; u += 2) if (l == r) break e;
|
|
82
|
+
n.insertBefore(r, o), a = o;
|
|
83
|
+
}
|
|
84
|
+
return a !== void 0 ? a : r.nextSibling;
|
|
85
|
+
}
|
|
86
|
+
function _e(n, e, t, i, r) {
|
|
87
|
+
var o;
|
|
88
|
+
for (o in t) o === "children" || o === "key" || o in e || W(n, o, null, t[o], i);
|
|
89
|
+
for (o in e) r && typeof e[o] != "function" || o === "children" || o === "key" || o === "value" || o === "checked" || t[o] === e[o] || W(n, o, e[o], t[o], i);
|
|
90
|
+
}
|
|
91
|
+
function $(n, e, t) {
|
|
92
|
+
e[0] === "-" ? n.setProperty(e, t) : n[e] = t == null ? "" : typeof t != "number" || ce.test(e) ? t : t + "px";
|
|
93
|
+
}
|
|
94
|
+
function W(n, e, t, i, r) {
|
|
95
|
+
var o;
|
|
96
|
+
e: if (e === "style") if (typeof t == "string") n.style.cssText = t;
|
|
97
|
+
else {
|
|
98
|
+
if (typeof i == "string" && (n.style.cssText = i = ""), i) for (e in i) t && e in t || $(n.style, e, "");
|
|
99
|
+
if (t) for (e in t) i && t[e] === i[e] || $(n.style, e, t[e]);
|
|
100
|
+
}
|
|
101
|
+
else if (e[0] === "o" && e[1] === "n") o = e !== (e = e.replace(/Capture$/, "")), e = e.toLowerCase() in n ? e.toLowerCase().slice(2) : e.slice(2), n.l || (n.l = {}), n.l[e + o] = t, t ? i || n.addEventListener(e, o ? X : j, o) : n.removeEventListener(e, o ? X : j, o);
|
|
102
|
+
else if (e !== "dangerouslySetInnerHTML") {
|
|
103
|
+
if (r) e = e.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
|
|
104
|
+
else if (e !== "href" && e !== "list" && e !== "form" && e !== "tabIndex" && e !== "download" && e in n) try {
|
|
105
|
+
n[e] = t ?? "";
|
|
106
|
+
break e;
|
|
107
|
+
} catch {
|
|
108
|
+
}
|
|
109
|
+
typeof t == "function" || (t != null && (t !== !1 || e[0] === "a" && e[1] === "r") ? n.setAttribute(e, t) : n.removeAttribute(e));
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
function j(n) {
|
|
113
|
+
this.l[n.type + !1](m.event ? m.event(n) : n);
|
|
114
|
+
}
|
|
115
|
+
function X(n) {
|
|
116
|
+
this.l[n.type + !0](m.event ? m.event(n) : n);
|
|
117
|
+
}
|
|
118
|
+
function O(n, e, t, i, r, o, a, l, u) {
|
|
119
|
+
var f, s, p, _, d, h, E, g, v, q, M, R, T, w = e.type;
|
|
120
|
+
if (e.constructor !== void 0) return null;
|
|
121
|
+
t.__h != null && (u = t.__h, l = e.__e = t.__e, e.__h = null, o = [l]), (f = m.__b) && f(e);
|
|
122
|
+
try {
|
|
123
|
+
e: if (typeof w == "function") {
|
|
124
|
+
if (g = e.props, v = (f = w.contextType) && i[f.__c], q = f ? v ? v.props.value : f.__ : i, t.__c ? E = (s = e.__c = t.__c).__ = s.__E : ("prototype" in w && w.prototype.render ? e.__c = s = new w(g, q) : (e.__c = s = new k(g, q), s.constructor = w, s.render = he), v && v.sub(s), s.props = g, s.state || (s.state = {}), s.context = q, s.__n = i, p = s.__d = !0, s.__h = []), s.__s == null && (s.__s = s.state), w.getDerivedStateFromProps != null && (s.__s == s.state && (s.__s = C({}, s.__s)), C(s.__s, w.getDerivedStateFromProps(g, s.__s))), _ = s.props, d = s.state, p) w.getDerivedStateFromProps == null && s.componentWillMount != null && s.componentWillMount(), s.componentDidMount != null && s.__h.push(s.componentDidMount);
|
|
125
|
+
else {
|
|
126
|
+
if (w.getDerivedStateFromProps == null && g !== _ && s.componentWillReceiveProps != null && s.componentWillReceiveProps(g, q), !s.__e && s.shouldComponentUpdate != null && s.shouldComponentUpdate(g, s.__s, q) === !1 || e.__v === t.__v) {
|
|
127
|
+
s.props = g, s.state = s.__s, e.__v !== t.__v && (s.__d = !1), s.__v = e, e.__e = t.__e, e.__k = t.__k, e.__k.forEach(function(I) {
|
|
128
|
+
I && (I.__ = e);
|
|
129
|
+
}), s.__h.length && a.push(s);
|
|
130
|
+
break e;
|
|
131
|
+
}
|
|
132
|
+
s.componentWillUpdate != null && s.componentWillUpdate(g, s.__s, q), s.componentDidUpdate != null && s.__h.push(function() {
|
|
133
|
+
s.componentDidUpdate(_, d, h);
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
if (s.context = q, s.props = g, s.__v = e, s.__P = n, M = m.__r, R = 0, "prototype" in w && w.prototype.render) s.state = s.__s, s.__d = !1, M && M(e), f = s.render(s.props, s.state, s.context);
|
|
137
|
+
else do
|
|
138
|
+
s.__d = !1, M && M(e), f = s.render(s.props, s.state, s.context), s.state = s.__s;
|
|
139
|
+
while (s.__d && ++R < 25);
|
|
140
|
+
s.state = s.__s, s.getChildContext != null && (i = C(C({}, i), s.getChildContext())), p || s.getSnapshotBeforeUpdate == null || (h = s.getSnapshotBeforeUpdate(_, d)), T = f != null && f.type === U && f.key == null ? f.props.children : f, te(n, Array.isArray(T) ? T : [T], e, t, i, r, o, a, l, u), s.base = e.__e, e.__h = null, s.__h.length && a.push(s), E && (s.__E = s.__ = null), s.__e = !1;
|
|
141
|
+
} else o == null && e.__v === t.__v ? (e.__k = t.__k, e.__e = t.__e) : e.__e = ue(t.__e, e, t, i, r, o, a, u);
|
|
142
|
+
(f = m.diffed) && f(e);
|
|
143
|
+
} catch (I) {
|
|
144
|
+
e.__v = null, (u || o != null) && (e.__e = l, e.__h = !!u, o[o.indexOf(l)] = null), m.__e(I, e, t);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
function oe(n, e) {
|
|
148
|
+
m.__c && m.__c(e, n), n.some(function(t) {
|
|
149
|
+
try {
|
|
150
|
+
n = t.__h, t.__h = [], n.some(function(i) {
|
|
151
|
+
i.call(t);
|
|
152
|
+
});
|
|
153
|
+
} catch (i) {
|
|
154
|
+
m.__e(i, t.__v);
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
function ue(n, e, t, i, r, o, a, l) {
|
|
159
|
+
var u, f, s, p = t.props, _ = e.props, d = e.type, h = 0;
|
|
160
|
+
if (d === "svg" && (r = !0), o != null) {
|
|
161
|
+
for (; h < o.length; h++) if ((u = o[h]) && "setAttribute" in u == !!d && (d ? u.localName === d : u.nodeType === 3)) {
|
|
162
|
+
n = u, o[h] = null;
|
|
163
|
+
break;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
if (n == null) {
|
|
167
|
+
if (d === null) return document.createTextNode(_);
|
|
168
|
+
n = r ? document.createElementNS("http://www.w3.org/2000/svg", d) : document.createElement(d, _.is && _), o = null, l = !1;
|
|
169
|
+
}
|
|
170
|
+
if (d === null) p === _ || l && n.data === _ || (n.data = _);
|
|
171
|
+
else {
|
|
172
|
+
if (o = o && A.call(n.childNodes), f = (p = t.props || N).dangerouslySetInnerHTML, s = _.dangerouslySetInnerHTML, !l) {
|
|
173
|
+
if (o != null) for (p = {}, h = 0; h < n.attributes.length; h++) p[n.attributes[h].name] = n.attributes[h].value;
|
|
174
|
+
(s || f) && (s && (f && s.__html == f.__html || s.__html === n.innerHTML) || (n.innerHTML = s && s.__html || ""));
|
|
175
|
+
}
|
|
176
|
+
if (_e(n, _, p, r, l), s) e.__k = [];
|
|
177
|
+
else if (h = e.props.children, te(n, Array.isArray(h) ? h : [h], e, t, i, r && d !== "foreignObject", o, a, o ? o[0] : t.__k && x(t, 0), l), o != null) for (h = o.length; h--; ) o[h] != null && K(o[h]);
|
|
178
|
+
l || ("value" in _ && (h = _.value) !== void 0 && (h !== n.value || d === "progress" && !h || d === "option" && h !== p.value) && W(n, "value", h, p.value, !1), "checked" in _ && (h = _.checked) !== void 0 && h !== n.checked && W(n, "checked", h, p.checked, !1));
|
|
179
|
+
}
|
|
180
|
+
return n;
|
|
181
|
+
}
|
|
182
|
+
function re(n, e, t) {
|
|
183
|
+
try {
|
|
184
|
+
typeof n == "function" ? n(e) : n.current = e;
|
|
185
|
+
} catch (i) {
|
|
186
|
+
m.__e(i, t);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
function se(n, e, t) {
|
|
190
|
+
var i, r;
|
|
191
|
+
if (m.unmount && m.unmount(n), (i = n.ref) && (i.current && i.current !== n.__e || re(i, null, e)), (i = n.__c) != null) {
|
|
192
|
+
if (i.componentWillUnmount) try {
|
|
193
|
+
i.componentWillUnmount();
|
|
194
|
+
} catch (o) {
|
|
195
|
+
m.__e(o, e);
|
|
196
|
+
}
|
|
197
|
+
i.base = i.__P = null;
|
|
198
|
+
}
|
|
199
|
+
if (i = n.__k) for (r = 0; r < i.length; r++) i[r] && se(i[r], e, typeof n.type != "function");
|
|
200
|
+
t || n.__e == null || K(n.__e), n.__e = n.__d = void 0;
|
|
201
|
+
}
|
|
202
|
+
function he(n, e, t) {
|
|
203
|
+
return this.constructor(n, t);
|
|
204
|
+
}
|
|
205
|
+
function fe(n, e, t) {
|
|
206
|
+
var i, r, o;
|
|
207
|
+
m.__ && m.__(n, e), r = (i = !1) ? null : e.__k, o = [], O(e, n = e.__k = de(U, null, [n]), r || N, N, e.ownerSVGElement !== void 0, r ? null : e.firstChild ? A.call(e.childNodes) : null, o, r ? r.__e : e.firstChild, i), oe(o, n);
|
|
208
|
+
}
|
|
209
|
+
A = J.slice, m = { __e: function(n, e, t, i) {
|
|
210
|
+
for (var r, o, a; e = e.__; ) if ((r = e.__c) && !r.__) try {
|
|
211
|
+
if ((o = r.constructor) && o.getDerivedStateFromError != null && (r.setState(o.getDerivedStateFromError(n)), a = r.__d), r.componentDidCatch != null && (r.componentDidCatch(n, i || {}), a = r.__d), a) return r.__E = r;
|
|
212
|
+
} catch (l) {
|
|
213
|
+
n = l;
|
|
214
|
+
}
|
|
215
|
+
throw n;
|
|
216
|
+
} }, Z = 0, k.prototype.setState = function(n, e) {
|
|
217
|
+
var t;
|
|
218
|
+
t = this.__s != null && this.__s !== this.state ? this.__s : this.__s = C({}, this.state), typeof n == "function" && (n = n(C({}, t), this.props)), n && C(t, n), n != null && this.__v && (e && this.__h.push(e), G(this));
|
|
219
|
+
}, k.prototype.forceUpdate = function(n) {
|
|
220
|
+
this.__v && (this.__e = !0, n && this.__h.push(n), G(this));
|
|
221
|
+
}, k.prototype.render = U, P = [], z.__r = 0;
|
|
222
|
+
var pe = 0;
|
|
223
|
+
function c(n, e, t, i, r) {
|
|
224
|
+
var o, a, l = {};
|
|
225
|
+
for (a in e) a == "ref" ? o = e[a] : l[a] = e[a];
|
|
226
|
+
var u = { type: n, props: l, key: t, ref: o, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, __h: null, constructor: void 0, __v: --pe, __source: r, __self: i };
|
|
227
|
+
if (typeof n == "function" && (o = n.defaultProps)) for (a in o) l[a] === void 0 && (l[a] = o[a]);
|
|
228
|
+
return m.vnode && m.vnode(u), u;
|
|
229
|
+
}
|
|
230
|
+
function me() {
|
|
231
|
+
let n, e = ge("utm_source");
|
|
232
|
+
return e ? n = e : document.referrer ? n = document.referrer : n = "", encodeURIComponent(n + "");
|
|
233
|
+
}
|
|
234
|
+
function ge(n) {
|
|
235
|
+
n = n.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
|
|
236
|
+
let e = new RegExp("[\\?&]" + n + "=([^&#]*)"), t = e.exec(location.search);
|
|
237
|
+
return t === null ? "" : decodeURIComponent(t[1].replace(/\+/g, " "));
|
|
238
|
+
}
|
|
239
|
+
function ve() {
|
|
240
|
+
return /* @__PURE__ */ c("svg", { className: "querlo_icon icon-window-minimize", children: /* @__PURE__ */ c("use", { xlinkHref: "#icon-window-minimize" }) });
|
|
241
|
+
}
|
|
242
|
+
function ye() {
|
|
243
|
+
return /* @__PURE__ */ c("svg", { className: "querlo_icon icon-window-maximize", children: /* @__PURE__ */ c("use", { xlinkHref: "#icon-window-maximize" }) });
|
|
244
|
+
}
|
|
245
|
+
function H() {
|
|
246
|
+
return /* @__PURE__ */ c("svg", { className: "querlo_icon icon-cancel", children: /* @__PURE__ */ c("use", { xlinkHref: "#icon-cancel" }) });
|
|
247
|
+
}
|
|
248
|
+
const Q = /* @__PURE__ */ c("svg", { style: "position: absolute; width: 0; height: 0; overflow: hidden;", children: /* @__PURE__ */ c("defs", { children: [
|
|
249
|
+
/* @__PURE__ */ c("symbol", { id: "icon-cancel", viewBox: "0 0 25 32", children: [
|
|
250
|
+
/* @__PURE__ */ c("title", { children: "cancel" }),
|
|
251
|
+
/* @__PURE__ */ c("path", { d: "M23.168 23.616q0 0.704-0.48 1.216l-2.432 2.432q-0.512 0.48-1.216 0.48t-1.216-0.48l-5.248-5.28-5.248 5.28q-0.512 0.48-1.216 0.48t-1.216-0.48l-2.432-2.432q-0.512-0.512-0.512-1.216t0.512-1.216l5.248-5.248-5.248-5.248q-0.512-0.512-0.512-1.216t0.512-1.216l2.432-2.432q0.512-0.512 1.216-0.512t1.216 0.512l5.248 5.248 5.248-5.248q0.512-0.512 1.216-0.512t1.216 0.512l2.432 2.432q0.48 0.48 0.48 1.216t-0.48 1.216l-5.248 5.248 5.248 5.248q0.48 0.48 0.48 1.216z" })
|
|
252
|
+
] }),
|
|
253
|
+
/* @__PURE__ */ c("symbol", { id: "icon-help-circled", viewBox: "0 0 27 32", children: [
|
|
254
|
+
/* @__PURE__ */ c("title", { children: "help-circled" }),
|
|
255
|
+
/* @__PURE__ */ c("path", { d: "M16 24.576v-3.424q0-0.256-0.16-0.416t-0.416-0.16h-3.424q-0.256 0-0.416 0.16t-0.16 0.416v3.424q0 0.256 0.16 0.416t0.416 0.16h3.424q0.256 0 0.416-0.16t0.16-0.416zM20.576 12.576q0-1.568-0.992-2.912t-2.464-2.080-3.040-0.736q-4.352 0-6.624 3.808-0.288 0.416 0.128 0.768l2.368 1.76q0.128 0.128 0.32 0.128 0.288 0 0.448-0.224 0.96-1.216 1.536-1.632 0.608-0.448 1.536-0.448 0.864 0 1.536 0.48t0.672 1.056q0 0.672-0.352 1.088t-1.216 0.8q-1.12 0.48-2.080 1.536t-0.928 2.24v0.64q0 0.256 0.16 0.416t0.416 0.16h3.424q0.256 0 0.416-0.16t0.16-0.416q0-0.32 0.384-0.864t0.96-0.896q0.576-0.32 0.896-0.512t0.8-0.608 0.8-0.864 0.512-1.088 0.224-1.44zM27.424 16q0 3.744-1.824 6.88t-4.992 4.992-6.88 1.856-6.912-1.856-4.96-4.992-1.856-6.88 1.856-6.88 4.96-4.992 6.912-1.856 6.88 1.856 4.992 4.992 1.824 6.88z" })
|
|
256
|
+
] }),
|
|
257
|
+
/* @__PURE__ */ c("symbol", { id: "icon-comment", viewBox: "0 0 32 32", children: [
|
|
258
|
+
/* @__PURE__ */ c("title", { children: "comment" }),
|
|
259
|
+
/* @__PURE__ */ c("path", { d: "M32 16q0 3.104-2.144 5.728t-5.824 4.16-8.032 1.536q-1.248 0-2.592-0.128-3.52 3.104-8.224 4.32-0.864 0.256-2.016 0.384-0.32 0.032-0.544-0.16t-0.32-0.512v-0.032q-0.064-0.064 0-0.192t0.032-0.192 0.064-0.16l0.128-0.16t0.128-0.16 0.128-0.16q0.128-0.16 0.544-0.608t0.64-0.704 0.544-0.704 0.576-0.896 0.48-1.056 0.48-1.344q-2.816-1.6-4.416-3.936t-1.632-5.024q0-2.336 1.28-4.448t3.392-3.648 5.12-2.432 6.208-0.896q4.352 0 8.032 1.536t5.824 4.16 2.144 5.728z" })
|
|
260
|
+
] }),
|
|
261
|
+
/* @__PURE__ */ c("symbol", { id: "icon-window-maximize", viewBox: "0 0 32 32", children: [
|
|
262
|
+
/* @__PURE__ */ c("title", { children: "window-maximize" }),
|
|
263
|
+
/* @__PURE__ */ c("path", { d: "M4.576 25.152h22.848v-13.728h-22.848v13.728zM32 5.152v21.696q0 1.184-0.832 2.016t-2.016 0.864h-26.304q-1.152 0-2.016-0.864t-0.832-2.016v-21.696q0-1.184 0.832-2.016t2.016-0.864h26.304q1.184 0 2.016 0.864t0.832 2.016z" })
|
|
264
|
+
] }),
|
|
265
|
+
/* @__PURE__ */ c("symbol", { id: "icon-window-minimize", viewBox: "0 0 32 32", children: [
|
|
266
|
+
/* @__PURE__ */ c("title", { children: "window-minimize" }),
|
|
267
|
+
/* @__PURE__ */ c("path", { d: "M32 23.424v3.424q0 1.184-0.832 2.016t-2.016 0.864h-26.304q-1.152 0-2.016-0.864t-0.832-2.016v-3.424q0-1.184 0.832-2.016t2.016-0.832h26.304q1.184 0 2.016 0.832t0.832 2.016z" })
|
|
268
|
+
] })
|
|
269
|
+
] }) });
|
|
270
|
+
class we extends k {
|
|
271
|
+
constructor() {
|
|
272
|
+
super();
|
|
273
|
+
}
|
|
274
|
+
render(e) {
|
|
275
|
+
return /* @__PURE__ */ c("div", { class: "querlo_popup querlo_img", children: /* @__PURE__ */ c("div", { class: "querlo_contentWrp", children: [
|
|
276
|
+
/* @__PURE__ */ c("div", { class: "querlo_header", style: { backgroundColor: e.color }, children: /* @__PURE__ */ c("div", { class: "querlo_close", onClick: e.cb, children: /* @__PURE__ */ c(H, {}) }) }),
|
|
277
|
+
/* @__PURE__ */ c("section", { id: "querlo_docWrp", children: /* @__PURE__ */ c("img", { src: e.data.img }) })
|
|
278
|
+
] }) });
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
function qe(n, e, t, i, r) {
|
|
282
|
+
const o = /* @__PURE__ */ c("div", { className: e.show ? "querlo_chatWrp querlo_open" : "querlo_chatWrp", children: [
|
|
283
|
+
/* @__PURE__ */ c("div", { className: "querlo_chatBar qrlfadeInUp", onClick: r.toggle, children: [
|
|
284
|
+
/* @__PURE__ */ c("div", { className: e.inited ? "querlo_avatar" : "querlo_avatar qrlpulse", style: { borderColor: n.data.mainColor }, children: /* @__PURE__ */ c("img", { src: n.data.speakerImg ? n.data.speakerImg : "https://static.querlo.com/image_uploads/avatar1/608_5f2bcb679692b_png_small.png" }) }),
|
|
285
|
+
!e.inited && n.data.introTxt ? /* @__PURE__ */ c("div", { class: "querlo_message", children: n.data.introTxt }) : "",
|
|
286
|
+
e.inited ? "" : /* @__PURE__ */ c("div", { className: "querlo_number", children: "1" })
|
|
287
|
+
] }),
|
|
288
|
+
/* @__PURE__ */ c("div", { className: "querlo_openWrp", children: /* @__PURE__ */ c("div", { class: "querlo_bodyWrp querlo_qrlfadeInUp2", children: [
|
|
289
|
+
/* @__PURE__ */ c("div", { class: "querlo_header", style: { backgroundColor: n.data.mainColor }, children: [
|
|
290
|
+
n.data.speakerName,
|
|
291
|
+
/* @__PURE__ */ c("div", { class: "querlo_buttonsWrp", children: [
|
|
292
|
+
/* @__PURE__ */ c(
|
|
293
|
+
"a",
|
|
294
|
+
{
|
|
295
|
+
href: "#",
|
|
296
|
+
onMouseEnter: (l) => r.toggleHoverColor(l, n.data.mainColor),
|
|
297
|
+
onMouseLeave: (l) => r.toggleHoverColor(l, ""),
|
|
298
|
+
onClick: r.toggleFullscreen,
|
|
299
|
+
children: e.fullscreen ? /* @__PURE__ */ c(ve, {}) : /* @__PURE__ */ c(ye, {})
|
|
300
|
+
}
|
|
301
|
+
),
|
|
302
|
+
/* @__PURE__ */ c(
|
|
303
|
+
"a",
|
|
304
|
+
{
|
|
305
|
+
href: "#",
|
|
306
|
+
onMouseEnter: (l) => r.toggleHoverColor(l, n.data.mainColor),
|
|
307
|
+
onMouseLeave: (l) => r.toggleHoverColor(l, ""),
|
|
308
|
+
onClick: r.toggle,
|
|
309
|
+
children: /* @__PURE__ */ c(H, {})
|
|
310
|
+
}
|
|
311
|
+
)
|
|
312
|
+
] })
|
|
313
|
+
] }),
|
|
314
|
+
/* @__PURE__ */ c("div", { className: "querlo_iframeWrp", children: e.inited ? /* @__PURE__ */ c("iframe", { allow: "microphone;camera;midi;encrypted-media;", src: i, id: "querloIframe", seamless: !0 }) : "" })
|
|
315
|
+
] }) }),
|
|
316
|
+
Q,
|
|
317
|
+
e.showImagePopup ? /* @__PURE__ */ c(we, { cb: r.closeImagePopup, data: e.showImagePopup, color: n.data.mainColor }) : ""
|
|
318
|
+
] });
|
|
319
|
+
return {
|
|
320
|
+
/*
|
|
321
|
+
* standard iframe inpage content
|
|
322
|
+
*
|
|
323
|
+
*/
|
|
324
|
+
inpage: /* @__PURE__ */ c("iframe", { allow: "microphone;camera;midi;encrypted-media;", src: i, seamless: !0 }),
|
|
325
|
+
/*
|
|
326
|
+
* digitransforum.com
|
|
327
|
+
* classic window iconfied like bitlanders
|
|
328
|
+
*
|
|
329
|
+
*/
|
|
330
|
+
/*classic: <div className={ state.show ? 'querlo_chatWrp querlo_open' : 'querlo_chatWrp' }>
|
|
331
|
+
<div className="querlo_chatBar" onClick={ scope.toggle }>
|
|
332
|
+
<div class="querlo_left">
|
|
333
|
+
<Iconcomment /> Talk to us
|
|
334
|
+
</div>
|
|
335
|
+
<div class="querlo_right">
|
|
336
|
+
{ state.show ? <Iconwindowminimize /> : <Iconwindowmaximize /> }
|
|
337
|
+
<a href="https://www.querlo.com" target="_blank" class="info" onClick={ scope.stopPropagation }><Iconhelp /></a>
|
|
338
|
+
</div>
|
|
339
|
+
</div>
|
|
340
|
+
{ state.inited ? <iframe allow='microphone;camera;midi;encrypted-media;' src={ url } seamless /> : '' }
|
|
341
|
+
{ svg_icons }
|
|
342
|
+
</div>,*/
|
|
343
|
+
/*
|
|
344
|
+
* esd.me
|
|
345
|
+
* like the facebook embed
|
|
346
|
+
*
|
|
347
|
+
*/
|
|
348
|
+
esd: o,
|
|
349
|
+
/*
|
|
350
|
+
* growth drivers for IBM
|
|
351
|
+
* like the facebook embed
|
|
352
|
+
* no fullscreen button in head
|
|
353
|
+
*
|
|
354
|
+
*/
|
|
355
|
+
/*gd: <div className={ state.show ? 'querlo_chatWrp querlo_open' : 'querlo_chatWrp' }>
|
|
356
|
+
<div className="querlo_chatBar qrlfadeInUp" onClick={ scope.toggle }>
|
|
357
|
+
<div className={ state.inited ? 'querlo_avatar' : "querlo_avatar qrlpulse" } style={ {borderColor: props.data.mainColor} }>
|
|
358
|
+
<img src={ props.data.speakerImg } />
|
|
359
|
+
</div>
|
|
360
|
+
{ !state.inited && props.data.introTxt ? <div class="message">
|
|
361
|
+
{ props.data.introTxt }
|
|
362
|
+
</div> : '' }
|
|
363
|
+
{ state.inited ? '' : <div className="querlo_number">1</div> }
|
|
364
|
+
</div>
|
|
365
|
+
<div className="querlo_openWrp">
|
|
366
|
+
<div class="querlo_bodyWrp qrlfadeInUp2">
|
|
367
|
+
<div class="querlo_header" style={ {backgroundColor: props.data.mainColor} }>
|
|
368
|
+
{ props.data.speakerName }
|
|
369
|
+
</div>
|
|
370
|
+
<div className="querlo_iframeWrp">
|
|
371
|
+
{ state.inited ? <iframe allow='microphone;camera;midi;encrypted-media;' src={ url } seamless /> : '' }
|
|
372
|
+
</div>
|
|
373
|
+
</div>
|
|
374
|
+
|
|
375
|
+
<div className="close" style={ {backgroundColor: props.data.mainColor} } onClick={ scope.toggle }><Iconcancel /></div>
|
|
376
|
+
</div>
|
|
377
|
+
{ svg_icons }
|
|
378
|
+
</div>,*/
|
|
379
|
+
/*
|
|
380
|
+
* popup_center
|
|
381
|
+
* embedded initially, centered popup on click
|
|
382
|
+
*/
|
|
383
|
+
inpage_popup: /* @__PURE__ */ c("div", { className: `querlo_popup_center ${e.show ? "open" : "closed"}`, children: [
|
|
384
|
+
/* @__PURE__ */ c("div", { className: "querlo_overlay", onClick: r.toggle }),
|
|
385
|
+
e.show && /* @__PURE__ */ c("div", { className: "querlo_close_btn", onClick: r.toggle, style: { backgroundColor: n.data.mainColor }, children: /* @__PURE__ */ c(H, {}) }),
|
|
386
|
+
/* @__PURE__ */ c("iframe", { allow: "microphone;camera;midi;encrypted-media;", src: i, seamless: !0 }),
|
|
387
|
+
Q
|
|
388
|
+
] })
|
|
389
|
+
}[t];
|
|
390
|
+
}
|
|
391
|
+
const be = window.location.href, B = "querlo_fullscreen", V = be.split("/");
|
|
392
|
+
V[0] + "" + V[2];
|
|
393
|
+
function S(n, e) {
|
|
394
|
+
n && (e.width && typeof e.width != "number" && e.width.indexOf("%") !== -1 ? n.classList.add(B) : (e.width && (n.style.width = e.width + "px"), n.classList.remove(B)));
|
|
395
|
+
}
|
|
396
|
+
function Ce(n) {
|
|
397
|
+
let e = new XMLHttpRequest();
|
|
398
|
+
e.onreadystatechange = function() {
|
|
399
|
+
if (e.readyState === 4)
|
|
400
|
+
return e.status >= 200 && e.status < 300 ? (n.cb && n.cb(e.responseText), e.responseText) : (console.log("error", e), n.cb && n.cb(!1), e);
|
|
401
|
+
}, e.open("GET", n.url), e.send();
|
|
402
|
+
}
|
|
403
|
+
class Ee extends k {
|
|
404
|
+
constructor() {
|
|
405
|
+
super();
|
|
406
|
+
y(this, "toggle", (t, i) => {
|
|
407
|
+
var l;
|
|
408
|
+
t && t.preventDefault && t.preventDefault();
|
|
409
|
+
const r = (l = this.base) == null ? void 0 : l.parentElement;
|
|
410
|
+
if (!r) return;
|
|
411
|
+
if (!this.state.show) {
|
|
412
|
+
const u = this.base.classList.contains("querlo_popup_center") ? this.base : this.base.querySelector(".querlo_popup_center");
|
|
413
|
+
if (u) {
|
|
414
|
+
const f = u.getBoundingClientRect();
|
|
415
|
+
r.style.setProperty("--origin-top", f.top + "px"), r.style.setProperty("--origin-left", f.left + "px"), r.style.setProperty("--origin-width", f.width + "px"), r.style.setProperty("--origin-height", f.height + "px");
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
const o = !this.state.show, a = i !== void 0 ? i : o ? this.state.fullscreen : !1;
|
|
419
|
+
this.setState({ inited: !0, show: o, fullscreen: a }), S(r, a ? {
|
|
420
|
+
width: "100%"
|
|
421
|
+
} : {
|
|
422
|
+
width: this.props.data.width,
|
|
423
|
+
height: this.props.data.height
|
|
424
|
+
});
|
|
425
|
+
});
|
|
426
|
+
y(this, "toggleHoverColor", (t, i) => {
|
|
427
|
+
const r = t.target.querySelector("svg");
|
|
428
|
+
r.style.fill = i;
|
|
429
|
+
});
|
|
430
|
+
y(this, "toggleFullscreen", (t) => {
|
|
431
|
+
var o;
|
|
432
|
+
t && t.preventDefault();
|
|
433
|
+
const i = !this.state.fullscreen, r = (o = this.base) == null ? void 0 : o.parentElement;
|
|
434
|
+
r && (S(r, i ? {
|
|
435
|
+
width: "100%"
|
|
436
|
+
} : {
|
|
437
|
+
width: this.props.data.width,
|
|
438
|
+
height: this.props.data.height
|
|
439
|
+
}), this.setState({ fullscreen: i }));
|
|
440
|
+
});
|
|
441
|
+
y(this, "handleScopedCommand", (t) => {
|
|
442
|
+
const { name: i, params: r } = t.detail;
|
|
443
|
+
i === "OPEN" && !this.state.show && this.toggle(!1, r == null ? void 0 : r.fullscreen), i === "CLOSE" && this.state.show && this.toggle(!1), i === "RESIZE_CLIENT" && !this.state.fullscreen && S(this.base, r);
|
|
444
|
+
});
|
|
445
|
+
y(this, "closeImagePopup", () => {
|
|
446
|
+
this.setState({ showImagePopup: !1 });
|
|
447
|
+
});
|
|
448
|
+
y(this, "receiveMessage", (t) => {
|
|
449
|
+
var u, f, s, p;
|
|
450
|
+
const i = (u = this.base) == null ? void 0 : u.querySelector("iframe"), r = i == null ? void 0 : i.contentWindow, o = t.source === r, a = t.source === window;
|
|
451
|
+
if (!o && !a) return;
|
|
452
|
+
const l = t.data.command;
|
|
453
|
+
if (t.data.querloMessageType === "clientEvent") {
|
|
454
|
+
if (l.name === "OPEN" && !this.state.show && this.toggle(!1, ((f = l.params) == null ? void 0 : f.fullscreen) || ((s = l.params) == null ? void 0 : s.fullScreen)), l.name === "CLOSE" && this.state.show && this.toggle(!1), l.name === "RESIZE_CLIENT" && !this.state.fullscreen && o) {
|
|
455
|
+
const _ = (p = this.base) == null ? void 0 : p.parentElement;
|
|
456
|
+
_ && S(_, l.params);
|
|
457
|
+
}
|
|
458
|
+
l.name === "XHR_CALL" && o && Ce(t.data.command.params), l.name === "OPEN_IMAGE_POPUP" && o && this.setState({ showImagePopup: l.params });
|
|
459
|
+
}
|
|
460
|
+
});
|
|
461
|
+
// passed to templates this is fUgly and is it really needed?
|
|
462
|
+
y(this, "stopPropagation", (t) => t.stopPropagation());
|
|
463
|
+
this.state = { inited: !1, show: !1 };
|
|
464
|
+
}
|
|
465
|
+
componentDidMount() {
|
|
466
|
+
var i, r;
|
|
467
|
+
if (this.props.data.delay && setTimeout(() => {
|
|
468
|
+
!this.state.inited && !this.state.show && this.toggle(!1);
|
|
469
|
+
}, this.props.data.delay), this.props.template === "inpage" || this.props.template === "popup_center" || this.props.template === "inpage_popup") {
|
|
470
|
+
const o = (i = this.base) == null ? void 0 : i.parentElement;
|
|
471
|
+
o && S(o, {
|
|
472
|
+
width: this.props.data.width,
|
|
473
|
+
height: this.props.data.height
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
window.addEventListener("message", this.receiveMessage, !1);
|
|
477
|
+
const t = (r = this.base) == null ? void 0 : r.parentElement;
|
|
478
|
+
t && t.addEventListener("querlo-command", this.handleScopedCommand);
|
|
479
|
+
}
|
|
480
|
+
componentWillUnmount() {
|
|
481
|
+
var i;
|
|
482
|
+
window.removeEventListener("message", this.receiveMessage);
|
|
483
|
+
const t = (i = this.base) == null ? void 0 : i.parentElement;
|
|
484
|
+
t && t.removeEventListener("querlo-command", this.handleScopedCommand);
|
|
485
|
+
}
|
|
486
|
+
render(t, i) {
|
|
487
|
+
let o = "https://chat.querlo.com/" + t.data.id + "?utm_source_js=" + t.data.referrer;
|
|
488
|
+
return t.data.params && (o += "&" + t.data.params), qe(t, i, t.data.template, o, this);
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
const b = class b {
|
|
492
|
+
constructor() {
|
|
493
|
+
this.initChat(), typeof window < "u" && !b.listenerAdded && (b.listenerAdded = !0, window.addEventListener("querlo-new-embed", () => this.initChat()));
|
|
494
|
+
}
|
|
495
|
+
initChat() {
|
|
496
|
+
document.querySelectorAll(".querlo, #querloEmbd").forEach((t) => {
|
|
497
|
+
if (b.initializedElements.has(t) || !t.dataset.id) return;
|
|
498
|
+
b.initializedElements.add(t);
|
|
499
|
+
const i = t.dataset, r = {
|
|
500
|
+
id: i.id,
|
|
501
|
+
width: i.querloW || i.width,
|
|
502
|
+
height: i.querloH || i.height,
|
|
503
|
+
template: i.template || "esd",
|
|
504
|
+
referrer: me(),
|
|
505
|
+
posX: i.posX || "right",
|
|
506
|
+
posY: i.posY || "bottom",
|
|
507
|
+
speakerImg: i.speakerImg,
|
|
508
|
+
speakerName: i.speakerName,
|
|
509
|
+
introTxt: i.introTxt,
|
|
510
|
+
delay: i.delay,
|
|
511
|
+
mainColor: i.mainColor || "rgb(107,185,240)"
|
|
512
|
+
};
|
|
513
|
+
t.classList.add(r.template), t.classList.add(r.posX), t.classList.add(r.posY), (r.template === "inpage" || r.template === "popup_center" || r.template === "inpage_popup") && (t.style.width = r.width + "px", t.style.minHeight = r.height + "px"), fe(/* @__PURE__ */ c(Ee, { data: r }), t);
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
};
|
|
517
|
+
y(b, "initializedElements", /* @__PURE__ */ new Set()), y(b, "listenerAdded", !1);
|
|
518
|
+
let D = b;
|
|
519
|
+
class ke {
|
|
520
|
+
constructor() {
|
|
521
|
+
y(this, "listeners", /* @__PURE__ */ new Map());
|
|
522
|
+
y(this, "initialized", !1);
|
|
523
|
+
y(this, "_loading", !1);
|
|
524
|
+
y(this, "_chatbotWaiting", !1);
|
|
525
|
+
y(this, "controllers", /* @__PURE__ */ new Set());
|
|
526
|
+
typeof window < "u" && this.initMessageListener();
|
|
527
|
+
}
|
|
528
|
+
/**
|
|
529
|
+
* Initializes a new chatbot instance.
|
|
530
|
+
* @returns A controller object to interact with this specific instance.
|
|
531
|
+
*/
|
|
532
|
+
embed(e) {
|
|
533
|
+
let t = null;
|
|
534
|
+
e.container && (t = typeof e.container == "string" ? document.querySelector(e.container) : e.container), t || (t = document.createElement("div"), document.body.appendChild(t)), t.classList.add("querlo"), e.id && (t.dataset.id = e.id), e.width && (t.dataset.width = e.width), e.height && (t.dataset.height = e.height), e.template && (t.dataset.template = e.template), e.posX && (t.dataset.posX = e.posX), e.posY && (t.dataset.posY = e.posY), e.mainColor && (t.dataset.mainColor = e.mainColor), e.speakerImg && (t.dataset.speakerImg = e.speakerImg), e.speakerName && (t.dataset.speakerName = e.speakerName), e.introTxt && (t.dataset.introTxt = e.introTxt), e.delay && (t.dataset.delay = e.delay);
|
|
535
|
+
const i = t, r = {
|
|
536
|
+
element: i,
|
|
537
|
+
open: (o = !1) => this.sendCommandToElement(i, "OPEN", { fullscreen: o }),
|
|
538
|
+
close: () => this.sendCommandToElement(i, "CLOSE"),
|
|
539
|
+
sendMessage: (o) => {
|
|
540
|
+
const a = i.querySelector("iframe");
|
|
541
|
+
a != null && a.contentWindow && a.contentWindow.postMessage({
|
|
542
|
+
querloMessageType: "sendMessage",
|
|
543
|
+
querloMessageBody: { text: o }
|
|
544
|
+
}, "*");
|
|
545
|
+
},
|
|
546
|
+
setVariable: (o, a) => {
|
|
547
|
+
const l = i.querySelector("iframe");
|
|
548
|
+
l != null && l.contentWindow && l.contentWindow.postMessage({
|
|
549
|
+
querloMessageType: "SET-CHAT-VARIABLE",
|
|
550
|
+
varName: o,
|
|
551
|
+
varContent: a
|
|
552
|
+
}, "*");
|
|
553
|
+
},
|
|
554
|
+
destroy: () => {
|
|
555
|
+
this.controllers.delete(r), i.remove();
|
|
556
|
+
}
|
|
557
|
+
};
|
|
558
|
+
return this.controllers.add(r), typeof window < "u" && window.dispatchEvent(new CustomEvent("querlo-new-embed")), r;
|
|
559
|
+
}
|
|
560
|
+
/**
|
|
561
|
+
* Shows ALL chatbot instances.
|
|
562
|
+
*/
|
|
563
|
+
open(e = !1) {
|
|
564
|
+
this.sendCommand("OPEN", { fullscreen: e });
|
|
565
|
+
}
|
|
566
|
+
/**
|
|
567
|
+
* Shows ALL chatbot instances in fullscreen mode.
|
|
568
|
+
*/
|
|
569
|
+
openFullscreen() {
|
|
570
|
+
this.open(!0);
|
|
571
|
+
}
|
|
572
|
+
/**
|
|
573
|
+
* Hides ALL chatbot instances.
|
|
574
|
+
*/
|
|
575
|
+
close() {
|
|
576
|
+
this.sendCommand("CLOSE");
|
|
577
|
+
}
|
|
578
|
+
/**
|
|
579
|
+
* Sends a custom text message to ALL chatbot instances.
|
|
580
|
+
*/
|
|
581
|
+
sendMessage(e) {
|
|
582
|
+
this.controllers.forEach((t) => t.sendMessage(e));
|
|
583
|
+
}
|
|
584
|
+
/**
|
|
585
|
+
* Sets a chat variable in ALL chatbot instances.
|
|
586
|
+
*/
|
|
587
|
+
setVariable(e, t) {
|
|
588
|
+
this.controllers.forEach((i) => i.setVariable(e, t));
|
|
589
|
+
}
|
|
590
|
+
isLoading() {
|
|
591
|
+
return this._loading;
|
|
592
|
+
}
|
|
593
|
+
isWaiting() {
|
|
594
|
+
return this._chatbotWaiting;
|
|
595
|
+
}
|
|
596
|
+
on(e, t) {
|
|
597
|
+
return this.listeners.has(e) || this.listeners.set(e, /* @__PURE__ */ new Set()), this.listeners.get(e).add(t), () => this.off(e, t);
|
|
598
|
+
}
|
|
599
|
+
off(e, t) {
|
|
600
|
+
var i;
|
|
601
|
+
(i = this.listeners.get(e)) == null || i.delete(t);
|
|
602
|
+
}
|
|
603
|
+
sendCommand(e, t = {}) {
|
|
604
|
+
window.postMessage({
|
|
605
|
+
querloMessageType: "clientEvent",
|
|
606
|
+
command: { name: e, params: t }
|
|
607
|
+
}, "*");
|
|
608
|
+
}
|
|
609
|
+
sendCommandToElement(e, t, i = {}) {
|
|
610
|
+
e.dispatchEvent(new CustomEvent("querlo-command", { detail: { name: t, params: i } }));
|
|
611
|
+
}
|
|
612
|
+
initMessageListener() {
|
|
613
|
+
this.initialized || (this.initialized = !0, window.addEventListener("message", (e) => {
|
|
614
|
+
let t = e.data;
|
|
615
|
+
if (typeof t == "string")
|
|
616
|
+
try {
|
|
617
|
+
t = JSON.parse(t);
|
|
618
|
+
} catch {
|
|
619
|
+
return;
|
|
620
|
+
}
|
|
621
|
+
if (!t || typeof t != "object") return;
|
|
622
|
+
const i = this.normalizeMessage(t);
|
|
623
|
+
if (!i) return;
|
|
624
|
+
const { querloMessageType: r, querloMessageBody: o } = i;
|
|
625
|
+
if (r === "clientEvent") {
|
|
626
|
+
const a = o.name || "";
|
|
627
|
+
if (a === "WAITING_REQUEST")
|
|
628
|
+
this._chatbotWaiting = !0, this.emit("WAITING_REQUEST", i);
|
|
629
|
+
else if (a === "BUILD_PAGE") {
|
|
630
|
+
this._chatbotWaiting = !1, this._loading = !1, this.emit("loading", !1);
|
|
631
|
+
const l = this.parseBuildPageEvent(o);
|
|
632
|
+
l && this.emit("BUILD_PAGE", l);
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
this.emit("message", i), this.emit(r, o), r === "clientEvent" && o.name && this.emit(o.name, o.params || o);
|
|
636
|
+
}), console.log("[QuerloAPI] API Layer initialized — Supporting multiple instances"));
|
|
637
|
+
}
|
|
638
|
+
parseBuildPageEvent(e) {
|
|
639
|
+
if (!e || typeof e != "object") return null;
|
|
640
|
+
const t = e.params || e.data || e.payload || e;
|
|
641
|
+
if (typeof t != "object") return null;
|
|
642
|
+
let i;
|
|
643
|
+
if (t.page) {
|
|
644
|
+
if (i = t, i.page && i.page.page) {
|
|
645
|
+
const r = i.page, o = r.page;
|
|
646
|
+
i = {
|
|
647
|
+
page: o,
|
|
648
|
+
missing_info: r.missing_info || o.missing_info || [],
|
|
649
|
+
version: r.version || i.version
|
|
650
|
+
};
|
|
651
|
+
}
|
|
652
|
+
} else
|
|
653
|
+
i = { page: t, missing_info: t.missing_info || [] };
|
|
654
|
+
return i;
|
|
655
|
+
}
|
|
656
|
+
normalizeMessage(e) {
|
|
657
|
+
if (e.querloMessageType && typeof e.querloMessageType == "string")
|
|
658
|
+
return {
|
|
659
|
+
querloMessageType: e.querloMessageType,
|
|
660
|
+
querloMessageBody: e.querloMessageBody || e.command || {}
|
|
661
|
+
};
|
|
662
|
+
if (Array.isArray(e.b) && e.b.length > 0) {
|
|
663
|
+
const t = e.b[0];
|
|
664
|
+
if (t && typeof t == "object" && t.t)
|
|
665
|
+
return {
|
|
666
|
+
querloMessageType: t.t,
|
|
667
|
+
querloMessageBody: t.b || {}
|
|
668
|
+
};
|
|
669
|
+
}
|
|
670
|
+
return null;
|
|
671
|
+
}
|
|
672
|
+
emit(e, t) {
|
|
673
|
+
var i;
|
|
674
|
+
(i = this.listeners.get(e)) == null || i.forEach((r) => {
|
|
675
|
+
try {
|
|
676
|
+
r(t);
|
|
677
|
+
} catch (o) {
|
|
678
|
+
console.error(o);
|
|
679
|
+
}
|
|
680
|
+
});
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
const Y = new ke();
|
|
684
|
+
typeof window < "u" && (window.Querlo = Y, window.dispatchEvent(new CustomEvent("querlo-ready", { detail: Y })));
|
|
685
|
+
new D();
|
|
686
|
+
export {
|
|
687
|
+
Y as QuerloAPI
|
|
688
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.querlo{transition:all .5s cubic-bezier(.16,1,.3,1)}.querlo *{margin:0;padding:0;border:0;vertical-align:baseline;box-sizing:border-box;font-family:Roboto,Helvetica Neue,sans-serif;color:#444}.querlo .iframeWrp{transition:all .5s cubic-bezier(.16,1,.3,1)}.querlo iframe{display:none;width:100%;border-width:0}.querlo .querlo_open iframe{display:block}.querlo.esd{position:fixed;width:500px;background:none;z-index:9999;transition:all .5s cubic-bezier(.16,1,.3,1)}.querlo.esd.bottom{bottom:10px}.querlo.esd.top{top:10px}.querlo.esd.right{right:10px}.querlo.esd.left{left:10px}.querlo.esd.querlo_fullscreen{width:100%!important;height:100%!important;bottom:0!important;right:0!important;left:0!important;top:0!important}.querlo.esd.querlo_fullscreen .querlo_iframeWrp{height:calc(100% - 50px)!important;max-height:none}.querlo.esd.querlo_fullscreen .querlo_chatWrp,.querlo.esd.querlo_fullscreen .querlo_openWrp,.querlo.esd.querlo_fullscreen .querlo_bodyWrp{height:100%!important}.querlo.esd.querlo_fullscreen .querlo_avatar{margin:0 10px 10px 0;box-shadow:none}.querlo.esd.querlo_fullscreen .querlo_message{margin-bottom:10px}.querlo.esd.querlo_fullscreen .querlo_bodyWrp{box-shadow:none;border-radius:0;margin-bottom:0}.querlo.esd.querlo_fullscreen .querlo_copy{float:none;margin:0}.querlo.esd.querlo_fullscreen .querlo_number{margin:0 10px 10px 0}.querlo.esd.querlo_fullscreen .querlo_resizeButton{margin-right:68px!important}@media screen and (max-width:812px){.querlo.esd.querlo_fullscreen .querlo_resizeButton{display:none}}.querlo.esd .querlo_iframeWrp{background:#fff;height:calc(100vh - 90px);max-height:600px}.querlo.esd .querlo_iframeWrp iframe{height:100%}@media screen and (max-width:812px){.querlo.esd .querlo_iframeWrp{height:calc(100% - 50px);max-height:none}}.querlo.esd .querlo_chatWrp{position:relative}@media screen and (max-width:812px){.querlo.esd .querlo_chatWrp{height:100%}}@media screen and (max-width:812px){.querlo.esd .querlo_chatWrp.querlo_open{width:100%;height:100%;top:0;bottom:0;right:0;left:0;position:fixed}}.querlo.esd .querlo_chatBar{position:fixed}.querlo.esd.bottom .querlo_chatBar{bottom:10px}.querlo.esd.top .querlo_chatBar{top:10px}.querlo.esd.right .querlo_chatBar{right:10px}.querlo.esd.left .querlo_chatBar{left:10px}.querlo.esd .querlo_open .querlo_chatBar{display:none}.querlo.esd .querlo_message{padding:12px 16px 12px 18px;font-size:13px;color:#000;background:#fff;max-width:260px;box-shadow:0 0 10px #00000026,0 0 30px #0000004d;border-radius:5px;position:relative}@media screen and (max-width:812px){.querlo.esd .querlo_message{margin-bottom:10px}}.querlo.esd .querlo_message:after{content:"";position:absolute;width:0;height:0;border:10px solid transparent;margin-top:-5px}.querlo.esd.right .querlo_message{float:right;margin-right:10px}.querlo.esd.right .querlo_message:after{right:-10px;border-left-color:#fff}.querlo.esd.left .querlo_message{float:left;margin-left:10px}.querlo.esd.left .querlo_message:after{left:-10px;border-right-color:#fff}.querlo.esd.bottom .querlo_message:after{bottom:20px}.querlo.esd.top .querlo_message:after{top:20px}.querlo.esd .querlo_avatar{border-radius:50%;border:3px solid #f1592a;cursor:pointer;width:60px;height:60px;overflow:hidden;transition:all .3s;transform-origin:50% 50%;box-shadow:0 0 10px #00000026,0 0 30px #0000004d}@media screen and (max-width:812px){.querlo.esd .querlo_avatar{margin:0 10px 10px 0;box-shadow:none}}.querlo.esd .querlo_avatar img{width:100%}.querlo.esd.right .querlo_avatar{float:right}.querlo.esd.left .querlo_avatar{float:left}.querlo.esd .querlo_avatar:hover{width:60px;height:60px}.querlo.esd .querlo_openWrp{display:none}@media screen and (max-width:812px){.querlo.esd .querlo_openWrp{height:100%}}.querlo.esd .querlo_open .querlo_openWrp{display:block;animation-duration:.4s;animation-timing-function:cubic-bezier(.16,1,.3,1);animation-fill-mode:forwards}.querlo.esd .querlo_bodyWrp{box-shadow:0 0 10px #00000026,0 0 30px #0000004d;border-radius:5px;overflow:hidden}@media screen and (max-width:812px){.querlo.esd .querlo_bodyWrp{box-shadow:none;border-radius:0;height:100%}}.querlo.esd.bottom .querlo_bodyWrp{margin-bottom:10px}.querlo.esd.top .querlo_bodyWrp{margin-top:10px}.querlo.esd.top .querlo_openWrp{display:flex;flex-direction:column-reverse}.querlo.esd .querlo_header{background:#f1592a;color:#fff;height:50px;line-height:48px;font-size:16px;text-align:center}.querlo.esd .querlo_header .querlo_buttonsWrp{float:right;height:50px;display:flex;justify-content:center;align-items:center}.querlo.esd .querlo_header .querlo_buttonsWrp a{display:flex;justify-content:center;align-items:center;padding:10px 13px}.querlo.esd .querlo_header .querlo_buttonsWrp svg{fill:#fff;height:48px}.querlo.esd .querlo_header .querlo_buttonsWrp a:hover{background:#fff}.querlo.esd .querlo_copy{display:block;padding:10px;font-size:12px;background:#fff;text-decoration:none;color:#a8b6c2}@media screen and (max-width:812px){.querlo.esd .querlo_copy{float:none;margin:0}}.querlo.esd .querlo_copy span{font-size:12px;color:#23a7d6}.querlo.esd .querlo_copy:hover{background:#23a7d6;color:#fff}.querlo.esd .querlo_copy:hover span{color:#fff}.querlo.esd .querlo_number{position:absolute;width:20px;height:20px;right:-4px;top:-4px;border-radius:50%;color:#fff;font-size:11px;border:2px solid #fff;background:#f82d6c;line-height:18px;text-align:center}@media screen and (max-width:812px){.querlo.esd .querlo_number{margin:0 10px 10px 0}}.querlo.esd.top,.querlo.esd.top .querlo_openWrp{animation-name:qrlEntranceTop}.querlo.esd.bottom,.querlo.esd.bottom .querlo_openWrp{animation-name:qrlEntranceBottom}.querlo.esd footer{text-align:center}.qrlpulse{animation-iteration-count:infinite;animation-name:qrlpulse;animation-duration:2s;animation-fill-mode:both}@keyframes qrlpulse{0%{transform:scaleZ(1)}50%{transform:scale3d(1.05,1.05,1.05)}to{transform:scaleZ(1)}}.qrlfadeInUp{animation-name:qrlfadeInUp;animation-duration:1s;animation-delay:1s;animation-fill-mode:both}.qrlfadeInUp2{animation-name:qrlfadeInUp;animation-duration:.5s;animation-fill-mode:both}@keyframes qrlEntranceBottom{0%{opacity:0;transform:scale(.9) translateY(20px)}to{opacity:1;transform:scale(1) translateY(0)}}@keyframes qrlEntranceTop{0%{opacity:0;transform:scale(.9) translateY(-20px)}to{opacity:1;transform:scale(1) translateY(0)}}@keyframes qrlfadeInUp{0%{opacity:0;transform:translate3d(0,500px,0)}to{opacity:1;transform:none}}.querlo.inpage{display:flex;flex-direction:column}.querlo.inpage iframe{flex:1;display:block}.querlo .querlo_icon{display:inline-block;width:1em;height:1em;stroke-width:0;stroke:currentColor;fill:currentColor}.querlo .icon-help-circled{width:.857421875em}.querlo.inpage_popup{display:flex;flex-direction:column}.querlo.inpage_popup iframe{display:block}.querlo.inpage_popup .querlo_popup_center{flex:1;display:flex;flex-direction:column;transition:background-color .3s ease-in-out}.querlo.inpage_popup .querlo_popup_center.closed{position:relative;cursor:pointer}.querlo.inpage_popup .querlo_popup_center.closed iframe{flex:1;height:auto;pointer-events:none}.querlo.inpage_popup .querlo_popup_center.closed .querlo_overlay{position:absolute;top:0;left:0;width:100%;height:100%;z-index:10;background:transparent}.querlo.inpage_popup .querlo_popup_center.open{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);width:90%;max-width:800px;height:80vh;z-index:99999;box-shadow:0 0 20px #0000004d;background:#fff;border-radius:8px;overflow:hidden;animation:zoomIn .4s cubic-bezier(.16,1,.3,1) forwards}.querlo.inpage_popup .querlo_popup_center.open .querlo_overlay{display:none}.querlo.inpage_popup .querlo_popup_center.open iframe{width:100%;height:100%;border:none}.querlo.inpage_popup .querlo_popup_center.open .querlo_close_btn{position:absolute;top:10px;right:10px;width:30px;height:30px;background:#00000080;color:#fff;border-radius:50%;display:flex;align-items:center;justify-content:center;cursor:pointer;z-index:20;opacity:0;animation:fadeIn .3s ease-in-out .3s forwards}.querlo.inpage_popup .querlo_popup_center.open .querlo_close_btn svg{width:16px;height:16px;fill:#fff}.querlo.inpage_popup .querlo_popup_center.open .querlo_close_btn:hover{background:#000000b3}@media(max-width:768px){.querlo.inpage_popup .querlo_popup_center.open{width:100%;height:100%;max-width:none;max-height:none;border-radius:0}}@keyframes zoomIn{0%{position:fixed;top:var(--origin-top);left:var(--origin-left);width:var(--origin-width);height:var(--origin-height);transform:translate(0);border-radius:0}to{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);width:90%;max-width:990px;height:80vh;border-radius:8px}}@media(max-width:768px){@keyframes zoomIn{0%{position:fixed;top:var(--origin-top);left:var(--origin-left);width:var(--origin-width);height:var(--origin-height);transform:translate(0);border-radius:0}to{position:fixed;top:0;left:0;transform:translate(0);width:100%;height:100%;border-radius:0}}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.querlo .querlo_popup{position:fixed;top:0;left:0;right:0;bottom:0;background:#0003;display:flex;justify-content:center;align-items:center}.querlo .querlo_popup .querlo_contentWrp{border-radius:5px;width:95%;height:auto;background:#fff;overflow:hidden;box-shadow:0 2px 6px #0000002b}.querlo .querlo_popup .querlo_header{height:50px!important}.querlo .querlo_popup .querlo_close{background:none!important;box-shadow:none!important}.querlo .querlo_popup img{width:100%}.querlo .querlo_popup section{height:calc(100% - 60px);padding:15px!important}.querlo .querlo_popup section iframe{border:0;display:block;width:100%;height:100%}')),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
2
|
+
(function(q,y){typeof exports=="object"&&typeof module<"u"?y(exports):typeof define=="function"&&define.amd?define(["exports"],y):(q=typeof globalThis<"u"?globalThis:q||self,y(q.Querlo={}))})(this,(function(q){"use strict";var ke=Object.defineProperty;var xe=(q,y,p)=>y in q?ke(q,y,{enumerable:!0,configurable:!0,writable:!0,value:p}):q[y]=p;var w=(q,y,p)=>xe(q,typeof y!="symbol"?y+"":y,p);var y,p,F,T,G,L={},$=[],ae=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function E(n,e){for(var t in e)n[t]=e[t];return n}function Q(n){var e=n.parentNode;e&&e.removeChild(n)}function de(n,e,t){var i,r,o,a={};for(o in e)o=="key"?i=e[o]:o=="ref"?r=e[o]:a[o]=e[o];if(arguments.length>2&&(a.children=arguments.length>3?y.call(arguments,2):t),typeof n=="function"&&n.defaultProps!=null)for(o in n.defaultProps)a[o]===void 0&&(a[o]=n.defaultProps[o]);return N(n,a,i,r,null)}function N(n,e,t,i,r){var o={type:n,props:e,key:t,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:r??++F};return r==null&&p.vnode!=null&&p.vnode(o),o}function z(n){return n.children}function x(n,e){this.props=n,this.context=e}function M(n,e){if(e==null)return n.__?M(n.__,n.__.__k.indexOf(n)+1):null;for(var t;e<n.__k.length;e++)if((t=n.__k[e])!=null&&t.__e!=null)return t.__e;return typeof n.type=="function"?M(n):null}function X(n){var e,t;if((n=n.__)!=null&&n.__c!=null){for(n.__e=n.__c.base=null,e=0;e<n.__k.length;e++)if((t=n.__k[e])!=null&&t.__e!=null){n.__e=n.__c.base=t.__e;break}return X(n)}}function V(n){(!n.__d&&(n.__d=!0)&&T.push(n)&&!W.__r++||G!==p.debounceRendering)&&((G=p.debounceRendering)||setTimeout)(W)}function W(){for(var n;W.__r=T.length;)n=T.sort(function(e,t){return e.__v.__b-t.__v.__b}),T=[],n.some(function(e){var t,i,r,o,a,l;e.__d&&(a=(o=(t=e).__v).__e,(l=t.__P)&&(i=[],(r=E({},o)).__v=o.__v+1,H(l,o,r,t.__n,l.ownerSVGElement!==void 0,o.__h!=null?[a]:null,i,a??M(o),o.__h),ne(i,o),o.__e!=a&&X(o)))})}function Y(n,e,t,i,r,o,a,l,u,f){var s,m,_,c,h,S,g,v=i&&i.__k||$,C=v.length;for(t.__k=[],s=0;s<e.length;s++)if((c=t.__k[s]=(c=e[s])==null||typeof c=="boolean"?null:typeof c=="string"||typeof c=="number"||typeof c=="bigint"?N(null,c,null,null,c):Array.isArray(c)?N(z,{children:c},null,null,null):c.__b>0?N(c.type,c.props,c.key,null,c.__v):c)!=null){if(c.__=t,c.__b=t.__b+1,(_=v[s])===null||_&&c.key==_.key&&c.type===_.type)v[s]=void 0;else for(m=0;m<C;m++){if((_=v[m])&&c.key==_.key&&c.type===_.type){v[m]=void 0;break}_=null}H(n,c,_=_||L,r,o,a,l,u,f),h=c.__e,(m=c.ref)&&_.ref!=m&&(g||(g=[]),_.ref&&g.push(_.ref,null,c),g.push(m,c.__c||h,c)),h!=null?(S==null&&(S=h),typeof c.type=="function"&&c.__k===_.__k?c.__d=u=Z(c,u,n):u=J(n,c,_,v,h,u),typeof t.type=="function"&&(t.__d=u)):u&&_.__e==u&&u.parentNode!=n&&(u=M(_))}for(t.__e=S,s=C;s--;)v[s]!=null&&(typeof t.type=="function"&&v[s].__e!=null&&v[s].__e==t.__d&&(t.__d=M(i,s+1)),oe(v[s],v[s]));if(g)for(s=0;s<g.length;s++)ie(g[s],g[++s],g[++s])}function Z(n,e,t){for(var i,r=n.__k,o=0;r&&o<r.length;o++)(i=r[o])&&(i.__=n,e=typeof i.type=="function"?Z(i,e,t):J(t,i,i,r,i.__e,e));return e}function J(n,e,t,i,r,o){var a,l,u;if(e.__d!==void 0)a=e.__d,e.__d=void 0;else if(t==null||r!=o||r.parentNode==null)e:if(o==null||o.parentNode!==n)n.appendChild(r),a=null;else{for(l=o,u=0;(l=l.nextSibling)&&u<i.length;u+=2)if(l==r)break e;n.insertBefore(r,o),a=o}return a!==void 0?a:r.nextSibling}function ce(n,e,t,i,r){var o;for(o in t)o==="children"||o==="key"||o in e||A(n,o,null,t[o],i);for(o in e)r&&typeof e[o]!="function"||o==="children"||o==="key"||o==="value"||o==="checked"||t[o]===e[o]||A(n,o,e[o],t[o],i)}function K(n,e,t){e[0]==="-"?n.setProperty(e,t):n[e]=t==null?"":typeof t!="number"||ae.test(e)?t:t+"px"}function A(n,e,t,i,r){var o;e:if(e==="style")if(typeof t=="string")n.style.cssText=t;else{if(typeof i=="string"&&(n.style.cssText=i=""),i)for(e in i)t&&e in t||K(n.style,e,"");if(t)for(e in t)i&&t[e]===i[e]||K(n.style,e,t[e])}else if(e[0]==="o"&&e[1]==="n")o=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in n?e.toLowerCase().slice(2):e.slice(2),n.l||(n.l={}),n.l[e+o]=t,t?i||n.addEventListener(e,o?te:ee,o):n.removeEventListener(e,o?te:ee,o);else if(e!=="dangerouslySetInnerHTML"){if(r)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!=="href"&&e!=="list"&&e!=="form"&&e!=="tabIndex"&&e!=="download"&&e in n)try{n[e]=t??"";break e}catch{}typeof t=="function"||(t!=null&&(t!==!1||e[0]==="a"&&e[1]==="r")?n.setAttribute(e,t):n.removeAttribute(e))}}function ee(n){this.l[n.type+!1](p.event?p.event(n):n)}function te(n){this.l[n.type+!0](p.event?p.event(n):n)}function H(n,e,t,i,r,o,a,l,u){var f,s,m,_,c,h,S,g,v,C,I,le,U,b=e.type;if(e.constructor!==void 0)return null;t.__h!=null&&(u=t.__h,l=e.__e=t.__e,e.__h=null,o=[l]),(f=p.__b)&&f(e);try{e:if(typeof b=="function"){if(g=e.props,v=(f=b.contextType)&&i[f.__c],C=f?v?v.props.value:f.__:i,t.__c?S=(s=e.__c=t.__c).__=s.__E:("prototype"in b&&b.prototype.render?e.__c=s=new b(g,C):(e.__c=s=new x(g,C),s.constructor=b,s.render=ue),v&&v.sub(s),s.props=g,s.state||(s.state={}),s.context=C,s.__n=i,m=s.__d=!0,s.__h=[]),s.__s==null&&(s.__s=s.state),b.getDerivedStateFromProps!=null&&(s.__s==s.state&&(s.__s=E({},s.__s)),E(s.__s,b.getDerivedStateFromProps(g,s.__s))),_=s.props,c=s.state,m)b.getDerivedStateFromProps==null&&s.componentWillMount!=null&&s.componentWillMount(),s.componentDidMount!=null&&s.__h.push(s.componentDidMount);else{if(b.getDerivedStateFromProps==null&&g!==_&&s.componentWillReceiveProps!=null&&s.componentWillReceiveProps(g,C),!s.__e&&s.shouldComponentUpdate!=null&&s.shouldComponentUpdate(g,s.__s,C)===!1||e.__v===t.__v){s.props=g,s.state=s.__s,e.__v!==t.__v&&(s.__d=!1),s.__v=e,e.__e=t.__e,e.__k=t.__k,e.__k.forEach(function(B){B&&(B.__=e)}),s.__h.length&&a.push(s);break e}s.componentWillUpdate!=null&&s.componentWillUpdate(g,s.__s,C),s.componentDidUpdate!=null&&s.__h.push(function(){s.componentDidUpdate(_,c,h)})}if(s.context=C,s.props=g,s.__v=e,s.__P=n,I=p.__r,le=0,"prototype"in b&&b.prototype.render)s.state=s.__s,s.__d=!1,I&&I(e),f=s.render(s.props,s.state,s.context);else do s.__d=!1,I&&I(e),f=s.render(s.props,s.state,s.context),s.state=s.__s;while(s.__d&&++le<25);s.state=s.__s,s.getChildContext!=null&&(i=E(E({},i),s.getChildContext())),m||s.getSnapshotBeforeUpdate==null||(h=s.getSnapshotBeforeUpdate(_,c)),U=f!=null&&f.type===z&&f.key==null?f.props.children:f,Y(n,Array.isArray(U)?U:[U],e,t,i,r,o,a,l,u),s.base=e.__e,e.__h=null,s.__h.length&&a.push(s),S&&(s.__E=s.__=null),s.__e=!1}else o==null&&e.__v===t.__v?(e.__k=t.__k,e.__e=t.__e):e.__e=_e(t.__e,e,t,i,r,o,a,u);(f=p.diffed)&&f(e)}catch(B){e.__v=null,(u||o!=null)&&(e.__e=l,e.__h=!!u,o[o.indexOf(l)]=null),p.__e(B,e,t)}}function ne(n,e){p.__c&&p.__c(e,n),n.some(function(t){try{n=t.__h,t.__h=[],n.some(function(i){i.call(t)})}catch(i){p.__e(i,t.__v)}})}function _e(n,e,t,i,r,o,a,l){var u,f,s,m=t.props,_=e.props,c=e.type,h=0;if(c==="svg"&&(r=!0),o!=null){for(;h<o.length;h++)if((u=o[h])&&"setAttribute"in u==!!c&&(c?u.localName===c:u.nodeType===3)){n=u,o[h]=null;break}}if(n==null){if(c===null)return document.createTextNode(_);n=r?document.createElementNS("http://www.w3.org/2000/svg",c):document.createElement(c,_.is&&_),o=null,l=!1}if(c===null)m===_||l&&n.data===_||(n.data=_);else{if(o=o&&y.call(n.childNodes),f=(m=t.props||L).dangerouslySetInnerHTML,s=_.dangerouslySetInnerHTML,!l){if(o!=null)for(m={},h=0;h<n.attributes.length;h++)m[n.attributes[h].name]=n.attributes[h].value;(s||f)&&(s&&(f&&s.__html==f.__html||s.__html===n.innerHTML)||(n.innerHTML=s&&s.__html||""))}if(ce(n,_,m,r,l),s)e.__k=[];else if(h=e.props.children,Y(n,Array.isArray(h)?h:[h],e,t,i,r&&c!=="foreignObject",o,a,o?o[0]:t.__k&&M(t,0),l),o!=null)for(h=o.length;h--;)o[h]!=null&&Q(o[h]);l||("value"in _&&(h=_.value)!==void 0&&(h!==n.value||c==="progress"&&!h||c==="option"&&h!==m.value)&&A(n,"value",h,m.value,!1),"checked"in _&&(h=_.checked)!==void 0&&h!==n.checked&&A(n,"checked",h,m.checked,!1))}return n}function ie(n,e,t){try{typeof n=="function"?n(e):n.current=e}catch(i){p.__e(i,t)}}function oe(n,e,t){var i,r;if(p.unmount&&p.unmount(n),(i=n.ref)&&(i.current&&i.current!==n.__e||ie(i,null,e)),(i=n.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(o){p.__e(o,e)}i.base=i.__P=null}if(i=n.__k)for(r=0;r<i.length;r++)i[r]&&oe(i[r],e,typeof n.type!="function");t||n.__e==null||Q(n.__e),n.__e=n.__d=void 0}function ue(n,e,t){return this.constructor(n,t)}function he(n,e,t){var i,r,o;p.__&&p.__(n,e),r=(i=!1)?null:e.__k,o=[],H(e,n=e.__k=de(z,null,[n]),r||L,L,e.ownerSVGElement!==void 0,r?null:e.firstChild?y.call(e.childNodes):null,o,r?r.__e:e.firstChild,i),ne(o,n)}y=$.slice,p={__e:function(n,e,t,i){for(var r,o,a;e=e.__;)if((r=e.__c)&&!r.__)try{if((o=r.constructor)&&o.getDerivedStateFromError!=null&&(r.setState(o.getDerivedStateFromError(n)),a=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(n,i||{}),a=r.__d),a)return r.__E=r}catch(l){n=l}throw n}},F=0,x.prototype.setState=function(n,e){var t;t=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=E({},this.state),typeof n=="function"&&(n=n(E({},t),this.props)),n&&E(t,n),n!=null&&this.__v&&(e&&this.__h.push(e),V(this))},x.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),V(this))},x.prototype.render=z,T=[],W.__r=0;var fe=0;function d(n,e,t,i,r){var o,a,l={};for(a in e)a=="ref"?o=e[a]:l[a]=e[a];var u={type:n,props:l,key:t,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--fe,__source:r,__self:i};if(typeof n=="function"&&(o=n.defaultProps))for(a in o)l[a]===void 0&&(l[a]=o[a]);return p.vnode&&p.vnode(u),u}function pe(){let n,e=me("utm_source");return e?n=e:document.referrer?n=document.referrer:n="",encodeURIComponent(n+"")}function me(n){n=n.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");let e=new RegExp("[\\?&]"+n+"=([^&#]*)"),t=e.exec(location.search);return t===null?"":decodeURIComponent(t[1].replace(/\+/g," "))}function ge(){return d("svg",{className:"querlo_icon icon-window-minimize",children:d("use",{xlinkHref:"#icon-window-minimize"})})}function ve(){return d("svg",{className:"querlo_icon icon-window-maximize",children:d("use",{xlinkHref:"#icon-window-maximize"})})}function D(){return d("svg",{className:"querlo_icon icon-cancel",children:d("use",{xlinkHref:"#icon-cancel"})})}const re=d("svg",{style:"position: absolute; width: 0; height: 0; overflow: hidden;",children:d("defs",{children:[d("symbol",{id:"icon-cancel",viewBox:"0 0 25 32",children:[d("title",{children:"cancel"}),d("path",{d:"M23.168 23.616q0 0.704-0.48 1.216l-2.432 2.432q-0.512 0.48-1.216 0.48t-1.216-0.48l-5.248-5.28-5.248 5.28q-0.512 0.48-1.216 0.48t-1.216-0.48l-2.432-2.432q-0.512-0.512-0.512-1.216t0.512-1.216l5.248-5.248-5.248-5.248q-0.512-0.512-0.512-1.216t0.512-1.216l2.432-2.432q0.512-0.512 1.216-0.512t1.216 0.512l5.248 5.248 5.248-5.248q0.512-0.512 1.216-0.512t1.216 0.512l2.432 2.432q0.48 0.48 0.48 1.216t-0.48 1.216l-5.248 5.248 5.248 5.248q0.48 0.48 0.48 1.216z"})]}),d("symbol",{id:"icon-help-circled",viewBox:"0 0 27 32",children:[d("title",{children:"help-circled"}),d("path",{d:"M16 24.576v-3.424q0-0.256-0.16-0.416t-0.416-0.16h-3.424q-0.256 0-0.416 0.16t-0.16 0.416v3.424q0 0.256 0.16 0.416t0.416 0.16h3.424q0.256 0 0.416-0.16t0.16-0.416zM20.576 12.576q0-1.568-0.992-2.912t-2.464-2.080-3.040-0.736q-4.352 0-6.624 3.808-0.288 0.416 0.128 0.768l2.368 1.76q0.128 0.128 0.32 0.128 0.288 0 0.448-0.224 0.96-1.216 1.536-1.632 0.608-0.448 1.536-0.448 0.864 0 1.536 0.48t0.672 1.056q0 0.672-0.352 1.088t-1.216 0.8q-1.12 0.48-2.080 1.536t-0.928 2.24v0.64q0 0.256 0.16 0.416t0.416 0.16h3.424q0.256 0 0.416-0.16t0.16-0.416q0-0.32 0.384-0.864t0.96-0.896q0.576-0.32 0.896-0.512t0.8-0.608 0.8-0.864 0.512-1.088 0.224-1.44zM27.424 16q0 3.744-1.824 6.88t-4.992 4.992-6.88 1.856-6.912-1.856-4.96-4.992-1.856-6.88 1.856-6.88 4.96-4.992 6.912-1.856 6.88 1.856 4.992 4.992 1.824 6.88z"})]}),d("symbol",{id:"icon-comment",viewBox:"0 0 32 32",children:[d("title",{children:"comment"}),d("path",{d:"M32 16q0 3.104-2.144 5.728t-5.824 4.16-8.032 1.536q-1.248 0-2.592-0.128-3.52 3.104-8.224 4.32-0.864 0.256-2.016 0.384-0.32 0.032-0.544-0.16t-0.32-0.512v-0.032q-0.064-0.064 0-0.192t0.032-0.192 0.064-0.16l0.128-0.16t0.128-0.16 0.128-0.16q0.128-0.16 0.544-0.608t0.64-0.704 0.544-0.704 0.576-0.896 0.48-1.056 0.48-1.344q-2.816-1.6-4.416-3.936t-1.632-5.024q0-2.336 1.28-4.448t3.392-3.648 5.12-2.432 6.208-0.896q4.352 0 8.032 1.536t5.824 4.16 2.144 5.728z"})]}),d("symbol",{id:"icon-window-maximize",viewBox:"0 0 32 32",children:[d("title",{children:"window-maximize"}),d("path",{d:"M4.576 25.152h22.848v-13.728h-22.848v13.728zM32 5.152v21.696q0 1.184-0.832 2.016t-2.016 0.864h-26.304q-1.152 0-2.016-0.864t-0.832-2.016v-21.696q0-1.184 0.832-2.016t2.016-0.864h26.304q1.184 0 2.016 0.864t0.832 2.016z"})]}),d("symbol",{id:"icon-window-minimize",viewBox:"0 0 32 32",children:[d("title",{children:"window-minimize"}),d("path",{d:"M32 23.424v3.424q0 1.184-0.832 2.016t-2.016 0.864h-26.304q-1.152 0-2.016-0.864t-0.832-2.016v-3.424q0-1.184 0.832-2.016t2.016-0.832h26.304q1.184 0 2.016 0.832t0.832 2.016z"})]})]})});class ye extends x{constructor(){super()}render(e){return d("div",{class:"querlo_popup querlo_img",children:d("div",{class:"querlo_contentWrp",children:[d("div",{class:"querlo_header",style:{backgroundColor:e.color},children:d("div",{class:"querlo_close",onClick:e.cb,children:d(D,{})})}),d("section",{id:"querlo_docWrp",children:d("img",{src:e.data.img})})]})})}}function we(n,e,t,i,r){const o=d("div",{className:e.show?"querlo_chatWrp querlo_open":"querlo_chatWrp",children:[d("div",{className:"querlo_chatBar qrlfadeInUp",onClick:r.toggle,children:[d("div",{className:e.inited?"querlo_avatar":"querlo_avatar qrlpulse",style:{borderColor:n.data.mainColor},children:d("img",{src:n.data.speakerImg?n.data.speakerImg:"https://static.querlo.com/image_uploads/avatar1/608_5f2bcb679692b_png_small.png"})}),!e.inited&&n.data.introTxt?d("div",{class:"querlo_message",children:n.data.introTxt}):"",e.inited?"":d("div",{className:"querlo_number",children:"1"})]}),d("div",{className:"querlo_openWrp",children:d("div",{class:"querlo_bodyWrp querlo_qrlfadeInUp2",children:[d("div",{class:"querlo_header",style:{backgroundColor:n.data.mainColor},children:[n.data.speakerName,d("div",{class:"querlo_buttonsWrp",children:[d("a",{href:"#",onMouseEnter:l=>r.toggleHoverColor(l,n.data.mainColor),onMouseLeave:l=>r.toggleHoverColor(l,""),onClick:r.toggleFullscreen,children:e.fullscreen?d(ge,{}):d(ve,{})}),d("a",{href:"#",onMouseEnter:l=>r.toggleHoverColor(l,n.data.mainColor),onMouseLeave:l=>r.toggleHoverColor(l,""),onClick:r.toggle,children:d(D,{})})]})]}),d("div",{className:"querlo_iframeWrp",children:e.inited?d("iframe",{allow:"microphone;camera;midi;encrypted-media;",src:i,id:"querloIframe",seamless:!0}):""})]})}),re,e.showImagePopup?d(ye,{cb:r.closeImagePopup,data:e.showImagePopup,color:n.data.mainColor}):""]});return{inpage:d("iframe",{allow:"microphone;camera;midi;encrypted-media;",src:i,seamless:!0}),esd:o,inpage_popup:d("div",{className:`querlo_popup_center ${e.show?"open":"closed"}`,children:[d("div",{className:"querlo_overlay",onClick:r.toggle}),e.show&&d("div",{className:"querlo_close_btn",onClick:r.toggle,style:{backgroundColor:n.data.mainColor},children:d(D,{})}),d("iframe",{allow:"microphone;camera;midi;encrypted-media;",src:i,seamless:!0}),re]})}[t]}const qe=window.location.href,O="querlo_fullscreen",se=qe.split("/");se[0]+""+se[2];function P(n,e){n&&(e.width&&typeof e.width!="number"&&e.width.indexOf("%")!==-1?n.classList.add(O):(e.width&&(n.style.width=e.width+"px"),n.classList.remove(O)))}function be(n){let e=new XMLHttpRequest;e.onreadystatechange=function(){if(e.readyState===4)return e.status>=200&&e.status<300?(n.cb&&n.cb(e.responseText),e.responseText):(console.log("error",e),n.cb&&n.cb(!1),e)},e.open("GET",n.url),e.send()}class Ce extends x{constructor(){super();w(this,"toggle",(t,i)=>{var l;t&&t.preventDefault&&t.preventDefault();const r=(l=this.base)==null?void 0:l.parentElement;if(!r)return;if(!this.state.show){const u=this.base.classList.contains("querlo_popup_center")?this.base:this.base.querySelector(".querlo_popup_center");if(u){const f=u.getBoundingClientRect();r.style.setProperty("--origin-top",f.top+"px"),r.style.setProperty("--origin-left",f.left+"px"),r.style.setProperty("--origin-width",f.width+"px"),r.style.setProperty("--origin-height",f.height+"px")}}const o=!this.state.show,a=i!==void 0?i:o?this.state.fullscreen:!1;this.setState({inited:!0,show:o,fullscreen:a}),P(r,a?{width:"100%"}:{width:this.props.data.width,height:this.props.data.height})});w(this,"toggleHoverColor",(t,i)=>{const r=t.target.querySelector("svg");r.style.fill=i});w(this,"toggleFullscreen",t=>{var o;t&&t.preventDefault();const i=!this.state.fullscreen,r=(o=this.base)==null?void 0:o.parentElement;r&&(P(r,i?{width:"100%"}:{width:this.props.data.width,height:this.props.data.height}),this.setState({fullscreen:i}))});w(this,"handleScopedCommand",t=>{const{name:i,params:r}=t.detail;i==="OPEN"&&!this.state.show&&this.toggle(!1,r==null?void 0:r.fullscreen),i==="CLOSE"&&this.state.show&&this.toggle(!1),i==="RESIZE_CLIENT"&&!this.state.fullscreen&&P(this.base,r)});w(this,"closeImagePopup",()=>{this.setState({showImagePopup:!1})});w(this,"receiveMessage",t=>{var u,f,s,m;const i=(u=this.base)==null?void 0:u.querySelector("iframe"),r=i==null?void 0:i.contentWindow,o=t.source===r,a=t.source===window;if(!o&&!a)return;const l=t.data.command;if(t.data.querloMessageType==="clientEvent"){if(l.name==="OPEN"&&!this.state.show&&this.toggle(!1,((f=l.params)==null?void 0:f.fullscreen)||((s=l.params)==null?void 0:s.fullScreen)),l.name==="CLOSE"&&this.state.show&&this.toggle(!1),l.name==="RESIZE_CLIENT"&&!this.state.fullscreen&&o){const _=(m=this.base)==null?void 0:m.parentElement;_&&P(_,l.params)}l.name==="XHR_CALL"&&o&&be(t.data.command.params),l.name==="OPEN_IMAGE_POPUP"&&o&&this.setState({showImagePopup:l.params})}});w(this,"stopPropagation",t=>t.stopPropagation());this.state={inited:!1,show:!1}}componentDidMount(){var i,r;if(this.props.data.delay&&setTimeout(()=>{!this.state.inited&&!this.state.show&&this.toggle(!1)},this.props.data.delay),this.props.template==="inpage"||this.props.template==="popup_center"||this.props.template==="inpage_popup"){const o=(i=this.base)==null?void 0:i.parentElement;o&&P(o,{width:this.props.data.width,height:this.props.data.height})}window.addEventListener("message",this.receiveMessage,!1);const t=(r=this.base)==null?void 0:r.parentElement;t&&t.addEventListener("querlo-command",this.handleScopedCommand)}componentWillUnmount(){var i;window.removeEventListener("message",this.receiveMessage);const t=(i=this.base)==null?void 0:i.parentElement;t&&t.removeEventListener("querlo-command",this.handleScopedCommand)}render(t,i){let o="https://chat.querlo.com/"+t.data.id+"?utm_source_js="+t.data.referrer;return t.data.params&&(o+="&"+t.data.params),we(t,i,t.data.template,o,this)}}const k=class k{constructor(){this.initChat(),typeof window<"u"&&!k.listenerAdded&&(k.listenerAdded=!0,window.addEventListener("querlo-new-embed",()=>this.initChat()))}initChat(){document.querySelectorAll(".querlo, #querloEmbd").forEach(t=>{if(k.initializedElements.has(t)||!t.dataset.id)return;k.initializedElements.add(t);const i=t.dataset,r={id:i.id,width:i.querloW||i.width,height:i.querloH||i.height,template:i.template||"esd",referrer:pe(),posX:i.posX||"right",posY:i.posY||"bottom",speakerImg:i.speakerImg,speakerName:i.speakerName,introTxt:i.introTxt,delay:i.delay,mainColor:i.mainColor||"rgb(107,185,240)"};t.classList.add(r.template),t.classList.add(r.posX),t.classList.add(r.posY),(r.template==="inpage"||r.template==="popup_center"||r.template==="inpage_popup")&&(t.style.width=r.width+"px",t.style.minHeight=r.height+"px"),he(d(Ce,{data:r}),t)})}};w(k,"initializedElements",new Set),w(k,"listenerAdded",!1);let R=k;class Ee{constructor(){w(this,"listeners",new Map);w(this,"initialized",!1);w(this,"_loading",!1);w(this,"_chatbotWaiting",!1);w(this,"controllers",new Set);typeof window<"u"&&this.initMessageListener()}embed(e){let t=null;e.container&&(t=typeof e.container=="string"?document.querySelector(e.container):e.container),t||(t=document.createElement("div"),document.body.appendChild(t)),t.classList.add("querlo"),e.id&&(t.dataset.id=e.id),e.width&&(t.dataset.width=e.width),e.height&&(t.dataset.height=e.height),e.template&&(t.dataset.template=e.template),e.posX&&(t.dataset.posX=e.posX),e.posY&&(t.dataset.posY=e.posY),e.mainColor&&(t.dataset.mainColor=e.mainColor),e.speakerImg&&(t.dataset.speakerImg=e.speakerImg),e.speakerName&&(t.dataset.speakerName=e.speakerName),e.introTxt&&(t.dataset.introTxt=e.introTxt),e.delay&&(t.dataset.delay=e.delay);const i=t,r={element:i,open:(o=!1)=>this.sendCommandToElement(i,"OPEN",{fullscreen:o}),close:()=>this.sendCommandToElement(i,"CLOSE"),sendMessage:o=>{const a=i.querySelector("iframe");a!=null&&a.contentWindow&&a.contentWindow.postMessage({querloMessageType:"sendMessage",querloMessageBody:{text:o}},"*")},setVariable:(o,a)=>{const l=i.querySelector("iframe");l!=null&&l.contentWindow&&l.contentWindow.postMessage({querloMessageType:"SET-CHAT-VARIABLE",varName:o,varContent:a},"*")},destroy:()=>{this.controllers.delete(r),i.remove()}};return this.controllers.add(r),typeof window<"u"&&window.dispatchEvent(new CustomEvent("querlo-new-embed")),r}open(e=!1){this.sendCommand("OPEN",{fullscreen:e})}openFullscreen(){this.open(!0)}close(){this.sendCommand("CLOSE")}sendMessage(e){this.controllers.forEach(t=>t.sendMessage(e))}setVariable(e,t){this.controllers.forEach(i=>i.setVariable(e,t))}isLoading(){return this._loading}isWaiting(){return this._chatbotWaiting}on(e,t){return this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(t),()=>this.off(e,t)}off(e,t){var i;(i=this.listeners.get(e))==null||i.delete(t)}sendCommand(e,t={}){window.postMessage({querloMessageType:"clientEvent",command:{name:e,params:t}},"*")}sendCommandToElement(e,t,i={}){e.dispatchEvent(new CustomEvent("querlo-command",{detail:{name:t,params:i}}))}initMessageListener(){this.initialized||(this.initialized=!0,window.addEventListener("message",e=>{let t=e.data;if(typeof t=="string")try{t=JSON.parse(t)}catch{return}if(!t||typeof t!="object")return;const i=this.normalizeMessage(t);if(!i)return;const{querloMessageType:r,querloMessageBody:o}=i;if(r==="clientEvent"){const a=o.name||"";if(a==="WAITING_REQUEST")this._chatbotWaiting=!0,this.emit("WAITING_REQUEST",i);else if(a==="BUILD_PAGE"){this._chatbotWaiting=!1,this._loading=!1,this.emit("loading",!1);const l=this.parseBuildPageEvent(o);l&&this.emit("BUILD_PAGE",l)}}this.emit("message",i),this.emit(r,o),r==="clientEvent"&&o.name&&this.emit(o.name,o.params||o)}),console.log("[QuerloAPI] API Layer initialized — Supporting multiple instances"))}parseBuildPageEvent(e){if(!e||typeof e!="object")return null;const t=e.params||e.data||e.payload||e;if(typeof t!="object")return null;let i;if(t.page){if(i=t,i.page&&i.page.page){const r=i.page,o=r.page;i={page:o,missing_info:r.missing_info||o.missing_info||[],version:r.version||i.version}}}else i={page:t,missing_info:t.missing_info||[]};return i}normalizeMessage(e){if(e.querloMessageType&&typeof e.querloMessageType=="string")return{querloMessageType:e.querloMessageType,querloMessageBody:e.querloMessageBody||e.command||{}};if(Array.isArray(e.b)&&e.b.length>0){const t=e.b[0];if(t&&typeof t=="object"&&t.t)return{querloMessageType:t.t,querloMessageBody:t.b||{}}}return null}emit(e,t){var i;(i=this.listeners.get(e))==null||i.forEach(r=>{try{r(t)}catch(o){console.error(o)}})}}const j=new Ee;typeof window<"u"&&(window.Querlo=j,window.dispatchEvent(new CustomEvent("querlo-ready",{detail:j}))),new R,q.QuerloAPI=j,Object.defineProperty(q,Symbol.toStringTag,{value:"Module"})}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function getReferral(): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function templates(props: any, state: any, tpl: string, url: string, scope: any): any;
|
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@querlo/sdk",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Querlo Chatbot Embed SDK - Programmatic control and multi-instance support",
|
|
6
|
+
"author": "Querlo",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"main": "./dist/querlo-sdk.umd.js",
|
|
9
|
+
"module": "./dist/querlo-sdk.es.js",
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"import": "./dist/querlo-sdk.es.js",
|
|
15
|
+
"require": "./dist/querlo-sdk.umd.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist",
|
|
20
|
+
"README.md",
|
|
21
|
+
"QUERLO_SDK_GUIDE.md"
|
|
22
|
+
],
|
|
23
|
+
"keywords": [
|
|
24
|
+
"querlo",
|
|
25
|
+
"chatbot",
|
|
26
|
+
"sdk",
|
|
27
|
+
"embed",
|
|
28
|
+
"ai"
|
|
29
|
+
],
|
|
30
|
+
"scripts": {
|
|
31
|
+
"dev": "vite",
|
|
32
|
+
"build": "rimraf dist && tsc --build && vite build",
|
|
33
|
+
"preview": "vite preview",
|
|
34
|
+
"clean": "rimraf ./dist",
|
|
35
|
+
"watch:tsc": "tsc --noEmit --watch",
|
|
36
|
+
"prepublishOnly": "npm run build"
|
|
37
|
+
},
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"preact": ">=10.0.0"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@preact/preset-vite": "^2.10.3",
|
|
43
|
+
"@types/node": "^20.0.0",
|
|
44
|
+
"autoprefixer": "^10.0.0",
|
|
45
|
+
"postcss": "^8.4.0",
|
|
46
|
+
"preact": "10.10.6",
|
|
47
|
+
"rimraf": "^3.0.2",
|
|
48
|
+
"sass": "^1.60.0",
|
|
49
|
+
"typescript": "^5.0.0",
|
|
50
|
+
"vite": "^6.4.1",
|
|
51
|
+
"vite-plugin-css-injected-by-js": "^3.5.2"
|
|
52
|
+
}
|
|
53
|
+
}
|