@constructor-io/constructorio-ui-quizzes 1.4.5 → 1.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -0
- package/dist/constructorio-ui-quizzes-bundled.js +2 -2
- package/lib/cjs/components/RedoButton/RedoButton.js +1 -1
- package/lib/cjs/components/ResultCard/ResultCard.js +3 -3
- package/lib/cjs/components/ResultContainer/ResultContainer.js +2 -2
- package/lib/cjs/components/Results/Results.js +2 -2
- package/lib/cjs/components/ZeroResults/ZeroResults.js +1 -1
- package/lib/cjs/constants.js +1 -0
- package/lib/cjs/stories/Quiz/tests/mocks.js +1 -0
- package/lib/mjs/components/RedoButton/RedoButton.js +1 -1
- package/lib/mjs/components/ResultCard/ResultCard.js +3 -3
- package/lib/mjs/components/ResultContainer/ResultContainer.js +2 -2
- package/lib/mjs/components/Results/Results.js +2 -2
- package/lib/mjs/components/ZeroResults/ZeroResults.js +1 -1
- package/lib/mjs/constants.js +1 -0
- package/lib/mjs/stories/Quiz/tests/mocks.js +1 -0
- package/lib/styles.css +5 -0
- package/lib/types/components/ResultCard/ResultCard.d.ts +1 -0
- package/lib/types/constants.d.ts +1 -1
- package/lib/types/types.d.ts +1 -0
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -82,6 +82,20 @@ import '@constructor-io/constructorio-ui-quizzes/styles.css';
|
|
|
82
82
|
|
|
83
83
|
### Known Issues
|
|
84
84
|
|
|
85
|
+
**Older Javascript environments**
|
|
86
|
+
|
|
87
|
+
The library provides two different builds. CommonJS (cjs) and ECMAScript Modules (mjs)
|
|
88
|
+
|
|
89
|
+
For ECMAScript Modules (mjs) build. The Javascript version is ESNext which might not be supported by your environment.
|
|
90
|
+
If that's the case and your environment is using an older Javascript version like ES6 (ES2015), you might get this error.
|
|
91
|
+
|
|
92
|
+
`Module parse failed: Unexpected token (15:32)
|
|
93
|
+
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file`
|
|
94
|
+
|
|
95
|
+
To solve this you can import the CommonJS (cjs) build which supports ES6 (ES2015) syntax:
|
|
96
|
+
|
|
97
|
+
`import CioQuiz from '@constructor-io/constructorio-ui-quizzes/cjs'`
|
|
98
|
+
|
|
85
99
|
**ESLint**
|
|
86
100
|
|
|
87
101
|
There is a known issue with ESLint where it fails to resolve the paths exposed in the `exports` statement of NPM packages. If you are receiving the following error, you can safely disable ESLint using `// eslint-disable-line` for that line.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.id="cio-quizzes-styles",o.appendChild(document.createTextNode('@import"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap";.cio-quiz{--primary-color-h: 227;--primary-color-s: 70%;--primary-color-l: 46%;--primary-color-variant-100: hsl( var(--primary-color-h), calc(var(--primary-color-s) + 10%), calc(var(--primary-color-l) + 25%) );--primary-color-variant-400: hsl( var(--primary-color-h), var(--primary-color-s), var(--primary-color-l) );--primary-color-variant-500: hsl( var(--primary-color-h), calc(var(--primary-color-s) + 10%), calc(var(--primary-color-l) - 5%) );--primary-color-variant-600: hsl( var(--primary-color-h), calc(var(--primary-color-s) + 15%), calc(var(--primary-color-l) - 10%) );--primary-color-variant-700: hsl( var(--primary-color-h), calc(var(--primary-color-s) + 15%), calc(var(--primary-color-l) - 15%) );--primary-color-variant-800: hsl( var(--primary-color-h), calc(var(--primary-color-s) + 20%), calc(var(--primary-color-l) - 20%) );--primary-color: var(--primary-color-variant-400);--gray-dust-100: #92959c;--gray-dust-200: #74757b;--gray-dust-500: #46474a;--gray-dust-900: #2c2c2f;--bottom-bar-height: 80px;--container-image-small-height: 250px;container:quiz / inline-size}.cio-quiz,.cio-quiz *{box-sizing:border-box;font-family:Inter,sans-serif}.cio-quiz{position:relative;min-width:100%;min-height:100%;height:100%;overflow:auto;display:flex;justify-content:center;background-color:#fff;color:var(--gray-dust-500);font-size:16px}.cio-quiz button{cursor:pointer}.cio-container{display:flex;justify-content:center;margin-top:2rem;padding-bottom:var(--bottom-bar-height);width:100%;position:relative;align-self:start;min-height:calc(100% - 2rem)}.cio-container--with-image{display:flex;flex-direction:column;width:100%;padding-bottom:var(--bottom-bar-height);position:relative;align-self:start;min-height:100%}.cio-session-prompt-modal{position:absolute;display:flex;z-index:100;width:100%;height:100%;background-color:#00000080;justify-content:space-between}.cio-session-prompt-container{margin:auto}.cio-session-prompt-content{display:flex;flex-direction:column;gap:1rem;height:fit-content;margin:2rem;padding:2rem;border-radius:8px;background:#ffffff;line-height:1.5}.cio-session-prompt-controls-container{display:flex;justify-content:space-between;gap:1rem}.cio-session-prompt-content .cio-button-container{margin:0;padding:0}.cio-session-prompt-controls-container .cio-button-container:nth-child(1) .cio-question-cta-button{color:var(--primary-color);background-color:#fff}.cio-question-content{display:flex;flex-direction:column;padding:1rem}.cio-question-title{font-size:2.125em;margin:0}.cio-question-description{font-size:1em;line-height:1.5;margin-top:1.5rem}.cio-question-image{width:100%;height:100%;object-fit:cover}.cio-question-image-container{box-sizing:border-box;width:100%;object-fit:cover;max-height:var(--container-image-small-height);height:var(--container-image-small-height);display:flex}.cio-question-input-text{width:100%;padding:.5rem;border:0;border-bottom:1px solid var(--gray-dust-100);color:var(--primary-color-variant-500);padding:.8rem;outline:none;font-size:1rem}.cio-question-input-text:focus,.cio-question-input-text:active{border-bottom:1px solid var(--primary-color-variant-500)}.cio-question-input-text::placeholder{color:var(--gray-dust-100)}.cio-question-buttons-container{width:100%;height:var(--bottom-bar-height);padding:8px 16px;display:flex;position:absolute;bottom:0px;left:0px;background:white;background-color:#ffffffde;align-items:center}.cio-question-cta-button{background:var(--primary-color);color:#fff;border:1px solid var(--primary-color);border-radius:4px;height:3rem;font-size:1rem;flex-grow:1;margin-left:auto;width:100%}.cio-button-container{max-width:10rem;flex-grow:1;margin-left:auto;padding-left:1rem}.cio-question-cta-button:hover{background:var(--primary-color-variant-500);border:2px solid var(--primary-color-variant-600)}.cio-question-cta-button:active{background:var(--primary-color-variant-700);border:2px solid var(--primary-color-variant-800)}.cio-question-cta-button:focus{outline:3px solid var(--primary-color-variant-100)}.cio-question-cta-button:disabled,.cio-question-cta-button.disabled{background:var(--gray-dust-200);border:2px solid var(--gray-dust-200);cursor:auto;outline:none}.cio-question-back-button{color:var(--primary-color);background:#ffffff;border:1px solid var(--primary-color);border-radius:4px;height:3rem;width:3rem;font-size:1rem;margin-right:4rem}.cio-question-back-button:hover{border:2px solid var(--primary-color-variant-600)}.cio-question-back-button:active{border:2px solid var(--primary-color-variant-700)}.cio-question-back-button:focus{outline:3px solid var(--primary-color-variant-100)}.cio-question-back-button.disabled{display:none}.cio-question-back-button svg{display:inline}.cio-cover-question-container--with-image{padding:0;padding-bottom:var(--bottom-bar-height)}.cio-question-option-container{padding:1.5rem;border-radius:8px;border:1px solid var(--primary-color-variant-100);box-shadow:0 4px 10px #5d7ce826;width:calc(50% - 10px);display:flex;flex-direction:column;cursor:pointer}.cio-question-option-container.selected,.cio-question-option-container-text-only.selected{outline:3px solid var(--primary-color-variant-600);box-shadow:0 4px 10px #5d7ce859}.cio-question-option-container:hover:not(.selected){outline:1px solid var(--primary-color-variant-600);box-shadow:0 4px 10px #5d7ce840}.cio-question-option-container-text-only:hover:not(.selected){outline:1px solid var(--primary-color-variant-600);box-shadow:0 4px 10px #5d7ce840}.cio-select-question-container{position:relative;display:flex;flex-direction:column;align-items:center;align-self:start;max-width:1200px;padding:1rem;margin-top:2rem;min-height:calc(100% - 3rem);width:100%}.cio-question-options-container{display:flex;justify-content:center;flex-wrap:wrap;gap:1rem;width:100%;margin-bottom:var(--bottom-bar-height);margin-top:2rem}.cio-question-options-container-text-only{display:flex;flex-direction:column;gap:1rem;width:100%;padding:10px;margin-bottom:var(--bottom-bar-height);margin-top:2rem}.cio-question-option-container-text-only{padding:1.5rem;border-radius:8px;border:1px solid var(--primary-color-variant-100);box-shadow:0 4px 10px #5d7ce826;display:flex;flex-direction:column;width:100%;margin:auto;cursor:pointer}.cio-question-option-image{width:100%;height:auto;border-radius:4px;object-fit:cover;margin-bottom:16px;aspect-ratio:1/1}.cio-question-option-value{text-align:center;margin:auto 0}.cio-select-question-text{width:100%;display:flex;flex-direction:column;justify-content:space-between}.cio-select-question-text .cio-question-description{margin-bottom:0}.cio-select-question-instructions{text-align:center;font-size:1.125rem;color:var(--gray-dust-100);line-height:150%;margin-top:2.75rem;margin-bottom:-1rem}.cio-results-container{width:100%;max-width:1200px;padding:2rem 1rem;display:flex;flex-direction:column}.cio-results-title{margin-top:0;margin-bottom:1rem;color:var(--gray-dust-500)}.cio-results-filter-container{margin-bottom:1.5rem}.cio-results-filter-container p{color:var(--gray-dust-500);margin-bottom:1.5rem}.cio-results-filter-options{display:flex;flex-wrap:wrap;gap:.5rem;cursor:default}.cio-results-filter-option{background-color:#fff;border:1px solid var(--primary-color);color:var(--primary-color-variant-500);border-radius:10000px;padding:.4rem 1.25rem;display:flex;justify-content:center;align-items:center;font-size:.75rem}.cio-results{display:flex;flex-direction:row;flex-wrap:wrap}.cio-zero-results{margin-top:2rem;text-align:center;display:flex;flex-direction:column;justify-content:center;max-width:420px;margin-left:auto;margin-right:auto}.cio-zero-results-subtitle{font-weight:500;font-size:1.25rem;line-height:1.5rem;margin-bottom:2rem;color:var(--gray-dust-500);margin-top:0}.cio-zero-results .cio-button-container{width:14rem;margin-right:auto;margin-left:auto;padding-left:0}.cio-result-card{background-color:transparent;height:auto;box-sizing:border-box;text-decoration:none;margin:0;margin-bottom:1.5rem;flex-basis:100%;display:flex;flex-direction:column}.cio-result-card-anchor,.cio-result-card-container{text-decoration:none;background-color:transparent;color:inherit;height:100%;display:flex;flex-direction:column;justify-content:space-between}.cio-result-card-image{width:auto;height:240px;margin-left:auto;margin-right:auto;margin-bottom:10px}.cio-result-card-image img{height:100%;width:100%;object-fit:contain}.cio-result-card-text{flex-grow:1;display:flex;flex-direction:column;justify-content:space-between;text-decoration:none}.cio-result-card-title{color:var(--gray-dust-500);margin:0;margin-bottom:1rem;font-weight:700}.cio-result-card-prices{margin-bottom:1rem;font-weight:700}.cio-result-card-sale-price{color:#bf1728;margin-right:.75rem}.cio-result-card-regular-price{color:var(--gray-dust-900)}.cio-result-card-regular-price--strike-through{text-decoration:line-through}.cio-result-card-rating{margin-bottom:10px}.cio-result-card-rating-score{margin-right:5px}.cio-result-card-cta-button{padding:.75rem 2.5rem;height:3rem;background:var(--primary-color);border:1px solid var(--primary-color);border-radius:4px;color:#fff;font-size:1rem;width:100%}.cio-result-card-cta-button:hover{background:var(--primary-color-variant-500);border:2px solid var(--primary-color-variant-600)}.cio-result-card-cta-button:active{background:var(--primary-color-variant-700);border:2px solid var(--primary-color-variant-800)}.cio-result-card-cta-button:focus{outline:3px solid var(--primary-color-variant-100)}.cio-result-card-cta-button:disabled,.cio-result-card-cta-button.disabled{background:var(--gray-dust-200);border:2px solid var(--gray-dust-200)}.cio-question-redo-button{background:none;border:none;display:flex;gap:.5rem;align-items:center}.cio-question-redo-button:hover{text-decoration:underline}.cio-question-redo-button span{margin-top:1px}@container quiz (min-width: 640px){.cio-container{padding-bottom:0;align-self:normal}.cio-container--with-image{display:flex;align-items:center;margin-bottom:0;padding-bottom:0;align-self:normal}.cio-question-image-container{height:100%;flex-basis:50%;flex-shrink:0;border-radius:4px}.cio-cover-question-container--with-image{margin-bottom:0;padding-bottom:0}.cio-select-question-text{margin-top:2rem}.cio-select-question-buttons{padding:1rem 3rem}.cio-results-container{padding:3rem 4rem}.cio-results-filter-and-redo-container{display:flex;justify-content:space-between;align-items:end;margin-bottom:1.5rem}.cio-results-filter-container{margin-bottom:0}.cio-results{column-gap:5%}.cio-result-card{flex-basis:30%}}@container quiz (min-width: 768px){.cio-container{align-items:center;margin-top:0}.cio-container--with-image{padding:6% 2%;align-items:center;flex-direction:row;justify-content:center}.cio-cover-question-container--with-image{flex-direction:row-reverse}.cio-question-input-text{margin-bottom:1rem}.cio-question-image-container{max-height:100%}.cio-cover-question-container--with-image .cio-question-image-container{max-height:unset}.cio-question-content{justify-content:center;height:fit-content;flex-basis:70%;flex-shrink:1;margin:0 auto;padding:3rem}.cio-question-description{margin-bottom:2rem}.cio-question-buttons-container{position:sticky;padding:0;margin:0;align-items:center}.cio-cover-question-container--with-image{padding:0}.cio-select-question-text{padding:0;padding-bottom:2rem;margin:0}.cio-select-question-buttons{padding:1rem 5rem}.cio-select-question-container{justify-content:center;margin:0;padding:2rem;padding-bottom:0}.cio-question-option-container{width:calc(25% - 13px)}.cio-question-options-container{padding:0;margin-bottom:2rem}.cio-question-options-container-text-only{flex-direction:row;flex-wrap:wrap;justify-content:center;margin-bottom:2rem;margin-top:0}.cio-question-option-container-text-only{margin:0;width:30%}}@container quiz (min-width: 1280px){.cio-cover-question-container--with-image{padding:0}.cio-question-option-container-text-only{width:30%}.cio-select-question-container{margin-bottom:0}.cio-select-question-text{padding:2.5rem 0rem}.cio-results-container{margin-top:3rem}.cio-zero-results{margin-top:7rem}.cio-question-content{padding:5rem}}.cio-spinner{display:inline-block;position:relative;width:80px;margin:auto}.cio-spinner div{box-sizing:border-box;display:block;position:absolute;top:-35px;width:64px;height:64px;margin:4px;border:4px solid var(--primary-color);border-radius:50%;animation:cio-spinner 1.2s cubic-bezier(.5,0,.5,1) infinite;border-color:var(--primary-color) transparent transparent transparent}.cio-spinner div:nth-child(1){animation-delay:-.45s}.cio-spinner div:nth-child(2){animation-delay:-.3s}.cio-spinner div:nth-child(3){animation-delay:-.15s}@keyframes cio-spinner{0%{transform:rotate(0)}to{transform:rotate(360deg)}}')),document.head.appendChild(o)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.id="cio-quizzes-styles",o.appendChild(document.createTextNode('@import"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap";.cio-quiz{--primary-color-h: 227;--primary-color-s: 70%;--primary-color-l: 46%;--primary-color-variant-100: hsl( var(--primary-color-h), calc(var(--primary-color-s) + 10%), calc(var(--primary-color-l) + 25%) );--primary-color-variant-400: hsl( var(--primary-color-h), var(--primary-color-s), var(--primary-color-l) );--primary-color-variant-500: hsl( var(--primary-color-h), calc(var(--primary-color-s) + 10%), calc(var(--primary-color-l) - 5%) );--primary-color-variant-600: hsl( var(--primary-color-h), calc(var(--primary-color-s) + 15%), calc(var(--primary-color-l) - 10%) );--primary-color-variant-700: hsl( var(--primary-color-h), calc(var(--primary-color-s) + 15%), calc(var(--primary-color-l) - 15%) );--primary-color-variant-800: hsl( var(--primary-color-h), calc(var(--primary-color-s) + 20%), calc(var(--primary-color-l) - 20%) );--primary-color: var(--primary-color-variant-400);--gray-dust-100: #92959c;--gray-dust-200: #74757b;--gray-dust-500: #46474a;--gray-dust-900: #2c2c2f;--bottom-bar-height: 80px;--container-image-small-height: 250px;container:quiz / inline-size}.cio-quiz,.cio-quiz *{box-sizing:border-box;font-family:Inter,sans-serif}.cio-quiz{position:relative;min-width:100%;min-height:100%;height:100%;overflow:auto;display:flex;justify-content:center;background-color:#fff;color:var(--gray-dust-500);font-size:16px}.cio-quiz button{cursor:pointer}.cio-container{display:flex;justify-content:center;margin-top:2rem;padding-bottom:var(--bottom-bar-height);width:100%;position:relative;align-self:start;min-height:calc(100% - 2rem)}.cio-container--with-image{display:flex;flex-direction:column;width:100%;padding-bottom:var(--bottom-bar-height);position:relative;align-self:start;min-height:100%}.cio-session-prompt-modal{position:absolute;display:flex;z-index:100;width:100%;height:100%;background-color:#00000080;justify-content:space-between}.cio-session-prompt-container{margin:auto}.cio-session-prompt-content{display:flex;flex-direction:column;gap:1rem;height:fit-content;margin:2rem;padding:2rem;border-radius:8px;background:#ffffff;line-height:1.5}.cio-session-prompt-controls-container{display:flex;justify-content:space-between;gap:1rem}.cio-session-prompt-content .cio-button-container{margin:0;padding:0}.cio-session-prompt-controls-container .cio-button-container:nth-child(1) .cio-question-cta-button{color:var(--primary-color);background-color:#fff}.cio-question-content{display:flex;flex-direction:column;padding:1rem}.cio-question-title{font-size:2.125em;margin:0}.cio-question-description{font-size:1em;line-height:1.5;margin-top:1.5rem}.cio-question-image{width:100%;height:100%;object-fit:cover}.cio-question-image-container{box-sizing:border-box;width:100%;object-fit:cover;max-height:var(--container-image-small-height);height:var(--container-image-small-height);display:flex}.cio-question-input-text{width:100%;padding:.5rem;border:0;border-bottom:1px solid var(--gray-dust-100);color:var(--primary-color-variant-500);padding:.8rem;outline:none;font-size:1rem}.cio-question-input-text:focus,.cio-question-input-text:active{border-bottom:1px solid var(--primary-color-variant-500)}.cio-question-input-text::placeholder{color:var(--gray-dust-100)}.cio-question-buttons-container{width:100%;height:var(--bottom-bar-height);padding:8px 16px;display:flex;position:absolute;bottom:0px;left:0px;background:white;background-color:#ffffffde;align-items:center}.cio-question-cta-button{background:var(--primary-color);color:#fff;border:1px solid var(--primary-color);border-radius:4px;height:3rem;font-size:1rem;flex-grow:1;margin-left:auto;width:100%}.cio-button-container{max-width:10rem;flex-grow:1;margin-left:auto;padding-left:1rem}.cio-question-cta-button:hover{background:var(--primary-color-variant-500);border:2px solid var(--primary-color-variant-600)}.cio-question-cta-button:active{background:var(--primary-color-variant-700);border:2px solid var(--primary-color-variant-800)}.cio-question-cta-button:focus{outline:3px solid var(--primary-color-variant-100)}.cio-question-cta-button:disabled,.cio-question-cta-button.disabled{background:var(--gray-dust-200);border:2px solid var(--gray-dust-200);cursor:auto;outline:none}.cio-question-back-button{color:var(--primary-color);background:#ffffff;border:1px solid var(--primary-color);border-radius:4px;height:3rem;width:3rem;font-size:1rem;margin-right:4rem}.cio-question-back-button:hover{border:2px solid var(--primary-color-variant-600)}.cio-question-back-button:active{border:2px solid var(--primary-color-variant-700)}.cio-question-back-button:focus{outline:3px solid var(--primary-color-variant-100)}.cio-question-back-button.disabled{display:none}.cio-question-back-button svg{display:inline}.cio-cover-question-container--with-image{padding:0;padding-bottom:var(--bottom-bar-height)}.cio-question-option-container{padding:1.5rem;border-radius:8px;border:1px solid var(--primary-color-variant-100);box-shadow:0 4px 10px #5d7ce826;width:calc(50% - 10px);display:flex;flex-direction:column;cursor:pointer}.cio-question-option-container.selected,.cio-question-option-container-text-only.selected{outline:3px solid var(--primary-color-variant-600);box-shadow:0 4px 10px #5d7ce859}.cio-question-option-container:hover:not(.selected){outline:1px solid var(--primary-color-variant-600);box-shadow:0 4px 10px #5d7ce840}.cio-question-option-container-text-only:hover:not(.selected){outline:1px solid var(--primary-color-variant-600);box-shadow:0 4px 10px #5d7ce840}.cio-select-question-container{position:relative;display:flex;flex-direction:column;align-items:center;align-self:start;max-width:1200px;padding:1rem;margin-top:2rem;min-height:calc(100% - 3rem);width:100%}.cio-question-options-container{display:flex;justify-content:center;flex-wrap:wrap;gap:1rem;width:100%;margin-bottom:var(--bottom-bar-height);margin-top:2rem}.cio-question-options-container-text-only{display:flex;flex-direction:column;gap:1rem;width:100%;padding:10px;margin-bottom:var(--bottom-bar-height);margin-top:2rem}.cio-question-option-container-text-only{padding:1.5rem;border-radius:8px;border:1px solid var(--primary-color-variant-100);box-shadow:0 4px 10px #5d7ce826;display:flex;flex-direction:column;width:100%;margin:auto;cursor:pointer}.cio-question-option-image{width:100%;height:auto;border-radius:4px;object-fit:cover;margin-bottom:16px;aspect-ratio:1/1}.cio-question-option-value{text-align:center;margin:auto 0}.cio-select-question-text{width:100%;display:flex;flex-direction:column;justify-content:space-between}.cio-select-question-text .cio-question-description{margin-bottom:0}.cio-select-question-instructions{text-align:center;font-size:1.125rem;color:var(--gray-dust-100);line-height:150%;margin-top:2.75rem;margin-bottom:-1rem}.cio-results-container{width:100%;max-width:1200px;padding:2rem 1rem;display:flex;flex-direction:column}.cio-results-title{margin-top:0;margin-bottom:1rem;color:var(--gray-dust-500)}.cio-results-filter-container{margin-bottom:1.5rem}.cio-results-filter-container p{color:var(--gray-dust-500);margin-bottom:1.5rem}.cio-results-filter-options{display:flex;flex-wrap:wrap;gap:.5rem;cursor:default}.cio-results-filter-option{background-color:#fff;border:1px solid var(--primary-color);color:var(--primary-color-variant-500);border-radius:10000px;padding:.4rem 1.25rem;display:flex;justify-content:center;align-items:center;font-size:.75rem}.cio-results{display:flex;flex-direction:row;flex-wrap:wrap}.cio-zero-results{margin-top:2rem;text-align:center;display:flex;flex-direction:column;justify-content:center;max-width:420px;margin-left:auto;margin-right:auto}.cio-zero-results-subtitle{font-weight:500;font-size:1.25rem;line-height:1.5rem;margin-bottom:2rem;color:var(--gray-dust-500);margin-top:0}.cio-zero-results .cio-button-container{width:14rem;margin-right:auto;margin-left:auto;padding-left:0}.cio-result-card{background-color:transparent;height:auto;box-sizing:border-box;text-decoration:none;margin:0;margin-bottom:1.5rem;flex-basis:100%;display:flex;flex-direction:column}.cio-result-card-anchor,.cio-result-card-container{text-decoration:none;background-color:transparent;color:inherit;height:100%;display:flex;flex-direction:column;justify-content:space-between}.cio-result-card-image{width:auto;height:240px;margin-left:auto;margin-right:auto;margin-bottom:10px}.cio-result-card-image img{height:100%;width:100%;object-fit:contain}.cio-result-card-text{flex-grow:1;display:flex;flex-direction:column;justify-content:space-between;text-decoration:none}.cio-result-card-title{color:var(--gray-dust-500);margin:0;margin-bottom:1rem;font-weight:700}.cio-result-card-prices{margin-bottom:1rem;font-weight:700}.cio-result-card-sale-price{color:#bf1728;margin-right:.75rem}.cio-result-card-regular-price{color:var(--gray-dust-900)}.cio-result-card-regular-price--strike-through{text-decoration:line-through}.cio-result-card-rating{margin-bottom:10px}.cio-result-card-rating-score{margin-right:5px}.cio-result-card-discount{font-weight:400;font-size:.9em;margin-top:4px}.cio-result-card-cta-button{padding:.75rem 2.5rem;height:3rem;background:var(--primary-color);border:1px solid var(--primary-color);border-radius:4px;color:#fff;font-size:1rem;width:100%}.cio-result-card-cta-button:hover{background:var(--primary-color-variant-500);border:2px solid var(--primary-color-variant-600)}.cio-result-card-cta-button:active{background:var(--primary-color-variant-700);border:2px solid var(--primary-color-variant-800)}.cio-result-card-cta-button:focus{outline:3px solid var(--primary-color-variant-100)}.cio-result-card-cta-button:disabled,.cio-result-card-cta-button.disabled{background:var(--gray-dust-200);border:2px solid var(--gray-dust-200)}.cio-question-redo-button{background:none;border:none;display:flex;gap:.5rem;align-items:center}.cio-question-redo-button:hover{text-decoration:underline}.cio-question-redo-button span{margin-top:1px}@container quiz (min-width: 640px){.cio-container{padding-bottom:0;align-self:normal}.cio-container--with-image{display:flex;align-items:center;margin-bottom:0;padding-bottom:0;align-self:normal}.cio-question-image-container{height:100%;flex-basis:50%;flex-shrink:0;border-radius:4px}.cio-cover-question-container--with-image{margin-bottom:0;padding-bottom:0}.cio-select-question-text{margin-top:2rem}.cio-select-question-buttons{padding:1rem 3rem}.cio-results-container{padding:3rem 4rem}.cio-results-filter-and-redo-container{display:flex;justify-content:space-between;align-items:end;margin-bottom:1.5rem}.cio-results-filter-container{margin-bottom:0}.cio-results{column-gap:5%}.cio-result-card{flex-basis:30%}}@container quiz (min-width: 768px){.cio-container{align-items:center;margin-top:0}.cio-container--with-image{padding:6% 2%;align-items:center;flex-direction:row;justify-content:center}.cio-cover-question-container--with-image{flex-direction:row-reverse}.cio-question-input-text{margin-bottom:1rem}.cio-question-image-container{max-height:100%}.cio-cover-question-container--with-image .cio-question-image-container{max-height:unset}.cio-question-content{justify-content:center;height:fit-content;flex-basis:70%;flex-shrink:1;margin:0 auto;padding:3rem}.cio-question-description{margin-bottom:2rem}.cio-question-buttons-container{position:sticky;padding:0;margin:0;align-items:center}.cio-cover-question-container--with-image{padding:0}.cio-select-question-text{padding:0;padding-bottom:2rem;margin:0}.cio-select-question-buttons{padding:1rem 5rem}.cio-select-question-container{justify-content:center;margin:0;padding:2rem;padding-bottom:0}.cio-question-option-container{width:calc(25% - 13px)}.cio-question-options-container{padding:0;margin-bottom:2rem}.cio-question-options-container-text-only{flex-direction:row;flex-wrap:wrap;justify-content:center;margin-bottom:2rem;margin-top:0}.cio-question-option-container-text-only{margin:0;width:30%}}@container quiz (min-width: 1280px){.cio-cover-question-container--with-image{padding:0}.cio-question-option-container-text-only{width:30%}.cio-select-question-container{margin-bottom:0}.cio-select-question-text{padding:2.5rem 0rem}.cio-results-container{margin-top:3rem}.cio-zero-results{margin-top:7rem}.cio-question-content{padding:5rem}}.cio-spinner{display:inline-block;position:relative;width:80px;margin:auto}.cio-spinner div{box-sizing:border-box;display:block;position:absolute;top:-35px;width:64px;height:64px;margin:4px;border:4px solid var(--primary-color);border-radius:50%;animation:cio-spinner 1.2s cubic-bezier(.5,0,.5,1) infinite;border-color:var(--primary-color) transparent transparent transparent}.cio-spinner div:nth-child(1){animation-delay:-.45s}.cio-spinner div:nth-child(2){animation-delay:-.3s}.cio-spinner div:nth-child(3){animation-delay:-.15s}@keyframes cio-spinner{0%{transform:rotate(0)}to{transform:rotate(360deg)}}')),document.head.appendChild(o)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();
|
|
2
2
|
var It=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ed(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var D={},td={get exports(){return D},set exports(e){D=e}},K={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react.production.min.js
|
|
@@ -40,7 +40,7 @@ Error generating stack: `+o.message+`
|
|
|
40
40
|
`,"data-question-key":n.key},i?Fl(n.images,"cio-question-image-container"):"",O.createElement("div",{className:"cio-question-content"},O.createElement(Ul,{title:n.title}),O.createElement(Ml,{description:n.description}),t&&O.createElement("input",{...t()}),O.createElement(Dl,{ctaButtonText:n==null?void 0:n.cta_text})))}return null}function Rh(){var r;const{state:e}=D.useContext(Be);let t;e!=null&&e.quiz.currentQuestion&&(t=e==null?void 0:e.quiz.currentQuestion.next_question);const n=(r=t==null?void 0:t.images)==null?void 0:r.primary_url;return t?O.createElement("div",{className:`
|
|
41
41
|
cio-container${n?"--with-image":""}
|
|
42
42
|
cio-cover-question-container${n?"--with-image":""}
|
|
43
|
-
`,"data-question-key":t.key},n?Fl(t.images,"cio-question-image-container"):"",O.createElement("div",{className:"cio-question-content"},O.createElement(Ul,{title:t==null?void 0:t.title}),O.createElement(Ml,{description:t.description}),O.createElement(Dl,{ctaButtonText:t==null?void 0:t.cta_text}))):null}function zh(){var o;const{state:e,getSelectInputProps:t}=D.useContext(Be);let n,r=!1,i;return e!=null&&e.quiz.currentQuestion&&(n=e.quiz.currentQuestion.next_question,r=n.options.some(s=>s.images),i=n.type===Y.MultipleSelect&&"Select one or more options"),n?O.createElement("div",{className:"cio-select-question-container","data-question-key":n.key},O.createElement("div",{className:"cio-select-question-text"},O.createElement(Ul,{title:n.title}),n!=null&&n.description?O.createElement(Ml,{description:n.description}):""),i&&O.createElement("div",{className:"cio-select-question-instructions"},i),O.createElement("div",{className:`${r?"cio-question-options-container":"cio-question-options-container-text-only"}`},(o=n==null?void 0:n.options)==null?void 0:o.map(s=>t&&O.createElement("div",{...t(s)},s.images?Fl(s.images,"cio-question-option-image"):"",O.createElement("div",{className:"cio-question-option-value"},s==null?void 0:s.value)))),O.createElement(Dl,{ctaButtonText:(n==null?void 0:n.cta_text)||"Continue"})):null}function Nh(){var r;const{state:e}=D.useContext(Be),t=(r=e==null?void 0:e.quiz.currentQuestion)==null?void 0:r.next_question,n=Hf(t==null?void 0:t.type);return O.createElement(O.Fragment,null,n.isOpenQuestion&&O.createElement(xh,{key:t==null?void 0:t.id}),n.isCoverQuestion&&O.createElement(Rh,{key:t==null?void 0:t.id}),n.isSelectQuestion&&O.createElement(zh,{key:t==null?void 0:t.id}))}function Th(){return O.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},O.createElement("g",{clipPath:"url(#clip0_7495_177230)"},O.createElement("path",{d:"M0.667969 2.66699V6.66699H4.66797",stroke:"#0A0B0C",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"}),O.createElement("path",{d:"M15.332 13.333V9.33301H11.332",stroke:"#0A0B0C",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"}),O.createElement("path",{d:"M13.6613 6.00038C13.3232 5.0449 12.7485 4.19064 11.991 3.51732C11.2334 2.844 10.3177 2.37355 9.32911 2.14988C8.34056 1.92621 7.31147 1.9566 6.33784 2.23823C5.36422 2.51985 4.4778 3.04352 3.7613 3.76038L0.667969 6.66704M15.3346 9.33371L12.2413 12.2404C11.5248 12.9572 10.6384 13.4809 9.66476 13.7625C8.69114 14.0441 7.66204 14.0745 6.67349 13.8509C5.68495 13.6272 4.76917 13.1568 4.01161 12.4834C3.25406 11.8101 2.67941 10.9559 2.3413 10.0004",stroke:"#0A0B0C",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"})),O.createElement("defs",null,O.createElement("clipPath",{id:"clip0_7495_177230"},O.createElement("rect",{width:"16",height:"16",fill:"white"}))))}function qh(e){const{redoText:t="Redo Quiz",disabled:n,...r}=e,{getResetQuizButtonProps:i}=D.useContext(Be);return i?O.createElement("button",{...r,...i("secondary")},O.createElement(Th,null),O.createElement("span",null,t)):null}function Ph({hasNoResults:e}){var n;const{state:t}=D.useContext(Be);return O.createElement("div",{className:"cio-results-filter-container"},O.createElement("p",null,e?"Your preferences":"Because you answered"),O.createElement("div",{className:"cio-results-filter-options"},(n=t==null?void 0:t.quiz.selectedOptionsWithAttributes)==null?void 0:n.map(r=>O.createElement("div",{className:"cio-results-filter-option",key:r},r))))}function Ih(){const{getResetQuizButtonProps:e}=D.useContext(Be);return O.createElement("div",{className:"cio-zero-results"},O.createElement("h3",{className:"cio-zero-results-subtitle"},"Sorry, we couldn’t find products that perfectly match your preferences."),O.createElement(qi,{ctaText:"Redo Quiz",propsGetters:e}))}function Oh(e){const{item:t,price:n}=e,{getAddToCartButtonProps:r}=D.useContext(Be);return r?O.createElement("button",{...r(t,n)},"Add to Cart"):null}function Ah(e){var d,f,p,g;const{result:t,salePriceKey:n,regularPriceKey:r,resultPosition:i,ratingCountKey:o,ratingScoreKey:s}=e,{customClickItemCallback:l,getQuizResultButtonProps:u,getQuizResultLinkProps:c}=D.useContext(Be),v=n&&((d=t==null?void 0:t.data)==null?void 0:d[n]),w=r&&((f=t==null?void 0:t.data)==null?void 0:f[r]),C=o&&((p=t==null?void 0:t.data)==null?void 0:p[o]),x=s&&((g=t==null?void 0:t.data)==null?void 0:g[s]),k=()=>{var m;return O.createElement(O.Fragment,null,O.createElement("div",{className:"cio-result-card-image"},O.createElement("img",{src:(m=t.data)==null?void 0:m.image_url,alt:"product"})),O.createElement("div",{className:"cio-result-card-text"},O.createElement("p",{className:"cio-result-card-title"},t.value),O.createElement("div",{className:"cio-result-card-details"},O.createElement("div",{className:"cio-result-card-rating"},x&&O.createElement("span",{className:"cio-result-card-rating-score"},Array(Number(x)).fill("★"),Array(5-Number(x)).fill("☆")),C&&O.createElement("span",{className:"cio-result-card-rating-count"},"(",C,")")),O.createElement("div",{className:"cio-result-card-prices"},v&&O.createElement("span",{className:"cio-result-card-sale-price"},"$",v),w&&O.createElement("span",{className:`cio-result-card-regular-price${v?"--strike-through":""}`},"$",w)))))},a=()=>u&&O.createElement("div",{...u({result:t,position:i,type:"button"})},k()),h=()=>c&&O.createElement("a",{className:"cio-result-card-anchor",rel:"noreferrer",target:"_blank",...c({result:t,position:i,type:"link"})},k());return O.createElement("div",{className:"cio-result-card"},l?a():h(),O.createElement(Oh,{item:t,price:v||w}))}function Lh(e){var s,l,u,c;const{resultCardSalePriceKey:t,resultCardRegularPriceKey:n,resultCardRatingCountKey:r,resultCardRatingScoreKey:i}=e,{state:o}=D.useContext(Be);return O.createElement("div",{className:"cio-results"},(c=(u=(l=(s=o==null?void 0:o.quiz)==null?void 0:s.results)==null?void 0:l.response)==null?void 0:u.results)==null?void 0:c.map((v,w)=>{var C;return O.createElement(Ah,{result:v,key:(C=v.data)==null?void 0:C.id,salePriceKey:t,regularPriceKey:n,ratingCountKey:r,ratingScoreKey:i,resultPosition:w+1})}))}function Vf(){return O.createElement("div",{className:"cio-spinner"},O.createElement("div",null),O.createElement("div",null),O.createElement("div",null),O.createElement("div",null))}function Bh(e){var c,v,w;const{options:t}=e,{resultCardSalePriceKey:n,resultCardRegularPriceKey:r,resultCardRatingCountKey:i,resultCardRatingScoreKey:o}=t,{state:s}=D.useContext(Be),l=!((w=(v=(c=s==null?void 0:s.quiz.results)==null?void 0:c.response)==null?void 0:v.results)!=null&&w.length),u=l?"":"Here are your results";return s!=null&&s.quiz.results?O.createElement("div",{className:"cio-results-container"},O.createElement("h1",{className:"cio-results-title"},u),O.createElement("div",{className:"cio-results-filter-and-redo-container"},O.createElement(Ph,{hasNoResults:l}),O.createElement(qh,null)),!l&&O.createElement(Lh,{resultCardSalePriceKey:n,resultCardRegularPriceKey:r,resultCardRatingCountKey:i,resultCardRatingScoreKey:o}),l&&O.createElement(Ih,null)):O.createElement("div",{className:"cio-results-container"},O.createElement(Vf,null))}const Uh="constructorIOQuizState";var Pt=(e=>(e.Stale="STALE",e.Loading="LOADING",e.Success="SUCCESS",e.Error="ERROR",e))(Pt||{}),He={},Mh={get exports(){return He},set exports(e){He=e}};(function(e){function t(n){return n&&n.__esModule?n:{default:n}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(Mh);var Pi={},Fh={get exports(){return Pi},set exports(e){Pi=e}},ia;function ft(){return ia||(ia=1,function(e){function t(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(Fh)),Pi}var Ii={},jh={get exports(){return Ii},set exports(e){Ii=e}},Oi={},Dh={get exports(){return Oi},set exports(e){Oi=e}},Ai={},Hh={get exports(){return Ai},set exports(e){Ai=e}},oa;function Tr(){return oa||(oa=1,function(e){function t(n){return e.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(Hh)),Ai}var Li={},Vh={get exports(){return Li},set exports(e){Li=e}},sa;function Qh(){return sa||(sa=1,function(e){var t=Tr().default;function n(r,i){if(t(r)!=="object"||r===null)return r;var o=r[Symbol.toPrimitive];if(o!==void 0){var s=o.call(r,i||"default");if(t(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(r)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}(Vh)),Li}var la;function Qf(){return la||(la=1,function(e){var t=Tr().default,n=Qh();function r(i){var o=n(i,"string");return t(o)==="symbol"?o:String(o)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}(Dh)),Oi}var ua;function dt(){return ua||(ua=1,function(e){var t=Qf();function n(i,o){for(var s=0;s<o.length;s++){var l=o[s];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(i,t(l.key),l)}}function r(i,o,s){return o&&n(i.prototype,o),s&&n(i,s),Object.defineProperty(i,"prototype",{writable:!1}),i}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}(jh)),Ii}function Wh(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Bi={},bh={get exports(){return Bi},set exports(e){Bi=e}},aa;function Kh(){return aa||(aa=1,function(e){(function(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:function(n){if(n==null)throw new TypeError("Cannot convert first argument to object");for(var r=Object(n),i=1;i<arguments.length;i++){var o=arguments[i];if(o!=null){o=Object(o);for(var s=Object.keys(Object(o)),l=0,u=s.length;u>l;l++){var c=s[l],v=Object.getOwnPropertyDescriptor(o,c);v!==void 0&&v.enumerable&&(r[c]=o[c])}}}return r}});var t=function(n){var r={user_agent:null,persist:!0,cookie_name_client_id:"ConstructorioID_client_id",cookie_name_session_id:"ConstructorioID_session_id",cookie_name_session_data:"ConstructorioID_session",cookie_domain:null,cookie_days_to_live:365,local_name_client_id:"_constructorio_search_client_id",local_name_session_id:"_constructorio_search_session_id",local_name_session_data:"_constructorio_search_session",on_node:typeof window>"u",session_is_new:null,client_id_storage_location:"cookie",session_id_storage_location:"local"};if(Object.assign(this,r,n),!this.client_id)if(!this.on_node&&this.persist){var i;this.client_id_storage_location==="cookie"&&(i=this.get_cookie(this.cookie_name_client_id)),this.client_id_storage_location==="local"&&(i=this.get_local_object(this.local_name_client_id)),this.client_id=i||this.generate_client_id()}else this.client_id=this.generate_client_id();this.session_id||(!this.on_node&&this.persist?this.session_id=this.generate_session_id():this.session_id=1),this.on_node||(this.user_agent=this.user_agent||window&&window.navigator&&window.navigator.userAgent)};t.prototype.set_cookie=function(n,r){if(!this.on_node&&this.persist){var i=new Date(Date.now()+this.cookie_days_to_live*24*60*60*1e3),o=n+"="+r+"; expires="+i.toUTCString()+"; path=/";return this.cookie_domain&&(o+="; domain="+this.cookie_domain),document.cookie=o,o}return null},t.prototype.get_cookie=function(n){for(var r=n+"=",i=document.cookie.split(";"),o=0;o<i.length;o++){var s=i[o];try{for(var l=decodeURIComponent(s);l.charAt(0)===" ";)l=l.substring(1);if(l.indexOf(r)===0)return l.substring(r.length,l.length)}catch{}}},t.prototype.delete_cookie=function(n){document.cookie=n+"=;expires=Thu, 01 Jan 1970 00:00:01 GMT;"},t.prototype.generate_client_id=function(){var n;if(!this.on_node){var r=this.get_cookie(this.cookie_name_client_id),i=this.get_local_object(this.local_name_client_id);this.client_id_storage_location==="cookie"&&i&&(n=i,this.set_cookie(this.cookie_name_client_id,n),this.delete_local_object(this.local_name_client_id)),this.client_id_storage_location==="local"&&r&&(n=r,this.set_local_object(this.local_name_client_id,n),this.delete_cookie(this.cookie_name_client_id))}return n||(n="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(o){var s=Math.random()*16|0,l=o==="x"?s:s&3|8;return l.toString(16)}),this.client_id_storage_location==="cookie"&&this.set_cookie(this.cookie_name_client_id,n),this.client_id_storage_location==="local"&&this.set_local_object(this.local_name_client_id,n)),n},t.prototype.get_local_object=function(n){var r,i=window&&window.localStorage;if(i&&typeof n=="string")try{r=JSON.parse(i.getItem(n))}catch{r=i.getItem(n)}return r},t.prototype.set_local_object=function(n,r){var i=window&&window.localStorage;if(i&&typeof n=="string"){if(typeof r=="object")try{i.setItem(n,JSON.stringify(r))}catch{}if(typeof r=="string"||typeof r=="number")try{i.setItem(n,r)}catch{}}},t.prototype.delete_local_object=function(n){var r=window&&window.localStorage;if(r&&typeof n=="string")try{r.removeItem(n)}catch{}},t.prototype.generate_session_id=function(){var n=this.get_cookie(this.cookie_name_session_data),r=this.get_local_object(this.local_name_session_data),i=Date.now(),o=1e3*60*30,s;if(this.session_id_storage_location==="local"&&(s=this.get_local_object(this.local_name_session_data),!s&&n&&(s=n,this.delete_cookie(this.cookie_name_session_data))),this.session_id_storage_location==="cookie"){s=this.get_cookie(this.cookie_name_session_data);try{s=JSON.parse(s)}catch{}!s&&r&&(s=r,this.delete_local_object(this.local_name_session_data))}var l=1,u=1;return s&&typeof s=="object"&&(u=parseInt(s.sessionId,10)||1,s.lastTime>i-o?l=u:l=u+1),this.session_id=l,this.session_is_new=!(s&&u===l),this.session_id_storage_location==="local"&&(this.set_local_object(this.local_name_session_id,l),this.set_local_object(this.local_name_session_data,{sessionId:l,lastTime:i})),this.session_id_storage_location==="cookie"&&(this.set_cookie(this.cookie_name_session_id,l),this.set_cookie(this.cookie_name_session_data,JSON.stringify({sessionId:l,lastTime:i}))),l},typeof Wh<"u"&&(e.exports=t)})()}(bh)),Bi}var or={},Gh={get exports(){return or},set exports(e){or=e}},ca;function Yh(){return ca||(ca=1,function(e,t){(function(n){function r(i){var o=i&&i.Promise||n.Promise,s=i&&i.XMLHttpRequest||n.XMLHttpRequest;return function(){var l=Object.create(n,{fetch:{value:void 0,writable:!0}});return function(u,c){c(t)}(this,function(u){var c=typeof l<"u"&&l||typeof self<"u"&&self||typeof c<"u"&&c,v={searchParams:"URLSearchParams"in c,iterable:"Symbol"in c&&"iterator"in Symbol,blob:"FileReader"in c&&"Blob"in c&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in c,arrayBuffer:"ArrayBuffer"in c};function w(z){return z&&DataView.prototype.isPrototypeOf(z)}if(v.arrayBuffer)var C=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],x=ArrayBuffer.isView||function(z){return z&&C.indexOf(Object.prototype.toString.call(z))>-1};function k(z){if(typeof z!="string"&&(z=String(z)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(z)||z==="")throw new TypeError("Invalid character in header field name");return z.toLowerCase()}function a(z){return typeof z!="string"&&(z=String(z)),z}function h(z){var R={next:function(){var P=z.shift();return{done:P===void 0,value:P}}};return v.iterable&&(R[Symbol.iterator]=function(){return R}),R}function d(z){this.map={},z instanceof d?z.forEach(function(R,P){this.append(P,R)},this):Array.isArray(z)?z.forEach(function(R){this.append(R[0],R[1])},this):z&&Object.getOwnPropertyNames(z).forEach(function(R){this.append(R,z[R])},this)}d.prototype.append=function(z,R){z=k(z),R=a(R);var P=this.map[z];this.map[z]=P?P+", "+R:R},d.prototype.delete=function(z){delete this.map[k(z)]},d.prototype.get=function(z){return z=k(z),this.has(z)?this.map[z]:null},d.prototype.has=function(z){return this.map.hasOwnProperty(k(z))},d.prototype.set=function(z,R){this.map[k(z)]=a(R)},d.prototype.forEach=function(z,R){for(var P in this.map)this.map.hasOwnProperty(P)&&z.call(R,this.map[P],P,this)},d.prototype.keys=function(){var z=[];return this.forEach(function(R,P){z.push(P)}),h(z)},d.prototype.values=function(){var z=[];return this.forEach(function(R){z.push(R)}),h(z)},d.prototype.entries=function(){var z=[];return this.forEach(function(R,P){z.push([P,R])}),h(z)},v.iterable&&(d.prototype[Symbol.iterator]=d.prototype.entries);function f(z){if(z.bodyUsed)return o.reject(new TypeError("Already read"));z.bodyUsed=!0}function p(z){return new o(function(R,P){z.onload=function(){R(z.result)},z.onerror=function(){P(z.error)}})}function g(z){var R=new FileReader,P=p(R);return R.readAsArrayBuffer(z),P}function m(z){var R=new FileReader,P=p(R);return R.readAsText(z),P}function E(z){for(var R=new Uint8Array(z),P=new Array(R.length),A=0;A<R.length;A++)P[A]=String.fromCharCode(R[A]);return P.join("")}function _(z){if(z.slice)return z.slice(0);var R=new Uint8Array(z.byteLength);return R.set(new Uint8Array(z)),R.buffer}function y(){return this.bodyUsed=!1,this._initBody=function(z){this.bodyUsed=this.bodyUsed,this._bodyInit=z,z?typeof z=="string"?this._bodyText=z:v.blob&&Blob.prototype.isPrototypeOf(z)?this._bodyBlob=z:v.formData&&FormData.prototype.isPrototypeOf(z)?this._bodyFormData=z:v.searchParams&&URLSearchParams.prototype.isPrototypeOf(z)?this._bodyText=z.toString():v.arrayBuffer&&v.blob&&w(z)?(this._bodyArrayBuffer=_(z.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):v.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(z)||x(z))?this._bodyArrayBuffer=_(z):this._bodyText=z=Object.prototype.toString.call(z):this._bodyText="",this.headers.get("content-type")||(typeof z=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):v.searchParams&&URLSearchParams.prototype.isPrototypeOf(z)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},v.blob&&(this.blob=function(){var z=f(this);if(z)return z;if(this._bodyBlob)return o.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return o.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return o.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var z=f(this);return z||(ArrayBuffer.isView(this._bodyArrayBuffer)?o.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):o.resolve(this._bodyArrayBuffer))}else return this.blob().then(g)}),this.text=function(){var z=f(this);if(z)return z;if(this._bodyBlob)return m(this._bodyBlob);if(this._bodyArrayBuffer)return o.resolve(E(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return o.resolve(this._bodyText)},v.formData&&(this.formData=function(){return this.text().then(q)}),this.json=function(){return this.text().then(JSON.parse)},this}var N=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function S(z){var R=z.toUpperCase();return N.indexOf(R)>-1?R:z}function T(z,R){if(!(this instanceof T))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');R=R||{};var P=R.body;if(z instanceof T){if(z.bodyUsed)throw new TypeError("Already read");this.url=z.url,this.credentials=z.credentials,R.headers||(this.headers=new d(z.headers)),this.method=z.method,this.mode=z.mode,this.signal=z.signal,!P&&z._bodyInit!=null&&(P=z._bodyInit,z.bodyUsed=!0)}else this.url=String(z);if(this.credentials=R.credentials||this.credentials||"same-origin",(R.headers||!this.headers)&&(this.headers=new d(R.headers)),this.method=S(R.method||this.method||"GET"),this.mode=R.mode||this.mode||null,this.signal=R.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&P)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(P),(this.method==="GET"||this.method==="HEAD")&&(R.cache==="no-store"||R.cache==="no-cache")){var A=/([?&])_=[^&]*/;if(A.test(this.url))this.url=this.url.replace(A,"$1_="+new Date().getTime());else{var U=/\?/;this.url+=(U.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}T.prototype.clone=function(){return new T(this,{body:this._bodyInit})};function q(z){var R=new FormData;return z.trim().split("&").forEach(function(P){if(P){var A=P.split("="),U=A.shift().replace(/\+/g," "),B=A.join("=").replace(/\+/g," ");R.append(decodeURIComponent(U),decodeURIComponent(B))}}),R}function I(z){var R=new d,P=z.replace(/\r?\n[\t ]+/g," ");return P.split("\r").map(function(A){return A.indexOf(`
|
|
43
|
+
`,"data-question-key":t.key},n?Fl(t.images,"cio-question-image-container"):"",O.createElement("div",{className:"cio-question-content"},O.createElement(Ul,{title:t==null?void 0:t.title}),O.createElement(Ml,{description:t.description}),O.createElement(Dl,{ctaButtonText:t==null?void 0:t.cta_text}))):null}function zh(){var o;const{state:e,getSelectInputProps:t}=D.useContext(Be);let n,r=!1,i;return e!=null&&e.quiz.currentQuestion&&(n=e.quiz.currentQuestion.next_question,r=n.options.some(s=>s.images),i=n.type===Y.MultipleSelect&&"Select one or more options"),n?O.createElement("div",{className:"cio-select-question-container","data-question-key":n.key},O.createElement("div",{className:"cio-select-question-text"},O.createElement(Ul,{title:n.title}),n!=null&&n.description?O.createElement(Ml,{description:n.description}):""),i&&O.createElement("div",{className:"cio-select-question-instructions"},i),O.createElement("div",{className:`${r?"cio-question-options-container":"cio-question-options-container-text-only"}`},(o=n==null?void 0:n.options)==null?void 0:o.map(s=>t&&O.createElement("div",{...t(s)},s.images?Fl(s.images,"cio-question-option-image"):"",O.createElement("div",{className:"cio-question-option-value"},s==null?void 0:s.value)))),O.createElement(Dl,{ctaButtonText:(n==null?void 0:n.cta_text)||"Continue"})):null}function Nh(){var r;const{state:e}=D.useContext(Be),t=(r=e==null?void 0:e.quiz.currentQuestion)==null?void 0:r.next_question,n=Hf(t==null?void 0:t.type);return O.createElement(O.Fragment,null,n.isOpenQuestion&&O.createElement(xh,{key:t==null?void 0:t.id}),n.isCoverQuestion&&O.createElement(Rh,{key:t==null?void 0:t.id}),n.isSelectQuestion&&O.createElement(zh,{key:t==null?void 0:t.id}))}function Th(){return O.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},O.createElement("g",{clipPath:"url(#clip0_7495_177230)"},O.createElement("path",{d:"M0.667969 2.66699V6.66699H4.66797",stroke:"#0A0B0C",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"}),O.createElement("path",{d:"M15.332 13.333V9.33301H11.332",stroke:"#0A0B0C",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"}),O.createElement("path",{d:"M13.6613 6.00038C13.3232 5.0449 12.7485 4.19064 11.991 3.51732C11.2334 2.844 10.3177 2.37355 9.32911 2.14988C8.34056 1.92621 7.31147 1.9566 6.33784 2.23823C5.36422 2.51985 4.4778 3.04352 3.7613 3.76038L0.667969 6.66704M15.3346 9.33371L12.2413 12.2404C11.5248 12.9572 10.6384 13.4809 9.66476 13.7625C8.69114 14.0441 7.66204 14.0745 6.67349 13.8509C5.68495 13.6272 4.76917 13.1568 4.01161 12.4834C3.25406 11.8101 2.67941 10.9559 2.3413 10.0004",stroke:"#0A0B0C",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"})),O.createElement("defs",null,O.createElement("clipPath",{id:"clip0_7495_177230"},O.createElement("rect",{width:"16",height:"16",fill:"white"}))))}function qh(e){const{redoText:t="Retake Quiz",disabled:n,...r}=e,{getResetQuizButtonProps:i}=D.useContext(Be);return i?O.createElement("button",{...r,...i("secondary")},O.createElement(Th,null),O.createElement("span",null,t)):null}function Ph({hasNoResults:e}){var n;const{state:t}=D.useContext(Be);return O.createElement("div",{className:"cio-results-filter-container"},O.createElement("p",null,e?"Your preferences":"Because you answered"),O.createElement("div",{className:"cio-results-filter-options"},(n=t==null?void 0:t.quiz.selectedOptionsWithAttributes)==null?void 0:n.map(r=>O.createElement("div",{className:"cio-results-filter-option",key:r},r))))}function Ih(){const{getResetQuizButtonProps:e}=D.useContext(Be);return O.createElement("div",{className:"cio-zero-results"},O.createElement("h3",{className:"cio-zero-results-subtitle"},"Sorry, we couldn’t find products that perfectly match your preferences."),O.createElement(qi,{ctaText:"Retake Quiz",propsGetters:e}))}function Oh(e){const{item:t,price:n}=e,{getAddToCartButtonProps:r}=D.useContext(Be);return r?O.createElement("button",{...r(t,n)},"Add to Cart"):null}function Ah(e){var f,p,g,m;const{result:t,salePriceKey:n,regularPriceKey:r,resultPosition:i,ratingCountKey:o,ratingScoreKey:s,renderResultCardPriceDetails:l}=e,{customClickItemCallback:u,getQuizResultButtonProps:c,getQuizResultLinkProps:v}=D.useContext(Be),w=n&&((f=t==null?void 0:t.data)==null?void 0:f[n]),C=r&&((p=t==null?void 0:t.data)==null?void 0:p[r]),x=o&&((g=t==null?void 0:t.data)==null?void 0:g[o]),k=s&&((m=t==null?void 0:t.data)==null?void 0:m[s]),a=()=>{var E;return O.createElement(O.Fragment,null,O.createElement("div",{className:"cio-result-card-image"},O.createElement("img",{src:(E=t.data)==null?void 0:E.image_url,alt:"product"})),O.createElement("div",{className:"cio-result-card-text"},O.createElement("p",{className:"cio-result-card-title"},t.value),O.createElement("div",{className:"cio-result-card-details"},O.createElement("div",{className:"cio-result-card-rating"},k&&O.createElement("span",{className:"cio-result-card-rating-score"},Array(Number(k)).fill("★"),Array(5-Number(k)).fill("☆")),x&&O.createElement("span",{className:"cio-result-card-rating-count"},"(",x,")")),l?l(t):O.createElement("div",{className:"cio-result-card-prices"},w&&O.createElement("span",{className:"cio-result-card-sale-price"},"$",w),C&&O.createElement("span",{className:`cio-result-card-regular-price${w?"--strike-through":""}`},"$",C)))))},h=()=>c&&O.createElement("div",{...c({result:t,position:i,type:"button"})},a()),d=()=>v&&O.createElement("a",{className:"cio-result-card-anchor",rel:"noreferrer",target:"_blank",...v({result:t,position:i,type:"link"})},a());return O.createElement("div",{className:"cio-result-card"},u?h():d(),O.createElement(Oh,{item:t,price:w||C}))}function Lh(e){var l,u,c,v;const{resultCardSalePriceKey:t,resultCardRegularPriceKey:n,resultCardRatingCountKey:r,resultCardRatingScoreKey:i,renderResultCardPriceDetails:o}=e,{state:s}=D.useContext(Be);return O.createElement("div",{className:"cio-results"},(v=(c=(u=(l=s==null?void 0:s.quiz)==null?void 0:l.results)==null?void 0:u.response)==null?void 0:c.results)==null?void 0:v.map((w,C)=>{var x;return O.createElement(Ah,{result:w,key:(x=w.data)==null?void 0:x.id,salePriceKey:t,regularPriceKey:n,ratingCountKey:r,ratingScoreKey:i,renderResultCardPriceDetails:o,resultPosition:C+1})}))}function Vf(){return O.createElement("div",{className:"cio-spinner"},O.createElement("div",null),O.createElement("div",null),O.createElement("div",null),O.createElement("div",null))}function Bh(e){var v,w,C;const{options:t}=e,{resultCardSalePriceKey:n,resultCardRegularPriceKey:r,resultCardRatingCountKey:i,resultCardRatingScoreKey:o,renderResultCardPriceDetails:s}=t,{state:l}=D.useContext(Be),u=!((C=(w=(v=l==null?void 0:l.quiz.results)==null?void 0:v.response)==null?void 0:w.results)!=null&&C.length),c=u?"":"Here are your results";return l!=null&&l.quiz.results?O.createElement("div",{className:"cio-results-container"},O.createElement("h1",{className:"cio-results-title"},c),O.createElement("div",{className:"cio-results-filter-and-redo-container"},O.createElement(Ph,{hasNoResults:u}),O.createElement(qh,null)),!u&&O.createElement(Lh,{resultCardSalePriceKey:n,resultCardRegularPriceKey:r,resultCardRatingCountKey:i,resultCardRatingScoreKey:o,renderResultCardPriceDetails:s}),u&&O.createElement(Ih,null)):O.createElement("div",{className:"cio-results-container"},O.createElement(Vf,null))}const Uh="constructorIOQuizState";var Pt=(e=>(e.Stale="STALE",e.Loading="LOADING",e.Success="SUCCESS",e.Error="ERROR",e))(Pt||{}),He={},Mh={get exports(){return He},set exports(e){He=e}};(function(e){function t(n){return n&&n.__esModule?n:{default:n}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(Mh);var Pi={},Fh={get exports(){return Pi},set exports(e){Pi=e}},ia;function ft(){return ia||(ia=1,function(e){function t(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(Fh)),Pi}var Ii={},jh={get exports(){return Ii},set exports(e){Ii=e}},Oi={},Dh={get exports(){return Oi},set exports(e){Oi=e}},Ai={},Hh={get exports(){return Ai},set exports(e){Ai=e}},oa;function Tr(){return oa||(oa=1,function(e){function t(n){return e.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(Hh)),Ai}var Li={},Vh={get exports(){return Li},set exports(e){Li=e}},sa;function Qh(){return sa||(sa=1,function(e){var t=Tr().default;function n(r,i){if(t(r)!=="object"||r===null)return r;var o=r[Symbol.toPrimitive];if(o!==void 0){var s=o.call(r,i||"default");if(t(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(r)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}(Vh)),Li}var la;function Qf(){return la||(la=1,function(e){var t=Tr().default,n=Qh();function r(i){var o=n(i,"string");return t(o)==="symbol"?o:String(o)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}(Dh)),Oi}var ua;function dt(){return ua||(ua=1,function(e){var t=Qf();function n(i,o){for(var s=0;s<o.length;s++){var l=o[s];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(i,t(l.key),l)}}function r(i,o,s){return o&&n(i.prototype,o),s&&n(i,s),Object.defineProperty(i,"prototype",{writable:!1}),i}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}(jh)),Ii}function Wh(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Bi={},bh={get exports(){return Bi},set exports(e){Bi=e}},aa;function Kh(){return aa||(aa=1,function(e){(function(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:function(n){if(n==null)throw new TypeError("Cannot convert first argument to object");for(var r=Object(n),i=1;i<arguments.length;i++){var o=arguments[i];if(o!=null){o=Object(o);for(var s=Object.keys(Object(o)),l=0,u=s.length;u>l;l++){var c=s[l],v=Object.getOwnPropertyDescriptor(o,c);v!==void 0&&v.enumerable&&(r[c]=o[c])}}}return r}});var t=function(n){var r={user_agent:null,persist:!0,cookie_name_client_id:"ConstructorioID_client_id",cookie_name_session_id:"ConstructorioID_session_id",cookie_name_session_data:"ConstructorioID_session",cookie_domain:null,cookie_days_to_live:365,local_name_client_id:"_constructorio_search_client_id",local_name_session_id:"_constructorio_search_session_id",local_name_session_data:"_constructorio_search_session",on_node:typeof window>"u",session_is_new:null,client_id_storage_location:"cookie",session_id_storage_location:"local"};if(Object.assign(this,r,n),!this.client_id)if(!this.on_node&&this.persist){var i;this.client_id_storage_location==="cookie"&&(i=this.get_cookie(this.cookie_name_client_id)),this.client_id_storage_location==="local"&&(i=this.get_local_object(this.local_name_client_id)),this.client_id=i||this.generate_client_id()}else this.client_id=this.generate_client_id();this.session_id||(!this.on_node&&this.persist?this.session_id=this.generate_session_id():this.session_id=1),this.on_node||(this.user_agent=this.user_agent||window&&window.navigator&&window.navigator.userAgent)};t.prototype.set_cookie=function(n,r){if(!this.on_node&&this.persist){var i=new Date(Date.now()+this.cookie_days_to_live*24*60*60*1e3),o=n+"="+r+"; expires="+i.toUTCString()+"; path=/";return this.cookie_domain&&(o+="; domain="+this.cookie_domain),document.cookie=o,o}return null},t.prototype.get_cookie=function(n){for(var r=n+"=",i=document.cookie.split(";"),o=0;o<i.length;o++){var s=i[o];try{for(var l=decodeURIComponent(s);l.charAt(0)===" ";)l=l.substring(1);if(l.indexOf(r)===0)return l.substring(r.length,l.length)}catch{}}},t.prototype.delete_cookie=function(n){document.cookie=n+"=;expires=Thu, 01 Jan 1970 00:00:01 GMT;"},t.prototype.generate_client_id=function(){var n;if(!this.on_node){var r=this.get_cookie(this.cookie_name_client_id),i=this.get_local_object(this.local_name_client_id);this.client_id_storage_location==="cookie"&&i&&(n=i,this.set_cookie(this.cookie_name_client_id,n),this.delete_local_object(this.local_name_client_id)),this.client_id_storage_location==="local"&&r&&(n=r,this.set_local_object(this.local_name_client_id,n),this.delete_cookie(this.cookie_name_client_id))}return n||(n="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(o){var s=Math.random()*16|0,l=o==="x"?s:s&3|8;return l.toString(16)}),this.client_id_storage_location==="cookie"&&this.set_cookie(this.cookie_name_client_id,n),this.client_id_storage_location==="local"&&this.set_local_object(this.local_name_client_id,n)),n},t.prototype.get_local_object=function(n){var r,i=window&&window.localStorage;if(i&&typeof n=="string")try{r=JSON.parse(i.getItem(n))}catch{r=i.getItem(n)}return r},t.prototype.set_local_object=function(n,r){var i=window&&window.localStorage;if(i&&typeof n=="string"){if(typeof r=="object")try{i.setItem(n,JSON.stringify(r))}catch{}if(typeof r=="string"||typeof r=="number")try{i.setItem(n,r)}catch{}}},t.prototype.delete_local_object=function(n){var r=window&&window.localStorage;if(r&&typeof n=="string")try{r.removeItem(n)}catch{}},t.prototype.generate_session_id=function(){var n=this.get_cookie(this.cookie_name_session_data),r=this.get_local_object(this.local_name_session_data),i=Date.now(),o=1e3*60*30,s;if(this.session_id_storage_location==="local"&&(s=this.get_local_object(this.local_name_session_data),!s&&n&&(s=n,this.delete_cookie(this.cookie_name_session_data))),this.session_id_storage_location==="cookie"){s=this.get_cookie(this.cookie_name_session_data);try{s=JSON.parse(s)}catch{}!s&&r&&(s=r,this.delete_local_object(this.local_name_session_data))}var l=1,u=1;return s&&typeof s=="object"&&(u=parseInt(s.sessionId,10)||1,s.lastTime>i-o?l=u:l=u+1),this.session_id=l,this.session_is_new=!(s&&u===l),this.session_id_storage_location==="local"&&(this.set_local_object(this.local_name_session_id,l),this.set_local_object(this.local_name_session_data,{sessionId:l,lastTime:i})),this.session_id_storage_location==="cookie"&&(this.set_cookie(this.cookie_name_session_id,l),this.set_cookie(this.cookie_name_session_data,JSON.stringify({sessionId:l,lastTime:i}))),l},typeof Wh<"u"&&(e.exports=t)})()}(bh)),Bi}var or={},Gh={get exports(){return or},set exports(e){or=e}},ca;function Yh(){return ca||(ca=1,function(e,t){(function(n){function r(i){var o=i&&i.Promise||n.Promise,s=i&&i.XMLHttpRequest||n.XMLHttpRequest;return function(){var l=Object.create(n,{fetch:{value:void 0,writable:!0}});return function(u,c){c(t)}(this,function(u){var c=typeof l<"u"&&l||typeof self<"u"&&self||typeof c<"u"&&c,v={searchParams:"URLSearchParams"in c,iterable:"Symbol"in c&&"iterator"in Symbol,blob:"FileReader"in c&&"Blob"in c&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in c,arrayBuffer:"ArrayBuffer"in c};function w(z){return z&&DataView.prototype.isPrototypeOf(z)}if(v.arrayBuffer)var C=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],x=ArrayBuffer.isView||function(z){return z&&C.indexOf(Object.prototype.toString.call(z))>-1};function k(z){if(typeof z!="string"&&(z=String(z)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(z)||z==="")throw new TypeError("Invalid character in header field name");return z.toLowerCase()}function a(z){return typeof z!="string"&&(z=String(z)),z}function h(z){var R={next:function(){var P=z.shift();return{done:P===void 0,value:P}}};return v.iterable&&(R[Symbol.iterator]=function(){return R}),R}function d(z){this.map={},z instanceof d?z.forEach(function(R,P){this.append(P,R)},this):Array.isArray(z)?z.forEach(function(R){this.append(R[0],R[1])},this):z&&Object.getOwnPropertyNames(z).forEach(function(R){this.append(R,z[R])},this)}d.prototype.append=function(z,R){z=k(z),R=a(R);var P=this.map[z];this.map[z]=P?P+", "+R:R},d.prototype.delete=function(z){delete this.map[k(z)]},d.prototype.get=function(z){return z=k(z),this.has(z)?this.map[z]:null},d.prototype.has=function(z){return this.map.hasOwnProperty(k(z))},d.prototype.set=function(z,R){this.map[k(z)]=a(R)},d.prototype.forEach=function(z,R){for(var P in this.map)this.map.hasOwnProperty(P)&&z.call(R,this.map[P],P,this)},d.prototype.keys=function(){var z=[];return this.forEach(function(R,P){z.push(P)}),h(z)},d.prototype.values=function(){var z=[];return this.forEach(function(R){z.push(R)}),h(z)},d.prototype.entries=function(){var z=[];return this.forEach(function(R,P){z.push([P,R])}),h(z)},v.iterable&&(d.prototype[Symbol.iterator]=d.prototype.entries);function f(z){if(z.bodyUsed)return o.reject(new TypeError("Already read"));z.bodyUsed=!0}function p(z){return new o(function(R,P){z.onload=function(){R(z.result)},z.onerror=function(){P(z.error)}})}function g(z){var R=new FileReader,P=p(R);return R.readAsArrayBuffer(z),P}function m(z){var R=new FileReader,P=p(R);return R.readAsText(z),P}function E(z){for(var R=new Uint8Array(z),P=new Array(R.length),A=0;A<R.length;A++)P[A]=String.fromCharCode(R[A]);return P.join("")}function _(z){if(z.slice)return z.slice(0);var R=new Uint8Array(z.byteLength);return R.set(new Uint8Array(z)),R.buffer}function y(){return this.bodyUsed=!1,this._initBody=function(z){this.bodyUsed=this.bodyUsed,this._bodyInit=z,z?typeof z=="string"?this._bodyText=z:v.blob&&Blob.prototype.isPrototypeOf(z)?this._bodyBlob=z:v.formData&&FormData.prototype.isPrototypeOf(z)?this._bodyFormData=z:v.searchParams&&URLSearchParams.prototype.isPrototypeOf(z)?this._bodyText=z.toString():v.arrayBuffer&&v.blob&&w(z)?(this._bodyArrayBuffer=_(z.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):v.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(z)||x(z))?this._bodyArrayBuffer=_(z):this._bodyText=z=Object.prototype.toString.call(z):this._bodyText="",this.headers.get("content-type")||(typeof z=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):v.searchParams&&URLSearchParams.prototype.isPrototypeOf(z)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},v.blob&&(this.blob=function(){var z=f(this);if(z)return z;if(this._bodyBlob)return o.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return o.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return o.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var z=f(this);return z||(ArrayBuffer.isView(this._bodyArrayBuffer)?o.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):o.resolve(this._bodyArrayBuffer))}else return this.blob().then(g)}),this.text=function(){var z=f(this);if(z)return z;if(this._bodyBlob)return m(this._bodyBlob);if(this._bodyArrayBuffer)return o.resolve(E(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return o.resolve(this._bodyText)},v.formData&&(this.formData=function(){return this.text().then(q)}),this.json=function(){return this.text().then(JSON.parse)},this}var N=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function S(z){var R=z.toUpperCase();return N.indexOf(R)>-1?R:z}function T(z,R){if(!(this instanceof T))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');R=R||{};var P=R.body;if(z instanceof T){if(z.bodyUsed)throw new TypeError("Already read");this.url=z.url,this.credentials=z.credentials,R.headers||(this.headers=new d(z.headers)),this.method=z.method,this.mode=z.mode,this.signal=z.signal,!P&&z._bodyInit!=null&&(P=z._bodyInit,z.bodyUsed=!0)}else this.url=String(z);if(this.credentials=R.credentials||this.credentials||"same-origin",(R.headers||!this.headers)&&(this.headers=new d(R.headers)),this.method=S(R.method||this.method||"GET"),this.mode=R.mode||this.mode||null,this.signal=R.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&P)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(P),(this.method==="GET"||this.method==="HEAD")&&(R.cache==="no-store"||R.cache==="no-cache")){var A=/([?&])_=[^&]*/;if(A.test(this.url))this.url=this.url.replace(A,"$1_="+new Date().getTime());else{var U=/\?/;this.url+=(U.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}T.prototype.clone=function(){return new T(this,{body:this._bodyInit})};function q(z){var R=new FormData;return z.trim().split("&").forEach(function(P){if(P){var A=P.split("="),U=A.shift().replace(/\+/g," "),B=A.join("=").replace(/\+/g," ");R.append(decodeURIComponent(U),decodeURIComponent(B))}}),R}function I(z){var R=new d,P=z.replace(/\r?\n[\t ]+/g," ");return P.split("\r").map(function(A){return A.indexOf(`
|
|
44
44
|
`)===0?A.substr(1,A.length):A}).forEach(function(A){var U=A.split(":"),B=U.shift().trim();if(B){var W=U.join(":").trim();R.append(B,W)}}),R}y.call(T.prototype);function M(z,R){if(!(this instanceof M))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');R||(R={}),this.type="default",this.status=R.status===void 0?200:R.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in R?R.statusText:"",this.headers=new d(R.headers),this.url=R.url||"",this._initBody(z)}y.call(M.prototype),M.prototype.clone=function(){return new M(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},M.error=function(){var z=new M(null,{status:0,statusText:""});return z.type="error",z};var H=[301,302,303,307,308];M.redirect=function(z,R){if(H.indexOf(R)===-1)throw new RangeError("Invalid status code");return new M(null,{status:R,headers:{location:z}})},u.DOMException=c.DOMException;try{new u.DOMException}catch{u.DOMException=function(R,P){this.message=R,this.name=P;var A=Error(R);this.stack=A.stack},u.DOMException.prototype=Object.create(Error.prototype),u.DOMException.prototype.constructor=u.DOMException}function F(z,R){return new o(function(P,A){var U=new T(z,R);if(U.signal&&U.signal.aborted)return A(new u.DOMException("Aborted","AbortError"));var B=new s;function W(){B.abort()}B.onload=function(){var V={status:B.status,statusText:B.statusText,headers:I(B.getAllResponseHeaders()||"")};V.url="responseURL"in B?B.responseURL:V.headers.get("X-Request-URL");var b="response"in B?B.response:B.responseText;setTimeout(function(){P(new M(b,V))},0)},B.onerror=function(){setTimeout(function(){A(new TypeError("Network request failed"))},0)},B.ontimeout=function(){setTimeout(function(){A(new TypeError("Network request failed"))},0)},B.onabort=function(){setTimeout(function(){A(new u.DOMException("Aborted","AbortError"))},0)};function Q(V){try{return V===""&&c.location.href?c.location.href:V}catch{return V}}B.open(U.method,Q(U.url),!0),U.credentials==="include"?B.withCredentials=!0:U.credentials==="omit"&&(B.withCredentials=!1),"responseType"in B&&(v.blob?B.responseType="blob":v.arrayBuffer&&U.headers.get("Content-Type")&&U.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(B.responseType="arraybuffer")),R&&typeof R.headers=="object"&&!(R.headers instanceof d)?Object.getOwnPropertyNames(R.headers).forEach(function(V){B.setRequestHeader(V,a(R.headers[V]))}):U.headers.forEach(function(V,b){B.setRequestHeader(b,V)}),U.signal&&(U.signal.addEventListener("abort",W),B.onreadystatechange=function(){B.readyState===4&&U.signal.removeEventListener("abort",W)}),B.send(typeof U._bodyInit>"u"?null:U._bodyInit)})}F.polyfill=!0,c.fetch||(c.fetch=F,c.Headers=d,c.Request=T,c.Response=M),u.Headers=d,u.Request=T,u.Response=M,u.fetch=F,Object.defineProperty(u,"__esModule",{value:!0})}),{fetch:l.fetch,Headers:l.Headers,Request:l.Request,Response:l.Response,DOMException:l.DOMException}}()}e.exports=r})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:It)}(Gh,or)),or}var Oo={};/*! crc32.js (C) 2014-present SheetJS -- http://sheetjs.com */var fa;function Xh(){return fa||(fa=1,function(e){(function(t){t(typeof DO_NOT_EXPORT_CRC>"u"?e:{})})(function(t){t.version="1.2.2";function n(){for(var y=0,N=new Array(256),S=0;S!=256;++S)y=S,y=y&1?-306674912^y>>>1:y>>>1,y=y&1?-306674912^y>>>1:y>>>1,y=y&1?-306674912^y>>>1:y>>>1,y=y&1?-306674912^y>>>1:y>>>1,y=y&1?-306674912^y>>>1:y>>>1,y=y&1?-306674912^y>>>1:y>>>1,y=y&1?-306674912^y>>>1:y>>>1,y=y&1?-306674912^y>>>1:y>>>1,N[S]=y;return typeof Int32Array<"u"?new Int32Array(N):N}var r=n();function i(y){var N=0,S=0,T=0,q=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(T=0;T!=256;++T)q[T]=y[T];for(T=0;T!=256;++T)for(S=y[T],N=256+T;N<4096;N+=256)S=q[N]=S>>>8^y[S&255];var I=[];for(T=1;T!=16;++T)I[T-1]=typeof Int32Array<"u"?q.subarray(T*256,T*256+256):q.slice(T*256,T*256+256);return I}var o=i(r),s=o[0],l=o[1],u=o[2],c=o[3],v=o[4],w=o[5],C=o[6],x=o[7],k=o[8],a=o[9],h=o[10],d=o[11],f=o[12],p=o[13],g=o[14];function m(y,N){for(var S=N^-1,T=0,q=y.length;T<q;)S=S>>>8^r[(S^y.charCodeAt(T++))&255];return~S}function E(y,N){for(var S=N^-1,T=y.length-15,q=0;q<T;)S=g[y[q++]^S&255]^p[y[q++]^S>>8&255]^f[y[q++]^S>>16&255]^d[y[q++]^S>>>24]^h[y[q++]]^a[y[q++]]^k[y[q++]]^x[y[q++]]^C[y[q++]]^w[y[q++]]^v[y[q++]]^c[y[q++]]^u[y[q++]]^l[y[q++]]^s[y[q++]]^r[y[q++]];for(T+=15;q<T;)S=S>>>8^r[(S^y[q++])&255];return~S}function _(y,N){for(var S=N^-1,T=0,q=y.length,I=0,M=0;T<q;)I=y.charCodeAt(T++),I<128?S=S>>>8^r[(S^I)&255]:I<2048?(S=S>>>8^r[(S^(192|I>>6&31))&255],S=S>>>8^r[(S^(128|I&63))&255]):I>=55296&&I<57344?(I=(I&1023)+64,M=y.charCodeAt(T++)&1023,S=S>>>8^r[(S^(240|I>>8&7))&255],S=S>>>8^r[(S^(128|I>>2&63))&255],S=S>>>8^r[(S^(128|M>>6&15|(I&3)<<4))&255],S=S>>>8^r[(S^(128|M&63))&255]):(S=S>>>8^r[(S^(224|I>>12&15))&255],S=S>>>8^r[(S^(128|I>>6&63))&255],S=S>>>8^r[(S^(128|I&63))&255]);return~S}t.table=r,t.bstr=m,t.buf=E,t.str=_})}(Oo)),Oo}var Ui={},Jh={get exports(){return Ui},set exports(e){Ui=e}};/*! store2 - v2.14.2 - 2022-07-18
|
|
45
45
|
* Copyright (c) 2022 Nathan Bubna; Licensed (MIT OR GPL-3.0) */var da;function Zh(){return da||(da=1,function(e){(function(t,n){var r={version:"2.14.2",areas:{},apis:{},nsdelim:".",inherit:function(o,s){for(var l in o)s.hasOwnProperty(l)||Object.defineProperty(s,l,Object.getOwnPropertyDescriptor(o,l));return s},stringify:function(o,s){return o===void 0||typeof o=="function"?o+"":JSON.stringify(o,s||r.replace)},parse:function(o,s){try{return JSON.parse(o,s||r.revive)}catch{return o}},fn:function(o,s){r.storeAPI[o]=s;for(var l in r.apis)r.apis[l][o]=s},get:function(o,s){return o.getItem(s)},set:function(o,s,l){o.setItem(s,l)},remove:function(o,s){o.removeItem(s)},key:function(o,s){return o.key(s)},length:function(o){return o.length},clear:function(o){o.clear()},Store:function(o,s,l){var u=r.inherit(r.storeAPI,function(v,w,C){return arguments.length===0?u.getAll():typeof w=="function"?u.transact(v,w,C):w!==void 0?u.set(v,w,C):typeof v=="string"||typeof v=="number"?u.get(v):typeof v=="function"?u.each(v):v?u.setAll(v,w):u.clear()});u._id=o;try{var c="__store2_test";s.setItem(c,"ok"),u._area=s,s.removeItem(c)}catch{u._area=r.storage("fake")}return u._ns=l||"",r.areas[o]||(r.areas[o]=u._area),r.apis[u._ns+u._id]||(r.apis[u._ns+u._id]=u),u},storeAPI:{area:function(o,s){var l=this[o];return(!l||!l.area)&&(l=r.Store(o,s,this._ns),this[o]||(this[o]=l)),l},namespace:function(o,s,l){if(l=l||this._delim||r.nsdelim,!o)return this._ns?this._ns.substring(0,this._ns.length-l.length):"";var u=o,c=this[u];if((!c||!c.namespace)&&(c=r.Store(this._id,this._area,this._ns+u+l),c._delim=l,this[u]||(this[u]=c),!s))for(var v in r.areas)c.area(v,r.areas[v]);return c},isFake:function(o){return o?(this._real=this._area,this._area=r.storage("fake")):o===!1&&(this._area=this._real||this._area),this._area.name==="fake"},toString:function(){return"store"+(this._ns?"."+this.namespace():"")+"["+this._id+"]"},has:function(o){return this._area.has?this._area.has(this._in(o)):this._in(o)in this._area},size:function(){return this.keys().length},each:function(o,s){for(var l=0,u=r.length(this._area);l<u;l++){var c=this._out(r.key(this._area,l));if(c!==void 0&&o.call(this,c,this.get(c),s)===!1)break;u>r.length(this._area)&&(u--,l--)}return s||this},keys:function(o){return this.each(function(s,l,u){u.push(s)},o||[])},get:function(o,s){var l=r.get(this._area,this._in(o)),u;return typeof s=="function"&&(u=s,s=null),l!==null?r.parse(l,u):s??l},getAll:function(o){return this.each(function(s,l,u){u[s]=l},o||{})},transact:function(o,s,l){var u=this.get(o,l),c=s(u);return this.set(o,c===void 0?u:c),this},set:function(o,s,l){var u=this.get(o),c;return u!=null&&l===!1?s:(typeof l=="function"&&(c=l,l=void 0),r.set(this._area,this._in(o),r.stringify(s,c),l)||u)},setAll:function(o,s){var l,u;for(var c in o)u=o[c],this.set(c,u,s)!==u&&(l=!0);return l},add:function(o,s,l){var u=this.get(o);if(u instanceof Array)s=u.concat(s);else if(u!==null){var c=typeof u;if(c===typeof s&&c==="object"){for(var v in s)u[v]=s[v];s=u}else s=u+s}return r.set(this._area,this._in(o),r.stringify(s,l)),s},remove:function(o,s){var l=this.get(o,s);return r.remove(this._area,this._in(o)),l},clear:function(){return this._ns?this.each(function(o){r.remove(this._area,this._in(o))},1):r.clear(this._area),this},clearAll:function(){var o=this._area;for(var s in r.areas)r.areas.hasOwnProperty(s)&&(this._area=r.areas[s],this.clear());return this._area=o,this},_in:function(o){return typeof o!="string"&&(o=r.stringify(o)),this._ns?this._ns+o:o},_out:function(o){return this._ns?o&&o.indexOf(this._ns)===0?o.substring(this._ns.length):void 0:o}},storage:function(o){return r.inherit(r.storageAPI,{items:{},name:o})},storageAPI:{length:0,has:function(o){return this.items.hasOwnProperty(o)},key:function(o){var s=0;for(var l in this.items)if(this.has(l)&&o===s++)return l},setItem:function(o,s){this.has(o)||this.length++,this.items[o]=s},removeItem:function(o){this.has(o)&&(delete this.items[o],this.length--)},getItem:function(o){return this.has(o)?this.items[o]:null},clear:function(){for(var o in this.items)this.removeItem(o)}}},i=r.Store("local",function(){try{return localStorage}catch{}}());i.local=i,i._=r,i.area("session",function(){try{return sessionStorage}catch{}}()),i.area("page",r.storage("page")),typeof n=="function"&&n.amd!==void 0?n("store2",[],function(){return i}):e.exports?e.exports=i:(t.store&&(r.conflict=t.store),t.store=i)})(It,It&&It.define)}(Jh)),Ui}var Ao,pa;function $h(){return pa||(pa=1,Ao=function(e,t){var n=t.set,r=t.get,i=t.remove,o=t.key,s=t.length,l=t.clear;t.overflow=function(u,c){var v=u===t.areas.local?"+local+":u===t.areas.session?"+session+":!1;if(v){var w=t.areas[v];return c&&!w?w=e.area(v)._area:c===!1&&(delete t.areas[v],delete e[v]),w}},t.set=function(u,c,v){try{n.apply(this,arguments)}catch(w){if(w.name==="QUOTA_EXCEEDED_ERR"||w.name==="NS_ERROR_DOM_QUOTA_REACHED"||w.toString().indexOf("QUOTA_EXCEEDED_ERR")!==-1||w.toString().indexOf("QuotaExceededError")!==-1)return t.set(t.overflow(u,!0),c,v);throw w}},t.get=function(u,c){var v=t.overflow(u);return v&&r.call(this,v,c)||r.apply(this,arguments)},t.remove=function(u,c){var v=t.overflow(u);v&&i.call(this,v,c),i.apply(this,arguments)},t.key=function(u,c){var v=t.overflow(u);if(v){var w=s.call(this,u);if(c>=w){c=c-w;for(var C=0,x=s.call(this,v);C<x;C++)if(C===c)return o.call(this,v,C)}}return o.apply(this,arguments)},t.length=function(u){var c=s(u),v=t.overflow(u);return v?c+s(v):c},t.clear=function(u){t.overflow(u,!1),l.apply(this,arguments)}}),Ao}var Lo,ha;function Hl(){if(ha)return Lo;ha=1;var e=Zh(),t=$h();return t(e,e._),Lo=e,Lo}var Bo,va;function pt(){if(va)return Bo;va=1;var e=He,t=e(Tr()),n=Xh(),r=Hl(),i="_constructorio_purchase_order_ids",o={trimNonBreakingSpaces:function(l){return l.replace(/\s/g," ").trim()},encodeURIComponentRFC3986:function(l){return encodeURIComponent(l).replace(/[!'()*]/g,function(u){return"%".concat(u.charCodeAt(0).toString(16).toUpperCase())})},cleanParams:function(l){var u={};return Object.keys(l).forEach(function(c){var v=l[c];typeof v=="string"?u[c]=o.trimNonBreakingSpaces(v):u[c]=v}),u},throwHttpErrorFromResponse:function(l,u){return u.json().then(function(c){throw l.message=c.message,l.status=u.status,l.statusText=u.statusText,l.url=u.url,l.headers=u.headers,l})},canUseDOM:function(){return!!(typeof window<"u"&&window.document&&window.document.createElement)},addEventListener:function(l,u,c){o.canUseDOM()&&window.addEventListener(l,u,c)},removeEventListener:function(l,u,c){o.canUseDOM()&&window.removeEventListener(l,u,c)},getNavigator:function(){return o.canUseDOM()?window.navigator:{userAgent:"",webdriver:!1}},isNil:function(l){return l==null},getWindowLocation:function(){return o.canUseDOM()?window.location:{}},dispatchEvent:function(l){o.canUseDOM()&&window.dispatchEvent(l)},createCustomEvent:function(l,u){if(o.canUseDOM())try{return new window.CustomEvent(l,{detail:u})}catch{var c=document.createEvent("CustomEvent");return c.initCustomEvent(l,!1,!1,u),c}return null},hasOrderIdRecord:function(l){var u=n.str(l.toString()),c=r.local.get(i);return typeof c=="string"&&(c=JSON.parse(c)),c&&c.includes(u)?!0:null},addOrderIdRecord:function(l){var u=n.str(l.toString()),c=r.local.get(i);if(typeof c=="string"&&(c=JSON.parse(c)),c){if(c.includes(u))return;c.length>=10&&(c=c.slice(-9)),c.push(u)}else c=[u];r.local.set(i,c)},applyNetworkTimeout:function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,v=l&&l.networkParameters&&l.networkParameters.timeout,w=u&&u.timeout,C=w||v;typeof C=="number"&&c&&setTimeout(function(){return c.abort()},C)},stringify:function(l,u,c){if(!l)return"";var v=[];return Object.keys(l).forEach(function(w){var C=l[w],x=o.encodeURIComponentRFC3986(w),k;if(C!=null){var a=u?"".concat(u,"%5B").concat(x,"%5D"):x;Array.isArray(C)?k=o.stringify(C,a,"array"):(0,t.default)(C)==="object"?k=o.stringify(C,a,"object"):c==="object"?k="".concat(a,"=").concat(o.encodeURIComponentRFC3986(C)):k="".concat(u||x,"=").concat(o.encodeURIComponentRFC3986(C)),v.push(k)}}),v.join("&")},toSnakeCase:function(l){return l.replace(/[A-Z]/g,function(u){return"_".concat(u.toLowerCase())})},toSnakeCaseKeys:function(l){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,c={};return Object.keys(l).forEach(function(v){var w=o.toSnakeCase(v);c[w]=u&&(0,t.default)(l[v])==="object"&&!Array.isArray(l[v])?o.toSnakeCaseKeys(l[v],u):l[v]}),c}};return Bo=o,Bo}var Uo,ga;function Bn(){if(ga)return Uo;ga=1;var e=He,t=e(ft()),n=e(dt()),r=pt(),i=function(){function o(s){var l=this;(0,t.default)(this,o),this.events=[],this.enabled=!(s&&s.enabled===!1),this.waitForBeacon=!(s&&s.waitForBeacon===!1),this.active=this.enabled,this.waitForBeacon&&(this.active=!1,r.canUseDOM()&&(window.ConstructorioAutocomplete||window.ConstructorioBeacon||window.ConstructorioTracker)&&this.enabled&&(this.active=!0,this.dispatchEvents()),r.addEventListener("cio.beacon.loaded",function(){l.enabled&&(l.active=!0,l.dispatchEvents())}))}return(0,n.default)(o,[{key:"queue",value:function(l,u){this.events.push({name:l,data:u}),this.active&&this.dispatchEvents()}},{key:"dispatchEvents",value:function(){for(;this.events.length;){var l=this.events.shift(),u=l.name,c=l.data,v="cio.client.".concat(u);r.dispatchEvent(r.createCustomEvent(v,c))}}}]),o}();return Uo=i,Uo}var Mo,ya;function ev(){if(ya)return Mo;ya=1;var e=He,t=e(ft()),n=e(dt()),r=Bn(),i=pt();function o(l,u,c){var v=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,w=c.apiKey,C=c.version,x=c.serviceUrl,k=c.sessionId,a=c.clientId,h=c.userId,d=c.segments,f=c.testCells,p={c:C};if(p.key=w,p.i=a,p.s=k,!l||typeof l!="string")throw new Error("query is a required parameter of type string");if(f&&Object.keys(f).forEach(function(P){p["ef-".concat(P)]=f[P]}),d&&d.length&&(p.us=d),h&&(p.ui=String(h)),u){var g=u.offset,m=u.page,E=u.resultsPerPage,_=u.filters,y=u.sortBy,N=u.sortOrder,S=u.section,T=u.fmtOptions,q=u.hiddenFields,I=u.hiddenFacets,M=u.variationsMap,H=u.qsParam,F=u.preFilterExpression;i.isNil(g)||(p.offset=g),i.isNil(m)||(p.page=m),i.isNil(E)||(p.num_results_per_page=E),_&&(p.filters=_),y&&(p.sort_by=y),N&&(p.sort_order=N),S&&(p.section=S),T&&(p.fmt_options=T),q&&(p.fmt_options?p.fmt_options.hidden_fields=q:p.fmt_options={hidden_fields:q}),I&&(p.fmt_options?p.fmt_options.hidden_facets=I:p.fmt_options={hidden_facets:I}),M&&(p.variations_map=JSON.stringify(M)),F&&(p.pre_filter_expression=JSON.stringify(F)),H&&(p.qs=JSON.stringify(H))}p._dt=Date.now(),p=i.cleanParams(p);var z=i.stringify(p),R=v?"search/natural_language":"search";return"".concat(x,"/").concat(R,"/").concat(i.encodeURIComponentRFC3986(i.trimNonBreakingSpaces(l)),"?").concat(z)}var s=function(){function l(u){(0,t.default)(this,l),this.options=u||{},this.eventDispatcher=new r(u.eventDispatcher)}return(0,n.default)(l,[{key:"getSearchResults",value:function(c,v){var w=this,C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},x,k=this.options.fetch,a;if(typeof AbortController=="function"){var h=new AbortController;a=h&&h.signal,i.applyNetworkTimeout(this.options,C,h)}try{x=o(c,v,this.options)}catch(d){return Promise.reject(d)}return k(x,{signal:a}).then(function(d){return d.ok?d.json():i.throwHttpErrorFromResponse(new Error,d)}).then(function(d){if(d.response&&d.response.results)return d.result_id&&d.response.results.forEach(function(f){f.result_id=d.result_id}),w.eventDispatcher.queue("search.getSearchResults.completed",d),d;if(d.response&&d.response.redirect)return w.eventDispatcher.queue("search.getSearchResults.completed",d),d;throw new Error("getSearchResults response data is malformed")})}},{key:"getVoiceSearchResults",value:function(c,v){var w=this,C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},x,k=this.options.fetch,a;if(typeof AbortController=="function"){var h=new AbortController;a=h&&h.signal,i.applyNetworkTimeout(this.options,C,h)}try{var d=!0;x=o(c,v,this.options,d)}catch(f){return Promise.reject(f)}return k(x,{signal:a}).then(function(f){return f.ok?f.json():i.throwHttpErrorFromResponse(new Error,f)}).then(function(f){if(f.response&&f.response.results)return f.result_id&&f.response.results.forEach(function(p){p.result_id=f.result_id}),w.eventDispatcher.queue("search.getVoiceSearchResults.completed",f),f;if(f.response&&f.response.redirect)return w.eventDispatcher.queue("search.getVoiceSearchResults.completed",f),f;throw new Error("getVoiceSearchResults response data is malformed")})}}]),l}();return Mo=s,Mo}var Mi={},tv={get exports(){return Mi},set exports(e){Mi=e}},ma;function Wf(){return ma||(ma=1,function(e){var t=Qf();function n(r,i,o){return i=t(i),i in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o,r}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}(tv)),Mi}var Fo,_a;function nv(){if(_a)return Fo;_a=1;var e=He,t=e(ft()),n=e(dt()),r=e(Wf());function i(k,a){var h=Object.keys(k);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(k);a&&(d=d.filter(function(f){return Object.getOwnPropertyDescriptor(k,f).enumerable})),h.push.apply(h,d)}return h}function o(k){for(var a=1;a<arguments.length;a++){var h=arguments[a]!=null?arguments[a]:{};a%2?i(Object(h),!0).forEach(function(d){(0,r.default)(k,d,h[d])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(h)):i(Object(h)).forEach(function(d){Object.defineProperty(k,d,Object.getOwnPropertyDescriptor(h,d))})}return k}var s=Bn(),l=pt();function u(k,a){var h=a.apiKey,d=a.version,f=a.sessionId,p=a.clientId,g=a.userId,m=a.segments,E=a.testCells,_={c:d};if(_.key=h,_.i=p,_.s=f,E&&Object.keys(E).forEach(function(U){_["ef-".concat(U)]=E[U]}),m&&m.length&&(_.us=m),g&&(_.ui=String(g)),k){var y=k.page,N=k.offset,S=k.resultsPerPage,T=k.filters,q=k.sortBy,I=k.sortOrder,M=k.section,H=k.fmtOptions,F=k.hiddenFields,z=k.hiddenFacets,R=k.variationsMap,P=k.qsParam,A=k.preFilterExpression;l.isNil(y)||(_.page=y),l.isNil(N)||(_.offset=N),l.isNil(S)||(_.num_results_per_page=S),T&&(_.filters=T),q&&(_.sort_by=q),I&&(_.sort_order=I),M&&(_.section=M),H&&(_.fmt_options=H),F&&(_.fmt_options?_.fmt_options.hidden_fields=F:_.fmt_options={hidden_fields:F}),z&&(_.fmt_options?_.fmt_options.hidden_facets=z:_.fmt_options={hidden_facets:z}),R&&(_.variations_map=JSON.stringify(R)),A&&(_.pre_filter_expression=JSON.stringify(A)),P&&(_.qs=JSON.stringify(P))}return _._dt=Date.now(),_=l.cleanParams(_),_}function c(k,a,h,d){var f=d.serviceUrl;if(!k||typeof k!="string")throw new Error("filterName is a required parameter of type string");if(!a||typeof a!="string")throw new Error("filterValue is a required parameter of type string");var p=u(h,d),g=l.stringify(p);return"".concat(f,"/browse/").concat(l.encodeURIComponentRFC3986(l.trimNonBreakingSpaces(k)),"/").concat(l.encodeURIComponentRFC3986(l.trimNonBreakingSpaces(a)),"?").concat(g)}function v(k,a,h){var d=h.serviceUrl;if(!k||!Array.isArray(k)||!k.length)throw new Error("ids is a required parameter of type array");var f=o(o({},u(a,h)),{},{ids:k}),p=l.stringify(f);return"".concat(d,"/browse/items?").concat(p)}function w(k,a){var h=a.serviceUrl,d=o({},u(k,a));delete d._dt;var f=l.stringify(d);return"".concat(h,"/browse/facets?").concat(f)}function C(k,a,h){var d=h.serviceUrl;if(!k||typeof k!="string")throw new Error("facetName is a required parameter of type string");var f=o({},u(a,h));f.facet_name=k,delete f._dt;var p=l.stringify(f);return"".concat(d,"/browse/facet_options?").concat(p)}var x=function(){function k(a){(0,t.default)(this,k),this.options=a||{},this.eventDispatcher=new s(a.eventDispatcher)}return(0,n.default)(k,[{key:"getBrowseResults",value:function(h,d,f){var p=this,g=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},m,E=this.options.fetch,_;if(typeof AbortController=="function"){var y=new AbortController;_=y&&y.signal,l.applyNetworkTimeout(this.options,g,y)}try{m=c(h,d,f,this.options)}catch(N){return Promise.reject(N)}return E(m,{signal:_}).then(function(N){return N.ok?N.json():l.throwHttpErrorFromResponse(new Error,N)}).then(function(N){if(N.response&&N.response.results)return N.result_id&&N.response.results.forEach(function(S){S.result_id=N.result_id}),p.eventDispatcher.queue("browse.getBrowseResults.completed",N),N;throw new Error("getBrowseResults response data is malformed")})}},{key:"getBrowseResultsForItemIds",value:function(h,d){var f=this,p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},g,m=this.options.fetch,E;if(typeof AbortController=="function"){var _=new AbortController;E=_&&_.signal,l.applyNetworkTimeout(this.options,p,_)}try{g=v(h,d,this.options)}catch(y){return Promise.reject(y)}return m(g,{signal:E}).then(function(y){return y.ok?y.json():l.throwHttpErrorFromResponse(new Error,y)}).then(function(y){if(y.response&&y.response.results)return y.result_id&&y.response.results.forEach(function(N){N.result_id=y.result_id}),f.eventDispatcher.queue("browse.getBrowseResultsForItemIds.completed",y),y;throw new Error("getBrowseResultsForItemIds response data is malformed")})}},{key:"getBrowseGroups",value:function(h){var d=this,f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},p=this.options.fetch,g=this.options.serviceUrl,m=u(h,this.options),E;if(typeof AbortController=="function"){var _=new AbortController;E=_&&_.signal,l.applyNetworkTimeout(this.options,f,_)}delete m._dt;var y=l.stringify(m),N="".concat(g,"/browse/groups?").concat(y);return p(N,{signal:E}).then(function(S){return S.ok?S.json():l.throwHttpErrorFromResponse(new Error,S)}).then(function(S){if(S.response&&S.response.groups)return d.eventDispatcher.queue("browse.getBrowseGroups.completed",S),S;throw new Error("getBrowseGroups response data is malformed")})}},{key:"getBrowseFacets",value:function(h,d){var f=this,p,g=this.options.fetch,m;if(typeof AbortController=="function"){var E=new AbortController;m=E&&E.signal,l.applyNetworkTimeout(this.options,d,E)}try{p=w(h,this.options)}catch(_){return Promise.reject(_)}return g(p,{signal:m}).then(function(_){return _.ok?_.json():l.throwHttpErrorFromResponse(new Error,_)}).then(function(_){if(_.response&&_.response.facets)return f.eventDispatcher.queue("browse.getBrowseFacets.completed",_),_;throw new Error("getBrowseFacets response data is malformed")})}},{key:"getBrowseFacetOptions",value:function(h){var d=this,f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},g,m=this.options.fetch,E;if(typeof AbortController=="function"){var _=new AbortController;E=_&&_.signal,l.applyNetworkTimeout(this.options,p,_)}try{g=C(h,f,this.options)}catch(y){return Promise.reject(y)}return m(g,{signal:E}).then(function(y){return y.ok?y.json():l.throwHttpErrorFromResponse(new Error,y)}).then(function(y){if(y.response&&y.response.facets)return d.eventDispatcher.queue("browse.getBrowseFacetOptions.completed",y),y;throw new Error("getBrowseFacetOptions response data is malformed")})}}]),k}();return Fo=x,Fo}var jo,wa;function rv(){if(wa)return jo;wa=1;var e=He,t=e(ft()),n=e(dt()),r=Bn(),i=pt(),o=i.throwHttpErrorFromResponse,s=i.cleanParams,l=i.applyNetworkTimeout,u=i.trimNonBreakingSpaces,c=i.encodeURIComponentRFC3986,v=i.stringify;function w(x,k,a){var h=a.apiKey,d=a.version,f=a.serviceUrl,p=a.sessionId,g=a.clientId,m=a.userId,E=a.segments,_=a.testCells,y={c:d};if(y.key=h,y.i=g,y.s=p,!x||typeof x!="string")throw new Error("query is a required parameter of type string");if(_&&Object.keys(_).forEach(function(F){y["ef-".concat(F)]=_[F]}),E&&E.length&&(y.us=E),m&&(y.ui=String(m)),k){var N=k.numResults,S=k.resultsPerSection,T=k.filters,q=k.hiddenFields,I=k.variationsMap;N&&(y.num_results=N),S&&Object.keys(S).forEach(function(F){y["num_results_".concat(F)]=S[F]}),T&&(y.filters=T),q&&(y.fmt_options?y.fmt_options.hidden_fields=q:y.fmt_options={hidden_fields:q}),I&&(y.variations_map=JSON.stringify(I))}y._dt=Date.now(),y=s(y);var M=v(y),H=x.replace(/^\//,"|");return"".concat(f,"/autocomplete/").concat(c(u(H)),"?").concat(M)}var C=function(){function x(k){(0,t.default)(this,x),this.options=k||{},this.eventDispatcher=new r(k.eventDispatcher)}return(0,n.default)(x,[{key:"getAutocompleteResults",value:function(a,h){var d=this,f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},p,g=this.options.fetch,m;if(typeof AbortController=="function"){var E=new AbortController;m=E&&E.signal,l(this.options,f,E)}try{p=w(a,h,this.options)}catch(_){return Promise.reject(_)}return g(p,{signal:m}).then(function(_){return _.ok?_.json():o(new Error,_)}).then(function(_){if(_.sections){if(_.result_id){var y=Object.keys(_.sections);y.forEach(function(N){var S=_.sections[N];S.length&&S.forEach(function(T){T.result_id=_.result_id})})}return d.eventDispatcher.queue("autocomplete.getAutocompleteResults.completed",_),_}throw new Error("getAutocompleteResults response data is malformed")})}}]),x}();return jo=C,jo}var Do,ka;function iv(){if(ka)return Do;ka=1;var e=He,t=e(ft()),n=e(dt()),r=Bn(),i=pt();function o(l,u,c){var v=c.apiKey,w=c.version,C=c.serviceUrl,x=c.sessionId,k=c.userId,a=c.clientId,h=c.segments,d={c:w};if(d.key=v,d.i=a,d.s=x,!l||typeof l!="string")throw new Error("podId is a required parameter of type string");if(h&&h.length&&(d.us=h),k&&(d.ui=String(k)),u){var f=u.numResults,p=u.itemIds,g=u.section,m=u.term,E=u.filters,_=u.variationsMap,y=u.hiddenFields;i.isNil(f)||(d.num_results=f),p&&(d.item_id=p),g&&(d.section=g),m&&(d.term=m),E&&(d.filters=E),y&&(d.fmt_options?d.fmt_options.hidden_fields=y:d.fmt_options={hidden_fields:y}),_&&(d.variations_map=JSON.stringify(_))}d=i.cleanParams(d);var N=i.stringify(d);return"".concat(C,"/recommendations/v1/pods/").concat(i.encodeURIComponentRFC3986(i.trimNonBreakingSpaces(l)),"?").concat(N)}var s=function(){function l(u){(0,t.default)(this,l),this.options=u||{},this.eventDispatcher=new r(u.eventDispatcher)}return(0,n.default)(l,[{key:"getRecommendations",value:function(c,v){var w=this,C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},x,k=this.options.fetch,a;if(typeof AbortController=="function"){var h=new AbortController;a=h&&h.signal,i.applyNetworkTimeout(this.options,C,h)}try{x=o(c,v,this.options)}catch(d){return Promise.reject(d)}return k(x,{signal:a}).then(function(d){return d.ok?d.json():i.throwHttpErrorFromResponse(new Error,d)}).then(function(d){if(d.response&&d.response.results)return d.result_id&&d.response.results.forEach(function(f){f.result_id=d.result_id}),w.eventDispatcher.queue("recommendations.getRecommendations.completed",d),d;throw new Error("getRecommendations response data is malformed")})}}]),l}();return Do=s,Do}var sr={},ov={get exports(){return sr},set exports(e){sr=e}},Sa;function sv(){if(Sa)return sr;Sa=1;var e=typeof Reflect=="object"?Reflect:null,t=e&&typeof e.apply=="function"?e.apply:function(m,E,_){return Function.prototype.apply.call(m,E,_)},n;e&&typeof e.ownKeys=="function"?n=e.ownKeys:Object.getOwnPropertySymbols?n=function(m){return Object.getOwnPropertyNames(m).concat(Object.getOwnPropertySymbols(m))}:n=function(m){return Object.getOwnPropertyNames(m)};function r(g){console&&console.warn&&console.warn(g)}var i=Number.isNaN||function(m){return m!==m};function o(){o.init.call(this)}ov.exports=o,sr.once=d,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function l(g){if(typeof g!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof g)}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(g){if(typeof g!="number"||g<0||i(g))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+g+".");s=g}}),o.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(m){if(typeof m!="number"||m<0||i(m))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+m+".");return this._maxListeners=m,this};function u(g){return g._maxListeners===void 0?o.defaultMaxListeners:g._maxListeners}o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(m){for(var E=[],_=1;_<arguments.length;_++)E.push(arguments[_]);var y=m==="error",N=this._events;if(N!==void 0)y=y&&N.error===void 0;else if(!y)return!1;if(y){var S;if(E.length>0&&(S=E[0]),S instanceof Error)throw S;var T=new Error("Unhandled error."+(S?" ("+S.message+")":""));throw T.context=S,T}var q=N[m];if(q===void 0)return!1;if(typeof q=="function")t(q,this,E);else for(var I=q.length,M=k(q,I),_=0;_<I;++_)t(M[_],this,E);return!0};function c(g,m,E,_){var y,N,S;if(l(E),N=g._events,N===void 0?(N=g._events=Object.create(null),g._eventsCount=0):(N.newListener!==void 0&&(g.emit("newListener",m,E.listener?E.listener:E),N=g._events),S=N[m]),S===void 0)S=N[m]=E,++g._eventsCount;else if(typeof S=="function"?S=N[m]=_?[E,S]:[S,E]:_?S.unshift(E):S.push(E),y=u(g),y>0&&S.length>y&&!S.warned){S.warned=!0;var T=new Error("Possible EventEmitter memory leak detected. "+S.length+" "+String(m)+" listeners added. Use emitter.setMaxListeners() to increase limit");T.name="MaxListenersExceededWarning",T.emitter=g,T.type=m,T.count=S.length,r(T)}return g}o.prototype.addListener=function(m,E){return c(this,m,E,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(m,E){return c(this,m,E,!0)};function v(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function w(g,m,E){var _={fired:!1,wrapFn:void 0,target:g,type:m,listener:E},y=v.bind(_);return y.listener=E,_.wrapFn=y,y}o.prototype.once=function(m,E){return l(E),this.on(m,w(this,m,E)),this},o.prototype.prependOnceListener=function(m,E){return l(E),this.prependListener(m,w(this,m,E)),this},o.prototype.removeListener=function(m,E){var _,y,N,S,T;if(l(E),y=this._events,y===void 0)return this;if(_=y[m],_===void 0)return this;if(_===E||_.listener===E)--this._eventsCount===0?this._events=Object.create(null):(delete y[m],y.removeListener&&this.emit("removeListener",m,_.listener||E));else if(typeof _!="function"){for(N=-1,S=_.length-1;S>=0;S--)if(_[S]===E||_[S].listener===E){T=_[S].listener,N=S;break}if(N<0)return this;N===0?_.shift():a(_,N),_.length===1&&(y[m]=_[0]),y.removeListener!==void 0&&this.emit("removeListener",m,T||E)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(m){var E,_,y;if(_=this._events,_===void 0)return this;if(_.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):_[m]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete _[m]),this;if(arguments.length===0){var N=Object.keys(_),S;for(y=0;y<N.length;++y)S=N[y],S!=="removeListener"&&this.removeAllListeners(S);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(E=_[m],typeof E=="function")this.removeListener(m,E);else if(E!==void 0)for(y=E.length-1;y>=0;y--)this.removeListener(m,E[y]);return this};function C(g,m,E){var _=g._events;if(_===void 0)return[];var y=_[m];return y===void 0?[]:typeof y=="function"?E?[y.listener||y]:[y]:E?h(y):k(y,y.length)}o.prototype.listeners=function(m){return C(this,m,!0)},o.prototype.rawListeners=function(m){return C(this,m,!1)},o.listenerCount=function(g,m){return typeof g.listenerCount=="function"?g.listenerCount(m):x.call(g,m)},o.prototype.listenerCount=x;function x(g){var m=this._events;if(m!==void 0){var E=m[g];if(typeof E=="function")return 1;if(E!==void 0)return E.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]};function k(g,m){for(var E=new Array(m),_=0;_<m;++_)E[_]=g[_];return E}function a(g,m){for(;m+1<g.length;m++)g[m]=g[m+1];g.pop()}function h(g){for(var m=new Array(g.length),E=0;E<m.length;++E)m[E]=g[E].listener||g[E];return m}function d(g,m){return new Promise(function(E,_){function y(S){g.removeListener(m,N),_(S)}function N(){typeof g.removeListener=="function"&&g.removeListener("error",y),E([].slice.call(arguments))}p(g,m,N,{once:!0}),m!=="error"&&f(g,y,{once:!0})})}function f(g,m,E){typeof g.on=="function"&&p(g,"error",m,E)}function p(g,m,E,_){if(typeof g.on=="function")_.once?g.once(m,E):g.on(m,E);else if(typeof g.addEventListener=="function")g.addEventListener(m,function y(N){_.once&&g.removeEventListener(m,y),E(N)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof g)}return sr}var Ho,Ea;function lv(){return Ea||(Ea=1,Ho=["Googlebot/","Googlebot-Mobile","Googlebot-Image","Googlebot-News","Googlebot-Video","AdsBot-Google([^-]|$)","AdsBot-Google-Mobile","Feedfetcher-Google","Mediapartners-Google","Mediapartners \\(Googlebot\\)","APIs-Google","bingbot","Slurp","[wW]get","curl","LinkedInBot","Python-urllib","python-requests","libwww","httpunit","nutch","Go-http-client","phpcrawl","msnbot","jyxobot","FAST-WebCrawler","FAST Enterprise Crawler","BIGLOTRON","Teoma","convera","seekbot","Gigabot","Gigablast","exabot","ia_archiver","GingerCrawler","webmon ","HTTrack","grub\\.org","UsineNouvelleCrawler","antibot","netresearchserver","speedy","fluffy","bibnum\\.bnf","findlink","msrbot","panscient","yacybot","AISearchBot","ips-agent","tagoobot","MJ12bot","woriobot","yanga","buzzbot","mlbot","YandexBot","yandex\\.com/bots","purebot","Linguee Bot","CyberPatrol","voilabot","Baiduspider","citeseerxbot","spbot","twengabot","postrank","turnitinbot","scribdbot","page2rss","sitebot","linkdex","Adidxbot","blekkobot","ezooms","dotbot","Mail\\.RU_Bot","discobot","heritrix","findthatfile","europarchive\\.org","NerdByNature\\.Bot","sistrix crawler","Ahrefs(Bot|SiteAudit)","fuelbot","CrunchBot","centurybot9","IndeedBot","mappydata","woobot","ZoominfoBot","PrivacyAwareBot","Multiviewbot","SWIMGBot","Grobbot","eright","Apercite","semanticbot","Aboundex","domaincrawler","wbsearchbot","summify","CCBot","edisterbot","seznambot","ec2linkfinder","gslfbot","aiHitBot","intelium_bot","facebookexternalhit","Yeti","RetrevoPageAnalyzer","lb-spider","Sogou","lssbot","careerbot","wotbox","wocbot","ichiro","DuckDuckBot","lssrocketcrawler","drupact","webcompanycrawler","acoonbot","openindexspider","gnam gnam spider","web-archive-net\\.com\\.bot","backlinkcrawler","coccoc","integromedb","content crawler spider","toplistbot","it2media-domain-crawler","ip-web-crawler\\.com","siteexplorer\\.info","elisabot","proximic","changedetection","arabot","WeSEE:Search","niki-bot","CrystalSemanticsBot","rogerbot","360Spider","psbot","InterfaxScanBot","CC Metadata Scaper","g00g1e\\.net","GrapeshotCrawler","urlappendbot","brainobot","fr-crawler","binlar","SimpleCrawler","Twitterbot","cXensebot","smtbot","bnf\\.fr_bot","A6-Indexer","ADmantX","Facebot","OrangeBot/","memorybot","AdvBot","MegaIndex","SemanticScholarBot","ltx71","nerdybot","xovibot","BUbiNG","Qwantify","archive\\.org_bot","Applebot","TweetmemeBot","crawler4j","findxbot","S[eE][mM]rushBot","yoozBot","lipperhey","Y!J","Domain Re-Animator Bot","AddThis","Screaming Frog SEO Spider","MetaURI","Scrapy","Livelap[bB]ot","OpenHoseBot","CapsuleChecker","collection@infegy\\.com","IstellaBot","DeuSu/","betaBot","Cliqzbot/","MojeekBot/","netEstate NE Crawler","SafeSearch microdata crawler","Gluten Free Crawler/","Sonic","Sysomos","Trove","deadlinkchecker","Slack-ImgProxy","Embedly","RankActiveLinkBot","iskanie","SafeDNSBot","SkypeUriPreview","Veoozbot","Slackbot","redditbot","datagnionbot","Google-Adwords-Instant","adbeat_bot","WhatsApp","contxbot","pinterest","electricmonk","GarlikCrawler","BingPreview/","vebidoobot","FemtosearchBot","Yahoo Link Preview","MetaJobBot","DomainStatsBot","mindUpBot","Daum/","Jugendschutzprogramm-Crawler","Xenu Link Sleuth","Pcore-HTTP","moatbot","KosmioBot","pingdom","PhantomJS","Gowikibot","PiplBot","Discordbot","TelegramBot","Jetslide","newsharecounts","James BOT","Barkrowler","TinEye","SocialRankIOBot","trendictionbot","Ocarinabot","epicbot","Primalbot","DuckDuckGo-Favicons-Bot","GnowitNewsbot","Leikibot","LinkArchiver","YaK/","PaperLiBot","Digg Deeper","dcrawl","Snacktory","AndersPinkBot","Fyrebot","EveryoneSocialBot","Mediatoolkitbot","Luminator-robots","ExtLinksBot","SurveyBot","NING/","okhttp","Nuzzel","omgili","PocketParser","YisouSpider","um-LN","ToutiaoSpider","MuckRack","Jamie's Spider","AHC/","NetcraftSurveyAgent","Laserlikebot","Apache-HttpClient","AppEngine-Google","Jetty","Upflow","Thinklab","Traackr\\.com","Twurly","Mastodon","http_get","DnyzBot","botify","007ac9 Crawler","BehloolBot","BrandVerity","check_http","BDCbot","ZumBot","EZID","ICC-Crawler","ArchiveBot","^LCC ","filterdb\\.iss\\.net/crawler","BLP_bbot","BomboraBot","Buck/","Companybook-Crawler","Genieo","magpie-crawler","MeltwaterNews","Moreover","newspaper/","ScoutJet","(^| )sentry/","StorygizeBot","UptimeRobot","OutclicksBot","seoscanners","Hatena","Google Web Preview","MauiBot","AlphaBot","SBL-BOT","IAS crawler","adscanner","Netvibes","acapbot","Baidu-YunGuanCe","bitlybot","blogmuraBot","Bot\\.AraTurka\\.com","bot-pge\\.chlooe\\.com","BoxcarBot","BTWebClient","ContextAd Bot","Digincore bot","Disqus","Feedly","Fetch/","Fever","Flamingo_SearchEngine","FlipboardProxy","g2reader-bot","imrbot","K7MLWCBot","Kemvibot","Landau-Media-Spider","linkapediabot","vkShare","Siteimprove\\.com","BLEXBot/","DareBoost","ZuperlistBot/","Miniflux/","Feedspotbot/","Diffbot/","SEOkicks","tracemyfile","Nimbostratus-Bot"]),Ho}var Vo,Ca;function uv(){if(Ca)return Vo;Ca=1;var e=He,t=e(ft()),n=e(dt()),r=Hl(),i=lv(),o=pt(),s="_constructorio_is_human",l=["scroll","resize","touchmove","mouseover","mousemove","keydown","keypress","keyup","focus"],u=function(){function c(){var v=this;(0,t.default)(this,c),this.isHumanBoolean=this.getIsHumanFromSessionStorage();var w=function C(){v.isHumanBoolean=!0,r.session.set(s,!0),l.forEach(function(x){o.removeEventListener(x,C,!0)})};this.isHumanBoolean||l.forEach(function(C){o.addEventListener(C,w,!0)})}return(0,n.default)(c,[{key:"getIsHumanFromSessionStorage",value:function(){return!!r.session.get(s)||!1}},{key:"isHuman",value:function(){return this.isHumanBoolean||!!r.session.get(s)}},{key:"isBot",value:function(){if(this.getIsHumanFromSessionStorage())return!1;var w=o.getNavigator(),C=w.userAgent,x=w.webdriver,k=new RegExp("(".concat(i.join("|"),")"));return!!C.match(k)||!!x}}]),c}();return Vo=u,Vo}var Qo,xa;function av(){if(xa)return Qo;xa=1;var e=He,t=e(ft()),n=e(dt()),r=Hl(),i=uv(),o=pt(),s="_constructorio_requests",l=18e4,u=function(){function c(v,w){var C=this;(0,t.default)(this,c),this.options=v,this.eventemitter=w,this.humanity=new i,this.requestPending=!1,this.pageUnloading=!1,this.sendTrackingEvents=!!(v&&v.sendTrackingEvents===!0),o.addEventListener("beforeunload",function(){C.pageUnloading=!0}),this.sendTrackingEvents&&this.send()}return(0,n.default)(c,[{key:"queue",value:function(w){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GET",x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},k=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};if(this.sendTrackingEvents&&!this.humanity.isBot()){var a=c.get();a.push({url:w,method:C,body:x,networkParameters:k}),c.set(a)}}},{key:"sendEvents",value:function(){var w=this,C=this.options.fetch,x=c.get();if((!o.canUseDOM()||this.humanity.isHuman())&&!this.requestPending&&!this.pageUnloading&&x.length){var k,a=x.shift(),h=a,d=h.networkParameters,f,p=this;if(c.set(x),d&&typeof AbortController=="function"){var g=new AbortController;f=g.signal,o.applyNetworkTimeout(this.options,d,g)}if(typeof a=="string"&&(a={url:a,method:"GET"}),a.url){var m=a.url.match(/\?.*_dt=([^&]+)/),E=parseInt(m&&m[1],10),_=+new Date;if(E&&Number.isInteger(E)&&_-E>l){this.sendTrackingEvents=!1,c.remove();return}}a.method==="GET"&&(k=C(a.url,{signal:f})),a.method==="POST"&&(k=C(a.url,{method:a.method,body:JSON.stringify(a.body),mode:"cors",headers:{"Content-Type":"text/plain"},signal:f})),k&&(this.requestPending=!0,k.then(function(y){y.ok?(p.eventemitter&&p.eventemitter.emit("success",{url:a.url,method:a.method,message:"ok"}),w.requestPending=!1,w.send()):y.json().then(function(N){p.eventemitter&&p.eventemitter.emit("error",{url:a.url,method:a.method,message:N&&N.message}),w.requestPending=!1,w.send()}).catch(function(N){p.eventemitter&&p.eventemitter.emit("error",{url:a.url,method:a.method,message:N.type}),w.requestPending=!1,w.send()})}).catch(function(y){p.eventemitter&&p.eventemitter.emit("error",{url:a.url,method:a.method,message:y&&y.toString&&y.toString()}),w.requestPending=!1,w.send()}))}}},{key:"send",value:function(){this.sendTrackingEvents&&(this.options&&this.options.trackingSendDelay===0?this.sendEvents():setTimeout(this.sendEvents.bind(this),this.options&&this.options.trackingSendDelay||250))}}],[{key:"get",value:function(){return r.local.get(s)||[]}},{key:"set",value:function(w){!w||Array.isArray(w)&&w.length===0?c.remove():r.local.set(s,w);var C=c.get();Array.isArray(C)&&C.length!==w.length&&(this.sendTrackingEvents=!1,c.remove())}},{key:"remove",value:function(){r.local.remove(s)}}]),c}();return Qo=u,Qo}var Wo,Ra;function cv(){if(Ra)return Wo;Ra=1;var e=He,t=e(Wf()),n=e(Tr()),r=e(ft()),i=e(dt());function o(x,k){var a=Object.keys(x);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(x);k&&(h=h.filter(function(d){return Object.getOwnPropertyDescriptor(x,d).enumerable})),a.push.apply(a,h)}return a}function s(x){for(var k=1;k<arguments.length;k++){var a=arguments[k]!=null?arguments[k]:{};k%2?o(Object(a),!0).forEach(function(h){(0,t.default)(x,h,a[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(x,Object.getOwnPropertyDescriptors(a)):o(Object(a)).forEach(function(h){Object.defineProperty(x,h,Object.getOwnPropertyDescriptor(a,h))})}return x}var l=sv(),u=pt(),c=av();function v(x,k){var a=k.apiKey,h=k.version,d=k.sessionId,f=k.clientId,p=k.userId,g=k.segments,m=k.testCells,E=k.requestMethod,_=k.beaconMode,y=u.getWindowLocation(),N=y.host,S=y.pathname,T=k.sendReferrerWithTrackingEvents!==!1,q=Object.assign(x);return h&&(q.c=h),f&&(q.i=f),d&&(q.s=d),p&&(q.ui=String(p)),g&&g.length&&(q.us=g),a&&(q.key=a),m&&Object.keys(m).forEach(function(I){q["ef-".concat(I)]=m[I]}),_&&E&&E.match(/POST/i)&&(q.beacon=!0),T&&N&&(q.origin_referrer=N,S&&(q.origin_referrer+=S)),q._dt=Date.now(),q=u.cleanParams(q),q}function w(x,k){return u.stringify(v(x,k))}var C=function(){function x(k){(0,r.default)(this,x),this.options=k||{},this.eventemitter=new l,this.requests=new c(k,this.eventemitter),this.behavioralV2Url="https://ac.cnstrc.com/v2/behavioral_action/"}return(0,i.default)(x,[{key:"trackSessionStartV2",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},h="".concat(this.behavioralV2Url,"session_start?");return this.requests.queue("".concat(h).concat(w({},this.options)),"POST",void 0,a),this.requests.send(),!0}},{key:"trackSessionStart",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},h="".concat(this.options.serviceUrl,"/behavior?"),d={action:"session_start"};return this.requests.queue("".concat(h).concat(w(d,this.options)),void 0,void 0,a),this.requests.send(),!0}},{key:"trackInputFocusV2",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},d="".concat(this.behavioralV2Url,"focus?"),f={},p=h,g=a;(0,n.default)(a)==="object"&&(p=a,g=""),f.user_input=g;var m="POST",E=v(f,s(s({},this.options),{},{requestMethod:m}));return this.requests.queue("".concat(d).concat(w({},this.options)),m,E,p),this.requests.send(),!0}},{key:"trackInputFocus",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},h="".concat(this.options.serviceUrl,"/behavior?"),d={action:"focus"};return this.requests.queue("".concat(h).concat(w(d,this.options)),void 0,void 0,a),this.requests.send(),!0}},{key:"trackItemDetailLoad",value:function(a){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(a&&(0,n.default)(a)==="object"&&!Array.isArray(a)){var d="".concat(this.options.serviceUrl,"/v2/behavioral_action/item_detail_load?"),f={},p={},g=a.item_name,m=a.name,E=a.item_id,_=a.customer_id,y=a.customerId,N=y===void 0?_:y,S=a.variation_id,T=a.itemName,q=T===void 0?g||m:T,I=a.itemId,M=I===void 0?E||N:I,H=a.variationId,F=H===void 0?S:H,z=a.url;q&&(p.item_name=q),M&&(p.item_id=M),F&&(p.variation_id=F),z&&(p.url=z);var R="".concat(d).concat(w(f,this.options)),P="POST",A=v(p,s(s({},this.options),{},{requestMethod:P}));return this.requests.queue(R,P,A,h),this.requests.send(),!0}return this.requests.send(),new Error("parameters are required of type object")}},{key:"trackAutocompleteSelectV2",value:function(a,h){var d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(a&&typeof a=="string"){if(h&&(0,n.default)(h)==="object"&&!Array.isArray(h)){var f="".concat(this.behavioralV2Url,"autocomplete_select?"),p=h.original_query,g=h.originalQuery,m=g===void 0?p:g,E=h.user_input,_=h.userInput,y=_===void 0?m||E:_,N=h.original_section,S=h.section,T=S===void 0?N:S,q=h.tr,I=h.group_id,M=h.groupId,H=M===void 0?I:M,F=h.item_id,z=h.itemId,R=z===void 0?F:z,P=h.variation_id,A=h.variationId,U=A===void 0?P:A,B={},W={user_input:y,tr:q,group_id:H,item_id:R,variation_id:U,item_name:a,section:T};T&&(B.section=T);var Q="".concat(f).concat(w(B,this.options)),V="POST",b=v(W,s(s({},this.options),{},{requestMethod:V}));return this.requests.queue(Q,V,b,d),this.requests.send(),!0}return this.requests.send(),new Error("parameters are required of type object")}return this.requests.send(),new Error("term is a required parameter of type string")}},{key:"trackAutocompleteSelect",value:function(a,h){var d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(a&&typeof a=="string"){if(h&&(0,n.default)(h)==="object"&&!Array.isArray(h)){var f="".concat(this.options.serviceUrl,"/autocomplete/").concat(u.encodeURIComponentRFC3986(u.trimNonBreakingSpaces(a)),"/select?"),p={},g=h.original_query,m=h.originalQuery,E=m===void 0?g:m,_=h.section,y=h.original_section,N=h.originalSection,S=N===void 0?y:N,T=h.tr,q=h.group_id,I=h.groupId,M=I===void 0?q:I,H=h.display_name,F=h.displayName,z=F===void 0?H:F;return E&&(p.original_query=E),T&&(p.tr=T),(S||_)&&(p.section=S||_),M&&(p.group={group_id:M,display_name:z}),this.requests.queue("".concat(f).concat(w(p,this.options)),void 0,void 0,d),this.requests.send(),!0}return this.requests.send(),new Error("parameters are required of type object")}return this.requests.send(),new Error("term is a required parameter of type string")}},{key:"trackSearchSubmitV2",value:function(a,h){var d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(a&&typeof a=="string"){if(h&&(0,n.default)(h)==="object"&&!Array.isArray(h)){var f="".concat(this.behavioralV2Url,"search_submit?"),p=h.original_query,g=h.originalQuery,m=g===void 0?p:g,E=h.user_input,_=h.userInput,y=_===void 0?m||E:_,N=h.group_id,S=h.groupId,T=S===void 0?N:S,q=h.section,I={},M={user_input:y,search_term:a,section:q};T&&(M.filters={group_id:T}),q&&(I.section=q);var H="".concat(f).concat(w(I,this.options)),F="POST",z=v(M,s(s({},this.options),{},{requestMethod:F}));return this.requests.queue(H,F,z,d),this.requests.send(),!0}return this.requests.send(),new Error("parameters are required of type object")}return this.requests.send(),new Error("term is a required parameter of type string")}},{key:"trackSearchSubmit",value:function(a,h){var d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(a&&typeof a=="string"){if(h&&(0,n.default)(h)==="object"&&!Array.isArray(h)){var f="".concat(this.options.serviceUrl,"/autocomplete/").concat(u.encodeURIComponentRFC3986(u.trimNonBreakingSpaces(a)),"/search?"),p={},g=h.original_query,m=h.originalQuery,E=m===void 0?g:m,_=h.group_id,y=h.groupId,N=y===void 0?_:y,S=h.display_name,T=h.displayName,q=T===void 0?S:T;return E&&(p.original_query=E),N&&(p.group={group_id:N,display_name:q}),this.requests.queue("".concat(f).concat(w(p,this.options)),void 0,void 0,d),this.requests.send(),!0}return this.requests.send(),new Error("parameters are required of type object")}return this.requests.send(),new Error("term is a required parameter of type string")}},{key:"trackSearchResultsLoadedV2",value:function(a,h){var d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(a&&typeof a=="string"){if(h&&(0,n.default)(h)==="object"&&!Array.isArray(h)){var f="".concat(this.behavioralV2Url,"search_result_load?"),p=h.num_results,g=h.numResults,m=g===void 0?p:g,E=h.result_count,_=h.resultCount,y=_===void 0?m||E:_,N=h.customer_ids,S=h.item_ids,T=h.items,q=T===void 0?N||S:T,I=h.result_page,M=h.resultPage,H=M===void 0?I:M,F=h.result_id,z=h.resultId,R=z===void 0?F:z,P=h.sort_order,A=h.sortOrder,U=A===void 0?P:A,B=h.sort_by,W=h.sortBy,Q=W===void 0?B:W,V=h.selected_filters,b=h.selectedFilters,Z=b===void 0?V:b,re=h.url,fe=h.section,le={},G;q&&Array.isArray(q)&&q.length!==0&&(G=q,typeof q[0]=="string"||typeof q[0]=="number"?G=q.map(function(Ue){return{item_id:String(Ue)}}):G=q.map(function(Ue){return u.toSnakeCaseKeys(Ue,!1)})),fe&&(le.section=fe);var Re={search_term:a,result_count:y,items:G,result_page:H,result_id:R,sort_order:U,sort_by:Q,selected_filters:Z,url:re,section:fe},de="".concat(f).concat(w(le,this.options)),ke="POST",ae=v(Re,s(s({},this.options),{},{requestMethod:ke}));return this.requests.queue(de,ke,ae,d),this.requests.send(),!0}return this.requests.send(),new Error("parameters are required of type object")}return this.requests.send(),new Error("term is a required parameter of type string")}},{key:"trackSearchResultsLoaded",value:function(a,h){var d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(a&&typeof a=="string"){if(h&&(0,n.default)(h)==="object"&&!Array.isArray(h)){var f="".concat(this.options.serviceUrl,"/behavior?"),p={action:"search-results",term:a},g=h.num_results,m=h.numResults,E=m===void 0?g:m,_=h.customer_ids,y=h.customerIds,N=y===void 0?_:y,S=h.item_ids,T=h.itemIds,q=T===void 0?S:T,I;return u.isNil(E)||(p.num_results=E),q&&Array.isArray(q)?I=q:N&&Array.isArray(N)&&(I=N),I&&Array.isArray(I)&&I.length&&(p.customer_ids=I.slice(0,100).join(",")),this.requests.queue("".concat(f).concat(w(p,this.options)),void 0,void 0,d),this.requests.send(),!0}return this.requests.send(),new Error("parameters are required of type object")}return this.requests.send(),new Error("term is a required parameter of type string")}},{key:"trackSearchResultClickV2",value:function(a,h){var d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(a&&typeof a=="string"){if(h&&(0,n.default)(h)==="object"&&!Array.isArray(h)){var f="".concat(this.behavioralV2Url,"search_result_click?"),p=h.num_results,g=h.customer_id,m=h.item_id,E=h.itemId,_=E===void 0?g||m:E,y=h.name,N=h.item_name,S=h.itemName,T=S===void 0?y||N:S,q=h.variation_id,I=h.variationId,M=I===void 0?q:I,H=h.result_id,F=h.resultId,z=F===void 0?H:F,R=h.result_count,P=h.resultCount,A=P===void 0?p||R:P,U=h.result_page,B=h.resultPage,W=B===void 0?U:B,Q=h.result_position_on_page,V=h.resultPositionOnPage,b=V===void 0?Q:V,Z=h.num_results_per_page,re=h.numResultsPerPage,fe=re===void 0?Z:re,le=h.selected_filters,G=h.selectedFilters,Re=G===void 0?le:G,de=h.section,ke={item_name:T,item_id:_,variation_id:M,result_id:z,result_count:A,result_page:W,result_position_on_page:b,num_results_per_page:fe,selected_filters:Re,section:de,search_term:a},ae={};de&&(ae.section=de);var Ue="".concat(f).concat(w(ae,this.options)),ot="POST",Un=v(ke,s(s({},this.options),{},{requestMethod:ot}));return this.requests.queue(Ue,ot,Un,d),this.requests.send(),!0}return this.requests.send(),new Error("parameters are required of type object")}return this.requests.send(),new Error("term is a required parameter of type string")}},{key:"trackSearchResultClick",value:function(a,h){var d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(a&&typeof a=="string"){if(h&&(0,n.default)(h)==="object"&&!Array.isArray(h)){var f="".concat(this.options.serviceUrl,"/autocomplete/").concat(u.encodeURIComponentRFC3986(u.trimNonBreakingSpaces(a)),"/click_through?"),p={},g=h.item_name,m=h.name,E=h.itemName,_=E===void 0?g||m:E,y=h.item_id,N=h.itemId,S=N===void 0?y:N,T=h.customer_id,q=h.customerId,I=q===void 0?T||S:q,M=h.variation_id,H=h.variationId,F=H===void 0?M:H,z=h.result_id,R=h.resultId,P=R===void 0?z:R,A=h.item_is_convertible,U=h.itemIsConvertible,B=U===void 0?A:U,W=h.section;return _&&(p.name=_),I&&(p.customer_id=I),F&&(p.variation_id=F),P&&(p.result_id=P),typeof B=="boolean"&&(p.item_is_convertible=B),W&&(p.section=W),this.requests.queue("".concat(f).concat(w(p,this.options)),void 0,void 0,d),this.requests.send(),!0}return this.requests.send(),new Error("parameters are required of type object")}return this.requests.send(),new Error("term is a required parameter of type string")}},{key:"trackConversion",value:function(a,h){var d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(h&&(0,n.default)(h)==="object"&&!Array.isArray(h)){var f=a||"TERM_UNKNOWN",p="".concat(this.options.serviceUrl,"/v2/behavioral_action/conversion?"),g={},m={},E=h.name,_=h.item_name,y=h.itemName,N=y===void 0?_||E:y,S=h.customer_id,T=h.customerId,q=T===void 0?S:T,I=h.item_id,M=h.itemId,H=M===void 0?I||q:M,F=h.variation_id,z=h.variationId,R=z===void 0?F:z,P=h.revenue,A=h.section,U=A===void 0?"Products":A,B=h.display_name,W=h.displayName,Q=W===void 0?B:W,V=h.type,b=h.is_custom_type,Z=h.isCustomType,re=Z===void 0?b:Z;H&&(m.item_id=H),N&&(m.item_name=N),R&&(m.variation_id=R),P&&(m.revenue=P.toString()),U&&(g.section=U,m.section=U),f&&(m.search_term=f),V&&(m.type=V),re&&(m.is_custom_type=re),Q&&(m.display_name=Q);var fe="".concat(p).concat(w(g,this.options)),le="POST",G=v(m,s(s({},this.options),{},{requestMethod:le}));return this.requests.queue(fe,le,G,d),this.requests.send(),!0}return this.requests.send(),new Error("parameters are required of type object")}},{key:"trackPurchase",value:function(a){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(a&&(0,n.default)(a)==="object"&&!Array.isArray(a)){var d="".concat(this.options.serviceUrl,"/v2/behavioral_action/purchase?"),f={},p={},g=a.items,m=a.revenue,E=a.order_id,_=a.orderId,y=_===void 0?E:_,N=a.section;if(y){if(u.hasOrderIdRecord(y))return!1;u.addOrderIdRecord(y),p.order_id=y}g&&Array.isArray(g)&&(p.items=g.slice(0,100).map(function(I){return u.toSnakeCaseKeys(I,!1)})),m&&(p.revenue=m),N?f.section=N:f.section="Products";var S="".concat(d).concat(w(f,this.options)),T="POST",q=v(p,s(s({},this.options),{},{requestMethod:T}));return this.requests.queue(S,T,q,h),this.requests.send(),!0}return this.requests.send(),new Error("parameters are required of type object")}},{key:"trackRecommendationView",value:function(a){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(a&&(0,n.default)(a)==="object"&&!Array.isArray(a)){var d="".concat(this.options.serviceUrl,"/v2/behavioral_action/recommendation_result_view?"),f={},p=a.result_count,g=a.resultCount,m=g===void 0?p:g,E=a.result_page,_=a.resultPage,y=_===void 0?E:_,N=a.result_id,S=a.resultId,T=S===void 0?N:S,q=a.section,I=a.url,M=a.pod_id,H=a.podId,F=H===void 0?M:H,z=a.num_results_viewed,R=a.numResultsViewed,P=R===void 0?z:R,A=a.items;u.isNil(m)||(f.result_count=m),u.isNil(y)||(f.result_page=y),T&&(f.result_id=T),q?f.section=q:f.section="Products",I&&(f.url=I),F&&(f.pod_id=F),u.isNil(P)||(f.num_results_viewed=P),A&&Array.isArray(A)&&(f.items=A.slice(0,100).map(function(Q){return u.toSnakeCaseKeys(Q,!1)}));var U="".concat(d).concat(w({},this.options)),B="POST",W=v(f,s(s({},this.options),{},{requestMethod:B}));return this.requests.queue(U,B,W,h),this.requests.send(),!0}return this.requests.send(),new Error("parameters are required of type object")}},{key:"trackRecommendationClick",value:function(a){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(a&&(0,n.default)(a)==="object"&&!Array.isArray(a)){var d="".concat(this.options.serviceUrl,"/v2/behavioral_action/recommendation_result_click?"),f={},p=a.variation_id,g=a.variationId,m=g===void 0?p:g,E=a.section,_=E===void 0?"Products":E,y=a.result_id,N=a.resultId,S=N===void 0?y:N,T=a.result_count,q=a.resultCount,I=q===void 0?T:q,M=a.result_page,H=a.resultPage,F=H===void 0?M:H,z=a.result_position_on_page,R=a.resultPositionOnPage,P=R===void 0?z:R,A=a.num_results_per_page,U=a.numResultsPerPage,B=U===void 0?A:U,W=a.pod_id,Q=a.podId,V=Q===void 0?W:Q,b=a.strategy_id,Z=a.strategyId,re=Z===void 0?b:Z,fe=a.item_id,le=a.itemId,G=le===void 0?fe:le,Re=a.item_name,de=a.itemName,ke=de===void 0?Re:de;m&&(f.variation_id=m),_&&(f.section=_),S&&(f.result_id=S),u.isNil(I)||(f.result_count=I),u.isNil(F)||(f.result_page=F),u.isNil(P)||(f.result_position_on_page=P),u.isNil(B)||(f.num_results_per_page=B),V&&(f.pod_id=V),re&&(f.strategy_id=re),G&&(f.item_id=G),ke&&(f.item_name=ke);var ae="".concat(d).concat(w({},this.options)),Ue="POST",ot=v(f,s(s({},this.options),{},{requestMethod:Ue}));return this.requests.queue(ae,Ue,ot,h),this.requests.send(),!0}return this.requests.send(),new Error("parameters are required of type object")}},{key:"trackBrowseResultsLoaded",value:function(a){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(a&&(0,n.default)(a)==="object"&&!Array.isArray(a)){var d="".concat(this.options.serviceUrl,"/v2/behavioral_action/browse_result_load?"),f={},p=a.section,g=p===void 0?"Products":p,m=a.result_count,E=a.resultCount,_=E===void 0?m:E,y=a.result_page,N=a.resultPage,S=N===void 0?y:N,T=a.result_id,q=a.resultId,I=q===void 0?T:q,M=a.selected_filters,H=a.selectedFilters,F=H===void 0?M:H,z=a.url,R=a.sort_order,P=a.sortOrder,A=P===void 0?R:P,U=a.sort_by,B=a.sortBy,W=B===void 0?U:B,Q=a.filter_name,V=a.filterName,b=V===void 0?Q:V,Z=a.filter_value,re=a.filterValue,fe=re===void 0?Z:re,le=a.items;g&&(f.section=g),u.isNil(_)||(f.result_count=_),u.isNil(S)||(f.result_page=S),I&&(f.result_id=I),F&&(f.selected_filters=F),z&&(f.url=z),A&&(f.sort_order=A),W&&(f.sort_by=W),b&&(f.filter_name=b),fe&&(f.filter_value=fe),le&&Array.isArray(le)&&(f.items=le.slice(0,100).map(function(ke){return u.toSnakeCaseKeys(ke,!1)}));var G="".concat(d).concat(w({},this.options)),Re="POST",de=v(f,s(s({},this.options),{},{requestMethod:Re}));return this.requests.queue(G,Re,de,h),this.requests.send(),!0}return this.requests.send(),new Error("parameters are required of type object")}},{key:"trackBrowseResultClick",value:function(a){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(a&&(0,n.default)(a)==="object"&&!Array.isArray(a)){var d="".concat(this.options.serviceUrl,"/v2/behavioral_action/browse_result_click?"),f={},p=a.section,g=p===void 0?"Products":p,m=a.variation_id,E=a.variationId,_=E===void 0?m:E,y=a.result_id,N=a.resultId,S=N===void 0?y:N,T=a.result_count,q=a.resultCount,I=q===void 0?T:q,M=a.result_page,H=a.resultPage,F=H===void 0?M:H,z=a.result_position_on_page,R=a.resultPositionOnPage,P=R===void 0?z:R,A=a.num_results_per_page,U=a.numResultsPerPage,B=U===void 0?A:U,W=a.selected_filters,Q=a.selectedFilters,V=Q===void 0?W:Q,b=a.filter_name,Z=a.filterName,re=Z===void 0?b:Z,fe=a.filter_value,le=a.filterValue,G=le===void 0?fe:le,Re=a.customer_id,de=a.customerId,ke=de===void 0?Re:de,ae=a.item_id,Ue=a.itemId,ot=Ue===void 0?ke||ae:Ue,Un=a.item_name,Jf=a.name,Wl=a.itemName,bl=Wl===void 0?Un||Jf:Wl;g&&(f.section=g),_&&(f.variation_id=_),S&&(f.result_id=S),u.isNil(I)||(f.result_count=I),u.isNil(F)||(f.result_page=F),u.isNil(P)||(f.result_position_on_page=P),u.isNil(B)||(f.num_results_per_page=B),V&&(f.selected_filters=V),re&&(f.filter_name=re),G&&(f.filter_value=G),ot&&(f.item_id=ot),bl&&(f.item_name=bl);var Zf="".concat(d).concat(w({},this.options)),Kl="POST",$f=v(f,s(s({},this.options),{},{requestMethod:Kl}));return this.requests.queue(Zf,Kl,$f,h),this.requests.send(),!0}return this.requests.send(),new Error("parameters are required of type object")}},{key:"trackGenericResultClick",value:function(a){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if((0,n.default)(a)==="object"){var d="".concat(this.options.serviceUrl,"/v2/behavioral_action/result_click?"),f={},p=a.item_id,g=a.itemId,m=g===void 0?p:g,E=a.item_name,_=a.itemName,y=_===void 0?E:_,N=a.variation_id,S=a.variationId,T=S===void 0?N:S,q=a.section,I=q===void 0?"Products":q;if(m){f.section=I,f.item_id=m,y&&(f.item_name=y),T&&(f.variation_id=T);var M="".concat(d).concat(w({},this.options)),H="POST",F=v(f,s(s({},this.options),{},{requestMethod:H}));return this.requests.queue(M,H,F,h),this.requests.send(),!0}}return this.requests.send(),new Error('A parameters object with an "itemId" property is required.')}},{key:"trackQuizResultsLoaded",value:function(a){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(a&&(0,n.default)(a)==="object"&&!Array.isArray(a)){var d="".concat(this.options.serviceUrl,"/v2/behavioral_action/quiz_result_load?"),f=a.quiz_id,p=a.quizId,g=p===void 0?f:p,m=a.quiz_version_id,E=a.quizVersionId,_=E===void 0?m:E,y=a.quiz_session_id,N=a.quizSessionId,S=N===void 0?y:N,T=a.url,q=a.section,I=q===void 0?"Products":q,M=a.result_count,H=a.resultCount,F=H===void 0?M:H,z=a.result_id,R=a.resultId,P=R===void 0?z:R,A=a.result_page,U=a.resultPage,B=U===void 0?A:U,W={},Q={};if(typeof g!="string")return new Error('"quizId" is a required parameter of type string');if(typeof _!="string")return new Error('"quizVersionId" is a required parameter of type string');if(typeof S!="string")return new Error('"quizSessionId" is a required parameter of type string');if(typeof T!="string")return new Error('"url" is a required parameter of type string');if(Q.quiz_id=g,Q.quiz_version_id=_,Q.quiz_session_id=S,Q.url=T,!u.isNil(I)){if(typeof I!="string")return new Error('"section" must be a string');W.section=I,Q.section=I}if(!u.isNil(F)){if(typeof F!="number")return new Error('"resultCount" must be a number');Q.result_count=F}if(!u.isNil(P)){if(typeof P!="string")return new Error('"resultId" must be a string');Q.result_id=P}if(!u.isNil(B)){if(typeof B!="number")return new Error('"resultPage" must be a number');Q.result_page=B}Q.action_class="result_load";var V="".concat(d).concat(w(W,this.options)),b="POST",Z=v(Q,s(s({},this.options),{},{requestMethod:b}));return this.requests.queue(V,b,Z,h),this.requests.send(),!0}return this.requests.send(),new Error("parameters are required of type object")}},{key:"trackQuizResultClick",value:function(a){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(a&&(0,n.default)(a)==="object"&&!Array.isArray(a)){var d="".concat(this.options.serviceUrl,"/v2/behavioral_action/quiz_result_click?"),f=a.quiz_id,p=a.quizId,g=p===void 0?f:p,m=a.quiz_version_id,E=a.quizVersionId,_=E===void 0?m:E,y=a.quiz_session_id,N=a.quizSessionId,S=N===void 0?y:N,T=a.item_id,q=a.itemId,I=q===void 0?T:q,M=a.item_name,H=a.itemName,F=H===void 0?M:H,z=a.result_count,R=a.resultCount,P=R===void 0?z:R,A=a.result_id,U=a.resultId,B=U===void 0?A:U,W=a.result_page,Q=a.resultPage,V=Q===void 0?W:Q,b=a.num_results_per_page,Z=a.numResultsPerPage,re=Z===void 0?b:Z,fe=a.result_position_on_page,le=a.resultPositionOnPage,G=le===void 0?fe:le,Re=a.section,de=Re===void 0?"Products":Re,ke={},ae={};if(typeof g!="string")return new Error('"quizId" is a required parameter of type string');if(typeof _!="string")return new Error('"quizVersionId" is a required parameter of type string');if(typeof S!="string")return new Error('"quizSessionId" is a required parameter of type string');if(typeof I!="string"&&typeof F!="string")return new Error('"itemId" or "itemName" is a required parameter of type string');if(ae.quiz_id=g,ae.quiz_version_id=_,ae.quiz_session_id=S,!u.isNil(I)){if(typeof I!="string")return new Error('"itemId" must be a string');ae.item_id=I}if(!u.isNil(F)){if(typeof F!="string")return new Error('"itemName" must be a string');ae.item_name=F}if(!u.isNil(de)){if(typeof de!="string")return new Error('"section" must be a string');ke.section=de}if(!u.isNil(P)){if(typeof P!="number")return new Error('"resultCount" must be a number');ae.result_count=P}if(!u.isNil(B)){if(typeof B!="string")return new Error('"resultId" must be a string');ae.result_id=B}if(!u.isNil(V)){if(typeof V!="number")return new Error('"resultPage" must be a number');ae.result_page=V}if(!u.isNil(re)){if(typeof re!="number")return new Error('"numResultsPerPage" must be a number');ae.num_results_per_page=re}if(!u.isNil(G)){if(typeof G!="number")return new Error('"resultPositionOnPage" must be a number');ae.result_position_on_page=G}ae.action_class="result_click";var Ue="".concat(d).concat(w(ke,this.options)),ot="POST",Un=v(ae,s(s({},this.options),{},{requestMethod:ot}));return this.requests.queue(Ue,ot,Un,h),this.requests.send(),!0}return this.requests.send(),new Error("parameters are required of type object")}},{key:"trackQuizConversion",value:function(a){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(a&&(0,n.default)(a)==="object"&&!Array.isArray(a)){var d="".concat(this.options.serviceUrl,"/v2/behavioral_action/quiz_conversion?"),f=a.quiz_id,p=a.quizId,g=p===void 0?f:p,m=a.quiz_version_id,E=a.quizVersionId,_=E===void 0?m:E,y=a.quiz_session_id,N=a.quizSessionId,S=N===void 0?y:N,T=a.item_id,q=a.itemId,I=q===void 0?T:q,M=a.item_name,H=a.itemName,F=H===void 0?M:H,z=a.variation_id,R=a.variationId,P=R===void 0?z:R,A=a.revenue,U=a.section,B=U===void 0?"Products":U,W=a.type,Q=a.is_custom_type,V=a.isCustomType,b=V===void 0?Q:V,Z=a.display_name,re=a.displayName,fe=re===void 0?Z:re,le={},G={};if(typeof g!="string")return new Error('"quizId" is a required parameter of type string');if(typeof _!="string")return new Error('"quizVersionId" is a required parameter of type string');if(typeof S!="string")return new Error('"quizSessionId" is a required parameter of type string');if(typeof I!="string"&&typeof F!="string")return new Error('"itemId" or "itemName" is a required parameter of type string');if(G.quiz_id=g,G.quiz_version_id=_,G.quiz_session_id=S,!u.isNil(I)){if(typeof I!="string")return new Error('"itemId" must be a string');G.item_id=I}if(!u.isNil(F)){if(typeof F!="string")return new Error('"itemName" must be a string');G.item_name=F}if(!u.isNil(P)){if(typeof P!="string")return new Error('"variationId" must be a string');G.variation_id=P}if(!u.isNil(A)){if(typeof A!="string")return new Error('"revenue" must be a string');G.revenue=A}if(!u.isNil(B)){if(typeof B!="string")return new Error('"section" must be a string');G.section=B}if(!u.isNil(W)){if(typeof W!="string")return new Error('"type" must be a string');G.type=W}if(!u.isNil(b)){if(typeof b!="boolean")return new Error('"isCustomType" must be a boolean');G.is_custom_type=b}if(!u.isNil(fe)){if(typeof fe!="string")return new Error('"displayName" must be a string');G.display_name=fe}G.action_class="conversion";var Re="".concat(d).concat(w(le,this.options)),de="POST",ke=v(G,s(s({},this.options),{},{requestMethod:de}));return this.requests.queue(Re,de,ke,h),this.requests.send(),!0}return this.requests.send(),new Error("parameters are required of type object")}},{key:"on",value:function(a,h){return a!=="success"&&a!=="error"?new Error('messageType must be a string of value "success" or "error"'):!h||typeof h!="function"?new Error("callback is required and must be a function"):(this.eventemitter.on(a,h),!0)}}]),x}();return C.RequestQueue=c,Wo=C,Wo}const fv="@constructor-io/constructorio-client-javascript",dv="2.35.12",pv="Constructor.io JavaScript client",hv="lib/constructorio.js",vv="lib/types/constructorio.d.ts",gv={clean:"sudo rm -rf node_modules package-lock.json",version:"npm run verify-node-version && npm run docs && git add ./docs/* && npm run bundle && git add -A ./dist","check-license":"license-checker --production --onlyAllow 'Apache-2.0;BSD-3-Clause;MIT;0BSD;BSD-2-Clause'","verify-node-version":"chmod +x ./scripts/verify-node-version.sh && ./scripts/verify-node-version.sh",lint:"eslint 'src/**/*.js' 'spec/**/*.js' 'src/**/*.d.ts'",test:"npm run compile && mkdir -p test && cp -rf lib/* test && mocha ./spec/*","test:types":"tsd .","test:parallel":"npm run compile && mkdir -p test && cp -rf lib/* test && mocha --parallel ./spec/*","test:src":"mkdir -p test && cp -rf src/* test && mocha ./spec/*","test:src:parallel":"mkdir -p test && cp -rf src/* test && mocha --parallel ./spec/*","test:bundled":"npm run bundle && BUNDLED=true PACKAGE_VERSION=$(echo $npm_package_version) mocha ./spec/*","test:bundled:parallel":"npm run bundle && BUNDLED=true PACKAGE_VERSION=$(echo $npm_package_version) mocha --parallel ./spec/*","test:all":"npm run test && npm run test:bundled","test:all:parallel":"npm run test:parallel && npm run test:bundled:parallel",precoverage:"rm -rf ./coverage && rm -rf ./.nyc_output",coverage:"nyc --all --reporter=html npm run test:src",postcoverage:"open coverage/index.html && rm -rf test",docs:"jsdoc --configure ./.jsdoc.json ./README.md --recurse ./src --destination ./docs",compile:"babel src/ -d lib/ --copy-files && rm -rf lib/types/tests",prepublish:"npm run compile",bundle:"rm -rf ./dist/* && npm run compile && node bundle.js",prepare:"husky install"},yv={type:"git",url:"git+https://github.com/Constructor-io/constructorio-client-javascript.git"},mv="constructor.io",_v="MIT",wv={url:"https://github.com/Constructor-io/constructorio-client-javascript/issues"},kv="https://github.com/Constructor-io/constructorio-client-javascript#readme",Sv=["lib/**/*"],Ev={"@babel/cli":"^7.15.7","@babel/core":"^7.15.8","@babel/plugin-transform-runtime":"^7.16.4","@babel/preset-env":"^7.15.8","@babel/register":"^7.15.3","@cspell/eslint-plugin":"^6.8.2","@types/events":"^3.0.0","@typescript-eslint/eslint-plugin":"^5.48.1","@typescript-eslint/parser":"^5.48.1",chai:"^4.2.0","chai-as-promised":"^7.1.1",docdash:"^2.0.1",dotenv:"^8.6.0",esbuild:"^0.12.28",eslint:"^8.17.0","eslint-config-airbnb-base":"^15.0.0","eslint-plugin-import":"^2.25.2",husky:"^7.0.4",jsdoc:"^4.0.2",jsdom:"^16.7.0","license-checker":"^25.0.1","lodash.clonedeep":"^4.5.0",mocha:"^9.1.3",nyc:"^15.1.0",qs:"^6.11.0",sinon:"^7.5.0","sinon-chai":"^3.7.0",tsd:"^0.24.1"},Cv={"@constructor-io/constructorio-id":"^2.4.10","crc-32":"^1.2.2",events:"^3.0.0","fetch-ponyfill":"^7.1.0",store2:"^2.14.2"},xv={"@babel/runtime":"^7.19.0"},Rv={directory:"src/types/tests"},zv={name:fv,version:dv,description:pv,main:hv,types:vv,scripts:gv,repository:yv,author:mv,license:_v,bugs:wv,homepage:kv,files:Sv,devDependencies:Ev,dependencies:Cv,peerDependencies:xv,tsd:Rv};var Fi={},Nv={get exports(){return Fi},set exports(e){Fi=e}},ji={},Tv={get exports(){return ji},set exports(e){ji=e}},Di={},qv={get exports(){return Di},set exports(e){Di=e}},za;function bf(){return za||(za=1,function(e){function t(n,r){(r==null||r>n.length)&&(r=n.length);for(var i=0,o=new Array(r);i<r;i++)o[i]=n[i];return o}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(qv)),Di}var Na;function Pv(){return Na||(Na=1,function(e){var t=bf();function n(r){if(Array.isArray(r))return t(r)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}(Tv)),ji}var Hi={},Iv={get exports(){return Hi},set exports(e){Hi=e}},Ta;function Ov(){return Ta||(Ta=1,function(e){function t(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(Iv)),Hi}var Vi={},Av={get exports(){return Vi},set exports(e){Vi=e}},qa;function Lv(){return qa||(qa=1,function(e){var t=bf();function n(r,i){if(r){if(typeof r=="string")return t(r,i);var o=Object.prototype.toString.call(r).slice(8,-1);if(o==="Object"&&r.constructor&&(o=r.constructor.name),o==="Map"||o==="Set")return Array.from(r);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return t(r,i)}}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}(Av)),Vi}var Qi={},Bv={get exports(){return Qi},set exports(e){Qi=e}},Pa;function Uv(){return Pa||(Pa=1,function(e){function t(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
46
46
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(Bv)),Qi}var Ia;function Mv(){return Ia||(Ia=1,function(e){var t=Pv(),n=Ov(),r=Lv(),i=Uv();function o(s){return t(s)||n(s)||r(s)||i()}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports}(Nv)),Fi}var bo,Oa;function Fv(){if(Oa)return bo;Oa=1;var e=He,t=e(ft()),n=e(dt()),r=e(Mv()),i=e(Tr()),o=Bn(),s=pt();function l(c,v,w,C){var x=w.apiKey,k=w.clientId,a=w.sessionId,h=w.segments,d=w.userId,f=w.version,p=w.quizzesServiceUrl,g={c:f},m="";if(g.key=x,g.i=k,g.s=a,h&&h.length&&(g.us=h),d&&(g.ui=String(d)),!c||typeof c!="string")throw new Error("quizId is a required parameter of type string");if(C==="results"&&((0,i.default)(v.answers)!=="object"||!Array.isArray(v.answers)||v.answers.length===0))throw new Error("answers is a required parameter of type array");if(v){var E=v.section,_=v.answers,y=v.quizSessionId,N=v.quizVersionId,S=v.page,T=v.resultsPerPage,q=v.filters;E&&(g.section=E),N&&(g.quiz_version_id=N),y&&(g.quiz_session_id=y),_&&_.length&&(m="&".concat(s.stringify({a:_.map(function(M){return(0,r.default)(M).join(",")})}))),s.isNil(S)||(g.page=S),s.isNil(T)||(g.num_results_per_page=T),q&&(g.filters=q)}g._dt=Date.now(),g=s.cleanParams(g);var I=s.stringify(g);return"".concat(p,"/v1/quizzes/").concat(encodeURIComponent(c),"/").concat(encodeURIComponent(C),"/?").concat(I).concat(m)}var u=function(){function c(v){(0,t.default)(this,c),this.options=v||{},this.eventDispatcher=new o(v.eventDispatcher)}return(0,n.default)(c,[{key:"getQuizNextQuestion",value:function(w,C){var x=this,k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a,h=this.options.fetch,d=new AbortController,f=d.signal;try{a=l(w,C,this.options,"next")}catch(p){return Promise.reject(p)}return s.applyNetworkTimeout(this.options,k,d),h(a,{signal:f}).then(function(p){return p.ok?p.json():s.throwHttpErrorFromResponse(new Error,p)}).then(function(p){if(p.quiz_version_id)return x.eventDispatcher.queue("quizzes.getQuizNextQuestion.completed",p),p;throw new Error("getQuizNextQuestion response data is malformed")})}},{key:"getQuizResults",value:function(w,C){var x=this,k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a,h=this.options.fetch,d=new AbortController,f=d.signal;try{a=l(w,C,this.options,"results")}catch(p){return Promise.reject(p)}return s.applyNetworkTimeout(this.options,k,d),h(a,{signal:f}).then(function(p){return p.ok?p.json():s.throwHttpErrorFromResponse(new Error,p)}).then(function(p){if(p.quiz_version_id)return x.eventDispatcher.queue("quizzes.getQuizResults.completed",p),p;throw new Error("getQuizResults response data is malformed")})}}]),c}();return bo=u,bo}var Kf=He,jv=Kf(ft()),Dv=Kf(dt()),Hv=Kh(),Vv=Yh(),Qv=ev(),Wv=nv(),bv=rv(),Kv=iv(),Gf=cv(),Gv=Bn(),Vl=pt(),Yv=zv,Xv=Yv.version,Jv=Fv(),Zv=function(){var t="ciojs-client-",n=[];return Vl.canUseDOM()||n.push("domless"),typeof process<"u"&&typeof process.env<"u"&&{}.BUNDLED&&n.push("bundled"),"".concat(t).concat(n.join("-")).concat(n.length?"-":"").concat(Xv)},Ql=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(0,jv.default)(this,e);var n=t.apiKey,r=t.version,i=t.serviceUrl,o=t.quizzesServiceUrl,s=t.segments,l=t.testCells,u=t.clientId,c=t.sessionId,v=t.userId,w=t.fetch,C=t.trackingSendDelay,x=t.sendReferrerWithTrackingEvents,k=t.sendTrackingEvents,a=t.eventDispatcher,h=t.idOptions,d=t.beaconMode,f=t.networkParameters;if(!n||typeof n!="string")throw new Error("API key is a required parameter of type string");var p,g,m=typeof It<"u"&&It.CLIENT_VERSION;if(Vl.canUseDOM()){var E=new Hv(h||{});p=E.session_id,g=E.client_id}else{if(!c||typeof c!="number")throw new Error("sessionId is a required user parameter of type number");if(!u||typeof u!="string")throw new Error("clientId is a required user parameter of type string")}this.options={apiKey:n,version:r||m||Zv(),serviceUrl:i&&i.replace(/\/$/,"")||"https://ac.cnstrc.com",quizzesServiceUrl:o&&o.replace(/\/$/,"")||"https://quizzes.cnstrc.com",sessionId:c||p,clientId:u||g,userId:v,segments:s,testCells:l,fetch:w||Vv({Promise}).fetch,trackingSendDelay:C,sendTrackingEvents:k,sendReferrerWithTrackingEvents:x,eventDispatcher:a,beaconMode:d!==!1,networkParameters:f||{}},this.search=new Qv(this.options),this.browse=new Wv(this.options),this.autocomplete=new bv(this.options),this.recommendations=new Kv(this.options),this.tracker=new Gf(this.options),this.quizzes=new Jv(this.options),new Gv(t.eventDispatcher).queue("instantiated",this.options)}return(0,Dv.default)(e,[{key:"setClientOptions",value:function(n){if(Object.keys(n).length){var r=n.apiKey,i=n.segments,o=n.testCells,s=n.userId;r&&(this.options.apiKey=r),i&&(this.options.segments=i),o&&(this.options.testCells=o),s&&(this.options.userId=s)}}}]),e}();Ql.Tracker=Gf;Vl.canUseDOM()&&(window.ConstructorioClient=Ql);var $v=Ql;const eg=e=>{if(e)return new $v({apiKey:e,sendTrackingEvents:!0})},tg=(e,t,n)=>e==null?void 0:e.quizzes.getQuizNextQuestion(t,n),ng=async(e,t,n)=>e==null?void 0:e.quizzes.getQuizResults(t,n),rg=(e,t)=>{const{quiz_id:n,quiz_session_id:r,quiz_version_id:i,result_id:o,request:s,response:l}=t;e==null||e.tracker.trackQuizResultsLoaded({quizId:n,quizVersionId:i,quizSessionId:r,url:window.location.href,section:s==null?void 0:s.section,resultCount:l==null?void 0:l.total_num_results,resultPage:s==null?void 0:s.page,resultId:o})},ig=(e,t,n,r)=>{var i;if(t.request&&t.response){const{quiz_id:o,quiz_session_id:s,quiz_version_id:l,result_id:u,request:{section:c,page:v,num_results_per_page:w},response:{total_num_results:C}}=t;e==null||e.tracker.trackQuizResultClick({quizId:o,quizVersionId:l,quizSessionId:s,itemId:(i=n.data)==null?void 0:i.id,itemName:n==null?void 0:n.value,section:c,resultCount:C,resultPage:v,resultId:u,resultPositionOnPage:r,numResultsPerPage:w})}},og=(e,t,n,r)=>{var i,o;if(t.request){const{quiz_id:s,quiz_session_id:l,quiz_version_id:u,request:{section:c}}=t;e==null||e.tracker.trackQuizConversion({quizId:s,quizVersionId:u,quizSessionId:l,itemId:(i=n.data)==null?void 0:i.id,itemName:n.value,section:c,variationId:(o=n.data)==null?void 0:o.variation_id,revenue:r&&String(r)||void 0})}},sg=({apiKey:e,cioJsClient:t})=>{if(!e&&!t)throw new Error("Either apiKey or cioJsClient is required");return D.useMemo(()=>t||eg(e),[e,t])},lg=e=>{const{quizId:t,resultsPageOptions:n}=e;D.useEffect(()=>{t||console.error("quizId is a required field of type string"),(!n||Object.keys(n).length===0)&&console.error("resultsPageOptions is a required field of type object"),n&&!(n!=null&&n.onAddToCartClick)&&console.error("resultsPageOptions.onAddToCartClick is a required field of type function")},[t,n,n==null?void 0:n.onAddToCartClick])};function ug(e,t,n,r){var C;const i=n==null?void 0:n.type,o=(C=n==null?void 0:n.options)==null?void 0:C.some(x=>x.images),[s,l]=D.useState({}),u=D.useRef({}),c=D.useCallback(x=>{if(i===Y.SingleSelect)u.current=!0,l({[x]:!0});else if(i===Y.MultipleSelect)if(s[x]){const k={...s};delete k[x],l(k)}else l({...s,[x]:!0})},[s,i]),v=(x,k)=>{((x==null?void 0:x.key)===" "||(x==null?void 0:x.key)==="Enter")&&c(k)};return D.useEffect(()=>{var x;if(n!=null&&n.type){const k=n.id,a=r==null?void 0:r[k],h={};Array.isArray(a==null?void 0:a.value)&&((x=a==null?void 0:a.value)==null||x.forEach(d=>{h[Number(d)]=!0,l(h)}))}return u.current=!1,function(){l({})}},[n==null?void 0:n.id]),D.useEffect(()=>{if((n==null?void 0:n.type)==="multiple"||(n==null?void 0:n.type)==="single"){const x=Object.keys(s).filter(k=>s[Number(k)]);e(x)}},[s,n==null?void 0:n.id,n==null?void 0:n.type,e]),D.useEffect(()=>{(n==null?void 0:n.type)==="single"&&u.current&&t()},[r]),D.useCallback(x=>({className:`${o?"cio-question-option-container":"cio-question-option-container-text-only"} ${s[x.id]?"selected":""}`,onClick:()=>{c(x.id)},onKeyDown:k=>{v(k,x.id)},role:"button",tabIndex:0,key:x.id}),[n==null?void 0:n.id,s])}function ag(e,t){return D.useEffect(()=>{(t==null?void 0:t.type)==="cover"&&e("")},[e,t]),D.useCallback(()=>({}),[])}function cg(e,t,n,r){const[i,o]=D.useState(""),s=D.useCallback(c=>{o(c.target.value)},[]),l=D.useCallback(c=>{const{key:v}=c;v==="Enter"&&i&&(n==null?void 0:n.type)==="open"&&t()},[n==null?void 0:n.type,i,t]);return D.useEffect(()=>{(n==null?void 0:n.type)==="open"&&e(i)},[i,n==null?void 0:n.type,n==null?void 0:n.id,e]),D.useEffect(()=>{var c;if(r&&(n!=null&&n.id)){const v=(c=r[n.id])==null?void 0:c.value;o(v||"")}},[n==null?void 0:n.id]),D.useCallback(()=>({className:"cio-question-input-text",placeholder:(n==null?void 0:n.input_placeholder)||"Answer here...",value:i,onChange:s,onKeyDown:l}),[n==null?void 0:n.input_placeholder,n==null?void 0:n.id,i,l])}function fg(e,t,n){return D.useCallback(()=>{var s,l,u,c,v;const i=(s=t.quizCurrentQuestion)==null?void 0:s.next_question.id;let o;return i&&!((l=t.quizCurrentQuestion)!=null&&l.isCoverQuestion)&&(o=!((u=n.answerInputs[i])!=null&&u.value)||!((v=(c=n.answerInputs[i])==null?void 0:c.value)!=null&&v.length)),{className:o?"cio-question-cta-button disabled":"cio-question-cta-button",type:"button",onClick:()=>{e()}}},[t.quizCurrentQuestion,n.answerInputs,e])}function dg(e,t){return D.useCallback(()=>{var i;return{title:"Quiz Back Button",role:"button",className:`cio-question-back-button ${((i=e.quizCurrentQuestion)==null?void 0:i.isFirstQuestion)?"disabled":""}`,type:"button",onClick:()=>t()}},[e,t])}const pg=(e,t,n)=>{var _,y,N;const{quizAnswerChanged:r,nextQuestion:i,previousQuestion:o,resetQuiz:s,hydrateQuiz:l,addToCart:u,resultClick:c}=e,v=cg(r,i,(_=t.quizCurrentQuestion)==null?void 0:_.next_question,n.answerInputs),w=ag(r,(y=t.quizCurrentQuestion)==null?void 0:y.next_question),C=ug(r,i,(N=t.quizCurrentQuestion)==null?void 0:N.next_question,n.answerInputs),x=fg(i,t,n),k=dg(t,o),a=D.useCallback((S="primary")=>({className:S==="primary"?"cio-question-cta-button":"cio-question-redo-button",type:"button",onClick:()=>s()}),[s]),h=D.useCallback(()=>({className:"",type:"button",onClick:()=>l()}),[l]),d=D.useCallback((S,T)=>({className:"cio-result-card-cta-button",type:"button",onClick:q=>u(q,S,T)}),[u]),f=D.useCallback((S,T,q)=>{((S==null?void 0:S.key)===" "||(S==null?void 0:S.key)==="Enter")&&c&&c(T,q)},[c]),p=D.useCallback(({result:S,position:T})=>({className:"cio-result-card-container",role:"button",tabIndex:0,onClick:()=>c(S,T),onKeyDown:q=>f(q,S,T)}),[f,c]),g=D.useCallback(({result:S,position:T})=>{var q;return{href:(q=S.data)==null?void 0:q.url,onClick:()=>c(S,T),onKeyDown:I=>f(I,S,T)}},[f,c]),m=D.useCallback(()=>{var S,T,q,I,M,H;return{src:(q=(T=(S=t.quizCurrentQuestion)==null?void 0:S.next_question)==null?void 0:T.images)==null?void 0:q.primary_url,alt:(H=(M=(I=t.quizCurrentQuestion)==null?void 0:I.next_question)==null?void 0:M.images)==null?void 0:H.primary_alt}},[t.quizCurrentQuestion]),E=D.useCallback(S=>{var T,q;return{className:"cio-question-option-image",src:(T=S==null?void 0:S.images)==null?void 0:T.primary_url,alt:(q=S==null?void 0:S.images)==null?void 0:q.primary_alt}},[]);return{getOpenTextInputProps:v,getNextQuestionButtonProps:x,getPreviousQuestionButtonProps:k,getQuizImageProps:m,getSelectQuestionImageProps:E,getSelectInputProps:C,getCoverQuestionProps:w,getResetQuizButtonProps:a,getHydrateQuizButtonProps:h,getAddToCartButtonProps:d,getQuizResultButtonProps:p,getQuizResultLinkProps:g}},hg=e=>D.useMemo(()=>{var r;let n={"--primary-color-h":"227","--primary-color-s":"70%","--primary-color-l":"46%"};if(e){const i=/^\s*\(?(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\)?/,o=(r=e.trim().match(i))==null?void 0:r.slice(1);if(o&&o.length===3){const[s,l,u]=o,[c,v,w]=Sh(Number(s),Number(l),Number(u));n={"--primary-color-h":`${c}`,"--primary-color-s":`${v}%`,"--primary-color-l":`${w}%`}}}return n},[e]),vg=(e,t,n)=>{D.useEffect(()=>{var r;t.quizResults&&(rg(e,t.quizResults),n&&jl(n)&&((r=t.quizResults.response)!=null&&r.results)&&n(t.quizResults.response.results))},[t,e,n])},gg=(e,t,n)=>D.useCallback((i,o)=>{t.quizResults&&(ig(e,t.quizResults,i,o),jl(n)&&n(i,o))},[t,e,n]),yg=(e,t,n)=>D.useCallback((i,o,s)=>{i.preventDefault(),t.quizResults&&(og(e,t.quizResults,o,s),jl(n)&&n(o))},[t,e,n]),mg=(e,t)=>D.useCallback(()=>{t&&t({type:Y.Back,payload:e.quizCurrentQuestion})},[t,e.quizCurrentQuestion]),_g=(e,t)=>D.useCallback(r=>{var s;const i=(s=e.quizCurrentQuestion)==null?void 0:s.next_question.type,o=e.quizCurrentQuestion;switch(i){case Y.Cover:t({type:Y.Cover,payload:{questionId:o.next_question.id,input:"",isLastQuestion:o.is_last_question}});break;case Y.OpenText:t({type:Y.OpenText,payload:{questionId:o.next_question.id,input:r,isLastQuestion:o.is_last_question}});break;case Y.SingleSelect:case Y.MultipleSelect:t({type:o.next_question.type,payload:{questionId:o.next_question.id,input:r,isLastQuestion:o.is_last_question}});break}},[e,t]),wg=(e,t,n)=>D.useCallback(()=>{var s,l;const i=(s=e.quizCurrentQuestion)==null?void 0:s.next_question,o=i==null?void 0:i.id;if(n&&o){const u=t.answerInputs[o];((l=u==null?void 0:u.value)!=null&&l.length||(i==null?void 0:i.type)==="cover")&&n({type:Y.Next,payload:e.quizCurrentQuestion})}},[n,e.quizCurrentQuestion,t.answerInputs]),kg=(e,t,n,r)=>D.useCallback(()=>{r&&(t({type:Y.Reset}),n({type:Ke.RESET_QUIZ}),e())},[t,n,e,r]),Sg=(e,t)=>{const n=Hs(e);return D.useCallback(()=>{n&&t({type:Y.Hydrate,payload:n})},[t,n])},Eg=(e,t,n)=>{const{quizApiState:r,dispatchLocalState:i,dispatchApiState:o,hasQuizStoredState:s,quizStateKey:l,quizLocalState:u}=n,{resultsPageOptions:c}=e,{onAddToCartClick:v,onQuizResultClick:w,onQuizResultsLoaded:C}=c,x=_g(r,i),k=wg(r,u,i),a=mg(r,i),h=yg(t,r,v),d=gg(t,r,w);vg(t,r,C);const f=kg(ra(l),i,o,r.quizResults),p=Sg(l,i);return{addToCart:h,resultClick:d,quizAnswerChanged:x,previousQuestion:a,nextQuestion:k,resetQuiz:f,hydrateQuiz:p,hasSessionStorageState:s,resetSessionStorageState:ra(l)}},Yf={quizRequestState:Pt.Stale};function Cg(e,t){var n,r,i,o,s,l,u,c,v,w;switch(t.type){case Ke.SET_IS_LOADING:return{...e,quizRequestState:Pt.Loading,quizCurrentQuestion:void 0,quizResults:void 0};case Ke.SET_IS_ERROR:return{...e,quizRequestState:Pt.Error,quizCurrentQuestion:void 0,quizResults:void 0,selectedOptionsWithAttributes:void 0};case Ke.SET_CURRENT_QUESTION:{const{isOpenQuestion:C,isCoverQuestion:x,isSingleQuestion:k,isMultipleQuestion:a,isSelectQuestion:h}=Hf((i=(r=(n=t.payload)==null?void 0:n.quizCurrentQuestion)==null?void 0:r.next_question)==null?void 0:i.type),d=e.quizFirstQuestion||((o=t.payload)==null?void 0:o.quizCurrentQuestion);return{...e,quizRequestState:Pt.Success,quizCurrentQuestion:{...(s=t.payload)==null?void 0:s.quizCurrentQuestion,isFirstQuestion:(d==null?void 0:d.next_question.id)===((c=(u=(l=t.payload)==null?void 0:l.quizCurrentQuestion)==null?void 0:u.next_question)==null?void 0:c.id),isOpenQuestion:C,isCoverQuestion:x,isSingleQuestion:k,isMultipleQuestion:a,isSelectQuestion:h},quizFirstQuestion:d,quizResults:void 0,selectedOptionsWithAttributes:void 0}}case Ke.SET_QUIZ_RESULTS:{const C=((v=t.payload)==null?void 0:v.quizResults.quiz_selected_options.filter(x=>x.has_attribute).map(x=>x.value))||[];return{...e,quizRequestState:Pt.Success,quizResults:(w=t.payload)==null?void 0:w.quizResults,quizCurrentQuestion:void 0,selectedOptionsWithAttributes:C}}case Ke.RESET_QUIZ:return Yf;default:return e}}const xg=(e,t,n,r,i)=>{const[o,s]=D.useReducer(Cg,Yf),{quizId:l,quizVersionId:u,resultsPageOptions:c}=e;return D.useEffect(()=>{(async()=>{if(s({type:Ke.SET_IS_LOADING}),n.isLastAnswer||r)try{const v=await ng(t,l,{answers:n.answers,resultsPerPage:c==null?void 0:c.numResultsToDisplay,quizVersionId:n.quizVersionId,quizSessionId:n.quizSessionId});s({type:Ke.SET_QUIZ_RESULTS,payload:{quizResults:v}}),n.isQuizCompleted||i({type:Y.Complete})}catch{s({type:Ke.SET_IS_ERROR})}else try{const v=n.quizVersionId||u,{quizSessionId:w}=n,C=await tg(t,l,{answers:n.answers,quizVersionId:v,quizSessionId:w});(!w&&(C!=null&&C.quiz_session_id)||!v&&C.quiz_version_id)&&i({type:Y.Hydrate,payload:{quizVersionId:C==null?void 0:C.quiz_version_id,quizSessionId:C==null?void 0:C.quiz_session_id}}),s({type:Ke.SET_CURRENT_QUESTION,payload:{quizCurrentQuestion:C}})}catch{s({type:Ke.SET_IS_ERROR})}})()},[t,l,n.answers,c==null?void 0:c.numResultsToDisplay]),{quizApiState:o,dispatchApiState:s}},Xf={answers:[],answerInputs:{},isLastAnswer:!1,isQuizCompleted:!1};function Kr(e,t){return{...e,[String(t.payload.questionId)]:{type:t.type,value:t.payload.input}}}function Rg(e,t){var n,r,i,o,s;switch(t.type){case Y.OpenText:return{...e,answerInputs:Kr(e.answerInputs,t),isLastAnswer:!!((n=t.payload)!=null&&n.isLastQuestion),isQuizCompleted:!1};case Y.Cover:return{...e,answerInputs:Kr(e.answerInputs,t),isLastAnswer:!!((r=t.payload)!=null&&r.isLastQuestion),isQuizCompleted:!1};case Y.SingleSelect:return{...e,answerInputs:Kr(e.answerInputs,t),isLastAnswer:!!((i=t.payload)!=null&&i.isLastQuestion),isQuizCompleted:!1};case Y.MultipleSelect:return{...e,answerInputs:Kr(e.answerInputs,t),isLastAnswer:!!((o=t.payload)!=null&&o.isLastQuestion),isQuizCompleted:!1};case Y.Next:{const{answers:l}=e,u=[...l],c=l.length,v=(s=Object.values(e.answerInputs))==null?void 0:s[c];switch(v.type){case Y.OpenText:u.push(["true"]);break;case Y.Cover:u.push(["seen"]);break;case Y.SingleSelect:u.push(v.value);break;case Y.MultipleSelect:u.push(v.value);break;default:u.push([])}return{...e,answers:u,isQuizCompleted:!1}}case Y.Back:{const l={...e.answerInputs};return{...e,answerInputs:l,answers:[...e.answers.slice(0,-1)],isLastAnswer:!1,isQuizCompleted:!1}}case Y.Reset:return{...Xf};case Y.Hydrate:return{...e,...t.payload};case Y.Complete:return{...e,isQuizCompleted:!0};default:return e}}const zg=e=>{var l;const[t,n]=D.useReducer(Rg,Xf),r=(e==null?void 0:e.sessionStateKey)||Uh;D.useEffect(()=>{var u,c;(u=t==null?void 0:t.answers)!=null&&u.length&&((c=window==null?void 0:window.sessionStorage)==null||c.setItem(r,JSON.stringify(t)))},[t,r]);const i=()=>Hs(r)!==null,o=!!((l=Hs(r))!=null&&l.isQuizCompleted)&&!(e!=null&&e.showSessionModalOnResults),s=D.useCallback(u=>{kh(u),n(u)},[]);return{quizLocalState:t,hasQuizStoredState:i,dispatchLocalState:s,skipToResults:o,quizStateKey:r}},Ng=(e,t)=>{const{sessionStateOptions:n}=e,{quizLocalState:r,dispatchLocalState:i,hasQuizStoredState:o,skipToResults:s,quizStateKey:l}=zg(n),{quizApiState:u,dispatchApiState:c}=xg(e,t,r,s,i);return{quizApiState:u,quizLocalState:r,dispatchApiState:c,dispatchLocalState:i,hasQuizStoredState:o,skipToResults:s,quizStateKey:l}},Tg=e=>{const{apiKey:t,cioJsClient:n,primaryColor:r}=e;lg(e);const i=sg({apiKey:t,cioJsClient:n}),o=Ng(e,i),s=Eg(e,i,o),{quizApiState:l,quizLocalState:u,skipToResults:c}=o,v=pg(s,l,u),w=hg(r);return{cioClient:i,state:{answers:{inputs:u.answerInputs,isLastAnswer:u.isLastAnswer},quiz:{requestState:l.quizRequestState,versionId:u.quizVersionId,sessionId:u.quizSessionId,skipToResults:c,currentQuestion:l.quizCurrentQuestion,results:l.quizResults,selectedOptionsWithAttributes:l.selectedOptionsWithAttributes}},events:{...s},...v,primaryColorStyles:w}};function qg({continueSession:e,resetStoredState:t,setShowSessionPrompt:n,showSessionPrompt:r}){const i=()=>{t(),n(!1)};if(r){const o=()=>({className:"cio-question-cta-button",onClick:()=>{e(),n(!1)}}),s=()=>({className:"cio-question-cta-button",onClick:()=>{t(),n(!1)}});return O.createElement("div",{className:"cio-session-prompt-modal",role:"presentation",onClick:i},O.createElement("div",{className:"cio-session-prompt-container"},O.createElement("div",{className:"cio-session-prompt-content",role:"presentation",onClick:l=>l.stopPropagation()},O.createElement("div",null,"Do you want to continue where you left off?"),O.createElement("div",{className:"cio-session-prompt-controls-container"},O.createElement(qi,{ctaText:"No",type:"button",propsGetters:s}),O.createElement(qi,{type:"button",ctaText:"Yes",propsGetters:o})))))}return null}function Pg(e){const{cioClient:t,state:n,events:{hydrateQuiz:r,hasSessionStorageState:i,resetSessionStorageState:o},getAddToCartButtonProps:s,getCoverQuestionProps:l,getHydrateQuizButtonProps:u,getNextQuestionButtonProps:c,getOpenTextInputProps:v,getPreviousQuestionButtonProps:w,getQuizImageProps:C,getQuizResultButtonProps:x,getQuizResultLinkProps:k,getResetQuizButtonProps:a,getSelectInputProps:h,primaryColorStyles:d}=Tg(e),[f,p]=D.useState(!1),{resultsPageOptions:g,sessionStateOptions:m}=e;D.useEffect(()=>{(m==null?void 0:m.showSessionModal)!==void 0?p((m==null?void 0:m.showSessionModal)&&i()&&!n.quiz.skipToResults):p(i()&&!n.quiz.skipToResults),n.quiz.skipToResults&&r()},[]);const E={cioClient:t,state:n,getAddToCartButtonProps:s,getCoverQuestionProps:l,getHydrateQuizButtonProps:u,getNextQuestionButtonProps:c,getOpenTextInputProps:v,getPreviousQuestionButtonProps:w,getQuizImageProps:C,getQuizResultButtonProps:x,getQuizResultLinkProps:k,getResetQuizButtonProps:a,getSelectInputProps:h,customClickItemCallback:!!(g!=null&&g.onQuizResultClick),primaryColorStyles:d};return n.quiz.requestState===Pt.Loading?O.createElement("div",{className:"cio-quiz"},O.createElement(Vf,null)):n.quiz.requestState===Pt.Success?O.createElement("div",{className:"cio-quiz"},O.createElement("style",null,".cio-quiz ",Eh(d)),O.createElement(qg,{resetStoredState:o,continueSession:r,showSessionPrompt:f,setShowSessionPrompt:p}),O.createElement(Be.Provider,{value:E},n.quiz.results||n.quiz.skipToResults?O.createElement(Bh,{options:g}):n.quiz.currentQuestion&&O.createElement(Nh,null))):null}const Ig=({selector:e,includeCSS:t=!0,...n})=>{if(document){const r=document.getElementById("cio-quizzes-styles"),i=document.querySelector(e);if(!i){console.error("CioQuiz: There were no elements found for the provided selector");return}r&&(t?r.disabled=!1:r.disabled=!0),Ko.createRoot(i).render(O.createElement(O.StrictMode,null,O.createElement(Pg,{...n})))}};window&&(window.CioQuiz=Ig);export{Ig as default};
|
|
@@ -5,7 +5,7 @@ const react_1 = tslib_1.__importStar(require("react"));
|
|
|
5
5
|
const RedoSVG_1 = tslib_1.__importDefault(require("./RedoSVG"));
|
|
6
6
|
const context_1 = tslib_1.__importDefault(require("../CioQuiz/context"));
|
|
7
7
|
function RedoButton(props) {
|
|
8
|
-
const { redoText = '
|
|
8
|
+
const { redoText = 'Retake Quiz', disabled } = props, rest = tslib_1.__rest(props, ["redoText", "disabled"]);
|
|
9
9
|
const { getResetQuizButtonProps } = (0, react_1.useContext)(context_1.default);
|
|
10
10
|
if (getResetQuizButtonProps) {
|
|
11
11
|
return (
|
|
@@ -6,7 +6,7 @@ const ResultCtaButton_1 = tslib_1.__importDefault(require("../ResultCtaButton/Re
|
|
|
6
6
|
const context_1 = tslib_1.__importDefault(require("../CioQuiz/context"));
|
|
7
7
|
function ResultCard(props) {
|
|
8
8
|
var _a, _b, _c, _d;
|
|
9
|
-
const { result, salePriceKey, regularPriceKey, resultPosition, ratingCountKey, ratingScoreKey } = props;
|
|
9
|
+
const { result, salePriceKey, regularPriceKey, resultPosition, ratingCountKey, ratingScoreKey, renderResultCardPriceDetails, } = props;
|
|
10
10
|
const { customClickItemCallback, getQuizResultButtonProps, getQuizResultLinkProps } = (0, react_1.useContext)(context_1.default);
|
|
11
11
|
const salePrice = salePriceKey && ((_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a[salePriceKey]);
|
|
12
12
|
const regularPrice = regularPriceKey && ((_b = result === null || result === void 0 ? void 0 : result.data) === null || _b === void 0 ? void 0 : _b[regularPriceKey]);
|
|
@@ -28,13 +28,13 @@ function ResultCard(props) {
|
|
|
28
28
|
"(",
|
|
29
29
|
ratingCount,
|
|
30
30
|
")")),
|
|
31
|
-
react_1.default.createElement("div", { className: 'cio-result-card-prices' },
|
|
31
|
+
renderResultCardPriceDetails ? (renderResultCardPriceDetails(result)) : (react_1.default.createElement("div", { className: 'cio-result-card-prices' },
|
|
32
32
|
salePrice && react_1.default.createElement("span", { className: 'cio-result-card-sale-price' },
|
|
33
33
|
"$",
|
|
34
34
|
salePrice),
|
|
35
35
|
regularPrice && (react_1.default.createElement("span", { className: `cio-result-card-regular-price${salePrice ? '--strike-through' : ''}` },
|
|
36
36
|
"$",
|
|
37
|
-
regularPrice)))))));
|
|
37
|
+
regularPrice))))))));
|
|
38
38
|
};
|
|
39
39
|
const resultCardContentWithoutLink = () => getQuizResultButtonProps && (react_1.default.createElement("div", Object.assign({}, getQuizResultButtonProps({ result, position: resultPosition, type: 'button' })), resultCardContent()));
|
|
40
40
|
const resultCardContentWithLink = () => getQuizResultLinkProps && (react_1.default.createElement("a", Object.assign({ className: 'cio-result-card-anchor', rel: 'noreferrer', target: '_blank' }, getQuizResultLinkProps({ result, position: resultPosition, type: 'link' })), resultCardContent()));
|
|
@@ -11,7 +11,7 @@ const Spinner_1 = tslib_1.__importDefault(require("../Spinner/Spinner"));
|
|
|
11
11
|
function ResultContainer(props) {
|
|
12
12
|
var _a, _b, _c;
|
|
13
13
|
const { options } = props;
|
|
14
|
-
const { resultCardSalePriceKey, resultCardRegularPriceKey, resultCardRatingCountKey, resultCardRatingScoreKey, } = options;
|
|
14
|
+
const { resultCardSalePriceKey, resultCardRegularPriceKey, resultCardRatingCountKey, resultCardRatingScoreKey, renderResultCardPriceDetails, } = options;
|
|
15
15
|
const { state } = (0, react_1.useContext)(context_1.default);
|
|
16
16
|
const zeroResults = !((_c = (_b = (_a = state === null || state === void 0 ? void 0 : state.quiz.results) === null || _a === void 0 ? void 0 : _a.response) === null || _b === void 0 ? void 0 : _b.results) === null || _c === void 0 ? void 0 : _c.length);
|
|
17
17
|
const resultsTitle = zeroResults ? '' : 'Here are your results';
|
|
@@ -21,7 +21,7 @@ function ResultContainer(props) {
|
|
|
21
21
|
react_1.default.createElement("div", { className: 'cio-results-filter-and-redo-container' },
|
|
22
22
|
react_1.default.createElement(ResultFilters_1.default, { hasNoResults: zeroResults }),
|
|
23
23
|
react_1.default.createElement(RedoButton_1.default, null)),
|
|
24
|
-
!zeroResults && (react_1.default.createElement(Results_1.default, { resultCardSalePriceKey: resultCardSalePriceKey, resultCardRegularPriceKey: resultCardRegularPriceKey, resultCardRatingCountKey: resultCardRatingCountKey, resultCardRatingScoreKey: resultCardRatingScoreKey })),
|
|
24
|
+
!zeroResults && (react_1.default.createElement(Results_1.default, { resultCardSalePriceKey: resultCardSalePriceKey, resultCardRegularPriceKey: resultCardRegularPriceKey, resultCardRatingCountKey: resultCardRatingCountKey, resultCardRatingScoreKey: resultCardRatingScoreKey, renderResultCardPriceDetails: renderResultCardPriceDetails })),
|
|
25
25
|
zeroResults && react_1.default.createElement(ZeroResults_1.default, null)));
|
|
26
26
|
}
|
|
27
27
|
return (react_1.default.createElement("div", { className: 'cio-results-container' },
|
|
@@ -6,11 +6,11 @@ const context_1 = tslib_1.__importDefault(require("../CioQuiz/context"));
|
|
|
6
6
|
const ResultCard_1 = tslib_1.__importDefault(require("../ResultCard/ResultCard"));
|
|
7
7
|
function Results(props) {
|
|
8
8
|
var _a, _b, _c, _d;
|
|
9
|
-
const { resultCardSalePriceKey, resultCardRegularPriceKey, resultCardRatingCountKey, resultCardRatingScoreKey, } = props;
|
|
9
|
+
const { resultCardSalePriceKey, resultCardRegularPriceKey, resultCardRatingCountKey, resultCardRatingScoreKey, renderResultCardPriceDetails, } = props;
|
|
10
10
|
const { state } = (0, react_1.useContext)(context_1.default);
|
|
11
11
|
return (react_1.default.createElement("div", { className: 'cio-results' }, (_d = (_c = (_b = (_a = state === null || state === void 0 ? void 0 : state.quiz) === null || _a === void 0 ? void 0 : _a.results) === null || _b === void 0 ? void 0 : _b.response) === null || _c === void 0 ? void 0 : _c.results) === null || _d === void 0 ? void 0 : _d.map((result, index) => {
|
|
12
12
|
var _a;
|
|
13
|
-
return (react_1.default.createElement(ResultCard_1.default, { result: result, key: (_a = result.data) === null || _a === void 0 ? void 0 : _a.id, salePriceKey: resultCardSalePriceKey, regularPriceKey: resultCardRegularPriceKey, ratingCountKey: resultCardRatingCountKey, ratingScoreKey: resultCardRatingScoreKey, resultPosition: index + 1 }));
|
|
13
|
+
return (react_1.default.createElement(ResultCard_1.default, { result: result, key: (_a = result.data) === null || _a === void 0 ? void 0 : _a.id, salePriceKey: resultCardSalePriceKey, regularPriceKey: resultCardRegularPriceKey, ratingCountKey: resultCardRatingCountKey, ratingScoreKey: resultCardRatingScoreKey, renderResultCardPriceDetails: renderResultCardPriceDetails, resultPosition: index + 1 }));
|
|
14
14
|
})));
|
|
15
15
|
}
|
|
16
16
|
exports.default = Results;
|
|
@@ -8,6 +8,6 @@ function ZeroResults() {
|
|
|
8
8
|
const { getResetQuizButtonProps } = (0, react_1.useContext)(context_1.default);
|
|
9
9
|
return (react_1.default.createElement("div", { className: 'cio-zero-results' },
|
|
10
10
|
react_1.default.createElement("h3", { className: 'cio-zero-results-subtitle' }, "Sorry, we couldn\u2019t find products that perfectly match your preferences."),
|
|
11
|
-
react_1.default.createElement(CTAButton_1.default, { ctaText: '
|
|
11
|
+
react_1.default.createElement(CTAButton_1.default, { ctaText: 'Retake Quiz', propsGetters: getResetQuizButtonProps })));
|
|
12
12
|
}
|
|
13
13
|
exports.default = ZeroResults;
|
package/lib/cjs/constants.js
CHANGED
|
@@ -20,6 +20,7 @@ exports.componentDescription = `- import \`CioQuiz\` to render in your JSX.
|
|
|
20
20
|
- \`resultCardSalePriceKey\` is an optional parameter that specifies the metadata field name for the sale price
|
|
21
21
|
- \`resultCardRatingCountKey\` is an optional parameter that specifies the metadata field name for the ratings count
|
|
22
22
|
- \`resultCardRatingScoreKey\` is an optional parameter that specifies the metadata field name for the ratings score
|
|
23
|
+
- \`renderResultCardPriceDetails\` is an optional render function to render custom prices section in result card
|
|
23
24
|
- \`sessionStateOptions\` lets you configure the session modal behavior
|
|
24
25
|
- \`showSessionModal\` is a boolean used to decide whether to show the session modal. The default behavior is to show the session modal
|
|
25
26
|
- \`showSessionModalOnResults\` is a boolean to decide whether to show the session modal after reaching the results page. The default behavior is to not show the session modal
|
|
@@ -2,7 +2,7 @@ import React, { useContext } from 'react';
|
|
|
2
2
|
import RedoSVG from './RedoSVG';
|
|
3
3
|
import QuizContext from '../CioQuiz/context';
|
|
4
4
|
function RedoButton(props) {
|
|
5
|
-
const { redoText = '
|
|
5
|
+
const { redoText = 'Retake Quiz', disabled, ...rest } = props;
|
|
6
6
|
const { getResetQuizButtonProps } = useContext(QuizContext);
|
|
7
7
|
if (getResetQuizButtonProps) {
|
|
8
8
|
return (
|
|
@@ -2,7 +2,7 @@ import React, { useContext } from 'react';
|
|
|
2
2
|
import ResultCtaButton from '../ResultCtaButton/ResultCtaButton';
|
|
3
3
|
import QuizContext from '../CioQuiz/context';
|
|
4
4
|
export default function ResultCard(props) {
|
|
5
|
-
const { result, salePriceKey, regularPriceKey, resultPosition, ratingCountKey, ratingScoreKey } = props;
|
|
5
|
+
const { result, salePriceKey, regularPriceKey, resultPosition, ratingCountKey, ratingScoreKey, renderResultCardPriceDetails, } = props;
|
|
6
6
|
const { customClickItemCallback, getQuizResultButtonProps, getQuizResultLinkProps } = useContext(QuizContext);
|
|
7
7
|
const salePrice = salePriceKey && result?.data?.[salePriceKey];
|
|
8
8
|
const regularPrice = regularPriceKey && result?.data?.[regularPriceKey];
|
|
@@ -22,13 +22,13 @@ export default function ResultCard(props) {
|
|
|
22
22
|
"(",
|
|
23
23
|
ratingCount,
|
|
24
24
|
")")),
|
|
25
|
-
React.createElement("div", { className: 'cio-result-card-prices' },
|
|
25
|
+
renderResultCardPriceDetails ? (renderResultCardPriceDetails(result)) : (React.createElement("div", { className: 'cio-result-card-prices' },
|
|
26
26
|
salePrice && React.createElement("span", { className: 'cio-result-card-sale-price' },
|
|
27
27
|
"$",
|
|
28
28
|
salePrice),
|
|
29
29
|
regularPrice && (React.createElement("span", { className: `cio-result-card-regular-price${salePrice ? '--strike-through' : ''}` },
|
|
30
30
|
"$",
|
|
31
|
-
regularPrice)))))));
|
|
31
|
+
regularPrice))))))));
|
|
32
32
|
const resultCardContentWithoutLink = () => getQuizResultButtonProps && (React.createElement("div", { ...getQuizResultButtonProps({ result, position: resultPosition, type: 'button' }) }, resultCardContent()));
|
|
33
33
|
const resultCardContentWithLink = () => getQuizResultLinkProps && (React.createElement("a", { className: 'cio-result-card-anchor', rel: 'noreferrer', target: '_blank', ...getQuizResultLinkProps({ result, position: resultPosition, type: 'link' }) }, resultCardContent()));
|
|
34
34
|
return (React.createElement("div", { className: 'cio-result-card' },
|
|
@@ -7,7 +7,7 @@ import Results from '../Results/Results';
|
|
|
7
7
|
import Spinner from '../Spinner/Spinner';
|
|
8
8
|
export default function ResultContainer(props) {
|
|
9
9
|
const { options } = props;
|
|
10
|
-
const { resultCardSalePriceKey, resultCardRegularPriceKey, resultCardRatingCountKey, resultCardRatingScoreKey, } = options;
|
|
10
|
+
const { resultCardSalePriceKey, resultCardRegularPriceKey, resultCardRatingCountKey, resultCardRatingScoreKey, renderResultCardPriceDetails, } = options;
|
|
11
11
|
const { state } = useContext(QuizContext);
|
|
12
12
|
const zeroResults = !state?.quiz.results?.response?.results?.length;
|
|
13
13
|
const resultsTitle = zeroResults ? '' : 'Here are your results';
|
|
@@ -17,7 +17,7 @@ export default function ResultContainer(props) {
|
|
|
17
17
|
React.createElement("div", { className: 'cio-results-filter-and-redo-container' },
|
|
18
18
|
React.createElement(ResultFilters, { hasNoResults: zeroResults }),
|
|
19
19
|
React.createElement(RedoButton, null)),
|
|
20
|
-
!zeroResults && (React.createElement(Results, { resultCardSalePriceKey: resultCardSalePriceKey, resultCardRegularPriceKey: resultCardRegularPriceKey, resultCardRatingCountKey: resultCardRatingCountKey, resultCardRatingScoreKey: resultCardRatingScoreKey })),
|
|
20
|
+
!zeroResults && (React.createElement(Results, { resultCardSalePriceKey: resultCardSalePriceKey, resultCardRegularPriceKey: resultCardRegularPriceKey, resultCardRatingCountKey: resultCardRatingCountKey, resultCardRatingScoreKey: resultCardRatingScoreKey, renderResultCardPriceDetails: renderResultCardPriceDetails })),
|
|
21
21
|
zeroResults && React.createElement(ZeroResults, null)));
|
|
22
22
|
}
|
|
23
23
|
return (React.createElement("div", { className: 'cio-results-container' },
|
|
@@ -2,8 +2,8 @@ import React, { useContext } from 'react';
|
|
|
2
2
|
import QuizContext from '../CioQuiz/context';
|
|
3
3
|
import ResultCard from '../ResultCard/ResultCard';
|
|
4
4
|
function Results(props) {
|
|
5
|
-
const { resultCardSalePriceKey, resultCardRegularPriceKey, resultCardRatingCountKey, resultCardRatingScoreKey, } = props;
|
|
5
|
+
const { resultCardSalePriceKey, resultCardRegularPriceKey, resultCardRatingCountKey, resultCardRatingScoreKey, renderResultCardPriceDetails, } = props;
|
|
6
6
|
const { state } = useContext(QuizContext);
|
|
7
|
-
return (React.createElement("div", { className: 'cio-results' }, state?.quiz?.results?.response?.results?.map((result, index) => (React.createElement(ResultCard, { result: result, key: result.data?.id, salePriceKey: resultCardSalePriceKey, regularPriceKey: resultCardRegularPriceKey, ratingCountKey: resultCardRatingCountKey, ratingScoreKey: resultCardRatingScoreKey, resultPosition: index + 1 })))));
|
|
7
|
+
return (React.createElement("div", { className: 'cio-results' }, state?.quiz?.results?.response?.results?.map((result, index) => (React.createElement(ResultCard, { result: result, key: result.data?.id, salePriceKey: resultCardSalePriceKey, regularPriceKey: resultCardRegularPriceKey, ratingCountKey: resultCardRatingCountKey, ratingScoreKey: resultCardRatingScoreKey, renderResultCardPriceDetails: renderResultCardPriceDetails, resultPosition: index + 1 })))));
|
|
8
8
|
}
|
|
9
9
|
export default Results;
|
|
@@ -5,6 +5,6 @@ function ZeroResults() {
|
|
|
5
5
|
const { getResetQuizButtonProps } = useContext(QuizContext);
|
|
6
6
|
return (React.createElement("div", { className: 'cio-zero-results' },
|
|
7
7
|
React.createElement("h3", { className: 'cio-zero-results-subtitle' }, "Sorry, we couldn\u2019t find products that perfectly match your preferences."),
|
|
8
|
-
React.createElement(CTAButton, { ctaText: '
|
|
8
|
+
React.createElement(CTAButton, { ctaText: 'Retake Quiz', propsGetters: getResetQuizButtonProps })));
|
|
9
9
|
}
|
|
10
10
|
export default ZeroResults;
|
package/lib/mjs/constants.js
CHANGED
|
@@ -17,6 +17,7 @@ export const componentDescription = `- import \`CioQuiz\` to render in your JSX.
|
|
|
17
17
|
- \`resultCardSalePriceKey\` is an optional parameter that specifies the metadata field name for the sale price
|
|
18
18
|
- \`resultCardRatingCountKey\` is an optional parameter that specifies the metadata field name for the ratings count
|
|
19
19
|
- \`resultCardRatingScoreKey\` is an optional parameter that specifies the metadata field name for the ratings score
|
|
20
|
+
- \`renderResultCardPriceDetails\` is an optional render function to render custom prices section in result card
|
|
20
21
|
- \`sessionStateOptions\` lets you configure the session modal behavior
|
|
21
22
|
- \`showSessionModal\` is a boolean used to decide whether to show the session modal. The default behavior is to show the session modal
|
|
22
23
|
- \`showSessionModalOnResults\` is a boolean to decide whether to show the session modal after reaching the results page. The default behavior is to not show the session modal
|
package/lib/styles.css
CHANGED
|
@@ -7,6 +7,7 @@ interface ResultCardProps {
|
|
|
7
7
|
ratingCountKey?: string;
|
|
8
8
|
ratingScoreKey?: string;
|
|
9
9
|
resultPosition: number;
|
|
10
|
+
renderResultCardPriceDetails?: (result: QuizResultDataPartial) => JSX.Element;
|
|
10
11
|
}
|
|
11
12
|
export default function ResultCard(props: ResultCardProps): JSX.Element;
|
|
12
13
|
export {};
|
package/lib/types/constants.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const apiKey = "key_wJSdZSiesX5hiVLt";
|
|
2
2
|
export declare const quizId = "coffee-quiz";
|
|
3
3
|
export declare const quizSessionStateKey = "constructorIOQuizState";
|
|
4
|
-
export declare const componentDescription = "- import `CioQuiz` to render in your JSX.\n- This component handles state management, data fetching, and rendering logic.\n- To use this component, `quizId`, `resultsPageOptions`, and one of `apiKey` or `cioJsClient` are required.\n- `resultsPageOptions` lets you configure the results page\n - `onAddToCartClick` is a callback function that will be called when the \"Add to cart\" button is clicked\n - `onQuizResultClick` is an optional callback function that will be called when the result card is clicked. The default behavior is redirecting the user to the item's URL\n - `onQuizResultsLoaded` is an optional callback function that will be called when the quiz results are loaded\n - `resultCardRegularPriceKey` is a parameter that specifies the metadata field name for the regular price\n - `resultCardSalePriceKey` is an optional parameter that specifies the metadata field name for the sale price \n - `resultCardRatingCountKey` is an optional parameter that specifies the metadata field name for the ratings count \n - `resultCardRatingScoreKey` is an optional parameter that specifies the metadata field name for the ratings score \n- `sessionStateOptions` lets you configure the session modal behavior\n - `showSessionModal` is a boolean used to decide whether to show the session modal. The default behavior is to show the session modal\n - `showSessionModalOnResults` is a boolean to decide whether to show the session modal after reaching the results page. The default behavior is to not show the session modal\n - `sessionStateKey` is a custom string that will be used as a session storage key\n- Use different props to configure the behavior of this component.\n- The following stories show how different props affect the component's behavior\n\n> Note: `cioJsClient` refers to an instance of the [constructorio-client-javascript](https://www.npmjs.com/package/@constructor-io/constructorio-client-javascript)\n";
|
|
4
|
+
export declare const componentDescription = "- import `CioQuiz` to render in your JSX.\n- This component handles state management, data fetching, and rendering logic.\n- To use this component, `quizId`, `resultsPageOptions`, and one of `apiKey` or `cioJsClient` are required.\n- `resultsPageOptions` lets you configure the results page\n - `onAddToCartClick` is a callback function that will be called when the \"Add to cart\" button is clicked\n - `onQuizResultClick` is an optional callback function that will be called when the result card is clicked. The default behavior is redirecting the user to the item's URL\n - `onQuizResultsLoaded` is an optional callback function that will be called when the quiz results are loaded\n - `resultCardRegularPriceKey` is a parameter that specifies the metadata field name for the regular price\n - `resultCardSalePriceKey` is an optional parameter that specifies the metadata field name for the sale price \n - `resultCardRatingCountKey` is an optional parameter that specifies the metadata field name for the ratings count \n - `resultCardRatingScoreKey` is an optional parameter that specifies the metadata field name for the ratings score \n - `renderResultCardPriceDetails` is an optional render function to render custom prices section in result card \n- `sessionStateOptions` lets you configure the session modal behavior\n - `showSessionModal` is a boolean used to decide whether to show the session modal. The default behavior is to show the session modal\n - `showSessionModalOnResults` is a boolean to decide whether to show the session modal after reaching the results page. The default behavior is to not show the session modal\n - `sessionStateKey` is a custom string that will be used as a session storage key\n- Use different props to configure the behavior of this component.\n- The following stories show how different props affect the component's behavior\n\n> Note: `cioJsClient` refers to an instance of the [constructorio-client-javascript](https://www.npmjs.com/package/@constructor-io/constructorio-client-javascript)\n";
|
|
5
5
|
export declare const hookDescription = "- import `useCioQuiz` and call this custom hook in a functional component.\n- This hook leaves rendering logic up to you, while handling:\n - state management\n - data fetching\n - keyboard navigation\n - mouse interactions\n - focus and submit event handling\n- Since the markup is controlled by you, the default styles might not be applied if you have a different DOM structure\n- To use this hook, an `apiKey` and `quizId` are required, and `resultsPageOptions` must be passed to the `useCioQuiz` hook to configure behavior. All other values are optional.\n- use the <a href=\"https://kentcdodds.com/blog/how-to-give-rendering-control-to-users-with-prop-getters\" target=\"__blank\">prop getters</a> and other variables returned by this hook (below) to leverage the functionality described above with jsx elements in your react component definitions\n\nCalling the `useCioQuiz` hook returns an object with the following keys:\n\n```jsx\nconst {\n // must be used for a hooks integrations\n state: QuizReturnState, // Quiz state\n events: [{...}], // array of quiz events\n getAddToCartButtonProps: () => ({...})), // prop getter for jsx add to cart button for quiz result,\n getCoverQuestionProps: () => ({...})), // prop getter for jsx quiz cover question,\n getHydrateQuizButtonProps: () => ({...})), // prop getter for jsx hydrate quiz button,\n getNextQuestionButtonProps: () => ({...})), // prop getter for jsx next button to traverse the quiz,\n getPreviousQuestionButtonProps: () => ({...})), // prop getter for jsx back button to traverse the quiz, \n getOpenTextInputProps: () => ({...})), // prop getter for jsx open text input,\n getSelectInputProps: () => ({...})), // prop getter for jsx select input for select type questions,\n getQuizImageProps: () => ({...})), // prop getter for jsx quiz image,\n getQuizResultButtonProps: () => ({...})), // prop getter for jsx result card click as a button,\n getQuizResultLinkProps: () => ({...})), // prop getter for jsx result card click as a link. Should be spread into <a> tags,\n getResetQuizButtonProps: () => ({...})), // prop getter for jsx reset quiz button,\n cioClient, // instance of constructorio-client-javascript\n } = useCioQuiz(args);\n```\n\n> Note: when we say `cioClient`, we are referring to an instance of the [constructorio-client-javascript](https://www.npmjs.com/package/@constructor-io/constructorio-client-javascript)\n";
|
|
6
6
|
export declare const basicDescription = "Pass an `apiKey` and a `quizId` to request questions and quiz results from Constructor's servers";
|
|
7
7
|
export declare const cioJsClientDescription = "If you are already using an instance of the `ConstructorIOClient`, you can pass a `cioJsClient` instead of an `apiKey` to request results from Constructor's servers\n\n> Note: `cioJsClient` refers to an instance of the [constructorio-client-javascript](https://www.npmjs.com/package/@constructor-io/constructorio-client-javascript)";
|
package/lib/types/types.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export interface ResultCardProps {
|
|
|
10
10
|
resultCardRegularPriceKey?: string;
|
|
11
11
|
resultCardRatingCountKey?: string;
|
|
12
12
|
resultCardRatingScoreKey?: string;
|
|
13
|
+
renderResultCardPriceDetails?: (result: QuizResultDataPartial) => JSX.Element;
|
|
13
14
|
}
|
|
14
15
|
export declare namespace QuizResultsEventsProps {
|
|
15
16
|
type OnQuizResultsLoaded = (results: QuizResultDataPartial) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@constructor-io/constructorio-ui-quizzes",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.7",
|
|
4
4
|
"description": "Constructor.io Quizzes UI library for web applications",
|
|
5
5
|
"author": "constructor.io",
|
|
6
6
|
"license": "MIT",
|
|
@@ -26,6 +26,10 @@
|
|
|
26
26
|
".": {
|
|
27
27
|
"import": "./lib/mjs/index.js",
|
|
28
28
|
"require": "./lib/cjs/index.js"
|
|
29
|
+
},
|
|
30
|
+
"./cjs": {
|
|
31
|
+
"import": "./lib/cjs/index.js",
|
|
32
|
+
"require": "./lib/cjs/index.js"
|
|
29
33
|
}
|
|
30
34
|
},
|
|
31
35
|
"files": [
|