@ppg_pl/pallete 2.0.25 → 2.0.26

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.
Files changed (31) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/my-backdrop_8.cjs.entry.js +4 -1
  3. package/dist/cjs/my-backdrop_8.cjs.entry.js.map +1 -1
  4. package/dist/cjs/pallete.cjs.js +1 -1
  5. package/dist/collection/components/my-colorinfo/my-colorinfo.css +350 -0
  6. package/dist/collection/components/my-colorinfo/my-colorinfo.js +11 -0
  7. package/dist/collection/components/my-colorinfo/my-colorinfo.js.map +1 -1
  8. package/dist/collection/components/my-modal/my-modal.css +1 -341
  9. package/dist/collection/components/my-modal/my-modal.js +1 -0
  10. package/dist/collection/components/my-modal/my-modal.js.map +1 -1
  11. package/dist/components/my-colorinfo2.js +4 -1
  12. package/dist/components/my-colorinfo2.js.map +1 -1
  13. package/dist/components/my-modal2.js +2 -2
  14. package/dist/components/my-modal2.js.map +1 -1
  15. package/dist/esm/loader.js +1 -1
  16. package/dist/esm/my-backdrop_8.entry.js +4 -1
  17. package/dist/esm/my-backdrop_8.entry.js.map +1 -1
  18. package/dist/esm/pallete.js +1 -1
  19. package/dist/pallete/p-2394bcec.entry.js +2 -0
  20. package/dist/pallete/p-2394bcec.entry.js.map +1 -0
  21. package/dist/pallete/pallete.esm.js +1 -1
  22. package/package.json +1 -1
  23. package/www/build/p-2394bcec.entry.js +2 -0
  24. package/www/build/p-2394bcec.entry.js.map +1 -0
  25. package/www/build/{p-8c41f668.js → p-c5910eb7.js} +1 -1
  26. package/www/build/pallete.esm.js +1 -1
  27. package/www/index.html +1 -1
  28. package/dist/pallete/p-d142c667.entry.js +0 -2
  29. package/dist/pallete/p-d142c667.entry.js.map +0 -1
  30. package/www/build/p-d142c667.entry.js +0 -2
  31. package/www/build/p-d142c667.entry.js.map +0 -1
@@ -151,229 +151,6 @@
151
151
  justify-content: center;
152
152
  }
153
153
  }
154
- .my-modal__wrapper .boxes__box-content {
155
- width: 100%;
156
- margin-bottom: 5px;
157
- height: 500px;
158
- text-align: left;
159
- display: flex;
160
- flex-direction: row;
161
- justify-content: space-between;
162
- position: relative;
163
- }
164
- .my-modal__wrapper .boxes__box-content .closebtn {
165
- position: absolute;
166
- right: 10px;
167
- top: 10px;
168
- width: 53px;
169
- height: 53px;
170
- cursor: pointer;
171
- object-fit: cover;
172
- z-index: 9999;
173
- }
174
- @media (max-width: 1024px) {
175
- .my-modal__wrapper .boxes__box-content {
176
- flex-direction: column-reverse;
177
- height: auto;
178
- }
179
- }
180
- @media (max-width: 768px) {
181
- .my-modal__wrapper .boxes__box-content {
182
- margin: 0 auto;
183
- }
184
- }
185
- .my-modal__wrapper .boxes__box-content__info {
186
- width: 40%;
187
- padding: 50px 40px;
188
- position: relative;
189
- display: flex;
190
- flex-direction: column;
191
- justify-content: space-between;
192
- }
193
- @media (max-width: 1024px) {
194
- .my-modal__wrapper .boxes__box-content__info {
195
- width: 100%;
196
- padding: 15px;
197
- min-height: 100px;
198
- }
199
- }
200
- @media (max-width: 768px) {
201
- .my-modal__wrapper .boxes__box-content__info {
202
- min-height: auto;
203
- }
204
- }
205
- .my-modal__wrapper .boxes__box-content__info__header {
206
- display: flex;
207
- flex-direction: column;
208
- align-items: flex-start;
209
- }
210
- .my-modal__wrapper .boxes__box-content__info h2 {
211
- font-size: 35px;
212
- font-weight: normal;
213
- margin-bottom: 30px;
214
- color: #232323;
215
- }
216
- @media (max-width: 768px) {
217
- .my-modal__wrapper .boxes__box-content__info h2 {
218
- font-size: 16px;
219
- text-align: center;
220
- margin-bottom: 15px;
221
- margin-top: 5px;
222
- }
223
- }
224
- .my-modal__wrapper .boxes__box-content__info h4 {
225
- margin-top: 0px;
226
- margin-bottom: 15px;
227
- font-size: 16px;
228
- color: #4c4c4c;
229
- }
230
- .my-modal__wrapper .boxes__box-content__info__value {
231
- display: flex;
232
- flex-direction: column;
233
- align-items: flex-start;
234
- gap: 20px;
235
- }
236
- @media (max-width: 1024px) {
237
- .my-modal__wrapper .boxes__box-content__info__value {
238
- justify-content: flex-start;
239
- margin-top: 30px;
240
- }
241
- }
242
- @media (max-width: 768px) {
243
- .my-modal__wrapper .boxes__box-content__info__value {
244
- flex-direction: column;
245
- }
246
- }
247
- @media (max-width: 768px) {
248
- .my-modal__wrapper .boxes__box-content__info__value-image {
249
- margin: 0 auto;
250
- margin-bottom: 10px;
251
- }
252
- }
253
- .my-modal__wrapper .boxes__box-content__info__value-image img {
254
- width: 114px;
255
- object-fit: cover;
256
- }
257
- @media (max-width: 1024px) {
258
- .my-modal__wrapper .boxes__box-content__info__value-image img {
259
- width: 75px;
260
- }
261
- }
262
- .my-modal__wrapper .boxes__box-content__info__value-product {
263
- color: #232323;
264
- margin-left: 10px;
265
- }
266
- @media (max-width: 1024px) {
267
- .my-modal__wrapper .boxes__box-content__info__value-product h2 {
268
- font-size: 26px;
269
- margin: 0;
270
- margin-right: 10px;
271
- }
272
- }
273
- @media (max-width: 768px) {
274
- .my-modal__wrapper .boxes__box-content__info__value-product h2 {
275
- font-size: 16px;
276
- }
277
- }
278
- .my-modal__wrapper .boxes__box-content__info__value-product p {
279
- font-size: 20px;
280
- margin-top: 0px;
281
- margin-bottom: 0px;
282
- }
283
- .my-modal__wrapper .boxes__box-content__info__value-product p:last-of-type {
284
- margin-bottom: 20px;
285
- }
286
- @media (max-width: 1024px) {
287
- .my-modal__wrapper .boxes__box-content__info__value-product p:last-of-type {
288
- margin-bottom: 0;
289
- }
290
- }
291
- @media (max-width: 768px) {
292
- .my-modal__wrapper .boxes__box-content__info__value-product p {
293
- font-size: 10px;
294
- }
295
- }
296
- @media (max-width: 1024px) {
297
- .my-modal__wrapper .boxes__box-content__info__value-product > div {
298
- display: flex;
299
- justify-content: flex-start;
300
- align-items: center;
301
- }
302
- }
303
- @media (max-width: 768px) {
304
- .my-modal__wrapper .boxes__box-content__info__value-product > div {
305
- flex-direction: column;
306
- }
307
- }
308
- .my-modal__wrapper .boxes__box-content__info__tester {
309
- display: flex;
310
- flex-direction: column;
311
- gap: 15px;
312
- width: 100%;
313
- }
314
- @media (max-width: 1024px) {
315
- .my-modal__wrapper .boxes__box-content__info__tester {
316
- text-align: center;
317
- }
318
- }
319
- .my-modal__wrapper .boxes__box-content__info__tester .tester-text h2 {
320
- margin: 0 0 10px;
321
- font-size: 18px;
322
- font-weight: 700;
323
- }
324
- .my-modal__wrapper .boxes__box-content__info__tester .tester-text p {
325
- margin: 0;
326
- font-size: 14px;
327
- }
328
- .my-modal__wrapper .boxes__box-content__info__tester .tester-buy {
329
- display: flex;
330
- align-items: center;
331
- gap: 15px;
332
- }
333
- @media (max-width: 1024px) {
334
- .my-modal__wrapper .boxes__box-content__info__tester .tester-buy {
335
- flex-direction: column;
336
- }
337
- .my-modal__wrapper .boxes__box-content__info__tester .tester-buy button {
338
- margin: 0;
339
- max-width: 100%;
340
- }
341
- }
342
- .my-modal__wrapper .boxes__box-content__info__tester .price {
343
- font-size: 20px;
344
- font-weight: 600;
345
- }
346
- .my-modal__wrapper .boxes__box-content__slider {
347
- width: 60%;
348
- min-width: 60%;
349
- max-width: 60%;
350
- position: relative;
351
- }
352
- @media (max-width: 1024px) {
353
- .my-modal__wrapper .boxes__box-content__slider {
354
- width: 100%;
355
- display: block;
356
- min-width: 100%;
357
- max-width: 100%;
358
- }
359
- }
360
- .my-modal__wrapper .boxes__box-content__slider .color-big-image {
361
- width: 100%;
362
- height: 100%;
363
- object-fit: cover;
364
- }
365
- @media (max-width: 1024px) {
366
- .my-modal__wrapper .boxes__box-content__slider .color-big-image {
367
- height: 300px;
368
- }
369
- }
370
- .my-modal__wrapper .boxes__box-content__white .tester-text,
371
- .my-modal__wrapper .boxes__box-content__white .tester-buy {
372
- color: #fff;
373
- }
374
- .my-modal__wrapper .boxes__box-content__white h2 {
375
- color: #fff;
376
- }
377
154
  .my-modal__wrapper .pagination {
378
155
  margin: 10px 0px;
379
156
  font-size: 16px;
@@ -430,123 +207,6 @@
430
207
  margin-right: 7px;
431
208
  }
432
209
 
