freemium-survey-components 0.10.30 → 0.10.33

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/lib/index.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var n=require("react"),t=e(n),o=require("react-transition-group"),r=e(require("react-dom"));function i(e,n){void 0===n&&(n={});var t=n.insertAt;if(e&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===t&&o.firstChild?o.insertBefore(r,o.firstChild):o.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}i(".freemium-survey-components .nps-container {\n margin: 0 auto;\n width: 100%;\n display: flex;\n flex-direction: column;\n grid-gap: 28px;\n gap: 28px;\n}\n.freemium-survey-components .nps-container .footer {\n border-top: 1px solid var(--default-background-color);\n border-top: 1px solid var(--background-color, var(--default-background-color));\n padding-top: 20px;\n display: flex;\n justify-content: center;\n font-size: 0.875rem;\n line-height: 1.5;\n color: #666;\n}\n.freemium-survey-components .nps-container .footer:empty {\n display: none;\n}\n.freemium-survey-components .nps-container .nps-scale {\n position: relative;\n}\n.freemium-survey-components .nps-container .nps-scale .button-container {\n display: flex;\n border-radius: 4px;\n justify-content: space-between;\n background: var(--default-background-color);\n background: var(--background-color, var(--default-background-color));\n position: relative;\n margin-bottom: 40px;\n}\n.freemium-survey-components .nps-container .nps-scale .positive-text {\n position: absolute;\n color: #475867;\n bottom: -40px;\n font-size: 12px;\n right: 0px;\n text-align: right;\n}\n.freemium-survey-components .nps-container .nps-scale .negative-text {\n position: absolute;\n color: #475867;\n bottom: -40px;\n font-size: 12px;\n left: 0;\n text-align: left;\n}\n.freemium-survey-components .nps-container .nps-scale span {\n color: #aaa;\n font-size: 0.75rem;\n}\n.freemium-survey-components .nps-container .nps-scale button {\n display: inline-block;\n font-size: 1rem;\n white-space: nowrap;\n vertical-align: middle;\n background: none;\n border: none;\n box-shadow: none;\n cursor: pointer;\n text-align: center;\n font-weight: 400;\n border-radius: 4px;\n margin: 0;\n outline: none;\n margin-left: -1px;\n width: 40px;\n height: 40px;\n transform: scale(1);\n}\n.freemium-survey-components .nps-container .nps-scale button:hover {\n transition: background 0.2s ease-in, color 0.2s ease-in, border-color 0.2s ease-in, transform 0.2s cubic-bezier(0.5, 2, 0.5, 0.75);\n}\n.freemium-survey-components .nps-container .nps-scale button:hover, .freemium-survey-components .nps-container .nps-scale button:focus {\n color: white;\n transform: scale(1.2);\n z-index: 2;\n position: relative;\n}\n.freemium-survey-components .nps-container .nps-scale button.active {\n color: white;\n transform: scale(1.2);\n z-index: 2;\n position: relative;\n}\n.freemium-survey-components .nps-container .nps-scale.rounded button {\n border-radius: 50%;\n}\n.freemium-survey-components .nps-container .nps-scale.square button {\n border-radius: 0;\n}\n.freemium-survey-components .nps-container .nps-scale.curved button {\n border-radius: 3px;\n}\n.freemium-survey-components .nps-container .nps-scale.highlighted button:hover, .freemium-survey-components .nps-container .nps-scale.highlighted button:focus, .freemium-survey-components .nps-container .nps-scale.highlighted button.active {\n background: var(--default-brand-color) !important;\n background: var(--brand-color, var(--default-brand-color)) !important;\n}\n.freemium-survey-components .nps-container .nps-scale .choices {\n width: 100%;\n display: flex;\n justify-content: space-between;\n font-weight: 500;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .button-container {\n background-color: transparent;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice {\n background: #E43E3D;\n color: #fff;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(1), .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(2) {\n background: #00AF50;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(3), .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(4) {\n background: #F8C43E;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:hover, .freemium-survey-components .nps-container .nps-scale.standard .choice:focus, .freemium-survey-components .nps-container .nps-scale.standard .choice.active {\n transform: scale(1.2);\n}\n\n.freemium-survey-components.mobile-preview .nps-container .nps-scale .button-container {\n background: transparent;\n}\n.freemium-survey-components.mobile-preview .nps-container .nps-scale .choices {\n flex-wrap: wrap;\n justify-content: center;\n grid-gap: 16px;\n gap: 16px;\n background: transparent;\n}\n.freemium-survey-components.mobile-preview .nps-container .nps-scale button {\n border-radius: 50%;\n background: #ebeff3;\n}\n\n@media (max-width: 550px) {\n .freemium-survey-components .nps-container .nps-scale .button-container,\n.card-survey-style .nps-container .nps-scale .button-container {\n background: transparent;\n }\n .freemium-survey-components .nps-container .nps-scale .choices,\n.card-survey-style .nps-container .nps-scale .choices {\n flex-wrap: wrap;\n justify-content: center;\n grid-gap: 16px;\n gap: 16px;\n background: transparent;\n }\n .freemium-survey-components .nps-container .nps-scale button,\n.card-survey-style .nps-container .nps-scale button {\n border-radius: 50%;\n background: #ebeff3;\n }\n}\n.widget-survey-components .nps-container .nps-scale .button-container {\n background: transparent;\n}\n.widget-survey-components .nps-container .nps-scale .choices {\n flex-wrap: wrap;\n justify-content: center;\n grid-gap: 16px;\n gap: 16px;\n background: transparent;\n}\n.widget-survey-components .nps-container .nps-scale button {\n border-radius: 50%;\n background: #ebeff3;\n}");const s=e=>{const{type_info:{linear_scale:{button_style:o="highlighted",button_shape:r="rounded"}={},score_presets:{start:i="Very unlikely",end:s="Very likely"}={},validation:{min:a},footer_text:c}}=e,u=e=>{switch(e){case e<=6:return"detractor";case e<=8:return"passive";default:return"promoter"}},l=n.useRef(Array.from({length:10+(0===a?1:0)},((e,n)=>n+a)));return t.createElement("div",{className:"nps-container","data-test-input":"nps"},t.createElement("div",{className:`nps-scale ${r} ${o}`},t.createElement("div",{className:"button-container"},t.createElement("span",{className:"negative-text",role:"note"},`${a} - ${i}`),t.createElement("span",{className:"positive-text",role:"note"},`${l.current[l.current.length-1]} - ${s}`),t.createElement("div",{className:"choices",role:"radiogroup","aria-required":!0},l.current.map((n=>t.createElement("button",{role:"radio","aria-checked":e.npsValue===n,key:n,"data-test-nps-choice":n,onClick:t=>{e.onChangeHandler(n)},className:`choice ${u(n)} ${e.npsValue===n&&"active"}`},n)))))),t.createElement("div",{className:"footer",role:"note"},c))},a=(e,n)=>(e.defaultProps=n,e);i('.freemium-survey-components .input-container,\n.freemium-survey-components .textarea-container {\n display: flex;\n flex-direction: column;\n width: 100%;\n border-radius: 4px;\n position: relative;\n}\n.freemium-survey-components label.input-label {\n display: inline-block;\n padding-bottom: 8px;\n padding-left: 2px;\n font-size: 0.75rem;\n font-weight: 400;\n}\n.freemium-survey-components label.required::after {\n content: "*";\n position: relative;\n top: 2px;\n font-weight: 500;\n font-size: 0.85rem;\n padding-left: 3px;\n color: #d72d30;\n}\n.freemium-survey-components .input-basic {\n width: 100%;\n display: flex;\n align-items: center;\n border-radius: 4px;\n border: 1px solid var(--default-brand-color);\n border: 1px solid var(--brand-color, var(--default-brand-color));\n transition: border-color 0.2s linear;\n background: #fff;\n}\n.freemium-survey-components .textarea-container .input-basic {\n flex-direction: column;\n align-items: unset;\n}\n.freemium-survey-components .input-basic.error {\n border: 1px solid #d72d30;\n}\n.freemium-survey-components .input-basic.error:hover {\n border: 1px solid #d72d30;\n}\n.freemium-survey-components .input-basic.error[focus-within] {\n box-shadow: none;\n}\n.freemium-survey-components .input-basic.error:focus-within {\n box-shadow: none;\n}\n.freemium-survey-components .input-basic:hover {\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n transition: 0.2s linear;\n}\n.freemium-survey-components .input-basic[focus-within] {\n border: 1px solid transparent;\n box-shadow: 0 0 0 2px var(--default-brand-color);\n box-shadow: 0 0 0 2px var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components .input-basic:focus-within {\n border: 1px solid transparent;\n box-shadow: 0 0 0 2px var(--default-brand-color);\n box-shadow: 0 0 0 2px var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components .end-max-length {\n padding: 0 8px;\n font-size: 0.75rem;\n color: #264966;\n}\n.freemium-survey-components .textarea-container .end-max-length {\n padding: 8px;\n align-self: flex-end;\n}\n.freemium-survey-components span.input-error {\n display: block;\n padding-left: 2px;\n padding-top: 4px;\n font-size: 0.9rem;\n color: #d72d30;\n}\n.freemium-survey-components input[type=text] {\n padding: 6px 12px;\n flex: 1;\n border: unset;\n height: 32px;\n font-size: 1rem;\n /* line-height: ${typography.input.text.lineHeight}; */\n border-radius: 4px;\n}\n.freemium-survey-components input[type=text],\n.freemium-survey-components textarea {\n outline: none;\n border: none;\n}\n.freemium-survey-components input[type=text]::-moz-placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components input[type=text]:-ms-input-placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components input[type=text]::placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components textarea {\n min-height: 116px;\n padding: 12px;\n flex: 1;\n border: unset;\n resize: none;\n font-size: 1rem;\n /* line-height: ${typography.input.text.lineHeight}; */\n border-radius: 4px;\n}\n.freemium-survey-components textarea::-moz-placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components textarea:-ms-input-placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components textarea::placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}');const c=["RANGE","NPS","RADIO","DROPDOWN"],u={isRequired:!1,showCount:!0,isErrored:!1,inline:!1,spellCheck:!1,autoFocusInput:!0},l=n.forwardRef(((e,o)=>{const r=n.useRef(null);n.useEffect((()=>{e.autoFocusInput&&setTimeout((()=>{r.current?.focus()}),600+e.autoFocusDelay)}),[e.autoFocusInput]);const{inputStyle:i,style:s,className:a,showCount:c,isErrored:u,startLabel:l,isRequired:d,errorText:p,endLabel:m,maxLength:f=300,onChange:y,autoFocusInput:v,...x}=e;return t.createElement("div",{className:"input-container",style:s},e.label&&t.createElement("label",{className:"input-label "+(d?"required":"")},e.label),t.createElement("div",null,l&&t.createElement("div",{className:"start-label"},l),t.createElement("div",{className:`input-basic ${u?"error":""}${a||""}`},t.createElement("input",Object.assign({},x,{type:"text",autoComplete:"off",ref:r,style:i,onChange:e=>{e.target.value?.length>f||y?.(e)}})),c&&f>0&&t.createElement("div",{className:"end-max-length"},`${e.value&&e.value.length||0}/${f}`)),m&&t.createElement("div",{className:"end-label"},m)),u&&p&&t.createElement("span",{className:"input-error"},e.errorText))})),d=n.forwardRef(((e,o)=>{const r=n.useRef(null);n.useEffect((()=>{e.autoFocusInput&&setTimeout((()=>{r.current?.focus()}),600+e.autoFocusDelay)}),[e.autoFocusInput]);const{inputStyle:i,style:s,className:a,showCount:c,maxLength:u=1500,startLabel:l,isRequired:d,autoFocusInput:p,onChange:m,...f}=e;return t.createElement(t.Fragment,null,t.createElement("div",{className:"textarea-container",style:s},e.label&&t.createElement("label",{className:"input-label "+(d?"required":"")},e.label),l&&t.createElement("div",{className:"start-label"},l),t.createElement("div",{className:`input-basic ${a||""}`},t.createElement("textarea",Object.assign({},f,{autoComplete:"off",ref:r,style:i,onChange:e=>{e.target.value?.length>u||m?.(e)}})),c&&u&&u>0&&t.createElement("div",{className:"end-max-length"},`${e.value&&e.value.length||0}/${u}`)),e.endLabel&&t.createElement("div",{className:"end-label"},e.endLabel)))})),p=a(l,u),m=a(d,u);i('.freemium-survey-components .checkbox-group {\n width: 100%;\n display: flex;\n grid-gap: 12px;\n gap: 12px;\n flex-direction: column;\n white-space: nowrap;\n flex-wrap: wrap;\n}\n.freemium-survey-components .icon-container {\n display: inline-block;\n flex: 0 0 12px;\n width: 12px;\n height: 12px;\n min-width: 12px;\n min-height: 12px;\n color: inherit;\n position: absolute;\n left: 1px;\n top: 2px;\n}\n.freemium-survey-components .tick-icon {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n height: 100%;\n width: 100%;\n color: inherit;\n fill: currentColor;\n}\n.freemium-survey-components input[type=checkbox] {\n position: absolute;\n clip: rect(0px 0px 0px 0px);\n width: 0px;\n height: 0px;\n}\n.freemium-survey-components input[type=checkbox]:focus ~ .checkbox {\n /* box-shadow: ${pseudo.focus} 0px 0px 0px 2px; */\n box-shadow: var(--default-brand-color) 0px 0px 0px 2px;\n box-shadow: var(--brand-color, var(--default-brand-color)) 0px 0px 0px 2px;\n border-color: transparent;\n}\n.freemium-survey-components .checkbox-label {\n display: flex;\n align-items: baseline;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n text-align: left;\n opacity: 1;\n line-height: 1.2;\n cursor: pointer;\n font-size: 1rem;\n padding: 16px 24px;\n min-width: 200px;\n border: 1px solid #ebeff3;\n box-shadow: 0px 2px 5px rgba(18, 52, 77, 0.06);\n border-radius: 4px;\n white-space: pre-wrap;\n}\n.freemium-survey-components .checkbox-label:hover .checkbox {\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n box-shadow: var(--default-background-color) 0px 0px 0px 5px;\n box-shadow: var(--background-color, var(--default-background-color)) 0px 0px 0px 5px;\n}\n.freemium-survey-components .checkbox-label.disabled {\n opacity: 0.5;\n cursor: "not-allowed";\n}\n.freemium-survey-components .checkbox {\n transition: background-color ease-in 0.2s;\n min-width: 14px;\n min-height: 14px;\n min-height: 14px;\n max-height: 14px;\n border-radius: 2px;\n position: relative;\n margin-right: 16px;\n background-color: #fff;\n border: 1px solid;\n text-align: left;\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components .checkbox:hover {\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n box-shadow: var(--default-background-color) 0px 0px 0px 5px;\n box-shadow: var(--background-color, var(--default-background-color)) 0px 0px 0px 5px;\n}\n.freemium-survey-components input[type=checkbox]:checked ~ .checkbox {\n background-color: var(--default-brand-color);\n background-color: var(--brand-color, var(--default-brand-color));\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components input[type=checkbox]:checked ~ .checkbox:hover {\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components input[type=checkbox]:disabled ~ .checkbox:hover {\n box-shadow: unset;\n border-color: unset;\n}');const f=()=>t.createElement("svg",{id:"tick",className:"tick-icon",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"title",viewBox:"0 0 10 10"},t.createElement("path",{d:"M3 5.87c-.18666814.00267463-.36667109-.06932655-.5-.2L.21 3.41c-.1786328-.17863279-.24839684-.43899577-.1830127-.6830127.06538414-.24401694.25598306-.43461586.5-.5C.77100423 2.16160316 1.0313672 2.23136721 1.21 2.41L3 4.18 6.8.33c.27679776-.27455556.72320224-.27455556 1 0 .13696438.13025306.21450026.31098915.21450026.5S7.93696438 1.19974694 7.8 1.33L3.45 5.67c-.12082534.11896945-.28072735.19003701-.45.2Z",fill:"#fff",fillRule:"evenodd"})),y=({values:e=[],othersValue:o="",options:r,name:i,autoFocusGroup:s,autoFocusDelay:a,onChangeHandler:c,saveOthersValue:u,othersOption:l,othersRequired:d})=>{const[m,f]=n.useState(!1),y=n.useRef(null);return n.useEffect((()=>{s&&setTimeout((()=>{y.current?.focus()}),600+a)}),[s]),t.createElement("div",{className:"checkbox-group"},t.createElement("button",{ref:y,className:"autofocus-button","aria-hidden":!0}),r?.map(((n,o)=>t.createElement(v,{key:n.id,checked:e?.includes(n.value),name:n.value,id:n.id,onChange:(t,o)=>{if(o)c([...e||[],n.value]);else{const t=e.indexOf(n.value);t>-1&&e.splice(t,1),c([...e])}}},n.value))),l&&t.createElement(v,{key:"others",checked:m,name:"others",id:"others",onChange:(n,t)=>{if(f(t),t)c([...e,"others"]);else{const n=e.findIndex((e=>"others"===e));e.splice(n,1),c(e)}}},"Others"),m&&t.createElement(t.Fragment,null,t.createElement(p,{placeholder:"Enter your comment",value:o[i],onChange:e=>{u(i,e.target.value)},autoFocusDelay:10,label:""})))},v=a((e=>{const o=n.useRef(null);return n.useEffect((()=>{e.autoFocus&&setTimeout((()=>{o.current?.focus()}),620)}),[]),t.createElement("label",{className:`checkbox-label ${e.disabled&&"disabled"}`},t.createElement("input",{ref:o,id:e.id,type:"checkbox",name:e.name,readOnly:e.readOnly,disabled:e.disabled,"aria-disabled":e.disabled,checked:e.checked,onChange:e.readOnly?()=>{}:n=>e.onChange(n,n.target.checked)}),t.createElement("div",{className:"checkbox"},e.checked&&t.createElement("div",{className:"icon-container"},t.createElement(f,null)," ")),t.createElement("div",null,e.children))}),{checked:!1});i('.freemium-survey-components .radio-group {\n display: flex;\n grid-gap: 12px;\n gap: 12px;\n white-space: nowrap;\n flex-direction: column;\n width: 100%;\n}\n.freemium-survey-components .radio {\n background-color: #fff;\n border: 1px solid;\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n transition: background-color ease-in 0.2s;\n min-width: 18px;\n max-width: 18px;\n min-height: 18px;\n max-height: 18px;\n border-radius: 50%;\n position: relative;\n margin-right: 16px;\n text-align: left;\n}\n.freemium-survey-components .radio:before {\n left: 3px;\n top: 3px;\n content: "";\n position: absolute;\n width: 10px;\n height: 10px;\n border-radius: 50%;\n transition: all ease-in 0.2s;\n background-color: #fff;\n}\n.freemium-survey-components .radio-label {\n display: flex;\n align-items: baseline;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n text-align: left;\n cursor: pointer;\n line-height: 1.2;\n font-size: 1rem;\n font-weight: 400;\n padding: 16px 24px;\n min-width: 200px;\n border: 1px solid #ebeff3;\n box-shadow: 0px 2px 5px rgba(18, 52, 77, 0.06);\n border-radius: 4px;\n white-space: pre-wrap;\n}\n.freemium-survey-components input[type=radio] {\n position: absolute;\n clip: rect(0, 0, 0, 0);\n width: 0px;\n height: 0px;\n}\n.freemium-survey-components input[type=radio]:focus ~ .radio {\n /* box-shadow: ${pseudo.focus} 0px 0px 0px 3px; */\n box-shadow: var(--default-brand-color) 0px 0px 0px 3px;\n box-shadow: var(--brand-color, var(--default-brand-color)) 0px 0px 0px 3px;\n border-color: transparent;\n}\n.freemium-survey-components input[type=radio]:checked ~ .radio:before {\n background-color: var(--default-brand-color);\n background-color: var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components .radio-label:hover .radio {\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n box-shadow: var(--default-background-color) 0px 0px 0px 5px;\n box-shadow: var(--background-color, var(--default-background-color)) 0px 0px 0px 5px;\n}');const x=({name:e,options:o,value:r,autoFocusGroup:i,autoFocusDelay:s,onChangeHandler:a,saveOthersValue:c,othersOption:u,othersRequired:l,othersValue:d})=>{const[m,f]=n.useState(d??""),[y,v]=n.useState(r),x=n.useRef(null);return n.useEffect((()=>{i&&setTimeout((()=>{x.current?.focus()}),600+s)}),[i]),n.useEffect((()=>{r||f("")}),[r]),n.useEffect((()=>{y&&o.find((e=>e.value===y))&&y!==r&&a(y)}),[y]),t.createElement("div",{className:"radio-group",role:"radiogroup"},t.createElement("button",{ref:x,className:"autofocus-button","aria-hidden":!0,tabIndex:-1}),o?.map(((n,o)=>t.createElement(g,{key:n.value,value:n.value,name:e,onChange:e=>{v(e.currentTarget.value)},checked:y===n.value},n.value))),u&&t.createElement(g,{key:"others",value:"others",name:e,onChange:e=>{v("others")},checked:"others"===y},"Others"),"others"===y&&t.createElement(t.Fragment,null,t.createElement(p,{value:m,onChange:e=>f(e.target.value),placeholder:"Enter your comment",label:"",autoFocusDelay:10}),m!==r&&t.createElement(w,{inline:!0,disabled:l&&0===m.length,onClick:()=>{a("others"),c(e,m)}},"Next")))},g=a((e=>{const o=n.useRef(null);return n.useEffect((()=>{e.autoFocus&&setTimeout((()=>{o.current?.focus()}),620)}),[]),t.createElement("label",{className:"radio-label"},t.createElement("input",{ref:o,type:"radio",name:e.name,value:e.value,checked:e.checked,onChange:e.onChange}),t.createElement("div",{className:"radio"}),t.createElement("div",null,e.children))}),{checked:!1,autoFocus:!1});i(".progressbar-container {\n width: 100%;\n height: 4px;\n position: fixed;\n top: 0;\n left: 0;\n z-index: 1;\n text-align: left;\n}\n\n.progressbar {\n transition: transform 0.25s linear;\n transform-origin: left;\n height: 100%;\n background-color: var(--default-brand-color);\n background-color: var(--brand-color, var(--default-brand-color));\n}");const h=e=>{const{totalSteps:n,completedSteps:o}=e;return t.createElement("div",{className:"progressbar-container"},t.createElement("div",{className:"progressbar",style:{width:(o>0?100/n:0)+"%",transform:`scaleX(${o})`}}))};i(".freemium-survey-components .action-button {\n width: auto;\n display: block;\n padding: 8px 16px;\n cursor: pointer;\n line-height: 1.5;\n text-align: center;\n font-weight: 500;\n letter-spacing: 0.3px;\n border-radius: 4px;\n white-space: nowrap;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n color: --default-button-text-color;\n color: var(--button-text-color, --default-button-text-color);\n background: var(--default-brand-color);\n background: var(--brand-color, var(--default-brand-color));\n border: 1px solid var(--default-brand-color);\n border: 1px solid var(--brand-color, var(--default-brand-color));\n border-radius: 4px;\n min-width: 200px;\n max-width: -webkit-fit-content;\n max-width: -moz-fit-content;\n max-width: fit-content;\n transform: translateY(0px);\n transition: transform ease 0.2s;\n}\n.freemium-survey-components .action-button:not([disabled]):hover {\n transform: translateY(-4px);\n}\n.freemium-survey-components .action-button[disabled] {\n cursor: not-allowed;\n opacity: 0.6;\n}\n.freemium-survey-components button:focus:not(:active) {\n /* box-shadow: 0 0 0 2px ${pseudo.focus}; */\n}\n\n@media (max-width: 550px) {\n .freemium-survey-components .action-button {\n min-width: 120px;\n }\n}\n.widget-survey-components .action-button {\n min-width: 120px;\n}\n\n.freemium-survey-components.mobile-preview .action-button {\n min-width: 120px;\n}");const b=()=>t.createElement(t.Fragment,null,"..."),w=e=>{const{inline:n=!1,children:o,disabled:r,className:i="",htmlType:s,type:a="primary",onClick:c,size:u,overrideStyleClassName:l="",loading:d=!1,...p}=e;return t.createElement("button",Object.assign({style:n?{display:"inline-block"}:{},disabled:r,className:`action-button ${i} ${l}`,type:s,onClick:c},p),d?t.createElement(b,null):o)},k=()=>t.createElement("svg",{style:{display:"block"},width:"9",height:"14",viewBox:"0 0 10 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M7.82585 6.15754C7.98999 6.32147 8.08232 6.54389 8.08252 6.77587L8.08252 7.2192C8.07983 7.45069 7.98788 7.6722 7.82585 7.83754L1.82919 13.8225C1.77496 13.8772 1.71044 13.9206 1.63936 13.9502C1.56827 13.9798 1.49203 13.9951 1.41502 13.9951C1.33801 13.9951 1.26177 13.9798 1.19068 13.9502C1.1196 13.9206 1.05508 13.8772 1.00085 13.8225L0.172521 12.9942C0.118197 12.941 0.0750381 12.8774 0.0455752 12.8073C0.0161124 12.7372 0.000937578 12.6619 0.000937585 12.5859C0.000937592 12.5098 0.0161125 12.4345 0.0455753 12.3644C0.0750381 12.2943 0.118197 12.2308 0.172521 12.1775L5.36419 6.99754L0.172522 1.81754C0.117847 1.76331 0.0744506 1.69879 0.0448352 1.62771C0.0152208 1.55662 -2.75162e-05 1.48038 -2.75094e-05 1.40337C-2.75027e-05 1.32636 0.0152208 1.25012 0.0448353 1.17904C0.0744507 1.10795 0.117847 1.04343 0.172522 0.989205L1.00086 0.172537C1.05508 0.117862 1.1196 0.0744661 1.19069 0.0448507C1.26177 0.0152353 1.33801 -1.20337e-05 1.41502 -1.2027e-05C1.49203 -1.20203e-05 1.56827 0.0152353 1.63936 0.0448507C1.71044 0.0744661 1.77496 0.117862 1.82919 0.172537L7.82585 6.15754Z",fill:"#6B6B6B"})),q=()=>t.createElement("svg",{style:{display:"block"},width:"9",height:"14",viewBox:"0 0 10 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M0.256667 7.83755C0.0925257 7.67361 0.000204227 7.4512 0 7.21921V6.77588C0.00268801 6.5444 0.0946357 6.32289 0.256667 6.15755L6.25333 0.172549C6.30756 0.117874 6.37208 0.0744776 6.44316 0.0448625C6.51425 0.0152474 6.59049 0 6.6675 0C6.74451 0 6.82075 0.0152474 6.89184 0.0448625C6.96292 0.0744776 7.02744 0.117874 7.08167 0.172549L7.91 1.00088C7.96432 1.05411 8.00748 1.11764 8.03694 1.18776C8.06641 1.25787 8.08158 1.33316 8.08158 1.40922C8.08158 1.48527 8.06641 1.56056 8.03694 1.63067C8.00748 1.70079 7.96432 1.76432 7.91 1.81755L2.71833 6.99755L7.91 12.1775C7.96467 12.2318 8.00807 12.2963 8.03769 12.3674C8.0673 12.4385 8.08255 12.5147 8.08255 12.5917C8.08255 12.6687 8.0673 12.745 8.03769 12.8161C8.00807 12.8871 7.96467 12.9517 7.91 13.0059L7.08167 13.8225C7.02744 13.8772 6.96292 13.9206 6.89184 13.9502C6.82075 13.9799 6.74451 13.9951 6.6675 13.9951C6.59049 13.9951 6.51425 13.9799 6.44316 13.9502C6.37208 13.9206 6.30756 13.8772 6.25333 13.8225L0.256667 7.83755Z",fill:"#6B6B6B"})),E=({question:e,formValues:n,othersMeta:o,onChangeHandler:r,saveOthersValue:i,autoFocus:a,autoFocusDelay:c})=>{switch(e.type_info.question_type){case"RANGE":return t.createElement(s,{type_info:e.type_info,onChangeHandler:r,npsValue:n[e.name]});case"CHECKBOX":case"MULTI_SELECT":return t.createElement(y,{name:e.name,autoFocusGroup:a,values:n[e.name],othersValue:o[e.name],options:e.type_info.choices,onChangeHandler:r,saveOthersValue:i,othersOption:e.type_info.meta?.othersOption,othersRequired:e.type_info.meta?.othersRequired,autoFocusDelay:c});case"RADIO":case"DROPDOWN":return t.createElement(x,{autoFocusGroup:a,autoFocusDelay:c,name:e.name,onChangeHandler:r,saveOthersValue:i,options:e.type_info.choices,value:n[e.name],othersValue:o[e.name],othersOption:e.type_info.meta?.othersOption,othersRequired:e.type_info.meta?.othersRequired});case"INPUT":case"TEXT":return e.type_info?.meta?.readOnly?t.createElement("div",{className:"message-container"},e.type_info?.meta?.value):t.createElement("div",{className:"responsive-text-field"},t.createElement(p,{autoFocusInput:a,autoFocusDelay:c,label:"",isRequired:e.is_required,value:n[e.name]||"",placeholder:e.type_info?.meta?.placeholder??"",onChange:e=>r(e.target.value)}),t.createElement(m,{autoFocusInput:a,autoFocusDelay:c,label:"",isRequired:e.is_required,placeholder:e.type_info?.meta?.placeholder??"",value:n[e.name]||"",onChange:e=>r(e.target.value)}));case"PARAGRAPH":return t.createElement(m,{autoFocusInput:a,autoFocusDelay:c,label:"",isRequired:e.is_required,placeholder:e.type_info?.meta?.placeholder??"",value:n[e.name]||"",onChange:e=>r(e.target.value)});default:return console.error(`Question type ${e.type_info.question_type} not found`),null}},_=(e,n,t)=>{if(e){let o={"{{nps.score}}":t};n&&(o={...o,...n});const r=new RegExp(Object.keys(o).join("|"),"gi");e=e.replace(r,(function(e){return o[e.toLowerCase()]}))}return e};i(":root {\n --default-brand-color: #264966;\n --default-question-text-color: #000;\n --default-question-background-color: #fff;\n --default-background-color: #f8f8f8;\n --default-button-text-color: #fff;\n --default-secondary-button-text-color: #000;\n --default-input-placeholder-color: #92a2b1;\n --compact-widget-max-height: 560px;\n --default-widget-max-height: 400px;\n --cozy-widget-max-height: 380px;\n}\n\n.freemium-survey-step-navigation {\n padding: 0 2px;\n box-shadow: 0px 0px 6px #eee;\n white-space: nowrap;\n}\n.freemium-survey-step-navigation .navigation-button {\n width: 38px;\n text-align: -webkit-center;\n height: 38px;\n background-color: #fff;\n border: none;\n cursor: pointer;\n border-radius: 0 3px 3px 0;\n}\n.freemium-survey-step-navigation .navigation-button:first-of-type {\n border-right: 1px solid #d9d9d9;\n border-radius: 3px 0 0 3px;\n}\n.freemium-survey-step-navigation .navigation-button:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n.freemium-survey-step-navigation .navigation-button:focus {\n position: relative;\n z-index: 1;\n}\n\n.freemium-survey-components .question-container {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n text-align: center;\n max-width: 700px;\n margin: 0 auto;\n background: var(--default-question-background-color);\n background: var(--question-background-color, var(--default-question-background-color));\n border-radius: 4px;\n transition: transform 500ms ease 0ms, opacity 200ms ease 0ms;\n box-shadow: 0px 12px 15px rgba(18, 52, 77, 0.03);\n margin-bottom: 28px;\n padding: 28px;\n grid-gap: 28px;\n gap: 28px;\n position: relative;\n height: -webkit-fit-content;\n height: -moz-fit-content;\n height: fit-content;\n transition: opacity 50ms ease-out;\n overflow: auto;\n}\n.freemium-survey-components .hide-question-container {\n opacity: 0;\n}\n.freemium-survey-components .question-text {\n font-size: 1rem;\n font-weight: 600;\n line-height: 1.8;\n width: 100%;\n text-align: left;\n color: var(--default-question-text-color);\n color: var(--question-text-color, var(--default-question-text-color));\n}\n.freemium-survey-components .autofocus-button {\n border: none;\n width: 0;\n height: 0;\n opacity: 0;\n margin-top: -12px;\n margin-left: -12px;\n position: absolute;\n}\n@-webkit-keyframes opac {\n 0%, 50% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n@keyframes opac {\n 0%, 50% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n@-webkit-keyframes fade-out {\n 0% {\n opacity: 1;\n transform: translateY(0);\n }\n 100% {\n opacity: 0;\n transform: translateY(-100px);\n }\n}\n@keyframes fade-out {\n 0% {\n opacity: 1;\n transform: translateY(0);\n }\n 100% {\n opacity: 0;\n transform: translateY(-100px);\n }\n}\n@-webkit-keyframes fade-in {\n 0% {\n opacity: 0;\n transform: translateY(100px);\n }\n 100% {\n opacity: 1;\n transform: translateY(0px);\n }\n}\n@keyframes fade-in {\n 0% {\n opacity: 0;\n transform: translateY(100px);\n }\n 100% {\n opacity: 1;\n transform: translateY(0px);\n }\n}\n.freemium-survey-components .fade-in {\n opacity: 0;\n -webkit-animation: fade-in 1s ease forwards 1s;\n animation: fade-in 1s ease forwards 1s;\n}\n.freemium-survey-components .fade-out {\n -webkit-animation: fade-out 1s ease forwards;\n animation: fade-out 1s ease forwards;\n}\n.freemium-survey-components .fade-enter .question-container {\n opacity: 0;\n transform: translateY(100px);\n}\n.freemium-survey-components .fade-enter-active .question-container {\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components .fade-exit .question-container {\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components .fade-exit-active .question-container {\n opacity: 0;\n transform: translateY(-100px);\n}\n.freemium-survey-components .fade-enter-active .question-container,\n.freemium-survey-components .fade-exit-active .question-container {\n transition: opacity 500ms, transform 500ms;\n}\n.freemium-survey-components .fade-reverse-enter .question-container {\n opacity: 0;\n transform: translateY(-100px);\n}\n.freemium-survey-components .fade-reverse-enter-active .question-container {\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components .fade-reverse-exit .question-container {\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components .fade-reverse-exit-active .question-container {\n opacity: 0;\n transform: translateY(100px);\n}\n.freemium-survey-components .fade-reverse-enter-active .question-container,\n.freemium-survey-components .fade-reverse-exit-active .question-container {\n transition: opacity 500ms, transform 500ms;\n}\n.freemium-survey-components .question-footer {\n display: flex;\n justify-content: flex-end;\n grid-gap: 40px;\n gap: 40px;\n width: 100%;\n align-items: center;\n}\n.freemium-survey-components .question-footer:empty {\n display: none;\n}\n.freemium-survey-components .action-buttons {\n display: flex;\n grid-gap: 20px;\n gap: 20px;\n flex-direction: row-reverse;\n}\n.freemium-survey-components .action-buttons:empty {\n display: none;\n}\n.freemium-survey-components .skip-button {\n font-weight: 400;\n cursor: pointer;\n background: transparent;\n border: none;\n min-width: 40px;\n padding: 8px 16px;\n border-radius: 4px;\n color: var(--default-secondary-button-text-color);\n color: var(--secondary-button-text-color, var(--default-secondary-button-text-color));\n letter-spacing: 0.05rem;\n line-height: 1.5;\n border: 1px solid transparent;\n}\n.freemium-survey-components .skip-button:hover {\n background-color: #f3f3f3;\n}\n.freemium-survey-components .next-button {\n color: var(--default-button-text-color);\n color: var(--button-text-color, var(--default-button-text-color));\n}\n.freemium-survey-components .submit {\n max-width: 700px;\n margin: 0 auto;\n text-align: left;\n background: transparent;\n box-shadow: none;\n color: var(--default-button-text-color);\n color: var(--button-text-color, var(--default-button-text-color));\n}\n.freemium-survey-components .thankyou {\n display: flex;\n align-items: center;\n justify-content: center;\n grid-gap: 20px;\n gap: 20px;\n min-height: 180px;\n}\n.freemium-survey-components .thankyou .heading {\n font-weight: 600;\n font-size: 28px;\n}\n.freemium-survey-components .thankyou .text {\n white-space: pre-wrap;\n font-weight: 500;\n font-size: 0.875rem;\n line-height: 1.6;\n color: #12344d;\n width: 75%;\n}\n.freemium-survey-components .thankyou .redirection-text {\n color: #929292;\n margin-bottom: 12px;\n font-weight: 300;\n}\n.freemium-survey-components .thankyou .link {\n width: 100%;\n display: inline-block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: #666;\n font-weight: 500;\n text-decoration: underline;\n}\n.freemium-survey-components .responsive-text-field {\n width: 100%;\n}\n.freemium-survey-components .responsive-text-field .textarea-container {\n display: none;\n}\n.freemium-survey-components .message-container:empty {\n display: none;\n}\n\n@media (max-width: 550px) {\n .freemium-survey-component .responsive-text-field .input-container,\n.card-survey-style .responsive-text-field .input-container {\n display: none;\n }\n .freemium-survey-component .responsive-text-field .textarea-container,\n.card-survey-style .responsive-text-field .textarea-container {\n display: flex;\n }\n}\ndiv.widget-survey-components.compact-style .freemium-survey-step-navigation {\n padding: 0 2px;\n margin-left: 4px;\n box-shadow: 0px 0px 6px #eee;\n margin-top: 4px;\n}\ndiv.widget-survey-components.compact-style .nps-container .footer {\n padding-top: 12px;\n}\ndiv.widget-survey-components.compact-style .nps-container .choices {\n grid-gap: 12px;\n gap: 12px;\n}\n\ndiv.widget-survey-components,\ndiv.card-survey-style {\n display: flex;\n flex-direction: column;\n grid-gap: 28px;\n gap: 28px;\n flex-grow: 1;\n font-size: 0.875rem;\n overflow: hidden;\n}\ndiv.widget-survey-components .questions,\ndiv.card-survey-style .questions {\n min-width: 100%;\n max-width: 100%;\n display: flex;\n position: relative;\n max-height: 560px;\n max-height: var(--compact-widget-max-height);\n}\ndiv.widget-survey-components .question-text,\ndiv.card-survey-style .question-text {\n width: 100%;\n text-align: left;\n}\ndiv.widget-survey-components .focus-lock,\ndiv.card-survey-style .focus-lock {\n width: 100%;\n}\ndiv.widget-survey-components .question-container,\ndiv.card-survey-style .question-container {\n height: -webkit-fit-content;\n height: -moz-fit-content;\n height: fit-content;\n min-width: 100%;\n max-width: 100%;\n margin-bottom: 0;\n padding: 16px 28px;\n grid-gap: 16px;\n gap: 16px;\n flex-grow: 1;\n}\ndiv.widget-survey-components .question-footer,\ndiv.card-survey-style .question-footer {\n margin: 0px auto;\n justify-content: space-between;\n bottom: 0;\n padding-bottom: 20px;\n}\ndiv.widget-survey-components .submit,\ndiv.card-survey-style .submit {\n padding-bottom: 0;\n margin: unset;\n}\ndiv.widget-survey-components .nps-container .footer,\ndiv.card-survey-style .nps-container .footer {\n padding-top: 12px;\n}\ndiv.widget-survey-components .nps-container .widget .choices,\ndiv.card-survey-style .nps-container .widget .choices {\n grid-gap: 8px;\n gap: 8px;\n}\ndiv.widget-survey-components .radio-group,\ndiv.card-survey-style .radio-group {\n width: 100%;\n}\ndiv.widget-survey-components .checkbox-group,\ndiv.card-survey-style .checkbox-group {\n width: 100%;\n flex-wrap: nowrap;\n}\n\ndiv.widget-survey-components .question-container {\n box-shadow: none;\n border-radius: 0;\n}\ndiv.widget-survey-components .question-text {\n font-size: 0.875rem;\n}\ndiv.widget-survey-components .progressbar-container {\n position: absolute;\n}\ndiv.widget-survey-components .progressbar-container .progressbar {\n border-radius: 3px 0 0 0;\n}\ndiv.widget-survey-components .textarea-container .end-max-length {\n padding: 4px;\n}\ndiv.widget-survey-components .responsive-text-field .input-container {\n display: none;\n}\ndiv.widget-survey-components .responsive-text-field .textarea-container {\n display: flex;\n}\ndiv.widget-survey-components div.thankyou {\n min-height: unset;\n}\ndiv.widget-survey-components div.thankyou .text {\n width: 85%;\n}\ndiv.widget-survey-components div.thankyou svg {\n width: 140px;\n height: 120px;\n}\n\ndiv.widget-survey-components.default-style .freemium-survey-step-navigation {\n margin: 0;\n}\ndiv.widget-survey-components.default-style .questions {\n max-height: 400px;\n max-height: var(--default-widget-max-height);\n}\ndiv.widget-survey-components.default-style .question-container {\n padding: 12px 28px;\n}\ndiv.widget-survey-components.default-style .question-footer {\n justify-content: space-between;\n}\ndiv.widget-survey-components.default-style .nps-container .footer {\n padding-top: 12px;\n}\ndiv.widget-survey-components.default-style .nps-container .choices {\n flex-wrap: unset;\n grid-gap: 12px;\n gap: 12px;\n}\ndiv.widget-survey-components.default-style .action-button {\n line-height: 1.2;\n}\ndiv.widget-survey-components.default-style .radio-group {\n flex-direction: row;\n flex-wrap: wrap;\n}\ndiv.widget-survey-components.default-style .radio-group .radio-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n}\ndiv.widget-survey-components.default-style .checkbox-group {\n flex-direction: row;\n flex-wrap: wrap;\n}\ndiv.widget-survey-components.default-style .checkbox-group .checkbox-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n}\ndiv.widget-survey-components.default-style textarea {\n min-height: 84px;\n}\ndiv.widget-survey-components.default-style .end-max-length {\n font-size: 0.8rem;\n font-weight: 300;\n padding: 4px;\n}\n\n.widget-survey-components.cozy-style .freemium-survey-step-navigation {\n margin: 0;\n}\n.widget-survey-components.cozy-style .questions {\n max-height: 380px;\n max-height: var(--cozy-widget-max-height);\n}\n.widget-survey-components.cozy-style .question-text {\n font-size: 1rem;\n}\n.widget-survey-components.cozy-style .question-text.nps {\n text-align: center;\n width: 60%;\n min-width: 600px;\n margin: auto;\n}\n.widget-survey-components.cozy-style .question-container {\n padding: 12px 28px;\n}\n.widget-survey-components.cozy-style .question-footer {\n justify-content: space-between;\n}\n.widget-survey-components.cozy-style .nps-container {\n grid-gap: 44px;\n gap: 44px;\n}\n.widget-survey-components.cozy-style .nps-container .widget {\n display: flex;\n justify-content: center;\n}\n.widget-survey-components.cozy-style .nps-container .button-container {\n width: 60%;\n min-width: 600px;\n margin: 0 auto;\n}\n.widget-survey-components.cozy-style .nps-container .button-container .choices {\n justify-content: space-around;\n}\n.widget-survey-components.cozy-style .nps-container .footer {\n padding-top: 8px;\n}\n.widget-survey-components.cozy-style .action-button {\n line-height: 1.2;\n}\n.widget-survey-components.cozy-style .radio-group {\n flex-direction: row;\n flex-wrap: wrap;\n}\n.widget-survey-components.cozy-style .radio-group .radio-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n}\n.widget-survey-components.cozy-style .checkbox-group {\n flex-direction: row;\n flex-wrap: wrap;\n}\n.widget-survey-components.cozy-style .checkbox-group .checkbox-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n}\n.widget-survey-components.cozy-style textarea {\n min-height: 60px;\n}\n.widget-survey-components.cozy-style .end-max-length {\n font-size: 0.8rem;\n font-weight: 300;\n padding: 4px;\n}\n\n.freemium-survey-components.mobile-preview .thankyou .text {\n width: unset;\n}");const C=({thankYouQuestion:e,preview:o,placeholders:r,npsValue:i})=>(n.useEffect((()=>{o||e.type_info.meta?.redirectUrl&&setTimeout((()=>{window.location.href=e.type_info.meta?.redirectUrl}),e.type_info.meta?.redirectDelay??1e4)}),[]),t.createElement("div",{className:"question-container thankyou"},t.createElement("div",{className:"heading"},"Thank you!"),t.createElement("div",{className:"text",dangerouslySetInnerHTML:{__html:_(e.text,r,i)}}),e.type_info.meta?.redirectUrl&&t.createElement("div",{style:{width:"100%"}},t.createElement("div",{className:"redirection-text"},"You will be redirected to the below URL automatically in"," ",e.type_info.meta?.redirectDelay," seconds.",t.createElement("br",null)),t.createElement("a",{className:"link",href:e.type_info.meta?.redirectUrl},e?.type_info.meta?.redirectUrl)))),z=({currentBlockIndex:e,currentBlockIndexOfBlocksWithQns:n,blocksWithQns:o,blocks:r,setHorizontalScrollUnits:i,preventQuestionAnimation:s,tempCurrentBlockIndexOfBlocksWithQns:a,setReverse:c,reverse:u})=>t.createElement("div",{className:"freemium-survey-step-navigation","data-navigation-element":"1"},t.createElement("button",{disabled:0==n.current,className:"navigation-button",onClick:()=>{u?n.current=Math.max(n.current-1,0):a.current=Math.max(n.current-1,0),e.current=r.findIndex((e=>e.name===o[n.current].name)),s.current=!1,c(!0),i(n.current)}},t.createElement(q,null)),t.createElement("button",{className:"navigation-button",disabled:n.current>=o.length-1,onClick:()=>{s.current=!1,e.current=r.findIndex((e=>e.name===o[n.current].name)),u?a.current=Math.min(n.current+1,o.length-1):n.current=Math.min(n.current+1,o.length-1),c(!1),i(n.current)}},t.createElement(k,null))),N=({widget:e,widgetStyle:n,surveyStyle:o,formValues:r,blocksWithQns:i,blocks:s,thankYouQuestion:a,currentBlockIndexOfBlocksWithQns:u,currentBlockIndexOfBlocks:l,currentEditingBlock:d,isSubmitting:p,isValuesCommitted:m,isCurrentBlockFinal:f,setHorizontalScrollUnits:y,handleFormValues:v,skipBlock:x,setIsSubmitting:g,onSubmit:h,setIsSurveyCompleted:b,preventQuestionAnimation:k,preview:q,closePreview:E,setReverse:_,tempCurrentBlockIndexOfBlocksWithQns:C,question:N,reverse:S,othersMeta:I,...R})=>{const B=R.blockIndex??u.current,O=()=>!c.includes(N.type_info.question_type)&&!f(),T=()=>"RANGE"!==N.type_info.question_type&&!N.required&&!f(),F=()=>"DROPDOWN"===N.type_info.question_type&&!N.required&&null!=r[N.name],Q=()=>f()&&(e||"standard"!==o),$="MULTI_SELECT"===d.current.question.type_info.question_type&&r[d.current.question.name]?.includes("others")&&(!I[d.current.question.name]||""===I[d.current.question.name]);return t.createElement("div",{className:"question-footer"},!(!e&&"standard"===o||0===B&&!r[N.name]||"compact"===n)&&t.createElement(z,{currentBlockIndex:l,currentBlockIndexOfBlocksWithQns:u,blocksWithQns:i,blocks:s,setHorizontalScrollUnits:y,preventQuestionAnimation:k,setReverse:_,tempCurrentBlockIndexOfBlocksWithQns:C,reverse:S}),(O()||F()||T()||Q())&&t.createElement("div",{className:"action-buttons"},O()&&t.createElement(w,{onClick:()=>{_(!1),v(i[B],null,!0)},disabled:d.current.question.required&&(!r[d.current.question.name]||Array.isArray(r[d.current.question.name])&&0===r[d.current.question.name].length)||d.current.question.type_info.meta?.othersRequired&&$,className:"next-button"},"Next"),T()&&t.createElement("button",{className:"skip-button",onClick:()=>{_(!1),x(N)}},"Skip"),F()&&t.createElement("button",{className:"skip-button",onClick:()=>{d.current=i[B],l.current=s.findIndex((e=>e.name===i[B].name)),x(N)}},"Clear selection"),Q()&&t.createElement("div",{className:"submit"},t.createElement(w,{disabled:(d.current.question.required||d.current.question.type_info.pivot_question)&&(null==r[d.current.question.name]||0===r[d.current.question.name]?.length)||d.current.question.type_info.meta?.othersRequired&&$||p,onClick:()=>{g(!0),h({...r,others_meta:I},(()=>{a?.type_info.meta?.skipThankYouPage?q?setTimeout((()=>{E?.()}),300):window.location.href=a?.type_info.meta?.redirectUrl:b(!0)}))}},p?"Submitting":"Submit Survey"))))},S=({survey:e,surveyStyle:r="standard",placeholders:i,onSubmit:s,widget:a,npsValue:u,widgetStyle:l,widgetNavigatorQuerySelector:d,preview:p,mobilePreview:m,closePreview:f})=>{const y=e.question_details?.questions||[],v=e.meta?.blocks||[],[x,g]=n.useState(null),[b,w]=n.useState({}),[k,q]=n.useState(!1),[z,S]=n.useState([]),[I,R]=n.useState(0),[B,O]=n.useState(!1),[T,F]=n.useState(null),[Q,$]=n.useState({}),L=n.useRef(null),V=n.useRef(null),Y=n.useRef(-1),A=n.useRef(null),D=n.useRef(0),j=n.useRef(0),U=n.useRef(!1),H=n.useRef([]),M=t.useRef(!!u&&"card"===r),P=n.useRef(null),W=n.useRef(0),[G,X]=n.useState(!1);n.useEffect((()=>{v&&(P.current=v.find((e=>"TY"===e.name)),g(v.filter((e=>"TY"!==e.name))))}),[v]),n.useEffect((()=>{j.current=W.current,R(I+1)}),[G]),n.useEffect((()=>{if(x)if(V.current=y.find((e=>e.type_info?.pivot_question))??y.find((e=>"RANGE"===e.type_info?.question_type))??y[0],null!=u){Y.current=u;const e=y.find((e=>e.name===x[0].question_names[0]));L.current={...x[0],question:e},H.current=[...H.current,{...x[0],question:e}],S(H.current),w({Q_1:u})}else if(!L.current&&x.length>0)return L.current=x[0],void K(x[0])}),[x,u]),t.useEffect((()=>{z.length&&(H.current=z,j.current=z.length-1),R(z.length-1)}),[z]),n.useEffect((()=>{Object.keys(b).length>0&&L.current.question&&(c.includes(L.current.question.type_info.question_type)||U.current)&&!Z()&&J()}),[b]),n.useEffect((()=>{if(null!=b?.[V.current?.name])if(P.current?.is_based_on_score){const e=V.current?.type_info?.choices[b?.[V.current?.name]]?.dependent_question_names,n=P.current?.question_names.find((n=>e?.includes(n))),t=y.find((e=>e.name===n));F(t)}else{const e=y.find((e=>e.name==P.current?.question_names[0]));F(e)}}),[b?.[V.current?.name]]);const Z=()=>(D.current===x.length-1||"end"===L.current.branchOption)&&j.current===z.length-1,K=e=>{let n={};if(e.is_based_on_score){const t=V.current?.type_info?.choices[b?.[V.current?.name]]?.dependent_question_names,o=e.question_names.find((e=>t?.includes(e)));n=y.find((e=>e.name===o))}else n=y.find((n=>n.name===e.question_names[0]));L.current.question=n;H.current.find((e=>e.question.name===n.name))?(R(I+1),j.current+=1):S([...H.current,{...e,question:n}])},J=()=>{if(Z())q(!0);else{if(L.current.nextBlock)D.current=x.findIndex((e=>e.name===L.current.nextBlock));else if(L.current.question.type_info?.meta?.branches){const e=L.current.question.type_info?.meta?.branches,n=b[L.current.question.name];let t;if(t="RANGE"===L.current.question.type_info.question_type?e.find((e=>n>=e.min&&n<=e.max)):e.find((e=>n===e.value)),t?.nextBlock){if("TY"===t.nextBlock)return void q(!0);D.current=x.findIndex((e=>e.name===t.nextBlock))}else D.current+=1}else D.current+=1;L.current=x[D.current],K(x[D.current])}},ee=(e,n,t)=>{if(M.current=!1,t){if(U.current=!0,null!=b[e.question.name]&&e.name!==z[z.length-1].name){const[t,o]=(e=>{const n=z.findIndex((n=>n.name===e.name)),t=z.slice(0,n+1),o=t.reduce(((e,n)=>(e[n.question.name]=b[n.question.name],e)),{});return D.current=x.findIndex((n=>n.name===e.name)),[t,o]})(e);w({...o,...null!=n&&{[e.question.name]:n}}),H.current=t}else w({...b,...null!=n&&{[e.question.name]:n}});V?.current?.name==e?.question?.name&&(Y.current=n)}else w({...b,...null!=n&&{[e.question.name]:n}})};if(!L.current||!L.current.question)return null;const ne=z[j.current];return t.createElement("div",{className:`freemium-survey-components ${a?"widget-survey-components":""} ${l}-style ${m?"mobile-preview":""} ${r}-survey-style`,style:{height:"calc(100vh - 40px)",display:"flex",justifyContent:"center",alignItems:"center"},id:"freemium-survey"},t.createElement(h,{totalSteps:x.length,completedSteps:D.current+(k?1:0)}),t.createElement(o.SwitchTransition,{mode:"out-in"},t.createElement(o.CSSTransition,{key:j.current+String(k),addEndListener:(e,n)=>{e.addEventListener("transitionend",n,!1)},classNames:G?"fade-reverse":"fade"},t.createElement("div",{className:"questions"},k?t.createElement(C,{thankYouQuestion:T,preview:p,placeholders:i,npsValue:Y.current}):t.createElement("div",{ref:A,id:`${ne.question.name}`,className:`question-container ${a||"card"===r}`},t.createElement("div",{className:"question-text",dangerouslySetInnerHTML:{__html:_(ne.question.text,i,Y.current)},title:`question-${j.current}`,role:"heading","aria-level":1}),t.createElement("div",{onTransitionEndCapture:e=>e.stopPropagation(),style:{width:"100%"}},t.createElement(E,{question:ne.question,formValues:b,othersMeta:Q,autoFocus:!0,autoFocusDelay:"standard"===r?350:0,saveOthersValue:(e,n)=>{$({...Q,[e]:n})},onChangeHandler:e=>{U.current=!1,D.current=x.findIndex((e=>e.name===ne.name)),L.current=ne,X(!1),ee(ne,e,c.includes(ne.question.type_info.question_type)&&!Z())}})),t.createElement(N,{question:ne.question,widget:a,widgetStyle:l,surveyStyle:r,formValues:b,othersMeta:Q,blocksWithQns:z,blocks:x,thankYouQuestion:T,currentBlockIndexOfBlocksWithQns:j,reverse:G,setReverse:X,currentBlockIndexOfBlocks:D,currentEditingBlock:L,isSubmitting:B,isValuesCommitted:U,isCurrentBlockFinal:Z,setHorizontalScrollUnits:R,handleFormValues:ee,skipBlock:e=>{U.current=!0,delete b[e.name],w({...b})},setIsSubmitting:O,onSubmit:s,setIsSurveyCompleted:q,preventQuestionAnimation:M,preview:p,closePreview:f,tempCurrentBlockIndexOfBlocksWithQns:W}))))))};i(":root {\n --default-brand-color: #264966;\n --default-question-text-color: #000;\n --default-question-background-color: #fff;\n --default-background-color: #f8f8f8;\n --default-button-text-color: #fff;\n --default-secondary-button-text-color: #000;\n --default-input-placeholder-color: #92a2b1;\n --compact-widget-max-height: 560px;\n --default-widget-max-height: 400px;\n --cozy-widget-max-height: 380px;\n}\n\n.freemium-survey-step-navigation {\n padding: 0 2px;\n box-shadow: 0px 0px 6px #eee;\n white-space: nowrap;\n}\n.freemium-survey-step-navigation .navigation-button {\n width: 38px;\n text-align: -webkit-center;\n height: 38px;\n background-color: #fff;\n border: none;\n cursor: pointer;\n border-radius: 0 3px 3px 0;\n}\n.freemium-survey-step-navigation .navigation-button:first-of-type {\n border-right: 1px solid #d9d9d9;\n border-radius: 3px 0 0 3px;\n}\n.freemium-survey-step-navigation .navigation-button:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n.freemium-survey-step-navigation .navigation-button:focus {\n position: relative;\n z-index: 1;\n}\n\n.freemium-survey-components .question-container {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n text-align: center;\n max-width: 700px;\n margin: 0 auto;\n background: var(--default-question-background-color);\n background: var(--question-background-color, var(--default-question-background-color));\n border-radius: 4px;\n transition: transform 500ms ease 0ms, opacity 800ms ease 0ms;\n box-shadow: 0px 12px 15px rgba(18, 52, 77, 0.03);\n margin-bottom: 28px;\n padding: 28px;\n grid-gap: 28px;\n gap: 28px;\n position: relative;\n height: -webkit-fit-content;\n height: -moz-fit-content;\n height: fit-content;\n overflow: auto;\n opacity: 1;\n}\n.freemium-survey-components .hide-question-container {\n pointer-events: none;\n opacity: 0;\n}\n.freemium-survey-components .question-text {\n font-size: 1rem;\n font-weight: 600;\n line-height: 1.8;\n width: 100%;\n text-align: left;\n color: var(--default-question-text-color);\n color: var(--question-text-color, var(--default-question-text-color));\n}\n.freemium-survey-components .autofocus-button {\n border: none;\n width: 0;\n height: 0;\n opacity: 0;\n margin-top: -12px;\n margin-left: -12px;\n position: absolute;\n}\n@-webkit-keyframes opac {\n 0%, 50% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n@keyframes opac {\n 0%, 50% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n.freemium-survey-components .question-footer {\n display: flex;\n justify-content: flex-end;\n grid-gap: 40px;\n gap: 40px;\n width: 100%;\n align-items: center;\n}\n.freemium-survey-components .question-footer:empty {\n display: none;\n}\n.freemium-survey-components .action-buttons {\n display: flex;\n grid-gap: 20px;\n gap: 20px;\n flex-direction: row-reverse;\n}\n.freemium-survey-components .action-buttons:empty {\n display: none;\n}\n.freemium-survey-components .skip-button {\n font-weight: 400;\n cursor: pointer;\n background: transparent;\n border: none;\n min-width: 40px;\n padding: 8px 16px;\n border-radius: 4px;\n color: var(--default-secondary-button-text-color);\n color: var(--secondary-button-text-color, var(--default-secondary-button-text-color));\n letter-spacing: 0.05rem;\n line-height: 1.5;\n border: 1px solid transparent;\n}\n.freemium-survey-components .skip-button:hover {\n background-color: #f3f3f3;\n}\n.freemium-survey-components .next-button {\n color: var(--default-button-text-color);\n color: var(--button-text-color, var(--default-button-text-color));\n}\n.freemium-survey-components .submit {\n max-width: 700px;\n margin: 0 auto;\n text-align: left;\n background: transparent;\n box-shadow: none;\n color: var(--default-button-text-color);\n color: var(--button-text-color, var(--default-button-text-color));\n}\n.freemium-survey-components .thankyou {\n display: flex;\n align-items: center;\n justify-content: center;\n grid-gap: 20px;\n gap: 20px;\n min-height: 180px;\n}\n.freemium-survey-components .thankyou .heading {\n font-weight: 600;\n font-size: 28px;\n}\n.freemium-survey-components .thankyou .text {\n white-space: pre-wrap;\n font-weight: 500;\n font-size: 0.875rem;\n line-height: 1.6;\n color: #12344d;\n width: 75%;\n}\n.freemium-survey-components .thankyou .redirection-text {\n color: #929292;\n margin-bottom: 12px;\n font-weight: 300;\n}\n.freemium-survey-components .thankyou .link {\n width: 100%;\n display: inline-block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: #666;\n font-weight: 500;\n text-decoration: underline;\n}\n.freemium-survey-components .responsive-text-field {\n width: 100%;\n}\n.freemium-survey-components .responsive-text-field .textarea-container {\n display: none;\n}\n.freemium-survey-components .message-container:empty {\n display: none;\n}\n\n@media (max-width: 550px) {\n .freemium-survey-component .responsive-text-field .input-container,\n.card-survey-style .responsive-text-field .input-container {\n display: none;\n }\n .freemium-survey-component .responsive-text-field .textarea-container,\n.card-survey-style .responsive-text-field .textarea-container {\n display: flex;\n }\n}\ndiv.widget-survey-components.compact-style .freemium-survey-step-navigation {\n padding: 0 2px;\n margin-left: 4px;\n box-shadow: 0px 0px 6px #eee;\n margin-top: 4px;\n}\ndiv.widget-survey-components.compact-style .nps-container .footer {\n padding-top: 12px;\n}\ndiv.widget-survey-components.compact-style .nps-container .choices {\n grid-gap: 12px;\n gap: 12px;\n}\n\ndiv.widget-survey-components,\ndiv.card-survey-style {\n display: flex;\n flex-direction: column;\n grid-gap: 28px;\n gap: 28px;\n flex-grow: 1;\n font-size: 0.875rem;\n overflow: hidden;\n}\ndiv.widget-survey-components .questions,\ndiv.card-survey-style .questions {\n min-width: 100%;\n max-width: 100%;\n display: flex;\n height: 100%;\n position: relative;\n max-height: 560px;\n max-height: var(--compact-widget-max-height);\n}\ndiv.widget-survey-components .question-text,\ndiv.card-survey-style .question-text {\n width: 100%;\n text-align: left;\n}\ndiv.widget-survey-components .focus-lock,\ndiv.card-survey-style .focus-lock {\n width: 100%;\n}\ndiv.widget-survey-components .question-container,\ndiv.card-survey-style .question-container {\n height: -webkit-fit-content;\n height: -moz-fit-content;\n height: fit-content;\n min-width: 100%;\n max-width: 100%;\n margin-bottom: 0;\n padding: 16px 28px;\n grid-gap: 16px;\n gap: 16px;\n flex-grow: 1;\n}\ndiv.widget-survey-components .question-footer,\ndiv.card-survey-style .question-footer {\n margin: 0px auto;\n justify-content: space-between;\n bottom: 0;\n padding-bottom: 20px;\n}\ndiv.widget-survey-components .submit,\ndiv.card-survey-style .submit {\n padding-bottom: 0;\n margin: unset;\n}\ndiv.widget-survey-components .nps-container .footer,\ndiv.card-survey-style .nps-container .footer {\n padding-top: 12px;\n}\ndiv.widget-survey-components .nps-container .widget .choices,\ndiv.card-survey-style .nps-container .widget .choices {\n grid-gap: 8px;\n gap: 8px;\n}\ndiv.widget-survey-components .radio-group,\ndiv.card-survey-style .radio-group {\n width: 100%;\n}\ndiv.widget-survey-components .checkbox-group,\ndiv.card-survey-style .checkbox-group {\n width: 100%;\n flex-wrap: nowrap;\n}\n\ndiv.widget-survey-components .question-container {\n box-shadow: none;\n border-radius: 0;\n}\ndiv.widget-survey-components .question-text {\n font-size: 0.875rem;\n}\ndiv.widget-survey-components .progressbar-container {\n position: absolute;\n}\ndiv.widget-survey-components .progressbar-container .progressbar {\n border-radius: 3px 0 0 0;\n}\ndiv.widget-survey-components .textarea-container .end-max-length {\n padding: 4px;\n}\ndiv.widget-survey-components .responsive-text-field .input-container {\n display: none;\n}\ndiv.widget-survey-components .responsive-text-field .textarea-container {\n display: flex;\n}\ndiv.widget-survey-components div.thankyou {\n min-height: unset;\n}\ndiv.widget-survey-components div.thankyou .text {\n width: 85%;\n}\ndiv.widget-survey-components div.thankyou svg {\n width: 140px;\n height: 120px;\n}\n\ndiv.widget-survey-components.default-style .freemium-survey-step-navigation {\n margin: 0;\n}\ndiv.widget-survey-components.default-style .questions {\n max-height: 400px;\n max-height: var(--default-widget-max-height);\n}\ndiv.widget-survey-components.default-style .question-container {\n padding: 12px 28px;\n}\ndiv.widget-survey-components.default-style .question-footer {\n justify-content: space-between;\n}\ndiv.widget-survey-components.default-style .nps-container .footer {\n padding-top: 12px;\n}\ndiv.widget-survey-components.default-style .nps-container .choices {\n flex-wrap: unset;\n grid-gap: 12px;\n gap: 12px;\n}\ndiv.widget-survey-components.default-style .action-button {\n line-height: 1.2;\n}\ndiv.widget-survey-components.default-style .radio-group {\n flex-direction: row;\n flex-wrap: wrap;\n}\ndiv.widget-survey-components.default-style .radio-group .radio-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n}\ndiv.widget-survey-components.default-style .checkbox-group {\n flex-direction: row;\n flex-wrap: wrap;\n}\ndiv.widget-survey-components.default-style .checkbox-group .checkbox-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n}\ndiv.widget-survey-components.default-style textarea {\n min-height: 84px;\n}\ndiv.widget-survey-components.default-style .end-max-length {\n font-size: 0.8rem;\n font-weight: 300;\n padding: 4px;\n}\n\n.widget-survey-components.cozy-style .freemium-survey-step-navigation {\n margin: 0;\n}\n.widget-survey-components.cozy-style .questions {\n max-height: 380px;\n max-height: var(--cozy-widget-max-height);\n}\n.widget-survey-components.cozy-style .question-text {\n font-size: 1rem;\n}\n.widget-survey-components.cozy-style .question-text.nps {\n text-align: center;\n width: 60%;\n min-width: 600px;\n margin: auto;\n}\n.widget-survey-components.cozy-style .question-container {\n padding: 12px 28px;\n}\n.widget-survey-components.cozy-style .question-footer {\n justify-content: space-between;\n}\n.widget-survey-components.cozy-style .nps-container {\n grid-gap: 44px;\n gap: 44px;\n}\n.widget-survey-components.cozy-style .nps-container .widget {\n display: flex;\n justify-content: center;\n}\n.widget-survey-components.cozy-style .nps-container .button-container {\n width: 60%;\n min-width: 600px;\n margin: 0 auto;\n}\n.widget-survey-components.cozy-style .nps-container .button-container .choices {\n justify-content: space-around;\n}\n.widget-survey-components.cozy-style .nps-container .footer {\n padding-top: 8px;\n}\n.widget-survey-components.cozy-style .action-button {\n line-height: 1.2;\n}\n.widget-survey-components.cozy-style .radio-group {\n flex-direction: row;\n flex-wrap: wrap;\n}\n.widget-survey-components.cozy-style .radio-group .radio-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n}\n.widget-survey-components.cozy-style .checkbox-group {\n flex-direction: row;\n flex-wrap: wrap;\n}\n.widget-survey-components.cozy-style .checkbox-group .checkbox-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n}\n.widget-survey-components.cozy-style textarea {\n min-height: 60px;\n}\n.widget-survey-components.cozy-style .end-max-length {\n font-size: 0.8rem;\n font-weight: 300;\n padding: 4px;\n}\n\n.freemium-survey-components.mobile-preview .thankyou .text {\n width: unset;\n}");const I=({thankYouQuestion:e,preview:o,placeholders:r,npsValue:i})=>(n.useEffect((()=>{o||e.type_info.meta?.redirectUrl&&setTimeout((()=>{window.location.href=e.type_info.meta?.redirectUrl}),1e3*(e.type_info.meta?.redirectDelay??1e4))}),[]),t.createElement("div",{className:"question-container thankyou"},t.createElement("div",{className:"heading"},"Thank you!"),t.createElement("div",{className:"text",dangerouslySetInnerHTML:{__html:_(e.text,r,i)}}),e.type_info.meta?.redirectUrl&&t.createElement("div",{style:{width:"100%"}},t.createElement("div",{className:"redirection-text"},"You will be redirected to the below URL automatically in"," ",e.type_info.meta?.redirectDelay," seconds.",t.createElement("br",null)),t.createElement("a",{className:"link",href:e.type_info.meta?.redirectUrl},e?.type_info.meta?.redirectUrl)))),R=({currentBlockIndex:e,currentBlockIndexOfBlocksWithQns:n,blocksWithQns:o,blocks:r,setHorizontalScrollUnits:i,preventQuestionAnimation:s})=>t.createElement("div",{className:"freemium-survey-step-navigation","data-navigation-element":"1"},t.createElement("button",{disabled:0==n.current,className:"navigation-button",onClick:()=>{n.current=Math.max(n.current-1,0),e.current=r.findIndex((e=>e.name===o[n.current].name)),s.current=!1,i(n.current)}},t.createElement(q,null)),t.createElement("button",{className:"navigation-button",disabled:n.current>=o.length-1,onClick:()=>{s.current=!1,n.current=Math.min(n.current+1,o.length-1),e.current=r.findIndex((e=>e.name===o[n.current].name)),i(n.current)}},t.createElement(k,null))),B=({widget:e,widgetStyle:n,surveyStyle:o,formValues:r,othersMeta:i,blocksWithQns:s,blocks:a,thankYouQuestion:u,currentBlockIndexOfBlocksWithQns:l,currentBlockIndexOfBlocks:d,currentEditingBlock:p,isSubmitting:m,isValuesCommitted:f,isCurrentBlockFinal:y,setHorizontalScrollUnits:v,handleFormValues:x,skipBlock:g,setIsSubmitting:h,onSubmit:b,setIsSurveyCompleted:k,preventQuestionAnimation:q,preview:E,closePreview:_,...C})=>{const z=C.blockIndex??l.current,N=C.question??s[z].question,S=()=>N.name===p.current.question.name&&!c.includes(N.type_info.question_type)&&!y(),I=()=>"RANGE"!==N.type_info.question_type&&!N.required&&N.name===p.current.question.name&&!y(),B=()=>"DROPDOWN"===N.type_info.question_type&&N.name!==p.current.question.name&&!N.required&&null!=r[N.name],O=()=>y()&&(e||"standard"!==o)&&N.name===p.current.question.name,T="MULTI_SELECT"===p.current.question.type_info.question_type&&r[p.current.question.name]?.includes("others")&&(!i[p.current.question.name]||""===i[p.current.question.name]);return t.createElement("div",{className:"question-footer"},!(!e&&"standard"===o||0===z&&!r[N.name]||"compact"===n)&&t.createElement(R,{currentBlockIndex:d,currentBlockIndexOfBlocksWithQns:l,blocksWithQns:s,blocks:a,setHorizontalScrollUnits:v,preventQuestionAnimation:q}),(S()||B()||I()||O())&&t.createElement("div",{className:"action-buttons"},S()&&t.createElement(w,{onClick:()=>{x(s[z],null,!0)},disabled:p.current.question.required&&(!r[p.current.question.name]||Array.isArray(r[p.current.question.name])&&0===r[p.current.question.name].length)||p.current.question.type_info.meta?.othersRequired&&T,className:"next-button"},"Next"),I()&&t.createElement("button",{className:"skip-button",onClick:()=>g(N)},"Skip"),B()&&t.createElement("button",{className:"skip-button",onClick:()=>{p.current=s[z],d.current=a.findIndex((e=>e.name===s[z].name)),g(N)}},"Clear selection"),O()&&t.createElement("div",{className:"submit"},t.createElement(w,{disabled:(p.current.question.required||p.current.question.type_info.pivot_question)&&(null==r[p.current.question.name]||0===r[p.current.question.name]?.length)||p.current.question.type_info.meta?.othersRequired&&T||m,onClick:()=>{h(!0),b({...r,others_meta:i},(()=>{u?.type_info.meta?.skipThankYouPage?E?setTimeout((()=>{_?.()}),300):window.location.href=u?.type_info.meta?.redirectUrl:k(!0)}))}},m?"Submitting":"Submit Survey"))))},O=({survey:e,surveyStyle:o="standard",placeholders:i,onSubmit:s,widget:a,npsValue:u,widgetStyle:l,widgetNavigatorQuerySelector:d,preview:p,mobilePreview:m,closePreview:f})=>{const y=e.question_details?.questions||[],v=e.meta?.blocks||[],[x,g]=n.useState(null),[b,k]=n.useState({}),[q,C]=n.useState(!1),[z,N]=n.useState([]),[S,O]=n.useState(0),[T,F]=n.useState(!1),[Q,$]=n.useState(null),[L,V]=n.useState({}),Y=n.useRef(null),A=n.useRef(null),D=n.useRef(-1),j=n.useRef(null),U=n.useRef(0),H=n.useRef(0),M=n.useRef(!1),P=n.useRef([]),W=n.useRef(!!u&&"card"===o),G=n.useRef(null),X=n.useRef([]);n.useEffect((()=>{v&&(G.current=v.find((e=>"TY"===e.name)),g(v.filter((e=>"TY"!==e.name))))}),[v]),n.useEffect((()=>{if(x)if(A.current=y.find((e=>e.type_info?.pivot_question))??y.find((e=>"RANGE"===e.type_info?.question_type))??y[0],null!=u){D.current=u;const e=y.find((e=>e.name===x[0].question_names[0]));Y.current={...x[0],question:e},P.current=[...P.current,{...x[0],question:e}],N(P.current),k({Q_1:u})}else if(!Y.current&&x.length>0)return Y.current=x[0],void K(x[0])}),[x,u]),n.useEffect((()=>{z.length&&(P.current=z,H.current=z.length-1),a||"standard"!==o?(j.current&&(j.current.style.maxHeight="unset"),X.current[U.current]=j.current?.scrollHeight||X.current[U.current]||0,j.current&&(j.current.style.maxHeight="100%")):j.current?.scrollIntoView({block:"center",behavior:"smooth"}),O(z.length-1)}),[z]),n.useEffect((()=>{Object.keys(b).length>0&&Y.current.question&&(c.includes(Y.current.question.type_info.question_type)||M.current)&&!Z()&&J()}),[b]),n.useEffect((()=>{if(null!=b?.[A.current?.name])if(G.current?.is_based_on_score){const e=A.current?.type_info?.choices[b?.[A.current?.name]]?.dependent_question_names,n=G.current?.question_names.find((n=>e?.includes(n))),t=y.find((e=>e.name===n));$(t)}else{const e=y.find((e=>e.name==G.current?.question_names[0]));$(e)}}),[b?.[A.current?.name]]);const Z=()=>U.current===x.length-1||"end"===Y.current.branchOption,K=e=>{let n={};if(e.is_based_on_score){const t=A.current?.type_info?.choices[b?.[A.current?.name]]?.dependent_question_names,o=e.question_names.find((e=>t?.includes(e)));n=y.find((e=>e.name===o))}else n=y.find((n=>n.name===e.question_names[0]));Y.current.question=n;P.current.find((e=>e.question.name===n.name))?(O(S+1),H.current+=1):N([...P.current,{...e,question:n}])},J=()=>{if(Z())C(!0);else{if(Y.current.nextBlock)U.current=x.findIndex((e=>e.name===Y.current.nextBlock));else if(Y.current.question.type_info?.meta?.branches){const e=Y.current.question.type_info?.meta?.branches,n=b[Y.current.question.name];let t;if(t="RANGE"===Y.current.question.type_info.question_type?e.find((e=>n>=e.min&&n<=e.max)):e.find((e=>n===e.value)),t?.nextBlock){if("TY"===t.nextBlock)return void C(!0);U.current=x.findIndex((e=>e.name===t.nextBlock))}else U.current+=1}else U.current+=1;Y.current=x[U.current],K(x[U.current])}},ee=e=>{M.current=!0,delete b[e.name],k({...b})},ne=(e,n,t)=>{if(W.current=!1,t){if(M.current=!0,null!=b[e.question.name]&&e.name!==z[z.length-1].name){const[t,o]=(e=>{const n=z.findIndex((n=>n.name===e.name)),t=z.slice(0,n+1),o=t.reduce(((e,n)=>(e[n.question.name]=b[n.question.name],e)),{});return U.current=x.findIndex((n=>n.name===e.name)),[t,o]})(e);k({...o,...null!=n&&{[e.question.name]:n}}),P.current=t}else k({...b,...null!=n&&{[e.question.name]:n}});A?.current?.name==e?.question?.name&&(D.current=n)}else k({...b,...null!=n&&{[e.question.name]:n}})},te=(e,n)=>{V({...L,[e]:n})};return Y.current&&Y.current.question?q?t.createElement("div",{className:`freemium-survey-components ${a?"widget-survey-components":""} ${l}-style ${m?"mobile-preview":""} ${o}-survey-style`,id:"freemium-survey"},t.createElement(I,{thankYouQuestion:Q,preview:p,placeholders:i,npsValue:D.current})):t.createElement("div",{className:`freemium-survey-components ${a?"widget-survey-components":""} ${l}-style ${m?"mobile-preview":""} ${o}-survey-style`,id:"freemium-survey"},t.createElement(h,{totalSteps:x.length,completedSteps:U.current}),a&&"compact"===l&&document.querySelector(d)&&t.createElement(t.Fragment,null,r.createPortal(t.createElement("div",null,t.createElement(R,{currentBlockIndex:U,currentBlockIndexOfBlocksWithQns:H,blocksWithQns:z,blocks:x,setHorizontalScrollUnits:O,preventQuestionAnimation:W})),document.querySelector(d))),t.createElement("div",{style:a||"card"===o?{transform:`translateX(calc(-${S} * 100%))`,height:`${X.current[U.current]}px`,transition:W.current||z?.length<=1?"none":"all 600ms ease-out 0ms"}:{},className:"questions"},z.map(((e,n)=>t.createElement("div",{key:e.question.name,ref:j,className:"question-container "+(!a&&"card"!==o||H.current===n?"":"hide-question-container")},t.createElement("div",{className:"question-text "+(0===n?"nps":""),dangerouslySetInnerHTML:{__html:_(e.question.text,i,D.current)},title:`question-${n}`,role:"heading","aria-level":1}),t.createElement("button",{disabled:!a&&"standard"===o,className:"autofocus-button",onKeyDown:e=>{"Tab"===e.key&&(e.stopPropagation(),e.preventDefault())}}),t.createElement(E,{question:e.question,formValues:b,othersMeta:L,autoFocus:H.current===n,autoFocusDelay:"standard"===o?350:20,saveOthersValue:te,onChangeHandler:n=>{M.current=!1,U.current=x.findIndex((n=>n.name===e.name)),Y.current=e,ne(e,n,c.includes(e.question.type_info.question_type)&&!Z())}}),t.createElement("button",{disabled:!a&&"standard"===o,className:"autofocus-button",onKeyDown:e=>{"Tab"===e.key&&(e.stopPropagation(),e.preventDefault())}}),t.createElement(B,{question:e.question,blockIndex:n,widget:a,widgetStyle:l,surveyStyle:o,formValues:b,othersMeta:L,blocksWithQns:z,blocks:x,thankYouQuestion:Q,currentBlockIndexOfBlocksWithQns:H,currentBlockIndexOfBlocks:U,currentEditingBlock:Y,isSubmitting:T,isValuesCommitted:M,isCurrentBlockFinal:Z,setHorizontalScrollUnits:O,handleFormValues:ne,skipBlock:ee,setIsSubmitting:F,onSubmit:s,setIsSurveyCompleted:C,preventQuestionAnimation:W,preview:p,closePreview:f})))),!a&&"card"!==o&&Z()&&t.createElement("div",{className:"submit"},t.createElement(w,{disabled:(Y.current.question.required||Y.current.question.type_info.pivot_question)&&(null==b[Y.current.question.name]||0===b[Y.current.question.name]?.length)||Y.current.question.type_info.meta?.othersRequired&&"MULTI_SELECT"===Y.current.question.type_info.question_type&&b[Y.current.question.name]?.includes("")||T,onClick:()=>{F(!0),s({...b,others_meta:L},(()=>{Q?.type_info.meta?.skipThankYouPage?p?setTimeout((()=>{f?.()}),300):window.location.href=Q?.type_info.meta?.redirectUrl:C(!0)}))}},T?"Submitting":"Submit Survey")))):null};exports.BUTTON_SIZE_VARIANTS={LARGE:"large",MINI:"mini",NORMAL:"normal"},exports.Button=w,exports.CheckboxGroup=y,exports.Input=p,exports.NPS=s,exports.ProgressBar=h,exports.Radio=g,exports.RadioGroup=x,exports.Survey=e=>{const{survey:o}=e,r=n.useMemo((()=>{const e=JSON.parse(JSON.stringify(o)),n=[];return(e.question_details?.questions||[]).forEach((e=>{const t=e.type_info?.meta?.block;t&&(t.question_names||(t.question_names=[e.name]),n.push(t))})),{...e,meta:{...e.meta,blocks:n}}}),[o]);return t.createElement(t.Fragment,null,"standard"===e.surveyStyle||e.widget?t.createElement(O,Object.assign({},e,{survey:r})):t.createElement(S,Object.assign({},e,{survey:r})))},exports.TextArea=m;
1
+ "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var n=require("react"),t=e(n),o=require("react-transition-group"),r=e(require("react-dom"));function i(e,n){void 0===n&&(n={});var t=n.insertAt;if(e&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===t&&o.firstChild?o.insertBefore(r,o.firstChild):o.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}i(".freemium-survey-components .nps-container {\n margin: 0 auto;\n width: 100%;\n display: flex;\n flex-direction: column;\n grid-gap: 28px;\n gap: 28px;\n}\n.freemium-survey-components .nps-container .footer {\n border-top: 1px solid var(--default-background-color);\n border-top: 1px solid var(--background-color, var(--default-background-color));\n padding-top: 20px;\n display: flex;\n justify-content: center;\n font-size: 0.875rem;\n line-height: 1.5;\n color: #666;\n}\n.freemium-survey-components .nps-container .footer:empty {\n display: none;\n}\n.freemium-survey-components .nps-container .nps-scale {\n position: relative;\n}\n.freemium-survey-components .nps-container .nps-scale .button-container {\n display: flex;\n border-radius: 4px;\n justify-content: space-between;\n background: var(--default-background-color);\n background: var(--background-color, var(--default-background-color));\n position: relative;\n margin-bottom: 40px;\n}\n.freemium-survey-components .nps-container .nps-scale .positive-text {\n position: absolute;\n color: #475867;\n bottom: -40px;\n font-size: 12px;\n right: 0px;\n text-align: right;\n}\n.freemium-survey-components .nps-container .nps-scale .negative-text {\n position: absolute;\n color: #475867;\n bottom: -40px;\n font-size: 12px;\n left: 0;\n text-align: left;\n}\n.freemium-survey-components .nps-container .nps-scale span {\n color: #aaa;\n font-size: 0.75rem;\n}\n.freemium-survey-components .nps-container .nps-scale button {\n display: inline-block;\n font-size: 1rem;\n white-space: nowrap;\n vertical-align: middle;\n background: none;\n border: none;\n box-shadow: none;\n cursor: pointer;\n text-align: center;\n font-weight: 400;\n border-radius: 4px;\n margin: 0;\n outline: none;\n margin-left: -1px;\n width: 40px;\n height: 40px;\n transform: scale(1);\n}\n.freemium-survey-components .nps-container .nps-scale button:hover {\n transition: background 0.2s ease-in, border-color 0.2s ease-in, transform 0.2s cubic-bezier(0.5, 2, 0.5, 0.75);\n}\n.freemium-survey-components .nps-container .nps-scale button:hover, .freemium-survey-components .nps-container .nps-scale button:focus {\n color: white;\n transform: scale(1.2);\n z-index: 2;\n position: relative;\n}\n.freemium-survey-components .nps-container .nps-scale button.active {\n color: white;\n transform: scale(1.2);\n z-index: 2;\n position: relative;\n}\n.freemium-survey-components .nps-container .nps-scale.rounded button {\n border-radius: 50%;\n}\n.freemium-survey-components .nps-container .nps-scale.square button {\n border-radius: 0;\n}\n.freemium-survey-components .nps-container .nps-scale.curved button {\n border-radius: 3px;\n}\n.freemium-survey-components .nps-container .nps-scale.highlighted button:hover, .freemium-survey-components .nps-container .nps-scale.highlighted button:focus, .freemium-survey-components .nps-container .nps-scale.highlighted button.active {\n background: var(--default-brand-color) !important;\n background: var(--brand-color, var(--default-brand-color)) !important;\n}\n.freemium-survey-components .nps-container .nps-scale .choices {\n width: 100%;\n display: flex;\n justify-content: space-between;\n font-weight: 500;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .button-container {\n background-color: transparent;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice {\n background: #EBEFF3;\n color: #000;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:focus, .freemium-survey-components .nps-container .nps-scale.standard .choice.active, .freemium-survey-components .nps-container .nps-scale.standard .choice:hover {\n background: #E43E3D;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(1):focus, .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(1).active, .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(1):hover, .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(2):focus, .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(2).active, .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(2):hover {\n background: #00AF50;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(3):hover, .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(4):hover {\n background: #F8C43E;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:hover, .freemium-survey-components .nps-container .nps-scale.standard .choice:focus, .freemium-survey-components .nps-container .nps-scale.standard .choice.active {\n color: #fff;\n transform: scale(1.2);\n}\n\n.freemium-survey-components.mobile-preview .nps-container .nps-scale .button-container {\n background: transparent;\n}\n.freemium-survey-components.mobile-preview .nps-container .nps-scale .choices {\n flex-wrap: wrap;\n justify-content: center;\n grid-gap: 16px;\n gap: 16px;\n background: transparent;\n}\n.freemium-survey-components.mobile-preview .nps-container .nps-scale button {\n border-radius: 50%;\n background: #ebeff3;\n}\n\n@media (max-width: 550px) {\n .freemium-survey-components .nps-container .nps-scale .button-container,\n.card-survey-style .nps-container .nps-scale .button-container {\n background: transparent;\n }\n .freemium-survey-components .nps-container .nps-scale .choices,\n.card-survey-style .nps-container .nps-scale .choices {\n flex-wrap: wrap;\n justify-content: center;\n grid-gap: 16px;\n gap: 16px;\n background: transparent;\n }\n .freemium-survey-components .nps-container .nps-scale button,\n.card-survey-style .nps-container .nps-scale button {\n border-radius: 50%;\n background: #ebeff3;\n }\n}\n.widget-survey-components .nps-container .nps-scale .button-container {\n background: transparent;\n}\n.widget-survey-components .nps-container .nps-scale .choices {\n flex-wrap: wrap;\n justify-content: center;\n grid-gap: 16px;\n gap: 16px;\n background: transparent;\n}\n.widget-survey-components .nps-container .nps-scale button {\n border-radius: 50%;\n background: #ebeff3;\n}");const s=e=>{const{type_info:{linear_scale:{button_style:o="highlighted",button_shape:r="rounded"}={},rating_presets:{start:i="Very unlikely",end:s="Very likely"}={},validation:{min:a},footer_text:c}}=e,u=e=>{switch(e){case e<=6:return"detractor";case e<=8:return"passive";default:return"promoter"}},l=n.useRef(Array.from({length:10+(0===a?1:0)},((e,n)=>n+a)));return t.createElement("div",{className:"nps-container","data-test-input":"nps"},t.createElement("div",{className:`nps-scale ${r} ${o}`},t.createElement("div",{className:"button-container"},t.createElement("span",{className:"negative-text",role:"note"},`${a} - ${i}`),t.createElement("span",{className:"positive-text",role:"note"},`${l.current[l.current.length-1]} - ${s}`),t.createElement("div",{className:"choices",role:"radiogroup","aria-required":!0},l.current.map((n=>t.createElement("button",{role:"radio","aria-checked":e.npsValue===n,key:n,"data-test-nps-choice":n,onClick:t=>{e.onChangeHandler(n)},className:`choice ${u(n)} ${e.npsValue===n&&"active"}`},n)))))),t.createElement("div",{className:"footer",role:"note"},c))},a=(e,n)=>(e.defaultProps=n,e);i('.freemium-survey-components .input-container,\n.freemium-survey-components .textarea-container {\n display: flex;\n flex-direction: column;\n width: 100%;\n border-radius: 4px;\n position: relative;\n}\n.freemium-survey-components label.input-label {\n display: inline-block;\n padding-bottom: 8px;\n padding-left: 2px;\n font-size: 0.75rem;\n font-weight: 400;\n}\n.freemium-survey-components label.required::after {\n content: "*";\n position: relative;\n top: 2px;\n font-weight: 500;\n font-size: 0.85rem;\n padding-left: 3px;\n color: #d72d30;\n}\n.freemium-survey-components .input-basic {\n width: 100%;\n display: flex;\n align-items: center;\n border-radius: 4px;\n border: 1px solid var(--default-brand-color);\n border: 1px solid var(--brand-color, var(--default-brand-color));\n transition: border-color 0.2s linear;\n background: #fff;\n}\n.freemium-survey-components .textarea-container .input-basic {\n flex-direction: column;\n align-items: unset;\n}\n.freemium-survey-components .input-basic.error {\n border: 1px solid #d72d30;\n}\n.freemium-survey-components .input-basic.error:hover {\n border: 1px solid #d72d30;\n}\n.freemium-survey-components .input-basic.error[focus-within] {\n box-shadow: none;\n}\n.freemium-survey-components .input-basic.error:focus-within {\n box-shadow: none;\n}\n.freemium-survey-components .input-basic:hover {\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n transition: 0.2s linear;\n}\n.freemium-survey-components .input-basic[focus-within] {\n border: 1px solid transparent;\n box-shadow: 0 0 0 2px var(--default-brand-color);\n box-shadow: 0 0 0 2px var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components .input-basic:focus-within {\n border: 1px solid transparent;\n box-shadow: 0 0 0 2px var(--default-brand-color);\n box-shadow: 0 0 0 2px var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components .end-max-length {\n padding: 0 8px;\n font-size: 0.75rem;\n color: #264966;\n}\n.freemium-survey-components .textarea-container .end-max-length {\n padding: 8px;\n align-self: flex-end;\n}\n.freemium-survey-components span.input-error {\n display: block;\n padding-left: 2px;\n padding-top: 4px;\n font-size: 0.9rem;\n color: #d72d30;\n}\n.freemium-survey-components input[type=text] {\n padding: 6px 12px;\n flex: 1;\n border: unset;\n height: 32px;\n font-size: 1rem;\n /* line-height: ${typography.input.text.lineHeight}; */\n border-radius: 4px;\n}\n.freemium-survey-components input[type=text],\n.freemium-survey-components textarea {\n outline: none;\n border: none;\n}\n.freemium-survey-components input[type=text]::-moz-placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components input[type=text]:-ms-input-placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components input[type=text]::placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components textarea {\n min-height: 116px;\n padding: 12px;\n flex: 1;\n border: unset;\n resize: none;\n font-size: 1rem;\n /* line-height: ${typography.input.text.lineHeight}; */\n border-radius: 4px;\n}\n.freemium-survey-components textarea::-moz-placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components textarea:-ms-input-placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components textarea::placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}');const c=["RANGE","NPS","RADIO","DROPDOWN"],u={isRequired:!1,showCount:!0,isErrored:!1,inline:!1,spellCheck:!1,autoFocusInput:!0},l=n.forwardRef(((e,o)=>{const r=n.useRef(null);n.useEffect((()=>{e.autoFocusInput&&setTimeout((()=>{r.current?.focus()}),600+e.autoFocusDelay)}),[e.autoFocusInput]);const{inputStyle:i,style:s,className:a,showCount:c,isErrored:u,startLabel:l,isRequired:d,errorText:p,endLabel:m,maxLength:f=300,onChange:v,autoFocusInput:y,...g}=e;return t.createElement("div",{className:"input-container",style:s},e.label&&t.createElement("label",{className:"input-label "+(d?"required":"")},e.label),t.createElement("div",null,l&&t.createElement("div",{className:"start-label"},l),t.createElement("div",{className:`input-basic ${u?"error":""}${a||""}`},t.createElement("input",Object.assign({},g,{type:"text",autoComplete:"off",ref:r,style:i,onChange:e=>{e.target.value?.length>f||v?.(e)}})),c&&f>0&&t.createElement("div",{className:"end-max-length"},`${e.value&&e.value.length||0}/${f}`)),m&&t.createElement("div",{className:"end-label"},m)),u&&p&&t.createElement("span",{className:"input-error"},e.errorText))})),d=n.forwardRef(((e,o)=>{const r=n.useRef(null);n.useEffect((()=>{e.autoFocusInput&&setTimeout((()=>{r.current?.focus()}),600+e.autoFocusDelay)}),[e.autoFocusInput]);const{inputStyle:i,style:s,className:a,showCount:c,maxLength:u=1500,startLabel:l,isRequired:d,autoFocusInput:p,onChange:m,...f}=e;return t.createElement(t.Fragment,null,t.createElement("div",{className:"textarea-container",style:s},e.label&&t.createElement("label",{className:"input-label "+(d?"required":"")},e.label),l&&t.createElement("div",{className:"start-label"},l),t.createElement("div",{className:`input-basic ${a||""}`},t.createElement("textarea",Object.assign({},f,{autoComplete:"off",ref:r,style:i,onChange:e=>{e.target.value?.length>u||m?.(e)}})),c&&u&&u>0&&t.createElement("div",{className:"end-max-length"},`${e.value&&e.value.length||0}/${u}`)),e.endLabel&&t.createElement("div",{className:"end-label"},e.endLabel)))})),p=a(l,u),m=a(d,u);i('.freemium-survey-components .checkbox-group {\n width: 100%;\n display: flex;\n grid-gap: 12px;\n gap: 12px;\n flex-direction: column;\n white-space: nowrap;\n flex-wrap: wrap;\n}\n.freemium-survey-components .icon-container {\n display: inline-block;\n flex: 0 0 12px;\n width: 12px;\n height: 12px;\n min-width: 12px;\n min-height: 12px;\n color: inherit;\n position: absolute;\n left: 1px;\n top: 2px;\n}\n.freemium-survey-components .tick-icon {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n height: 100%;\n width: 100%;\n color: inherit;\n fill: currentColor;\n}\n.freemium-survey-components input[type=checkbox] {\n position: absolute;\n clip: rect(0px 0px 0px 0px);\n width: 0px;\n height: 0px;\n}\n.freemium-survey-components input[type=checkbox]:focus ~ .checkbox {\n /* box-shadow: ${pseudo.focus} 0px 0px 0px 2px; */\n box-shadow: var(--default-brand-color) 0px 0px 0px 2px;\n box-shadow: var(--brand-color, var(--default-brand-color)) 0px 0px 0px 2px;\n border-color: transparent;\n}\n.freemium-survey-components .checkbox-label {\n display: flex;\n align-items: baseline;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n text-align: left;\n opacity: 1;\n line-height: 1.2;\n cursor: pointer;\n font-size: 1rem;\n padding: 16px 24px;\n min-width: 200px;\n border: 1px solid #ebeff3;\n box-shadow: 0px 2px 5px rgba(18, 52, 77, 0.06);\n border-radius: 4px;\n white-space: pre-wrap;\n}\n.freemium-survey-components .checkbox-label:hover .checkbox {\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n box-shadow: var(--default-background-color) 0px 0px 0px 5px;\n box-shadow: var(--background-color, var(--default-background-color)) 0px 0px 0px 5px;\n}\n.freemium-survey-components .checkbox-label.disabled {\n opacity: 0.5;\n cursor: "not-allowed";\n}\n.freemium-survey-components .checkbox {\n transition: background-color ease-in 0.2s;\n min-width: 14px;\n min-height: 14px;\n min-height: 14px;\n max-height: 14px;\n border-radius: 2px;\n position: relative;\n margin-right: 16px;\n background-color: #fff;\n border: 1px solid;\n text-align: left;\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components .checkbox:hover {\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n box-shadow: var(--default-background-color) 0px 0px 0px 5px;\n box-shadow: var(--background-color, var(--default-background-color)) 0px 0px 0px 5px;\n}\n.freemium-survey-components input[type=checkbox]:checked ~ .checkbox {\n background-color: var(--default-brand-color);\n background-color: var(--brand-color, var(--default-brand-color));\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components input[type=checkbox]:checked ~ .checkbox:hover {\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components input[type=checkbox]:disabled ~ .checkbox:hover {\n box-shadow: unset;\n border-color: unset;\n}');const f=()=>t.createElement("svg",{id:"tick",className:"tick-icon",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"title",viewBox:"0 0 10 10"},t.createElement("path",{d:"M3 5.87c-.18666814.00267463-.36667109-.06932655-.5-.2L.21 3.41c-.1786328-.17863279-.24839684-.43899577-.1830127-.6830127.06538414-.24401694.25598306-.43461586.5-.5C.77100423 2.16160316 1.0313672 2.23136721 1.21 2.41L3 4.18 6.8.33c.27679776-.27455556.72320224-.27455556 1 0 .13696438.13025306.21450026.31098915.21450026.5S7.93696438 1.19974694 7.8 1.33L3.45 5.67c-.12082534.11896945-.28072735.19003701-.45.2Z",fill:"#fff",fillRule:"evenodd"})),v=({values:e=[],othersValue:o="",options:r,name:i,autoFocusGroup:s,autoFocusDelay:a,onChangeHandler:c,saveOthersValue:u,othersOption:l,othersRequired:d})=>{const[m,f]=n.useState(!1),v=n.useRef(null);return n.useEffect((()=>{s&&setTimeout((()=>{v.current?.focus()}),600+a)}),[s]),t.createElement("div",{className:"checkbox-group"},t.createElement("button",{ref:v,className:"autofocus-button","aria-hidden":!0}),r?.map(((n,o)=>t.createElement(y,{key:n.id,checked:e?.includes(n.value),name:n.value,id:n.id,onChange:(t,o)=>{if(o)c([...e||[],n.value]);else{const t=e.indexOf(n.value);t>-1&&e.splice(t,1),c([...e])}}},n.value))),l&&t.createElement(y,{key:"others",checked:m,name:"others",id:"others",onChange:(n,t)=>{if(f(t),t)c([...e,"others"]);else{const n=e.findIndex((e=>"others"===e));e.splice(n,1),c(e)}}},"Others"),m&&t.createElement(t.Fragment,null,t.createElement(p,{placeholder:"Enter your comment",value:o[i],onChange:e=>{u(i,e.target.value)},autoFocusDelay:10,label:""})))},y=a((e=>{const o=n.useRef(null);return n.useEffect((()=>{e.autoFocus&&setTimeout((()=>{o.current?.focus()}),620)}),[]),t.createElement("label",{className:`checkbox-label ${e.disabled&&"disabled"}`},t.createElement("input",{ref:o,id:e.id,type:"checkbox",name:e.name,readOnly:e.readOnly,disabled:e.disabled,"aria-disabled":e.disabled,checked:e.checked,onChange:e.readOnly?()=>{}:n=>e.onChange(n,n.target.checked)}),t.createElement("div",{className:"checkbox"},e.checked&&t.createElement("div",{className:"icon-container"},t.createElement(f,null)," ")),t.createElement("div",null,e.children))}),{checked:!1});i('.freemium-survey-components .radio-group {\n display: flex;\n grid-gap: 12px;\n gap: 12px;\n white-space: nowrap;\n flex-direction: column;\n width: 100%;\n}\n.freemium-survey-components .radio {\n background-color: #fff;\n border: 1px solid;\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n transition: background-color ease-in 0.2s;\n min-width: 18px;\n max-width: 18px;\n min-height: 18px;\n max-height: 18px;\n border-radius: 50%;\n position: relative;\n margin-right: 16px;\n text-align: left;\n}\n.freemium-survey-components .radio:before {\n left: 3px;\n top: 3px;\n content: "";\n position: absolute;\n width: 10px;\n height: 10px;\n border-radius: 50%;\n transition: all ease-in 0.2s;\n background-color: #fff;\n}\n.freemium-survey-components .radio-label {\n display: flex;\n align-items: baseline;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n text-align: left;\n cursor: pointer;\n line-height: 1.2;\n font-size: 1rem;\n font-weight: 400;\n padding: 16px 24px;\n min-width: 200px;\n border: 1px solid #ebeff3;\n box-shadow: 0px 2px 5px rgba(18, 52, 77, 0.06);\n border-radius: 4px;\n white-space: pre-wrap;\n}\n.freemium-survey-components input[type=radio] {\n position: absolute;\n clip: rect(0, 0, 0, 0);\n width: 0px;\n height: 0px;\n}\n.freemium-survey-components input[type=radio]:focus ~ .radio {\n /* box-shadow: ${pseudo.focus} 0px 0px 0px 3px; */\n box-shadow: var(--default-brand-color) 0px 0px 0px 3px;\n box-shadow: var(--brand-color, var(--default-brand-color)) 0px 0px 0px 3px;\n border-color: transparent;\n}\n.freemium-survey-components input[type=radio]:checked ~ .radio:before {\n background-color: var(--default-brand-color);\n background-color: var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components .radio-label:hover .radio {\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n box-shadow: var(--default-background-color) 0px 0px 0px 5px;\n box-shadow: var(--background-color, var(--default-background-color)) 0px 0px 0px 5px;\n}');const g=({name:e,options:o,value:r,autoFocusGroup:i,autoFocusDelay:s,onChangeHandler:a,saveOthersValue:c,othersOption:u,othersRequired:l,othersValue:d})=>{const[m,f]=n.useState(d??""),[v,y]=n.useState(r),g=n.useRef(null);return n.useEffect((()=>{i&&setTimeout((()=>{g.current?.focus()}),600+s)}),[i]),n.useEffect((()=>{r||(f(""),y(null))}),[r]),n.useEffect((()=>{v&&o.find((e=>e.value===v))&&v!==r&&a(v)}),[v]),t.createElement("div",{className:"radio-group",role:"radiogroup"},t.createElement("button",{ref:g,className:"autofocus-button","aria-hidden":!0,tabIndex:-1}),o?.map(((n,o)=>t.createElement(x,{key:n.value,value:n.value,name:e,onChange:e=>{y(e.currentTarget.value)},checked:v===n.value},n.value))),u&&t.createElement(x,{key:"others",value:"others",name:e,onChange:e=>{y("others")},checked:"others"===v},"Others"),"others"===v&&t.createElement(t.Fragment,null,t.createElement(p,{value:m,onChange:e=>f(e.target.value),placeholder:"Enter your comment",label:"",autoFocusDelay:10}),m!==r&&t.createElement(w,{inline:!0,disabled:l&&0===m.length,onClick:()=>{a("others"),c(e,m)}},"Next")))},x=a((e=>{const o=n.useRef(null);return n.useEffect((()=>{e.autoFocus&&setTimeout((()=>{o.current?.focus()}),620)}),[]),t.createElement("label",{className:"radio-label"},t.createElement("input",{ref:o,type:"radio",name:e.name,value:e.value,checked:e.checked,onChange:e.onChange}),t.createElement("div",{className:"radio"}),t.createElement("div",null,e.children))}),{checked:!1,autoFocus:!1});i(".progressbar-container {\n width: 100%;\n height: 4px;\n position: fixed;\n top: 0;\n left: 0;\n z-index: 1;\n text-align: left;\n}\n\n.progressbar {\n transition: transform 0.25s linear;\n transform-origin: left;\n height: 100%;\n background-color: var(--default-brand-color);\n background-color: var(--brand-color, var(--default-brand-color));\n}");const h=e=>{const{totalSteps:n,completedSteps:o}=e;return t.createElement("div",{className:"progressbar-container"},t.createElement("div",{className:"progressbar",style:{width:(o>0?100/n:0)+"%",transform:`scaleX(${o})`}}))};i(".freemium-survey-components .action-button {\n width: auto;\n display: block;\n padding: 8px 16px;\n cursor: pointer;\n line-height: 1.5;\n text-align: center;\n font-weight: 500;\n letter-spacing: 0.3px;\n border-radius: 4px;\n white-space: nowrap;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n color: --default-button-text-color;\n color: var(--button-text-color, --default-button-text-color);\n background: var(--default-brand-color);\n background: var(--brand-color, var(--default-brand-color));\n border: 1px solid var(--default-brand-color);\n border: 1px solid var(--brand-color, var(--default-brand-color));\n border-radius: 4px;\n min-width: 200px;\n max-width: -webkit-fit-content;\n max-width: -moz-fit-content;\n max-width: fit-content;\n transform: translateY(0px);\n transition: transform ease 0.2s;\n}\n.freemium-survey-components .action-button:not([disabled]):hover {\n transform: translateY(-4px);\n}\n.freemium-survey-components .action-button[disabled] {\n cursor: not-allowed;\n opacity: 0.6;\n}\n.freemium-survey-components button:focus:not(:active) {\n /* box-shadow: 0 0 0 2px ${pseudo.focus}; */\n}\n\n@media (max-width: 550px) {\n .freemium-survey-components .action-button {\n min-width: 120px;\n }\n}\n.widget-survey-components .action-button {\n min-width: 120px;\n}\n\n.freemium-survey-components.mobile-preview .action-button {\n min-width: 120px;\n}");const b=()=>t.createElement(t.Fragment,null,"..."),w=e=>{const{inline:n=!1,children:o,disabled:r,className:i="",htmlType:s,type:a="primary",onClick:c,size:u,overrideStyleClassName:l="",loading:d=!1,...p}=e;return t.createElement("button",Object.assign({style:n?{display:"inline-block"}:{},disabled:r,className:`action-button ${i} ${l}`,type:s,onClick:c},p),d?t.createElement(b,null):o)},k=()=>t.createElement("svg",{style:{display:"block"},width:"9",height:"14",viewBox:"0 0 10 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M7.82585 6.15754C7.98999 6.32147 8.08232 6.54389 8.08252 6.77587L8.08252 7.2192C8.07983 7.45069 7.98788 7.6722 7.82585 7.83754L1.82919 13.8225C1.77496 13.8772 1.71044 13.9206 1.63936 13.9502C1.56827 13.9798 1.49203 13.9951 1.41502 13.9951C1.33801 13.9951 1.26177 13.9798 1.19068 13.9502C1.1196 13.9206 1.05508 13.8772 1.00085 13.8225L0.172521 12.9942C0.118197 12.941 0.0750381 12.8774 0.0455752 12.8073C0.0161124 12.7372 0.000937578 12.6619 0.000937585 12.5859C0.000937592 12.5098 0.0161125 12.4345 0.0455753 12.3644C0.0750381 12.2943 0.118197 12.2308 0.172521 12.1775L5.36419 6.99754L0.172522 1.81754C0.117847 1.76331 0.0744506 1.69879 0.0448352 1.62771C0.0152208 1.55662 -2.75162e-05 1.48038 -2.75094e-05 1.40337C-2.75027e-05 1.32636 0.0152208 1.25012 0.0448353 1.17904C0.0744507 1.10795 0.117847 1.04343 0.172522 0.989205L1.00086 0.172537C1.05508 0.117862 1.1196 0.0744661 1.19069 0.0448507C1.26177 0.0152353 1.33801 -1.20337e-05 1.41502 -1.2027e-05C1.49203 -1.20203e-05 1.56827 0.0152353 1.63936 0.0448507C1.71044 0.0744661 1.77496 0.117862 1.82919 0.172537L7.82585 6.15754Z",fill:"#6B6B6B"})),q=()=>t.createElement("svg",{style:{display:"block"},width:"9",height:"14",viewBox:"0 0 10 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M0.256667 7.83755C0.0925257 7.67361 0.000204227 7.4512 0 7.21921V6.77588C0.00268801 6.5444 0.0946357 6.32289 0.256667 6.15755L6.25333 0.172549C6.30756 0.117874 6.37208 0.0744776 6.44316 0.0448625C6.51425 0.0152474 6.59049 0 6.6675 0C6.74451 0 6.82075 0.0152474 6.89184 0.0448625C6.96292 0.0744776 7.02744 0.117874 7.08167 0.172549L7.91 1.00088C7.96432 1.05411 8.00748 1.11764 8.03694 1.18776C8.06641 1.25787 8.08158 1.33316 8.08158 1.40922C8.08158 1.48527 8.06641 1.56056 8.03694 1.63067C8.00748 1.70079 7.96432 1.76432 7.91 1.81755L2.71833 6.99755L7.91 12.1775C7.96467 12.2318 8.00807 12.2963 8.03769 12.3674C8.0673 12.4385 8.08255 12.5147 8.08255 12.5917C8.08255 12.6687 8.0673 12.745 8.03769 12.8161C8.00807 12.8871 7.96467 12.9517 7.91 13.0059L7.08167 13.8225C7.02744 13.8772 6.96292 13.9206 6.89184 13.9502C6.82075 13.9799 6.74451 13.9951 6.6675 13.9951C6.59049 13.9951 6.51425 13.9799 6.44316 13.9502C6.37208 13.9206 6.30756 13.8772 6.25333 13.8225L0.256667 7.83755Z",fill:"#6B6B6B"})),E=({question:e,formValues:n,othersMeta:o,onChangeHandler:r,saveOthersValue:i,autoFocus:a,autoFocusDelay:c})=>{switch(e.type_info.question_type){case"RANGE":return t.createElement(s,{type_info:e.type_info,onChangeHandler:r,npsValue:n[e.name]});case"CHECKBOX":case"MULTI_SELECT":return t.createElement(v,{name:e.name,autoFocusGroup:a,values:n[e.name],othersValue:o[e.name],options:e.type_info.choices,onChangeHandler:r,saveOthersValue:i,othersOption:e.type_info.meta?.othersOption,othersRequired:e.type_info.meta?.othersRequired,autoFocusDelay:c});case"RADIO":case"DROPDOWN":return t.createElement(g,{autoFocusGroup:a,autoFocusDelay:c,name:e.name,onChangeHandler:r,saveOthersValue:i,options:e.type_info.choices,value:n[e.name],othersValue:o[e.name],othersOption:e.type_info.meta?.othersOption,othersRequired:e.type_info.meta?.othersRequired});case"INPUT":case"TEXT":return e.type_info?.meta?.readOnly?t.createElement("div",{className:"message-container"},e.type_info?.meta?.value):t.createElement("div",{className:"responsive-text-field"},t.createElement(p,{autoFocusInput:a,autoFocusDelay:c,label:"",isRequired:e.is_required,value:n[e.name]||"",placeholder:e.type_info?.meta?.placeholder??"",onChange:e=>r(e.target.value)}),t.createElement(m,{autoFocusInput:a,autoFocusDelay:c,label:"",isRequired:e.is_required,placeholder:e.type_info?.meta?.placeholder??"",value:n[e.name]||"",onChange:e=>r(e.target.value)}));case"PARAGRAPH":return t.createElement(m,{autoFocusInput:a,autoFocusDelay:c,label:"",isRequired:e.is_required,placeholder:e.type_info?.meta?.placeholder??"",value:n[e.name]||"",onChange:e=>r(e.target.value)});default:return console.error(`Question type ${e.type_info.question_type} not found`),null}},_=(e,n,t)=>{if(e){let o={"{{nps.rating}}":t};n&&(o={...o,...n});const r=new RegExp(Object.keys(o).join("|"),"gi");e=e.replace(r,(function(e){return o[e.toLowerCase()]}))}return e};i(":root {\n --default-brand-color: #264966;\n --default-question-text-color: #000;\n --default-question-background-color: #fff;\n --default-background-color: #f8f8f8;\n --default-button-text-color: #fff;\n --default-secondary-button-text-color: #000;\n --default-input-placeholder-color: #92a2b1;\n --compact-widget-max-height: 560px;\n --default-widget-max-height: 400px;\n --cozy-widget-max-height: 380px;\n}\n\n.freemium-survey-step-navigation {\n padding: 0 2px;\n box-shadow: 0px 0px 6px #eee;\n white-space: nowrap;\n}\n.freemium-survey-step-navigation .navigation-button {\n width: 38px;\n text-align: -webkit-center;\n height: 38px;\n background-color: #fff;\n border: none;\n cursor: pointer;\n border-radius: 0 3px 3px 0;\n}\n.freemium-survey-step-navigation .navigation-button svg {\n transform: rotate(90deg);\n}\n.freemium-survey-step-navigation .navigation-button:first-of-type {\n border-right: 1px solid #d9d9d9;\n border-radius: 3px 0 0 3px;\n}\n.freemium-survey-step-navigation .navigation-button:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n.freemium-survey-step-navigation .navigation-button:focus {\n position: relative;\n z-index: 1;\n}\n\n.freemium-survey-components .question-container {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n text-align: center;\n max-width: 700px;\n margin: 0 auto;\n background: var(--default-question-background-color);\n background: var(--question-background-color, var(--default-question-background-color));\n border-radius: 4px;\n transition: transform 500ms ease 0ms, opacity 200ms ease 0ms;\n box-shadow: 0px 12px 15px rgba(18, 52, 77, 0.03);\n margin-bottom: 28px;\n padding: 28px;\n grid-gap: 28px;\n gap: 28px;\n position: relative;\n height: -webkit-fit-content;\n height: -moz-fit-content;\n height: fit-content;\n transition: opacity 50ms ease-out;\n overflow: auto;\n}\n.freemium-survey-components .hide-question-container {\n opacity: 0;\n}\n.freemium-survey-components .question-text {\n font-size: 1rem;\n font-weight: 600;\n line-height: 1.8;\n width: 100%;\n text-align: left;\n color: var(--default-question-text-color);\n color: var(--question-text-color, var(--default-question-text-color));\n}\n.freemium-survey-components .autofocus-button {\n border: none;\n width: 0;\n height: 0;\n opacity: 0;\n margin-top: -12px;\n margin-left: -12px;\n position: absolute;\n}\n.freemium-survey-components .radio-group,\n.freemium-survey-components .checkbox-group {\n max-height: 420px;\n overflow: auto;\n}\n.freemium-survey-components .fade-enter .question-container {\n opacity: 0;\n transform: translateY(30px);\n}\n.freemium-survey-components .fade-enter-active .question-container {\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components .fade-exit .question-container {\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components .fade-exit-active .question-container {\n opacity: 0;\n transform: translateY(-30px);\n}\n.freemium-survey-components .fade-enter-active .question-container,\n.freemium-survey-components .fade-exit-active .question-container {\n transition: opacity 300ms, transform 300ms;\n}\n.freemium-survey-components .fade-reverse-enter .question-container {\n opacity: 0;\n transform: translateY(-30px);\n}\n.freemium-survey-components .fade-reverse-enter-active .question-container {\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components .fade-reverse-exit .question-container {\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components .fade-reverse-exit-active .question-container {\n opacity: 0;\n transform: translateY(30px);\n}\n.freemium-survey-components .fade-reverse-enter-active .question-container,\n.freemium-survey-components .fade-reverse-exit-active .question-container {\n transition: opacity 300ms, transform 300ms;\n}\n.freemium-survey-components .question-footer {\n display: flex;\n justify-content: flex-end;\n grid-gap: 40px;\n gap: 40px;\n width: 100%;\n align-items: center;\n}\n.freemium-survey-components .question-footer:empty {\n display: none;\n}\n.freemium-survey-components .action-buttons {\n display: flex;\n grid-gap: 20px;\n gap: 20px;\n flex-direction: row-reverse;\n}\n.freemium-survey-components .action-buttons:empty {\n display: none;\n}\n.freemium-survey-components .skip-button {\n font-weight: 400;\n cursor: pointer;\n background: transparent;\n border: none;\n min-width: 40px;\n padding: 8px 16px;\n border-radius: 4px;\n color: var(--default-secondary-button-text-color);\n color: var(--secondary-button-text-color, var(--default-secondary-button-text-color));\n letter-spacing: 0.05rem;\n line-height: 1.5;\n border: 1px solid transparent;\n}\n.freemium-survey-components .skip-button:hover {\n background-color: #f3f3f3;\n}\n.freemium-survey-components .next-button {\n color: var(--default-button-text-color);\n color: var(--button-text-color, var(--default-button-text-color));\n}\n.freemium-survey-components .submit {\n max-width: 700px;\n margin: 0 auto;\n text-align: left;\n background: transparent;\n box-shadow: none;\n color: var(--default-button-text-color);\n color: var(--button-text-color, var(--default-button-text-color));\n}\n.freemium-survey-components .thankyou {\n display: flex;\n align-items: center;\n justify-content: center;\n grid-gap: 20px;\n gap: 20px;\n min-height: 180px;\n}\n.freemium-survey-components .thankyou .heading {\n font-weight: 600;\n font-size: 28px;\n}\n.freemium-survey-components .thankyou .text {\n white-space: pre-wrap;\n font-weight: 500;\n font-size: 0.875rem;\n line-height: 1.6;\n color: #12344d;\n width: 75%;\n}\n.freemium-survey-components .thankyou .redirection-text {\n color: #929292;\n margin-bottom: 12px;\n font-weight: 300;\n}\n.freemium-survey-components .thankyou .link {\n width: 100%;\n display: inline-block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: #666;\n font-weight: 500;\n text-decoration: underline;\n}\n.freemium-survey-components .responsive-text-field {\n width: 100%;\n}\n.freemium-survey-components .responsive-text-field .textarea-container {\n display: none;\n}\n.freemium-survey-components .message-container:empty {\n display: none;\n}\n\n@media (max-width: 550px) {\n .freemium-survey-component .responsive-text-field .input-container,\n.card-survey-style .responsive-text-field .input-container {\n display: none;\n }\n .freemium-survey-component .responsive-text-field .textarea-container,\n.card-survey-style .responsive-text-field .textarea-container {\n display: flex;\n }\n}\ndiv.widget-survey-components.compact-style .freemium-survey-step-navigation {\n padding: 0 2px;\n margin-left: 4px;\n box-shadow: 0px 0px 6px #eee;\n margin-top: 4px;\n}\ndiv.widget-survey-components.compact-style .nps-container .footer {\n padding-top: 12px;\n}\ndiv.widget-survey-components.compact-style .nps-container .choices {\n grid-gap: 12px;\n gap: 12px;\n}\n\ndiv.widget-survey-components,\ndiv.card-survey-style {\n display: flex;\n flex-direction: column;\n grid-gap: 28px;\n gap: 28px;\n padding: 40px 0;\n flex-grow: 1;\n font-size: 0.875rem;\n overflow: hidden;\n}\ndiv.widget-survey-components .questions,\ndiv.card-survey-style .questions {\n min-width: 100%;\n max-width: 100%;\n display: flex;\n position: relative;\n}\ndiv.widget-survey-components .question-text,\ndiv.card-survey-style .question-text {\n width: 100%;\n text-align: left;\n}\ndiv.widget-survey-components .focus-lock,\ndiv.card-survey-style .focus-lock {\n width: 100%;\n}\ndiv.widget-survey-components .question-container,\ndiv.card-survey-style .question-container {\n height: -webkit-fit-content;\n height: -moz-fit-content;\n height: fit-content;\n min-width: 100%;\n max-width: 100%;\n margin-bottom: 0;\n padding: 28px;\n grid-gap: 28px;\n gap: 28px;\n flex-grow: 1;\n}\ndiv.widget-survey-components .question-footer,\ndiv.card-survey-style .question-footer {\n margin: 0px auto;\n justify-content: space-between;\n position: -webkit-sticky;\n position: sticky;\n bottom: 0;\n}\ndiv.widget-survey-components .submit,\ndiv.card-survey-style .submit {\n padding-bottom: 0;\n margin: unset;\n}\ndiv.widget-survey-components .nps-container .footer,\ndiv.card-survey-style .nps-container .footer {\n padding-top: 12px;\n}\ndiv.widget-survey-components .nps-container .widget .choices,\ndiv.card-survey-style .nps-container .widget .choices {\n grid-gap: 8px;\n gap: 8px;\n}\ndiv.widget-survey-components .radio-group,\ndiv.card-survey-style .radio-group {\n width: 100%;\n}\ndiv.widget-survey-components .checkbox-group,\ndiv.card-survey-style .checkbox-group {\n width: 100%;\n flex-wrap: nowrap;\n}\n\ndiv.widget-survey-components .question-container {\n box-shadow: none;\n border-radius: 0;\n}\ndiv.widget-survey-components .question-text {\n font-size: 0.875rem;\n}\ndiv.widget-survey-components .progressbar-container {\n position: absolute;\n}\ndiv.widget-survey-components .progressbar-container .progressbar {\n border-radius: 3px 0 0 0;\n}\ndiv.widget-survey-components .textarea-container .end-max-length {\n padding: 4px;\n}\ndiv.widget-survey-components .responsive-text-field .input-container {\n display: none;\n}\ndiv.widget-survey-components .responsive-text-field .textarea-container {\n display: flex;\n}\ndiv.widget-survey-components div.thankyou {\n min-height: unset;\n}\ndiv.widget-survey-components div.thankyou .text {\n width: 85%;\n}\ndiv.widget-survey-components div.thankyou svg {\n width: 140px;\n height: 120px;\n}\n\ndiv.widget-survey-components.default-style .freemium-survey-step-navigation {\n margin: 0;\n}\ndiv.widget-survey-components.default-style .questions {\n max-height: 400px;\n max-height: var(--default-widget-max-height);\n}\ndiv.widget-survey-components.default-style .question-container {\n padding: 28px;\n}\ndiv.widget-survey-components.default-style .question-footer {\n justify-content: space-between;\n}\ndiv.widget-survey-components.default-style .nps-container .footer {\n padding-top: 12px;\n}\ndiv.widget-survey-components.default-style .nps-container .choices {\n flex-wrap: unset;\n grid-gap: 12px;\n gap: 12px;\n}\ndiv.widget-survey-components.default-style .action-button {\n line-height: 1.2;\n}\ndiv.widget-survey-components.default-style .radio-group {\n flex-direction: row;\n flex-wrap: wrap;\n}\ndiv.widget-survey-components.default-style .radio-group .radio-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n}\ndiv.widget-survey-components.default-style .checkbox-group {\n flex-direction: row;\n flex-wrap: wrap;\n}\ndiv.widget-survey-components.default-style .checkbox-group .checkbox-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n}\ndiv.widget-survey-components.default-style textarea {\n min-height: 84px;\n}\ndiv.widget-survey-components.default-style .end-max-length {\n font-size: 0.8rem;\n font-weight: 300;\n padding: 4px;\n}\n\n.widget-survey-components.cozy-style .freemium-survey-step-navigation {\n margin: 0;\n}\n.widget-survey-components.cozy-style .questions {\n max-height: 380px;\n max-height: var(--cozy-widget-max-height);\n}\n.widget-survey-components.cozy-style .question-text {\n font-size: 1rem;\n}\n.widget-survey-components.cozy-style .question-text.nps {\n text-align: center;\n width: 60%;\n min-width: 600px;\n margin: auto;\n}\n.widget-survey-components.cozy-style .question-container {\n padding: 12px 28px;\n}\n.widget-survey-components.cozy-style .question-footer {\n justify-content: space-between;\n}\n.widget-survey-components.cozy-style .nps-container {\n grid-gap: 44px;\n gap: 44px;\n}\n.widget-survey-components.cozy-style .nps-container .widget {\n display: flex;\n justify-content: center;\n}\n.widget-survey-components.cozy-style .nps-container .button-container {\n width: 60%;\n min-width: 600px;\n margin: 0 auto;\n}\n.widget-survey-components.cozy-style .nps-container .button-container .choices {\n justify-content: space-around;\n}\n.widget-survey-components.cozy-style .nps-container .footer {\n padding-top: 8px;\n}\n.widget-survey-components.cozy-style .action-button {\n line-height: 1.2;\n}\n.widget-survey-components.cozy-style .radio-group {\n flex-direction: row;\n flex-wrap: wrap;\n}\n.widget-survey-components.cozy-style .radio-group .radio-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n}\n.widget-survey-components.cozy-style .checkbox-group {\n flex-direction: row;\n flex-wrap: wrap;\n}\n.widget-survey-components.cozy-style .checkbox-group .checkbox-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n}\n.widget-survey-components.cozy-style textarea {\n min-height: 60px;\n}\n.widget-survey-components.cozy-style .end-max-length {\n font-size: 0.8rem;\n font-weight: 300;\n padding: 4px;\n}\n\n.freemium-survey-components.mobile-preview .thankyou .text {\n width: unset;\n}");const C=({thankYouQuestion:e,preview:o,placeholders:r,npsValue:i})=>(n.useEffect((()=>{o||e.type_info.meta?.redirectUrl&&setTimeout((()=>{window.location.href=e.type_info.meta?.redirectUrl}),e.type_info.meta?.redirectDelay??1e4)}),[]),t.createElement("div",{className:"question-container thankyou"},t.createElement("div",{className:"heading"},"Thank you!"),t.createElement("div",{className:"text",dangerouslySetInnerHTML:{__html:_(e.text,r,i)}}),e.type_info.meta?.redirectUrl&&t.createElement("div",{style:{width:"100%"}},t.createElement("div",{className:"redirection-text"},"You will be redirected to the below URL automatically in"," ",e.type_info.meta?.redirectDelay," seconds.",t.createElement("br",null)),t.createElement("a",{className:"link",href:e.type_info.meta?.redirectUrl},e?.type_info.meta?.redirectUrl)))),z=({currentBlockIndex:e,currentBlockIndexOfBlocksWithQns:n,blocksWithQns:o,blocks:r,setHorizontalScrollUnits:i,preventQuestionAnimation:s,tempCurrentBlockIndexOfBlocksWithQns:a,setReverse:c,reverse:u})=>t.createElement("div",{className:"freemium-survey-step-navigation","data-navigation-element":"1"},t.createElement("button",{disabled:0==n.current,className:"navigation-button",onClick:()=>{u?n.current=Math.max(n.current-1,0):a.current=Math.max(n.current-1,0),s.current=!1,c(!0),i(n.current)}},t.createElement(q,null)),t.createElement("button",{className:"navigation-button",disabled:n.current>=o.length-1,onClick:()=>{s.current=!1,u?a.current=Math.min(n.current+1,o.length-1):n.current=Math.min(n.current+1,o.length-1),c(!1),i(n.current)}},t.createElement(k,null))),N=({widget:e,widgetStyle:n,surveyStyle:o,formValues:r,blocksWithQns:i,blocks:s,thankYouQuestion:a,currentBlockIndexOfBlocksWithQns:u,currentBlockIndexOfBlocks:l,currentEditingBlock:d,isSubmitting:p,isValuesCommitted:m,isCurrentBlockFinal:f,setHorizontalScrollUnits:v,handleFormValues:y,skipBlock:g,setIsSubmitting:x,onSubmit:h,setIsSurveyCompleted:b,preventQuestionAnimation:k,preview:q,closePreview:E,setReverse:_,tempCurrentBlockIndexOfBlocksWithQns:C,question:N,reverse:S,othersMeta:B,...I})=>{const R=I.blockIndex??u.current,O=()=>!c.includes(N.type_info.question_type)&&!f(),T=()=>"RANGE"!==N.type_info.question_type&&!N.required&&!f(),F=()=>"DROPDOWN"===N.type_info.question_type&&!N.required&&null!=r[N.name],Q=()=>f()&&(e||"standard"!==o),$="MULTI_SELECT"===d.current.question.type_info.question_type&&r[d.current.question.name]?.includes("others")&&(!B[d.current.question.name]||""===B[d.current.question.name]);return t.createElement("div",{className:"question-footer"},!(!e&&"standard"===o||0===R&&!r[N.name]||"compact"===n)&&t.createElement(z,{currentBlockIndex:l,currentBlockIndexOfBlocksWithQns:u,blocksWithQns:i,blocks:s,setHorizontalScrollUnits:v,preventQuestionAnimation:k,setReverse:_,tempCurrentBlockIndexOfBlocksWithQns:C,reverse:S}),(O()||F()||T()||Q())&&t.createElement("div",{className:"action-buttons"},O()&&t.createElement(w,{onClick:()=>{_(!1),y(i[R],null,!0)},disabled:d.current.question.required&&(!r[d.current.question.name]||Array.isArray(r[d.current.question.name])&&0===r[d.current.question.name].length)||d.current.question.type_info.meta?.othersRequired&&$,className:"next-button"},"Next"),T()&&t.createElement("button",{className:"skip-button",onClick:()=>{_(!1),g(N)}},"Skip"),Q()&&t.createElement("div",{className:"submit"},t.createElement(w,{disabled:(d.current.question.required||d.current.question.type_info.pivot_question)&&(null==r[d.current.question.name]||0===r[d.current.question.name]?.length)||d.current.question.type_info.meta?.othersRequired&&$||p,onClick:()=>{x(!0),h({...r,others_meta:B},(()=>{a?.type_info.meta?.skipThankYouPage?q?setTimeout((()=>{E?.()}),300):window.location.href=a?.type_info.meta?.redirectUrl:b(!0)}))}},p?"Submitting":"Submit Survey")),F()&&t.createElement("button",{className:"skip-button",onClick:()=>{d.current=i[R],l.current=s.findIndex((e=>e.name===i[R].name)),g(N)}},"Clear selection")))},S=({survey:e,surveyStyle:r="standard",placeholders:i,onSubmit:s,widget:a,npsValue:u,widgetStyle:l,widgetNavigatorQuerySelector:d,preview:p,mobilePreview:m,closePreview:f})=>{const v=e.question_details?.questions||[],y=e.meta?.blocks||[],[g,x]=n.useState(null),[b,w]=n.useState({}),[k,q]=n.useState(!1),[z,S]=n.useState([]),[B,I]=n.useState(0),[R,O]=n.useState(!1),[T,F]=n.useState(null),[Q,$]=n.useState({}),L=n.useRef(null),V=n.useRef(null),A=n.useRef(-1),D=n.useRef(null),j=n.useRef(0),U=n.useRef(0),H=n.useRef(!1),Y=n.useRef([]),M=t.useRef(!!u&&"card"===r),P=n.useRef(null),W=n.useRef(0),[G,X]=n.useState(!1);n.useEffect((()=>{y&&(P.current=y.find((e=>"TY"===e.name)),x(y.filter((e=>"TY"!==e.name))))}),[y]),n.useEffect((()=>{U.current=W.current,g&&z&&(j.current=g.findIndex((e=>e.name===z[W.current].name))),I(B+1)}),[G]),n.useEffect((()=>{if(g)if(V.current=v.find((e=>e.type_info?.pivot_question))??v.find((e=>"RANGE"===e.type_info?.question_type))??v[0],null!=u){A.current=u;const e=v.find((e=>e.name===g[0].question_names[0]));L.current={...g[0],question:e},Y.current=[...Y.current,{...g[0],question:e}],S(Y.current),w({Q_1:u})}else if(!L.current&&g.length>0)return L.current=g[0],void K(g[0])}),[g,u]),t.useEffect((()=>{z.length&&(Y.current=z,U.current=z.length-1),I(z.length-1)}),[z]),n.useEffect((()=>{Object.keys(b).length>0&&L.current.question&&(c.includes(L.current.question.type_info.question_type)||H.current)&&!Z()&&J()}),[b]),n.useEffect((()=>{if(null!=b?.[V.current?.name])if(P.current?.is_based_on_rating){const e=V.current?.type_info?.choices[b?.[V.current?.name]]?.dependent_question_names,n=P.current?.question_names.find((n=>e?.includes(n))),t=v.find((e=>e.name===n));F(t)}else{const e=v.find((e=>e.name==P.current?.question_names[0]));F(e)}}),[b?.[V.current?.name]]);const Z=()=>(j.current===g.length-1||"end"===L.current.branchOption)&&U.current===z.length-1,K=e=>{let n={};if(e.is_based_on_rating){const t=V.current?.type_info?.choices[b?.[V.current?.name]]?.dependent_question_names,o=e.question_names.find((e=>t?.includes(e)));n=v.find((e=>e.name===o))}else n=v.find((n=>n.name===e.question_names[0]));L.current.question=n;Y.current.find((e=>e.question.name===n.name))?(I(B+1),U.current+=1):S([...Y.current,{...e,question:n}])},J=()=>{if(Z())q(!0);else{if(L.current.nextBlock)j.current=g.findIndex((e=>e.name===L.current.nextBlock));else if(L.current.question.type_info?.meta?.branches){const e=L.current.question.type_info?.meta?.branches,n=b[L.current.question.name];let t;if(t="RANGE"===L.current.question.type_info.question_type?e.find((e=>n>=e.min&&n<=e.max)):e.find((e=>n===e.value)),t?.nextBlock){if("TY"===t.nextBlock)return void q(!0);j.current=g.findIndex((e=>e.name===t.nextBlock))}else j.current+=1}else j.current+=1;L.current=g[j.current],K(g[j.current])}},ee=(e,n,t)=>{if(M.current=!1,t){if(H.current=!0,null!=b[e.question.name]&&e.name!==z[z.length-1].name){const[t,o]=(e=>{const n=z.findIndex((n=>n.name===e.name)),t=z.slice(0,n+1),o=t.reduce(((e,n)=>(e[n.question.name]=b[n.question.name],e)),{});return j.current=g.findIndex((n=>n.name===e.name)),[t,o]})(e);w({...o,...null!=n&&{[e.question.name]:n}}),Y.current=t}else w({...b,...null!=n&&{[e.question.name]:n}});V?.current?.name==e?.question?.name&&(A.current=n)}else w({...b,...null!=n&&{[e.question.name]:n}})};if(!L.current||!L.current.question)return null;const ne=z[U.current];return t.createElement("div",{className:`freemium-survey-components ${a?"widget-survey-components":""} ${l}-style ${m?"mobile-preview":""} ${r}-survey-style`,id:"freemium-survey"},t.createElement(h,{totalSteps:g.length,completedSteps:j.current+(k?1:0)}),t.createElement(o.SwitchTransition,{mode:"out-in"},t.createElement(o.CSSTransition,{key:U.current+String(k),addEndListener:(e,n)=>{e.addEventListener("transitionend",n,!1)},classNames:G?"fade-reverse":"fade"},t.createElement("div",{className:"questions"},k?t.createElement(C,{thankYouQuestion:T,preview:p,placeholders:i,npsValue:A.current}):t.createElement("div",{ref:D,id:`${ne.question.name}`,className:`question-container ${a||"card"===r}`},t.createElement("div",{className:"question-text",dangerouslySetInnerHTML:{__html:_(ne.question.text,i,A.current)},title:`question-${U.current}`,role:"heading","aria-level":1}),t.createElement("div",{onTransitionEndCapture:e=>e.stopPropagation(),style:{width:"100%"}},t.createElement(E,{question:ne.question,formValues:b,othersMeta:Q,autoFocus:!0,autoFocusDelay:"standard"===r?350:0,saveOthersValue:(e,n)=>{$({...Q,[e]:n})},onChangeHandler:e=>{H.current=!1,j.current=g.findIndex((e=>e.name===ne.name)),L.current=ne,X(!1),ee(ne,e,c.includes(ne.question.type_info.question_type)&&!Z())}})),t.createElement(N,{question:ne.question,widget:a,widgetStyle:l,surveyStyle:r,formValues:b,othersMeta:Q,blocksWithQns:z,blocks:g,thankYouQuestion:T,currentBlockIndexOfBlocksWithQns:U,reverse:G,setReverse:X,currentBlockIndexOfBlocks:j,currentEditingBlock:L,isSubmitting:R,isValuesCommitted:H,isCurrentBlockFinal:Z,setHorizontalScrollUnits:I,handleFormValues:ee,skipBlock:e=>{H.current=!0,delete b[e.name],w({...b})},setIsSubmitting:O,onSubmit:s,setIsSurveyCompleted:q,preventQuestionAnimation:M,preview:p,closePreview:f,tempCurrentBlockIndexOfBlocksWithQns:W}))))))};i(":root {\n --default-brand-color: #264966;\n --default-question-text-color: #000;\n --default-question-background-color: #fff;\n --default-background-color: #f8f8f8;\n --default-button-text-color: #fff;\n --default-secondary-button-text-color: #000;\n --default-input-placeholder-color: #92a2b1;\n --compact-widget-max-height: 400px;\n --default-widget-max-height: 460px;\n --cozy-widget-max-height: 380px;\n}\n\n.freemium-survey-step-navigation {\n padding: 0 2px;\n box-shadow: 0px 0px 6px #eee;\n white-space: nowrap;\n}\n.freemium-survey-step-navigation .navigation-button {\n width: 38px;\n text-align: -webkit-center;\n height: 38px;\n background-color: #fff;\n border: none;\n cursor: pointer;\n border-radius: 0 3px 3px 0;\n}\n.freemium-survey-step-navigation .navigation-button:first-of-type {\n border-right: 1px solid #d9d9d9;\n border-radius: 3px 0 0 3px;\n}\n.freemium-survey-step-navigation .navigation-button:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n.freemium-survey-step-navigation .navigation-button:focus {\n position: relative;\n z-index: 1;\n}\n\n.freemium-survey-components .question-container {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n text-align: center;\n max-width: 700px;\n margin: 0 auto;\n background: var(--default-question-background-color);\n background: var(--question-background-color, var(--default-question-background-color));\n border-radius: 4px;\n transition: transform 500ms ease 0ms, opacity 800ms ease 0ms;\n box-shadow: 0px 12px 15px rgba(18, 52, 77, 0.03);\n margin-bottom: 28px;\n padding: 28px;\n grid-gap: 28px;\n gap: 28px;\n position: relative;\n height: -webkit-fit-content;\n height: -moz-fit-content;\n height: fit-content;\n overflow: auto;\n opacity: 1;\n}\n.freemium-survey-components .hide-question-container {\n pointer-events: none;\n opacity: 0;\n}\n.freemium-survey-components .question-text {\n font-size: 1rem;\n font-weight: 600;\n line-height: 1.8;\n width: 100%;\n text-align: left;\n color: var(--default-question-text-color);\n color: var(--question-text-color, var(--default-question-text-color));\n}\n.freemium-survey-components .autofocus-button {\n border: none;\n width: 0;\n height: 0;\n opacity: 0;\n margin-top: -12px;\n margin-left: -12px;\n position: absolute;\n}\n.freemium-survey-components .question-footer {\n display: flex;\n justify-content: flex-end;\n grid-gap: 40px;\n gap: 40px;\n width: 100%;\n align-items: center;\n}\n.freemium-survey-components .question-footer:empty {\n display: none;\n}\n.freemium-survey-components .action-buttons {\n display: flex;\n grid-gap: 20px;\n gap: 20px;\n flex-direction: row-reverse;\n}\n.freemium-survey-components .action-buttons:empty {\n display: none;\n}\n.freemium-survey-components .skip-button {\n font-weight: 400;\n cursor: pointer;\n background: transparent;\n border: none;\n min-width: 40px;\n padding: 8px 16px;\n border-radius: 4px;\n color: var(--default-secondary-button-text-color);\n color: var(--secondary-button-text-color, var(--default-secondary-button-text-color));\n letter-spacing: 0.05rem;\n line-height: 1.5;\n border: 1px solid transparent;\n}\n.freemium-survey-components .skip-button:hover {\n background-color: #f3f3f3;\n}\n.freemium-survey-components .next-button {\n color: var(--default-button-text-color);\n color: var(--button-text-color, var(--default-button-text-color));\n}\n.freemium-survey-components .submit {\n max-width: 700px;\n margin: 0 auto;\n text-align: left;\n background: transparent;\n box-shadow: none;\n padding-bottom: 40px;\n color: var(--default-button-text-color);\n color: var(--button-text-color, var(--default-button-text-color));\n}\n.freemium-survey-components .thankyou {\n display: flex;\n align-items: center;\n justify-content: center;\n grid-gap: 20px;\n gap: 20px;\n min-height: 180px;\n}\n.freemium-survey-components .thankyou .heading {\n font-weight: 600;\n font-size: 28px;\n}\n.freemium-survey-components .thankyou .text {\n white-space: pre-wrap;\n font-weight: 500;\n font-size: 0.875rem;\n line-height: 1.6;\n color: #12344d;\n width: 75%;\n}\n.freemium-survey-components .thankyou .redirection-text {\n color: #929292;\n margin-bottom: 12px;\n font-weight: 300;\n}\n.freemium-survey-components .thankyou .link {\n width: 100%;\n display: inline-block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: #666;\n font-weight: 500;\n text-decoration: underline;\n}\n.freemium-survey-components .responsive-text-field {\n width: 100%;\n}\n.freemium-survey-components .responsive-text-field .textarea-container {\n display: none;\n}\n.freemium-survey-components .message-container:empty {\n display: none;\n}\n\n@media (max-width: 550px) {\n .freemium-survey-component .responsive-text-field .input-container,\n.card-survey-style .responsive-text-field .input-container {\n display: none;\n }\n .freemium-survey-component .responsive-text-field .textarea-container,\n.card-survey-style .responsive-text-field .textarea-container {\n display: flex;\n }\n}\ndiv.widget-survey-components.compact-style .freemium-survey-step-navigation {\n padding: 0 2px;\n margin-left: 4px;\n box-shadow: 0px 0px 6px #eee;\n margin-top: 4px;\n}\ndiv.widget-survey-components.compact-style .nps-container .footer {\n padding-top: 12px;\n}\ndiv.widget-survey-components.compact-style .nps-container .choices {\n grid-gap: 12px;\n gap: 12px;\n}\n\ndiv.widget-survey-components,\ndiv.card-survey-style {\n display: flex;\n flex-direction: column;\n grid-gap: 28px;\n gap: 28px;\n flex-grow: 1;\n font-size: 0.875rem;\n overflow: hidden;\n}\ndiv.widget-survey-components .questions,\ndiv.card-survey-style .questions {\n min-width: 100%;\n max-width: 100%;\n display: flex;\n height: 100%;\n position: relative;\n max-height: 400px;\n max-height: var(--compact-widget-max-height);\n background: var(--default-question-background-color);\n background: var(--question-background-color, var(--default-question-background-color));\n}\ndiv.widget-survey-components .question-text,\ndiv.card-survey-style .question-text {\n width: 100%;\n text-align: left;\n}\ndiv.widget-survey-components .focus-lock,\ndiv.card-survey-style .focus-lock {\n width: 100%;\n}\ndiv.widget-survey-components .question-container,\ndiv.card-survey-style .question-container {\n height: -webkit-fit-content;\n height: -moz-fit-content;\n height: fit-content;\n min-width: 100%;\n max-width: 100%;\n margin-bottom: 0;\n padding: 16px 28px;\n grid-gap: 16px;\n gap: 16px;\n flex-grow: 1;\n}\ndiv.widget-survey-components .question-footer,\ndiv.card-survey-style .question-footer {\n margin: 0px auto;\n justify-content: space-between;\n bottom: 0;\n padding-bottom: 20px;\n}\ndiv.widget-survey-components .submit,\ndiv.card-survey-style .submit {\n padding-bottom: 0;\n margin: unset;\n}\ndiv.widget-survey-components .nps-container .footer,\ndiv.card-survey-style .nps-container .footer {\n padding-top: 12px;\n}\ndiv.widget-survey-components .nps-container .widget .choices,\ndiv.card-survey-style .nps-container .widget .choices {\n grid-gap: 8px;\n gap: 8px;\n}\ndiv.widget-survey-components .radio-group,\ndiv.card-survey-style .radio-group {\n width: 100%;\n}\ndiv.widget-survey-components .checkbox-group,\ndiv.card-survey-style .checkbox-group {\n width: 100%;\n flex-wrap: nowrap;\n}\n\ndiv.widget-survey-components .question-container {\n box-shadow: none;\n border-radius: 0;\n}\ndiv.widget-survey-components .question-text {\n font-size: 0.875rem;\n}\ndiv.widget-survey-components .progressbar-container {\n position: absolute;\n}\ndiv.widget-survey-components .progressbar-container .progressbar {\n border-radius: 3px 0 0 0;\n}\ndiv.widget-survey-components .textarea-container .end-max-length {\n padding: 4px;\n}\ndiv.widget-survey-components .responsive-text-field .input-container {\n display: none;\n}\ndiv.widget-survey-components .responsive-text-field .textarea-container {\n display: flex;\n}\ndiv.widget-survey-components div.thankyou {\n min-height: unset;\n}\ndiv.widget-survey-components div.thankyou .text {\n width: 85%;\n}\ndiv.widget-survey-components div.thankyou svg {\n width: 140px;\n height: 120px;\n}\n\ndiv.widget-survey-components.default-style .freemium-survey-step-navigation {\n margin: 0;\n}\ndiv.widget-survey-components.default-style .questions {\n max-height: 460px;\n max-height: var(--default-widget-max-height);\n}\ndiv.widget-survey-components.default-style .question-container {\n padding: 12px 28px;\n}\ndiv.widget-survey-components.default-style .question-footer {\n justify-content: space-between;\n}\ndiv.widget-survey-components.default-style .nps-container .footer {\n padding-top: 12px;\n}\ndiv.widget-survey-components.default-style .nps-container .choices {\n flex-wrap: unset;\n grid-gap: 12px;\n gap: 12px;\n}\ndiv.widget-survey-components.default-style .action-button {\n line-height: 1.2;\n}\ndiv.widget-survey-components.default-style .radio-group {\n flex-direction: row;\n flex-wrap: wrap;\n}\ndiv.widget-survey-components.default-style .radio-group .radio-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n}\ndiv.widget-survey-components.default-style .checkbox-group {\n flex-direction: row;\n flex-wrap: wrap;\n}\ndiv.widget-survey-components.default-style .checkbox-group .checkbox-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n}\ndiv.widget-survey-components.default-style textarea {\n min-height: 84px;\n}\ndiv.widget-survey-components.default-style .end-max-length {\n font-size: 0.8rem;\n font-weight: 300;\n padding: 4px;\n}\n\n.widget-survey-components.cozy-style .freemium-survey-step-navigation {\n margin: 0;\n}\n.widget-survey-components.cozy-style .questions {\n max-height: 380px;\n max-height: var(--cozy-widget-max-height);\n}\n.widget-survey-components.cozy-style .question-text {\n font-size: 1rem;\n}\n.widget-survey-components.cozy-style .question-text.nps {\n text-align: center;\n width: 60%;\n min-width: 600px;\n margin: auto;\n}\n.widget-survey-components.cozy-style .question-container {\n padding: 12px 28px;\n}\n.widget-survey-components.cozy-style .question-footer {\n justify-content: space-between;\n}\n.widget-survey-components.cozy-style .nps-container {\n grid-gap: 44px;\n gap: 44px;\n}\n.widget-survey-components.cozy-style .nps-container .widget {\n display: flex;\n justify-content: center;\n}\n.widget-survey-components.cozy-style .nps-container .button-container {\n width: 60%;\n min-width: 600px;\n margin: 0 auto;\n}\n.widget-survey-components.cozy-style .nps-container .button-container .choices {\n justify-content: space-around;\n}\n.widget-survey-components.cozy-style .nps-container .footer {\n padding-top: 8px;\n}\n.widget-survey-components.cozy-style .action-button {\n line-height: 1.2;\n}\n.widget-survey-components.cozy-style .radio-group {\n flex-direction: row;\n flex-wrap: wrap;\n}\n.widget-survey-components.cozy-style .radio-group .radio-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n}\n.widget-survey-components.cozy-style .checkbox-group {\n flex-direction: row;\n flex-wrap: wrap;\n}\n.widget-survey-components.cozy-style .checkbox-group .checkbox-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n}\n.widget-survey-components.cozy-style textarea {\n min-height: 60px;\n}\n.widget-survey-components.cozy-style .end-max-length {\n font-size: 0.8rem;\n font-weight: 300;\n padding: 4px;\n}\n\n.freemium-survey-components.mobile-preview .thankyou .text {\n width: unset;\n}");const B=({thankYouQuestion:e,preview:o,placeholders:r,npsValue:i})=>(n.useEffect((()=>{o||e.type_info.meta?.redirectUrl&&setTimeout((()=>{window.location.href=e.type_info.meta?.redirectUrl}),1e3*(e.type_info.meta?.redirectDelay??1e4))}),[]),t.createElement("div",{className:"question-container thankyou"},t.createElement("div",{className:"heading"},"Thank you!"),t.createElement("div",{className:"text",dangerouslySetInnerHTML:{__html:_(e.text,r,i)}}),e.type_info.meta?.redirectUrl&&t.createElement("div",{style:{width:"100%"}},t.createElement("div",{className:"redirection-text"},"You will be redirected to the below URL automatically in"," ",e.type_info.meta?.redirectDelay," seconds.",t.createElement("br",null)),t.createElement("a",{className:"link",href:e.type_info.meta?.redirectUrl},e?.type_info.meta?.redirectUrl)))),I=({currentBlockIndex:e,currentBlockIndexOfBlocksWithQns:n,blocksWithQns:o,blocks:r,setHorizontalScrollUnits:i,preventQuestionAnimation:s})=>t.createElement("div",{className:"freemium-survey-step-navigation","data-navigation-element":"1"},t.createElement("button",{disabled:0==n.current,className:"navigation-button",onClick:()=>{n.current=Math.max(n.current-1,0),e.current=r.findIndex((e=>e.name===o[n.current].name)),s.current=!1,i(n.current)}},t.createElement(q,null)),t.createElement("button",{className:"navigation-button",disabled:n.current>=o.length-1,onClick:()=>{s.current=!1,n.current=Math.min(n.current+1,o.length-1),e.current=r.findIndex((e=>e.name===o[n.current].name)),i(n.current)}},t.createElement(k,null))),R=({widget:e,widgetStyle:n,surveyStyle:o,formValues:r,othersMeta:i,blocksWithQns:s,blocks:a,thankYouQuestion:u,currentBlockIndexOfBlocksWithQns:l,currentBlockIndexOfBlocks:d,currentEditingBlock:p,isSubmitting:m,isValuesCommitted:f,isCurrentBlockFinal:v,setHorizontalScrollUnits:y,handleFormValues:g,skipBlock:x,setIsSubmitting:h,onSubmit:b,setIsSurveyCompleted:k,preventQuestionAnimation:q,preview:E,closePreview:_,...C})=>{const z=C.blockIndex??l.current,N=C.question??s[z].question,S=()=>N.name===p.current.question.name&&!c.includes(N.type_info.question_type)&&!v(),B=()=>"RANGE"!==N.type_info.question_type&&!N.required&&N.name===p.current.question.name&&!v(),R=()=>"DROPDOWN"===N.type_info.question_type&&N.name!==p.current.question.name&&!N.required&&null!=r[N.name],O=()=>v()&&(e||"standard"!==o)&&N.name===p.current.question.name,T="MULTI_SELECT"===p.current.question.type_info.question_type&&r[p.current.question.name]?.includes("others")&&(!i[p.current.question.name]||""===i[p.current.question.name]);return t.createElement("div",{className:"question-footer"},!(!e&&"standard"===o||0===z&&!r[N.name]||"compact"===n)&&t.createElement(I,{currentBlockIndex:d,currentBlockIndexOfBlocksWithQns:l,blocksWithQns:s,blocks:a,setHorizontalScrollUnits:y,preventQuestionAnimation:q}),(S()||R()||B()||O())&&t.createElement("div",{className:"action-buttons"},S()&&t.createElement(w,{onClick:()=>{g(s[z],null,!0)},disabled:p.current.question.required&&(!r[p.current.question.name]||Array.isArray(r[p.current.question.name])&&0===r[p.current.question.name].length)||p.current.question.type_info.meta?.othersRequired&&T,className:"next-button"},"Next"),B()&&t.createElement("button",{className:"skip-button",onClick:()=>x(N)},"Skip"),R()&&t.createElement("button",{className:"skip-button",onClick:()=>{p.current=s[z],d.current=a.findIndex((e=>e.name===s[z].name)),x(N)}},"Clear selection"),O()&&t.createElement("div",{className:"submit"},t.createElement(w,{disabled:(p.current.question.required||p.current.question.type_info.pivot_question)&&(null==r[p.current.question.name]||0===r[p.current.question.name]?.length)||p.current.question.type_info.meta?.othersRequired&&T||m,onClick:()=>{h(!0),b({...r,others_meta:i},(()=>{u?.type_info.meta?.skipThankYouPage?E?setTimeout((()=>{_?.()}),300):window.location.href=u?.type_info.meta?.redirectUrl:k(!0)}))}},m?"Submitting":"Submit Survey"))))},O=({survey:e,surveyStyle:o="standard",placeholders:i,onSubmit:s,widget:a,npsValue:u,widgetStyle:l,widgetNavigatorQuerySelector:d,preview:p,mobilePreview:m,closePreview:f})=>{const v=e.question_details?.questions||[],y=e.meta?.blocks||[],[g,x]=n.useState(null),[b,k]=n.useState({}),[q,C]=n.useState(!1),[z,N]=n.useState([]),[S,O]=n.useState(0),[T,F]=n.useState(!1),[Q,$]=n.useState(null),[L,V]=n.useState({}),A=n.useRef(null),D=n.useRef(null),j=n.useRef(-1),U=n.useRef(null),H=n.useRef(0),Y=n.useRef(0),M=n.useRef(!1),P=n.useRef([]),W=n.useRef(!!u&&"card"===o),G=n.useRef(null),X=n.useRef([]);n.useEffect((()=>{y&&(G.current=y.find((e=>"TY"===e.name)),x(y.filter((e=>"TY"!==e.name))))}),[y]),n.useEffect((()=>{if(g)if(D.current=v.find((e=>e.type_info?.pivot_question))??v.find((e=>"RANGE"===e.type_info?.question_type))??v[0],null!=u){j.current=u;const e=v.find((e=>e.name===g[0].question_names[0]));A.current={...g[0],question:e},P.current=[...P.current,{...g[0],question:e}],N(P.current),k({Q_1:u})}else if(!A.current&&g.length>0)return A.current=g[0],void K(g[0])}),[g,u]),n.useEffect((()=>{z.length&&(P.current=z,Y.current=z.length-1),a||"standard"!==o?(U.current&&(U.current.style.maxHeight="unset"),X.current[H.current]=U.current?.scrollHeight||X.current[H.current]||0,U.current&&(U.current.style.maxHeight="100%")):U.current?.scrollIntoView({block:"center",behavior:"smooth"}),O(z.length-1)}),[z]),n.useEffect((()=>{Object.keys(b).length>0&&A.current.question&&(c.includes(A.current.question.type_info.question_type)||M.current)&&!Z()&&J()}),[b]),n.useEffect((()=>{if(null!=b?.[D.current?.name])if(G.current?.is_based_on_rating){const e=D.current?.type_info?.choices[b?.[D.current?.name]]?.dependent_question_names,n=G.current?.question_names.find((n=>e?.includes(n))),t=v.find((e=>e.name===n));$(t)}else{const e=v.find((e=>e.name==G.current?.question_names[0]));$(e)}}),[b?.[D.current?.name]]);const Z=()=>H.current===g.length-1||"end"===A.current.branchOption,K=e=>{let n={};if(e.is_based_on_rating){const t=D.current?.type_info?.choices[b?.[D.current?.name]]?.dependent_question_names,o=e.question_names.find((e=>t?.includes(e)));n=v.find((e=>e.name===o))}else n=v.find((n=>n.name===e.question_names[0]));A.current.question=n;P.current.find((e=>e.question.name===n.name))?(O(S+1),Y.current+=1):N([...P.current,{...e,question:n}])},J=()=>{if(Z())C(!0);else{if(A.current.nextBlock)H.current=g.findIndex((e=>e.name===A.current.nextBlock));else if(A.current.question.type_info?.meta?.branches){const e=A.current.question.type_info?.meta?.branches,n=b[A.current.question.name];let t;if(t="RANGE"===A.current.question.type_info.question_type?e.find((e=>n>=e.min&&n<=e.max)):e.find((e=>n===e.value)),t?.nextBlock){if("TY"===t.nextBlock)return void C(!0);H.current=g.findIndex((e=>e.name===t.nextBlock))}else H.current+=1}else H.current+=1;A.current=g[H.current],K(g[H.current])}},ee=e=>{M.current=!0,delete b[e.name],k({...b})},ne=(e,n,t)=>{if(W.current=!1,t){if(M.current=!0,null!=b[e.question.name]&&e.name!==z[z.length-1].name){const[t,o]=(e=>{const n=z.findIndex((n=>n.name===e.name)),t=z.slice(0,n+1),o=t.reduce(((e,n)=>(e[n.question.name]=b[n.question.name],e)),{});return H.current=g.findIndex((n=>n.name===e.name)),[t,o]})(e);k({...o,...null!=n&&{[e.question.name]:n}}),P.current=t}else k({...b,...null!=n&&{[e.question.name]:n}});D?.current?.name==e?.question?.name&&(j.current=n)}else k({...b,...null!=n&&{[e.question.name]:n}})},te=(e,n)=>{V({...L,[e]:n})};return A.current&&A.current.question?q?t.createElement("div",{className:`freemium-survey-components ${a?"widget-survey-components":""} ${l}-style ${m?"mobile-preview":""} ${o}-survey-style`,id:"freemium-survey"},t.createElement(B,{thankYouQuestion:Q,preview:p,placeholders:i,npsValue:j.current})):t.createElement("div",{className:`freemium-survey-components ${a?"widget-survey-components":""} ${l}-style ${m?"mobile-preview":""} ${o}-survey-style`,id:"freemium-survey"},t.createElement(h,{totalSteps:g.length,completedSteps:H.current}),a&&"compact"===l&&document.querySelector(d)&&t.createElement(t.Fragment,null,r.createPortal(t.createElement("div",null,t.createElement(I,{currentBlockIndex:H,currentBlockIndexOfBlocksWithQns:Y,blocksWithQns:z,blocks:g,setHorizontalScrollUnits:O,preventQuestionAnimation:W})),document.querySelector(d))),t.createElement("div",{style:a||"card"===o?{transform:`translateX(calc(-${S} * 100%))`,height:`${X.current[H.current]}px`,transition:W.current||z?.length<=1?"none":"all 600ms ease-out 0ms"}:{},className:"questions"},z.map(((e,n)=>t.createElement("div",{key:e.question.name,ref:U,className:"question-container "+(!a&&"card"!==o||Y.current===n?"":"hide-question-container")},t.createElement("div",{className:"question-text "+(0===n?"nps":""),dangerouslySetInnerHTML:{__html:_(e.question.text,i,j.current)},title:`question-${n}`,role:"heading","aria-level":1}),t.createElement("button",{disabled:!a&&"standard"===o,className:"autofocus-button",onKeyDown:e=>{"Tab"===e.key&&(e.stopPropagation(),e.preventDefault())}}),t.createElement(E,{question:e.question,formValues:b,othersMeta:L,autoFocus:Y.current===n,autoFocusDelay:"standard"===o?350:20,saveOthersValue:te,onChangeHandler:n=>{M.current=!1,H.current=g.findIndex((n=>n.name===e.name)),A.current=e,ne(e,n,c.includes(e.question.type_info.question_type)&&!Z())}}),t.createElement("button",{disabled:!a&&"standard"===o,className:"autofocus-button",onKeyDown:e=>{"Tab"===e.key&&(e.stopPropagation(),e.preventDefault())}}),t.createElement(R,{question:e.question,blockIndex:n,widget:a,widgetStyle:l,surveyStyle:o,formValues:b,othersMeta:L,blocksWithQns:z,blocks:g,thankYouQuestion:Q,currentBlockIndexOfBlocksWithQns:Y,currentBlockIndexOfBlocks:H,currentEditingBlock:A,isSubmitting:T,isValuesCommitted:M,isCurrentBlockFinal:Z,setHorizontalScrollUnits:O,handleFormValues:ne,skipBlock:ee,setIsSubmitting:F,onSubmit:s,setIsSurveyCompleted:C,preventQuestionAnimation:W,preview:p,closePreview:f})))),!a&&"card"!==o&&Z()&&t.createElement("div",{className:"submit"},t.createElement(w,{disabled:(A.current.question.required||A.current.question.type_info.pivot_question)&&(null==b[A.current.question.name]||0===b[A.current.question.name]?.length)||A.current.question.type_info.meta?.othersRequired&&"MULTI_SELECT"===A.current.question.type_info.question_type&&b[A.current.question.name]?.includes("")||T,onClick:()=>{F(!0),s({...b,others_meta:L},(()=>{Q?.type_info.meta?.skipThankYouPage?p?setTimeout((()=>{f?.()}),300):window.location.href=Q?.type_info.meta?.redirectUrl:C(!0)}))}},T?"Submitting":"Submit Survey")))):null};exports.BUTTON_SIZE_VARIANTS={LARGE:"large",MINI:"mini",NORMAL:"normal"},exports.Button=w,exports.CheckboxGroup=v,exports.Input=p,exports.NPS=s,exports.ProgressBar=h,exports.Radio=x,exports.RadioGroup=g,exports.Survey=e=>{const{survey:o}=e,r=n.useMemo((()=>{const e=JSON.parse(JSON.stringify(o)),n=[];return(e.question_details?.questions||[]).forEach((e=>{const t=e.type_info?.meta?.block;t&&(t.question_names||(t.question_names=[e.name]),n.push(t))})),{...e,meta:{...e.meta,blocks:n}}}),[o]);return t.createElement(t.Fragment,null,"standard"===e.surveyStyle||e.widget?t.createElement(O,Object.assign({},e,{survey:r})):t.createElement(S,Object.assign({},e,{survey:r})))},exports.TextArea=m;
package/lib/index.esm.js CHANGED
@@ -1 +1 @@
1
- import e,{useRef as n,forwardRef as t,useEffect as o,useState as r,useMemo as i}from"react";import{SwitchTransition as a,CSSTransition as s}from"react-transition-group";import c from"react-dom";function u(e,n){void 0===n&&(n={});var t=n.insertAt;if(e&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===t&&o.firstChild?o.insertBefore(r,o.firstChild):o.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}u(".freemium-survey-components .nps-container {\n margin: 0 auto;\n width: 100%;\n display: flex;\n flex-direction: column;\n grid-gap: 28px;\n gap: 28px;\n}\n.freemium-survey-components .nps-container .footer {\n border-top: 1px solid var(--default-background-color);\n border-top: 1px solid var(--background-color, var(--default-background-color));\n padding-top: 20px;\n display: flex;\n justify-content: center;\n font-size: 0.875rem;\n line-height: 1.5;\n color: #666;\n}\n.freemium-survey-components .nps-container .footer:empty {\n display: none;\n}\n.freemium-survey-components .nps-container .nps-scale {\n position: relative;\n}\n.freemium-survey-components .nps-container .nps-scale .button-container {\n display: flex;\n border-radius: 4px;\n justify-content: space-between;\n background: var(--default-background-color);\n background: var(--background-color, var(--default-background-color));\n position: relative;\n margin-bottom: 40px;\n}\n.freemium-survey-components .nps-container .nps-scale .positive-text {\n position: absolute;\n color: #475867;\n bottom: -40px;\n font-size: 12px;\n right: 0px;\n text-align: right;\n}\n.freemium-survey-components .nps-container .nps-scale .negative-text {\n position: absolute;\n color: #475867;\n bottom: -40px;\n font-size: 12px;\n left: 0;\n text-align: left;\n}\n.freemium-survey-components .nps-container .nps-scale span {\n color: #aaa;\n font-size: 0.75rem;\n}\n.freemium-survey-components .nps-container .nps-scale button {\n display: inline-block;\n font-size: 1rem;\n white-space: nowrap;\n vertical-align: middle;\n background: none;\n border: none;\n box-shadow: none;\n cursor: pointer;\n text-align: center;\n font-weight: 400;\n border-radius: 4px;\n margin: 0;\n outline: none;\n margin-left: -1px;\n width: 40px;\n height: 40px;\n transform: scale(1);\n}\n.freemium-survey-components .nps-container .nps-scale button:hover {\n transition: background 0.2s ease-in, color 0.2s ease-in, border-color 0.2s ease-in, transform 0.2s cubic-bezier(0.5, 2, 0.5, 0.75);\n}\n.freemium-survey-components .nps-container .nps-scale button:hover, .freemium-survey-components .nps-container .nps-scale button:focus {\n color: white;\n transform: scale(1.2);\n z-index: 2;\n position: relative;\n}\n.freemium-survey-components .nps-container .nps-scale button.active {\n color: white;\n transform: scale(1.2);\n z-index: 2;\n position: relative;\n}\n.freemium-survey-components .nps-container .nps-scale.rounded button {\n border-radius: 50%;\n}\n.freemium-survey-components .nps-container .nps-scale.square button {\n border-radius: 0;\n}\n.freemium-survey-components .nps-container .nps-scale.curved button {\n border-radius: 3px;\n}\n.freemium-survey-components .nps-container .nps-scale.highlighted button:hover, .freemium-survey-components .nps-container .nps-scale.highlighted button:focus, .freemium-survey-components .nps-container .nps-scale.highlighted button.active {\n background: var(--default-brand-color) !important;\n background: var(--brand-color, var(--default-brand-color)) !important;\n}\n.freemium-survey-components .nps-container .nps-scale .choices {\n width: 100%;\n display: flex;\n justify-content: space-between;\n font-weight: 500;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .button-container {\n background-color: transparent;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice {\n background: #E43E3D;\n color: #fff;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(1), .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(2) {\n background: #00AF50;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(3), .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(4) {\n background: #F8C43E;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:hover, .freemium-survey-components .nps-container .nps-scale.standard .choice:focus, .freemium-survey-components .nps-container .nps-scale.standard .choice.active {\n transform: scale(1.2);\n}\n\n.freemium-survey-components.mobile-preview .nps-container .nps-scale .button-container {\n background: transparent;\n}\n.freemium-survey-components.mobile-preview .nps-container .nps-scale .choices {\n flex-wrap: wrap;\n justify-content: center;\n grid-gap: 16px;\n gap: 16px;\n background: transparent;\n}\n.freemium-survey-components.mobile-preview .nps-container .nps-scale button {\n border-radius: 50%;\n background: #ebeff3;\n}\n\n@media (max-width: 550px) {\n .freemium-survey-components .nps-container .nps-scale .button-container,\n.card-survey-style .nps-container .nps-scale .button-container {\n background: transparent;\n }\n .freemium-survey-components .nps-container .nps-scale .choices,\n.card-survey-style .nps-container .nps-scale .choices {\n flex-wrap: wrap;\n justify-content: center;\n grid-gap: 16px;\n gap: 16px;\n background: transparent;\n }\n .freemium-survey-components .nps-container .nps-scale button,\n.card-survey-style .nps-container .nps-scale button {\n border-radius: 50%;\n background: #ebeff3;\n }\n}\n.widget-survey-components .nps-container .nps-scale .button-container {\n background: transparent;\n}\n.widget-survey-components .nps-container .nps-scale .choices {\n flex-wrap: wrap;\n justify-content: center;\n grid-gap: 16px;\n gap: 16px;\n background: transparent;\n}\n.widget-survey-components .nps-container .nps-scale button {\n border-radius: 50%;\n background: #ebeff3;\n}");const l=t=>{const{type_info:{linear_scale:{button_style:o="highlighted",button_shape:r="rounded"}={},score_presets:{start:i="Very unlikely",end:a="Very likely"}={},validation:{min:s},footer_text:c}}=t,u=e=>{switch(e){case e<=6:return"detractor";case e<=8:return"passive";default:return"promoter"}},l=n(Array.from({length:10+(0===s?1:0)},((e,n)=>n+s)));return e.createElement("div",{className:"nps-container","data-test-input":"nps"},e.createElement("div",{className:`nps-scale ${r} ${o}`},e.createElement("div",{className:"button-container"},e.createElement("span",{className:"negative-text",role:"note"},`${s} - ${i}`),e.createElement("span",{className:"positive-text",role:"note"},`${l.current[l.current.length-1]} - ${a}`),e.createElement("div",{className:"choices",role:"radiogroup","aria-required":!0},l.current.map((n=>e.createElement("button",{role:"radio","aria-checked":t.npsValue===n,key:n,"data-test-nps-choice":n,onClick:e=>{t.onChangeHandler(n)},className:`choice ${u(n)} ${t.npsValue===n&&"active"}`},n)))))),e.createElement("div",{className:"footer",role:"note"},c))},d=(e,n)=>(e.defaultProps=n,e);u('.freemium-survey-components .input-container,\n.freemium-survey-components .textarea-container {\n display: flex;\n flex-direction: column;\n width: 100%;\n border-radius: 4px;\n position: relative;\n}\n.freemium-survey-components label.input-label {\n display: inline-block;\n padding-bottom: 8px;\n padding-left: 2px;\n font-size: 0.75rem;\n font-weight: 400;\n}\n.freemium-survey-components label.required::after {\n content: "*";\n position: relative;\n top: 2px;\n font-weight: 500;\n font-size: 0.85rem;\n padding-left: 3px;\n color: #d72d30;\n}\n.freemium-survey-components .input-basic {\n width: 100%;\n display: flex;\n align-items: center;\n border-radius: 4px;\n border: 1px solid var(--default-brand-color);\n border: 1px solid var(--brand-color, var(--default-brand-color));\n transition: border-color 0.2s linear;\n background: #fff;\n}\n.freemium-survey-components .textarea-container .input-basic {\n flex-direction: column;\n align-items: unset;\n}\n.freemium-survey-components .input-basic.error {\n border: 1px solid #d72d30;\n}\n.freemium-survey-components .input-basic.error:hover {\n border: 1px solid #d72d30;\n}\n.freemium-survey-components .input-basic.error[focus-within] {\n box-shadow: none;\n}\n.freemium-survey-components .input-basic.error:focus-within {\n box-shadow: none;\n}\n.freemium-survey-components .input-basic:hover {\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n transition: 0.2s linear;\n}\n.freemium-survey-components .input-basic[focus-within] {\n border: 1px solid transparent;\n box-shadow: 0 0 0 2px var(--default-brand-color);\n box-shadow: 0 0 0 2px var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components .input-basic:focus-within {\n border: 1px solid transparent;\n box-shadow: 0 0 0 2px var(--default-brand-color);\n box-shadow: 0 0 0 2px var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components .end-max-length {\n padding: 0 8px;\n font-size: 0.75rem;\n color: #264966;\n}\n.freemium-survey-components .textarea-container .end-max-length {\n padding: 8px;\n align-self: flex-end;\n}\n.freemium-survey-components span.input-error {\n display: block;\n padding-left: 2px;\n padding-top: 4px;\n font-size: 0.9rem;\n color: #d72d30;\n}\n.freemium-survey-components input[type=text] {\n padding: 6px 12px;\n flex: 1;\n border: unset;\n height: 32px;\n font-size: 1rem;\n /* line-height: ${typography.input.text.lineHeight}; */\n border-radius: 4px;\n}\n.freemium-survey-components input[type=text],\n.freemium-survey-components textarea {\n outline: none;\n border: none;\n}\n.freemium-survey-components input[type=text]::-moz-placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components input[type=text]:-ms-input-placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components input[type=text]::placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components textarea {\n min-height: 116px;\n padding: 12px;\n flex: 1;\n border: unset;\n resize: none;\n font-size: 1rem;\n /* line-height: ${typography.input.text.lineHeight}; */\n border-radius: 4px;\n}\n.freemium-survey-components textarea::-moz-placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components textarea:-ms-input-placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components textarea::placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}');const p=["RANGE","NPS","RADIO","DROPDOWN"],m={isRequired:!1,showCount:!0,isErrored:!1,inline:!1,spellCheck:!1,autoFocusInput:!0},f=t(((t,r)=>{const i=n(null);o((()=>{t.autoFocusInput&&setTimeout((()=>{i.current?.focus()}),600+t.autoFocusDelay)}),[t.autoFocusInput]);const{inputStyle:a,style:s,className:c,showCount:u,isErrored:l,startLabel:d,isRequired:p,errorText:m,endLabel:f,maxLength:y=300,onChange:v,autoFocusInput:x,...g}=t;return e.createElement("div",{className:"input-container",style:s},t.label&&e.createElement("label",{className:"input-label "+(p?"required":"")},t.label),e.createElement("div",null,d&&e.createElement("div",{className:"start-label"},d),e.createElement("div",{className:`input-basic ${l?"error":""}${c||""}`},e.createElement("input",Object.assign({},g,{type:"text",autoComplete:"off",ref:i,style:a,onChange:e=>{e.target.value?.length>y||v?.(e)}})),u&&y>0&&e.createElement("div",{className:"end-max-length"},`${t.value&&t.value.length||0}/${y}`)),f&&e.createElement("div",{className:"end-label"},f)),l&&m&&e.createElement("span",{className:"input-error"},t.errorText))})),y=t(((t,r)=>{const i=n(null);o((()=>{t.autoFocusInput&&setTimeout((()=>{i.current?.focus()}),600+t.autoFocusDelay)}),[t.autoFocusInput]);const{inputStyle:a,style:s,className:c,showCount:u,maxLength:l=1500,startLabel:d,isRequired:p,autoFocusInput:m,onChange:f,...y}=t;return e.createElement(e.Fragment,null,e.createElement("div",{className:"textarea-container",style:s},t.label&&e.createElement("label",{className:"input-label "+(p?"required":"")},t.label),d&&e.createElement("div",{className:"start-label"},d),e.createElement("div",{className:`input-basic ${c||""}`},e.createElement("textarea",Object.assign({},y,{autoComplete:"off",ref:i,style:a,onChange:e=>{e.target.value?.length>l||f?.(e)}})),u&&l&&l>0&&e.createElement("div",{className:"end-max-length"},`${t.value&&t.value.length||0}/${l}`)),t.endLabel&&e.createElement("div",{className:"end-label"},t.endLabel)))})),v=d(f,m),x=d(y,m);u('.freemium-survey-components .checkbox-group {\n width: 100%;\n display: flex;\n grid-gap: 12px;\n gap: 12px;\n flex-direction: column;\n white-space: nowrap;\n flex-wrap: wrap;\n}\n.freemium-survey-components .icon-container {\n display: inline-block;\n flex: 0 0 12px;\n width: 12px;\n height: 12px;\n min-width: 12px;\n min-height: 12px;\n color: inherit;\n position: absolute;\n left: 1px;\n top: 2px;\n}\n.freemium-survey-components .tick-icon {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n height: 100%;\n width: 100%;\n color: inherit;\n fill: currentColor;\n}\n.freemium-survey-components input[type=checkbox] {\n position: absolute;\n clip: rect(0px 0px 0px 0px);\n width: 0px;\n height: 0px;\n}\n.freemium-survey-components input[type=checkbox]:focus ~ .checkbox {\n /* box-shadow: ${pseudo.focus} 0px 0px 0px 2px; */\n box-shadow: var(--default-brand-color) 0px 0px 0px 2px;\n box-shadow: var(--brand-color, var(--default-brand-color)) 0px 0px 0px 2px;\n border-color: transparent;\n}\n.freemium-survey-components .checkbox-label {\n display: flex;\n align-items: baseline;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n text-align: left;\n opacity: 1;\n line-height: 1.2;\n cursor: pointer;\n font-size: 1rem;\n padding: 16px 24px;\n min-width: 200px;\n border: 1px solid #ebeff3;\n box-shadow: 0px 2px 5px rgba(18, 52, 77, 0.06);\n border-radius: 4px;\n white-space: pre-wrap;\n}\n.freemium-survey-components .checkbox-label:hover .checkbox {\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n box-shadow: var(--default-background-color) 0px 0px 0px 5px;\n box-shadow: var(--background-color, var(--default-background-color)) 0px 0px 0px 5px;\n}\n.freemium-survey-components .checkbox-label.disabled {\n opacity: 0.5;\n cursor: "not-allowed";\n}\n.freemium-survey-components .checkbox {\n transition: background-color ease-in 0.2s;\n min-width: 14px;\n min-height: 14px;\n min-height: 14px;\n max-height: 14px;\n border-radius: 2px;\n position: relative;\n margin-right: 16px;\n background-color: #fff;\n border: 1px solid;\n text-align: left;\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components .checkbox:hover {\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n box-shadow: var(--default-background-color) 0px 0px 0px 5px;\n box-shadow: var(--background-color, var(--default-background-color)) 0px 0px 0px 5px;\n}\n.freemium-survey-components input[type=checkbox]:checked ~ .checkbox {\n background-color: var(--default-brand-color);\n background-color: var(--brand-color, var(--default-brand-color));\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components input[type=checkbox]:checked ~ .checkbox:hover {\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components input[type=checkbox]:disabled ~ .checkbox:hover {\n box-shadow: unset;\n border-color: unset;\n}');const g=()=>e.createElement("svg",{id:"tick",className:"tick-icon",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"title",viewBox:"0 0 10 10"},e.createElement("path",{d:"M3 5.87c-.18666814.00267463-.36667109-.06932655-.5-.2L.21 3.41c-.1786328-.17863279-.24839684-.43899577-.1830127-.6830127.06538414-.24401694.25598306-.43461586.5-.5C.77100423 2.16160316 1.0313672 2.23136721 1.21 2.41L3 4.18 6.8.33c.27679776-.27455556.72320224-.27455556 1 0 .13696438.13025306.21450026.31098915.21450026.5S7.93696438 1.19974694 7.8 1.33L3.45 5.67c-.12082534.11896945-.28072735.19003701-.45.2Z",fill:"#fff",fillRule:"evenodd"})),h=({values:t=[],othersValue:i="",options:a,name:s,autoFocusGroup:c,autoFocusDelay:u,onChangeHandler:l,saveOthersValue:d,othersOption:p,othersRequired:m})=>{const[f,y]=r(!1),x=n(null);return o((()=>{c&&setTimeout((()=>{x.current?.focus()}),600+u)}),[c]),e.createElement("div",{className:"checkbox-group"},e.createElement("button",{ref:x,className:"autofocus-button","aria-hidden":!0}),a?.map(((n,o)=>e.createElement(b,{key:n.id,checked:t?.includes(n.value),name:n.value,id:n.id,onChange:(e,o)=>{if(o)l([...t||[],n.value]);else{const e=t.indexOf(n.value);e>-1&&t.splice(e,1),l([...t])}}},n.value))),p&&e.createElement(b,{key:"others",checked:f,name:"others",id:"others",onChange:(e,n)=>{if(y(n),n)l([...t,"others"]);else{const e=t.findIndex((e=>"others"===e));t.splice(e,1),l(t)}}},"Others"),f&&e.createElement(e.Fragment,null,e.createElement(v,{placeholder:"Enter your comment",value:i[s],onChange:e=>{d(s,e.target.value)},autoFocusDelay:10,label:""})))},b=d((t=>{const r=n(null);return o((()=>{t.autoFocus&&setTimeout((()=>{r.current?.focus()}),620)}),[]),e.createElement("label",{className:`checkbox-label ${t.disabled&&"disabled"}`},e.createElement("input",{ref:r,id:t.id,type:"checkbox",name:t.name,readOnly:t.readOnly,disabled:t.disabled,"aria-disabled":t.disabled,checked:t.checked,onChange:t.readOnly?()=>{}:e=>t.onChange(e,e.target.checked)}),e.createElement("div",{className:"checkbox"},t.checked&&e.createElement("div",{className:"icon-container"},e.createElement(g,null)," ")),e.createElement("div",null,t.children))}),{checked:!1});u('.freemium-survey-components .radio-group {\n display: flex;\n grid-gap: 12px;\n gap: 12px;\n white-space: nowrap;\n flex-direction: column;\n width: 100%;\n}\n.freemium-survey-components .radio {\n background-color: #fff;\n border: 1px solid;\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n transition: background-color ease-in 0.2s;\n min-width: 18px;\n max-width: 18px;\n min-height: 18px;\n max-height: 18px;\n border-radius: 50%;\n position: relative;\n margin-right: 16px;\n text-align: left;\n}\n.freemium-survey-components .radio:before {\n left: 3px;\n top: 3px;\n content: "";\n position: absolute;\n width: 10px;\n height: 10px;\n border-radius: 50%;\n transition: all ease-in 0.2s;\n background-color: #fff;\n}\n.freemium-survey-components .radio-label {\n display: flex;\n align-items: baseline;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n text-align: left;\n cursor: pointer;\n line-height: 1.2;\n font-size: 1rem;\n font-weight: 400;\n padding: 16px 24px;\n min-width: 200px;\n border: 1px solid #ebeff3;\n box-shadow: 0px 2px 5px rgba(18, 52, 77, 0.06);\n border-radius: 4px;\n white-space: pre-wrap;\n}\n.freemium-survey-components input[type=radio] {\n position: absolute;\n clip: rect(0, 0, 0, 0);\n width: 0px;\n height: 0px;\n}\n.freemium-survey-components input[type=radio]:focus ~ .radio {\n /* box-shadow: ${pseudo.focus} 0px 0px 0px 3px; */\n box-shadow: var(--default-brand-color) 0px 0px 0px 3px;\n box-shadow: var(--brand-color, var(--default-brand-color)) 0px 0px 0px 3px;\n border-color: transparent;\n}\n.freemium-survey-components input[type=radio]:checked ~ .radio:before {\n background-color: var(--default-brand-color);\n background-color: var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components .radio-label:hover .radio {\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n box-shadow: var(--default-background-color) 0px 0px 0px 5px;\n box-shadow: var(--background-color, var(--default-background-color)) 0px 0px 0px 5px;\n}');const w=({name:t,options:i,value:a,autoFocusGroup:s,autoFocusDelay:c,onChangeHandler:u,saveOthersValue:l,othersOption:d,othersRequired:p,othersValue:m})=>{const[f,y]=r(m??""),[x,g]=r(a),h=n(null);return o((()=>{s&&setTimeout((()=>{h.current?.focus()}),600+c)}),[s]),o((()=>{a||y("")}),[a]),o((()=>{x&&i.find((e=>e.value===x))&&x!==a&&u(x)}),[x]),e.createElement("div",{className:"radio-group",role:"radiogroup"},e.createElement("button",{ref:h,className:"autofocus-button","aria-hidden":!0,tabIndex:-1}),i?.map(((n,o)=>e.createElement(k,{key:n.value,value:n.value,name:t,onChange:e=>{g(e.currentTarget.value)},checked:x===n.value},n.value))),d&&e.createElement(k,{key:"others",value:"others",name:t,onChange:e=>{g("others")},checked:"others"===x},"Others"),"others"===x&&e.createElement(e.Fragment,null,e.createElement(v,{value:f,onChange:e=>y(e.target.value),placeholder:"Enter your comment",label:"",autoFocusDelay:10}),f!==a&&e.createElement(C,{inline:!0,disabled:p&&0===f.length,onClick:()=>{u("others"),l(t,f)}},"Next")))},k=d((t=>{const r=n(null);return o((()=>{t.autoFocus&&setTimeout((()=>{r.current?.focus()}),620)}),[]),e.createElement("label",{className:"radio-label"},e.createElement("input",{ref:r,type:"radio",name:t.name,value:t.value,checked:t.checked,onChange:t.onChange}),e.createElement("div",{className:"radio"}),e.createElement("div",null,t.children))}),{checked:!1,autoFocus:!1});u(".progressbar-container {\n width: 100%;\n height: 4px;\n position: fixed;\n top: 0;\n left: 0;\n z-index: 1;\n text-align: left;\n}\n\n.progressbar {\n transition: transform 0.25s linear;\n transform-origin: left;\n height: 100%;\n background-color: var(--default-brand-color);\n background-color: var(--brand-color, var(--default-brand-color));\n}");const q=n=>{const{totalSteps:t,completedSteps:o}=n;return e.createElement("div",{className:"progressbar-container"},e.createElement("div",{className:"progressbar",style:{width:(o>0?100/t:0)+"%",transform:`scaleX(${o})`}}))};u(".freemium-survey-components .action-button {\n width: auto;\n display: block;\n padding: 8px 16px;\n cursor: pointer;\n line-height: 1.5;\n text-align: center;\n font-weight: 500;\n letter-spacing: 0.3px;\n border-radius: 4px;\n white-space: nowrap;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n color: --default-button-text-color;\n color: var(--button-text-color, --default-button-text-color);\n background: var(--default-brand-color);\n background: var(--brand-color, var(--default-brand-color));\n border: 1px solid var(--default-brand-color);\n border: 1px solid var(--brand-color, var(--default-brand-color));\n border-radius: 4px;\n min-width: 200px;\n max-width: -webkit-fit-content;\n max-width: -moz-fit-content;\n max-width: fit-content;\n transform: translateY(0px);\n transition: transform ease 0.2s;\n}\n.freemium-survey-components .action-button:not([disabled]):hover {\n transform: translateY(-4px);\n}\n.freemium-survey-components .action-button[disabled] {\n cursor: not-allowed;\n opacity: 0.6;\n}\n.freemium-survey-components button:focus:not(:active) {\n /* box-shadow: 0 0 0 2px ${pseudo.focus}; */\n}\n\n@media (max-width: 550px) {\n .freemium-survey-components .action-button {\n min-width: 120px;\n }\n}\n.widget-survey-components .action-button {\n min-width: 120px;\n}\n\n.freemium-survey-components.mobile-preview .action-button {\n min-width: 120px;\n}");const E=()=>e.createElement(e.Fragment,null,"..."),_={LARGE:"large",MINI:"mini",NORMAL:"normal"},C=n=>{const{inline:t=!1,children:o,disabled:r,className:i="",htmlType:a,type:s="primary",onClick:c,size:u,overrideStyleClassName:l="",loading:d=!1,...p}=n;return e.createElement("button",Object.assign({style:t?{display:"inline-block"}:{},disabled:r,className:`action-button ${i} ${l}`,type:a,onClick:c},p),d?e.createElement(E,null):o)},z=()=>e.createElement("svg",{style:{display:"block"},width:"9",height:"14",viewBox:"0 0 10 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M7.82585 6.15754C7.98999 6.32147 8.08232 6.54389 8.08252 6.77587L8.08252 7.2192C8.07983 7.45069 7.98788 7.6722 7.82585 7.83754L1.82919 13.8225C1.77496 13.8772 1.71044 13.9206 1.63936 13.9502C1.56827 13.9798 1.49203 13.9951 1.41502 13.9951C1.33801 13.9951 1.26177 13.9798 1.19068 13.9502C1.1196 13.9206 1.05508 13.8772 1.00085 13.8225L0.172521 12.9942C0.118197 12.941 0.0750381 12.8774 0.0455752 12.8073C0.0161124 12.7372 0.000937578 12.6619 0.000937585 12.5859C0.000937592 12.5098 0.0161125 12.4345 0.0455753 12.3644C0.0750381 12.2943 0.118197 12.2308 0.172521 12.1775L5.36419 6.99754L0.172522 1.81754C0.117847 1.76331 0.0744506 1.69879 0.0448352 1.62771C0.0152208 1.55662 -2.75162e-05 1.48038 -2.75094e-05 1.40337C-2.75027e-05 1.32636 0.0152208 1.25012 0.0448353 1.17904C0.0744507 1.10795 0.117847 1.04343 0.172522 0.989205L1.00086 0.172537C1.05508 0.117862 1.1196 0.0744661 1.19069 0.0448507C1.26177 0.0152353 1.33801 -1.20337e-05 1.41502 -1.2027e-05C1.49203 -1.20203e-05 1.56827 0.0152353 1.63936 0.0448507C1.71044 0.0744661 1.77496 0.117862 1.82919 0.172537L7.82585 6.15754Z",fill:"#6B6B6B"})),N=()=>e.createElement("svg",{style:{display:"block"},width:"9",height:"14",viewBox:"0 0 10 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M0.256667 7.83755C0.0925257 7.67361 0.000204227 7.4512 0 7.21921V6.77588C0.00268801 6.5444 0.0946357 6.32289 0.256667 6.15755L6.25333 0.172549C6.30756 0.117874 6.37208 0.0744776 6.44316 0.0448625C6.51425 0.0152474 6.59049 0 6.6675 0C6.74451 0 6.82075 0.0152474 6.89184 0.0448625C6.96292 0.0744776 7.02744 0.117874 7.08167 0.172549L7.91 1.00088C7.96432 1.05411 8.00748 1.11764 8.03694 1.18776C8.06641 1.25787 8.08158 1.33316 8.08158 1.40922C8.08158 1.48527 8.06641 1.56056 8.03694 1.63067C8.00748 1.70079 7.96432 1.76432 7.91 1.81755L2.71833 6.99755L7.91 12.1775C7.96467 12.2318 8.00807 12.2963 8.03769 12.3674C8.0673 12.4385 8.08255 12.5147 8.08255 12.5917C8.08255 12.6687 8.0673 12.745 8.03769 12.8161C8.00807 12.8871 7.96467 12.9517 7.91 13.0059L7.08167 13.8225C7.02744 13.8772 6.96292 13.9206 6.89184 13.9502C6.82075 13.9799 6.74451 13.9951 6.6675 13.9951C6.59049 13.9951 6.51425 13.9799 6.44316 13.9502C6.37208 13.9206 6.30756 13.8772 6.25333 13.8225L0.256667 7.83755Z",fill:"#6B6B6B"})),S=({question:n,formValues:t,othersMeta:o,onChangeHandler:r,saveOthersValue:i,autoFocus:a,autoFocusDelay:s})=>{switch(n.type_info.question_type){case"RANGE":return e.createElement(l,{type_info:n.type_info,onChangeHandler:r,npsValue:t[n.name]});case"CHECKBOX":case"MULTI_SELECT":return e.createElement(h,{name:n.name,autoFocusGroup:a,values:t[n.name],othersValue:o[n.name],options:n.type_info.choices,onChangeHandler:r,saveOthersValue:i,othersOption:n.type_info.meta?.othersOption,othersRequired:n.type_info.meta?.othersRequired,autoFocusDelay:s});case"RADIO":case"DROPDOWN":return e.createElement(w,{autoFocusGroup:a,autoFocusDelay:s,name:n.name,onChangeHandler:r,saveOthersValue:i,options:n.type_info.choices,value:t[n.name],othersValue:o[n.name],othersOption:n.type_info.meta?.othersOption,othersRequired:n.type_info.meta?.othersRequired});case"INPUT":case"TEXT":return n.type_info?.meta?.readOnly?e.createElement("div",{className:"message-container"},n.type_info?.meta?.value):e.createElement("div",{className:"responsive-text-field"},e.createElement(v,{autoFocusInput:a,autoFocusDelay:s,label:"",isRequired:n.is_required,value:t[n.name]||"",placeholder:n.type_info?.meta?.placeholder??"",onChange:e=>r(e.target.value)}),e.createElement(x,{autoFocusInput:a,autoFocusDelay:s,label:"",isRequired:n.is_required,placeholder:n.type_info?.meta?.placeholder??"",value:t[n.name]||"",onChange:e=>r(e.target.value)}));case"PARAGRAPH":return e.createElement(x,{autoFocusInput:a,autoFocusDelay:s,label:"",isRequired:n.is_required,placeholder:n.type_info?.meta?.placeholder??"",value:t[n.name]||"",onChange:e=>r(e.target.value)});default:return console.error(`Question type ${n.type_info.question_type} not found`),null}},I=(e,n,t)=>{if(e){let o={"{{nps.score}}":t};n&&(o={...o,...n});const r=new RegExp(Object.keys(o).join("|"),"gi");e=e.replace(r,(function(e){return o[e.toLowerCase()]}))}return e};u(":root {\n --default-brand-color: #264966;\n --default-question-text-color: #000;\n --default-question-background-color: #fff;\n --default-background-color: #f8f8f8;\n --default-button-text-color: #fff;\n --default-secondary-button-text-color: #000;\n --default-input-placeholder-color: #92a2b1;\n --compact-widget-max-height: 560px;\n --default-widget-max-height: 400px;\n --cozy-widget-max-height: 380px;\n}\n\n.freemium-survey-step-navigation {\n padding: 0 2px;\n box-shadow: 0px 0px 6px #eee;\n white-space: nowrap;\n}\n.freemium-survey-step-navigation .navigation-button {\n width: 38px;\n text-align: -webkit-center;\n height: 38px;\n background-color: #fff;\n border: none;\n cursor: pointer;\n border-radius: 0 3px 3px 0;\n}\n.freemium-survey-step-navigation .navigation-button:first-of-type {\n border-right: 1px solid #d9d9d9;\n border-radius: 3px 0 0 3px;\n}\n.freemium-survey-step-navigation .navigation-button:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n.freemium-survey-step-navigation .navigation-button:focus {\n position: relative;\n z-index: 1;\n}\n\n.freemium-survey-components .question-container {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n text-align: center;\n max-width: 700px;\n margin: 0 auto;\n background: var(--default-question-background-color);\n background: var(--question-background-color, var(--default-question-background-color));\n border-radius: 4px;\n transition: transform 500ms ease 0ms, opacity 200ms ease 0ms;\n box-shadow: 0px 12px 15px rgba(18, 52, 77, 0.03);\n margin-bottom: 28px;\n padding: 28px;\n grid-gap: 28px;\n gap: 28px;\n position: relative;\n height: -webkit-fit-content;\n height: -moz-fit-content;\n height: fit-content;\n transition: opacity 50ms ease-out;\n overflow: auto;\n}\n.freemium-survey-components .hide-question-container {\n opacity: 0;\n}\n.freemium-survey-components .question-text {\n font-size: 1rem;\n font-weight: 600;\n line-height: 1.8;\n width: 100%;\n text-align: left;\n color: var(--default-question-text-color);\n color: var(--question-text-color, var(--default-question-text-color));\n}\n.freemium-survey-components .autofocus-button {\n border: none;\n width: 0;\n height: 0;\n opacity: 0;\n margin-top: -12px;\n margin-left: -12px;\n position: absolute;\n}\n@-webkit-keyframes opac {\n 0%, 50% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n@keyframes opac {\n 0%, 50% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n@-webkit-keyframes fade-out {\n 0% {\n opacity: 1;\n transform: translateY(0);\n }\n 100% {\n opacity: 0;\n transform: translateY(-100px);\n }\n}\n@keyframes fade-out {\n 0% {\n opacity: 1;\n transform: translateY(0);\n }\n 100% {\n opacity: 0;\n transform: translateY(-100px);\n }\n}\n@-webkit-keyframes fade-in {\n 0% {\n opacity: 0;\n transform: translateY(100px);\n }\n 100% {\n opacity: 1;\n transform: translateY(0px);\n }\n}\n@keyframes fade-in {\n 0% {\n opacity: 0;\n transform: translateY(100px);\n }\n 100% {\n opacity: 1;\n transform: translateY(0px);\n }\n}\n.freemium-survey-components .fade-in {\n opacity: 0;\n -webkit-animation: fade-in 1s ease forwards 1s;\n animation: fade-in 1s ease forwards 1s;\n}\n.freemium-survey-components .fade-out {\n -webkit-animation: fade-out 1s ease forwards;\n animation: fade-out 1s ease forwards;\n}\n.freemium-survey-components .fade-enter .question-container {\n opacity: 0;\n transform: translateY(100px);\n}\n.freemium-survey-components .fade-enter-active .question-container {\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components .fade-exit .question-container {\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components .fade-exit-active .question-container {\n opacity: 0;\n transform: translateY(-100px);\n}\n.freemium-survey-components .fade-enter-active .question-container,\n.freemium-survey-components .fade-exit-active .question-container {\n transition: opacity 500ms, transform 500ms;\n}\n.freemium-survey-components .fade-reverse-enter .question-container {\n opacity: 0;\n transform: translateY(-100px);\n}\n.freemium-survey-components .fade-reverse-enter-active .question-container {\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components .fade-reverse-exit .question-container {\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components .fade-reverse-exit-active .question-container {\n opacity: 0;\n transform: translateY(100px);\n}\n.freemium-survey-components .fade-reverse-enter-active .question-container,\n.freemium-survey-components .fade-reverse-exit-active .question-container {\n transition: opacity 500ms, transform 500ms;\n}\n.freemium-survey-components .question-footer {\n display: flex;\n justify-content: flex-end;\n grid-gap: 40px;\n gap: 40px;\n width: 100%;\n align-items: center;\n}\n.freemium-survey-components .question-footer:empty {\n display: none;\n}\n.freemium-survey-components .action-buttons {\n display: flex;\n grid-gap: 20px;\n gap: 20px;\n flex-direction: row-reverse;\n}\n.freemium-survey-components .action-buttons:empty {\n display: none;\n}\n.freemium-survey-components .skip-button {\n font-weight: 400;\n cursor: pointer;\n background: transparent;\n border: none;\n min-width: 40px;\n padding: 8px 16px;\n border-radius: 4px;\n color: var(--default-secondary-button-text-color);\n color: var(--secondary-button-text-color, var(--default-secondary-button-text-color));\n letter-spacing: 0.05rem;\n line-height: 1.5;\n border: 1px solid transparent;\n}\n.freemium-survey-components .skip-button:hover {\n background-color: #f3f3f3;\n}\n.freemium-survey-components .next-button {\n color: var(--default-button-text-color);\n color: var(--button-text-color, var(--default-button-text-color));\n}\n.freemium-survey-components .submit {\n max-width: 700px;\n margin: 0 auto;\n text-align: left;\n background: transparent;\n box-shadow: none;\n color: var(--default-button-text-color);\n color: var(--button-text-color, var(--default-button-text-color));\n}\n.freemium-survey-components .thankyou {\n display: flex;\n align-items: center;\n justify-content: center;\n grid-gap: 20px;\n gap: 20px;\n min-height: 180px;\n}\n.freemium-survey-components .thankyou .heading {\n font-weight: 600;\n font-size: 28px;\n}\n.freemium-survey-components .thankyou .text {\n white-space: pre-wrap;\n font-weight: 500;\n font-size: 0.875rem;\n line-height: 1.6;\n color: #12344d;\n width: 75%;\n}\n.freemium-survey-components .thankyou .redirection-text {\n color: #929292;\n margin-bottom: 12px;\n font-weight: 300;\n}\n.freemium-survey-components .thankyou .link {\n width: 100%;\n display: inline-block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: #666;\n font-weight: 500;\n text-decoration: underline;\n}\n.freemium-survey-components .responsive-text-field {\n width: 100%;\n}\n.freemium-survey-components .responsive-text-field .textarea-container {\n display: none;\n}\n.freemium-survey-components .message-container:empty {\n display: none;\n}\n\n@media (max-width: 550px) {\n .freemium-survey-component .responsive-text-field .input-container,\n.card-survey-style .responsive-text-field .input-container {\n display: none;\n }\n .freemium-survey-component .responsive-text-field .textarea-container,\n.card-survey-style .responsive-text-field .textarea-container {\n display: flex;\n }\n}\ndiv.widget-survey-components.compact-style .freemium-survey-step-navigation {\n padding: 0 2px;\n margin-left: 4px;\n box-shadow: 0px 0px 6px #eee;\n margin-top: 4px;\n}\ndiv.widget-survey-components.compact-style .nps-container .footer {\n padding-top: 12px;\n}\ndiv.widget-survey-components.compact-style .nps-container .choices {\n grid-gap: 12px;\n gap: 12px;\n}\n\ndiv.widget-survey-components,\ndiv.card-survey-style {\n display: flex;\n flex-direction: column;\n grid-gap: 28px;\n gap: 28px;\n flex-grow: 1;\n font-size: 0.875rem;\n overflow: hidden;\n}\ndiv.widget-survey-components .questions,\ndiv.card-survey-style .questions {\n min-width: 100%;\n max-width: 100%;\n display: flex;\n position: relative;\n max-height: 560px;\n max-height: var(--compact-widget-max-height);\n}\ndiv.widget-survey-components .question-text,\ndiv.card-survey-style .question-text {\n width: 100%;\n text-align: left;\n}\ndiv.widget-survey-components .focus-lock,\ndiv.card-survey-style .focus-lock {\n width: 100%;\n}\ndiv.widget-survey-components .question-container,\ndiv.card-survey-style .question-container {\n height: -webkit-fit-content;\n height: -moz-fit-content;\n height: fit-content;\n min-width: 100%;\n max-width: 100%;\n margin-bottom: 0;\n padding: 16px 28px;\n grid-gap: 16px;\n gap: 16px;\n flex-grow: 1;\n}\ndiv.widget-survey-components .question-footer,\ndiv.card-survey-style .question-footer {\n margin: 0px auto;\n justify-content: space-between;\n bottom: 0;\n padding-bottom: 20px;\n}\ndiv.widget-survey-components .submit,\ndiv.card-survey-style .submit {\n padding-bottom: 0;\n margin: unset;\n}\ndiv.widget-survey-components .nps-container .footer,\ndiv.card-survey-style .nps-container .footer {\n padding-top: 12px;\n}\ndiv.widget-survey-components .nps-container .widget .choices,\ndiv.card-survey-style .nps-container .widget .choices {\n grid-gap: 8px;\n gap: 8px;\n}\ndiv.widget-survey-components .radio-group,\ndiv.card-survey-style .radio-group {\n width: 100%;\n}\ndiv.widget-survey-components .checkbox-group,\ndiv.card-survey-style .checkbox-group {\n width: 100%;\n flex-wrap: nowrap;\n}\n\ndiv.widget-survey-components .question-container {\n box-shadow: none;\n border-radius: 0;\n}\ndiv.widget-survey-components .question-text {\n font-size: 0.875rem;\n}\ndiv.widget-survey-components .progressbar-container {\n position: absolute;\n}\ndiv.widget-survey-components .progressbar-container .progressbar {\n border-radius: 3px 0 0 0;\n}\ndiv.widget-survey-components .textarea-container .end-max-length {\n padding: 4px;\n}\ndiv.widget-survey-components .responsive-text-field .input-container {\n display: none;\n}\ndiv.widget-survey-components .responsive-text-field .textarea-container {\n display: flex;\n}\ndiv.widget-survey-components div.thankyou {\n min-height: unset;\n}\ndiv.widget-survey-components div.thankyou .text {\n width: 85%;\n}\ndiv.widget-survey-components div.thankyou svg {\n width: 140px;\n height: 120px;\n}\n\ndiv.widget-survey-components.default-style .freemium-survey-step-navigation {\n margin: 0;\n}\ndiv.widget-survey-components.default-style .questions {\n max-height: 400px;\n max-height: var(--default-widget-max-height);\n}\ndiv.widget-survey-components.default-style .question-container {\n padding: 12px 28px;\n}\ndiv.widget-survey-components.default-style .question-footer {\n justify-content: space-between;\n}\ndiv.widget-survey-components.default-style .nps-container .footer {\n padding-top: 12px;\n}\ndiv.widget-survey-components.default-style .nps-container .choices {\n flex-wrap: unset;\n grid-gap: 12px;\n gap: 12px;\n}\ndiv.widget-survey-components.default-style .action-button {\n line-height: 1.2;\n}\ndiv.widget-survey-components.default-style .radio-group {\n flex-direction: row;\n flex-wrap: wrap;\n}\ndiv.widget-survey-components.default-style .radio-group .radio-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n}\ndiv.widget-survey-components.default-style .checkbox-group {\n flex-direction: row;\n flex-wrap: wrap;\n}\ndiv.widget-survey-components.default-style .checkbox-group .checkbox-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n}\ndiv.widget-survey-components.default-style textarea {\n min-height: 84px;\n}\ndiv.widget-survey-components.default-style .end-max-length {\n font-size: 0.8rem;\n font-weight: 300;\n padding: 4px;\n}\n\n.widget-survey-components.cozy-style .freemium-survey-step-navigation {\n margin: 0;\n}\n.widget-survey-components.cozy-style .questions {\n max-height: 380px;\n max-height: var(--cozy-widget-max-height);\n}\n.widget-survey-components.cozy-style .question-text {\n font-size: 1rem;\n}\n.widget-survey-components.cozy-style .question-text.nps {\n text-align: center;\n width: 60%;\n min-width: 600px;\n margin: auto;\n}\n.widget-survey-components.cozy-style .question-container {\n padding: 12px 28px;\n}\n.widget-survey-components.cozy-style .question-footer {\n justify-content: space-between;\n}\n.widget-survey-components.cozy-style .nps-container {\n grid-gap: 44px;\n gap: 44px;\n}\n.widget-survey-components.cozy-style .nps-container .widget {\n display: flex;\n justify-content: center;\n}\n.widget-survey-components.cozy-style .nps-container .button-container {\n width: 60%;\n min-width: 600px;\n margin: 0 auto;\n}\n.widget-survey-components.cozy-style .nps-container .button-container .choices {\n justify-content: space-around;\n}\n.widget-survey-components.cozy-style .nps-container .footer {\n padding-top: 8px;\n}\n.widget-survey-components.cozy-style .action-button {\n line-height: 1.2;\n}\n.widget-survey-components.cozy-style .radio-group {\n flex-direction: row;\n flex-wrap: wrap;\n}\n.widget-survey-components.cozy-style .radio-group .radio-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n}\n.widget-survey-components.cozy-style .checkbox-group {\n flex-direction: row;\n flex-wrap: wrap;\n}\n.widget-survey-components.cozy-style .checkbox-group .checkbox-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n}\n.widget-survey-components.cozy-style textarea {\n min-height: 60px;\n}\n.widget-survey-components.cozy-style .end-max-length {\n font-size: 0.8rem;\n font-weight: 300;\n padding: 4px;\n}\n\n.freemium-survey-components.mobile-preview .thankyou .text {\n width: unset;\n}");const B=({thankYouQuestion:n,preview:t,placeholders:r,npsValue:i})=>(o((()=>{t||n.type_info.meta?.redirectUrl&&setTimeout((()=>{window.location.href=n.type_info.meta?.redirectUrl}),n.type_info.meta?.redirectDelay??1e4)}),[]),e.createElement("div",{className:"question-container thankyou"},e.createElement("div",{className:"heading"},"Thank you!"),e.createElement("div",{className:"text",dangerouslySetInnerHTML:{__html:I(n.text,r,i)}}),n.type_info.meta?.redirectUrl&&e.createElement("div",{style:{width:"100%"}},e.createElement("div",{className:"redirection-text"},"You will be redirected to the below URL automatically in"," ",n.type_info.meta?.redirectDelay," seconds.",e.createElement("br",null)),e.createElement("a",{className:"link",href:n.type_info.meta?.redirectUrl},n?.type_info.meta?.redirectUrl)))),O=({currentBlockIndex:n,currentBlockIndexOfBlocksWithQns:t,blocksWithQns:o,blocks:r,setHorizontalScrollUnits:i,preventQuestionAnimation:a,tempCurrentBlockIndexOfBlocksWithQns:s,setReverse:c,reverse:u})=>e.createElement("div",{className:"freemium-survey-step-navigation","data-navigation-element":"1"},e.createElement("button",{disabled:0==t.current,className:"navigation-button",onClick:()=>{u?t.current=Math.max(t.current-1,0):s.current=Math.max(t.current-1,0),n.current=r.findIndex((e=>e.name===o[t.current].name)),a.current=!1,c(!0),i(t.current)}},e.createElement(N,null)),e.createElement("button",{className:"navigation-button",disabled:t.current>=o.length-1,onClick:()=>{a.current=!1,n.current=r.findIndex((e=>e.name===o[t.current].name)),u?s.current=Math.min(t.current+1,o.length-1):t.current=Math.min(t.current+1,o.length-1),c(!1),i(t.current)}},e.createElement(z,null))),F=({widget:n,widgetStyle:t,surveyStyle:o,formValues:r,blocksWithQns:i,blocks:a,thankYouQuestion:s,currentBlockIndexOfBlocksWithQns:c,currentBlockIndexOfBlocks:u,currentEditingBlock:l,isSubmitting:d,isValuesCommitted:m,isCurrentBlockFinal:f,setHorizontalScrollUnits:y,handleFormValues:v,skipBlock:x,setIsSubmitting:g,onSubmit:h,setIsSurveyCompleted:b,preventQuestionAnimation:w,preview:k,closePreview:q,setReverse:E,tempCurrentBlockIndexOfBlocksWithQns:_,question:z,reverse:N,othersMeta:S,...I})=>{const B=I.blockIndex??c.current,F=()=>!p.includes(z.type_info.question_type)&&!f(),T=()=>"RANGE"!==z.type_info.question_type&&!z.required&&!f(),Q=()=>"DROPDOWN"===z.type_info.question_type&&!z.required&&null!=r[z.name],R=()=>f()&&(n||"standard"!==o),$="MULTI_SELECT"===l.current.question.type_info.question_type&&r[l.current.question.name]?.includes("others")&&(!S[l.current.question.name]||""===S[l.current.question.name]);return e.createElement("div",{className:"question-footer"},!(!n&&"standard"===o||0===B&&!r[z.name]||"compact"===t)&&e.createElement(O,{currentBlockIndex:u,currentBlockIndexOfBlocksWithQns:c,blocksWithQns:i,blocks:a,setHorizontalScrollUnits:y,preventQuestionAnimation:w,setReverse:E,tempCurrentBlockIndexOfBlocksWithQns:_,reverse:N}),(F()||Q()||T()||R())&&e.createElement("div",{className:"action-buttons"},F()&&e.createElement(C,{onClick:()=>{E(!1),v(i[B],null,!0)},disabled:l.current.question.required&&(!r[l.current.question.name]||Array.isArray(r[l.current.question.name])&&0===r[l.current.question.name].length)||l.current.question.type_info.meta?.othersRequired&&$,className:"next-button"},"Next"),T()&&e.createElement("button",{className:"skip-button",onClick:()=>{E(!1),x(z)}},"Skip"),Q()&&e.createElement("button",{className:"skip-button",onClick:()=>{l.current=i[B],u.current=a.findIndex((e=>e.name===i[B].name)),x(z)}},"Clear selection"),R()&&e.createElement("div",{className:"submit"},e.createElement(C,{disabled:(l.current.question.required||l.current.question.type_info.pivot_question)&&(null==r[l.current.question.name]||0===r[l.current.question.name]?.length)||l.current.question.type_info.meta?.othersRequired&&$||d,onClick:()=>{g(!0),h({...r,others_meta:S},(()=>{s?.type_info.meta?.skipThankYouPage?k?setTimeout((()=>{q?.()}),300):window.location.href=s?.type_info.meta?.redirectUrl:b(!0)}))}},d?"Submitting":"Submit Survey"))))},T=({survey:t,surveyStyle:i="standard",placeholders:c,onSubmit:u,widget:l,npsValue:d,widgetStyle:m,widgetNavigatorQuerySelector:f,preview:y,mobilePreview:v,closePreview:x})=>{const g=t.question_details?.questions||[],h=t.meta?.blocks||[],[b,w]=r(null),[k,E]=r({}),[_,C]=r(!1),[z,N]=r([]),[O,T]=r(0),[Q,R]=r(!1),[$,L]=r(null),[V,Y]=r({}),D=n(null),A=n(null),j=n(-1),H=n(null),U=n(0),M=n(0),W=n(!1),P=n([]),G=e.useRef(!!d&&"card"===i),X=n(null),K=n(0),[Z,J]=r(!1);o((()=>{h&&(X.current=h.find((e=>"TY"===e.name)),w(h.filter((e=>"TY"!==e.name))))}),[h]),o((()=>{M.current=K.current,T(O+1)}),[Z]),o((()=>{if(b)if(A.current=g.find((e=>e.type_info?.pivot_question))??g.find((e=>"RANGE"===e.type_info?.question_type))??g[0],null!=d){j.current=d;const e=g.find((e=>e.name===b[0].question_names[0]));D.current={...b[0],question:e},P.current=[...P.current,{...b[0],question:e}],N(P.current),E({Q_1:d})}else if(!D.current&&b.length>0)return D.current=b[0],void ne(b[0])}),[b,d]),e.useEffect((()=>{z.length&&(P.current=z,M.current=z.length-1),T(z.length-1)}),[z]),o((()=>{Object.keys(k).length>0&&D.current.question&&(p.includes(D.current.question.type_info.question_type)||W.current)&&!ee()&&te()}),[k]),o((()=>{if(null!=k?.[A.current?.name])if(X.current?.is_based_on_score){const e=A.current?.type_info?.choices[k?.[A.current?.name]]?.dependent_question_names,n=X.current?.question_names.find((n=>e?.includes(n))),t=g.find((e=>e.name===n));L(t)}else{const e=g.find((e=>e.name==X.current?.question_names[0]));L(e)}}),[k?.[A.current?.name]]);const ee=()=>(U.current===b.length-1||"end"===D.current.branchOption)&&M.current===z.length-1,ne=e=>{let n={};if(e.is_based_on_score){const t=A.current?.type_info?.choices[k?.[A.current?.name]]?.dependent_question_names,o=e.question_names.find((e=>t?.includes(e)));n=g.find((e=>e.name===o))}else n=g.find((n=>n.name===e.question_names[0]));D.current.question=n;P.current.find((e=>e.question.name===n.name))?(T(O+1),M.current+=1):N([...P.current,{...e,question:n}])},te=()=>{if(ee())C(!0);else{if(D.current.nextBlock)U.current=b.findIndex((e=>e.name===D.current.nextBlock));else if(D.current.question.type_info?.meta?.branches){const e=D.current.question.type_info?.meta?.branches,n=k[D.current.question.name];let t;if(t="RANGE"===D.current.question.type_info.question_type?e.find((e=>n>=e.min&&n<=e.max)):e.find((e=>n===e.value)),t?.nextBlock){if("TY"===t.nextBlock)return void C(!0);U.current=b.findIndex((e=>e.name===t.nextBlock))}else U.current+=1}else U.current+=1;D.current=b[U.current],ne(b[U.current])}},oe=(e,n,t)=>{if(G.current=!1,t){if(W.current=!0,null!=k[e.question.name]&&e.name!==z[z.length-1].name){const[t,o]=(e=>{const n=z.findIndex((n=>n.name===e.name)),t=z.slice(0,n+1),o=t.reduce(((e,n)=>(e[n.question.name]=k[n.question.name],e)),{});return U.current=b.findIndex((n=>n.name===e.name)),[t,o]})(e);E({...o,...null!=n&&{[e.question.name]:n}}),P.current=t}else E({...k,...null!=n&&{[e.question.name]:n}});A?.current?.name==e?.question?.name&&(j.current=n)}else E({...k,...null!=n&&{[e.question.name]:n}})};if(!D.current||!D.current.question)return null;const re=z[M.current];return e.createElement("div",{className:`freemium-survey-components ${l?"widget-survey-components":""} ${m}-style ${v?"mobile-preview":""} ${i}-survey-style`,style:{height:"calc(100vh - 40px)",display:"flex",justifyContent:"center",alignItems:"center"},id:"freemium-survey"},e.createElement(q,{totalSteps:b.length,completedSteps:U.current+(_?1:0)}),e.createElement(a,{mode:"out-in"},e.createElement(s,{key:M.current+String(_),addEndListener:(e,n)=>{e.addEventListener("transitionend",n,!1)},classNames:Z?"fade-reverse":"fade"},e.createElement("div",{className:"questions"},_?e.createElement(B,{thankYouQuestion:$,preview:y,placeholders:c,npsValue:j.current}):e.createElement("div",{ref:H,id:`${re.question.name}`,className:`question-container ${l||"card"===i}`},e.createElement("div",{className:"question-text",dangerouslySetInnerHTML:{__html:I(re.question.text,c,j.current)},title:`question-${M.current}`,role:"heading","aria-level":1}),e.createElement("div",{onTransitionEndCapture:e=>e.stopPropagation(),style:{width:"100%"}},e.createElement(S,{question:re.question,formValues:k,othersMeta:V,autoFocus:!0,autoFocusDelay:"standard"===i?350:0,saveOthersValue:(e,n)=>{Y({...V,[e]:n})},onChangeHandler:e=>{W.current=!1,U.current=b.findIndex((e=>e.name===re.name)),D.current=re,J(!1),oe(re,e,p.includes(re.question.type_info.question_type)&&!ee())}})),e.createElement(F,{question:re.question,widget:l,widgetStyle:m,surveyStyle:i,formValues:k,othersMeta:V,blocksWithQns:z,blocks:b,thankYouQuestion:$,currentBlockIndexOfBlocksWithQns:M,reverse:Z,setReverse:J,currentBlockIndexOfBlocks:U,currentEditingBlock:D,isSubmitting:Q,isValuesCommitted:W,isCurrentBlockFinal:ee,setHorizontalScrollUnits:T,handleFormValues:oe,skipBlock:e=>{W.current=!0,delete k[e.name],E({...k})},setIsSubmitting:R,onSubmit:u,setIsSurveyCompleted:C,preventQuestionAnimation:G,preview:y,closePreview:x,tempCurrentBlockIndexOfBlocksWithQns:K}))))))};u(":root {\n --default-brand-color: #264966;\n --default-question-text-color: #000;\n --default-question-background-color: #fff;\n --default-background-color: #f8f8f8;\n --default-button-text-color: #fff;\n --default-secondary-button-text-color: #000;\n --default-input-placeholder-color: #92a2b1;\n --compact-widget-max-height: 560px;\n --default-widget-max-height: 400px;\n --cozy-widget-max-height: 380px;\n}\n\n.freemium-survey-step-navigation {\n padding: 0 2px;\n box-shadow: 0px 0px 6px #eee;\n white-space: nowrap;\n}\n.freemium-survey-step-navigation .navigation-button {\n width: 38px;\n text-align: -webkit-center;\n height: 38px;\n background-color: #fff;\n border: none;\n cursor: pointer;\n border-radius: 0 3px 3px 0;\n}\n.freemium-survey-step-navigation .navigation-button:first-of-type {\n border-right: 1px solid #d9d9d9;\n border-radius: 3px 0 0 3px;\n}\n.freemium-survey-step-navigation .navigation-button:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n.freemium-survey-step-navigation .navigation-button:focus {\n position: relative;\n z-index: 1;\n}\n\n.freemium-survey-components .question-container {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n text-align: center;\n max-width: 700px;\n margin: 0 auto;\n background: var(--default-question-background-color);\n background: var(--question-background-color, var(--default-question-background-color));\n border-radius: 4px;\n transition: transform 500ms ease 0ms, opacity 800ms ease 0ms;\n box-shadow: 0px 12px 15px rgba(18, 52, 77, 0.03);\n margin-bottom: 28px;\n padding: 28px;\n grid-gap: 28px;\n gap: 28px;\n position: relative;\n height: -webkit-fit-content;\n height: -moz-fit-content;\n height: fit-content;\n overflow: auto;\n opacity: 1;\n}\n.freemium-survey-components .hide-question-container {\n pointer-events: none;\n opacity: 0;\n}\n.freemium-survey-components .question-text {\n font-size: 1rem;\n font-weight: 600;\n line-height: 1.8;\n width: 100%;\n text-align: left;\n color: var(--default-question-text-color);\n color: var(--question-text-color, var(--default-question-text-color));\n}\n.freemium-survey-components .autofocus-button {\n border: none;\n width: 0;\n height: 0;\n opacity: 0;\n margin-top: -12px;\n margin-left: -12px;\n position: absolute;\n}\n@-webkit-keyframes opac {\n 0%, 50% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n@keyframes opac {\n 0%, 50% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n.freemium-survey-components .question-footer {\n display: flex;\n justify-content: flex-end;\n grid-gap: 40px;\n gap: 40px;\n width: 100%;\n align-items: center;\n}\n.freemium-survey-components .question-footer:empty {\n display: none;\n}\n.freemium-survey-components .action-buttons {\n display: flex;\n grid-gap: 20px;\n gap: 20px;\n flex-direction: row-reverse;\n}\n.freemium-survey-components .action-buttons:empty {\n display: none;\n}\n.freemium-survey-components .skip-button {\n font-weight: 400;\n cursor: pointer;\n background: transparent;\n border: none;\n min-width: 40px;\n padding: 8px 16px;\n border-radius: 4px;\n color: var(--default-secondary-button-text-color);\n color: var(--secondary-button-text-color, var(--default-secondary-button-text-color));\n letter-spacing: 0.05rem;\n line-height: 1.5;\n border: 1px solid transparent;\n}\n.freemium-survey-components .skip-button:hover {\n background-color: #f3f3f3;\n}\n.freemium-survey-components .next-button {\n color: var(--default-button-text-color);\n color: var(--button-text-color, var(--default-button-text-color));\n}\n.freemium-survey-components .submit {\n max-width: 700px;\n margin: 0 auto;\n text-align: left;\n background: transparent;\n box-shadow: none;\n color: var(--default-button-text-color);\n color: var(--button-text-color, var(--default-button-text-color));\n}\n.freemium-survey-components .thankyou {\n display: flex;\n align-items: center;\n justify-content: center;\n grid-gap: 20px;\n gap: 20px;\n min-height: 180px;\n}\n.freemium-survey-components .thankyou .heading {\n font-weight: 600;\n font-size: 28px;\n}\n.freemium-survey-components .thankyou .text {\n white-space: pre-wrap;\n font-weight: 500;\n font-size: 0.875rem;\n line-height: 1.6;\n color: #12344d;\n width: 75%;\n}\n.freemium-survey-components .thankyou .redirection-text {\n color: #929292;\n margin-bottom: 12px;\n font-weight: 300;\n}\n.freemium-survey-components .thankyou .link {\n width: 100%;\n display: inline-block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: #666;\n font-weight: 500;\n text-decoration: underline;\n}\n.freemium-survey-components .responsive-text-field {\n width: 100%;\n}\n.freemium-survey-components .responsive-text-field .textarea-container {\n display: none;\n}\n.freemium-survey-components .message-container:empty {\n display: none;\n}\n\n@media (max-width: 550px) {\n .freemium-survey-component .responsive-text-field .input-container,\n.card-survey-style .responsive-text-field .input-container {\n display: none;\n }\n .freemium-survey-component .responsive-text-field .textarea-container,\n.card-survey-style .responsive-text-field .textarea-container {\n display: flex;\n }\n}\ndiv.widget-survey-components.compact-style .freemium-survey-step-navigation {\n padding: 0 2px;\n margin-left: 4px;\n box-shadow: 0px 0px 6px #eee;\n margin-top: 4px;\n}\ndiv.widget-survey-components.compact-style .nps-container .footer {\n padding-top: 12px;\n}\ndiv.widget-survey-components.compact-style .nps-container .choices {\n grid-gap: 12px;\n gap: 12px;\n}\n\ndiv.widget-survey-components,\ndiv.card-survey-style {\n display: flex;\n flex-direction: column;\n grid-gap: 28px;\n gap: 28px;\n flex-grow: 1;\n font-size: 0.875rem;\n overflow: hidden;\n}\ndiv.widget-survey-components .questions,\ndiv.card-survey-style .questions {\n min-width: 100%;\n max-width: 100%;\n display: flex;\n height: 100%;\n position: relative;\n max-height: 560px;\n max-height: var(--compact-widget-max-height);\n}\ndiv.widget-survey-components .question-text,\ndiv.card-survey-style .question-text {\n width: 100%;\n text-align: left;\n}\ndiv.widget-survey-components .focus-lock,\ndiv.card-survey-style .focus-lock {\n width: 100%;\n}\ndiv.widget-survey-components .question-container,\ndiv.card-survey-style .question-container {\n height: -webkit-fit-content;\n height: -moz-fit-content;\n height: fit-content;\n min-width: 100%;\n max-width: 100%;\n margin-bottom: 0;\n padding: 16px 28px;\n grid-gap: 16px;\n gap: 16px;\n flex-grow: 1;\n}\ndiv.widget-survey-components .question-footer,\ndiv.card-survey-style .question-footer {\n margin: 0px auto;\n justify-content: space-between;\n bottom: 0;\n padding-bottom: 20px;\n}\ndiv.widget-survey-components .submit,\ndiv.card-survey-style .submit {\n padding-bottom: 0;\n margin: unset;\n}\ndiv.widget-survey-components .nps-container .footer,\ndiv.card-survey-style .nps-container .footer {\n padding-top: 12px;\n}\ndiv.widget-survey-components .nps-container .widget .choices,\ndiv.card-survey-style .nps-container .widget .choices {\n grid-gap: 8px;\n gap: 8px;\n}\ndiv.widget-survey-components .radio-group,\ndiv.card-survey-style .radio-group {\n width: 100%;\n}\ndiv.widget-survey-components .checkbox-group,\ndiv.card-survey-style .checkbox-group {\n width: 100%;\n flex-wrap: nowrap;\n}\n\ndiv.widget-survey-components .question-container {\n box-shadow: none;\n border-radius: 0;\n}\ndiv.widget-survey-components .question-text {\n font-size: 0.875rem;\n}\ndiv.widget-survey-components .progressbar-container {\n position: absolute;\n}\ndiv.widget-survey-components .progressbar-container .progressbar {\n border-radius: 3px 0 0 0;\n}\ndiv.widget-survey-components .textarea-container .end-max-length {\n padding: 4px;\n}\ndiv.widget-survey-components .responsive-text-field .input-container {\n display: none;\n}\ndiv.widget-survey-components .responsive-text-field .textarea-container {\n display: flex;\n}\ndiv.widget-survey-components div.thankyou {\n min-height: unset;\n}\ndiv.widget-survey-components div.thankyou .text {\n width: 85%;\n}\ndiv.widget-survey-components div.thankyou svg {\n width: 140px;\n height: 120px;\n}\n\ndiv.widget-survey-components.default-style .freemium-survey-step-navigation {\n margin: 0;\n}\ndiv.widget-survey-components.default-style .questions {\n max-height: 400px;\n max-height: var(--default-widget-max-height);\n}\ndiv.widget-survey-components.default-style .question-container {\n padding: 12px 28px;\n}\ndiv.widget-survey-components.default-style .question-footer {\n justify-content: space-between;\n}\ndiv.widget-survey-components.default-style .nps-container .footer {\n padding-top: 12px;\n}\ndiv.widget-survey-components.default-style .nps-container .choices {\n flex-wrap: unset;\n grid-gap: 12px;\n gap: 12px;\n}\ndiv.widget-survey-components.default-style .action-button {\n line-height: 1.2;\n}\ndiv.widget-survey-components.default-style .radio-group {\n flex-direction: row;\n flex-wrap: wrap;\n}\ndiv.widget-survey-components.default-style .radio-group .radio-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n}\ndiv.widget-survey-components.default-style .checkbox-group {\n flex-direction: row;\n flex-wrap: wrap;\n}\ndiv.widget-survey-components.default-style .checkbox-group .checkbox-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n}\ndiv.widget-survey-components.default-style textarea {\n min-height: 84px;\n}\ndiv.widget-survey-components.default-style .end-max-length {\n font-size: 0.8rem;\n font-weight: 300;\n padding: 4px;\n}\n\n.widget-survey-components.cozy-style .freemium-survey-step-navigation {\n margin: 0;\n}\n.widget-survey-components.cozy-style .questions {\n max-height: 380px;\n max-height: var(--cozy-widget-max-height);\n}\n.widget-survey-components.cozy-style .question-text {\n font-size: 1rem;\n}\n.widget-survey-components.cozy-style .question-text.nps {\n text-align: center;\n width: 60%;\n min-width: 600px;\n margin: auto;\n}\n.widget-survey-components.cozy-style .question-container {\n padding: 12px 28px;\n}\n.widget-survey-components.cozy-style .question-footer {\n justify-content: space-between;\n}\n.widget-survey-components.cozy-style .nps-container {\n grid-gap: 44px;\n gap: 44px;\n}\n.widget-survey-components.cozy-style .nps-container .widget {\n display: flex;\n justify-content: center;\n}\n.widget-survey-components.cozy-style .nps-container .button-container {\n width: 60%;\n min-width: 600px;\n margin: 0 auto;\n}\n.widget-survey-components.cozy-style .nps-container .button-container .choices {\n justify-content: space-around;\n}\n.widget-survey-components.cozy-style .nps-container .footer {\n padding-top: 8px;\n}\n.widget-survey-components.cozy-style .action-button {\n line-height: 1.2;\n}\n.widget-survey-components.cozy-style .radio-group {\n flex-direction: row;\n flex-wrap: wrap;\n}\n.widget-survey-components.cozy-style .radio-group .radio-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n}\n.widget-survey-components.cozy-style .checkbox-group {\n flex-direction: row;\n flex-wrap: wrap;\n}\n.widget-survey-components.cozy-style .checkbox-group .checkbox-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n}\n.widget-survey-components.cozy-style textarea {\n min-height: 60px;\n}\n.widget-survey-components.cozy-style .end-max-length {\n font-size: 0.8rem;\n font-weight: 300;\n padding: 4px;\n}\n\n.freemium-survey-components.mobile-preview .thankyou .text {\n width: unset;\n}");const Q=({thankYouQuestion:n,preview:t,placeholders:r,npsValue:i})=>(o((()=>{t||n.type_info.meta?.redirectUrl&&setTimeout((()=>{window.location.href=n.type_info.meta?.redirectUrl}),1e3*(n.type_info.meta?.redirectDelay??1e4))}),[]),e.createElement("div",{className:"question-container thankyou"},e.createElement("div",{className:"heading"},"Thank you!"),e.createElement("div",{className:"text",dangerouslySetInnerHTML:{__html:I(n.text,r,i)}}),n.type_info.meta?.redirectUrl&&e.createElement("div",{style:{width:"100%"}},e.createElement("div",{className:"redirection-text"},"You will be redirected to the below URL automatically in"," ",n.type_info.meta?.redirectDelay," seconds.",e.createElement("br",null)),e.createElement("a",{className:"link",href:n.type_info.meta?.redirectUrl},n?.type_info.meta?.redirectUrl)))),R=({currentBlockIndex:n,currentBlockIndexOfBlocksWithQns:t,blocksWithQns:o,blocks:r,setHorizontalScrollUnits:i,preventQuestionAnimation:a})=>e.createElement("div",{className:"freemium-survey-step-navigation","data-navigation-element":"1"},e.createElement("button",{disabled:0==t.current,className:"navigation-button",onClick:()=>{t.current=Math.max(t.current-1,0),n.current=r.findIndex((e=>e.name===o[t.current].name)),a.current=!1,i(t.current)}},e.createElement(N,null)),e.createElement("button",{className:"navigation-button",disabled:t.current>=o.length-1,onClick:()=>{a.current=!1,t.current=Math.min(t.current+1,o.length-1),n.current=r.findIndex((e=>e.name===o[t.current].name)),i(t.current)}},e.createElement(z,null))),$=({widget:n,widgetStyle:t,surveyStyle:o,formValues:r,othersMeta:i,blocksWithQns:a,blocks:s,thankYouQuestion:c,currentBlockIndexOfBlocksWithQns:u,currentBlockIndexOfBlocks:l,currentEditingBlock:d,isSubmitting:m,isValuesCommitted:f,isCurrentBlockFinal:y,setHorizontalScrollUnits:v,handleFormValues:x,skipBlock:g,setIsSubmitting:h,onSubmit:b,setIsSurveyCompleted:w,preventQuestionAnimation:k,preview:q,closePreview:E,..._})=>{const z=_.blockIndex??u.current,N=_.question??a[z].question,S=()=>N.name===d.current.question.name&&!p.includes(N.type_info.question_type)&&!y(),I=()=>"RANGE"!==N.type_info.question_type&&!N.required&&N.name===d.current.question.name&&!y(),B=()=>"DROPDOWN"===N.type_info.question_type&&N.name!==d.current.question.name&&!N.required&&null!=r[N.name],O=()=>y()&&(n||"standard"!==o)&&N.name===d.current.question.name,F="MULTI_SELECT"===d.current.question.type_info.question_type&&r[d.current.question.name]?.includes("others")&&(!i[d.current.question.name]||""===i[d.current.question.name]);return e.createElement("div",{className:"question-footer"},!(!n&&"standard"===o||0===z&&!r[N.name]||"compact"===t)&&e.createElement(R,{currentBlockIndex:l,currentBlockIndexOfBlocksWithQns:u,blocksWithQns:a,blocks:s,setHorizontalScrollUnits:v,preventQuestionAnimation:k}),(S()||B()||I()||O())&&e.createElement("div",{className:"action-buttons"},S()&&e.createElement(C,{onClick:()=>{x(a[z],null,!0)},disabled:d.current.question.required&&(!r[d.current.question.name]||Array.isArray(r[d.current.question.name])&&0===r[d.current.question.name].length)||d.current.question.type_info.meta?.othersRequired&&F,className:"next-button"},"Next"),I()&&e.createElement("button",{className:"skip-button",onClick:()=>g(N)},"Skip"),B()&&e.createElement("button",{className:"skip-button",onClick:()=>{d.current=a[z],l.current=s.findIndex((e=>e.name===a[z].name)),g(N)}},"Clear selection"),O()&&e.createElement("div",{className:"submit"},e.createElement(C,{disabled:(d.current.question.required||d.current.question.type_info.pivot_question)&&(null==r[d.current.question.name]||0===r[d.current.question.name]?.length)||d.current.question.type_info.meta?.othersRequired&&F||m,onClick:()=>{h(!0),b({...r,others_meta:i},(()=>{c?.type_info.meta?.skipThankYouPage?q?setTimeout((()=>{E?.()}),300):window.location.href=c?.type_info.meta?.redirectUrl:w(!0)}))}},m?"Submitting":"Submit Survey"))))},L=({survey:t,surveyStyle:i="standard",placeholders:a,onSubmit:s,widget:u,npsValue:l,widgetStyle:d,widgetNavigatorQuerySelector:m,preview:f,mobilePreview:y,closePreview:v})=>{const x=t.question_details?.questions||[],g=t.meta?.blocks||[],[h,b]=r(null),[w,k]=r({}),[E,_]=r(!1),[z,N]=r([]),[B,O]=r(0),[F,T]=r(!1),[L,V]=r(null),[Y,D]=r({}),A=n(null),j=n(null),H=n(-1),U=n(null),M=n(0),W=n(0),P=n(!1),G=n([]),X=n(!!l&&"card"===i),K=n(null),Z=n([]);o((()=>{g&&(K.current=g.find((e=>"TY"===e.name)),b(g.filter((e=>"TY"!==e.name))))}),[g]),o((()=>{if(h)if(j.current=x.find((e=>e.type_info?.pivot_question))??x.find((e=>"RANGE"===e.type_info?.question_type))??x[0],null!=l){H.current=l;const e=x.find((e=>e.name===h[0].question_names[0]));A.current={...h[0],question:e},G.current=[...G.current,{...h[0],question:e}],N(G.current),k({Q_1:l})}else if(!A.current&&h.length>0)return A.current=h[0],void ee(h[0])}),[h,l]),o((()=>{z.length&&(G.current=z,W.current=z.length-1),u||"standard"!==i?(U.current&&(U.current.style.maxHeight="unset"),Z.current[M.current]=U.current?.scrollHeight||Z.current[M.current]||0,U.current&&(U.current.style.maxHeight="100%")):U.current?.scrollIntoView({block:"center",behavior:"smooth"}),O(z.length-1)}),[z]),o((()=>{Object.keys(w).length>0&&A.current.question&&(p.includes(A.current.question.type_info.question_type)||P.current)&&!J()&&ne()}),[w]),o((()=>{if(null!=w?.[j.current?.name])if(K.current?.is_based_on_score){const e=j.current?.type_info?.choices[w?.[j.current?.name]]?.dependent_question_names,n=K.current?.question_names.find((n=>e?.includes(n))),t=x.find((e=>e.name===n));V(t)}else{const e=x.find((e=>e.name==K.current?.question_names[0]));V(e)}}),[w?.[j.current?.name]]);const J=()=>M.current===h.length-1||"end"===A.current.branchOption,ee=e=>{let n={};if(e.is_based_on_score){const t=j.current?.type_info?.choices[w?.[j.current?.name]]?.dependent_question_names,o=e.question_names.find((e=>t?.includes(e)));n=x.find((e=>e.name===o))}else n=x.find((n=>n.name===e.question_names[0]));A.current.question=n;G.current.find((e=>e.question.name===n.name))?(O(B+1),W.current+=1):N([...G.current,{...e,question:n}])},ne=()=>{if(J())_(!0);else{if(A.current.nextBlock)M.current=h.findIndex((e=>e.name===A.current.nextBlock));else if(A.current.question.type_info?.meta?.branches){const e=A.current.question.type_info?.meta?.branches,n=w[A.current.question.name];let t;if(t="RANGE"===A.current.question.type_info.question_type?e.find((e=>n>=e.min&&n<=e.max)):e.find((e=>n===e.value)),t?.nextBlock){if("TY"===t.nextBlock)return void _(!0);M.current=h.findIndex((e=>e.name===t.nextBlock))}else M.current+=1}else M.current+=1;A.current=h[M.current],ee(h[M.current])}},te=e=>{P.current=!0,delete w[e.name],k({...w})},oe=(e,n,t)=>{if(X.current=!1,t){if(P.current=!0,null!=w[e.question.name]&&e.name!==z[z.length-1].name){const[t,o]=(e=>{const n=z.findIndex((n=>n.name===e.name)),t=z.slice(0,n+1),o=t.reduce(((e,n)=>(e[n.question.name]=w[n.question.name],e)),{});return M.current=h.findIndex((n=>n.name===e.name)),[t,o]})(e);k({...o,...null!=n&&{[e.question.name]:n}}),G.current=t}else k({...w,...null!=n&&{[e.question.name]:n}});j?.current?.name==e?.question?.name&&(H.current=n)}else k({...w,...null!=n&&{[e.question.name]:n}})},re=(e,n)=>{D({...Y,[e]:n})};return A.current&&A.current.question?E?e.createElement("div",{className:`freemium-survey-components ${u?"widget-survey-components":""} ${d}-style ${y?"mobile-preview":""} ${i}-survey-style`,id:"freemium-survey"},e.createElement(Q,{thankYouQuestion:L,preview:f,placeholders:a,npsValue:H.current})):e.createElement("div",{className:`freemium-survey-components ${u?"widget-survey-components":""} ${d}-style ${y?"mobile-preview":""} ${i}-survey-style`,id:"freemium-survey"},e.createElement(q,{totalSteps:h.length,completedSteps:M.current}),u&&"compact"===d&&document.querySelector(m)&&e.createElement(e.Fragment,null,c.createPortal(e.createElement("div",null,e.createElement(R,{currentBlockIndex:M,currentBlockIndexOfBlocksWithQns:W,blocksWithQns:z,blocks:h,setHorizontalScrollUnits:O,preventQuestionAnimation:X})),document.querySelector(m))),e.createElement("div",{style:u||"card"===i?{transform:`translateX(calc(-${B} * 100%))`,height:`${Z.current[M.current]}px`,transition:X.current||z?.length<=1?"none":"all 600ms ease-out 0ms"}:{},className:"questions"},z.map(((n,t)=>e.createElement("div",{key:n.question.name,ref:U,className:"question-container "+(!u&&"card"!==i||W.current===t?"":"hide-question-container")},e.createElement("div",{className:"question-text "+(0===t?"nps":""),dangerouslySetInnerHTML:{__html:I(n.question.text,a,H.current)},title:`question-${t}`,role:"heading","aria-level":1}),e.createElement("button",{disabled:!u&&"standard"===i,className:"autofocus-button",onKeyDown:e=>{"Tab"===e.key&&(e.stopPropagation(),e.preventDefault())}}),e.createElement(S,{question:n.question,formValues:w,othersMeta:Y,autoFocus:W.current===t,autoFocusDelay:"standard"===i?350:20,saveOthersValue:re,onChangeHandler:e=>{P.current=!1,M.current=h.findIndex((e=>e.name===n.name)),A.current=n,oe(n,e,p.includes(n.question.type_info.question_type)&&!J())}}),e.createElement("button",{disabled:!u&&"standard"===i,className:"autofocus-button",onKeyDown:e=>{"Tab"===e.key&&(e.stopPropagation(),e.preventDefault())}}),e.createElement($,{question:n.question,blockIndex:t,widget:u,widgetStyle:d,surveyStyle:i,formValues:w,othersMeta:Y,blocksWithQns:z,blocks:h,thankYouQuestion:L,currentBlockIndexOfBlocksWithQns:W,currentBlockIndexOfBlocks:M,currentEditingBlock:A,isSubmitting:F,isValuesCommitted:P,isCurrentBlockFinal:J,setHorizontalScrollUnits:O,handleFormValues:oe,skipBlock:te,setIsSubmitting:T,onSubmit:s,setIsSurveyCompleted:_,preventQuestionAnimation:X,preview:f,closePreview:v})))),!u&&"card"!==i&&J()&&e.createElement("div",{className:"submit"},e.createElement(C,{disabled:(A.current.question.required||A.current.question.type_info.pivot_question)&&(null==w[A.current.question.name]||0===w[A.current.question.name]?.length)||A.current.question.type_info.meta?.othersRequired&&"MULTI_SELECT"===A.current.question.type_info.question_type&&w[A.current.question.name]?.includes("")||F,onClick:()=>{T(!0),s({...w,others_meta:Y},(()=>{L?.type_info.meta?.skipThankYouPage?f?setTimeout((()=>{v?.()}),300):window.location.href=L?.type_info.meta?.redirectUrl:_(!0)}))}},F?"Submitting":"Submit Survey")))):null},V=n=>{const{survey:t}=n,o=i((()=>{const e=JSON.parse(JSON.stringify(t)),n=[];return(e.question_details?.questions||[]).forEach((e=>{const t=e.type_info?.meta?.block;t&&(t.question_names||(t.question_names=[e.name]),n.push(t))})),{...e,meta:{...e.meta,blocks:n}}}),[t]);return e.createElement(e.Fragment,null,"standard"===n.surveyStyle||n.widget?e.createElement(L,Object.assign({},n,{survey:o})):e.createElement(T,Object.assign({},n,{survey:o})))};export{_ as BUTTON_SIZE_VARIANTS,C as Button,h as CheckboxGroup,v as Input,l as NPS,q as ProgressBar,k as Radio,w as RadioGroup,V as Survey,x as TextArea};
1
+ import e,{useRef as n,forwardRef as t,useEffect as o,useState as r,useMemo as i}from"react";import{SwitchTransition as a,CSSTransition as s}from"react-transition-group";import c from"react-dom";function u(e,n){void 0===n&&(n={});var t=n.insertAt;if(e&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===t&&o.firstChild?o.insertBefore(r,o.firstChild):o.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}u(".freemium-survey-components .nps-container {\n margin: 0 auto;\n width: 100%;\n display: flex;\n flex-direction: column;\n grid-gap: 28px;\n gap: 28px;\n}\n.freemium-survey-components .nps-container .footer {\n border-top: 1px solid var(--default-background-color);\n border-top: 1px solid var(--background-color, var(--default-background-color));\n padding-top: 20px;\n display: flex;\n justify-content: center;\n font-size: 0.875rem;\n line-height: 1.5;\n color: #666;\n}\n.freemium-survey-components .nps-container .footer:empty {\n display: none;\n}\n.freemium-survey-components .nps-container .nps-scale {\n position: relative;\n}\n.freemium-survey-components .nps-container .nps-scale .button-container {\n display: flex;\n border-radius: 4px;\n justify-content: space-between;\n background: var(--default-background-color);\n background: var(--background-color, var(--default-background-color));\n position: relative;\n margin-bottom: 40px;\n}\n.freemium-survey-components .nps-container .nps-scale .positive-text {\n position: absolute;\n color: #475867;\n bottom: -40px;\n font-size: 12px;\n right: 0px;\n text-align: right;\n}\n.freemium-survey-components .nps-container .nps-scale .negative-text {\n position: absolute;\n color: #475867;\n bottom: -40px;\n font-size: 12px;\n left: 0;\n text-align: left;\n}\n.freemium-survey-components .nps-container .nps-scale span {\n color: #aaa;\n font-size: 0.75rem;\n}\n.freemium-survey-components .nps-container .nps-scale button {\n display: inline-block;\n font-size: 1rem;\n white-space: nowrap;\n vertical-align: middle;\n background: none;\n border: none;\n box-shadow: none;\n cursor: pointer;\n text-align: center;\n font-weight: 400;\n border-radius: 4px;\n margin: 0;\n outline: none;\n margin-left: -1px;\n width: 40px;\n height: 40px;\n transform: scale(1);\n}\n.freemium-survey-components .nps-container .nps-scale button:hover {\n transition: background 0.2s ease-in, border-color 0.2s ease-in, transform 0.2s cubic-bezier(0.5, 2, 0.5, 0.75);\n}\n.freemium-survey-components .nps-container .nps-scale button:hover, .freemium-survey-components .nps-container .nps-scale button:focus {\n color: white;\n transform: scale(1.2);\n z-index: 2;\n position: relative;\n}\n.freemium-survey-components .nps-container .nps-scale button.active {\n color: white;\n transform: scale(1.2);\n z-index: 2;\n position: relative;\n}\n.freemium-survey-components .nps-container .nps-scale.rounded button {\n border-radius: 50%;\n}\n.freemium-survey-components .nps-container .nps-scale.square button {\n border-radius: 0;\n}\n.freemium-survey-components .nps-container .nps-scale.curved button {\n border-radius: 3px;\n}\n.freemium-survey-components .nps-container .nps-scale.highlighted button:hover, .freemium-survey-components .nps-container .nps-scale.highlighted button:focus, .freemium-survey-components .nps-container .nps-scale.highlighted button.active {\n background: var(--default-brand-color) !important;\n background: var(--brand-color, var(--default-brand-color)) !important;\n}\n.freemium-survey-components .nps-container .nps-scale .choices {\n width: 100%;\n display: flex;\n justify-content: space-between;\n font-weight: 500;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .button-container {\n background-color: transparent;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice {\n background: #EBEFF3;\n color: #000;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:focus, .freemium-survey-components .nps-container .nps-scale.standard .choice.active, .freemium-survey-components .nps-container .nps-scale.standard .choice:hover {\n background: #E43E3D;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(1):focus, .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(1).active, .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(1):hover, .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(2):focus, .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(2).active, .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(2):hover {\n background: #00AF50;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(3):hover, .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(4):hover {\n background: #F8C43E;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:hover, .freemium-survey-components .nps-container .nps-scale.standard .choice:focus, .freemium-survey-components .nps-container .nps-scale.standard .choice.active {\n color: #fff;\n transform: scale(1.2);\n}\n\n.freemium-survey-components.mobile-preview .nps-container .nps-scale .button-container {\n background: transparent;\n}\n.freemium-survey-components.mobile-preview .nps-container .nps-scale .choices {\n flex-wrap: wrap;\n justify-content: center;\n grid-gap: 16px;\n gap: 16px;\n background: transparent;\n}\n.freemium-survey-components.mobile-preview .nps-container .nps-scale button {\n border-radius: 50%;\n background: #ebeff3;\n}\n\n@media (max-width: 550px) {\n .freemium-survey-components .nps-container .nps-scale .button-container,\n.card-survey-style .nps-container .nps-scale .button-container {\n background: transparent;\n }\n .freemium-survey-components .nps-container .nps-scale .choices,\n.card-survey-style .nps-container .nps-scale .choices {\n flex-wrap: wrap;\n justify-content: center;\n grid-gap: 16px;\n gap: 16px;\n background: transparent;\n }\n .freemium-survey-components .nps-container .nps-scale button,\n.card-survey-style .nps-container .nps-scale button {\n border-radius: 50%;\n background: #ebeff3;\n }\n}\n.widget-survey-components .nps-container .nps-scale .button-container {\n background: transparent;\n}\n.widget-survey-components .nps-container .nps-scale .choices {\n flex-wrap: wrap;\n justify-content: center;\n grid-gap: 16px;\n gap: 16px;\n background: transparent;\n}\n.widget-survey-components .nps-container .nps-scale button {\n border-radius: 50%;\n background: #ebeff3;\n}");const l=t=>{const{type_info:{linear_scale:{button_style:o="highlighted",button_shape:r="rounded"}={},rating_presets:{start:i="Very unlikely",end:a="Very likely"}={},validation:{min:s},footer_text:c}}=t,u=e=>{switch(e){case e<=6:return"detractor";case e<=8:return"passive";default:return"promoter"}},l=n(Array.from({length:10+(0===s?1:0)},((e,n)=>n+s)));return e.createElement("div",{className:"nps-container","data-test-input":"nps"},e.createElement("div",{className:`nps-scale ${r} ${o}`},e.createElement("div",{className:"button-container"},e.createElement("span",{className:"negative-text",role:"note"},`${s} - ${i}`),e.createElement("span",{className:"positive-text",role:"note"},`${l.current[l.current.length-1]} - ${a}`),e.createElement("div",{className:"choices",role:"radiogroup","aria-required":!0},l.current.map((n=>e.createElement("button",{role:"radio","aria-checked":t.npsValue===n,key:n,"data-test-nps-choice":n,onClick:e=>{t.onChangeHandler(n)},className:`choice ${u(n)} ${t.npsValue===n&&"active"}`},n)))))),e.createElement("div",{className:"footer",role:"note"},c))},d=(e,n)=>(e.defaultProps=n,e);u('.freemium-survey-components .input-container,\n.freemium-survey-components .textarea-container {\n display: flex;\n flex-direction: column;\n width: 100%;\n border-radius: 4px;\n position: relative;\n}\n.freemium-survey-components label.input-label {\n display: inline-block;\n padding-bottom: 8px;\n padding-left: 2px;\n font-size: 0.75rem;\n font-weight: 400;\n}\n.freemium-survey-components label.required::after {\n content: "*";\n position: relative;\n top: 2px;\n font-weight: 500;\n font-size: 0.85rem;\n padding-left: 3px;\n color: #d72d30;\n}\n.freemium-survey-components .input-basic {\n width: 100%;\n display: flex;\n align-items: center;\n border-radius: 4px;\n border: 1px solid var(--default-brand-color);\n border: 1px solid var(--brand-color, var(--default-brand-color));\n transition: border-color 0.2s linear;\n background: #fff;\n}\n.freemium-survey-components .textarea-container .input-basic {\n flex-direction: column;\n align-items: unset;\n}\n.freemium-survey-components .input-basic.error {\n border: 1px solid #d72d30;\n}\n.freemium-survey-components .input-basic.error:hover {\n border: 1px solid #d72d30;\n}\n.freemium-survey-components .input-basic.error[focus-within] {\n box-shadow: none;\n}\n.freemium-survey-components .input-basic.error:focus-within {\n box-shadow: none;\n}\n.freemium-survey-components .input-basic:hover {\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n transition: 0.2s linear;\n}\n.freemium-survey-components .input-basic[focus-within] {\n border: 1px solid transparent;\n box-shadow: 0 0 0 2px var(--default-brand-color);\n box-shadow: 0 0 0 2px var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components .input-basic:focus-within {\n border: 1px solid transparent;\n box-shadow: 0 0 0 2px var(--default-brand-color);\n box-shadow: 0 0 0 2px var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components .end-max-length {\n padding: 0 8px;\n font-size: 0.75rem;\n color: #264966;\n}\n.freemium-survey-components .textarea-container .end-max-length {\n padding: 8px;\n align-self: flex-end;\n}\n.freemium-survey-components span.input-error {\n display: block;\n padding-left: 2px;\n padding-top: 4px;\n font-size: 0.9rem;\n color: #d72d30;\n}\n.freemium-survey-components input[type=text] {\n padding: 6px 12px;\n flex: 1;\n border: unset;\n height: 32px;\n font-size: 1rem;\n /* line-height: ${typography.input.text.lineHeight}; */\n border-radius: 4px;\n}\n.freemium-survey-components input[type=text],\n.freemium-survey-components textarea {\n outline: none;\n border: none;\n}\n.freemium-survey-components input[type=text]::-moz-placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components input[type=text]:-ms-input-placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components input[type=text]::placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components textarea {\n min-height: 116px;\n padding: 12px;\n flex: 1;\n border: unset;\n resize: none;\n font-size: 1rem;\n /* line-height: ${typography.input.text.lineHeight}; */\n border-radius: 4px;\n}\n.freemium-survey-components textarea::-moz-placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components textarea:-ms-input-placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components textarea::placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}');const p=["RANGE","NPS","RADIO","DROPDOWN"],m={isRequired:!1,showCount:!0,isErrored:!1,inline:!1,spellCheck:!1,autoFocusInput:!0},f=t(((t,r)=>{const i=n(null);o((()=>{t.autoFocusInput&&setTimeout((()=>{i.current?.focus()}),600+t.autoFocusDelay)}),[t.autoFocusInput]);const{inputStyle:a,style:s,className:c,showCount:u,isErrored:l,startLabel:d,isRequired:p,errorText:m,endLabel:f,maxLength:v=300,onChange:y,autoFocusInput:g,...x}=t;return e.createElement("div",{className:"input-container",style:s},t.label&&e.createElement("label",{className:"input-label "+(p?"required":"")},t.label),e.createElement("div",null,d&&e.createElement("div",{className:"start-label"},d),e.createElement("div",{className:`input-basic ${l?"error":""}${c||""}`},e.createElement("input",Object.assign({},x,{type:"text",autoComplete:"off",ref:i,style:a,onChange:e=>{e.target.value?.length>v||y?.(e)}})),u&&v>0&&e.createElement("div",{className:"end-max-length"},`${t.value&&t.value.length||0}/${v}`)),f&&e.createElement("div",{className:"end-label"},f)),l&&m&&e.createElement("span",{className:"input-error"},t.errorText))})),v=t(((t,r)=>{const i=n(null);o((()=>{t.autoFocusInput&&setTimeout((()=>{i.current?.focus()}),600+t.autoFocusDelay)}),[t.autoFocusInput]);const{inputStyle:a,style:s,className:c,showCount:u,maxLength:l=1500,startLabel:d,isRequired:p,autoFocusInput:m,onChange:f,...v}=t;return e.createElement(e.Fragment,null,e.createElement("div",{className:"textarea-container",style:s},t.label&&e.createElement("label",{className:"input-label "+(p?"required":"")},t.label),d&&e.createElement("div",{className:"start-label"},d),e.createElement("div",{className:`input-basic ${c||""}`},e.createElement("textarea",Object.assign({},v,{autoComplete:"off",ref:i,style:a,onChange:e=>{e.target.value?.length>l||f?.(e)}})),u&&l&&l>0&&e.createElement("div",{className:"end-max-length"},`${t.value&&t.value.length||0}/${l}`)),t.endLabel&&e.createElement("div",{className:"end-label"},t.endLabel)))})),y=d(f,m),g=d(v,m);u('.freemium-survey-components .checkbox-group {\n width: 100%;\n display: flex;\n grid-gap: 12px;\n gap: 12px;\n flex-direction: column;\n white-space: nowrap;\n flex-wrap: wrap;\n}\n.freemium-survey-components .icon-container {\n display: inline-block;\n flex: 0 0 12px;\n width: 12px;\n height: 12px;\n min-width: 12px;\n min-height: 12px;\n color: inherit;\n position: absolute;\n left: 1px;\n top: 2px;\n}\n.freemium-survey-components .tick-icon {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n height: 100%;\n width: 100%;\n color: inherit;\n fill: currentColor;\n}\n.freemium-survey-components input[type=checkbox] {\n position: absolute;\n clip: rect(0px 0px 0px 0px);\n width: 0px;\n height: 0px;\n}\n.freemium-survey-components input[type=checkbox]:focus ~ .checkbox {\n /* box-shadow: ${pseudo.focus} 0px 0px 0px 2px; */\n box-shadow: var(--default-brand-color) 0px 0px 0px 2px;\n box-shadow: var(--brand-color, var(--default-brand-color)) 0px 0px 0px 2px;\n border-color: transparent;\n}\n.freemium-survey-components .checkbox-label {\n display: flex;\n align-items: baseline;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n text-align: left;\n opacity: 1;\n line-height: 1.2;\n cursor: pointer;\n font-size: 1rem;\n padding: 16px 24px;\n min-width: 200px;\n border: 1px solid #ebeff3;\n box-shadow: 0px 2px 5px rgba(18, 52, 77, 0.06);\n border-radius: 4px;\n white-space: pre-wrap;\n}\n.freemium-survey-components .checkbox-label:hover .checkbox {\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n box-shadow: var(--default-background-color) 0px 0px 0px 5px;\n box-shadow: var(--background-color, var(--default-background-color)) 0px 0px 0px 5px;\n}\n.freemium-survey-components .checkbox-label.disabled {\n opacity: 0.5;\n cursor: "not-allowed";\n}\n.freemium-survey-components .checkbox {\n transition: background-color ease-in 0.2s;\n min-width: 14px;\n min-height: 14px;\n min-height: 14px;\n max-height: 14px;\n border-radius: 2px;\n position: relative;\n margin-right: 16px;\n background-color: #fff;\n border: 1px solid;\n text-align: left;\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components .checkbox:hover {\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n box-shadow: var(--default-background-color) 0px 0px 0px 5px;\n box-shadow: var(--background-color, var(--default-background-color)) 0px 0px 0px 5px;\n}\n.freemium-survey-components input[type=checkbox]:checked ~ .checkbox {\n background-color: var(--default-brand-color);\n background-color: var(--brand-color, var(--default-brand-color));\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components input[type=checkbox]:checked ~ .checkbox:hover {\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components input[type=checkbox]:disabled ~ .checkbox:hover {\n box-shadow: unset;\n border-color: unset;\n}');const x=()=>e.createElement("svg",{id:"tick",className:"tick-icon",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"title",viewBox:"0 0 10 10"},e.createElement("path",{d:"M3 5.87c-.18666814.00267463-.36667109-.06932655-.5-.2L.21 3.41c-.1786328-.17863279-.24839684-.43899577-.1830127-.6830127.06538414-.24401694.25598306-.43461586.5-.5C.77100423 2.16160316 1.0313672 2.23136721 1.21 2.41L3 4.18 6.8.33c.27679776-.27455556.72320224-.27455556 1 0 .13696438.13025306.21450026.31098915.21450026.5S7.93696438 1.19974694 7.8 1.33L3.45 5.67c-.12082534.11896945-.28072735.19003701-.45.2Z",fill:"#fff",fillRule:"evenodd"})),h=({values:t=[],othersValue:i="",options:a,name:s,autoFocusGroup:c,autoFocusDelay:u,onChangeHandler:l,saveOthersValue:d,othersOption:p,othersRequired:m})=>{const[f,v]=r(!1),g=n(null);return o((()=>{c&&setTimeout((()=>{g.current?.focus()}),600+u)}),[c]),e.createElement("div",{className:"checkbox-group"},e.createElement("button",{ref:g,className:"autofocus-button","aria-hidden":!0}),a?.map(((n,o)=>e.createElement(b,{key:n.id,checked:t?.includes(n.value),name:n.value,id:n.id,onChange:(e,o)=>{if(o)l([...t||[],n.value]);else{const e=t.indexOf(n.value);e>-1&&t.splice(e,1),l([...t])}}},n.value))),p&&e.createElement(b,{key:"others",checked:f,name:"others",id:"others",onChange:(e,n)=>{if(v(n),n)l([...t,"others"]);else{const e=t.findIndex((e=>"others"===e));t.splice(e,1),l(t)}}},"Others"),f&&e.createElement(e.Fragment,null,e.createElement(y,{placeholder:"Enter your comment",value:i[s],onChange:e=>{d(s,e.target.value)},autoFocusDelay:10,label:""})))},b=d((t=>{const r=n(null);return o((()=>{t.autoFocus&&setTimeout((()=>{r.current?.focus()}),620)}),[]),e.createElement("label",{className:`checkbox-label ${t.disabled&&"disabled"}`},e.createElement("input",{ref:r,id:t.id,type:"checkbox",name:t.name,readOnly:t.readOnly,disabled:t.disabled,"aria-disabled":t.disabled,checked:t.checked,onChange:t.readOnly?()=>{}:e=>t.onChange(e,e.target.checked)}),e.createElement("div",{className:"checkbox"},t.checked&&e.createElement("div",{className:"icon-container"},e.createElement(x,null)," ")),e.createElement("div",null,t.children))}),{checked:!1});u('.freemium-survey-components .radio-group {\n display: flex;\n grid-gap: 12px;\n gap: 12px;\n white-space: nowrap;\n flex-direction: column;\n width: 100%;\n}\n.freemium-survey-components .radio {\n background-color: #fff;\n border: 1px solid;\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n transition: background-color ease-in 0.2s;\n min-width: 18px;\n max-width: 18px;\n min-height: 18px;\n max-height: 18px;\n border-radius: 50%;\n position: relative;\n margin-right: 16px;\n text-align: left;\n}\n.freemium-survey-components .radio:before {\n left: 3px;\n top: 3px;\n content: "";\n position: absolute;\n width: 10px;\n height: 10px;\n border-radius: 50%;\n transition: all ease-in 0.2s;\n background-color: #fff;\n}\n.freemium-survey-components .radio-label {\n display: flex;\n align-items: baseline;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n text-align: left;\n cursor: pointer;\n line-height: 1.2;\n font-size: 1rem;\n font-weight: 400;\n padding: 16px 24px;\n min-width: 200px;\n border: 1px solid #ebeff3;\n box-shadow: 0px 2px 5px rgba(18, 52, 77, 0.06);\n border-radius: 4px;\n white-space: pre-wrap;\n}\n.freemium-survey-components input[type=radio] {\n position: absolute;\n clip: rect(0, 0, 0, 0);\n width: 0px;\n height: 0px;\n}\n.freemium-survey-components input[type=radio]:focus ~ .radio {\n /* box-shadow: ${pseudo.focus} 0px 0px 0px 3px; */\n box-shadow: var(--default-brand-color) 0px 0px 0px 3px;\n box-shadow: var(--brand-color, var(--default-brand-color)) 0px 0px 0px 3px;\n border-color: transparent;\n}\n.freemium-survey-components input[type=radio]:checked ~ .radio:before {\n background-color: var(--default-brand-color);\n background-color: var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components .radio-label:hover .radio {\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n box-shadow: var(--default-background-color) 0px 0px 0px 5px;\n box-shadow: var(--background-color, var(--default-background-color)) 0px 0px 0px 5px;\n}');const w=({name:t,options:i,value:a,autoFocusGroup:s,autoFocusDelay:c,onChangeHandler:u,saveOthersValue:l,othersOption:d,othersRequired:p,othersValue:m})=>{const[f,v]=r(m??""),[g,x]=r(a),h=n(null);return o((()=>{s&&setTimeout((()=>{h.current?.focus()}),600+c)}),[s]),o((()=>{a||(v(""),x(null))}),[a]),o((()=>{g&&i.find((e=>e.value===g))&&g!==a&&u(g)}),[g]),e.createElement("div",{className:"radio-group",role:"radiogroup"},e.createElement("button",{ref:h,className:"autofocus-button","aria-hidden":!0,tabIndex:-1}),i?.map(((n,o)=>e.createElement(k,{key:n.value,value:n.value,name:t,onChange:e=>{x(e.currentTarget.value)},checked:g===n.value},n.value))),d&&e.createElement(k,{key:"others",value:"others",name:t,onChange:e=>{x("others")},checked:"others"===g},"Others"),"others"===g&&e.createElement(e.Fragment,null,e.createElement(y,{value:f,onChange:e=>v(e.target.value),placeholder:"Enter your comment",label:"",autoFocusDelay:10}),f!==a&&e.createElement(C,{inline:!0,disabled:p&&0===f.length,onClick:()=>{u("others"),l(t,f)}},"Next")))},k=d((t=>{const r=n(null);return o((()=>{t.autoFocus&&setTimeout((()=>{r.current?.focus()}),620)}),[]),e.createElement("label",{className:"radio-label"},e.createElement("input",{ref:r,type:"radio",name:t.name,value:t.value,checked:t.checked,onChange:t.onChange}),e.createElement("div",{className:"radio"}),e.createElement("div",null,t.children))}),{checked:!1,autoFocus:!1});u(".progressbar-container {\n width: 100%;\n height: 4px;\n position: fixed;\n top: 0;\n left: 0;\n z-index: 1;\n text-align: left;\n}\n\n.progressbar {\n transition: transform 0.25s linear;\n transform-origin: left;\n height: 100%;\n background-color: var(--default-brand-color);\n background-color: var(--brand-color, var(--default-brand-color));\n}");const q=n=>{const{totalSteps:t,completedSteps:o}=n;return e.createElement("div",{className:"progressbar-container"},e.createElement("div",{className:"progressbar",style:{width:(o>0?100/t:0)+"%",transform:`scaleX(${o})`}}))};u(".freemium-survey-components .action-button {\n width: auto;\n display: block;\n padding: 8px 16px;\n cursor: pointer;\n line-height: 1.5;\n text-align: center;\n font-weight: 500;\n letter-spacing: 0.3px;\n border-radius: 4px;\n white-space: nowrap;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n color: --default-button-text-color;\n color: var(--button-text-color, --default-button-text-color);\n background: var(--default-brand-color);\n background: var(--brand-color, var(--default-brand-color));\n border: 1px solid var(--default-brand-color);\n border: 1px solid var(--brand-color, var(--default-brand-color));\n border-radius: 4px;\n min-width: 200px;\n max-width: -webkit-fit-content;\n max-width: -moz-fit-content;\n max-width: fit-content;\n transform: translateY(0px);\n transition: transform ease 0.2s;\n}\n.freemium-survey-components .action-button:not([disabled]):hover {\n transform: translateY(-4px);\n}\n.freemium-survey-components .action-button[disabled] {\n cursor: not-allowed;\n opacity: 0.6;\n}\n.freemium-survey-components button:focus:not(:active) {\n /* box-shadow: 0 0 0 2px ${pseudo.focus}; */\n}\n\n@media (max-width: 550px) {\n .freemium-survey-components .action-button {\n min-width: 120px;\n }\n}\n.widget-survey-components .action-button {\n min-width: 120px;\n}\n\n.freemium-survey-components.mobile-preview .action-button {\n min-width: 120px;\n}");const E=()=>e.createElement(e.Fragment,null,"..."),_={LARGE:"large",MINI:"mini",NORMAL:"normal"},C=n=>{const{inline:t=!1,children:o,disabled:r,className:i="",htmlType:a,type:s="primary",onClick:c,size:u,overrideStyleClassName:l="",loading:d=!1,...p}=n;return e.createElement("button",Object.assign({style:t?{display:"inline-block"}:{},disabled:r,className:`action-button ${i} ${l}`,type:a,onClick:c},p),d?e.createElement(E,null):o)},z=()=>e.createElement("svg",{style:{display:"block"},width:"9",height:"14",viewBox:"0 0 10 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M7.82585 6.15754C7.98999 6.32147 8.08232 6.54389 8.08252 6.77587L8.08252 7.2192C8.07983 7.45069 7.98788 7.6722 7.82585 7.83754L1.82919 13.8225C1.77496 13.8772 1.71044 13.9206 1.63936 13.9502C1.56827 13.9798 1.49203 13.9951 1.41502 13.9951C1.33801 13.9951 1.26177 13.9798 1.19068 13.9502C1.1196 13.9206 1.05508 13.8772 1.00085 13.8225L0.172521 12.9942C0.118197 12.941 0.0750381 12.8774 0.0455752 12.8073C0.0161124 12.7372 0.000937578 12.6619 0.000937585 12.5859C0.000937592 12.5098 0.0161125 12.4345 0.0455753 12.3644C0.0750381 12.2943 0.118197 12.2308 0.172521 12.1775L5.36419 6.99754L0.172522 1.81754C0.117847 1.76331 0.0744506 1.69879 0.0448352 1.62771C0.0152208 1.55662 -2.75162e-05 1.48038 -2.75094e-05 1.40337C-2.75027e-05 1.32636 0.0152208 1.25012 0.0448353 1.17904C0.0744507 1.10795 0.117847 1.04343 0.172522 0.989205L1.00086 0.172537C1.05508 0.117862 1.1196 0.0744661 1.19069 0.0448507C1.26177 0.0152353 1.33801 -1.20337e-05 1.41502 -1.2027e-05C1.49203 -1.20203e-05 1.56827 0.0152353 1.63936 0.0448507C1.71044 0.0744661 1.77496 0.117862 1.82919 0.172537L7.82585 6.15754Z",fill:"#6B6B6B"})),N=()=>e.createElement("svg",{style:{display:"block"},width:"9",height:"14",viewBox:"0 0 10 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M0.256667 7.83755C0.0925257 7.67361 0.000204227 7.4512 0 7.21921V6.77588C0.00268801 6.5444 0.0946357 6.32289 0.256667 6.15755L6.25333 0.172549C6.30756 0.117874 6.37208 0.0744776 6.44316 0.0448625C6.51425 0.0152474 6.59049 0 6.6675 0C6.74451 0 6.82075 0.0152474 6.89184 0.0448625C6.96292 0.0744776 7.02744 0.117874 7.08167 0.172549L7.91 1.00088C7.96432 1.05411 8.00748 1.11764 8.03694 1.18776C8.06641 1.25787 8.08158 1.33316 8.08158 1.40922C8.08158 1.48527 8.06641 1.56056 8.03694 1.63067C8.00748 1.70079 7.96432 1.76432 7.91 1.81755L2.71833 6.99755L7.91 12.1775C7.96467 12.2318 8.00807 12.2963 8.03769 12.3674C8.0673 12.4385 8.08255 12.5147 8.08255 12.5917C8.08255 12.6687 8.0673 12.745 8.03769 12.8161C8.00807 12.8871 7.96467 12.9517 7.91 13.0059L7.08167 13.8225C7.02744 13.8772 6.96292 13.9206 6.89184 13.9502C6.82075 13.9799 6.74451 13.9951 6.6675 13.9951C6.59049 13.9951 6.51425 13.9799 6.44316 13.9502C6.37208 13.9206 6.30756 13.8772 6.25333 13.8225L0.256667 7.83755Z",fill:"#6B6B6B"})),S=({question:n,formValues:t,othersMeta:o,onChangeHandler:r,saveOthersValue:i,autoFocus:a,autoFocusDelay:s})=>{switch(n.type_info.question_type){case"RANGE":return e.createElement(l,{type_info:n.type_info,onChangeHandler:r,npsValue:t[n.name]});case"CHECKBOX":case"MULTI_SELECT":return e.createElement(h,{name:n.name,autoFocusGroup:a,values:t[n.name],othersValue:o[n.name],options:n.type_info.choices,onChangeHandler:r,saveOthersValue:i,othersOption:n.type_info.meta?.othersOption,othersRequired:n.type_info.meta?.othersRequired,autoFocusDelay:s});case"RADIO":case"DROPDOWN":return e.createElement(w,{autoFocusGroup:a,autoFocusDelay:s,name:n.name,onChangeHandler:r,saveOthersValue:i,options:n.type_info.choices,value:t[n.name],othersValue:o[n.name],othersOption:n.type_info.meta?.othersOption,othersRequired:n.type_info.meta?.othersRequired});case"INPUT":case"TEXT":return n.type_info?.meta?.readOnly?e.createElement("div",{className:"message-container"},n.type_info?.meta?.value):e.createElement("div",{className:"responsive-text-field"},e.createElement(y,{autoFocusInput:a,autoFocusDelay:s,label:"",isRequired:n.is_required,value:t[n.name]||"",placeholder:n.type_info?.meta?.placeholder??"",onChange:e=>r(e.target.value)}),e.createElement(g,{autoFocusInput:a,autoFocusDelay:s,label:"",isRequired:n.is_required,placeholder:n.type_info?.meta?.placeholder??"",value:t[n.name]||"",onChange:e=>r(e.target.value)}));case"PARAGRAPH":return e.createElement(g,{autoFocusInput:a,autoFocusDelay:s,label:"",isRequired:n.is_required,placeholder:n.type_info?.meta?.placeholder??"",value:t[n.name]||"",onChange:e=>r(e.target.value)});default:return console.error(`Question type ${n.type_info.question_type} not found`),null}},B=(e,n,t)=>{if(e){let o={"{{nps.rating}}":t};n&&(o={...o,...n});const r=new RegExp(Object.keys(o).join("|"),"gi");e=e.replace(r,(function(e){return o[e.toLowerCase()]}))}return e};u(":root {\n --default-brand-color: #264966;\n --default-question-text-color: #000;\n --default-question-background-color: #fff;\n --default-background-color: #f8f8f8;\n --default-button-text-color: #fff;\n --default-secondary-button-text-color: #000;\n --default-input-placeholder-color: #92a2b1;\n --compact-widget-max-height: 560px;\n --default-widget-max-height: 400px;\n --cozy-widget-max-height: 380px;\n}\n\n.freemium-survey-step-navigation {\n padding: 0 2px;\n box-shadow: 0px 0px 6px #eee;\n white-space: nowrap;\n}\n.freemium-survey-step-navigation .navigation-button {\n width: 38px;\n text-align: -webkit-center;\n height: 38px;\n background-color: #fff;\n border: none;\n cursor: pointer;\n border-radius: 0 3px 3px 0;\n}\n.freemium-survey-step-navigation .navigation-button svg {\n transform: rotate(90deg);\n}\n.freemium-survey-step-navigation .navigation-button:first-of-type {\n border-right: 1px solid #d9d9d9;\n border-radius: 3px 0 0 3px;\n}\n.freemium-survey-step-navigation .navigation-button:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n.freemium-survey-step-navigation .navigation-button:focus {\n position: relative;\n z-index: 1;\n}\n\n.freemium-survey-components .question-container {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n text-align: center;\n max-width: 700px;\n margin: 0 auto;\n background: var(--default-question-background-color);\n background: var(--question-background-color, var(--default-question-background-color));\n border-radius: 4px;\n transition: transform 500ms ease 0ms, opacity 200ms ease 0ms;\n box-shadow: 0px 12px 15px rgba(18, 52, 77, 0.03);\n margin-bottom: 28px;\n padding: 28px;\n grid-gap: 28px;\n gap: 28px;\n position: relative;\n height: -webkit-fit-content;\n height: -moz-fit-content;\n height: fit-content;\n transition: opacity 50ms ease-out;\n overflow: auto;\n}\n.freemium-survey-components .hide-question-container {\n opacity: 0;\n}\n.freemium-survey-components .question-text {\n font-size: 1rem;\n font-weight: 600;\n line-height: 1.8;\n width: 100%;\n text-align: left;\n color: var(--default-question-text-color);\n color: var(--question-text-color, var(--default-question-text-color));\n}\n.freemium-survey-components .autofocus-button {\n border: none;\n width: 0;\n height: 0;\n opacity: 0;\n margin-top: -12px;\n margin-left: -12px;\n position: absolute;\n}\n.freemium-survey-components .radio-group,\n.freemium-survey-components .checkbox-group {\n max-height: 420px;\n overflow: auto;\n}\n.freemium-survey-components .fade-enter .question-container {\n opacity: 0;\n transform: translateY(30px);\n}\n.freemium-survey-components .fade-enter-active .question-container {\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components .fade-exit .question-container {\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components .fade-exit-active .question-container {\n opacity: 0;\n transform: translateY(-30px);\n}\n.freemium-survey-components .fade-enter-active .question-container,\n.freemium-survey-components .fade-exit-active .question-container {\n transition: opacity 300ms, transform 300ms;\n}\n.freemium-survey-components .fade-reverse-enter .question-container {\n opacity: 0;\n transform: translateY(-30px);\n}\n.freemium-survey-components .fade-reverse-enter-active .question-container {\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components .fade-reverse-exit .question-container {\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components .fade-reverse-exit-active .question-container {\n opacity: 0;\n transform: translateY(30px);\n}\n.freemium-survey-components .fade-reverse-enter-active .question-container,\n.freemium-survey-components .fade-reverse-exit-active .question-container {\n transition: opacity 300ms, transform 300ms;\n}\n.freemium-survey-components .question-footer {\n display: flex;\n justify-content: flex-end;\n grid-gap: 40px;\n gap: 40px;\n width: 100%;\n align-items: center;\n}\n.freemium-survey-components .question-footer:empty {\n display: none;\n}\n.freemium-survey-components .action-buttons {\n display: flex;\n grid-gap: 20px;\n gap: 20px;\n flex-direction: row-reverse;\n}\n.freemium-survey-components .action-buttons:empty {\n display: none;\n}\n.freemium-survey-components .skip-button {\n font-weight: 400;\n cursor: pointer;\n background: transparent;\n border: none;\n min-width: 40px;\n padding: 8px 16px;\n border-radius: 4px;\n color: var(--default-secondary-button-text-color);\n color: var(--secondary-button-text-color, var(--default-secondary-button-text-color));\n letter-spacing: 0.05rem;\n line-height: 1.5;\n border: 1px solid transparent;\n}\n.freemium-survey-components .skip-button:hover {\n background-color: #f3f3f3;\n}\n.freemium-survey-components .next-button {\n color: var(--default-button-text-color);\n color: var(--button-text-color, var(--default-button-text-color));\n}\n.freemium-survey-components .submit {\n max-width: 700px;\n margin: 0 auto;\n text-align: left;\n background: transparent;\n box-shadow: none;\n color: var(--default-button-text-color);\n color: var(--button-text-color, var(--default-button-text-color));\n}\n.freemium-survey-components .thankyou {\n display: flex;\n align-items: center;\n justify-content: center;\n grid-gap: 20px;\n gap: 20px;\n min-height: 180px;\n}\n.freemium-survey-components .thankyou .heading {\n font-weight: 600;\n font-size: 28px;\n}\n.freemium-survey-components .thankyou .text {\n white-space: pre-wrap;\n font-weight: 500;\n font-size: 0.875rem;\n line-height: 1.6;\n color: #12344d;\n width: 75%;\n}\n.freemium-survey-components .thankyou .redirection-text {\n color: #929292;\n margin-bottom: 12px;\n font-weight: 300;\n}\n.freemium-survey-components .thankyou .link {\n width: 100%;\n display: inline-block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: #666;\n font-weight: 500;\n text-decoration: underline;\n}\n.freemium-survey-components .responsive-text-field {\n width: 100%;\n}\n.freemium-survey-components .responsive-text-field .textarea-container {\n display: none;\n}\n.freemium-survey-components .message-container:empty {\n display: none;\n}\n\n@media (max-width: 550px) {\n .freemium-survey-component .responsive-text-field .input-container,\n.card-survey-style .responsive-text-field .input-container {\n display: none;\n }\n .freemium-survey-component .responsive-text-field .textarea-container,\n.card-survey-style .responsive-text-field .textarea-container {\n display: flex;\n }\n}\ndiv.widget-survey-components.compact-style .freemium-survey-step-navigation {\n padding: 0 2px;\n margin-left: 4px;\n box-shadow: 0px 0px 6px #eee;\n margin-top: 4px;\n}\ndiv.widget-survey-components.compact-style .nps-container .footer {\n padding-top: 12px;\n}\ndiv.widget-survey-components.compact-style .nps-container .choices {\n grid-gap: 12px;\n gap: 12px;\n}\n\ndiv.widget-survey-components,\ndiv.card-survey-style {\n display: flex;\n flex-direction: column;\n grid-gap: 28px;\n gap: 28px;\n padding: 40px 0;\n flex-grow: 1;\n font-size: 0.875rem;\n overflow: hidden;\n}\ndiv.widget-survey-components .questions,\ndiv.card-survey-style .questions {\n min-width: 100%;\n max-width: 100%;\n display: flex;\n position: relative;\n}\ndiv.widget-survey-components .question-text,\ndiv.card-survey-style .question-text {\n width: 100%;\n text-align: left;\n}\ndiv.widget-survey-components .focus-lock,\ndiv.card-survey-style .focus-lock {\n width: 100%;\n}\ndiv.widget-survey-components .question-container,\ndiv.card-survey-style .question-container {\n height: -webkit-fit-content;\n height: -moz-fit-content;\n height: fit-content;\n min-width: 100%;\n max-width: 100%;\n margin-bottom: 0;\n padding: 28px;\n grid-gap: 28px;\n gap: 28px;\n flex-grow: 1;\n}\ndiv.widget-survey-components .question-footer,\ndiv.card-survey-style .question-footer {\n margin: 0px auto;\n justify-content: space-between;\n position: -webkit-sticky;\n position: sticky;\n bottom: 0;\n}\ndiv.widget-survey-components .submit,\ndiv.card-survey-style .submit {\n padding-bottom: 0;\n margin: unset;\n}\ndiv.widget-survey-components .nps-container .footer,\ndiv.card-survey-style .nps-container .footer {\n padding-top: 12px;\n}\ndiv.widget-survey-components .nps-container .widget .choices,\ndiv.card-survey-style .nps-container .widget .choices {\n grid-gap: 8px;\n gap: 8px;\n}\ndiv.widget-survey-components .radio-group,\ndiv.card-survey-style .radio-group {\n width: 100%;\n}\ndiv.widget-survey-components .checkbox-group,\ndiv.card-survey-style .checkbox-group {\n width: 100%;\n flex-wrap: nowrap;\n}\n\ndiv.widget-survey-components .question-container {\n box-shadow: none;\n border-radius: 0;\n}\ndiv.widget-survey-components .question-text {\n font-size: 0.875rem;\n}\ndiv.widget-survey-components .progressbar-container {\n position: absolute;\n}\ndiv.widget-survey-components .progressbar-container .progressbar {\n border-radius: 3px 0 0 0;\n}\ndiv.widget-survey-components .textarea-container .end-max-length {\n padding: 4px;\n}\ndiv.widget-survey-components .responsive-text-field .input-container {\n display: none;\n}\ndiv.widget-survey-components .responsive-text-field .textarea-container {\n display: flex;\n}\ndiv.widget-survey-components div.thankyou {\n min-height: unset;\n}\ndiv.widget-survey-components div.thankyou .text {\n width: 85%;\n}\ndiv.widget-survey-components div.thankyou svg {\n width: 140px;\n height: 120px;\n}\n\ndiv.widget-survey-components.default-style .freemium-survey-step-navigation {\n margin: 0;\n}\ndiv.widget-survey-components.default-style .questions {\n max-height: 400px;\n max-height: var(--default-widget-max-height);\n}\ndiv.widget-survey-components.default-style .question-container {\n padding: 28px;\n}\ndiv.widget-survey-components.default-style .question-footer {\n justify-content: space-between;\n}\ndiv.widget-survey-components.default-style .nps-container .footer {\n padding-top: 12px;\n}\ndiv.widget-survey-components.default-style .nps-container .choices {\n flex-wrap: unset;\n grid-gap: 12px;\n gap: 12px;\n}\ndiv.widget-survey-components.default-style .action-button {\n line-height: 1.2;\n}\ndiv.widget-survey-components.default-style .radio-group {\n flex-direction: row;\n flex-wrap: wrap;\n}\ndiv.widget-survey-components.default-style .radio-group .radio-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n}\ndiv.widget-survey-components.default-style .checkbox-group {\n flex-direction: row;\n flex-wrap: wrap;\n}\ndiv.widget-survey-components.default-style .checkbox-group .checkbox-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n}\ndiv.widget-survey-components.default-style textarea {\n min-height: 84px;\n}\ndiv.widget-survey-components.default-style .end-max-length {\n font-size: 0.8rem;\n font-weight: 300;\n padding: 4px;\n}\n\n.widget-survey-components.cozy-style .freemium-survey-step-navigation {\n margin: 0;\n}\n.widget-survey-components.cozy-style .questions {\n max-height: 380px;\n max-height: var(--cozy-widget-max-height);\n}\n.widget-survey-components.cozy-style .question-text {\n font-size: 1rem;\n}\n.widget-survey-components.cozy-style .question-text.nps {\n text-align: center;\n width: 60%;\n min-width: 600px;\n margin: auto;\n}\n.widget-survey-components.cozy-style .question-container {\n padding: 12px 28px;\n}\n.widget-survey-components.cozy-style .question-footer {\n justify-content: space-between;\n}\n.widget-survey-components.cozy-style .nps-container {\n grid-gap: 44px;\n gap: 44px;\n}\n.widget-survey-components.cozy-style .nps-container .widget {\n display: flex;\n justify-content: center;\n}\n.widget-survey-components.cozy-style .nps-container .button-container {\n width: 60%;\n min-width: 600px;\n margin: 0 auto;\n}\n.widget-survey-components.cozy-style .nps-container .button-container .choices {\n justify-content: space-around;\n}\n.widget-survey-components.cozy-style .nps-container .footer {\n padding-top: 8px;\n}\n.widget-survey-components.cozy-style .action-button {\n line-height: 1.2;\n}\n.widget-survey-components.cozy-style .radio-group {\n flex-direction: row;\n flex-wrap: wrap;\n}\n.widget-survey-components.cozy-style .radio-group .radio-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n}\n.widget-survey-components.cozy-style .checkbox-group {\n flex-direction: row;\n flex-wrap: wrap;\n}\n.widget-survey-components.cozy-style .checkbox-group .checkbox-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n}\n.widget-survey-components.cozy-style textarea {\n min-height: 60px;\n}\n.widget-survey-components.cozy-style .end-max-length {\n font-size: 0.8rem;\n font-weight: 300;\n padding: 4px;\n}\n\n.freemium-survey-components.mobile-preview .thankyou .text {\n width: unset;\n}");const I=({thankYouQuestion:n,preview:t,placeholders:r,npsValue:i})=>(o((()=>{t||n.type_info.meta?.redirectUrl&&setTimeout((()=>{window.location.href=n.type_info.meta?.redirectUrl}),n.type_info.meta?.redirectDelay??1e4)}),[]),e.createElement("div",{className:"question-container thankyou"},e.createElement("div",{className:"heading"},"Thank you!"),e.createElement("div",{className:"text",dangerouslySetInnerHTML:{__html:B(n.text,r,i)}}),n.type_info.meta?.redirectUrl&&e.createElement("div",{style:{width:"100%"}},e.createElement("div",{className:"redirection-text"},"You will be redirected to the below URL automatically in"," ",n.type_info.meta?.redirectDelay," seconds.",e.createElement("br",null)),e.createElement("a",{className:"link",href:n.type_info.meta?.redirectUrl},n?.type_info.meta?.redirectUrl)))),O=({currentBlockIndex:n,currentBlockIndexOfBlocksWithQns:t,blocksWithQns:o,blocks:r,setHorizontalScrollUnits:i,preventQuestionAnimation:a,tempCurrentBlockIndexOfBlocksWithQns:s,setReverse:c,reverse:u})=>e.createElement("div",{className:"freemium-survey-step-navigation","data-navigation-element":"1"},e.createElement("button",{disabled:0==t.current,className:"navigation-button",onClick:()=>{u?t.current=Math.max(t.current-1,0):s.current=Math.max(t.current-1,0),a.current=!1,c(!0),i(t.current)}},e.createElement(N,null)),e.createElement("button",{className:"navigation-button",disabled:t.current>=o.length-1,onClick:()=>{a.current=!1,u?s.current=Math.min(t.current+1,o.length-1):t.current=Math.min(t.current+1,o.length-1),c(!1),i(t.current)}},e.createElement(z,null))),F=({widget:n,widgetStyle:t,surveyStyle:o,formValues:r,blocksWithQns:i,blocks:a,thankYouQuestion:s,currentBlockIndexOfBlocksWithQns:c,currentBlockIndexOfBlocks:u,currentEditingBlock:l,isSubmitting:d,isValuesCommitted:m,isCurrentBlockFinal:f,setHorizontalScrollUnits:v,handleFormValues:y,skipBlock:g,setIsSubmitting:x,onSubmit:h,setIsSurveyCompleted:b,preventQuestionAnimation:w,preview:k,closePreview:q,setReverse:E,tempCurrentBlockIndexOfBlocksWithQns:_,question:z,reverse:N,othersMeta:S,...B})=>{const I=B.blockIndex??c.current,F=()=>!p.includes(z.type_info.question_type)&&!f(),T=()=>"RANGE"!==z.type_info.question_type&&!z.required&&!f(),Q=()=>"DROPDOWN"===z.type_info.question_type&&!z.required&&null!=r[z.name],R=()=>f()&&(n||"standard"!==o),$="MULTI_SELECT"===l.current.question.type_info.question_type&&r[l.current.question.name]?.includes("others")&&(!S[l.current.question.name]||""===S[l.current.question.name]);return e.createElement("div",{className:"question-footer"},!(!n&&"standard"===o||0===I&&!r[z.name]||"compact"===t)&&e.createElement(O,{currentBlockIndex:u,currentBlockIndexOfBlocksWithQns:c,blocksWithQns:i,blocks:a,setHorizontalScrollUnits:v,preventQuestionAnimation:w,setReverse:E,tempCurrentBlockIndexOfBlocksWithQns:_,reverse:N}),(F()||Q()||T()||R())&&e.createElement("div",{className:"action-buttons"},F()&&e.createElement(C,{onClick:()=>{E(!1),y(i[I],null,!0)},disabled:l.current.question.required&&(!r[l.current.question.name]||Array.isArray(r[l.current.question.name])&&0===r[l.current.question.name].length)||l.current.question.type_info.meta?.othersRequired&&$,className:"next-button"},"Next"),T()&&e.createElement("button",{className:"skip-button",onClick:()=>{E(!1),g(z)}},"Skip"),R()&&e.createElement("div",{className:"submit"},e.createElement(C,{disabled:(l.current.question.required||l.current.question.type_info.pivot_question)&&(null==r[l.current.question.name]||0===r[l.current.question.name]?.length)||l.current.question.type_info.meta?.othersRequired&&$||d,onClick:()=>{x(!0),h({...r,others_meta:S},(()=>{s?.type_info.meta?.skipThankYouPage?k?setTimeout((()=>{q?.()}),300):window.location.href=s?.type_info.meta?.redirectUrl:b(!0)}))}},d?"Submitting":"Submit Survey")),Q()&&e.createElement("button",{className:"skip-button",onClick:()=>{l.current=i[I],u.current=a.findIndex((e=>e.name===i[I].name)),g(z)}},"Clear selection")))},T=({survey:t,surveyStyle:i="standard",placeholders:c,onSubmit:u,widget:l,npsValue:d,widgetStyle:m,widgetNavigatorQuerySelector:f,preview:v,mobilePreview:y,closePreview:g})=>{const x=t.question_details?.questions||[],h=t.meta?.blocks||[],[b,w]=r(null),[k,E]=r({}),[_,C]=r(!1),[z,N]=r([]),[O,T]=r(0),[Q,R]=r(!1),[$,L]=r(null),[V,D]=r({}),A=n(null),j=n(null),H=n(-1),U=n(null),Y=n(0),M=n(0),W=n(!1),P=n([]),G=e.useRef(!!d&&"card"===i),X=n(null),K=n(0),[Z,J]=r(!1);o((()=>{h&&(X.current=h.find((e=>"TY"===e.name)),w(h.filter((e=>"TY"!==e.name))))}),[h]),o((()=>{M.current=K.current,b&&z&&(Y.current=b.findIndex((e=>e.name===z[K.current].name))),T(O+1)}),[Z]),o((()=>{if(b)if(j.current=x.find((e=>e.type_info?.pivot_question))??x.find((e=>"RANGE"===e.type_info?.question_type))??x[0],null!=d){H.current=d;const e=x.find((e=>e.name===b[0].question_names[0]));A.current={...b[0],question:e},P.current=[...P.current,{...b[0],question:e}],N(P.current),E({Q_1:d})}else if(!A.current&&b.length>0)return A.current=b[0],void ne(b[0])}),[b,d]),e.useEffect((()=>{z.length&&(P.current=z,M.current=z.length-1),T(z.length-1)}),[z]),o((()=>{Object.keys(k).length>0&&A.current.question&&(p.includes(A.current.question.type_info.question_type)||W.current)&&!ee()&&te()}),[k]),o((()=>{if(null!=k?.[j.current?.name])if(X.current?.is_based_on_rating){const e=j.current?.type_info?.choices[k?.[j.current?.name]]?.dependent_question_names,n=X.current?.question_names.find((n=>e?.includes(n))),t=x.find((e=>e.name===n));L(t)}else{const e=x.find((e=>e.name==X.current?.question_names[0]));L(e)}}),[k?.[j.current?.name]]);const ee=()=>(Y.current===b.length-1||"end"===A.current.branchOption)&&M.current===z.length-1,ne=e=>{let n={};if(e.is_based_on_rating){const t=j.current?.type_info?.choices[k?.[j.current?.name]]?.dependent_question_names,o=e.question_names.find((e=>t?.includes(e)));n=x.find((e=>e.name===o))}else n=x.find((n=>n.name===e.question_names[0]));A.current.question=n;P.current.find((e=>e.question.name===n.name))?(T(O+1),M.current+=1):N([...P.current,{...e,question:n}])},te=()=>{if(ee())C(!0);else{if(A.current.nextBlock)Y.current=b.findIndex((e=>e.name===A.current.nextBlock));else if(A.current.question.type_info?.meta?.branches){const e=A.current.question.type_info?.meta?.branches,n=k[A.current.question.name];let t;if(t="RANGE"===A.current.question.type_info.question_type?e.find((e=>n>=e.min&&n<=e.max)):e.find((e=>n===e.value)),t?.nextBlock){if("TY"===t.nextBlock)return void C(!0);Y.current=b.findIndex((e=>e.name===t.nextBlock))}else Y.current+=1}else Y.current+=1;A.current=b[Y.current],ne(b[Y.current])}},oe=(e,n,t)=>{if(G.current=!1,t){if(W.current=!0,null!=k[e.question.name]&&e.name!==z[z.length-1].name){const[t,o]=(e=>{const n=z.findIndex((n=>n.name===e.name)),t=z.slice(0,n+1),o=t.reduce(((e,n)=>(e[n.question.name]=k[n.question.name],e)),{});return Y.current=b.findIndex((n=>n.name===e.name)),[t,o]})(e);E({...o,...null!=n&&{[e.question.name]:n}}),P.current=t}else E({...k,...null!=n&&{[e.question.name]:n}});j?.current?.name==e?.question?.name&&(H.current=n)}else E({...k,...null!=n&&{[e.question.name]:n}})};if(!A.current||!A.current.question)return null;const re=z[M.current];return e.createElement("div",{className:`freemium-survey-components ${l?"widget-survey-components":""} ${m}-style ${y?"mobile-preview":""} ${i}-survey-style`,id:"freemium-survey"},e.createElement(q,{totalSteps:b.length,completedSteps:Y.current+(_?1:0)}),e.createElement(a,{mode:"out-in"},e.createElement(s,{key:M.current+String(_),addEndListener:(e,n)=>{e.addEventListener("transitionend",n,!1)},classNames:Z?"fade-reverse":"fade"},e.createElement("div",{className:"questions"},_?e.createElement(I,{thankYouQuestion:$,preview:v,placeholders:c,npsValue:H.current}):e.createElement("div",{ref:U,id:`${re.question.name}`,className:`question-container ${l||"card"===i}`},e.createElement("div",{className:"question-text",dangerouslySetInnerHTML:{__html:B(re.question.text,c,H.current)},title:`question-${M.current}`,role:"heading","aria-level":1}),e.createElement("div",{onTransitionEndCapture:e=>e.stopPropagation(),style:{width:"100%"}},e.createElement(S,{question:re.question,formValues:k,othersMeta:V,autoFocus:!0,autoFocusDelay:"standard"===i?350:0,saveOthersValue:(e,n)=>{D({...V,[e]:n})},onChangeHandler:e=>{W.current=!1,Y.current=b.findIndex((e=>e.name===re.name)),A.current=re,J(!1),oe(re,e,p.includes(re.question.type_info.question_type)&&!ee())}})),e.createElement(F,{question:re.question,widget:l,widgetStyle:m,surveyStyle:i,formValues:k,othersMeta:V,blocksWithQns:z,blocks:b,thankYouQuestion:$,currentBlockIndexOfBlocksWithQns:M,reverse:Z,setReverse:J,currentBlockIndexOfBlocks:Y,currentEditingBlock:A,isSubmitting:Q,isValuesCommitted:W,isCurrentBlockFinal:ee,setHorizontalScrollUnits:T,handleFormValues:oe,skipBlock:e=>{W.current=!0,delete k[e.name],E({...k})},setIsSubmitting:R,onSubmit:u,setIsSurveyCompleted:C,preventQuestionAnimation:G,preview:v,closePreview:g,tempCurrentBlockIndexOfBlocksWithQns:K}))))))};u(":root {\n --default-brand-color: #264966;\n --default-question-text-color: #000;\n --default-question-background-color: #fff;\n --default-background-color: #f8f8f8;\n --default-button-text-color: #fff;\n --default-secondary-button-text-color: #000;\n --default-input-placeholder-color: #92a2b1;\n --compact-widget-max-height: 400px;\n --default-widget-max-height: 460px;\n --cozy-widget-max-height: 380px;\n}\n\n.freemium-survey-step-navigation {\n padding: 0 2px;\n box-shadow: 0px 0px 6px #eee;\n white-space: nowrap;\n}\n.freemium-survey-step-navigation .navigation-button {\n width: 38px;\n text-align: -webkit-center;\n height: 38px;\n background-color: #fff;\n border: none;\n cursor: pointer;\n border-radius: 0 3px 3px 0;\n}\n.freemium-survey-step-navigation .navigation-button:first-of-type {\n border-right: 1px solid #d9d9d9;\n border-radius: 3px 0 0 3px;\n}\n.freemium-survey-step-navigation .navigation-button:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n.freemium-survey-step-navigation .navigation-button:focus {\n position: relative;\n z-index: 1;\n}\n\n.freemium-survey-components .question-container {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n text-align: center;\n max-width: 700px;\n margin: 0 auto;\n background: var(--default-question-background-color);\n background: var(--question-background-color, var(--default-question-background-color));\n border-radius: 4px;\n transition: transform 500ms ease 0ms, opacity 800ms ease 0ms;\n box-shadow: 0px 12px 15px rgba(18, 52, 77, 0.03);\n margin-bottom: 28px;\n padding: 28px;\n grid-gap: 28px;\n gap: 28px;\n position: relative;\n height: -webkit-fit-content;\n height: -moz-fit-content;\n height: fit-content;\n overflow: auto;\n opacity: 1;\n}\n.freemium-survey-components .hide-question-container {\n pointer-events: none;\n opacity: 0;\n}\n.freemium-survey-components .question-text {\n font-size: 1rem;\n font-weight: 600;\n line-height: 1.8;\n width: 100%;\n text-align: left;\n color: var(--default-question-text-color);\n color: var(--question-text-color, var(--default-question-text-color));\n}\n.freemium-survey-components .autofocus-button {\n border: none;\n width: 0;\n height: 0;\n opacity: 0;\n margin-top: -12px;\n margin-left: -12px;\n position: absolute;\n}\n.freemium-survey-components .question-footer {\n display: flex;\n justify-content: flex-end;\n grid-gap: 40px;\n gap: 40px;\n width: 100%;\n align-items: center;\n}\n.freemium-survey-components .question-footer:empty {\n display: none;\n}\n.freemium-survey-components .action-buttons {\n display: flex;\n grid-gap: 20px;\n gap: 20px;\n flex-direction: row-reverse;\n}\n.freemium-survey-components .action-buttons:empty {\n display: none;\n}\n.freemium-survey-components .skip-button {\n font-weight: 400;\n cursor: pointer;\n background: transparent;\n border: none;\n min-width: 40px;\n padding: 8px 16px;\n border-radius: 4px;\n color: var(--default-secondary-button-text-color);\n color: var(--secondary-button-text-color, var(--default-secondary-button-text-color));\n letter-spacing: 0.05rem;\n line-height: 1.5;\n border: 1px solid transparent;\n}\n.freemium-survey-components .skip-button:hover {\n background-color: #f3f3f3;\n}\n.freemium-survey-components .next-button {\n color: var(--default-button-text-color);\n color: var(--button-text-color, var(--default-button-text-color));\n}\n.freemium-survey-components .submit {\n max-width: 700px;\n margin: 0 auto;\n text-align: left;\n background: transparent;\n box-shadow: none;\n padding-bottom: 40px;\n color: var(--default-button-text-color);\n color: var(--button-text-color, var(--default-button-text-color));\n}\n.freemium-survey-components .thankyou {\n display: flex;\n align-items: center;\n justify-content: center;\n grid-gap: 20px;\n gap: 20px;\n min-height: 180px;\n}\n.freemium-survey-components .thankyou .heading {\n font-weight: 600;\n font-size: 28px;\n}\n.freemium-survey-components .thankyou .text {\n white-space: pre-wrap;\n font-weight: 500;\n font-size: 0.875rem;\n line-height: 1.6;\n color: #12344d;\n width: 75%;\n}\n.freemium-survey-components .thankyou .redirection-text {\n color: #929292;\n margin-bottom: 12px;\n font-weight: 300;\n}\n.freemium-survey-components .thankyou .link {\n width: 100%;\n display: inline-block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: #666;\n font-weight: 500;\n text-decoration: underline;\n}\n.freemium-survey-components .responsive-text-field {\n width: 100%;\n}\n.freemium-survey-components .responsive-text-field .textarea-container {\n display: none;\n}\n.freemium-survey-components .message-container:empty {\n display: none;\n}\n\n@media (max-width: 550px) {\n .freemium-survey-component .responsive-text-field .input-container,\n.card-survey-style .responsive-text-field .input-container {\n display: none;\n }\n .freemium-survey-component .responsive-text-field .textarea-container,\n.card-survey-style .responsive-text-field .textarea-container {\n display: flex;\n }\n}\ndiv.widget-survey-components.compact-style .freemium-survey-step-navigation {\n padding: 0 2px;\n margin-left: 4px;\n box-shadow: 0px 0px 6px #eee;\n margin-top: 4px;\n}\ndiv.widget-survey-components.compact-style .nps-container .footer {\n padding-top: 12px;\n}\ndiv.widget-survey-components.compact-style .nps-container .choices {\n grid-gap: 12px;\n gap: 12px;\n}\n\ndiv.widget-survey-components,\ndiv.card-survey-style {\n display: flex;\n flex-direction: column;\n grid-gap: 28px;\n gap: 28px;\n flex-grow: 1;\n font-size: 0.875rem;\n overflow: hidden;\n}\ndiv.widget-survey-components .questions,\ndiv.card-survey-style .questions {\n min-width: 100%;\n max-width: 100%;\n display: flex;\n height: 100%;\n position: relative;\n max-height: 400px;\n max-height: var(--compact-widget-max-height);\n background: var(--default-question-background-color);\n background: var(--question-background-color, var(--default-question-background-color));\n}\ndiv.widget-survey-components .question-text,\ndiv.card-survey-style .question-text {\n width: 100%;\n text-align: left;\n}\ndiv.widget-survey-components .focus-lock,\ndiv.card-survey-style .focus-lock {\n width: 100%;\n}\ndiv.widget-survey-components .question-container,\ndiv.card-survey-style .question-container {\n height: -webkit-fit-content;\n height: -moz-fit-content;\n height: fit-content;\n min-width: 100%;\n max-width: 100%;\n margin-bottom: 0;\n padding: 16px 28px;\n grid-gap: 16px;\n gap: 16px;\n flex-grow: 1;\n}\ndiv.widget-survey-components .question-footer,\ndiv.card-survey-style .question-footer {\n margin: 0px auto;\n justify-content: space-between;\n bottom: 0;\n padding-bottom: 20px;\n}\ndiv.widget-survey-components .submit,\ndiv.card-survey-style .submit {\n padding-bottom: 0;\n margin: unset;\n}\ndiv.widget-survey-components .nps-container .footer,\ndiv.card-survey-style .nps-container .footer {\n padding-top: 12px;\n}\ndiv.widget-survey-components .nps-container .widget .choices,\ndiv.card-survey-style .nps-container .widget .choices {\n grid-gap: 8px;\n gap: 8px;\n}\ndiv.widget-survey-components .radio-group,\ndiv.card-survey-style .radio-group {\n width: 100%;\n}\ndiv.widget-survey-components .checkbox-group,\ndiv.card-survey-style .checkbox-group {\n width: 100%;\n flex-wrap: nowrap;\n}\n\ndiv.widget-survey-components .question-container {\n box-shadow: none;\n border-radius: 0;\n}\ndiv.widget-survey-components .question-text {\n font-size: 0.875rem;\n}\ndiv.widget-survey-components .progressbar-container {\n position: absolute;\n}\ndiv.widget-survey-components .progressbar-container .progressbar {\n border-radius: 3px 0 0 0;\n}\ndiv.widget-survey-components .textarea-container .end-max-length {\n padding: 4px;\n}\ndiv.widget-survey-components .responsive-text-field .input-container {\n display: none;\n}\ndiv.widget-survey-components .responsive-text-field .textarea-container {\n display: flex;\n}\ndiv.widget-survey-components div.thankyou {\n min-height: unset;\n}\ndiv.widget-survey-components div.thankyou .text {\n width: 85%;\n}\ndiv.widget-survey-components div.thankyou svg {\n width: 140px;\n height: 120px;\n}\n\ndiv.widget-survey-components.default-style .freemium-survey-step-navigation {\n margin: 0;\n}\ndiv.widget-survey-components.default-style .questions {\n max-height: 460px;\n max-height: var(--default-widget-max-height);\n}\ndiv.widget-survey-components.default-style .question-container {\n padding: 12px 28px;\n}\ndiv.widget-survey-components.default-style .question-footer {\n justify-content: space-between;\n}\ndiv.widget-survey-components.default-style .nps-container .footer {\n padding-top: 12px;\n}\ndiv.widget-survey-components.default-style .nps-container .choices {\n flex-wrap: unset;\n grid-gap: 12px;\n gap: 12px;\n}\ndiv.widget-survey-components.default-style .action-button {\n line-height: 1.2;\n}\ndiv.widget-survey-components.default-style .radio-group {\n flex-direction: row;\n flex-wrap: wrap;\n}\ndiv.widget-survey-components.default-style .radio-group .radio-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n}\ndiv.widget-survey-components.default-style .checkbox-group {\n flex-direction: row;\n flex-wrap: wrap;\n}\ndiv.widget-survey-components.default-style .checkbox-group .checkbox-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n}\ndiv.widget-survey-components.default-style textarea {\n min-height: 84px;\n}\ndiv.widget-survey-components.default-style .end-max-length {\n font-size: 0.8rem;\n font-weight: 300;\n padding: 4px;\n}\n\n.widget-survey-components.cozy-style .freemium-survey-step-navigation {\n margin: 0;\n}\n.widget-survey-components.cozy-style .questions {\n max-height: 380px;\n max-height: var(--cozy-widget-max-height);\n}\n.widget-survey-components.cozy-style .question-text {\n font-size: 1rem;\n}\n.widget-survey-components.cozy-style .question-text.nps {\n text-align: center;\n width: 60%;\n min-width: 600px;\n margin: auto;\n}\n.widget-survey-components.cozy-style .question-container {\n padding: 12px 28px;\n}\n.widget-survey-components.cozy-style .question-footer {\n justify-content: space-between;\n}\n.widget-survey-components.cozy-style .nps-container {\n grid-gap: 44px;\n gap: 44px;\n}\n.widget-survey-components.cozy-style .nps-container .widget {\n display: flex;\n justify-content: center;\n}\n.widget-survey-components.cozy-style .nps-container .button-container {\n width: 60%;\n min-width: 600px;\n margin: 0 auto;\n}\n.widget-survey-components.cozy-style .nps-container .button-container .choices {\n justify-content: space-around;\n}\n.widget-survey-components.cozy-style .nps-container .footer {\n padding-top: 8px;\n}\n.widget-survey-components.cozy-style .action-button {\n line-height: 1.2;\n}\n.widget-survey-components.cozy-style .radio-group {\n flex-direction: row;\n flex-wrap: wrap;\n}\n.widget-survey-components.cozy-style .radio-group .radio-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n}\n.widget-survey-components.cozy-style .checkbox-group {\n flex-direction: row;\n flex-wrap: wrap;\n}\n.widget-survey-components.cozy-style .checkbox-group .checkbox-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n}\n.widget-survey-components.cozy-style textarea {\n min-height: 60px;\n}\n.widget-survey-components.cozy-style .end-max-length {\n font-size: 0.8rem;\n font-weight: 300;\n padding: 4px;\n}\n\n.freemium-survey-components.mobile-preview .thankyou .text {\n width: unset;\n}");const Q=({thankYouQuestion:n,preview:t,placeholders:r,npsValue:i})=>(o((()=>{t||n.type_info.meta?.redirectUrl&&setTimeout((()=>{window.location.href=n.type_info.meta?.redirectUrl}),1e3*(n.type_info.meta?.redirectDelay??1e4))}),[]),e.createElement("div",{className:"question-container thankyou"},e.createElement("div",{className:"heading"},"Thank you!"),e.createElement("div",{className:"text",dangerouslySetInnerHTML:{__html:B(n.text,r,i)}}),n.type_info.meta?.redirectUrl&&e.createElement("div",{style:{width:"100%"}},e.createElement("div",{className:"redirection-text"},"You will be redirected to the below URL automatically in"," ",n.type_info.meta?.redirectDelay," seconds.",e.createElement("br",null)),e.createElement("a",{className:"link",href:n.type_info.meta?.redirectUrl},n?.type_info.meta?.redirectUrl)))),R=({currentBlockIndex:n,currentBlockIndexOfBlocksWithQns:t,blocksWithQns:o,blocks:r,setHorizontalScrollUnits:i,preventQuestionAnimation:a})=>e.createElement("div",{className:"freemium-survey-step-navigation","data-navigation-element":"1"},e.createElement("button",{disabled:0==t.current,className:"navigation-button",onClick:()=>{t.current=Math.max(t.current-1,0),n.current=r.findIndex((e=>e.name===o[t.current].name)),a.current=!1,i(t.current)}},e.createElement(N,null)),e.createElement("button",{className:"navigation-button",disabled:t.current>=o.length-1,onClick:()=>{a.current=!1,t.current=Math.min(t.current+1,o.length-1),n.current=r.findIndex((e=>e.name===o[t.current].name)),i(t.current)}},e.createElement(z,null))),$=({widget:n,widgetStyle:t,surveyStyle:o,formValues:r,othersMeta:i,blocksWithQns:a,blocks:s,thankYouQuestion:c,currentBlockIndexOfBlocksWithQns:u,currentBlockIndexOfBlocks:l,currentEditingBlock:d,isSubmitting:m,isValuesCommitted:f,isCurrentBlockFinal:v,setHorizontalScrollUnits:y,handleFormValues:g,skipBlock:x,setIsSubmitting:h,onSubmit:b,setIsSurveyCompleted:w,preventQuestionAnimation:k,preview:q,closePreview:E,..._})=>{const z=_.blockIndex??u.current,N=_.question??a[z].question,S=()=>N.name===d.current.question.name&&!p.includes(N.type_info.question_type)&&!v(),B=()=>"RANGE"!==N.type_info.question_type&&!N.required&&N.name===d.current.question.name&&!v(),I=()=>"DROPDOWN"===N.type_info.question_type&&N.name!==d.current.question.name&&!N.required&&null!=r[N.name],O=()=>v()&&(n||"standard"!==o)&&N.name===d.current.question.name,F="MULTI_SELECT"===d.current.question.type_info.question_type&&r[d.current.question.name]?.includes("others")&&(!i[d.current.question.name]||""===i[d.current.question.name]);return e.createElement("div",{className:"question-footer"},!(!n&&"standard"===o||0===z&&!r[N.name]||"compact"===t)&&e.createElement(R,{currentBlockIndex:l,currentBlockIndexOfBlocksWithQns:u,blocksWithQns:a,blocks:s,setHorizontalScrollUnits:y,preventQuestionAnimation:k}),(S()||I()||B()||O())&&e.createElement("div",{className:"action-buttons"},S()&&e.createElement(C,{onClick:()=>{g(a[z],null,!0)},disabled:d.current.question.required&&(!r[d.current.question.name]||Array.isArray(r[d.current.question.name])&&0===r[d.current.question.name].length)||d.current.question.type_info.meta?.othersRequired&&F,className:"next-button"},"Next"),B()&&e.createElement("button",{className:"skip-button",onClick:()=>x(N)},"Skip"),I()&&e.createElement("button",{className:"skip-button",onClick:()=>{d.current=a[z],l.current=s.findIndex((e=>e.name===a[z].name)),x(N)}},"Clear selection"),O()&&e.createElement("div",{className:"submit"},e.createElement(C,{disabled:(d.current.question.required||d.current.question.type_info.pivot_question)&&(null==r[d.current.question.name]||0===r[d.current.question.name]?.length)||d.current.question.type_info.meta?.othersRequired&&F||m,onClick:()=>{h(!0),b({...r,others_meta:i},(()=>{c?.type_info.meta?.skipThankYouPage?q?setTimeout((()=>{E?.()}),300):window.location.href=c?.type_info.meta?.redirectUrl:w(!0)}))}},m?"Submitting":"Submit Survey"))))},L=({survey:t,surveyStyle:i="standard",placeholders:a,onSubmit:s,widget:u,npsValue:l,widgetStyle:d,widgetNavigatorQuerySelector:m,preview:f,mobilePreview:v,closePreview:y})=>{const g=t.question_details?.questions||[],x=t.meta?.blocks||[],[h,b]=r(null),[w,k]=r({}),[E,_]=r(!1),[z,N]=r([]),[I,O]=r(0),[F,T]=r(!1),[L,V]=r(null),[D,A]=r({}),j=n(null),H=n(null),U=n(-1),Y=n(null),M=n(0),W=n(0),P=n(!1),G=n([]),X=n(!!l&&"card"===i),K=n(null),Z=n([]);o((()=>{x&&(K.current=x.find((e=>"TY"===e.name)),b(x.filter((e=>"TY"!==e.name))))}),[x]),o((()=>{if(h)if(H.current=g.find((e=>e.type_info?.pivot_question))??g.find((e=>"RANGE"===e.type_info?.question_type))??g[0],null!=l){U.current=l;const e=g.find((e=>e.name===h[0].question_names[0]));j.current={...h[0],question:e},G.current=[...G.current,{...h[0],question:e}],N(G.current),k({Q_1:l})}else if(!j.current&&h.length>0)return j.current=h[0],void ee(h[0])}),[h,l]),o((()=>{z.length&&(G.current=z,W.current=z.length-1),u||"standard"!==i?(Y.current&&(Y.current.style.maxHeight="unset"),Z.current[M.current]=Y.current?.scrollHeight||Z.current[M.current]||0,Y.current&&(Y.current.style.maxHeight="100%")):Y.current?.scrollIntoView({block:"center",behavior:"smooth"}),O(z.length-1)}),[z]),o((()=>{Object.keys(w).length>0&&j.current.question&&(p.includes(j.current.question.type_info.question_type)||P.current)&&!J()&&ne()}),[w]),o((()=>{if(null!=w?.[H.current?.name])if(K.current?.is_based_on_rating){const e=H.current?.type_info?.choices[w?.[H.current?.name]]?.dependent_question_names,n=K.current?.question_names.find((n=>e?.includes(n))),t=g.find((e=>e.name===n));V(t)}else{const e=g.find((e=>e.name==K.current?.question_names[0]));V(e)}}),[w?.[H.current?.name]]);const J=()=>M.current===h.length-1||"end"===j.current.branchOption,ee=e=>{let n={};if(e.is_based_on_rating){const t=H.current?.type_info?.choices[w?.[H.current?.name]]?.dependent_question_names,o=e.question_names.find((e=>t?.includes(e)));n=g.find((e=>e.name===o))}else n=g.find((n=>n.name===e.question_names[0]));j.current.question=n;G.current.find((e=>e.question.name===n.name))?(O(I+1),W.current+=1):N([...G.current,{...e,question:n}])},ne=()=>{if(J())_(!0);else{if(j.current.nextBlock)M.current=h.findIndex((e=>e.name===j.current.nextBlock));else if(j.current.question.type_info?.meta?.branches){const e=j.current.question.type_info?.meta?.branches,n=w[j.current.question.name];let t;if(t="RANGE"===j.current.question.type_info.question_type?e.find((e=>n>=e.min&&n<=e.max)):e.find((e=>n===e.value)),t?.nextBlock){if("TY"===t.nextBlock)return void _(!0);M.current=h.findIndex((e=>e.name===t.nextBlock))}else M.current+=1}else M.current+=1;j.current=h[M.current],ee(h[M.current])}},te=e=>{P.current=!0,delete w[e.name],k({...w})},oe=(e,n,t)=>{if(X.current=!1,t){if(P.current=!0,null!=w[e.question.name]&&e.name!==z[z.length-1].name){const[t,o]=(e=>{const n=z.findIndex((n=>n.name===e.name)),t=z.slice(0,n+1),o=t.reduce(((e,n)=>(e[n.question.name]=w[n.question.name],e)),{});return M.current=h.findIndex((n=>n.name===e.name)),[t,o]})(e);k({...o,...null!=n&&{[e.question.name]:n}}),G.current=t}else k({...w,...null!=n&&{[e.question.name]:n}});H?.current?.name==e?.question?.name&&(U.current=n)}else k({...w,...null!=n&&{[e.question.name]:n}})},re=(e,n)=>{A({...D,[e]:n})};return j.current&&j.current.question?E?e.createElement("div",{className:`freemium-survey-components ${u?"widget-survey-components":""} ${d}-style ${v?"mobile-preview":""} ${i}-survey-style`,id:"freemium-survey"},e.createElement(Q,{thankYouQuestion:L,preview:f,placeholders:a,npsValue:U.current})):e.createElement("div",{className:`freemium-survey-components ${u?"widget-survey-components":""} ${d}-style ${v?"mobile-preview":""} ${i}-survey-style`,id:"freemium-survey"},e.createElement(q,{totalSteps:h.length,completedSteps:M.current}),u&&"compact"===d&&document.querySelector(m)&&e.createElement(e.Fragment,null,c.createPortal(e.createElement("div",null,e.createElement(R,{currentBlockIndex:M,currentBlockIndexOfBlocksWithQns:W,blocksWithQns:z,blocks:h,setHorizontalScrollUnits:O,preventQuestionAnimation:X})),document.querySelector(m))),e.createElement("div",{style:u||"card"===i?{transform:`translateX(calc(-${I} * 100%))`,height:`${Z.current[M.current]}px`,transition:X.current||z?.length<=1?"none":"all 600ms ease-out 0ms"}:{},className:"questions"},z.map(((n,t)=>e.createElement("div",{key:n.question.name,ref:Y,className:"question-container "+(!u&&"card"!==i||W.current===t?"":"hide-question-container")},e.createElement("div",{className:"question-text "+(0===t?"nps":""),dangerouslySetInnerHTML:{__html:B(n.question.text,a,U.current)},title:`question-${t}`,role:"heading","aria-level":1}),e.createElement("button",{disabled:!u&&"standard"===i,className:"autofocus-button",onKeyDown:e=>{"Tab"===e.key&&(e.stopPropagation(),e.preventDefault())}}),e.createElement(S,{question:n.question,formValues:w,othersMeta:D,autoFocus:W.current===t,autoFocusDelay:"standard"===i?350:20,saveOthersValue:re,onChangeHandler:e=>{P.current=!1,M.current=h.findIndex((e=>e.name===n.name)),j.current=n,oe(n,e,p.includes(n.question.type_info.question_type)&&!J())}}),e.createElement("button",{disabled:!u&&"standard"===i,className:"autofocus-button",onKeyDown:e=>{"Tab"===e.key&&(e.stopPropagation(),e.preventDefault())}}),e.createElement($,{question:n.question,blockIndex:t,widget:u,widgetStyle:d,surveyStyle:i,formValues:w,othersMeta:D,blocksWithQns:z,blocks:h,thankYouQuestion:L,currentBlockIndexOfBlocksWithQns:W,currentBlockIndexOfBlocks:M,currentEditingBlock:j,isSubmitting:F,isValuesCommitted:P,isCurrentBlockFinal:J,setHorizontalScrollUnits:O,handleFormValues:oe,skipBlock:te,setIsSubmitting:T,onSubmit:s,setIsSurveyCompleted:_,preventQuestionAnimation:X,preview:f,closePreview:y})))),!u&&"card"!==i&&J()&&e.createElement("div",{className:"submit"},e.createElement(C,{disabled:(j.current.question.required||j.current.question.type_info.pivot_question)&&(null==w[j.current.question.name]||0===w[j.current.question.name]?.length)||j.current.question.type_info.meta?.othersRequired&&"MULTI_SELECT"===j.current.question.type_info.question_type&&w[j.current.question.name]?.includes("")||F,onClick:()=>{T(!0),s({...w,others_meta:D},(()=>{L?.type_info.meta?.skipThankYouPage?f?setTimeout((()=>{y?.()}),300):window.location.href=L?.type_info.meta?.redirectUrl:_(!0)}))}},F?"Submitting":"Submit Survey")))):null},V=n=>{const{survey:t}=n,o=i((()=>{const e=JSON.parse(JSON.stringify(t)),n=[];return(e.question_details?.questions||[]).forEach((e=>{const t=e.type_info?.meta?.block;t&&(t.question_names||(t.question_names=[e.name]),n.push(t))})),{...e,meta:{...e.meta,blocks:n}}}),[t]);return e.createElement(e.Fragment,null,"standard"===n.surveyStyle||n.widget?e.createElement(L,Object.assign({},n,{survey:o})):e.createElement(T,Object.assign({},n,{survey:o})))};export{_ as BUTTON_SIZE_VARIANTS,C as Button,h as CheckboxGroup,y as Input,l as NPS,q as ProgressBar,k as Radio,w as RadioGroup,V as Survey,g as TextArea};
@@ -10,7 +10,7 @@ declare type NPSProps = {
10
10
  validation: {
11
11
  min: number;
12
12
  };
13
- score_presets: {
13
+ rating_presets: {
14
14
  start: string;
15
15
  end: string;
16
16
  };
@@ -25,7 +25,7 @@ export declare const newSurvey: {
25
25
  button_style: string;
26
26
  button_shape: string;
27
27
  };
28
- score_presets: {
28
+ rating_presets: {
29
29
  start: string;
30
30
  end: string;
31
31
  };
@@ -39,8 +39,7 @@ export declare const newSurvey: {
39
39
  block: {
40
40
  name: string;
41
41
  title: string;
42
- is_based_on_score: boolean;
43
- question_names?: undefined;
42
+ is_based_on_rating: boolean;
44
43
  };
45
44
  branches: {
46
45
  min: number;
@@ -48,9 +47,6 @@ export declare const newSurvey: {
48
47
  id: string;
49
48
  }[];
50
49
  branchType: string;
51
- othersRequired?: undefined;
52
- othersOption?: undefined;
53
- placeholder?: undefined;
54
50
  };
55
51
  pivot_question: boolean;
56
52
  };
@@ -66,107 +62,17 @@ export declare const newSurvey: {
66
62
  question_type: string;
67
63
  validation: null;
68
64
  linear_scale: null;
69
- score_presets: null;
70
- choices: {
71
- id: string;
72
- position: string;
73
- value: string;
74
- }[];
75
- footer_text: null;
76
- meta: {
77
- block: {
78
- name: string;
79
- title: string;
80
- is_based_on_score: boolean;
81
- question_names: string[];
82
- };
83
- othersRequired: boolean;
84
- othersOption: boolean;
85
- branches?: undefined;
86
- branchType?: undefined;
87
- placeholder?: undefined;
88
- };
89
- pivot_question: boolean;
90
- };
91
- } | {
92
- id: string;
93
- text: string;
94
- name: string;
95
- position: number;
96
- required: boolean;
97
- type_info: {
98
- comment: boolean;
99
- driver: boolean;
100
- question_type: string;
101
- validation: null;
102
- linear_scale: null;
103
- score_presets: null;
104
- choices: {
105
- id: string;
106
- position: string;
107
- value: string;
108
- }[];
109
- footer_text: null;
110
- meta: null;
111
- pivot_question: boolean;
112
- };
113
- } | {
114
- id: string;
115
- text: string;
116
- name: string;
117
- position: number;
118
- required: boolean;
119
- type_info: {
120
- comment: boolean;
121
- driver: boolean;
122
- question_type: string;
123
- validation: null;
124
- linear_scale: null;
125
- score_presets: null;
126
- choices: null;
127
- footer_text: null;
128
- meta: {
129
- block: {
130
- name: string;
131
- title: string;
132
- is_based_on_score: boolean;
133
- question_names?: undefined;
134
- };
135
- placeholder: string;
136
- branches?: undefined;
137
- branchType?: undefined;
138
- othersRequired?: undefined;
139
- othersOption?: undefined;
140
- };
141
- pivot_question: boolean;
142
- };
143
- } | {
144
- id: string;
145
- text: string;
146
- name: string;
147
- position: number;
148
- required: boolean;
149
- type_info: {
150
- comment: boolean;
151
- driver: boolean;
152
- question_type: string;
153
- validation: null;
154
- linear_scale: null;
155
- score_presets: null;
65
+ rating_presets: null;
156
66
  choices: null;
157
67
  footer_text: null;
158
68
  meta: {
159
69
  block: {
160
70
  name: string;
161
71
  title: string;
162
- is_based_on_score: boolean;
163
- question_names?: undefined;
72
+ is_based_on_rating: boolean;
164
73
  };
165
74
  branches?: undefined;
166
75
  branchType?: undefined;
167
- othersRequired?: undefined;
168
- othersOption?: undefined;
169
- placeholder?: undefined;
170
76
  };
171
77
  pivot_question: boolean;
172
78
  };
@@ -182,7 +88,7 @@ export declare const newSurvey: {
182
88
  question_type: string;
183
89
  validation: null;
184
90
  linear_scale: null;
185
- score_presets: null;
91
+ rating_presets: null;
186
92
  choices: {
187
93
  id: string;
188
94
  position: string;
@@ -193,14 +99,10 @@ export declare const newSurvey: {
193
99
  block: {
194
100
  name: string;
195
101
  title: string;
196
- is_based_on_score: boolean;
197
- question_names?: undefined;
102
+ is_based_on_rating: boolean;
198
103
  };
199
104
  branches?: undefined;
200
105
  branchType?: undefined;
201
- othersRequired?: undefined;
202
- othersOption?: undefined;
203
- placeholder?: undefined;
204
106
  };
205
107
  pivot_question: boolean;
206
108
  };
@@ -1 +1 @@
1
- export declare const sanitiseQuestion: (questionText: any, placeholders: any, npsScore: any) => any;
1
+ export declare const sanitiseQuestion: (questionText: any, placeholders: any, npsRating: any) => any;
@@ -20,7 +20,7 @@ export declare type BlockType = {
20
20
  question_names?: string[];
21
21
  type?: string;
22
22
  required?: boolean;
23
- is_based_on_score?: boolean;
23
+ is_based_on_rating?: boolean;
24
24
  is_same_for_all?: boolean;
25
25
  };
26
26
  export declare type SurveyMetaType = {
@@ -86,7 +86,7 @@ export declare type LinearScaleType = {
86
86
  button_style?: string | null;
87
87
  button_shape?: 'rounded' | 'square' | 'curved';
88
88
  };
89
- export declare type QuestionScorePresetType = {
89
+ export declare type QuestionRatingPresetType = {
90
90
  start?: string | null;
91
91
  end?: string | null;
92
92
  };
@@ -98,7 +98,7 @@ export declare type QuestionTypeInfo = {
98
98
  question_type: QuestionType | null;
99
99
  validation?: QuestionValidationType | null;
100
100
  linear_scale?: LinearScaleType | null;
101
- score_presets?: QuestionScorePresetType | null;
101
+ rating_presets?: QuestionRatingPresetType | null;
102
102
  choices?: QuestionChoiceType[] | null;
103
103
  footer_text?: string | null;
104
104
  meta?: any | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "freemium-survey-components",
3
- "version": "0.10.30",
3
+ "version": "0.10.33",
4
4
  "description": "React Survey Ui Components",
5
5
  "main": "lib/index.cjs.js",
6
6
  "module": "lib/index.esm.js",