rio-assist-widget 0.1.5 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/rio-assist.js +73 -55
- package/index.html +9 -17
- package/package.json +1 -1
- package/src/assets/icons/closeIcon.png +0 -0
- package/src/components/conversations-panel/conversations-panel.styles.ts +294 -294
- package/src/components/conversations-panel/conversations-panel.template.ts +184 -184
- package/src/components/fullscreen/fullscreen.styles.ts +185 -178
- package/src/components/mini-panel/mini-panel.styles.ts +346 -335
- package/src/components/mini-panel/mini-panel.template.ts +2 -1
- package/src/components/rio-assist/rio-assist.ts +281 -255
package/dist/rio-assist.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
(function(){"use strict";var ve;var
|
|
1
|
+
(function(){"use strict";var ve;var l=typeof document<"u"?document.currentScript:null;/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/const N=globalThis,D=N.ShadowRoot&&(N.ShadyCSS===void 0||N.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,j=Symbol(),
|
|
5
|
+
*/const N=globalThis,D=N.ShadowRoot&&(N.ShadyCSS===void 0||N.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,j=Symbol(),K=new WeakMap;let Z=class{constructor(e,t,s){if(this._$cssResult$=!0,s!==j)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(D&&e===void 0){const s=t!==void 0&&t.length===1;s&&(e=K.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),s&&K.set(t,e))}return e}toString(){return this.cssText}};const we=n=>new Z(typeof n=="string"?n:n+"",void 0,j),I=(n,...e)=>{const t=n.length===1?n[0]:e.reduce((s,i,o)=>s+(r=>{if(r._$cssResult$===!0)return r.cssText;if(typeof r=="number")return r;throw Error("Value passed to 'css' function must be a 'css' function result: "+r+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+n[o+1],n[0]);return new Z(t,n,j)},xe=(n,e)=>{if(D)n.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const s=document.createElement("style"),i=N.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=t.cssText,n.appendChild(s)}},W=D?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let t="";for(const s of e.cssRules)t+=s.cssText;return we(t)})(n):n;/**
|
|
6
6
|
* @license
|
|
7
7
|
* Copyright 2017 Google LLC
|
|
8
8
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
-
*/const{is:Ce,defineProperty:Se,getOwnPropertyDescriptor:ye,getOwnPropertyNames:Ue,getOwnPropertySymbols:Ee,getPrototypeOf:Ie}=Object,b=globalThis,J=b.trustedTypes,$e=J?J.emptyScript:"",H=b.reactiveElementPolyfillSupport,$=(n,e)=>n,V={toAttribute(n,e){switch(e){case Boolean:n=n?$e:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,e){let t=n;switch(e){case Boolean:t=n!==null;break;case Number:t=n===null?null:Number(n);break;case Object:case Array:try{t=JSON.parse(n)}catch{t=null}}return t}},ee=(n,e)=>!Ce(n,e),te={attribute:!0,type:String,converter:V,reflect:!1,useDefault:!1,hasChanged:ee};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),b.litPropertyMetadata??(b.litPropertyMetadata=new WeakMap);let U=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=te){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(e,s,t);i!==void 0&&Se(this.prototype,e,i)}}static getPropertyDescriptor(e,t,s){const{get:i,set:
|
|
9
|
+
*/const{is:Ce,defineProperty:Se,getOwnPropertyDescriptor:ye,getOwnPropertyNames:Ue,getOwnPropertySymbols:Ee,getPrototypeOf:Ie}=Object,b=globalThis,J=b.trustedTypes,$e=J?J.emptyScript:"",H=b.reactiveElementPolyfillSupport,$=(n,e)=>n,V={toAttribute(n,e){switch(e){case Boolean:n=n?$e:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,e){let t=n;switch(e){case Boolean:t=n!==null;break;case Number:t=n===null?null:Number(n);break;case Object:case Array:try{t=JSON.parse(n)}catch{t=null}}return t}},ee=(n,e)=>!Ce(n,e),te={attribute:!0,type:String,converter:V,reflect:!1,useDefault:!1,hasChanged:ee};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),b.litPropertyMetadata??(b.litPropertyMetadata=new WeakMap);let U=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=te){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(e,s,t);i!==void 0&&Se(this.prototype,e,i)}}static getPropertyDescriptor(e,t,s){const{get:i,set:o}=ye(this.prototype,e)??{get(){return this[t]},set(r){this[t]=r}};return{get:i,set(r){const c=i==null?void 0:i.call(this);o==null||o.call(this,r),this.requestUpdate(e,c,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??te}static _$Ei(){if(this.hasOwnProperty($("elementProperties")))return;const e=Ie(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty($("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty($("properties"))){const t=this.properties,s=[...Ue(t),...Ee(t)];for(const i of s)this.createProperty(i,t[i])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[s,i]of t)this.elementProperties.set(s,i)}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);i!==void 0&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const s=new Set(e.flat(1/0).reverse());for(const i of s)t.unshift(W(i))}else e!==void 0&&t.push(W(e));return t}static _$Eu(e,t){const s=t.attribute;return s===!1?void 0:typeof s=="string"?s:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const s of t.keys())this.hasOwnProperty(s)&&(e.set(s,this[s]),delete this[s]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return xe(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var s;return(s=t.hostConnected)==null?void 0:s.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var s;return(s=t.hostDisconnected)==null?void 0:s.call(t)})}attributeChangedCallback(e,t,s){this._$AK(e,s)}_$ET(e,t){var o;const s=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,s);if(i!==void 0&&s.reflect===!0){const r=(((o=s.converter)==null?void 0:o.toAttribute)!==void 0?s.converter:V).toAttribute(t,s.type);this._$Em=e,r==null?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(e,t){var o,r;const s=this.constructor,i=s._$Eh.get(e);if(i!==void 0&&this._$Em!==i){const c=s.getPropertyOptions(i),a=typeof c.converter=="function"?{fromAttribute:c.converter}:((o=c.converter)==null?void 0:o.fromAttribute)!==void 0?c.converter:V;this._$Em=i;const h=a.fromAttribute(t,c.type);this[i]=h??((r=this._$Ej)==null?void 0:r.get(i))??h,this._$Em=null}}requestUpdate(e,t,s){var i;if(e!==void 0){const o=this.constructor,r=this[e];if(s??(s=o.getPropertyOptions(e)),!((s.hasChanged??ee)(r,t)||s.useDefault&&s.reflect&&r===((i=this._$Ej)==null?void 0:i.get(e))&&!this.hasAttribute(o._$Eu(e,s))))return;this.C(e,t,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:s,reflect:i,wrapped:o},r){s&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,r??t??this[e]),o!==!0||r!==void 0)||(this._$AL.has(e)||(this.hasUpdated||s||(t=void 0),this._$AL.set(e,t)),i===!0&&this._$Em!==e&&(this._$Eq??(this._$Eq=new Set)).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var s;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[o,r]of this._$Ep)this[o]=r;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[o,r]of i){const{wrapped:c}=r,a=this[o];c!==!0||this._$AL.has(o)||a===void 0||this.C(o,void 0,r,a)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(s=this._$EO)==null||s.forEach(i=>{var o;return(o=i.hostUpdate)==null?void 0:o.call(i)}),this.update(t)):this._$EM()}catch(i){throw e=!1,this._$EM(),i}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(s=>{var i;return(i=s.hostUpdated)==null?void 0:i.call(s)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach(t=>this._$ET(t,this[t]))),this._$EM()}updated(e){}firstUpdated(e){}};U.elementStyles=[],U.shadowRootOptions={mode:"open"},U[$("elementProperties")]=new Map,U[$("finalized")]=new Map,H==null||H({ReactiveElement:U}),(b.reactiveElementVersions??(b.reactiveElementVersions=[])).push("2.1.1");/**
|
|
10
10
|
* @license
|
|
11
11
|
* Copyright 2017 Google LLC
|
|
12
12
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
13
|
-
*/const R=globalThis,Q=R.trustedTypes,se=Q?Q.createPolicy("lit-html",{createHTML:n=>n}):void 0,ie="$lit$",m=`lit$${Math.random().toFixed(9).slice(2)}$`,ne="?"+m,Re=`<${ne}>`,
|
|
14
|
-
\f\r]`,k=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,
|
|
15
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),ae=/'/g,le=/"/g,ce=/^(?:script|style|textarea|title)$/i,
|
|
13
|
+
*/const R=globalThis,Q=R.trustedTypes,se=Q?Q.createPolicy("lit-html",{createHTML:n=>n}):void 0,ie="$lit$",m=`lit$${Math.random().toFixed(9).slice(2)}$`,ne="?"+m,Re=`<${ne}>`,x=document,B=()=>x.createComment(""),_=n=>n===null||typeof n!="object"&&typeof n!="function",F=Array.isArray,Be=n=>F(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",X=`[
|
|
14
|
+
\f\r]`,k=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,oe=/-->/g,re=/>/g,C=RegExp(`>|${X}(?:([^\\s"'>=/]+)(${X}*=${X}*(?:[^
|
|
15
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),ae=/'/g,le=/"/g,ce=/^(?:script|style|textarea|title)$/i,_e=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),u=_e(1),v=Symbol.for("lit-noChange"),A=Symbol.for("lit-nothing"),he=new WeakMap,S=x.createTreeWalker(x,129);function de(n,e){if(!F(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return se!==void 0?se.createHTML(e):e}const ke=(n,e)=>{const t=n.length-1,s=[];let i,o=e===2?"<svg>":e===3?"<math>":"",r=k;for(let c=0;c<t;c++){const a=n[c];let h,p,d=-1,f=0;for(;f<a.length&&(r.lastIndex=f,p=r.exec(a),p!==null);)f=r.lastIndex,r===k?p[1]==="!--"?r=oe:p[1]!==void 0?r=re:p[2]!==void 0?(ce.test(p[2])&&(i=RegExp("</"+p[2],"g")),r=C):p[3]!==void 0&&(r=C):r===C?p[0]===">"?(r=i??k,d=-1):p[1]===void 0?d=-2:(d=r.lastIndex-p[2].length,h=p[1],r=p[3]===void 0?C:p[3]==='"'?le:ae):r===le||r===ae?r=C:r===oe||r===re?r=k:(r=C,i=void 0);const w=r===C&&n[c+1].startsWith("/>")?" ":"";o+=r===k?a+Re:d>=0?(s.push(h),a.slice(0,d)+ie+a.slice(d)+m+w):a+m+(d===-2?c:w)}return[de(n,o+(n[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),s]};class M{constructor({strings:e,_$litType$:t},s){let i;this.parts=[];let o=0,r=0;const c=e.length-1,a=this.parts,[h,p]=ke(e,t);if(this.el=M.createElement(h,s),S.currentNode=this.el.content,t===2||t===3){const d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(i=S.nextNode())!==null&&a.length<c;){if(i.nodeType===1){if(i.hasAttributes())for(const d of i.getAttributeNames())if(d.endsWith(ie)){const f=p[r++],w=i.getAttribute(d).split(m),O=/([.?@])?(.*)/.exec(f);a.push({type:1,index:o,name:O[2],strings:w,ctor:O[1]==="."?Te:O[1]==="?"?Pe:O[1]==="@"?Ne:L}),i.removeAttribute(d)}else d.startsWith(m)&&(a.push({type:6,index:o}),i.removeAttribute(d));if(ce.test(i.tagName)){const d=i.textContent.split(m),f=d.length-1;if(f>0){i.textContent=Q?Q.emptyScript:"";for(let w=0;w<f;w++)i.append(d[w],B()),S.nextNode(),a.push({type:2,index:++o});i.append(d[f],B())}}}else if(i.nodeType===8)if(i.data===ne)a.push({type:2,index:o});else{let d=-1;for(;(d=i.data.indexOf(m,d+1))!==-1;)a.push({type:7,index:o}),d+=m.length-1}o++}}static createElement(e,t){const s=x.createElement("template");return s.innerHTML=e,s}}function E(n,e,t=n,s){var r,c;if(e===v)return e;let i=s!==void 0?(r=t._$Co)==null?void 0:r[s]:t._$Cl;const o=_(e)?void 0:e._$litDirective$;return(i==null?void 0:i.constructor)!==o&&((c=i==null?void 0:i._$AO)==null||c.call(i,!1),o===void 0?i=void 0:(i=new o(n),i._$AT(n,t,s)),s!==void 0?(t._$Co??(t._$Co=[]))[s]=i:t._$Cl=i),i!==void 0&&(e=E(n,i._$AS(n,e.values),i,s)),e}class Me{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:s}=this._$AD,i=((e==null?void 0:e.creationScope)??x).importNode(t,!0);S.currentNode=i;let o=S.nextNode(),r=0,c=0,a=s[0];for(;a!==void 0;){if(r===a.index){let h;a.type===2?h=new T(o,o.nextSibling,this,e):a.type===1?h=new a.ctor(o,a.name,a.strings,this,e):a.type===6&&(h=new Qe(o,this,e)),this._$AV.push(h),a=s[++c]}r!==(a==null?void 0:a.index)&&(o=S.nextNode(),r++)}return S.currentNode=x,i}p(e){let t=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(e,s,t),t+=s.strings.length-2):s._$AI(e[t])),t++}}class T{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,s,i){this.type=2,this._$AH=A,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=s,this.options=i,this._$Cv=(i==null?void 0:i.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=E(this,e,t),_(e)?e===A||e==null||e===""?(this._$AH!==A&&this._$AR(),this._$AH=A):e!==this._$AH&&e!==v&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Be(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==A&&_(this._$AH)?this._$AA.nextSibling.data=e:this.T(x.createTextNode(e)),this._$AH=e}$(e){var o;const{values:t,_$litType$:s}=e,i=typeof s=="number"?this._$AC(e):(s.el===void 0&&(s.el=M.createElement(de(s.h,s.h[0]),this.options)),s);if(((o=this._$AH)==null?void 0:o._$AD)===i)this._$AH.p(t);else{const r=new Me(i,this),c=r.u(this.options);r.p(t),this.T(c),this._$AH=r}}_$AC(e){let t=he.get(e.strings);return t===void 0&&he.set(e.strings,t=new M(e)),t}k(e){F(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let s,i=0;for(const o of e)i===t.length?t.push(s=new T(this.O(B()),this.O(B()),this,this.options)):s=t[i],s._$AI(o),i++;i<t.length&&(this._$AR(s&&s._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){var s;for((s=this._$AP)==null?void 0:s.call(this,!1,!0,t);e!==this._$AB;){const i=e.nextSibling;e.remove(),e=i}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}}class L{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,s,i,o){this.type=1,this._$AH=A,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=o,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=A}_$AI(e,t=this,s,i){const o=this.strings;let r=!1;if(o===void 0)e=E(this,e,t,0),r=!_(e)||e!==this._$AH&&e!==v,r&&(this._$AH=e);else{const c=e;let a,h;for(e=o[0],a=0;a<o.length-1;a++)h=E(this,c[s+a],t,a),h===v&&(h=this._$AH[a]),r||(r=!_(h)||h!==this._$AH[a]),h===A?e=A:e!==A&&(e+=(h??"")+o[a+1]),this._$AH[a]=h}r&&!i&&this.j(e)}j(e){e===A?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class Te extends L{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===A?void 0:e}}class Pe extends L{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==A)}}class Ne extends L{constructor(e,t,s,i,o){super(e,t,s,i,o),this.type=5}_$AI(e,t=this){if((e=E(this,e,t,0)??A)===v)return;const s=this._$AH,i=e===A&&s!==A||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,o=e!==A&&(s===A||i);i&&this.element.removeEventListener(this.name,this,s),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t;typeof this._$AH=="function"?this._$AH.call(((t=this.options)==null?void 0:t.host)??this.element,e):this._$AH.handleEvent(e)}}class Qe{constructor(e,t,s){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(e){E(this,e)}}const z=R.litHtmlPolyfillSupport;z==null||z(M,T),(R.litHtmlVersions??(R.litHtmlVersions=[])).push("3.3.1");const Le=(n,e,t)=>{const s=(t==null?void 0:t.renderBefore)??e;let i=s._$litPart$;if(i===void 0){const o=(t==null?void 0:t.renderBefore)??null;s._$litPart$=i=new T(e.insertBefore(B(),o),o,void 0,t??{})}return i._$AI(n),i};/**
|
|
16
16
|
* @license
|
|
17
17
|
* Copyright 2017 Google LLC
|
|
18
18
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
19
|
-
*/const y=globalThis;let
|
|
19
|
+
*/const y=globalThis;let P=class extends U{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Le(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return v}};P._$litElement$=!0,P.finalized=!0,(ve=y.litElementHydrateSupport)==null||ve.call(y,{LitElement:P});const G=y.litElementPolyfillSupport;G==null||G({LitElement:P}),(y.litElementVersions??(y.litElementVersions=[])).push("4.2.1");const Ye=I`
|
|
20
20
|
.floating-button {
|
|
21
21
|
position: absolute;
|
|
22
22
|
pointer-events: auto;
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
opacity: 0;
|
|
62
62
|
pointer-events: none;
|
|
63
63
|
}
|
|
64
|
-
`,
|
|
64
|
+
`,Oe=I`
|
|
65
65
|
.canvas {
|
|
66
66
|
position: absolute;
|
|
67
67
|
inset: 0;
|
|
@@ -227,30 +227,35 @@
|
|
|
227
227
|
width: 100%;
|
|
228
228
|
display: flex;
|
|
229
229
|
flex-direction: column;
|
|
230
|
-
gap:
|
|
230
|
+
gap: 12px;
|
|
231
231
|
}
|
|
232
232
|
|
|
233
233
|
.message {
|
|
234
234
|
border-radius: 16px;
|
|
235
235
|
border: 1px solid #e4eaee;
|
|
236
|
-
padding:
|
|
236
|
+
padding: 10px 16px;
|
|
237
237
|
max-width: 90%;
|
|
238
238
|
background: #fff;
|
|
239
239
|
color: #1f2f36;
|
|
240
240
|
font-size: 15px;
|
|
241
241
|
}
|
|
242
242
|
|
|
243
|
+
.message p {
|
|
244
|
+
margin: 0;
|
|
245
|
+
line-height: 1.35;
|
|
246
|
+
}
|
|
247
|
+
|
|
243
248
|
.message--user {
|
|
244
249
|
align-self: flex-end;
|
|
245
|
-
background: #
|
|
246
|
-
border-color: #
|
|
247
|
-
color: #
|
|
250
|
+
background: #e5ebf0;
|
|
251
|
+
border-color: #cfd6dc;
|
|
252
|
+
color: #1f2f36;
|
|
253
|
+
padding: 8px 10px;
|
|
248
254
|
}
|
|
249
255
|
|
|
250
256
|
.message time {
|
|
251
257
|
display: block;
|
|
252
258
|
font-size: 11px;
|
|
253
|
-
margin-top: 6px;
|
|
254
259
|
color: #8a98a4;
|
|
255
260
|
text-align: right;
|
|
256
261
|
}
|
|
@@ -260,6 +265,10 @@
|
|
|
260
265
|
opacity: 0.75;
|
|
261
266
|
}
|
|
262
267
|
|
|
268
|
+
.message--user time {
|
|
269
|
+
margin-top: 3px;
|
|
270
|
+
}
|
|
271
|
+
|
|
263
272
|
.panel-footer {
|
|
264
273
|
width: 100%;
|
|
265
274
|
display: flex;
|
|
@@ -385,13 +394,15 @@
|
|
|
385
394
|
border: none;
|
|
386
395
|
display: grid;
|
|
387
396
|
place-items: center;
|
|
388
|
-
color: #9ba5b2;
|
|
389
|
-
font-size: 20px;
|
|
390
|
-
font-weight: 600;
|
|
391
|
-
line-height: 1;
|
|
392
397
|
width: 24px;
|
|
393
398
|
height: 24px;
|
|
394
399
|
margin-right: 12px;
|
|
400
|
+
padding: 0;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
.close-button img {
|
|
404
|
+
width: 16px;
|
|
405
|
+
height: 16px;
|
|
395
406
|
}
|
|
396
407
|
`,De=I`
|
|
397
408
|
.fullscreen-shell {
|
|
@@ -564,13 +575,20 @@
|
|
|
564
575
|
display: flex;
|
|
565
576
|
flex-direction: column;
|
|
566
577
|
align-items: center;
|
|
567
|
-
padding: 36px
|
|
578
|
+
padding: 36px 32px 18px;
|
|
579
|
+
width: 100%;
|
|
580
|
+
flex: 1;
|
|
581
|
+
min-height: 0;
|
|
582
|
+
overflow: hidden;
|
|
583
|
+
max-width: 1400px;
|
|
584
|
+
margin: 0 auto;
|
|
568
585
|
}
|
|
569
586
|
|
|
570
587
|
.fullscreen-chat .panel-body {
|
|
571
588
|
max-width: 920px;
|
|
572
589
|
width: 100%;
|
|
573
|
-
padding: 12px
|
|
590
|
+
padding: 12px 32px 12px;
|
|
591
|
+
margin: 0 auto;
|
|
574
592
|
}
|
|
575
593
|
|
|
576
594
|
.fullscreen-chat .panel-footer {
|
|
@@ -868,8 +886,8 @@
|
|
|
868
886
|
.new-conversation-cta__button[aria-disabled='true'] {
|
|
869
887
|
opacity: 0.45;
|
|
870
888
|
cursor: not-allowed;
|
|
871
|
-
border-color: #
|
|
872
|
-
color: #
|
|
889
|
+
border-color: #7bc1d3ff;
|
|
890
|
+
color: #88c5d3ff;
|
|
873
891
|
}
|
|
874
892
|
`,He=[I`
|
|
875
893
|
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@700&display=swap');
|
|
@@ -889,7 +907,7 @@
|
|
|
889
907
|
border-radius: 999px;
|
|
890
908
|
transition: transform 0.2s ease, box-shadow 0.2s ease;
|
|
891
909
|
}
|
|
892
|
-
`,Ye,
|
|
910
|
+
`,Ye,Oe,De,je];/**
|
|
893
911
|
* @license
|
|
894
912
|
* Copyright 2017 Google LLC
|
|
895
913
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -897,7 +915,7 @@
|
|
|
897
915
|
* @license
|
|
898
916
|
* Copyright 2018 Google LLC
|
|
899
917
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
900
|
-
*/const g=ue(class extends Ae{constructor(n){var e;if(super(n),n.type!==pe.ATTRIBUTE||n.name!=="class"||((e=n.strings)==null?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(n){return" "+Object.keys(n).filter(e=>n[e]).join(" ")+" "}update(n,[e]){var s,i;if(this.st===void 0){this.st=new Set,n.strings!==void 0&&(this.nt=new Set(n.strings.join(" ").split(/\s/).filter(
|
|
918
|
+
*/const g=ue(class extends Ae{constructor(n){var e;if(super(n),n.type!==pe.ATTRIBUTE||n.name!=="class"||((e=n.strings)==null?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(n){return" "+Object.keys(n).filter(e=>n[e]).join(" ")+" "}update(n,[e]){var s,i;if(this.st===void 0){this.st=new Set,n.strings!==void 0&&(this.nt=new Set(n.strings.join(" ").split(/\s/).filter(o=>o!=="")));for(const o in e)e[o]&&!((s=this.nt)!=null&&s.has(o))&&this.st.add(o);return this.render(e)}const t=n.element.classList;for(const o of this.st)o in e||(t.remove(o),this.st.delete(o));for(const o in e){const r=!!e[o];r===this.st.has(o)||(i=this.nt)!=null&&i.has(o)||(r?(t.add(o),this.st.add(o)):(t.remove(o),this.st.delete(o)))}return v}}),Ve=new URL("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAIRSURBVHgB7Ze/T8JAFMcfxMVFq5OaGBsTJxccXEn/AAdGNvE/8C9QjP+AOybippuDDrpQdCT+ijpIRJowwICCMZFBk/O99iANob+urS73SV5ee717/XL37l0BkEgkklhJQAQwxhR0isPjbiKR6IIggQSiEA1dBm0BLcVFKT6HG9xIbBntBIUbEBUobptFSwctA1GAgTZZPJBIFcKCQeosPg7c3j3mQ5yG7gPtkDcZDl37+aiClaMq+EOD/4B+mN+Zd4vjuYuZVUIomVWwZmjSoSvNMu1QA02nHcqs/CqBx2xiX7FyRy9gYvlHyb/OY2henUEUFm5zkEiFxym5dXTTkHQRp8HQ0jROK/BcOB/cv93UzPtW+XFUCBKX49f3IEgySOfGWQWq+xeDexL3enwFd7tHTkP6p4zwURdIoJ1es2PO4Ex6Gb4/e+Z1HAgLbF+/mH5+bdX0Lf0B4kBYYD/vqgVryVuXTyCI6/KLz+BtDcZnp9CmYWJpDr6a76YJ4LqBhAS2Md9+MO8Ws2lY2cqannDYzV4UQQRmFemwZHisPYfneQiDV4H1oG6LU7e1UwHXmVVnw4FBFLQiCw4JUHmMnK09B3HAhY5apjwXkGHWmZtitg9Q3tYJI9Dze5CgPz0YfLgcbGB70WkMX8IShES0zLiKI/C5jm4H/gpbLuUCjsvHnoNh4SIpF1MgkUgkkkD8AgAi3WKqFnrYAAAAAElFTkSuQmCC",l&&l.tagName.toUpperCase()==="SCRIPT"&&l.src||new URL("rio-assist.js",document.baseURI).href).href,Fe=n=>u`
|
|
901
919
|
<button
|
|
902
920
|
class="floating-button"
|
|
903
921
|
style="background:${n.accentColor}"
|
|
@@ -911,11 +929,11 @@
|
|
|
911
929
|
* @license
|
|
912
930
|
* Copyright 2018 Google LLC
|
|
913
931
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
914
|
-
*/const ge="important",
|
|
932
|
+
*/const ge="important",Xe=" !"+ge,ze=ue(class extends Ae{constructor(n){var e;if(super(n),n.type!==pe.ATTRIBUTE||n.name!=="style"||((e=n.strings)==null?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(n){return Object.keys(n).reduce((e,t)=>{const s=n[t];return s==null?e:e+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`},"")}update(n,[e]){const{style:t}=n.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(e)),this.render(e);for(const s of this.ft)e[s]==null&&(this.ft.delete(s),s.includes("-")?t.removeProperty(s):t[s]=null);for(const s in e){const i=e[s];if(i!=null){this.ft.add(s);const o=typeof i=="string"&&i.endsWith(Xe);s.includes("-")||o?t.setProperty(s,o?i.slice(0,-11):i,o?ge:""):t[s]=i}}return v}}),Ge=new URL("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAADdSURBVHgB5ZQxCsJAEEX/rsbaI3gEvYE22ppO7DyCJ1BvoCdIFSNBGFOIaBBzg1whR0gpqLsuSWHnBBKI4G+mefyB+Z8B6pBD1C7KCg7wgusCSi0Bndxh9Wb2IP3GS84wN8t2d1rqMeZw3hCIMjuIVEorQhXyKOw7dCt8x98Wm7JPl+4TYiGho4k93HA8G8oLILN1rCHW2/25fMom3U8YDbCSPKAH0CrQwHxqjw74D7n+sevRqVOEZW+4o5Ck1Yo1mrFrKlTa0ISRVcVUpw2F8oZGq3yIpLLnUOtjeAMX/z7Yit+o3QAAAABJRU5ErkJggg==",l&&l.tagName.toUpperCase()==="SCRIPT"&&l.src||new URL("rio-assist.js",document.baseURI).href).href,qe=new URL("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAADJSURBVHgBvZPdCcIwFIVPqvjcETpCnUDzrA86ghOIG+gGbqIv4mPjBhmhI/goFhNv2qpNQfIjeCCQhHu++0MC/CgWEpwfihQjLHCHkEteBgHyc5FBsQIaGR2vqPTYQBJfAG5k0rQapRhgajZOgMmcny5rymaycrqStEo8IJwtWGUztpWzya6eA1XgnEGv51Z6I+d8341L/M1UdoVjP5b5mzV/lf0VEGq2ADHmNyDWbNQMUdGjiDB/ALa8zUbDFiOg9Kredz7KX/QESDR2d7Kg6IcAAAAASUVORK5CYII=",l&&l.tagName.toUpperCase()==="SCRIPT"&&l.src||new URL("rio-assist.js",document.baseURI).href).href,Ke=new URL("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAADoSURBVHgBpZLfDYIwEMavqImPjOAIdQP6bIw6AhM4giMYR3ACEhOegQ3qBh2hvplIOItG6NXKn/glbY6745e7DwD+FPMl+SXbwgRCkqxAybXI3d6pDwAB2wNCRJNYmCvyTsCTLIQZS+whzAmdXm2ObJ4eGMudUO8J5qa5RHudK/jFHCD1gKfFARAX0CeGJ7kSr2moB1gtTXXTC6jg/AkDp6RbGApz519xrRKUH4BtoUu1eX5AMAig6SvjpboAEvqEePsNCKzxmPUz0ZisQD/j3RRnDeHYFqzYMZoAjLuap1kMXWID1hyjJ+SZQp3ORCa/AAAAAElFTkSuQmCC",l&&l.tagName.toUpperCase()==="SCRIPT"&&l.src||new URL("rio-assist.js",document.baseURI).href).href,Ze=new URL("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAF+SURBVHgBxZNNTsMwEIVnnBAqVuEG6Q16A8INeoOSFXRFkEpFVqRCaquqi7CA0hXhBNATUE4ANyBHyA4aKg+OU0QgxgKExNvkx8+fx89jgD8S6gb98NK2rKcdALZFCLacwOkuYxBHQTv5FqhzMnGZCdfCYqvGOWA4DnZ7b99MZTocnTWYibcFhHoMqD4K9jBbrG8SkCcsifgXdvrnvrai7uDiUTwcYd4eBu355/GjwcThAPdEAC9ZrR6FXlqpqNufNnOIWCFWQXIN83w4nCKiba09+8qtEZJblEpXoFG2UYukH6ChBCFREe4CEh0oOvBS6V+dZjVsKgDcooYO5Iucyt8VEGcwlzxk+6CRCawlfQSxEjSWAeODCNvtDKbHKojsMXH84jUxVgtXjj+fvDJJiTBjvsQZY8uEc9NBgzcZYquo4r09UAcRmPSLzs4b0iu3B2ogvVHQDkXzuZyDK5wOEaYGoxtVf6EOAj+QDBuN5azYxu8gH5Rf1PIl/De9AhTgnL0rAocOAAAAAElFTkSuQmCC",l&&l.tagName.toUpperCase()==="SCRIPT"&&l.src||new URL("rio-assist.js",document.baseURI).href).href,We=new URL("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAADhSURBVHgB7ZbdCYNAEIRnJb6nBEu4ErSAEK0gLaSUdJAS8gt5vKQDO4gd6HtAc0YhEm4NOQUJ7AcnuHMrI7cMBwjCP6N2el4vDMCDI+qoY/h0NytXJx3CEWcDpjM2z+bviVZwxN3ASIgBMTC5gRkntAHTFzJvjVAHUsBtTJMo4zSyFV8h49EW/QZ+o6qidBFdP8v2I+iGzFgwYWU3UGKPsSmrg61M3P6vM+BjY9qXzYv5+ANr8BRmDgqbwA5h21BwujrrjkZ5moQZHJAcEANiwN1AN6zK6oYpUBcdDL0VC8ITASg13Rg8meYAAAAASUVORK5CYII=",l&&l.tagName.toUpperCase()==="SCRIPT"&&l.src||new URL("rio-assist.js",document.baseURI).href).href,fe=(n,e={})=>{const t=e.variant??"drawer",s=t==="sidebar",i=s||n.showConversations;return u`
|
|
915
933
|
<div
|
|
916
934
|
class=${g({"conversations-panel":!0,"conversations-panel--open":i,"conversations-panel--sidebar":s})}
|
|
917
935
|
aria-hidden=${!i}
|
|
918
|
-
@pointerdown=${
|
|
936
|
+
@pointerdown=${o=>n.handleConversationsPanelPointer(o)}
|
|
919
937
|
>
|
|
920
938
|
<div
|
|
921
939
|
class=${g({"conversations-panel__surface":!0,"conversations-panel__surface--sidebar":s})}
|
|
@@ -934,44 +952,44 @@
|
|
|
934
952
|
aria-disabled=${!n.hasActiveConversation}
|
|
935
953
|
@click=${()=>n.handleCreateConversation()}
|
|
936
954
|
>
|
|
937
|
-
<img src=${
|
|
955
|
+
<img src=${We} alt="" aria-hidden="true" />
|
|
938
956
|
<span>Iniciar nova conversa</span>
|
|
939
957
|
</button>
|
|
940
958
|
</div>
|
|
941
959
|
`:null,i=u`
|
|
942
960
|
<div
|
|
943
961
|
class=${g({"conversation-list":!0,"conversation-list--sidebar":t})}
|
|
944
|
-
@scroll=${t?
|
|
962
|
+
@scroll=${t?o=>n.handleConversationListScroll(o):null}
|
|
945
963
|
>
|
|
946
|
-
${n.filteredConversations.map(
|
|
964
|
+
${n.filteredConversations.map(o=>{const r=n.conversationMenuId===o.id;return u`
|
|
947
965
|
<div class="conversation-item">
|
|
948
966
|
<div class="conversation-item__text">
|
|
949
|
-
${
|
|
967
|
+
${o.title}
|
|
950
968
|
</div>
|
|
951
969
|
<button
|
|
952
970
|
class="conversation-menu-button"
|
|
953
971
|
type="button"
|
|
954
|
-
@click=${
|
|
972
|
+
@click=${c=>n.handleConversationMenuToggle(c,o.id)}
|
|
955
973
|
>
|
|
956
974
|
<img src=${Ge} alt="" aria-hidden="true" />
|
|
957
975
|
</button>
|
|
958
|
-
${
|
|
976
|
+
${r?u`
|
|
959
977
|
<div
|
|
960
978
|
class=${g({"conversation-menu":!0,"conversation-menu--above":n.conversationMenuPlacement==="above"})}
|
|
961
|
-
@click=${
|
|
979
|
+
@click=${c=>c.stopPropagation()}
|
|
962
980
|
>
|
|
963
981
|
<button
|
|
964
982
|
type="button"
|
|
965
|
-
@click=${()=>n.handleConversationAction("rename",
|
|
983
|
+
@click=${()=>n.handleConversationAction("rename",o.id)}
|
|
966
984
|
>
|
|
967
|
-
<img src=${
|
|
985
|
+
<img src=${qe} alt="" aria-hidden="true" />
|
|
968
986
|
Renomear
|
|
969
987
|
</button>
|
|
970
988
|
<button
|
|
971
989
|
type="button"
|
|
972
|
-
@click=${()=>n.handleConversationAction("delete",
|
|
990
|
+
@click=${()=>n.handleConversationAction("delete",o.id)}
|
|
973
991
|
>
|
|
974
|
-
<img src=${
|
|
992
|
+
<img src=${Ke} alt="" aria-hidden="true" />
|
|
975
993
|
Excluir
|
|
976
994
|
</button>
|
|
977
995
|
</div>
|
|
@@ -983,12 +1001,12 @@
|
|
|
983
1001
|
${s}
|
|
984
1002
|
|
|
985
1003
|
<div class="conversation-search">
|
|
986
|
-
<img class="search-icon" src=${
|
|
1004
|
+
<img class="search-icon" src=${Ze} alt="" aria-hidden="true" />
|
|
987
1005
|
<input
|
|
988
1006
|
type="text"
|
|
989
1007
|
placeholder="Buscar nas conversas"
|
|
990
1008
|
.value=${n.conversationSearch}
|
|
991
|
-
@input=${
|
|
1009
|
+
@input=${o=>n.handleConversationSearch(o)}
|
|
992
1010
|
/>
|
|
993
1011
|
</div>
|
|
994
1012
|
|
|
@@ -999,19 +1017,19 @@
|
|
|
999
1017
|
${t?u`
|
|
1000
1018
|
<div
|
|
1001
1019
|
class=${g({"conversation-scrollbar":!0,"conversation-scrollbar--visible":n.conversationScrollbar.visible})}
|
|
1002
|
-
@pointerdown=${
|
|
1003
|
-
@pointermove=${
|
|
1004
|
-
@pointerup=${
|
|
1005
|
-
@pointercancel=${
|
|
1020
|
+
@pointerdown=${o=>n.handleConversationScrollbarPointerDown(o)}
|
|
1021
|
+
@pointermove=${o=>n.handleConversationScrollbarPointerMove(o)}
|
|
1022
|
+
@pointerup=${o=>n.handleConversationScrollbarPointerUp(o)}
|
|
1023
|
+
@pointercancel=${o=>n.handleConversationScrollbarPointerUp(o)}
|
|
1006
1024
|
>
|
|
1007
1025
|
<span
|
|
1008
1026
|
class="conversation-scrollbar__thumb"
|
|
1009
|
-
style=${
|
|
1027
|
+
style=${ze({height:`${n.conversationScrollbar.height}%`,top:`${n.conversationScrollbar.top}%`})}
|
|
1010
1028
|
></span>
|
|
1011
1029
|
</div>
|
|
1012
1030
|
`:null}
|
|
1013
1031
|
</div>
|
|
1014
|
-
`},et=new URL("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAACLSURBVHgB7dSxDYAgEAXQf8ZF3MAN1F53cAVHcBKH0F5HYATcwN7ipEShOoMkhpdAwg/kCg6AJDZ6BuWyMeS0auvCDjIEFrxA7iQnF0gsvi6aIEaHaqvBTnLPrh5irM10KxChi5hHSBEO/I7bRfNa4wXVNZu9du+AaIWcNuPbz87zDniHFEN+NgnmAsF0G91pmpecAAAAAElFTkSuQmCC",
|
|
1032
|
+
`},et=new URL("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAACLSURBVHgB7dSxDYAgEAXQf8ZF3MAN1F53cAVHcBKH0F5HYATcwN7ipEShOoMkhpdAwg/kCg6AJDZ6BuWyMeS0auvCDjIEFrxA7iQnF0gsvi6aIEaHaqvBTnLPrh5irM10KxChi5hHSBEO/I7bRfNa4wXVNZu9du+AaIWcNuPbz87zDniHFEN+NgnmAsF0G91pmpecAAAAAElFTkSuQmCC",l&&l.tagName.toUpperCase()==="SCRIPT"&&l.src||new URL("rio-assist.js",document.baseURI).href).href,tt=new URL("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAEpSURBVHgB5ZbBDYIwFIZfjd4dwRHqCD0aY4ybuIE6gpPghXhEJ7AbyAgMYKyPApZAkUIfMdH/QHr4838p7722AL8uBp7iYcThCdOPpgdIuRFJuhwDhRgL8NsMHSuB30u6HIGn5FJIYDowcfF7A7tCSYB51BqgpZZUQB5ed6DU3sXrDewC8wY2wpQ6YE3nYKlpbyA/RzMM3tpgciX2TY3UGygXIq4F5rC3p4COjIfmpFEsQtixDBtUPIhax+FroU411N04YXf9+zzFTGgWpgtdhZnWT9ImqHq6yOwwvWKw+OVdWOYs8wQ4Ej1VvZ4KqNBno32oj3i3xUAELKA3TAYL7ODb+u6DTwBzBxLBXIEJuk5AJBdgrXuHBpJCTZfiUy5/XTXL+6j/B70AdWmQ/S7ON+YAAAAASUVORK5CYII=",l&&l.tagName.toUpperCase()==="SCRIPT"&&l.src||new URL("rio-assist.js",document.baseURI).href).href,st=new URL("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAavSURBVHgB7Z1PTxtHFMDf2Cb9o6ZBoSq0ShRQK1XKpRs1Uo/Yx4pAk0+QcOg5ILVn4F4Jeu4h9BOQEqMevdx6SIWRKlVUquRWUQRVqJyStqiAJ+/N7prFWYu1PbP71p6fZO1igzHz23kz82ZmEU7ZlWBhQw4srLBCmGGFMKPQ+kT1VlGAJTFa23BbQ5hhhTDDCmGGFcIMK4QZVggzrBBmWCHMsEKYYYUwwwphhhXCDCuEGVYIMwqQEZy1yrg6KYB3lDAMeXzEoQG15nkO6vA/PgDq1TulOjAjdSGqoPPgqMJtYGELcQ0Enks6949R0KxN3NUA4Rke+pkh/3eXXXqths8pQfjAc/k7PlfH56okrzpVqkKCpCLE2ajcAynu0ik+vKucCiooONlyNEmrcOF/CF+4kgbgQkN+ByfgYq2qgUESFeKsV25DXiy3ver5UoScKFKNcTY2V6pTk0tgiMQadae8uYx/1FoGZYTBECoXsdZsNds0zSQixNlwH2D9n4P+wYEhUTEhxbgQrOILWCvuQf8xjlLWQDNGhWDj7VAVh/7FcR5VFkEjhmuI/iuIHULcx9AVbzwUA2NC8MopZrwBj8sw9lW1tY/maojoy3YjGqHGVFowGLLExzA4jOvqcZkcGNIovO6nImqYFqmrlAT4R+/cI5xrOo9cKJcl1SjfOwr/eaEuBG0xPTZ59ffWoEeMCFGNnJSl6nTJhRRwfsCrtYGjaxALCbZjWi4CI0L8LKoLKVH9TOWbVumh8mbJiumJvp8PwWztanWqOIE19hvIACzmQ+I2iL1kWjF8zmFXHNsurC2MMSZEtSMX4DbGcgcL4RKAChnDao6D6CKE+Klwj/A8hjd/gedyG8/ddnMYKGURpQBnKdqFeCJy9zFEzPm9n7PomuMIC22+pwjmMGiiaTaqU6GklN1JoJQ6Q7S2Iap3c0Fs+fmr5Luep9DMY0UlNqPIy1lgijYhXldTVFj1ZmjuIkKK6oUxbeT11ZAG05lAkkJ5tVZyqlvMDi1CvDlybMC5EtGI+w1/ogsY4qCnhnCW4VGMrCVSbgIzNIUs8TlwR6hc01ly/GpIz91e1ZifQMfcvDwM773xGhwcH4O7tx/5PcXREbhY8D7iT389h6f/HUL3RGSfKanJbFd+7+OQY7WgrWOmr47CzJUxePrvYVshX13/EN5/83V1vv5kFxa2d6BrpJyADMA2l/XJ5UtKBtUgojT6DgwCbIVQ7SHW/9hVUi4OFeDmSJpjzWRgKyQofPfPfajsPlPnxXdHoN9hKSQIV8TO8xew8/cLdT5zdQz6HZZCgnD1eL+uwtWjJ3vq60EIWyyFBIVOPSvi4OhYySH6PWyxExIOVzT2CAiE9HvYYreDqjR22r399tPTsRyFq+BINSgQ1G/wExIabwQ1pRUKW+yEiN6XABGshHz09ltNCfOPf4ZfD/458/qX1z9Qwihsff3Lb8CKYz15MVZtyPSVUXWkRpzSKZRWCT/cXS/Fwq63hVljXRtIWQkJwlW7cFTZe9Y8Z9Xbkvomu9gICYercMGHCXd/w41/ytSqM6VV0ETvbUgBG7Mu0u+UuQ1nb2k0fmPj/PmiL37chq4IryXWSUNq3QDaew05hGz0P2VEL0j2uDJGyiWdtYPoWUja63hjIyM+Y9QsYuz3QxnTpUXQjKY2RH4PvKE4//CVZ4WYhK6Q8yZkEHqEHGEvQ9PAyAgRcV5NPXe6epEWRRzJieqt0goYQsvAkMKWs1G5g5fcFnBDwMPION84VwatFaZkGg34XLrokrhZjbaROq1zQimzIMUypLuM9BR1RcMry0b9VZYLbX5mCUfdK2ndKUjrOIT2YkBe3mAQvup+o1uMLNgTWgzeZpUl9sbSvG2T9lyWv3tpQi1Mo524krYjUI0R18AcscOLU67Mcb7Nh7Hkor8VwA2+xoKodSSFFkOHF7KdhDaKnt6ErKNNPN6dJQZ0w05PGOjjO+XNu/i+1DtiPQfMT4hmGWoD0VBuISt3I+I1hWti9DtEd5TIzq2h+AgxlIpQgzipNwFoEh5CDMkIUO+dESnpCzEsIyArUtIVkpCMAO93yXlgTHJCWqc5E5YRoNoUMQC7cM9DFT4VBN3/tqH2kC9CSqgUD1MpiY5DVEEAj92v9Flw5I41VTw480LKebiBvhl/s6Z4Eur+xJMLKZKZm/GbglOtJey/q2CGFcIMK4QZVggzrBBmWCHMsEKYYYUwwwphhhXCDCuEGVYIM6wQZlghzLBCmCGcspvEPzi1xMTWEGZYIcywQpjxEna5gwxqk9eHAAAAAElFTkSuQmCC",l&&l.tagName.toUpperCase()==="SCRIPT"&&l.src||new URL("rio-assist.js",document.baseURI).href).href,it=new URL("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAADhSURBVHgB7ZbdCYNAEIRnJb6nBEu4ErSAEK0gLaSUdJAS8gt5vKQDO4gd6HtAc0YhEm4NOQUJ7AcnuHMrI7cMBwjCP6N2el4vDMCDI+qoY/h0NytXJx3CEWcDpjM2z+bviVZwxN3ASIgBMTC5gRkntAHTFzJvjVAHUsBtTJMo4zSyFV8h49EW/QZ+o6qidBFdP8v2I+iGzFgwYWU3UGKPsSmrg61M3P6vM+BjY9qXzYv5+ANr8BRmDgqbwA5h21BwujrrjkZ5moQZHJAcEANiwN1AN6zK6oYpUBcdDL0VC8ITASg13Rg8meYAAAAASUVORK5CYII=",l&&l.tagName.toUpperCase()==="SCRIPT"&&l.src||new URL("rio-assist.js",document.baseURI).href).href,nt=new URL("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAADgSURBVHgBrVNBDoIwEFya6Hv0EeqZmJgQDoaXUB6DRC4NBy+i8Qn4IalbSLUtW9DoXChlZpjtbgH+ibw8LaY4pThbHKYXh+qyZ7N5U4g69YmL6po+IGiOyNV7gXZVHwwuj8JV5oqhbbl+b0Eu43B97xLscIEPU8DNJK4Y11nca/oEL6KoFcksgQNj4Iqj7YZbJUyYgE9MGnhNCLECowwwtvxoj0owODAbg+6wUTHGhpHuWAkosa6Z6o5O0hnkOEjMHCTiwFwTa5D6oZCJT6yAf+TvcmSiB8lCKW5fX6af8QRrqoetlQGSZAAAAABJRU5ErkJggg==",l&&l.tagName.toUpperCase()==="SCRIPT"&&l.src||new URL("rio-assist.js",document.baseURI).href).href,be=n=>{const e=n.messages.length>0,t=u`
|
|
1015
1033
|
<div class="hero-card">
|
|
1016
1034
|
<img src=${st} alt="IA assistente" class="hero-card__icon" />
|
|
1017
1035
|
<h3>Como posso te ajudar hoje?</h3>
|
|
@@ -1080,7 +1098,7 @@
|
|
|
1080
1098
|
</p>
|
|
1081
1099
|
</div>
|
|
1082
1100
|
</div>
|
|
1083
|
-
`},
|
|
1101
|
+
`},ot=n=>{const e=be(n);return u`
|
|
1084
1102
|
<aside class=${g({panel:!0,open:n.open})} role="dialog">
|
|
1085
1103
|
<header class="panel-header">
|
|
1086
1104
|
<div class="panel-header__top">
|
|
@@ -1090,7 +1108,7 @@
|
|
|
1090
1108
|
@click=${()=>n.handleCloseAction()}
|
|
1091
1109
|
aria-label="Fechar Rio Insight"
|
|
1092
1110
|
>
|
|
1093
|
-
|
|
1111
|
+
<img src=${nt} alt="" aria-hidden="true" />
|
|
1094
1112
|
</button>
|
|
1095
1113
|
</div>
|
|
1096
1114
|
<div class="panel-header__actions">
|
|
@@ -1129,7 +1147,7 @@
|
|
|
1129
1147
|
|
|
1130
1148
|
${fe(n,{variant:"drawer"})}
|
|
1131
1149
|
</aside>
|
|
1132
|
-
`},rt=new URL("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAClSURBVHgB7ZXtCYAgEIbPaIBGsA1arU3aoJFqgxqhDa6LFPogO/UEoR44ENHn/eGpADmBiHorSIGRT6Y0SELCyogt27gCCYx8wDtDdIhDHh/CkIeHeMj9QwLk/JAI+XuIgNwdQpMdytFbb3HIkLk4FwpITDYBLVV9qZazsQQei1JqPk7QQS6cjd85gz8gHcoOqO0aeH4uRmrTU1vi/vHrh/WzbesVLQQBC6E6gyQAAAAASUVORK5CYII=",
|
|
1150
|
+
`},rt=new URL("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAClSURBVHgB7ZXtCYAgEIbPaIBGsA1arU3aoJFqgxqhDa6LFPogO/UEoR44ENHn/eGpADmBiHorSIGRT6Y0SELCyogt27gCCYx8wDtDdIhDHh/CkIeHeMj9QwLk/JAI+XuIgNwdQpMdytFbb3HIkLk4FwpITDYBLVV9qZazsQQei1JqPk7QQS6cjd85gz8gHcoOqO0aeH4uRmrTU1vi/vHrh/WzbesVLQQBC6E6gyQAAAAASUVORK5CYII=",l&&l.tagName.toUpperCase()==="SCRIPT"&&l.src||new URL("rio-assist.js",document.baseURI).href).href,at=new URL("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAIQSURBVHgB5ZZLTuQwEIbLjqWRRizCDcIJpvsGnQ1MNBvYoe5G5AYzV+EGRoGIXe8mYjb0nGAyJyA3ICsQUtqmKiTpPPrhZAm1ieOU63NV/bYC8NGMmTqeLk7tgy8HE8aYTe8adJJBltx5d4nJ+r2gaTT1OeOXOJxscYmVVlehF0oYAjqPzh2LWQsGbAQGRhmu9MrdluFG0PTPdMQ1f8DVNvSzVK2UG/4I470gykRw8W8ApIJlOhu3M+NtLyzXkEwARZIWQ1swsWh/b4Co8dgTB/oCNLjBSXCIz+tiekSxtoI45z+hJwQr4N54N0t610xXvSmUuvYtB3lvmHiEnhB5LONyPZW9XhHxIg7lmUwbGQkQjiGjAyGVtiFk2ddsso5fLkYnPAswBJIfBegKSClVzfGdUbHJiqsxbiLZCTFQaQXSXKfNrUNMTQ6Pw9jSlosz//tCOPBkHa4w/8G3s9fsqe6IKvJvT26v2wFMMxFaHElPJu/QwqSbq2NZd2Saydn97HIIhCpSQhqgInBn9zns9+wXjefRfGLaE6bYVZPbsvn9nO650YYdpqZXE4kn+B4c1ec6qhNKnOVB22YKIWW+iwd2gqiuiil3I8wEQsqs9WYriIwkjZlV58fQYktZ41L+nU3sW30RXfgocxLDt40OGv7ihmTgBXJXHOOfEz/yHfwZccr7jA64eBbL8tL8fPYGlj3l1qpxcVgAAAAASUVORK5CYII=",l&&l.tagName.toUpperCase()==="SCRIPT"&&l.src||new URL("rio-assist.js",document.baseURI).href).href,lt=new URL("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAIVSURBVHgB5VVBctNAEOxZiQpwEi+IfoD9A+uAKI4yVamycyC8gPwAeAGVF+AcEldR5VpuQHKweQHmBYgf+AhUvMMsthVZWkm2wynpizS7O9M7O7O9wG0DbbrwvdbB3vxhh4kCaxszT30faS95lm7i30h0Nro4UopeyG/HNc/AlA2fHD6PB9iFaKg/hQxPE6iFjcApMI+qMnQSfdAXLQMay24DbAFZP2NwdJjE00YimwnB/1ZJwvzdBiRS+2KELjLCVbuYmSpH8moz6XXjVr8bd6QZTl3zsvOA4evi+BqRLbwsDXFDCFlrEesaft7wFL3ihiDn+lIahKUWqG2SZacOcuQL2NoI7486Z2b8zBwJ+2jAL/iPXibRzP5nGV3BD/06Eilyv/skXNlnoy9vlFKva1ywhz8d+Xy0/1mNlCl3UB72uLAl2FDWVGpjJ1BwPvp8jB2RERGr2h3btiXlvcM2wUUPS0QPPG+C/w3/floiShbdManzYzbZJb2nSIpMaeVaEdteEpWJltOnqKZJ+92nRyvrQPTMGPO2arU0z0neXiPqJfFAajHFjUGpjZUfKV0d0alERNEhqhQO9eV4bUTUoagk8qyIangRSuMO7PpMWBIlJAdJVDoV5z2y5y+ZteuKXcS/lxZe20Wy2EQDhlpUmHEs4vbYScD8VXRvUKzJ1kTXhONQFDHEUqpYqdlveJOVaN49/AWuVb4JKaLcJgAAAABJRU5ErkJggg==",l&&l.tagName.toUpperCase()==="SCRIPT"&&l.src||new URL("rio-assist.js",document.baseURI).href).href,ct=new URL("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAGYSURBVHgBzZZPTsJAFMbfG8A/0USO0BvQI9AFJu5sjEbiptwATgCcQG5QN1ATNeOOBEioN8Ab9Ai4MHFR5jmjxiilzNSi8dt00vfN+01m5r0W4I+EWcw+5+VivGOrcVx8mTVcd2461wikALuw3yaA5lKoU3drXZMczMS0DXvTFZA30DUfX4KBtKD+3chDQDstrhYQ3AyrkBfEkI51HmLpCzEGAbIDnYWQWTqPFkREj9okCDOtR2dAxHuNIwIohZAXJK9vKB+pV5hg0aq7TgQaGRdswEceEXgMWUUQPSGIWQG3Omeuo922/yXVFQI+tNbFwUBrt27Ax015iKr1qGShEOLh/fDVTGEzLFTkqCpPKhICuhcnh1eZQQGf+DKBBxkkk/XO3VorJbYZiA6WAKnexhj6kEdx7NRPj8KvrxJ1xBi0Ia+KxUSOb6DB7UQ2ULQgv6p9PrJTQYQLbRc2loB0kOxrFmxMZKWCflPLIOOfDW1i9lHYq0CIpd5n5edS8tORqCOfT8s7EP/4UhSA5s9Qihqus7HdyaRXhOV61M1m9WYAAAAASUVORK5CYII=",l&&l.tagName.toUpperCase()==="SCRIPT"&&l.src||new URL("rio-assist.js",document.baseURI).href).href,ht=n=>{const e=be(n);return u`
|
|
1133
1151
|
<section class="fullscreen-shell" role="dialog" aria-modal="true">
|
|
1134
1152
|
<div class="fullscreen-shell__rail">
|
|
1135
1153
|
<button type="button" class="rail-button" aria-label="Ir para home">
|
|
@@ -1185,13 +1203,13 @@
|
|
|
1185
1203
|
|
|
1186
1204
|
<div class="fullscreen-header__actions">
|
|
1187
1205
|
<button type="button" class="fullscreen-header__icon" aria-label="Status">
|
|
1188
|
-
<img src=${
|
|
1206
|
+
<img src=${at} alt="" aria-hidden="true" />
|
|
1189
1207
|
</button>
|
|
1190
1208
|
<button type="button" class="fullscreen-header__icon" aria-label="Informacoes">
|
|
1191
|
-
<img src=${
|
|
1209
|
+
<img src=${lt} alt="" aria-hidden="true" />
|
|
1192
1210
|
</button>
|
|
1193
1211
|
<button type="button" class="fullscreen-header__icon" aria-label="Perfil de usuario">
|
|
1194
|
-
<img src=${
|
|
1212
|
+
<img src=${ct} alt="" aria-hidden="true" />
|
|
1195
1213
|
</button>
|
|
1196
1214
|
</div>
|
|
1197
1215
|
</header>
|
|
@@ -1204,10 +1222,10 @@
|
|
|
1204
1222
|
</div>
|
|
1205
1223
|
</div>
|
|
1206
1224
|
</section>
|
|
1207
|
-
`},
|
|
1225
|
+
`},dt=n=>{const e=g({canvas:!0,"canvas--fullscreen":n.isFullscreen});return u`
|
|
1208
1226
|
<div class=${e}>
|
|
1209
1227
|
${Fe(n)}
|
|
1210
|
-
${
|
|
1211
|
-
${n.isFullscreen?
|
|
1228
|
+
${ot(n)}
|
|
1229
|
+
${n.isFullscreen?ht(n):null}
|
|
1212
1230
|
</div>
|
|
1213
|
-
`},dt="wss://ws.volkswagen.latam-sandbox.rio.cloud",pt="eu.amazon.nova-pro-v1:0";class ut{constructor(e){this.socket=null,this.connectPromise=null,this.listeners=new Set,this.token=e}matchesToken(e){return this.token===e}async sendMessage(e){const t=await this.ensureConnection(),s={action:"sendMessage",message:e,agentModel:pt};t.send(JSON.stringify(s))}onMessage(e){return this.listeners.add(e),()=>this.listeners.delete(e)}close(){this.socket&&this.socket.readyState===WebSocket.OPEN&&this.socket.close(),this.connectPromise=null,this.socket=null,this.listeners.clear()}async ensureConnection(){if(this.socket&&(this.socket.readyState===WebSocket.OPEN||this.socket.readyState===WebSocket.CONNECTING))return await this.connectPromise,this.socket;if(this.socket=new WebSocket(`${dt}?token=${encodeURIComponent(this.token)}`),this.socket.addEventListener("message",e=>this.handleMessage(e)),this.socket.addEventListener("close",()=>{this.connectPromise=null,this.socket=null}),this.connectPromise=new Promise((e,t)=>{if(!this.socket){t(new Error("Falha ao criar conexão WebSocket."));return}const s=()=>{r(),e()},i=()=>{var o;r(),(o=this.socket)==null||o.close(),this.socket=null,this.connectPromise=null,t(new Error("Não foi possível abrir conexão com o websocket do Rio Insight."))},r=()=>{var o,l;(o=this.socket)==null||o.removeEventListener("open",s),(l=this.socket)==null||l.removeEventListener("error",i)};this.socket.addEventListener("open",s,{once:!0}),this.socket.addEventListener("error",i,{once:!0})}),await this.connectPromise,!this.socket||this.socket.readyState!==WebSocket.OPEN)throw new Error("Conexão WebSocket do Rio Insight não está pronta.");return this.socket}async handleMessage(e){const t=await this.readMessage(e.data);let s=null,i=t;try{if(s=JSON.parse(t),typeof s=="object"&&s!==null){const r=s.message??s.response??s.text??s.content;typeof r=="string"&&(i=r)}}catch{s=null}this.listeners.forEach(r=>r({text:i,raw:t,data:s}))}async readMessage(e){return typeof e=="string"?e:e instanceof Blob?e.text():e instanceof ArrayBuffer?new TextDecoder().decode(new Uint8Array(e)):ArrayBuffer.isView(e)?new TextDecoder().decode(new Uint8Array(e.buffer,e.byteOffset,e.byteLength)):String(e??"")}}const Y=class Y extends T{constructor(){super(...arguments),this.open=!1,this.message="",this.titleText="Rio Insight",this.buttonLabel="Rio Insight",this.placeholder="Pergunte alguma coisa",this.accentColor="#008B9A",this.apiBaseUrl="",this.rioToken="",this.suggestionsSource="",this.messages=[],this.isLoading=!1,this.errorMessage="",this.showConversations=!1,this.conversationSearch="",this.conversationMenuId=null,this.conversationMenuPlacement="below",this.isFullscreen=!1,this.showNewConversationShortcut=!1,this.conversationScrollbar={height:0,top:0,visible:!1},this.conversationScrollbarRaf=null,this.rioClient=null,this.rioUnsubscribe=null,this.loadingTimer=null,this.conversationScrollbarDraggingId=null,this.conversationScrollbarDragState=null,this.conversations=Array.from({length:20}).map((e,t)=>({id:`${t+1}`,title:["Caminhões com problema na frota de veículos.","Próximas manutenções periódicas preventivas.","Quais revisões meu plano inclui?","Como automatizar preenchimento de odômetro.","Valor das peças da próxima revisão.","O que é revisão de assentamento?","Alertas críticos ativos.","Veículo superaquecendo, causas e recomendações.","Calibragem recomendada nos pneus do e-Delivery.","Quantos mil km trocar o óleo do motor.","Qual a vida útil da bateria Moura M100HE."][t%11],updatedAt:new Date(Date.now()-t*36e5).toISOString()}))}get suggestions(){return this.suggestionsSource?this.suggestionsSource.split("|").map(e=>e.trim()).filter(Boolean):[]}updated(e){super.updated(e),this.style.setProperty("--accent-color",this.accentColor),(e.has("isFullscreen")||e.has("showConversations")||e.has("conversations"))&&this.enqueueConversationScrollbarMeasure()}firstUpdated(){this.enqueueConversationScrollbarMeasure()}disconnectedCallback(){super.disconnectedCallback(),this.conversationScrollbarRaf!==null&&(cancelAnimationFrame(this.conversationScrollbarRaf),this.conversationScrollbarRaf=null),this.teardownRioClient(),this.clearLoadingGuard()}get filteredConversations(){const e=this.conversationSearch.trim().toLowerCase();return e?this.conversations.filter(t=>t.title.toLowerCase().includes(e)):this.conversations}get hasActiveConversation(){return this.messages.length>0}togglePanel(){if(this.isFullscreen){this.exitFullscreen(!1);return}this.open=!this.open,this.dispatchEvent(new CustomEvent(this.open?"rioassist:open":"rioassist:close",{bubbles:!0,composed:!0}))}closePanel(){this.isFullscreen=!1,this.open&&this.togglePanel()}openConversationsPanel(){this.showConversations=!0}closeConversationsPanel(){this.showConversations=!1,this.conversationMenuId=null}toggleConversationsPanel(){this.showConversations=!this.showConversations,this.showConversations||(this.conversationMenuId=null)}toggleNewConversationShortcut(){this.showNewConversationShortcut=!this.showNewConversationShortcut}handleConversationSearch(e){this.conversationSearch=e.target.value}handleConversationMenuToggle(e,t){if(e.stopPropagation(),this.conversationMenuId===t){this.conversationMenuId=null;return}const s=e.currentTarget,i=this.renderRoot.querySelector(".conversations-panel__surface");if(s&&i){const r=s.getBoundingClientRect(),l=i.getBoundingClientRect().bottom-r.bottom;this.conversationMenuPlacement=l<140?"above":"below"}else this.conversationMenuPlacement="below";this.conversationMenuId=t}handleConversationsPanelPointer(e){const t=e.target;!t.closest(".conversation-menu")&&!t.closest(".conversation-menu-button")&&(this.conversationMenuId=null)}handleConversationAction(e,t){this.conversationMenuId=null;const s=this.conversations.find(r=>r.id===t);if(!s)return;const i=`${e==="rename"?"Renomear":"Excluir"} "${s.title}"`;console.info(`[Mock] ${i}`)}handleCloseAction(){if(this.isFullscreen){this.exitFullscreen(!0);return}this.showConversations?this.closeConversationsPanel():this.closePanel()}enterFullscreen(){this.isFullscreen||(this.isFullscreen=!0,this.open=!1,this.showConversations=!1)}exitFullscreen(e){this.isFullscreen&&(this.isFullscreen=!1,this.conversationMenuId=null,this.showNewConversationShortcut=!1,e&&(this.open=!0))}handleCreateConversation(){this.hasActiveConversation&&(this.clearLoadingGuard(),this.isLoading=!1,this.messages=[],this.message="",this.errorMessage="",this.showConversations=!1,this.teardownRioClient(),this.showNewConversationShortcut=!1,this.dispatchEvent(new CustomEvent("rioassist:new-conversation",{bubbles:!0,composed:!0})))}handleConversationListScroll(e){const t=e.currentTarget;t&&this.updateConversationScrollbar(t)}handleConversationScrollbarPointerDown(e){const t=e.currentTarget,s=this.renderRoot.querySelector(".conversation-list--sidebar");if(!t||!s)return;const i=t.getBoundingClientRect(),r=i.height*(this.conversationScrollbar.height/100),o=Math.max(i.height-r,0),l=Math.max(s.scrollHeight-s.clientHeight,1),a=s.scrollTop/l*o,h=e.clientY-i.top,p=h>=a&&h<=a+r,d=p?a:Math.min(Math.max(h-r/2,0),o);p||(s.scrollTop=d/Math.max(o,1)*(s.scrollHeight-s.clientHeight),this.updateConversationScrollbar(s)),t.setPointerCapture(e.pointerId),this.conversationScrollbarDraggingId=e.pointerId,this.conversationScrollbarDragState={startY:e.clientY,startThumbTop:d,trackHeight:i.height,thumbHeight:r,list:s},e.preventDefault()}handleConversationScrollbarPointerMove(e){if(this.conversationScrollbarDraggingId===null||this.conversationScrollbarDraggingId!==e.pointerId||!this.conversationScrollbarDragState)return;const{startY:t,startThumbTop:s,trackHeight:i,thumbHeight:r,list:o}=this.conversationScrollbarDragState,l=Math.max(i-r,0),a=e.clientY-t,h=Math.min(Math.max(s+a,0),l),p=o.scrollHeight-o.clientHeight;p>0&&(o.scrollTop=h/Math.max(l,1)*p,this.updateConversationScrollbar(o)),e.preventDefault()}handleConversationScrollbarPointerUp(e){if(this.conversationScrollbarDraggingId!==e.pointerId)return;const t=e.currentTarget;t==null||t.releasePointerCapture(e.pointerId),this.conversationScrollbarDraggingId=null,this.conversationScrollbarDragState=null}enqueueConversationScrollbarMeasure(){this.conversationScrollbarRaf===null&&(this.conversationScrollbarRaf=requestAnimationFrame(()=>{this.conversationScrollbarRaf=null,this.updateConversationScrollbar()}))}updateConversationScrollbar(e){const t=e??this.renderRoot.querySelector(".conversation-list--sidebar");if(!t){this.conversationScrollbar.visible&&(this.conversationScrollbar={height:0,top:0,visible:!1});return}const{scrollHeight:s,clientHeight:i,scrollTop:r}=t;if(s<=i+1){this.conversationScrollbar.visible&&(this.conversationScrollbar={height:0,top:0,visible:!1});return}const o=i/s,l=Math.max(o*100,8),a=100-l,h=r/(s-i)*(a>0?a:0);this.conversationScrollbar={height:l,top:h,visible:!0}}async onSuggestionClick(e){await this.processMessage(e)}async handleSubmit(e){e.preventDefault(),await this.processMessage(this.message)}createMessage(e,t){return{id:typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`${Date.now()}-${Math.random()}`,role:e,text:t,timestamp:Date.now()}}async processMessage(e){const t=e.trim();if(!t||this.isLoading)return;this.dispatchEvent(new CustomEvent("rioassist:send",{detail:{message:t,apiBaseUrl:this.apiBaseUrl,token:this.rioToken},bubbles:!0,composed:!0}));const s=this.createMessage("user",t);this.messages=[...this.messages,s],this.message="",this.errorMessage="",this.isLoading=!0,this.startLoadingGuard();try{await this.ensureRioClient().sendMessage(t)}catch(i){this.clearLoadingGuard(),this.isLoading=!1,this.errorMessage=i instanceof Error?i.message:"Nao foi possivel enviar a mensagem para o agente."}}ensureRioClient(){const e=this.rioToken.trim();if(!e)throw new Error("Informe o token RIO em data-rio-token para conectar no websocket do assistente.");return(!this.rioClient||!this.rioClient.matchesToken(e))&&(this.teardownRioClient(),this.rioClient=new ut(e),this.rioUnsubscribe=this.rioClient.onMessage(t=>{this.handleIncomingMessage(t)})),this.rioClient}handleIncomingMessage(e){const t=this.createMessage("assistant",e.text);this.messages=[...this.messages,t],this.clearLoadingGuard(),this.isLoading=!1}teardownRioClient(){this.rioUnsubscribe&&(this.rioUnsubscribe(),this.rioUnsubscribe=null),this.rioClient&&(this.rioClient.close(),this.rioClient=null)}startLoadingGuard(){this.clearLoadingGuard(),this.loadingTimer=window.setTimeout(()=>{this.loadingTimer=null,this.isLoading=!1},15e3)}clearLoadingGuard(){this.loadingTimer!==null&&(window.clearTimeout(this.loadingTimer),this.loadingTimer=null)}render(){return ht(this)}};Y.styles=He,Y.properties={open:{type:Boolean,state:!0},message:{type:String,state:!0},titleText:{type:String,attribute:"data-title"},buttonLabel:{type:String,attribute:"data-button-label"},placeholder:{type:String,attribute:"data-placeholder"},accentColor:{type:String,attribute:"data-accent-color"},apiBaseUrl:{type:String,attribute:"data-api-base-url"},rioToken:{type:String,attribute:"data-rio-token"},suggestionsSource:{type:String,attribute:"data-suggestions"},messages:{state:!0},isLoading:{type:Boolean,state:!0},errorMessage:{type:String,state:!0},showConversations:{type:Boolean,state:!0},conversationSearch:{type:String,state:!0},conversationMenuId:{state:!0},conversationMenuPlacement:{state:!0},isFullscreen:{type:Boolean,state:!0},conversationScrollbar:{state:!0},showNewConversationShortcut:{type:Boolean,state:!0}};let K=Y;customElements.get("rio-assist-widget")||customElements.define("rio-assist-widget",K);const At={title:"Rio Insight",buttonLabel:"Rio Insight",placeholder:"Pergunte alguma coisa",suggestions:["Veículos com problemas","Valor das peças","Planos de manutenção"],accentColor:"#008B9A",apiBaseUrl:"",rioToken:""},me="rio-assist-widget";function gt(n={}){const{target:e=document.body,...t}=n;let s=document.querySelector(me);s||(s=document.createElement(me),e.appendChild(s));const i={...At,...t};Object.entries(i).forEach(([r,o])=>{o!==void 0&&(s==null||s.setAttribute(`data-${r.replace(/[A-Z]/g,l=>`-${l.toLowerCase()}`)}`,Array.isArray(o)?o.join("|"):String(o)))})}typeof window<"u"&&(window.RioAssist=window.RioAssist??{init:gt},window.dispatchEvent(new Event("rio-assist-ready")))})();
|
|
1231
|
+
`},pt="wss://ws.volkswagen.latam-sandbox.rio.cloud",ut="eu.amazon.nova-pro-v1:0";class At{constructor(e){this.socket=null,this.connectPromise=null,this.listeners=new Set,this.token=e}matchesToken(e){return this.token===e}async sendMessage(e){const t=await this.ensureConnection(),s={action:"sendMessage",message:e,agentModel:ut};t.send(JSON.stringify(s))}onMessage(e){return this.listeners.add(e),()=>this.listeners.delete(e)}close(){this.socket&&this.socket.readyState===WebSocket.OPEN&&this.socket.close(),this.connectPromise=null,this.socket=null,this.listeners.clear()}async ensureConnection(){if(this.socket&&(this.socket.readyState===WebSocket.OPEN||this.socket.readyState===WebSocket.CONNECTING))return await this.connectPromise,this.socket;if(this.socket=new WebSocket(`${pt}?token=${encodeURIComponent(this.token)}`),this.socket.addEventListener("message",e=>this.handleMessage(e)),this.socket.addEventListener("close",()=>{this.connectPromise=null,this.socket=null}),this.connectPromise=new Promise((e,t)=>{if(!this.socket){t(new Error("Falha ao criar conexão WebSocket."));return}const s=()=>{o(),e()},i=()=>{var r;o(),(r=this.socket)==null||r.close(),this.socket=null,this.connectPromise=null,t(new Error("Não foi possível abrir conexão com o websocket do Rio Insight."))},o=()=>{var r,c;(r=this.socket)==null||r.removeEventListener("open",s),(c=this.socket)==null||c.removeEventListener("error",i)};this.socket.addEventListener("open",s,{once:!0}),this.socket.addEventListener("error",i,{once:!0})}),await this.connectPromise,!this.socket||this.socket.readyState!==WebSocket.OPEN)throw new Error("Conexão WebSocket do Rio Insight não está pronta.");return this.socket}async handleMessage(e){const t=await this.readMessage(e.data);let s=null,i=t;try{if(s=JSON.parse(t),typeof s=="object"&&s!==null){const o=s.message??s.response??s.text??s.content;typeof o=="string"&&(i=o)}}catch{s=null}this.listeners.forEach(o=>o({text:i,raw:t,data:s}))}async readMessage(e){return typeof e=="string"?e:e instanceof Blob?e.text():e instanceof ArrayBuffer?new TextDecoder().decode(new Uint8Array(e)):ArrayBuffer.isView(e)?new TextDecoder().decode(new Uint8Array(e.buffer,e.byteOffset,e.byteLength)):String(e??"")}}const Y=class Y extends P{constructor(){super(...arguments),this.open=!1,this.message="",this.titleText="Rio Insight",this.buttonLabel="Rio Insight",this.placeholder="Pergunte alguma coisa",this.accentColor="#008B9A",this.apiBaseUrl="",this.rioToken="",this.suggestionsSource="",this.messages=[],this.isLoading=!1,this.errorMessage="",this.showConversations=!1,this.conversationSearch="",this.conversationMenuId=null,this.conversationMenuPlacement="below",this.isFullscreen=!1,this.showNewConversationShortcut=!1,this.conversationScrollbar={height:0,top:0,visible:!1},this.conversationScrollbarRaf=null,this.rioClient=null,this.rioUnsubscribe=null,this.loadingTimer=null,this.conversationScrollbarDraggingId=null,this.conversationScrollbarDragState=null,this.conversations=Array.from({length:20}).map((e,t)=>({id:`${t+1}`,title:["Caminhões com problema na frota de veículos.","Próximas manutenções periódicas preventivas.","Quais revisões meu plano inclui?","Como automatizar preenchimento de odômetro.","Valor das peças da próxima revisão.","O que é revisão de assentamento?","Alertas críticos ativos.","Veículo superaquecendo, causas e recomendações.","Calibragem recomendada nos pneus do e-Delivery.","Quantos mil km trocar o óleo do motor.","Qual a vida útil da bateria Moura M100HE."][t%11],updatedAt:new Date(Date.now()-t*36e5).toISOString()}))}get suggestions(){return this.suggestionsSource?this.suggestionsSource.split("|").map(e=>e.trim()).filter(Boolean):[]}updated(e){super.updated(e),this.style.setProperty("--accent-color",this.accentColor),(e.has("isFullscreen")||e.has("showConversations")||e.has("conversations"))&&this.enqueueConversationScrollbarMeasure(),(e.has("messages")||e.has("isLoading")&&this.isLoading||e.has("open")&&this.open||e.has("isFullscreen")&&this.isFullscreen)&&this.scrollConversationToBottom()}firstUpdated(){this.enqueueConversationScrollbarMeasure()}disconnectedCallback(){super.disconnectedCallback(),this.conversationScrollbarRaf!==null&&(cancelAnimationFrame(this.conversationScrollbarRaf),this.conversationScrollbarRaf=null),this.teardownRioClient(),this.clearLoadingGuard()}get filteredConversations(){const e=this.conversationSearch.trim().toLowerCase();return e?this.conversations.filter(t=>t.title.toLowerCase().includes(e)):this.conversations}get hasActiveConversation(){return this.messages.length>0}togglePanel(){if(this.isFullscreen){this.exitFullscreen(!1);return}this.open=!this.open,this.dispatchEvent(new CustomEvent(this.open?"rioassist:open":"rioassist:close",{bubbles:!0,composed:!0}))}closePanel(){this.isFullscreen=!1,this.open&&this.togglePanel()}openConversationsPanel(){this.showConversations=!0}closeConversationsPanel(){this.showConversations=!1,this.conversationMenuId=null}toggleConversationsPanel(){this.showConversations=!this.showConversations,this.showConversations||(this.conversationMenuId=null)}toggleNewConversationShortcut(){this.showNewConversationShortcut=!this.showNewConversationShortcut}handleConversationSearch(e){this.conversationSearch=e.target.value}handleConversationMenuToggle(e,t){if(e.stopPropagation(),this.conversationMenuId===t){this.conversationMenuId=null;return}const s=e.currentTarget,i=this.renderRoot.querySelector(".conversations-panel__surface");if(s&&i){const o=s.getBoundingClientRect(),c=i.getBoundingClientRect().bottom-o.bottom;this.conversationMenuPlacement=c<140?"above":"below"}else this.conversationMenuPlacement="below";this.conversationMenuId=t}handleConversationsPanelPointer(e){const t=e.target;!t.closest(".conversation-menu")&&!t.closest(".conversation-menu-button")&&(this.conversationMenuId=null)}handleConversationAction(e,t){this.conversationMenuId=null;const s=this.conversations.find(o=>o.id===t);if(!s)return;const i=`${e==="rename"?"Renomear":"Excluir"} "${s.title}"`;console.info(`[Mock] ${i}`)}handleCloseAction(){if(this.isFullscreen){this.exitFullscreen(!0);return}this.showConversations?this.closeConversationsPanel():this.closePanel()}enterFullscreen(){this.isFullscreen||(this.isFullscreen=!0,this.open=!1,this.showConversations=!1)}exitFullscreen(e){this.isFullscreen&&(this.isFullscreen=!1,this.conversationMenuId=null,this.showNewConversationShortcut=!1,e&&(this.open=!0))}handleCreateConversation(){this.hasActiveConversation&&(this.clearLoadingGuard(),this.isLoading=!1,this.messages=[],this.message="",this.errorMessage="",this.showConversations=!1,this.teardownRioClient(),this.showNewConversationShortcut=!1,this.dispatchEvent(new CustomEvent("rioassist:new-conversation",{bubbles:!0,composed:!0})))}handleConversationListScroll(e){const t=e.currentTarget;t&&this.updateConversationScrollbar(t)}handleConversationScrollbarPointerDown(e){const t=e.currentTarget,s=this.renderRoot.querySelector(".conversation-list--sidebar");if(!t||!s)return;const i=t.getBoundingClientRect(),o=i.height*(this.conversationScrollbar.height/100),r=Math.max(i.height-o,0),c=Math.max(s.scrollHeight-s.clientHeight,1),a=s.scrollTop/c*r,h=e.clientY-i.top,p=h>=a&&h<=a+o,d=p?a:Math.min(Math.max(h-o/2,0),r);p||(s.scrollTop=d/Math.max(r,1)*(s.scrollHeight-s.clientHeight),this.updateConversationScrollbar(s)),t.setPointerCapture(e.pointerId),this.conversationScrollbarDraggingId=e.pointerId,this.conversationScrollbarDragState={startY:e.clientY,startThumbTop:d,trackHeight:i.height,thumbHeight:o,list:s},e.preventDefault()}handleConversationScrollbarPointerMove(e){if(this.conversationScrollbarDraggingId===null||this.conversationScrollbarDraggingId!==e.pointerId||!this.conversationScrollbarDragState)return;const{startY:t,startThumbTop:s,trackHeight:i,thumbHeight:o,list:r}=this.conversationScrollbarDragState,c=Math.max(i-o,0),a=e.clientY-t,h=Math.min(Math.max(s+a,0),c),p=r.scrollHeight-r.clientHeight;p>0&&(r.scrollTop=h/Math.max(c,1)*p,this.updateConversationScrollbar(r)),e.preventDefault()}handleConversationScrollbarPointerUp(e){if(this.conversationScrollbarDraggingId!==e.pointerId)return;const t=e.currentTarget;t==null||t.releasePointerCapture(e.pointerId),this.conversationScrollbarDraggingId=null,this.conversationScrollbarDragState=null}enqueueConversationScrollbarMeasure(){this.conversationScrollbarRaf===null&&(this.conversationScrollbarRaf=requestAnimationFrame(()=>{this.conversationScrollbarRaf=null,this.updateConversationScrollbar()}))}updateConversationScrollbar(e){const t=e??this.renderRoot.querySelector(".conversation-list--sidebar");if(!t){this.conversationScrollbar.visible&&(this.conversationScrollbar={height:0,top:0,visible:!1});return}const{scrollHeight:s,clientHeight:i,scrollTop:o}=t;if(s<=i+1){this.conversationScrollbar.visible&&(this.conversationScrollbar={height:0,top:0,visible:!1});return}const r=i/s,c=Math.max(r*100,8),a=100-c,h=o/(s-i)*(a>0?a:0);this.conversationScrollbar={height:c,top:h,visible:!0}}async onSuggestionClick(e){await this.processMessage(e)}async handleSubmit(e){e.preventDefault(),await this.processMessage(this.message)}createMessage(e,t){return{id:typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`${Date.now()}-${Math.random()}`,role:e,text:t,timestamp:Date.now()}}async processMessage(e){const t=e.trim();if(!t||this.isLoading)return;const s=this.messages.length===0;this.dispatchEvent(new CustomEvent("rioassist:send",{detail:{message:t,apiBaseUrl:this.apiBaseUrl,token:this.rioToken},bubbles:!0,composed:!0}));const i=this.createMessage("user",t);this.messages=[...this.messages,i],s&&(this.showNewConversationShortcut=!0),this.message="",this.errorMessage="",this.isLoading=!0,this.startLoadingGuard();try{await this.ensureRioClient().sendMessage(t)}catch(o){this.clearLoadingGuard(),this.isLoading=!1,this.errorMessage=o instanceof Error?o.message:"Nao foi possivel enviar a mensagem para o agente."}}ensureRioClient(){const e=this.rioToken.trim();if(!e)throw new Error("Informe o token RIO em data-rio-token para conectar no websocket do assistente.");return(!this.rioClient||!this.rioClient.matchesToken(e))&&(this.teardownRioClient(),this.rioClient=new At(e),this.rioUnsubscribe=this.rioClient.onMessage(t=>{this.handleIncomingMessage(t)})),this.rioClient}handleIncomingMessage(e){const t=this.createMessage("assistant",e.text);this.messages=[...this.messages,t],this.clearLoadingGuard(),this.isLoading=!1}teardownRioClient(){this.rioUnsubscribe&&(this.rioUnsubscribe(),this.rioUnsubscribe=null),this.rioClient&&(this.rioClient.close(),this.rioClient=null)}startLoadingGuard(){this.clearLoadingGuard(),this.loadingTimer=window.setTimeout(()=>{this.loadingTimer=null,this.isLoading=!1},15e3)}clearLoadingGuard(){this.loadingTimer!==null&&(window.clearTimeout(this.loadingTimer),this.loadingTimer=null)}scrollConversationToBottom(){Array.from(this.renderRoot.querySelectorAll(".panel-content")).forEach(t=>{requestAnimationFrame(()=>{t.scrollTop=t.scrollHeight})})}render(){return dt(this)}};Y.styles=He,Y.properties={open:{type:Boolean,state:!0},message:{type:String,state:!0},titleText:{type:String,attribute:"data-title"},buttonLabel:{type:String,attribute:"data-button-label"},placeholder:{type:String,attribute:"data-placeholder"},accentColor:{type:String,attribute:"data-accent-color"},apiBaseUrl:{type:String,attribute:"data-api-base-url"},rioToken:{type:String,attribute:"data-rio-token"},suggestionsSource:{type:String,attribute:"data-suggestions"},messages:{state:!0},isLoading:{type:Boolean,state:!0},errorMessage:{type:String,state:!0},showConversations:{type:Boolean,state:!0},conversationSearch:{type:String,state:!0},conversationMenuId:{state:!0},conversationMenuPlacement:{state:!0},isFullscreen:{type:Boolean,state:!0},conversationScrollbar:{state:!0},showNewConversationShortcut:{type:Boolean,state:!0}};let q=Y;customElements.get("rio-assist-widget")||customElements.define("rio-assist-widget",q);const gt={title:"Rio Insight",buttonLabel:"Rio Insight",placeholder:"Pergunte alguma coisa",suggestions:["Veículos com problemas","Valor das peças","Planos de manutenção"],accentColor:"#008B9A",apiBaseUrl:"",rioToken:""},me="rio-assist-widget";function ft(n={}){const{target:e=document.body,...t}=n;let s=document.querySelector(me);s||(s=document.createElement(me),e.appendChild(s));const i={...gt,...t};Object.entries(i).forEach(([o,r])=>{r!==void 0&&(s==null||s.setAttribute(`data-${o.replace(/[A-Z]/g,c=>`-${c.toLowerCase()}`)}`,Array.isArray(r)?r.join("|"):String(r)))})}typeof window<"u"&&(window.RioAssist=window.RioAssist??{init:ft},window.dispatchEvent(new Event("rio-assist-ready")))})();
|
package/index.html
CHANGED
|
@@ -9,28 +9,20 @@
|
|
|
9
9
|
min-height: 100vh;
|
|
10
10
|
margin: 0;
|
|
11
11
|
font-family: 'Inter', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
|
|
12
|
-
background:
|
|
13
|
-
color: #
|
|
14
|
-
padding: 32px;
|
|
12
|
+
background: #f5f7fa;
|
|
13
|
+
color: #1f2f36;
|
|
15
14
|
}
|
|
16
15
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
h1 {
|
|
22
|
-
margin-top: 0;
|
|
16
|
+
.page {
|
|
17
|
+
padding: 24px;
|
|
18
|
+
max-width: 720px;
|
|
23
19
|
}
|
|
24
20
|
</style>
|
|
25
21
|
</head>
|
|
26
22
|
<body>
|
|
27
|
-
<
|
|
28
|
-
<
|
|
29
|
-
|
|
30
|
-
Playground de teste para o webcomponent. Clique no
|
|
31
|
-
botão flutuante no canto inferior direito para testar.
|
|
32
|
-
</p>
|
|
33
|
-
</main>
|
|
23
|
+
<div class="page">
|
|
24
|
+
<p>Abra o botão flutuante no canto inferior direito para testar.</p>
|
|
25
|
+
</div>
|
|
34
26
|
|
|
35
27
|
<rio-assist-widget
|
|
36
28
|
data-title="Rio Insight"
|
|
@@ -44,4 +36,4 @@
|
|
|
44
36
|
<script type="module" src="/src/playground.ts"></script>
|
|
45
37
|
</body>
|
|
46
38
|
</html>
|
|
47
|
-
|
|
39
|
+
</body>
|
package/package.json
CHANGED
|
Binary file
|