433
- .button,
434
- a {
435
- background-color: #fff;
436
- font-size: 16px;
437
- box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.1);
438
- border-radius: 22px;
439
- padding: 10px 35px;
440
- color: #232323;
441
- text-decoration: none;
442
- display: block;
443
- text-align: center;
444
- transition: all 0.7s ease-in-out;
445
- border: none;
446
- cursor: pointer;
447
- display: flex;
448
- align-items: center;
449
- gap: 5px;
450
- }
451
- .button .shape-icon,
452
- a .shape-icon {
453
- display: inline-flex;
454
- }
455
- .button .shape-icon svg,
456
- a .shape-icon svg {
457
- display: block;
458
- }
459
- .button .shape-icon path,
460
- .button .shape-icon .shape-icon__path,
461
- a .shape-icon path,
462
- a .shape-icon .shape-icon__path {
463
- fill: currentColor;
464
- transition: fill 0.7s ease-in-out;
465
- }
466
- .button.fit,
467
- a.fit {
468
- padding: 10px 15px;
469
- }
470
- .button:hover,
471
- a:hover {
472
- color: #fff;
473
- background-color: #232323;
474
- }
475
- .button.brown,
476
- a.brown {
477
- background-color: #3c2114;
478
- color: #fff;
479
- }
480
- .button.brown:hover,
481
- a.brown:hover {
482
- color: #fff;
483
- background-color: #232323;
484
- }
485
- .button.inverse,
486
- a.inverse {
487
- background-color: #232323;
488
- color: #fff;
489
- }
490
- .button.inverse:hover,
491
- a.inverse:hover {
492
- color: #232323;
493
- background-color: #fff;
494
- }
495
- .button.inverse svg path,
496
- a.inverse svg path {
497
- fill: #fff;
498
- }
499
- .button:disabled,
500
- a:disabled {
501
- cursor: not-allowed;
502
- background-color: white;
503
- opacity: 0.5;
504
- }
505
- .button:disabled.brown,
506
- a:disabled.brown {
507
- background-color: black;
508
- color: white;
509
- opacity: 0.5;
510
- }
511
- .button:disabled.inverse,
512
- a:disabled.inverse {
513
- background-color: black;
514
- color: white;
515
- opacity: 0.5;
516
- }
517
- .button:disabled:hover,
518
- a:disabled:hover {
519
- background-color: inherit;
520
- color: inherit;
521
- opacity: 0.5;
522
- }
523
- @media (max-width: 1024px) {
524
- .button,
525
- a {
526
- max-width: 150px;
527
- font-size: 13px;
528
- padding: 12px 25px;
529
- }
530
- }
531
- @media (max-width: 768px) {
532
- .button,
533
- a {
534
- margin: 0 auto;
535
- }
536
- }
537
-
538
- > .button {
210
+ .my-modal > .button {
539
211
  margin: 10px auto;
540
- }
541
-
542
- .divider {
543
- border: 1px solid #4c4c4c;
544
- opacity: 0.2;
545
- margin-bottom: 20px;
546
- }
547
- @media (max-width: 768px) {
548
- .divider {
549
- margin: 10px 0px;
550
- display: none;
551
- }
552
212
  }
@@ -324,6 +324,7 @@ export class MyModal {
324
324
  }, key: `#${i + 1}` }, i + 1)))))))), !this.preloader && this.isMobile && (h("button", { class: "button", onClick: () => this.closeModalHandler() }, "Zamknij"))));
325
325
  }
326
326
  static get is() { return "my-modal"; }
