@sprig-technologies/sprig-bundled 2.46.1 → 2.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/conversational-styles-BO6t2-y4.js +4 -0
- package/dist/conversational-styles-CWaKMg_f.cjs +1 -0
- package/dist/conversational-ui-CEmVz2Vg.cjs +658 -0
- package/dist/conversational-ui-CXl_8HB_.js +1517 -0
- package/dist/conversational-v2-styles-D5xNLWoE.cjs +1 -0
- package/dist/conversational-v2-styles-GH9tfuXI.js +4 -0
- package/dist/getAttributedUrl-D-vLs0_x.js +194 -0
- package/dist/getAttributedUrl-DNR4xoBk.cjs +12 -0
- package/dist/index-B-aCET7A.js +737 -0
- package/dist/index-BBiYWZkL.cjs +66 -0
- package/dist/{index-D2UpkOdR.js → index-BNI3IK7K.js} +993 -993
- package/dist/index-DD639GNJ.cjs +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +42 -0
- package/dist/index.js +1 -1
- package/dist/view-B4aVfDPi.cjs +1 -0
- package/dist/view-eRBVyC0l.js +1831 -0
- package/package.json +1 -1
- package/dist/conversational-styles-B-bImmUK.js +0 -4
- package/dist/conversational-styles-vDq05r1U.cjs +0 -1
- package/dist/conversational-ui-BZDC1buu.js +0 -1511
- package/dist/conversational-ui-DqQZMJkq.cjs +0 -658
- package/dist/conversational-v2-styles-DeqT460S.js +0 -4
- package/dist/conversational-v2-styles-DkN3ff79.cjs +0 -1
- package/dist/getAttributedUrl-BuO50-dW.cjs +0 -12
- package/dist/getAttributedUrl-BvS4nPJR.js +0 -193
- package/dist/index-BCIAxJWJ.cjs +0 -66
- package/dist/index-DiPr4x-u.cjs +0 -1
- package/dist/index-fcbxeQg3.js +0 -734
- package/dist/view-5-qQQKtl.js +0 -1789
- package/dist/view-D8rc4Fhu.cjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./view-B4aVfDPi.cjs"),ee=require("./index-BBiYWZkL.cjs"),h=require("./getAttributedUrl-DNR4xoBk.cjs"),Be=({className:n,message:i,next:d,properties:r,questionId:t,type:o})=>{const{useMobileStyling:p,border:b,isLongFormSurvey:c,focusedQuestionId:v}=e.useConfig(x=>({useMobileStyling:x.useMobileStyling,border:x.border,isLongFormSurvey:ee.isLongFormSurvey(x.studyType),focusedQuestionId:x.focusedQuestionId})),[s,g]=e.h(!1),[u,I]=e.h(""),[a,y]=e.h(!1),m=c&&v===t,C=r==null?void 0:r.collectName,f=(r==null?void 0:r.nameLabelText)||"Full Name",L=(r==null?void 0:r.consentText)||"I agree to the stated conditions",F=(r==null?void 0:r.submitButtonText)||"Submit",M=!!u.trim(),R=s&&(!C||M),U=(x,T=!1)=>{x.preventDefault(),x.stopPropagation();let q=null;if(!T){if(!R)return void y(!0);q={submitted:!0},C&&(q.name=u)}d({value:q,questionId:t,type:o},R)};return e.u("div",{className:e.cc(n,c&&!m&&"ul-card--unfocused","ul-card__consent-legal","fade-in-transition"),children:[e.u(h.Header,{isRequired:c&&(r==null?void 0:r.required),message:i,properties:{image:r.image,questionHtml:r.questionHtml}}),r!=null&&r.richTextBody?e.u(h.QuestionBodyWrapper,{children:e.u(h.Html,{className:"ul-rich-text-body",html:r.richTextBody,id:"ul-card__consent-legal-body-container"})}):null,e.u(h.MobileEmbedView,{embeddedType:"pdf",properties:r,children:e.u(h.QuestionBodyFooterContainer,{children:[e.u("div",{className:"sprig-stretch",children:[e.u(h.Option,{allowTextEntry:!1,border:b,error:a&&!s,id:"consent",isRadio:!1,isSelected:s,label:L,onUserInputChanged:({selected:x})=>{x!==s&&g(!s)},useMobileStyling:p}),C&&e.u("input",{"aria-label":f,"aria-placeholder":f,className:e.cc(e.getClasses("ul-consent-legal__name-input",p)),"data-gramm":"false",maxLength:250,name:"name",onBlur:x=>{x.currentTarget.style.borderColor=a&&!M?ee.ERROR_BORDER_COLOR:ee.DEFAULT_BORDER_COLOR},onFocus:x=>{x.currentTarget.style.borderColor=a&&!M?ee.ERROR_BORDER_COLOR:b},onInput:x=>{x.preventDefault(),x.stopPropagation(),I(x.currentTarget.value)},placeholder:f,style:a&&!M?{borderColor:ee.ERROR_BORDER_COLOR}:{},tabIndex:0,value:u})]}),e.u("div",{className:"ul-card__button-wrapper ul-card-vertical__button-wrapper",children:[e.u(h.Button,{className:R?"":"sprig-button-disabled",onClick:U,children:F}),r.required===!1&&!c&&e.u("button",{className:"ul-card-skip__button",onClick:x=>U(x,!0),children:e.getSkipButtonText(r)})]})]})})]},t)},ae=n=>i=>{i.pointerType!=="touch"&&n()},Me=({activeValue:n,border:i,icon:d,isPressed:r,onSubmit:t,range:o,scaleLabelType:p,selectedValue:b,setSelectedValue:c,setActiveValue:v,setIsPressed:s,useMobileStyling:g,value:u,viewDocument:I})=>{const{isLongFormSurvey:a,enableCspTrustedTypes:y}=e.useConfig(T=>({isLongFormSurvey:ee.isLongFormSurvey(T.studyType),enableCspTrustedTypes:T.enableCspTrustedTypes})),m=`option-${u}`,C=p==="number",f=p==="star",L=p==="smiley",F=C&&u===n||u===b,[M,R]=(()=>{const T=f&&b!==null&&u<=b;return f&&u<=n||L&&u===n||T||u===n||u===b?[i,r||T||u===b?1:.3]:["",1]})(),U=e.F(()=>{const T=b===u,q={borderColor:F&&!g||T?M:"",fillOpacity:F?"":R,zIndex:F?3:"auto",color:T?"#fff":""};return C?{...q,backgroundColor:T?M:""}:{...q,color:f||L||T?M:""}},[F,M,R,b,u,C,f,L,g]),x=e.F(()=>ee.getHtml((({icon:T,scaleLabelType:q,value:P,selectedValue:H})=>{if(q==="smiley"&&P===H){let w=0;return T.replace(/black/g,()=>++w==1?"black":"white")}return T})({icon:d,scaleLabelType:p,value:u,selectedValue:b}),y),[y,d,p,b,u]);return e.u("button",{"aria-label":C?void 0:String(u),className:(()=>{switch(p){case"star":return e.cc(e.getClasses("likert-star",g),e.getClasses(`likert-star-${u}`,g));case"smiley":return e.cc(e.getClasses("likert-smiley",g),e.getClasses(`likert-smiley-${u}`,g));default:return u===o?e.cc(e.getClasses("likert-number",g),e.getClasses(`likert-number-${u}`,g),e.getClasses("likert-last-option",g)):e.cc(e.getClasses("likert-number",g),e.getClasses(`likert-number-${u}`,g))}})(),dangerouslySetInnerHTML:{__html:x},id:m,onClick:T=>{a&&(T.preventDefault(),T.stopPropagation(),c(u)),t()},onKeyDown:T=>{var H,w;const q=I.querySelectorAll(`.likert-${p??"number"}`),P=u-1;T.key==="ArrowRight"?(H=q[P+1])==null||H.focus():T.key==="ArrowLeft"?(w=q[P-1])==null||w.focus():T.key!=="Enter"&&T.key!==" "||(a&&(T.preventDefault(),T.stopPropagation(),c(u)),t())},onPointerCancel:ae(()=>s(!1)),onPointerDown:ae(()=>{s(!0),v(u)}),onPointerEnter:ae(()=>v(u)),onPointerLeave:ae(()=>{v(-1),s(!1)}),onPointerUp:ae(()=>s(!1)),style:U,tabIndex:0})},Re=({className:n,labels:i,message:d,next:r,properties:t,questionId:o,type:p})=>{const{border:b,useMobileStyling:c,viewDocument:v,isLongFormSurvey:s,focusedQuestionId:g}=e.useConfig(P=>({border:P.border,useMobileStyling:P.useMobileStyling,viewDocument:P.viewDocument,isLongFormSurvey:ee.isLongFormSurvey(P.studyType),focusedQuestionId:P.focusedQuestionId})),[u,I]=e.h(-1),[a,y]=e.h(!1),[m,C]=e.h(null);e.p(()=>{I(-1),y(!1),C(null)},[o]);const f=s&&g===o,L=i&&i.left,F=i&&i.right;let M;const{range:R,scaleLabelType:U,ratingIcons:x}=t;R&&(M=Number(R));const T=M||5,q=P=>{var H,w;switch(U){case"star":return(H=x[0])==null?void 0:H.svg;case"smiley":return(w=x[P])==null?void 0:w.svg;default:return String(P+1)}};return e.u("form",{className:e.cc(n,"ul-card--likert","fade-in-transition",s&&!f&&"ul-card--unfocused"),children:[e.u(h.Header,{isRequired:s&&(t==null?void 0:t.required),message:d,properties:t}),e.u(h.MobileEmbedView,{properties:t,children:e.u(e.g,{children:[e.u(h.QuestionBodyWrapper,{children:[e.u("div",{"aria-label":`Rating (1 - ${T})`,className:"ul-card--likert__numbers",role:"radiogroup",children:[...Array(T)].map((P,H)=>{const w=H+1;return e.u(Me,{activeValue:u,border:b,icon:q(H),isPressed:a,onSubmit:()=>r({value:w,questionId:o,type:p},!0),range:T,scaleLabelType:U,selectedValue:m,setActiveValue:I,setIsPressed:y,setSelectedValue:C,useMobileStyling:c,value:w,viewDocument:v},H)})}),e.u("div",{className:"ul-card--likert__labels",children:[e.u("span",{children:L}),e.u("span",{children:F})]})]}),!t.required&&!s&&e.u(h.QuestionBodyFooterContainer,{children:e.u("div",{className:"ul-vertical-centered-container",children:e.u(h.Button,{onClick:P=>{P.preventDefault(),P.stopPropagation(),r({value:null,questionId:o,type:p},!0)},children:e.getButtonText(t)})})})]})})]},o)},Pe=({columns:n,onSelect:i,options:d,selectedOptions:r})=>{const t=e._([]),{border:o,useMobileStyling:p,cards:b,index:c}=e.useConfig(a=>({border:a.border,useMobileStyling:a.useMobileStyling,cards:a.cards,index:a.index})),v=d.findIndex(a=>r[a.id]===null),[s,g]=e.h(v),u=e.T((a,y)=>{var f;i(a,y);const m=s+1,C=d[m];if(C&&r[C.id]===null){g(m);const L=b[c];(L==null?void 0:L.groupId)!=null||((f=t.current[m])==null||f.scrollIntoView({block:"nearest",behavior:"smooth"}))}},[i,d,r,s,b,c]),I=e.T((a,y)=>{const m=s===a;return e.u(e.Accordion,{animate:!0,header:y.label,isOpen:m,onClick:()=>{var C;return g(m&&!((C=window.UserLeap)!=null&&C.isMobileSDK)?-1:a)},ref:C=>{C&&(t.current[a]=C)},showHeaderCheck:r[y.id]!==null,children:e.u("div",{style:{paddingTop:"12px"},children:n.map(C=>e.u(h.Option,{allowTextEntry:!1,ariaLabel:`${y.label}-${C.label}`,border:o,error:!1,id:`${y.id}-${C.value}`,isRadio:!0,isSelected:r[y.id]===C.value,label:C.label,onUserInputChanged:()=>u(y.id,C.value),useMobileStyling:p},C.label))})},y.id)},[o,n,s,u,r,p]);return e.u("div",{children:d.map((a,y)=>I(y,a))})},De=({columns:n,onSelect:i,options:d,selectedOptions:r})=>{const{border:t,useMobileStyling:o,isLongFormSurvey:p}=e.useConfig(a=>({border:a.border,useMobileStyling:a.useMobileStyling,isLongFormSurvey:ee.isLongFormSurvey(a.studyType)})),b=d.length,c=n.length,v=e._(null),[s,g]=e.h(!1),[u,I]=e.h(!1);return e.p(()=>{if(p)return;const a=v.current,y=new ResizeObserver(m=>{window.requestAnimationFrame(()=>{a&&(g(Math.round(m[0].contentRect.width)<a.scrollWidth),I(Math.round(m[0].contentRect.width)<a.scrollWidth))})});return a&&y.observe(a),()=>{a&&y.unobserve(a)}},[p]),e.u("div",{className:"ul-card--matrix_question_container",children:[e.u("div",{className:e.cc("ul-card--matrix_container",!p&&s&&"ul-matrix-scroll-gradient"),onScroll:p?void 0:()=>{const a=v.current;a&&g(a.clientWidth+Math.abs(a.scrollLeft)<a.scrollWidth)},ref:v,children:e.u("div",{className:e.cc(p&&"ul-card--matrix_grid_longform","ul-card--matrix_grid"),style:`--numColumns: ${c}; --numRows: ${b+1};`,children:[e.u("div",{className:"ul-matrix-header-row",children:[e.u("div",{})," ",n.map(a=>e.u("div",{className:"ul-matrix-column-label",children:a.label},a.label))]}),d.map(a=>e.u("div",{className:"ul-matrix-row",children:[e.u("div",{"aria-label":a.label,className:"ul-matrix-row-label",children:a.label}),e.u("div",{className:"ul-matrix-row-options",role:"radiogroup",children:n.map((y,m)=>{const C=m===c-1;return e.u("div",{className:e.cc("ul-matrix-option-wrapper",C&&"ul-matrix-last-option"),children:e.u(h.Option,{allowTextEntry:!1,ariaLabel:`${a.label}-${y.label}`,border:t,choiceStyle:{background:"transparent",border:"none",marginBottom:"0",padding:"0"},error:!1,id:`${a.id}-${y.value}`,isRadio:!0,isSelected:r[a.id]===y.value,onUserInputChanged:()=>i(a.id,y.value),useMobileStyling:o})},y.value)})})]},a.label))]})}),!p&&(s||u)&&e.u("button",{className:u&&!s?"ul-matrix-scroll-arrow left":"ul-matrix-scroll-arrow",onClick:u&&!s?a=>{a.preventDefault();const y=v.current;if(y){const m=getComputedStyle(y).direction==="rtl";y.scrollTo({left:m?y.scrollWidth-y.clientWidth:0,behavior:"smooth"})}}:a=>{a.preventDefault();const y=v.current;if(y){const m=getComputedStyle(y).direction==="rtl";y.scrollTo({left:m?y.clientWidth-y.scrollWidth:y.scrollWidth,behavior:"smooth"})}},children:u&&!s?e.u(Fe,{}):e.u(Qe,{})})]})},Fe=()=>e.u("svg",{fill:"currentColor",height:"32",transform:"matrix(-1,0,0,1,0,0)",version:"1.1",viewBox:"0 0 256 256",width:"32",xmlns:"http://www.w3.org/2000/svg",children:e.u("path",{d:"M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z"})}),Qe=()=>e.u("svg",{fill:"currentColor",height:"32",viewBox:"0 0 256 256",width:"32",xmlns:"http://www.w3.org/2000/svg",children:e.u("path",{d:"M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z"})}),Ee=({className:n,message:i,next:d,options:r,properties:t,questionId:o,type:p,showIndividualSubmit:b=!1,onSubmitButtonClick:c})=>{const{useMobileStyling:v,isLongFormSurvey:s,focusedQuestionId:g,setFocusedQuestionId:u,update:I}=e.useConfig(B=>({useMobileStyling:B.useMobileStyling,isLongFormSurvey:ee.isLongFormSurvey(B.studyType),focusedQuestionId:B.focusedQuestionId,setFocusedQuestionId:B.setFocusedQuestionId,update:B.update})),a=t.matrixColumn,y=t.required,m=s&&g===o,C=B=>Object.values(B).every(V=>V==null),f=B=>y&&C(B),L=B=>{if(B.preventDefault(),B.stopPropagation(),d({value:M,questionId:o,type:p},!0),c){const V=!C(M);c(V)}},F=r.reduce((B,V)=>(B[V.id]=null,B),{}),[M,R]=e.h(F),[U,x]=e.h(window.innerWidth),T=(B,V)=>{s&&d({value:{...M,[B]:V},questionId:o,type:p},!f({...M,[B]:V})),R(S=>({...S,[B]:V}))},q=t.displayMatrixAsAccordion||v,P=s&&!q&&e.shouldMatrixUseAccordionDueToSize(a.length,U),H=q||P,w=s&&!H,E=w&&e.shouldMatrixUseFillLayout(a.length,U);return e.p(()=>{if(!s)return;const B=ee.debounce(()=>x(window.innerWidth),100);return window.addEventListener("resize",B),I(),()=>window.removeEventListener("resize",B)},[s,E,P,U,I]),e.u("form",{className:e.cc(n,!s&&"ul-card__matrix",w&&"ul-card--matrix-expandable",E&&"ul-card--matrix-expandable-fill","fade-in-transition",s&&!m&&"ul-card--unfocused"),id:"text-form",onClick:()=>{m&&u(o)},onSubmit:L,children:[e.u(h.Header,{isRequired:s&&(t==null?void 0:t.required),message:i,properties:t}),e.u(h.MobileEmbedView,{properties:t,children:[e.u(h.QuestionBodyWrapper,{children:[H?e.u(Pe,{columns:a,onSelect:T,options:r,selectedOptions:M}):e.u(De,{columns:a,onSelect:T,options:r,selectedOptions:M}),b&&e.u(h.LongformSubmitButton,{handleSubmit:L,isSubmitDisabled:f(M)})]}),!s&&e.u(h.QuestionBodyFooterContainer,{children:e.u("div",{className:"ul-card__button-wrapper",children:e.u(h.Button,{disabled:f(M),children:e.getButtonText(t)})})})]})]},o)},Ce=({className:n,message:i,onSubmit:d,options:r=[],properties:t,questionId:o,type:p,showIndividualSubmit:b=!1,onSubmitButtonClick:c})=>{const{border:v,useMobileStyling:s,isLongFormSurvey:g,focusedQuestionId:u,setFocusedQuestionId:I}=e.useConfig(S=>({border:S.border,useMobileStyling:S.useMobileStyling,isLongFormSurvey:ee.isLongFormSurvey(S.studyType),focusedQuestionId:S.focusedQuestionId,setFocusedQuestionId:S.setFocusedQuestionId})),a=g&&u===o,y=r.reduce((S,A)=>(S[A.id]={isSelected:!1},S),{}),[m,C]=e.h(y),f=p==="multiplechoice",L=t.required,F=r.find(S=>{var A;return(A=S.optionProperties)==null?void 0:A.noneOfTheAbove}),M=S=>Object.entries(S).some(([A,j])=>{var re;const J=r.find(l=>`${l.id}`===A),Z=j.userText===void 0||j.userText.trim()==="";return((re=J==null?void 0:J.optionProperties)==null?void 0:re.allowsTextEntry)&&Z&&j.isSelected}),R=S=>Object.values(S).filter(A=>A.isSelected).length,U=S=>{const{minSelect:A=0,maxSelect:j=1/0,maxSelectMode:J}=t,Z=R(S);switch(J){case e.MaxSelectModes.Maximum:return Z<=j;case e.MaxSelectModes.Range:return Z===0||Z>=A;default:return!0}},x=t.minSelect&&t.minSelect>0&&t.maxSelectMode===e.MaxSelectModes.Range&&R(m)<t.minSelect&&(L||R(m)>0),T=S=>M(S)||L&&!R(S)||!U(S),q=S=>U(S)&&!M(S)&&R(S)>0,P=Object.entries(m).some(([S,A])=>{var j,J;return A.isSelected&&((J=(j=r.find(Z=>`${Z.id}`===S))==null?void 0:j.optionProperties)==null?void 0:J.allowsTextEntry)}),H=b&&(!f||P),w=S=>{V(S.id,S.selected,S.userText,S.noneOfTheAbove),S.selected&&g&&!f&&!a&&I(o)},E=S=>{var A;return(t==null?void 0:t.maxSelectMode)!==e.MaxSelectModes.Unlimited&&R(m)===(t==null?void 0:t.maxSelect)&&!((A=m[S])!=null&&A.isSelected)},B=S=>{if(S.preventDefault(),S.stopPropagation(),d(m,!0),c){const A=q(m);c(A)}},V=(S,A,j,J)=>{const Z=Object.assign({},m);if((f||J)&&A)for(const k of Object.values(Z))k.isSelected=!1,delete k.userText;else F&&!J&&m[F.id].isSelected&&(Z[F.id].isSelected=!1);Z[S]={isSelected:A,userText:j};const re=f&&Object.entries(Z).some(([k,N])=>{var O,Q;return N.isSelected&&((Q=(O=r.find(G=>`${G.id}`===k))==null?void 0:O.optionProperties)==null?void 0:Q.allowsTextEntry)}),l=!T(Z);if(g&&(d(Z,l),f&&!re&&l&&c)){const k=q(Z);c(k)}C(Z)};return e.u("form",{className:e.cc(n,"ul-card--multiple","fade-in-transition",g&&!a&&"ul-card--unfocused"),id:"text-form",onClick:p==="multipleselect"?()=>{g&&u!==o&&p==="multipleselect"&&I(o)}:void 0,onSubmit:B,children:[e.u(h.Header,{isRequired:g&&(t==null?void 0:t.required),message:i,properties:t}),e.u(h.MobileEmbedView,{properties:t,children:e.u(e.g,{children:[e.u(h.QuestionBodyWrapper,{children:[t.isDropdown?e.u(h.Select,{disabledOptions:r.filter(S=>E(S.id)),dropdownFooter:x?e.u("div",{className:"ul-card__min-select-counter",style:{marginLeft:"16px"},children:[R(m),"/",t.minSelect]}):void 0,isMultiSelect:!f,multiselectText:t.dropdownMultiselectedText??"choices selected",onChange:S=>{const A={...m};for(const j of r)S.includes(j)?A[j.id].isSelected=!0:A[j.id].isSelected=!1;g&&d(A,!T(A)),C(A)},options:r,placeholderText:t.dropdownPlaceholderText??(f?"Select choice":"Select choice(s)"),value:r.filter(S=>m[S.id].isSelected)}):e.u("div",{className:e.cc(e.getClasses("ul-card__choices",s)),role:f?"radiogroup":"group",children:[r.map(({id:S,label:A,value:j,optionProperties:J})=>{var k,N;const Z=`${S}`,{allowsTextEntry:re,noneOfTheAbove:l}={allowsTextEntry:!1,noneOfTheAbove:!1,...J};return e.u(h.Option,{allowTextEntry:re,border:v,disabled:E(Z),error:M(m),id:Z,isRadio:f,isSelected:!!((k=m[Z])!=null&&k.isSelected),label:A,noneOfTheAbove:l,onUserInputChanged:w,promptText:(J==null?void 0:J.otherOptionPlaceholder)||"Please specify",text:(N=m[S])==null?void 0:N.userText,useMobileStyling:s,value:j},Z)}),!!x&&e.u("div",{className:"ul-card__min-select-counter",children:[R(m),"/",t.minSelect]})]}),H&&e.u(h.LongformSubmitButton,{handleSubmit:B,isSubmitDisabled:T(m)})]}),!g&&e.u(h.QuestionBodyFooterContainer,{children:e.u("div",{className:"ul-card__button-wrapper",children:e.u(h.Button,{disabled:T(m),onClick:B,children:e.getButtonText(t)})})})]})})]},o)},Oe=n=>{const{questionId:i,type:d,next:r,options:t}=n,{setFocusedQuestionId:o}=e.useConfig(p=>({setFocusedQuestionId:p.setFocusedQuestionId}));return e.u(Ce,{...n,onSubmit:(p,b)=>{var I;const c=Object.entries(p).find(([,a])=>a.isSelected)||[void 0,void 0],[v,s]=c,g=t.find(a=>`${a.id}`===v);!((I=g==null?void 0:g.optionProperties)!=null&&I.allowsTextEntry)||s!=null&&s.userText&&s.userText.trim()!==""||o(i);const u=s!=null&&s.userText?{[v]:{userText:s.userText}}:null;r({value:g&&v?{[v]:g.value}:{},secondaryValue:u,questionId:i,type:d},b)}})},Ae=n=>{const{questionId:i,type:d,next:r}=n;return e.u(Ce,{...n,onSubmit:(t,o)=>{const p=Object.entries(t).reduce((c,[v,s])=>(c[v]=s.isSelected,c),{}),b=Object.entries(t).reduce((c,[v,s])=>{if(!s.userText)return c;const g=c||{};return g[v]={userText:s.userText},g},null);r({value:p,secondaryValue:b,questionId:i,type:d},o)}})},He=({className:n,labels:i,message:d,properties:r,next:t,questionId:o,type:p})=>{const[b,c]=e.h(null),{border:v,useMobileStyling:s,viewDocument:g,isLongFormSurvey:u,focusedQuestionId:I}=e.useConfig(C=>({border:C.border,useMobileStyling:C.useMobileStyling,viewDocument:C.viewDocument,isLongFormSurvey:ee.isLongFormSurvey(C.studyType),focusedQuestionId:C.focusedQuestionId})),a=u&&I===o,y=i&&i.left,m=i&&i.right;return e.u("form",{className:e.cc(n,"ul-card--nps","fade-in-transition",u&&!a&&"ul-card--unfocused"),children:[e.u(h.Header,{isRequired:u&&(r==null?void 0:r.required),message:d,properties:r}),e.u(h.MobileEmbedView,{properties:r,children:[e.u(h.QuestionBodyWrapper,{children:[e.u("div",{className:"ul-card--nps__numbers",children:[...Array(11)].map((C,f)=>e.u("button",{className:e.cc(e.getClasses("nps-number",s),e.getClasses(`nps-number-${f}`,s)),id:`option-${f}`,onClick:L=>{u&&(L.preventDefault(),L.stopPropagation(),c(f)),t({value:f,questionId:o,type:p},!0)},onKeyDown:L=>{var M,R;const F=g.querySelectorAll("button.nps-number");L.key==="ArrowRight"?(M=F[f+1])==null||M.focus():L.key==="ArrowLeft"?(R=F[f-1])==null||R.focus():L.key!=="Enter"&&L.key!==" "||(u&&(L.preventDefault(),L.stopPropagation(),c(f)),t({value:f,questionId:o,type:p},!0))},onPointerDown:L=>{L.currentTarget.style.zIndex="2",L.currentTarget.style.borderColor=v},onPointerLeave:L=>{L.currentTarget.style.zIndex="auto"},style:b===f?{backgroundColor:v,color:"#fff"}:void 0,tabIndex:0,children:f},f))}),e.u("div",{className:"ul-card--nps__labels",children:[e.u("span",{children:y}),e.u("span",{children:m})]})]}),!r.required&&!u&&e.u(h.QuestionBodyFooterContainer,{children:e.u("div",{className:"ul-vertical-centered-container",children:e.u(h.Button,{onClick:C=>{C.preventDefault(),C.stopPropagation(),t({value:null,questionId:o,type:p},!0)},children:e.getButtonText(r)})})})]})]},o)},$e=n=>{const{className:i,message:d,next:r,properties:t,questionId:o,type:p,showIndividualSubmit:b=!1,onSubmitButtonClick:c}=n,v=p==="aidynamicfollowup"||p==="aidynamicstandalone",s=v?n.loading:void 0,{border:g,useMobileStyling:u,update:I,isLongFormSurvey:a,focusedQuestionId:y,setFocusedQuestionId:m,isPreview:C}=e.useConfig(w=>({border:w.border,useMobileStyling:w.useMobileStyling,update:w.update,isLongFormSurvey:ee.isLongFormSurvey(w.studyType),focusedQuestionId:w.focusedQuestionId,setFocusedQuestionId:w.setFocusedQuestionId,isPreview:w.isPreview})),[f,L]=e.h(""),F=e._(null),M=a&&y===o;e.p(()=>{var w,E;a&&!C&&(M?(w=F.current)==null||w.focus():(E=F.current)==null||E.blur())},[a,M,C]);const R=f.trim(),U=t.required===!0&&!R,x=h.useAutoSize(F,()=>I()),T=w=>{w.preventDefault(),w.stopPropagation();const E=R.length>0,B=!t.required||E;r({value:f,questionId:o,type:p},B),c&&c(E)},q=t&&t.openTextPlaceholder?t.openTextPlaceholder:"";if((s===e.DynamicQuestionLoadingStates.failure||s===void 0)&&v)return e.u(e.g,{});const P=s===e.DynamicQuestionLoadingStates.inFlight,H=P?"Preparing your next question":d;return e.u("form",{className:e.cc(i,"ul-card-text","fade-in-transition",a&&!M&&"ul-card--unfocused"),id:"text-form",onClick:()=>{a&&y!==o&&m(o)},children:[e.u(h.Header,{isRequired:a&&(t==null?void 0:t.required),message:H,properties:t}),e.u(h.MobileEmbedView,{properties:t,children:e.u("div",{className:"ul-card-text",children:e.u(h.QuestionBodyWrapper,{children:[e.u("div",{className:"ul-card-text__container",children:e.u("textarea",{"aria-describedby":"ul-caption","aria-labelledby":"ul-question","aria-multiline":"true","aria-placeholder":q,className:e.cc(P&&"ul-card-text__input__loading",e.getClasses("ul-card-text__input",u)),"data-gramm":"false",disabled:P,maxLength:5e3,name:"text",onBlur:w=>{w.currentTarget.style.borderColor=ee.DEFAULT_BORDER_COLOR},onChange:w=>{const{value:E}=w.currentTarget;if(x(),w.preventDefault(),w.stopPropagation(),L(E),a){const B=E.trim().length>0;r({value:E,questionId:o,type:p},B)}},onFocus:w=>{w.currentTarget.style.borderColor=g,m(o)},placeholder:q,ref:F,role:"textbox",tabIndex:0})}),t.footerHtml&&e.u(h.Html,{className:"footer",html:t.footerHtml}),b&&e.u(h.LongformSubmitButton,{handleSubmit:T,isSubmitDisabled:U}),e.u(h.QuestionBodyFooterContainer,{children:!a&&e.u(h.Button,{disabled:U||P,onClick:T,children:e.getButtonText(t)})})]})})})]},o)},ce=1,Te=2,ke=3,le=n=>n.type==="av_permission",ve=n=>n.type==="screen_permission",_e=(n,i)=>n===void 0?ce:n?((d,r)=>!(le(r)?r.permissionDescriptors:[]).includes("camera")||d.getVideoTracks().length>0)(n,i)?ke:ce:Te,ye={avStream:null,currentPage:null,mediaRecordingUids:null,nextQuestion:()=>{},passthroughData:void 0,recordingMediaTypes:void 0,screenPermissionRequested:!1,type:void 0},ne=e.create(n=>({...ye,reset:()=>{n(ye)},updatePage:i=>{n(i)}}));function pe({currentPage:n,pages:i}){const{avStream:d,recordingMediaTypes:r,updatePage:t}=ne.getState(),{recorderEventEmitter:o}=e.useConfig.getState();o.emit("av.permission",{"permission.descriptors":n.permissionDescriptors,"stream.ready":(p,b)=>{if(d===p)return;let c=n;if(p&&!n.permissionDescriptors.includes("camera")){const v=i.indexOf(n),s=b!=null&&b.active?v+2:v+1;b!=null&&b.active&&r&&o.emit("begin.recording",{"recording.media.types":r,"start.recording.callback":g=>t({mediaRecordingUids:g})}),c=i[s]}t({currentPage:c,avStream:p})}})}function me({status:n}){const{nextQuestion:i,passthroughData:d,mediaRecordingUids:r,reset:t}=ne.getState(),{recorderEventEmitter:o,handleUploadUpdate:p,index:b}=e.useConfig.getState(),c={value:{taskStatus:n},type:"recordedtask",questionId:(d==null?void 0:d.questionId)||1};d&&o.emit("finish.task",{"begin.callback":v=>{p({mediaRecordingUid:v,isSubmitted:!0,progressPct:0,isComplete:!1})},"progress.callback":(v,s)=>{p({mediaRecordingUid:v,progressPct:s.detail,isSubmitted:!1,isComplete:!1})},"upload.callback":v=>{v&&p({mediaRecordingUid:v,isComplete:!0,isSubmitted:!0,progressPct:100})},"passthrough.data":d,"current.index":b,"task.response":c,"task.complete.callback":v=>{c.value.taskDurationMillisecond=v,r&&(c.value.mediaRecordingUids=r),t(),i(c)}})}function ge({pages:n,setIsRequestingPermission:i}){const{recorderEventEmitter:d,eventEmitFn:r}=e.useConfig.getState(),{updatePage:t,currentPage:o,recordingMediaTypes:p,screenPermissionRequested:b}=ne.getState();if(!o)return;const c=n.indexOf(o);switch(o.type){case"av_permission":{const v=b?c+2:c+1;return b&&p&&d.emit("begin.recording",{"recording.media.types":p,"start.recording.callback":s=>{t({mediaRecordingUids:s})}}),void t({currentPage:n[v]})}case"screen_permission":return void d.emit("screen.permission",{"screen.permission.requested":i,"stream.ready.callback":(v,s)=>{const g=s?n[c+1]:o;s&&p&&d.emit("begin.recording",{"recording.media.types":p,"start.recording.callback":u=>{t({captureStream:s,mediaRecordingUids:u})}}),t({currentPage:g,screenPermissionRequested:!0,captureStream:s})}});case"start_task":return r("recorded.task.start"),d.emit("recorded.task.start"),d.emit("start.task"),void t({currentPage:n[c+1],screenPermissionRequested:!0});case"complete_task":return}}const we="ul-permission-graphics-container",Ie="ul-permission-body",Ne=e.cc(we,"ul_recorded-task-inset-spacing"),ue=e.cc("ul-horizontal-button-container","ul-horizontal-button-container-left"),Le=({richTextBody:n})=>e.u(h.Html,{className:"ul-rich-text-body",html:n,id:"ul-task-detail-container"}),de=({required:n,skipButtonText:i,bottom:d=!1})=>n?null:e.u(h.Button,{className:e.cc(d&&"ul-skip-button-below","ul-button-inactive"),onClick:me.bind(null,{status:"abandoned"}),children:i||"Skip"}),he=n=>{const{avStream:i,captureStream:d,recordingMediaTypes:r,updatePage:t}=ne.getState(),o=(r==null?void 0:r.includes("audio"))||(r==null?void 0:r.includes("video"));e.p(()=>{const p=setInterval(()=>{o&&i&&!i.active?t({avStream:null,currentPage:n[0]}):d&&d.active||t({captureStream:void 0,currentPage:n[o?1:0]})},1e3);return()=>clearInterval(p)},[i,d,o,n,r,t])},Ue=({content:n,pages:i,required:d})=>{const{buttonText:r,skipButtonText:t,taskDetail:o}=n;return he(i),e.u("div",{className:"ul-task-page",children:[o&&e.u(Le,{richTextBody:o}),e.u("div",{className:ue,children:[e.u(h.Button,{onClick:ge.bind(null,{pages:i}),children:r}),e.u(de,{required:d,skipButtonText:t})]})]},"start-task")},Ve=({content:n,pages:i,properties:d})=>{const{buttonText:r,skipButtonText:t}=n;return he(i),e.u("div",{className:"ul-task-page",children:[n.taskDetail&&e.u(Le,{richTextBody:n.taskDetail}),e.u(h.MobileEmbedView,{properties:d,children:e.u("div",{className:ue,children:[e.u(h.Button,{className:"ul-complete-task-button",onClick:me.bind(null,{status:"completed"}),children:r}),e.u(h.Button,{className:e.cc("ul-button-inactive"),onClick:me.bind(null,{status:"given.up"}),children:t})]})})]},"complete-task")},We=({content:n,pages:i,required:d})=>{const{buttonText:r,skipButtonText:t}=n,[o]=e.useConfig(c=>[c.tabTitle]),[p,b]=e.h(!1);return e.u("div",{children:[e.u("div",{className:Ne,children:[e.u("p",{style:{marginTop:"auto"},children:n.selectTabText}),e.u("div",{className:"ul-select-tab-container",children:e.u("p",{className:Ie,children:o})})]}),e.u("div",{className:d?"":ue,children:[e.u(h.Button,{disabled:p,onClick:ge.bind(null,{pages:i,setIsRequestingPermission:b}),children:r}),e.u(de,{required:d,skipButtonText:t})]})]})},je=({content:n})=>e.u(h.Html,{className:e.cc(we,"ul_permission_svg_container","ul_recorded-task-inset-spacing","ul-center-horizontally"),html:n.svg},"ul-permission-request-graphic"),ze=({content:n,pages:i,required:d})=>{const{permissionDeniedHeadline:r,permissionDeniedBody:t,skipButtonText:o,tryAgainButtonText:p}=n,b=le(i[0])?i[0]:null;return e.p(()=>{const c=setInterval(()=>{b!==null&&pe({currentPage:b,pages:i})},1e3);return()=>clearInterval(c)},[b,i]),b?e.u("div",{children:[e.u("div",{className:Ne,children:e.u("p",{className:"ul-av-permission-denied-paragraph",children:[e.u("span",{className:"ul-av-permission-denied-headline",children:r}),e.u("span",{className:Ie,children:t})]})}),e.u("div",{className:ue,children:[e.u(h.Button,{onClick:pe.bind(null,{currentPage:b,pages:i}),children:p}),e.u(de,{required:d,skipButtonText:o})]})]}):null},Ge=({stream:n})=>e.u("video",{autoPlay:!0,className:e.cc("ul_recorded-task-inset-spacing"),id:"ul-record-task-video-preview",muted:!0,ref:i=>{i&&(i.srcObject=n||null)}}),Ze=({content:n,pages:i,required:d})=>{const{skipButtonText:r}=n,{avStream:t}=ne.getState();return he(i),e.u("div",{children:[e.u(Ge,{stream:t}),e.u("div",{className:"ul-vertical-button-container-center",children:[e.u(h.Button,{onClick:ge.bind(null,{pages:i}),children:n.buttonText}),e.u(de,{bottom:!0,required:d,skipButtonText:r})]})]})},Ye=({properties:n})=>{const{pages:i,required:d}=n,{avStream:r,currentPage:t}=ne.getState();if(t===void 0)return null;switch(t==null?void 0:t.type){case"av_permission":{const o=_e(r,t);return o===ce?e.u(je,{content:t}):o===Te?e.u(ze,{content:t,pages:i,required:d}):e.u(Ze,{content:t,pages:i,required:d})}case"screen_permission":return e.u(We,{content:t,pages:i,required:d});case"start_task":return e.u(Ue,{content:t,pages:i,required:d});case"complete_task":return e.u(Ve,{content:t,pages:i,properties:n});default:return null}},Ke=({className:n,properties:i,next:d,questionId:r})=>{const t=e.useConfig(),{surveyId:o,responseGroupUid:p,userId:b,update:c}=t,v=ne(),{screenPermissionRequested:s}=v,g=ne(m=>m.avStream);let u=ne(m=>m.currentPage);u||(u=function({pages:m,userId:C,responseGroupUid:f,surveyId:L,questionId:F,next:M}){const{updatePage:R}=ne.getState(),{eventEmitFn:U,recorderEventEmitter:x}=e.useConfig.getState(),T={questionId:F,surveyId:L,visitorId:C,responseGroupUid:f};let q=0;x.emit("recorded.task.permission.screen"),U("recorded.task.permission.screen"),x.emit("permission.status",{"permission.status.callback":(H,w,E,B)=>{const V=m[q],{type:S}=V,A=["screen"];if(le(V)){const{permissionDescriptors:j}=V,J=j==null?void 0:j.includes("microphone"),Z=j==null?void 0:j.includes("camera");J&&A.push("audio"),Z&&A.push("video"),(H!=null&&H.active&&!Z||H!=null&&H.active&&w)&&q++}ve(m[q])&&E&&(q++,x.emit("begin.recording",{"recording.media.types":A,"start.recording.callback":j=>R({mediaRecordingUids:j})})),R({currentPage:m[q],avStream:H,screenPermissionRequested:E,nextQuestion:M,type:S,passthroughData:T,recordingMediaTypes:A,captureStream:B})}});const P=m[q];return P.type==="av_permission"&&pe({currentPage:P,pages:m}),P}({questionId:r,surveyId:o,next:m=>{d(m,!0)},pages:i.pages,responseGroupUid:p,userId:b}));let I=u.headline,a=u.captionText;const y=_e(g,u);return ve(u)&&s&&(I=u.permissionDeniedHeadline,a=u.permissionDeniedCaptionText),le(u)&&y===ke&&(I=u.permissionGrantedHeadline,a=u.permissionGrantedCaptionText),e.p(()=>{c()},[c]),e.u("div",{className:e.cc(n,"ul-center-horizontally","fade-in-transition"),children:[e.u(h.Header,{isRequired:i==null?void 0:i.required,message:I,properties:{captionText:a}}),e.u(h.QuestionBodyWrapper,{children:e.u(Ye,{properties:i})})]})},Xe=({richTextBody:n,plaintextBody:i})=>n?e.u(h.Html,{className:"ul-rich-text-body",html:n,id:"ul-card__text-url-body-container"}):i?e.u("div",{className:"ul-rich-text-body",id:"ul-card__text-url-body-container",children:(i?i.split(/\n\s*\n/g):[]).map((d,r)=>e.u("p",{children:d},r))}):null,Je=({className:n,message:i,next:d,properties:r,questionId:t,type:o})=>{const{visitorAttributes:p,isLongFormSurvey:b}=e.useConfig(g=>({visitorAttributes:g.visitorAttributes,isLongFormSurvey:ee.isLongFormSurvey(g.studyType)})),c=(g,u=!1)=>{d({value:u?{skipped:!0}:void 0,questionId:t,type:o},!0)},v=h.getAttributedUrl(r&&r.buttonUrl,p),s=b&&r.promptActionType===e.PromptActionTypeEnum.NO_BUTTON;return e.u("div",{className:e.cc(n,"ul-card__text-url-prompt","fade-in-transition"),children:[e.u(h.Header,{isRequired:b&&(r==null?void 0:r.required),message:i,properties:{image:r.image,questionHtml:r.questionHtml}}),e.u(h.QuestionBodyWrapper,{children:e.u(Xe,{plaintextBody:r==null?void 0:r.body,richTextBody:r==null?void 0:r.richTextBody})}),e.u(h.MobileEmbedView,{properties:r,children:!s&&e.u(h.QuestionBodyFooterContainer,{children:e.u("div",{className:"ul-card-button-group",children:[e.u("a",{className:"ul-card-text__button ul-card__text-url-prompt-button",href:v,id:"ul-card-text__button",onClick:c,onKeyPress:g=>{g.key!=="Enter"&&g.key!==" "||d({value:void 0,questionId:t,type:o},!0)},rel:"noreferrer",role:v?"link":"button",tabIndex:0,target:"_blank",children:e.getButtonText(r)}),r.required===!1&&e.u("button",{className:"ul-card-skip__button",onClick:g=>c(0,!0),children:e.getSkipButtonText(r)})]})})})]},t)},et=({className:n,questionId:i})=>{const{border:d,destroy:r,endCard:t,forceBrandedLogo:o,quotaEndcardText:p,update:b}=e.useConfig(g=>({border:g.border,destroy:g.destroy,endCard:g.endCard,forceBrandedLogo:g.forceBrandedLogo,quotaEndcardText:g.quotaEndcardText,update:g.update}));e.p(()=>{setTimeout(()=>{r(ee.APP_ID)},o?4e3:2e3)},[r,o]);const c=(p==null?void 0:p.subheader)??(t==null?void 0:t.subheader),v=c?e.u("p",{className:"ul-caption",children:c}):null,s=(p==null?void 0:p.headline)??(t==null?void 0:t.headline)??"";return e.p(()=>{b()},[b]),e.u("div",{className:e.cc(n,"ul-card--thanks","fade-in-transition"),children:e.u("div",{children:e.u("div",{className:"ul-card--thanks-content",children:[e.u("div",{className:"ul-thanks-check",children:e.u("svg",{"aria-labelledby":"title",fill:"none",height:"99",viewBox:"0 0 81 99",width:"81",xmlns:"http://www.w3.org/2000/svg",children:[e.u("path",{clipRule:"evenodd",d:"M40.5 77C60.9345 77 77.5 60.4345 77.5 40C77.5 19.5655 60.9345 3 40.5 3C20.0655 3 3.5 19.5655 3.5 40C3.5 60.4345 20.0655 77 40.5 77ZM80.5 40C80.5 62.0914 62.5914 80 40.5 80C18.4086 80 0.5 62.0914 0.5 40C0.5 17.9086 18.4086 0 40.5 0C62.5914 0 80.5 17.9086 80.5 40Z",fill:d,fillRule:"evenodd"}),e.u("path",{clipRule:"evenodd",d:"M55.025 22.9046C55.6299 23.4705 55.6616 24.4198 55.0956 25.0247C54.8724 25.2634 54.6109 25.5285 54.3157 25.8277C52.2547 27.9168 48.5549 31.667 44.8135 39.6658C43.2818 42.9406 42.0864 45.8386 41.0823 48.2729C40.6539 49.3116 40.2603 50.2659 39.8902 51.129C39.287 52.5359 38.7248 53.7508 38.1744 54.625C37.8997 55.0613 37.5806 55.4905 37.2017 55.8245C36.8201 56.1607 36.2613 56.5 35.5457 56.5C34.6742 56.5 34.0892 55.9692 33.7774 55.6083C33.4502 55.2296 33.1752 54.7511 32.9396 54.301C32.7305 53.9013 32.5088 53.4367 32.2797 52.9565C32.2429 52.8794 32.2059 52.8019 32.1688 52.7243C31.8942 52.1499 31.5959 51.534 31.2537 50.8868C29.8886 48.305 27.8539 45.2878 24.2343 43.1382C23.522 42.7152 23.2875 41.7949 23.7105 41.0826C24.1335 40.3703 25.0539 40.1358 25.7662 40.5588C30.0556 43.1062 32.4149 46.6647 33.9058 49.4845C34.2776 50.1876 34.5973 50.8487 34.8753 51.4302C34.9147 51.5124 34.9529 51.5926 34.9902 51.6707C35.2222 52.1567 35.4164 52.5637 35.5978 52.9102C35.6151 52.9434 35.6321 52.9754 35.6485 53.0061C36.0565 52.3531 36.5341 51.3434 37.133 49.9468C37.4781 49.1418 37.8572 48.2229 38.2761 47.2074C39.2886 44.7532 40.5339 41.7347 42.0961 38.3948C46.0591 29.9221 50.0641 25.8648 52.1535 23.7482C52.4423 23.4556 52.6944 23.2002 52.9048 22.9753C53.4708 22.3703 54.42 22.3387 55.025 22.9046ZM35.1994 53.5892C35.1994 53.5892 35.2 53.5888 35.2012 53.5879C35.2 53.5889 35.1994 53.5893 35.1994 53.5892ZM36.0666 53.6682C36.0732 53.674 36.0765 53.6775 36.0765 53.6777C36.0765 53.678 36.0732 53.6751 36.0666 53.6682Z",fill:d,fillRule:"evenodd"}),e.u("path",{d:"M69.5 97C69.5 98.1046 56.2924 99 40 99C23.7076 99 10.5 98.1046 10.5 97C10.5 95.8954 23.7076 95 40 95C56.2924 95 69.5 95.8954 69.5 97Z",fill:"black",fillOpacity:"0.2"})]})}),e.u(h.Header,{message:s}),v]})})},i)},tt=({className:n})=>{const{uploadProgress:i}=e.useConfig(o=>({uploadProgress:o.uploadProgress}));let d,r;Object.values(i).filter(o=>o.isSubmitted).length>1?(d="Your responses are processing",r="Please keep this tab open until your responses are fully processed."):(d="Your response is processing",r="Please keep this tab open until your response is fully processed.");const t=Math.round(Math.min(99,...Object.values(i).filter(o=>o.isSubmitted).map(o=>o.progressPct||0)));return e.u("div",{className:e.cc(n,"ul-card--uploading","fade-in-transition"),children:[e.u("div",{"aria-busy":"true","aria-label":"Processing...","aria-live":"polite",className:"ul-loading-spinner-container",role:"progressbar",children:e.u("div",{className:"ul-loading-spinner",children:[e.u("div",{className:"first"}),e.u("div",{className:"second"}),e.u("div",{className:"third"}),e.u("div",{className:"fourth"})]})}),e.u(h.Header,{message:`${d} (${t}% complete)`}),e.u("p",{className:"ul-caption",children:r})]})},qe=e.F$1(void 0),rt=({value:n,children:i})=>e.u(qe.Provider,{value:n,children:i}),nt=({isRightLabel:n,isLeftLabel:i})=>n?e.MaxDiffChoice.RIGHT:i?e.MaxDiffChoice.LEFT:null,it="Best",st="Worst",ot=({className:n,labels:i,message:d,properties:r,options:t,questionId:o,type:p,next:b})=>{var F,M,R,U;const[c,v]=e.h(t.map((x,T)=>({...x,label:x.label===""?`Item ${T+1}`:x.label,isRightLabel:!1,isLeftLabel:!1}))),s=(()=>{const x=e.q(qe);if(x===void 0)throw new Error("usePreviousResponses must be used within a PreviousResponsesProvider");return x})(),g={padding:"24px",display:"flex",cursor:"pointer",width:"auto"},[u,I]=e.h(!1);e.p(()=>{const x=c.findIndex(V=>V.isRightLabel),T=c.findIndex(V=>V.isLeftLabel),q=x!==-1&&T!==-1;I(q);const P=!r.required||r.required&&q,H=c.map(V=>({id:V.id,option:V.label,selected:nt(V)})),w=Math.floor(o),E=Object.keys(s).filter(V=>V.startsWith(w.toString())).map(Number).sort((V,S)=>V-S).at(-1),B=[];if(typeof E=="number"){const V=s[E],S=JSON.parse(V);B.push(...S)}B.push(H),setTimeout(()=>{b({value:B,questionId:o,type:p},P,q),I(!1)},q?500:0)},[c]);const{border:a,useMobileStyling:y,enableCspTrustedTypes:m}=e.useConfig(x=>({border:x.border,useMobileStyling:x.useMobileStyling,enableCspTrustedTypes:x.enableCspTrustedTypes})),C=(x,T)=>()=>{u||v(q=>((P,H,w)=>P.map(E=>E.id===H?{...E,isRightLabel:w===e.MaxDiffChoice.RIGHT,isLeftLabel:w===e.MaxDiffChoice.LEFT}:w===e.MaxDiffChoice.RIGHT&&E.isRightLabel||w===e.MaxDiffChoice.LEFT&&E.isLeftLabel?{...E,isRightLabel:!1,isLeftLabel:!1}:E))(q,x,T))},f=(F=r.ratingIcons)==null?void 0:F[0].svg,L=(M=r.ratingIcons)==null?void 0:M[1].svg;return e.u("form",{className:e.cc(n,"ul-card-maxdiff","fade-in-transition"),children:[e.u(h.Header,{isRequired:r==null?void 0:r.required,message:d,properties:r}),e.u(h.QuestionBodyWrapper,{children:e.u("div",{className:"ul-card--maxdiff__question-inner-container",children:[e.u("div",{className:"ul-card-maxdiff__label",children:(i==null?void 0:i.left)||((R=r==null?void 0:r.labels)==null?void 0:R.left)||it}),e.u("div",{children:" "}),e.u("div",{className:"ul-card-maxdiff__label",children:(i==null?void 0:i.right)||((U=r==null?void 0:r.labels)==null?void 0:U.right)||st}),c.map(({id:x,label:T,isLeftLabel:q,isRightLabel:P})=>e.u(e.g,{children:[e.u("div",{className:"ul-card-maxdiff__option-control "+(L?"smiley":""),children:L?e.u(fe,{ariaPressed:q,className:q?"ul-card-maxdiff__option-btn ul-card-maxdiff__option-selected good":"ul-card-maxdiff__option-btn",enableCspTrustedTypes:m,html:L,id:`smiley-good-${x}`,onClick:C(x,e.MaxDiffChoice.LEFT)}):e.u(h.Option,{allowTextEntry:!1,ariaLabel:`bestLabel-${T}`,border:a,choiceStyle:g,error:!1,id:`${x}`,isRadio:!0,isSelected:q,onUserInputChanged:C(x,e.MaxDiffChoice.LEFT),useMobileStyling:y})}),e.u("div",{className:"ul-card-maxdiff__option-label",children:T}),e.u("div",{className:"ul-card-maxdiff__option-control "+(f?"smiley":""),children:f?e.u(fe,{ariaPressed:P,className:P?"ul-card-maxdiff__option-btn ul-card-maxdiff__option-selected bad":"ul-card-maxdiff__option-btn",enableCspTrustedTypes:m,html:f,id:`smiley-bad-${x}`,onClick:C(x,e.MaxDiffChoice.RIGHT)}):e.u(h.Option,{allowTextEntry:!1,ariaLabel:`worstLabel-${T}`,border:a,choiceStyle:g,error:!1,id:`${x}`,isRadio:!0,isSelected:P,onUserInputChanged:C(x,e.MaxDiffChoice.RIGHT),useMobileStyling:y})})]}))]})})]},o)},fe=({enableCspTrustedTypes:n,ariaPressed:i,className:d,html:r,id:t,onClick:o})=>{const p=e.F(()=>ee.getHtml(r,n),[n,r]);return e.u("span",{"aria-pressed":i,className:d,dangerouslySetInnerHTML:{__html:p},id:t,onClick:o,tabIndex:0,type:"button"})},at=({className:n,labels:i,message:d,next:r,properties:t,questionId:o,type:p,onSubmitButtonClick:b,options:c,showIndividualSubmit:v=!1})=>{const s=e._(null),g=e._(0),u=e._(0),I=e._(null),a=e._(!1),y=e._([]),[m,C]=e.h(()=>(t==null?void 0:t.required)===!0),[f,L]=e.h(!1),[F,M]=e.h(()=>c.map(_=>({..._,rank:null}))),R=e.F(()=>Array.from({length:c.length},(_,W)=>W+1),[c.length]),{isLongFormSurvey:U,focusedQuestionId:x,setFocusedQuestionId:T,useMobileStyling:q,isPreview:P,headers:H}=e.useConfig(_=>({useMobileStyling:_.useMobileStyling,isLongFormSurvey:ee.isLongFormSurvey(_.studyType),focusedQuestionId:_.focusedQuestionId,setFocusedQuestionId:_.setFocusedQuestionId,isPreview:_.isPreview,headers:_.headers})),w=(H==null?void 0:H["userleap-platform"])==="android",E=q&&!P&&!w,B=!E&&!w,V=U&&x===o,S=_=>{_.preventDefault(),k(F),b&&b(f)},A=(_,W)=>{M($=>{const D=parseInt(W),z=$.map(Y=>({...Y}));z.some(Y=>Y.rank==null)&&z.forEach((Y,oe)=>Y.rank=oe+1);const te=z.findIndex(Y=>Y.id===_);if(te===-1)return $;const X=z[te].rank;return D<X?z.forEach(Y=>{Y.id!==_&&Y.rank>=D&&Y.rank<X&&(Y.rank=Y.rank+1)}):D>X&&z.forEach(Y=>{Y.id!==_&&Y.rank>X&&Y.rank<=D&&(Y.rank=Y.rank-1)}),z[te].rank=D,z.sort((Y,oe)=>Y.rank-oe.rank),N(z),z})},j=(_,W)=>{for(let $=0;$<y.current.length;$++){const D=y.current[$];if(!D||D===I.current)continue;const z=D.getBoundingClientRect();if(_>=z.left&&_<=z.right&&W>=z.top&&W<=z.bottom)return{element:D,index:$}}return null},J=_=>W=>{if(!E)return;W.preventDefault(),W.stopPropagation(),a.current=!0,s.current=_;const $=W.touches[0];g.current=$.clientY,u.current=$.clientY;const D=W.currentTarget.closest(".ul-card-rank__option");D&&(I.current=D,D.classList.add("is-dragging"))},Z=_=>{if(!E||!a.current||s.current===null)return;_.preventDefault(),_.stopPropagation();const W=_.touches[0];u.current=W.clientY;const $=u.current-g.current;I.current&&(I.current.style.transform=`translateY(${$}px)`,I.current.style.zIndex="1000"),y.current.forEach(z=>{z&&z!==I.current&&z.classList.remove("is-drop-target")});const D=j(W.clientX,W.clientY);D&&D.element.classList.add("is-drop-target")},re=_=>{if(!E||!a.current||s.current===null)return;_.preventDefault(),_.stopPropagation();const W=_.changedTouches[0],$=j(W.clientX,W.clientY);I.current&&(I.current.style.transform="",I.current.style.zIndex="",I.current.classList.remove("is-dragging")),y.current.forEach(D=>{D&&D.classList.remove("is-drop-target")}),$&&$.index!==s.current&&l(s.current,$.index),s.current=null,I.current=null,a.current=!1},l=(_,W)=>{M($=>{const D=$.map(te=>({...te})),[z]=D.splice(_,1);return D.splice(W,0,z),D.forEach((te,X)=>{te.rank=X+1}),N(D),D})},k=_=>{const W={};_.reduce(($,D)=>($[D.id]=D.rank,$),W),r({value:W,questionId:o,type:p},!0)},N=_=>{C(!1),L(!0),U&&k(_)},{left:O,right:Q}=i,G=c.length,K=_=>{_.preventDefault(),_.currentTarget.classList.add("is-drop-target")},ie=_=>{_.currentTarget.classList.remove("is-drop-target")},se=_=>{s.current=null,_.currentTarget.classList.remove("is-dragging")};return e.u("form",{className:e.cc(n,"ul-card-rank","fade-in-transition",U&&!V&&"ul-card--unfocused"),onClick:U&&!V?()=>{T(o)}:void 0,onSubmit:S,children:[e.u(h.Header,{isRequired:t==null?void 0:t.required,message:d,properties:t}),e.u(h.MobileEmbedView,{properties:t,children:w?e.u(e.g,{children:[e.u(h.QuestionBodyWrapper,{children:[e.u("div",{className:"ul-card--rank__question-inner-container",children:[e.u("div",{className:"ul-card-rank__labels",children:e.u("span",{children:["1 - ",O]})}),e.u("ol",{className:"ul-card-rank__list",children:F.map(({id:_,label:W,rank:$})=>e.u("li",{className:"ul-card-rank__option",children:[e.u("select",{"aria-label":`Rank for ${W}`,className:e.cc("ul-card-rank__select",$==null&&"ul-card-rank__select--placeholder"),name:`rank[${_}]`,onChange:D=>A(_,D.currentTarget.value),value:$??"",children:[$==null&&e.u("option",{className:"ul-card-rank__select-option",disabled:!0,value:"",children:"-"}),R.map(D=>e.u("option",{className:"ul-card-rank__select-option",value:D,children:D},`${D}-${o}`))]}),e.u("span",{children:W})]},_))}),e.u("div",{className:"ul-card-rank__labels",children:e.u("span",{children:[G," - ",Q]})})]}),v&&e.u(h.LongformSubmitButton,{handleSubmit:S,isSubmitDisabled:m})]}),!U&&e.u(h.QuestionBodyFooterContainer,{children:e.u("div",{className:"ul-card__button-wrapper",children:e.u(h.Button,{disabled:m,children:e.getButtonText(t)})})})]}):e.u(e.g,{children:[e.u(h.QuestionBodyWrapper,{children:[e.u("div",{className:"ul-card--rank__question-inner-container",children:[e.u("div",{className:"ul-card-rank__labels",children:e.u("span",{children:["1 - ",O]})}),e.u("ol",{className:"ul-card-rank__list",onDragOver:w?void 0:_=>{_.preventDefault(),_.dataTransfer&&(_.dataTransfer.dropEffect="move")},children:F.map(({id:_,label:W,rank:$},D)=>{return e.u("li",{className:"ul-card-rank__option",draggable:!!B||void 0,onDragEnd:B?se:void 0,onDragEnter:B?K:void 0,onDragLeave:B?ie:void 0,onDragStart:B?(te=D,X=>{s.current=te,X.dataTransfer&&(X.dataTransfer.effectAllowed="move",X.dataTransfer.setData("text/plain",String(te)),X.currentTarget.classList.add("is-dragging"))}):void 0,onDrop:B?(z=D,X=>{var oe,be;X.preventDefault(),X.currentTarget.classList.remove("is-drop-target");const Y=s.current;s.current=null,(be=(oe=X.currentTarget.closest(".ul-card-rank__list"))==null?void 0:oe.querySelector(".is-dragging"))==null||be.classList.remove("is-dragging"),Y!=null&&Y!==z&&l(Y,z)}):void 0,ref:X=>y.current[D]=X,children:[e.u("select",{"aria-label":`Rank for ${W}`,className:e.cc("ul-card-rank__select",$==null&&"ul-card-rank__select--placeholder"),name:`rank[${_}]`,onChange:X=>A(_,X.currentTarget.value),value:$??"",children:[$==null&&e.u("option",{className:"ul-card-rank__select-option",disabled:!0,value:"",children:"-"}),R.map(X=>e.u("option",{className:"ul-card-rank__select-option",value:X,children:X},`${X}-${o}`))]}),e.u("span",{children:W}),!w&&e.u("button",{"aria-label":`Drag ${W} to reorder`,className:"ul-card-rank__drag-btn",onTouchEnd:E?re:void 0,onTouchMove:E?Z:void 0,onTouchStart:E?J(D):void 0,title:"Drag to reorder",type:"button",children:e.u("svg",{fill:"none",height:"17",viewBox:"0 0 16 17",width:"16",xmlns:"http://www.w3.org/2000/svg",children:e.u("path",{d:"M5.75 11.625C6.37132 11.625 6.875 12.1287 6.875 12.75C6.875 13.3713 6.37132 13.875 5.75 13.875C5.12868 13.875 4.625 13.3713 4.625 12.75C4.625 12.1287 5.12868 11.625 5.75 11.625ZM10.25 11.625C10.8713 11.625 11.375 12.1287 11.375 12.75C11.375 13.3713 10.8713 13.875 10.25 13.875C9.62868 13.875 9.125 13.3713 9.125 12.75C9.125 12.1287 9.62868 11.625 10.25 11.625ZM5.75 7.375C6.37132 7.375 6.875 7.87868 6.875 8.5C6.875 9.12132 6.37132 9.625 5.75 9.625C5.12868 9.625 4.625 9.12132 4.625 8.5C4.625 7.87868 5.12868 7.375 5.75 7.375ZM10.25 7.375C10.8713 7.375 11.375 7.87868 11.375 8.5C11.375 9.12132 10.8713 9.625 10.25 9.625C9.62868 9.625 9.125 9.12132 9.125 8.5C9.125 7.87868 9.62868 7.375 10.25 7.375ZM5.75 3.125C6.37132 3.125 6.875 3.62868 6.875 4.25C6.875 4.87132 6.37132 5.375 5.75 5.375C5.12868 5.375 4.625 4.87132 4.625 4.25C4.625 3.62868 5.12868 3.125 5.75 3.125ZM10.25 3.125C10.8713 3.125 11.375 3.62868 11.375 4.25C11.375 4.87132 10.8713 5.375 10.25 5.375C9.62868 5.375 9.125 4.87132 9.125 4.25C9.125 3.62868 9.62868 3.125 10.25 3.125Z",fill:"currentColor"})})})]},_);var z,te})}),e.u("div",{className:"ul-card-rank__labels",children:e.u("span",{children:[G," - ",Q]})})]}),v&&e.u(h.LongformSubmitButton,{handleSubmit:S,isSubmitDisabled:m})]}),!U&&e.u(h.QuestionBodyFooterContainer,{children:e.u("div",{className:"ul-card__button-wrapper",children:e.u(h.Button,{disabled:m,children:e.getButtonText(t)})})})]})})]},o)},lt=new Set(["aidynamicfollowup","aidynamicstandalone","open","matrix","multipleselect","multiplechoice","rankorder"]),xe=({cardInstance:n,moveToNextQuestion:i,showIndividualSubmit:d,submitQuestion:r,updateCardValues:t,allResponsesArray:o})=>{const{isLongFormSurvey:p,createDynamicFollowupQuestion:b,cards:c,surveyVisitorAttributes:v}=e.useConfig(f=>({isLongFormSurvey:ee.isLongFormSurvey(f.studyType),createDynamicFollowupQuestion:f.createDynamicFollowupQuestion,cards:f.cards,surveyVisitorAttributes:f.surveyVisitorAttributes}));if(!n)return null;const{name:s,type:g,props:u,childId:I}=n,a=d&<.has(g),y=u==null?void 0:u.displayLogic;if(y!=null&&y.length&&!e.someDisplayLogicOptionMatches({displayLogic:y,allResponses:o,cards:c,surveyVisitorAttributes:v??{}}))return null;const m={className:"ul-card",next:(f,L,F=!0)=>r(f,L&&F),questionId:s,type:g,showIndividualSubmit:d,...a?{next:(f,L)=>{t(f.questionId,f,L??!0)},onSubmitButtonClick:(f=!1)=>{I?f?(i(s),b({parentQuestionId:s})):i(I):i(s)}}:{}},C=(()=>{switch(g){case"consentlegal":return e.u(Be,{...m,...u});case"likert":return e.u(Re,{...m,...u});case"matrix":return e.u(Ee,{...m,...u});case"maxdiff":return e.u(ot,{...m,...u});case"multiplechoice":return e.u(Oe,{...m,...u});case"multipleselect":return e.u(Ae,{...m,...u});case"nps":return e.u(He,{...m,...u});case"open":case"aidynamicfollowup":case"aidynamicstandalone":return e.u($e,{...m,type:n.type,...u});case"rankorder":return e.u(at,{...m,...u});case"recordedtask":return e.u(Ke,{...m,...u});case"texturlprompt":return e.u(Je,{...m,...u});case"thanks":return e.u(et,{...m,...u});case"uploading":return e.u(tt,{...m,...u});default:return null}})();return C?p?e.u("div",{className:"ul-card-scroll-wrapper",children:C},s):C:null},ut=({isSubmitDisabled:n=!1,onSubmit:i,buttonText:d})=>{var I;const{cards:r,forceBrandedLogo:t,index:o,marketingUrl:p,showSurveyBrand:b,slugName:c,surveyId:v,useMobileStyling:s}=e.useConfig(a=>({cards:a.cards,forceBrandedLogo:a.forceBrandedLogo,index:a.index,marketingUrl:a.marketingUrl,showSurveyBrand:a.showSurveyBrand,slugName:a.slugName,surveyId:a.surveyId,useMobileStyling:a.useMobileStyling})),g=((I=r[o])==null?void 0:I.type)==="thanks",u=e.buildMarketingUrl({marketingUrl:p,slugName:c,surveyId:v,forceBrandedLogo:t});return e.u("footer",{className:e.cc("long-form-question-footer-container",s&&"long-form-question-footer-container--mobile",g&&"long-form-question-footer-container-center"),children:[g&&t?e.u(e.ThankYouLink,{marketingUrlLink:u}):e.u("div",{className:"long-form-question-footer-container-logo",children:b?e.u(e.SprigBrandLogo,{forceBrandedLogo:t,marketingUrlLink:u}):null}),!g&&e.u("div",{className:e.cc("ul-card__button-wrapper","ul-card-vertical__button-wrapper","long-form-question-footer-container-actions"),children:e.u(h.Button,{className:e.cc("long-form-button",n&&"sprig-button-disabled"),disabled:n,onClick:i,children:e.u("span",{className:"long-form-button-text-container",children:d??e.u(e.Arrow,{stroke:"white"})})})})]})},dt=new Set(["thanks","uploading"]),Se="Questions with Display Logic do not show in side-by-side previews.";exports.PageCard=({cards:n,next:i,previousResponses:d})=>{var re;const r=e._(null),[t,o]=e.h({}),[p,b]=e.h({}),{isLongFormSurvey:c,focusedQuestionId:v,setFocusedQuestionId:s,createDynamicFollowupQuestion:g,allResponses:u,cardIndexByName:I,surveyVisitorAttributes:a,cards:y,createDynamicStandaloneQuestion:m,isPreview:C,update:f}=e.useConfig(l=>({isLongFormSurvey:ee.isLongFormSurvey(l.studyType),focusedQuestionId:l.focusedQuestionId,setFocusedQuestionId:l.setFocusedQuestionId,createDynamicFollowupQuestion:l.createDynamicFollowupQuestion,allResponses:l.allResponses,cardIndexByName:l.cardIndexByName,surveyVisitorAttributes:l.surveyVisitorAttributes,cards:l.cards,createDynamicStandaloneQuestion:l.createDynamicStandaloneQuestion,isPreview:l.isPreview,update:l.update})),L=e.F(()=>({...d,...e.buildReadableResponseMap(n.map(l=>{var k,N;return{...l,value:((k=t[l.name])==null?void 0:k.value)??null,secondaryValue:((N=t[l.name])==null?void 0:N.secondaryValue)??null}}))}),[d,t,n]);h.useSetAllResponsesRaw(L);const F=e.pipeReadableResponsesIntoCards(n,L),M=e.F(()=>e.buildResponsesArrayForDisplayLogic({storeAllResponses:u,cards:n,cardValues:t,cardIndexByName:I}),[u,n,t,I]),R=e.F(()=>{const l=new Set;return n.forEach(k=>{var O;const N=(O=k.props)==null?void 0:O.displayLogic;if(!N||N.length===0)return void l.add(k.name);e.someDisplayLogicOptionMatches({displayLogic:N,allResponses:M,cards:y,surveyVisitorAttributes:a??{}})&&l.add(k.name)}),l},[n,M,a,y]),U=(({isPreview:l,cards:k,displayedCardNames:N})=>{var G;if(!l||N.size>0)return!1;const O=k.filter(K=>!dt.has(K.type));if(O.length!==1)return!1;const Q=(G=O[0].props)==null?void 0:G.displayLogic;return!!(Q!=null&&Q.length)})({isPreview:!!C,cards:n,displayedCardNames:R});e.p(()=>{U&&requestAnimationFrame(()=>{f()})},[U,f]),e.p(()=>{n.some(l=>{if(l.type==="aidynamicstandalone"&&l.props&&R.has(l.name)){if(l.props.loading===e.DynamicQuestionLoadingStates.inFlight)return!0;if(l.props.loading===void 0)return m({questionId:l.name}),!0}return!1})},[n,m,R]);const x=e._(null);e.p(()=>{const l=R,k=x.current;if(k!==null)for(const N of k)l.has(N)||(o(O=>{const Q={...O};return delete Q[N],Q}),b(O=>{const Q={...O};return delete Q[N],Q}));x.current=new Set(l)},[R]);const T=e._(null),q=e._(!1),P=e._(null),H=e.T(l=>{var Q,G;q.current=!0;const k=n.findIndex(K=>K.name===l);if(!c||l===null||k===-1)return void(q.current=!1);const N=(Q=T.current)==null?void 0:Q.querySelectorAll(".ul-card-scroll-wrapper")[k],O=(G=T.current)==null?void 0:G.closest(".ul-card-main-content");if(N&&O){if(N&&O){const K=N.getBoundingClientRect(),ie=O.getBoundingClientRect(),se=K.top-ie.top+O.scrollTop,_=se+K.height/2,W=window.innerHeight-157;let $;K.height>=W?$=se:$=_-O.clientHeight/2;const D=O.clientHeight,z=O.scrollHeight-D,te=Math.max(0,Math.min($,z));O.scrollTo({top:te,behavior:"smooth"}),setTimeout(()=>{q.current=!1},500)}}else q.current=!1},[c,n]);function w(l,k){return l.filter(N=>R.has(N.name)).map(N=>{const O=k[N.name],Q=F.find(G=>G.name===N.name);return{...O,questionText:Q?e.getProcessedQuestionText(Q):void 0}})}e.p(()=>{v!==null&&n.findIndex(l=>l.name===v)!==-1||s(n[0].name)},[n,v,s]);const E=l=>{if(!c)return;let k=n.findIndex(N=>N.name===l)+1;for(;k<n.length&&!R.has(n[k].name);)k++;k<n.length?s(n[k].name):s(l)};e.p(()=>{c&&v!==null&&(P.current!==v?H(v):P.current=null)},[v,c,H]);const B=e.T(()=>{var ie,se;if(q.current)return;const l=(ie=T.current)==null?void 0:ie.closest(".ul-card-main-content");if(!l)return;const k=(se=T.current)==null?void 0:se.querySelectorAll(".ul-card-scroll-wrapper");if(!k||k.length===0)return;const N=l.getBoundingClientRect(),O=N.top+N.height/2;let Q=0,G=1/0;k.forEach((_,W)=>{const $=_.getBoundingClientRect(),D=$.top+$.height/2,z=Math.abs(O-D);z<G&&(G=z,Q=W)});const K=n[Q];P.current=K.name,s(K.name)},[n,s]);e.p(()=>{var k;if(!c)return;const l=((k=T.current)==null?void 0:k.closest(".ul-card__container"))||null;return l&&l.addEventListener("scroll",B,{passive:!0}),()=>{l&&l.removeEventListener("scroll",B)}},[B,c]);const V=e.F(()=>n.every(l=>{var k;return!R.has(l.name)||!(!(l!=null&&l.props)||!("properties"in l.props)||((k=l.props.properties)==null?void 0:k.required)!==!1)||p[l.name]}),[p,n,R]),S=async(l,k,N)=>{return b(Q=>({...Q,[l]:N})),await(O=Q=>({...Q,[l]:k}),new Promise(Q=>{o(G=>{const K=O(G);return Q(K),K})}));var O};e.p(()=>{var O;if(!c)return;const l=r.current,k=(O=n==null?void 0:n[0])==null?void 0:O.groupId;r.current=k;const N={};if(n.forEach(Q=>{var G,K;e.appCardHasPropertiesWithRequired(Q)&&(Q.props.properties.required||(N[Q.name]={value:((G=t[Q.name])==null?void 0:G.value)??null,secondaryValue:((K=t[Q.name])==null?void 0:K.secondaryValue)??null,questionId:Q.name,type:Q.type}))}),l==null||l!==k)o(N),b({});else{o(G=>({...G,...N}));const Q=n.reduce((G,K)=>{var ie;return K.type==="aidynamicfollowup"&&((ie=K.props)==null?void 0:ie.loading)===null&&(G[K.name]=!0),G},{});b(G=>({...G,...Q}))}},[n,c]);const A=async(l,k)=>{const N=F.find(O=>O.name===l.questionId);if(c){const O=await S(l.questionId,l,k),Q=j(l.type),G=J(l.type);if(Q&&(N!=null&&N.groupId&&e.triggerFollowUpQuestionGeneration({displayCard:N,response:l,createDynamicFollowupQuestion:g}),E(l.questionId)),G&&k){const K=w(n,O);i(K)}}else{const O={...l,questionText:N?e.getProcessedQuestionText(N):void 0};e.triggerFollowUpQuestionGeneration({displayCard:N,response:l,createDynamicFollowupQuestion:g}),i([O])}},j=l=>new Set(["nps","likert","multiplechoice"]).has(l),J=l=>new Set(["videovoice","consentlegal","texturlprompt","maxdiff"]).has(l),Z=((re=n[0])==null?void 0:re.type)==="thanks";return c?e.u("div",{className:"ul-card-list-container--longform","data-testid":"ui-container",ref:T,children:U?e.u("div",{className:"ul-display-logic-preview-message","data-testid":"display-logic-preview-message",children:Se}):e.u(rt,{value:d,children:[F.map((l,k)=>e.u(xe,{allResponsesArray:M,cardInstance:l,moveToNextQuestion:E,showIndividualSubmit:n.length>1&&k<n.length-1,submitQuestion:A,updateCardValues:S},(l==null?void 0:l.name)||k)),!Z&&e.u(ut,{isSubmitDisabled:!V,onSubmit:function(){const l=w(n,t);if((F==null?void 0:F.length)===1&&(l==null?void 0:l.length)===1){const k=F[0],N=l[0];e.triggerFollowUpQuestionGeneration({displayCard:k,response:N,createDynamicFollowupQuestion:g})}i(l)}})]})}):e.u(e.g,{children:[e.u("div",{"data-testid":"ui-container",style:{display:"none"}}),U?e.u("div",{className:"ul-display-logic-preview-message","data-testid":"display-logic-preview-message",children:Se}):F.map((l,k)=>e.u(xe,{allResponsesArray:M,cardInstance:l,moveToNextQuestion:E,showIndividualSubmit:!1,submitQuestion:A,updateCardValues:S},(l==null?void 0:l.name)||k))]})};
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-BBiYWZkL.cjs");exports.DismissReason=i.DismissReason,exports.Sprig=i.Sprig,exports.SprigAPI=i.SprigAPI,exports.SprigEvent=i.SprigEvent,exports.sprig=i.sprig;
|
package/dist/index.d.ts
CHANGED
|
@@ -1134,6 +1134,7 @@ interface TextUrlPromptCard extends BaseCard {
|
|
|
1134
1134
|
required: boolean;
|
|
1135
1135
|
richTextBody: RichTextBody;
|
|
1136
1136
|
questionHtml?: string;
|
|
1137
|
+
image?: QuestionImage;
|
|
1137
1138
|
};
|
|
1138
1139
|
displayLogic: RoutingOptions;
|
|
1139
1140
|
routingOptions: RoutingOptions;
|
|
@@ -1161,6 +1162,7 @@ interface ConsentLegalCard extends BaseCard {
|
|
|
1161
1162
|
skipButtonText: string;
|
|
1162
1163
|
submitButtonText: string;
|
|
1163
1164
|
questionHtml?: string;
|
|
1165
|
+
image?: QuestionImage;
|
|
1164
1166
|
};
|
|
1165
1167
|
displayLogic: RoutingOptions;
|
|
1166
1168
|
routingOptions: RoutingOptions;
|
|
@@ -1214,6 +1216,7 @@ interface RecordedTaskCardProperties {
|
|
|
1214
1216
|
permissions: AvPermission[];
|
|
1215
1217
|
required: boolean;
|
|
1216
1218
|
taskDetail: string;
|
|
1219
|
+
image?: QuestionImage;
|
|
1217
1220
|
}
|
|
1218
1221
|
interface RecordedTaskCard extends BaseCard {
|
|
1219
1222
|
props: {
|
|
@@ -1248,6 +1251,7 @@ interface LikertCard extends BaseCard {
|
|
|
1248
1251
|
ratingIcons: RatingIcon[];
|
|
1249
1252
|
scaleLabelType: ScaleLabelType;
|
|
1250
1253
|
required: boolean;
|
|
1254
|
+
image?: QuestionImage;
|
|
1251
1255
|
};
|
|
1252
1256
|
displayLogic: RoutingOptions;
|
|
1253
1257
|
routingOptions: RoutingOptions<"eq" | "given_up" | "gt" | "gte" | "lt" | "lte" | "neq">;
|
|
@@ -1268,6 +1272,7 @@ interface OpenTextCard extends BaseCard {
|
|
|
1268
1272
|
required: boolean;
|
|
1269
1273
|
richTextBody: RichTextBody;
|
|
1270
1274
|
skipButtonText?: string;
|
|
1275
|
+
image?: QuestionImage;
|
|
1271
1276
|
};
|
|
1272
1277
|
displayLogic: RoutingOptions;
|
|
1273
1278
|
routingOptions: RoutingOptions<"contains" | "notcontains">;
|
|
@@ -1331,6 +1336,7 @@ interface CommonMultipleChoiceProps {
|
|
|
1331
1336
|
minSelect?: number;
|
|
1332
1337
|
maxSelect?: number;
|
|
1333
1338
|
maxSelectMode?: MaxSelectModes;
|
|
1339
|
+
image?: QuestionImage;
|
|
1334
1340
|
};
|
|
1335
1341
|
}
|
|
1336
1342
|
declare enum MaxSelectModes {
|
|
@@ -1367,6 +1373,7 @@ interface MatrixCard extends BaseCard {
|
|
|
1367
1373
|
}[];
|
|
1368
1374
|
randomize: Randomize;
|
|
1369
1375
|
required: boolean;
|
|
1376
|
+
image?: QuestionImage;
|
|
1370
1377
|
};
|
|
1371
1378
|
};
|
|
1372
1379
|
type: "matrix";
|
|
@@ -1382,6 +1389,7 @@ interface NPSCard extends BaseCard {
|
|
|
1382
1389
|
conceptUrl: null;
|
|
1383
1390
|
labels: Labels;
|
|
1384
1391
|
required: boolean;
|
|
1392
|
+
image?: QuestionImage;
|
|
1385
1393
|
};
|
|
1386
1394
|
displayLogic: RoutingOptions;
|
|
1387
1395
|
routingOptions: RoutingOptions<"eq" | "gt" | "gte" | "lt" | "lte" | "neq">;
|
|
@@ -1412,6 +1420,7 @@ interface RankOrderType extends BaseCard {
|
|
|
1412
1420
|
labels: Labels;
|
|
1413
1421
|
required: boolean;
|
|
1414
1422
|
randomize: Randomize;
|
|
1423
|
+
image?: QuestionImage;
|
|
1415
1424
|
};
|
|
1416
1425
|
displayLogic: RoutingOptions;
|
|
1417
1426
|
routingOptions: RoutingOptions<"eq" | "gt" | "gte" | "lt" | "lte" | "neq">;
|
|
@@ -1451,6 +1460,7 @@ interface MaxDiffType extends BaseCard {
|
|
|
1451
1460
|
numberOfItems: number;
|
|
1452
1461
|
numberOfTimesToShowItem: number;
|
|
1453
1462
|
buttonText?: string;
|
|
1463
|
+
image?: QuestionImage;
|
|
1454
1464
|
};
|
|
1455
1465
|
};
|
|
1456
1466
|
type: "maxdiff";
|
|
@@ -1476,6 +1486,13 @@ interface VideoVoiceCard extends BaseCard {
|
|
|
1476
1486
|
type: "videovoice";
|
|
1477
1487
|
}
|
|
1478
1488
|
type Card = TextUrlPromptCard | ConsentLegalCard | DynamicQuestionCard | RecordedTaskCard | LikertCard | OpenTextCard | MatrixCard | MaxDiffType | MultipleChoiceSingleSelectCard | MultipleChoiceMultiSelectCard | NPSCard | RankOrderType | VideoVoiceCard;
|
|
1489
|
+
interface QuestionImage {
|
|
1490
|
+
altText: string;
|
|
1491
|
+
src: string;
|
|
1492
|
+
srcSet: string;
|
|
1493
|
+
width: number;
|
|
1494
|
+
height: number;
|
|
1495
|
+
}
|
|
1479
1496
|
|
|
1480
1497
|
type InteractiveMatchType = "exactly" | "legacy";
|
|
1481
1498
|
type PageUrlMatchType = "contains" | "exactly" | "legacy" | "notContains" | "regex" | "startsWith";
|
|
@@ -1757,6 +1774,28 @@ interface Answer {
|
|
|
1757
1774
|
questionId: number;
|
|
1758
1775
|
value: unknown;
|
|
1759
1776
|
}
|
|
1777
|
+
type QuotaConstraint = {
|
|
1778
|
+
comparisonType: Comparator;
|
|
1779
|
+
constraintTypeId: number;
|
|
1780
|
+
questionUid: string;
|
|
1781
|
+
uuid: UUID;
|
|
1782
|
+
value: RoutingGroupOption["value"];
|
|
1783
|
+
};
|
|
1784
|
+
type QuotaConstraintGroupSegment = QuotaConstraint | number | QuotaConstraintGroupSegment[];
|
|
1785
|
+
type Quota = {
|
|
1786
|
+
constraintGroup: QuotaConstraintGroupSegment[];
|
|
1787
|
+
id: number;
|
|
1788
|
+
name: string;
|
|
1789
|
+
quotaFilled: boolean;
|
|
1790
|
+
};
|
|
1791
|
+
type QuotaEndcardMessage = {
|
|
1792
|
+
headline?: string;
|
|
1793
|
+
subheader?: string;
|
|
1794
|
+
};
|
|
1795
|
+
type QuotaMessages = {
|
|
1796
|
+
disqualified?: QuotaEndcardMessage;
|
|
1797
|
+
filled?: QuotaEndcardMessage;
|
|
1798
|
+
};
|
|
1760
1799
|
type FeedbackPlacement = "center-left" | "center-right" | "bottom-left" | "bottom-right";
|
|
1761
1800
|
type FeedbackDesktopDisplay = "center-modal" | "slider";
|
|
1762
1801
|
interface Avatars {
|
|
@@ -1874,13 +1913,16 @@ interface Config extends MobileReplayConfig {
|
|
|
1874
1913
|
previewKey?: string | null;
|
|
1875
1914
|
previewMode?: boolean;
|
|
1876
1915
|
productConfig?: AppProductConfig;
|
|
1916
|
+
quotaMessages?: QuotaMessages;
|
|
1877
1917
|
providerPersona?: string | null;
|
|
1918
|
+
quotas?: Quota[];
|
|
1878
1919
|
replaySettings?: object;
|
|
1879
1920
|
requireUserIdForTracking: boolean;
|
|
1880
1921
|
responseGroupUid: UUID;
|
|
1881
1922
|
showProviderPersona?: boolean;
|
|
1882
1923
|
showStripes: boolean;
|
|
1883
1924
|
showSurveyBrand: boolean;
|
|
1925
|
+
useBranding?: boolean;
|
|
1884
1926
|
slugName: null;
|
|
1885
1927
|
startingQuestionIdx?: number | null;
|
|
1886
1928
|
styleNonce?: string;
|
package/dist/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const I=require("./index-BBiYWZkL.cjs");var ve,C,ir,ee,mt,ar,Be,sr,ge={},lr=[],gn=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ee=Array.isArray;function W(e,t){for(var r in t)e[r]=t[r];return e}function ur(e){var t=e.parentNode;t&&t.removeChild(e)}function O(e,t,r){var o,n,i,a={};for(i in t)i=="key"?o=t[i]:i=="ref"?n=t[i]:a[i]=t[i];if(arguments.length>2&&(a.children=arguments.length>3?ve.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)a[i]===void 0&&(a[i]=e.defaultProps[i]);return me(e,a,o,n,null)}function me(e,t,r,o,n){var i={type:e,props:t,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:n??++ir,__i:-1,__u:0};return n==null&&C.vnode!=null&&C.vnode(i),i}function cr(){return{current:null}}function F(e){return e.children}function z(e,t){this.props=e,this.context=t}function se(e,t){if(t==null)return e.__?se(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?se(e):null}function dr(e){var t,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return dr(e)}}function $e(e){(!e.__d&&(e.__d=!0)&&ee.push(e)&&!Se.__r++||mt!==C.debounceRendering)&&((mt=C.debounceRendering)||ar)(Se)}function Se(){var e,t,r,o,n,i,a,l,s;for(ee.sort(Be);e=ee.shift();)e.__d&&(t=ee.length,o=void 0,i=(n=(r=e).__v).__e,l=[],s=[],(a=r.__P)&&((o=W({},n)).__v=n.__v+1,C.vnode&&C.vnode(o),et(a,o,n,r.__n,a.ownerSVGElement!==void 0,32&n.__u?[i]:null,l,i??se(n),!!(32&n.__u),s),o.__.__k[o.__i]=o,mr(l,o,s),o.__e!=i&&dr(o)),ee.length>t&&ee.sort(Be));Se.__r=0}function pr(e,t,r,o,n,i,a,l,s,c,d){var u,g,p,y,h,_=o&&o.__k||lr,b=t.length;for(r.__d=s,function(f,x,w){var k,v,m,A,R,j=x.length,q=w.length,T=q,N=0;for(f.__k=[],k=0;k<j;k++)(v=f.__k[k]=(v=x[k])==null||typeof v=="boolean"||typeof v=="function"?null:typeof v=="string"||typeof v=="number"||typeof v=="bigint"||v.constructor==String?me(null,v,null,null,v):Ee(v)?me(F,{children:v},null,null,null):v.constructor===void 0&&v.__b>0?me(v.type,v.props,v.key,v.ref?v.ref:null,v.__v):v)!=null?(v.__=f,v.__b=f.__b+1,R=hn(v,w,A=k+N,T),v.__i=R,m=null,R!==-1&&(T--,(m=w[R])&&(m.__u|=131072)),m==null||m.__v===null?(R==-1&&N--,typeof v.type!="function"&&(v.__u|=65536)):R!==A&&(R===A+1?N++:R>A?T>j-A?N+=R-A:N--:N=R<A&&R==A-1?R-A:0,R!==k+N&&(v.__u|=65536))):(m=w[k])&&m.key==null&&m.__e&&(m.__e==f.__d&&(f.__d=se(m)),We(m,m,!1),w[k]=null,T--);if(T)for(k=0;k<q;k++)(m=w[k])!=null&&!(131072&m.__u)&&(m.__e==f.__d&&(f.__d=se(m)),We(m,m))}(r,t,_),s=r.__d,u=0;u<b;u++)(p=r.__k[u])!=null&&typeof p!="boolean"&&typeof p!="function"&&(g=p.__i===-1?ge:_[p.__i]||ge,p.__i=u,et(e,p,g,n,i,a,l,s,c,d),y=p.__e,p.ref&&g.ref!=p.ref&&(g.ref&&tt(g.ref,null,p),d.push(p.ref,p.__c||y,p)),h==null&&y!=null&&(h=y),65536&p.__u||g.__k===p.__k?s=fr(p,s,e):typeof p.type=="function"&&p.__d!==void 0?s=p.__d:y&&(s=y.nextSibling),p.__d=void 0,p.__u&=-196609);r.__d=s,r.__e=h}function fr(e,t,r){var o,n;if(typeof e.type=="function"){for(o=e.__k,n=0;o&&n<o.length;n++)o[n]&&(o[n].__=e,t=fr(o[n],t,r));return t}return e.__e!=t&&(r.insertBefore(e.__e,t||null),t=e.__e),t&&t.nextSibling}function Q(e,t){return t=t||[],e==null||typeof e=="boolean"||(Ee(e)?e.some(function(r){Q(r,t)}):t.push(e)),t}function hn(e,t,r,o){var n=e.key,i=e.type,a=r-1,l=r+1,s=t[r];if(s===null||s&&n==s.key&&i===s.type)return r;if(o>(s==null||131072&s.__u?0:1))for(;a>=0||l<t.length;){if(a>=0){if((s=t[a])&&!(131072&s.__u)&&n==s.key&&i===s.type)return a;a--}if(l<t.length){if((s=t[l])&&!(131072&s.__u)&&n==s.key&&i===s.type)return l;l++}}return-1}function gt(e,t,r){t[0]==="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||gn.test(t)?r:r+"px"}function xe(e,t,r,o,n){var i;e:if(t==="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof o=="string"&&(e.style.cssText=o=""),o)for(t in o)r&&t in r||gt(e.style,t,"");if(r)for(t in r)o&&r[t]===o[t]||gt(e.style,t,r[t])}else if(t[0]==="o"&&t[1]==="n")i=t!==(t=t.replace(/(PointerCapture)$|Capture$/,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=r,r?o?r.u=o.u:(r.u=Date.now(),e.addEventListener(t,i?_t:ht,i)):e.removeEventListener(t,i?_t:ht,i);else{if(n)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!=="width"&&t!=="height"&&t!=="href"&&t!=="list"&&t!=="form"&&t!=="tabIndex"&&t!=="download"&&t!=="rowSpan"&&t!=="colSpan"&&t!=="role"&&t in e)try{e[t]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,r))}}function ht(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(C.event?C.event(e):e)}function _t(e){return this.l[e.type+!0](C.event?C.event(e):e)}function et(e,t,r,o,n,i,a,l,s,c){var d,u,g,p,y,h,_,b,f,x,w,k,v,m,A,R=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(s=!!(32&r.__u),i=[l=t.__e=r.__e]),(d=C.__b)&&d(t);e:if(typeof R=="function")try{if(b=t.props,f=(d=R.contextType)&&o[d.__c],x=d?f?f.props.value:d.__:o,r.__c?_=(u=t.__c=r.__c).__=u.__E:("prototype"in R&&R.prototype.render?t.__c=u=new R(b,x):(t.__c=u=new z(b,x),u.constructor=R,u.render=vn),f&&f.sub(u),u.props=b,u.state||(u.state={}),u.context=x,u.__n=o,g=u.__d=!0,u.__h=[],u._sb=[]),u.__s==null&&(u.__s=u.state),R.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=W({},u.__s)),W(u.__s,R.getDerivedStateFromProps(b,u.__s))),p=u.props,y=u.state,u.__v=t,g)R.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(R.getDerivedStateFromProps==null&&b!==p&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(b,x),!u.__e&&(u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(b,u.__s,x)===!1||t.__v===r.__v)){for(t.__v!==r.__v&&(u.props=b,u.state=u.__s,u.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.forEach(function(j){j&&(j.__=t)}),w=0;w<u._sb.length;w++)u.__h.push(u._sb[w]);u._sb=[],u.__h.length&&a.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(b,u.__s,x),u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(p,y,h)})}if(u.context=x,u.props=b,u.__P=e,u.__e=!1,k=C.__r,v=0,"prototype"in R&&R.prototype.render){for(u.state=u.__s,u.__d=!1,k&&k(t),d=u.render(u.props,u.state,u.context),m=0;m<u._sb.length;m++)u.__h.push(u._sb[m]);u._sb=[]}else do u.__d=!1,k&&k(t),d=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++v<25);u.state=u.__s,u.getChildContext!=null&&(o=W(W({},o),u.getChildContext())),g||u.getSnapshotBeforeUpdate==null||(h=u.getSnapshotBeforeUpdate(p,y)),pr(e,Ee(A=d!=null&&d.type===F&&d.key==null?d.props.children:d)?A:[A],t,r,o,n,i,a,l,s,c),u.base=t.__e,t.__u&=-161,u.__h.length&&a.push(u),_&&(u.__E=u.__=null)}catch(j){t.__v=null,s||i!=null?(t.__e=l,t.__u|=s?160:32,i[i.indexOf(l)]=null):(t.__e=r.__e,t.__k=r.__k),C.__e(j,t,r)}else i==null&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=_n(r.__e,t,r,o,n,i,a,s,c);(d=C.diffed)&&d(t)}function mr(e,t,r){t.__d=void 0;for(var o=0;o<r.length;o++)tt(r[o],r[++o],r[++o]);C.__c&&C.__c(t,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(i){i.call(n)})}catch(i){C.__e(i,n.__v)}})}function _n(e,t,r,o,n,i,a,l,s){var c,d,u,g,p,y,h,_=r.props,b=t.props,f=t.type;if(f==="svg"&&(n=!0),i!=null){for(c=0;c<i.length;c++)if((p=i[c])&&"setAttribute"in p==!!f&&(f?p.localName===f:p.nodeType===3)){e=p,i[c]=null;break}}if(e==null){if(f===null)return document.createTextNode(b);e=n?document.createElementNS("http://www.w3.org/2000/svg",f):document.createElement(f,b.is&&b),i=null,l=!1}if(f===null)_===b||l&&e.data===b||(e.data=b);else{if(i=i&&ve.call(e.childNodes),_=r.props||ge,!l&&i!=null)for(_={},c=0;c<e.attributes.length;c++)_[(p=e.attributes[c]).name]=p.value;for(c in _)p=_[c],c=="children"||(c=="dangerouslySetInnerHTML"?u=p:c==="key"||c in b||xe(e,c,null,p,n));for(c in b)p=b[c],c=="children"?g=p:c=="dangerouslySetInnerHTML"?d=p:c=="value"?y=p:c=="checked"?h=p:c==="key"||l&&typeof p!="function"||_[c]===p||xe(e,c,p,_[c],n);if(d)l||u&&(d.__html===u.__html||d.__html===e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(u&&(e.innerHTML=""),pr(e,Ee(g)?g:[g],t,r,o,n&&f!=="foreignObject",i,a,i?i[0]:r.__k&&se(r,0),l,s),i!=null)for(c=i.length;c--;)i[c]!=null&&ur(i[c]);l||(c="value",y!==void 0&&(y!==e[c]||f==="progress"&&!y||f==="option"&&y!==_[c])&&xe(e,c,y,_[c],!1),c="checked",h!==void 0&&h!==e[c]&&xe(e,c,h,_[c],!1))}return e}function tt(e,t,r){try{typeof e=="function"?e(t):e.current=t}catch(o){C.__e(o,r)}}function We(e,t,r){var o,n;if(C.unmount&&C.unmount(e),(o=e.ref)&&(o.current&&o.current!==e.__e||tt(o,null,t)),(o=e.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(i){C.__e(i,t)}o.base=o.__P=null,e.__c=void 0}if(o=e.__k)for(n=0;n<o.length;n++)o[n]&&We(o[n],t,r||typeof e.type!="function");r||e.__e==null||ur(e.__e),e.__=e.__e=e.__d=void 0}function vn(e,t,r){return this.constructor(e,r)}function le(e,t,r){var o,n,i,a;C.__&&C.__(e,t),n=(o=typeof r=="function")?null:r&&r.__k||t.__k,i=[],a=[],et(t,e=(!o&&r||t).__k=O(F,null,[e]),n||ge,ge,t.ownerSVGElement!==void 0,!o&&r?[r]:n?null:t.firstChild?ve.call(t.childNodes):null,i,!o&&r?r:n?n.__e:t.firstChild,o,a),mr(i,e,a)}function gr(e,t){le(e,t,gr)}function bn(e,t,r){var o,n,i,a,l=W({},e.props);for(i in e.type&&e.type.defaultProps&&(a=e.type.defaultProps),t)i=="key"?o=t[i]:i=="ref"?n=t[i]:l[i]=t[i]===void 0&&a!==void 0?a[i]:t[i];return arguments.length>2&&(l.children=arguments.length>3?ve.call(arguments,2):r),me(e.type,l,o||e.key,n||e.ref,null)}function rt(e,t){var r={__c:t="__cC"+sr++,__:e,Consumer:function(o,n){return o.children(n)},Provider:function(o){var n,i;return this.getChildContext||(n=[],(i={})[t]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(a){this.props.value!==a.value&&n.some(function(l){l.__e=!0,$e(l)})},this.sub=function(a){n.push(a);var l=a.componentWillUnmount;a.componentWillUnmount=function(){n.splice(n.indexOf(a),1),l&&l.call(a)}}),o.children}};return r.Provider.__=r.Consumer.contextType=r}ve=lr.slice,C={__e:function(e,t,r,o){for(var n,i,a;t=t.__;)if((n=t.__c)&&!n.__)try{if((i=n.constructor)&&i.getDerivedStateFromError!=null&&(n.setState(i.getDerivedStateFromError(e)),a=n.__d),n.componentDidCatch!=null&&(n.componentDidCatch(e,o||{}),a=n.__d),a)return n.__E=n}catch(l){e=l}throw e}},ir=0,z.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=W({},this.state),typeof e=="function"&&(e=e(W({},r),this.props)),e&&W(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),$e(this))},z.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),$e(this))},z.prototype.render=F,ee=[],ar=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Be=function(e,t){return e.__v.__b-t.__v.__b},Se.__r=0,sr=0;var yn=0;function S(e,t,r,o,n,i){var a,l,s={};for(l in t)l=="ref"?a=t[l]:s[l]=t[l];var c={type:e,props:s,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--yn,__i:-1,__u:0,__source:n,__self:i};if(typeof e=="function"&&(a=e.defaultProps))for(l in a)s[l]===void 0&&(s[l]=a[l]);return C.vnode&&C.vnode(c),c}var G,L,Te,vt,ue=0,hr=[],ke=[],bt=C.__b,yt=C.__r,xt=C.diffed,kt=C.__c,wt=C.unmount;function te(e,t){C.__h&&C.__h(L,e,ue||t),ue=0;var r=L.__H||(L.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:ke}),r.__[e]}function K(e){return ue=1,nt(br,e)}function nt(e,t,r){var o=te(G++,2);if(o.t=e,!o.__c&&(o.__=[r?r(t):br(void 0,t),function(l){var s=o.__N?o.__N[0]:o.__[0],c=o.t(s,l);s!==c&&(o.__N=[c,o.__[1]],o.__c.setState({}))}],o.__c=L,!L.u)){var n=function(l,s,c){if(!o.__c.__H)return!0;var d=o.__c.__H.__.filter(function(g){return g.__c});if(d.every(function(g){return!g.__N}))return!i||i.call(this,l,s,c);var u=!1;return d.forEach(function(g){if(g.__N){var p=g.__[0];g.__=g.__N,g.__N=void 0,p!==g.__[0]&&(u=!0)}}),!(!u&&o.__c.props===l)&&(!i||i.call(this,l,s,c))};L.u=!0;var i=L.shouldComponentUpdate,a=L.componentWillUpdate;L.componentWillUpdate=function(l,s,c){if(this.__e){var d=i;i=void 0,n(l,s,c),i=d}a&&a.call(this,l,s,c)},L.shouldComponentUpdate=n}return o.__N||o.__}function V(e,t){var r=te(G++,3);!C.__s&&at(r.__H,t)&&(r.__=e,r.i=t,L.__H.__h.push(r))}function de(e,t){var r=te(G++,4);!C.__s&&at(r.__H,t)&&(r.__=e,r.i=t,L.__h.push(r))}function J(e){return ue=5,Y(function(){return{current:e}},[])}function _r(e,t,r){ue=6,de(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},r==null?r:r.concat(e))}function Y(e,t){var r=te(G++,7);return at(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function he(e,t){return ue=8,Y(function(){return e},t)}function ot(e){var t=L.context[e.__c],r=te(G++,9);return r.c=e,t?(r.__==null&&(r.__=!0,t.sub(L)),t.props.value):e.__}function it(e,t){C.useDebugValue&&C.useDebugValue(t?t(e):e)}function vr(){var e=te(G++,11);if(!e.__){for(var t=L.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var r=t.__m||(t.__m=[0,0]);e.__="P"+r[0]+"-"+r[1]++}return e.__}function xn(){for(var e;e=hr.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(we),e.__H.__h.forEach(Qe),e.__H.__h=[]}catch(t){e.__H.__h=[],C.__e(t,e.__v)}}C.__b=function(e){L=null,bt&&bt(e)},C.__r=function(e){yt&&yt(e),G=0;var t=(L=e.__c).__H;t&&(Te===L?(t.__h=[],L.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.__V=ke,r.__N=r.i=void 0})):(t.__h.forEach(we),t.__h.forEach(Qe),t.__h=[],G=0)),Te=L},C.diffed=function(e){xt&&xt(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(hr.push(t)!==1&&vt===C.requestAnimationFrame||((vt=C.requestAnimationFrame)||kn)(xn)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.__V!==ke&&(r.__=r.__V),r.i=void 0,r.__V=ke})),Te=L=null},C.__c=function(e,t){t.some(function(r){try{r.__h.forEach(we),r.__h=r.__h.filter(function(o){return!o.__||Qe(o)})}catch(o){t.some(function(n){n.__h&&(n.__h=[])}),t=[],C.__e(o,r.__v)}}),kt&&kt(e,t)},C.unmount=function(e){wt&&wt(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(o){try{we(o)}catch(n){t=n}}),r.__H=void 0,t&&C.__e(t,r.__v))};var Ct=typeof requestAnimationFrame=="function";function kn(e){var t,r=function(){clearTimeout(o),Ct&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(r,100);Ct&&(t=requestAnimationFrame(r))}function we(e){var t=L,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),L=t}function Qe(e){var t=L;e.__c=e.__(),L=t}function at(e,t){return!e||e.length!==t.length||t.some(function(r,o){return r!==e[o]})}function br(e,t){return typeof t=="function"?t(e):t}function yr(e,t){for(var r in t)e[r]=t[r];return e}function Ge(e,t){for(var r in e)if(r!=="__source"&&!(r in t))return!0;for(var o in t)if(o!=="__source"&&e[o]!==t[o])return!0;return!1}function Ie(e){this.props=e}function xr(e,t){function r(n){var i=this.props.ref,a=i==n.ref;return!a&&i&&(i.call?i(null):i.current=null),t?!t(this.props,n)||!a:Ge(this.props,n)}function o(n){return this.shouldComponentUpdate=r,O(e,n)}return o.displayName="Memo("+(e.displayName||e.name)+")",o.prototype.isReactComponent=!0,o.__f=!0,o}(Ie.prototype=new z).isPureReactComponent=!0,Ie.prototype.shouldComponentUpdate=function(e,t){return Ge(this.props,e)||Ge(this.state,t)};var St=C.__b;C.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),St&&St(e)};var wn=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function st(e){function t(r){var o=yr({},r);return delete o.ref,e(o,r.ref||null)}return t.$$typeof=wn,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var It=function(e,t){return e==null?null:Q(Q(e).map(t))},kr={map:It,forEach:It,count:function(e){return e?Q(e).length:0},only:function(e){var t=Q(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:Q},Cn=C.__e;C.__e=function(e,t,r,o){if(e.then){for(var n,i=t;i=i.__;)if((n=i.__c)&&n.__c)return t.__e==null&&(t.__e=r.__e,t.__k=r.__k),n.__c(e,t)}Cn(e,t,r,o)};var Rt=C.unmount;function wr(e,t,r){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(o){typeof o.__c=="function"&&o.__c()}),e.__c.__H=null),(e=yr({},e)).__c!=null&&(e.__c.__P===r&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(o){return wr(o,t,r)})),e}function Cr(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(o){return Cr(o,t,r)}),e.__c&&e.__c.__P===t&&(e.__e&&r.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=r)),e}function ae(){this.__u=0,this.t=null,this.__b=null}function Sr(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function je(e){var t,r,o;function n(i){if(t||(t=e()).then(function(a){r=a.default||a},function(a){o=a}),o)throw o;if(!r)throw t;return O(r,i)}return n.displayName="Lazy",n.__f=!0,n}function oe(){this.u=null,this.o=null}C.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Rt&&Rt(e)},(ae.prototype=new z).__c=function(e,t){var r=t.__c,o=this;o.t==null&&(o.t=[]),o.t.push(r);var n=Sr(o.__v),i=!1,a=function(){i||(i=!0,r.__R=null,n?n(l):l())};r.__R=a;var l=function(){if(!--o.__u){if(o.state.__a){var s=o.state.__a;o.__v.__k[0]=Cr(s,s.__c.__P,s.__c.__O)}var c;for(o.setState({__a:o.__b=null});c=o.t.pop();)c.forceUpdate()}};o.__u++||32&t.__u||o.setState({__a:o.__b=o.__v.__k[0]}),e.then(a,a)},ae.prototype.componentWillUnmount=function(){this.t=[]},ae.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=wr(this.__b,r,o.__O=o.__P)}this.__b=null}var n=t.__a&&O(F,null,e.fallback);return n&&(n.__u&=-33),[O(F,null,t.__a?null:e.children),n]};var At=function(e,t,r){if(++r[1]===r[0]&&e.o.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.o.size))for(r=e.u;r;){for(;r.length>3;)r.pop()();if(r[1]<r[0])break;e.u=r=r[2]}};function Sn(e){return this.getChildContext=function(){return e.context},e.children}function In(e){var t=this,r=e.i;t.componentWillUnmount=function(){le(null,t.l),t.l=null,t.i=null},t.i&&t.i!==r&&t.componentWillUnmount(),t.l||(t.i=r,t.l={nodeType:1,parentNode:r,childNodes:[],appendChild:function(o){this.childNodes.push(o),t.i.appendChild(o)},insertBefore:function(o,n){this.childNodes.push(o),t.i.appendChild(o)},removeChild:function(o){this.childNodes.splice(this.childNodes.indexOf(o)>>>1,1),t.i.removeChild(o)}}),le(O(Sn,{context:t.context},e.__v),t.l)}function Ir(e,t){var r=O(In,{__v:e,i:t});return r.containerInfo=t,r}(oe.prototype=new z).__a=function(e){var t=this,r=Sr(t.__v),o=t.o.get(e);return o[0]++,function(n){var i=function(){t.props.revealOrder?(o.push(n),At(t,e,o)):n()};r?r(i):i()}},oe.prototype.render=function(e){this.u=null,this.o=new Map;var t=Q(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var r=t.length;r--;)this.o.set(t[r],this.u=[1,0,this.u]);return e.children},oe.prototype.componentDidUpdate=oe.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,r){At(e,r,t)})};var Rr=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Rn=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,An=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,En=/[A-Z0-9]/g,jn=typeof document<"u",qn=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function Ar(e,t,r){return t.__k==null&&(t.textContent=""),le(e,t),typeof r=="function"&&r(),e?e.__c:null}function Er(e,t,r){return gr(e,t),typeof r=="function"&&r(),e?e.__c:null}z.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(z.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Et=C.event;function Ln(){}function Tn(){return this.cancelBubble}function Nn(){return this.defaultPrevented}C.event=function(e){return Et&&(e=Et(e)),e.persist=Ln,e.isPropagationStopped=Tn,e.isDefaultPrevented=Nn,e.nativeEvent=e};var lt,Pn={enumerable:!1,configurable:!0,get:function(){return this.class}},jt=C.vnode;C.vnode=function(e){typeof e.type=="string"&&function(t){var r=t.props,o=t.type,n={};for(var i in r){var a=r[i];if(!(i==="value"&&"defaultValue"in r&&a==null||jn&&i==="children"&&o==="noscript"||i==="class"||i==="className")){var l=i.toLowerCase();i==="defaultValue"&&"value"in r&&r.value==null?i="value":i==="download"&&a===!0?a="":l==="ondoubleclick"?i="ondblclick":l!=="onchange"||o!=="input"&&o!=="textarea"||qn(r.type)?l==="onfocus"?i="onfocusin":l==="onblur"?i="onfocusout":An.test(i)?i=l:o.indexOf("-")===-1&&Rn.test(i)?i=i.replace(En,"-$&").toLowerCase():a===null&&(a=void 0):l=i="oninput",l==="oninput"&&n[i=l]&&(i="oninputCapture"),n[i]=a}}o=="select"&&n.multiple&&Array.isArray(n.value)&&(n.value=Q(r.children).forEach(function(s){s.props.selected=n.value.indexOf(s.props.value)!=-1})),o=="select"&&n.defaultValue!=null&&(n.value=Q(r.children).forEach(function(s){s.props.selected=n.multiple?n.defaultValue.indexOf(s.props.value)!=-1:n.defaultValue==s.props.value})),r.class&&!r.className?(n.class=r.class,Object.defineProperty(n,"className",Pn)):(r.className&&!r.class||r.class&&r.className)&&(n.class=n.className=r.className),t.props=n}(e),e.$$typeof=Rr,jt&&jt(e)};var qt=C.__r;C.__r=function(e){qt&&qt(e),lt=e.__c};var Lt=C.diffed;C.diffed=function(e){Lt&&Lt(e);var t=e.props,r=e.__e;r!=null&&e.type==="textarea"&&"value"in t&&t.value!==r.value&&(r.value=t.value==null?"":t.value),lt=null};var jr={ReactCurrentDispatcher:{current:{readContext:function(e){return lt.__n[e.__c].props.value}}}};function qr(e){return O.bind(null,e)}function be(e){return!!e&&e.$$typeof===Rr}function Lr(e){return be(e)&&e.type===F}function Tr(e){return be(e)?bn.apply(null,arguments):e}function Re(e){return!!e.__k&&(le(null,e),!0)}function Nr(e){return e&&(e.base||e.nodeType===1&&e)||null}var Pr=function(e,t){return e(t)},Ur=function(e,t){return e(t)},Mr=F;function ut(e){e()}function Or(e){return e}function Vr(){return[!1,ut]}var Hr=de,Fr=be;function Dr(e,t){var r=t(),o=K({h:{__:r,v:t}}),n=o[0].h,i=o[1];return de(function(){n.__=r,n.v=t,Ne(n)&&i({h:n})},[e,r,t]),V(function(){return Ne(n)&&i({h:n}),e(function(){Ne(n)&&i({h:n})})},[e]),r}function Ne(e){var t,r,o=e.v,n=e.__;try{var i=o();return!((t=n)===(r=i)&&(t!==0||1/t==1/r)||t!=t&&r!=r)}catch{return!0}}var zr={useState:K,useId:vr,useReducer:nt,useEffect:V,useLayoutEffect:de,useInsertionEffect:Hr,useTransition:Vr,useDeferredValue:Or,useSyncExternalStore:Dr,startTransition:ut,useRef:J,useImperativeHandle:_r,useMemo:Y,useCallback:he,useContext:ot,useDebugValue:it,version:"17.0.2",Children:kr,render:Ar,hydrate:Er,unmountComponentAtNode:Re,createPortal:Ir,createElement:O,createContext:rt,createFactory:qr,cloneElement:Tr,createRef:cr,Fragment:F,isValidElement:be,isElement:Fr,isFragment:Lr,findDOMNode:Nr,Component:z,PureComponent:Ie,memo:xr,forwardRef:st,flushSync:Ur,unstable_batchedUpdates:Pr,StrictMode:Mr,Suspense:ae,SuspenseList:oe,lazy:je,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:jr};const Un=Object.freeze(Object.defineProperty({__proto__:null,Children:kr,Component:z,Fragment:F,PureComponent:Ie,StrictMode:Mr,Suspense:ae,SuspenseList:oe,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:jr,cloneElement:Tr,createContext:rt,createElement:O,createFactory:qr,createPortal:Ir,createRef:cr,default:zr,findDOMNode:Nr,flushSync:Ur,forwardRef:st,hydrate:Er,isElement:Fr,isFragment:Lr,isValidElement:be,lazy:je,memo:xr,render:Ar,startTransition:ut,unmountComponentAtNode:Re,unstable_batchedUpdates:Pr,useCallback:he,useContext:ot,useDebugValue:it,useDeferredValue:Or,useEffect:V,useErrorBoundary:function(e){var t=te(G++,10),r=K();return t.__=e,L.componentDidCatch||(L.componentDidCatch=function(o,n){t.__&&t.__(o,n),r[1](o)}),[r[0],function(){r[1](void 0)}]},useId:vr,useImperativeHandle:_r,useInsertionEffect:Hr,useLayoutEffect:de,useMemo:Y,useReducer:nt,useRef:J,useState:K,useSyncExternalStore:Dr,useTransition:Vr,version:"17.0.2"},Symbol.toStringTag,{value:"Module"})),Tt=e=>{let t;const r=new Set,o=(a,l)=>{const s=typeof a=="function"?a(t):a;if(!Object.is(s,t)){const c=t;t=l??typeof s!="object"?s:Object.assign({},t,s),r.forEach(d=>d(t,c))}},n=()=>t,i={setState:o,getState:n,subscribe:a=>(r.add(a),()=>r.delete(a)),destroy:()=>r.clear()};return t=e(o,n,i),i};function Mn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function On(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=function o(){return this instanceof o?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(o){var n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(r,o,n.get?n:{enumerable:!0,get:function(){return e[o]}})}),r}var Nt={exports:{}},Pe={};const Br=On(Un);var Pt,Ut,Mt,Ot,Vt={exports:{}},Ue={};function Vn(){return Ut||(Ut=1,Vt.exports=function(){if(Pt)return Ue;Pt=1;var e=Br,t=typeof Object.is=="function"?Object.is:function(s,c){return s===c&&(s!==0||1/s==1/c)||s!=s&&c!=c},r=e.useState,o=e.useEffect,n=e.useLayoutEffect,i=e.useDebugValue;function a(s){var c=s.getSnapshot;s=s.value;try{var d=c();return!t(s,d)}catch{return!0}}var l=typeof window>"u"||window.document===void 0||window.document.createElement===void 0?function(s,c){return c()}:function(s,c){var d=c(),u=r({inst:{value:d,getSnapshot:c}}),g=u[0].inst,p=u[1];return n(function(){g.value=d,g.getSnapshot=c,a(g)&&p({inst:g})},[s,d,c]),o(function(){return a(g)&&p({inst:g}),s(function(){a(g)&&p({inst:g})})},[s]),i(d),d};return Ue.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:l,Ue}()),Vt.exports}var Hn=(Ot||(Ot=1,Nt.exports=function(){if(Mt)return Pe;Mt=1;var e=Br,t=Vn(),r=typeof Object.is=="function"?Object.is:function(s,c){return s===c&&(s!==0||1/s==1/c)||s!=s&&c!=c},o=t.useSyncExternalStore,n=e.useRef,i=e.useEffect,a=e.useMemo,l=e.useDebugValue;return Pe.useSyncExternalStoreWithSelector=function(s,c,d,u,g){var p=n(null);if(p.current===null){var y={hasValue:!1,value:null};p.current=y}else y=p.current;p=a(function(){function _(k){if(!x){if(x=!0,b=k,k=u(k),g!==void 0&&y.hasValue){var v=y.value;if(g(v,k))return f=v}return f=k}if(v=f,r(b,k))return v;var m=u(k);return g!==void 0&&g(v,m)?v:(b=k,f=m)}var b,f,x=!1,w=d===void 0?null:d;return[function(){return _(c())},w===null?void 0:function(){return _(w())}]},[c,d,u,g]);var h=o(s,p[0],p[1]);return i(function(){y.hasValue=!0,y.value=h},[h]),l(h),h},Pe}()),Nt.exports);const Fn=Mn(Hn),{useSyncExternalStoreWithSelector:Dn}=Fn,Ht=e=>{const t=typeof e=="function"?(o=>o?Tt(o):Tt)(e):e,r=(o,n)=>function(i,a=i.getState,l){const s=Dn(i.subscribe,i.getState,i.getServerState||i.getState,a,l);return it(s),s}(t,o,n);return Object.assign(r,t),r},$r=e=>e?Ht(e):Ht;var Wr=(e=>(e.RIGHT="right",e.LEFT="left",e))(Wr||{});const Me=e=>e!=null&&typeof e=="object"&&typeof Reflect.get(e,"taskStatus")=="string",Ft=e=>e!=null&&typeof e=="object"&&!Array.isArray(e)&&Object.values(e).every(t=>t===null||typeof t=="string"),Dt=e=>e!=null&&typeof e=="object"&&!Array.isArray(e)&&Object.values(e).every(t=>t===null||typeof t=="number"),zt=e=>Array.isArray(e)&&e.every(t=>Array.isArray(t)&&t.every(r=>{if(typeof r!="object"||r===null)return!1;const o=Reflect.get(r,"selected");return o==="left"||o==="right"||o===null})),Ze=(e,t)=>{const{allowUndefined:r=!0,rejectBooleanRecord:o=!1}=t??{};if(e===void 0)return r;if(e===null||typeof e=="string"||typeof e=="number"||Array.isArray(e))return!0;if(typeof e=="object"&&e!==null){if(o){const n=Object.values(e);if(n.length>0&&n.every(i=>typeof i=="boolean"))return!1}return!0}return!1},Ke=(e,t)=>{var r;if(t===null)return null;if(e.type==="texturlprompt")return(o=>o===void 0||typeof o=="object"&&o!==null&&"skipped"in o)(t)?t:void 0;if(t===void 0)return null;if(e.type==="consentlegal")return typeof t=="object"&&"submitted"in t&&t.submitted===!0?t:null;if(e.type==="multipleselect"){const o=(r=e.props)==null?void 0:r.options;if(Array.isArray(o)&&(n=>typeof n=="object"&&n!==null&&!Array.isArray(n)&&Object.values(n).every(i=>typeof i=="boolean"))(t)){const n=t;return o.reduce((i,a)=>(n[String(a.id)]&&i.push(a.value),i),[])}}if(e.type==="multiplechoice"){if(typeof t=="object"&&t!==null&&!Array.isArray(t)){if(Object.keys(t).length===0)return null;const o=Object.values(t).find(n=>n!==!1&&n!==void 0);if(o!==void 0)return o}return Ze(t,{allowUndefined:!1,rejectBooleanRecord:!0})?t:null}return Ze(t,{allowUndefined:!1,rejectBooleanRecord:!0})?t:null},zn=/<piped-value\b([^>]*)>.*?<\/piped-value>/gis,Bt=["questionHtml","captionHtml","footerHtml","richTextBody"],Je=e=>!!e.props&&typeof e.props=="object"&&"properties"in e.props,Oe=e=>!!e.props&&typeof e.props=="object"&&"options"in e.props&&Array.isArray(e.props.options),$t=e=>["string","number"].includes(typeof e),Wt=e=>e.length===0?"":e.length===1?e[0]:e.join(", "),Bn=e=>{var r,o;const t=(n=>n!=null&&typeof n=="object"&&"value"in n)(e)?e.value:void 0;if(t!=null){if(e.type==="multipleselect"&&Oe(e)&&(n=>!!n&&typeof n=="object"&&!Array.isArray(n))(t)){const n=e.secondaryValue??null,i=e.props.options.filter(a=>t[String(a.id)]===!0).map(a=>{var l;return a.label+((l=n==null?void 0:n[String(a.id)])!=null&&l.userText?`: ${n[String(a.id)].userText}`:"")});return i.length?Wt(i):"No options selected"}if(e.type==="multiplechoice"&&typeof t=="object"&&t!==null){const n=Object.keys(t);if(n.length===0)return"No options selected";const i=e.secondaryValue??null,a=n[0];if(a){const l=e.props.options.find(s=>String(s.id)===a);return(l==null?void 0:l.label)+((r=i==null?void 0:i[a])!=null&&r.userText?`: ${(o=i==null?void 0:i[a])==null?void 0:o.userText}`:"")}}if(e.type==="matrix"&&Oe(e)&&(n=>{if(!Je(n))return!1;const i=n.props.properties;return!!i&&typeof i=="object"&&"matrixColumn"in i})(e)){const n=e.props.options,i=e.props.properties.matrixColumn,a=[];for(const[l,s]of Object.entries(t)){const c=n.find(y=>String(y.id)===l),d=(c==null?void 0:c.label)??l,u=$t(s)?String(s):JSON.stringify(s),g=i.find(y=>y.value===u),p=(g==null?void 0:g.label)??u;a.push(`${d}: ${p}`)}return a.join("; ")}if(e.type==="rankorder"&&Oe(e)){const n=e.props.options.reduce((a,l)=>(a[String(l.id)]=l.label,a),{}),i=[];for(const[a,l]of Object.entries(t)){const s=n[a];s&&(i[l-1]=s)}return Wt(i)}if($t(t)){const n=String(t).replaceAll(/[\u200B-\u200D\uFEFF]/g,"").trim();return n===""?void 0:n}try{return JSON.stringify(t)}catch{return String(t)}}},Qt=(e,t)=>{const r=new RegExp(`${t}="([^"]*)"`,"i").exec(e);return(r==null?void 0:r[1])??null},$n=(e,t)=>{if(e==null)return e;let r=!1;const o=e.replace(zn,(n,i)=>{r=!0;const a=Qt(i,"answer-id"),l=Qt(i,"fallback-text")??"";if(!a)return l;const s=a.startsWith("attr-")?a:Number(a);if(Object.hasOwn(t,s)){const c=t[s];return String(c)}return l});return r?o:e},Ye=(e,t)=>{const r={};if(t)for(const[o,n]of Object.entries(t))typeof n=="string"?r[`attr-${o}`]=n:n!=null&&(r[`attr-${o}`]=JSON.stringify(n));for(const o of e){const n=Bn(o);n!==void 0&&(r[o.name]=n)}return r},Wn=(e,t,r)=>{switch(t){case"videovoice":return!!(e!=null&&e.value);case"open":return!!r;case"multipleselect":return!!(r&&Object.keys(r).length);case"recordedtask":return r!==null&&typeof r=="object"&&"taskStatus"in r&&r.taskStatus==="completed";case"texturlprompt":return!e.value;case"consentlegal":case"nps":case"likert":return r!==null;case"multiplechoice":return r!==void 0;case"matrix":return!!(r&&Object.values(r).every(o=>o!==null));default:return!0}},Qr=(e,t)=>{if(t==="matrix"&&e&&typeof e=="object"){const r=Object.keys(e).length,o=Object.values(e).filter(n=>n!==null).length;return o>0&&o<r}return!1},Ae=e=>e==null?"":typeof e=="object"?JSON.stringify(e):typeof e=="string"?e:String(e),ie={eq:(e,t)=>Number(e)===Number(t),neq:(e,t)=>!ie.eq(e,t),gt:(e,t)=>Number(e)>Number(t),gte:(e,t)=>Number(e)>=Number(t),lt:(e,t)=>Number(e)<Number(t),lte:(e,t)=>Number(e)<=Number(t),list_exact(e,t){if(!Array.isArray(e)||!Array.isArray(t))return!1;const r=(o,n)=>String(o).localeCompare(String(n));return e.slice().sort(r).join(",")===t.slice().sort(r).join(",")},list_all:(e,t)=>!(!Array.isArray(e)||!Array.isArray(t))&&!t.some(r=>!e.includes(r)),list_alo(e,t){if(!Array.isArray(t))return!1;const r=Array.isArray(e)?e:[e],o=new Set(r);return t.some(n=>o.has(n))},list_dni(e,t){if(!Array.isArray(t))return!1;const r=Array.isArray(e)?e:[e],o=new Set(r);return t.every(n=>!o.has(n))},contains(e,t){const r=Ae(e).toLowerCase(),o=Ae(t).toLowerCase();return r.includes(o)},notcontains:(e,t)=>!ie.contains(e,t)},ct=(e,t,r)=>r>0?t?e.length-3:e.length-2:t?e.length-2:e.length-1,_e={eq:(e,t)=>e==t,neq:(e,t)=>!_e.eq(e,t),gt:(e,t)=>Number(e)>Number(t),gte:(e,t)=>Number(e)>=Number(t),lt:(e,t)=>Number(e)<Number(t),lte:(e,t)=>Number(e)<=Number(t),list_exact(e,t){if(!Array.isArray(e)||!Array.isArray(t))return!1;const r=(o,n)=>String(o).localeCompare(String(n));return e.slice().sort(r).join(",")===t.slice().sort(r).join(",")},list_all:(e,t)=>!(!Array.isArray(e)||!Array.isArray(t))&&!t.some(r=>!e.includes(r)),list_alo(e,t){if(!Array.isArray(t))return!1;const r=Array.isArray(e)?e:[e],o=new Set(r);return t.some(n=>o.has(n))},list_dni(e,t){if(!Array.isArray(t))return!1;const r=Array.isArray(e)?e:[e],o=new Set(r);return t.every(n=>!o.has(n))},contains(e,t){const r=String(e??"").toLowerCase(),o=String(t??"").toLowerCase();return r.includes(o)},notcontains:(e,t)=>!_e.contains(e,t)},Qn=e=>e in _e,qe=1,Gr=2,Gn=e=>{var o,n,i;switch(e.type){case"multipleselect":return e&&e.props&&e.props.options?e.props.options.length>13?e.props.options.map(a=>[a.value]):(t=e.props.options.map(a=>a.value),r=!e.props.properties.required,t.reduce((a,l)=>a.concat(a.map(s=>[...s,l])),[[]]).filter(a=>r||a.length>0)):null;case"multiplechoice":{if(!e||!e.props||!e.props.options)return null;const a=e.props.options.map(l=>l.value);return e.props.properties.required||a.push(void 0),a}case"matrix":{if(!((o=e==null?void 0:e.props)!=null&&o.options))return null;const a=e.props.properties.matrixColumn,l=e.props.options,s=l.reduce((d,u)=>(d[u.id]=null,d),{}),c=[{...s,[l[0].id]:a[0].value},l.reduce((d,u)=>(d[u.id]=a[0].value,d),{})];return e.props.properties.required||c.push(s),c}case"likert":{const a=Number((i=(n=e.props)==null?void 0:n.properties)==null?void 0:i.range)||5;return[...Array.from(new Array(a).keys()).map(s=>s+1),...e.props.properties.required?[]:[null]]}case"nps":return[0,1,2,3,4,5,6,7,8,9,10,...e.props.properties.required?[]:[null]];case"videovoice":case"open":return["1",...e.props.properties.required?[]:[""]];case"recordedtask":{const a=[{taskStatus:"completed"},{taskStatus:"given.up"}];return e.props.properties.required||a.push({taskStatus:"abandoned"}),a}case"texturlprompt":return[void 0,...e.props.properties.required?[]:[{skipped:!0}]];case"consentlegal":return[1,...e.props.properties.required?[]:[null]];default:return[1]}var t,r},Zn=e=>typeof e=="object"&&e!==null&&"taskStatus"in e,Kn=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)&&"comparator"in e&&"questionIndex"in e,Zr=(e,t)=>{const r=[];for(const o of e)Array.isArray(o)?r.push(...Zr(o,t)):Kn(o)&&o.questionIndex===t&&r.push(o);return r},Jn=(e,t=[])=>t.reduce((r,o)=>{const{group:n,target:i}=o;if(!(n!=null&&n.length))return[...r];const a=Zr(n,e).map(l=>{const{comparator:s,value:c}=l;return{comparator:s,target:i,value:c}});return[...r,...a]},[]),Kr=({cards:e,index:t,hasEndCard:r,allResponses:o,uploadProgress:n={},surveyVisitorAttributes:i={}})=>{var d;if(t>=e.length||t<0)return null;let a=t+1;const l=e[t].props.routingOptions||[];for(const u of l){if(!Jr(u))continue;const{group:g,target:p}=u;if(en({group:g,allResponses:o,cards:e,surveyVisitorAttributes:i})){a=p===-1&&r?e.length-1:p;break}}const s=e.findIndex(u=>u.type==="uploading"),c=ct(e,r,s);for(;a!==null&&a!==-1&&a<=c;){const u=e[a],g=((d=u==null?void 0:u.props)==null?void 0:d.displayLogic)||[];if(g.length>0&&!dt({displayLogic:g,allResponses:o,cards:e,surveyVisitorAttributes:i})){a++;continue}if(u!=null&&u.parentId){const p=e.findIndex(y=>y.name===u.parentId);if(p>-1){const y=e[p],h=o[p],_=ce({comparator:"answered",type:y.type,response:h}),b=y.type==="matrix"&&ce({comparator:"partial",type:y.type,response:h});if(!(_||b)){a++;continue}}}break}return t>=c||a===-1||a!==null&&a>c?s>0&&Object.values(n).some(g=>g.isSubmitted&&!g.isComplete)?s:r?e.length-1:null:a===-1?null:a},Jr=e=>typeof e=="object"&&e!==null&&"group"in e,Yr=e=>e===qe||e===Gr,Gt=({segment:e,allResponses:t,cards:r,surveyVisitorAttributes:o})=>Array.isArray(e)?Xr({segments:e,allResponses:t,cards:r,surveyVisitorAttributes:o}):!Yr(e)&&!!(n=>typeof n=="object"&&n!==null&&!Array.isArray(n)&&"comparator"in n)(e)&&(({rule:n,allResponses:i,cards:a,surveyVisitorAttributes:l})=>{if(n.questionIndex===void 0||typeof n.questionIndex=="number"&&n.questionIndex>=i.length)return!1;const s=(({rule:c,allResponses:d,cards:u,surveyVisitorAttributes:g})=>{if(c.questionIndex===void 0)return null;if(typeof(p=c.questionIndex)=="string"&&p.startsWith("attr-")){const h=(_=>_.slice(5))(c.questionIndex);return h in g?{response:g[h],type:"AttributeCheck"}:null}var p;const y=c.questionIndex;return{response:d[y],type:u[y].type}})({rule:n,allResponses:i,cards:a,surveyVisitorAttributes:l});return s!==null&&!!ce({comparator:n.comparator,response:s.response,type:s.type,value:n.value})})({rule:e,allResponses:t,cards:r,surveyVisitorAttributes:o}),Xr=({segments:e,allResponses:t,cards:r,surveyVisitorAttributes:o})=>{if(!e||e.length===0)return!1;let n=Gt({segment:e[0],allResponses:t,cards:r,surveyVisitorAttributes:o}),i=1;for(;i<e.length;){const a=e[i];if(!Yr(a)||(i+=1,i>=e.length))return!1;const l=Gt({segment:e[i],allResponses:t,cards:r,surveyVisitorAttributes:o});i+=1,n=a===qe?n&&l:n||l}return n},dt=({displayLogic:e,allResponses:t,cards:r,surveyVisitorAttributes:o})=>e.some(n=>!!Jr(n)&&en({group:n.group,allResponses:t,cards:r,surveyVisitorAttributes:o})),en=({group:e,allResponses:t,cards:r,surveyVisitorAttributes:o})=>Xr({segments:e,allResponses:t,cards:r,surveyVisitorAttributes:o}),ce=({comparator:e,response:t,type:r,value:o})=>{if(r==="AttributeCheck")return((i,a,l)=>{const s=Ae(a),c=Ae(l),d=Number(a),u=Number(l),g=!Number.isNaN(d)&&s===String(d),p=!Number.isNaN(u)&&c===String(u),y=g&&p;switch(i){case"eq":return y?d===u:s.toLowerCase()===c.toLowerCase();case"neq":return y?d!==u:s.toLowerCase()!==c.toLowerCase();case"contains":case"notcontains":return ie[i](s,c);case"gt":case"gte":case"lt":case"lte":return y?ie[i](d,u):ie[i](s.localeCompare(c),0);case"list_exact":case"list_all":case"list_alo":case"list_dni":{const h=Array.isArray(a)?a:[a],_=Array.isArray(l)?l:[l];return ie[i](h,_)}default:return!1}})(e,t,o);if(!Ze(t))return!1;const n=t;if(e==="answered")switch(r){case"texturlprompt":return n===void 0;case"consentlegal":return n&&(i=>i===null||i!==void 0&&typeof i=="object"&&"submitted"in i&&typeof i.submitted=="boolean")(n)&&n.submitted===!0;case"recordedtask":return Me(n)&&n.taskStatus==="completed";case"likert":case"nps":return Number.isInteger(n);case"rankorder":return Dt(n)&&Object.values(n).every(i=>i!==null);case"matrix":return Ft(n)&&Object.values(n).every(i=>i!==null);case"maxdiff":return zt(n)&&n.every(i=>{if(!Array.isArray(i))return!1;const a=i.some(s=>s.selected==="left"),l=i.some(s=>s.selected==="right");return a&&l});case"multiplechoice":return!!n;case"multipleselect":return n&&Array.isArray(n)&&(n.length??0)>0;case"open":case"aidynamicstandalone":return typeof n=="string"&&!!n;case"videovoice":return(i=>i!=null&&typeof i=="object"&&"mediaRecordingUid"in i&&typeof i.mediaRecordingUid=="string")(n)&&!!n.mediaRecordingUid;default:return!1}if(e==="given_up")return r!=="recordedtask"||Me(n)&&n.taskStatus==="given.up";if(e==="partial")return Qr(n,r);if(e==="skipped")switch(r){case"texturlprompt":return(i=>i!==null&&(i===void 0||typeof i=="object"))(n)&&!!(typeof n=="object"&&n!==null&&"skipped"in n&&n.skipped);case"consentlegal":case"likert":case"nps":case"videovoice":return n===null;case"recordedtask":return Me(n)&&n.taskStatus==="abandoned";case"open":case"aidynamicstandalone":return n===null||typeof n=="string"&&n.length===0;case"multiplechoice":return n==null;case"multipleselect":return n===null||Array.isArray(n)&&n.length===0;case"matrix":return n===null||Ft(n)&&Object.values(n).every(i=>i===null);case"maxdiff":return n===null||!zt(n)||n.some(i=>{if(!Array.isArray(i))return!0;const a=i.some(s=>s.selected==="left"),l=i.some(s=>s.selected==="right");return!(a&&l)});case"rankorder":return n===null||Dt(n)&&Object.values(n).includes(null);default:return!1}return o!==void 0&&_e[e](n,o)};var tn=(e=>(e.CONTINUE="CONTINUE",e.EXTERNAL="EXTERNAL",e.NO_BUTTON="NO_BUTTON",e))(tn||{}),Z=(e=>(e.failure="failure",e.success="success",e.inFlight="inFlight",e))(Z||{}),rn=(e=>(e.Unlimited="Unlimited",e.Maximum="Maximum",e.Range="Range",e))(rn||{});const Yn=e=>{var t,r,o,n,i,a,l,s,c;switch(e.type){case"rankorder":case"multipleselect":case"multiplechoice":return(r=(t=e==null?void 0:e.props)==null?void 0:t.options)==null?void 0:r.map(d=>d.label);case"nps":return"1-10";case"likert":return`1-${((n=(o=e==null?void 0:e.props)==null?void 0:o.properties)==null?void 0:n.range)??5}`;case"matrix":return{matrixColumns:(l=(a=(i=e==null?void 0:e.props)==null?void 0:i.properties)==null?void 0:a.matrixColumn)==null?void 0:l.map(d=>d.label),matrixRows:(c=(s=e==null?void 0:e.props)==null?void 0:s.options)==null?void 0:c.map(d=>d.label)};default:return}},Xn=new Set(["rankorder","multipleselect","multiplechoice","matrix","likert","nps","open","aidynamicfollowup","aidynamicstandalone"]),Zt=({cards:e,combinedReadableRawResponses:t,targetQuestionId:r,generateQuestionType:o})=>{let n=1,i=1;const a=e.reduce((l,s)=>{if(s.name>0&&Xn.has(s.type)){if(r===s.name&&(i=n,o==="aidynamicstandalone"))return n++,l;if((s.type==="aidynamicfollowup"||s.type==="aidynamicstandalone")&&s.props.loading!==Z.success)return l;const c="properties"in s.props&&s.props.properties&&"captionText"in s.props.properties?s.props.properties.captionText:void 0,d=(u=>u.type!=="uploading"&&u.type!=="thanks")(s)?{order:n++,question:s.props.message,questionDescription:c,questionType:s.type,response:t==null?void 0:t[s.name],options:Yn(s)}:{order:n++,questionType:s.type,response:t==null?void 0:t[s.name]};l.push(d)}return l},[]);return{targetQuestionOrder:i,questionsResponses:a}},Kt=e=>{var t;return"props"in e&&"loading"in e.props&&((t=e==null?void 0:e.props)==null?void 0:t.loading)!==void 0},Ve=(e,t,r)=>{let o=!1;const n=e.map(i=>i&&i.parentId===t?(o=!0,r(i)):i);return o?n:e},He=(e,t,r)=>{let o=!1;const n=e.map(i=>i&&i.name===t?(o=!0,r(i)):i);return o?n:e},Jt=e=>{const{props:t}=e;return t&&"message"in t&&"properties"in t?{...e,props:{...t,loading:Z.inFlight}}:e},Yt=({isPreview:e,apiURL:t,envId:r,userId:o,headers:n})=>e?{url:`${t}/sdk/1/environments/${r}/dynamic-question-preview`,visitorIdHeader:"0"}:{url:`${t}/sdk/1/environments/${r}/visitors/${o}/dynamic-question`,visitorIdHeader:n["x-ul-visitor-id"]},eo=(e,t)=>{const r=t[e];return typeof r!="number"?null:r},nn=(e,t)=>Array.isArray(e)?e.map(r=>nn(r,t)):(r=>typeof r=="object"&&r!==null&&!Array.isArray(r)&&"questionUid"in r)(e)?{...e,questionIndex:eo(e.questionUid,t)}:e,to=e=>e===qe||e===Gr,Xt=({segment:e,allResponses:t,cards:r,currentIndex:o})=>Array.isArray(e)?on({constraintGroup:e,allResponses:t,cards:r,currentIndex:o}):typeof e!="number"&&!!(n=>typeof n=="object"&&n!==null&&!Array.isArray(n)&&"questionIndex"in n)(e)&&(({constraint:n,allResponses:i,cards:a,currentIndex:l})=>{const{questionIndex:s}=n;if(s===null)return!1;if(!Object.hasOwn(i,s))return!(l>s)||n.comparisonType==="skipped";const c=a[s];return c!==void 0&&!!ce({comparator:n.comparisonType,response:i[s],type:c.type,value:n.value})})({constraint:e,allResponses:t,cards:r,currentIndex:o}),on=({constraintGroup:e,allResponses:t,cards:r,currentIndex:o})=>{if(e.length===0)return!1;let n=Xt({segment:e[0],allResponses:t,cards:r,currentIndex:o}),i=1;for(;i<e.length;){const a=e[i];if(typeof a!="number"||!to(a)||(i+=1,i>=e.length))return!1;const l=Xt({segment:e[i],allResponses:t,cards:r,currentIndex:o});i+=1,n=a===qe?n&&l:n||l}return n},an=e=>e.length>0&&e.every(t=>t.quotaFilled||!t.quotaMatched),ro=({quotas:e,quotaMessages:t})=>{if(e.length!==0)return e.every(r=>!r.quotaMatched)?t==null?void 0:t.disqualified:an(e)?t==null?void 0:t.filled:void 0},er=e=>200+90*e+16*e,Fe=new Set(["thanks","uploading"]),B=$r()((e,t)=>({providerPersona:void 0,showProviderPersona:!1,addResponseGroupMeta:void 0,allResponses:[],allResponsesRaw:{},answers:void 0,apiURL:"",avatars:{agentAvatar:{"1x":"","2x":""},respondentAvatar:{"1x":"","2x":""}},border:"#000000",cards:[],cardIndexByName:{},quotaEndcardText:void 0,quotaMessages:void 0,quotas:[],close:async(r=I.APP_ID)=>{const o=t(),{fadeout:n,remove:i,trackHistory:a,studyType:l}=o;await n(r),De(o)||a({event:"closed"}),I.breadcrumbsLogger.info("SurveyClosing",{surveyId:o.surveyId}),I.ConflictingWidgets.enable(),i({initiator:I.DismissReason.Closed,studyType:l})},configureExitOnOverlayClick:()=>{},customMetadata:{},destroy:async r=>{const{eventEmitFn:o,fadeout:n,remove:i,studyType:a,surveyId:l}=t();o("survey.complete",l),await n(r),I.ConflictingWidgets.enable(),i({initiator:I.DismissReason.Complete,studyType:a})},enableCspTrustedTypes:!1,endCard:{headline:""},envId:"",eventEmitFn:I.eventEmitter.emit.bind(I.eventEmitter),fadeout:async r=>{const{eventEmitFn:o,headers:n,viewDocument:i}=t();return I.shouldDirectEmbed(n)?Promise.resolve():(o(I.SprigEvent.SurveyFadingOut),new Promise(a=>{const l=i.getElementById(r);l?(l.addEventListener("transitionend",()=>{a()}),l.classList.remove("ul-app--visible")):a()}))},forceBrandedLogo:!1,frame:document.createElement("iframe"),handleClickEmbedButton:r=>{const{cards:o,eventEmitFn:n,index:i}=t();n(r,{qid:o[i].name,props:o[i].props}),e(()=>({hasViewedEmbed:!0}))},handleUploadUpdate:({mediaRecordingUid:r,isComplete:o,progressPct:n,isSubmitted:i})=>{var p,y,h;const{cards:a,destroy:l,index:s,uploadProgress:c}=t(),d=o||((p=c[r])==null?void 0:p.isComplete),u={...c,[r]:{progressPct:d?100:n||((y=c[r])==null?void 0:y.progressPct),isComplete:d,isSubmitted:i||((h=c[r])==null?void 0:h.isSubmitted)}};if(e({uploadProgress:u}),a[s].type!=="uploading")return;const g=Object.entries(c).every(([_,b])=>!b.isSubmitted||b.isComplete||r==_&&o);if(g&&s>=a.length-1)return l(I.APP_ID);e({index:g?s+1:s,uploadingCardViewed:!0})},hasViewedEmbed:!1,headers:{Authorization:"","Content-Type":"","userleap-platform":"web","x-ul-environment-id":"","x-ul-installation-method":"web-snippet","x-ul-sdk-version":"","x-ul-visitor-id":""},index:0,isConversationalUI:!1,isPreview:!1,layout:"default",marketingUrl:"https://sprig.com",meta:{ch:0,cw:0,l:"",mode:null,p:"",sh:0,sw:0},mode:void 0,next:r=>{const{allResponses:o,cards:n,eventEmitFn:i,index:a,quotaMessages:l,quotas:s,responseGroupUid:c,submit:d,trackHistory:u,uploadProgress:g,viewedCardCount:p}=t(),y=Array.isArray(r.data)?r.data:[r.data],h=Date.now(),_=[...n],b={response:[],responseGroupUid:c,questionIndex:a};let f=null;const x=o.slice(0);let w=a;y.forEach((A,R)=>{const j=Math.floor(A.questionId),q=_.findIndex(H=>H.name===j),T=q>=0?_[q]:_[a+R],N={value:A.value,questionId:j,answeredAt:h,...A.secondaryValue!==void 0&&{secondaryValue:A.secondaryValue},...A.questionText!==void 0&&{questionText:A.questionText}},P=N.value;(H=>H&&!Fe.has(H.type))(T)&&(T.value=P,T.secondaryValue=N.secondaryValue||null),b.response.push(N);const U=q>=0?q:a+R;x[U]=Ke(T,P),U>w&&(w=U)}),f=Kr({cards:_,index:w,hasEndCard:!!r.endCard,uploadProgress:g,allResponses:x,surveyVisitorAttributes:t().surveyVisitorAttributes});const k=(({quotas:A,allResponses:R,cards:j,currentIndex:q})=>A.map(T=>T.quotaMatched?{...T,quotaMatched:on({constraintGroup:T.constraintGroup,allResponses:R,cards:j,currentIndex:q})}:T))({quotas:s,allResponses:x,cards:_,currentIndex:f??w+1});if(an(k)){const A=_.findIndex(R=>R.type==="thanks");f=A>=0?A:null}e({allResponses:x,quotaEndcardText:ro({quotas:k,quotaMessages:l}),quotas:k}),(f===null||Fe.has(_[f].type))&&(b.completedAt=h);const v=d(b);if(f===null)return void r.completeSurvey();f&&!Fe.has(_[f].type)&&v.finally(()=>{u({event:"seen",index:f})});const m=_[f];_[f]&&i&&i("survey.question",{qid:m.name,props:m.props}),e({cards:_,hasViewedEmbed:!1,index:f,viewedCardCount:p+1})},pendingRemoveIframeReason:null,previewKey:null,recorder:()=>{},recorderEventEmitter:I.eventEmitter,resolveTrackedPromise:()=>{const{removeIframeIfReady:r}=t();e(o=>({unresolvedRequestCount:o.unresolvedRequestCount-1})),r()},responseGroupUid:"",remove:({initiator:r,studyType:o})=>{const{eventEmitFn:n,removeIframeIfReady:i,surveyId:a}=t();e({pendingRemoveIframeReason:r,studyType:o}),n(I.SprigEvent.SurveyCloseRequested,{name:I.SprigEvent.SurveyCloseRequested,initiator:r,studyType:o,"survey.id":a}),i()},removeIframeIfReady:()=>{const{eventEmitFn:r,pendingRemoveIframeReason:o,unresolvedRequestCount:n,studyType:i,surveyId:a}=t();o&&n===0&&(r(I.SprigEvent.SurveyWillClose,{name:I.SprigEvent.SurveyWillClose,initiator:o,studyType:i,"survey.id":a}),e({pendingRemoveIframeReason:null,studyType:i}))},seen:async()=>{const{trackHistory:r}=t();return r({event:"seen",isNew:!0})},createDynamicStandaloneQuestion:async({questionId:r})=>{var g,p,y;let o=!1;if(e(h=>{const _=h.cards.find(b=>(b==null?void 0:b.name)===r);return!(_!=null&&_.name)||Kt(_)?h:(o=!0,{cards:He(h.cards,r,Jt)})}),!o)return;const n=t(),{targetQuestionOrder:i,questionsResponses:a}=Zt({cards:n.cards,combinedReadableRawResponses:n.allResponsesRaw,targetQuestionId:r,generateQuestionType:"aidynamicstandalone"}),l={surveyId:n.surveyId,responseGroupUid:n.responseGroupUid,standaloneQuestionOrder:i,questionsResponses:a,standaloneQuestionId:r,customMetadata:n.customMetadata,meta:n.meta,previewKey:n.previewKey,isPreview:n.isPreview};let s=!1;const c=()=>{if(s)return;s=!0;const h=t(),_=h.cards.find(({name:b})=>b===r);if(e(b=>({cards:He(b.cards,r,f=>{const{props:x}=f;return x&&"message"in x&&"properties"in x?{...f,value:"",props:{...x,loading:Z.failure,properties:{...x.properties,required:!1}}}:f})})),I.isLongFormSurvey(h.studyType)&&(_!=null&&_.groupId)){const b=h.cards.reduce((w,k)=>((k==null?void 0:k.groupId)===_.groupId&&w.push(k),w),[]),f=b.findIndex(w=>w.name===_.name),x=f+1;if(x<b.length){const w=b[x].name;h.setFocusedQuestionId(w)}else{const w=b[f-1].name;h.setFocusedQuestionId(w)}}else h.next({data:{value:"",questionId:_.name,type:_.type},completeSurvey:()=>h.destroy(I.APP_ID),endCard:h.endCard})},d=new AbortController,u=setTimeout(()=>{d.abort(),c();const h=new Error("Timeout reached—question skipped");n.trackPromise(ne(n,"aidynamicstandalone",h))},3e3);try{const{url:h,visitorIdHeader:_}=Yt(n),b=await n.trackPromise(I.sprigFetch(h,{body:JSON.stringify(l),headers:{...n.headers,"x-ul-visitor-id":_},method:"POST",signal:d.signal}));if(!b.ok||!((y=(p=(g=b==null?void 0:b.json)==null?void 0:g.props)==null?void 0:p.message)!=null&&y.length))return c(),void await n.trackPromise(ne(n,"dynamicQuestion",b.error));if(s)return;s=!0,e(f=>({cards:He(f.cards,r,x=>{const w=x.props;return w&&"message"in w&&"properties"in w?{...x,props:{...w,loading:Z.success,message:b.json.props.message}}:x})}))}finally{clearTimeout(u)}},createDynamicFollowupQuestion:async({parentQuestionId:r,parentResponseConfig:o})=>{var h,_,b;let n=!1;e(f=>{const x=f.cards.find(w=>(w==null?void 0:w.parentId)===r);return!(x!=null&&x.name)||Kt(x)?f:(n=!0,{cards:Ve(f.cards,r,Jt)})});const i=t(),a={...i.allResponsesRaw,...o||{}},{targetQuestionOrder:l,questionsResponses:s}=Zt({cards:i.cards,combinedReadableRawResponses:a,targetQuestionId:r,generateQuestionType:"aidynamicfollowup"}),c=i.cards.find(f=>f.parentId===r&&f.type==="aidynamicfollowup");if(!n||!c)return;const d={surveyId:i.surveyId,responseGroupUid:i.responseGroupUid,parentQuestionOrder:l,questionsResponses:s,childQuestionId:c.name,customMetadata:i.customMetadata,meta:i.meta,previewKey:i.previewKey,isPreview:i.isPreview};let u=!1;const g=()=>{if(u)return;u=!0;const f=t(),x=f.cards.find(w=>w.parentId===r);if(e(w=>({cards:Ve(w.cards,r,k=>{const{props:v}=k;return v&&"message"in v&&"properties"in v?{...k,value:"",props:{...v,loading:Z.failure,properties:{...v.properties,required:!1}}}:k})})),I.isLongFormSurvey(f.studyType)&&(x!=null&&x.groupId)){const w=f.cards.reduce((m,A)=>((A==null?void 0:A.groupId)===x.groupId&&m.push(A),m),[]),k=w.findIndex(m=>m.name===x.name),v=k+1;if(v<w.length){const m=w[v].name;f.setFocusedQuestionId(m)}else{const m=w[k-1].name;f.setFocusedQuestionId(m)}}else f.next({data:{value:"",questionId:x.name,type:x.type},completeSurvey:()=>f.destroy(I.APP_ID),endCard:f.endCard})},p=new AbortController,y=setTimeout(()=>{p.abort(),g();const f=new Error("Timeout reached—question skipped");i.trackPromise(ne(i,"dynamicFollowUpQuestion",f))},3e3);try{const{url:f,visitorIdHeader:x}=Yt(i),w=await i.trackPromise(I.sprigFetch(f,{body:JSON.stringify(d),headers:{...i.headers,"x-ul-visitor-id":x},method:"POST",signal:p.signal}));if(!w.ok||!((b=(_=(h=w==null?void 0:w.json)==null?void 0:h.props)==null?void 0:_.message)!=null&&b.length))return g(),void await i.trackPromise(ne(i,"dynamicQuestion",w.error));if(u)return;u=!0,e(k=>({cards:Ve(k.cards,r,v=>{const m=v.props;return m&&"message"in m&&"properties"in m?{...v,props:{...m,loading:Z.success,message:w.json.props.message}}:v})}))}finally{clearTimeout(y)}},setAllResponsesRaw:r=>e({allResponsesRaw:r}),slugName:null,showStripes:!1,showSurveyBrand:!1,startingQuestionIdx:null,styleNonce:"",submit:async({completedAt:r,questionIndex:o,response:n,responseGroupUid:i})=>{const a=t();if(!i||De(a))return;const l={responseGroupUid:i,meta:a.meta,customMetadata:a.customMetadata,responses:n,completedAt:r,previewKey:a.previewKey};if(typeof a.addResponseGroupMeta=="function")try{const c=await a.addResponseGroupMeta();typeof c=="object"&&c!==null?l.meta={...l.meta,...c}:I.breadcrumbsLogger.error("addResponseGroupMeta must return an object")}catch(c){I.breadcrumbsLogger.error("addResponseGroupMeta promise failed",c)}const s=await a.trackPromise(I.sprigFetch(`${a.apiURL}/sdk/1/environments/${a.envId}/visitors/${a.userId}/responses/submit`,{body:JSON.stringify(l),headers:a.headers,method:"POST"}));s.ok?n.forEach((c,d)=>{a.eventEmitFn(I.SprigEvent.QuestionAnswered,{...c,questionIndex:o?o+d:void 0,"survey.id":a.surveyId})}):s.reportError&&(console.warn("[Sprig] (ERR-427) Failed to submit response",s.error),await a.trackPromise(ne(a,"submitResponse",s.error)))},surveyId:0,surveyVisitorAttributes:{},tabTitle:"",trackHistory:async({event:r,index:o,isNew:n=!1})=>{const i=t();if(De(i))return;const{cards:a,index:l}=i;let s=o??l,c=a[s];for(;c;){const d={sid:i.surveyId,qid:Math.floor(c.name),action:r,vid:i.userId,eid:i.envId,isNew:n,responseGroupUid:i.responseGroupUid,previewKey:i.previewKey},u=await i.trackPromise(I.sprigFetch(`${i.apiURL}/sdk/1/visitors/${i.userId}/surveys/${i.surveyId}/history`,{method:"POST",headers:i.headers,body:JSON.stringify(d)}));!u.ok&&u.reportError&&(console.warn("[Sprig] (ERR-428) Failed to track survey event",u.error),await i.trackPromise(ne(i,"trackHistory",u.error)));const g=a[s+1];if(!c.groupId||!(g!=null&&g.groupId)||g.groupId!==c.groupId)break;s++,c=g,n=!1}},trackPromise:async r=>{const{resolveTrackedPromise:o}=t();return e(n=>({unresolvedRequestCount:n.unresolvedRequestCount+1})),r.then(n=>(o(),n)).catch(n=>{throw o(),n})},unresolvedRequestCount:0,update:()=>{var k,v,m;const{cards:r,index:o,headers:n,eventEmitFn:i,frame:a,useMobileStyling:l,surveyId:s,studyType:c,viewDocument:d,isConversationalUI:u}=t(),g=n["userleap-platform"]==="web",p=I.shouldDirectEmbed(n),y=r[o],h=I.isLongFormSurvey(c)?!!d.querySelector(".ul-card--matrix-expandable"):y.type==="matrix"&&!(y.props.properties.displayMatrixAsAccordion||l),_=!l&&h;!p&&!l&&((k=a==null?void 0:a.setWidth)==null||k.call(a,I.DEFAULT_WIDTH_PX));const[b,f]=I.calculateFrameDimensions(d,g&&!l,p),x=u&&b<532?532:b,w=((A,R,j)=>{if(!j)return R;const q=A.querySelector(".ul-card-scroll-wrapper:has(.ul-card--matrix-expandable)");if(!I.isHTMLElement(q)||q.offsetWidth<=600)return R;const T=A.querySelector(".ul-card--matrix_grid"),N=I.isHTMLElement(T)?T.scrollWidth:0;return Math.max(R,q.offsetWidth+(R-N))})(d,f,_);if(p)return i(I.SprigEvent.SurveyHeight,{name:I.SprigEvent.SurveyHeight,contentFrameHeight:x,"survey.id":s}),void i(I.SprigEvent.SurveyWidth,{name:I.SprigEvent.SurveyWidth,contentFrameWidth:w,"survey.id":s});(v=a.setHeight)==null||v.call(a,x),_&&((m=a.setWidth)==null||m.call(a,w))},uploadingCardViewed:!1,uploadProgress:{},useDesktopPrototype:void 0,useMobileStyling:!1,userId:"",viewDocument:window.document,viewedCardCount:0,focusedQuestionId:null,setFocusedQuestionId:r=>e({focusedQuestionId:r})})),De=e=>{var t;return!e.userId||((t=e==null?void 0:e.meta)==null?void 0:t.mode)==="test"||e.isPreview},ne=async(e,t,r)=>{const{mode:o,userId:n,envId:i,apiURL:a,headers:l,viewDocument:s}=e,c=s.documentElement,d={mode:o,screenWidth:window.screen.width,screenHeight:window.screen.height,clientWidth:c.clientWidth,clientHeight:c.clientHeight,location:window.location.href,language:window.navigator.language},u={action:t,err:{message:`${r==null?void 0:r.name} - ${r==null?void 0:r.message}`,stack:r==null?void 0:r.stack},meta:d,vid:n,envId:i};(await I.sprigFetch(`${a}/sdk/1/errors`,{method:"POST",headers:Object.assign({"x-ul-error":window.btoa(`userleap-${Date.now()}-error`)},l),body:JSON.stringify(u)})).ok||console.warn("[Sprig] (ERR-444) Failed to report error to API",r)},no=()=>{const{cards:e,close:t,endCard:r,headers:o,index:n}=B(l=>({cards:l.cards,close:l.close,endCard:l.endCard,headers:l.headers,index:l.index,useMobileStyling:l.useMobileStyling})),i=e.length,a=Y(()=>()=>t(I.APP_ID),[t]);return["email","link"].includes(o["userleap-platform"])||r&&n+1===i?null:S("div",{"aria-label":"Close button",className:"close-btn",onClick:a,onKeyPress:l=>{l.key==="Enter"&&a()},role:"button",tabIndex:0,children:S("svg",{fill:"none",height:"16px",viewBox:"0 0 13 13",width:"16px",xmlns:"http://www.w3.org/2000/svg",children:S("path",{d:"M2.54964 1.78369L1.78369 2.54964L5.73405 6.5L1.78369 10.4504L2.54964 11.2163L6.5 7.26595L10.4504 11.2163L11.2163 10.4504L7.26595 6.5L11.2163 2.54964L10.4504 1.78369L6.5 5.73405L2.54964 1.78369Z",fill:"currentColor"})})})},sn=e=>O("svg",{fill:"none",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",...e},O("path",{d:"M17 10L12 15L7 10",stroke:"#0B2330",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5})),ln=e=>O("svg",{fill:"none",height:10,viewBox:"0 0 10 10",width:10,xmlns:"http://www.w3.org/2000/svg",...e},O("path",{d:"M9.15377 1.30774L4.07685 8.23082L1.30762 5.00005",stroke:"white",strokeLinecap:"round",strokeWidth:2})),oo=({visible:e})=>S("div",{className:"sprig-check-background",style:{opacity:e?1:0},children:S(ln,{className:"sprig-check"})}),tr="250ms",io=st(({animate:e,children:t,header:r,isOpen:o,onClick:n,showHeaderCheck:i},a)=>{const l=B(h=>h.update),s=J(null),[c,d]=K(0),[u,g]=K("none"),[p,y]=K(!0);return V(()=>{var _;const h=(_=s.current)==null?void 0:_.getBoundingClientRect();d(o&&h?h.height:0)},[o]),V(()=>{l()},[c,l]),V(()=>{!c&&o||!p||y(!1),g(e&&!p?`height ${tr} ease`:"none")},[e,p,c,o]),S("div",{className:"sprig-accordion",ref:a,children:[S("button",{className:"sprig-accordion-header-container",onClick:n,type:"button",children:[S("div",{className:"sprig-header-label-container",children:[S("span",{className:"sprig-header-label",children:r}),S(oo,{visible:i})]}),S(sn,{className:"sprig-caret",style:{transitionDuration:e?tr:"0",transform:o?"rotate(-180deg)":"none"}})]}),S("div",{className:"sprig-accordion-body",style:{transition:u,height:c},children:S("div",{ref:s,children:t})})]})}),pt=({style:e,stroke:t="black"})=>S("svg",{fill:"none",height:"10",style:e,viewBox:"0 0 12 10",width:"12",xmlns:"http://www.w3.org/2000/svg",children:[S("path",{d:"M1.47839 5.2085L10.9384 5.2085",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.35"}),S("path",{d:"M7.0686 1.15845L10.9386 5.20845L7.0686 9.25845",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.35"})]}),Ce=(...e)=>e.filter(Boolean).join(" "),un=(e,t,r)=>{const o=t?"--mobile":"--desktop";return`${e+o} ${e+(r?`${o}_${r}`:"")} ${e}`},ao=(e,t)=>`${e} ${e}__${t}`,cn=({logoOnly:e=!1,style:t={}})=>S("svg",{alt:(e?"Powered by ":"")+"Sprig",className:"sprig-logo",fill:"none",height:"15",style:{display:"block",...t},viewBox:e?"79 0 31 15":"0 0 112 15",width:e?"35":"112",xmlns:"http://www.w3.org/2000/svg",children:[!e&&S("path",{d:"M0.648926 12.0181V2.8584H4.21631C6.0127 2.8584 7.25684 4.06445 7.25684 5.86084V5.87354C7.25684 7.66357 6.0127 8.88867 4.21631 8.88867H2.0708V12.0181H0.648926ZM3.86084 4.05811H2.0708V7.69531H3.86084C5.09229 7.69531 5.80957 7.02881 5.80957 5.87988V5.86719C5.80957 4.72461 5.09229 4.05811 3.86084 4.05811ZM11.6621 12.1514C9.63721 12.1514 8.39941 10.7993 8.39941 8.57764V8.56494C8.39941 6.34961 9.64355 4.99121 11.6621 4.99121C13.6743 4.99121 14.9185 6.34326 14.9185 8.56494V8.57764C14.9185 10.7993 13.6807 12.1514 11.6621 12.1514ZM11.6621 11.0024C12.8428 11.0024 13.5156 10.1011 13.5156 8.57764V8.56494C13.5156 7.03516 12.8428 6.14014 11.6621 6.14014C10.4751 6.14014 9.80859 7.03516 9.80859 8.56494V8.57764C9.80859 10.1074 10.4751 11.0024 11.6621 11.0024ZM17.6226 12.0181L15.7183 5.12451H17.1021L18.3398 10.4438H18.4414L19.8633 5.12451H21.1709L22.5928 10.4438H22.7007L23.9321 5.12451H25.2969L23.3989 12.0181H21.9834L20.5552 6.87646H20.4473L19.0254 12.0181H17.6226ZM29.334 12.1514C27.3154 12.1514 26.0967 10.7739 26.0967 8.59033V8.58398C26.0967 6.43213 27.3408 4.99121 29.2642 4.99121C31.1875 4.99121 32.3682 6.38135 32.3682 8.45068V8.93311H27.4805C27.5059 10.2534 28.2295 11.0215 29.3657 11.0215C30.248 11.0215 30.7749 10.5835 30.9399 10.228L30.9653 10.1772L32.292 10.1709L32.2793 10.228C32.0508 11.1357 31.0986 12.1514 29.334 12.1514ZM29.2705 6.12109C28.3311 6.12109 27.6201 6.76221 27.4995 7.94922H31.0034C30.8955 6.71777 30.2036 6.12109 29.2705 6.12109ZM34.0059 12.0181V5.12451H35.3833V6.16553H35.4849C35.7324 5.43555 36.3735 5.00391 37.2939 5.00391C37.5161 5.00391 37.7573 5.03564 37.897 5.06738V6.33691C37.6494 6.28613 37.4146 6.25439 37.1543 6.25439C36.1006 6.25439 35.3833 6.90186 35.3833 7.89844V12.0181H34.0059ZM41.9277 12.1514C39.9092 12.1514 38.6904 10.7739 38.6904 8.59033V8.58398C38.6904 6.43213 39.9346 4.99121 41.8579 4.99121C43.7812 4.99121 44.9619 6.38135 44.9619 8.45068V8.93311H40.0742C40.0996 10.2534 40.8232 11.0215 41.9595 11.0215C42.8418 11.0215 43.3687 10.5835 43.5337 10.228L43.5591 10.1772L44.8857 10.1709L44.873 10.228C44.6445 11.1357 43.6924 12.1514 41.9277 12.1514ZM41.8643 6.12109C40.9248 6.12109 40.2139 6.76221 40.0933 7.94922H43.5972C43.4893 6.71777 42.7974 6.12109 41.8643 6.12109ZM49.1133 12.1323C47.3804 12.1323 46.2568 10.7422 46.2568 8.57764V8.56494C46.2568 6.38135 47.3613 5.00391 49.1133 5.00391C50.0591 5.00391 50.8652 5.47363 51.2334 6.21631H51.3413V2.42041H52.7124V12.0181H51.3413V10.9326H51.2334C50.8335 11.688 50.0781 12.1323 49.1133 12.1323ZM49.5068 10.958C50.6558 10.958 51.3604 10.0503 51.3604 8.57764V8.56494C51.3604 7.09229 50.6494 6.18457 49.5068 6.18457C48.3516 6.18457 47.6597 7.08594 47.6597 8.56494V8.57764C47.6597 10.0566 48.3516 10.958 49.5068 10.958ZM61.98 12.1323C61.0151 12.1323 60.2598 11.688 59.8599 10.9326H59.7583V12.0181H58.3809V2.42041H59.7583V6.21631H59.8599C60.228 5.47363 61.0342 5.00391 61.98 5.00391C63.7319 5.00391 64.8364 6.38135 64.8364 8.56494V8.57764C64.8364 10.7422 63.7192 12.1323 61.98 12.1323ZM61.5928 10.958C62.7417 10.958 63.4336 10.0566 63.4336 8.57764V8.56494C63.4336 7.08594 62.7417 6.18457 61.5928 6.18457C60.4438 6.18457 59.7329 7.09229 59.7329 8.56494V8.57764C59.7329 10.0503 60.4438 10.958 61.5928 10.958ZM66.8867 14.4429C66.7153 14.4429 66.5122 14.4302 66.3345 14.4111V13.3257C66.4678 13.3447 66.6392 13.3511 66.7979 13.3511C67.439 13.3511 67.8262 13.0781 68.0293 12.3799L68.1309 12.0244L65.6299 5.12451H67.1152L68.8418 10.6343H68.9624L70.6826 5.12451H72.1299L69.5654 12.2847C68.9814 13.9287 68.2832 14.4429 66.8867 14.4429Z",fill:"currentColor"}),S("path",{d:"M81.1088 6.63629C79.6878 6.32154 78.9672 5.76865 78.9672 4.99369C78.9672 4.19299 79.736 3.5886 80.7556 3.5886C81.8066 3.5886 82.5995 4.25285 82.5995 5.13336V5.20352H84.0518V5.13336C84.0518 3.52424 82.6405 2.30774 80.7693 2.30774C79.8676 2.30774 79.0414 2.58451 78.4433 3.08655C78.1463 3.33144 77.9077 3.63818 77.7448 3.98479C77.5818 4.33141 77.4984 4.70934 77.5005 5.09153C77.4946 5.44197 77.5675 5.78934 77.714 6.10857C77.8605 6.42779 78.0769 6.71092 78.3475 6.93752C78.8512 7.37584 79.5659 7.70024 80.4709 7.90299C81.9949 8.23898 82.7676 8.81054 82.7676 9.60094C82.7676 10.4576 81.9258 11.1032 80.813 11.1032C79.6571 11.1032 78.7854 10.3856 78.7854 9.43424V9.36408H77.3318V9.43424C77.3318 11.1167 78.8219 12.3847 80.7973 12.3847C81.7421 12.3847 82.6093 12.0983 83.2393 11.5769C83.5519 11.3237 83.8034 11.0048 83.9753 10.6433C84.1472 10.2818 84.2352 9.88702 84.2329 9.48766C84.2329 8.05875 83.1833 7.09907 81.1088 6.63629Z",fill:"currentColor"}),S("path",{d:"M89.2394 4.68276C88.6963 4.67605 88.1596 4.79915 87.6751 5.04156C87.1905 5.28397 86.7725 5.63851 86.4566 6.07497V4.85204H85.0747V14.8479H86.4566V11.0356C86.7725 11.472 87.1906 11.8265 87.6751 12.0688C88.1596 12.3111 88.6963 12.434 89.2394 12.4272C91.3836 12.4272 93 10.7627 93 8.55495C93 6.34723 91.3836 4.68276 89.2394 4.68276ZM91.5608 8.84202C91.5057 9.41605 91.2512 9.95356 90.8406 10.3633C90.4299 10.773 89.8883 11.0296 89.3078 11.0896C88.5363 11.1669 87.8177 10.9461 87.2841 10.4692C86.7505 9.99222 86.4566 9.3106 86.4566 8.55495C86.4566 7.10159 87.5538 6.00546 89.0087 6.00546C89.7619 6.00546 90.4421 6.29124 90.9171 6.81002C91.407 7.34232 91.6357 8.06385 91.5608 8.84202Z",fill:"currentColor"}),S("path",{d:"M109.95 4.85407V6.06349C109.298 5.18298 108.292 4.68286 107.153 4.68286C105.017 4.68286 103.406 6.31709 103.406 8.48426C103.406 10.6514 105.017 12.285 107.153 12.285C108.296 12.285 109.303 11.79 109.95 10.9185V11.1046C109.95 12.6101 108.993 13.5826 107.513 13.5826C106.513 13.5826 105.68 13.1494 105.284 12.424L105.264 12.3867H103.838L103.871 12.48C104.112 13.1892 104.583 13.8001 105.211 14.2179C105.841 14.6324 106.637 14.8512 107.513 14.8512C108.637 14.8512 109.594 14.4972 110.28 13.8285C110.967 13.1597 111.332 12.2194 111.332 11.1213V4.85407H109.95ZM109.175 10.3502C108.588 10.905 107.752 11.138 106.879 10.9887C106.361 10.8984 105.886 10.6475 105.523 10.2725C105.16 9.89751 104.927 9.41787 104.859 8.90328C104.736 8.03757 104.999 7.21756 105.581 6.655C106.069 6.19093 106.723 5.93643 107.401 5.94699C107.565 5.94713 107.729 5.96026 107.891 5.98625C108.946 6.15489 109.781 7.01609 109.921 8.0852C110.039 8.96507 109.766 9.78958 109.175 10.3502Z",fill:"currentColor"}),S("path",{d:"M101.89 2.12378C101.63 2.06766 101.358 2.11486 101.133 2.25518C100.908 2.39551 100.747 2.61769 100.687 2.87371C100.626 3.12973 100.67 3.39902 100.809 3.62339C100.947 3.84775 101.17 4.00917 101.428 4.07275C101.503 4.08936 101.58 4.09778 101.657 4.09786C101.906 4.09824 102.146 4.0083 102.331 3.84518C102.517 3.68206 102.636 3.45714 102.664 3.21327C102.693 2.9694 102.63 2.72361 102.487 2.5227C102.344 2.32179 102.132 2.17981 101.89 2.12378Z",fill:"currentColor"}),S("path",{d:"M100.967 10.934H99.7755C98.9285 10.934 98.4196 10.3644 98.4196 9.40982C98.4196 8.4791 98.8757 7.36945 99.8054 6.01778L99.8178 5.99976V5.61807L95.8571 5.06453C95.8585 4.90331 95.8162 4.74466 95.7346 4.60501C95.653 4.46536 95.5352 4.34979 95.3932 4.27027C95.0381 4.07718 94.6498 4.07717 94.3279 4.26383C94.1667 4.35799 94.035 4.4945 93.9476 4.65816C93.8602 4.82182 93.8205 5.00623 93.8328 5.19087C93.8452 5.37552 93.9092 5.55315 94.0176 5.70402C94.1261 5.85489 94.2748 5.97309 94.4472 6.04546L93.2151 12.258H94.5833L95.7196 6.35891L97.8593 6.7155C97.284 7.73439 96.9921 8.68442 96.9921 9.53919C96.9921 11.1168 97.9577 12.1498 99.5187 12.2496V12.258H102.346V4.87723H100.967V10.934Z",fill:"currentColor"})]}),dn=({forceBrandedLogo:e,marketingUrlLink:t})=>S("div",{className:e?"yellow-footer-logo":"",children:S("a",{href:t,rel:"noreferrer",target:"_blank",children:S("div",{style:{display:"flex"},children:[S(cn,{logoOnly:!1}),e&&S(pt,{style:{display:"block",margin:"auto 0 auto 4px",transform:"rotateY(0deg) rotate(-45deg)"}})]})})}),pn=({marketingUrlLink:e})=>S("a",{dir:"ltr",href:e,rel:"noreferrer",target:"_blank",children:S("div",{className:"thank-you-card-link",children:[S("div",{className:"sprig-box-logo",children:S(cn,{logoOnly:!0,style:{margin:"auto"}})}),S("div",{children:S("p",{children:["Capture insights about your own product",S(pt,{style:{display:"inline-flex",marginInlineStart:"4px",verticalAlign:"middle"}})]})})]})}),fn=({marketingUrl:e,slugName:t,surveyId:r,forceBrandedLogo:o})=>`${e}?utm_source=survey_branding&utm_medium=website&utm_campaign=${t}&utm_content=${r}${o?"&utm_term=poweredby_pill":""}`,so=()=>{var b;const{border:e,cards:t,forceBrandedLogo:r,headers:o,index:n,marketingUrl:i,showSurveyBrand:a,slugName:l,surveyId:s,viewedCardCount:c}=B(f=>({border:f.border,cards:f.cards,forceBrandedLogo:f.forceBrandedLogo,headers:f.headers,index:f.index,marketingUrl:f.marketingUrl,showSurveyBrand:f.showSurveyBrand,slugName:f.slugName,surveyId:f.surveyId,viewedCardCount:f.viewedCardCount})),d=J(null),u=t.filter(f=>f.type!=="uploading"&&f.type!=="thanks"),g=((f,x)=>{const w=new Set(["thanks","uploading"]);if(x>=f.length||x<0||w.has(f[x].type))return 0;const k=f.filter(m=>!w.has(m.type));if(x===k.length-1)return 1;const v={[k.length-1]:1,[-1]:0};for(let m=k.length-2;m>=x;m--){const A=k[m],R=(A.props.routingOptions??[]).filter(P=>typeof P=="object"&&P!==null&&"group"in P),j=Jn(m,R);if(j.length===0){v[m]=v[m+1]+1;continue}let q=0;const T=Gn(A);if(T===null)return k.length-1-x;let N=T;for(const P of j){if(N.length===0)break;const{comparator:U,target:H,value:X}=P,pe=N.filter(M=>{const re=Wn({value:M},A.type,M),E=Qr(M,A.type);return!(re&&U==="answered"||E&&U==="partial"||!re&&!E&&U==="skipped"||U==="given_up"&&Zn(M)&&M.taskStatus==="given.up"||re&&A.type==="open"&&(U==="contains"||U==="notcontains")||re&&Qn(U)&&_e[U](M,X))});if(pe.length<N.length){const M=Number.parseInt(String(H),10);if(M!==-1&&M<=m||M>=k.length)return k.length-1-x;q=Math.max(v[M]+1,q)}N=pe}N.length>0&&(q=Math.max(v[m+1]+1,q)),v[m]=q}return v[x]})(t,n),p=c+1,y=p/(p+g),h=fn({marketingUrl:i,slugName:l,surveyId:s,forceBrandedLogo:r});V(()=>{d.current&&(d.current.style.width=100*y+"%")},[y]);const _=((b=t[n])==null?void 0:b.type)==="thanks";return S("footer",{className:"ul-footer "+(o["userleap-platform"]==="link"?"ul-footer__link":""),children:_&&r?S(pn,{marketingUrlLink:h}):S(F,{children:[u.length>1&&S("div",{className:"ul-progress-bar-container ul-progress-bar-container__footer",children:S("div",{className:"ul-progress-bar-current",ref:d,style:{border:`1px solid ${e||"#000"}`}})}),a?S(dn,{forceBrandedLogo:r,marketingUrlLink:h}):null]})})},lo=()=>{const{border:e,cards:t,index:r,focusedQuestionId:o,isConversationalUI:n}=B(l=>({border:l.border,cards:l.cards,index:l.index,focusedQuestionId:l.focusedQuestionId,isConversationalUI:l.isConversationalUI})),{totalQuestions:i,fraction:a}=Y(()=>{var d;const l=t.filter(u=>u.type!=="uploading"&&u.type!=="thanks"),s=l.length;if(s<=1)return{totalQuestions:s,fraction:0};if(((d=t[r])==null?void 0:d.type)==="thanks")return{totalQuestions:s,fraction:1};let c=0;return c=n?r+1:l.findIndex(u=>u.name===o),{totalQuestions:s,fraction:c/(s+1)}},[t,r,o,n]);return i<=1?null:S("div",{className:"ul-progress-bar-container ul-progress-bar-container__header",children:S("div",{className:"ul-progress-bar-current",style:{width:100*a+"%",border:`1px solid ${e??"#000"}`}})})},uo=je(async()=>({default:(await Promise.resolve().then(()=>require("./index-DD639GNJ.cjs"))).PageCard})),co=je(()=>Promise.resolve().then(()=>require("./conversational-ui-CEmVz2Vg.cjs"))),po=()=>{const{answers:e,border:t,cards:r,close:o,configureExitOnOverlayClick:n,destroy:i,endCard:a,eventEmitFn:l,fontFamily:s,headers:c,isConversationalUI:d,experimentFlags:u,index:g,next:p,previewKey:y,productConfig:h,seen:_,showStripes:b,studyType:f,surveyId:x,surveyVisitorAttributes:w,update:k,useMobileStyling:v,viewDocument:m}=B(E=>({answers:E.answers,border:E.border,cards:E.cards,close:E.close,configureExitOnOverlayClick:E.configureExitOnOverlayClick,destroy:E.destroy,endCard:E.endCard,eventEmitFn:E.eventEmitFn,fontFamily:E.fontFamily,headers:E.headers,index:E.index,isConversationalUI:E.isConversationalUI,experimentFlags:E.experimentFlags,previewKey:E.previewKey,productConfig:E.productConfig,next:E.next,seen:E.seen,showStripes:E.showStripes,studyType:E.studyType,surveyId:E.surveyId,surveyVisitorAttributes:E.surveyVisitorAttributes,update:E.update,useMobileStyling:E.useMobileStyling,viewDocument:E.viewDocument})),A=J(null),R=J(!1),j=J(!1),q=c["userleap-platform"],T=u==null?void 0:u["sdk-new-convo-ui"],{props:N,type:P,name:U}=r[g];V(()=>{if(window.Sprig)return window.Sprig.trackHistory=E=>B.getState().trackHistory(E),()=>{window.Sprig.trackHistory=void 0}},[]),V(()=>{A.current&&(A.current.classList.contains("ul-app--visible")||A.current.classList.add("ul-app--visible"),!R.current&&l&&(R.current=!0,l(I.SprigEvent.SurveyAppeared,{name:I.SprigEvent.SurveyAppeared,"survey.id":x})))},[l,x]),V(()=>{const E=()=>{m.visibilityState==="visible"&&(_(),m.removeEventListener("visibilitychange",E))};return m.addEventListener("visibilitychange",E),E(),()=>{m.removeEventListener("visibilitychange",E)}},[_,m]);const H=he(async()=>{if(!m)return;const E=m.getElementById("conversational-ui-styles");if(!d&&E)return E.remove(),void(j.current=!1);if(d&&!E){const $=await(D=!!T,D?Promise.resolve().then(()=>require("./conversational-v2-styles-D5xNLWoE.cjs")):Promise.resolve().then(()=>require("./conversational-styles-CWaKMg_f.cjs")));I.setSurveyStyles({document:m,elementId:"conversational-ui-styles",styleString:$.default}),requestAnimationFrame(()=>{k()}),j.current=!0}var D},[m,d,k]);V(()=>{n(()=>o())},[o,n]),V(()=>{H()},[H,m]);const X=Y(()=>I.groupCards(r,g),[r,g]),pe=Ye(r,w),M=he(E=>{p({data:E,completeSurvey:()=>i(I.APP_ID),endCard:a}),I.resetScrollPosition(m)},[p,i,a,m]);if(e){for(const E of e)if(E.questionId===U){let D;if(P==="multiplechoice"){const $=N.options.find(({value:Le})=>Le===E.value);if(!$)break;D={[$.id]:$.value}}else D=E.value;M({value:D,type:P,questionId:E.questionId});break}}const re=!v&&((h==null?void 0:h.framePosition)==="center"||(h==null?void 0:h.desktopDisplay)==="center-modal"||((h==null?void 0:h.placement)||"").includes("center"));return S("div",{className:Ce("ul-app",I.shouldDirectEmbed(c)?"ul-app--visible":"ul-app--overlay"),dir:"auto",id:I.APP_ID,onClick:E=>{var ft;const D=window.sprigAPI,$=E.target;if(!D||!$)return;const Le=[$,$.parentElement];for(const ye of Le)if(((ft=ye==null?void 0:ye.tagName)==null?void 0:ft.toLowerCase())==="a"){E.preventDefault();try{const fe=new URL(ye.href);fe.protocol!=="http:"&&fe.protocol!=="https:"||(D==null||D.openUrl(fe.toString()))}catch(fe){console.error(fe)}return}},ref:A,style:{"--theme":t,...s?{fontFamily:s.replace(";","")}:{},...re?{position:"relative"}:{}},children:S("div",{className:"ul-app__container",children:S("div",{className:Ce(un("ul-card__container",v,f)),style:{...f!=="feedbackButton"||(h==null?void 0:h.desktopDisplay)==="center-modal"?{borderColor:t}:{},...(h==null?void 0:h.desktopDisplay)==="slider"?{margin:"0px"}:{}},children:[S("div",{className:"sprig-container",children:[b&&S("div",{className:"ul-header__container",dir:"ltr",children:S("div",{className:"ul-header",children:"For development purposes only"})}),y&&S("div",{className:"ul-header__container",dir:"ltr",children:S("div",{className:"ul-header",children:"Preview Mode: Response will not be recorded."})}),I.isLongFormSurvey(f)&&S(lo,{}),S("div",{className:Ce(ao("ul-card-main-content",q)),children:S(ae,d?{fallback:null,children:S(co,{cards:r,next:M,previousResponses:pe})}:{fallback:null,children:S(uo,{cards:X,next:M,previousResponses:pe})})}),!I.isLongFormSurvey(f)&&S(so,{})]}),!d&&S(no,{})]})})})},mn=()=>MediaRecorder.isTypeSupported("video/webm")?"video/webm":"video/mp4",rr=e=>{const t={audioBitsPerSecond:128e3,videoBitsPerSecond:25e5,mimeType:mn()};return new MediaRecorder(e,t)},nr=(e,t,r)=>{r[t]=[],e.ondataavailable=function(o){r[t].push(o.data)},e.currentMediaRecordingUid=t,e.start()};function or(e,t,r,o,n,i){if(e&&e.state!=="inactive"){const{"begin.callback":a}=o,l=e.currentMediaRecordingUid;if(!l)return;a&&a(l),e.onstop=()=>async function(s,c,d,u,g,p,y){const h=B.getState().viewDocument,{"upload.callback":_,"progress.callback":b}=u,f={mediaType:d,updatedAt:new Date().toISOString(),mediaRecordingUid:g,...u["passthrough.data"]},x=await(async(m,A)=>{var j;const R=await fetch(A,{method:"POST",cache:"no-cache",headers:{"Content-Type":"application/json"},body:JSON.stringify(m)});if(R.ok){const q=await R.json();return(j=q==null?void 0:q.upload)==null?void 0:j.url}return null})(f,s);if(!x)return void(_&&_(null,{message:"failed to get upload url"}));const w=new Blob(y,{type:mn()});if(!h.defaultView)return;const k=new h.defaultView.File([w],`recording video ${Date.now()}`),v=p.createUpload({endpoint:x,file:k,chunkSize:5120});v.on("error",m=>{_&&_(null,m)}),v.on("progress",m=>{b&&b(g,m)}),v.on("success",()=>{_&&_(g,!0)})}(t,0,r,o,l,n,i),e.stop()}}const fo={state:{chunks:{}},stopRecording(e){const{uploadApiEndpoint:t,avRecorder:r,screenRecorder:o,UpChunk:n}=this.state,i=this.state.avStream&&this.state.avStream.getVideoTracks().length>0?"video":"audio";this.state.chunks&&t&&n&&(r!=null&&r.currentMediaRecordingUid&&or(r,t,i,e,n,this.state.chunks[r==null?void 0:r.currentMediaRecordingUid]),o!=null&&o.currentMediaRecordingUid&&or(o,t,"screen",e,n,this.state.chunks[o==null?void 0:o.currentMediaRecordingUid]))},handleCancelledStream(e){const t=e.getVideoTracks(),r=e.getAudioTracks();let o=t.length&&t[0];o=o||r.length&&r[0],o&&o.addEventListener("ended",()=>{[this.state.avRecorder,this.state.screenRecorder].map(n=>{n&&(n.state==="recording"&&n.stop(),n.stream.getTracks().map(i=>{i.readyState==="live"&&i.stop()}))}),Object.assign(this.state,{avStream:null,captureStream:null,avRecorder:null,screenRecorder:null})})},taskDurationMillisecond(){return this.state.startTime?new Date().getTime()-this.state.startTime.getTime():0},setUpChunk(e){this.state.UpChunk=e},configure(e,t){Object.assign(this.state,t),this.state.uploadApiEndpoint=`${t.apiURL}/2/environments/integrations/upload`,this.state.chunks={},e.on("permission.status",this.permissionStatusCallback.bind(this)),e.on("av.permission",async r=>{this.avPermissionCallback(r)}),e.on("begin.recording",this.beginRecordingCallback.bind(this)),e.on("start.task",this.startTaskCallback.bind(this)),e.on("screen.permission",async r=>{this.screenPermissionCallback(r)}),e.on("finish.task",async r=>{this.finishTaskCallback(r)})},async avPermissionCallback(e){var o,n,i;const{"stream.ready":t,"permission.descriptors":r}=e;try{(o=this.state.avStream)!=null&&o.active&&(this.state.avStream.getTracks().map(a=>a.readyState==="live"&&a.stop()),((n=this.state.captureStream)==null?void 0:n.getAudioTracks().length)===1&&this.state.captureStream.removeTrack(this.state.captureStream.getAudioTracks()[0])),this.state.avStream=await navigator.mediaDevices.getUserMedia({video:r.includes("camera"),audio:!0}),((i=this.state.captureStream)==null?void 0:i.getAudioTracks().length)===0&&this.state.captureStream.addTrack(this.state.avStream.getAudioTracks()[0]),this.handleCancelledStream(this.state.avStream)}catch(a){return console.warn("Error: failed to get permissions: "+a),void(t&&t(null,null))}t&&t(this.state.avStream,this.state.captureStream)},async screenPermissionCallback(e){const{"screen.permission.requested":t,"stream.ready.callback":r}=e;t==null||t(!0);try{this.state.captureStream=await navigator.mediaDevices.getDisplayMedia({video:!0,cursor:"always",displaySurface:"browser",preferCurrentTab:!0})}catch(o){return t==null||t(!1),console.warn("Error: failed to get permissions: "+o),void(r&&r(null,null))}t==null||t(!1),this.state.avStream&&this.state.avStream.getAudioTracks().length>0&&this.state.captureStream.addTrack(this.state.avStream.getAudioTracks()[0]),this.handleCancelledStream(this.state.captureStream),r&&r(this.state.avStream||null,this.state.captureStream)},beginRecordingCallback(e){const{"recording.media.types":t,"start.recording.callback":r=()=>{}}=e;if(!t)return;const o=[];if(t.includes("video")&&this.state.avStream){this.state.avRecorder=rr(this.state.avStream);const n=I.v4();nr(this.state.avRecorder,n,this.state.chunks),o.push(n)}if(t.includes("screen")&&this.state.captureStream){this.state.screenRecorder=rr(this.state.captureStream);const n=I.v4();nr(this.state.screenRecorder,n,this.state.chunks),o.push(n)}o&&r&&r(o)},async finishTaskCallback(e){const{"current.index":t,"task.response":r,"task.complete.callback":o}=e;await this.stopRecording(e),o&&o(this.taskDurationMillisecond()),this.state.cards&&this.state.hasEndCard!==void 0&&this.lookAheadAndStopStream(t,r,this.state.cards,this.state.hasEndCard)},startTaskCallback(){this.state.startTime=new Date},permissionStatusCallback(e){var o;const{"permission.status.callback":t}=e,r=this.state.avStream;t&&t(r,!!r&&(r==null?void 0:r.getVideoTracks().length)>0,!!((o=this.state.captureStream)!=null&&o.active),this.state.captureStream)},lookAheadAndStopStream(e,t,r,o){const{avRecorder:n,screenRecorder:i}=this.state,{allResponses:a,surveyVisitorAttributes:l}=B.getState(),s=Kr({cards:r,index:e,hasEndCard:o,allResponses:a,surveyVisitorAttributes:l});s!==null&&r[s].type==="recordedtask"||[n,i].map(c=>{c&&(c.state==="recording"&&c.stop(),c.stream.getTracks().map(d=>{d.readyState==="live"&&d.stop()}))})}},Xe=Object.create(fo);Object.freeze(Xe);const mo=({mode:e=null,viewWindow:t,viewDocument:r,trackPageViewUrl:o})=>{const n=r.documentElement;let i;try{i=t.parent.location.href}catch{i=t.location.href}return{mode:e,sw:t.screen.width,sh:t.screen.height,cw:n.clientWidth,ch:n.clientHeight,p:o??i,l:t.navigator.language}};let ze=!1;const go={configure:function(e,t=!0){var v;const{answers:r,apiURL:o,endCard:n,eventEmitFn:i,fontFamilyURL:a,frame:l,previewKey:s,viewDocument:c,viewWindow:d}=e,u=I.shouldDirectEmbed(e.headers)?e.frame:c.body,g=e.UpChunk||window.UpChunk,p=I.eventEmitter,y=((m,A)=>{const R=[...m],j=new Set(["videovoice","recordedtask"]);return m.some(q=>j.has(q.type))&&R.push({name:-2,props:{routingOptions:[],displayLogic:[]},type:"uploading"}),A&&R.push({name:-1,props:{routingOptions:[],displayLogic:[]},type:"thanks"}),R})(e.cards,!!n),h=Object.fromEntries(y.map((m,A)=>[m.name,A])),_=(({quotas:m,cardIndexByName:A})=>m===void 0?[]:m.map(R=>({...R,constraintGroup:R.constraintGroup.map(j=>nn(j,A)),quotaMatched:!0})))({quotas:e.quotas,cardIndexByName:h});Xe.configure(p,{cards:y,hasEndCard:!!n,apiURL:o,UpChunk:g});const b=e.layout==="conversational",f=(({cards:m,hasEndCard:A,allResponses:R=[],surveyVisitorAttributes:j={},startingQuestionIdx:q=0})=>{var U,H;const T=m.findIndex(X=>X.type==="uploading"),N=ct(m,A,T);let P=Math.min(Math.max(0,q??0),N);for(;P<=N&&((H=(U=m[P])==null?void 0:U.props)!=null&&H.displayLogic)&&m[P].props.displayLogic.length>0;){const X=m[P].props.displayLogic||[];if(dt({displayLogic:X,allResponses:R,cards:m,surveyVisitorAttributes:j}))break;P++}return Math.min(P,N)})({cards:y,hasEndCard:!!n,allResponses:[],surveyVisitorAttributes:e.surveyVisitorAttributes??{},startingQuestionIdx:e.startingQuestionIdx}),x=e.useBranding??!0?e.border:I.DEFAULT_BORDER_COLOR;B.setState({experimentFlags:e.experimentFlags??{},addResponseGroupMeta:e.addResponseGroupMeta,apiURL:o,answers:r,avatars:e.avatars,border:x,index:f,isConversationalUI:b,cards:y,cardIndexByName:h,configureExitOnOverlayClick:e.configureExitOnOverlayClick,customMetadata:e.customMetadata,enableCspTrustedTypes:e.enableCspTrustedTypes,endCard:e.endCard,envId:e.envId,eventEmitFn:i,fontFamily:e.fontFamily,forceBrandedLogo:e.forceBrandedLogo,frame:l,headers:e.headers,hasViewedEmbed:!1,isPreview:e.previewMode,layout:e.layout,marketingUrl:"https://sprig.com",meta:mo({mode:e.mode,viewWindow:d,viewDocument:c,trackPageViewUrl:e.trackPageViewUrl}),mode:e.mode,previewKey:s,productConfig:e.productConfig,quotaEndcardText:void 0,quotaMessages:e.quotaMessages,providerPersona:e.providerPersona??void 0,quotas:_,recorder:Xe,recorderEventEmitter:p,responseGroupUid:e.responseGroupUid,showProviderPersona:e.showProviderPersona??!1,showStripes:e.showStripes,showSurveyBrand:e.showSurveyBrand,slugName:e.slugName,startingQuestionIdx:e.startingQuestionIdx,styleNonce:e.styleNonce,studyType:e.studyType,surveyId:e.surveyId,surveyVisitorAttributes:e.surveyVisitorAttributes,tabTitle:e.tabTitle,uploadingCardViewed:!1,uploadProgress:{},useMobileStyling:e.useMobileStyling,useDesktopPrototype:e.useDesktopPrototype,userId:e.userId,viewDocument:e.viewDocument,visitorAttributes:e.visitorAttributes,viewedCardCount:f});const{head:w}=c;if(I.setSurveyStyles({document:c,elementId:"sprig-style",styleString:`html,body,p,ol,ul,li,dl,dt,dd,blockquote,figure,fieldset,legend,textarea,pre,iframe,hr,h1,h2,h3,h4,h5,h6{margin:0;padding:0}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:400}button,input,select,textarea{margin:0}html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}ol,ul{padding-inline-start:1em}.ul-loading-spinner-container{font-size:1.8rem;flex-grow:1;width:100%;height:100%;display:flex;align-items:center;justify-content:center}.ul-loading-spinner{display:inline-block;position:relative;width:6rem;height:6rem}.ul-loading-spinner div{box-sizing:border-box;display:block;position:absolute;width:80%;height:80%;margin:5px;border:5px solid #152e3e;border-radius:50%;animation:lds-ring 1.2s cubic-bezier(.5,0,.5,1) infinite;border-color:#152e3e transparent transparent transparent}.ul-loading-spinner .first{animation-delay:-.45s}.ul-loading-spinner .second{animation-delay:-.3s}.ul-loading-spinner .third{animation-delay:-.15s}@keyframes lds-ring{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.fade-in-transition{animation:fadeIn .4s ease-in}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.ul-card{flex:1 1 auto;border-radius:2px;display:flex;flex-direction:column;font-size:17px;line-height:19px;text-align:start;min-width:200px;justify-content:center;animation:enable-transitions 0s .3s forwards;min-height:0}@keyframes enable-transitions{to{transition:opacity .2s ease-in-out}}.ul-focus-transitions-active .ul-card,.ul-card--with-transitions{transition:opacity .2s ease-in-out}.ul-card__container--desktop{border:2px solid var(--background-color);box-shadow:0 0 15px #00000026;margin:15px}.ul-card__container--mobile{border-width:0;box-shadow:0 0 5px #00000040;margin-top:5px}.ul-card__container--desktop_longFormSurvey,.ul-card__container--mobile_longFormSurvey{margin:0}.sprig-container{display:flex;flex-direction:column;width:100%;height:fit-content;flex:1 1 auto;min-height:0;justify-content:center}.ul-display-logic-preview-message{font-size:14px;line-height:20px;padding:24px 20px;text-align:center}.ul-card__container{background:var(--background-color);border-radius:6px;display:flex;flex-direction:column;flex-grow:1;flex:1 1 auto;font-size:17px;line-height:23px;padding:0;min-height:0;position:relative;text-align:center;word-break:normal}.ul-card__container--desktop_feedbackButton{box-shadow:unset}.ul-card-vertical__button-wrapper{flex-direction:column;align-items:center}.ul-card__button-wrapper{margin-top:4px;display:flex;gap:16px;justify-content:center;align-self:stretch}.sprig-question-footer-container{align-items:center;width:100%;height:fit-content;display:flex;flex-direction:column;padding:12px 20px 0}.long-form-question-footer-container{position:fixed;bottom:0;left:0;width:100%;display:flex;justify-content:space-between;align-items:center;overflow:visible;z-index:1000;pointer-events:none;padding:32px}@media only screen and (max-width: 700px){.long-form-question-footer-container{position:relative}}.long-form-question-footer-container--mobile{background-color:#fff;border-top:1px solid #e6e6e6;padding:16px 24px;flex:0 1}.long-form-question-footer-container-center{justify-content:center}.long-form-question-footer-container .long-form-question-footer-container-logo{width:auto;pointer-events:auto}.conversational-ui .long-form-question-footer-container-logo{position:sticky;bottom:32px;margin:16px;width:112px;padding:4px;background-color:#fff;border-radius:24px}.long-form-question-footer-container-center .long-form-question-footer-container-logo{margin-left:0}.long-form-question-footer-container .long-form-question-footer-container-actions{display:flex;gap:8px;pointer-events:auto}.long-form-question-footer-container .long-form-question-footer-container-actions .long-form-button{display:flex;justify-content:center;align-items:center;gap:8px;padding:12px;border-radius:8px;height:40px;width:40px}.long-form-question-footer-container .long-form-question-footer-container-actions .long-form-button .long-form-button-text-container{display:flex;align-items:center}.ul-rich-text-body{min-height:2em}.ul-rich-text-body,.ul-rich-text-body p{margin-top:10px;margin-bottom:10px}.ul-rich-text-body li{margin:5px 0}.ul-rich-text-body p,.ul-rich-text-body li{font-size:15px;line-height:130.35%;letter-spacing:.02em;color:var(--text-color);text-align:start;white-space:pre-line}.ul-rich-text-body:last-child,.ul-rich-text-body li:last-child{margin-bottom:15px}.ul-card-main-content__link,.ul-card-main-content__email,.ul-card-main-content__web,.ul-card-main-content__android,.ul-card-main-content__ios{display:flex;flex:1 1 auto;min-height:0;flex-direction:column;z-index:2;height:fit-content;overflow:auto;scrollbar-width:thin;scroll-behavior:smooth}.sprig-border-bottom{border-bottom:1px solid var(--border-color)}.sprig-border-top{border-top:1px solid var(--border-color)}.question-header-container{z-index:1}.sprig-header-container{padding:16px}.question-header-button-container{display:grid;grid-template-columns:97fr 3fr;align-items:center;justify-content:space-between;width:100%;height:fit-content}.ul-card--thanks-content .question-header-button-container{justify-content:center}.sprig-question-body{padding:0 20px;min-height:0;flex-shrink:1;overflow:auto;position:relative;align-self:stretch;width:100%}.sprig-stretch{align-self:stretch}.ul-question{color:var(--text-color);display:block;font-size:17px;line-height:125%;font-weight:500;cursor:default;text-align:start}.ul-question ol,.ul-question ul,.ul-caption ol,.ul-caption ul{margin-left:1em}.ul-caption{flex:1 0 auto;font-size:14px;line-height:130.35%;letter-spacing:.02em;color:var(--text-color-light);text-align:start;margin-top:4px}.ul-card__choices{margin:5px 0 0;flex:1 0}.choice--mobile{border:2px solid var(--border-color)}.choice--desktop{border:1px solid var(--border-color)}.choice{align-items:flex-start;color:var(--text-color);cursor:pointer;display:flex;justify-content:flex-start;flex-direction:column;box-sizing:border-box;border-radius:3px;margin-bottom:7px;font-size:15px;line-height:20px;padding:10px 20px 10px 15px;background-color:var(--prototype-button-background)}.choice--desktop:hover,.choice--desktop:active,.choice--mobile:active{background-color:var(--thank-you-link-background-hover)}.choice-label-container{align-items:center;display:flex;flex-direction:row;flex:0 0 fit-content;gap:15px;height:fit-content;justify-content:flex-start;width:100%}.choice-text-entry-container{width:100%;height:fit-content;flex:0 1 fit-content;overflow:hidden}.choice .choice-text-input--mobile{max-height:63px}.choice .choice-text-input--desktop{max-height:150px}.choice .choice-text-input{box-sizing:border-box;background-color:var(--background-color);border:1px solid var(--border-color);border-radius:8px;color:var(--text-color);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;min-height:20px;max-height:60px;padding:8px 12px;margin-top:8px;resize:none;width:100%;font-size:14px;line-height:20px;outline:none;border:none;overflow-wrap:break-word}.choice .choice-text-input::placeholder{color:var(--text-color-light)}.ul-thanks-check{text-align:center;margin-bottom:20px}.ul-card--thanks-content{padding:20px 0 10px}.ul-card--thanks .ul-question{padding-top:0;text-align:center}.ul-card--thanks .ul-caption{padding-top:0;text-align:center;overflow-wrap:break-word;-webkit-hyphens:auto;hyphens:auto;hyphenate-limit-lines:no-limit}.ul-card--uploading .ul-question{padding-top:15px;text-align:center}.ul-card--uploading .ul-caption{padding-top:5px;text-align:center;overflow-wrap:break-word}.select-checkbox{height:16px;width:16px;display:flex;box-sizing:border-box;background-color:"transparent";align-items:center;justify-content:center;border-radius:4px;border:1px solid var(--selection-indicator-color);flex-shrink:0}.select-radio{height:16px;width:16px;border-radius:16px;border:1px solid var(--selection-indicator-color-selected);display:flex;box-sizing:border-box;box-shadow:inset 2px 2px #0000001a;background-color:"transparent";align-items:center;justify-content:center}.footer{width:100%;margin-top:12px;font-size:12px;line-height:12px;color:var(--text-color)}[class^=CenteredSurveyLayout] .ul-header__container,[class^=QuestionConceptTestLayout] .ul-header__container,.ul-websurvey-frame .ul-card__container,.ul-websurvey-frame-mobile .ul-card__container{margin-bottom:unset}[class^=CenteredSurveyLayout] .ul-card__container,[class^=QuestionConceptTestLayout] .ul-card__container,.ul-websurvey-frame .ul-card__container,.ul-websurvey-frame-mobile .ul-card__container{align-self:center;box-shadow:unset;border-radius:unset;border:none!important;position:unset;width:100%}@media only screen and (min-height: 600px) and (width: 600px){.ul-card{position:relative;top:-20px}}.ul-vertical-centered-container{display:flex;flex-direction:column;align-items:center;align-self:stretch}.sprig-accordion{width:100%;margin-bottom:8px}.sprig-accordion-body{width:100%;overflow:hidden}.sprig-accordion-header-container{background:transparent;border:none;display:flex;flex-direction:row;align-items:center;justify-content:space-between;width:100%;cursor:pointer;margin:8px 0 0;padding:0;font-family:inherit}.sprig-header-label-container{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:8px;flex:1 1 0}.sprig-header-label{color:var(--text-color);font-size:15px;font-weight:590;line-height:21px;text-align:start;overflow:hidden}.sprig-check-background{flex:0 0 16px;height:16px;width:16px;border-radius:8px;margin-right:8px;background-color:var(--button-subtle-background);display:flex;align-items:center;justify-content:center}.sprig-check{height:9px;width:9px;margin-left:-1px}.sprig-check path{stroke:var(--text-color-light);stroke-width:1.5}.sprig-caret{height:20px;width:20px;transition-property:transform}.sprig-caret path{stroke:var(--text-color)}.ul-card-longform__submit-button-container{display:flex;justify-content:flex-end}.ul-card-longform__submit-button-container .ul-card-longform__submit-button{display:flex;flex-direction:row;align-items:center;white-space:nowrap;gap:4px;border-radius:8px;color:var(--button-secondary-text-color);cursor:pointer}.ul-card-longform__submit-button-container .ul-card-longform__submit-button:disabled{opacity:.5;cursor:not-allowed}.ul-card-list-container--longform{display:flex;flex-direction:column;gap:2rem;width:100%;align-items:center;height:auto;justify-content:center;flex:1 0 auto}.ul-card-list-container--longform:has(.ul-card-scroll-wrapper:nth-child(2)){gap:1rem;padding-block-start:40px;padding-block-end:40px}@media (max-width: 600px){.ul-websurvey-frame-mobile.long-form-survey>.ul-websurvey-sidebar-mobile{padding-top:0}.ul-card-list-container--longform .ul-card-scroll-wrapper:last-child{padding-bottom:80px}.ul-card-list-container--longform:has(.ul-card-scroll-wrapper:nth-child(2)){padding-block-start:80px;padding-block-end:40px}}.ul-card-scroll-wrapper{width:100%;max-width:100vw;position:relative;display:flex;justify-content:center;flex:1 0 auto}.ul-card-scroll-wrapper:has(.ul-card--matrix-expandable){width:100%;max-width:100%}.ul-card-scroll-wrapper:has(.ul-card--matrix-expandable-fill){max-width:600px}@media (min-width: 601px){.ul-card-scroll-wrapper:has(.ul-card--matrix-expandable:not(.ul-card--matrix-expandable-fill)){width:fit-content;max-width:min(1200px,90vw)}}.ul-card--unfocused{opacity:.3;transition:opacity .3s ease-in-out}.sprig-question-image{object-fit:contain;width:100%;margin-bottom:12px;height:auto}.sprig-conversation-ui-image{margin-bottom:0}.ul-consent-legal__name-input--mobile{border:2px solid var(--border-color)}.ul-consent-legal__name-input--desktop{border:1px solid var(--border-color)}.ul-consent-legal__name-input{background:var(--prototype-button-background);box-sizing:border-box;color:var(--text-color);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;padding:10px 20px 10px 15px;border-radius:3px;font-size:15px;line-height:20px;margin-bottom:7px;width:100%}.ul-consent-legal__name-input::placeholder{color:var(--text-color-light)}.ul-consent-legal__name-input:focus{outline:none;background:var(--background-color)}.ul-consent-legal__name-input--desktop:hover:not(:focus){background-color:var(--thank-you-link-background-hover)}.ul-card__consent-legal .choice{font-size:15px;padding:10px 15px;background-color:var(--prototype-button-background)}.ul-card__consent-legal .choice--desktop:hover,.ul-card__consent-legal .choice--desktop:active,.ul-card__consent-legal .choice--mobile:active{background-color:var(--thank-you-link-background-hover)}.ul-card--likert__numbers{align-items:center;border-radius:5px;display:flex;flex-direction:row;flex:1 0;justify-content:center}.ul-card--likert__numbers>button{padding:unset}.likert-number--mobile{border:2px solid var(--selection-border-color)}.likert-number--mobile:not(:first-child){margin-inline-start:-2px}.likert-number--desktop{border:1px solid var(--selection-border-color)}.likert-number--desktop:not(:first-child){margin-inline-start:-1px}.likert-number{align-items:center;cursor:pointer;display:flex;justify-content:center;flex:1 0;color:var(--text-color);background-color:var(--selection-background-color);font-size:18px;line-height:54px}.likert-number:first-child{border-start-start-radius:5px;border-end-start-radius:5px}.likert-number:last-child{border-start-end-radius:5px;border-end-end-radius:5px}.likert-number:active{background-color:var(--selection-background-color-hover);font-weight:500;position:relative;z-index:10}.likert-number--mobile:active{border-color:var(--text-color)}.ul-card--likert__numbers>.likert-number.likert-number--desktop:hover{background-color:var(--selection-background-color-hover);font-weight:500;border-color:var(--text-color);position:relative;z-index:10}.likert-star--mobile:not(:first-child){margin-inline-start:-2px}.likert-star--desktop:not(:first-child){margin-inline-start:-1px}.likert-star{align-items:center;cursor:pointer;display:flex;justify-content:space-between;flex:1 0;color:var(--likert-symbol-color);font-size:18px;line-height:24px;height:67px;background:unset;border:unset}.likert-smiley--mobile:not(:first-child){margin-inline-start:-2px}.likert-smiley--desktop:not(:first-child){margin-inline-start:-1px}.likert-smiley{align-items:center;cursor:pointer;display:flex;justify-content:space-between;flex:1 0;color:var(--likert-symbol-color);line-height:24px;background:unset;border:unset}.likert-smiley>svg{margin:0 auto}.likert-smiley circle:not(:first-child){fill-opacity:1}.ul-card--likert__labels{align-items:center;color:var(--text-color);display:flex;flex-direction:row;flex:1 0;font-weight:500;font-size:13px;line-height:15px;justify-content:space-between;margin:7px 0 10px}.ul-card--likert__labels>span:last-child{margin-left:auto;flex:1 1 auto;min-width:0;text-align:right}.ul-card--matrix_grid{display:grid;grid-template-columns:max-content repeat(var(--numColumns),minmax(107px,1fr));grid-template-rows:repeat(var(--numRows),min-content);margin:0 auto;row-gap:4px;width:max-content}.ul-card--matrix_grid_longform{width:100%}.ul-matrix-header-row,.ul-matrix-row{display:contents}.ul-matrix-row-options{display:grid;grid-column:2/-1;grid-template-columns:subgrid}.ul-matrix-column-label{align-items:center;display:flex;font-size:15px;justify-content:center;max-width:150px;padding:10px 12px;text-align:center}.ul-card--matrix-expandable .ul-matrix-column-label{font-size:12px;max-width:90px;padding:8px 0}.ul-card--matrix_container{margin-bottom:16px}.ul-card__matrix .ul-card--matrix_container{overflow:auto}.ul-card--matrix_question_container{display:flex;flex-direction:column}.ul-card__matrix .ul-matrix-scroll-gradient{-webkit-mask-image:linear-gradient(90deg,#000 90%,transparent);mask-image:linear-gradient(90deg,#000 90%,transparent)}.ul-card__matrix .ul-matrix-scroll-gradient:dir(rtl){-webkit-mask-image:linear-gradient(270deg,#000,90%,transparent);mask-image:linear-gradient(270deg,#000,90%,transparent)}.ul-card__matrix .ul-matrix-scroll-gradient:dir(rtl)+.ul-matrix-scroll-arrow{rotate:180deg}.ul-card__matrix .ul-matrix-scroll-arrow{align-self:flex-end;background:none;border:none;color:var(--text-color);padding:0;position:absolute;top:45%}.ul-card__matrix .ul-matrix-scroll-arrow:hover{cursor:pointer}.ul-matrix-option-wrapper{align-items:center;background:var(--matrix-header-background);display:flex;justify-content:center;padding:10px 12px}.ul-matrix-last-option{border-start-end-radius:4px;border-end-end-radius:4px}.ul-matrix-row-label{align-items:center;background:var(--matrix-header-background);border-end-start-radius:4px;border-start-start-radius:4px;display:flex;font-size:15px;left:0;right:0;max-width:200px;min-width:100px;padding:10px 12px;position:sticky}.ul-matrix-option-selected{border:6px solid var(--border);box-shadow:none}.ul-card__matrix{max-width:100%}.ul-card.ul-card--matrix-expandable{flex:0 0 auto;align-self:center;box-sizing:border-box;max-width:100%;width:fit-content}.ul-card.ul-card--matrix-expandable-fill{width:100%}.ul-card.ul-card--matrix-expandable .ul-card--matrix_container,.ul-card.ul-card--matrix-expandable .sprig-question-body{overflow:visible}.ul-card--matrix-expandable .ul-matrix-header-row,.ul-card--matrix-expandable .ul-matrix-row{display:grid;grid-column:1 / -1;grid-template-columns:subgrid}.ul-card--matrix-expandable .ul-matrix-row{background:var(--matrix-header-background);border-radius:4px}.ul-card--matrix-expandable .ul-matrix-row-label,.ul-card--matrix-expandable .ul-matrix-option-wrapper{background:transparent;border-radius:0}.ul-card--matrix-expandable .ul-matrix-option-wrapper{padding:8px 0}.ul-card--matrix-expandable .ul-card--matrix_grid{column-gap:16px;width:100%;max-width:100%;grid-template-columns:minmax(0,1fr) repeat(var(--numColumns),90px)}.ul-card--matrix-expandable-fill .ul-matrix-row-label{max-width:none;min-width:0}@media (max-width: 600px){.ul-card.ul-card--matrix-expandable{width:100%}.ul-card--matrix-expandable .ul-matrix-row-label{max-width:none;min-width:0}}@media (min-width: 601px){.ul-card--matrix-expandable:not(.ul-card--matrix-expandable-fill) .ul-card--matrix_grid{width:max-content;grid-template-columns:max-content repeat(var(--numColumns),90px)}}.select-label{cursor:pointer;flex:1;overflow-wrap:anywhere;text-align:start}.ul-card--nps__numbers{align-items:center;border-radius:5px;display:flex;flex-direction:row;flex:1 0;justify-content:center;margin:5px 0 0}.nps-number--mobile{border:2px solid var(--nps-unselected-border)}.nps-number--mobile:not(:first-child){margin-inline-start:-2px}.nps-number--desktop{border:1px solid var(--nps-unselected-border)}.nps-number--desktop:not(:first-child){margin-inline-start:-1px}.nps-number{align-items:center;cursor:pointer;display:flex;justify-content:center;flex:1 0;color:var(--text-color);background-color:var(--nps-unselected);font-size:18px;line-height:24px;height:67px;padding:unset}.nps-number:first-child{border-start-start-radius:5px;border-end-start-radius:5px}.nps-number:last-child{border-start-end-radius:5px;border-end-end-radius:5px}.nps-number:active,.nps-number--desktop:hover{background-color:var(--selection-background-color-hover);font-weight:500}.ul-card--nps__labels{align-items:center;color:var(--text-color);display:flex;flex-direction:row;flex:1 0;font-weight:500;font-size:13px;line-height:15px;justify-content:space-between;margin:7px 0 10px}.ul-card-rank__labels{font-size:14px;font-style:normal;font-weight:600;line-height:150%;text-align:left}.ul-card-rank__list{list-style-type:none;padding-inline-start:0;margin:4px 0}.ul-card-rank__option{display:flex;align-items:center;padding:8px;gap:8px;align-self:stretch;border:1px solid var(--rank-order-border);border-radius:8px;margin-bottom:4px;background:var(--background-color)}.ul-card-rank__option:last-child{margin-bottom:0}.ul-card-rank__drag-btn{display:inline-flex;align-items:center;justify-content:center;line-height:0;padding:0;width:25px;height:25px;margin-left:auto;color:var(--text-color);cursor:grab;background:transparent;border:0}.ul-card-rank__drag-btn:active,.ul-card-rank__option:active{cursor:grabbing}.ul-card-rank__option svg{display:block}.ul-card-rank__option.is-dragging{opacity:1;box-shadow:0 8px 25px #00000026,0 3px 10px #0000001a;z-index:1000;background:var(--background-color);border-color:var(--text-color);transition:none}.ul-card-rank__option.is-drop-target{background:var(--rank-order-background);border-radius:8px;border-color:var(--rank-order-border-hover)}.ul-card-rank__option.is-drop-target select,.ul-card-rank__option.is-drop-target span,.ul-card-rank__option.is-drop-target button{visibility:hidden}.ul-card-rank__option span{font-size:14px;font-weight:400;pointer-events:none}.ul-card-rank__select{appearance:none;-webkit-appearance:none;-moz-appearance:none;box-sizing:border-box;height:25px;min-height:25px;border:1px solid var(--rank-order-border);border-radius:4px;font-size:14px;line-height:1.4;padding:2px 28px 2px 8px;background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='13' viewBox='0 0 12 13' fill='none'><path d='M9.75 5L6 8.75L2.25 5' stroke='%230B2330' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");background-repeat:no-repeat;background-position:right 8px center;background-size:12px 12px;background-color:var(--background-color);cursor:pointer;pointer-events:auto;color:var(--text-color)}.ul-card-rank__select.ul-card-rank__select--placeholder{color:var(--text-color-lighter)}.ul-card-text{margin-top:2px;margin-bottom:3px;display:flex;flex-direction:column;justify-content:center;padding:0;width:100%}.ul-card-text__container{align-items:center;box-sizing:border-box;border-radius:3px;display:flex;justify-content:center;margin-bottom:12px;flex:1 0 100%}.ul-card-text__input--mobile{border:2px solid var(--border-color);max-height:63px}.ul-card-text__input--desktop{border:1px solid var(--border-color);max-height:150px}.ul-card-text__input{background:var(--prototype-button-background);box-sizing:border-box;color:var(--text-color);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;min-height:63px;overflow:auto;padding:12px;resize:none;width:100%;border-radius:3px;font-size:15px;line-height:20px;overflow-wrap:break-word}.ul-card-text__input::placeholder{color:var(--text-color-light)}.ul-card-text__input:focus{outline:none;background:var(--background-color)}.ul-card-text__input--desktop:hover:not(:focus){background-color:var(--thank-you-link-background-hover)}.ul-card-text__input__loading{background-image:linear-gradient(70deg,#e2e3e1,#f9f9f8,#e2e3e1);background-size:200% 100%;animation:shimmer 2s infinite linear}@keyframes shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}.ul-card__text-url-prompt-button{text-decoration:none;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;max-width:-webkit-fill-available}#ul-card-video__player_recorder{width:100%;width:-moz-available;width:-webkit-fill-available;width:fill-available}.ul-card-record__task{flex:1 0 auto;margin-top:2px;margin-bottom:3px;align-items:center;display:flex;flex-wrap:wrap;justify-content:center;padding:0}#ul-record-task-upload-progress,#ul-record-task-video-preview{width:100%;height:150px}.ul-permission-graphics-container{width:100%;height:150px;background-color:var(--record-task-background);text-align:center;flex-direction:column;margin-left:auto;margin-right:auto;border-radius:5px;display:flex;align-items:center;font-size:15px;color:var(--text-color-light)}.ul-av-permission-denied-paragraph{margin:auto 15px;font-size:12px}.ul-av-permission-denied-headline{font-size:14px;color:var(--text-color);text-decoration:underline;font-size:12px}.ul-permission-body{color:var(--text-color);margin:5px auto 5px 5px;line-height:135%;text-align:center}.ul-select-tab-container{width:240px;height:46px;background:var(--background-color);border-radius:5px;text-align:start;align-items:center;display:flex;padding:0 5px;margin-top:20px;margin-bottom:auto}.ul-select-tab-text{color:var(--text-color-light);margin:5px;line-height:135%;text-align:center}button.ul-task-skip-button{color:var(--text-color);background-color:var(--background-color)}#ul-task-detail-container{margin-top:0;margin-bottom:0;overflow:auto}#ul-task-detail-container.ul-rich-text-body p,#ul-task-detail-container.ul-rich-text-body li,#ul-task-detail-container.ul-rich-text-body{color:var(--text-color-light)}#ul-task-detail-container :first-child{margin-top:0}#ul-task-detail-container :last-child{margin-bottom:20px}.ul-horizontal-button-container{width:100%;display:flex;flex-direction:row}.ul-skip-button-below{margin-top:5px}.ul-horizontal-button-container-center{justify-content:center}.ul-vertical-button-container-center{display:flex;flex-direction:column;align-items:center}.ul-horizontal-button-container-left{justify-content:flex-start}.ul_recorded-task-inset-spacing{margin-top:5px;margin-bottom:24px}.ul_permission_svg_container{justify-content:center}.ul-card-text__button{background-color:var(--theme);color:#fff;border-radius:3px;border:none;cursor:pointer;font-size:15px;font-weight:500;line-height:18px;padding:10.5px 21px}.ul-card-text__button:disabled,.ul-card-text__button.sprig-button-disabled{background-color:var(--button-disabled-background);color:var(--button-disabled-text-color)}.ul-card-text__button.ul-button-inactive{background-color:transparent;color:#5d696f!important}.ul-card-text__button:disabled>svg path,.ul-card-text__button.sprig-button-disabled>svg path{stroke:var(--button-disabled-text-color)}.ul-card-skip__button{color:var(--text-color-light);background:none;border:none;font-size:15px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;cursor:pointer}.ul-card-button-group{align-items:center;display:flex;gap:15px;justify-content:center;flex-direction:column}.select-button{align-items:center;background-color:transparent;border-radius:8px;border:1px solid var(--select-border);box-shadow:0 0 0 2px var(--selection-border-color);cursor:pointer;display:flex;font-size:15px;justify-content:space-between;margin-bottom:8px;padding:4px 8px 4px 16px;width:100%;color:var(--text-color)}.select-button:hover{background-color:var(--select-background-hover)}.select-button:active{background-color:var(--selection-background-color-hover)}.select-button span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select-button.select-button-placeholder{color:var(--text-color-lighter)}.select-button svg{flex-shrink:0}.select-list{position:relative;height:fit-content;padding:4px 0;z-index:100;background-color:var(--select-background);border:1px solid var(--select-border);box-shadow:0 16px 24px #0b23300d,0 4px 12px #0b233008;border-radius:8px;overflow-y:scroll;width:100%}.select-option{align-items:center;cursor:pointer;display:flex;font-size:15px;gap:16px;line-height:20px;padding:8px 16px}.select-option:hover{background-color:var(--select-background-hover)}.ul-card--maxdiff__question-inner-container{display:grid;grid-template-columns:1fr 2.5fr 1fr;grid-template-rows:repeat(3,minmax(40px,auto));grid-gap:6px;align-items:center}@media (max-width: 600px){.ul-card-maxdiff__labels-row{column-gap:30%}}.ul-card-maxdiff__label{font-weight:600;text-align:center;margin:auto;flex:1;padding:8px;overflow:auto;overflow-wrap:break-word;-webkit-hyphens:auto;hyphens:auto}.ul-card-maxdiff__label-spacer{flex:6}.ul-card-maxdiff .ul-question{text-align:center}.ul-question a{color:var(--text-color)}.ul-card-maxdiff__option-row{display:flex;justify-content:space-between;margin-bottom:8px;padding:0 24px}.ul-card-maxdiff__option-label{flex:6;align-self:center;padding:12px;text-align:center;max-width:100%;overflow-wrap:anywhere;-webkit-hyphens:auto;hyphens:auto}.ul-card-maxdiff__option-control.smiley{display:flex;justify-content:center;align-items:center;min-width:86px;flex:1;padding:12px;border-radius:none;border:none;background:none;cursor:pointer}.ul-card-maxdiff__option-control .choice-label-container{justify-content:center}.ul-card-maxdiff p.ul-caption{text-align:center}.ul-card-maxdiff .question-header-button-container{display:flex;justify-content:center}.ul-card-maxdiff__option-selected{border-radius:100px}.ul-card-maxdiff__option-selected.good{background:var(--nps-selected-color-high)}.ul-card-maxdiff__option-selected.bad{background:var(--nps-selected-color-low)}.ul-card-maxdiff__option-btn{width:42px;height:42px;justify-content:center;align-items:center}html{--background-color: #fff;--background-color-darker: #f7f7f7;--text-color: #000;--text-color-light: #8f8f8f;--text-color-lighter: #a8a8a8;--border-color: #e6e6e6;--border-color-heavy: #ebebeb;--button-disabled-background: #f2f2f2;--button-disabled-text-color: #a8a8a8;--sprig-logo-background: #f9c600;--progress-bar-background: rgba(0, 0, 0, .1);--prototype-button-background: rgba(0, 0, 0, .01);--thank-you-link-background: rgba(0, 0, 0, .01);--thank-you-link-background-hover: rgba(0, 0, 0, .03);--selection-border-color: #c2c2c2;--selection-background-color: #f2f2f2;--selection-background-color-hover: #e6e6e6;--selection-indicator-color: #a8a8a8;--selection-indicator-color-selected: #000;--matrix-header-background: #f7f7f7;--nps-unselected: #fcfcfc;--nps-unselected-border: #e6e6e6;--nps-selected-color-low: #f44336;--nps-selected-color-high: #4caf50;--rank-order-background: #f2f2f2;--rank-order-border: #e6e6e6;--rank-order-border-hover: #d9d9d9;--rank-order-number-background: #fff;--record-task-background: #f2f2f2;--record-task-border: #e6e6e6;--record-task-border-hover: #d9d9d9;--record-task-number-background: #fff;--select-border: #e6e6e6;--select-border-hover: #d9d9d9;--select-background: #fff;--select-background-hover: #f2f2f2;--voice-video-background: #f2f2f2;--voice-video-border: #e6e6e6;--voice-video-border-hover: #d9d9d9;--voice-video-icon-color: #a8a8a8;--likert-symbol-color: transparent;--sprig-brand-color: #000000}html,body{cursor:default;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;height:100%;overflow:hidden;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;-webkit-touch-callout:none;color:var(--text-color)}b{font-weight:500}form{margin-block-end:0;margin-block-start:0}#ul-app{opacity:0;width:100%;flex-grow:2;display:flex}#ul-app.ul-app--overlay{position:absolute;bottom:0;transition:opacity .1s ease-out;transition-delay:.1s}#ul-app.ul-app--visible{opacity:1;bottom:0}.ul-app__container{width:100%;display:flex;flex-direction:column;max-height:100vh}.ul-header__container{margin-bottom:15px}.ul-header{align-items:center;background:var(--background-color);border-bottom:2px solid var(--border-color-heavy);display:flex;font-size:14px;font-weight:500;height:40px;justify-content:center;width:100%}.ul-footer{display:flex;flex-direction:column;align-items:center;justify-content:flex-end;margin-top:auto;flex-grow:0;width:100%;min-height:10px;height:fit-content;flex-shrink:0;padding-bottom:16px}.ul-footer>.yellow-footer-logo{background:#fad133;border:1px solid #f9c600;border-radius:14px;padding:6px 12px}.ul-footer>.yellow-footer-logo:hover{background:#f9c600}.ul-footer .thank-you-card-link{background:var(--thank-you-link-background);border:1px solid var(--border-color);border-radius:8px;cursor:pointer;display:inline-flex;font-size:14px;gap:12px;margin-bottom:15px;padding:12px;text-align:initial;width:280px}.ul-footer .thank-you-card-link:hover{background:var(--thank-you-link-background-hover)}.ul-footer>a{color:inherit}.ul-footer-bubble{display:inline-block;margin:0 3px;width:7px;height:7px;border-radius:3px;border:1px solid transparent}.sprig-box-logo{background:var(--sprig-logo-background);border-radius:5px;display:flex;padding:4px}.close-container{display:flex;justify-content:flex-end;width:100%;height:0}.close-btn{position:absolute;top:8px;right:8px;cursor:pointer;height:16px;width:16px;z-index:2;color:var(--text-color)}.ul-app__container{transition:opacity .3s ease-out}.ul-center-horizontally{text-align:center}.ul-progress-bar-container{width:100%;height:2px;background-color:var(--progress-bar-background);border-radius:2px}.ul-progress-bar-container__footer{max-width:250px;margin:16px 0}.ul-progress-bar-container__header{position:fixed;top:80px;max-width:unset;margin:0;z-index:3}.ul-progress-bar-current{transition:width 1s ease;width:0%;height:0;border-radius:2px}.prototype-button{align-self:stretch;background:var(--prototype-button-background);border:1.5px solid var(--border-color);border-radius:4px 0 0 4px;flex:none;flex-grow:0;height:fit-content;line-height:16.5px;margin:0 20px;padding:20px 0;font-size:14px;font-family:inherit;text-decoration:underline}.prototype-button:hover{cursor:pointer}.sprig-logo{color:var(--sprig-brand-color)}.ul-video-btn{color:var(--text-color)}`}),e.customStyles&&I.setSurveyStyles({document:c,elementId:"ul-custom-style",styleString:e.customStyles,nonce:e.styleNonce}),e.fontFamily&&a&&parent){const m=c.createElement("link");m.rel="stylesheet",m.href=a,w.appendChild(m)}const k=i||((v=l.eventEmitter)==null?void 0:v.emit);k==null||k("verify.view.version",{"view.version":"2.47.0"}),u&&t&&(ze&&Re(u),le(S(po,{}),u),ze=!0,I.eventEmitter.once(I.SprigEvent.SurveyClosed,()=>{Re(u),ze=!1}))}},ho=Object.freeze(Object.defineProperty({__proto__:null,default:go},Symbol.toStringTag,{value:"Module"}));exports.Accordion=io,exports.Arrow=pt,exports.DynamicQuestionLoadingStates=Z,exports.F=Y,exports.F$1=rt,exports.MaxDiffChoice=Wr,exports.MaxSelectModes=rn,exports.PromptActionTypeEnum=tn,exports.SprigBrandLogo=dn,exports.SvgCaret=sn,exports.SvgCheckmark=ln,exports.T=he,exports.ThankYouLink=pn,exports._=J,exports.appCardHasPropertiesWithRequired=function(e){const t=e.props;if(t===null||typeof t!="object")return!1;const r=Reflect.get(t,"properties");return typeof r=="object"&&r!==null&&"required"in r},exports.buildMarketingUrl=fn,exports.buildReadableResponseMap=Ye,exports.buildResponsesArrayForDisplayLogic=({storeAllResponses:e,cards:t,cardValues:r,cardIndexByName:o})=>{const n=e?[...e]:[];if(o===void 0)return n;for(const i of t){const a=o[i.name];if(typeof a!="number")continue;const l=r[i.name];(l==null?void 0:l.value)!==void 0&&(n[a]=Ke(i,l.value))}return n},exports.cc=Ce,exports.create=$r,exports.g=F,exports.getButtonText=e=>(e==null?void 0:e.buttonText)||"Next",exports.getClasses=un,exports.getProcessedQuestionText=e=>{var t;return Je(e)&&((t=e.props.properties)!=null&&t.questionHtml)&&typeof e.props.properties.questionHtml=="string"?e.props.properties.questionHtml.replace(/<[^>]*>/g,"").trim():e.props&&"message"in e.props&&typeof e.props.message=="string"?e.props.message.trim():e.props&&"questionHtml"in e.props&&typeof e.props.questionHtml=="string"?e.props.questionHtml.replace(/<[^>]*>/g,"").trim():""},exports.getSkipButtonText=e=>(e==null?void 0:e.skipButtonText)||"Skip",exports.h=K,exports.isLastQuestion=(e,t)=>{const r=t.findIndex(i=>i.type==="uploading"),o=t.some(i=>i.type==="thanks"),n=t.findIndex(i=>i.name===e);return n===-1?!1:n===ct(t,o,r)},exports.p=V,exports.pipeReadableResponsesIntoCards=(e,t)=>e.map(r=>{if(!Je(r)||r.props.properties===void 0||r.props.properties===null)return r;const o=r.props.properties;if(o===null||typeof o!="object"||!Bt.some(a=>a in o))return r;let n=!1;const i={};for(const a of Bt){const l=o[a];if(l!==void 0){const s=$n(l,t);i[a]=s,s!==l&&(n=!0)}}return n?{...r,props:{...r.props,properties:{...o,...i}}}:r}),exports.q=ot,exports.shouldMatrixUseAccordionDueToSize=(e,t)=>er(e)>(r=>Math.min(1200,.9*r))(t),exports.shouldMatrixUseFillLayout=(e,t)=>t>600&&er(e)<600,exports.someDisplayLogicOptionMatches=dt,exports.triggerFollowUpQuestionGeneration=({displayCard:e,response:t,createDynamicFollowupQuestion:r})=>{if(e&&((e==null?void 0:e.childId)??0)>0){const o=Ke(e,t==null?void 0:t.value),n=ce({comparator:"answered",type:e.type,response:o}),i=e.type==="matrix"&&ce({comparator:"partial",type:e.type,response:o});if(n||i){const a=Ye([e].map(l=>({...l,value:(t==null?void 0:t.value)??null,secondaryValue:(t==null?void 0:t.secondaryValue)??null})));r({parentQuestionId:e==null?void 0:e.name,parentResponseConfig:a})}}},exports.u=S,exports.useConfig=B,exports.view=ho,exports.wn=zr,exports.y=de;
|