xactsize-webcomponents 1.0.47 → 1.0.48
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/{body-measurer-Bd8qnuTn.mjs → body-measurer-CORR-wkE.mjs} +310 -274
- package/dist/body-measurer.es.js +1 -1
- package/dist/body-measurer.umd.js +28 -28
- package/dist/{es-MX-C6PnLIYM.mjs → es-MX-CdrQCtwz.mjs} +1 -1
- package/dist/{pt-BR-0sbJDgsT.mjs → pt-BR-BepVa4r8.mjs} +1 -1
- package/dist/services/ai-session-manager.d.ts +6 -0
- package/package.json +1 -1
package/dist/body-measurer.es.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
(function(c,
|
|
1
|
+
(function(c,B){typeof exports=="object"&&typeof module<"u"?B(exports):typeof define=="function"&&define.amd?define(["exports"],B):(c=typeof globalThis<"u"?globalThis:c||self,B(c.BodyMeasurer={}))})(this,function(c){"use strict";var Ke;const B=(a,e,t)=>{const i=a[e];return i?typeof i=="function"?i():Promise.resolve(i):new Promise((s,o)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(o.bind(null,new Error("Unknown variable dynamic import: "+e+(e.split("/").length!==t?". Note that variables only represent file names one level deep.":""))))})};/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/const
|
|
5
|
+
*/const Q=globalThis,ne=Q.ShadowRoot&&(Q.ShadyCSS===void 0||Q.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,le=Symbol(),Ae=new WeakMap;let Re=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==le)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(ne&&e===void 0){const i=t!==void 0&&t.length===1;i&&(e=Ae.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&Ae.set(t,e))}return e}toString(){return this.cssText}};const Xe=a=>new Re(typeof a=="string"?a:a+"",void 0,le),D=(a,...e)=>{const t=a.length===1?a[0]:e.reduce((i,s,o)=>i+(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.")})(s)+a[o+1],a[0]);return new Re(t,a,le)},Qe=(a,e)=>{if(ne)a.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const i=document.createElement("style"),s=Q.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=t.cssText,a.appendChild(i)}},Me=ne?a=>a:a=>a instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return Xe(t)})(a):a;/**
|
|
6
6
|
* @license
|
|
7
7
|
* Copyright 2017 Google LLC
|
|
8
8
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
-
*/const{is:Je,defineProperty:et,getOwnPropertyDescriptor:tt,getOwnPropertyNames:it,getOwnPropertySymbols:st,getPrototypeOf:at}=Object,
|
|
9
|
+
*/const{is:Je,defineProperty:et,getOwnPropertyDescriptor:tt,getOwnPropertyNames:it,getOwnPropertySymbols:st,getPrototypeOf:at}=Object,A=globalThis,Se=A.trustedTypes,ot=Se?Se.emptyScript:"",de=A.reactiveElementPolyfillSupport,F=(a,e)=>a,J={toAttribute(a,e){switch(e){case Boolean:a=a?ot:null;break;case Object:case Array:a=a==null?a:JSON.stringify(a)}return a},fromAttribute(a,e){let t=a;switch(e){case Boolean:t=a!==null;break;case Number:t=a===null?null:Number(a);break;case Object:case Array:try{t=JSON.parse(a)}catch{t=null}}return t}},ce=(a,e)=>!Je(a,e),Le={attribute:!0,type:String,converter:J,reflect:!1,useDefault:!1,hasChanged:ce};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),A.litPropertyMetadata??(A.litPropertyMetadata=new WeakMap);let H=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=Le){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 i=Symbol(),s=this.getPropertyDescriptor(e,i,t);s!==void 0&&et(this.prototype,e,s)}}static getPropertyDescriptor(e,t,i){const{get:s,set:o}=tt(this.prototype,e)??{get(){return this[t]},set(r){this[t]=r}};return{get:s,set(r){const d=s==null?void 0:s.call(this);o==null||o.call(this,r),this.requestUpdate(e,d,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Le}static _$Ei(){if(this.hasOwnProperty(F("elementProperties")))return;const e=at(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(F("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(F("properties"))){const t=this.properties,i=[...it(t),...st(t)];for(const s of i)this.createProperty(s,t[s])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[i,s]of t)this.elementProperties.set(i,s)}this._$Eh=new Map;for(const[t,i]of this.elementProperties){const s=this._$Eu(t,i);s!==void 0&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const s of i)t.unshift(Me(s))}else e!==void 0&&t.push(Me(e));return t}static _$Eu(e,t){const i=t.attribute;return i===!1?void 0:typeof i=="string"?i: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 i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Qe(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 i;return(i=t.hostConnected)==null?void 0:i.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var i;return(i=t.hostDisconnected)==null?void 0:i.call(t)})}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$ET(e,t){var o;const i=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,i);if(s!==void 0&&i.reflect===!0){const r=(((o=i.converter)==null?void 0:o.toAttribute)!==void 0?i.converter:J).toAttribute(t,i.type);this._$Em=e,r==null?this.removeAttribute(s):this.setAttribute(s,r),this._$Em=null}}_$AK(e,t){var o,r;const i=this.constructor,s=i._$Eh.get(e);if(s!==void 0&&this._$Em!==s){const d=i.getPropertyOptions(s),l=typeof d.converter=="function"?{fromAttribute:d.converter}:((o=d.converter)==null?void 0:o.fromAttribute)!==void 0?d.converter:J;this._$Em=s,this[s]=l.fromAttribute(t,d.type)??((r=this._$Ej)==null?void 0:r.get(s))??null,this._$Em=null}}requestUpdate(e,t,i){var s;if(e!==void 0){const o=this.constructor,r=this[e];if(i??(i=o.getPropertyOptions(e)),!((i.hasChanged??ce)(r,t)||i.useDefault&&i.reflect&&r===((s=this._$Ej)==null?void 0:s.get(e))&&!this.hasAttribute(o._$Eu(e,i))))return;this.C(e,t,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:i,reflect:s,wrapped:o},r){i&&!(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||i||(t=void 0),this._$AL.set(e,t)),s===!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 i;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 s=this.constructor.elementProperties;if(s.size>0)for(const[o,r]of s){const{wrapped:d}=r,l=this[o];d!==!0||this._$AL.has(o)||l===void 0||this.C(o,void 0,r,l)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(i=this._$EO)==null||i.forEach(s=>{var o;return(o=s.hostUpdate)==null?void 0:o.call(s)}),this.update(t)):this._$EM()}catch(s){throw e=!1,this._$EM(),s}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(i=>{var s;return(s=i.hostUpdated)==null?void 0:s.call(i)}),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){}};H.elementStyles=[],H.shadowRootOptions={mode:"open"},H[F("elementProperties")]=new Map,H[F("finalized")]=new Map,de==null||de({ReactiveElement:H}),(A.reactiveElementVersions??(A.reactiveElementVersions=[])).push("2.1.0");/**
|
|
10
10
|
* @license
|
|
11
11
|
* Copyright 2017 Google LLC
|
|
12
12
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
13
|
-
*/const
|
|
14
|
-
\f\r]`,
|
|
15
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),De=/'/g,He=/"/g,
|
|
13
|
+
*/const z=globalThis,ee=z.trustedTypes,Te=ee?ee.createPolicy("lit-html",{createHTML:a=>a}):void 0,Oe="$lit$",R=`lit$${Math.random().toFixed(9).slice(2)}$`,$e="?"+R,rt=`<${$e}>`,S=document,j=()=>S.createComment(""),G=a=>a===null||typeof a!="object"&&typeof a!="function",he=Array.isArray,nt=a=>he(a)||typeof(a==null?void 0:a[Symbol.iterator])=="function",pe=`[
|
|
14
|
+
\f\r]`,Z=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ie=/-->/g,ke=/>/g,L=RegExp(`>|${pe}(?:([^\\s"'>=/]+)(${pe}*=${pe}*(?:[^
|
|
15
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),De=/'/g,He=/"/g,Ue=/^(?:script|style|textarea|title)$/i,lt=a=>(e,...t)=>({_$litType$:a,strings:e,values:t}),g=lt(1),T=Symbol.for("lit-noChange"),_=Symbol.for("lit-nothing"),Ne=new WeakMap,O=S.createTreeWalker(S,129);function Pe(a,e){if(!he(a)||!a.hasOwnProperty("raw"))throw Error("invalid template strings array");return Te!==void 0?Te.createHTML(e):e}const dt=(a,e)=>{const t=a.length-1,i=[];let s,o=e===2?"<svg>":e===3?"<math>":"",r=Z;for(let d=0;d<t;d++){const l=a[d];let f,m,h=-1,b=0;for(;b<l.length&&(r.lastIndex=b,m=r.exec(l),m!==null);)b=r.lastIndex,r===Z?m[1]==="!--"?r=Ie:m[1]!==void 0?r=ke:m[2]!==void 0?(Ue.test(m[2])&&(s=RegExp("</"+m[2],"g")),r=L):m[3]!==void 0&&(r=L):r===L?m[0]===">"?(r=s??Z,h=-1):m[1]===void 0?h=-2:(h=r.lastIndex-m[2].length,f=m[1],r=m[3]===void 0?L:m[3]==='"'?He:De):r===He||r===De?r=L:r===Ie||r===ke?r=Z:(r=L,s=void 0);const M=r===L&&a[d+1].startsWith("/>")?" ":"";o+=r===Z?l+rt:h>=0?(i.push(f),l.slice(0,h)+Oe+l.slice(h)+R+M):l+R+(h===-2?d:M)}return[Pe(a,o+(a[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]};class q{constructor({strings:e,_$litType$:t},i){let s;this.parts=[];let o=0,r=0;const d=e.length-1,l=this.parts,[f,m]=dt(e,t);if(this.el=q.createElement(f,i),O.currentNode=this.el.content,t===2||t===3){const h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(s=O.nextNode())!==null&&l.length<d;){if(s.nodeType===1){if(s.hasAttributes())for(const h of s.getAttributeNames())if(h.endsWith(Oe)){const b=m[r++],M=s.getAttribute(h).split(R),re=/([.?@])?(.*)/.exec(b);l.push({type:1,index:o,name:re[2],strings:M,ctor:re[1]==="."?ht:re[1]==="?"?pt:re[1]==="@"?ut:te}),s.removeAttribute(h)}else h.startsWith(R)&&(l.push({type:6,index:o}),s.removeAttribute(h));if(Ue.test(s.tagName)){const h=s.textContent.split(R),b=h.length-1;if(b>0){s.textContent=ee?ee.emptyScript:"";for(let M=0;M<b;M++)s.append(h[M],j()),O.nextNode(),l.push({type:2,index:++o});s.append(h[b],j())}}}else if(s.nodeType===8)if(s.data===$e)l.push({type:2,index:o});else{let h=-1;for(;(h=s.data.indexOf(R,h+1))!==-1;)l.push({type:7,index:o}),h+=R.length-1}o++}}static createElement(e,t){const i=S.createElement("template");return i.innerHTML=e,i}}function U(a,e,t=a,i){var r,d;if(e===T)return e;let s=i!==void 0?(r=t._$Co)==null?void 0:r[i]:t._$Cl;const o=G(e)?void 0:e._$litDirective$;return(s==null?void 0:s.constructor)!==o&&((d=s==null?void 0:s._$AO)==null||d.call(s,!1),o===void 0?s=void 0:(s=new o(a),s._$AT(a,t,i)),i!==void 0?(t._$Co??(t._$Co=[]))[i]=s:t._$Cl=s),s!==void 0&&(e=U(a,s._$AS(a,e.values),s,i)),e}class ct{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:i}=this._$AD,s=((e==null?void 0:e.creationScope)??S).importNode(t,!0);O.currentNode=s;let o=O.nextNode(),r=0,d=0,l=i[0];for(;l!==void 0;){if(r===l.index){let f;l.type===2?f=new Y(o,o.nextSibling,this,e):l.type===1?f=new l.ctor(o,l.name,l.strings,this,e):l.type===6&&(f=new ft(o,this,e)),this._$AV.push(f),l=i[++d]}r!==(l==null?void 0:l.index)&&(o=O.nextNode(),r++)}return O.currentNode=S,s}p(e){let t=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}}class Y{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,i,s){this.type=2,this._$AH=_,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=s,this._$Cv=(s==null?void 0:s.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=U(this,e,t),G(e)?e===_||e==null||e===""?(this._$AH!==_&&this._$AR(),this._$AH=_):e!==this._$AH&&e!==T&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):nt(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!==_&&G(this._$AH)?this._$AA.nextSibling.data=e:this.T(S.createTextNode(e)),this._$AH=e}$(e){var o;const{values:t,_$litType$:i}=e,s=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=q.createElement(Pe(i.h,i.h[0]),this.options)),i);if(((o=this._$AH)==null?void 0:o._$AD)===s)this._$AH.p(t);else{const r=new ct(s,this),d=r.u(this.options);r.p(t),this.T(d),this._$AH=r}}_$AC(e){let t=Ne.get(e.strings);return t===void 0&&Ne.set(e.strings,t=new q(e)),t}k(e){he(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let i,s=0;for(const o of e)s===t.length?t.push(i=new Y(this.O(j()),this.O(j()),this,this.options)):i=t[s],i._$AI(o),s++;s<t.length&&(this._$AR(i&&i._$AB.nextSibling,s),t.length=s)}_$AR(e=this._$AA.nextSibling,t){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,t);e&&e!==this._$AB;){const s=e.nextSibling;e.remove(),e=s}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}}class te{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,s,o){this.type=1,this._$AH=_,this._$AN=void 0,this.element=e,this.name=t,this._$AM=s,this.options=o,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=_}_$AI(e,t=this,i,s){const o=this.strings;let r=!1;if(o===void 0)e=U(this,e,t,0),r=!G(e)||e!==this._$AH&&e!==T,r&&(this._$AH=e);else{const d=e;let l,f;for(e=o[0],l=0;l<o.length-1;l++)f=U(this,d[i+l],t,l),f===T&&(f=this._$AH[l]),r||(r=!G(f)||f!==this._$AH[l]),f===_?e=_:e!==_&&(e+=(f??"")+o[l+1]),this._$AH[l]=f}r&&!s&&this.j(e)}j(e){e===_?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class ht extends te{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===_?void 0:e}}class pt extends te{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==_)}}class ut extends te{constructor(e,t,i,s,o){super(e,t,i,s,o),this.type=5}_$AI(e,t=this){if((e=U(this,e,t,0)??_)===T)return;const i=this._$AH,s=e===_&&i!==_||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,o=e!==_&&(i===_||s);s&&this.element.removeEventListener(this.name,this,i),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 ft{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){U(this,e)}}const ue=z.litHtmlPolyfillSupport;ue==null||ue(q,Y),(z.litHtmlVersions??(z.litHtmlVersions=[])).push("3.3.0");const mt=(a,e,t)=>{const i=(t==null?void 0:t.renderBefore)??e;let s=i._$litPart$;if(s===void 0){const o=(t==null?void 0:t.renderBefore)??null;i._$litPart$=s=new Y(e.insertBefore(j(),o),o,void 0,t??{})}return s._$AI(a),s};/**
|
|
16
16
|
* @license
|
|
17
17
|
* Copyright 2017 Google LLC
|
|
18
18
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
19
|
-
*/const $=globalThis;let
|
|
19
|
+
*/const $=globalThis;let C=class extends H{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=mt(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 T}};C._$litElement$=!0,C.finalized=!0,(Ke=$.litElementHydrateSupport)==null||Ke.call($,{LitElement:C});const fe=$.litElementPolyfillSupport;fe==null||fe({LitElement:C}),($.litElementVersions??($.litElementVersions=[])).push("4.2.0");/**
|
|
20
20
|
* @license
|
|
21
21
|
* Copyright 2017 Google LLC
|
|
22
22
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
23
|
-
*/const
|
|
23
|
+
*/const N=a=>(e,t)=>{t!==void 0?t.addInitializer(()=>{customElements.define(a,e)}):customElements.define(a,e)};/**
|
|
24
24
|
* @license
|
|
25
25
|
* Copyright 2017 Google LLC
|
|
26
26
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
27
|
-
*/const gt={attribute:!0,type:String,converter:
|
|
27
|
+
*/const gt={attribute:!0,type:String,converter:J,reflect:!1,hasChanged:ce},_t=(a=gt,e,t)=>{const{kind:i,metadata:s}=t;let o=globalThis.litPropertyMetadata.get(s);if(o===void 0&&globalThis.litPropertyMetadata.set(s,o=new Map),i==="setter"&&((a=Object.create(a)).wrapped=!0),o.set(t.name,a),i==="accessor"){const{name:r}=t;return{set(d){const l=e.get.call(this);e.set.call(this,d),this.requestUpdate(r,l,a)},init(d){return d!==void 0&&this.C(r,void 0,a,d),d}}}if(i==="setter"){const{name:r}=t;return function(d){const l=this[r];e.call(this,d),this.requestUpdate(r,l,a)}}throw Error("Unsupported decorator location: "+i)};function p(a){return(e,t)=>typeof t=="object"?_t(a,e,t):((i,s,o)=>{const r=s.hasOwnProperty(o);return s.constructor.createProperty(o,i),r?Object.getOwnPropertyDescriptor(s,o):void 0})(a,e,t)}/**
|
|
28
28
|
* @license
|
|
29
29
|
* Copyright 2017 Google LLC
|
|
30
30
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
* @license
|
|
45
45
|
* Copyright 2021 Google LLC
|
|
46
46
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
47
|
-
*/class bt{constructor(e){this.__litLocalizeEventHandler=t=>{t.detail.status==="ready"&&this.host.requestUpdate()},this.host=e}hostConnected(){window.addEventListener(me,this.__litLocalizeEventHandler)}hostDisconnected(){window.removeEventListener(me,this.__litLocalizeEventHandler)}}const
|
|
47
|
+
*/class bt{constructor(e){this.__litLocalizeEventHandler=t=>{t.detail.status==="ready"&&this.host.requestUpdate()},this.host=e}hostConnected(){window.addEventListener(me,this.__litLocalizeEventHandler)}hostDisconnected(){window.removeEventListener(me,this.__litLocalizeEventHandler)}}const Ct=a=>a.addController(new bt(a));/**
|
|
48
48
|
* @license
|
|
49
49
|
* Copyright 2021 Google LLC
|
|
50
50
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
51
|
-
*/const
|
|
51
|
+
*/const W=()=>(a,e)=>(a.addInitializer(Ct),a);/**
|
|
52
52
|
* @license
|
|
53
53
|
* Copyright 2020 Google LLC
|
|
54
54
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -56,11 +56,11 @@
|
|
|
56
56
|
* @license
|
|
57
57
|
* Copyright 2014 Travis Webb
|
|
58
58
|
* SPDX-License-Identifier: MIT
|
|
59
|
-
*/const
|
|
59
|
+
*/const w=[];for(let a=0;a<256;a++)w[a]=(a>>4&15).toString(16)+(a&15).toString(16);function vt(a){let e=0,t=8997,i=0,s=33826,o=0,r=40164,d=0,l=52210;for(let f=0;f<a.length;f++)t^=a.charCodeAt(f),e=t*435,i=s*435,o=r*435,d=l*435,o+=t<<8,d+=s<<8,i+=e>>>16,t=e&65535,o+=i>>>16,s=i&65535,l=d+(o>>>16)&65535,r=o&65535;return w[l>>8]+w[l&255]+w[r>>8]+w[r&255]+w[s>>8]+w[s&255]+w[t>>8]+w[t&255]}/**
|
|
60
60
|
* @license
|
|
61
61
|
* Copyright 2020 Google LLC
|
|
62
62
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
63
|
-
*/const xt="",wt="h",At="s";function Rt(a,e){return(e?wt:At)+
|
|
63
|
+
*/const xt="",wt="h",At="s";function Rt(a,e){return(e?wt:At)+vt(typeof a=="string"?a:a.join(xt))}/**
|
|
64
64
|
* @license
|
|
65
65
|
* Copyright 2021 Google LLC
|
|
66
66
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -68,15 +68,15 @@
|
|
|
68
68
|
* @license
|
|
69
69
|
* Copyright 2021 Google LLC
|
|
70
70
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
71
|
-
*/function _e(a){window.dispatchEvent(new CustomEvent(me,{detail:a}))}let
|
|
71
|
+
*/function _e(a){window.dispatchEvent(new CustomEvent(me,{detail:a}))}let ie="",Ee,Ze,se,ye,qe,I=new ze;I.resolve();let ae=0;const Lt=a=>(yt((e,t)=>Mt(qe,e,t)),ie=Ze=a.sourceLocale,se=new Set(a.targetLocales),se.add(a.sourceLocale),ye=a.loadLocale,{getLocale:Tt,setLocale:Ot}),Tt=()=>ie,Ot=a=>{if(a===(Ee??ie))return I.promise;if(!se||!ye)throw new Error("Internal error");if(!se.has(a))throw new Error("Invalid locale code");ae++;const e=ae;return Ee=a,I.settled&&(I=new ze),_e({status:"loading",loadingLocale:a}),(a===Ze?Promise.resolve({templates:void 0}):ye(a)).then(i=>{ae===e&&(ie=a,Ee=void 0,qe=i.templates,_e({status:"ready",readyLocale:a}),I.resolve())},i=>{ae===e&&(_e({status:"error",errorLocale:a,errorMessage:i.toString()}),I.reject(i))}),I.promise},Ye="en",$t=["es-MX","pt-BR"];/**
|
|
72
72
|
* @license
|
|
73
73
|
* Copyright 2017 Google LLC
|
|
74
74
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
75
|
-
*/const
|
|
75
|
+
*/const It={ATTRIBUTE:1},kt=a=>(...e)=>({_$litDirective$:a,values:e});class Dt{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}}/**
|
|
76
76
|
* @license
|
|
77
77
|
* Copyright 2018 Google LLC
|
|
78
78
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
79
|
-
*/const Ht=
|
|
79
|
+
*/const Ht=kt(class extends Dt{constructor(a){var e;if(super(a),a.type!==It.ATTRIBUTE||a.name!=="class"||((e=a.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(a){return" "+Object.keys(a).filter(e=>a[e]).join(" ")+" "}update(a,[e]){var i,s;if(this.st===void 0){this.st=new Set,a.strings!==void 0&&(this.nt=new Set(a.strings.join(" ").split(/\s/).filter(o=>o!=="")));for(const o in e)e[o]&&!((i=this.nt)!=null&&i.has(o))&&this.st.add(o);return this.render(e)}const t=a.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)||(s=this.nt)!=null&&s.has(o)||(r?(t.add(o),this.st.add(o)):(t.remove(o),this.st.delete(o)))}return T}});var Ut=Object.defineProperty,Nt=Object.getOwnPropertyDescriptor,K=(a,e,t,i)=>{for(var s=i>1?void 0:i?Nt(e,t):e,o=a.length-1,r;o>=0;o--)(r=a[o])&&(s=(i?r(e,t,s):r(s))||s);return i&&s&&Ut(e,t,s),s};let k=class extends C{constructor(){super(...arguments),this.type="button",this.label="",this.disabled=!1,this.variant="contained"}render(){return g`
|
|
80
80
|
<div class="button-wrapper">
|
|
81
81
|
<button
|
|
82
82
|
class=${this.variant}
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
${this.label}
|
|
88
88
|
</button>
|
|
89
89
|
</div>
|
|
90
|
-
`}};k.styles=
|
|
90
|
+
`}};k.styles=D`
|
|
91
91
|
:host {
|
|
92
92
|
display: block;
|
|
93
93
|
width: 100%;
|
|
@@ -167,7 +167,7 @@
|
|
|
167
167
|
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
|
-
`,
|
|
170
|
+
`,K([p({type:String})],k.prototype,"type",2),K([p({type:String})],k.prototype,"label",2),K([p({type:Boolean})],k.prototype,"disabled",2),K([p({type:String})],k.prototype,"variant",2),k=K([N("xact-button")],k);var Pt=Object.defineProperty,Vt=Object.getOwnPropertyDescriptor,oe=(a,e,t,i)=>{for(var s=i>1?void 0:i?Vt(e,t):e,o=a.length-1,r;o>=0;o--)(r=a[o])&&(s=(i?r(e,t,s):r(s))||s);return i&&s&&Pt(e,t,s),s};let P=class extends C{constructor(){super(...arguments),this.height=0,this.brandName="",this.handleStart=()=>{var e;const a=this.shadowRoot.querySelector("#height-input");if(a!=null&&a.value){const t=parseInt(a.value);this.height=t,(e=this.onStartMeasurement)==null||e.call(this,t)}}}render(){return g`
|
|
171
171
|
<div class="card">
|
|
172
172
|
<div class="pill">XactSize${this.brandName?" x "+this.brandName:""}</div>
|
|
173
173
|
<h2 class="title">${n("Let's find your perfect size")}</h2>
|
|
@@ -219,7 +219,7 @@
|
|
|
219
219
|
<span>${e}</span>
|
|
220
220
|
</div>
|
|
221
221
|
</div>
|
|
222
|
-
`}};
|
|
222
|
+
`}};P.styles=D`
|
|
223
223
|
:host {
|
|
224
224
|
display: block;
|
|
225
225
|
font-family: 'Inter', 'Helvetica', Arial, sans-serif;
|
|
@@ -394,7 +394,7 @@
|
|
|
394
394
|
grid-template-columns: 1fr;
|
|
395
395
|
}
|
|
396
396
|
}
|
|
397
|
-
`,
|
|
397
|
+
`,oe([p({type:Number})],P.prototype,"height",2),oe([p({type:String})],P.prototype,"brandName",2),oe([p({type:Function})],P.prototype,"onStartMeasurement",2),P=oe([N("xact-step-one"),W()],P);var Bt=Object.getOwnPropertyDescriptor,Ft=(a,e,t,i)=>{for(var s=i>1?void 0:i?Bt(e,t):e,o=a.length-1,r;o>=0;o--)(r=a[o])&&(s=r(s)||s);return s};let be=class extends C{render(){return g`
|
|
398
398
|
<footer class="modal-footer">
|
|
399
399
|
<span>
|
|
400
400
|
<span class="powered-by">${n("Powered by")}</span>
|
|
@@ -437,7 +437,7 @@
|
|
|
437
437
|
</a>
|
|
438
438
|
</span>
|
|
439
439
|
</footer>
|
|
440
|
-
`}};be.styles=
|
|
440
|
+
`}};be.styles=D`
|
|
441
441
|
.modal-footer {
|
|
442
442
|
text-align: center;
|
|
443
443
|
font-size: 12px;
|
|
@@ -473,7 +473,7 @@
|
|
|
473
473
|
outline: 2px solid var(--brand-primary);
|
|
474
474
|
outline-offset: 2px;
|
|
475
475
|
}
|
|
476
|
-
`,be=Ft([
|
|
476
|
+
`,be=Ft([N("xact-footer"),W()],be);var zt=Object.defineProperty,jt=Object.getOwnPropertyDescriptor,v=(a,e,t,i)=>{for(var s=i>1?void 0:i?jt(e,t):e,o=a.length-1,r;o>=0;o--)(r=a[o])&&(s=(i?r(e,t,s):r(s))||s);return i&&s&&zt(e,t,s),s};let y=class extends C{constructor(){super(...arguments),this.productName="",this.recommendedSize="",this.productSku="",this.garmentUrl="",this.generatedImageUrl="",this.isVtonFetching=!1,this.vtonError=!1}render(){return g`
|
|
477
477
|
<div class="image-container">
|
|
478
478
|
<!-- Product image -->
|
|
479
479
|
<img
|
|
@@ -584,7 +584,7 @@
|
|
|
584
584
|
<xact-button @click=${this.onAccept} label=${n("Accept Suggestion")}>
|
|
585
585
|
</xact-button>
|
|
586
586
|
</div>
|
|
587
|
-
`}};y.styles=
|
|
587
|
+
`}};y.styles=D`
|
|
588
588
|
:host {
|
|
589
589
|
display: flex;
|
|
590
590
|
flex-direction: column;
|
|
@@ -666,7 +666,7 @@
|
|
|
666
666
|
background-position: 200% center;
|
|
667
667
|
}
|
|
668
668
|
}
|
|
669
|
-
`,
|
|
669
|
+
`,v([p({type:String})],y.prototype,"productName",2),v([p({type:String})],y.prototype,"recommendedSize",2),v([p({type:String})],y.prototype,"productSku",2),v([p({type:String})],y.prototype,"garmentUrl",2),v([p({type:String})],y.prototype,"generatedImageUrl",2),v([p({type:Boolean})],y.prototype,"isVtonFetching",2),v([p({type:Boolean})],y.prototype,"vtonError",2),v([p({type:Function})],y.prototype,"onAccept",2),v([p({type:Function})],y.prototype,"onRetry",2),y=v([N("xact-step-result"),W()],y);var Gt=Object.defineProperty,Zt=Object.getOwnPropertyDescriptor,Ce=(a,e,t,i)=>{for(var s=i>1?void 0:i?Zt(e,t):e,o=a.length-1,r;o>=0;o--)(r=a[o])&&(s=(i?r(e,t,s):r(s))||s);return i&&s&&Gt(e,t,s),s};let X=class extends C{constructor(){super(...arguments),this.height=0}render(){const a=Array.from({length:24},(e,t)=>t);return g`
|
|
670
670
|
<div class="component-content">
|
|
671
671
|
<div class="header-section">
|
|
672
672
|
<h2 class="header-text">${n("Before you begin")}</h2>
|
|
@@ -810,7 +810,7 @@
|
|
|
810
810
|
style="left:${t}%; animation-delay:${i}s, ${s}s;"
|
|
811
811
|
></span>`})}
|
|
812
812
|
</div>
|
|
813
|
-
`}};
|
|
813
|
+
`}};X.styles=D`
|
|
814
814
|
:host {
|
|
815
815
|
display: flex;
|
|
816
816
|
justify-content: center;
|
|
@@ -1001,7 +1001,7 @@
|
|
|
1001
1001
|
50% { transform: translateX(22px); }
|
|
1002
1002
|
}
|
|
1003
1003
|
|
|
1004
|
-
`,ve([p({type:Number})],K.prototype,"height",2),ve([p({type:Function})],K.prototype,"onStep2advancement",2),K=ve([P("xact-step-informs"),Y()],K);const We="data:image/svg+xml,%3csvg%20width='22'%20height='40'%20viewBox='0%200%2022%2040'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M21.517%200L0%2013.3362V0H21.517Z'%20fill='white'/%3e%3cpath%20d='M21.517%2013.339L0%2026.6724V13.3362H21.517V13.339Z'%20fill='white'/%3e%3cpath%20d='M21.517%2026.6755L0%2040.0089V26.6726H21.517V26.6755Z'%20fill='%231C28BA'/%3e%3c/svg%3e",qt="data:image/svg+xml,%3csvg%20width='22'%20height='41'%20viewBox='0%200%2022%2041'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M21.517%200.00878906L0%2013.345V0.00878906H21.517Z'%20fill='white'/%3e%3cpath%20d='M21.517%2013.3478L0%2026.6812V13.345H21.517V13.3478Z'%20fill='%231C28BA'/%3e%3cpath%20d='M21.517%2026.6843L0%2040.0176V26.6814H21.517V26.6843Z'%20fill='white'/%3e%3c/svg%3e",Yt="data:image/svg+xml,%3csvg%20width='22'%20height='41'%20viewBox='0%200%2022%2041'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M21.517%200.0204381L0%2013.3538V0.0175781H21.517V0.0204381Z'%20fill='%231C28BA'/%3e%3cpath%20d='M21.517%2013.3538L0%2026.69V13.3538H21.517Z'%20fill='white'/%3e%3cpath%20d='M21.517%2026.693L0%2040.0264V26.6902H21.517V26.693Z'%20fill='white'/%3e%3c/svg%3e",N=class N{constructor(){this.audioContext=null,this.playbackCtx=null,this.stream=null,this.processor=null,this.source=null,this.audioPlaybackQueue=[],this.isPlaying=!1,this.isUserSpeaking=!1,this.speechTimeout=null}get isPlaybackActive(){return this.isPlaying||this.audioPlaybackQueue.length>0}async startMicrophone(e){try{this.stream=await navigator.mediaDevices.getUserMedia({audio:{sampleRate:16e3,channelCount:1,echoCancellation:!0}}),this.audioContext=new AudioContext({sampleRate:16e3}),this.source=this.audioContext.createMediaStreamSource(this.stream),this.processor=this.audioContext.createScriptProcessor(4096,1,1),this.processor.onaudioprocess=t=>{const i=t.inputBuffer.getChannelData(0);let s=0;for(let d=0;d<i.length;d++)s+=i[d]*i[d];Math.sqrt(s/i.length)>N.SPEECH_THRESHOLD&&(this.isUserSpeaking=!0,this.speechTimeout&&clearTimeout(this.speechTimeout),this.speechTimeout=window.setTimeout(()=>{this.isUserSpeaking=!1},N.SPEECH_HOLD_TIME));const r=this.float32ToInt16(i);e(r.buffer)},this.source.connect(this.processor),this.processor.connect(this.audioContext.destination)}catch(t){console.error("Microphone access denied or error:",t)}}float32ToInt16(e){const t=new Int16Array(e.length);for(let i=0;i<e.length;i++){const s=Math.max(-1,Math.min(1,e[i]));t[i]=s<0?s*32768:s*32767}return t}initPlayback(){this.playbackCtx||(this.playbackCtx=new AudioContext({sampleRate:24e3}))}queueAudio(e){this.audioPlaybackQueue.push(e),this.playNextChunk()}playNextChunk(){if(this.isPlaying||this.audioPlaybackQueue.length===0)return;this.initPlayback();const e=this.audioPlaybackQueue.shift();this.isPlaying=!0;const t=new Int16Array(e),i=new Float32Array(t.length);for(let r=0;r<t.length;r++)i[r]=t[r]/32767;const s=this.playbackCtx.createBuffer(1,i.length,24e3);s.copyToChannel(i,0);const o=this.playbackCtx.createBufferSource();o.buffer=s,o.connect(this.playbackCtx.destination),o.onended=()=>{this.isPlaying=!1,this.audioPlaybackQueue.length===0&&this.onQueueDrained&&this.onQueueDrained(),this.playNextChunk()},o.start()}clearPlaybackQueue(){this.audioPlaybackQueue=[]}stopAll(){this.clearPlaybackQueue(),this.processor&&this.source&&(this.processor.disconnect(),this.source.disconnect()),this.stream&&(this.stream.getTracks().forEach(e=>e.stop()),this.stream=null),this.audioContext&&(this.audioContext.close(),this.audioContext=null),this.playbackCtx&&(this.playbackCtx.close(),this.playbackCtx=null)}};N.SPEECH_THRESHOLD=.02,N.SPEECH_HOLD_TIME=1500;let Ce=N;const oe=class oe{constructor(e,t,i="en"){this.ws=null,this.introSent=!1,this.introComplete=!1,this.lastCvError="",this.lastCvErrorTime=0,this.measurementComplete=!1,this.isDisconnected=!1,this.apiUrl=e,this.apiKey=t,this.localeCode=i,this.audioManager=new Ce}async connect(){try{const e=await fetch(`${this.apiUrl}/api/ConversationalAI/ticket`,{method:"POST",headers:{"Content-Type":"application/json","X-Api-Key":this.apiKey}});if(this.isDisconnected){console.log("AI session was disconnected before ticket response.");return}if(!e.ok){console.error("Failed to get ticket",e.statusText);return}const t=await e.json();if(!t||!t.ticket_id){console.error("Invalid ticket response");return}if(this.isDisconnected){console.log("AI session was disconnected before websocket could be opened.");return}const i="wss://conversational-ai-service-923169850574.southamerica-east1.run.app",s=crypto.randomUUID(),o=`${i}/ws/chat/${s}/${t.ticket_id}`;this.ws=new WebSocket(o),this.ws.binaryType="arraybuffer",this.ws.onopen=()=>{console.log("AI session connected."),!this.introSent&&this.ws&&this.ws.readyState===WebSocket.OPEN&&(this.introSent=!0,this.ws.send(JSON.stringify({cv_alert:`Measurement process started! The user speaks ${this.localeCode}.`})))},this.ws.onmessage=r=>{if(r.data instanceof ArrayBuffer){this.audioManager.queueAudio(r.data);return}try{const d=JSON.parse(r.data);switch(d.type){case"user":break;case"gemini":break;case"interrupted":this.audioManager.clearPlaybackQueue();break;case"error":console.error("AI session error:",d.error);break;case"turn_complete":this.handleTurnComplete();break}}catch(d){console.error("Error parsing WS message:",d)}},this.ws.onclose=r=>{r.code===4003&&console.error("Ticket was invalid or expired"),console.log("AI session disconnected.")},this.ws.onerror=r=>{console.error("AI Session WebSocket Error:",r)}}catch(e){console.error("Failed to connect to AI session:",e)}}handleTurnComplete(){if(!this.introComplete){this.audioManager.onQueueDrained=()=>{this.audioManager.onQueueDrained=void 0,this.introComplete=!0,console.log("AI introduction audio finished. CV errors now enabled.")},this.audioManager.isPlaybackActive||(this.audioManager.onQueueDrained=void 0,this.introComplete=!0,console.log("AI introduction complete (no audio). CV errors now enabled."));return}if(this.measurementComplete){this.audioManager.onQueueDrained=()=>{this.audioManager.onQueueDrained=void 0,console.log("AI goodbye audio finished. Disconnecting session."),this.onTurnComplete&&this.onTurnComplete(),this.disconnect()},this.audioManager.isPlaybackActive||(this.audioManager.onQueueDrained=void 0,console.log("AI goodbye complete (no audio). Disconnecting session."),this.onTurnComplete&&this.onTurnComplete(),this.disconnect());return}}startMicrophone(){this.measurementComplete||(this.audioManager.initPlayback(),this.audioManager.startMicrophone(e=>{this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(e)}))}forwardCvError(e){if(!this.introComplete||this.measurementComplete||this.audioManager.isUserSpeaking)return;const t=Date.now(),i=e===this.lastCvError,s=t-this.lastCvErrorTime<oe.CV_ERROR_THROTTLE_MS;i&&s||(this.lastCvError=e,this.lastCvErrorTime=t,this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({cv_alert:e})))}notifySuccess(e,t=""){this.measurementComplete=!0,this.audioManager.clearPlaybackQueue(),console.log("Sending success message to AI session",e,t),this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({cv_alert:`SYSTEM ALERT: Measurement is complete! Recommended size: ${e}. ${t?`Extra context: ${t}. `:""}INSTRUCTION: Embody your persona! Enthusiastically reveal their size, offer a quick fashion compliment, and gracefully say goodbye.`}))}disconnect(){this.isDisconnected=!0,this.audioManager.stopAll(),this.ws&&(this.ws.close(1e3,"Measurement complete"),this.ws=null)}};oe.CV_ERROR_THROTTLE_MS=6e3;let xe=oe;var Wt=Object.defineProperty,Kt=Object.getOwnPropertyDescriptor,u=(a,e,t,i)=>{for(var s=i>1?void 0:i?Kt(e,t):e,o=a.length-1,r;o>=0;o--)(r=a[o])&&(s=(i?r(e,t,s):r(s))||s);return i&&s&&Wt(e,t,s),s};const{getLocale:Xt,setLocale:we}=Lt({sourceLocale:Ye,targetLocales:Ot,loadLocale:a=>V(Object.assign({"./generated/locales/es-MX.ts":()=>Promise.resolve().then(()=>Jt),"./generated/locales/pt-BR.ts":()=>Promise.resolve().then(()=>ti)}),`./generated/locales/${a}.ts`,4)});c.BodyMeasurer=class extends v{constructor(){super(...arguments),this.spinnerFrame=0,this.apiKey="",this.tenantId="1",this.productSku="123456",this.baseUrl="https://xactsize-dotnet-api-923169850574.southamerica-east1.run.app",this.apiUrl=this.baseUrl+"/api/measurer/measure/body",this.vtonUrl=this.baseUrl+"/api/VirtualTryOn/generate",this.garmentUrl="",this.vton=!1,this.brandName=void 0,this.buttonText="",this._culture="pt-BR",this.measurerKey="",this._isLocaleLoading=!1,this.showModal=!1,this.step=1,this.height=0,this.recommendedSize="",this.measurements={},this.errorMessage="",this.instructionMessage=n("Position yourself in front of the camera"),this.shouldStartMeasurement=!1,this.isLoading=!1,this.isFetching=!1,this.generatedImageUrl="",this.isVtonFetching=!1,this.vtonError=!1,this.videoElement=null,this.stream=null,this.poolingTimeout=null,this.instructionMessageTimeout=null,this.aiSession=null,this.sessionActive=!1,this.cameras=[],this.currentCameraId=null,this.snowflakesCache=null}firstUpdated(){this.startSpinnerAnimation()}startSpinnerAnimation(){const e=[Yt,qt,We];this.spinnerInterval=setInterval(()=>{var i;const t=(i=this.shadowRoot)==null?void 0:i.querySelector(".spinner");t&&(t.src=e[this.spinnerFrame],this.spinnerFrame=(this.spinnerFrame+1)%e.length)},300)}get culture(){return this._culture}set culture(e){const t=this._culture;this._culture=e,this.requestUpdate("culture",t),this._applyLocale(e).catch(console.error)}async _applyLocale(e){try{this._isLocaleLoading=!0,this.requestUpdate(),await we(e)}catch(t){console.error("Failed to load locale",e,t),await we(Ye)}finally{this._isLocaleLoading=!1,this.requestUpdate()}}get errorMap(){return{ERR_RIGHT_ARM_TOO_HIGH:n("Lower your right arm",{id:"ERR_RIGHT_ARM_TOO_HIGH"}),ERR_LEFT_ARM_TOO_HIGH:n("Lower your left arm",{id:"ERR_LEFT_ARM_TOO_HIGH"}),ERR_ARMS_NOT_RAISED:n("Raise both arms to a 45-degree angle",{id:"ERR_ARMS_NOT_RAISED"}),ERR_RIGHT_ARM_NOT_RAISED:n("Raise your right arm to a 45-degree angle",{id:"ERR_RIGHT_ARM_NOT_RAISED"}),ERR_LEFT_ARM_NOT_RAISED:n("Raise your left arm to a 45-degree angle",{id:"ERR_LEFT_ARM_NOT_RAISED"}),ERR_BODY_LANDMARKS_NOT_DETECTED:n("Ensure your full body is visible in the camera",{id:"ERR_BODY_LANDMARKS_NOT_DETECTED"}),ERR_HIPS_NOT_VISIBLE:n("Adjust your position to show your hips",{id:"ERR_HIPS_NOT_VISIBLE"}),ERR_TOO_CLOSE_TO_CAMERA:n("Step back from the camera",{id:"ERR_TOO_CLOSE_TO_CAMERA"}),ERR_NOT_SIDE_VIEW:n("Turn to show your side profile",{id:"ERR_NOT_SIDE_VIEW"}),ERR_INVALID_CLOTHING_TYPE:n("This clothing type is not supported; please contact support",{id:"ERR_INVALID_CLOTHING_TYPE"}),ERR_UPPER_BODY_NOT_VISIBLE:n("Adjust your position to show your upper body",{id:"ERR_UPPER_BODY_NOT_VISIBLE"}),ERR_HEAD_TOO_CLOSE_TO_EDGE:n("Move your head away from the edge of the frame",{id:"ERR_HEAD_TOO_CLOSE_TO_EDGE"}),ERR_LOWER_BODY_NOT_VISIBLE:n("Adjust your position to show your lower body",{id:"ERR_LOWER_BODY_NOT_VISIBLE"}),ERR_FEET_TOO_CLOSE_TO_EDGE:n("Move your feet away from the edge of the frame",{id:"ERR_FEET_TOO_CLOSE_TO_EDGE"}),ERR_BODY_TOO_CLOSE_TO_EDGE:n("Move your body away from the edge of the frame",{id:"ERR_BODY_TOO_CLOSE_TO_EDGE"}),ERR_BODY_TOO_CLOSE_TO_EDGE_MOVE_LEFT:n("Move to the left to center your body",{id:"ERR_BODY_TOO_CLOSE_TO_EDGE_MOVE_LEFT"}),ERR_BODY_TOO_CLOSE_TO_EDGE_MOVE_RIGHT:n("Move to the right to center your body",{id:"ERR_BODY_TOO_CLOSE_TO_EDGE_MOVE_RIGHT"}),ERR_SHOULDERS_NOT_VISIBLE:n("Adjust your position to show your shoulders",{id:"ERR_SHOULDERS_NOT_VISIBLE"}),ERR_HEIGHT_MEASUREMENT_FAILED:n("Stand straight and ensure your full body is visible",{id:"ERR_HEIGHT_MEASUREMENT_FAILED"}),ERR_HEAD_POINT_NOT_DETECTED:n("Ensure your head is fully visible in the frame",{id:"ERR_HEAD_POINT_NOT_DETECTED"}),ERR_INCORRECT_POSTURE:n("Stand straight with your shoulders back",{id:"ERR_INCORRECT_POSTURE"}),ERR_HEM_MEASUREMENT_FAILED:n("Ensure your clothing hem is visible and clear",{id:"ERR_HEM_MEASUREMENT_FAILED"}),ERR_SHOULDER_MEASUREMENT_FAILED:n("Keep your shoulders relaxed and visible",{id:"ERR_SHOULDER_MEASUREMENT_FAILED"}),ERR_ARM_NOT_STRETCHED:n("Stretch your arms fully",{id:"ERR_ARM_NOT_STRETCHED"}),ERR_LEGS_NOT_DETECTED:n("Ensure your legs are fully visible in the frame",{id:"ERR_LEGS_NOT_DETECTED"}),ERR_HIPS_MEASUREMENT_FAILED:n("Stand straight and ensure your hips are visible",{id:"ERR_HIPS_MEASUREMENT_FAILED"}),ERR_WAIST_MEASUREMENT_FAILED:n("Stand straight and ensure your waist is visible",{id:"ERR_WAIST_MEASUREMENT_FAILED"}),ERR_INVALID_MEASURE_SIDE_VIEW:n("Turn to show a clear side profile",{id:"ERR_INVALID_MEASURE_SIDE_VIEW"}),ERR_INVALID_BODY_HEIGHT_TYPE:n("Ensure your full body is visible for height measurement",{id:"ERR_INVALID_BODY_HEIGHT_TYPE"}),ERR_IMAGE_LOAD_FAILED:n("Try again later; the image could not be processed",{id:"ERR_IMAGE_LOAD_FAILED"}),ERR_HEIGHT_INVALID:n("Height must be between 50 and 300 cm",{id:"ERR_HEIGHT_INVALID"})}}getTranslatedMessage(e){const t=this.errorMap[e];return t||(console.info("Error code is missing",e),n("An unexpected error occurred"))}trackAnalytics(e,t={}){if(!(!this.baseUrl||!this.tenantId))try{const i={tenantId:this.tenantId,timestamp:new Date().toISOString(),...t};fetch(`${this.baseUrl}/api/analytics${e}`,{method:"POST",headers:{"Content-Type":"application/json",...this.apiKey?{"X-API-Key":this.apiKey}:{}},body:JSON.stringify(i),keepalive:!0}).catch(s=>console.error("Analytics fetch error:",s))}catch(i){console.error("Analytics error:",i)}}connectedCallback(){super.connectedCallback(),console.log("New code loaded Jan 27 11:57am"),document.addEventListener("keydown",this.handleEscKey.bind(this)),this.snowflakesCache=this.generateSnowflakes()}disconnectedCallback(){var e;super.disconnectedCallback(),document.removeEventListener("keydown",this.handleEscKey.bind(this)),this.stopPolling(),clearInterval(this.spinnerInterval),(e=this.aiSession)==null||e.disconnect(),this.sessionActive&&(this.trackAnalytics("/session-ended"),this.sessionActive=!1)}handleEscKey(e){e.key==="Escape"&&this.showModal&&this.closeModal()}openModal(){this.trackAnalytics("/click"),this.showModal=!0,this.step=1,this.height=0,this.instructionMessage=n("Position yourself in front of the camera")}closeModal(){var e;this.step===4&&this.trackAnalytics("/measurement-declined",{sku:this.productSku,measurementData:JSON.stringify(this.measurements)}),this.showModal=!1,this.onMeasurementCanceled&&typeof this.onMeasurementCanceled=="function"&&this.onMeasurementCanceled(),this.stopPolling(),(e=this.aiSession)==null||e.disconnect(),this.dispatchEvent(new CustomEvent("measurementCanceled",{detail:{}})),this.sessionActive&&(this.trackAnalytics("/session-ended"),this.sessionActive=!1)}handleDialogClose(){this.showModal&&this.closeModal()}async step2advancement(){if(this.height<50||this.height>300){this.errorMessage=this.getTranslatedMessage("ERR_HEIGHT_INVALID");return}this.step=3,this.errorMessage=""}async startMeasurement(){this.step=3,this.errorMessage="",this.shouldStartMeasurement=!0,this.sessionActive=!0,this.trackAnalytics("/session-started")}updated(e){var t;if(super.updated(e),e.has("step")&&this.step===3&&this.shouldStartMeasurement&&(this.initializeMeasurement(),this.shouldStartMeasurement=!1),e.has("showModal")){const i=(t=this.shadowRoot)==null?void 0:t.getElementById("measurer-dialog");i&&(this.showModal&&!i.open?i.showModal():!this.showModal&&i.open&&i.close())}}async initializeMeasurement(){if(!this.apiKey)throw new Error("API key is required");if(!this.tenantId)throw new Error("Tenant ID is required");if(!this.productSku)throw new Error("Product SKU is required");if(!this.baseUrl)throw new Error("Base URL is required");if(!this.apiUrl)throw new Error("API URL is required");if(!this.vtonUrl)throw new Error("VTON URL is required");this.videoElement=this.shadowRoot.querySelector("video");try{this.stream=await navigator.mediaDevices.getUserMedia({video:!0}),this.videoElement&&(this.videoElement.srcObject=this.stream,await this.videoElement.play(),await this.loadCameras(),this.aiSession=new xe(this.baseUrl,this.apiKey,this.culture),await this.aiSession.connect(),this.aiSession.startMicrophone(),this.startPolling())}catch{this.errorMessage=n("Error accessing webcam")}}async loadCameras(){try{const e=await navigator.mediaDevices.enumerateDevices();this.cameras=e.filter(t=>t.kind==="videoinput"),this.cameras.length>0&&(this.currentCameraId=this.cameras[0].deviceId)}catch(e){console.error("Error enumerating devices:",e)}}async flipCamera(){if(this.cameras.length<2)return;this.isLoading=!0,this.stopPolling();const t=(this.cameras.findIndex(i=>i.deviceId===this.currentCameraId)+1)%this.cameras.length;this.currentCameraId=this.cameras[t].deviceId;try{this.stream&&this.stream.getTracks().forEach(i=>i.stop()),this.stream=await navigator.mediaDevices.getUserMedia({video:{deviceId:{exact:this.currentCameraId}}}),this.videoElement&&(this.videoElement.srcObject=this.stream,await this.videoElement.play(),this.startPolling())}catch{this.errorMessage=n("Error switching camera")}finally{this.isLoading=!1}}async startPolling(){const t=[],i=async()=>{var f;if(!this.videoElement||!this.stream||this.isFetching)return;const s=document.createElement("canvas");s.width=this.videoElement.videoWidth,s.height=this.videoElement.videoHeight;const o=s.getContext("2d");o==null||o.drawImage(this.videoElement,0,0,s.width,s.height);const r=await new Promise(m=>s.toBlob(h=>m(h),"image/jpeg")),d=new File([r],"frame.jpg",{type:"image/jpeg"}),l=new FormData;l.append("image",d),l.append("height",this.height.toString()),l.append("productSku",this.productSku),this.measurerKey&&l.append("measurerKey",this.measurerKey);try{this.isFetching=!0,this.isLoading=!0,this.poolingTimeout&&clearTimeout(this.poolingTimeout),this.instructionMessageTimeout&&clearTimeout(this.instructionMessageTimeout);const h=await(await fetch(this.apiUrl,{method:"POST",body:l,headers:{Accept:"application/json","Cache-Control":"no-store",Pragma:"no-cache","X-Api-Key":this.apiKey}})).json();if(this.isFetching=!1,this.isLoading=!1,h.success&&h.chosenSize){this.generateVtonImage(d),t.push(h);const b=t.length;this.instructionMessage=n(ge`Scanning... ${b}/${3}`),b>=3?(this.processFinalResults(t),this.stopPolling(),this.step=4):this.poolingTimeout=setTimeout(i,500)}else this.instructionMessage=this.getTranslatedMessage(h.message||"UNKNOWN_ERROR"),h.message&&((f=this.aiSession)==null||f.forwardCvError(this.instructionMessage)),this.instructionMessageTimeout=setTimeout(()=>{t.length<3&&(this.poolingTimeout=setTimeout(i,0))},2e3)}catch{this.isFetching=!1,this.isLoading=!1,this.instructionMessage=n("Error processing measurement"),this.instructionMessageTimeout=setTimeout(()=>{this.poolingTimeout=setTimeout(i,0)},2e3)}};i()}async generateVtonImage(e){if(!this.vton||!this.garmentUrl||this.isVtonFetching||this.generatedImageUrl)return;this.isVtonFetching=!0,this.vtonError=!1;const t=new FormData;t.append("PersonImage",e),t.append("GarmentUrl",this.garmentUrl);try{const s=await(await fetch(this.vtonUrl,{method:"POST",body:t,headers:{Accept:"application/json","X-Api-Key":this.apiKey}})).json();s.result_urls&&s.result_urls.length>0?(this.generatedImageUrl=s.result_urls[0],this.isVtonFetching=!1):(this.vtonError=!0,this.isVtonFetching=!1)}catch(i){console.error("Error generating VTON image",i),this.vtonError=!0,this.isVtonFetching=!1}}processFinalResults(e){console.group("Scan Debug Report"),console.log(`✅ Collected ${e.length} successful scans.`),e.forEach((d,l)=>{console.log(`Scan #${l+1}: Size [${d.chosenSize}] | Chest: ${d.measurements.chest} | Waist: ${d.measurements.waist}`)});const t={};Object.keys(e[0].measurements||{}).forEach(d=>{let l=0,f=0;e.forEach(m=>{const h=m.measurements[d];typeof h=="number"&&(l+=h,f++)}),t[d]=f>0?Math.round(l/f*100)/100:0}),console.log("📏 Final Averaged Measurements:",t);const s={};e.forEach(d=>{const l=d.chosenSize;l&&(s[l]=(s[l]||0)+1)}),console.log("🗳️ Voting Results:",s);let o="",r=0;for(const[d,l]of Object.entries(s))l>r&&(r=l,o=d);if(console.log(`🏆 WINNER: ${o}`),console.groupEnd(),this.measurements=t,this.recommendedSize=o,this.instructionMessage=n("Measurement successful!"),this.trackAnalytics("/session-completed"),this.sessionActive&&(this.trackAnalytics("/session-ended"),this.sessionActive=!1),this.aiSession){this.aiSession.onTurnComplete=()=>{this.aiSession=null};let d="";this.vton&&(this.isVtonFetching?d="An image of the user wearing the garment is currently being generated. TELL USER THEIR IMAGE IS GENERATING.":this.generatedImageUrl&&(d="The image has successfully generated. TELL USER: 'Here is your image in the garment'.")),this.aiSession.notifySuccess(o,d)}}stopPolling(){this.poolingTimeout!==null&&(clearTimeout(this.poolingTimeout),this.poolingTimeout=null),this.instructionMessageTimeout!==null&&(clearTimeout(this.instructionMessageTimeout),this.instructionMessageTimeout=null),this.stream&&(this.stream.getTracks().forEach(e=>e.stop()),this.stream=null)}acceptMeasurement(){var e;this.trackAnalytics("/measurement-accepted",{sku:this.productSku,measurementData:JSON.stringify(this.measurements)}),this.dispatchEvent(new CustomEvent("measurementAccepted",{detail:{size:this.recommendedSize}})),this.onMeasurementAccepted&&typeof this.onMeasurementAccepted=="function"&&this.onMeasurementAccepted(),this.showModal=!1,this.stopPolling(),(e=this.aiSession)==null||e.disconnect(),this.aiSession=null}resetMeasurement(){var e;this.step===4&&this.trackAnalytics("/measurement-declined",{sku:this.productSku,measurementData:JSON.stringify(this.measurements)}),this.step=1,this.height=0,this.recommendedSize="",this.measurements={},this.generatedImageUrl="",this.isVtonFetching=!1,this.vtonError=!1,this.stopPolling(),(e=this.aiSession)==null||e.disconnect(),this.aiSession=null}stopMeasurement(){this.resetMeasurement(),this.showModal=!1}generateSnowflakes(){const e=[];for(let i=0;i<80;i++){const s=Math.random()*100,o=8+Math.random()*17,r=-Math.random()*30;e.push(g`<span
|
|
1004
|
+
`,Ce([p({type:Number})],X.prototype,"height",2),Ce([p({type:Function})],X.prototype,"onStep2advancement",2),X=Ce([N("xact-step-informs"),W()],X);const We="data:image/svg+xml,%3csvg%20width='22'%20height='40'%20viewBox='0%200%2022%2040'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M21.517%200L0%2013.3362V0H21.517Z'%20fill='white'/%3e%3cpath%20d='M21.517%2013.339L0%2026.6724V13.3362H21.517V13.339Z'%20fill='white'/%3e%3cpath%20d='M21.517%2026.6755L0%2040.0089V26.6726H21.517V26.6755Z'%20fill='%231C28BA'/%3e%3c/svg%3e",qt="data:image/svg+xml,%3csvg%20width='22'%20height='41'%20viewBox='0%200%2022%2041'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M21.517%200.00878906L0%2013.345V0.00878906H21.517Z'%20fill='white'/%3e%3cpath%20d='M21.517%2013.3478L0%2026.6812V13.345H21.517V13.3478Z'%20fill='%231C28BA'/%3e%3cpath%20d='M21.517%2026.6843L0%2040.0176V26.6814H21.517V26.6843Z'%20fill='white'/%3e%3c/svg%3e",Yt="data:image/svg+xml,%3csvg%20width='22'%20height='41'%20viewBox='0%200%2022%2041'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M21.517%200.0204381L0%2013.3538V0.0175781H21.517V0.0204381Z'%20fill='%231C28BA'/%3e%3cpath%20d='M21.517%2013.3538L0%2026.69V13.3538H21.517Z'%20fill='white'/%3e%3cpath%20d='M21.517%2026.693L0%2040.0264V26.6902H21.517V26.693Z'%20fill='white'/%3e%3c/svg%3e",V=class V{constructor(){this.audioContext=null,this.playbackCtx=null,this.stream=null,this.processor=null,this.source=null,this.audioPlaybackQueue=[],this.isPlaying=!1,this.isUserSpeaking=!1,this.speechTimeout=null}get isPlaybackActive(){return this.isPlaying||this.audioPlaybackQueue.length>0}async startMicrophone(e){try{this.stream=await navigator.mediaDevices.getUserMedia({audio:{sampleRate:16e3,channelCount:1,echoCancellation:!0}}),this.audioContext=new AudioContext({sampleRate:16e3}),this.source=this.audioContext.createMediaStreamSource(this.stream),this.processor=this.audioContext.createScriptProcessor(4096,1,1),this.processor.onaudioprocess=t=>{const i=t.inputBuffer.getChannelData(0);let s=0;for(let d=0;d<i.length;d++)s+=i[d]*i[d];Math.sqrt(s/i.length)>V.SPEECH_THRESHOLD&&(this.isUserSpeaking=!0,this.speechTimeout&&clearTimeout(this.speechTimeout),this.speechTimeout=window.setTimeout(()=>{this.isUserSpeaking=!1},V.SPEECH_HOLD_TIME));const r=this.float32ToInt16(i);e(r.buffer)},this.source.connect(this.processor),this.processor.connect(this.audioContext.destination)}catch(t){console.error("Microphone access denied or error:",t)}}float32ToInt16(e){const t=new Int16Array(e.length);for(let i=0;i<e.length;i++){const s=Math.max(-1,Math.min(1,e[i]));t[i]=s<0?s*32768:s*32767}return t}initPlayback(){this.playbackCtx||(this.playbackCtx=new AudioContext({sampleRate:24e3}))}queueAudio(e){this.audioPlaybackQueue.push(e),this.playNextChunk()}playNextChunk(){if(this.isPlaying||this.audioPlaybackQueue.length===0)return;this.initPlayback();const e=this.audioPlaybackQueue.shift();this.isPlaying=!0;const t=new Int16Array(e),i=new Float32Array(t.length);for(let r=0;r<t.length;r++)i[r]=t[r]/32767;const s=this.playbackCtx.createBuffer(1,i.length,24e3);s.copyToChannel(i,0);const o=this.playbackCtx.createBufferSource();o.buffer=s,o.connect(this.playbackCtx.destination),o.onended=()=>{this.isPlaying=!1,this.audioPlaybackQueue.length===0&&this.onQueueDrained&&this.onQueueDrained(),this.playNextChunk()},o.start()}clearPlaybackQueue(){this.audioPlaybackQueue=[]}stopAll(){this.clearPlaybackQueue(),this.processor&&this.source&&(this.processor.disconnect(),this.source.disconnect()),this.stream&&(this.stream.getTracks().forEach(e=>e.stop()),this.stream=null),this.audioContext&&(this.audioContext.close(),this.audioContext=null),this.playbackCtx&&(this.playbackCtx.close(),this.playbackCtx=null)}};V.SPEECH_THRESHOLD=.02,V.SPEECH_HOLD_TIME=1500;let ve=V;const x=class x{constructor(e,t,i="en"){this.ws=null,this.introSent=!1,this.introComplete=!1,this.lastCvError="",this.lastCvErrorTime=0,this.measurementComplete=!1,this.isDisconnected=!1,this.apiUrl=e,this.apiKey=t,this.localeCode=i,this.audioManager=new ve}async connect(){try{const e=await fetch(`${this.apiUrl}/api/ConversationalAI/ticket`,{method:"POST",headers:{"Content-Type":"application/json","X-Api-Key":this.apiKey}});if(this.isDisconnected){console.log("AI session was disconnected before ticket response.");return}if(!e.ok){console.error("Failed to get ticket",e.statusText);return}const t=await e.json();if(!t||!t.ticket_id){console.error("Invalid ticket response");return}if(this.isDisconnected){console.log("AI session was disconnected before websocket could be opened.");return}const i="wss://conversational-ai-service-923169850574.southamerica-east1.run.app",s=crypto.randomUUID(),o=`${i}/ws/chat/${s}/${t.ticket_id}`;this.ws=new WebSocket(o),this.ws.binaryType="arraybuffer",this.ws.onopen=()=>{if(console.log("AI session connected."),!this.introSent&&this.ws&&this.ws.readyState===WebSocket.OPEN){this.introSent=!0;const r=this.getStoredUserName();r&&(this.ws.send(JSON.stringify({system_alert:`The user's name is ${r}. Do not ask for their name.`})),console.log("Sent existing user name to AI:",r)),this.ws.send(JSON.stringify({cv_alert:`Measurement process started! The user speaks ${this.localeCode}.`}))}},this.ws.onmessage=r=>{if(r.data instanceof ArrayBuffer){this.audioManager.queueAudio(r.data);return}try{const d=JSON.parse(r.data);switch(d.type){case"user":break;case"gemini":break;case"interrupted":this.audioManager.clearPlaybackQueue();break;case"error":console.error("AI session error:",d.error);break;case"turn_complete":this.handleTurnComplete();break;case"extract_user_name":this.handleNameExtracted(d.name);break}}catch(d){console.error("Error parsing WS message:",d)}},this.ws.onclose=r=>{r.code===4003&&console.error("Ticket was invalid or expired"),console.log("AI session disconnected.")},this.ws.onerror=r=>{console.error("AI Session WebSocket Error:",r)}}catch(e){console.error("Failed to connect to AI session:",e)}}handleTurnComplete(){if(!this.introComplete){this.audioManager.onQueueDrained=()=>{this.audioManager.onQueueDrained=void 0,this.introComplete=!0,console.log("AI introduction audio finished. CV errors now enabled.")},this.audioManager.isPlaybackActive||(this.audioManager.onQueueDrained=void 0,this.introComplete=!0,console.log("AI introduction complete (no audio). CV errors now enabled."));return}if(this.measurementComplete){this.audioManager.onQueueDrained=()=>{this.audioManager.onQueueDrained=void 0,console.log("AI goodbye audio finished. Disconnecting session."),this.onTurnComplete&&this.onTurnComplete(),this.disconnect()},this.audioManager.isPlaybackActive||(this.audioManager.onQueueDrained=void 0,console.log("AI goodbye complete (no audio). Disconnecting session."),this.onTurnComplete&&this.onTurnComplete(),this.disconnect());return}}startMicrophone(){this.measurementComplete||(this.audioManager.initPlayback(),this.audioManager.startMicrophone(e=>{this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(e)}))}forwardCvError(e){if(!this.introComplete||this.measurementComplete||this.audioManager.isUserSpeaking)return;const t=Date.now(),i=e===this.lastCvError,s=t-this.lastCvErrorTime<x.CV_ERROR_THROTTLE_MS;i&&s||(this.lastCvError=e,this.lastCvErrorTime=t,this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({cv_alert:e})))}notifySuccess(e,t=""){this.measurementComplete=!0,this.audioManager.clearPlaybackQueue(),console.log("Sending success message to AI session",e,t),this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({cv_alert:`SYSTEM ALERT: Measurement is complete! Recommended size: ${e}. ${t?`Extra context: ${t}. `:""}INSTRUCTION: Embody your persona! Enthusiastically reveal their size, offer a quick fashion compliment, and gracefully say goodbye.`}))}handleNameExtracted(e){if(e){console.log("AI extracted user name:",e),this.setUserNameCookie(e);try{localStorage.setItem(x.USER_NAME_STORAGE_KEY,e)}catch{}this.onNameExtracted&&this.onNameExtracted(e)}}getStoredUserName(){try{const t=localStorage.getItem(x.USER_NAME_STORAGE_KEY);if(t)return t}catch{}const e=document.cookie.split("; ").find(t=>t.startsWith(x.USER_NAME_COOKIE+"="));return e?decodeURIComponent(e.split("=")[1]):null}setUserNameCookie(e){const i=new Date;i.setTime(i.getTime()+30*24*60*60*1e3),document.cookie=`${x.USER_NAME_COOKIE}=${encodeURIComponent(e)};expires=${i.toUTCString()};path=/`}disconnect(){this.isDisconnected=!0,this.audioManager.stopAll(),this.ws&&(this.ws.close(1e3,"Measurement complete"),this.ws=null)}};x.CV_ERROR_THROTTLE_MS=6e3,x.USER_NAME_COOKIE="xactsize_userName",x.USER_NAME_STORAGE_KEY="xactsize_userName";let xe=x;var Wt=Object.defineProperty,Kt=Object.getOwnPropertyDescriptor,u=(a,e,t,i)=>{for(var s=i>1?void 0:i?Kt(e,t):e,o=a.length-1,r;o>=0;o--)(r=a[o])&&(s=(i?r(e,t,s):r(s))||s);return i&&s&&Wt(e,t,s),s};const{getLocale:Xt,setLocale:we}=Lt({sourceLocale:Ye,targetLocales:$t,loadLocale:a=>B(Object.assign({"./generated/locales/es-MX.ts":()=>Promise.resolve().then(()=>Jt),"./generated/locales/pt-BR.ts":()=>Promise.resolve().then(()=>ti)}),`./generated/locales/${a}.ts`,4)});c.BodyMeasurer=class extends C{constructor(){super(...arguments),this.spinnerFrame=0,this.apiKey="",this.tenantId="1",this.productSku="123456",this.baseUrl="https://xactsize-dotnet-api-923169850574.southamerica-east1.run.app",this.apiUrl=this.baseUrl+"/api/measurer/measure/body",this.vtonUrl=this.baseUrl+"/api/VirtualTryOn/generate",this.garmentUrl="",this.vton=!1,this.brandName=void 0,this.buttonText="",this._culture="pt-BR",this.measurerKey="",this._isLocaleLoading=!1,this.showModal=!1,this.step=1,this.height=0,this.recommendedSize="",this.measurements={},this.errorMessage="",this.instructionMessage=n("Position yourself in front of the camera"),this.shouldStartMeasurement=!1,this.isLoading=!1,this.isFetching=!1,this.generatedImageUrl="",this.isVtonFetching=!1,this.vtonError=!1,this.videoElement=null,this.stream=null,this.poolingTimeout=null,this.instructionMessageTimeout=null,this.aiSession=null,this.sessionActive=!1,this.cameras=[],this.currentCameraId=null,this.snowflakesCache=null}firstUpdated(){this.startSpinnerAnimation()}startSpinnerAnimation(){const e=[Yt,qt,We];this.spinnerInterval=setInterval(()=>{var i;const t=(i=this.shadowRoot)==null?void 0:i.querySelector(".spinner");t&&(t.src=e[this.spinnerFrame],this.spinnerFrame=(this.spinnerFrame+1)%e.length)},300)}get culture(){return this._culture}set culture(e){const t=this._culture;this._culture=e,this.requestUpdate("culture",t),this._applyLocale(e).catch(console.error)}async _applyLocale(e){try{this._isLocaleLoading=!0,this.requestUpdate(),await we(e)}catch(t){console.error("Failed to load locale",e,t),await we(Ye)}finally{this._isLocaleLoading=!1,this.requestUpdate()}}get errorMap(){return{ERR_RIGHT_ARM_TOO_HIGH:n("Lower your right arm",{id:"ERR_RIGHT_ARM_TOO_HIGH"}),ERR_LEFT_ARM_TOO_HIGH:n("Lower your left arm",{id:"ERR_LEFT_ARM_TOO_HIGH"}),ERR_ARMS_NOT_RAISED:n("Raise both arms to a 45-degree angle",{id:"ERR_ARMS_NOT_RAISED"}),ERR_RIGHT_ARM_NOT_RAISED:n("Raise your right arm to a 45-degree angle",{id:"ERR_RIGHT_ARM_NOT_RAISED"}),ERR_LEFT_ARM_NOT_RAISED:n("Raise your left arm to a 45-degree angle",{id:"ERR_LEFT_ARM_NOT_RAISED"}),ERR_BODY_LANDMARKS_NOT_DETECTED:n("Ensure your full body is visible in the camera",{id:"ERR_BODY_LANDMARKS_NOT_DETECTED"}),ERR_HIPS_NOT_VISIBLE:n("Adjust your position to show your hips",{id:"ERR_HIPS_NOT_VISIBLE"}),ERR_TOO_CLOSE_TO_CAMERA:n("Step back from the camera",{id:"ERR_TOO_CLOSE_TO_CAMERA"}),ERR_NOT_SIDE_VIEW:n("Turn to show your side profile",{id:"ERR_NOT_SIDE_VIEW"}),ERR_INVALID_CLOTHING_TYPE:n("This clothing type is not supported; please contact support",{id:"ERR_INVALID_CLOTHING_TYPE"}),ERR_UPPER_BODY_NOT_VISIBLE:n("Adjust your position to show your upper body",{id:"ERR_UPPER_BODY_NOT_VISIBLE"}),ERR_HEAD_TOO_CLOSE_TO_EDGE:n("Move your head away from the edge of the frame",{id:"ERR_HEAD_TOO_CLOSE_TO_EDGE"}),ERR_LOWER_BODY_NOT_VISIBLE:n("Adjust your position to show your lower body",{id:"ERR_LOWER_BODY_NOT_VISIBLE"}),ERR_FEET_TOO_CLOSE_TO_EDGE:n("Move your feet away from the edge of the frame",{id:"ERR_FEET_TOO_CLOSE_TO_EDGE"}),ERR_BODY_TOO_CLOSE_TO_EDGE:n("Move your body away from the edge of the frame",{id:"ERR_BODY_TOO_CLOSE_TO_EDGE"}),ERR_BODY_TOO_CLOSE_TO_EDGE_MOVE_LEFT:n("Move to the left to center your body",{id:"ERR_BODY_TOO_CLOSE_TO_EDGE_MOVE_LEFT"}),ERR_BODY_TOO_CLOSE_TO_EDGE_MOVE_RIGHT:n("Move to the right to center your body",{id:"ERR_BODY_TOO_CLOSE_TO_EDGE_MOVE_RIGHT"}),ERR_SHOULDERS_NOT_VISIBLE:n("Adjust your position to show your shoulders",{id:"ERR_SHOULDERS_NOT_VISIBLE"}),ERR_HEIGHT_MEASUREMENT_FAILED:n("Stand straight and ensure your full body is visible",{id:"ERR_HEIGHT_MEASUREMENT_FAILED"}),ERR_HEAD_POINT_NOT_DETECTED:n("Ensure your head is fully visible in the frame",{id:"ERR_HEAD_POINT_NOT_DETECTED"}),ERR_INCORRECT_POSTURE:n("Stand straight with your shoulders back",{id:"ERR_INCORRECT_POSTURE"}),ERR_HEM_MEASUREMENT_FAILED:n("Ensure your clothing hem is visible and clear",{id:"ERR_HEM_MEASUREMENT_FAILED"}),ERR_SHOULDER_MEASUREMENT_FAILED:n("Keep your shoulders relaxed and visible",{id:"ERR_SHOULDER_MEASUREMENT_FAILED"}),ERR_ARM_NOT_STRETCHED:n("Stretch your arms fully",{id:"ERR_ARM_NOT_STRETCHED"}),ERR_LEGS_NOT_DETECTED:n("Ensure your legs are fully visible in the frame",{id:"ERR_LEGS_NOT_DETECTED"}),ERR_HIPS_MEASUREMENT_FAILED:n("Stand straight and ensure your hips are visible",{id:"ERR_HIPS_MEASUREMENT_FAILED"}),ERR_WAIST_MEASUREMENT_FAILED:n("Stand straight and ensure your waist is visible",{id:"ERR_WAIST_MEASUREMENT_FAILED"}),ERR_INVALID_MEASURE_SIDE_VIEW:n("Turn to show a clear side profile",{id:"ERR_INVALID_MEASURE_SIDE_VIEW"}),ERR_INVALID_BODY_HEIGHT_TYPE:n("Ensure your full body is visible for height measurement",{id:"ERR_INVALID_BODY_HEIGHT_TYPE"}),ERR_IMAGE_LOAD_FAILED:n("Try again later; the image could not be processed",{id:"ERR_IMAGE_LOAD_FAILED"}),ERR_HEIGHT_INVALID:n("Height must be between 50 and 300 cm",{id:"ERR_HEIGHT_INVALID"})}}getTranslatedMessage(e){const t=this.errorMap[e];return t||(console.info("Error code is missing",e),n("An unexpected error occurred"))}trackAnalytics(e,t={}){if(!(!this.baseUrl||!this.tenantId))try{const i={tenantId:this.tenantId,timestamp:new Date().toISOString(),...t};fetch(`${this.baseUrl}/api/analytics${e}`,{method:"POST",headers:{"Content-Type":"application/json",...this.apiKey?{"X-API-Key":this.apiKey}:{}},body:JSON.stringify(i),keepalive:!0}).catch(s=>console.error("Analytics fetch error:",s))}catch(i){console.error("Analytics error:",i)}}connectedCallback(){super.connectedCallback(),console.log("New code loaded Jan 27 11:57am"),document.addEventListener("keydown",this.handleEscKey.bind(this)),this.snowflakesCache=this.generateSnowflakes()}disconnectedCallback(){var e;super.disconnectedCallback(),document.removeEventListener("keydown",this.handleEscKey.bind(this)),this.stopPolling(),clearInterval(this.spinnerInterval),(e=this.aiSession)==null||e.disconnect(),this.sessionActive&&(this.trackAnalytics("/session-ended"),this.sessionActive=!1)}handleEscKey(e){e.key==="Escape"&&this.showModal&&this.closeModal()}openModal(){this.trackAnalytics("/click"),this.showModal=!0,this.step=1,this.height=0,this.instructionMessage=n("Position yourself in front of the camera")}closeModal(){var e;this.step===4&&this.trackAnalytics("/measurement-declined",{sku:this.productSku,measurementData:JSON.stringify(this.measurements)}),this.showModal=!1,this.onMeasurementCanceled&&typeof this.onMeasurementCanceled=="function"&&this.onMeasurementCanceled(),this.stopPolling(),(e=this.aiSession)==null||e.disconnect(),this.dispatchEvent(new CustomEvent("measurementCanceled",{detail:{}})),this.sessionActive&&(this.trackAnalytics("/session-ended"),this.sessionActive=!1)}handleDialogClose(){this.showModal&&this.closeModal()}async step2advancement(){if(this.height<50||this.height>300){this.errorMessage=this.getTranslatedMessage("ERR_HEIGHT_INVALID");return}this.step=3,this.errorMessage=""}async startMeasurement(){this.step=3,this.errorMessage="",this.shouldStartMeasurement=!0,this.sessionActive=!0,this.trackAnalytics("/session-started")}updated(e){var t;if(super.updated(e),e.has("step")&&this.step===3&&this.shouldStartMeasurement&&(this.initializeMeasurement(),this.shouldStartMeasurement=!1),e.has("showModal")){const i=(t=this.shadowRoot)==null?void 0:t.getElementById("measurer-dialog");i&&(this.showModal&&!i.open?i.showModal():!this.showModal&&i.open&&i.close())}}async initializeMeasurement(){if(!this.apiKey)throw new Error("API key is required");if(!this.tenantId)throw new Error("Tenant ID is required");if(!this.productSku)throw new Error("Product SKU is required");if(!this.baseUrl)throw new Error("Base URL is required");if(!this.apiUrl)throw new Error("API URL is required");if(!this.vtonUrl)throw new Error("VTON URL is required");this.videoElement=this.shadowRoot.querySelector("video");try{this.stream=await navigator.mediaDevices.getUserMedia({video:!0}),this.videoElement&&(this.videoElement.srcObject=this.stream,await this.videoElement.play(),await this.loadCameras(),this.aiSession=new xe(this.baseUrl,this.apiKey,this.culture),await this.aiSession.connect(),this.aiSession.startMicrophone(),this.startPolling())}catch{this.errorMessage=n("Error accessing webcam")}}async loadCameras(){try{const e=await navigator.mediaDevices.enumerateDevices();this.cameras=e.filter(t=>t.kind==="videoinput"),this.cameras.length>0&&(this.currentCameraId=this.cameras[0].deviceId)}catch(e){console.error("Error enumerating devices:",e)}}async flipCamera(){if(this.cameras.length<2)return;this.isLoading=!0,this.stopPolling();const t=(this.cameras.findIndex(i=>i.deviceId===this.currentCameraId)+1)%this.cameras.length;this.currentCameraId=this.cameras[t].deviceId;try{this.stream&&this.stream.getTracks().forEach(i=>i.stop()),this.stream=await navigator.mediaDevices.getUserMedia({video:{deviceId:{exact:this.currentCameraId}}}),this.videoElement&&(this.videoElement.srcObject=this.stream,await this.videoElement.play(),this.startPolling())}catch{this.errorMessage=n("Error switching camera")}finally{this.isLoading=!1}}async startPolling(){const t=[],i=async()=>{var f;if(!this.videoElement||!this.stream||this.isFetching)return;const s=document.createElement("canvas");s.width=this.videoElement.videoWidth,s.height=this.videoElement.videoHeight;const o=s.getContext("2d");o==null||o.drawImage(this.videoElement,0,0,s.width,s.height);const r=await new Promise(m=>s.toBlob(h=>m(h),"image/jpeg")),d=new File([r],"frame.jpg",{type:"image/jpeg"}),l=new FormData;l.append("image",d),l.append("height",this.height.toString()),l.append("productSku",this.productSku),this.measurerKey&&l.append("measurerKey",this.measurerKey);try{this.isFetching=!0,this.isLoading=!0,this.poolingTimeout&&clearTimeout(this.poolingTimeout),this.instructionMessageTimeout&&clearTimeout(this.instructionMessageTimeout);const h=await(await fetch(this.apiUrl,{method:"POST",body:l,headers:{Accept:"application/json","Cache-Control":"no-store",Pragma:"no-cache","X-Api-Key":this.apiKey}})).json();if(this.isFetching=!1,this.isLoading=!1,h.success&&h.chosenSize){this.generateVtonImage(d),t.push(h);const b=t.length;this.instructionMessage=n(ge`Scanning... ${b}/${3}`),b>=3?(this.processFinalResults(t),this.stopPolling(),this.step=4):this.poolingTimeout=setTimeout(i,500)}else this.instructionMessage=this.getTranslatedMessage(h.message||"UNKNOWN_ERROR"),h.message&&((f=this.aiSession)==null||f.forwardCvError(this.instructionMessage)),this.instructionMessageTimeout=setTimeout(()=>{t.length<3&&(this.poolingTimeout=setTimeout(i,0))},2e3)}catch{this.isFetching=!1,this.isLoading=!1,this.instructionMessage=n("Error processing measurement"),this.instructionMessageTimeout=setTimeout(()=>{this.poolingTimeout=setTimeout(i,0)},2e3)}};i()}async generateVtonImage(e){if(!this.vton||!this.garmentUrl||this.isVtonFetching||this.generatedImageUrl)return;this.isVtonFetching=!0,this.vtonError=!1;const t=new FormData;t.append("PersonImage",e),t.append("GarmentUrl",this.garmentUrl);try{const s=await(await fetch(this.vtonUrl,{method:"POST",body:t,headers:{Accept:"application/json","X-Api-Key":this.apiKey}})).json();s.result_urls&&s.result_urls.length>0?(this.generatedImageUrl=s.result_urls[0],this.isVtonFetching=!1):(this.vtonError=!0,this.isVtonFetching=!1)}catch(i){console.error("Error generating VTON image",i),this.vtonError=!0,this.isVtonFetching=!1}}processFinalResults(e){console.group("Scan Debug Report"),console.log(`✅ Collected ${e.length} successful scans.`),e.forEach((d,l)=>{console.log(`Scan #${l+1}: Size [${d.chosenSize}] | Chest: ${d.measurements.chest} | Waist: ${d.measurements.waist}`)});const t={};Object.keys(e[0].measurements||{}).forEach(d=>{let l=0,f=0;e.forEach(m=>{const h=m.measurements[d];typeof h=="number"&&(l+=h,f++)}),t[d]=f>0?Math.round(l/f*100)/100:0}),console.log("📏 Final Averaged Measurements:",t);const s={};e.forEach(d=>{const l=d.chosenSize;l&&(s[l]=(s[l]||0)+1)}),console.log("🗳️ Voting Results:",s);let o="",r=0;for(const[d,l]of Object.entries(s))l>r&&(r=l,o=d);if(console.log(`🏆 WINNER: ${o}`),console.groupEnd(),this.measurements=t,this.recommendedSize=o,this.instructionMessage=n("Measurement successful!"),this.trackAnalytics("/session-completed"),this.sessionActive&&(this.trackAnalytics("/session-ended"),this.sessionActive=!1),this.aiSession){this.aiSession.onTurnComplete=()=>{this.aiSession=null};let d="";this.vton&&(this.isVtonFetching?d="An image of the user wearing the garment is currently being generated. TELL USER THEIR IMAGE IS GENERATING.":this.generatedImageUrl&&(d="The image has successfully generated. TELL USER: 'Here is your image in the garment'.")),this.aiSession.notifySuccess(o,d)}}stopPolling(){this.poolingTimeout!==null&&(clearTimeout(this.poolingTimeout),this.poolingTimeout=null),this.instructionMessageTimeout!==null&&(clearTimeout(this.instructionMessageTimeout),this.instructionMessageTimeout=null),this.stream&&(this.stream.getTracks().forEach(e=>e.stop()),this.stream=null)}acceptMeasurement(){var e;this.trackAnalytics("/measurement-accepted",{sku:this.productSku,measurementData:JSON.stringify(this.measurements)}),this.dispatchEvent(new CustomEvent("measurementAccepted",{detail:{size:this.recommendedSize}})),this.onMeasurementAccepted&&typeof this.onMeasurementAccepted=="function"&&this.onMeasurementAccepted(),this.showModal=!1,this.stopPolling(),(e=this.aiSession)==null||e.disconnect(),this.aiSession=null}resetMeasurement(){var e;this.step===4&&this.trackAnalytics("/measurement-declined",{sku:this.productSku,measurementData:JSON.stringify(this.measurements)}),this.step=1,this.height=0,this.recommendedSize="",this.measurements={},this.generatedImageUrl="",this.isVtonFetching=!1,this.vtonError=!1,this.stopPolling(),(e=this.aiSession)==null||e.disconnect(),this.aiSession=null}stopMeasurement(){this.resetMeasurement(),this.showModal=!1}generateSnowflakes(){const e=[];for(let i=0;i<80;i++){const s=Math.random()*100,o=8+Math.random()*17,r=-Math.random()*30;e.push(g`<span
|
|
1005
1005
|
class="snowflake"
|
|
1006
1006
|
style="left:${s}%; animation-duration:${o.toFixed(2)}s; animation-delay:${r.toFixed(2)}s;"
|
|
1007
1007
|
></span>`)}return g`${e}`}renderSnowflakes(){return this.snowflakesCache||g``}render(){return this._isLocaleLoading?g`<div hidden></div>`:g`
|
|
@@ -1119,7 +1119,7 @@
|
|
|
1119
1119
|
</div>
|
|
1120
1120
|
</dialog>
|
|
1121
1121
|
`:""}
|
|
1122
|
-
`}},c.BodyMeasurer.styles=
|
|
1122
|
+
`}},c.BodyMeasurer.styles=D`
|
|
1123
1123
|
:host {
|
|
1124
1124
|
display: block;
|
|
1125
1125
|
font-family: Arial, sans-serif;
|
|
@@ -1677,4 +1677,4 @@
|
|
|
1677
1677
|
BlinkMacSystemFont,
|
|
1678
1678
|
sans-serif;
|
|
1679
1679
|
}
|
|
1680
|
-
`,u([p({type:String,attribute:"api-key"})],c.BodyMeasurer.prototype,"apiKey",2),u([p({type:String,attribute:"tenant-id"})],c.BodyMeasurer.prototype,"tenantId",2),u([p({type:String,attribute:"product-sku"})],c.BodyMeasurer.prototype,"productSku",2),u([p({type:String,attribute:"base-url"})],c.BodyMeasurer.prototype,"baseUrl",2),u([p({type:String,attribute:"api-url"})],c.BodyMeasurer.prototype,"apiUrl",2),u([p({type:String,attribute:"vton-url"})],c.BodyMeasurer.prototype,"vtonUrl",2),u([p({type:String,attribute:"garment-url"})],c.BodyMeasurer.prototype,"garmentUrl",2),u([p({type:Boolean,attribute:"vton"})],c.BodyMeasurer.prototype,"vton",2),u([p({type:Function,attribute:"onmeasurementaccepted"})],c.BodyMeasurer.prototype,"onMeasurementAccepted",2),u([p({type:Function,attribute:"onmeasurementcanceled"})],c.BodyMeasurer.prototype,"onMeasurementCanceled",2),u([p({type:String,attribute:"brand-name"})],c.BodyMeasurer.prototype,"brandName",2),u([p({type:String,attribute:"button-text"})],c.BodyMeasurer.prototype,"buttonText",2),u([p({type:String})],c.BodyMeasurer.prototype,"culture",1),u([E()],c.BodyMeasurer.prototype,"errorMap",1),u([E()],c.BodyMeasurer.prototype,"measurerKey",2),u([E()],c.BodyMeasurer.prototype,"_isLocaleLoading",2),u([E()],c.BodyMeasurer.prototype,"showModal",2),u([E()],c.BodyMeasurer.prototype,"step",2),u([E()],c.BodyMeasurer.prototype,"height",2),u([E()],c.BodyMeasurer.prototype,"recommendedSize",2),u([E()],c.BodyMeasurer.prototype,"measurements",2),u([E()],c.BodyMeasurer.prototype,"errorMessage",2),u([E()],c.BodyMeasurer.prototype,"instructionMessage",2),u([E()],c.BodyMeasurer.prototype,"shouldStartMeasurement",2),u([E()],c.BodyMeasurer.prototype,"isLoading",2),u([E()],c.BodyMeasurer.prototype,"isFetching",2),u([E()],c.BodyMeasurer.prototype,"generatedImageUrl",2),u([E()],c.BodyMeasurer.prototype,"isVtonFetching",2),u([E()],c.BodyMeasurer.prototype,"vtonError",2),u([E()],c.BodyMeasurer.prototype,"cameras",2),u([E()],c.BodyMeasurer.prototype,"currentCameraId",2),c.BodyMeasurer=u([P("body-measurer"),Y()],c.BodyMeasurer);const Qt={ERR_ARM_NOT_STRETCHED:"Estira tus brazos completamente",ERR_ARMS_NOT_RAISED:"Levanta ambos brazos en un ángulo de 45 grados",ERR_BODY_LANDMARKS_NOT_DETECTED:"Asegúrate de que todo tu cuerpo sea visible en la cámara",ERR_BODY_TOO_CLOSE_TO_EDGE:"Aleja tu cuerpo del borde del encuadre",ERR_BODY_TOO_CLOSE_TO_EDGE_MOVE_LEFT:"Muévete hacia la izquierda para centrar tu cuerpo",ERR_BODY_TOO_CLOSE_TO_EDGE_MOVE_RIGHT:"Muévete hacia la derecha para centrar tu cuerpo",ERR_FEET_TOO_CLOSE_TO_EDGE:"Aleja tus pies del borde del encuadre",ERR_HEAD_POINT_NOT_DETECTED:"Asegúrate de que tu cabeza sea completamente visible en el encuadre",ERR_HEAD_TOO_CLOSE_TO_EDGE:"Aleja tu cabeza del borde del encuadre",ERR_HEIGHT_INVALID:"La altura debe estar entre 50 y 300 cm",ERR_HEIGHT_MEASUREMENT_FAILED:"Párate derecho y asegúrate de que todo tu cuerpo sea visible",ERR_HEM_MEASUREMENT_FAILED:"Asegúrate de que el dobladillo de tu ropa sea visible y claro",ERR_HIPS_MEASUREMENT_FAILED:"Párate derecho y asegúrate de que tus caderas sean visibles",ERR_HIPS_NOT_VISIBLE:"Ajusta tu posición para mostrar tus caderas",ERR_IMAGE_LOAD_FAILED:"Intenta de nuevo más tarde; la imagen no se pudo procesar",ERR_INCORRECT_POSTURE:"Párate derecho con los hombros hacia atrás",ERR_INVALID_BODY_HEIGHT_TYPE:"Asegúrate de que todo tu cuerpo sea visible para medir la altura",ERR_INVALID_CLOTHING_TYPE:"Este tipo de ropa no es compatible; por favor, contacta a soporte",ERR_INVALID_MEASURE_SIDE_VIEW:"Gira para mostrar un perfil de lado claro",ERR_LEFT_ARM_NOT_RAISED:"Levante tu brazo izquierdo en un ángulo de 45 grados",ERR_LEFT_ARM_TOO_HIGH:"Baja tu brazo izquierdo",ERR_LEGS_NOT_DETECTED:"Asegúrate de que tus piernas sean completamente visibles en el encuadre",ERR_LOWER_BODY_NOT_VISIBLE:"Ajusta tu posición para mostrar la parte inferior de tu cuerpo",ERR_NOT_SIDE_VIEW:"Gira para mostrar tu perfil de lado",ERR_RIGHT_ARM_NOT_RAISED:"Levanta tu brazo derecho en un ángulo de 45 grados",ERR_RIGHT_ARM_TOO_HIGH:"Baja tu brazo derecho",ERR_SHOULDER_MEASUREMENT_FAILED:"Mantén tus hombros relajados y visibles",ERR_SHOULDERS_NOT_VISIBLE:"Ajusta tu posición para mostrar tus hombros",ERR_TOO_CLOSE_TO_CAMERA:"Aléjate de la cámara",ERR_UPPER_BODY_NOT_VISIBLE:"Ajusta tu posición para mostrar la parte superior de tu cuerpo",ERR_WAIST_MEASUREMENT_FAILED:"Párate derecho y asegúrate de que tu cintura sea visible",s08b0bc2feb4e0f1c:"Buena iluminación",s1137f6c10e0f1660:"Al usar",s1dd794b3870bcae0:"Empezar",s2f77566c78235d88:"Error al acceder a la cámara web",s322c72546e939809:"Elige un área bien iluminada donde puedas ver tu imagen claramente.",s32d5e90d7ffec075:"Usa una pared lisa",s34c58d3d12e5f890:"Error al cambiar de cámara",s396efd2b23a16ac9:"Colócate contra un fondo liso.",s3a09a6be4809cb50:"Foto de cuerpo entero",s3d324b180f982d46:"Asegúrate de que todo tu cuerpo sea visible en la cámara",s420e8053328b31c4:"Tu talla ideal",s48d094fb2ffff8fb:"Consejos",s5c91b5e06c363734:"Error al procesar la medición",s625ff027ee7b497b:"Asegúrate de que todo tu cuerpo sea visible. La aplicación te guiará.",s676cfe9f36657792:"¡Medición exitosa!",s6ad3b28b46803c43:"Aceptar sugerencia",s6cda30fe423482fd:"Generando tu imagen de probador virtual...",s76ceab13c1401897:ge`Escaneando... ${0}/${1}`,s7948656b643c5186:"Ingresa tu altura (cm)",s81d43b9b25d0775b:"Ropa",s833a6c1d27f3b409:"Haz clic aquí para voltear tu cámara",s88a3f5e6a9d9945d:"Usa la ropa que sueles ponerte a diario.",s88a7dd58c3763c51:"Encontrar Mi Talla",s8fb9f388e75ffe11:"Encuadre",s91a037763666343d:"Algo pasó mientras se generaba la imagen del probador virtual.",s952ed559991cf0b4:"Desarrollado por",sa4ad2b9cd4ea10ba:"Fondo limpio",sad8ede33ccaa8ef1:"aceptas nuestros Términos y Política de Privacidad.",sb59d68ed12d46377:"Cargando",sca9b53eeb24a5865:"Evita la luz de fondo",scf8d43c4a5cb71fa:"Para garantizar medidas precisas, tomaremos dos escaneos: uno de frente y otro de lado. Mantén una postura erguida con los brazos ligeramente separados de tu cuerpo y estirados. En la vista lateral, párate derecho con los brazos estirados y alineados con tu cuerpo.",sd13d4c82d57859fc:"Colócate frente a la cámara",sd2259f35f330b63c:"Lujo seleccionado. Ajuste perfecto.",sdabfef8968aeb5fa:"Ocurrió un error inesperado",sdde2fe5a591a828a:"¡Comencemos! →",sde0bd870399b428c:"VER IMAGEN COMPLETA",sde1f02481331134c:"Producto",sdf9f9c621b6316e7:"Medir de nuevo",se61735ca89853860:"Ropa ajustada",se940dab2e0b7a710:"Antes de comenzar",seb66e000f03f21e0:"Encontremos tu talla perfecta",sf84b5644f7595ce5:"Según tus medidas y las dimensiones exactas de la prenda, la recomendación de talla proporcionada es la más precisa para un ajuste ideal."},Jt=Object.freeze(Object.defineProperty({__proto__:null,templates:Qt},Symbol.toStringTag,{value:"Module"})),ei={ERR_ARM_NOT_STRETCHED:"Estique seus braços completamente",ERR_ARMS_NOT_RAISED:"Levante ambos os braços em um ângulo de 45 graus",ERR_BODY_LANDMARKS_NOT_DETECTED:"Certifique-se de que seu corpo inteiro esteja visível na câmera",ERR_BODY_TOO_CLOSE_TO_EDGE:"Afaste seu corpo da borda do quadro",ERR_BODY_TOO_CLOSE_TO_EDGE_MOVE_LEFT:"Mova-se para a esquerda para centralizar seu corpo",ERR_BODY_TOO_CLOSE_TO_EDGE_MOVE_RIGHT:"Mova-se para a direita para centralizar seu corpo",ERR_FEET_TOO_CLOSE_TO_EDGE:"Afaste seus pés da borda do quadro",ERR_HEAD_POINT_NOT_DETECTED:"Certifique-se de que sua cabeça esteja totalmente visível no quadro",ERR_HEAD_TOO_CLOSE_TO_EDGE:"Afaste sua cabeça da borda do quadro",ERR_HEIGHT_INVALID:"A altura deve ser entre 50 e 300cm",ERR_HEIGHT_MEASUREMENT_FAILED:"Fique ereto e certifique-se de que seu corpo inteiro esteja visível",ERR_HEM_MEASUREMENT_FAILED:"Certifique-se de que a bainha da sua roupa esteja visível e clara",ERR_HIPS_MEASUREMENT_FAILED:"Fique ereto e certifique-se de que seus quadris estejam visíveis",ERR_HIPS_NOT_VISIBLE:"Ajuste sua posição para mostrar seus quadris",ERR_IMAGE_LOAD_FAILED:"Tente novamente mais tarde; a imagem não pôde ser processada",ERR_INCORRECT_POSTURE:"Fique ereto com os ombros para trás",ERR_INVALID_BODY_HEIGHT_TYPE:"Certifique-se de que seu corpo inteiro esteja visível para a medição de altura",ERR_INVALID_CLOTHING_TYPE:"Este tipo de roupa não é suportado; entre em contato com o suporte",ERR_INVALID_MEASURE_SIDE_VIEW:"Gire para mostrar um perfil lateral claro",ERR_LEFT_ARM_NOT_RAISED:"Levante seu braço esquerdo em um ângulo de 45 graus",ERR_LEFT_ARM_TOO_HIGH:"Abaixe seu braço esquerdo",ERR_LEGS_NOT_DETECTED:"Certifique-se de que suas pernas estejam totalmente visíveis no quadro",ERR_LOWER_BODY_NOT_VISIBLE:"Ajuste sua posição para mostrar a parte inferior do corpo",ERR_NOT_SIDE_VIEW:"Gire para mostrar seu perfil lateral",ERR_RIGHT_ARM_NOT_RAISED:"Levante seu braço direito em um ângulo de 45 graus",ERR_RIGHT_ARM_TOO_HIGH:"Abaixe seu braço direito",ERR_SHOULDER_MEASUREMENT_FAILED:"Mantenha seus ombros relaxados e visíveis",ERR_SHOULDERS_NOT_VISIBLE:"Ajuste sua posição para mostrar seus ombros",ERR_TOO_CLOSE_TO_CAMERA:"Dê um passo para trás da câmera",ERR_UPPER_BODY_NOT_VISIBLE:"Ajuste sua posição para mostrar a parte superior do corpo",ERR_WAIST_MEASUREMENT_FAILED:"Fique ereto e certifique-se de que sua cintura esteja visível",s08b0bc2feb4e0f1c:"Boa iluminação",s1137f6c10e0f1660:"Ao usar a",s1dd794b3870bcae0:"Começar",s2f77566c78235d88:"Erro acessando a câmera",s322c72546e939809:"Escolha uma área bem iluminada onde você possa ver sua imagem claramente.",s32d5e90d7ffec075:"Use uma parede lisa",s34c58d3d12e5f890:"Erro ao mudar a câmera",s396efd2b23a16ac9:"Posicione-se contra um fundo simples.",s3a09a6be4809cb50:"Foto de corpo inteiro",s3d324b180f982d46:"Tenha certeza de que seu corpo está totalmente visível",s420e8053328b31c4:"Seu tamanho ideal",s48d094fb2ffff8fb:"Pontas",s5c91b5e06c363734:"Medição de processamento de erros",s625ff027ee7b497b:"Certifique-se de que todo o seu corpo esteja visível. O aplicativo guiará você.",s676cfe9f36657792:"Medição realizada com sucesso!",s6ad3b28b46803c43:"Aceitar sugestão",s6cda30fe423482fd:"Gerando sua imagem de provador virtual...",s76ceab13c1401897:ge`Escaneando... ${0}/${1}`,s7948656b643c5186:"Digite sua altura (cm)",s81d43b9b25d0775b:"Roupas",s833a6c1d27f3b409:"Clique aqui para virar sua câmera",s88a3f5e6a9d9945d:"Use roupas que você costuma usar no dia a dia.",s88a7dd58c3763c51:"Encontrar Meu Tamanho",s8fb9f388e75ffe11:"Enquadramento",s91a037763666343d:"Algo aconteceu ao gerar a imagem do provador virtual.",s952ed559991cf0b4:"Desenvolvido por",sa4ad2b9cd4ea10ba:"Fundo limpo",sad8ede33ccaa8ef1:"você concorda com nossos Termos e Política de Privacidade.",sb59d68ed12d46377:"Carregando",sca9b53eeb24a5865:"Evite luz de fundo",scf8d43c4a5cb71fa:"Mantenha uma postura ereta, com os braços ligeiramente afastados do corpo",sd13d4c82d57859fc:"Posicione-se em frente a câmera",sd2259f35f330b63c:"Luxo sob medida. Caimento perfeito.",sdabfef8968aeb5fa:"Um erro inesperado aconteceu",sdde2fe5a591a828a:"Vamos começar! →",sde0bd870399b428c:"VER IMAGEM COMPLETA",sde1f02481331134c:"Produto",sdf9f9c621b6316e7:"Medir novamente",se61735ca89853860:"Roupas justas",se940dab2e0b7a710:"Antes de começar",seb66e000f03f21e0:"Vamos encontrar o seu tamanho perfeito",sf84b5644f7595ce5:"Com base em suas medidas e nas dimensões exatas da peça, a recomendação de tamanho fornecida é a mais precisa para um ajuste ideal."},ti=Object.freeze(Object.defineProperty({__proto__:null,templates:ei},Symbol.toStringTag,{value:"Module"}));c.getLocale=Xt,c.setLocale=we,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
|
|
1680
|
+
`,u([p({type:String,attribute:"api-key"})],c.BodyMeasurer.prototype,"apiKey",2),u([p({type:String,attribute:"tenant-id"})],c.BodyMeasurer.prototype,"tenantId",2),u([p({type:String,attribute:"product-sku"})],c.BodyMeasurer.prototype,"productSku",2),u([p({type:String,attribute:"base-url"})],c.BodyMeasurer.prototype,"baseUrl",2),u([p({type:String,attribute:"api-url"})],c.BodyMeasurer.prototype,"apiUrl",2),u([p({type:String,attribute:"vton-url"})],c.BodyMeasurer.prototype,"vtonUrl",2),u([p({type:String,attribute:"garment-url"})],c.BodyMeasurer.prototype,"garmentUrl",2),u([p({type:Boolean,attribute:"vton"})],c.BodyMeasurer.prototype,"vton",2),u([p({type:Function,attribute:"onmeasurementaccepted"})],c.BodyMeasurer.prototype,"onMeasurementAccepted",2),u([p({type:Function,attribute:"onmeasurementcanceled"})],c.BodyMeasurer.prototype,"onMeasurementCanceled",2),u([p({type:String,attribute:"brand-name"})],c.BodyMeasurer.prototype,"brandName",2),u([p({type:String,attribute:"button-text"})],c.BodyMeasurer.prototype,"buttonText",2),u([p({type:String})],c.BodyMeasurer.prototype,"culture",1),u([E()],c.BodyMeasurer.prototype,"errorMap",1),u([E()],c.BodyMeasurer.prototype,"measurerKey",2),u([E()],c.BodyMeasurer.prototype,"_isLocaleLoading",2),u([E()],c.BodyMeasurer.prototype,"showModal",2),u([E()],c.BodyMeasurer.prototype,"step",2),u([E()],c.BodyMeasurer.prototype,"height",2),u([E()],c.BodyMeasurer.prototype,"recommendedSize",2),u([E()],c.BodyMeasurer.prototype,"measurements",2),u([E()],c.BodyMeasurer.prototype,"errorMessage",2),u([E()],c.BodyMeasurer.prototype,"instructionMessage",2),u([E()],c.BodyMeasurer.prototype,"shouldStartMeasurement",2),u([E()],c.BodyMeasurer.prototype,"isLoading",2),u([E()],c.BodyMeasurer.prototype,"isFetching",2),u([E()],c.BodyMeasurer.prototype,"generatedImageUrl",2),u([E()],c.BodyMeasurer.prototype,"isVtonFetching",2),u([E()],c.BodyMeasurer.prototype,"vtonError",2),u([E()],c.BodyMeasurer.prototype,"cameras",2),u([E()],c.BodyMeasurer.prototype,"currentCameraId",2),c.BodyMeasurer=u([N("body-measurer"),W()],c.BodyMeasurer);const Qt={ERR_ARM_NOT_STRETCHED:"Estira tus brazos completamente",ERR_ARMS_NOT_RAISED:"Levanta ambos brazos en un ángulo de 45 grados",ERR_BODY_LANDMARKS_NOT_DETECTED:"Asegúrate de que todo tu cuerpo sea visible en la cámara",ERR_BODY_TOO_CLOSE_TO_EDGE:"Aleja tu cuerpo del borde del encuadre",ERR_BODY_TOO_CLOSE_TO_EDGE_MOVE_LEFT:"Muévete hacia la izquierda para centrar tu cuerpo",ERR_BODY_TOO_CLOSE_TO_EDGE_MOVE_RIGHT:"Muévete hacia la derecha para centrar tu cuerpo",ERR_FEET_TOO_CLOSE_TO_EDGE:"Aleja tus pies del borde del encuadre",ERR_HEAD_POINT_NOT_DETECTED:"Asegúrate de que tu cabeza sea completamente visible en el encuadre",ERR_HEAD_TOO_CLOSE_TO_EDGE:"Aleja tu cabeza del borde del encuadre",ERR_HEIGHT_INVALID:"La altura debe estar entre 50 y 300 cm",ERR_HEIGHT_MEASUREMENT_FAILED:"Párate derecho y asegúrate de que todo tu cuerpo sea visible",ERR_HEM_MEASUREMENT_FAILED:"Asegúrate de que el dobladillo de tu ropa sea visible y claro",ERR_HIPS_MEASUREMENT_FAILED:"Párate derecho y asegúrate de que tus caderas sean visibles",ERR_HIPS_NOT_VISIBLE:"Ajusta tu posición para mostrar tus caderas",ERR_IMAGE_LOAD_FAILED:"Intenta de nuevo más tarde; la imagen no se pudo procesar",ERR_INCORRECT_POSTURE:"Párate derecho con los hombros hacia atrás",ERR_INVALID_BODY_HEIGHT_TYPE:"Asegúrate de que todo tu cuerpo sea visible para medir la altura",ERR_INVALID_CLOTHING_TYPE:"Este tipo de ropa no es compatible; por favor, contacta a soporte",ERR_INVALID_MEASURE_SIDE_VIEW:"Gira para mostrar un perfil de lado claro",ERR_LEFT_ARM_NOT_RAISED:"Levante tu brazo izquierdo en un ángulo de 45 grados",ERR_LEFT_ARM_TOO_HIGH:"Baja tu brazo izquierdo",ERR_LEGS_NOT_DETECTED:"Asegúrate de que tus piernas sean completamente visibles en el encuadre",ERR_LOWER_BODY_NOT_VISIBLE:"Ajusta tu posición para mostrar la parte inferior de tu cuerpo",ERR_NOT_SIDE_VIEW:"Gira para mostrar tu perfil de lado",ERR_RIGHT_ARM_NOT_RAISED:"Levanta tu brazo derecho en un ángulo de 45 grados",ERR_RIGHT_ARM_TOO_HIGH:"Baja tu brazo derecho",ERR_SHOULDER_MEASUREMENT_FAILED:"Mantén tus hombros relajados y visibles",ERR_SHOULDERS_NOT_VISIBLE:"Ajusta tu posición para mostrar tus hombros",ERR_TOO_CLOSE_TO_CAMERA:"Aléjate de la cámara",ERR_UPPER_BODY_NOT_VISIBLE:"Ajusta tu posición para mostrar la parte superior de tu cuerpo",ERR_WAIST_MEASUREMENT_FAILED:"Párate derecho y asegúrate de que tu cintura sea visible",s08b0bc2feb4e0f1c:"Buena iluminación",s1137f6c10e0f1660:"Al usar",s1dd794b3870bcae0:"Empezar",s2f77566c78235d88:"Error al acceder a la cámara web",s322c72546e939809:"Elige un área bien iluminada donde puedas ver tu imagen claramente.",s32d5e90d7ffec075:"Usa una pared lisa",s34c58d3d12e5f890:"Error al cambiar de cámara",s396efd2b23a16ac9:"Colócate contra un fondo liso.",s3a09a6be4809cb50:"Foto de cuerpo entero",s3d324b180f982d46:"Asegúrate de que todo tu cuerpo sea visible en la cámara",s420e8053328b31c4:"Tu talla ideal",s48d094fb2ffff8fb:"Consejos",s5c91b5e06c363734:"Error al procesar la medición",s625ff027ee7b497b:"Asegúrate de que todo tu cuerpo sea visible. La aplicación te guiará.",s676cfe9f36657792:"¡Medición exitosa!",s6ad3b28b46803c43:"Aceptar sugerencia",s6cda30fe423482fd:"Generando tu imagen de probador virtual...",s76ceab13c1401897:ge`Escaneando... ${0}/${1}`,s7948656b643c5186:"Ingresa tu altura (cm)",s81d43b9b25d0775b:"Ropa",s833a6c1d27f3b409:"Haz clic aquí para voltear tu cámara",s88a3f5e6a9d9945d:"Usa la ropa que sueles ponerte a diario.",s88a7dd58c3763c51:"Encontrar Mi Talla",s8fb9f388e75ffe11:"Encuadre",s91a037763666343d:"Algo pasó mientras se generaba la imagen del probador virtual.",s952ed559991cf0b4:"Desarrollado por",sa4ad2b9cd4ea10ba:"Fondo limpio",sad8ede33ccaa8ef1:"aceptas nuestros Términos y Política de Privacidad.",sb59d68ed12d46377:"Cargando",sca9b53eeb24a5865:"Evita la luz de fondo",scf8d43c4a5cb71fa:"Para garantizar medidas precisas, tomaremos dos escaneos: uno de frente y otro de lado. Mantén una postura erguida con los brazos ligeramente separados de tu cuerpo y estirados. En la vista lateral, párate derecho con los brazos estirados y alineados con tu cuerpo.",sd13d4c82d57859fc:"Colócate frente a la cámara",sd2259f35f330b63c:"Lujo seleccionado. Ajuste perfecto.",sdabfef8968aeb5fa:"Ocurrió un error inesperado",sdde2fe5a591a828a:"¡Comencemos! →",sde0bd870399b428c:"VER IMAGEN COMPLETA",sde1f02481331134c:"Producto",sdf9f9c621b6316e7:"Medir de nuevo",se61735ca89853860:"Ropa ajustada",se940dab2e0b7a710:"Antes de comenzar",seb66e000f03f21e0:"Encontremos tu talla perfecta",sf84b5644f7595ce5:"Según tus medidas y las dimensiones exactas de la prenda, la recomendación de talla proporcionada es la más precisa para un ajuste ideal."},Jt=Object.freeze(Object.defineProperty({__proto__:null,templates:Qt},Symbol.toStringTag,{value:"Module"})),ei={ERR_ARM_NOT_STRETCHED:"Estique seus braços completamente",ERR_ARMS_NOT_RAISED:"Levante ambos os braços em um ângulo de 45 graus",ERR_BODY_LANDMARKS_NOT_DETECTED:"Certifique-se de que seu corpo inteiro esteja visível na câmera",ERR_BODY_TOO_CLOSE_TO_EDGE:"Afaste seu corpo da borda do quadro",ERR_BODY_TOO_CLOSE_TO_EDGE_MOVE_LEFT:"Mova-se para a esquerda para centralizar seu corpo",ERR_BODY_TOO_CLOSE_TO_EDGE_MOVE_RIGHT:"Mova-se para a direita para centralizar seu corpo",ERR_FEET_TOO_CLOSE_TO_EDGE:"Afaste seus pés da borda do quadro",ERR_HEAD_POINT_NOT_DETECTED:"Certifique-se de que sua cabeça esteja totalmente visível no quadro",ERR_HEAD_TOO_CLOSE_TO_EDGE:"Afaste sua cabeça da borda do quadro",ERR_HEIGHT_INVALID:"A altura deve ser entre 50 e 300cm",ERR_HEIGHT_MEASUREMENT_FAILED:"Fique ereto e certifique-se de que seu corpo inteiro esteja visível",ERR_HEM_MEASUREMENT_FAILED:"Certifique-se de que a bainha da sua roupa esteja visível e clara",ERR_HIPS_MEASUREMENT_FAILED:"Fique ereto e certifique-se de que seus quadris estejam visíveis",ERR_HIPS_NOT_VISIBLE:"Ajuste sua posição para mostrar seus quadris",ERR_IMAGE_LOAD_FAILED:"Tente novamente mais tarde; a imagem não pôde ser processada",ERR_INCORRECT_POSTURE:"Fique ereto com os ombros para trás",ERR_INVALID_BODY_HEIGHT_TYPE:"Certifique-se de que seu corpo inteiro esteja visível para a medição de altura",ERR_INVALID_CLOTHING_TYPE:"Este tipo de roupa não é suportado; entre em contato com o suporte",ERR_INVALID_MEASURE_SIDE_VIEW:"Gire para mostrar um perfil lateral claro",ERR_LEFT_ARM_NOT_RAISED:"Levante seu braço esquerdo em um ângulo de 45 graus",ERR_LEFT_ARM_TOO_HIGH:"Abaixe seu braço esquerdo",ERR_LEGS_NOT_DETECTED:"Certifique-se de que suas pernas estejam totalmente visíveis no quadro",ERR_LOWER_BODY_NOT_VISIBLE:"Ajuste sua posição para mostrar a parte inferior do corpo",ERR_NOT_SIDE_VIEW:"Gire para mostrar seu perfil lateral",ERR_RIGHT_ARM_NOT_RAISED:"Levante seu braço direito em um ângulo de 45 graus",ERR_RIGHT_ARM_TOO_HIGH:"Abaixe seu braço direito",ERR_SHOULDER_MEASUREMENT_FAILED:"Mantenha seus ombros relaxados e visíveis",ERR_SHOULDERS_NOT_VISIBLE:"Ajuste sua posição para mostrar seus ombros",ERR_TOO_CLOSE_TO_CAMERA:"Dê um passo para trás da câmera",ERR_UPPER_BODY_NOT_VISIBLE:"Ajuste sua posição para mostrar a parte superior do corpo",ERR_WAIST_MEASUREMENT_FAILED:"Fique ereto e certifique-se de que sua cintura esteja visível",s08b0bc2feb4e0f1c:"Boa iluminação",s1137f6c10e0f1660:"Ao usar a",s1dd794b3870bcae0:"Começar",s2f77566c78235d88:"Erro acessando a câmera",s322c72546e939809:"Escolha uma área bem iluminada onde você possa ver sua imagem claramente.",s32d5e90d7ffec075:"Use uma parede lisa",s34c58d3d12e5f890:"Erro ao mudar a câmera",s396efd2b23a16ac9:"Posicione-se contra um fundo simples.",s3a09a6be4809cb50:"Foto de corpo inteiro",s3d324b180f982d46:"Tenha certeza de que seu corpo está totalmente visível",s420e8053328b31c4:"Seu tamanho ideal",s48d094fb2ffff8fb:"Pontas",s5c91b5e06c363734:"Medição de processamento de erros",s625ff027ee7b497b:"Certifique-se de que todo o seu corpo esteja visível. O aplicativo guiará você.",s676cfe9f36657792:"Medição realizada com sucesso!",s6ad3b28b46803c43:"Aceitar sugestão",s6cda30fe423482fd:"Gerando sua imagem de provador virtual...",s76ceab13c1401897:ge`Escaneando... ${0}/${1}`,s7948656b643c5186:"Digite sua altura (cm)",s81d43b9b25d0775b:"Roupas",s833a6c1d27f3b409:"Clique aqui para virar sua câmera",s88a3f5e6a9d9945d:"Use roupas que você costuma usar no dia a dia.",s88a7dd58c3763c51:"Encontrar Meu Tamanho",s8fb9f388e75ffe11:"Enquadramento",s91a037763666343d:"Algo aconteceu ao gerar a imagem do provador virtual.",s952ed559991cf0b4:"Desenvolvido por",sa4ad2b9cd4ea10ba:"Fundo limpo",sad8ede33ccaa8ef1:"você concorda com nossos Termos e Política de Privacidade.",sb59d68ed12d46377:"Carregando",sca9b53eeb24a5865:"Evite luz de fundo",scf8d43c4a5cb71fa:"Mantenha uma postura ereta, com os braços ligeiramente afastados do corpo",sd13d4c82d57859fc:"Posicione-se em frente a câmera",sd2259f35f330b63c:"Luxo sob medida. Caimento perfeito.",sdabfef8968aeb5fa:"Um erro inesperado aconteceu",sdde2fe5a591a828a:"Vamos começar! →",sde0bd870399b428c:"VER IMAGEM COMPLETA",sde1f02481331134c:"Produto",sdf9f9c621b6316e7:"Medir novamente",se61735ca89853860:"Roupas justas",se940dab2e0b7a710:"Antes de começar",seb66e000f03f21e0:"Vamos encontrar o seu tamanho perfeito",sf84b5644f7595ce5:"Com base em suas medidas e nas dimensões exatas da peça, a recomendação de tamanho fornecida é a mais precisa para um ajuste ideal."},ti=Object.freeze(Object.defineProperty({__proto__:null,templates:ei},Symbol.toStringTag,{value:"Module"}));c.getLocale=Xt,c.setLocale=we,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -11,12 +11,18 @@ export declare class AISessionManager {
|
|
|
11
11
|
private measurementComplete;
|
|
12
12
|
private isDisconnected;
|
|
13
13
|
private static readonly CV_ERROR_THROTTLE_MS;
|
|
14
|
+
private static readonly USER_NAME_COOKIE;
|
|
15
|
+
private static readonly USER_NAME_STORAGE_KEY;
|
|
14
16
|
onTurnComplete?: () => void;
|
|
17
|
+
onNameExtracted?: (name: string) => void;
|
|
15
18
|
constructor(apiUrl: string, apiKey: string, localeCode?: string);
|
|
16
19
|
connect(): Promise<void>;
|
|
17
20
|
private handleTurnComplete;
|
|
18
21
|
startMicrophone(): void;
|
|
19
22
|
forwardCvError(errorMessage: string): void;
|
|
20
23
|
notifySuccess(size: string, extraInfo?: string): void;
|
|
24
|
+
private handleNameExtracted;
|
|
25
|
+
private getStoredUserName;
|
|
26
|
+
private setUserNameCookie;
|
|
21
27
|
disconnect(): void;
|
|
22
28
|
}
|
package/package.json
CHANGED