327
+ static get encapsulation() { return "scoped"; }
327
328
  static get originalStyleUrls() {
328
329
  return {
329
330
  "$": ["my-modal.scss"]
@@ -1 +1 @@
1
- {"version":3,"file":"my-modal.js","sourceRoot":"","sources":["../../../src/components/my-modal/my-modal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAgB,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC7H,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7G,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAavC,MAAM,OAAO,OAAO;EAsClB;IArCQ,oBAAe,GAAG,GAAG,CAAC;IACtB,mBAAc,GAAG,EAAE,CAAC;IAC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,OAAO,EAAE,CAAC,CAAC,EAAE;cACX,CAAC,CAAC,cAAc,EAAE,CAAC;cACnB,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YACrB,CAAC,EACD,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,IAEf,CAAC,GAAG,CAAC,CACD,CACR,CAAC,CACE,CACP,CACG,CACP,CACG;MACL,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,QAAQ,IAAI,CACnC,cAAQ,KAAK,EAAC,QAAQ,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,iBAAiB,EAAE,cAErD,CACV,CACG,CACP,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Method, Element, Prop, Event, EventEmitter, h, State, getAssetPath, Listen, Watch } from '@stencil/core';\nimport { APIURL, ApiService, accessToken } from '../api';\nimport { setDataLayer } from '../../gtmUtils';\nimport { AvailableTester, Color, PaginationData, Product, ProductShopRelation } from '../../types';\nimport { fetchCategoryColorsQuery, fetchColorByName, fetchProductColorsQuery, limit } from '../api/services';\nimport { debounce } from '../../utils';\n\ndeclare global {\n interface Window {\n dataLayer: Record<string, any>[];\n }\n}\n\n@Component({\n tag: 'my-modal',\n styleUrl: 'my-modal.scss',\n assetsDirs: ['assets'],\n})\nexport class MyModal {\n private boxDesktopWidth = 130;\n private boxMobileWidth = 70;\n private desktopPadding = 75;\n private mobilePadding = 35;\n private mediumBreakpoint = 1024;\n private colorTimerInterval: ReturnType<typeof setInterval> | undefined;\n\n @Event({ bubbles: true, composed: true }) clearSearchText: EventEmitter;\n @Element() modalEl: HTMLElement;\n\n @Prop() shop: string;\n @Prop() product: string;\n @Prop() baselink: string;\n @Prop() available_testers: AvailableTester[] | null;\n @Prop() price: number | null;\n @Prop() selectedcolor: string | null;\n @Prop() closeImage = 'close.png';\n @Prop() arrowDown = 'arrow_down.png';\n\n @State() chunksNum = 12;\n @State() data: Product | null = null;\n @State() preloader = false;\n @State() loading = false;\n @State() colors: PaginationData<Color> | null = null;\n @State() currentColor: Color | null = null;\n @State() currentIndex: number | null = null;\n @State() infoBoxWidth: number | null = null;\n @State() boxWidth: number = this.boxDesktopWidth; // box width with gap\n @State() padding: number = this.desktopPadding;\n @State() isMobile: boolean = false;\n @State() showRange: boolean = false;\n @State() colorCategories: string[] | null = null;\n @State() selectedCategory: any = null;\n @State() page = 1;\n @State() colorIsSelected = false;\n debouncedSearchColorsHandler: (event: CustomEvent) => void;\n\n constructor() {\n this.debouncedSearchColorsHandler = debounce(this.searchColor.bind(this), 300);\n }\n\n @Watch('chunksNum')\n setInfoBoxWidth(newValue: number) {\n this.infoBoxWidth = newValue * this.boxWidth;\n }\n\n @Watch('data')\n watchPropHandler(newValue: Product) {\n if (newValue.Category.length > 0) {\n this.showRange = true;\n this.handleCategoryClick(newValue.Category[0].Category_id.id);\n } else {\n this.fetchProductColors(String(newValue.id));\n }\n }\n\n private clearInterval = () => {\n this.colorTimerInterval && clearInterval(this.colorTimerInterval);\n this.colorTimerInterval = undefined;\n };\n\n private colorTimer = () => {\n if (this.currentColor && this.currentColor.id) {\n this.colorTimerInterval = setInterval(() => {\n this.currentColor?.name &&\n setDataLayer({\n event: 'ColorTimer',\n shop: this.shop,\n product: this.product,\n color: this.currentColor?.name,\n timer: '10',\n });\n }, 10000);\n } else {\n this.clearInterval();\n }\n };\n\n @Method()\n async open() {\n this.modalEl.style.display = 'block';\n }\n @Event() close: EventEmitter;\n closeModalHandler() {\n this.close.emit();\n }\n\n @Event() readyToCLose: EventEmitter;\n handleReadyToClose(value: boolean) {\n this.readyToCLose.emit({ observable: value });\n }\n\n @Listen('closeInfoBox')\n closeInfoBoxHandler() {\n this.currentColor = null;\n this.currentIndex = null;\n }\n\n private chunks = (xs: Color[], y: Color[][] = []): Color[][] => {\n return xs.length === 0 ? y : this.chunks(xs.slice(this.chunksNum), y.concat([xs.slice(0, this.chunksNum)]));\n };\n\n private calculateBoxCount = () => {\n const modalWidth = this.modalEl.children && this.modalEl.children[0] && this.modalEl.children[0]?.clientWidth - this.padding;\n const boxWidth = this.boxWidth;\n\n const calc = Math.floor(modalWidth / boxWidth);\n\n const boxesCount = calc;\n\n if (!this.preloader) this.chunksNum = boxesCount;\n };\n\n private displayForMobile = () => {\n if (window.innerWidth < this.mediumBreakpoint) {\n this.boxWidth = this.boxMobileWidth;\n this.padding = this.mobilePadding;\n this.isMobile = true;\n } else {\n this.isMobile = false;\n this.boxWidth = this.boxDesktopWidth;\n this.padding = this.desktopPadding;\n }\n };\n\n @Listen('resize', { target: 'window' })\n handleResize() {\n this.calculateBoxCount();\n this.displayForMobile();\n }\n\n private fetchProductData = async () => {\n try {\n const shopResponse = await ApiService.getData(`items/Shop?filter[name][_eq]=${this.shop}`);\n const shop = shopResponse?.data[0];\n if (shop.id) {\n const response = await ApiService.getData(`items/Product?filter[name][_eq]=${this.product}&fields=*,images.*,Shop.*,Category.*.*.*.*`);\n const product = response?.data[0];\n\n if (product) {\n if (product.Shop.find((s: ProductShopRelation) => s.Shop_id === shop.id)) {\n this.data = {\n ...response.data[0],\n id: response.data[0].id,\n };\n } else {\n return null;\n }\n }\n }\n } catch (error) {\n console.error(error);\n } finally {\n this.preloader = false;\n }\n };\n\n private fetchProductColors = async (id: string, page?: number) => {\n this.loading = true;\n\n try {\n const response = await ApiService.getData(`items/Color?${fetchProductColorsQuery(id, page)}`);\n\n if (response) {\n this.colors = {\n list:\n response &&\n response.data &&\n response.data.map((item: Color) => ({\n ...item,\n })),\n pagination: response.meta,\n };\n }\n } catch (error) {\n console.error(error);\n } finally {\n this.loading = false;\n }\n };\n\n private fetchCategoryColors = async (id: number, page?: number) => {\n this.loading = true;\n\n try {\n const response = await ApiService.getData(`items/Color?${fetchCategoryColorsQuery(id, page)}`);\n\n if (response) {\n this.colors = {\n list:\n response &&\n response.data &&\n response.data.map((item: Color) => ({\n ...item,\n })),\n pagination: response.meta,\n };\n }\n } catch (error) {\n console.error(error);\n } finally {\n this.loading = false;\n }\n };\n\n async searchColor(event: CustomEvent) {\n if (event.detail === '') {\n this.fetchProductData();\n this.loading = true;\n } else {\n if (!this.data?.id) {\n return;\n }\n try {\n const response = await ApiService.getData(`items/Color?${fetchColorByName(this.data?.id, event.detail)}`);\n\n if (response) {\n this.colors = {\n list:\n response &&\n response.data &&\n response.data.map((item: Color) => ({\n ...item,\n })),\n pagination: response.meta,\n };\n }\n } catch (error) {\n console.error(error);\n } finally {\n this.loading = false;\n }\n }\n }\n\n @Listen('searchColors')\n searchColorsHandler(event: CustomEvent) {\n this.loading = true;\n this.currentColor = null;\n this.debouncedSearchColorsHandler(event);\n }\n\n private handleCategoryClick = (color?: number) => {\n if (this.selectedCategory && color && this.selectedCategory === color && !this.showRange) {\n this.data && this.fetchProductColors(String(this.data.id));\n this.selectedCategory = null;\n } else {\n color && this.fetchCategoryColors(color);\n this.selectedCategory = color;\n }\n this.currentColor = null;\n this.clearSearchText.emit();\n };\n\n // async searchColorsHandler(event: CustomEvent) {\n // this.loading = true;\n // this.currentColor = null;\n\n // // if search is empty set to first category to not showing whole product colors\n // if (event.detail === '') {\n // this.handleCategoryClick(this.selectedCategory);\n // this.loading = true;\n // }\n\n // try {\n // if (this.data && this.data.id && event.detail !== '') {\n // const response = await ApiService.getData(`items/Color?${fetchColorByNumber(Number(this.selectedCategory), event.detail)}`);\n // if (response) {\n // this.colors = {\n // list:\n // (response &&\n // response.data &&\n // response.data.map((item: Color) => ({\n // ...item,\n // }))) ||\n // [],\n // pagination: response.meta,\n // };\n // }\n // }\n // } catch (error) {\n // console.error(error);\n // } finally {\n // this.loading = false;\n // }\n // }\n private onPage = (page: number) => {\n if (this.data) {\n if (this.selectedCategory) {\n this.fetchCategoryColors(this.selectedCategory, page);\n } else {\n this.fetchProductColors(String(this.data.id), page);\n }\n }\n\n this.page = page;\n this.currentColor = null;\n this.currentIndex = null;\n };\n\n private openSeletedColor() {\n if (!this.colors?.list || !this.selectedcolor) return;\n\n if (!this.colorIsSelected) {\n const result = this.chunks(this.colors.list)\n .map((innerArray, arrayIndex) => {\n const foundColor = innerArray.find(color => color.name.trim()?.toUpperCase() === this.selectedcolor?.trim()?.toUpperCase());\n\n return foundColor ? { color: foundColor, index: arrayIndex } : null;\n })\n .filter(item => item !== null);\n\n this.currentColor = result[0]?.color as any;\n this.currentIndex = result[0]?.index as any;\n this.colorIsSelected = true;\n }\n }\n\n componentWillLoad() {\n this.preloader = true;\n this.fetchProductData();\n setDataLayer({\n shop: this.shop,\n product: this.product,\n });\n }\n\n componentWillRender() {\n this.displayForMobile();\n this.calculateBoxCount();\n this.colorTimer();\n this.openSeletedColor();\n }\n\n render() {\n return (\n <div class={`my-modal`} onMouseEnter={() => this.handleReadyToClose(false)} onMouseLeave={() => this.handleReadyToClose(true)}>\n {this.preloader && (\n <div class={'loader'}>\n <my-loader></my-loader>\n </div>\n )}\n {!this.preloader && this.data && (\n <div class={`my-modal__header`}>\n <div class=\"image-wrapper\">\n <img src={`${APIURL}/assets/${this.data?.modalLogo}?access_token=${accessToken}`} alt=\"modal-logo\" />\n {!this.preloader && this.data && (\n <p class=\"my-modal__see-more\">\n {this.data?.modalDescription}\n {/* <img src={getAssetPath(`./assets/${this.arrowDown}`)} alt=\"arrow_down\" /> */}\n </p>\n )}\n </div>\n <div class=\"search-wrapper\">\n {!this.preloader && <my-search shopname={this.shop} productname={this.data.name} isMobile={this.isMobile}></my-search>}\n {!this.preloader && (\n <button class=\"my-modal__close\" onClick={() => this.closeModalHandler()}>\n <img src={getAssetPath(`./assets/${this.closeImage}`)} alt=\"closebtn\" />\n </button>\n )}\n </div>\n </div>\n )}\n\n {/* {this.showRange && (\n <div class={'categories'}>\n {this.data && <my-search productId={Number(this.data?.id)} isMobile={this.isMobile}></my-search>}\n\n <div class={'categories__container'} style={{ maxWidth: `${this.infoBoxWidth}px` }}>\n {this.data?.Category.map((c: ProductCategoryRelation) => (\n <my-colorbox\n key={c.id}\n onClick={() => this.handleCategoryClick(c.Category_id.id)}\n color={c.Category_id.hex}\n name={c.Category_id.category_name}\n shop={this.shop}\n product={this.product}\n isCategoryActive={this.selectedCategory === c.Category_id.id}\n isImageInsteadHex={{\n isImageInsteadHex: c?.imageInsteadHex || false,\n bigImage: c?.bigImage || '',\n }}\n ></my-colorbox>\n ))}\n </div>\n {this.isMobile && (\n <div class={'categories__slide-information'} style={{ width: `${this.infoBoxWidth}px` }}>\n <span>Przewiń w lewo</span>\n <span>Przewiń w prawo</span>\n </div>\n )}\n </div>\n )} */}\n <div class={'my-modal__wrapper'}>\n {this.loading && <my-loader></my-loader>}\n {!this.loading && this.colors && (\n <div class={'container_boxes'}>\n {this.colors.list.length > 0 ? (\n this.chunks(this.colors.list).map((color: Color[], index: number) => {\n return (\n <div key={index} class=\"boxes\">\n <div class=\"boxes__list\">\n {color.map((c: Color) => (\n <my-colorbox\n key={c.id}\n onClick={() => [\n this.currentColor?.id ? (this.currentColor?.id === c.id ? (this.currentColor = null) : (this.currentColor = c)) : (this.currentColor = c),\n (this.currentIndex = index),\n setDataLayer({\n event: 'ColorClick',\n shop: this.shop,\n product: this.product,\n color: c.name,\n }),\n this.currentColor?.id && this.clearInterval(),\n ]}\n color={c.hex}\n name={c.name}\n isActive={this.currentColor?.id === c.id}\n shop={this.shop}\n product={this.product}\n isImageInsteadHex={{\n isImageInsteadHex: c.imageInsteadHex,\n bigImage: c.bigImage,\n }}\n ></my-colorbox>\n ))}\n </div>\n\n {this.currentColor?.id && index === this.currentIndex && (\n <my-colorinfo\n currentColor={this.currentColor}\n shop={this.shop}\n product={this.product}\n data={this.data}\n isMobile={this.isMobile}\n infoBoxWidth={this.infoBoxWidth}\n baselink={this.baselink}\n availableTesters={this.available_testers?.find((t: any) => t.color_name?.trim().toLowerCase() === this.currentColor?.name?.trim().toLowerCase())}\n price={this.price}\n ></my-colorinfo>\n )}\n </div>\n );\n })\n ) : (\n <p>Brak wyników</p>\n )}\n {this.colors.pagination.filter_count > limit && (\n <div class={'pagination'}>\n {Array.from({ length: Math.ceil(this.colors.pagination.filter_count / limit) }).map((_, i) => (\n <span\n class={i + 1 === this.page ? 'current' : ''}\n onClick={e => {\n e.preventDefault();\n this.onPage(i + 1);\n }}\n key={`#${i + 1}`}\n >\n {i + 1}\n </span>\n ))}\n </div>\n )}\n </div>\n )}\n </div>\n {!this.preloader && this.isMobile && (\n <button class=\"button\" onClick={() => this.closeModalHandler()}>\n Zamknij\n </button>\n )}\n </div>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"my-modal.js","sourceRoot":"","sources":["../../../src/components/my-modal/my-modal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAgB,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC7H,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7G,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAcvC,MAAM,OAAO,OAAO;EAsClB;IArCQ,oBAAe,GAAG,GAAG,CAAC;IACtB,mBAAc,GAAG,EAAE,CAAC;IACpB,mBAAc,GAAG,EAAE,CAAC;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E;cACX,CAAC,CAAC,cAAc,EAAE,CAAC;cACnB,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YACrB,CAAC,EACD,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,IAEf,CAAC,GAAG,CAAC,CACD,CACR,CAAC,CACE,CACP,CACG,CACP,CACG;MACL,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,QAAQ,IAAI,CACnC,cAAQ,KAAK,EAAC,QAAQ,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,iBAAiB,EAAE,cAErD,CACV,CACG,CACP,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Method, Element, Prop, Event, EventEmitter, h, State, getAssetPath, Listen, Watch } from '@stencil/core';\nimport { APIURL, ApiService, accessToken } from '../api';\nimport { setDataLayer } from '../../gtmUtils';\nimport { AvailableTester, Color, PaginationData, Product, ProductShopRelation } from '../../types';\nimport { fetchCategoryColorsQuery, fetchColorByName, fetchProductColorsQuery, limit } from '../api/services';\nimport { debounce } from '../../utils';\n\ndeclare global {\n interface Window {\n dataLayer: Record<string, any>[];\n }\n}\n\n@Component({\n tag: 'my-modal',\n styleUrl: 'my-modal.scss',\n assetsDirs: ['assets'],\n scoped: true,\n})\nexport class MyModal {\n private boxDesktopWidth = 130;\n private boxMobileWidth = 70;\n private desktopPadding = 75;\n private mobilePadding = 35;\n private mediumBreakpoint = 1024;\n private colorTimerInterval: ReturnType<typeof setInterval> | undefined;\n\n @Event({ bubbles: true, composed: true }) clearSearchText: EventEmitter;\n @Element() modalEl: HTMLElement;\n\n @Prop() shop: string;\n @Prop() product: string;\n @Prop() baselink: string;\n @Prop() available_testers: AvailableTester[] | null;\n @Prop() price: number | null;\n @Prop() selectedcolor: string | null;\n @Prop() closeImage = 'close.png';\n @Prop() arrowDown = 'arrow_down.png';\n\n @State() chunksNum = 12;\n @State() data: Product | null = null;\n @State() preloader = false;\n @State() loading = false;\n @State() colors: PaginationData<Color> | null = null;\n @State() currentColor: Color | null = null;\n @State() currentIndex: number | null = null;\n @State() infoBoxWidth: number | null = null;\n @State() boxWidth: number = this.boxDesktopWidth; // box width with gap\n @State() padding: number = this.desktopPadding;\n @State() isMobile: boolean = false;\n @State() showRange: boolean = false;\n @State() colorCategories: string[] | null = null;\n @State() selectedCategory: any = null;\n @State() page = 1;\n @State() colorIsSelected = false;\n debouncedSearchColorsHandler: (event: CustomEvent) => void;\n\n constructor() {\n this.debouncedSearchColorsHandler = debounce(this.searchColor.bind(this), 300);\n }\n\n @Watch('chunksNum')\n setInfoBoxWidth(newValue: number) {\n this.infoBoxWidth = newValue * this.boxWidth;\n }\n\n @Watch('data')\n watchPropHandler(newValue: Product) {\n if (newValue.Category.length > 0) {\n this.showRange = true;\n this.handleCategoryClick(newValue.Category[0].Category_id.id);\n } else {\n this.fetchProductColors(String(newValue.id));\n }\n }\n\n private clearInterval = () => {\n this.colorTimerInterval && clearInterval(this.colorTimerInterval);\n this.colorTimerInterval = undefined;\n };\n\n private colorTimer = () => {\n if (this.currentColor && this.currentColor.id) {\n this.colorTimerInterval = setInterval(() => {\n this.currentColor?.name &&\n setDataLayer({\n event: 'ColorTimer',\n shop: this.shop,\n product: this.product,\n color: this.currentColor?.name,\n timer: '10',\n });\n }, 10000);\n } else {\n this.clearInterval();\n }\n };\n\n @Method()\n async open() {\n this.modalEl.style.display = 'block';\n }\n @Event() close: EventEmitter;\n closeModalHandler() {\n this.close.emit();\n }\n\n @Event() readyToCLose: EventEmitter;\n handleReadyToClose(value: boolean) {\n this.readyToCLose.emit({ observable: value });\n }\n\n @Listen('closeInfoBox')\n closeInfoBoxHandler() {\n this.currentColor = null;\n this.currentIndex = null;\n }\n\n private chunks = (xs: Color[], y: Color[][] = []): Color[][] => {\n return xs.length === 0 ? y : this.chunks(xs.slice(this.chunksNum), y.concat([xs.slice(0, this.chunksNum)]));\n };\n\n private calculateBoxCount = () => {\n const modalWidth = this.modalEl.children && this.modalEl.children[0] && this.modalEl.children[0]?.clientWidth - this.padding;\n const boxWidth = this.boxWidth;\n\n const calc = Math.floor(modalWidth / boxWidth);\n\n const boxesCount = calc;\n\n if (!this.preloader) this.chunksNum = boxesCount;\n };\n\n private displayForMobile = () => {\n if (window.innerWidth < this.mediumBreakpoint) {\n this.boxWidth = this.boxMobileWidth;\n this.padding = this.mobilePadding;\n this.isMobile = true;\n } else {\n this.isMobile = false;\n this.boxWidth = this.boxDesktopWidth;\n this.padding = this.desktopPadding;\n }\n };\n\n @Listen('resize', { target: 'window' })\n handleResize() {\n this.calculateBoxCount();\n this.displayForMobile();\n }\n\n private fetchProductData = async () => {\n try {\n const shopResponse = await ApiService.getData(`items/Shop?filter[name][_eq]=${this.shop}`);\n const shop = shopResponse?.data[0];\n if (shop.id) {\n const response = await ApiService.getData(`items/Product?filter[name][_eq]=${this.product}&fields=*,images.*,Shop.*,Category.*.*.*.*`);\n const product = response?.data[0];\n\n if (product) {\n if (product.Shop.find((s: ProductShopRelation) => s.Shop_id === shop.id)) {\n this.data = {\n ...response.data[0],\n id: response.data[0].id,\n };\n } else {\n return null;\n }\n }\n }\n } catch (error) {\n console.error(error);\n } finally {\n this.preloader = false;\n }\n };\n\n private fetchProductColors = async (id: string, page?: number) => {\n this.loading = true;\n\n try {\n const response = await ApiService.getData(`items/Color?${fetchProductColorsQuery(id, page)}`);\n\n if (response) {\n this.colors = {\n list:\n response &&\n response.data &&\n response.data.map((item: Color) => ({\n ...item,\n })),\n pagination: response.meta,\n };\n }\n } catch (error) {\n console.error(error);\n } finally {\n this.loading = false;\n }\n };\n\n private fetchCategoryColors = async (id: number, page?: number) => {\n this.loading = true;\n\n try {\n const response = await ApiService.getData(`items/Color?${fetchCategoryColorsQuery(id, page)}`);\n\n if (response) {\n this.colors = {\n list:\n response &&\n response.data &&\n response.data.map((item: Color) => ({\n ...item,\n })),\n pagination: response.meta,\n };\n }\n } catch (error) {\n console.error(error);\n } finally {\n this.loading = false;\n }\n };\n\n async searchColor(event: CustomEvent) {\n if (event.detail === '') {\n this.fetchProductData();\n this.loading = true;\n } else {\n if (!this.data?.id) {\n return;\n }\n try {\n const response = await ApiService.getData(`items/Color?${fetchColorByName(this.data?.id, event.detail)}`);\n\n if (response) {\n this.colors = {\n list:\n response &&\n response.data &&\n response.data.map((item: Color) => ({\n ...item,\n })),\n pagination: response.meta,\n };\n }\n } catch (error) {\n console.error(error);\n } finally {\n this.loading = false;\n }\n }\n }\n\n @Listen('searchColors')\n searchColorsHandler(event: CustomEvent) {\n this.loading = true;\n this.currentColor = null;\n this.debouncedSearchColorsHandler(event);\n }\n\n private handleCategoryClick = (color?: number) => {\n if (this.selectedCategory && color && this.selectedCategory === color && !this.showRange) {\n this.data && this.fetchProductColors(String(this.data.id));\n this.selectedCategory = null;\n } else {\n color && this.fetchCategoryColors(color);\n this.selectedCategory = color;\n }\n this.currentColor = null;\n this.clearSearchText.emit();\n };\n\n // async searchColorsHandler(event: CustomEvent) {\n // this.loading = true;\n // this.currentColor = null;\n\n // // if search is empty set to first category to not showing whole product colors\n // if (event.detail === '') {\n // this.handleCategoryClick(this.selectedCategory);\n // this.loading = true;\n // }\n\n // try {\n // if (this.data && this.data.id && event.detail !== '') {\n // const response = await ApiService.getData(`items/Color?${fetchColorByNumber(Number(this.selectedCategory), event.detail)}`);\n // if (response) {\n // this.colors = {\n // list:\n // (response &&\n // response.data &&\n // response.data.map((item: Color) => ({\n // ...item,\n // }))) ||\n // [],\n // pagination: response.meta,\n // };\n // }\n // }\n // } catch (error) {\n // console.error(error);\n // } finally {\n // this.loading = false;\n // }\n // }\n private onPage = (page: number) => {\n if (this.data) {\n if (this.selectedCategory) {\n this.fetchCategoryColors(this.selectedCategory, page);\n } else {\n this.fetchProductColors(String(this.data.id), page);\n }\n }\n\n this.page = page;\n this.currentColor = null;\n this.currentIndex = null;\n };\n\n private openSeletedColor() {\n if (!this.colors?.list || !this.selectedcolor) return;\n\n if (!this.colorIsSelected) {\n const result = this.chunks(this.colors.list)\n .map((innerArray, arrayIndex) => {\n const foundColor = innerArray.find(color => color.name.trim()?.toUpperCase() === this.selectedcolor?.trim()?.toUpperCase());\n\n return foundColor ? { color: foundColor, index: arrayIndex } : null;\n })\n .filter(item => item !== null);\n\n this.currentColor = result[0]?.color as any;\n this.currentIndex = result[0]?.index as any;\n this.colorIsSelected = true;\n }\n }\n\n componentWillLoad() {\n this.preloader = true;\n this.fetchProductData();\n setDataLayer({\n shop: this.shop,\n product: this.product,\n });\n }\n\n componentWillRender() {\n this.displayForMobile();\n this.calculateBoxCount();\n this.colorTimer();\n this.openSeletedColor();\n }\n\n render() {\n return (\n <div class={`my-modal`} onMouseEnter={() => this.handleReadyToClose(false)} onMouseLeave={() => this.handleReadyToClose(true)}>\n {this.preloader && (\n <div class={'loader'}>\n <my-loader></my-loader>\n </div>\n )}\n {!this.preloader && this.data && (\n <div class={`my-modal__header`}>\n <div class=\"image-wrapper\">\n <img src={`${APIURL}/assets/${this.data?.modalLogo}?access_token=${accessToken}`} alt=\"modal-logo\" />\n {!this.preloader && this.data && (\n <p class=\"my-modal__see-more\">\n {this.data?.modalDescription}\n {/* <img src={getAssetPath(`./assets/${this.arrowDown}`)} alt=\"arrow_down\" /> */}\n </p>\n )}\n </div>\n <div class=\"search-wrapper\">\n {!this.preloader && <my-search shopname={this.shop} productname={this.data.name} isMobile={this.isMobile}></my-search>}\n {!this.preloader && (\n <button class=\"my-modal__close\" onClick={() => this.closeModalHandler()}>\n <img src={getAssetPath(`./assets/${this.closeImage}`)} alt=\"closebtn\" />\n </button>\n )}\n </div>\n </div>\n )}\n\n {/* {this.showRange && (\n <div class={'categories'}>\n {this.data && <my-search productId={Number(this.data?.id)} isMobile={this.isMobile}></my-search>}\n\n <div class={'categories__container'} style={{ maxWidth: `${this.infoBoxWidth}px` }}>\n {this.data?.Category.map((c: ProductCategoryRelation) => (\n <my-colorbox\n key={c.id}\n onClick={() => this.handleCategoryClick(c.Category_id.id)}\n color={c.Category_id.hex}\n name={c.Category_id.category_name}\n shop={this.shop}\n product={this.product}\n isCategoryActive={this.selectedCategory === c.Category_id.id}\n isImageInsteadHex={{\n isImageInsteadHex: c?.imageInsteadHex || false,\n bigImage: c?.bigImage || '',\n }}\n ></my-colorbox>\n ))}\n </div>\n {this.isMobile && (\n <div class={'categories__slide-information'} style={{ width: `${this.infoBoxWidth}px` }}>\n <span>Przewiń w lewo</span>\n <span>Przewiń w prawo</span>\n </div>\n )}\n </div>\n )} */}\n <div class={'my-modal__wrapper'}>\n {this.loading && <my-loader></my-loader>}\n {!this.loading && this.colors && (\n <div class={'container_boxes'}>\n {this.colors.list.length > 0 ? (\n this.chunks(this.colors.list).map((color: Color[], index: number) => {\n return (\n <div key={index} class=\"boxes\">\n <div class=\"boxes__list\">\n {color.map((c: Color) => (\n <my-colorbox\n key={c.id}\n onClick={() => [\n this.currentColor?.id ? (this.currentColor?.id === c.id ? (this.currentColor = null) : (this.currentColor = c)) : (this.currentColor = c),\n (this.currentIndex = index),\n setDataLayer({\n event: 'ColorClick',\n shop: this.shop,\n product: this.product,\n color: c.name,\n }),\n this.currentColor?.id && this.clearInterval(),\n ]}\n color={c.hex}\n name={c.name}\n isActive={this.currentColor?.id === c.id}\n shop={this.shop}\n product={this.product}\n isImageInsteadHex={{\n isImageInsteadHex: c.imageInsteadHex,\n bigImage: c.bigImage,\n }}\n ></my-colorbox>\n ))}\n </div>\n\n {this.currentColor?.id && index === this.currentIndex && (\n <my-colorinfo\n currentColor={this.currentColor}\n shop={this.shop}\n product={this.product}\n data={this.data}\n isMobile={this.isMobile}\n infoBoxWidth={this.infoBoxWidth}\n baselink={this.baselink}\n availableTesters={this.available_testers?.find((t: any) => t.color_name?.trim().toLowerCase() === this.currentColor?.name?.trim().toLowerCase())}\n price={this.price}\n ></my-colorinfo>\n )}\n </div>\n );\n })\n ) : (\n <p>Brak wyników</p>\n )}\n {this.colors.pagination.filter_count > limit && (\n <div class={'pagination'}>\n {Array.from({ length: Math.ceil(this.colors.pagination.filter_count / limit) }).map((_, i) => (\n <span\n class={i + 1 === this.page ? 'current' : ''}\n onClick={e => {\n e.preventDefault();\n this.onPage(i + 1);\n }}\n key={`#${i + 1}`}\n >\n {i + 1}\n </span>\n ))}\n </div>\n )}\n </div>\n )}\n </div>\n {!this.preloader && this.isMobile && (\n <button class=\"button\" onClick={() => this.closeModalHandler()}>\n Zamknij\n </button>\n )}\n </div>\n );\n }\n}\n"]}
@@ -3,6 +3,8 @@ import { s as setDataLayer } from './gtmUtils.js';
3
3
  import { A as APIURL, a as accessToken } from './index2.js';
4
4
  import { d as defineCustomElement$1 } from './index3.js';
5
5
 
6
+ const myColorinfoCss = "@font-face{font-family:\"Galatea\";src:url(\"/assets/fonts/Galatea-Regular.woff2\") format(\"woff2\"), url(\"/assets/fonts/Galatea-Regular.woff\") format(\"woff\"), url(\"/assets/fonts/Galatea-Regular.ttf\") format(\"truetype\");font-weight:normal;font-style:normal;font-display:swap}.pallete-wrapper.sc-my-colorinfo *.sc-my-colorinfo{font-family:\"Galatea\", sans-serif}.boxes__box-content.sc-my-colorinfo{width:100%;margin-bottom:5px;height:500px;text-align:left;display:flex;flex-direction:row;justify-content:space-between;position:relative}.boxes__box-content.sc-my-colorinfo .closebtn.sc-my-colorinfo{position:absolute;right:10px;top:10px;width:53px;height:53px;cursor:pointer;object-fit:cover;z-index:9999}@media (max-width: 1024px){.boxes__box-content.sc-my-colorinfo{flex-direction:column-reverse;height:auto}}@media (max-width: 768px){.boxes__box-content.sc-my-colorinfo{margin:0 auto}}.boxes__box-content__info.sc-my-colorinfo{width:40%;padding:50px 40px;position:relative;display:flex;flex-direction:column;justify-content:space-between}@media (max-width: 1024px){.boxes__box-content__info.sc-my-colorinfo{width:100%;padding:15px;min-height:100px}}@media (max-width: 768px){.boxes__box-content__info.sc-my-colorinfo{min-height:auto}}.boxes__box-content__info__header.sc-my-colorinfo{display:flex;flex-direction:column;align-items:flex-start}.boxes__box-content__info.sc-my-colorinfo h2.sc-my-colorinfo{font-size:35px;font-weight:normal;margin-bottom:30px;color:#232323}@media (max-width: 768px){.boxes__box-content__info.sc-my-colorinfo h2.sc-my-colorinfo{font-size:16px;text-align:center;margin-bottom:15px;margin-top:5px}}.boxes__box-content__info.sc-my-colorinfo h4.sc-my-colorinfo{margin-top:0px;margin-bottom:15px;font-size:16px;color:#4c4c4c}.boxes__box-content__info__value.sc-my-colorinfo{display:flex;flex-direction:column;align-items:flex-start;gap:20px}@media (max-width: 1024px){.boxes__box-content__info__value.sc-my-colorinfo{justify-content:flex-start;margin-top:30px}}@media (max-width: 768px){.boxes__box-content__info__value.sc-my-colorinfo{flex-direction:column}}@media (max-width: 768px){.boxes__box-content__info__value-image.sc-my-colorinfo{margin:0 auto;margin-bottom:10px}}.boxes__box-content__info__value-image.sc-my-colorinfo img.sc-my-colorinfo{width:114px;object-fit:cover}@media (max-width: 1024px){.boxes__box-content__info__value-image.sc-my-colorinfo img.sc-my-colorinfo{width:75px}}.boxes__box-content__info__value-product.sc-my-colorinfo{color:#232323;margin-left:10px}@media (max-width: 1024px){.boxes__box-content__info__value-product.sc-my-colorinfo h2.sc-my-colorinfo{font-size:26px;margin:0;margin-right:10px}}@media (max-width: 768px){.boxes__box-content__info__value-product.sc-my-colorinfo h2.sc-my-colorinfo{font-size:16px}}.boxes__box-content__info__value-product.sc-my-colorinfo p.sc-my-colorinfo{font-size:20px;margin-top:0px;margin-bottom:0px}.boxes__box-content__info__value-product.sc-my-colorinfo p.sc-my-colorinfo:last-of-type{margin-bottom:20px}@media (max-width: 1024px){.boxes__box-content__info__value-product.sc-my-colorinfo p.sc-my-colorinfo:last-of-type{margin-bottom:0}}@media (max-width: 768px){.boxes__box-content__info__value-product.sc-my-colorinfo p.sc-my-colorinfo{font-size:10px}}@media (max-width: 1024px){.boxes__box-content__info__value-product.sc-my-colorinfo>div.sc-my-colorinfo{display:flex;justify-content:flex-start;align-items:center}}@media (max-width: 768px){.boxes__box-content__info__value-product.sc-my-colorinfo>div.sc-my-colorinfo{flex-direction:column}}.boxes__box-content__info__tester.sc-my-colorinfo{display:flex;flex-direction:column;gap:15px;width:100%}@media (max-width: 1024px){.boxes__box-content__info__tester.sc-my-colorinfo{text-align:center}}.boxes__box-content__info__tester.sc-my-colorinfo .tester-text.sc-my-colorinfo h2.sc-my-colorinfo{margin:0 0 10px;font-size:18px;font-weight:700}.boxes__box-content__info__tester.sc-my-colorinfo .tester-text.sc-my-colorinfo p.sc-my-colorinfo{margin:0;font-size:14px}.boxes__box-content__info__tester.sc-my-colorinfo .tester-buy.sc-my-colorinfo{display:flex;align-items:center;gap:15px}@media (max-width: 1024px){.boxes__box-content__info__tester.sc-my-colorinfo .tester-buy.sc-my-colorinfo{flex-direction:column}.boxes__box-content__info__tester.sc-my-colorinfo .tester-buy.sc-my-colorinfo button.sc-my-colorinfo{margin:0;max-width:100%}}.boxes__box-content__info__tester.sc-my-colorinfo .price.sc-my-colorinfo{font-size:20px;font-weight:600}.boxes__box-content__slider.sc-my-colorinfo{width:60%;min-width:60%;max-width:60%;position:relative}@media (max-width: 1024px){.boxes__box-content__slider.sc-my-colorinfo{width:100%;display:block;min-width:100%;max-width:100%}}.boxes__box-content__slider.sc-my-colorinfo .color-big-image.sc-my-colorinfo{width:100%;height:100%;object-fit:cover}@media (max-width: 1024px){.boxes__box-content__slider.sc-my-colorinfo .color-big-image.sc-my-colorinfo{height:300px}}.boxes__box-content__white.sc-my-colorinfo .tester-text.sc-my-colorinfo,.boxes__box-content__white.sc-my-colorinfo .tester-buy.sc-my-colorinfo{color:#fff}.boxes__box-content__white.sc-my-colorinfo h2.sc-my-colorinfo{color:#fff}.button.sc-my-colorinfo,a.button.sc-my-colorinfo{background-color:#fff;font-size:16px;box-shadow:0px 10px 20px rgba(0, 0, 0, 0.1);border-radius:22px;padding:10px 35px;color:#232323;text-decoration:none;text-align:center;transition:all 0.7s ease-in-out;border:none;cursor:pointer;display:flex;align-items:center;gap:5px}.button.sc-my-colorinfo .shape-icon.sc-my-colorinfo,a.button.sc-my-colorinfo .shape-icon.sc-my-colorinfo{display:inline-flex}.button.sc-my-colorinfo .shape-icon.sc-my-colorinfo svg.sc-my-colorinfo,a.button.sc-my-colorinfo .shape-icon.sc-my-colorinfo svg.sc-my-colorinfo{display:block}.button.sc-my-colorinfo .shape-icon.sc-my-colorinfo path.sc-my-colorinfo,.button.sc-my-colorinfo .shape-icon.sc-my-colorinfo .shape-icon__path.sc-my-colorinfo,a.button.sc-my-colorinfo .shape-icon.sc-my-colorinfo path.sc-my-colorinfo,a.button.sc-my-colorinfo .shape-icon.sc-my-colorinfo .shape-icon__path.sc-my-colorinfo{fill:currentColor;transition:fill 0.7s ease-in-out}.button.fit.sc-my-colorinfo,a.button.fit.sc-my-colorinfo{padding:10px 15px}.button.sc-my-colorinfo:hover,a.button.sc-my-colorinfo:hover{color:#fff;background-color:#232323}.button.brown.sc-my-colorinfo,a.button.brown.sc-my-colorinfo{background-color:#3c2114;color:#fff}.button.brown.sc-my-colorinfo:hover,a.button.brown.sc-my-colorinfo:hover{color:#fff;background-color:#232323}.button.inverse.sc-my-colorinfo,a.button.inverse.sc-my-colorinfo{background-color:#232323;color:#fff}.button.inverse.sc-my-colorinfo:hover,a.button.inverse.sc-my-colorinfo:hover{color:#232323;background-color:#fff}.button.inverse.sc-my-colorinfo svg.sc-my-colorinfo path.sc-my-colorinfo,a.button.inverse.sc-my-colorinfo svg.sc-my-colorinfo path.sc-my-colorinfo{fill:#fff}.button.sc-my-colorinfo:disabled,a.button.sc-my-colorinfo:disabled{cursor:not-allowed;background-color:white;opacity:0.5}.button.sc-my-colorinfo:disabled.brown,a.button.sc-my-colorinfo:disabled.brown{background-color:black;color:white;opacity:0.5}.button.sc-my-colorinfo:disabled.inverse,a.button.sc-my-colorinfo:disabled.inverse{background-color:black;color:white;opacity:0.5}.button.sc-my-colorinfo:disabled:hover,a.button.sc-my-colorinfo:disabled:hover{background-color:inherit;color:inherit;opacity:0.5}@media (max-width: 1024px){.button.sc-my-colorinfo,a.button.sc-my-colorinfo{max-width:150px;font-size:13px;padding:12px 25px}}@media (max-width: 768px){.button.sc-my-colorinfo,a.button.sc-my-colorinfo{margin:0 auto}}.divider.sc-my-colorinfo{border:1px solid #4c4c4c;opacity:0.2;margin-bottom:20px}@media (max-width: 768px){.divider.sc-my-colorinfo{margin:10px 0px;display:none}}";
7
+
6
8
  const MyColorInfo = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
7
9
  constructor() {
8
10
  super();
@@ -97,7 +99,8 @@ const MyColorInfo = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
97
99
  } }, h("div", { class: "boxes__box-content__info__header" }, !this.isMobile && h("img", { class: 'closebtn', onClick: this.onCloseButtonClick, src: getAssetPath(`./assets/${this.closeImage}`), alt: "closebtn" }), h("h2", null, this.capitalizeFirstLetter(this.currentColor.name)), !this.isMobile && h("h4", null, this.currentColor.number), this.currentColor && ((_a = this.currentColor.links) === null || _a === void 0 ? void 0 : _a.find((link) => (link === null || link === void 0 ? void 0 : link.shop) === this.shop)) && (h("a", { onClick: this.goToProduct, href: this.getHref(), class: `button ${this.getButtonClass()}` }, "wybierz kolor"))), h("div", { class: "boxes__box-content__info__value" }, h("div", { class: "divider" }), h("div", { class: "boxes__box-content__info__tester" }, ' ', h("div", { class: "divider" }), h("div", { class: "tester-text" }, h("h2", null, "Zam\u00F3w tester"), h("p", null, "Sprawd\u017A go na swojej \u015Bcianie.")), h("div", { class: "tester-buy" }, h("div", { class: "price" }, this.price ? `${this.price} zł` : ''), h("button", { class: `button fit ${this.getButtonClass()} ${!this.availableTesters ? 'disabled' : ''}`, onClick: this.handleAddToBasket, disabled: !this.availableTesters || this.buttonBlocked }, h("span", { class: "shape-icon", "aria-hidden": "true" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "15", height: "16", viewBox: "0 0 15 16" }, h("path", { class: "shape-icon__path", transform: "translate(0.0867462 0)", d: "M13.246571 12.763281L11.931726 4.961875C11.801879 4.1936703 11.13567 3.6319427 10.35657 3.63375L9.7429771 3.63375L9.7429771 3.1025C9.7429771 1.3890365 8.35394 0 6.6404767 0C4.9270134 0 3.537977 1.3890365 3.537977 3.1025L3.537977 3.63375L2.9217269 3.63375C2.1426277 3.6319427 1.4764187 4.1936703 1.3465706 4.961875L0.034383144 12.763281C-0.086738147 13.483807 0.11555123 14.221112 0.58740741 14.778946C1.0592636 15.336781 1.7528107 15.658594 2.4834456 15.658594L10.797508 15.658594C11.528143 15.658594 12.22169 15.336781 12.693546 14.778946C13.165402 14.221112 13.367692 13.483807 13.246571 12.763281L13.246571 12.763281ZM4.3348517 3.0892186C4.3348517 1.8158572 5.3671155 0.78359371 6.6404767 0.78359371C7.9138384 0.78359371 8.9461021 1.8158572 8.9461021 3.0892186L8.9461021 3.6204686L4.3348517 3.6204686L4.3348517 3.0892186ZM12.08579 14.264063C11.765244 14.643165 11.293964 14.86172 10.797508 14.86172L2.4834456 14.86172C1.9871488 14.862442 1.5158025 14.644215 1.195269 14.265309C0.87473541 13.886404 0.73765546 13.385406 0.82063317 12.896093L2.1248519 5.092031C2.1891608 4.703371 2.5278175 4.4200282 2.9217269 4.4252396L3.5353208 4.4252396L3.5353208 5.5834374C3.5353208 5.8034883 3.7137072 5.9818749 3.9337583 5.9818749C4.1538091 5.9818749 4.3321958 5.8034883 4.3321958 5.5834374L4.3321958 4.4252396L8.9461021 4.4252396L8.9461021 5.5834374C8.9461021 5.8034883 9.1244888 5.9818749 9.3445396 5.9818749C9.5645905 5.9818749 9.7429771 5.8034883 9.7429771 5.5834374L9.7429771 4.4252396L10.359227 4.4252396C10.753137 4.4200282 11.091793 4.703371 11.156102 5.092031L12.46032 12.896093C12.542204 13.384947 12.40527 13.885097 12.08579 14.264063L12.08579 14.264063Z" }))), this.buttonBlocked ? 'Dodano do koszyka…' : !this.availableTesters ? 'Tester obecnie niedostępny' : 'Dodaj do koszyka'))))), h("div", { class: "boxes__box-content__slider" }, this.renderSliderOrImage())));
