xactsize-webcomponents 1.0.26 → 1.0.28
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.es.js +117 -67
- package/dist/body-measurer.umd.js +131 -81
- package/package.json +1 -1
package/dist/body-measurer.es.js
CHANGED
|
@@ -926,6 +926,15 @@ o.styles = N`
|
|
|
926
926
|
cursor: not-allowed;
|
|
927
927
|
box-shadow: none;
|
|
928
928
|
}
|
|
929
|
+
|
|
930
|
+
@media (max-width: 380px) {
|
|
931
|
+
button {
|
|
932
|
+
padding: 10px 24px;
|
|
933
|
+
font-size: 8px;
|
|
934
|
+
min-height: 30px;
|
|
935
|
+
|
|
936
|
+
}
|
|
937
|
+
}
|
|
929
938
|
`;
|
|
930
939
|
Y([
|
|
931
940
|
j({ type: String })
|
|
@@ -982,7 +991,7 @@ let E = class extends X {
|
|
|
982
991
|
</div>
|
|
983
992
|
|
|
984
993
|
<form>
|
|
985
|
-
<label for="height-input">
|
|
994
|
+
<label for="height-input" class="height-label">
|
|
986
995
|
${n("To get started, please tell us your height.")}
|
|
987
996
|
</label>
|
|
988
997
|
<input id="height-input" type="number" min="50" max="300"
|
|
@@ -1071,16 +1080,14 @@ label="${n("Let's go!")}"
|
|
|
1071
1080
|
}
|
|
1072
1081
|
};
|
|
1073
1082
|
E.styles = N`
|
|
1074
|
-
|
|
1083
|
+
:host {
|
|
1075
1084
|
display: flex;
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
align-items: stretch; /* Evita que filhos desapareçam no Safari */
|
|
1085
|
+
justify-content: center;
|
|
1086
|
+
align-items: flex-start;
|
|
1079
1087
|
font-family: "Lato", sans-serif;
|
|
1080
1088
|
box-sizing: border-box;
|
|
1081
|
-
padding: 16px;
|
|
1089
|
+
padding: 16px;
|
|
1082
1090
|
width: 100%;
|
|
1083
|
-
min-height: 100vh; /* Garante que o conteúdo caiba */
|
|
1084
1091
|
}
|
|
1085
1092
|
|
|
1086
1093
|
.component-content {
|
|
@@ -1089,7 +1096,6 @@ E.styles = N`
|
|
|
1089
1096
|
gap: 12px;
|
|
1090
1097
|
width: 100%;
|
|
1091
1098
|
max-width: 960px;
|
|
1092
|
-
margin: 0 auto;
|
|
1093
1099
|
}
|
|
1094
1100
|
|
|
1095
1101
|
.header-section {
|
|
@@ -1113,14 +1119,12 @@ E.styles = N`
|
|
|
1113
1119
|
|
|
1114
1120
|
.main-section {
|
|
1115
1121
|
display: flex;
|
|
1116
|
-
flex-direction: row;
|
|
1122
|
+
flex-direction: row;
|
|
1117
1123
|
gap: 24px;
|
|
1118
|
-
flex-wrap: wrap; /* Evita overflow de elementos */
|
|
1119
|
-
justify-content: center;
|
|
1120
1124
|
}
|
|
1121
1125
|
|
|
1122
1126
|
.images-section {
|
|
1123
|
-
flex: 1
|
|
1127
|
+
flex: 1;
|
|
1124
1128
|
display: flex;
|
|
1125
1129
|
justify-content: center;
|
|
1126
1130
|
align-items: center;
|
|
@@ -1130,52 +1134,54 @@ E.styles = N`
|
|
|
1130
1134
|
width: 100%;
|
|
1131
1135
|
max-width: 400px;
|
|
1132
1136
|
height: auto;
|
|
1133
|
-
flex-shrink: 0; /* Evita sumir no Safari */
|
|
1134
1137
|
}
|
|
1135
1138
|
|
|
1136
1139
|
.tips-section {
|
|
1137
|
-
flex: 1
|
|
1140
|
+
flex: 1;
|
|
1138
1141
|
display: flex;
|
|
1139
1142
|
flex-direction: column;
|
|
1140
1143
|
gap: 8px;
|
|
1141
|
-
}
|
|
1142
1144
|
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
}
|
|
1145
|
+
form {
|
|
1146
|
+
display: flex;
|
|
1147
|
+
flex-direction: column;
|
|
1148
|
+
align-items: start;
|
|
1149
|
+
gap: 16px;
|
|
1150
|
+
width: 100%;
|
|
1151
|
+
}
|
|
1150
1152
|
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1153
|
+
label {
|
|
1154
|
+
font-size: 16px;
|
|
1155
|
+
color: #333;
|
|
1156
|
+
text-align: start;
|
|
1157
|
+
}
|
|
1155
1158
|
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1159
|
+
input {
|
|
1160
|
+
width: 100%;
|
|
1161
|
+
max-width: 150px;
|
|
1162
|
+
padding: 12px;
|
|
1163
|
+
font-size: 16px;
|
|
1164
|
+
border: 1px solid #ccc;
|
|
1165
|
+
border-radius: 6px;
|
|
1166
|
+
box-sizing: border-box;
|
|
1167
|
+
font-family: "Lato", sans-serif;
|
|
1168
|
+
text-align: start;
|
|
1169
|
+
}
|
|
1165
1170
|
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1171
|
+
input:focus {
|
|
1172
|
+
outline: 2px solid var(--brand-primary);
|
|
1173
|
+
outline-offset: 2px;
|
|
1174
|
+
}
|
|
1169
1175
|
}
|
|
1170
1176
|
|
|
1171
|
-
.xact-button {
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
}
|
|
1177
|
+
.xact-button {
|
|
1178
|
+
width: 100%;
|
|
1179
|
+
max-width: 150px;
|
|
1180
|
+
display: flex;
|
|
1181
|
+
justify-content: center;
|
|
1182
|
+
align-items: center;
|
|
1183
|
+
|
|
1184
|
+
}
|
|
1179
1185
|
|
|
1180
1186
|
.tip-item {
|
|
1181
1187
|
margin-bottom: 4px;
|
|
@@ -1204,11 +1210,11 @@ E.styles = N`
|
|
|
1204
1210
|
margin: 0 auto;
|
|
1205
1211
|
}
|
|
1206
1212
|
|
|
1207
|
-
/*
|
|
1213
|
+
/* Ajuste da responsividade para mobile */
|
|
1208
1214
|
@media (max-width: 754px) {
|
|
1209
1215
|
.main-section {
|
|
1210
1216
|
flex-direction: column;
|
|
1211
|
-
gap:
|
|
1217
|
+
gap: 5px; /* menor gap */
|
|
1212
1218
|
align-items: center;
|
|
1213
1219
|
}
|
|
1214
1220
|
|
|
@@ -1218,28 +1224,30 @@ E.styles = N`
|
|
|
1218
1224
|
}
|
|
1219
1225
|
|
|
1220
1226
|
.images-section svg {
|
|
1221
|
-
width: 80%;
|
|
1222
|
-
max-width: 180px;
|
|
1227
|
+
width: 80%; /* reduzir para não quebrar botão */
|
|
1228
|
+
max-width: 180px; /* altura menor */
|
|
1229
|
+
height: auto;
|
|
1223
1230
|
}
|
|
1224
1231
|
|
|
1225
1232
|
.tips-section {
|
|
1226
1233
|
width: 100%;
|
|
1227
1234
|
gap: 6px;
|
|
1228
|
-
align-items: flex-start;
|
|
1235
|
+
align-items: flex-start; /* alinhar à esquerda */
|
|
1229
1236
|
}
|
|
1230
1237
|
|
|
1231
|
-
|
|
1238
|
+
form {
|
|
1239
|
+
align-items: flex-start; /* alinhar labels e inputs à esquerda */
|
|
1232
1240
|
width: 100%;
|
|
1233
|
-
align-items: flex-start;
|
|
1234
1241
|
}
|
|
1235
1242
|
|
|
1236
|
-
|
|
1243
|
+
input {
|
|
1237
1244
|
max-width: 100%;
|
|
1238
1245
|
font-size: 14px;
|
|
1239
1246
|
padding: 10px;
|
|
1240
1247
|
}
|
|
1241
1248
|
|
|
1242
|
-
|
|
1249
|
+
label {
|
|
1250
|
+
text-align: left;
|
|
1243
1251
|
font-size: 14px;
|
|
1244
1252
|
}
|
|
1245
1253
|
|
|
@@ -1259,56 +1267,98 @@ E.styles = N`
|
|
|
1259
1267
|
|
|
1260
1268
|
.tip-title {
|
|
1261
1269
|
font-size: 12px;
|
|
1270
|
+
text-align: left;
|
|
1262
1271
|
}
|
|
1263
1272
|
|
|
1264
1273
|
.tip-text {
|
|
1265
1274
|
font-size: 11px;
|
|
1266
|
-
|
|
1275
|
+
text-align: left;
|
|
1276
|
+
margin-left: 0; /* remove centralização */
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1279
|
+
.tip-item {
|
|
1280
|
+
margin-bottom: 6px;
|
|
1267
1281
|
}
|
|
1268
1282
|
|
|
1269
1283
|
.buttons {
|
|
1284
|
+
gap: 8px;
|
|
1270
1285
|
width: 100%;
|
|
1271
1286
|
max-width: 100%;
|
|
1272
|
-
gap: 8px;
|
|
1273
1287
|
margin-top: 12px;
|
|
1274
1288
|
}
|
|
1275
1289
|
}
|
|
1276
1290
|
|
|
1277
1291
|
/* Ajuste fino para iPhones muito pequenos */
|
|
1278
1292
|
@media (max-width: 380px) {
|
|
1279
|
-
|
|
1280
|
-
|
|
1293
|
+
.main-section {
|
|
1294
|
+
gap: 1px;
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
.images-section {
|
|
1298
|
+
order: -1;
|
|
1299
|
+
width: 30%;
|
|
1281
1300
|
}
|
|
1282
1301
|
|
|
1283
1302
|
.images-section svg {
|
|
1284
|
-
|
|
1303
|
+
width: 80%; /* reduzir para não quebrar botão */
|
|
1304
|
+
max-width: 150px; /* altura menor */
|
|
1305
|
+
height: auto;
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1308
|
+
.tips-section {
|
|
1309
|
+
gap: 1px;
|
|
1310
|
+
label {
|
|
1311
|
+
font-size: 12px;
|
|
1312
|
+
}
|
|
1313
|
+
input {
|
|
1314
|
+
font-size: 12px;
|
|
1315
|
+
}
|
|
1316
|
+
}
|
|
1317
|
+
h3 {
|
|
1318
|
+
font-size: 14px;
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1321
|
+
|
|
1322
|
+
|
|
1323
|
+
|
|
1324
|
+
.xact-button {
|
|
1325
|
+
max-width: 100%;
|
|
1285
1326
|
}
|
|
1286
1327
|
|
|
1287
1328
|
.header-text {
|
|
1288
|
-
font-size:
|
|
1329
|
+
font-size: 14px;
|
|
1330
|
+
text-align: center;
|
|
1289
1331
|
}
|
|
1290
1332
|
|
|
1291
1333
|
.description-text {
|
|
1292
|
-
font-size:
|
|
1334
|
+
font-size: 12px;
|
|
1335
|
+
text-align: center;
|
|
1293
1336
|
}
|
|
1294
1337
|
|
|
1295
1338
|
.tip-title {
|
|
1296
|
-
font-size:
|
|
1339
|
+
font-size: 12px;
|
|
1340
|
+
text-align: left;
|
|
1297
1341
|
}
|
|
1298
1342
|
|
|
1299
1343
|
.tip-text {
|
|
1300
|
-
font-size:
|
|
1344
|
+
font-size: 11px;
|
|
1345
|
+
text-align: left;
|
|
1346
|
+
margin-left: 0; /* remove centralização */
|
|
1301
1347
|
}
|
|
1302
1348
|
|
|
1303
|
-
.
|
|
1304
|
-
|
|
1349
|
+
.tip-item {
|
|
1350
|
+
margin-bottom: 1px;
|
|
1305
1351
|
}
|
|
1306
1352
|
|
|
1307
1353
|
.buttons {
|
|
1308
|
-
gap:
|
|
1354
|
+
gap: 2px;
|
|
1355
|
+
width: 100%;
|
|
1356
|
+
max-width: 100%;
|
|
1357
|
+
margin-top: 1px;
|
|
1309
1358
|
}
|
|
1310
1359
|
}
|
|
1311
1360
|
|
|
1361
|
+
|
|
1312
1362
|
|
|
1313
1363
|
`;
|
|
1314
1364
|
kA([
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(S,H){typeof exports=="object"&&typeof module<"u"?H(exports):typeof define=="function"&&define.amd?define(["exports"],H):(S=typeof globalThis<"u"?globalThis:S||self,H(S.BodyMeasurer={}))})(this,function(S){"use strict";var wA;const H=(r,A,t)=>{const l=r[A];return l?typeof l=="function"?l():Promise.resolve(l):new Promise((e,p)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(p.bind(null,new Error("Unknown variable dynamic import: "+A+(A.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 g=globalThis,rA=g.ShadowRoot&&(g.ShadyCSS===void 0||g.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,pA=Symbol(),
|
|
5
|
+
*/const g=globalThis,rA=g.ShadowRoot&&(g.ShadyCSS===void 0||g.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,pA=Symbol(),iA=new WeakMap;let sA=class{constructor(A,t,l){if(this._$cssResult$=!0,l!==pA)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=A,this.t=t}get styleSheet(){let A=this.o;const t=this.t;if(rA&&A===void 0){const l=t!==void 0&&t.length===1;l&&(A=iA.get(t)),A===void 0&&((this.o=A=new CSSStyleSheet).replaceSync(this.cssText),l&&iA.set(t,A))}return A}toString(){return this.cssText}};const CA=r=>new sA(typeof r=="string"?r:r+"",void 0,pA),m=(r,...A)=>{const t=r.length===1?r[0]:A.reduce((l,e,p)=>l+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(e)+r[p+1],r[0]);return new sA(t,r,pA)},YA=(r,A)=>{if(rA)r.adoptedStyleSheets=A.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of A){const l=document.createElement("style"),e=g.litNonce;e!==void 0&&l.setAttribute("nonce",e),l.textContent=t.cssText,r.appendChild(l)}},xA=rA?r=>r:r=>r instanceof CSSStyleSheet?(A=>{let t="";for(const l of A.cssRules)t+=l.cssText;return CA(t)})(r):r;/**
|
|
6
6
|
* @license
|
|
7
7
|
* Copyright 2017 Google LLC
|
|
8
8
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
-
*/const{is:DA,defineProperty:QA,getOwnPropertyDescriptor:gA,getOwnPropertyNames:BA,getOwnPropertySymbols:_A,getPrototypeOf:$A}=Object,x=globalThis,KA=x.trustedTypes,At=KA?KA.emptyScript:"",nA=x.reactiveElementPolyfillSupport,z=(r,A)=>r,B={toAttribute(r,A){switch(A){case Boolean:r=r?At:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,A){let t=r;switch(A){case Boolean:t=r!==null;break;case Number:t=r===null?null:Number(r);break;case Object:case Array:try{t=JSON.parse(r)}catch{t=null}}return t}},VA=(r,A)=>!DA(r,A),UA={attribute:!0,type:String,converter:B,reflect:!1,useDefault:!1,hasChanged:VA};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),x.litPropertyMetadata??(x.litPropertyMetadata=new WeakMap);let Z=class extends HTMLElement{static addInitializer(A){this._$Ei(),(this.l??(this.l=[])).push(A)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(A,t=UA){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(A)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(A,t),!t.noAccessor){const l=Symbol(),e=this.getPropertyDescriptor(A,l,t);e!==void 0&&QA(this.prototype,A,e)}}static getPropertyDescriptor(A,t,l){const{get:e,set:p}=gA(this.prototype,A)??{get(){return this[t]},set(n){this[t]=n}};return{get:e,set(n){const
|
|
9
|
+
*/const{is:DA,defineProperty:QA,getOwnPropertyDescriptor:gA,getOwnPropertyNames:BA,getOwnPropertySymbols:_A,getPrototypeOf:$A}=Object,x=globalThis,KA=x.trustedTypes,At=KA?KA.emptyScript:"",nA=x.reactiveElementPolyfillSupport,z=(r,A)=>r,B={toAttribute(r,A){switch(A){case Boolean:r=r?At:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,A){let t=r;switch(A){case Boolean:t=r!==null;break;case Number:t=r===null?null:Number(r);break;case Object:case Array:try{t=JSON.parse(r)}catch{t=null}}return t}},VA=(r,A)=>!DA(r,A),UA={attribute:!0,type:String,converter:B,reflect:!1,useDefault:!1,hasChanged:VA};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),x.litPropertyMetadata??(x.litPropertyMetadata=new WeakMap);let Z=class extends HTMLElement{static addInitializer(A){this._$Ei(),(this.l??(this.l=[])).push(A)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(A,t=UA){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(A)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(A,t),!t.noAccessor){const l=Symbol(),e=this.getPropertyDescriptor(A,l,t);e!==void 0&&QA(this.prototype,A,e)}}static getPropertyDescriptor(A,t,l){const{get:e,set:p}=gA(this.prototype,A)??{get(){return this[t]},set(n){this[t]=n}};return{get:e,set(n){const a=e==null?void 0:e.call(this);p==null||p.call(this,n),this.requestUpdate(A,a,l)},configurable:!0,enumerable:!0}}static getPropertyOptions(A){return this.elementProperties.get(A)??UA}static _$Ei(){if(this.hasOwnProperty(z("elementProperties")))return;const A=$A(this);A.finalize(),A.l!==void 0&&(this.l=[...A.l]),this.elementProperties=new Map(A.elementProperties)}static finalize(){if(this.hasOwnProperty(z("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(z("properties"))){const t=this.properties,l=[...BA(t),..._A(t)];for(const e of l)this.createProperty(e,t[e])}const A=this[Symbol.metadata];if(A!==null){const t=litPropertyMetadata.get(A);if(t!==void 0)for(const[l,e]of t)this.elementProperties.set(l,e)}this._$Eh=new Map;for(const[t,l]of this.elementProperties){const e=this._$Eu(t,l);e!==void 0&&this._$Eh.set(e,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(A){const t=[];if(Array.isArray(A)){const l=new Set(A.flat(1/0).reverse());for(const e of l)t.unshift(xA(e))}else A!==void 0&&t.push(xA(A));return t}static _$Eu(A,t){const l=t.attribute;return l===!1?void 0:typeof l=="string"?l:typeof A=="string"?A.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var A;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(A=this.constructor.l)==null||A.forEach(t=>t(this))}addController(A){var t;(this._$EO??(this._$EO=new Set)).add(A),this.renderRoot!==void 0&&this.isConnected&&((t=A.hostConnected)==null||t.call(A))}removeController(A){var t;(t=this._$EO)==null||t.delete(A)}_$E_(){const A=new Map,t=this.constructor.elementProperties;for(const l of t.keys())this.hasOwnProperty(l)&&(A.set(l,this[l]),delete this[l]);A.size>0&&(this._$Ep=A)}createRenderRoot(){const A=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return YA(A,this.constructor.elementStyles),A}connectedCallback(){var A;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(A=this._$EO)==null||A.forEach(t=>{var l;return(l=t.hostConnected)==null?void 0:l.call(t)})}enableUpdating(A){}disconnectedCallback(){var A;(A=this._$EO)==null||A.forEach(t=>{var l;return(l=t.hostDisconnected)==null?void 0:l.call(t)})}attributeChangedCallback(A,t,l){this._$AK(A,l)}_$ET(A,t){var p;const l=this.constructor.elementProperties.get(A),e=this.constructor._$Eu(A,l);if(e!==void 0&&l.reflect===!0){const n=(((p=l.converter)==null?void 0:p.toAttribute)!==void 0?l.converter:B).toAttribute(t,l.type);this._$Em=A,n==null?this.removeAttribute(e):this.setAttribute(e,n),this._$Em=null}}_$AK(A,t){var p,n;const l=this.constructor,e=l._$Eh.get(A);if(e!==void 0&&this._$Em!==e){const a=l.getPropertyOptions(e),q=typeof a.converter=="function"?{fromAttribute:a.converter}:((p=a.converter)==null?void 0:p.fromAttribute)!==void 0?a.converter:B;this._$Em=e,this[e]=q.fromAttribute(t,a.type)??((n=this._$Ej)==null?void 0:n.get(e))??null,this._$Em=null}}requestUpdate(A,t,l){var e;if(A!==void 0){const p=this.constructor,n=this[A];if(l??(l=p.getPropertyOptions(A)),!((l.hasChanged??VA)(n,t)||l.useDefault&&l.reflect&&n===((e=this._$Ej)==null?void 0:e.get(A))&&!this.hasAttribute(p._$Eu(A,l))))return;this.C(A,t,l)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(A,t,{useDefault:l,reflect:e,wrapped:p},n){l&&!(this._$Ej??(this._$Ej=new Map)).has(A)&&(this._$Ej.set(A,n??t??this[A]),p!==!0||n!==void 0)||(this._$AL.has(A)||(this.hasUpdated||l||(t=void 0),this._$AL.set(A,t)),e===!0&&this._$Em!==A&&(this._$Eq??(this._$Eq=new Set)).add(A))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const A=this.scheduleUpdate();return A!=null&&await A,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var l;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[p,n]of this._$Ep)this[p]=n;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[p,n]of e){const{wrapped:a}=n,q=this[p];a!==!0||this._$AL.has(p)||q===void 0||this.C(p,void 0,n,q)}}let A=!1;const t=this._$AL;try{A=this.shouldUpdate(t),A?(this.willUpdate(t),(l=this._$EO)==null||l.forEach(e=>{var p;return(p=e.hostUpdate)==null?void 0:p.call(e)}),this.update(t)):this._$EM()}catch(e){throw A=!1,this._$EM(),e}A&&this._$AE(t)}willUpdate(A){}_$AE(A){var t;(t=this._$EO)==null||t.forEach(l=>{var e;return(e=l.hostUpdated)==null?void 0:e.call(l)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(A)),this.updated(A)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(A){return!0}update(A){this._$Eq&&(this._$Eq=this._$Eq.forEach(t=>this._$ET(t,this[t]))),this._$EM()}updated(A){}firstUpdated(A){}};Z.elementStyles=[],Z.shadowRootOptions={mode:"open"},Z[z("elementProperties")]=new Map,Z[z("finalized")]=new Map,nA==null||nA({ReactiveElement:Z}),(x.reactiveElementVersions??(x.reactiveElementVersions=[])).push("2.1.0");/**
|
|
10
10
|
* @license
|
|
11
11
|
* Copyright 2017 Google LLC
|
|
12
12
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
13
|
-
*/const G=globalThis,_=G.trustedTypes,vA=_?_.createPolicy("lit-html",{createHTML:r=>r}):void 0,OA="$lit$",K=`lit$${Math.random().toFixed(9).slice(2)}$`,WA="?"+K,tt=`<${WA}>`,v=document,F=()=>v.createComment(""),M=r=>r===null||typeof r!="object"&&typeof r!="function",qA=Array.isArray,lt=r=>qA(r)||typeof(r==null?void 0:r[Symbol.iterator])=="function",
|
|
14
|
-
\f\r]`,h=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,bA=/-->/g,oA=/>/g,O=RegExp(`>|${
|
|
15
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),LA=/'/g,fA=/"/g,PA=/^(?:script|style|textarea|title)$/i,et=r=>(A,...t)=>({_$litType$:r,strings:A,values:t}),J=et(1),W=Symbol.for("lit-noChange"),j=Symbol.for("lit-nothing"),mA=new WeakMap,b=v.createTreeWalker(v,129);function ZA(r,A){if(!qA(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return vA!==void 0?vA.createHTML(A):A}const rt=(r,A)=>{const t=r.length-1,l=[];let e,p=A===2?"<svg>":A===3?"<math>":"",n=h;for(let
|
|
13
|
+
*/const G=globalThis,_=G.trustedTypes,vA=_?_.createPolicy("lit-html",{createHTML:r=>r}):void 0,OA="$lit$",K=`lit$${Math.random().toFixed(9).slice(2)}$`,WA="?"+K,tt=`<${WA}>`,v=document,F=()=>v.createComment(""),M=r=>r===null||typeof r!="object"&&typeof r!="function",qA=Array.isArray,lt=r=>qA(r)||typeof(r==null?void 0:r[Symbol.iterator])=="function",aA=`[
|
|
14
|
+
\f\r]`,h=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,bA=/-->/g,oA=/>/g,O=RegExp(`>|${aA}(?:([^\\s"'>=/]+)(${aA}*=${aA}*(?:[^
|
|
15
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),LA=/'/g,fA=/"/g,PA=/^(?:script|style|textarea|title)$/i,et=r=>(A,...t)=>({_$litType$:r,strings:A,values:t}),J=et(1),W=Symbol.for("lit-noChange"),j=Symbol.for("lit-nothing"),mA=new WeakMap,b=v.createTreeWalker(v,129);function ZA(r,A){if(!qA(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return vA!==void 0?vA.createHTML(A):A}const rt=(r,A)=>{const t=r.length-1,l=[];let e,p=A===2?"<svg>":A===3?"<math>":"",n=h;for(let a=0;a<t;a++){const q=r[a];let y,k,d=-1,s=0;for(;s<q.length&&(n.lastIndex=s,k=n.exec(q),k!==null);)s=n.lastIndex,n===h?k[1]==="!--"?n=bA:k[1]!==void 0?n=oA:k[2]!==void 0?(PA.test(k[2])&&(e=RegExp("</"+k[2],"g")),n=O):k[3]!==void 0&&(n=O):n===O?k[0]===">"?(n=e??h,d=-1):k[1]===void 0?d=-2:(d=n.lastIndex-k[2].length,y=k[1],n=k[3]===void 0?O:k[3]==='"'?fA:LA):n===fA||n===LA?n=O:n===bA||n===oA?n=h:(n=O,e=void 0);const U=n===O&&r[a+1].startsWith("/>")?" ":"";p+=n===h?q+tt:d>=0?(l.push(y),q.slice(0,d)+OA+q.slice(d)+K+U):q+K+(d===-2?a:U)}return[ZA(r,p+(r[t]||"<?>")+(A===2?"</svg>":A===3?"</math>":"")),l]};class E{constructor({strings:A,_$litType$:t},l){let e;this.parts=[];let p=0,n=0;const a=A.length-1,q=this.parts,[y,k]=rt(A,t);if(this.el=E.createElement(y,l),b.currentNode=this.el.content,t===2||t===3){const d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(e=b.nextNode())!==null&&q.length<a;){if(e.nodeType===1){if(e.hasAttributes())for(const d of e.getAttributeNames())if(d.endsWith(OA)){const s=k[n++],U=e.getAttribute(d).split(K),eA=/([.?@])?(.*)/.exec(s);q.push({type:1,index:p,name:eA[2],strings:U,ctor:eA[1]==="."?nt:eA[1]==="?"?Vt:eA[1]==="@"?qt:$}),e.removeAttribute(d)}else d.startsWith(K)&&(q.push({type:6,index:p}),e.removeAttribute(d));if(PA.test(e.tagName)){const d=e.textContent.split(K),s=d.length-1;if(s>0){e.textContent=_?_.emptyScript:"";for(let U=0;U<s;U++)e.append(d[U],F()),b.nextNode(),q.push({type:2,index:++p});e.append(d[s],F())}}}else if(e.nodeType===8)if(e.data===WA)q.push({type:2,index:p});else{let d=-1;for(;(d=e.data.indexOf(K,d+1))!==-1;)q.push({type:7,index:p}),d+=K.length-1}p++}}static createElement(A,t){const l=v.createElement("template");return l.innerHTML=A,l}}function N(r,A,t=r,l){var n,a;if(A===W)return A;let e=l!==void 0?(n=t._$Co)==null?void 0:n[l]:t._$Cl;const p=M(A)?void 0:A._$litDirective$;return(e==null?void 0:e.constructor)!==p&&((a=e==null?void 0:e._$AO)==null||a.call(e,!1),p===void 0?e=void 0:(e=new p(r),e._$AT(r,t,l)),l!==void 0?(t._$Co??(t._$Co=[]))[l]=e:t._$Cl=e),e!==void 0&&(A=N(r,e._$AS(r,A.values),e,l)),A}class pt{constructor(A,t){this._$AV=[],this._$AN=void 0,this._$AD=A,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(A){const{el:{content:t},parts:l}=this._$AD,e=((A==null?void 0:A.creationScope)??v).importNode(t,!0);b.currentNode=e;let p=b.nextNode(),n=0,a=0,q=l[0];for(;q!==void 0;){if(n===q.index){let y;q.type===2?y=new I(p,p.nextSibling,this,A):q.type===1?y=new q.ctor(p,q.name,q.strings,this,A):q.type===6&&(y=new at(p,this,A)),this._$AV.push(y),q=l[++a]}n!==(q==null?void 0:q.index)&&(p=b.nextNode(),n++)}return b.currentNode=v,e}p(A){let t=0;for(const l of this._$AV)l!==void 0&&(l.strings!==void 0?(l._$AI(A,l,t),t+=l.strings.length-2):l._$AI(A[t])),t++}}class I{get _$AU(){var A;return((A=this._$AM)==null?void 0:A._$AU)??this._$Cv}constructor(A,t,l,e){this.type=2,this._$AH=j,this._$AN=void 0,this._$AA=A,this._$AB=t,this._$AM=l,this.options=e,this._$Cv=(e==null?void 0:e.isConnected)??!0}get parentNode(){let A=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&(A==null?void 0:A.nodeType)===11&&(A=t.parentNode),A}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(A,t=this){A=N(this,A,t),M(A)?A===j||A==null||A===""?(this._$AH!==j&&this._$AR(),this._$AH=j):A!==this._$AH&&A!==W&&this._(A):A._$litType$!==void 0?this.$(A):A.nodeType!==void 0?this.T(A):lt(A)?this.k(A):this._(A)}O(A){return this._$AA.parentNode.insertBefore(A,this._$AB)}T(A){this._$AH!==A&&(this._$AR(),this._$AH=this.O(A))}_(A){this._$AH!==j&&M(this._$AH)?this._$AA.nextSibling.data=A:this.T(v.createTextNode(A)),this._$AH=A}$(A){var p;const{values:t,_$litType$:l}=A,e=typeof l=="number"?this._$AC(A):(l.el===void 0&&(l.el=E.createElement(ZA(l.h,l.h[0]),this.options)),l);if(((p=this._$AH)==null?void 0:p._$AD)===e)this._$AH.p(t);else{const n=new pt(e,this),a=n.u(this.options);n.p(t),this.T(a),this._$AH=n}}_$AC(A){let t=mA.get(A.strings);return t===void 0&&mA.set(A.strings,t=new E(A)),t}k(A){qA(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let l,e=0;for(const p of A)e===t.length?t.push(l=new I(this.O(F()),this.O(F()),this,this.options)):l=t[e],l._$AI(p),e++;e<t.length&&(this._$AR(l&&l._$AB.nextSibling,e),t.length=e)}_$AR(A=this._$AA.nextSibling,t){var l;for((l=this._$AP)==null?void 0:l.call(this,!1,!0,t);A&&A!==this._$AB;){const e=A.nextSibling;A.remove(),A=e}}setConnected(A){var t;this._$AM===void 0&&(this._$Cv=A,(t=this._$AP)==null||t.call(this,A))}}class ${get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(A,t,l,e,p){this.type=1,this._$AH=j,this._$AN=void 0,this.element=A,this.name=t,this._$AM=e,this.options=p,l.length>2||l[0]!==""||l[1]!==""?(this._$AH=Array(l.length-1).fill(new String),this.strings=l):this._$AH=j}_$AI(A,t=this,l,e){const p=this.strings;let n=!1;if(p===void 0)A=N(this,A,t,0),n=!M(A)||A!==this._$AH&&A!==W,n&&(this._$AH=A);else{const a=A;let q,y;for(A=p[0],q=0;q<p.length-1;q++)y=N(this,a[l+q],t,q),y===W&&(y=this._$AH[q]),n||(n=!M(y)||y!==this._$AH[q]),y===j?A=j:A!==j&&(A+=(y??"")+p[q+1]),this._$AH[q]=y}n&&!e&&this.j(A)}j(A){A===j?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,A??"")}}class nt extends ${constructor(){super(...arguments),this.type=3}j(A){this.element[this.name]=A===j?void 0:A}}class Vt extends ${constructor(){super(...arguments),this.type=4}j(A){this.element.toggleAttribute(this.name,!!A&&A!==j)}}class qt extends ${constructor(A,t,l,e,p){super(A,t,l,e,p),this.type=5}_$AI(A,t=this){if((A=N(this,A,t,0)??j)===W)return;const l=this._$AH,e=A===j&&l!==j||A.capture!==l.capture||A.once!==l.once||A.passive!==l.passive,p=A!==j&&(l===j||e);e&&this.element.removeEventListener(this.name,this,l),p&&this.element.addEventListener(this.name,this,A),this._$AH=A}handleEvent(A){var t;typeof this._$AH=="function"?this._$AH.call(((t=this.options)==null?void 0:t.host)??this.element,A):this._$AH.handleEvent(A)}}class at{constructor(A,t,l){this.element=A,this.type=6,this._$AN=void 0,this._$AM=t,this.options=l}get _$AU(){return this._$AM._$AU}_$AI(A){N(this,A)}}const SA=G.litHtmlPolyfillSupport;SA==null||SA(E,I),(G.litHtmlVersions??(G.litHtmlVersions=[])).push("3.3.0");const St=(r,A,t)=>{const l=(t==null?void 0:t.renderBefore)??A;let e=l._$litPart$;if(e===void 0){const p=(t==null?void 0:t.renderBefore)??null;l._$litPart$=e=new I(A.insertBefore(F(),p),p,void 0,t??{})}return e._$AI(r),e};/**
|
|
16
16
|
* @license
|
|
17
17
|
* Copyright 2017 Google LLC
|
|
18
18
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
19
|
-
*/const o=globalThis;let X=class extends Z{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const A=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=A.firstChild),A}update(A){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(A),this._$Do=
|
|
19
|
+
*/const o=globalThis;let X=class extends Z{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const A=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=A.firstChild),A}update(A){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(A),this._$Do=St(t,this.renderRoot,this.renderOptions)}connectedCallback(){var A;super.connectedCallback(),(A=this._$Do)==null||A.setConnected(!0)}disconnectedCallback(){var A;super.disconnectedCallback(),(A=this._$Do)==null||A.setConnected(!1)}render(){return W}};X._$litElement$=!0,X.finalized=!0,(wA=o.litElementHydrateSupport)==null||wA.call(o,{LitElement:X});const dA=o.litElementPolyfillSupport;dA==null||dA({LitElement:X}),(o.litElementVersions??(o.litElementVersions=[])).push("4.2.0");/**
|
|
20
20
|
* @license
|
|
21
21
|
* Copyright 2017 Google LLC
|
|
22
22
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* @license
|
|
25
25
|
* Copyright 2017 Google LLC
|
|
26
26
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
27
|
-
*/const dt={attribute:!0,type:String,converter:B,reflect:!1,hasChanged:VA},ut=(r=dt,A,t)=>{const{kind:l,metadata:e}=t;let p=globalThis.litPropertyMetadata.get(e);if(p===void 0&&globalThis.litPropertyMetadata.set(e,p=new Map),l==="setter"&&((r=Object.create(r)).wrapped=!0),p.set(t.name,r),l==="accessor"){const{name:n}=t;return{set(
|
|
27
|
+
*/const dt={attribute:!0,type:String,converter:B,reflect:!1,hasChanged:VA},ut=(r=dt,A,t)=>{const{kind:l,metadata:e}=t;let p=globalThis.litPropertyMetadata.get(e);if(p===void 0&&globalThis.litPropertyMetadata.set(e,p=new Map),l==="setter"&&((r=Object.create(r)).wrapped=!0),p.set(t.name,r),l==="accessor"){const{name:n}=t;return{set(a){const q=A.get.call(this);A.set.call(this,a),this.requestUpdate(n,q,r)},init(a){return a!==void 0&&this.C(n,void 0,r,a),a}}}if(l==="setter"){const{name:n}=t;return function(a){const q=this[n];A.call(this,a),this.requestUpdate(n,q,r)}}throw Error("Unsupported decorator location: "+l)};function c(r){return(A,t)=>typeof t=="object"?ut(r,A,t):((l,e,p)=>{const n=e.hasOwnProperty(p);return e.constructor.createProperty(p,l),n?Object.getOwnPropertyDescriptor(e,p):void 0})(r,A,t)}/**
|
|
28
28
|
* @license
|
|
29
29
|
* Copyright 2017 Google LLC
|
|
30
30
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -56,15 +56,15 @@
|
|
|
56
56
|
* @license
|
|
57
57
|
* Copyright 2014 Travis Webb
|
|
58
58
|
* SPDX-License-Identifier: MIT
|
|
59
|
-
*/const
|
|
59
|
+
*/const i=[];for(let r=0;r<256;r++)i[r]=(r>>4&15).toString(16)+(r&15).toString(16);function Tt(r){let A=0,t=8997,l=0,e=33826,p=0,n=40164,a=0,q=52210;for(let y=0;y<r.length;y++)t^=r.charCodeAt(y),A=t*435,l=e*435,p=n*435,a=q*435,p+=t<<8,a+=e<<8,l+=A>>>16,t=A&65535,p+=l>>>16,e=l&65535,q=a+(p>>>16)&65535,n=p&65535;return i[q>>8]+i[q&255]+i[n>>8]+i[n&255]+i[e>>8]+i[e&255]+i[t>>8]+i[t&255]}/**
|
|
60
60
|
* @license
|
|
61
61
|
* Copyright 2020 Google LLC
|
|
62
62
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
63
|
-
*/const Jt="",Xt="h",
|
|
63
|
+
*/const Jt="",Xt="h",it="s";function st(r,A){return(A?Xt:it)+Tt(typeof r=="string"?r:r.join(Jt))}/**
|
|
64
64
|
* @license
|
|
65
65
|
* Copyright 2021 Google LLC
|
|
66
66
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
67
|
-
*/const GA=new WeakMap,FA=new Map;function xt(r,A,t){if(r){const l=(t==null?void 0:t.id)??Kt(A),e=r[l];if(e){if(typeof e=="string")return e;if("strTag"in e)return NA(e.strings,A.values,e.values);{let p=GA.get(e);return p===void 0&&(p=e.values,GA.set(e,p)),{...e,values:p.map(n=>A.values[n])}}}}return RA(A)}function Kt(r){const A=typeof r=="string"?r:r.strings;let t=FA.get(A);return t===void 0&&(t=
|
|
67
|
+
*/const GA=new WeakMap,FA=new Map;function xt(r,A,t){if(r){const l=(t==null?void 0:t.id)??Kt(A),e=r[l];if(e){if(typeof e=="string")return e;if("strTag"in e)return NA(e.strings,A.values,e.values);{let p=GA.get(e);return p===void 0&&(p=e.values,GA.set(e,p)),{...e,values:p.map(n=>A.values[n])}}}}return RA(A)}function Kt(r){const A=typeof r=="string"?r:r.strings;let t=FA.get(A);return t===void 0&&(t=st(A,typeof r!="string"&&!("strTag"in r)),FA.set(A,t)),t}/**
|
|
68
68
|
* @license
|
|
69
69
|
* Copyright 2021 Google LLC
|
|
70
70
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -158,6 +158,15 @@
|
|
|
158
158
|
cursor: not-allowed;
|
|
159
159
|
box-shadow: none;
|
|
160
160
|
}
|
|
161
|
+
|
|
162
|
+
@media (max-width: 380px) {
|
|
163
|
+
button {
|
|
164
|
+
padding: 10px 24px;
|
|
165
|
+
font-size: 8px;
|
|
166
|
+
min-height: 30px;
|
|
167
|
+
|
|
168
|
+
}
|
|
169
|
+
}
|
|
161
170
|
`,C([c({type:String})],f.prototype,"type",2),C([c({type:String})],f.prototype,"label",2),C([c({type:Boolean})],f.prototype,"disabled",2),C([c({type:String})],f.prototype,"variant",2),f=C([R("xact-button")],f);var Zt=Object.defineProperty,Nt=Object.getOwnPropertyDescriptor,kA=(r,A,t,l)=>{for(var e=l>1?void 0:l?Nt(A,t):A,p=r.length-1,n;p>=0;p--)(n=r[p])&&(e=(l?n(A,t,e):n(e))||e);return l&&e&&Zt(A,t,e),e};let Y=class extends X{constructor(){super(...arguments),this.height=0}render(){return J`
|
|
162
171
|
<div class="component-content">
|
|
163
172
|
<div class="header-section">
|
|
@@ -188,7 +197,7 @@
|
|
|
188
197
|
</div>
|
|
189
198
|
|
|
190
199
|
<form>
|
|
191
|
-
<label for="height-input">
|
|
200
|
+
<label for="height-input" class="height-label">
|
|
192
201
|
${V("To get started, please tell us your height.")}
|
|
193
202
|
</label>
|
|
194
203
|
<input id="height-input" type="number" min="50" max="300"
|
|
@@ -267,16 +276,14 @@ label="${V("Let's go!")}"
|
|
|
267
276
|
></xact-button>
|
|
268
277
|
|
|
269
278
|
`}};Y.styles=m`
|
|
270
|
-
|
|
279
|
+
:host {
|
|
271
280
|
display: flex;
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
align-items: stretch; /* Evita que filhos desapareçam no Safari */
|
|
281
|
+
justify-content: center;
|
|
282
|
+
align-items: flex-start;
|
|
275
283
|
font-family: "Lato", sans-serif;
|
|
276
284
|
box-sizing: border-box;
|
|
277
|
-
padding: 16px;
|
|
285
|
+
padding: 16px;
|
|
278
286
|
width: 100%;
|
|
279
|
-
min-height: 100vh; /* Garante que o conteúdo caiba */
|
|
280
287
|
}
|
|
281
288
|
|
|
282
289
|
.component-content {
|
|
@@ -285,7 +292,6 @@ label="${V("Let's go!")}"
|
|
|
285
292
|
gap: 12px;
|
|
286
293
|
width: 100%;
|
|
287
294
|
max-width: 960px;
|
|
288
|
-
margin: 0 auto;
|
|
289
295
|
}
|
|
290
296
|
|
|
291
297
|
.header-section {
|
|
@@ -309,14 +315,12 @@ label="${V("Let's go!")}"
|
|
|
309
315
|
|
|
310
316
|
.main-section {
|
|
311
317
|
display: flex;
|
|
312
|
-
flex-direction: row;
|
|
318
|
+
flex-direction: row;
|
|
313
319
|
gap: 24px;
|
|
314
|
-
flex-wrap: wrap; /* Evita overflow de elementos */
|
|
315
|
-
justify-content: center;
|
|
316
320
|
}
|
|
317
321
|
|
|
318
322
|
.images-section {
|
|
319
|
-
flex: 1
|
|
323
|
+
flex: 1;
|
|
320
324
|
display: flex;
|
|
321
325
|
justify-content: center;
|
|
322
326
|
align-items: center;
|
|
@@ -326,52 +330,54 @@ label="${V("Let's go!")}"
|
|
|
326
330
|
width: 100%;
|
|
327
331
|
max-width: 400px;
|
|
328
332
|
height: auto;
|
|
329
|
-
flex-shrink: 0; /* Evita sumir no Safari */
|
|
330
333
|
}
|
|
331
334
|
|
|
332
335
|
.tips-section {
|
|
333
|
-
flex: 1
|
|
336
|
+
flex: 1;
|
|
334
337
|
display: flex;
|
|
335
338
|
flex-direction: column;
|
|
336
339
|
gap: 8px;
|
|
337
|
-
}
|
|
338
340
|
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
}
|
|
341
|
+
form {
|
|
342
|
+
display: flex;
|
|
343
|
+
flex-direction: column;
|
|
344
|
+
align-items: start;
|
|
345
|
+
gap: 16px;
|
|
346
|
+
width: 100%;
|
|
347
|
+
}
|
|
346
348
|
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
349
|
+
label {
|
|
350
|
+
font-size: 16px;
|
|
351
|
+
color: #333;
|
|
352
|
+
text-align: start;
|
|
353
|
+
}
|
|
351
354
|
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
355
|
+
input {
|
|
356
|
+
width: 100%;
|
|
357
|
+
max-width: 150px;
|
|
358
|
+
padding: 12px;
|
|
359
|
+
font-size: 16px;
|
|
360
|
+
border: 1px solid #ccc;
|
|
361
|
+
border-radius: 6px;
|
|
362
|
+
box-sizing: border-box;
|
|
363
|
+
font-family: "Lato", sans-serif;
|
|
364
|
+
text-align: start;
|
|
365
|
+
}
|
|
361
366
|
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
367
|
+
input:focus {
|
|
368
|
+
outline: 2px solid var(--brand-primary);
|
|
369
|
+
outline-offset: 2px;
|
|
370
|
+
}
|
|
365
371
|
}
|
|
366
372
|
|
|
367
|
-
.xact-button {
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
}
|
|
373
|
+
.xact-button {
|
|
374
|
+
width: 100%;
|
|
375
|
+
max-width: 150px;
|
|
376
|
+
display: flex;
|
|
377
|
+
justify-content: center;
|
|
378
|
+
align-items: center;
|
|
379
|
+
|
|
380
|
+
}
|
|
375
381
|
|
|
376
382
|
.tip-item {
|
|
377
383
|
margin-bottom: 4px;
|
|
@@ -400,11 +406,11 @@ label="${V("Let's go!")}"
|
|
|
400
406
|
margin: 0 auto;
|
|
401
407
|
}
|
|
402
408
|
|
|
403
|
-
/*
|
|
409
|
+
/* Ajuste da responsividade para mobile */
|
|
404
410
|
@media (max-width: 754px) {
|
|
405
411
|
.main-section {
|
|
406
412
|
flex-direction: column;
|
|
407
|
-
gap:
|
|
413
|
+
gap: 5px; /* menor gap */
|
|
408
414
|
align-items: center;
|
|
409
415
|
}
|
|
410
416
|
|
|
@@ -414,28 +420,30 @@ label="${V("Let's go!")}"
|
|
|
414
420
|
}
|
|
415
421
|
|
|
416
422
|
.images-section svg {
|
|
417
|
-
width: 80%;
|
|
418
|
-
max-width: 180px;
|
|
423
|
+
width: 80%; /* reduzir para não quebrar botão */
|
|
424
|
+
max-width: 180px; /* altura menor */
|
|
425
|
+
height: auto;
|
|
419
426
|
}
|
|
420
427
|
|
|
421
428
|
.tips-section {
|
|
422
429
|
width: 100%;
|
|
423
430
|
gap: 6px;
|
|
424
|
-
align-items: flex-start;
|
|
431
|
+
align-items: flex-start; /* alinhar à esquerda */
|
|
425
432
|
}
|
|
426
433
|
|
|
427
|
-
|
|
434
|
+
form {
|
|
435
|
+
align-items: flex-start; /* alinhar labels e inputs à esquerda */
|
|
428
436
|
width: 100%;
|
|
429
|
-
align-items: flex-start;
|
|
430
437
|
}
|
|
431
438
|
|
|
432
|
-
|
|
439
|
+
input {
|
|
433
440
|
max-width: 100%;
|
|
434
441
|
font-size: 14px;
|
|
435
442
|
padding: 10px;
|
|
436
443
|
}
|
|
437
444
|
|
|
438
|
-
|
|
445
|
+
label {
|
|
446
|
+
text-align: left;
|
|
439
447
|
font-size: 14px;
|
|
440
448
|
}
|
|
441
449
|
|
|
@@ -455,56 +463,98 @@ label="${V("Let's go!")}"
|
|
|
455
463
|
|
|
456
464
|
.tip-title {
|
|
457
465
|
font-size: 12px;
|
|
466
|
+
text-align: left;
|
|
458
467
|
}
|
|
459
468
|
|
|
460
469
|
.tip-text {
|
|
461
470
|
font-size: 11px;
|
|
462
|
-
|
|
471
|
+
text-align: left;
|
|
472
|
+
margin-left: 0; /* remove centralização */
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
.tip-item {
|
|
476
|
+
margin-bottom: 6px;
|
|
463
477
|
}
|
|
464
478
|
|
|
465
479
|
.buttons {
|
|
480
|
+
gap: 8px;
|
|
466
481
|
width: 100%;
|
|
467
482
|
max-width: 100%;
|
|
468
|
-
gap: 8px;
|
|
469
483
|
margin-top: 12px;
|
|
470
484
|
}
|
|
471
485
|
}
|
|
472
486
|
|
|
473
487
|
/* Ajuste fino para iPhones muito pequenos */
|
|
474
488
|
@media (max-width: 380px) {
|
|
475
|
-
|
|
476
|
-
|
|
489
|
+
.main-section {
|
|
490
|
+
gap: 1px;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
.images-section {
|
|
494
|
+
order: -1;
|
|
495
|
+
width: 30%;
|
|
477
496
|
}
|
|
478
497
|
|
|
479
498
|
.images-section svg {
|
|
480
|
-
|
|
499
|
+
width: 80%; /* reduzir para não quebrar botão */
|
|
500
|
+
max-width: 150px; /* altura menor */
|
|
501
|
+
height: auto;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
.tips-section {
|
|
505
|
+
gap: 1px;
|
|
506
|
+
label {
|
|
507
|
+
font-size: 12px;
|
|
508
|
+
}
|
|
509
|
+
input {
|
|
510
|
+
font-size: 12px;
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
h3 {
|
|
514
|
+
font-size: 14px;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
|
|
518
|
+
|
|
519
|
+
|
|
520
|
+
.xact-button {
|
|
521
|
+
max-width: 100%;
|
|
481
522
|
}
|
|
482
523
|
|
|
483
524
|
.header-text {
|
|
484
|
-
font-size:
|
|
525
|
+
font-size: 14px;
|
|
526
|
+
text-align: center;
|
|
485
527
|
}
|
|
486
528
|
|
|
487
529
|
.description-text {
|
|
488
|
-
font-size:
|
|
530
|
+
font-size: 12px;
|
|
531
|
+
text-align: center;
|
|
489
532
|
}
|
|
490
533
|
|
|
491
534
|
.tip-title {
|
|
492
|
-
font-size:
|
|
535
|
+
font-size: 12px;
|
|
536
|
+
text-align: left;
|
|
493
537
|
}
|
|
494
538
|
|
|
495
539
|
.tip-text {
|
|
496
|
-
font-size:
|
|
540
|
+
font-size: 11px;
|
|
541
|
+
text-align: left;
|
|
542
|
+
margin-left: 0; /* remove centralização */
|
|
497
543
|
}
|
|
498
544
|
|
|
499
|
-
.
|
|
500
|
-
|
|
545
|
+
.tip-item {
|
|
546
|
+
margin-bottom: 1px;
|
|
501
547
|
}
|
|
502
548
|
|
|
503
549
|
.buttons {
|
|
504
|
-
gap:
|
|
550
|
+
gap: 2px;
|
|
551
|
+
width: 100%;
|
|
552
|
+
max-width: 100%;
|
|
553
|
+
margin-top: 1px;
|
|
505
554
|
}
|
|
506
555
|
}
|
|
507
556
|
|
|
557
|
+
|
|
508
558
|
|
|
509
559
|
`,kA([c({type:Number})],Y.prototype,"height",2),kA([c({type:Function})],Y.prototype,"onStartMeasurement",2),Y=kA([R("xact-step-one"),w()],Y);var Rt=Object.getOwnPropertyDescriptor,Ht=(r,A,t,l)=>{for(var e=l>1?void 0:l?Rt(A,t):A,p=r.length-1,n;p>=0;p--)(n=r[p])&&(e=n(e)||e);return e};let TA=class extends X{render(){return J`
|
|
510
560
|
<footer class="modal-footer">
|
|
@@ -993,7 +1043,7 @@ label="${V("Let's go!")}"
|
|
|
993
1043
|
}
|
|
994
1044
|
}
|
|
995
1045
|
|
|
996
|
-
`,JA([c({type:Number})],Q.prototype,"height",2),JA([c({type:Function})],Q.prototype,"onStep2advancement",2),Q=JA([R("xact-step-informs"),w()],Q);const IA="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",ht="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",Et="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";var It=Object.defineProperty,wt=Object.getOwnPropertyDescriptor,u=(r,A,t,l)=>{for(var e=l>1?void 0:l?wt(A,t):A,p=r.length-1,n;p>=0;p--)(n=r[p])&&(e=(l?n(A,t,e):n(e))||e);return l&&e&&It(A,t,e),e};const{getLocale:Ct,setLocale:XA}=Ut({sourceLocale:EA,targetLocales:Wt,loadLocale:r=>H(Object.assign({"./generated/locales/pt-BR.ts":()=>Promise.resolve().then(()=>Yt)}),`./generated/locales/${r}.ts`,4)});a.BodyMeasurer=class extends X{constructor(){super(...arguments),this.spinnerFrame=0,this.apiKey="DB8mP9gStPfvdyeYbbuCV4Zf3SH745dI",this.tenantId="1",this.productSku="123456",this.apiUrl="https://xactsize-dotnet-api-923169850574.southamerica-east1.run.app/api/measurer/measure/body",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=V("Position yourself in front of the camera"),this.shouldStartMeasurement=!1,this.isLoading=!1,this.isFetching=!1,this.videoElement=null,this.stream=null,this.poolingTimeout=null,this.instructionMessageTimeout=null,this.cameras=[],this.currentCameraId=null}firstUpdated(){this.startSpinnerAnimation()}startSpinnerAnimation(){const A=[Et,ht,IA];this.spinnerInterval=setInterval(()=>{var l;const t=(l=this.shadowRoot)==null?void 0:l.querySelector(".spinner");t&&(t.src=A[this.spinnerFrame],this.spinnerFrame=(this.spinnerFrame+1)%A.length)},300)}get culture(){return this._culture}set culture(A){const t=this._culture;this._culture=A,this.requestUpdate("culture",t),this._applyLocale(A).catch(console.error)}async _applyLocale(A){try{this._isLocaleLoading=!0,this.requestUpdate(),await XA(A)}catch(t){console.error("Failed to load locale",A,t),await XA(EA)}finally{this._isLocaleLoading=!1,this.requestUpdate()}}get errorMap(){return{ERR_RIGHT_ARM_TOO_HIGH:V("Lower your right arm",{id:"ERR_RIGHT_ARM_TOO_HIGH"}),ERR_LEFT_ARM_TOO_HIGH:V("Lower your left arm",{id:"ERR_LEFT_ARM_TOO_HIGH"}),ERR_ARMS_NOT_RAISED:V("Raise both arms to a 45-degree angle",{id:"ERR_ARMS_NOT_RAISED"}),ERR_RIGHT_ARM_NOT_RAISED:V("Raise your right arm to a 45-degree angle",{id:"ERR_RIGHT_ARM_NOT_RAISED"}),ERR_LEFT_ARM_NOT_RAISED:V("Raise your left arm to a 45-degree angle",{id:"ERR_LEFT_ARM_NOT_RAISED"}),ERR_BODY_LANDMARKS_NOT_DETECTED:V("Ensure your full body is visible in the camera",{id:"ERR_BODY_LANDMARKS_NOT_DETECTED"}),ERR_HIPS_NOT_VISIBLE:V("Adjust your position to show your hips",{id:"ERR_HIPS_NOT_VISIBLE"}),ERR_TOO_CLOSE_TO_CAMERA:V("Step back from the camera",{id:"ERR_TOO_CLOSE_TO_CAMERA"}),ERR_NOT_SIDE_VIEW:V("Turn to show your side profile",{id:"ERR_NOT_SIDE_VIEW"}),ERR_INVALID_CLOTHING_TYPE:V("This clothing type is not supported; please contact support",{id:"ERR_INVALID_CLOTHING_TYPE"}),ERR_UPPER_BODY_NOT_VISIBLE:V("Adjust your position to show your upper body",{id:"ERR_UPPER_BODY_NOT_VISIBLE"}),ERR_HEAD_TOO_CLOSE_TO_EDGE:V("Move your head away from the edge of the frame",{id:"ERR_HEAD_TOO_CLOSE_TO_EDGE"}),ERR_LOWER_BODY_NOT_VISIBLE:V("Adjust your position to show your lower body",{id:"ERR_LOWER_BODY_NOT_VISIBLE"}),ERR_FEET_TOO_CLOSE_TO_EDGE:V("Move your feet away from the edge of the frame",{id:"ERR_FEET_TOO_CLOSE_TO_EDGE"}),ERR_BODY_TOO_CLOSE_TO_EDGE:V("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:V("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:V("Move to the right to center your body",{id:"ERR_BODY_TOO_CLOSE_TO_EDGE_MOVE_RIGHT"}),ERR_SHOULDERS_NOT_VISIBLE:V("Adjust your position to show your shoulders",{id:"ERR_SHOULDERS_NOT_VISIBLE"}),ERR_HEIGHT_MEASUREMENT_FAILED:V("Stand straight and ensure your full body is visible",{id:"ERR_HEIGHT_MEASUREMENT_FAILED"}),ERR_HEAD_POINT_NOT_DETECTED:V("Ensure your head is fully visible in the frame",{id:"ERR_HEAD_POINT_NOT_DETECTED"}),ERR_INCORRECT_POSTURE:V("Stand straight with your shoulders back",{id:"ERR_INCORRECT_POSTURE"}),ERR_HEM_MEASUREMENT_FAILED:V("Ensure your clothing hem is visible and clear",{id:"ERR_HEM_MEASUREMENT_FAILED"}),ERR_SHOULDER_MEASUREMENT_FAILED:V("Keep your shoulders relaxed and visible",{id:"ERR_SHOULDER_MEASUREMENT_FAILED"}),ERR_ARM_NOT_STRETCHED:V("Stretch your arms fully",{id:"ERR_ARM_NOT_STRETCHED"}),ERR_LEGS_NOT_DETECTED:V("Ensure your legs are fully visible in the frame",{id:"ERR_LEGS_NOT_DETECTED"}),ERR_HIPS_MEASUREMENT_FAILED:V("Stand straight and ensure your hips are visible",{id:"ERR_HIPS_MEASUREMENT_FAILED"}),ERR_WAIST_MEASUREMENT_FAILED:V("Stand straight and ensure your waist is visible",{id:"ERR_WAIST_MEASUREMENT_FAILED"}),ERR_INVALID_MEASURE_SIDE_VIEW:V("Turn to show a clear side profile",{id:"ERR_INVALID_MEASURE_SIDE_VIEW"}),ERR_INVALID_BODY_HEIGHT_TYPE:V("Ensure your full body is visible for height measurement",{id:"ERR_INVALID_BODY_HEIGHT_TYPE"}),ERR_IMAGE_LOAD_FAILED:V("Try again later; the image could not be processed",{id:"ERR_IMAGE_LOAD_FAILED"}),ERR_HEIGHT_INVALID:V("Height must be between 50 and 300 cm",{id:"ERR_HEIGHT_INVALID"})}}getTranslatedMessage(A){const t=this.errorMap[A];return t||(console.info("Error code is missing",A),V("An unexpected error occurred"))}connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this.handleEscKey.bind(this))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.handleEscKey.bind(this)),this.stopPolling(),clearInterval(this.spinnerInterval)}handleEscKey(A){A.key==="Escape"&&this.showModal&&this.closeModal()}openModal(){this.showModal=!0,this.step=1,this.height=0,this.instructionMessage=V("Position yourself in front of the camera")}closeModal(){this.showModal=!1,this.onMeasurementCanceled&&typeof this.onMeasurementCanceled=="function"&&this.onMeasurementCanceled(),this.stopPolling(),this.dispatchEvent(new CustomEvent("measurementCanceled",{detail:{}}))}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}updated(A){super.updated(A),A.has("step")&&this.step===3&&this.shouldStartMeasurement&&(this.initializeMeasurement(),this.shouldStartMeasurement=!1)}async initializeMeasurement(){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.startPolling())}catch{this.errorMessage=V("Error accessing webcam")}}async loadCameras(){try{const A=await navigator.mediaDevices.enumerateDevices();this.cameras=A.filter(t=>t.kind==="videoinput"),this.cameras.length>0&&(this.currentCameraId=this.cameras[0].deviceId)}catch(A){console.error("Error enumerating devices:",A)}}async flipCamera(){if(this.cameras.length<2)return;this.isLoading=!0,this.stopPolling();const t=(this.cameras.findIndex(l=>l.deviceId===this.currentCameraId)+1)%this.cameras.length;this.currentCameraId=this.cameras[t].deviceId;try{this.stream&&this.stream.getTracks().forEach(l=>l.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=V("Error switching camera")}finally{this.isLoading=!1}}async startPolling(){const A=async()=>{if(!this.videoElement||!this.stream||this.isFetching)return;const t=document.createElement("canvas");t.width=this.videoElement.videoWidth,t.height=this.videoElement.videoHeight;const l=t.getContext("2d");l==null||l.drawImage(this.videoElement,0,0,t.width,t.height);const e=await new Promise(S=>t.toBlob(q=>S(q),"image/jpeg")),p=new File([e],"frame.jpg",{type:"image/jpeg"}),n=new FormData;n.append("image",p),n.append("height",this.height.toString()),n.append("productSku",this.productSku),this.measurerKey&&n.append("measurerKey",this.measurerKey);try{this.isFetching=!0,this.isLoading=!0,this.poolingTimeout!==null&&(clearTimeout(this.poolingTimeout),this.poolingTimeout=null),this.instructionMessageTimeout!==null&&(clearTimeout(this.instructionMessageTimeout),this.instructionMessageTimeout=null);const q=await(await fetch(this.apiUrl,{method:"POST",body:n,headers:{Accept:"application/json","Cache-Control":"no-store",Pragma:"no-cache","X-Api-Key":this.apiKey}})).json();this.isFetching=!1,this.isLoading=!1,this.errorMessage=JSON.stringify(q),q.success?(this.measurements=q.measurements,this.recommendedSize=q.chosenSize,this.instructionMessage=V("Measurement successful!"),this.stopPolling(),this.step=4):(this.instructionMessage=this.getTranslatedMessage(q.message||"UNKNOWN_ERROR"),this.instructionMessageTimeout=setTimeout(()=>{this.recommendedSize||(this.instructionMessage=V("Position yourself in front of the camera"),this.poolingTimeout=setTimeout(A,0))},2e3))}catch{this.isFetching=!1,this.isLoading=!1,this.instructionMessage=V("Error processing measurement"),this.instructionMessageTimeout=setTimeout(()=>{this.recommendedSize||(this.instructionMessage=V("Position yourself in front of the camera"),this.poolingTimeout=setTimeout(A,0))},2e3)}};A()}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(A=>A.stop()),this.stream=null)}acceptMeasurement(){this.dispatchEvent(new CustomEvent("measurementAccepted",{detail:{size:this.recommendedSize}})),this.onMeasurementAccepted&&typeof this.onMeasurementAccepted=="function"&&this.onMeasurementAccepted(),this.showModal=!1,this.stopPolling()}resetMeasurement(){this.step=1,this.height=0,this.recommendedSize="",this.measurements={},this.stopPolling()}stopMeasurement(){this.resetMeasurement(),this.showModal=!1}render(){return this._isLocaleLoading?J`<div hidden></div>`:J`
|
|
1046
|
+
`,JA([c({type:Number})],Q.prototype,"height",2),JA([c({type:Function})],Q.prototype,"onStep2advancement",2),Q=JA([R("xact-step-informs"),w()],Q);const IA="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",ht="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",Et="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";var It=Object.defineProperty,wt=Object.getOwnPropertyDescriptor,u=(r,A,t,l)=>{for(var e=l>1?void 0:l?wt(A,t):A,p=r.length-1,n;p>=0;p--)(n=r[p])&&(e=(l?n(A,t,e):n(e))||e);return l&&e&&It(A,t,e),e};const{getLocale:Ct,setLocale:XA}=Ut({sourceLocale:EA,targetLocales:Wt,loadLocale:r=>H(Object.assign({"./generated/locales/pt-BR.ts":()=>Promise.resolve().then(()=>Yt)}),`./generated/locales/${r}.ts`,4)});S.BodyMeasurer=class extends X{constructor(){super(...arguments),this.spinnerFrame=0,this.apiKey="DB8mP9gStPfvdyeYbbuCV4Zf3SH745dI",this.tenantId="1",this.productSku="123456",this.apiUrl="https://xactsize-dotnet-api-923169850574.southamerica-east1.run.app/api/measurer/measure/body",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=V("Position yourself in front of the camera"),this.shouldStartMeasurement=!1,this.isLoading=!1,this.isFetching=!1,this.videoElement=null,this.stream=null,this.poolingTimeout=null,this.instructionMessageTimeout=null,this.cameras=[],this.currentCameraId=null}firstUpdated(){this.startSpinnerAnimation()}startSpinnerAnimation(){const A=[Et,ht,IA];this.spinnerInterval=setInterval(()=>{var l;const t=(l=this.shadowRoot)==null?void 0:l.querySelector(".spinner");t&&(t.src=A[this.spinnerFrame],this.spinnerFrame=(this.spinnerFrame+1)%A.length)},300)}get culture(){return this._culture}set culture(A){const t=this._culture;this._culture=A,this.requestUpdate("culture",t),this._applyLocale(A).catch(console.error)}async _applyLocale(A){try{this._isLocaleLoading=!0,this.requestUpdate(),await XA(A)}catch(t){console.error("Failed to load locale",A,t),await XA(EA)}finally{this._isLocaleLoading=!1,this.requestUpdate()}}get errorMap(){return{ERR_RIGHT_ARM_TOO_HIGH:V("Lower your right arm",{id:"ERR_RIGHT_ARM_TOO_HIGH"}),ERR_LEFT_ARM_TOO_HIGH:V("Lower your left arm",{id:"ERR_LEFT_ARM_TOO_HIGH"}),ERR_ARMS_NOT_RAISED:V("Raise both arms to a 45-degree angle",{id:"ERR_ARMS_NOT_RAISED"}),ERR_RIGHT_ARM_NOT_RAISED:V("Raise your right arm to a 45-degree angle",{id:"ERR_RIGHT_ARM_NOT_RAISED"}),ERR_LEFT_ARM_NOT_RAISED:V("Raise your left arm to a 45-degree angle",{id:"ERR_LEFT_ARM_NOT_RAISED"}),ERR_BODY_LANDMARKS_NOT_DETECTED:V("Ensure your full body is visible in the camera",{id:"ERR_BODY_LANDMARKS_NOT_DETECTED"}),ERR_HIPS_NOT_VISIBLE:V("Adjust your position to show your hips",{id:"ERR_HIPS_NOT_VISIBLE"}),ERR_TOO_CLOSE_TO_CAMERA:V("Step back from the camera",{id:"ERR_TOO_CLOSE_TO_CAMERA"}),ERR_NOT_SIDE_VIEW:V("Turn to show your side profile",{id:"ERR_NOT_SIDE_VIEW"}),ERR_INVALID_CLOTHING_TYPE:V("This clothing type is not supported; please contact support",{id:"ERR_INVALID_CLOTHING_TYPE"}),ERR_UPPER_BODY_NOT_VISIBLE:V("Adjust your position to show your upper body",{id:"ERR_UPPER_BODY_NOT_VISIBLE"}),ERR_HEAD_TOO_CLOSE_TO_EDGE:V("Move your head away from the edge of the frame",{id:"ERR_HEAD_TOO_CLOSE_TO_EDGE"}),ERR_LOWER_BODY_NOT_VISIBLE:V("Adjust your position to show your lower body",{id:"ERR_LOWER_BODY_NOT_VISIBLE"}),ERR_FEET_TOO_CLOSE_TO_EDGE:V("Move your feet away from the edge of the frame",{id:"ERR_FEET_TOO_CLOSE_TO_EDGE"}),ERR_BODY_TOO_CLOSE_TO_EDGE:V("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:V("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:V("Move to the right to center your body",{id:"ERR_BODY_TOO_CLOSE_TO_EDGE_MOVE_RIGHT"}),ERR_SHOULDERS_NOT_VISIBLE:V("Adjust your position to show your shoulders",{id:"ERR_SHOULDERS_NOT_VISIBLE"}),ERR_HEIGHT_MEASUREMENT_FAILED:V("Stand straight and ensure your full body is visible",{id:"ERR_HEIGHT_MEASUREMENT_FAILED"}),ERR_HEAD_POINT_NOT_DETECTED:V("Ensure your head is fully visible in the frame",{id:"ERR_HEAD_POINT_NOT_DETECTED"}),ERR_INCORRECT_POSTURE:V("Stand straight with your shoulders back",{id:"ERR_INCORRECT_POSTURE"}),ERR_HEM_MEASUREMENT_FAILED:V("Ensure your clothing hem is visible and clear",{id:"ERR_HEM_MEASUREMENT_FAILED"}),ERR_SHOULDER_MEASUREMENT_FAILED:V("Keep your shoulders relaxed and visible",{id:"ERR_SHOULDER_MEASUREMENT_FAILED"}),ERR_ARM_NOT_STRETCHED:V("Stretch your arms fully",{id:"ERR_ARM_NOT_STRETCHED"}),ERR_LEGS_NOT_DETECTED:V("Ensure your legs are fully visible in the frame",{id:"ERR_LEGS_NOT_DETECTED"}),ERR_HIPS_MEASUREMENT_FAILED:V("Stand straight and ensure your hips are visible",{id:"ERR_HIPS_MEASUREMENT_FAILED"}),ERR_WAIST_MEASUREMENT_FAILED:V("Stand straight and ensure your waist is visible",{id:"ERR_WAIST_MEASUREMENT_FAILED"}),ERR_INVALID_MEASURE_SIDE_VIEW:V("Turn to show a clear side profile",{id:"ERR_INVALID_MEASURE_SIDE_VIEW"}),ERR_INVALID_BODY_HEIGHT_TYPE:V("Ensure your full body is visible for height measurement",{id:"ERR_INVALID_BODY_HEIGHT_TYPE"}),ERR_IMAGE_LOAD_FAILED:V("Try again later; the image could not be processed",{id:"ERR_IMAGE_LOAD_FAILED"}),ERR_HEIGHT_INVALID:V("Height must be between 50 and 300 cm",{id:"ERR_HEIGHT_INVALID"})}}getTranslatedMessage(A){const t=this.errorMap[A];return t||(console.info("Error code is missing",A),V("An unexpected error occurred"))}connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this.handleEscKey.bind(this))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.handleEscKey.bind(this)),this.stopPolling(),clearInterval(this.spinnerInterval)}handleEscKey(A){A.key==="Escape"&&this.showModal&&this.closeModal()}openModal(){this.showModal=!0,this.step=1,this.height=0,this.instructionMessage=V("Position yourself in front of the camera")}closeModal(){this.showModal=!1,this.onMeasurementCanceled&&typeof this.onMeasurementCanceled=="function"&&this.onMeasurementCanceled(),this.stopPolling(),this.dispatchEvent(new CustomEvent("measurementCanceled",{detail:{}}))}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}updated(A){super.updated(A),A.has("step")&&this.step===3&&this.shouldStartMeasurement&&(this.initializeMeasurement(),this.shouldStartMeasurement=!1)}async initializeMeasurement(){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.startPolling())}catch{this.errorMessage=V("Error accessing webcam")}}async loadCameras(){try{const A=await navigator.mediaDevices.enumerateDevices();this.cameras=A.filter(t=>t.kind==="videoinput"),this.cameras.length>0&&(this.currentCameraId=this.cameras[0].deviceId)}catch(A){console.error("Error enumerating devices:",A)}}async flipCamera(){if(this.cameras.length<2)return;this.isLoading=!0,this.stopPolling();const t=(this.cameras.findIndex(l=>l.deviceId===this.currentCameraId)+1)%this.cameras.length;this.currentCameraId=this.cameras[t].deviceId;try{this.stream&&this.stream.getTracks().forEach(l=>l.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=V("Error switching camera")}finally{this.isLoading=!1}}async startPolling(){const A=async()=>{if(!this.videoElement||!this.stream||this.isFetching)return;const t=document.createElement("canvas");t.width=this.videoElement.videoWidth,t.height=this.videoElement.videoHeight;const l=t.getContext("2d");l==null||l.drawImage(this.videoElement,0,0,t.width,t.height);const e=await new Promise(a=>t.toBlob(q=>a(q),"image/jpeg")),p=new File([e],"frame.jpg",{type:"image/jpeg"}),n=new FormData;n.append("image",p),n.append("height",this.height.toString()),n.append("productSku",this.productSku),this.measurerKey&&n.append("measurerKey",this.measurerKey);try{this.isFetching=!0,this.isLoading=!0,this.poolingTimeout!==null&&(clearTimeout(this.poolingTimeout),this.poolingTimeout=null),this.instructionMessageTimeout!==null&&(clearTimeout(this.instructionMessageTimeout),this.instructionMessageTimeout=null);const q=await(await fetch(this.apiUrl,{method:"POST",body:n,headers:{Accept:"application/json","Cache-Control":"no-store",Pragma:"no-cache","X-Api-Key":this.apiKey}})).json();this.isFetching=!1,this.isLoading=!1,this.errorMessage=JSON.stringify(q),q.success?(this.measurements=q.measurements,this.recommendedSize=q.chosenSize,this.instructionMessage=V("Measurement successful!"),this.stopPolling(),this.step=4):(this.instructionMessage=this.getTranslatedMessage(q.message||"UNKNOWN_ERROR"),this.instructionMessageTimeout=setTimeout(()=>{this.recommendedSize||(this.instructionMessage=V("Position yourself in front of the camera"),this.poolingTimeout=setTimeout(A,0))},2e3))}catch{this.isFetching=!1,this.isLoading=!1,this.instructionMessage=V("Error processing measurement"),this.instructionMessageTimeout=setTimeout(()=>{this.recommendedSize||(this.instructionMessage=V("Position yourself in front of the camera"),this.poolingTimeout=setTimeout(A,0))},2e3)}};A()}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(A=>A.stop()),this.stream=null)}acceptMeasurement(){this.dispatchEvent(new CustomEvent("measurementAccepted",{detail:{size:this.recommendedSize}})),this.onMeasurementAccepted&&typeof this.onMeasurementAccepted=="function"&&this.onMeasurementAccepted(),this.showModal=!1,this.stopPolling()}resetMeasurement(){this.step=1,this.height=0,this.recommendedSize="",this.measurements={},this.stopPolling()}stopMeasurement(){this.resetMeasurement(),this.showModal=!1}render(){return this._isLocaleLoading?J`<div hidden></div>`:J`
|
|
997
1047
|
<xact-button @click=${this.openModal} label="${V("Find your Xactsize")}"></xact-button>
|
|
998
1048
|
|
|
999
1049
|
${this.showModal?J`
|
|
@@ -1050,7 +1100,7 @@ label="${V("Let's go!")}"
|
|
|
1050
1100
|
|
|
1051
1101
|
</div>
|
|
1052
1102
|
`:""}
|
|
1053
|
-
`}},
|
|
1103
|
+
`}},S.BodyMeasurer.styles=m`
|
|
1054
1104
|
:host {
|
|
1055
1105
|
display: block;
|
|
1056
1106
|
font-family: Arial, sans-serif;
|
|
@@ -1478,4 +1528,4 @@ label="${V("Let's go!")}"
|
|
|
1478
1528
|
}
|
|
1479
1529
|
|
|
1480
1530
|
|
|
1481
|
-
`,u([c({type:String,attribute:"api-key"})],
|
|
1531
|
+
`,u([c({type:String,attribute:"api-key"})],S.BodyMeasurer.prototype,"apiKey",2),u([c({type:String,attribute:"tenant-id"})],S.BodyMeasurer.prototype,"tenantId",2),u([c({type:String,attribute:"product-sku"})],S.BodyMeasurer.prototype,"productSku",2),u([c({type:String,attribute:"api-url"})],S.BodyMeasurer.prototype,"apiUrl",2),u([c({type:Function,attribute:"onmeasurementaccepted"})],S.BodyMeasurer.prototype,"onMeasurementAccepted",2),u([c({type:Function,attribute:"onmeasurementcanceled"})],S.BodyMeasurer.prototype,"onMeasurementCanceled",2),u([c({type:String})],S.BodyMeasurer.prototype,"culture",1),u([T()],S.BodyMeasurer.prototype,"errorMap",1),u([T()],S.BodyMeasurer.prototype,"measurerKey",2),u([T()],S.BodyMeasurer.prototype,"_isLocaleLoading",2),u([T()],S.BodyMeasurer.prototype,"showModal",2),u([T()],S.BodyMeasurer.prototype,"step",2),u([T()],S.BodyMeasurer.prototype,"height",2),u([T()],S.BodyMeasurer.prototype,"recommendedSize",2),u([T()],S.BodyMeasurer.prototype,"measurements",2),u([T()],S.BodyMeasurer.prototype,"errorMessage",2),u([T()],S.BodyMeasurer.prototype,"instructionMessage",2),u([T()],S.BodyMeasurer.prototype,"shouldStartMeasurement",2),u([T()],S.BodyMeasurer.prototype,"isLoading",2),u([T()],S.BodyMeasurer.prototype,"isFetching",2),u([T()],S.BodyMeasurer.prototype,"cameras",2),u([T()],S.BodyMeasurer.prototype,"currentCameraId",2),S.BodyMeasurer=u([R("body-measurer"),w()],S.BodyMeasurer);const Yt=Object.freeze(Object.defineProperty({__proto__:null,templates:{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",s1dd794b3870bcae0:"Começar",s2d726e20085011c1:"Altura (cm)",s2f77566c78235d88:"Erro acessando a câmera",s322c72546e939809:"Escolha uma área bem iluminada onde você possa ver sua imagem claramente.",s34c58d3d12e5f890:"Erro ao mudar a câmera",s396efd2b23a16ac9:"Posicione-se contra um fundo simples.",s3d324b180f982d46:"Tenha certeza de que seu corpo está totalmente visível",s3e742a73512eb1da:"Para começarmos, informe sua altura",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",s7c5b35754de07309:"Vamos lá!",s81d43b9b25d0775b:"Roupas",s88a3f5e6a9d9945d:"Use roupas que você costuma usar no dia a dia.",s8fb9f388e75ffe11:"Enquadramento",s952ed559991cf0b4:"Desenvolvido por",sa4ad2b9cd4ea10ba:"Fundo limpo",scf8d43c4a5cb71fa:"Mantenha uma postura ereta, com os braços ligeiramente afastados do corpo",sd13d4c82d57859fc:"Posicione-se em frente a câmera",sdabfef8968aeb5fa:"Um erro inesperado aconteceu",sdf9f9c621b6316e7:"Medir novamente",se940dab2e0b7a710:"Antes de começar",sf315699feee25406:"Descubra o tamanho ideal para você",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.",sc9705de67a8b284f:"Maintain an upright posture with your arms away from your body."}},Symbol.toStringTag,{value:"Module"}));S.getLocale=Ct,S.setLocale=XA,Object.defineProperty(S,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED