@salla.sa/twilight-components 2.9.49 → 2.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/dist/cjs/{index-7b85482c.js → app-globals-a24e299c.js} +31 -2
  2. package/dist/cjs/index-1d2b3370.js +0 -4
  3. package/dist/cjs/loader.cjs.js +3 -2
  4. package/dist/cjs/salla-add-product-button.cjs.entry.js +7 -3
  5. package/dist/cjs/salla-button_35.cjs.entry.js +591 -1906
  6. package/dist/cjs/twilight.cjs.js +3 -2
  7. package/dist/collection/collection-manifest.json +0 -1
  8. package/dist/collection/components/salla-add-product-button/salla-add-product-button.js +9 -5
  9. package/dist/collection/components/salla-button/salla-button.js +5 -1
  10. package/dist/collection/components/salla-file-upload/salla-file-upload.js +9 -8
  11. package/dist/collection/components/salla-gifting/salla-gifting.js +18 -14
  12. package/dist/collection/components/salla-loyalty/salla-loyalty.js +5 -3
  13. package/dist/collection/components/salla-offer-modal/salla-offer-modal.js +6 -5
  14. package/dist/collection/components/salla-rating-stars/salla-rating-stars.js +14 -10
  15. package/dist/collection/components/salla-slider/salla-slider.css +242 -0
  16. package/dist/collection/components/salla-slider/salla-slider.js +403 -110
  17. package/dist/collection/global/app-dev.js +2 -1
  18. package/dist/collection/global/app.js +15 -0
  19. package/dist/components/index.d.ts +0 -1
  20. package/dist/components/index.js +31 -3
  21. package/dist/components/salla-add-product-button.js +7 -3
  22. package/dist/components/salla-button2.js +5 -1
  23. package/dist/components/salla-file-upload2.js +249 -3
  24. package/dist/components/salla-gifting.js +26 -16
  25. package/dist/components/salla-loyalty.js +3 -3
  26. package/dist/components/salla-offer-modal.js +5 -4
  27. package/dist/components/salla-rating-stars2.js +8 -4
  28. package/dist/components/salla-slider2.js +229 -1806
  29. package/dist/esm/{index-adc28dc8.js → app-globals-1619c0de.js} +31 -2
  30. package/dist/esm/index-f1d446ac.js +0 -4
  31. package/dist/esm/loader.js +3 -2
  32. package/dist/esm/salla-add-product-button.entry.js +7 -3
  33. package/dist/esm/salla-button_35.entry.js +590 -1905
  34. package/dist/esm/twilight.js +3 -2
  35. package/dist/esm-es5/{index-adc28dc8.js → app-globals-1619c0de.js} +2 -2
  36. package/dist/esm-es5/index-f1d446ac.js +2 -2
  37. package/dist/esm-es5/loader.js +1 -1
  38. package/dist/esm-es5/salla-add-product-button.entry.js +1 -1
  39. package/dist/esm-es5/salla-button_35.entry.js +11 -5
  40. package/dist/esm-es5/twilight.js +1 -1
  41. package/dist/twilight/p-0f839b43.system.js +4 -0
  42. package/dist/twilight/p-3420f00c.entry.js +30 -0
  43. package/dist/twilight/p-5207a10c.system.js +24 -0
  44. package/dist/twilight/{p-486ce499.system.entry.js → p-5a1197bb.system.entry.js} +1 -1
  45. package/dist/twilight/p-5b30b649.system.entry.js +47 -0
  46. package/dist/twilight/p-97614f6d.js +24 -0
  47. package/dist/twilight/{p-6f41faf8.entry.js → p-dbb379ce.entry.js} +1 -1
  48. package/dist/twilight/twilight.esm.js +1 -1
  49. package/dist/twilight/twilight.js +1 -1
  50. package/dist/types/components/salla-slider/salla-slider.d.ts +73 -14
  51. package/dist/types/components.d.ts +83 -60
  52. package/dist/types/global/app-dev.d.ts +0 -1
  53. package/package.json +6 -4
  54. package/dist/cjs/core-c7a9fb22.js +0 -4982
  55. package/dist/cjs/salla-swiper.cjs.entry.js +0 -62
  56. package/dist/collection/components/salla-swiper/salla-swiper.css +0 -177
  57. package/dist/collection/components/salla-swiper/salla-swiper.js +0 -152
  58. package/dist/components/arrow-left.js +0 -11
  59. package/dist/components/core.js +0 -4959
  60. package/dist/components/salla-swiper.d.ts +0 -11
  61. package/dist/components/salla-swiper.js +0 -92
  62. package/dist/esm/core-572aabd0.js +0 -4973
  63. package/dist/esm/salla-swiper.entry.js +0 -58
  64. package/dist/esm-es5/core-572aabd0.js +0 -4
  65. package/dist/esm-es5/salla-swiper.entry.js +0 -4
  66. package/dist/twilight/p-00e66d1a.system.js +0 -4
  67. package/dist/twilight/p-684a004a.system.entry.js +0 -4
  68. package/dist/twilight/p-6ed7d3a2.js +0 -4
  69. package/dist/twilight/p-7234a2a2.entry.js +0 -30
  70. package/dist/twilight/p-a84812f4.system.js +0 -4
  71. package/dist/twilight/p-d3daf7a7.system.entry.js +0 -41
  72. package/dist/twilight/p-e55e8d3d.js +0 -24
  73. package/dist/twilight/p-e8c3c209.entry.js +0 -4
  74. package/dist/twilight/p-ea021b56.system.js +0 -24
  75. package/dist/types/components/salla-swiper/salla-swiper.d.ts +0 -31
  76. package/dist/types/index.d.ts +0 -7
@@ -7,7 +7,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
7
7
 
8
8
  const index = require('./index-1d2b3370.js');
9
9
  const _commonjsHelpers = require('./_commonjsHelpers-691dd63b.js');
10
- const core = require('./core-c7a9fb22.js');
11
10
 
12
11
  const sallaButtonCss = "";
13
12
 
@@ -112,7 +111,11 @@ const SallaButton = class {
112
111
  return (index.h("button", Object.assign({}, this.getBtnAttributes(), { disabled: this.disabled }), index.h("span", { class: "s-button-text", ref: el => this.text = el }, index.h("slot", null)), this.loading ? index.h("span", { class: "s-button-loader" }) : ''));
113
112
  }
114
113
  render() {
115
- return (index.h(index.Host, { class: "s-button-wrap" }, this.href ? index.h("a", { href: this.href }, this.button()) : this.button()));
114
+ var _a;
115
+ //TODO:: find a better fix, this is a patch for issue that duplicates the buttons twice @see the screenshot inside this folder
116
+ return ((_a = this.host.closest('.swiper-slide')) === null || _a === void 0 ? void 0 : _a.classList.contains('swiper-slide-duplicate'))
117
+ ? ''
118
+ : (index.h(index.Host, { class: "s-button-wrap" }, this.href ? index.h("a", { href: this.href }, this.button()) : this.button()));
116
119
  }
117
120
  get host() { return index.getElement(this); }
118
121
  };
@@ -19692,6 +19695,252 @@ var filepondPluginImageEdit = _commonjsHelpers.createCommonjsModule(function (mo
19692
19695
  });
19693
19696
  });
19694
19697
 
19698
+ var filepondPluginFileValidateType = _commonjsHelpers.createCommonjsModule(function (module, exports) {
19699
+ /*!
19700
+ * FilePondPluginFileValidateType 1.2.8
19701
+ * Licensed under MIT, https://opensource.org/licenses/MIT/
19702
+ * Please visit https://pqina.nl/filepond/ for details.
19703
+ */
19704
+
19705
+ /* eslint-disable */
19706
+
19707
+ (function(global, factory) {
19708
+ (module.exports = factory())
19709
+ ;
19710
+ })(_commonjsHelpers.commonjsGlobal, function() {
19711
+
19712
+ var plugin = function plugin(_ref) {
19713
+ var addFilter = _ref.addFilter,
19714
+ utils = _ref.utils;
19715
+ // get quick reference to Type utils
19716
+ var Type = utils.Type,
19717
+ isString = utils.isString,
19718
+ replaceInString = utils.replaceInString,
19719
+ guesstimateMimeType = utils.guesstimateMimeType,
19720
+ getExtensionFromFilename = utils.getExtensionFromFilename,
19721
+ getFilenameFromURL = utils.getFilenameFromURL;
19722
+
19723
+ var mimeTypeMatchesWildCard = function mimeTypeMatchesWildCard(
19724
+ mimeType,
19725
+ wildcard
19726
+ ) {
19727
+ var mimeTypeGroup = (/^[^/]+/.exec(mimeType) || []).pop(); // image/png -> image
19728
+ var wildcardGroup = wildcard.slice(0, -2); // image/* -> image
19729
+ return mimeTypeGroup === wildcardGroup;
19730
+ };
19731
+
19732
+ var isValidMimeType = function isValidMimeType(
19733
+ acceptedTypes,
19734
+ userInputType
19735
+ ) {
19736
+ return acceptedTypes.some(function(acceptedType) {
19737
+ // accepted is wildcard mime type
19738
+ if (/\*$/.test(acceptedType)) {
19739
+ return mimeTypeMatchesWildCard(userInputType, acceptedType);
19740
+ }
19741
+
19742
+ // is normal mime type
19743
+ return acceptedType === userInputType;
19744
+ });
19745
+ };
19746
+
19747
+ var getItemType = function getItemType(item) {
19748
+ // if the item is a url we guess the mime type by the extension
19749
+ var type = '';
19750
+ if (isString(item)) {
19751
+ var filename = getFilenameFromURL(item);
19752
+ var extension = getExtensionFromFilename(filename);
19753
+ if (extension) {
19754
+ type = guesstimateMimeType(extension);
19755
+ }
19756
+ } else {
19757
+ type = item.type;
19758
+ }
19759
+
19760
+ return type;
19761
+ };
19762
+
19763
+ var validateFile = function validateFile(
19764
+ item,
19765
+ acceptedFileTypes,
19766
+ typeDetector
19767
+ ) {
19768
+ // no types defined, everything is allowed \o/
19769
+ if (acceptedFileTypes.length === 0) {
19770
+ return true;
19771
+ }
19772
+
19773
+ // gets the item type
19774
+ var type = getItemType(item);
19775
+
19776
+ // no type detector, test now
19777
+ if (!typeDetector) {
19778
+ return isValidMimeType(acceptedFileTypes, type);
19779
+ }
19780
+
19781
+ // use type detector
19782
+ return new Promise(function(resolve, reject) {
19783
+ typeDetector(item, type)
19784
+ .then(function(detectedType) {
19785
+ if (isValidMimeType(acceptedFileTypes, detectedType)) {
19786
+ resolve();
19787
+ } else {
19788
+ reject();
19789
+ }
19790
+ })
19791
+ .catch(reject);
19792
+ });
19793
+ };
19794
+
19795
+ var applyMimeTypeMap = function applyMimeTypeMap(map) {
19796
+ return function(acceptedFileType) {
19797
+ return map[acceptedFileType] === null
19798
+ ? false
19799
+ : map[acceptedFileType] || acceptedFileType;
19800
+ };
19801
+ };
19802
+
19803
+ // setup attribute mapping for accept
19804
+ addFilter('SET_ATTRIBUTE_TO_OPTION_MAP', function(map) {
19805
+ return Object.assign(map, {
19806
+ accept: 'acceptedFileTypes'
19807
+ });
19808
+ });
19809
+
19810
+ // filtering if an item is allowed in hopper
19811
+ addFilter('ALLOW_HOPPER_ITEM', function(file, _ref2) {
19812
+ var query = _ref2.query;
19813
+ // if we are not doing file type validation exit
19814
+ if (!query('GET_ALLOW_FILE_TYPE_VALIDATION')) {
19815
+ return true;
19816
+ }
19817
+
19818
+ // we validate the file against the accepted file types
19819
+ return validateFile(file, query('GET_ACCEPTED_FILE_TYPES'));
19820
+ });
19821
+
19822
+ // called for each file that is loaded
19823
+ // right before it is set to the item state
19824
+ // should return a promise
19825
+ addFilter('LOAD_FILE', function(file, _ref3) {
19826
+ var query = _ref3.query;
19827
+ return new Promise(function(resolve, reject) {
19828
+ if (!query('GET_ALLOW_FILE_TYPE_VALIDATION')) {
19829
+ resolve(file);
19830
+ return;
19831
+ }
19832
+
19833
+ var acceptedFileTypes = query('GET_ACCEPTED_FILE_TYPES');
19834
+
19835
+ // custom type detector method
19836
+ var typeDetector = query('GET_FILE_VALIDATE_TYPE_DETECT_TYPE');
19837
+
19838
+ // if invalid, exit here
19839
+ var validationResult = validateFile(
19840
+ file,
19841
+ acceptedFileTypes,
19842
+ typeDetector
19843
+ );
19844
+
19845
+ var handleRejection = function handleRejection() {
19846
+ var acceptedFileTypesMapped = acceptedFileTypes
19847
+ .map(
19848
+ applyMimeTypeMap(
19849
+ query('GET_FILE_VALIDATE_TYPE_LABEL_EXPECTED_TYPES_MAP')
19850
+ )
19851
+ )
19852
+ .filter(function(label) {
19853
+ return label !== false;
19854
+ });
19855
+
19856
+ var acceptedFileTypesMapped_unique = acceptedFileTypesMapped.filter(
19857
+ function(item, index) {
19858
+ return acceptedFileTypesMapped.indexOf(item) === index;
19859
+ }
19860
+ );
19861
+
19862
+ reject({
19863
+ status: {
19864
+ main: query('GET_LABEL_FILE_TYPE_NOT_ALLOWED'),
19865
+ sub: replaceInString(
19866
+ query('GET_FILE_VALIDATE_TYPE_LABEL_EXPECTED_TYPES'),
19867
+ {
19868
+ allTypes: acceptedFileTypesMapped_unique.join(', '),
19869
+ allButLastType: acceptedFileTypesMapped_unique
19870
+ .slice(0, -1)
19871
+ .join(', '),
19872
+ lastType:
19873
+ acceptedFileTypesMapped_unique[
19874
+ acceptedFileTypesMapped.length - 1
19875
+ ]
19876
+ }
19877
+ )
19878
+ }
19879
+ });
19880
+ };
19881
+
19882
+ // has returned new filename immidiately
19883
+ if (typeof validationResult === 'boolean') {
19884
+ if (!validationResult) {
19885
+ return handleRejection();
19886
+ }
19887
+ return resolve(file);
19888
+ }
19889
+
19890
+ // is promise
19891
+ validationResult
19892
+ .then(function() {
19893
+ resolve(file);
19894
+ })
19895
+ .catch(handleRejection);
19896
+ });
19897
+ });
19898
+
19899
+ // expose plugin
19900
+ return {
19901
+ // default options
19902
+ options: {
19903
+ // Enable or disable file type validation
19904
+ allowFileTypeValidation: [true, Type.BOOLEAN],
19905
+
19906
+ // What file types to accept
19907
+ acceptedFileTypes: [[], Type.ARRAY],
19908
+ // - must be comma separated
19909
+ // - mime types: image/png, image/jpeg, image/gif
19910
+ // - extensions: .png, .jpg, .jpeg ( not enabled yet )
19911
+ // - wildcards: image/*
19912
+
19913
+ // label to show when a type is not allowed
19914
+ labelFileTypeNotAllowed: ['File is of invalid type', Type.STRING],
19915
+
19916
+ // nicer label
19917
+ fileValidateTypeLabelExpectedTypes: [
19918
+ 'Expects {allButLastType} or {lastType}',
19919
+ Type.STRING
19920
+ ],
19921
+
19922
+ // map mime types to extensions
19923
+ fileValidateTypeLabelExpectedTypesMap: [{}, Type.OBJECT],
19924
+
19925
+ // Custom function to detect type of file
19926
+ fileValidateTypeDetectType: [null, Type.FUNCTION]
19927
+ }
19928
+ };
19929
+ };
19930
+
19931
+ // fire pluginloaded event if running in browser, this allows registering the plugin when using async script tags
19932
+ var isBrowser =
19933
+ typeof window !== 'undefined' && typeof window.document !== 'undefined';
19934
+ if (isBrowser) {
19935
+ document.dispatchEvent(
19936
+ new CustomEvent('FilePond:pluginloaded', { detail: plugin })
19937
+ );
19938
+ }
19939
+
19940
+ return plugin;
19941
+ });
19942
+ });
19943
+
19695
19944
  const sallaFileUploadCss = "/*!\n * FilePond 4.30.4\n * Licensed under MIT, https://opensource.org/licenses/MIT/\n * Please visit https://pqina.nl/filepond/ for details.\n */.filepond--assistant{position:absolute;overflow:hidden;height:1px;width:1px;padding:0;border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);white-space:nowrap}.filepond--browser.filepond--browser{position:absolute;margin:0;padding:0;left:1em;top:1.75em;width:calc(100% - 2em);opacity:0;font-size:0}.filepond--data{position:absolute;width:0;height:0;padding:0;margin:0;border:none;visibility:hidden;pointer-events:none;contain:strict}.filepond--drip{position:absolute;top:0;left:0;right:0;bottom:0;overflow:hidden;opacity:.1;pointer-events:none;border-radius:.5em;background:rgba(0,0,0,.01)}.filepond--drip-blob{-webkit-transform-origin:center center;transform-origin:center center;width:8em;height:8em;margin-left:-4em;margin-top:-4em;background:#292625;border-radius:50%}.filepond--drip-blob,.filepond--drop-label{position:absolute;top:0;left:0;will-change:transform,opacity}.filepond--drop-label{right:0;margin:0;color:#4f4f4f;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;height:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.filepond--drop-label.filepond--drop-label label{display:block;margin:0;padding:.5em}.filepond--drop-label label{cursor:default;font-size:.875em;font-weight:400;text-align:center;line-height:1.5}.filepond--label-action{text-decoration:underline;-webkit-text-decoration-skip:ink;text-decoration-skip-ink:auto;-webkit-text-decoration-color:#a7a4a4;text-decoration-color:#a7a4a4;cursor:pointer}.filepond--root[data-disabled] .filepond--drop-label label{opacity:.5}.filepond--file-action-button.filepond--file-action-button{font-size:1em;width:1.625em;height:1.625em;font-family:inherit;line-height:inherit;margin:0;padding:0;border:none;outline:none;will-change:transform,opacity}.filepond--file-action-button.filepond--file-action-button span{position:absolute;overflow:hidden;height:1px;width:1px;padding:0;border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);white-space:nowrap}.filepond--file-action-button.filepond--file-action-button svg{width:100%;height:100%}.filepond--file-action-button.filepond--file-action-button:after{position:absolute;left:-.75em;right:-.75em;top:-.75em;bottom:-.75em;content:\"\"}.filepond--file-action-button{cursor:auto;color:#fff;border-radius:50%;background-color:rgba(0,0,0,.5);background-image:none;-webkit-box-shadow:0 0 0 0 hsla(0,0%,100%,0);box-shadow:0 0 0 0 hsla(0,0%,100%,0);-webkit-transition:-webkit-box-shadow .25s ease-in;transition:-webkit-box-shadow .25s ease-in;transition:box-shadow .25s ease-in;transition:box-shadow .25s ease-in, -webkit-box-shadow .25s ease-in}.filepond--file-action-button:focus,.filepond--file-action-button:hover{-webkit-box-shadow:0 0 0 .125em hsla(0,0%,100%,.9);box-shadow:0 0 0 .125em hsla(0,0%,100%,.9)}.filepond--file-action-button[disabled]{color:hsla(0,0%,100%,.5);background-color:rgba(0,0,0,.25)}.filepond--file-action-button[hidden]{display:none}.filepond--action-edit-item.filepond--action-edit-item{width:2em;height:2em;padding:.1875em}.filepond--action-edit-item.filepond--action-edit-item[data-align*=center]{margin-left:-.1875em}.filepond--action-edit-item.filepond--action-edit-item[data-align*=bottom]{margin-bottom:-.1875em}.filepond--action-edit-item-alt{border:none;line-height:inherit;background:transparent;font-family:inherit;color:inherit;outline:none;padding:0;margin:0 0 0 .25em;pointer-events:all;position:absolute}.filepond--action-edit-item-alt svg{width:1.3125em;height:1.3125em}.filepond--action-edit-item-alt span{font-size:0;opacity:0}.filepond--file-info{position:static;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:flex-start;-ms-flex:1;flex:1;margin:0 .5em 0 0;min-width:0;will-change:transform,opacity;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.filepond--file-info *{margin:0}.filepond--file-info .filepond--file-info-main{font-size:.75em;line-height:1.2;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;width:100%}.filepond--file-info .filepond--file-info-sub{font-size:.625em;opacity:.5;-webkit-transition:opacity .25s ease-in-out;transition:opacity .25s ease-in-out;white-space:nowrap}.filepond--file-info .filepond--file-info-sub:empty{display:none}.filepond--file-status{position:static;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:end;align-items:flex-end;-ms-flex-positive:0;flex-grow:0;-ms-flex-negative:0;flex-shrink:0;margin:0;min-width:2.25em;text-align:right;will-change:transform,opacity;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.filepond--file-status *{margin:0;white-space:nowrap}.filepond--file-status .filepond--file-status-main{font-size:.75em;line-height:1.2}.filepond--file-status .filepond--file-status-sub{font-size:.625em;opacity:.5;-webkit-transition:opacity .25s ease-in-out;transition:opacity .25s ease-in-out}.filepond--file-wrapper.filepond--file-wrapper{border:none;margin:0;padding:0;min-width:0;height:100%}.filepond--file-wrapper.filepond--file-wrapper>legend{position:absolute;overflow:hidden;height:1px;width:1px;padding:0;border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);white-space:nowrap}.filepond--file{position:static;display:-ms-flexbox;display:flex;height:100%;-ms-flex-align:start;align-items:flex-start;padding:.5625em;color:#fff;border-radius:.5em}.filepond--file .filepond--file-status{margin-left:auto;margin-right:2.25em}.filepond--file .filepond--processing-complete-indicator{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:3}.filepond--file .filepond--file-action-button,.filepond--file .filepond--processing-complete-indicator,.filepond--file .filepond--progress-indicator{position:absolute}.filepond--file [data-align*=left]{left:.5625em}.filepond--file [data-align*=right]{right:.5625em}.filepond--file [data-align*=center]{left:calc(50% - .8125em)}.filepond--file [data-align*=bottom]{bottom:1.125em}.filepond--file [data-align=center]{top:calc(50% - .8125em)}.filepond--file .filepond--progress-indicator{margin-top:.1875em}.filepond--file .filepond--progress-indicator[data-align*=right]{margin-right:.1875em}.filepond--file .filepond--progress-indicator[data-align*=left]{margin-left:.1875em}[data-filepond-item-state*=error] .filepond--file-info,[data-filepond-item-state*=invalid] .filepond--file-info,[data-filepond-item-state=cancelled] .filepond--file-info{margin-right:2.25em}[data-filepond-item-state~=processing] .filepond--file-status-sub{opacity:0}[data-filepond-item-state~=processing] .filepond--action-abort-item-processing~.filepond--file-status .filepond--file-status-sub{opacity:.5}[data-filepond-item-state=processing-error] .filepond--file-status-sub{opacity:0}[data-filepond-item-state=processing-error] .filepond--action-retry-item-processing~.filepond--file-status .filepond--file-status-sub{opacity:.5}[data-filepond-item-state=processing-complete] .filepond--action-revert-item-processing svg{-webkit-animation:fall .5s linear .125s both;animation:fall .5s linear .125s both}[data-filepond-item-state=processing-complete] .filepond--file-status-sub{opacity:.5}[data-filepond-item-state=processing-complete] .filepond--file-info-sub,[data-filepond-item-state=processing-complete] .filepond--processing-complete-indicator:not([style*=hidden])~.filepond--file-status .filepond--file-status-sub{opacity:0}[data-filepond-item-state=processing-complete] .filepond--action-revert-item-processing~.filepond--file-info .filepond--file-info-sub{opacity:.5}[data-filepond-item-state*=error] .filepond--file-wrapper,[data-filepond-item-state*=error] .filepond--panel,[data-filepond-item-state*=invalid] .filepond--file-wrapper,[data-filepond-item-state*=invalid] .filepond--panel{-webkit-animation:shake .65s linear both;animation:shake .65s linear both}[data-filepond-item-state*=busy] .filepond--progress-indicator svg{-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@-webkit-keyframes shake{10%,90%{-webkit-transform:translateX(-.0625em);transform:translateX(-.0625em)}20%,80%{-webkit-transform:translateX(.125em);transform:translateX(.125em)}30%,50%,70%{-webkit-transform:translateX(-.25em);transform:translateX(-.25em)}40%,60%{-webkit-transform:translateX(.25em);transform:translateX(.25em)}}@keyframes shake{10%,90%{-webkit-transform:translateX(-.0625em);transform:translateX(-.0625em)}20%,80%{-webkit-transform:translateX(.125em);transform:translateX(.125em)}30%,50%,70%{-webkit-transform:translateX(-.25em);transform:translateX(-.25em)}40%,60%{-webkit-transform:translateX(.25em);transform:translateX(.25em)}}@-webkit-keyframes fall{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}70%{opacity:1;-webkit-transform:scale(1.1);transform:scale(1.1);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}to{-webkit-transform:scale(1);transform:scale(1);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}@keyframes fall{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}70%{opacity:1;-webkit-transform:scale(1.1);transform:scale(1.1);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}to{-webkit-transform:scale(1);transform:scale(1);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}.filepond--hopper[data-hopper-state=drag-over]>*{pointer-events:none}.filepond--hopper[data-hopper-state=drag-over]:after{content:\"\";position:absolute;left:0;top:0;right:0;bottom:0;z-index:100}.filepond--progress-indicator{z-index:103}.filepond--file-action-button{z-index:102}.filepond--file-status{z-index:101}.filepond--file-info{z-index:100}.filepond--item{position:absolute;top:0;left:0;right:0;z-index:1;padding:0;margin:.25em;will-change:transform,opacity}.filepond--item>.filepond--panel{z-index:-1}.filepond--item>.filepond--panel .filepond--panel-bottom{-webkit-box-shadow:0 .0625em .125em -.0625em rgba(0,0,0,.25);box-shadow:0 .0625em .125em -.0625em rgba(0,0,0,.25)}.filepond--item>.filepond--file-wrapper,.filepond--item>.filepond--panel{-webkit-transition:opacity .15s ease-out;transition:opacity .15s ease-out}.filepond--item[data-drag-state]{cursor:-webkit-grab;cursor:grab}.filepond--item[data-drag-state]>.filepond--panel{-webkit-transition:-webkit-box-shadow .125s ease-in-out;transition:-webkit-box-shadow .125s ease-in-out;transition:box-shadow .125s ease-in-out;transition:box-shadow .125s ease-in-out, -webkit-box-shadow .125s ease-in-out;-webkit-box-shadow:0 0 0 transparent;box-shadow:0 0 0 transparent}.filepond--item[data-drag-state=drag]{cursor:-webkit-grabbing;cursor:grabbing}.filepond--item[data-drag-state=drag]>.filepond--panel{-webkit-box-shadow:0 .125em .3125em rgba(0,0,0,.325);box-shadow:0 .125em .3125em rgba(0,0,0,.325)}.filepond--item[data-drag-state]:not([data-drag-state=idle]){z-index:2}.filepond--item-panel{background-color:#64605e}[data-filepond-item-state=processing-complete] .filepond--item-panel{background-color:#369763}[data-filepond-item-state*=error] .filepond--item-panel,[data-filepond-item-state*=invalid] .filepond--item-panel{background-color:#c44e47}.filepond--item-panel{border-radius:.5em;-webkit-transition:background-color .25s;transition:background-color .25s}.filepond--list-scroller{position:absolute;top:0;left:0;right:0;margin:0;will-change:transform}.filepond--list-scroller[data-state=overflow] .filepond--list{bottom:0;right:0}.filepond--list-scroller[data-state=overflow]{overflow-y:scroll;overflow-x:hidden;-webkit-overflow-scrolling:touch;-webkit-mask:-webkit-gradient(linear,left top, left bottom,from(#000),to(transparent));-webkit-mask:linear-gradient(180deg,#000 calc(100% - .5em),transparent);mask:-webkit-gradient(linear,left top, left bottom,from(#000),to(transparent));mask:linear-gradient(180deg,#000 calc(100% - .5em),transparent)}.filepond--list-scroller::-webkit-scrollbar{background:transparent}.filepond--list-scroller::-webkit-scrollbar:vertical{width:1em}.filepond--list-scroller::-webkit-scrollbar:horizontal{height:0}.filepond--list-scroller::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.3);border-radius:99999px;border:.3125em solid transparent;background-clip:content-box}.filepond--list.filepond--list{position:absolute;top:0;margin:0;padding:0;list-style-type:none;will-change:transform}.filepond--list{left:.75em;right:.75em}.filepond--root[data-style-panel-layout~=integrated]{width:100%;height:100%;max-width:none;margin:0}.filepond--root[data-style-panel-layout~=circle] .filepond--panel-root,.filepond--root[data-style-panel-layout~=integrated] .filepond--panel-root{border-radius:0}.filepond--root[data-style-panel-layout~=circle] .filepond--panel-root>*,.filepond--root[data-style-panel-layout~=integrated] .filepond--panel-root>*{display:none}.filepond--root[data-style-panel-layout~=circle] .filepond--drop-label,.filepond--root[data-style-panel-layout~=integrated] .filepond--drop-label{bottom:0;height:auto;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;z-index:7}.filepond--root[data-style-panel-layout~=circle] .filepond--item-panel,.filepond--root[data-style-panel-layout~=integrated] .filepond--item-panel{display:none}.filepond--root[data-style-panel-layout~=compact] .filepond--list-scroller,.filepond--root[data-style-panel-layout~=integrated] .filepond--list-scroller{overflow:hidden;height:100%;margin-top:0;margin-bottom:0}.filepond--root[data-style-panel-layout~=compact] .filepond--list,.filepond--root[data-style-panel-layout~=integrated] .filepond--list{left:0;right:0;height:100%}.filepond--root[data-style-panel-layout~=compact] .filepond--item,.filepond--root[data-style-panel-layout~=integrated] .filepond--item{margin:0}.filepond--root[data-style-panel-layout~=compact] .filepond--file-wrapper,.filepond--root[data-style-panel-layout~=integrated] .filepond--file-wrapper{height:100%}.filepond--root[data-style-panel-layout~=compact] .filepond--drop-label,.filepond--root[data-style-panel-layout~=integrated] .filepond--drop-label{z-index:7}.filepond--root[data-style-panel-layout~=circle]{border-radius:99999rem;overflow:hidden}.filepond--root[data-style-panel-layout~=circle]>.filepond--panel{border-radius:inherit}.filepond--root[data-style-panel-layout~=circle]>.filepond--panel>*{display:none}.filepond--root[data-style-panel-layout~=circle] .filepond--file-info,.filepond--root[data-style-panel-layout~=circle] .filepond--file-status{display:none}.filepond--root[data-style-panel-layout~=circle] .filepond--action-edit-item{opacity:1!important;visibility:visible!important}@media not all and (-webkit-min-device-pixel-ratio:0), not all and (min-resolution:0.001dpcm){@supports (-webkit-appearance:none) and (stroke-color:transparent){.filepond--root[data-style-panel-layout~=circle]{will-change:transform}}}.filepond--panel-root{border-radius:.5em;background-color:#f1f0ef}.filepond--panel{position:absolute;left:0;top:0;right:0;margin:0;height:100%!important;pointer-events:none}.filepond-panel:not([data-scalable=false]){height:auto!important}.filepond--panel[data-scalable=false]>div{display:none}.filepond--panel[data-scalable=true]{-webkit-transform-style:preserve-3d;transform-style:preserve-3d;background-color:transparent!important;border:none!important}.filepond--panel-bottom,.filepond--panel-center,.filepond--panel-top{position:absolute;left:0;top:0;right:0;margin:0;padding:0}.filepond--panel-bottom,.filepond--panel-top{height:.5em}.filepond--panel-top{border-bottom-left-radius:0!important;border-bottom-right-radius:0!important;border-bottom:none!important}.filepond--panel-top:after{content:\"\";position:absolute;height:2px;left:0;right:0;bottom:-1px;background-color:inherit}.filepond--panel-bottom,.filepond--panel-center{will-change:transform;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-transform-origin:left top;transform-origin:left top;-webkit-transform:translate3d(0,.5em,0);transform:translate3d(0,.5em,0)}.filepond--panel-bottom{border-top-left-radius:0!important;border-top-right-radius:0!important;border-top:none!important}.filepond--panel-bottom:before{content:\"\";position:absolute;height:2px;left:0;right:0;top:-1px;background-color:inherit}.filepond--panel-center{height:100px!important;border-top:none!important;border-bottom:none!important;border-radius:0!important}.filepond--panel-center:not([style]){visibility:hidden}.filepond--progress-indicator{position:static;width:1.25em;height:1.25em;color:#fff;margin:0;pointer-events:none;will-change:transform,opacity}.filepond--progress-indicator svg{width:100%;height:100%;vertical-align:top;transform-box:fill-box}.filepond--progress-indicator path{fill:none;stroke:currentColor}.filepond--list-scroller{z-index:6}.filepond--drop-label{z-index:5}.filepond--drip{z-index:3}.filepond--root>.filepond--panel{z-index:2}.filepond--browser{z-index:1}.filepond--root{-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;margin-bottom:1em;font-size:1rem;line-height:normal;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;font-weight:450;text-align:left;text-rendering:optimizeLegibility;direction:ltr;contain:layout style size}.filepond--root *{-webkit-box-sizing:inherit;box-sizing:inherit;line-height:inherit}.filepond--root :not(text){font-size:inherit}.filepond--root[data-disabled]{pointer-events:none}.filepond--root[data-disabled] .filepond--list-scroller{pointer-events:all}.filepond--root[data-disabled] .filepond--list{pointer-events:none}.filepond--root .filepond--drop-label{min-height:4.75em}.filepond--root .filepond--list-scroller{margin-top:1em;margin-bottom:1em}.filepond--root .filepond--credits{position:absolute;right:0;opacity:.175;line-height:.85;font-size:11px;color:inherit;text-decoration:none;z-index:3;bottom:-14px}.filepond--root .filepond--credits[style]{top:0;bottom:auto;margin-top:14px}/*!\n * FilePondPluginImagePreview 4.6.11\n * Licensed under MIT, https://opensource.org/licenses/MIT/\n * Please visit https://pqina.nl/filepond/ for details.\n */.filepond--image-preview-markup{position:absolute;left:0;top:0}.filepond--image-preview-wrapper{z-index:2}.filepond--image-preview-overlay{display:block;position:absolute;left:0;top:0;width:100%;min-height:5rem;max-height:7rem;margin:0;opacity:0;z-index:2;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.filepond--image-preview-overlay svg{width:100%;height:auto;color:inherit;max-height:inherit}.filepond--image-preview-overlay-idle{mix-blend-mode:multiply;color:rgba(40, 40, 40, 0.85)}.filepond--image-preview-overlay-success{mix-blend-mode:normal;color:rgba(54, 151, 99, 1)}.filepond--image-preview-overlay-failure{mix-blend-mode:normal;color:rgba(196, 78, 71, 1)}@supports (-webkit-marquee-repetition: infinite) and\n ((-o-object-fit: fill) or (object-fit: fill)){.filepond--image-preview-overlay-idle{mix-blend-mode:normal}}.filepond--image-preview-wrapper{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:absolute;left:0;top:0;right:0;height:100%;margin:0;border-radius:0.45em;overflow:hidden;background:rgba(0, 0, 0, 0.01)}.filepond--image-preview{position:absolute;left:0;top:0;z-index:1;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;height:100%;width:100%;pointer-events:none;background:#222;will-change:transform, opacity}.filepond--image-clip{position:relative;overflow:hidden;margin:0 auto;}.filepond--image-clip[data-transparency-indicator='grid'] img,.filepond--image-clip[data-transparency-indicator='grid'] canvas{background-color:#fff;background-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg' fill='%23eee'%3E%3Cpath d='M0 0 H50 V50 H0'/%3E%3Cpath d='M50 50 H100 V100 H50'/%3E%3C/svg%3E\");background-size:1.25em 1.25em}.filepond--image-bitmap,.filepond--image-vector{position:absolute;left:0;top:0;will-change:transform}.filepond--root[data-style-panel-layout~='integrated'] .filepond--image-preview-wrapper{border-radius:0}.filepond--root[data-style-panel-layout~='integrated'] .filepond--image-preview{height:100%;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}.filepond--root[data-style-panel-layout~='circle'] .filepond--image-preview-wrapper{border-radius:99999rem}.filepond--root[data-style-panel-layout~='circle'] .filepond--image-preview-overlay{top:auto;bottom:0;-webkit-transform:scaleY(-1);transform:scaleY(-1)}.filepond--root[data-style-panel-layout~='circle'] .filepond--file .filepond--file-action-button[data-align*='bottom']:not([data-align*='center']){margin-bottom:0.325em}.filepond--root[data-style-panel-layout~='circle'] .filepond--file [data-align*='left']{left:calc(50% - 3em)}.filepond--root[data-style-panel-layout~='circle'] .filepond--file [data-align*='right']{right:calc(50% - 3em)}.filepond--root[data-style-panel-layout~='circle'] .filepond--progress-indicator[data-align*='bottom'][data-align*='left'],.filepond--root[data-style-panel-layout~='circle'] .filepond--progress-indicator[data-align*='bottom'][data-align*='right']{margin-bottom:calc(0.325em + 0.1875em)}.filepond--root[data-style-panel-layout~='circle'] .filepond--progress-indicator[data-align*='bottom'][data-align*='center']{margin-top:0;margin-bottom:0.1875em;margin-left:0.1875em}/*!\n * FilePondPluginImageEdit 1.6.3\n * Licensed under MIT, https://opensource.org/licenses/MIT/\n * Please visit https://pqina.nl/filepond/ for details.\n */.filepond--action-edit-item.filepond--action-edit-item{width:2em;height:2em;padding:0.1875em}.filepond--action-edit-item.filepond--action-edit-item[data-align*='center']{margin-left:-0.1875em}.filepond--action-edit-item.filepond--action-edit-item[data-align*='bottom']{margin-bottom:-0.1875em}.filepond--action-edit-item-alt{border:none;line-height:inherit;background:transparent;font-family:inherit;color:inherit;outline:none;padding:0;margin:0 0 0 0.25em;pointer-events:all;position:absolute}.filepond--action-edit-item-alt svg{width:1.3125em;height:1.3125em}.filepond--action-edit-item-alt span{font-size:0;opacity:0}.filepond--root[data-style-panel-layout~='circle'] .filepond--action-edit-item{opacity:1 !important;visibility:visible !important}";