98
100
  }
99
101
  static get assetsDirs() { return ["assets"]; }
100
- }, [0, "my-colorinfo", {
102
+ static get style() { return myColorinfoCss; }
103
+ }, [2, "my-colorinfo", {
101
104
  "currentColor": [16],
102
105
  "shop": [1],
103
106
  "product": [1],
@@ -1 +1 @@
1
- {"file":"my-colorinfo2.js","mappings":";;;;;MASa,WAAW;;;;;;IAiBtB,gBAAW,GAAG;;MACZ,IAAI,CAAC,YAAY;QACf,YAAY,CAAC;UACX,KAAK,EAAE,aAAa;UACpB,IAAI,EAAE,IAAI,CAAC,IAAI;UACf,OAAO,EAAE,IAAI,CAAC,OAAO;UACrB,KAAK,EAAE,MAAA,IAAI,CAAC,YAAY,0CAAE,IAAI;SAC/B,CAAC,CAAC;MACL,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;KAC1B,CAAC;IAEF,uBAAkB,GAAG;MACnB,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;KAC1B,CAAC;IAEF,wBAAmB,GAAG;;MACpB,IAAI,IAAI,CAAC,YAAY,CAAC,eAAe,EAAE;QACrC,OAAO,WAAK,KAAK,EAAE,iBAAiB,EAAE,GAAG,EAAE,GAAG,MAAM,WAAW,IAAI,CAAC,YAAY,CAAC,QAAQ,iBAAiB,WAAW,EAAE,EAAE,GAAG,EAAC,aAAa,GAAG,CAAC;OAC/I;WAAM;QACL,OAAO,iBAAW,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,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B,CAChH,CACL,CACF,CACF,CACF,EACN,WAAK,KAAK,EAAC,4BAA4B,IAAE,IAAI,CAAC,mBAAmB,EAAE,CAAO,CACtE,EACN;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/my-colorinfo/my-colorinfo.tsx"],"sourcesContent":["import { Component, Prop, h, getAssetPath, Event, EventEmitter } from '@stencil/core';\nimport { setDataLayer } from '../../gtmUtils';\nimport { AvailableTester, Color, Link, Product } from '../../types';\nimport { APIURL, accessToken } from '../api';\n\n@Component({\n tag: 'my-colorinfo',\n assetsDirs: ['assets'],\n})\nexport class MyColorInfo {\n @Prop() currentColor: Color;\n @Prop() shop: string;\n @Prop() product: string;\n @Prop() baselink: string;\n @Prop() availableTesters: AvailableTester | null;\n @Prop() price: number | null;\n @Prop() data: Product | null = null;\n @Prop() isMobile: boolean = false;\n @Prop() infoBoxWidth: number | null;\n @Prop() closeImage = 'close.png';\n @Prop() shapeImage = 'Shape.svg';\n @Prop() buttonBlocked = false;\n\n @Event() closeInfoBox: EventEmitter;\n @Event({ bubbles: true, composed: true }) addToBasket: EventEmitter<{ id: number }>;\n\n goToProduct = () => {\n this.currentColor &&\n setDataLayer({\n event: 'GoToProduct',\n shop: this.shop,\n product: this.product,\n color: this.currentColor?.name,\n });\n this.closeInfoBox.emit();\n };\n\n onCloseButtonClick = () => {\n this.closeInfoBox.emit();\n };\n\n renderSliderOrImage = () => {\n if (this.currentColor.imageInsteadHex) {\n return <img class={'color-big-image'} src={`${APIURL}/assets/${this.currentColor.bigImage}?access_token=${accessToken}`} alt=\"color-image\" />;\n } else {\n return <my-slider color={this.currentColor.name} shop={this.shop} product={this.product} slides={this.data?.images}></my-slider>;\n }\n };\n\n getHref = () => {\n if (this.baselink) {\n return `${this.baselink}/${this?.currentColor.links?.find((link: Link) => link?.shop === this.shop)?.path}`;\n } else {\n return this?.currentColor.links?.find((link: Link) => link?.shop === this.shop)?.path;\n }\n };\n\n capitalizeFirstLetter = (string: string) => {\n return string.charAt(0).toUpperCase() + string.slice(1).toLocaleLowerCase();\n };\n\n isVeryLightBackground = (): boolean => {\n if (this.currentColor.imageInsteadHex) return true;\n const hex = this.currentColor.hex?.replace('#', '') ?? '';\n if (hex.length !== 6 && hex.length !== 3) return false;\n const r = parseInt(hex.length === 3 ? hex[0] + hex[0] : hex.slice(0, 2), 16) / 255;\n const g = parseInt(hex.length === 3 ? hex[1] + hex[1] : hex.slice(2, 4), 16) / 255;\n const b = parseInt(hex.length === 3 ? hex[2] + hex[2] : hex.slice(4, 6), 16) / 255;\n const luminance = 0.299 * r + 0.587 * g + 0.114 * b;\n return luminance > 0.96; // only near-white: dark button; rest: white button\n };\n\n getButtonClass = () => {\n if (this.currentColor.imageInsteadHex) return 'brown';\n return this.isVeryLightBackground() ? 'inverse' : '';\n };\n\n handleAddToBasket = () => {\n if (!this.availableTesters?.id_product_attribute) return;\n this.buttonBlocked = true;\n this.addToBasket.emit({\n id: this.availableTesters.id_product_attribute,\n });\n\n setTimeout(() => {\n this.buttonBlocked = false;\n }, 10000);\n };\n\n render() {\n return (\n <div\n class={`boxes__box-content ${this.currentColor.textWhite ? 'boxes__box-content__white' : ''}`}\n style={{\n background: this.currentColor.imageInsteadHex ? 'white' : this.currentColor.hex,\n maxWidth: `${this.infoBoxWidth && this.infoBoxWidth - 4}px`,\n }}\n >\n {this.isMobile && <img class={'closebtn'} onClick={this.onCloseButtonClick} src={getAssetPath(`./assets/${this.closeImage}`)} alt=\"closebtn\" />}\n <div\n class=\"boxes__box-content__info\"\n style={{\n maxWidth: this.isMobile ? `${this.infoBoxWidth && this.infoBoxWidth - 35}px` : ``,\n }}\n >\n <div class=\"boxes__box-content__info__header\">\n {!this.isMobile && <img class={'closebtn'} onClick={this.onCloseButtonClick} src={getAssetPath(`./assets/${this.closeImage}`)} alt=\"closebtn\" />}\n <h2>{this.capitalizeFirstLetter(this.currentColor.name)}</h2>\n {!this.isMobile && <h4>{this.currentColor.number}</h4>}\n {this.currentColor && this.currentColor.links?.find((link: Link) => link?.shop === this.shop) && (\n <a onClick={this.goToProduct} href={this.getHref()} class={`button ${this.getButtonClass()}`}>\n wybierz kolor\n </a>\n )}\n </div>\n <div class=\"boxes__box-content__info__value\">\n <div class=\"divider\"></div>\n\n <div class=\"boxes__box-content__info__tester\">\n {' '}\n <div class=\"divider\"></div>\n <div class=\"tester-text\">\n <h2>Zamów tester</h2>\n <p>Sprawdź go na swojej ścianie.</p>\n </div>\n <div class=\"tester-buy\">\n <div class=\"price\">{this.price ? `${this.price} zł` : ''}</div>\n\n <button\n class={`button fit ${this.getButtonClass()} ${!this.availableTesters ? 'disabled' : ''}`}\n onClick={this.handleAddToBasket}\n disabled={!this.availableTesters || this.buttonBlocked}\n >\n <span class=\"shape-icon\" aria-hidden=\"true\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"15\" height=\"16\" viewBox=\"0 0 15 16\">\n <path\n class=\"shape-icon__path\"\n transform=\"translate(0.0867462 0)\"\n d=\"M13.246571 12.763281L11.931726 4.961875C11.801879 4.1936703 11.13567 3.6319427 10.35657 3.63375L9.7429771 3.63375L9.7429771 3.1025C9.7429771 1.3890365 8.35394 0 6.6404767 0C4.9270134 0 3.537977 1.3890365 3.537977 3.1025L3.537977 3.63375L2.9217269 3.63375C2.1426277 3.6319427 1.4764187 4.1936703 1.3465706 4.961875L0.034383144 12.763281C-0.086738147 13.483807 0.11555123 14.221112 0.58740741 14.778946C1.0592636 15.336781 1.7528107 15.658594 2.4834456 15.658594L10.797508 15.658594C11.528143 15.658594 12.22169 15.336781 12.693546 14.778946C13.165402 14.221112 13.367692 13.483807 13.246571 12.763281L13.246571 12.763281ZM4.3348517 3.0892186C4.3348517 1.8158572 5.3671155 0.78359371 6.6404767 0.78359371C7.9138384 0.78359371 8.9461021 1.8158572 8.9461021 3.0892186L8.9461021 3.6204686L4.3348517 3.6204686L4.3348517 3.0892186ZM12.08579 14.264063C11.765244 14.643165 11.293964 14.86172 10.797508 14.86172L2.4834456 14.86172C1.9871488 14.862442 1.5158025 14.644215 1.195269 14.265309C0.87473541 13.886404 0.73765546 13.385406 0.82063317 12.896093L2.1248519 5.092031C2.1891608 4.703371 2.5278175 4.4200282 2.9217269 4.4252396L3.5353208 4.4252396L3.5353208 5.5834374C3.5353208 5.8034883 3.7137072 5.9818749 3.9337583 5.9818749C4.1538091 5.9818749 4.3321958 5.8034883 4.3321958 5.5834374L4.3321958 4.4252396L8.9461021 4.4252396L8.9461021 5.5834374C8.9461021 5.8034883 9.1244888 5.9818749 9.3445396 5.9818749C9.5645905 5.9818749 9.7429771 5.8034883 9.7429771 5.5834374L9.7429771 4.4252396L10.359227 4.4252396C10.753137 4.4200282 11.091793 4.703371 11.156102 5.092031L12.46032 12.896093C12.542204 13.384947 12.40527 13.885097 12.08579 14.264063L12.08579 14.264063Z\"\n />\n </svg>\n </span>\n \n\n {this.buttonBlocked ? 'Dodano do koszyka…' : !this.availableTesters ? 'Tester obecnie niedostępny' : 'Dodaj do koszyka'}\n </button>\n </div>\n </div>\n </div>\n </div>\n <div class=\"boxes__box-content__slider\">{this.renderSliderOrImage()}</div>\n </div>\n );\n }\n}\n"],"version":3}
1
+ {"file":"my-colorinfo2.js","mappings":";;;;;AAAA,MAAM,cAAc,GAAG,8mPAA8mP;;MCWxnP,WAAW;;;;;;IAiBtB,gBAAW,GAAG;;MACZ,IAAI,CAAC,YAAY;QACf,YAAY,CAAC;UACX,KAAK,EAAE,aAAa;UACpB,IAAI,EAAE,IAAI,CAAC,IAAI;UACf,OAAO,EAAE,IAAI,CAAC,OAAO;UACrB,KAAK,EAAE,MAAA,IAAI,CAAC,YAAY,0CAAE,IAAI;SAC/B,CAAC,CAAC;MACL,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;KAC1B,CAAC;IAEF,uBAAkB,GAAG;MACnB,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;KAC1B,CAAC;IAEF,wBAAmB,GAAG;;MACpB,IA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AAY,iBAAa,MAAM,IACzC,WAAK,KAAK,EAAC,4BAA4B,EAAC,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,IAChF,YACE,KAAK,EAAC,kBAAkB,EACxB,SAAS,EAAC,wBAAwB,EAClC,CAAC,EAAC,ynDAAynD,GAC3nD,CACE,CACD,EAGN,IAAI,CAAC,aAAa,GAAG,oBAAoB,GAAG,CAAC,IAAI,CAAC,gBAAgB,GAAG,4BAA4B,GAAG,kBAAkB,CAChH,CACL,CACF,CACF,CACF,EACN,WAAK,KAAK,EAAC,4BAA4B,IAAE,IAAI,CAAC,mBAAmB,EAAE,CAAO,CACtE,EACN;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/my-colorinfo/my-colorinfo.scss?tag=my-colorinfo&encapsulation=scoped","./src/components/my-colorinfo/my-colorinfo.tsx"],"sourcesContent":["@import '../../global/app.scss';\n\n.boxes__box-content {\n width: 100%;\n margin-bottom: 5px;\n height: 500px;\n text-align: left;\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n position: relative;\n\n .closebtn {\n position: absolute;\n right: 10px;\n top: 10px;\n width: 53px;\n height: 53px;\n cursor: pointer;\n object-fit: cover;\n z-index: 9999;\n }\n\n @media (max-width: $medium) {\n flex-direction: column-reverse;\n height: auto;\n }\n\n @media (max-width: $small) {\n margin: 0 auto;\n }\n\n &__info {\n width: 40%;\n padding: 50px 40px;\n position: relative;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n\n @media (max-width: $medium) {\n width: 100%;\n padding: 15px;\n min-height: 100px;\n }\n\n @media (max-width: $small) {\n min-height: auto;\n }\n\n &__header {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n }\n\n h2 {\n font-size: 35px;\n font-weight: normal;\n margin-bottom: 30px;\n color: $black;\n\n @media (max-width: $small) {\n font-size: 16px;\n text-align: center;\n margin-bottom: 15px;\n margin-top: 5px;\n }\n }\n\n h4 {\n margin-top: 0px;\n margin-bottom: 15px;\n font-size: 16px;\n color: $grey;\n }\n\n &__value {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: 20px;\n\n @media (max-width: $medium) {\n justify-content: flex-start;\n margin-top: 30px;\n }\n\n @media (max-width: $small) {\n flex-direction: column;\n }\n\n &-image {\n @media (max-width: $small) {\n margin: 0 auto;\n margin-bottom: 10px;\n }\n\n img {\n width: 114px;\n object-fit: cover;\n\n @media (max-width: $medium) {\n width: 75px;\n }\n }\n }\n\n &-product {\n color: $black;\n margin-left: 10px;\n\n h2 {\n @media (max-width: $medium) {\n font-size: 26px;\n margin: 0;\n margin-right: 10px;\n }\n\n @media (max-width: $small) {\n font-size: 16px;\n }\n }\n\n p {\n font-size: 20px;\n margin-top: 0px;\n margin-bottom: 0px;\n\n &:last-of-type {\n margin-bottom: 20px;\n\n @media (max-width: $medium) {\n margin-bottom: 0;\n }\n }\n\n @media (max-width: $small) {\n font-size: 10px;\n }\n }\n\n > div {\n @media (max-width: $medium) {\n display: flex;\n justify-content: flex-start;\n align-items: center;\n }\n\n @media (max-width: $small) {\n flex-direction: column;\n }\n }\n }\n }\n\n &__tester {\n display: flex;\n flex-direction: column;\n gap: 15px;\n width: 100%;\n\n @media (max-width: $medium) {\n text-align: center;\n }\n\n .tester-text {\n h2 {\n margin: 0 0 10px;\n font-size: 18px;\n font-weight: 700;\n }\n\n p {\n margin: 0;\n font-size: 14px;\n }\n }\n\n .tester-buy {\n display: flex;\n align-items: center;\n gap: 15px;\n\n @media (max-width: $medium) {\n flex-direction: column;\n\n button {\n margin: 0;\n max-width: 100%;\n }\n }\n }\n\n .price {\n font-size: 20px;\n font-weight: 600;\n }\n }\n }\n\n &__slider {\n width: 60%;\n min-width: 60%;\n max-width: 60%;\n position: relative;\n\n @media (max-width: $medium) {\n width: 100%;\n display: block;\n min-width: 100%;\n max-width: 100%;\n }\n\n .color-big-image {\n width: 100%;\n height: 100%;\n object-fit: cover;\n\n @media (max-width: $medium) {\n height: 300px;\n }\n }\n }\n\n &__white {\n .tester-text,\n .tester-buy {\n color: $white;\n }\n\n h2 {\n color: $white;\n }\n }\n}\n\n.button,\na.button {\n background-color: $white;\n font-size: 16px;\n box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.1);\n border-radius: 22px;\n padding: 10px 35px;\n color: $black;\n text-decoration: none;\n text-align: center;\n transition: all 0.7s ease-in-out;\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n gap: 5px;\n\n .shape-icon {\n display: inline-flex;\n\n svg {\n display: block;\n }\n\n path,\n .shape-icon__path {\n fill: currentColor;\n transition: fill 0.7s ease-in-out;\n }\n }\n\n &.fit {\n padding: 10px 15px;\n }\n\n &:hover {\n color: $white;\n background-color: $black;\n }\n\n &.brown {\n background-color: $brown;\n color: $white;\n\n &:hover {\n color: $white;\n background-color: $black;\n }\n }\n\n &.inverse {\n background-color: $black;\n color: $white;\n\n &:hover {\n color: $black;\n background-color: $white;\n }\n\n svg {\n path {\n fill: $white;\n }\n }\n }\n\n &:disabled {\n cursor: not-allowed;\n background-color: lighten($white_shadow, 20%);\n opacity: 0.5;\n\n &.brown {\n background-color: darken($brown, 20%);\n color: lighten($white, 20%);\n opacity: 0.5;\n }\n\n &.inverse {\n background-color: darken($black, 20%);\n color: lighten($white, 20%);\n opacity: 0.5;\n }\n\n &:hover {\n background-color: inherit;\n color: inherit;\n opacity: 0.5;\n }\n }\n\n @media (max-width: $medium) {\n max-width: 150px;\n font-size: 13px;\n padding: 12px 25px;\n }\n\n @media (max-width: $small) {\n margin: 0 auto;\n }\n}\n\n.divider {\n border: 1px solid $grey;\n opacity: 0.2;\n margin-bottom: 20px;\n\n @media (max-width: $small) {\n margin: 10px 0px;\n display: none;\n }\n}\n\n","import { Component, Prop, h, getAssetPath, Event, EventEmitter } from '@stencil/core';\nimport { setDataLayer } from '../../gtmUtils';\nimport { AvailableTester, Color, Link, Product } from '../../types';\nimport { APIURL, accessToken } from '../api';\n\n@Component({\n tag: 'my-colorinfo',\n styleUrl: 'my-colorinfo.scss',\n assetsDirs: ['assets'],\n scoped: true,\n})\nexport class MyColorInfo {\n @Prop() currentColor: Color;\n @Prop() shop: string;\n @Prop() product: string;\n @Prop() baselink: string;\n @Prop() availableTesters: AvailableTester | null;\n @Prop() price: number | null;\n @Prop() data: Product | null = null;\n @Prop() isMobile: boolean = false;\n @Prop() infoBoxWidth: number | null;\n @Prop() closeImage = 'close.png';\n @Prop() shapeImage = 'Shape.svg';\n @Prop() buttonBlocked = false;\n\n @Event() closeInfoBox: EventEmitter;\n @Event({ bubbles: true, composed: true }) addToBasket: EventEmitter<{ id: number }>;\n\n goToProduct = () => {\n this.currentColor &&\n setDataLayer({\n event: 'GoToProduct',\n shop: this.shop,\n product: this.product,\n color: this.currentColor?.name,\n });\n this.closeInfoBox.emit();\n };\n\n onCloseButtonClick = () => {\n this.closeInfoBox.emit();\n };\n\n renderSliderOrImage = () => {\n if (this.currentColor.imageInsteadHex) {\n return <img class={'color-big-image'} src={`${APIURL}/assets/${this.currentColor.bigImage}?access_token=${accessToken}`} alt=\"color-image\" />;\n } else {\n return <my-slider color={this.currentColor.name} shop={this.shop} product={this.product} slides={this.data?.images}></my-slider>;\n }\n };\n\n getHref = () => {\n if (this.baselink) {\n return `${this.baselink}/${this?.currentColor.links?.find((link: Link) => link?.shop === this.shop)?.path}`;\n } else {\n return this?.currentColor.links?.find((link: Link) => link?.shop === this.shop)?.path;\n }\n };\n\n capitalizeFirstLetter = (string: string) => {\n return string.charAt(0).toUpperCase() + string.slice(1).toLocaleLowerCase();\n };\n\n isVeryLightBackground = (): boolean => {\n if (this.currentColor.imageInsteadHex) return true;\n const hex = this.currentColor.hex?.replace('#', '') ?? '';\n if (hex.length !== 6 && hex.length !== 3) return false;\n const r = parseInt(hex.length === 3 ? hex[0] + hex[0] : hex.slice(0, 2), 16) / 255;\n const g = parseInt(hex.length === 3 ? hex[1] + hex[1] : hex.slice(2, 4), 16) / 255;\n const b = parseInt(hex.length === 3 ? hex[2] + hex[2] : hex.slice(4, 6), 16) / 255;\n const luminance = 0.299 * r + 0.587 * g + 0.114 * b;\n return luminance > 0.96; // only near-white: dark button; rest: white button\n };\n\n getButtonClass = () => {\n if (this.currentColor.imageInsteadHex) return 'brown';\n return this.isVeryLightBackground() ? 'inverse' : '';\n };\n\n handleAddToBasket = () => {\n if (!this.availableTesters?.id_product_attribute) return;\n this.buttonBlocked = true;\n this.addToBasket.emit({\n id: this.availableTesters.id_product_attribute,\n });\n\n setTimeout(() => {\n this.buttonBlocked = false;\n }, 10000);\n };\n\n render() {\n return (\n <div\n class={`boxes__box-content ${this.currentColor.textWhite ? 'boxes__box-content__white' : ''}`}\n style={{\n background: this.currentColor.imageInsteadHex ? 'white' : this.currentColor.hex,\n maxWidth: `${this.infoBoxWidth && this.infoBoxWidth - 4}px`,\n }}\n >\n {this.isMobile && <img class={'closebtn'} onClick={this.onCloseButtonClick} src={getAssetPath(`./assets/${this.closeImage}`)} alt=\"closebtn\" />}\n <div\n class=\"boxes__box-content__info\"\n style={{\n maxWidth: this.isMobile ? `${this.infoBoxWidth && this.infoBoxWidth - 35}px` : ``,\n }}\n >\n <div class=\"boxes__box-content__info__header\">\n {!this.isMobile && <img class={'closebtn'} onClick={this.onCloseButtonClick} src={getAssetPath(`./assets/${this.closeImage}`)} alt=\"closebtn\" />}\n <h2>{this.capitalizeFirstLetter(this.currentColor.name)}</h2>\n {!this.isMobile && <h4>{this.currentColor.number}</h4>}\n {this.currentColor && this.currentColor.links?.find((link: Link) => link?.shop === this.shop) && (\n <a onClick={this.goToProduct} href={this.getHref()} class={`button ${this.getButtonClass()}`}>\n wybierz kolor\n </a>\n )}\n </div>\n <div class=\"boxes__box-content__info__value\">\n <div class=\"divider\"></div>\n\n <div class=\"boxes__box-content__info__tester\">\n {' '}\n <div class=\"divider\"></div>\n <div class=\"tester-text\">\n <h2>Zamów tester</h2>\n <p>Sprawdź go na swojej ścianie.</p>\n </div>\n <div class=\"tester-buy\">\n <div class=\"price\">{this.price ? `${this.price} zł` : ''}</div>\n\n <button\n class={`button fit ${this.getButtonClass()} ${!this.availableTesters ? 'disabled' : ''}`}\n onClick={this.handleAddToBasket}\n disabled={!this.availableTesters || this.buttonBlocked}\n >\n <span class=\"shape-icon\" aria-hidden=\"true\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"15\" height=\"16\" viewBox=\"0 0 15 16\">\n <path\n class=\"shape-icon__path\"\n transform=\"translate(0.0867462 0)\"\n d=\"M13.246571 12.763281L11.931726 4.961875C11.801879 4.1936703 11.13567 3.6319427 10.35657 3.63375L9.7429771 3.63375L9.7429771 3.1025C9.7429771 1.3890365 8.35394 0 6.6404767 0C4.9270134 0 3.537977 1.3890365 3.537977 3.1025L3.537977 3.63375L2.9217269 3.63375C2.1426277 3.6319427 1.4764187 4.1936703 1.3465706 4.961875L0.034383144 12.763281C-0.086738147 13.483807 0.11555123 14.221112 0.58740741 14.778946C1.0592636 15.336781 1.7528107 15.658594 2.4834456 15.658594L10.797508 15.658594C11.528143 15.658594 12.22169 15.336781 12.693546 14.778946C13.165402 14.221112 13.367692 13.483807 13.246571 12.763281L13.246571 12.763281ZM4.3348517 3.0892186C4.3348517 1.8158572 5.3671155 0.78359371 6.6404767 0.78359371C7.9138384 0.78359371 8.9461021 1.8158572 8.9461021 3.0892186L8.9461021 3.6204686L4.3348517 3.6204686L4.3348517 3.0892186ZM12.08579 14.264063C11.765244 14.643165 11.293964 14.86172 10.797508 14.86172L2.4834456 14.86172C1.9871488 14.862442 1.5158025 14.644215 1.195269 14.265309C0.87473541 13.886404 0.73765546 13.385406 0.82063317 12.896093L2.1248519 5.092031C2.1891608 4.703371 2.5278175 4.4200282 2.9217269 4.4252396L3.5353208 4.4252396L3.5353208 5.5834374C3.5353208 5.8034883 3.7137072 5.9818749 3.9337583 5.9818749C4.1538091 5.9818749 4.3321958 5.8034883 4.3321958 5.5834374L4.3321958 4.4252396L8.9461021 4.4252396L8.9461021 5.5834374C8.9461021 5.8034883 9.1244888 5.9818749 9.3445396 5.9818749C9.5645905 5.9818749 9.7429771 5.8034883 9.7429771 5.5834374L9.7429771 4.4252396L10.359227 4.4252396C10.753137 4.4200282 11.091793 4.703371 11.156102 5.092031L12.46032 12.896093C12.542204 13.384947 12.40527 13.885097 12.08579 14.264063L12.08579 14.264063Z\"\n />\n </svg>\n </span>\n \n\n {this.buttonBlocked ? 'Dodano do koszyka…' : !this.availableTesters ? 'Tester obecnie niedostępny' : 'Dodaj do koszyka'}\n </button>\n </div>\n </div>\n </div>\n </div>\n <div class=\"boxes__box-content__slider\">{this.renderSliderOrImage()}</div>\n </div>\n );\n }\n}\n"],"version":3}