19696
19945
 
19697
19946
  const SallaFileUpload = class {
@@ -19944,7 +20193,6 @@ const SallaFileUpload = class {
19944
20193
  */
19945
20194
  this.files = [];
19946
20195
  }
19947
- ;
19948
20196
  /**
19949
20197
  * Append intial file
19950
20198
  */
@@ -19955,7 +20203,7 @@ const SallaFileUpload = class {
19955
20203
  this.pond = this.intiFilePond();
19956
20204
  }
19957
20205
  intiFilePond() {
19958
- filepond.registerPlugin(FilePondPluginImagePreview, filepondPluginImageExifOrientation, filepondPluginFileValidateSize, filepondPluginImageEdit);
20206
+ filepond.registerPlugin(FilePondPluginImagePreview, filepondPluginImageExifOrientation, filepondPluginFileValidateSize, filepondPluginImageEdit, filepondPluginFileValidateType);
19959
20207
  return filepond.create(document.querySelector('.s-file-upload-input'), {
19960
20208
  files: this.files,
19961
20209
  required: this.required,
@@ -19989,6 +20237,7 @@ const SallaFileUpload = class {
19989
20237
  labelDecimalSeparator: this.labelDecimalSeparator,
19990
20238
  labelThousandsSeparator: this.labelThousandsSeparator,
19991
20239
  labelIdle: this.labelIdle,
20240
+ acceptedFileTypes: ['image/jpg', 'image/png', 'image/jpeg', 'image/gif', 'video/*'],
19992
20241
  labelInvalidField: this.labelInvalidField,
19993
20242
  labelFileWaitingForSize: this.labelFileWaitingForSize,
19994
20243
  beforeRemoveFile: (file_deleted) => new Promise((resolve) => {
@@ -19998,7 +20247,7 @@ const SallaFileUpload = class {
19998
20247
  });
19999
20248
  }
20000
20249
  render() {
20001
- return (index.h(index.Host, { class: "s-file-upload" }, index.h("input", { type: "file", class: "s-file-upload-wrapper s-file-upload-input", name: "filepond" })));
20250
+ return (index.h(index.Host, { class: "s-file-upload" }, index.h("input", { type: "file", class: "s-file-upload-wrapper s-file-upload-input", name: "filepond", accept: "image/png, image/jpeg, image/jpg, image/gif" })));
20002
20251
  }
20003
20252
  };
20004
20253
  SallaFileUpload.style = sallaFileUploadCss;
@@ -20009,6 +20258,20 @@ const Images = `<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32"
20009
20258
  </svg>
20010
20259
  `;
20011
20260
 
20261
+ const ArrowRightIcon$1 = `<!-- Generated by IcoMoon.io -->
20262
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
20263
+ <title>arrow-right</title>
20264
+ <path d="M29.217 15.465c-0.019-0.044-0.056-0.077-0.080-0.119-0.067-0.116-0.139-0.227-0.236-0.317-0.011-0.009-0.013-0.024-0.024-0.033l-10.667-9.333c-0.553-0.484-1.396-0.429-1.881 0.125-0.484 0.555-0.428 1.396 0.127 1.881l7.996 6.997h-20.452c-0.737 0-1.333 0.597-1.333 1.333s0.596 1.333 1.333 1.333h20.452l-7.996 6.997c-0.555 0.485-0.611 1.327-0.127 1.881 0.264 0.3 0.633 0.455 1.004 0.455 0.312 0 0.625-0.109 0.877-0.331l10.667-9.333c0.011-0.009 0.015-0.024 0.024-0.033 0.097-0.091 0.169-0.201 0.236-0.317 0.024-0.041 0.060-0.075 0.080-0.119 0.073-0.163 0.116-0.343 0.116-0.533s-0.043-0.371-0.116-0.535z"></path>
20265
+ </svg>
20266
+ `;
20267
+
20268
+ const LeftArrow = `<!-- Generated by IcoMoon.io -->
20269
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
20270
+ <title>arrow-left</title>
20271
+ <path d="M28 14.667h-20.452l7.996-6.997c0.555-0.485 0.611-1.327 0.125-1.881-0.485-0.553-1.327-0.611-1.881-0.125l-10.667 9.333c-0.011 0.009-0.015 0.024-0.025 0.033-0.096 0.089-0.167 0.199-0.232 0.313-0.025 0.043-0.063 0.076-0.081 0.121-0.073 0.165-0.116 0.345-0.116 0.536s0.043 0.371 0.116 0.535c0.020 0.045 0.057 0.079 0.081 0.121 0.067 0.115 0.136 0.224 0.232 0.313 0.011 0.009 0.015 0.024 0.025 0.033l10.667 9.333c0.253 0.221 0.567 0.331 0.879 0.331 0.371 0 0.74-0.155 1.004-0.455 0.485-0.555 0.429-1.396-0.125-1.881l-7.997-6.997h20.452c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333z"></path>
20272
+ </svg>
20273
+ `;
20274
+
20012
20275
  const Cancel = `<!-- Generated by IcoMoon.io -->
20013
20276
  <svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
20014
20277
  <title>cancel</title>
@@ -20124,7 +20387,8 @@ const SallaGifting = class {
20124
20387
  this.setWrapperHeight(2, 150, 0);
20125
20388
  }
20126
20389
  toggleGiftText(event) {
20127
- this.textSelect.classList.remove('s-form-has-error');
20390
+ var _a;
20391
+ (_a = this.textSelect) === null || _a === void 0 ? void 0 : _a.classList.remove('s-form-has-error');
20128
20392
  let dataID = event.target.children[event.target.selectedIndex].getAttribute('data-id');
20129
20393
  let customID = dataID == "custom";
20130
20394
  this.showGiftText = customID;
@@ -20146,19 +20410,20 @@ const SallaGifting = class {
20146
20410
  * Go to the step 2
20147
20411
  */
20148
20412
  async goToStep2() {
20413
+ var _a, _b, _c, _d, _e, _f, _g, _h;
20149
20414
  if (!this.selectedGiftTextOption) {
20150
- this.textSelect.classList.add('s-form-has-error');
20151
- this.customTextArea.classList.remove('s-form-has-error');
20415
+ (_a = this.textSelect) === null || _a === void 0 ? void 0 : _a.classList.add('s-form-has-error');
20416
+ (_b = this.customTextArea) === null || _b === void 0 ? void 0 : _b.classList.remove('s-form-has-error');
20152
20417
  return;
20153
20418
  }
20154
20419
  else if (this.selectedGiftTextOption == 'custom' && !this.selectedText) {
20155
- this.textSelect.classList.remove('s-form-has-error');
20156
- this.customTextArea.classList.add('s-form-has-error');
20420
+ (_c = this.textSelect) === null || _c === void 0 ? void 0 : _c.classList.remove('s-form-has-error');
20421
+ (_d = this.customTextArea) === null || _d === void 0 ? void 0 : _d.classList.add('s-form-has-error');
20157
20422
  return;
20158
20423
  }
20159
20424
  else {
20160
- this.textSelect.classList.remove('s-form-has-error');
20161
- this.customTextArea.classList.remove('s-form-has-error');
20425
+ (_e = this.textSelect) === null || _e === void 0 ? void 0 : _e.classList.remove('s-form-has-error');
20426
+ (_f = this.customTextArea) === null || _f === void 0 ? void 0 : _f.classList.remove('s-form-has-error');
20162
20427
  }
20163
20428
  this.setWrapperHeight(2, 600, 0);
20164
20429
  let stepNextAnime = new anime.timeline();
@@ -20189,14 +20454,15 @@ const SallaGifting = class {
20189
20454
  }
20190
20455
  }, '-=1200');
20191
20456
  this.currentStep = 2;
20192
- this.stepsWrapper.classList.remove('is-current-step-1', 'is-current-step-2');
20193
- this.stepsWrapper.classList.add(`is-current-step-${this.currentStep}`);
20457
+ (_g = this.stepsWrapper) === null || _g === void 0 ? void 0 : _g.classList.remove('is-current-step-1', 'is-current-step-2');
20458
+ (_h = this.stepsWrapper) === null || _h === void 0 ? void 0 : _h.classList.add(`is-current-step-${this.currentStep}`);
20194
20459
  }
20195
20460
  /**
20196
20461
  *
20197
20462
  * Go to the step 1
20198
20463
  */
20199
20464
  goToStep1() {
20465
+ var _a, _b;
20200
20466
  let stepBackAnime = new anime.timeline({
20201
20467
  autoplay: false,
20202
20468
  });
@@ -20229,19 +20495,20 @@ const SallaGifting = class {
20229
20495
  stepBackAnime.play();
20230
20496
  this.setWrapperHeight(1, 600, 0);
20231
20497
  this.currentStep = 1;
20232
- this.stepsWrapper.classList.remove('is-current-step-1', 'is-current-step-2');
20233
- this.stepsWrapper.classList.add(`is-current-step-${this.currentStep}`);
20498
+ (_a = this.stepsWrapper) === null || _a === void 0 ? void 0 : _a.classList.remove('is-current-step-1', 'is-current-step-2');
20499
+ (_b = this.stepsWrapper) === null || _b === void 0 ? void 0 : _b.classList.add(`is-current-step-${this.currentStep}`);
20234
20500
  }
20235
20501
  getFilepondPlaceholder() {
20236
20502
  return `<div class="s-gifting-filepond-placeholder"><span class="s-gifting-filepond-placeholder-icon">${Images}</span><p class="s-gifting-filepond-placeholder-text">${this.selectImageOrUpload ? this.selectImageOrUpload : ''}</p></div>`;
20237
20503
  }
20238
20504
  setPreview(image) {
20239
- this.imageCover.classList.add('has-bg');
20505
+ var _a, _b;
20506
+ (_a = this.imageCover) === null || _a === void 0 ? void 0 : _a.classList.add('has-bg');
20240
20507
  var bg = document.querySelector('.filepond-bg') ? document.querySelector('.filepond-bg') : document.createElement('div');
20241
20508
  bg.classList.add('filepond-bg');
20242
20509
  bg.classList.remove('s-hidden');
20243
20510
  bg.style.backgroundImage = "url('" + image.url + "')";
20244
- this.imageCover.querySelector('.filepond--root').appendChild(bg);
20511
+ (_b = this.imageCover) === null || _b === void 0 ? void 0 : _b.querySelector('.filepond--root').appendChild(bg);
20245
20512
  this.uploadedImage = image.url;
20246
20513
  if (!!this.gift && this.gift.gift_images.length) {
20247
20514
  this.setWrapperHeight(1, 150, 0);
@@ -20364,9 +20631,9 @@ const SallaGifting = class {
20364
20631
  [
20365
20632
  index.h("div", { class: "s-gifting-modal-header" }, index.h("span", { class: "s-gifting-modal-icon" }, index.h("span", { innerHTML: GiftSharing })), index.h("h2", { class: "s-gifting-modal-title" }, index.h("div", { class: "s-gifting-modal-badge-wrapper" }, index.h("div", { class: "s-gifting-modal-badge" }, index.h("span", null, index.h("span", null, this.currentStep), "/2")), index.h("span", null, this.giftDetails)))),
20366
20633
  index.h("div", { class: "s-gifting-steps-wrapper steps-wrapper" }, index.h("div", { class: "s-gifting-step-one gift-step-1" }, index.h("div", { class: "s-gifting-modal-uploader-title anime-item" }, this.selectImageForYourGift), index.h("div", { class: "s-gifting-modal-uploader anime-item" }, index.h("span", { class: "s-gifting-remove-preview", onClick: () => this.removePreview(), innerHTML: Cancel }), this.selectImageOrUpload && index.h("salla-file-upload", { "instant-upload": true, labelIdle: this.getFilepondPlaceholder(), serverConfig: this.getServerConfig(), onRemove: () => this.handleRemoveImage() }, " ")), index.h("div", { class: "anime-item" }, !this.uploadedImage && !!this.gift && this.gift.gift_images.length > 0 ?
20367
- index.h("salla-slider", { type: "carousel" }, index.h("div", { slot: "items" }, (_a = this.gift) === null || _a === void 0 ? void 0 : _a.gift_images.map((item) => index.h("img", { class: "s-gifting-image s-gifting-clickable", src: item.url, onClick: () => this.setPreview(item), alt: `${item.id}` }))))
20634
+ index.h("salla-slider", { id: "gifting-slider", loop: false, "controls-outer": true, class: "s-gifting-slider", type: "carousel" }, index.h("div", { slot: "items" }, (_a = this.gift) === null || _a === void 0 ? void 0 : _a.gift_images.map((item) => index.h("img", { class: "s-gifting-image s-gifting-clickable", src: item.url, onClick: () => this.setPreview(item), alt: `${item.id}` }))))
20368
20635
  : ""), index.h("div", { class: "anime-item" }, index.h("div", { class: "s-form-group s-gifting-selectText" }, index.h("label", { htmlFor: "gift-text-selection", class: "s-form-label" }, this.selectGiftMessage), index.h("select", { id: "gift-text-selection", name: "gift-text-selection", class: "s-form-control s-gifting-select", onChange: e => this.toggleGiftText(e) }, index.h("option", { "data-id": null, selected: true }, this.selectGiftMessage), (_b = this.gift) === null || _b === void 0 ? void 0 :
20369
- _b.gift_texts.map((txt) => index.h("option", { "data-id": txt.id, value: txt.text, key: txt.id }, txt.text)), index.h("option", { "data-id": "custom" }, this.giftCustomText))), index.h("div", { class: this.showGiftText ? "s-form-group s-gifting-textarea shown" : "s-form-group s-gifting-textarea hide" }, index.h("label", { htmlFor: "gift-custom-text", class: "s-form-label" }, this.giftCustomText), index.h("div", { class: "mt-1" }, index.h("textarea", { onInput: (event) => this.handleTextAreaChange(event), rows: 4, ref: (el) => this.textArea = el, name: "gift-custom-text", id: "gift-custom-text", class: "s-form-control" })))), index.h("div", { class: "anime-item" }, index.h("salla-button", { color: "primary", width: "wide", onClick: () => this.goToStep2() }, index.h("span", null, this.nextStep)))), index.h("div", { class: "s-gifting-step-two gift-step-2" }, index.h("div", { class: this.errors && this.errors['sender_name'] ? "s-form-group s-form-has-error anime-item opacity-0" : "s-form-group anime-item opacity-0" }, index.h("label", { htmlFor: "sender_name", class: "s-form-label" }, this.senderNameLabel), index.h("input", { type: "text", class: "s-form-control", name: "sender_name", id: "sender_name", value: this.senderName, onInput: (event) => this.handleSenderName(event), placeholder: "" }), this.errors && this.errors['sender_name'] ? index.h("span", { class: "text-danger text-xs" }, this.errors['sender_name']) : ''), index.h("div", { class: this.errors && this.errors['receiver.name'] ? "s-form-group s-form-has-error anime-item opacity-0" : "s-form-group anime-item opacity-0" }, index.h("label", { htmlFor: "receiver_name", class: "s-form-label" }, this.receiverNameFieldLabel), index.h("input", { type: "text", class: "s-form-control", name: "receiver_name", id: "receiver_name", value: "", onInput: (event) => this.handleReceiverName(event), placeholder: "" }), this.errors && this.errors['receiver.name'] ? index.h("span", { class: "text-danger text-xs" }, this.errors['receiver.name']) : ''), index.h("div", { class: this.errors && this.errors['receiver.mobile'] ? "s-form-group s-form-has-error anime-item opacity-0" : "s-form-group anime-item opacity-0" }, index.h("label", { class: "s-form-label" }, this.receiverMobileFieldLabel), index.h("salla-tel-input", { class: "s-gifting-tel-input", phone: this.receiverMobile, countryCode: this.receiverCountryCode, onPhoneEntered: (e) => this.handlePhoneInputChange(e) }), this.errors && this.errors['receiver.mobile'] ? index.h("span", { class: "text-danger text-xs" }, this.errors['receiver.mobile']) : ''), index.h("div", { class: "anime-item opacity-0" }, index.h("label", { class: "s-gifting-schedule s-gifting-clickable", htmlFor: "schedule" }, index.h("input", { type: "checkbox", name: 'schedule', id: 'schedule', onChange: () => this.toggleCalendar(), class: "s-checkbox" }), index.h("span", { class: "s-form-label" }, " ", this.sendLater, " "))), index.h("div", { class: this.getCalendarClasses() }, index.h("label", { class: "s-form-label" }, this.selectSendDateAndTime), index.h("salla-datetime-picker", { value: this.deliveryDate, placeholder: this.selectSendDateAndTime, "enable-time": true, "date-format": "Y-m-d h:i K", onPicked: (event) => this.handleDateTimePicker(event) }), index.h("span", { class: "s-gifting-calendar-hint" }, this.canNotEditOrderAfterSelectDate)), index.h("div", { class: "s-gifting-step-two-footer anime-item opacity-0" }, index.h("a", { href: "#!", innerHTML: this.currentLang == 'ar' ? core.ArrowRightIcon : core.ArrowLeftIcon, onClick: () => this.goToStep1() }), index.h("salla-button", { onClick: () => this.submitForm(), color: "primary", width: 'wide' }, index.h("span", null, this.sendGift)))))
20636
+ _b.gift_texts.map((txt) => index.h("option", { "data-id": txt.id, value: txt.text, key: txt.id }, txt.text)), index.h("option", { "data-id": "custom" }, this.giftCustomText))), index.h("div", { class: this.showGiftText ? "s-form-group s-gifting-textarea shown" : "s-form-group s-gifting-textarea hide" }, index.h("label", { htmlFor: "gift-custom-text", class: "s-form-label" }, this.giftCustomText), index.h("div", { class: "mt-1" }, index.h("textarea", { onInput: (event) => this.handleTextAreaChange(event), rows: 4, ref: (el) => this.textArea = el, name: "gift-custom-text", id: "gift-custom-text", class: "s-form-control" })))), index.h("div", { class: "anime-item" }, index.h("salla-button", { color: "primary", width: "wide", onClick: () => this.goToStep2() }, index.h("span", null, this.nextStep)))), index.h("div", { class: "s-gifting-step-two gift-step-2" }, index.h("div", { class: this.errors && this.errors['sender_name'] ? "s-form-group s-form-has-error anime-item opacity-0" : "s-form-group anime-item opacity-0" }, index.h("label", { htmlFor: "sender_name", class: "s-form-label" }, this.senderNameLabel), index.h("input", { type: "text", class: "s-form-control", name: "sender_name", id: "sender_name", value: this.senderName, onInput: (event) => this.handleSenderName(event), placeholder: "" }), this.errors && this.errors['sender_name'] ? index.h("span", { class: "text-danger text-xs" }, this.errors['sender_name']) : ''), index.h("div", { class: this.errors && this.errors['receiver.name'] ? "s-form-group s-form-has-error anime-item opacity-0" : "s-form-group anime-item opacity-0" }, index.h("label", { htmlFor: "receiver_name", class: "s-form-label" }, this.receiverNameFieldLabel), index.h("input", { type: "text", class: "s-form-control", name: "receiver_name", id: "receiver_name", value: "", onInput: (event) => this.handleReceiverName(event), placeholder: "" }), this.errors && this.errors['receiver.name'] ? index.h("span", { class: "text-danger text-xs" }, this.errors['receiver.name']) : ''), index.h("div", { class: this.errors && this.errors['receiver.mobile'] ? "s-form-group s-form-has-error anime-item opacity-0" : "s-form-group anime-item opacity-0" }, index.h("label", { class: "s-form-label" }, this.receiverMobileFieldLabel), index.h("salla-tel-input", { class: "s-gifting-tel-input", phone: this.receiverMobile, countryCode: this.receiverCountryCode, onPhoneEntered: (e) => this.handlePhoneInputChange(e) }), this.errors && this.errors['receiver.mobile'] ? index.h("span", { class: "text-danger text-xs" }, this.errors['receiver.mobile']) : ''), index.h("div", { class: "anime-item opacity-0" }, index.h("label", { class: "s-gifting-schedule s-gifting-clickable", htmlFor: "schedule" }, index.h("input", { type: "checkbox", name: 'schedule', id: 'schedule', onChange: () => this.toggleCalendar(), class: "s-checkbox" }), index.h("span", { class: "s-form-label" }, " ", this.sendLater, " "))), index.h("div", { class: this.getCalendarClasses() }, index.h("label", { class: "s-form-label" }, this.selectSendDateAndTime), index.h("salla-datetime-picker", { value: this.deliveryDate, placeholder: this.selectSendDateAndTime, "enable-time": true, "date-format": "Y-m-d h:i K", onPicked: (event) => this.handleDateTimePicker(event) }), index.h("span", { class: "s-gifting-calendar-hint" }, this.canNotEditOrderAfterSelectDate)), index.h("div", { class: "s-gifting-step-two-footer anime-item opacity-0" }, index.h("a", { href: "#!", innerHTML: this.currentLang == 'ar' ? ArrowRightIcon$1 : LeftArrow, onClick: () => this.goToStep1() }), index.h("salla-button", { onClick: () => this.submitForm(), color: "primary", width: 'wide' }, index.h("span", null, this.sendGift)))))
20370
20637
  ], index.h("slot", { name: "footer" })))
20371
20638
  ];
20372
20639
  }
@@ -20905,7 +21172,7 @@ const SallaLoginModal = class {
20905
21172
  index.h("a", { href: "#", onClick: () => this.showTab(this.emailTab), class: "s-login-modal-link" }, salla.lang.get('blocks.header.login_by_email')) : '', index.h("slot", { name: "after-login-mobile" })) : '', this.isEmailAllowed ?
20906
21173
  index.h("div", { class: this.generateTabClasses('login-email'), "data-name": "login-email", ref: tab => this.emailTab = tab }, index.h("slot", { name: "before-login-email" }), index.h("label", { class: "s-login-modal-label" }, salla.lang.get('common.elements.email')), index.h("form", { onSubmit: () => this.loginByEmail(event), method: "POST" }, index.h("input", { type: "email", ref: el => this.loginEmail = el, onKeyDown: e => this.typing(e), placeholder: "your@email.com", enterkeyhint: "next", class: "s-login-modal-input s-ltr" }), index.h("span", { class: "s-login-modal-error-message" }), index.h("salla-button", { "loader-position": 'center', width: "wide", onClick: () => this.loginByEmail(), ref: b => this.emailBtn = b }, salla.lang.get('blocks.header.enter'))), this.isMobileAllowed ?
20907
21174
  index.h("a", { href: "#", onClick: () => this.showTab(this.mobileTab), class: "s-login-modal-link" }, salla.lang.get('blocks.header.login_by_sms'))
20908
- : '', index.h("slot", { name: "after-login-email" })) : '', index.h("salla-verify", { display: "inline", "support-web-auth": this.supportWebAuth ? 'true' : 'false', class: this.generateTabClasses('otp'), "data-name": "otp", ref: tab => this.verifyTab = tab, autoReload: false }, index.h("a", { onClick: () => this.showTab(this.regType == 'phone' ? this.mobileTab : this.emailTab), class: "s-verify-back", innerHTML: core.ArrowRightIcon, slot: "after-footer", href: "#" })), index.h("div", { "data-name": "registration", class: this.generateTabClasses('registration'), ref: tab => this.registrationTab = tab }, index.h("slot", { name: "before-registration" }), index.h("div", null, index.h("label", { class: "s-login-modal-label" }, salla.lang.get('blocks.header.your_name')), index.h("input", { type: "text", class: "s-login-modal-input", ref: el => this.firstName = el, onKeyDown: e => this.typing(e, this.newUser), placeholder: salla.lang.get('pages.profile.first_name') }), index.h("span", { class: "s-login-modal-error-message" })), index.h("div", null, index.h("label", { class: "s-login-modal-label" }, salla.lang.get('pages.profile.last_name')), index.h("input", { type: "text", class: "s-login-modal-input", ref: el => this.lastName = el, onKeyDown: e => this.typing(e, this.newUser), placeholder: salla.lang.get('pages.profile.last_name') }), index.h("span", { class: "s-login-modal-error-message" })), index.h("div", { class: this.generateRegClasses('phone') }, index.h("label", { class: "s-login-modal-label" }, salla.lang.get('common.elements.mobile')), index.h("salla-tel-input", { ref: el => this.regTelInput = el, onKeyDown: e => this.typing(e, this.newUser) })), index.h("div", { class: this.generateRegClasses('email') }, index.h("label", { class: "s-login-modal-label" }, salla.lang.get('common.elements.email')), index.h("input", { type: "email", ref: el => this.regEmail = el, onKeyDown: e => this.typing(e, this.newUser), placeholder: "your@email.com", class: "s-login-modal-input s-ltr" }), index.h("span", { class: "s-login-modal-error-message" })), index.h("salla-button", { "loader-position": 'center', width: "wide", onClick: () => this.newUser(), ref: b => this.regBtn = b }, salla.lang.get('blocks.header.register')), index.h("slot", { name: "after-registration" })))));
21175
+ : '', index.h("slot", { name: "after-login-email" })) : '', index.h("salla-verify", { display: "inline", "support-web-auth": this.supportWebAuth ? 'true' : 'false', class: this.generateTabClasses('otp'), "data-name": "otp", ref: tab => this.verifyTab = tab, autoReload: false }, index.h("a", { onClick: () => this.showTab(this.regType == 'phone' ? this.mobileTab : this.emailTab), class: "s-verify-back", innerHTML: ArrowRightIcon$1, slot: "after-footer", href: "#" })), index.h("div", { "data-name": "registration", class: this.generateTabClasses('registration'), ref: tab => this.registrationTab = tab }, index.h("slot", { name: "before-registration" }), index.h("div", null, index.h("label", { class: "s-login-modal-label" }, salla.lang.get('blocks.header.your_name')), index.h("input", { type: "text", class: "s-login-modal-input", ref: el => this.firstName = el, onKeyDown: e => this.typing(e, this.newUser), placeholder: salla.lang.get('pages.profile.first_name') }), index.h("span", { class: "s-login-modal-error-message" })), index.h("div", null, index.h("label", { class: "s-login-modal-label" }, salla.lang.get('pages.profile.last_name')), index.h("input", { type: "text", class: "s-login-modal-input", ref: el => this.lastName = el, onKeyDown: e => this.typing(e, this.newUser), placeholder: salla.lang.get('pages.profile.last_name') }), index.h("span", { class: "s-login-modal-error-message" })), index.h("div", { class: this.generateRegClasses('phone') }, index.h("label", { class: "s-login-modal-label" }, salla.lang.get('common.elements.mobile')), index.h("salla-tel-input", { ref: el => this.regTelInput = el, onKeyDown: e => this.typing(e, this.newUser) })), index.h("div", { class: this.generateRegClasses('email') }, index.h("label", { class: "s-login-modal-label" }, salla.lang.get('common.elements.email')), index.h("input", { type: "email", ref: el => this.regEmail = el, onKeyDown: e => this.typing(e, this.newUser), placeholder: "your@email.com", class: "s-login-modal-input s-ltr" }), index.h("span", { class: "s-login-modal-error-message" })), index.h("salla-button", { "loader-position": 'center', width: "wide", onClick: () => this.newUser(), ref: b => this.regBtn = b }, salla.lang.get('blocks.header.register')), index.h("slot", { name: "after-registration" })))));
20909
21176
  }
20910
21177
  get host() { return index.getElement(this); }
20911
21178
  };
@@ -21039,7 +21306,7 @@ const SallaLoyalty = class {
21039
21306
  getConfirmationModal() {
21040
21307
  var _a, _b;
21041
21308
  return [
21042
- index.h("salla-placeholder", { alignment: "center", icon: Star3, class: "s-loyalty-confirmation-modal-content" }, index.h("div", { slot: "title", class: "s-loyalty-confirmation-title" }, salla.lang.get('pages.loyalty_program.exchange_points')), index.h("div", { slot: "description" }, salla.lang.get('pages.loyalty_program.are_you_sure_to_exchange'), " ( ", index.h("strong", null, (_a = this.selectedItem) === null || _a === void 0 ? void 0 : _a.cost_points), " ) ", salla.lang.get('pages.loyalty_program.for'), " ( ", index.h("strong", null, (_b = this.selectedItem) === null || _b === void 0 ? void 0 : _b.name), " )")),
21309
+ index.h("salla-placeholder", { alignment: "center", icon: Star3, class: "s-loyalty-confirmation-modal-content" }, index.h("div", { slot: "title", class: "s-loyalty-confirmation-title" }, salla.lang.get('pages.loyalty_program.exchange_points')), index.h("div", { slot: "description" }, salla.lang.get('pages.loyalty_program.are_you_sure_to_exchange'), " ( ", index.h("strong", null, (_a = this.selectedItem) === null || _a === void 0 ? void 0 : _a.cost_points), " ", salla.lang.get('pages.loyalty_program.point'), " ) ", salla.lang.get('pages.loyalty_program.for'), " ( ", index.h("strong", null, (_b = this.selectedItem) === null || _b === void 0 ? void 0 : _b.name), " )")),
21043
21310
  index.h("div", { class: "s-loyalty-confirmation-actions" }, index.h("salla-button", { fill: 'outline', width: "wide", onClick: () => this.cancelProcess() }, salla.lang.get('pages.loyalty_program.cancellation')), index.h("salla-button", { loading: this.buttonLoading, width: "wide", onClick: () => this.exchangeLoyaltyPoint() }, salla.lang.get('pages.loyalty_program.confirm')))
21044
21311
  ];
21045
21312
  }
@@ -21129,10 +21396,10 @@ const SallaLoyalty = class {
21129
21396
  index.h("salla-list-tile", { class: 's-loyalty-widget' }, index.h("div", { slot: "icon", class: "s-loyalty-widget-icon", innerHTML: Rate }), index.h("div", { slot: "subtitle" }, this.is_loggedin ? salla.lang.get('pages.loyalty_program.cart_total_point_summary', { "balance": this.customerPoints }) : (this.guestMessage || salla.lang.get('pages.loyalty_program.guest_message')), index.h("salla-button", { shape: "link", color: "primary", onClick: () => salla.event.dispatch("loyalty::open") }, this.is_loggedin ? salla.lang.get('pages.loyalty_program.cart_point_exchange_now') : salla.lang.get('blocks.header.login')))) :
21130
21397
  ''),
21131
21398
  index.h("salla-modal", { noPadding: true, width: "sm", ref: modal => this.confirmationModal = modal }, this.getConfirmationModal()),
21132
- index.h("salla-modal", { isLoading: true, "has-skeleton": true, width: "md", ref: modal => this.modal = modal }, index.h("div", { slot: "loading" }, index.h("div", { class: "s-loyalty-skeleton" }, index.h("salla-list-tile", { class: "s-loyalty-header" }, index.h("div", { slot: "icon", class: "s-loyalty-header-icon" }, index.h("salla-skeleton", { type: "circle", height: '6rem', width: '6rem' })), index.h("div", { slot: "title", class: "s-loyalty-header-title mb-5" }, index.h("salla-skeleton", { height: '15px', width: '50%' })), index.h("div", { slot: "subtitle", class: "s-loyalty-header-subtitle" }, index.h("salla-skeleton", { height: '10px' }), index.h("salla-skeleton", { height: '10px', width: '75%' }))), index.h("div", { class: "s-loyalty-skeleton-cards" }, [...Array(3)].map(() => index.h("div", { class: "s-loyalty-prize-item" }, index.h("salla-skeleton", { height: '9rem' }), index.h("div", { class: "s-loyalty-prize-item-title" }, index.h("salla-skeleton", { height: '15px', width: '75%' })), index.h("div", { class: "s-loyalty-prize-item-subtitle" }, index.h("salla-skeleton", { height: '10px', width: '50%' }), index.h("salla-skeleton", { height: '10px', width: '25%' })), index.h("div", { class: "s-loyalty-prize-item-points" }, index.h("salla-skeleton", { height: '15px', width: '100px' }), index.h("div", { class: "s-loyalty-prize-item-check" }, index.h("salla-skeleton", { height: '1rem', width: '1rem', type: 'circle' })))))))), !this.hasError && !!this.loyaltyProgram ?
21399
+ index.h("salla-modal", { isLoading: true, "has-skeleton": true, width: "md", ref: modal => this.modal = modal }, index.h("div", { slot: "loading" }, index.h("div", { class: "s-loyalty-skeleton" }, index.h("salla-list-tile", { class: "s-loyalty-header" }, index.h("div", { slot: "icon", class: "s-loyalty-header-icon" }, index.h("salla-skeleton", { type: "circle", height: '6rem', width: '6rem' })), index.h("div", { slot: "title", class: "s-loyalty-header-title mb-5" }, index.h("salla-skeleton", { height: '15px', width: '50%' })), index.h("div", { slot: "subtitle", class: "s-loyalty-header-subtitle" }, index.h("salla-skeleton", { height: '10px' }), index.h("salla-skeleton", { height: '10px', width: '75%' }))), index.h("div", { class: "s-loyalty-skeleton-cards" }, [...Array(3)].map(() => index.h("div", { class: "s-loyalty-prize-item swiper-slide" }, index.h("salla-skeleton", { height: '9rem' }), index.h("div", { class: "s-loyalty-prize-item-title" }, index.h("salla-skeleton", { height: '15px', width: '75%' })), index.h("div", { class: "s-loyalty-prize-item-subtitle" }, index.h("salla-skeleton", { height: '10px', width: '50%' }), index.h("salla-skeleton", { height: '10px', width: '25%' })), index.h("div", { class: "s-loyalty-prize-item-points" }, index.h("salla-skeleton", { height: '15px', width: '100px' }), index.h("div", { class: "s-loyalty-prize-item-check" }, index.h("salla-skeleton", { height: '1rem', width: '1rem', type: 'circle' })))))))), !this.hasError && !!this.loyaltyProgram ?
21133
21400
  [
21134
21401
  index.h("salla-list-tile", { id: 's-loyalty-header', class: "s-loyalty-header" }, index.h("div", { slot: "icon", class: "s-loyalty-header-icon", innerHTML: GiftImg }), index.h("div", { slot: "title", class: "s-loyalty-header-title" }, this.loyaltyProgram.prize_promotion_title), index.h("div", { slot: "subtitle", class: "s-loyalty-header-subtitle" }, this.loyaltyProgram.prize_promotion_description)),
21135
- index.h("salla-tabs", null, this.loyaltyProgram.prizes.map((prize) => index.h("salla-tab-header", { slot: "header", name: prize.title }, index.h("span", null, prize.title))), this.loyaltyProgram.prizes.map((prize) => index.h("salla-tab-content", { slot: "content", name: prize.title }, index.h("salla-slider", { class: "s-loyalty-slider", type: "carousel" }, index.h("div", { slot: 'items' }, prize.items.map((item) => this.prizeItem(item))))))),
21402
+ index.h("salla-tabs", null, this.loyaltyProgram.prizes.map((prize) => index.h("salla-tab-header", { slot: "header", name: prize.title }, index.h("span", null, prize.title))), this.loyaltyProgram.prizes.map((prize, index$1) => index.h("salla-tab-content", { slot: "content", name: prize.title }, index.h("salla-slider", { class: "s-loyalty-slider", loop: false, "controls-outer": true, id: 'loyalty-popup-slider-' + index$1, type: "carousel" }, index.h("div", { slot: 'items' }, prize.items.map((item) => this.prizeItem(item))))))),
21136
21403
  index.h("salla-button", { disabled: !this.selectedItem, width: "wide", class: "s-loyalty-program-redeem-btn", onClick: () => this.openConfirmation() }, salla.lang.get('pages.loyalty_program.exchange_points')),
21137
21404
  ]
21138
21405
  : index.h("salla-placeholder", { class: "s-loyalty-placeholder", alignment: "center" }, !!this.errorMessage ? index.h("span", { slot: "description" }, this.errorMessage) : '')),
@@ -21981,6 +22248,7 @@ const SallaOfferModal = class {
21981
22248
  async open(product_id) {
21982
22249
  this.productID = product_id;
21983
22250
  //TODO:: make sure there is only one offer
22251
+ this.hasError = false;
21984
22252
  this.modal.open();
21985
22253
  return await salla.api.withoutNotifier(() => salla.product.offers(product_id))
21986
22254
  .then(response => this.showOffer(response.data[0]))
@@ -22011,7 +22279,7 @@ const SallaOfferModal = class {
22011
22279
  getOfferContent() {
22012
22280
  var _a, _b, _c, _d, _e, _f, _g, _h;
22013
22281
  if ((_a = this.offer.get.products) === null || _a === void 0 ? void 0 : _a.length) {
22014
- return index.h("salla-slider", { type: "carousel", class: { "s-offer-modal-slider-centered": ((_b = this.offer.get.products) === null || _b === void 0 ? void 0 : _b.length) <= 2, "s-offer-modal-slider": true }, "show-controls": ((_c = this.offer.get.products) === null || _c === void 0 ? void 0 : _c.length) <= 2 ? 'false' : 'true' }, index.h("div", { slot: 'items' }, (_d = this.offer.get.products) === null || _d === void 0 ? void 0 : _d.map(product => index.h("div", { class: {
22282
+ return index.h("salla-slider", { type: "carousel", class: { "s-offer-modal-slider-centered": ((_b = this.offer.get.products) === null || _b === void 0 ? void 0 : _b.length) <= 2, "s-offer-modal-slider": true }, id: "offer-modal-slider", "controls-outer": true, "show-controls": ((_c = this.offer.get.products) === null || _c === void 0 ? void 0 : _c.length) <= 2 ? 'false' : 'true' }, index.h("div", { slot: 'items' }, (_d = this.offer.get.products) === null || _d === void 0 ? void 0 : _d.map(product => index.h("div", { class: {
22015
22283
  "s-offer-modal-product": true,
22016
22284
  "s-offer-modal-slider-item": true,
22017
22285
  "s-offer-modal-not-available": !product.is_available
@@ -22020,11 +22288,11 @@ const SallaOfferModal = class {
22020
22288
  .replace(/\{url\}/g, product.url)
22021
22289
  .replace(/\{image\}/g, product.thumbnail)
22022
22290
  .replace(/\{price\}/g, product.has_special_price
22023
- ? salla.money(product.price) + '<span class="s-offer-modal-product-old-price">' + salla.money(product.regular_price) + '</span>'
22291
+ ? '<span class="s-offer-modal-product-sale-price">' + salla.money(product.price) + '</span><span class="s-offer-modal-product-old-price">' + salla.money(product.regular_price) + '</span>'
22024
22292
  : salla.money(product.price)) }, index.h("div", { class: "s-offer-modal-btn-wrap" }, index.h("salla-button", { width: "wide", fill: 'outline', "data-id": product.id, disabled: !product.is_available, "loader-position": "center", onClick: this.addItem }, product.is_available ? salla.lang.get('pages.cart.add_to_cart') : salla.lang.get('pages.products.out_of_stock')))))));
22025
22293
  }
22026
22294
  else if ((_e = this.offer.get.categories) === null || _e === void 0 ? void 0 : _e.length) {
22027
- return index.h("salla-slider", { type: "carousel", class: { "s-offer-modal-slider-centered": ((_f = this.offer.get.categories) === null || _f === void 0 ? void 0 : _f.length) <= 2, "s-offer-modal-slider": true }, "show-controls": ((_g = this.offer.get.categories) === null || _g === void 0 ? void 0 : _g.length) <= 2 ? 'false' : 'true' }, index.h("div", { slot: 'items' }, this.offer.get.categories.map(category => index.h("a", { href: category.urls.customer, class: "s-offer-modal-badge s-offer-modal-slider-item", innerHTML: this.categorySlot
22295
+ return index.h("salla-slider", { type: "carousel", class: { "s-offer-modal-slider-centered": ((_f = this.offer.get.categories) === null || _f === void 0 ? void 0 : _f.length) <= 2, "s-offer-modal-slider": true }, id: "offer-modal-slider", "controls-outer": true, "show-controls": ((_g = this.offer.get.categories) === null || _g === void 0 ? void 0 : _g.length) <= 2 ? 'false' : 'true' }, index.h("div", { slot: 'items' }, this.offer.get.categories.map(category => index.h("a", { href: category.urls.customer, class: "s-offer-modal-badge s-offer-modal-slider-item s-offer-modal-cat-item", innerHTML: this.categorySlot
22028
22296
  .replace(/\{tagIcon\}/g, Tag)
22029
22297
  .replace(/\{name\}/g, category.name)
22030
22298
  .replace(/\{url\}/g, category.urls.customer) }))));
@@ -22049,7 +22317,7 @@ const SallaOfferModal = class {
22049
22317
  '</div>';
22050
22318
  }
22051
22319
  render() {
22052
- return index.h("salla-modal", { "sub-title-first": true, "has-skeleton": true, "sub-title": this.offer_message, ref: modal => this.modal = modal, isLoading: true }, index.h("div", { slot: 'loading' }, index.h("div", { class: "s-offer-modal-skeleton" }, index.h("div", { class: "s-offer-modal-skeleton-header" }, index.h("salla-skeleton", { type: 'circle', height: '80px', width: '80px' }), index.h("salla-skeleton", { height: '15px', width: '50%' }), index.h("salla-skeleton", { height: '10px', width: '30%' })), index.h("div", { class: "s-offer-modal-skeleton-items" }, [...Array(3)].map(() => index.h("div", { class: "s-offer-modal-skeleton-item" }, index.h("salla-skeleton", { height: '9rem' }), index.h("div", { class: "s-offer-modal-skeleton-item-title" }, index.h("salla-skeleton", { height: '15px', width: '100%' })), index.h("div", { class: "s-offer-modal-skeleton-item-subtitle" }, index.h("salla-skeleton", { height: '9px', width: '50%' }), index.h("div", { innerHTML: Cart2 }))))), index.h("div", { class: "s-offer-modal-skeleton-footer" }, index.h("salla-skeleton", { height: '15px', width: '50%' }), index.h("salla-skeleton", { height: '15px', width: '30%' })))), !this.hasError && this.offer !== null
22320
+ return index.h("salla-modal", { "has-skeleton": true, "sub-title": this.offer_message, ref: modal => this.modal = modal, isLoading: true }, index.h("div", { slot: 'loading' }, index.h("div", { class: "s-offer-modal-skeleton" }, index.h("div", { class: "s-offer-modal-skeleton-header" }, index.h("salla-skeleton", { type: 'circle', height: '80px', width: '80px' }), index.h("salla-skeleton", { height: '15px', width: '50%' }), index.h("salla-skeleton", { height: '10px', width: '30%' })), index.h("div", { class: "s-offer-modal-skeleton-items" }, [...Array(3)].map(() => index.h("div", { class: "s-offer-modal-skeleton-item" }, index.h("salla-skeleton", { height: '9rem' }), index.h("div", { class: "s-offer-modal-skeleton-item-title" }, index.h("salla-skeleton", { height: '15px', width: '100%' })), index.h("div", { class: "s-offer-modal-skeleton-item-subtitle" }, index.h("salla-skeleton", { height: '9px', width: '50%' }), index.h("div", { innerHTML: Cart2 }))))), index.h("div", { class: "s-offer-modal-skeleton-footer" }, index.h("salla-skeleton", { height: '15px', width: '50%' }), index.h("salla-skeleton", { height: '15px', width: '30%' })))), !this.hasError && this.offer !== null
22053
22321
  ? [index.h("span", { slot: 'icon', class: "s-offer-modal-header-icon", innerHTML: SpecialDiscountIcon }), this.getOfferContent(), index.h("div", { class: "s-offer-modal-footer", slot: "footer" }, this.offer.formatted_date ?
22054
22322
  index.h("p", { class: "s-offer-modal-expiry" }, salla.lang.get('pages.products.offer_expires_in'), " ", this.offer.formatted_date)
22055
22323
  : '', index.h("label", { class: "s-offer-modal-remember-label" }, index.h("input", { type: "checkbox", onChange: e => this.rememberMe(e), class: "s-offer-modal-remember-input" }), "\u00A0 ", salla.lang.get('common.elements.remember_my_choice'))),
@@ -22816,10 +23084,14 @@ const SallaRatingStars = class {
22816
23084
  return stars;
22817
23085
  }
22818
23086
  render() {
22819
- return (index.h(index.Host, null, this.value || this.value == 0 ?
22820
- index.h("div", { class: "s-rating-stars-wrapper" }, " ", this.createStars(this.value), " ")
22821
- :
22822
- index.h("div", { class: "s-rating-stars-element", ref: (el) => this.startsElem = el }, index.h("input", { type: "hidden", class: "rating_hidden_input", name: this.name, value: "" }), [1, 2, 3, 4, 5].map(star => index.h("button", { class: `s-rating-stars-btn-star s-rating-stars-` + this.size, "data-star": star }, index.h("span", { innerHTML: Rate }))))));
23087
+ var _a;
23088
+ //TODO:: find a better fix, this is a patch for issue that duplicates the stars twice @see the screenshot inside this folder
23089
+ return ((_a = this.host.closest('.swiper-slide')) === null || _a === void 0 ? void 0 : _a.classList.contains('swiper-slide-duplicate'))
23090
+ ? ''
23091
+ : (index.h(index.Host, null, this.value || this.value == 0 ?
23092
+ index.h("div", { class: "s-rating-stars-wrapper" }, " ", this.createStars(this.value), " ")
23093
+ :
23094
+ index.h("div", { class: "s-rating-stars-element", ref: (el) => this.startsElem = el }, index.h("input", { type: "hidden", class: "rating_hidden_input", name: this.name, value: "" }), [1, 2, 3, 4, 5].map(star => index.h("button", { class: `s-rating-stars-btn-star s-rating-stars-` + this.size, "data-star": star }, index.h("span", { innerHTML: Rate }))))));
22823
23095
  }
22824
23096
  componentDidLoad() {
22825
23097
  this.initiateRating();
@@ -23153,1806 +23425,163 @@ const SallaSkeleton = class {
23153
23425
  };
23154
23426
  SallaSkeleton.style = sallaSkeletonCss;
23155
23427
 
23156
- function createElementIfNotDefined(swiper, originalParams, params, checkProps) {
23157
- const document = core.getDocument();
23428
+ const ArrowLeftIcon = `<!-- Generated by IcoMoon.io -->
23429
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
23430
+ <title>keyboard_arrow_left</title>
23431
+ <path d="M20.563 22.104l-1.875 1.875-8-8 8-8 1.875 1.875-6.125 6.125z"></path>
23432
+ </svg>
23433
+ `;
23158
23434
 
23159
- if (swiper.params.createElements) {
23160
- Object.keys(checkProps).forEach(key => {
23161
- if (!params[key] && params.auto === true) {
23162
- let element = swiper.$el.children(`.${checkProps[key]}`)[0];
23435
+ const sallaSliderCss = "@font-face{font-family:\"swiper-icons\";src:url(\"data:application/font-woff;charset=utf-8;base64, d09GRgABAAAAAAZgABAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAAGRAAAABoAAAAci6qHkUdERUYAAAWgAAAAIwAAACQAYABXR1BPUwAABhQAAAAuAAAANuAY7+xHU1VCAAAFxAAAAFAAAABm2fPczU9TLzIAAAHcAAAASgAAAGBP9V5RY21hcAAAAkQAAACIAAABYt6F0cBjdnQgAAACzAAAAAQAAAAEABEBRGdhc3AAAAWYAAAACAAAAAj//wADZ2x5ZgAAAywAAADMAAAD2MHtryVoZWFkAAABbAAAADAAAAA2E2+eoWhoZWEAAAGcAAAAHwAAACQC9gDzaG10eAAAAigAAAAZAAAArgJkABFsb2NhAAAC0AAAAFoAAABaFQAUGG1heHAAAAG8AAAAHwAAACAAcABAbmFtZQAAA/gAAAE5AAACXvFdBwlwb3N0AAAFNAAAAGIAAACE5s74hXjaY2BkYGAAYpf5Hu/j+W2+MnAzMYDAzaX6QjD6/4//Bxj5GA8AuRwMYGkAPywL13jaY2BkYGA88P8Agx4j+/8fQDYfA1AEBWgDAIB2BOoAeNpjYGRgYNBh4GdgYgABEMnIABJzYNADCQAACWgAsQB42mNgYfzCOIGBlYGB0YcxjYGBwR1Kf2WQZGhhYGBiYGVmgAFGBiQQkOaawtDAoMBQxXjg/wEGPcYDDA4wNUA2CCgwsAAAO4EL6gAAeNpj2M0gyAACqxgGNWBkZ2D4/wMA+xkDdgAAAHjaY2BgYGaAYBkGRgYQiAHyGMF8FgYHIM3DwMHABGQrMOgyWDLEM1T9/w8UBfEMgLzE////P/5//f/V/xv+r4eaAAeMbAxwIUYmIMHEgKYAYjUcsDAwsLKxc3BycfPw8jEQA/gZBASFhEVExcQlJKWkZWTl5BUUlZRVVNXUNTQZBgMAAMR+E+gAEQFEAAAAKgAqACoANAA+AEgAUgBcAGYAcAB6AIQAjgCYAKIArAC2AMAAygDUAN4A6ADyAPwBBgEQARoBJAEuATgBQgFMAVYBYAFqAXQBfgGIAZIBnAGmAbIBzgHsAAB42u2NMQ6CUAyGW568x9AneYYgm4MJbhKFaExIOAVX8ApewSt4Bic4AfeAid3VOBixDxfPYEza5O+Xfi04YADggiUIULCuEJK8VhO4bSvpdnktHI5QCYtdi2sl8ZnXaHlqUrNKzdKcT8cjlq+rwZSvIVczNiezsfnP/uznmfPFBNODM2K7MTQ45YEAZqGP81AmGGcF3iPqOop0r1SPTaTbVkfUe4HXj97wYE+yNwWYxwWu4v1ugWHgo3S1XdZEVqWM7ET0cfnLGxWfkgR42o2PvWrDMBSFj/IHLaF0zKjRgdiVMwScNRAoWUoH78Y2icB/yIY09An6AH2Bdu/UB+yxopYshQiEvnvu0dURgDt8QeC8PDw7Fpji3fEA4z/PEJ6YOB5hKh4dj3EvXhxPqH/SKUY3rJ7srZ4FZnh1PMAtPhwP6fl2PMJMPDgeQ4rY8YT6Gzao0eAEA409DuggmTnFnOcSCiEiLMgxCiTI6Cq5DZUd3Qmp10vO0LaLTd2cjN4fOumlc7lUYbSQcZFkutRG7g6JKZKy0RmdLY680CDnEJ+UMkpFFe1RN7nxdVpXrC4aTtnaurOnYercZg2YVmLN/d/gczfEimrE/fs/bOuq29Zmn8tloORaXgZgGa78yO9/cnXm2BpaGvq25Dv9S4E9+5SIc9PqupJKhYFSSl47+Qcr1mYNAAAAeNptw0cKwkAAAMDZJA8Q7OUJvkLsPfZ6zFVERPy8qHh2YER+3i/BP83vIBLLySsoKimrqKqpa2hp6+jq6RsYGhmbmJqZSy0sraxtbO3sHRydnEMU4uR6yx7JJXveP7WrDycAAAAAAAH//wACeNpjYGRgYOABYhkgZgJCZgZNBkYGLQZtIJsFLMYAAAw3ALgAeNolizEKgDAQBCchRbC2sFER0YD6qVQiBCv/H9ezGI6Z5XBAw8CBK/m5iQQVauVbXLnOrMZv2oLdKFa8Pjuru2hJzGabmOSLzNMzvutpB3N42mNgZGBg4GKQYzBhYMxJLMlj4GBgAYow/P/PAJJhLM6sSoWKfWCAAwDAjgbRAAB42mNgYGBkAIIbCZo5IPrmUn0hGA0AO8EFTQAA\") format(\"woff\");font-weight:400;font-style:normal}:root{--swiper-theme-color:#007aff}.swiper{margin-left:auto;margin-right:auto;position:relative;overflow:hidden;list-style:none;padding:0;z-index:1}.swiper-vertical>.swiper-wrapper{-ms-flex-direction:column;flex-direction:column}.swiper-wrapper{position:relative;width:100%;height:100%;z-index:1;display:-ms-flexbox;display:flex;-webkit-transition-property:-webkit-transform;transition-property:-webkit-transform;transition-property:transform;transition-property:transform, -webkit-transform;-webkit-box-sizing:content-box;box-sizing:content-box}.swiper-android .swiper-slide,.swiper-wrapper{-webkit-transform:translate3d(0px, 0, 0);transform:translate3d(0px, 0, 0)}.swiper-pointer-events{-ms-touch-action:pan-y;touch-action:pan-y}.swiper-pointer-events.swiper-vertical{-ms-touch-action:pan-x;touch-action:pan-x}.swiper-slide{-ms-flex-negative:0;flex-shrink:0;width:100%;height:100%;position:relative;-webkit-transition-property:-webkit-transform;transition-property:-webkit-transform;transition-property:transform;transition-property:transform, -webkit-transform}.swiper-slide-invisible-blank{visibility:hidden}.swiper-autoheight,.swiper-autoheight .swiper-slide{height:auto}.swiper-autoheight .swiper-wrapper{-ms-flex-align:start;align-items:flex-start;-webkit-transition-property:height, -webkit-transform;transition-property:height, -webkit-transform;transition-property:transform, height;transition-property:transform, height, -webkit-transform}.swiper-backface-hidden .swiper-slide{-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-backface-visibility:hidden;backface-visibility:hidden}.swiper-3d,.swiper-3d.swiper-css-mode .swiper-wrapper{-webkit-perspective:1200px;perspective:1200px}.swiper-3d .swiper-wrapper,.swiper-3d .swiper-slide,.swiper-3d .swiper-slide-shadow,.swiper-3d .swiper-slide-shadow-left,.swiper-3d .swiper-slide-shadow-right,.swiper-3d .swiper-slide-shadow-top,.swiper-3d .swiper-slide-shadow-bottom,.swiper-3d .swiper-cube-shadow{-webkit-transform-style:preserve-3d;transform-style:preserve-3d}.swiper-3d .swiper-slide-shadow,.swiper-3d .swiper-slide-shadow-left,.swiper-3d .swiper-slide-shadow-right,.swiper-3d .swiper-slide-shadow-top,.swiper-3d .swiper-slide-shadow-bottom{position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;z-index:10}.swiper-3d .swiper-slide-shadow{background:rgba(0, 0, 0, 0.15)}.swiper-3d .swiper-slide-shadow-left{background-image:-webkit-gradient(linear, right top, left top, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0)));background-image:linear-gradient(to left, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0))}.swiper-3d .swiper-slide-shadow-right{background-image:-webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0)));background-image:linear-gradient(to right, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0))}.swiper-3d .swiper-slide-shadow-top{background-image:-webkit-gradient(linear, left bottom, left top, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0)));background-image:linear-gradient(to top, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0))}.swiper-3d .swiper-slide-shadow-bottom{background-image:-webkit-gradient(linear, left top, left bottom, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0)));background-image:linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0))}.swiper-css-mode>.swiper-wrapper{overflow:auto;scrollbar-width:none;-ms-overflow-style:none;}.swiper-css-mode>.swiper-wrapper::-webkit-scrollbar{display:none}.swiper-css-mode>.swiper-wrapper>.swiper-slide{scroll-snap-align:start start}.swiper-horizontal.swiper-css-mode>.swiper-wrapper{-webkit-scroll-snap-type:x mandatory;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory}.swiper-vertical.swiper-css-mode>.swiper-wrapper{-webkit-scroll-snap-type:y mandatory;-ms-scroll-snap-type:y mandatory;scroll-snap-type:y mandatory}.swiper-centered>.swiper-wrapper::before{content:\"\";-ms-flex-negative:0;flex-shrink:0;-ms-flex-order:9999;order:9999}.swiper-centered.swiper-horizontal>.swiper-wrapper>.swiper-slide:first-child{-webkit-margin-start:var(--swiper-centered-offset-before);margin-inline-start:var(--swiper-centered-offset-before)}.swiper-centered.swiper-horizontal>.swiper-wrapper::before{height:100%;width:var(--swiper-centered-offset-after)}.swiper-centered.swiper-vertical>.swiper-wrapper>.swiper-slide:first-child{-webkit-margin-before:var(--swiper-centered-offset-before);margin-block-start:var(--swiper-centered-offset-before)}.swiper-centered.swiper-vertical>.swiper-wrapper::before{width:100%;height:var(--swiper-centered-offset-after)}.swiper-centered>.swiper-wrapper>.swiper-slide{scroll-snap-align:center center}:root{}.swiper-pagination{position:absolute;text-align:center;-webkit-transition:300ms opacity;transition:300ms opacity;-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);z-index:10}.swiper-pagination.swiper-pagination-hidden{opacity:0}.swiper-pagination-disabled>.swiper-pagination,.swiper-pagination.swiper-pagination-disabled{display:none !important}.swiper-pagination-fraction,.swiper-pagination-custom,.swiper-horizontal>.swiper-pagination-bullets,.swiper-pagination-bullets.swiper-pagination-horizontal{bottom:10px;left:0;width:100%}.swiper-pagination-bullets-dynamic{overflow:hidden;font-size:0}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{-webkit-transform:scale(0.33);transform:scale(0.33);position:relative}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active{-webkit-transform:scale(1);transform:scale(1)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-main{-webkit-transform:scale(1);transform:scale(1)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-prev{-webkit-transform:scale(0.66);transform:scale(0.66)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-prev-prev{-webkit-transform:scale(0.33);transform:scale(0.33)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next{-webkit-transform:scale(0.66);transform:scale(0.66)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next-next{-webkit-transform:scale(0.33);transform:scale(0.33)}.swiper-pagination-bullet{width:var(--swiper-pagination-bullet-width, var(--swiper-pagination-bullet-size, 8px));height:var(--swiper-pagination-bullet-height, var(--swiper-pagination-bullet-size, 8px));display:inline-block;border-radius:50%;background:var(--swiper-pagination-bullet-inactive-color, #000);opacity:var(--swiper-pagination-bullet-inactive-opacity, 0.2)}button.swiper-pagination-bullet{border:none;margin:0;padding:0;-webkit-box-shadow:none;box-shadow:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}.swiper-pagination-clickable .swiper-pagination-bullet{cursor:pointer}.swiper-pagination-bullet:only-child{display:none !important}.swiper-pagination-bullet-active{opacity:var(--swiper-pagination-bullet-opacity, 1);background:var(--swiper-pagination-color, var(--swiper-theme-color))}.swiper-vertical>.swiper-pagination-bullets,.swiper-pagination-vertical.swiper-pagination-bullets{right:10px;top:50%;-webkit-transform:translate3d(0px, -50%, 0);transform:translate3d(0px, -50%, 0)}.swiper-vertical>.swiper-pagination-bullets .swiper-pagination-bullet,.swiper-pagination-vertical.swiper-pagination-bullets .swiper-pagination-bullet{margin:var(--swiper-pagination-bullet-vertical-gap, 6px) 0;display:block}.swiper-vertical>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic,.swiper-pagination-vertical.swiper-pagination-bullets.swiper-pagination-bullets-dynamic{top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);width:8px}.swiper-vertical>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet,.swiper-pagination-vertical.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{display:inline-block;-webkit-transition:200ms top, 200ms -webkit-transform;transition:200ms top, 200ms -webkit-transform;transition:200ms transform, 200ms top;transition:200ms transform, 200ms top, 200ms -webkit-transform}.swiper-horizontal>.swiper-pagination-bullets .swiper-pagination-bullet,.swiper-pagination-horizontal.swiper-pagination-bullets .swiper-pagination-bullet{margin:0 var(--swiper-pagination-bullet-horizontal-gap, 4px)}.swiper-horizontal>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic,.swiper-pagination-horizontal.swiper-pagination-bullets.swiper-pagination-bullets-dynamic{left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%);white-space:nowrap}.swiper-horizontal>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet,.swiper-pagination-horizontal.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{-webkit-transition:200ms left, 200ms -webkit-transform;transition:200ms left, 200ms -webkit-transform;transition:200ms transform, 200ms left;transition:200ms transform, 200ms left, 200ms -webkit-transform}.swiper-horizontal.swiper-rtl>.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{-webkit-transition:200ms right, 200ms -webkit-transform;transition:200ms right, 200ms -webkit-transform;transition:200ms transform, 200ms right;transition:200ms transform, 200ms right, 200ms -webkit-transform}.swiper-pagination-progressbar{background:rgba(0, 0, 0, 0.25);position:absolute}.swiper-pagination-progressbar .swiper-pagination-progressbar-fill{background:var(--swiper-pagination-color, var(--swiper-theme-color));position:absolute;left:0;top:0;width:100%;height:100%;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:left top;transform-origin:left top}.swiper-rtl .swiper-pagination-progressbar .swiper-pagination-progressbar-fill{-webkit-transform-origin:right top;transform-origin:right top}.swiper-horizontal>.swiper-pagination-progressbar,.swiper-pagination-progressbar.swiper-pagination-horizontal,.swiper-vertical>.swiper-pagination-progressbar.swiper-pagination-progressbar-opposite,.swiper-pagination-progressbar.swiper-pagination-vertical.swiper-pagination-progressbar-opposite{width:100%;height:4px;left:0;top:0}.swiper-vertical>.swiper-pagination-progressbar,.swiper-pagination-progressbar.swiper-pagination-vertical,.swiper-horizontal>.swiper-pagination-progressbar.swiper-pagination-progressbar-opposite,.swiper-pagination-progressbar.swiper-pagination-horizontal.swiper-pagination-progressbar-opposite{width:4px;height:100%;left:0;top:0}.swiper-pagination-lock{display:none}:root{--swiper-navigation-size:44px;}.swiper-button-prev,.swiper-button-next{position:absolute;top:50%;width:calc(var(--swiper-navigation-size) / 44 * 27);height:var(--swiper-navigation-size);margin-top:calc(0px - var(--swiper-navigation-size) / 2);z-index:10;cursor:pointer;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;color:var(--swiper-navigation-color, var(--swiper-theme-color))}.swiper-button-prev.swiper-button-disabled,.swiper-button-next.swiper-button-disabled{opacity:0.35;cursor:auto;pointer-events:none}.swiper-button-prev.swiper-button-hidden,.swiper-button-next.swiper-button-hidden{opacity:0;cursor:auto;pointer-events:none}.swiper-navigation-disabled .swiper-button-prev,.swiper-navigation-disabled .swiper-button-next{display:none !important}.swiper-button-prev:after,.swiper-button-next:after{font-family:swiper-icons;font-size:var(--swiper-navigation-size);text-transform:none !important;letter-spacing:0;font-variant:initial;line-height:1}.swiper-button-prev,.swiper-rtl .swiper-button-next{left:10px;right:auto}.swiper-button-prev:after,.swiper-rtl .swiper-button-next:after{content:\"prev\"}.swiper-button-next,.swiper-rtl .swiper-button-prev{right:10px;left:auto}.swiper-button-next:after,.swiper-rtl .swiper-button-prev:after{content:\"next\"}.swiper-button-lock{display:none}";
23163
23436
 
23164
- if (!element) {
23165
- element = document.createElement('div');
23166
- element.className = checkProps[key];
23167
- swiper.$el.append(element);
23437
+ const SallaSwiper = class {
23438
+ constructor(hostRef) {
23439
+ index.registerInstance(this, hostRef);
23440
+ this.slideChange = index.createEvent(this, "slideChange", 7);
23441
+ this.reachBeginning = index.createEvent(this, "reachBeginning", 7);
23442
+ this.reachEnd = index.createEvent(this, "reachEnd", 7);
23443
+ this.slideChangeTransitionEnd = index.createEvent(this, "slideChangeTransitionEnd", 7);
23444
+ this.slideChangeTransitionStart = index.createEvent(this, "slideChangeTransitionStart", 7);
23445
+ this.slideNextTransitionEnd = index.createEvent(this, "slideNextTransitionEnd", 7);
23446
+ this.slideNextTransitionStart = index.createEvent(this, "slideNextTransitionStart", 7);
23447
+ this.slidePrevTransitionEnd = index.createEvent(this, "slidePrevTransitionEnd", 7);
23448
+ this.slidePrevTransitionStart = index.createEvent(this, "slidePrevTransitionStart", 7);
23449
+ this.sliderMove = index.createEvent(this, "sliderMove", 7);
23450
+ this.touchSliderEnd = index.createEvent(this, "touchSliderEnd", 7);
23451
+ this.touchSliderMove = index.createEvent(this, "touchSliderMove", 7);
23452
+ this.touchSliderStart = index.createEvent(this, "touchSliderStart", 7);
23453
+ this.sliderTransitionEnd = index.createEvent(this, "sliderTransitionEnd", 7);
23454
+ this.sliderTransitionStart = index.createEvent(this, "sliderTransitionStart", 7);
23455
+ /**
23456
+ * Show/hide slider block title
23457
+ */
23458
+ this.blockTitle = '';
23459
+ /**
23460
+ * Show/hide slider block sub title
23461
+ */
23462
+ this.blockSubtitle = '';
23463
+ /**
23464
+ * Show/hide display all button beside arrows
23465
+ */
23466
+ this.displayAllUrl = '';
23467
+ /**
23468
+ * Show/hide arrows
23469
+ */
23470
+ this.showControls = true;
23471
+ /**
23472
+ * Show/hide arrows
23473
+ */
23474
+ this.controlsOuter = false;
23475
+ /**
23476
+ * Show/hide thumbs slider arrows
23477
+ */
23478
+ this.showThumbsControls = true;
23479
+ /**
23480
+ * Enable autoplay - working with `type="carousel" only`
23481
+ */
23482
+ this.autoPlay = false;
23483
+ /**
23484
+ * Enable pagination
23485
+ */
23486
+ this.pagination = false;
23487
+ /**
23488
+ * Enable center mode - working with `type="carousel" only`
23489
+ */
23490
+ this.centered = false;
23491
+ /**
23492
+ * Run slider in loop, Don't use it for slides with custom components inside it, because it may cause re-render issue
23493
+ */
23494
+ this.loop = false;
23495
+ /**
23496
+ * Set the type of the slider
23497
+ * Default: ''
23498
+ */
23499
+ this.type = '';
23500
+ /**
23501
+ * Slider Configs refer to https://swiperjs.com/swiper-api#parameters and pass the entire config object
23502
+ * @example
23503
+ * let slider = document.querySelector('salla-slider');
23504
+ * slider.sliderConfig = {
23505
+ * slidesPerView: 1,
23506
+ * spaceBetween : 30,
23507
+ * lazy: true,
23508
+ * }
23509
+ *
23510
+ */
23511
+ this.sliderConfig = {};
23512
+ /**
23513
+ * Thumbs Slider Configs refer to https://swiperjs.com/swiper-api#parameters and pass the entire config object
23514
+ * @example
23515
+ * let slider = document.querySelector('salla-slider');
23516
+ * slider.thumbsConfig = {
23517
+ * slidesPerView: 1,
23518
+ * spaceBetween : 30,
23519
+ * lazy: true,
23520
+ * }
23521
+ *
23522
+ */
23523
+ this.thumbsConfig = {};
23524
+ // States
23525
+ this.currentIndex = undefined;
23526
+ this.isEnd = false;
23527
+ this.isBeginning = true;
23528
+ this.isRTL = document.documentElement.dir === 'rtl';
23529
+ this.pre_defined_config = {
23530
+ carousel: {
23531
+ speed: 300,
23532
+ slidesPerView: 'auto',
23533
+ spaceBetween: 0,
23534
+ },
23535
+ fullscreen: {
23536
+ speed: 750,
23537
+ parallax: true,
23538
+ autoplay: {
23539
+ delay: 5000,
23540
+ },
23541
+ },
23542
+ testimonials: {
23543
+ draggable: true,
23544
+ centeredSlides: true,
23545
+ slidesPerView: 1,
23546
+ breakpoints: { 1024: { slidesPerView: 2 } }
23547
+ },
23548
+ blog: {
23549
+ slidesPerView: 1,
23550
+ centeredSlides: true,
23551
+ spaceBetween: 30,
23552
+ effect: "fade",
23553
+ breakpoints: {
23554
+ 320: { spaceBetween: 10 },
23555
+ 768: { spaceBetween: 15 },
23556
+ 980: { paceBetween: 30 },
23168
23557
  }
23169
-
23170
- params[key] = element;
23171
- originalParams[key] = element;
23558
+ },
23559
+ thumbs: {
23560
+ slidesPerView: 1,
23561
+ spaceBetween: 30
23172
23562
  }
23173
- });
23563
+ };
23174
23564
  }
23175
-
23176
- return params;
23177
- }
23178
-
23179
- function Navigation(_ref) {
23180
- let {
23181
- swiper,
23182
- extendParams,
23183
- on,
23184
- emit
23185
- } = _ref;
23186
- extendParams({
23187
- navigation: {
23188
- nextEl: null,
23189
- prevEl: null,
23190
- hideOnClick: false,
23191
- disabledClass: 'swiper-button-disabled',
23192
- hiddenClass: 'swiper-button-hidden',
23193
- lockClass: 'swiper-button-lock',
23194
- navigationDisabledClass: 'swiper-navigation-disabled'
23195
- }
23196
- });
23197
- swiper.navigation = {
23198
- nextEl: null,
23199
- $nextEl: null,
23200
- prevEl: null,
23201
- $prevEl: null
23202
- };
23203
-
23204
- function getEl(el) {
23205
- let $el;
23206
-
23207
- if (el) {
23208
- $el = core.$(el);
23209
-
23210
- if (swiper.params.uniqueNavElements && typeof el === 'string' && $el.length > 1 && swiper.$el.find(el).length === 1) {
23211
- $el = swiper.$el.find(el);
23212
- }
23213
- }
23214
-
23215
- return $el;
23565
+ // Methods
23566
+ /**
23567
+ * Run transition to the slide with index number equal to 'index' parameter for the duration equal to 'speed' parameter.
23568
+ *
23569
+ * @param {number} index - Index number of slide.
23570
+ * @param {number} speed - Transition duration (in ms).
23571
+ * @param {boolean} runCallbacks - Set it to false (by default it is true) and transition will not produce transition events.
23572
+ * **/
23573
+ async slideTo(index, speed, runCallbacks) {
23574
+ return this.slider.slideTo(index, speed, runCallbacks);
23216
23575
  }
23217
-
23218
- function toggleEl($el, disabled) {
23219
- const params = swiper.params.navigation;
23220
-
23221
- if ($el && $el.length > 0) {
23222
- $el[disabled ? 'addClass' : 'removeClass'](params.disabledClass);
23223
- if ($el[0] && $el[0].tagName === 'BUTTON') $el[0].disabled = disabled;
23224
-
23225
- if (swiper.params.watchOverflow && swiper.enabled) {
23226
- $el[swiper.isLocked ? 'addClass' : 'removeClass'](params.lockClass);
23227
- }
23228
- }
23229
- }
23230
-
23231
- function update() {
23232
- // Update Navigation Buttons
23233
- if (swiper.params.loop) return;
23234
- const {
23235
- $nextEl,
23236
- $prevEl
23237
- } = swiper.navigation;
23238
- toggleEl($prevEl, swiper.isBeginning && !swiper.params.rewind);
23239
- toggleEl($nextEl, swiper.isEnd && !swiper.params.rewind);
23240
- }
23241
-
23242
- function onPrevClick(e) {
23243
- e.preventDefault();
23244
- if (swiper.isBeginning && !swiper.params.loop && !swiper.params.rewind) return;
23245
- swiper.slidePrev();
23246
- emit('navigationPrev');
23247
- }
23248
-
23249
- function onNextClick(e) {
23250
- e.preventDefault();
23251
- if (swiper.isEnd && !swiper.params.loop && !swiper.params.rewind) return;
23252
- swiper.slideNext();
23253
- emit('navigationNext');
23254
- }
23255
-
23256
- function init() {
23257
- const params = swiper.params.navigation;
23258
- swiper.params.navigation = createElementIfNotDefined(swiper, swiper.originalParams.navigation, swiper.params.navigation, {
23259
- nextEl: 'swiper-button-next',
23260
- prevEl: 'swiper-button-prev'
23261
- });
23262
- if (!(params.nextEl || params.prevEl)) return;
23263
- const $nextEl = getEl(params.nextEl);
23264
- const $prevEl = getEl(params.prevEl);
23265
-
23266
- if ($nextEl && $nextEl.length > 0) {
23267
- $nextEl.on('click', onNextClick);
23268
- }
23269
-
23270
- if ($prevEl && $prevEl.length > 0) {
23271
- $prevEl.on('click', onPrevClick);
23272
- }
23273
-
23274
- Object.assign(swiper.navigation, {
23275
- $nextEl,
23276
- nextEl: $nextEl && $nextEl[0],
23277
- $prevEl,
23278
- prevEl: $prevEl && $prevEl[0]
23279
- });
23280
-
23281
- if (!swiper.enabled) {
23282
- if ($nextEl) $nextEl.addClass(params.lockClass);
23283
- if ($prevEl) $prevEl.addClass(params.lockClass);
23284
- }
23285
- }
23286
-
23287
- function destroy() {
23288
- const {
23289
- $nextEl,
23290
- $prevEl
23291
- } = swiper.navigation;
23292
-
23293
- if ($nextEl && $nextEl.length) {
23294
- $nextEl.off('click', onNextClick);
23295
- $nextEl.removeClass(swiper.params.navigation.disabledClass);
23296
- }
23297
-
23298
- if ($prevEl && $prevEl.length) {
23299
- $prevEl.off('click', onPrevClick);
23300
- $prevEl.removeClass(swiper.params.navigation.disabledClass);
23301
- }
23302
- }
23303
-
23304
- on('init', () => {
23305
- if (swiper.params.navigation.enabled === false) {
23306
- // eslint-disable-next-line
23307
- disable();
23308
- } else {
23309
- init();
23310
- update();
23311
- }
23312
- });
23313
- on('toEdge fromEdge lock unlock', () => {
23314
- update();
23315
- });
23316
- on('destroy', () => {
23317
- destroy();
23318
- });
23319
- on('enable disable', () => {
23320
- const {
23321
- $nextEl,
23322
- $prevEl
23323
- } = swiper.navigation;
23324
-
23325
- if ($nextEl) {
23326
- $nextEl[swiper.enabled ? 'removeClass' : 'addClass'](swiper.params.navigation.lockClass);
23327
- }
23328
-
23329
- if ($prevEl) {
23330
- $prevEl[swiper.enabled ? 'removeClass' : 'addClass'](swiper.params.navigation.lockClass);
23331
- }
23332
- });
23333
- on('click', (_s, e) => {
23334
- const {
23335
- $nextEl,
23336
- $prevEl
23337
- } = swiper.navigation;
23338
- const targetEl = e.target;
23339
-
23340
- if (swiper.params.navigation.hideOnClick && !core.$(targetEl).is($prevEl) && !core.$(targetEl).is($nextEl)) {
23341
- if (swiper.pagination && swiper.params.pagination && swiper.params.pagination.clickable && (swiper.pagination.el === targetEl || swiper.pagination.el.contains(targetEl))) return;
23342
- let isHidden;
23343
-
23344
- if ($nextEl) {
23345
- isHidden = $nextEl.hasClass(swiper.params.navigation.hiddenClass);
23346
- } else if ($prevEl) {
23347
- isHidden = $prevEl.hasClass(swiper.params.navigation.hiddenClass);
23348
- }
23349
-
23350
- if (isHidden === true) {
23351
- emit('navigationShow');
23352
- } else {
23353
- emit('navigationHide');
23354
- }
23355
-
23356
- if ($nextEl) {
23357
- $nextEl.toggleClass(swiper.params.navigation.hiddenClass);
23358
- }
23359
-
23360
- if ($prevEl) {
23361
- $prevEl.toggleClass(swiper.params.navigation.hiddenClass);
23362
- }
23363
- }
23364
- });
23365
-
23366
- const enable = () => {
23367
- swiper.$el.removeClass(swiper.params.navigation.navigationDisabledClass);
23368
- init();
23369
- update();
23370
- };
23371
-
23372
- const disable = () => {
23373
- swiper.$el.addClass(swiper.params.navigation.navigationDisabledClass);
23374
- destroy();
23375
- };
23376
-
23377
- Object.assign(swiper.navigation, {
23378
- enable,
23379
- disable,
23380
- update,
23381
- init,
23382
- destroy
23383
- });
23384
- }
23385
-
23386
- function classesToSelector(classes) {
23387
- if (classes === void 0) {
23388
- classes = '';
23389
- }
23390
-
23391
- return `.${classes.trim().replace(/([\.:!\/])/g, '\\$1') // eslint-disable-line
23392
- .replace(/ /g, '.')}`;
23393
- }
23394
-
23395
- function Pagination(_ref) {
23396
- let {
23397
- swiper,
23398
- extendParams,
23399
- on,
23400
- emit
23401
- } = _ref;
23402
- const pfx = 'swiper-pagination';
23403
- extendParams({
23404
- pagination: {
23405
- el: null,
23406
- bulletElement: 'span',
23407
- clickable: false,
23408
- hideOnClick: false,
23409
- renderBullet: null,
23410
- renderProgressbar: null,
23411
- renderFraction: null,
23412
- renderCustom: null,
23413
- progressbarOpposite: false,
23414
- type: 'bullets',
23415
- // 'bullets' or 'progressbar' or 'fraction' or 'custom'
23416
- dynamicBullets: false,
23417
- dynamicMainBullets: 1,
23418
- formatFractionCurrent: number => number,
23419
- formatFractionTotal: number => number,
23420
- bulletClass: `${pfx}-bullet`,
23421
- bulletActiveClass: `${pfx}-bullet-active`,
23422
- modifierClass: `${pfx}-`,
23423
- currentClass: `${pfx}-current`,
23424
- totalClass: `${pfx}-total`,
23425
- hiddenClass: `${pfx}-hidden`,
23426
- progressbarFillClass: `${pfx}-progressbar-fill`,
23427
- progressbarOppositeClass: `${pfx}-progressbar-opposite`,
23428
- clickableClass: `${pfx}-clickable`,
23429
- lockClass: `${pfx}-lock`,
23430
- horizontalClass: `${pfx}-horizontal`,
23431
- verticalClass: `${pfx}-vertical`,
23432
- paginationDisabledClass: `${pfx}-disabled`
23433
- }
23434
- });
23435
- swiper.pagination = {
23436
- el: null,
23437
- $el: null,
23438
- bullets: []
23439
- };
23440
- let bulletSize;
23441
- let dynamicBulletIndex = 0;
23442
-
23443
- function isPaginationDisabled() {
23444
- return !swiper.params.pagination.el || !swiper.pagination.el || !swiper.pagination.$el || swiper.pagination.$el.length === 0;
23445
- }
23446
-
23447
- function setSideBullets($bulletEl, position) {
23448
- const {
23449
- bulletActiveClass
23450
- } = swiper.params.pagination;
23451
- $bulletEl[position]().addClass(`${bulletActiveClass}-${position}`)[position]().addClass(`${bulletActiveClass}-${position}-${position}`);
23452
- }
23453
-
23454
- function update() {
23455
- // Render || Update Pagination bullets/items
23456
- const rtl = swiper.rtl;
23457
- const params = swiper.params.pagination;
23458
- if (isPaginationDisabled()) return;
23459
- const slidesLength = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.slides.length : swiper.slides.length;
23460
- const $el = swiper.pagination.$el; // Current/Total
23461
-
23462
- let current;
23463
- const total = swiper.params.loop ? Math.ceil((slidesLength - swiper.loopedSlides * 2) / swiper.params.slidesPerGroup) : swiper.snapGrid.length;
23464
-
23465
- if (swiper.params.loop) {
23466
- current = Math.ceil((swiper.activeIndex - swiper.loopedSlides) / swiper.params.slidesPerGroup);
23467
-
23468
- if (current > slidesLength - 1 - swiper.loopedSlides * 2) {
23469
- current -= slidesLength - swiper.loopedSlides * 2;
23470
- }
23471
-
23472
- if (current > total - 1) current -= total;
23473
- if (current < 0 && swiper.params.paginationType !== 'bullets') current = total + current;
23474
- } else if (typeof swiper.snapIndex !== 'undefined') {
23475
- current = swiper.snapIndex;
23476
- } else {
23477
- current = swiper.activeIndex || 0;
23478
- } // Types
23479
-
23480
-
23481
- if (params.type === 'bullets' && swiper.pagination.bullets && swiper.pagination.bullets.length > 0) {
23482
- const bullets = swiper.pagination.bullets;
23483
- let firstIndex;
23484
- let lastIndex;
23485
- let midIndex;
23486
-
23487
- if (params.dynamicBullets) {
23488
- bulletSize = bullets.eq(0)[swiper.isHorizontal() ? 'outerWidth' : 'outerHeight'](true);
23489
- $el.css(swiper.isHorizontal() ? 'width' : 'height', `${bulletSize * (params.dynamicMainBullets + 4)}px`);
23490
-
23491
- if (params.dynamicMainBullets > 1 && swiper.previousIndex !== undefined) {
23492
- dynamicBulletIndex += current - (swiper.previousIndex - swiper.loopedSlides || 0);
23493
-
23494
- if (dynamicBulletIndex > params.dynamicMainBullets - 1) {
23495
- dynamicBulletIndex = params.dynamicMainBullets - 1;
23496
- } else if (dynamicBulletIndex < 0) {
23497
- dynamicBulletIndex = 0;
23498
- }
23499
- }
23500
-
23501
- firstIndex = Math.max(current - dynamicBulletIndex, 0);
23502
- lastIndex = firstIndex + (Math.min(bullets.length, params.dynamicMainBullets) - 1);
23503
- midIndex = (lastIndex + firstIndex) / 2;
23504
- }
23505
-
23506
- bullets.removeClass(['', '-next', '-next-next', '-prev', '-prev-prev', '-main'].map(suffix => `${params.bulletActiveClass}${suffix}`).join(' '));
23507
-
23508
- if ($el.length > 1) {
23509
- bullets.each(bullet => {
23510
- const $bullet = core.$(bullet);
23511
- const bulletIndex = $bullet.index();
23512
-
23513
- if (bulletIndex === current) {
23514
- $bullet.addClass(params.bulletActiveClass);
23515
- }
23516
-
23517
- if (params.dynamicBullets) {
23518
- if (bulletIndex >= firstIndex && bulletIndex <= lastIndex) {
23519
- $bullet.addClass(`${params.bulletActiveClass}-main`);
23520
- }
23521
-
23522
- if (bulletIndex === firstIndex) {
23523
- setSideBullets($bullet, 'prev');
23524
- }
23525
-
23526
- if (bulletIndex === lastIndex) {
23527
- setSideBullets($bullet, 'next');
23528
- }
23529
- }
23530
- });
23531
- } else {
23532
- const $bullet = bullets.eq(current);
23533
- const bulletIndex = $bullet.index();
23534
- $bullet.addClass(params.bulletActiveClass);
23535
-
23536
- if (params.dynamicBullets) {
23537
- const $firstDisplayedBullet = bullets.eq(firstIndex);
23538
- const $lastDisplayedBullet = bullets.eq(lastIndex);
23539
-
23540
- for (let i = firstIndex; i <= lastIndex; i += 1) {
23541
- bullets.eq(i).addClass(`${params.bulletActiveClass}-main`);
23542
- }
23543
-
23544
- if (swiper.params.loop) {
23545
- if (bulletIndex >= bullets.length) {
23546
- for (let i = params.dynamicMainBullets; i >= 0; i -= 1) {
23547
- bullets.eq(bullets.length - i).addClass(`${params.bulletActiveClass}-main`);
23548
- }
23549
-
23550
- bullets.eq(bullets.length - params.dynamicMainBullets - 1).addClass(`${params.bulletActiveClass}-prev`);
23551
- } else {
23552
- setSideBullets($firstDisplayedBullet, 'prev');
23553
- setSideBullets($lastDisplayedBullet, 'next');
23554
- }
23555
- } else {
23556
- setSideBullets($firstDisplayedBullet, 'prev');
23557
- setSideBullets($lastDisplayedBullet, 'next');
23558
- }
23559
- }
23560
- }
23561
-
23562
- if (params.dynamicBullets) {
23563
- const dynamicBulletsLength = Math.min(bullets.length, params.dynamicMainBullets + 4);
23564
- const bulletsOffset = (bulletSize * dynamicBulletsLength - bulletSize) / 2 - midIndex * bulletSize;
23565
- const offsetProp = rtl ? 'right' : 'left';
23566
- bullets.css(swiper.isHorizontal() ? offsetProp : 'top', `${bulletsOffset}px`);
23567
- }
23568
- }
23569
-
23570
- if (params.type === 'fraction') {
23571
- $el.find(classesToSelector(params.currentClass)).text(params.formatFractionCurrent(current + 1));
23572
- $el.find(classesToSelector(params.totalClass)).text(params.formatFractionTotal(total));
23573
- }
23574
-
23575
- if (params.type === 'progressbar') {
23576
- let progressbarDirection;
23577
-
23578
- if (params.progressbarOpposite) {
23579
- progressbarDirection = swiper.isHorizontal() ? 'vertical' : 'horizontal';
23580
- } else {
23581
- progressbarDirection = swiper.isHorizontal() ? 'horizontal' : 'vertical';
23582
- }
23583
-
23584
- const scale = (current + 1) / total;
23585
- let scaleX = 1;
23586
- let scaleY = 1;
23587
-
23588
- if (progressbarDirection === 'horizontal') {
23589
- scaleX = scale;
23590
- } else {
23591
- scaleY = scale;
23592
- }
23593
-
23594
- $el.find(classesToSelector(params.progressbarFillClass)).transform(`translate3d(0,0,0) scaleX(${scaleX}) scaleY(${scaleY})`).transition(swiper.params.speed);
23595
- }
23596
-
23597
- if (params.type === 'custom' && params.renderCustom) {
23598
- $el.html(params.renderCustom(swiper, current + 1, total));
23599
- emit('paginationRender', $el[0]);
23600
- } else {
23601
- emit('paginationUpdate', $el[0]);
23602
- }
23603
-
23604
- if (swiper.params.watchOverflow && swiper.enabled) {
23605
- $el[swiper.isLocked ? 'addClass' : 'removeClass'](params.lockClass);
23606
- }
23607
- }
23608
-
23609
- function render() {
23610
- // Render Container
23611
- const params = swiper.params.pagination;
23612
- if (isPaginationDisabled()) return;
23613
- const slidesLength = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.slides.length : swiper.slides.length;
23614
- const $el = swiper.pagination.$el;
23615
- let paginationHTML = '';
23616
-
23617
- if (params.type === 'bullets') {
23618
- let numberOfBullets = swiper.params.loop ? Math.ceil((slidesLength - swiper.loopedSlides * 2) / swiper.params.slidesPerGroup) : swiper.snapGrid.length;
23619
-
23620
- if (swiper.params.freeMode && swiper.params.freeMode.enabled && !swiper.params.loop && numberOfBullets > slidesLength) {
23621
- numberOfBullets = slidesLength;
23622
- }
23623
-
23624
- for (let i = 0; i < numberOfBullets; i += 1) {
23625
- if (params.renderBullet) {
23626
- paginationHTML += params.renderBullet.call(swiper, i, params.bulletClass);
23627
- } else {
23628
- paginationHTML += `<${params.bulletElement} class="${params.bulletClass}"></${params.bulletElement}>`;
23629
- }
23630
- }
23631
-
23632
- $el.html(paginationHTML);
23633
- swiper.pagination.bullets = $el.find(classesToSelector(params.bulletClass));
23634
- }
23635
-
23636
- if (params.type === 'fraction') {
23637
- if (params.renderFraction) {
23638
- paginationHTML = params.renderFraction.call(swiper, params.currentClass, params.totalClass);
23639
- } else {
23640
- paginationHTML = `<span class="${params.currentClass}"></span>` + ' / ' + `<span class="${params.totalClass}"></span>`;
23641
- }
23642
-
23643
- $el.html(paginationHTML);
23644
- }
23645
-
23646
- if (params.type === 'progressbar') {
23647
- if (params.renderProgressbar) {
23648
- paginationHTML = params.renderProgressbar.call(swiper, params.progressbarFillClass);
23649
- } else {
23650
- paginationHTML = `<span class="${params.progressbarFillClass}"></span>`;
23651
- }
23652
-
23653
- $el.html(paginationHTML);
23654
- }
23655
-
23656
- if (params.type !== 'custom') {
23657
- emit('paginationRender', swiper.pagination.$el[0]);
23658
- }
23659
- }
23660
-
23661
- function init() {
23662
- swiper.params.pagination = createElementIfNotDefined(swiper, swiper.originalParams.pagination, swiper.params.pagination, {
23663
- el: 'swiper-pagination'
23664
- });
23665
- const params = swiper.params.pagination;
23666
- if (!params.el) return;
23667
- let $el = core.$(params.el);
23668
- if ($el.length === 0) return;
23669
-
23670
- if (swiper.params.uniqueNavElements && typeof params.el === 'string' && $el.length > 1) {
23671
- $el = swiper.$el.find(params.el); // check if it belongs to another nested Swiper
23672
-
23673
- if ($el.length > 1) {
23674
- $el = $el.filter(el => {
23675
- if (core.$(el).parents('.swiper')[0] !== swiper.el) return false;
23676
- return true;
23677
- });
23678
- }
23679
- }
23680
-
23681
- if (params.type === 'bullets' && params.clickable) {
23682
- $el.addClass(params.clickableClass);
23683
- }
23684
-
23685
- $el.addClass(params.modifierClass + params.type);
23686
- $el.addClass(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass);
23687
-
23688
- if (params.type === 'bullets' && params.dynamicBullets) {
23689
- $el.addClass(`${params.modifierClass}${params.type}-dynamic`);
23690
- dynamicBulletIndex = 0;
23691
-
23692
- if (params.dynamicMainBullets < 1) {
23693
- params.dynamicMainBullets = 1;
23694
- }
23695
- }
23696
-
23697
- if (params.type === 'progressbar' && params.progressbarOpposite) {
23698
- $el.addClass(params.progressbarOppositeClass);
23699
- }
23700
-
23701
- if (params.clickable) {
23702
- $el.on('click', classesToSelector(params.bulletClass), function onClick(e) {
23703
- e.preventDefault();
23704
- let index = core.$(this).index() * swiper.params.slidesPerGroup;
23705
- if (swiper.params.loop) index += swiper.loopedSlides;
23706
- swiper.slideTo(index);
23707
- });
23708
- }
23709
-
23710
- Object.assign(swiper.pagination, {
23711
- $el,
23712
- el: $el[0]
23713
- });
23714
-
23715
- if (!swiper.enabled) {
23716
- $el.addClass(params.lockClass);
23717
- }
23718
- }
23719
-
23720
- function destroy() {
23721
- const params = swiper.params.pagination;
23722
- if (isPaginationDisabled()) return;
23723
- const $el = swiper.pagination.$el;
23724
- $el.removeClass(params.hiddenClass);
23725
- $el.removeClass(params.modifierClass + params.type);
23726
- $el.removeClass(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass);
23727
- if (swiper.pagination.bullets && swiper.pagination.bullets.removeClass) swiper.pagination.bullets.removeClass(params.bulletActiveClass);
23728
-
23729
- if (params.clickable) {
23730
- $el.off('click', classesToSelector(params.bulletClass));
23731
- }
23732
- }
23733
-
23734
- on('init', () => {
23735
- if (swiper.params.pagination.enabled === false) {
23736
- // eslint-disable-next-line
23737
- disable();
23738
- } else {
23739
- init();
23740
- render();
23741
- update();
23742
- }
23743
- });
23744
- on('activeIndexChange', () => {
23745
- if (swiper.params.loop) {
23746
- update();
23747
- } else if (typeof swiper.snapIndex === 'undefined') {
23748
- update();
23749
- }
23750
- });
23751
- on('snapIndexChange', () => {
23752
- if (!swiper.params.loop) {
23753
- update();
23754
- }
23755
- });
23756
- on('slidesLengthChange', () => {
23757
- if (swiper.params.loop) {
23758
- render();
23759
- update();
23760
- }
23761
- });
23762
- on('snapGridLengthChange', () => {
23763
- if (!swiper.params.loop) {
23764
- render();
23765
- update();
23766
- }
23767
- });
23768
- on('destroy', () => {
23769
- destroy();
23770
- });
23771
- on('enable disable', () => {
23772
- const {
23773
- $el
23774
- } = swiper.pagination;
23775
-
23776
- if ($el) {
23777
- $el[swiper.enabled ? 'removeClass' : 'addClass'](swiper.params.pagination.lockClass);
23778
- }
23779
- });
23780
- on('lock unlock', () => {
23781
- update();
23782
- });
23783
- on('click', (_s, e) => {
23784
- const targetEl = e.target;
23785
- const {
23786
- $el
23787
- } = swiper.pagination;
23788
-
23789
- if (swiper.params.pagination.el && swiper.params.pagination.hideOnClick && $el && $el.length > 0 && !core.$(targetEl).hasClass(swiper.params.pagination.bulletClass)) {
23790
- if (swiper.navigation && (swiper.navigation.nextEl && targetEl === swiper.navigation.nextEl || swiper.navigation.prevEl && targetEl === swiper.navigation.prevEl)) return;
23791
- const isHidden = $el.hasClass(swiper.params.pagination.hiddenClass);
23792
-
23793
- if (isHidden === true) {
23794
- emit('paginationShow');
23795
- } else {
23796
- emit('paginationHide');
23797
- }
23798
-
23799
- $el.toggleClass(swiper.params.pagination.hiddenClass);
23800
- }
23801
- });
23802
-
23803
- const enable = () => {
23804
- swiper.$el.removeClass(swiper.params.pagination.paginationDisabledClass);
23805
-
23806
- if (swiper.pagination.$el) {
23807
- swiper.pagination.$el.removeClass(swiper.params.pagination.paginationDisabledClass);
23808
- }
23809
-
23810
- init();
23811
- render();
23812
- update();
23813
- };
23814
-
23815
- const disable = () => {
23816
- swiper.$el.addClass(swiper.params.pagination.paginationDisabledClass);
23817
-
23818
- if (swiper.pagination.$el) {
23819
- swiper.pagination.$el.addClass(swiper.params.pagination.paginationDisabledClass);
23820
- }
23821
-
23822
- destroy();
23823
- };
23824
-
23825
- Object.assign(swiper.pagination, {
23826
- enable,
23827
- disable,
23828
- render,
23829
- update,
23830
- init,
23831
- destroy
23832
- });
23833
- }
23834
-
23835
- function Parallax(_ref) {
23836
- let {
23837
- swiper,
23838
- extendParams,
23839
- on
23840
- } = _ref;
23841
- extendParams({
23842
- parallax: {
23843
- enabled: false
23844
- }
23845
- });
23846
-
23847
- const setTransform = (el, progress) => {
23848
- const {
23849
- rtl
23850
- } = swiper;
23851
- const $el = core.$(el);
23852
- const rtlFactor = rtl ? -1 : 1;
23853
- const p = $el.attr('data-swiper-parallax') || '0';
23854
- let x = $el.attr('data-swiper-parallax-x');
23855
- let y = $el.attr('data-swiper-parallax-y');
23856
- const scale = $el.attr('data-swiper-parallax-scale');
23857
- const opacity = $el.attr('data-swiper-parallax-opacity');
23858
-
23859
- if (x || y) {
23860
- x = x || '0';
23861
- y = y || '0';
23862
- } else if (swiper.isHorizontal()) {
23863
- x = p;
23864
- y = '0';
23865
- } else {
23866
- y = p;
23867
- x = '0';
23868
- }
23869
-
23870
- if (x.indexOf('%') >= 0) {
23871
- x = `${parseInt(x, 10) * progress * rtlFactor}%`;
23872
- } else {
23873
- x = `${x * progress * rtlFactor}px`;
23874
- }
23875
-
23876
- if (y.indexOf('%') >= 0) {
23877
- y = `${parseInt(y, 10) * progress}%`;
23878
- } else {
23879
- y = `${y * progress}px`;
23880
- }
23881
-
23882
- if (typeof opacity !== 'undefined' && opacity !== null) {
23883
- const currentOpacity = opacity - (opacity - 1) * (1 - Math.abs(progress));
23884
- $el[0].style.opacity = currentOpacity;
23885
- }
23886
-
23887
- if (typeof scale === 'undefined' || scale === null) {
23888
- $el.transform(`translate3d(${x}, ${y}, 0px)`);
23889
- } else {
23890
- const currentScale = scale - (scale - 1) * (1 - Math.abs(progress));
23891
- $el.transform(`translate3d(${x}, ${y}, 0px) scale(${currentScale})`);
23892
- }
23893
- };
23894
-
23895
- const setTranslate = () => {
23896
- const {
23897
- $el,
23898
- slides,
23899
- progress,
23900
- snapGrid
23901
- } = swiper;
23902
- $el.children('[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]').each(el => {
23903
- setTransform(el, progress);
23904
- });
23905
- slides.each((slideEl, slideIndex) => {
23906
- let slideProgress = slideEl.progress;
23907
-
23908
- if (swiper.params.slidesPerGroup > 1 && swiper.params.slidesPerView !== 'auto') {
23909
- slideProgress += Math.ceil(slideIndex / 2) - progress * (snapGrid.length - 1);
23910
- }
23911
-
23912
- slideProgress = Math.min(Math.max(slideProgress, -1), 1);
23913
- core.$(slideEl).find('[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]').each(el => {
23914
- setTransform(el, slideProgress);
23915
- });
23916
- });
23917
- };
23918
-
23919
- const setTransition = function (duration) {
23920
- if (duration === void 0) {
23921
- duration = swiper.params.speed;
23922
- }
23923
-
23924
- const {
23925
- $el
23926
- } = swiper;
23927
- $el.find('[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]').each(parallaxEl => {
23928
- const $parallaxEl = core.$(parallaxEl);
23929
- let parallaxDuration = parseInt($parallaxEl.attr('data-swiper-parallax-duration'), 10) || duration;
23930
- if (duration === 0) parallaxDuration = 0;
23931
- $parallaxEl.transition(parallaxDuration);
23932
- });
23933
- };
23934
-
23935
- on('beforeInit', () => {
23936
- if (!swiper.params.parallax.enabled) return;
23937
- swiper.params.watchSlidesProgress = true;
23938
- swiper.originalParams.watchSlidesProgress = true;
23939
- });
23940
- on('init', () => {
23941
- if (!swiper.params.parallax.enabled) return;
23942
- setTranslate();
23943
- });
23944
- on('setTranslate', () => {
23945
- if (!swiper.params.parallax.enabled) return;
23946
- setTranslate();
23947
- });
23948
- on('setTransition', (_swiper, duration) => {
23949
- if (!swiper.params.parallax.enabled) return;
23950
- setTransition(duration);
23951
- });
23952
- }
23953
-
23954
- function Lazy(_ref) {
23955
- let {
23956
- swiper,
23957
- extendParams,
23958
- on,
23959
- emit
23960
- } = _ref;
23961
- extendParams({
23962
- lazy: {
23963
- checkInView: false,
23964
- enabled: false,
23965
- loadPrevNext: false,
23966
- loadPrevNextAmount: 1,
23967
- loadOnTransitionStart: false,
23968
- scrollingElement: '',
23969
- elementClass: 'swiper-lazy',
23970
- loadingClass: 'swiper-lazy-loading',
23971
- loadedClass: 'swiper-lazy-loaded',
23972
- preloaderClass: 'swiper-lazy-preloader'
23973
- }
23974
- });
23975
- swiper.lazy = {};
23976
- let scrollHandlerAttached = false;
23977
- let initialImageLoaded = false;
23978
-
23979
- function loadInSlide(index, loadInDuplicate) {
23980
- if (loadInDuplicate === void 0) {
23981
- loadInDuplicate = true;
23982
- }
23983
-
23984
- const params = swiper.params.lazy;
23985
- if (typeof index === 'undefined') return;
23986
- if (swiper.slides.length === 0) return;
23987
- const isVirtual = swiper.virtual && swiper.params.virtual.enabled;
23988
- const $slideEl = isVirtual ? swiper.$wrapperEl.children(`.${swiper.params.slideClass}[data-swiper-slide-index="${index}"]`) : swiper.slides.eq(index);
23989
- const $images = $slideEl.find(`.${params.elementClass}:not(.${params.loadedClass}):not(.${params.loadingClass})`);
23990
-
23991
- if ($slideEl.hasClass(params.elementClass) && !$slideEl.hasClass(params.loadedClass) && !$slideEl.hasClass(params.loadingClass)) {
23992
- $images.push($slideEl[0]);
23993
- }
23994
-
23995
- if ($images.length === 0) return;
23996
- $images.each(imageEl => {
23997
- const $imageEl = core.$(imageEl);
23998
- $imageEl.addClass(params.loadingClass);
23999
- const background = $imageEl.attr('data-background');
24000
- const src = $imageEl.attr('data-src');
24001
- const srcset = $imageEl.attr('data-srcset');
24002
- const sizes = $imageEl.attr('data-sizes');
24003
- const $pictureEl = $imageEl.parent('picture');
24004
- swiper.loadImage($imageEl[0], src || background, srcset, sizes, false, () => {
24005
- if (typeof swiper === 'undefined' || swiper === null || !swiper || swiper && !swiper.params || swiper.destroyed) return;
24006
-
24007
- if (background) {
24008
- $imageEl.css('background-image', `url("${background}")`);
24009
- $imageEl.removeAttr('data-background');
24010
- } else {
24011
- if (srcset) {
24012
- $imageEl.attr('srcset', srcset);
24013
- $imageEl.removeAttr('data-srcset');
24014
- }
24015
-
24016
- if (sizes) {
24017
- $imageEl.attr('sizes', sizes);
24018
- $imageEl.removeAttr('data-sizes');
24019
- }
24020
-
24021
- if ($pictureEl.length) {
24022
- $pictureEl.children('source').each(sourceEl => {
24023
- const $source = core.$(sourceEl);
24024
-
24025
- if ($source.attr('data-srcset')) {
24026
- $source.attr('srcset', $source.attr('data-srcset'));
24027
- $source.removeAttr('data-srcset');
24028
- }
24029
- });
24030
- }
24031
-
24032
- if (src) {
24033
- $imageEl.attr('src', src);
24034
- $imageEl.removeAttr('data-src');
24035
- }
24036
- }
24037
-
24038
- $imageEl.addClass(params.loadedClass).removeClass(params.loadingClass);
24039
- $slideEl.find(`.${params.preloaderClass}`).remove();
24040
-
24041
- if (swiper.params.loop && loadInDuplicate) {
24042
- const slideOriginalIndex = $slideEl.attr('data-swiper-slide-index');
24043
-
24044
- if ($slideEl.hasClass(swiper.params.slideDuplicateClass)) {
24045
- const originalSlide = swiper.$wrapperEl.children(`[data-swiper-slide-index="${slideOriginalIndex}"]:not(.${swiper.params.slideDuplicateClass})`);
24046
- loadInSlide(originalSlide.index(), false);
24047
- } else {
24048
- const duplicatedSlide = swiper.$wrapperEl.children(`.${swiper.params.slideDuplicateClass}[data-swiper-slide-index="${slideOriginalIndex}"]`);
24049
- loadInSlide(duplicatedSlide.index(), false);
24050
- }
24051
- }
24052
-
24053
- emit('lazyImageReady', $slideEl[0], $imageEl[0]);
24054
-
24055
- if (swiper.params.autoHeight) {
24056
- swiper.updateAutoHeight();
24057
- }
24058
- });
24059
- emit('lazyImageLoad', $slideEl[0], $imageEl[0]);
24060
- });
24061
- }
24062
-
24063
- function load() {
24064
- const {
24065
- $wrapperEl,
24066
- params: swiperParams,
24067
- slides,
24068
- activeIndex
24069
- } = swiper;
24070
- const isVirtual = swiper.virtual && swiperParams.virtual.enabled;
24071
- const params = swiperParams.lazy;
24072
- let slidesPerView = swiperParams.slidesPerView;
24073
-
24074
- if (slidesPerView === 'auto') {
24075
- slidesPerView = 0;
24076
- }
24077
-
24078
- function slideExist(index) {
24079
- if (isVirtual) {
24080
- if ($wrapperEl.children(`.${swiperParams.slideClass}[data-swiper-slide-index="${index}"]`).length) {
24081
- return true;
24082
- }
24083
- } else if (slides[index]) return true;
24084
-
24085
- return false;
24086
- }
24087
-
24088
- function slideIndex(slideEl) {
24089
- if (isVirtual) {
24090
- return core.$(slideEl).attr('data-swiper-slide-index');
24091
- }
24092
-
24093
- return core.$(slideEl).index();
24094
- }
24095
-
24096
- if (!initialImageLoaded) initialImageLoaded = true;
24097
-
24098
- if (swiper.params.watchSlidesProgress) {
24099
- $wrapperEl.children(`.${swiperParams.slideVisibleClass}`).each(slideEl => {
24100
- const index = isVirtual ? core.$(slideEl).attr('data-swiper-slide-index') : core.$(slideEl).index();
24101
- loadInSlide(index);
24102
- });
24103
- } else if (slidesPerView > 1) {
24104
- for (let i = activeIndex; i < activeIndex + slidesPerView; i += 1) {
24105
- if (slideExist(i)) loadInSlide(i);
24106
- }
24107
- } else {
24108
- loadInSlide(activeIndex);
24109
- }
24110
-
24111
- if (params.loadPrevNext) {
24112
- if (slidesPerView > 1 || params.loadPrevNextAmount && params.loadPrevNextAmount > 1) {
24113
- const amount = params.loadPrevNextAmount;
24114
- const spv = Math.ceil(slidesPerView);
24115
- const maxIndex = Math.min(activeIndex + spv + Math.max(amount, spv), slides.length);
24116
- const minIndex = Math.max(activeIndex - Math.max(spv, amount), 0); // Next Slides
24117
-
24118
- for (let i = activeIndex + spv; i < maxIndex; i += 1) {
24119
- if (slideExist(i)) loadInSlide(i);
24120
- } // Prev Slides
24121
-
24122
-
24123
- for (let i = minIndex; i < activeIndex; i += 1) {
24124
- if (slideExist(i)) loadInSlide(i);
24125
- }
24126
- } else {
24127
- const nextSlide = $wrapperEl.children(`.${swiperParams.slideNextClass}`);
24128
- if (nextSlide.length > 0) loadInSlide(slideIndex(nextSlide));
24129
- const prevSlide = $wrapperEl.children(`.${swiperParams.slidePrevClass}`);
24130
- if (prevSlide.length > 0) loadInSlide(slideIndex(prevSlide));
24131
- }
24132
- }
24133
- }
24134
-
24135
- function checkInViewOnLoad() {
24136
- const window = core.getWindow();
24137
- if (!swiper || swiper.destroyed) return;
24138
- const $scrollElement = swiper.params.lazy.scrollingElement ? core.$(swiper.params.lazy.scrollingElement) : core.$(window);
24139
- const isWindow = $scrollElement[0] === window;
24140
- const scrollElementWidth = isWindow ? window.innerWidth : $scrollElement[0].offsetWidth;
24141
- const scrollElementHeight = isWindow ? window.innerHeight : $scrollElement[0].offsetHeight;
24142
- const swiperOffset = swiper.$el.offset();
24143
- const {
24144
- rtlTranslate: rtl
24145
- } = swiper;
24146
- let inView = false;
24147
- if (rtl) swiperOffset.left -= swiper.$el[0].scrollLeft;
24148
- const swiperCoord = [[swiperOffset.left, swiperOffset.top], [swiperOffset.left + swiper.width, swiperOffset.top], [swiperOffset.left, swiperOffset.top + swiper.height], [swiperOffset.left + swiper.width, swiperOffset.top + swiper.height]];
24149
-
24150
- for (let i = 0; i < swiperCoord.length; i += 1) {
24151
- const point = swiperCoord[i];
24152
-
24153
- if (point[0] >= 0 && point[0] <= scrollElementWidth && point[1] >= 0 && point[1] <= scrollElementHeight) {
24154
- if (point[0] === 0 && point[1] === 0) continue; // eslint-disable-line
24155
-
24156
- inView = true;
24157
- }
24158
- }
24159
-
24160
- const passiveListener = swiper.touchEvents.start === 'touchstart' && swiper.support.passiveListener && swiper.params.passiveListeners ? {
24161
- passive: true,
24162
- capture: false
24163
- } : false;
24164
-
24165
- if (inView) {
24166
- load();
24167
- $scrollElement.off('scroll', checkInViewOnLoad, passiveListener);
24168
- } else if (!scrollHandlerAttached) {
24169
- scrollHandlerAttached = true;
24170
- $scrollElement.on('scroll', checkInViewOnLoad, passiveListener);
24171
- }
24172
- }
24173
-
24174
- on('beforeInit', () => {
24175
- if (swiper.params.lazy.enabled && swiper.params.preloadImages) {
24176
- swiper.params.preloadImages = false;
24177
- }
24178
- });
24179
- on('init', () => {
24180
- if (swiper.params.lazy.enabled) {
24181
- if (swiper.params.lazy.checkInView) {
24182
- checkInViewOnLoad();
24183
- } else {
24184
- load();
24185
- }
24186
- }
24187
- });
24188
- on('scroll', () => {
24189
- if (swiper.params.freeMode && swiper.params.freeMode.enabled && !swiper.params.freeMode.sticky) {
24190
- load();
24191
- }
24192
- });
24193
- on('scrollbarDragMove resize _freeModeNoMomentumRelease', () => {
24194
- if (swiper.params.lazy.enabled) {
24195
- if (swiper.params.lazy.checkInView) {
24196
- checkInViewOnLoad();
24197
- } else {
24198
- load();
24199
- }
24200
- }
24201
- });
24202
- on('transitionStart', () => {
24203
- if (swiper.params.lazy.enabled) {
24204
- if (swiper.params.lazy.loadOnTransitionStart || !swiper.params.lazy.loadOnTransitionStart && !initialImageLoaded) {
24205
- if (swiper.params.lazy.checkInView) {
24206
- checkInViewOnLoad();
24207
- } else {
24208
- load();
24209
- }
24210
- }
24211
- }
24212
- });
24213
- on('transitionEnd', () => {
24214
- if (swiper.params.lazy.enabled && !swiper.params.lazy.loadOnTransitionStart) {
24215
- if (swiper.params.lazy.checkInView) {
24216
- checkInViewOnLoad();
24217
- } else {
24218
- load();
24219
- }
24220
- }
24221
- });
24222
- on('slideChange', () => {
24223
- const {
24224
- lazy,
24225
- cssMode,
24226
- watchSlidesProgress,
24227
- touchReleaseOnEdges,
24228
- resistanceRatio
24229
- } = swiper.params;
24230
-
24231
- if (lazy.enabled && (cssMode || watchSlidesProgress && (touchReleaseOnEdges || resistanceRatio === 0))) {
24232
- load();
24233
- }
24234
- });
24235
- on('destroy', () => {
24236
- if (!swiper.$el) return;
24237
- swiper.$el.find(`.${swiper.params.lazy.loadingClass}`).removeClass(swiper.params.lazy.loadingClass);
24238
- });
24239
- Object.assign(swiper.lazy, {
24240
- load,
24241
- loadInSlide
24242
- });
24243
- }
24244
-
24245
- /* eslint no-bitwise: ["error", { "allow": [">>"] }] */
24246
- function Controller(_ref) {
24247
- let {
24248
- swiper,
24249
- extendParams,
24250
- on
24251
- } = _ref;
24252
- extendParams({
24253
- controller: {
24254
- control: undefined,
24255
- inverse: false,
24256
- by: 'slide' // or 'container'
24257
-
24258
- }
24259
- });
24260
- swiper.controller = {
24261
- control: undefined
24262
- };
24263
-
24264
- function LinearSpline(x, y) {
24265
- const binarySearch = function search() {
24266
- let maxIndex;
24267
- let minIndex;
24268
- let guess;
24269
- return (array, val) => {
24270
- minIndex = -1;
24271
- maxIndex = array.length;
24272
-
24273
- while (maxIndex - minIndex > 1) {
24274
- guess = maxIndex + minIndex >> 1;
24275
-
24276
- if (array[guess] <= val) {
24277
- minIndex = guess;
24278
- } else {
24279
- maxIndex = guess;
24280
- }
24281
- }
24282
-
24283
- return maxIndex;
24284
- };
24285
- }();
24286
-
24287
- this.x = x;
24288
- this.y = y;
24289
- this.lastIndex = x.length - 1; // Given an x value (x2), return the expected y2 value:
24290
- // (x1,y1) is the known point before given value,
24291
- // (x3,y3) is the known point after given value.
24292
-
24293
- let i1;
24294
- let i3;
24295
-
24296
- this.interpolate = function interpolate(x2) {
24297
- if (!x2) return 0; // Get the indexes of x1 and x3 (the array indexes before and after given x2):
24298
-
24299
- i3 = binarySearch(this.x, x2);
24300
- i1 = i3 - 1; // We have our indexes i1 & i3, so we can calculate already:
24301
- // y2 := ((x2−x1) × (y3−y1)) ÷ (x3−x1) + y1
24302
-
24303
- return (x2 - this.x[i1]) * (this.y[i3] - this.y[i1]) / (this.x[i3] - this.x[i1]) + this.y[i1];
24304
- };
24305
-
24306
- return this;
24307
- } // xxx: for now i will just save one spline function to to
24308
-
24309
-
24310
- function getInterpolateFunction(c) {
24311
- if (!swiper.controller.spline) {
24312
- swiper.controller.spline = swiper.params.loop ? new LinearSpline(swiper.slidesGrid, c.slidesGrid) : new LinearSpline(swiper.snapGrid, c.snapGrid);
24313
- }
24314
- }
24315
-
24316
- function setTranslate(_t, byController) {
24317
- const controlled = swiper.controller.control;
24318
- let multiplier;
24319
- let controlledTranslate;
24320
- const Swiper = swiper.constructor;
24321
-
24322
- function setControlledTranslate(c) {
24323
- // this will create an Interpolate function based on the snapGrids
24324
- // x is the Grid of the scrolled scroller and y will be the controlled scroller
24325
- // it makes sense to create this only once and recall it for the interpolation
24326
- // the function does a lot of value caching for performance
24327
- const translate = swiper.rtlTranslate ? -swiper.translate : swiper.translate;
24328
-
24329
- if (swiper.params.controller.by === 'slide') {
24330
- getInterpolateFunction(c); // i am not sure why the values have to be multiplicated this way, tried to invert the snapGrid
24331
- // but it did not work out
24332
-
24333
- controlledTranslate = -swiper.controller.spline.interpolate(-translate);
24334
- }
24335
-
24336
- if (!controlledTranslate || swiper.params.controller.by === 'container') {
24337
- multiplier = (c.maxTranslate() - c.minTranslate()) / (swiper.maxTranslate() - swiper.minTranslate());
24338
- controlledTranslate = (translate - swiper.minTranslate()) * multiplier + c.minTranslate();
24339
- }
24340
-
24341
- if (swiper.params.controller.inverse) {
24342
- controlledTranslate = c.maxTranslate() - controlledTranslate;
24343
- }
24344
-
24345
- c.updateProgress(controlledTranslate);
24346
- c.setTranslate(controlledTranslate, swiper);
24347
- c.updateActiveIndex();
24348
- c.updateSlidesClasses();
24349
- }
24350
-
24351
- if (Array.isArray(controlled)) {
24352
- for (let i = 0; i < controlled.length; i += 1) {
24353
- if (controlled[i] !== byController && controlled[i] instanceof Swiper) {
24354
- setControlledTranslate(controlled[i]);
24355
- }
24356
- }
24357
- } else if (controlled instanceof Swiper && byController !== controlled) {
24358
- setControlledTranslate(controlled);
24359
- }
24360
- }
24361
-
24362
- function setTransition(duration, byController) {
24363
- const Swiper = swiper.constructor;
24364
- const controlled = swiper.controller.control;
24365
- let i;
24366
-
24367
- function setControlledTransition(c) {
24368
- c.setTransition(duration, swiper);
24369
-
24370
- if (duration !== 0) {
24371
- c.transitionStart();
24372
-
24373
- if (c.params.autoHeight) {
24374
- core.nextTick(() => {
24375
- c.updateAutoHeight();
24376
- });
24377
- }
24378
-
24379
- c.$wrapperEl.transitionEnd(() => {
24380
- if (!controlled) return;
24381
-
24382
- if (c.params.loop && swiper.params.controller.by === 'slide') {
24383
- c.loopFix();
24384
- }
24385
-
24386
- c.transitionEnd();
24387
- });
24388
- }
24389
- }
24390
-
24391
- if (Array.isArray(controlled)) {
24392
- for (i = 0; i < controlled.length; i += 1) {
24393
- if (controlled[i] !== byController && controlled[i] instanceof Swiper) {
24394
- setControlledTransition(controlled[i]);
24395
- }
24396
- }
24397
- } else if (controlled instanceof Swiper && byController !== controlled) {
24398
- setControlledTransition(controlled);
24399
- }
24400
- }
24401
-
24402
- function removeSpline() {
24403
- if (!swiper.controller.control) return;
24404
-
24405
- if (swiper.controller.spline) {
24406
- swiper.controller.spline = undefined;
24407
- delete swiper.controller.spline;
24408
- }
24409
- }
24410
-
24411
- on('beforeInit', () => {
24412
- swiper.controller.control = swiper.params.controller.control;
24413
- });
24414
- on('update', () => {
24415
- removeSpline();
24416
- });
24417
- on('resize', () => {
24418
- removeSpline();
24419
- });
24420
- on('observerUpdate', () => {
24421
- removeSpline();
24422
- });
24423
- on('setTranslate', (_s, translate, byController) => {
24424
- if (!swiper.controller.control) return;
24425
- swiper.controller.setTranslate(translate, byController);
24426
- });
24427
- on('setTransition', (_s, duration, byController) => {
24428
- if (!swiper.controller.control) return;
24429
- swiper.controller.setTransition(duration, byController);
24430
- });
24431
- Object.assign(swiper.controller, {
24432
- setTranslate,
24433
- setTransition
24434
- });
24435
- }
24436
-
24437
- /* eslint no-underscore-dangle: "off" */
24438
- function Autoplay(_ref) {
24439
- let {
24440
- swiper,
24441
- extendParams,
24442
- on,
24443
- emit
24444
- } = _ref;
24445
- let timeout;
24446
- swiper.autoplay = {
24447
- running: false,
24448
- paused: false
24449
- };
24450
- extendParams({
24451
- autoplay: {
24452
- enabled: false,
24453
- delay: 3000,
24454
- waitForTransition: true,
24455
- disableOnInteraction: true,
24456
- stopOnLastSlide: false,
24457
- reverseDirection: false,
24458
- pauseOnMouseEnter: false
24459
- }
24460
- });
24461
-
24462
- function run() {
24463
- if (!swiper.size) {
24464
- swiper.autoplay.running = false;
24465
- swiper.autoplay.paused = false;
24466
- return;
24467
- }
24468
-
24469
- const $activeSlideEl = swiper.slides.eq(swiper.activeIndex);
24470
- let delay = swiper.params.autoplay.delay;
24471
-
24472
- if ($activeSlideEl.attr('data-swiper-autoplay')) {
24473
- delay = $activeSlideEl.attr('data-swiper-autoplay') || swiper.params.autoplay.delay;
24474
- }
24475
-
24476
- clearTimeout(timeout);
24477
- timeout = core.nextTick(() => {
24478
- let autoplayResult;
24479
-
24480
- if (swiper.params.autoplay.reverseDirection) {
24481
- if (swiper.params.loop) {
24482
- swiper.loopFix();
24483
- autoplayResult = swiper.slidePrev(swiper.params.speed, true, true);
24484
- emit('autoplay');
24485
- } else if (!swiper.isBeginning) {
24486
- autoplayResult = swiper.slidePrev(swiper.params.speed, true, true);
24487
- emit('autoplay');
24488
- } else if (!swiper.params.autoplay.stopOnLastSlide) {
24489
- autoplayResult = swiper.slideTo(swiper.slides.length - 1, swiper.params.speed, true, true);
24490
- emit('autoplay');
24491
- } else {
24492
- stop();
24493
- }
24494
- } else if (swiper.params.loop) {
24495
- swiper.loopFix();
24496
- autoplayResult = swiper.slideNext(swiper.params.speed, true, true);
24497
- emit('autoplay');
24498
- } else if (!swiper.isEnd) {
24499
- autoplayResult = swiper.slideNext(swiper.params.speed, true, true);
24500
- emit('autoplay');
24501
- } else if (!swiper.params.autoplay.stopOnLastSlide) {
24502
- autoplayResult = swiper.slideTo(0, swiper.params.speed, true, true);
24503
- emit('autoplay');
24504
- } else {
24505
- stop();
24506
- }
24507
-
24508
- if (swiper.params.cssMode && swiper.autoplay.running) run();else if (autoplayResult === false) {
24509
- run();
24510
- }
24511
- }, delay);
24512
- }
24513
-
24514
- function start() {
24515
- if (typeof timeout !== 'undefined') return false;
24516
- if (swiper.autoplay.running) return false;
24517
- swiper.autoplay.running = true;
24518
- emit('autoplayStart');
24519
- run();
24520
- return true;
24521
- }
24522
-
24523
- function stop() {
24524
- if (!swiper.autoplay.running) return false;
24525
- if (typeof timeout === 'undefined') return false;
24526
-
24527
- if (timeout) {
24528
- clearTimeout(timeout);
24529
- timeout = undefined;
24530
- }
24531
-
24532
- swiper.autoplay.running = false;
24533
- emit('autoplayStop');
24534
- return true;
24535
- }
24536
-
24537
- function pause(speed) {
24538
- if (!swiper.autoplay.running) return;
24539
- if (swiper.autoplay.paused) return;
24540
- if (timeout) clearTimeout(timeout);
24541
- swiper.autoplay.paused = true;
24542
-
24543
- if (speed === 0 || !swiper.params.autoplay.waitForTransition) {
24544
- swiper.autoplay.paused = false;
24545
- run();
24546
- } else {
24547
- ['transitionend', 'webkitTransitionEnd'].forEach(event => {
24548
- swiper.$wrapperEl[0].addEventListener(event, onTransitionEnd);
24549
- });
24550
- }
24551
- }
24552
-
24553
- function onVisibilityChange() {
24554
- const document = core.getDocument();
24555
-
24556
- if (document.visibilityState === 'hidden' && swiper.autoplay.running) {
24557
- pause();
24558
- }
24559
-
24560
- if (document.visibilityState === 'visible' && swiper.autoplay.paused) {
24561
- run();
24562
- swiper.autoplay.paused = false;
24563
- }
24564
- }
24565
-
24566
- function onTransitionEnd(e) {
24567
- if (!swiper || swiper.destroyed || !swiper.$wrapperEl) return;
24568
- if (e.target !== swiper.$wrapperEl[0]) return;
24569
- ['transitionend', 'webkitTransitionEnd'].forEach(event => {
24570
- swiper.$wrapperEl[0].removeEventListener(event, onTransitionEnd);
24571
- });
24572
- swiper.autoplay.paused = false;
24573
-
24574
- if (!swiper.autoplay.running) {
24575
- stop();
24576
- } else {
24577
- run();
24578
- }
24579
- }
24580
-
24581
- function onMouseEnter() {
24582
- if (swiper.params.autoplay.disableOnInteraction) {
24583
- stop();
24584
- } else {
24585
- emit('autoplayPause');
24586
- pause();
24587
- }
24588
-
24589
- ['transitionend', 'webkitTransitionEnd'].forEach(event => {
24590
- swiper.$wrapperEl[0].removeEventListener(event, onTransitionEnd);
24591
- });
24592
- }
24593
-
24594
- function onMouseLeave() {
24595
- if (swiper.params.autoplay.disableOnInteraction) {
24596
- return;
24597
- }
24598
-
24599
- swiper.autoplay.paused = false;
24600
- emit('autoplayResume');
24601
- run();
24602
- }
24603
-
24604
- function attachMouseEvents() {
24605
- if (swiper.params.autoplay.pauseOnMouseEnter) {
24606
- swiper.$el.on('mouseenter', onMouseEnter);
24607
- swiper.$el.on('mouseleave', onMouseLeave);
24608
- }
24609
- }
24610
-
24611
- function detachMouseEvents() {
24612
- swiper.$el.off('mouseenter', onMouseEnter);
24613
- swiper.$el.off('mouseleave', onMouseLeave);
24614
- }
24615
-
24616
- on('init', () => {
24617
- if (swiper.params.autoplay.enabled) {
24618
- start();
24619
- const document = core.getDocument();
24620
- document.addEventListener('visibilitychange', onVisibilityChange);
24621
- attachMouseEvents();
24622
- }
24623
- });
24624
- on('beforeTransitionStart', (_s, speed, internal) => {
24625
- if (swiper.autoplay.running) {
24626
- if (internal || !swiper.params.autoplay.disableOnInteraction) {
24627
- swiper.autoplay.pause(speed);
24628
- } else {
24629
- stop();
24630
- }
24631
- }
24632
- });
24633
- on('sliderFirstMove', () => {
24634
- if (swiper.autoplay.running) {
24635
- if (swiper.params.autoplay.disableOnInteraction) {
24636
- stop();
24637
- } else {
24638
- pause();
24639
- }
24640
- }
24641
- });
24642
- on('touchEnd', () => {
24643
- if (swiper.params.cssMode && swiper.autoplay.paused && !swiper.params.autoplay.disableOnInteraction) {
24644
- run();
24645
- }
24646
- });
24647
- on('destroy', () => {
24648
- detachMouseEvents();
24649
-
24650
- if (swiper.autoplay.running) {
24651
- stop();
24652
- }
24653
-
24654
- const document = core.getDocument();
24655
- document.removeEventListener('visibilitychange', onVisibilityChange);
24656
- });
24657
- Object.assign(swiper.autoplay, {
24658
- pause,
24659
- run,
24660
- start,
24661
- stop
24662
- });
24663
- }
24664
-
24665
- function Thumb(_ref) {
24666
- let {
24667
- swiper,
24668
- extendParams,
24669
- on
24670
- } = _ref;
24671
- extendParams({
24672
- thumbs: {
24673
- swiper: null,
24674
- multipleActiveThumbs: true,
24675
- autoScrollOffset: 0,
24676
- slideThumbActiveClass: 'swiper-slide-thumb-active',
24677
- thumbsContainerClass: 'swiper-thumbs'
24678
- }
24679
- });
24680
- let initialized = false;
24681
- let swiperCreated = false;
24682
- swiper.thumbs = {
24683
- swiper: null
24684
- };
24685
-
24686
- function onThumbClick() {
24687
- const thumbsSwiper = swiper.thumbs.swiper;
24688
- if (!thumbsSwiper || thumbsSwiper.destroyed) return;
24689
- const clickedIndex = thumbsSwiper.clickedIndex;
24690
- const clickedSlide = thumbsSwiper.clickedSlide;
24691
- if (clickedSlide && core.$(clickedSlide).hasClass(swiper.params.thumbs.slideThumbActiveClass)) return;
24692
- if (typeof clickedIndex === 'undefined' || clickedIndex === null) return;
24693
- let slideToIndex;
24694
-
24695
- if (thumbsSwiper.params.loop) {
24696
- slideToIndex = parseInt(core.$(thumbsSwiper.clickedSlide).attr('data-swiper-slide-index'), 10);
24697
- } else {
24698
- slideToIndex = clickedIndex;
24699
- }
24700
-
24701
- if (swiper.params.loop) {
24702
- let currentIndex = swiper.activeIndex;
24703
-
24704
- if (swiper.slides.eq(currentIndex).hasClass(swiper.params.slideDuplicateClass)) {
24705
- swiper.loopFix(); // eslint-disable-next-line
24706
-
24707
- swiper._clientLeft = swiper.$wrapperEl[0].clientLeft;
24708
- currentIndex = swiper.activeIndex;
24709
- }
24710
-
24711
- const prevIndex = swiper.slides.eq(currentIndex).prevAll(`[data-swiper-slide-index="${slideToIndex}"]`).eq(0).index();
24712
- const nextIndex = swiper.slides.eq(currentIndex).nextAll(`[data-swiper-slide-index="${slideToIndex}"]`).eq(0).index();
24713
- if (typeof prevIndex === 'undefined') slideToIndex = nextIndex;else if (typeof nextIndex === 'undefined') slideToIndex = prevIndex;else if (nextIndex - currentIndex < currentIndex - prevIndex) slideToIndex = nextIndex;else slideToIndex = prevIndex;
24714
- }
24715
-
24716
- swiper.slideTo(slideToIndex);
24717
- }
24718
-
24719
- function init() {
24720
- const {
24721
- thumbs: thumbsParams
24722
- } = swiper.params;
24723
- if (initialized) return false;
24724
- initialized = true;
24725
- const SwiperClass = swiper.constructor;
24726
-
24727
- if (thumbsParams.swiper instanceof SwiperClass) {
24728
- swiper.thumbs.swiper = thumbsParams.swiper;
24729
- Object.assign(swiper.thumbs.swiper.originalParams, {
24730
- watchSlidesProgress: true,
24731
- slideToClickedSlide: false
24732
- });
24733
- Object.assign(swiper.thumbs.swiper.params, {
24734
- watchSlidesProgress: true,
24735
- slideToClickedSlide: false
24736
- });
24737
- } else if (core.isObject(thumbsParams.swiper)) {
24738
- const thumbsSwiperParams = Object.assign({}, thumbsParams.swiper);
24739
- Object.assign(thumbsSwiperParams, {
24740
- watchSlidesProgress: true,
24741
- slideToClickedSlide: false
24742
- });
24743
- swiper.thumbs.swiper = new SwiperClass(thumbsSwiperParams);
24744
- swiperCreated = true;
24745
- }
24746
-
24747
- swiper.thumbs.swiper.$el.addClass(swiper.params.thumbs.thumbsContainerClass);
24748
- swiper.thumbs.swiper.on('tap', onThumbClick);
24749
- return true;
24750
- }
24751
-
24752
- function update(initial) {
24753
- const thumbsSwiper = swiper.thumbs.swiper;
24754
- if (!thumbsSwiper || thumbsSwiper.destroyed) return;
24755
- const slidesPerView = thumbsSwiper.params.slidesPerView === 'auto' ? thumbsSwiper.slidesPerViewDynamic() : thumbsSwiper.params.slidesPerView; // Activate thumbs
24756
-
24757
- let thumbsToActivate = 1;
24758
- const thumbActiveClass = swiper.params.thumbs.slideThumbActiveClass;
24759
-
24760
- if (swiper.params.slidesPerView > 1 && !swiper.params.centeredSlides) {
24761
- thumbsToActivate = swiper.params.slidesPerView;
24762
- }
24763
-
24764
- if (!swiper.params.thumbs.multipleActiveThumbs) {
24765
- thumbsToActivate = 1;
24766
- }
24767
-
24768
- thumbsToActivate = Math.floor(thumbsToActivate);
24769
- thumbsSwiper.slides.removeClass(thumbActiveClass);
24770
-
24771
- if (thumbsSwiper.params.loop || thumbsSwiper.params.virtual && thumbsSwiper.params.virtual.enabled) {
24772
- for (let i = 0; i < thumbsToActivate; i += 1) {
24773
- thumbsSwiper.$wrapperEl.children(`[data-swiper-slide-index="${swiper.realIndex + i}"]`).addClass(thumbActiveClass);
24774
- }
24775
- } else {
24776
- for (let i = 0; i < thumbsToActivate; i += 1) {
24777
- thumbsSwiper.slides.eq(swiper.realIndex + i).addClass(thumbActiveClass);
24778
- }
24779
- }
24780
-
24781
- const autoScrollOffset = swiper.params.thumbs.autoScrollOffset;
24782
- const useOffset = autoScrollOffset && !thumbsSwiper.params.loop;
24783
-
24784
- if (swiper.realIndex !== thumbsSwiper.realIndex || useOffset) {
24785
- let currentThumbsIndex = thumbsSwiper.activeIndex;
24786
- let newThumbsIndex;
24787
- let direction;
24788
-
24789
- if (thumbsSwiper.params.loop) {
24790
- if (thumbsSwiper.slides.eq(currentThumbsIndex).hasClass(thumbsSwiper.params.slideDuplicateClass)) {
24791
- thumbsSwiper.loopFix(); // eslint-disable-next-line
24792
-
24793
- thumbsSwiper._clientLeft = thumbsSwiper.$wrapperEl[0].clientLeft;
24794
- currentThumbsIndex = thumbsSwiper.activeIndex;
24795
- } // Find actual thumbs index to slide to
24796
-
24797
-
24798
- const prevThumbsIndex = thumbsSwiper.slides.eq(currentThumbsIndex).prevAll(`[data-swiper-slide-index="${swiper.realIndex}"]`).eq(0).index();
24799
- const nextThumbsIndex = thumbsSwiper.slides.eq(currentThumbsIndex).nextAll(`[data-swiper-slide-index="${swiper.realIndex}"]`).eq(0).index();
24800
-
24801
- if (typeof prevThumbsIndex === 'undefined') {
24802
- newThumbsIndex = nextThumbsIndex;
24803
- } else if (typeof nextThumbsIndex === 'undefined') {
24804
- newThumbsIndex = prevThumbsIndex;
24805
- } else if (nextThumbsIndex - currentThumbsIndex === currentThumbsIndex - prevThumbsIndex) {
24806
- newThumbsIndex = thumbsSwiper.params.slidesPerGroup > 1 ? nextThumbsIndex : currentThumbsIndex;
24807
- } else if (nextThumbsIndex - currentThumbsIndex < currentThumbsIndex - prevThumbsIndex) {
24808
- newThumbsIndex = nextThumbsIndex;
24809
- } else {
24810
- newThumbsIndex = prevThumbsIndex;
24811
- }
24812
-
24813
- direction = swiper.activeIndex > swiper.previousIndex ? 'next' : 'prev';
24814
- } else {
24815
- newThumbsIndex = swiper.realIndex;
24816
- direction = newThumbsIndex > swiper.previousIndex ? 'next' : 'prev';
24817
- }
24818
-
24819
- if (useOffset) {
24820
- newThumbsIndex += direction === 'next' ? autoScrollOffset : -1 * autoScrollOffset;
24821
- }
24822
-
24823
- if (thumbsSwiper.visibleSlidesIndexes && thumbsSwiper.visibleSlidesIndexes.indexOf(newThumbsIndex) < 0) {
24824
- if (thumbsSwiper.params.centeredSlides) {
24825
- if (newThumbsIndex > currentThumbsIndex) {
24826
- newThumbsIndex = newThumbsIndex - Math.floor(slidesPerView / 2) + 1;
24827
- } else {
24828
- newThumbsIndex = newThumbsIndex + Math.floor(slidesPerView / 2) - 1;
24829
- }
24830
- }
24831
-
24832
- thumbsSwiper.slideTo(newThumbsIndex, initial ? 0 : undefined);
24833
- }
24834
- }
24835
- }
24836
-
24837
- on('beforeInit', () => {
24838
- const {
24839
- thumbs
24840
- } = swiper.params;
24841
- if (!thumbs || !thumbs.swiper) return;
24842
- init();
24843
- update(true);
24844
- });
24845
- on('slideChange update resize observerUpdate', () => {
24846
- update();
24847
- });
24848
- on('setTransition', (_s, duration) => {
24849
- const thumbsSwiper = swiper.thumbs.swiper;
24850
- if (!thumbsSwiper || thumbsSwiper.destroyed) return;
24851
- thumbsSwiper.setTransition(duration);
24852
- });
24853
- on('beforeDestroy', () => {
24854
- const thumbsSwiper = swiper.thumbs.swiper;
24855
- if (!thumbsSwiper || thumbsSwiper.destroyed) return;
24856
-
24857
- if (swiperCreated) {
24858
- thumbsSwiper.destroy();
24859
- }
24860
- });
24861
- Object.assign(swiper.thumbs, {
24862
- init,
24863
- update
24864
- });
24865
- }
24866
-
24867
- const ArrowLeftIcon = `<!-- Generated by IcoMoon.io -->
24868
- <svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
24869
- <title>keyboard_arrow_left</title>
24870
- <path d="M20.563 22.104l-1.875 1.875-8-8 8-8 1.875 1.875-6.125 6.125z"></path>
24871
- </svg>
24872
- `;
24873
-
24874
- const sallaSliderCss = "@font-face{font-family:\"swiper-icons\";src:url(\"data:application/font-woff;charset=utf-8;base64, d09GRgABAAAAAAZgABAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAAGRAAAABoAAAAci6qHkUdERUYAAAWgAAAAIwAAACQAYABXR1BPUwAABhQAAAAuAAAANuAY7+xHU1VCAAAFxAAAAFAAAABm2fPczU9TLzIAAAHcAAAASgAAAGBP9V5RY21hcAAAAkQAAACIAAABYt6F0cBjdnQgAAACzAAAAAQAAAAEABEBRGdhc3AAAAWYAAAACAAAAAj//wADZ2x5ZgAAAywAAADMAAAD2MHtryVoZWFkAAABbAAAADAAAAA2E2+eoWhoZWEAAAGcAAAAHwAAACQC9gDzaG10eAAAAigAAAAZAAAArgJkABFsb2NhAAAC0AAAAFoAAABaFQAUGG1heHAAAAG8AAAAHwAAACAAcABAbmFtZQAAA/gAAAE5AAACXvFdBwlwb3N0AAAFNAAAAGIAAACE5s74hXjaY2BkYGAAYpf5Hu/j+W2+MnAzMYDAzaX6QjD6/4//Bxj5GA8AuRwMYGkAPywL13jaY2BkYGA88P8Agx4j+/8fQDYfA1AEBWgDAIB2BOoAeNpjYGRgYNBh4GdgYgABEMnIABJzYNADCQAACWgAsQB42mNgYfzCOIGBlYGB0YcxjYGBwR1Kf2WQZGhhYGBiYGVmgAFGBiQQkOaawtDAoMBQxXjg/wEGPcYDDA4wNUA2CCgwsAAAO4EL6gAAeNpj2M0gyAACqxgGNWBkZ2D4/wMA+xkDdgAAAHjaY2BgYGaAYBkGRgYQiAHyGMF8FgYHIM3DwMHABGQrMOgyWDLEM1T9/w8UBfEMgLzE////P/5//f/V/xv+r4eaAAeMbAxwIUYmIMHEgKYAYjUcsDAwsLKxc3BycfPw8jEQA/gZBASFhEVExcQlJKWkZWTl5BUUlZRVVNXUNTQZBgMAAMR+E+gAEQFEAAAAKgAqACoANAA+AEgAUgBcAGYAcAB6AIQAjgCYAKIArAC2AMAAygDUAN4A6ADyAPwBBgEQARoBJAEuATgBQgFMAVYBYAFqAXQBfgGIAZIBnAGmAbIBzgHsAAB42u2NMQ6CUAyGW568x9AneYYgm4MJbhKFaExIOAVX8ApewSt4Bic4AfeAid3VOBixDxfPYEza5O+Xfi04YADggiUIULCuEJK8VhO4bSvpdnktHI5QCYtdi2sl8ZnXaHlqUrNKzdKcT8cjlq+rwZSvIVczNiezsfnP/uznmfPFBNODM2K7MTQ45YEAZqGP81AmGGcF3iPqOop0r1SPTaTbVkfUe4HXj97wYE+yNwWYxwWu4v1ugWHgo3S1XdZEVqWM7ET0cfnLGxWfkgR42o2PvWrDMBSFj/IHLaF0zKjRgdiVMwScNRAoWUoH78Y2icB/yIY09An6AH2Bdu/UB+yxopYshQiEvnvu0dURgDt8QeC8PDw7Fpji3fEA4z/PEJ6YOB5hKh4dj3EvXhxPqH/SKUY3rJ7srZ4FZnh1PMAtPhwP6fl2PMJMPDgeQ4rY8YT6Gzao0eAEA409DuggmTnFnOcSCiEiLMgxCiTI6Cq5DZUd3Qmp10vO0LaLTd2cjN4fOumlc7lUYbSQcZFkutRG7g6JKZKy0RmdLY680CDnEJ+UMkpFFe1RN7nxdVpXrC4aTtnaurOnYercZg2YVmLN/d/gczfEimrE/fs/bOuq29Zmn8tloORaXgZgGa78yO9/cnXm2BpaGvq25Dv9S4E9+5SIc9PqupJKhYFSSl47+Qcr1mYNAAAAeNptw0cKwkAAAMDZJA8Q7OUJvkLsPfZ6zFVERPy8qHh2YER+3i/BP83vIBLLySsoKimrqKqpa2hp6+jq6RsYGhmbmJqZSy0sraxtbO3sHRydnEMU4uR6yx7JJXveP7WrDycAAAAAAAH//wACeNpjYGRgYOABYhkgZgJCZgZNBkYGLQZtIJsFLMYAAAw3ALgAeNolizEKgDAQBCchRbC2sFER0YD6qVQiBCv/H9ezGI6Z5XBAw8CBK/m5iQQVauVbXLnOrMZv2oLdKFa8Pjuru2hJzGabmOSLzNMzvutpB3N42mNgZGBg4GKQYzBhYMxJLMlj4GBgAYow/P/PAJJhLM6sSoWKfWCAAwDAjgbRAAB42mNgYGBkAIIbCZo5IPrmUn0hGA0AO8EFTQAA\") format(\"woff\");font-weight:400;font-style:normal}:root{--swiper-theme-color:#007aff}.swiper{margin-left:auto;margin-right:auto;position:relative;overflow:hidden;list-style:none;padding:0;z-index:1}.swiper-vertical>.swiper-wrapper{-ms-flex-direction:column;flex-direction:column}.swiper-wrapper{position:relative;width:100%;height:100%;z-index:1;display:-ms-flexbox;display:flex;-webkit-transition-property:-webkit-transform;transition-property:-webkit-transform;transition-property:transform;transition-property:transform, -webkit-transform;-webkit-box-sizing:content-box;box-sizing:content-box}.swiper-android .swiper-slide,.swiper-wrapper{-webkit-transform:translate3d(0px, 0, 0);transform:translate3d(0px, 0, 0)}.swiper-pointer-events{-ms-touch-action:pan-y;touch-action:pan-y}.swiper-pointer-events.swiper-vertical{-ms-touch-action:pan-x;touch-action:pan-x}.swiper-slide{-ms-flex-negative:0;flex-shrink:0;width:100%;height:100%;position:relative;-webkit-transition-property:-webkit-transform;transition-property:-webkit-transform;transition-property:transform;transition-property:transform, -webkit-transform}.swiper-slide-invisible-blank{visibility:hidden}.swiper-autoheight,.swiper-autoheight .swiper-slide{height:auto}.swiper-autoheight .swiper-wrapper{-ms-flex-align:start;align-items:flex-start;-webkit-transition-property:height, -webkit-transform;transition-property:height, -webkit-transform;transition-property:transform, height;transition-property:transform, height, -webkit-transform}.swiper-backface-hidden .swiper-slide{-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-backface-visibility:hidden;backface-visibility:hidden}.swiper-3d,.swiper-3d.swiper-css-mode .swiper-wrapper{-webkit-perspective:1200px;perspective:1200px}.swiper-3d .swiper-wrapper,.swiper-3d .swiper-slide,.swiper-3d .swiper-slide-shadow,.swiper-3d .swiper-slide-shadow-left,.swiper-3d .swiper-slide-shadow-right,.swiper-3d .swiper-slide-shadow-top,.swiper-3d .swiper-slide-shadow-bottom,.swiper-3d .swiper-cube-shadow{-webkit-transform-style:preserve-3d;transform-style:preserve-3d}.swiper-3d .swiper-slide-shadow,.swiper-3d .swiper-slide-shadow-left,.swiper-3d .swiper-slide-shadow-right,.swiper-3d .swiper-slide-shadow-top,.swiper-3d .swiper-slide-shadow-bottom{position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;z-index:10}.swiper-3d .swiper-slide-shadow{background:rgba(0, 0, 0, 0.15)}.swiper-3d .swiper-slide-shadow-left{background-image:-webkit-gradient(linear, right top, left top, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0)));background-image:linear-gradient(to left, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0))}.swiper-3d .swiper-slide-shadow-right{background-image:-webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0)));background-image:linear-gradient(to right, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0))}.swiper-3d .swiper-slide-shadow-top{background-image:-webkit-gradient(linear, left bottom, left top, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0)));background-image:linear-gradient(to top, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0))}.swiper-3d .swiper-slide-shadow-bottom{background-image:-webkit-gradient(linear, left top, left bottom, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0)));background-image:linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0))}.swiper-css-mode>.swiper-wrapper{overflow:auto;scrollbar-width:none;-ms-overflow-style:none;}.swiper-css-mode>.swiper-wrapper::-webkit-scrollbar{display:none}.swiper-css-mode>.swiper-wrapper>.swiper-slide{scroll-snap-align:start start}.swiper-horizontal.swiper-css-mode>.swiper-wrapper{-webkit-scroll-snap-type:x mandatory;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory}.swiper-vertical.swiper-css-mode>.swiper-wrapper{-webkit-scroll-snap-type:y mandatory;-ms-scroll-snap-type:y mandatory;scroll-snap-type:y mandatory}.swiper-centered>.swiper-wrapper::before{content:\"\";-ms-flex-negative:0;flex-shrink:0;-ms-flex-order:9999;order:9999}.swiper-centered.swiper-horizontal>.swiper-wrapper>.swiper-slide:first-child{-webkit-margin-start:var(--swiper-centered-offset-before);margin-inline-start:var(--swiper-centered-offset-before)}.swiper-centered.swiper-horizontal>.swiper-wrapper::before{height:100%;width:var(--swiper-centered-offset-after)}.swiper-centered.swiper-vertical>.swiper-wrapper>.swiper-slide:first-child{-webkit-margin-before:var(--swiper-centered-offset-before);margin-block-start:var(--swiper-centered-offset-before)}.swiper-centered.swiper-vertical>.swiper-wrapper::before{width:100%;height:var(--swiper-centered-offset-after)}.swiper-centered>.swiper-wrapper>.swiper-slide{scroll-snap-align:center center}";
24875
-
24876
- const SallaSwiper = class {
24877
- constructor(hostRef) {
24878
- index.registerInstance(this, hostRef);
24879
- this.slideChange = index.createEvent(this, "slideChange", 7);
24880
- this.reachBeginning = index.createEvent(this, "reachBeginning", 7);
24881
- this.reachEnd = index.createEvent(this, "reachEnd", 7);
24882
- this.slideChangeTransitionEnd = index.createEvent(this, "slideChangeTransitionEnd", 7);
24883
- this.slideChangeTransitionStart = index.createEvent(this, "slideChangeTransitionStart", 7);
24884
- this.slideNextTransitionEnd = index.createEvent(this, "slideNextTransitionEnd", 7);
24885
- this.slideNextTransitionStart = index.createEvent(this, "slideNextTransitionStart", 7);
24886
- this.slidePrevTransitionEnd = index.createEvent(this, "slidePrevTransitionEnd", 7);
24887
- this.slidePrevTransitionStart = index.createEvent(this, "slidePrevTransitionStart", 7);
24888
- this.sliderMove = index.createEvent(this, "sliderMove", 7);
24889
- this.touchSliderEnd = index.createEvent(this, "touchSliderEnd", 7);
24890
- this.touchSliderMove = index.createEvent(this, "touchSliderMove", 7);
24891
- this.touchSliderStart = index.createEvent(this, "touchSliderStart", 7);
24892
- this.sliderTransitionEnd = index.createEvent(this, "sliderTransitionEnd", 7);
24893
- this.sliderTransitionStart = index.createEvent(this, "sliderTransitionStart", 7);
24894
- /**
24895
- * Show/hide arrows
24896
- */
24897
- this.showControls = true;
24898
- /**
24899
- * Show/hide thumbs slider arrows
24900
- */
24901
- this.showThumbsControls = true;
24902
- /**
24903
- * Set the type of the slider
24904
- * Default: ''
24905
- */
24906
- this.type = '';
24907
- /**
24908
- * Slider Configs refer to https://swiperjs.com/swiper-api#parameters and pass the entire config object
24909
- * @example
24910
- * let slider = document.querySelector('salla-slider');
24911
- * slider.sliderConfig = {
24912
- * slidesPerView: 1,
24913
- * spaceBetween : 30,
24914
- * lazy: true,
24915
- * }
24916
- *
24917
- */
24918
- this.sliderConfig = {};
24919
- /**
24920
- * Thumbs Slider Configs refer to https://swiperjs.com/swiper-api#parameters and pass the entire config object
24921
- * @example
24922
- * let slider = document.querySelector('salla-slider');
24923
- * slider.thumbsConfig = {
24924
- * slidesPerView: 1,
24925
- * spaceBetween : 30,
24926
- * lazy: true,
24927
- * }
24928
- *
24929
- */
24930
- this.thumbsConfig = {};
24931
- // States
24932
- this.currentIndex = undefined;
24933
- this.isEnd = false;
24934
- this.isBeginning = true;
24935
- this.isRTL = document.documentElement.dir === 'rtl';
24936
- }
24937
- // Methods
24938
- /**
24939
- * Run transition to the slide with index number equal to 'index' parameter for the duration equal to 'speed' parameter.
24940
- *
24941
- * @param {number} index - Index number of slide.
24942
- * @param {number} speed - Transition duration (in ms).
24943
- * @param {boolean} runCallbacks - Set it to false (by default it is true) and transition will not produce transition events.
24944
- * **/
24945
- async slideTo(index, speed, runCallbacks) {
24946
- this.slider.slideTo(index, speed, runCallbacks);
24947
- }
24948
- /**
24949
- * Run transition to the next slide.
24950
- *
24951
- * @param {number} speed - Transition duration (in ms).
24952
- * @param {boolean} runCallbacks - Set it to false (by default it is true) and transition will not produce transition events.
24953
- * **/
24954
- async slideNext(speed, runCallbacks) {
24955
- this.slider.slideNext(speed, runCallbacks);
23576
+ /**
23577
+ * Run transition to the next slide.
23578
+ *
23579
+ * @param {number} speed - Transition duration (in ms).
23580
+ * @param {boolean} runCallbacks - Set it to false (by default it is true) and transition will not produce transition events.
23581
+ * **/
23582
+ async slideNext(speed, runCallbacks) {
23583
+ var _a;
23584
+ (_a = this.slider) === null || _a === void 0 ? void 0 : _a.slideNext(speed, runCallbacks);
24956
23585
  }
24957
23586
  /**
24958
23587
  * Run transition to the previous slide.
@@ -24961,7 +23590,8 @@ const SallaSwiper = class {
24961
23590
  * @param {boolean} runCallbacks - Set it to false (by default it is true) and transition will not produce transition events.
24962
23591
  * **/
24963
23592
  async slidePrev(speed, runCallbacks) {
24964
- this.slider.slidePrev(speed, runCallbacks);
23593
+ var _a;
23594
+ (_a = this.slider) === null || _a === void 0 ? void 0 : _a.slidePrev(speed, runCallbacks);
24965
23595
  }
24966
23596
  /**
24967
23597
  * Does the same as .slideTo but for the case when used with enabled loop. So this method will slide to slides with realIndex matching to passed index
@@ -25008,7 +23638,7 @@ const SallaSwiper = class {
25008
23638
  this.slider.slideToClosest(speed, runCallbacks);
25009
23639
  }
25010
23640
  /**
25011
- * You should call it after you add/remove slides manually, or after you hide/show it, or do any custom DOM modifications with Swiper This method also includes subcall of the following methods which you can use separately:
23641
+ * You should call it after you add/remove slides manually, or after you hide/show it, or do any custom DOM modifications with Swiper This method also includes subcall of the following methods which you can use separately:
25012
23642
  * **/
25013
23643
  async update() {
25014
23644
  this.slider.update();
@@ -25038,102 +23668,157 @@ const SallaSwiper = class {
25038
23668
  async updateSlidesClasses() {
25039
23669
  this.slider.updateSlidesClasses();
25040
23670
  }
25041
- componentDidLoad() {
25042
- let itemsSlot = this.sliderWrapper.querySelector('div[slot="items"]');
25043
- !!itemsSlot ? itemsSlot.replaceWith(...itemsSlot.children) : null;
25044
- if (this.type == 'thumbs') {
25045
- let thumbsSlot = this.thumbsSliderWrapper.querySelector('div[slot="thumbs"]');
25046
- !!thumbsSlot ? thumbsSlot.replaceWith(...thumbsSlot.children) : null;
25047
- }
25048
- this.initSlider();
23671
+ /**
23672
+ * Get slider slides
23673
+ * **/
23674
+ async getSlides() {
23675
+ var _a;
23676
+ return await ((_a = this.slider) === null || _a === void 0 ? void 0 : _a.slides);
25049
23677
  }
25050
- initSlider() {
25051
- core.Swiper.use([Controller, Navigation, Pagination, Lazy, Thumb, Parallax, Autoplay]);
25052
- for (const slide of this.sliderWrapper.children) {
25053
- //todo:: use `s-slider-slide`
25054
- slide.classList.add('swiper-slide');
25055
- }
25056
- if (this.type == 'carousel') {
25057
- this.slider = new core.Swiper(this.sliderContainer, {
25058
- loop: false,
25059
- speed: 300,
25060
- slidesPerView: 'auto',
25061
- spaceBetween: 10,
25062
- });
25063
- }
25064
- else if (this.type == 'thumbs') {
25065
- this.thumbsSlider = new core.Swiper(this.thumbsSliderContainer, Object.assign({}, this.thumbsConfig));
23678
+ componentWillLoad() {
23679
+ salla.lang.onLoaded(() => {
23680
+ this.displayAllTitle = salla.lang.get('blocks.home.display_all');
23681
+ });
23682
+ return new Promise((resolve, reject) => {
23683
+ // @ts-ignore
23684
+ if (typeof Swiper !== 'undefined') {
23685
+ return resolve(true);
23686
+ }
23687
+ if (document.getElementById('swiper-script')) {
23688
+ let interval = setInterval(() => {
23689
+ // @ts-ignore
23690
+ if (typeof Swiper !== 'undefined') {
23691
+ clearInterval(interval);
23692
+ resolve(true);
23693
+ }
23694
+ }, 5);
23695
+ }
23696
+ else {
23697
+ // ? There is an issue with stencil bundling it breaks the swiper import, so we need to import it manually by swiperjs rerendered file
23698
+ // ! IT'S NOT A GOOD SOLUTION, BUT IT WORKS, WE NEED TO FIND A BETTER SOLUTION
23699
+ this.swiperScript = document.createElement('script');
23700
+ this.swiperScript.onload = () => {
23701
+ resolve(true);
23702
+ salla.event.emit('swiper::loaded');
23703
+ };
23704
+ this.swiperScript.onerror = (error) => {
23705
+ salla.logger.warn('failed load swiper bundle', error);
23706
+ reject(true);
23707
+ };
23708
+ this.swiperScript.src = 'https://cdn.jsdelivr.net/npm/swiper@8/swiper-bundle.min.js';
23709
+ this.swiperScript.setAttribute('id', 'swiper-script');
23710
+ document.body.appendChild(this.swiperScript);
23711
+ }
23712
+ });
23713
+ }
23714
+ getSwiperConfig() {
23715
+ let pre_defined_config = {
23716
+ loop: this.loop,
23717
+ autoplay: this.autoPlay,
23718
+ centeredSlides: this.centered,
23719
+ lazy: true,
23720
+ on: {
23721
+ // todo:: find better way for this workaround to show lazyLoad for duplicated slides, for some reason they are loaded but class not added.
23722
+ afterInit: (slider) => this.loop && slider.slides.map(slide => {
23723
+ var _a;
23724
+ (_a = document.lazyLoadInstance) === null || _a === void 0 ? void 0 : _a.update();
23725
+ if (!slide.classList.contains('swiper-slide-duplicate')) {
23726
+ return;
23727
+ }
23728
+ slide.querySelectorAll('img.lazy:not(.loaded)').forEach(img => img.classList.add('loaded'));
23729
+ }),
23730
+ },
23731
+ pagination: this.pagination ? {
23732
+ el: this.host.id ? `#${this.host.id} .swiper-pagination` : '',
23733
+ clickable: true,
23734
+ } : false,
23735
+ navigation: this.showControls ? {
23736
+ nextEl: this.host.id ? `#${this.host.id} .s-slider-next` : '',
23737
+ prevEl: this.host.id ? `#${this.host.id} .s-slider-prev` : ''
23738
+ } : false,
23739
+ };
23740
+ pre_defined_config = Object.assign(Object.assign({}, pre_defined_config), (this.pre_defined_config[this.type] || {}));
23741
+ if (this.type == 'thumbs') {
25066
23742
  for (const slide of this.thumbsSliderWrapper.children) {
25067
23743
  //todo:: use `s-slider-slide`
25068
23744
  slide.classList.add('swiper-slide');
25069
23745
  }
25070
- this.slider = new core.Swiper(this.sliderContainer, {
25071
- slidesPerView: 1,
25072
- spaceBetween: 30,
25073
- lazy: true,
25074
- thumbs: {
25075
- swiper: this.thumbsSlider,
25076
- },
23746
+ // @ts-ignore
23747
+ this.thumbsSlider = new Swiper(this.thumbsSliderContainer, {
23748
+ freeMode: false,
23749
+ watchSlidesProgress: true,
23750
+ slidesPerView: 'auto',
25077
23751
  });
23752
+ // @ts-ignore
23753
+ pre_defined_config.thumbs = {
23754
+ swiper: this.thumbsSlider,
23755
+ };
25078
23756
  }
25079
- else {
25080
- this.slider = new core.Swiper(this.sliderContainer, Object.assign({}, this.sliderConfig));
23757
+ pre_defined_config = Object.assign(Object.assign({}, pre_defined_config), this.sliderConfig);
23758
+ return pre_defined_config;
23759
+ }
23760
+ initSlider() {
23761
+ for (const slide of this.sliderWrapper.children) {
23762
+ //todo:: use `s-slider-slide`
23763
+ slide.classList.add('swiper-slide');
25081
23764
  }
23765
+ // @ts-ignore
23766
+ this.slider = new Swiper(this.sliderContainer, this.getSwiperConfig());
25082
23767
  // Expose slider events
25083
23768
  this.slider.on('slideChange', (slider) => {
23769
+ //todo:: it doesn't change when loop is active, always will be false
25084
23770
  this.isBeginning = slider.isBeginning;
25085
23771
  this.isEnd = slider.isEnd;
25086
23772
  this.slideChange.emit(slider);
25087
23773
  });
25088
- this.slider.on('reachBeginning', (slider) => {
25089
- // this.isBeginning = true;
25090
- this.reachBeginning.emit(slider);
25091
- });
25092
- this.slider.on('reachEnd', (slider) => {
25093
- // this.isEnd = true;
25094
- this.reachEnd.emit(slider);
25095
- });
25096
- this.slider.on('slideChangeTransitionEnd', (slider) => {
25097
- this.slideChangeTransitionEnd.emit(slider);
25098
- });
25099
- this.slider.on('slideChangeTransitionStart', (slider) => {
25100
- this.slideChangeTransitionStart.emit(slider);
25101
- });
25102
- this.slider.on('slideNextTransitionEnd', (slider) => {
25103
- this.slideNextTransitionEnd.emit(slider);
25104
- });
25105
- this.slider.on('slideNextTransitionStart', (slider) => {
25106
- this.slideNextTransitionStart.emit(slider);
25107
- });
25108
- this.slider.on('slidePrevTransitionEnd', (slider) => {
25109
- this.slidePrevTransitionEnd.emit(slider);
25110
- });
25111
- this.slider.on('slidePrevTransitionStart', (slider) => {
25112
- this.slidePrevTransitionStart.emit(slider);
25113
- });
25114
- this.slider.on('sliderMove', (slider) => {
25115
- this.sliderMove.emit(slider);
25116
- });
25117
- this.slider.on('touchEnd', (slider) => {
25118
- this.touchSliderEnd.emit(slider);
25119
- });
25120
- this.slider.on('touchMove', (slider) => {
25121
- this.touchSliderMove.emit(slider);
25122
- });
25123
- this.slider.on('touchStart', (slider) => {
25124
- this.touchSliderStart.emit(slider);
25125
- });
25126
- this.slider.on('transitionEnd', (slider) => {
25127
- this.sliderTransitionEnd.emit(slider);
25128
- });
25129
- this.slider.on('transitionStart', (slider) => {
25130
- this.sliderTransitionStart.emit(slider);
25131
- });
23774
+ this.slider.on('reachBeginning', (slider) => this.reachBeginning.emit(slider));
23775
+ this.slider.on('reachEnd', (slider) => this.reachEnd.emit(slider));
23776
+ this.slider.on('slideChangeTransitionEnd', (slider) => this.slideChangeTransitionEnd.emit(slider));
23777
+ this.slider.on('slideChangeTransitionStart', (slider) => this.slideChangeTransitionStart.emit(slider));
23778
+ this.slider.on('slideNextTransitionEnd', (slider) => this.slideNextTransitionEnd.emit(slider));
23779
+ this.slider.on('slideNextTransitionStart', (slider) => this.slideNextTransitionStart.emit(slider));
23780
+ this.slider.on('slidePrevTransitionEnd', (slider) => this.slidePrevTransitionEnd.emit(slider));
23781
+ this.slider.on('slidePrevTransitionStart', (slider) => this.slidePrevTransitionStart.emit(slider));
23782
+ this.slider.on('sliderMove', (slider) => this.sliderMove.emit(slider));
23783
+ this.slider.on('touchEnd', (slider) => this.touchSliderEnd.emit(slider));
23784
+ this.slider.on('touchMove', (slider) => this.touchSliderMove.emit(slider));
23785
+ this.slider.on('touchStart', (slider) => this.touchSliderStart.emit(slider));
23786
+ this.slider.on('transitionEnd', (slider) => this.sliderTransitionEnd.emit(slider));
23787
+ this.slider.on('transitionStart', (slider) => this.sliderTransitionStart.emit(slider));
25132
23788
  }
25133
23789
  render() {
25134
23790
  var _a, _b, _c, _d;
25135
- return (index.h(index.Host, { class: "s-slider-wrapper" }, index.h("div", { class: "swiper s-slider-container", ref: el => this.sliderContainer = el }, index.h("div", { class: "swiper-wrapper", ref: el => this.sliderWrapper = el }, index.h("slot", { name: 'items' })), this.showControls ? [index.h("div", { class: "s-slider-button-prev" }, index.h("salla-button", { shape: "icon", disabled: this.isRTL ? this.isEnd : this.isBeginning, color: "light", onClick: () => this.isRTL ? this.slideNext() : this.slidePrev() }, index.h("span", { class: "s-slider-button-icon", innerHTML: ArrowLeftIcon }))), index.h("div", { class: "s-slider-button-next" }, index.h("salla-button", { disabled: this.isRTL ? this.isBeginning : this.isEnd, shape: "icon", color: "light", onClick: () => this.isRTL ? this.slidePrev() : this.slideNext() }, index.h("span", { class: "s-slider-button-icon", innerHTML: ArrowRightIcon })))] : ''), this.type == 'thumbs' ? index.h("div", { class: "s-slider-thumbs" }, index.h("div", { class: "swiper s-slider-thumbs-container", ref: el => this.thumbsSliderContainer = el }, index.h("div", { class: "swiper-wrapper", ref: el => this.thumbsSliderWrapper = el }, index.h("slot", { name: "thumbs" })), this.showThumbsControls ? [index.h("div", { class: "s-slider-button-prev" }, index.h("salla-button", { disabled: this.isRTL ? (_a = this.thumbsSlider) === null || _a === void 0 ? void 0 : _a.isEnd : (_b = this.thumbsSlider) === null || _b === void 0 ? void 0 : _b.isBeginning, shape: "icon", color: "light", onClick: () => this.isRTL ? this.thumbsSlider.slideNext() : this.thumbsSlider.slidePrev() }, index.h("span", { class: "s-slider-button-icon", innerHTML: ArrowLeftIcon }))), index.h("div", { class: "s-slider-button-next" }, index.h("salla-button", { disabled: this.isRTL ? (_c = this.thumbsSlider) === null || _c === void 0 ? void 0 : _c.isBeginning : (_d = this.thumbsSlider) === null || _d === void 0 ? void 0 : _d.isEnd, shape: "icon", color: "light", onClick: () => this.isRTL ? this.thumbsSlider.slidePrev() : this.thumbsSlider.slideNext() }, index.h("span", { class: "s-slider-button-icon", innerHTML: ArrowRightIcon })))] : '')) : ''));
23791
+ let classes = this.type ? this.type + '-slider ' : '';
23792
+ classes += this.controlsOuter ? ' s-slider-controls-outer ' : '';
23793
+ classes += this.blockTitle == '' ? ' s-slider-has-notitle ' : '';
23794
+ classes += this.blockTitle == '' || this.type == 'testimonials' ? ' s-slider-v-centered ' : '';
23795
+ return (index.h(index.Host, { class: 's-slider-wrapper ' + classes }, this.blockTitle || this.showControls ?
23796
+ index.h("div", { class: "s-slider-block__title" }, this.blockTitle ?
23797
+ index.h("div", { class: "s-slider-block__title-right" }, index.h("h2", null, this.blockTitle), this.blockSubtitle ? index.h("p", { innerHTML: this.blockSubtitle }) : '')
23798
+ : '', index.h("div", { class: "s-slider-block__title-left" }, this.displayAllUrl ?
23799
+ index.h("a", { href: this.displayAllUrl, class: "s-slider-block__display-all" }, this.displayAllTitle)
23800
+ : '', this.showControls ?
23801
+ index.h("div", { class: "s-slider-block__title-nav", dir: "rtl" }, index.h("button", { "aria-label": "Previous Slide", class: "s-slider-prev s-slider-nav-arrow" }, index.h("span", { class: "s-slider-button-icon", innerHTML: this.isRTL ? ArrowRightIcon : ArrowLeftIcon })), index.h("button", { "aria-label": "Next Slide", class: "s-slider-next s-slider-nav-arrow" }, index.h("span", { class: "s-slider-button-icon", innerHTML: this.isRTL ? ArrowLeftIcon : ArrowRightIcon })))
23802
+ : ''))
23803
+ : '', index.h("div", { class: "swiper s-slider-container", ref: el => this.sliderContainer = el }, index.h("slot", null), index.h("div", { class: "swiper-wrapper s-slider-swiper-wrapper", ref: el => this.sliderWrapper = el }, index.h("slot", { name: 'items' })), this.pagination ? index.h("div", { class: "swiper-pagination" }) : ''), this.type == 'thumbs' ? index.h("div", { class: "s-slider-thumbs" }, index.h("div", { class: "swiper s-slider-thumbs-container", ref: el => this.thumbsSliderContainer = el }, index.h("div", { class: "s-slider-swiper-wrapper swiper-wrapper", ref: el => this.thumbsSliderWrapper = el }, index.h("slot", { name: "thumbs" })), this.showThumbsControls ? [index.h("div", { class: "s-slider-button s-slider-button-prev" }, index.h("salla-button", { disabled: this.isRTL ? (_a = this.thumbsSlider) === null || _a === void 0 ? void 0 : _a.isEnd : (_b = this.thumbsSlider) === null || _b === void 0 ? void 0 : _b.isBeginning, shape: "icon", color: "light", onClick: () => this.isRTL ? this.thumbsSlider.slideNext() : this.thumbsSlider.slidePrev() }, index.h("span", { class: "s-slider-button-icon", innerHTML: salla.config.get('theme.is_rtl') ? ArrowLeftIcon : ArrowRightIcon }))), index.h("div", { class: "s-slider-button s-slider-button-next" }, index.h("salla-button", { disabled: this.isRTL ? (_c = this.thumbsSlider) === null || _c === void 0 ? void 0 : _c.isBeginning : (_d = this.thumbsSlider) === null || _d === void 0 ? void 0 : _d.isEnd, shape: "icon", color: "light", onClick: () => this.isRTL ? this.thumbsSlider.slidePrev() : this.thumbsSlider.slideNext() }, index.h("span", { class: "s-slider-button-icon", innerHTML: salla.config.get('theme.is_rtl') ? ArrowRightIcon : ArrowLeftIcon })))] : '')) : ''));
23804
+ }
23805
+ componentDidLoad() {
23806
+ let itemsSlot = this.sliderWrapper.querySelector('div[slot="items"]');
23807
+ !!itemsSlot ? itemsSlot.replaceWith(...itemsSlot.children) : null;
23808
+ if (this.type == 'thumbs') {
23809
+ let thumbsSlot = this.thumbsSliderWrapper.querySelector('div[slot="thumbs"]');
23810
+ !!thumbsSlot ? thumbsSlot.replaceWith(...thumbsSlot.children) : null;
23811
+ }
23812
+ // if swiper is not loaded, lets relay on event
23813
+ // @ts-ignore
23814
+ if (typeof Swiper === 'undefined') {
23815
+ salla.event.once('swiper::loaded', () => this.initSlider());
23816
+ }
23817
+ else { // if swiper is loaded lets init our slider
23818
+ this.initSlider();
23819
+ }
25136
23820
  }
23821
+ get host() { return index.getElement(this); }
25137
23822
  };
25138
23823
  SallaSwiper.style = sallaSliderCss;
25139
23824