@sprig-technologies/sprig-bundled 2.44.0 → 2.44.1

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.
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./view-AjjMeNkz.cjs"),K=require("./index-BmZLh0D5.cjs"),b=require("./getAttributedUrl-hV9sdUhw.cjs"),Ne=({className:n,message:i,next:d,properties:r,questionId:t,type:o})=>{const{useMobileStyling:m,border:f,isLongFormSurvey:c,focusedQuestionId:g}=e.useConfig(y=>({useMobileStyling:y.useMobileStyling,border:y.border,isLongFormSurvey:K.isLongFormSurvey(y.studyType),focusedQuestionId:y.focusedQuestionId})),[l,v]=e.h(!1),[u,N]=e.h(""),[a,S]=e.h(!1),p=c&&g===t,x=r==null?void 0:r.collectName,h=(r==null?void 0:r.nameLabelText)||"Full Name",w=(r==null?void 0:r.consentText)||"I agree to the stated conditions",M=(r==null?void 0:r.submitButtonText)||"Submit",F=!!u.trim(),Q=l&&(!x||F),D=(y,I=!1)=>{y.preventDefault(),y.stopPropagation();let P=null;if(!I){if(!Q)return void S(!0);P={submitted:!0},x&&(P.name=u)}d({value:P,questionId:t,type:o},Q)};return e.u("div",{className:e.cc(n,c&&!p&&"ul-card--unfocused","ul-card__consent-legal","fade-in-transition"),children:[e.u(b.Header,{isRequired:c&&(r==null?void 0:r.required),message:i,properties:{questionHtml:r.questionHtml}}),r!=null&&r.richTextBody?e.u(b.QuestionBodyWrapper,{children:e.u(b.Html,{className:"ul-rich-text-body",html:r.richTextBody,id:"ul-card__consent-legal-body-container"})}):null,e.u(b.MobileEmbedView,{embeddedType:"pdf",properties:r,children:e.u(b.QuestionBodyFooterContainer,{children:[e.u("div",{className:"sprig-stretch",children:[e.u(b.Option,{allowTextEntry:!1,border:f,error:a&&!l,id:"consent",isRadio:!1,isSelected:l,label:w,onUserInputChanged:({selected:y})=>{y!==l&&v(!l)},useMobileStyling:m}),x&&e.u("input",{"aria-label":h,"aria-placeholder":h,className:e.cc(e.getClasses("ul-consent-legal__name-input",m)),"data-gramm":"false",maxLength:250,name:"name",onBlur:y=>{y.currentTarget.style.borderColor=a&&!F?K.ERROR_BORDER_COLOR:K.DEFAULT_BORDER_COLOR},onFocus:y=>{y.currentTarget.style.borderColor=a&&!F?K.ERROR_BORDER_COLOR:f},onInput:y=>{y.preventDefault(),y.stopPropagation(),N(y.currentTarget.value)},placeholder:h,style:a&&!F?{borderColor:K.ERROR_BORDER_COLOR}:{},tabIndex:0,value:u})]}),e.u("div",{className:"ul-card__button-wrapper ul-card-vertical__button-wrapper",children:[e.u(b.Button,{className:Q?"":"sprig-button-disabled",onClick:D,children:M}),r.required===!1&&!c&&e.u("button",{className:"ul-card-skip__button",onClick:y=>D(y,!0),children:e.getSkipButtonText(r)})]})]})})]},t)},se=n=>i=>{i.pointerType!=="touch"&&n()},Le=({activeValue:n,border:i,icon:d,isPressed:r,onSubmit:t,range:o,scaleLabelType:m,selectedValue:f,setSelectedValue:c,setActiveValue:g,setIsPressed:l,useMobileStyling:v,value:u,viewDocument:N})=>{const{isLongFormSurvey:a,enableCspTrustedTypes:S}=e.useConfig(I=>({isLongFormSurvey:K.isLongFormSurvey(I.studyType),enableCspTrustedTypes:I.enableCspTrustedTypes})),p=`option-${u}`,x=m==="number",h=m==="star",w=m==="smiley",M=x&&u===n||u===f,[F,Q]=(()=>{const I=h&&f!==null&&u<=f;return h&&u<=n||w&&u===n||I||u===n||u===f?[i,r||I||u===f?1:.3]:["",1]})(),D=e.F(()=>{const I=f===u,P={borderColor:M&&!v||I?F:"",fillOpacity:M?"":Q,zIndex:M?3:"auto",color:I?"#fff":""};return x?{...P,backgroundColor:I?F:""}:{...P,color:h||w||I?F:""}},[M,F,Q,f,u,x,h,w,v]),y=e.F(()=>K.getHtml((({icon:I,scaleLabelType:P,value:R,selectedValue:E})=>{if(P==="smiley"&&R===E){let _=0;return I.replace(/black/g,()=>++_==1?"black":"white")}return I})({icon:d,scaleLabelType:m,value:u,selectedValue:f}),S),[S,d,m,f,u]);return e.u("button",{"aria-label":x?void 0:String(u),className:(()=>{switch(m){case"star":return e.cc(e.getClasses("likert-star",v),e.getClasses(`likert-star-${u}`,v));case"smiley":return e.cc(e.getClasses("likert-smiley",v),e.getClasses(`likert-smiley-${u}`,v));default:return u===o?e.cc(e.getClasses("likert-number",v),e.getClasses(`likert-number-${u}`,v),e.getClasses("likert-last-option",v)):e.cc(e.getClasses("likert-number",v),e.getClasses(`likert-number-${u}`,v))}})(),dangerouslySetInnerHTML:{__html:y},id:p,onClick:I=>{a&&(I.preventDefault(),I.stopPropagation(),c(u)),t()},onKeyDown:I=>{var E,_;const P=N.querySelectorAll(`.likert-${m??"number"}`),R=u-1;I.key==="ArrowRight"?(E=P[R+1])==null||E.focus():I.key==="ArrowLeft"?(_=P[R-1])==null||_.focus():I.key!=="Enter"&&I.key!==" "||(a&&(I.preventDefault(),I.stopPropagation(),c(u)),t())},onPointerCancel:se(()=>l(!1)),onPointerDown:se(()=>{l(!0),g(u)}),onPointerEnter:se(()=>g(u)),onPointerLeave:se(()=>{g(-1),l(!1)}),onPointerUp:se(()=>l(!1)),style:D,tabIndex:0})},qe=({className:n,labels:i,message:d,next:r,properties:t,questionId:o,type:m})=>{const{border:f,useMobileStyling:c,viewDocument:g,isLongFormSurvey:l,focusedQuestionId:v}=e.useConfig(R=>({border:R.border,useMobileStyling:R.useMobileStyling,viewDocument:R.viewDocument,isLongFormSurvey:K.isLongFormSurvey(R.studyType),focusedQuestionId:R.focusedQuestionId})),[u,N]=e.h(-1),[a,S]=e.h(!1),[p,x]=e.h(null);e.p(()=>{N(-1),S(!1),x(null)},[o]);const h=l&&v===o,w=i&&i.left,M=i&&i.right;let F;const{range:Q,scaleLabelType:D,ratingIcons:y}=t;Q&&(F=Number(Q));const I=F||5,P=R=>{var E,_;switch(D){case"star":return(E=y[0])==null?void 0:E.svg;case"smiley":return(_=y[R])==null?void 0:_.svg;default:return String(R+1)}};return e.u("form",{className:e.cc(n,"ul-card--likert","fade-in-transition",l&&!h&&"ul-card--unfocused"),children:[e.u(b.Header,{isRequired:l&&(t==null?void 0:t.required),message:d,properties:t}),e.u(b.MobileEmbedView,{properties:t,children:e.u(e.g,{children:[e.u(b.QuestionBodyWrapper,{children:[e.u("div",{"aria-label":`Rating (1 - ${I})`,className:"ul-card--likert__numbers",role:"radiogroup",children:[...Array(I)].map((R,E)=>{const _=E+1;return e.u(Le,{activeValue:u,border:f,icon:P(E),isPressed:a,onSubmit:()=>r({value:_,questionId:o,type:m},!0),range:I,scaleLabelType:D,selectedValue:p,setActiveValue:N,setIsPressed:S,setSelectedValue:x,useMobileStyling:c,value:_,viewDocument:g},E)})}),e.u("div",{className:"ul-card--likert__labels",children:[e.u("span",{children:w}),e.u("span",{children:M})]})]}),!t.required&&!l&&e.u(b.QuestionBodyFooterContainer,{children:e.u("div",{className:"ul-vertical-centered-container",children:e.u(b.Button,{onClick:R=>{R.preventDefault(),R.stopPropagation(),r({value:null,questionId:o,type:m},!0)},children:e.getButtonText(t)})})})]})})]},o)},Re=({columns:n,onSelect:i,options:d,selectedOptions:r})=>{const t=e._([]),{border:o,useMobileStyling:m,cards:f,index:c}=e.useConfig(a=>({border:a.border,useMobileStyling:a.useMobileStyling,cards:a.cards,index:a.index})),g=d.findIndex(a=>r[a.id]===null),[l,v]=e.h(g),u=e.T((a,S)=>{var h;i(a,S);const p=l+1,x=d[p];if(x&&r[x.id]===null){v(p);const w=f[c];(w==null?void 0:w.groupId)!=null||((h=t.current[p])==null||h.scrollIntoView({block:"nearest",behavior:"smooth"}))}},[i,d,r,l,f,c]),N=e.T((a,S)=>{const p=l===a;return e.u(e.Accordion,{animate:!0,header:S.label,isOpen:p,onClick:()=>{var x;return v(p&&!((x=window.UserLeap)!=null&&x.isMobileSDK)?-1:a)},ref:x=>{x&&(t.current[a]=x)},showHeaderCheck:r[S.id]!==null,children:e.u("div",{style:{paddingTop:"12px"},children:n.map(x=>e.u(b.Option,{allowTextEntry:!1,ariaLabel:`${S.label}-${x.label}`,border:o,error:!1,id:`${S.id}-${x.value}`,isRadio:!0,isSelected:r[S.id]===x.value,label:x.label,onUserInputChanged:()=>u(S.id,x.value),useMobileStyling:m},x.label))})},S.id)},[o,n,l,u,r,m]);return e.u("div",{children:d.map((a,S)=>N(S,a))})},Be=({columns:n,onSelect:i,options:d,selectedOptions:r})=>{const{border:t,useMobileStyling:o,isLongFormSurvey:m}=e.useConfig(a=>({border:a.border,useMobileStyling:a.useMobileStyling,isLongFormSurvey:K.isLongFormSurvey(a.studyType)})),f=d.length,c=n.length,g=e._(null),[l,v]=e.h(!1),[u,N]=e.h(!1);return e.p(()=>{const a=g.current,S=new ResizeObserver(p=>{window.requestAnimationFrame(()=>{a&&(v(Math.round(p[0].contentRect.width)<a.scrollWidth),N(Math.round(p[0].contentRect.width)<a.scrollWidth))})});return a&&S.observe(a),()=>{a&&S.unobserve(a)}},[]),e.u("div",{className:"ul-card--matrix_question_container",children:[e.u("div",{className:e.cc("ul-card--matrix_container",l&&"ul-matrix-scroll-gradient"),onScroll:()=>{(()=>{const a=g.current;a&&v(a.clientWidth+Math.abs(a.scrollLeft)<a.scrollWidth)})()},ref:g,children:e.u("div",{className:e.cc(m&&"ul-card--matrix_grid_longform","ul-card--matrix_grid"),style:`--numColumns: ${c}; --numRows: ${f+1};`,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(e.g,{children:[e.u("div",{"aria-label":a.label,className:"ul-matrix-row-label",children:a.label},a.label),e.u("div",{className:"ul-matrix-row-options",role:"radiogroup",children:n.map((S,p)=>{const x=p===c-1;return e.u("div",{className:e.cc("ul-matrix-option-wrapper",x&&"ul-matrix-last-option"),children:e.u(b.Option,{allowTextEntry:!1,ariaLabel:`${a.label}-${S.label}`,border:t,choiceStyle:{background:"transparent",border:"none",marginBottom:"0",padding:"0"},error:!1,id:`${a.id}-${S.value}`,isRadio:!0,isSelected:r[a.id]===S.value,onUserInputChanged:()=>i(a.id,S.value),useMobileStyling:o})},S.value)})})]}))]})}),(l||u)&&e.u("button",{className:u&&!l?"ul-matrix-scroll-arrow left":"ul-matrix-scroll-arrow",onClick:u&&!l?a=>{a.preventDefault();const S=g.current;if(S){const p=getComputedStyle(S).direction==="rtl";S.scrollTo({left:p?S.scrollWidth-S.clientWidth:0,behavior:"smooth"})}}:a=>{a.preventDefault();const S=g.current;if(S){const p=getComputedStyle(S).direction==="rtl";S.scrollTo({left:p?S.clientWidth-S.scrollWidth:S.scrollWidth,behavior:"smooth"})}},children:u&&!l?e.u(Me,{}):e.u(De,{})})]})},Me=()=>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"})}),De=()=>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"})}),Pe=({className:n,message:i,next:d,options:r,properties:t,questionId:o,type:m,showIndividualSubmit:f=!1,onSubmitButtonClick:c})=>{const{useMobileStyling:g,isLongFormSurvey:l,focusedQuestionId:v,setFocusedQuestionId:u}=e.useConfig(D=>({useMobileStyling:D.useMobileStyling,isLongFormSurvey:K.isLongFormSurvey(D.studyType),focusedQuestionId:D.focusedQuestionId,setFocusedQuestionId:D.setFocusedQuestionId})),N=t.matrixColumn,a=t.required,S=l&&v===o,p=D=>{D.preventDefault(),D.stopPropagation(),d({value:h,questionId:o,type:m},!0),c&&c()},x=r.reduce((D,y)=>(D[y.id]=null,D),{}),[h,w]=e.h(x),M=D=>a&&Object.values(D).every(y=>y==null),F=(D,y)=>{l&&d({value:{...h,[D]:y},questionId:o,type:m},!M({...h,[D]:y})),w(I=>({...I,[D]:y}))},Q=t.displayMatrixAsAccordion||g;return e.u("form",{className:e.cc(n,!l&&"ul-card__matrix","fade-in-transition",l&&!S&&"ul-card--unfocused"),id:"text-form",onClick:()=>{S&&u(o)},onSubmit:p,children:[e.u(b.Header,{isRequired:l&&(t==null?void 0:t.required),message:i,properties:t}),e.u(b.MobileEmbedView,{properties:t,children:[e.u(b.QuestionBodyWrapper,{children:[Q?e.u(Re,{columns:N,onSelect:F,options:r,selectedOptions:h}):e.u(Be,{columns:N,onSelect:F,options:r,selectedOptions:h}),f&&e.u(b.LongformSubmitButton,{handleSubmit:p,isSubmitDisabled:M(h)})]}),!l&&e.u(b.QuestionBodyFooterContainer,{children:e.u("div",{className:"ul-card__button-wrapper",children:e.u(b.Button,{disabled:M(h),children:e.getButtonText(t)})})})]})]},o)},fe=({className:n,message:i,onSubmit:d,options:r=[],properties:t,questionId:o,type:m,showIndividualSubmit:f=!1,onSubmitButtonClick:c})=>{const{border:g,useMobileStyling:l,isLongFormSurvey:v,focusedQuestionId:u,setFocusedQuestionId:N}=e.useConfig(k=>({border:k.border,useMobileStyling:k.useMobileStyling,isLongFormSurvey:K.isLongFormSurvey(k.studyType),focusedQuestionId:k.focusedQuestionId,setFocusedQuestionId:k.setFocusedQuestionId})),a=v&&u===o,S=r.reduce((k,L)=>(k[L.id]={isSelected:!1},k),{}),[p,x]=e.h(S),h=m==="multiplechoice",w=t.required,M=r.find(k=>{var L;return(L=k.optionProperties)==null?void 0:L.noneOfTheAbove}),F=k=>Object.entries(k).some(([L,j])=>{var J;const z=r.find(s=>`${s.id}`===L),V=j.userText===void 0||j.userText.trim()==="";return((J=z==null?void 0:z.optionProperties)==null?void 0:J.allowsTextEntry)&&V&&j.isSelected}),Q=k=>Object.values(k).filter(L=>L.isSelected).length,D=t.minSelect&&t.minSelect>0&&t.maxSelectMode===e.MaxSelectModes.Range&&Q(p)<t.minSelect&&(w||Q(p)>0),y=k=>F(k)||w&&!Q(k)||!(L=>{const{minSelect:j=0,maxSelect:z=1/0,maxSelectMode:V}=t,J=Q(L);switch(V){case e.MaxSelectModes.Maximum:return J<=z;case e.MaxSelectModes.Range:return J===0||J>=j;default:return!0}})(k),I=Object.entries(p).some(([k,L])=>{var j,z;return L.isSelected&&((z=(j=r.find(V=>`${V.id}`===k))==null?void 0:j.optionProperties)==null?void 0:z.allowsTextEntry)}),P=f&&(!h||I),R=k=>{W(k.id,k.selected,k.userText,k.noneOfTheAbove),k.selected&&v&&!h&&!a&&N(o)},E=k=>{var L;return(t==null?void 0:t.maxSelectMode)!==e.MaxSelectModes.Unlimited&&Q(p)===(t==null?void 0:t.maxSelect)&&!((L=p[k])!=null&&L.isSelected)},_=k=>{k.preventDefault(),k.stopPropagation(),d(p,!0),c&&c()},W=(k,L,j,z)=>{const V=Object.assign({},p);if((h||z)&&L)for(const C of Object.values(V))C.isSelected=!1,delete C.userText;else M&&!z&&p[M.id].isSelected&&(V[M.id].isSelected=!1);V[k]={isSelected:L,userText:j};const J=h&&Object.entries(V).some(([C,q])=>{var O,A;return q.isSelected&&((A=(O=r.find(Z=>`${Z.id}`===C))==null?void 0:O.optionProperties)==null?void 0:A.allowsTextEntry)}),s=!y(V);v&&(d(V,s),h&&!J&&s&&c&&c()),x(V)};return e.u("form",{className:e.cc(n,"ul-card--multiple","fade-in-transition",v&&!a&&"ul-card--unfocused"),id:"text-form",onClick:m==="multipleselect"?()=>{v&&u!==o&&m==="multipleselect"&&N(o)}:void 0,onSubmit:_,children:[e.u(b.Header,{isRequired:v&&(t==null?void 0:t.required),message:i,properties:t}),e.u(b.MobileEmbedView,{properties:t,children:e.u(e.g,{children:[e.u(b.QuestionBodyWrapper,{children:[t.isDropdown?e.u(b.Select,{disabledOptions:r.filter(k=>E(k.id)),dropdownFooter:D?e.u("div",{className:"ul-card__min-select-counter",style:{marginLeft:"16px"},children:[Q(p),"/",t.minSelect]}):void 0,isMultiSelect:!h,multiselectText:t.dropdownMultiselectedText??"choices selected",onChange:k=>{const L={...p};for(const j of r)k.includes(j)?L[j.id].isSelected=!0:L[j.id].isSelected=!1;v&&d(L,!y(L)),x(L)},options:r,placeholderText:t.dropdownPlaceholderText??(h?"Select choice":"Select choice(s)"),value:r.filter(k=>p[k.id].isSelected)}):e.u("div",{className:e.cc(e.getClasses("ul-card__choices",l)),role:h?"radiogroup":"group",children:[r.map(({id:k,label:L,value:j,optionProperties:z})=>{var q,O;const V=`${k}`,{allowsTextEntry:J,noneOfTheAbove:s}={allowsTextEntry:!1,noneOfTheAbove:!1,...z};return e.u(b.Option,{allowTextEntry:J,border:g,disabled:E(V),error:(C=p,F(C)),id:V,isRadio:h,isSelected:!!((q=p[V])!=null&&q.isSelected),label:L,noneOfTheAbove:s,onUserInputChanged:R,promptText:(z==null?void 0:z.otherOptionPlaceholder)||"Please specify",text:(O=p[k])==null?void 0:O.userText,useMobileStyling:l,value:j},V);var C}),!!D&&e.u("div",{className:"ul-card__min-select-counter",children:[Q(p),"/",t.minSelect]})]}),P&&e.u(b.LongformSubmitButton,{handleSubmit:_,isSubmitDisabled:y(p)})]}),!v&&e.u(b.QuestionBodyFooterContainer,{children:e.u("div",{className:"ul-card__button-wrapper",children:e.u(b.Button,{disabled:y(p),onClick:_,children:e.getButtonText(t)})})})]})})]},o)},Fe=n=>{const{questionId:i,type:d,next:r,options:t}=n,{setFocusedQuestionId:o}=e.useConfig(m=>({setFocusedQuestionId:m.setFocusedQuestionId}));return e.u(fe,{...n,onSubmit:(m,f)=>{var N;const c=Object.entries(m).find(([,a])=>a.isSelected)||[void 0,void 0],[g,l]=c,v=t.find(a=>`${a.id}`===g);!((N=v==null?void 0:v.optionProperties)!=null&&N.allowsTextEntry)||l!=null&&l.userText&&l.userText.trim()!==""||o(i);const u=l!=null&&l.userText?{[g]:{userText:l.userText}}:null;r({value:v&&g?{[g]:v.value}:{},secondaryValue:u,questionId:i,type:d},f)}})},Qe=n=>{const{questionId:i,type:d,next:r}=n;return e.u(fe,{...n,onSubmit:(t,o)=>{const m=Object.entries(t).reduce((c,[g,l])=>(c[g]=l.isSelected,c),{}),f=Object.entries(t).reduce((c,[g,l])=>{if(!l.userText)return c;const v=c||{};return v[g]={userText:l.userText},v},null);r({value:m,secondaryValue:f,questionId:i,type:d},o)}})},Ee=({className:n,labels:i,message:d,properties:r,next:t,questionId:o,type:m})=>{const[f,c]=e.h(null),{border:g,useMobileStyling:l,viewDocument:v,isLongFormSurvey:u,focusedQuestionId:N}=e.useConfig(x=>({border:x.border,useMobileStyling:x.useMobileStyling,viewDocument:x.viewDocument,isLongFormSurvey:K.isLongFormSurvey(x.studyType),focusedQuestionId:x.focusedQuestionId})),a=u&&N===o,S=i&&i.left,p=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(b.Header,{isRequired:u&&(r==null?void 0:r.required),message:d,properties:r}),e.u(b.MobileEmbedView,{properties:r,children:[e.u(b.QuestionBodyWrapper,{children:[e.u("div",{className:"ul-card--nps__numbers",children:[...Array(11)].map((x,h)=>e.u("button",{className:e.cc(e.getClasses("nps-number",l),e.getClasses(`nps-number-${h}`,l)),id:`option-${h}`,onClick:w=>{u&&(w.preventDefault(),w.stopPropagation(),c(h)),t({value:h,questionId:o,type:m},!0)},onKeyDown:w=>{var F,Q;const M=v.querySelectorAll("button.nps-number");w.key==="ArrowRight"?(F=M[h+1])==null||F.focus():w.key==="ArrowLeft"?(Q=M[h-1])==null||Q.focus():w.key!=="Enter"&&w.key!==" "||(u&&(w.preventDefault(),w.stopPropagation(),c(h)),t({value:h,questionId:o,type:m},!0))},onPointerDown:w=>{w.currentTarget.style.zIndex="2",w.currentTarget.style.borderColor=g},onPointerLeave:w=>{w.currentTarget.style.zIndex="auto",w.currentTarget.style.borderColor=K.DEFAULT_BORDER_COLOR},style:f===h?{backgroundColor:g,color:"#fff"}:void 0,tabIndex:0,children:h},h))}),e.u("div",{className:"ul-card--nps__labels",children:[e.u("span",{children:S}),e.u("span",{children:p})]})]}),!r.required&&!u&&e.u(b.QuestionBodyFooterContainer,{children:e.u("div",{className:"ul-vertical-centered-container",children:e.u(b.Button,{onClick:x=>{x.preventDefault(),x.stopPropagation(),t({value:null,questionId:o,type:m},!0)},children:e.getButtonText(r)})})})]})]},o)},Oe=n=>{const{className:i,message:d,next:r,properties:t,questionId:o,type:m,showIndividualSubmit:f=!1,onSubmitButtonClick:c}=n,g=m==="aidynamicfollowup"||m==="aidynamicstandalone",l=g?n.loading:void 0,{border:v,useMobileStyling:u,update:N,isLongFormSurvey:a,focusedQuestionId:S,setFocusedQuestionId:p,isPreview:x}=e.useConfig(_=>({border:_.border,useMobileStyling:_.useMobileStyling,update:_.update,isLongFormSurvey:K.isLongFormSurvey(_.studyType),focusedQuestionId:_.focusedQuestionId,setFocusedQuestionId:_.setFocusedQuestionId,isPreview:_.isPreview})),[h,w]=e.h(""),M=e._(null),F=a&&S===o;e.p(()=>{var _,W;a&&!x&&(F?(_=M.current)==null||_.focus():(W=M.current)==null||W.blur())},[a,F,x]);const Q=h.trim(),D=t.required===!0&&!Q,y=b.useAutoSize(M,()=>N()),I=_=>{_.preventDefault(),_.stopPropagation();const W=Q.length>0,k=!t.required||W;r({value:h,questionId:o,type:m},k),c&&c(W)},P=t&&t.openTextPlaceholder?t.openTextPlaceholder:"";if((l===e.DynamicQuestionLoadingStates.failure||l===void 0)&&g)return e.u(e.g,{});const R=l===e.DynamicQuestionLoadingStates.inFlight,E=R?"Preparing your next question":d;return e.u("form",{className:e.cc(i,"ul-card-text","fade-in-transition",a&&!F&&"ul-card--unfocused"),id:"text-form",onClick:()=>{a&&S!==o&&p(o)},children:[e.u(b.Header,{isRequired:a&&(t==null?void 0:t.required),message:E,properties:t}),e.u(b.MobileEmbedView,{properties:t,children:e.u("div",{className:"ul-card-text",children:e.u(b.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":P,className:e.cc(R&&"ul-card-text__input__loading",e.getClasses("ul-card-text__input",u)),"data-gramm":"false",disabled:R,maxLength:5e3,name:"text",onBlur:_=>{_.currentTarget.style.borderColor=K.DEFAULT_BORDER_COLOR},onChange:_=>{const{value:W}=_.currentTarget;if(y(),_.preventDefault(),_.stopPropagation(),w(W),a){const k=W.trim().length>0;r({value:W,questionId:o,type:m},k)}},onFocus:_=>{_.currentTarget.style.borderColor=v,p(o)},placeholder:P,ref:M,role:"textbox",tabIndex:0})}),t.footerHtml&&e.u(b.Html,{className:"footer",html:t.footerHtml}),f&&e.u(b.LongformSubmitButton,{handleSubmit:I,isSubmitDisabled:D}),e.u(b.QuestionBodyFooterContainer,{children:!a&&e.u(b.Button,{disabled:D||R,onClick:I,children:e.getButtonText(t)})})]})})})]},o)},ue=1,Se=2,xe=3,oe=n=>n.type==="av_permission",he=n=>n.type==="screen_permission",Ce=(n,i)=>n===void 0?ue:n?((d,r)=>!(oe(r)?r.permissionDescriptors:[]).includes("camera")||d.getVideoTracks().length>0)(n,i)?xe:ue:Se,be={avStream:null,currentPage:null,mediaRecordingUids:null,nextQuestion:()=>{},passthroughData:void 0,recordingMediaTypes:void 0,screenPermissionRequested:!1,type:void 0},te=e.create(n=>({...be,reset:()=>{n(be)},updatePage:i=>{n(i)}}));function de({currentPage:n,pages:i}){const{avStream:d,recordingMediaTypes:r,updatePage:t}=te.getState(),{recorderEventEmitter:o}=e.useConfig.getState();o.emit("av.permission",{"permission.descriptors":n.permissionDescriptors,"stream.ready":(m,f)=>{if(d===m)return;let c=n;if(m&&!n.permissionDescriptors.includes("camera")){const g=i.indexOf(n),l=f!=null&&f.active?g+2:g+1;f!=null&&f.active&&r&&o.emit("begin.recording",{"recording.media.types":r,"start.recording.callback":v=>t({mediaRecordingUids:v})}),c=i[l]}t({currentPage:c,avStream:m})}})}function ce({status:n}){const{nextQuestion:i,passthroughData:d,mediaRecordingUids:r,reset:t}=te.getState(),{recorderEventEmitter:o,handleUploadUpdate:m,index:f}=e.useConfig.getState(),c={value:{taskStatus:n},type:"recordedtask",questionId:(d==null?void 0:d.questionId)||1};d&&o.emit("finish.task",{"begin.callback":g=>{m({mediaRecordingUid:g,isSubmitted:!0,progressPct:0,isComplete:!1})},"progress.callback":(g,l)=>{m({mediaRecordingUid:g,progressPct:l.detail,isSubmitted:!1,isComplete:!1})},"upload.callback":g=>{g&&m({mediaRecordingUid:g,isComplete:!0,isSubmitted:!0,progressPct:100})},"passthrough.data":d,"current.index":f,"task.response":c,"task.complete.callback":g=>{c.value.taskDurationMillisecond=g,r&&(c.value.mediaRecordingUids=r),t(),i(c)}})}function pe({pages:n,setIsRequestingPermission:i}){const{recorderEventEmitter:d,eventEmitFn:r}=e.useConfig.getState(),{updatePage:t,currentPage:o,recordingMediaTypes:m,screenPermissionRequested:f}=te.getState();if(!o)return;const c=n.indexOf(o);switch(o.type){case"av_permission":{const g=f?c+2:c+1;return f&&m&&d.emit("begin.recording",{"recording.media.types":m,"start.recording.callback":l=>{t({mediaRecordingUids:l})}}),void t({currentPage:n[g]})}case"screen_permission":return void d.emit("screen.permission",{"screen.permission.requested":i,"stream.ready.callback":(g,l)=>{const v=l?n[c+1]:o;l&&m&&d.emit("begin.recording",{"recording.media.types":m,"start.recording.callback":u=>{t({captureStream:l,mediaRecordingUids:u})}}),t({currentPage:v,screenPermissionRequested:!0,captureStream:l})}});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 ke="ul-permission-graphics-container",Te="ul-permission-body",_e=e.cc(ke,"ul_recorded-task-inset-spacing"),ae=e.cc("ul-horizontal-button-container","ul-horizontal-button-container-left"),Ie=({richTextBody:n})=>e.u(b.Html,{className:"ul-rich-text-body",html:n,id:"ul-task-detail-container"}),le=({required:n,skipButtonText:i,bottom:d=!1})=>n?null:e.u(b.Button,{className:e.cc(d&&"ul-skip-button-below","ul-button-inactive"),onClick:ce.bind(null,{status:"abandoned"}),children:i||"Skip"}),me=n=>{const{avStream:i,captureStream:d,recordingMediaTypes:r,updatePage:t}=te.getState(),o=(r==null?void 0:r.includes("audio"))||(r==null?void 0:r.includes("video"));e.p(()=>{const m=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(m)},[i,d,o,n,r,t])},Ae=({content:n,pages:i,required:d})=>{const{buttonText:r,skipButtonText:t,taskDetail:o}=n;return me(i),e.u("div",{className:"ul-task-page",children:[o&&e.u(Ie,{richTextBody:o}),e.u("div",{className:ae,children:[e.u(b.Button,{onClick:pe.bind(null,{pages:i}),children:r}),e.u(le,{required:d,skipButtonText:t})]})]},"start-task")},He=({content:n,pages:i,properties:d})=>{const{buttonText:r,skipButtonText:t}=n;return me(i),e.u("div",{className:"ul-task-page",children:[n.taskDetail&&e.u(Ie,{richTextBody:n.taskDetail}),e.u(b.MobileEmbedView,{properties:d,children:e.u("div",{className:ae,children:[e.u(b.Button,{className:"ul-complete-task-button",onClick:ce.bind(null,{status:"completed"}),children:r}),e.u(b.Button,{className:e.cc("ul-button-inactive"),onClick:ce.bind(null,{status:"given.up"}),children:t})]})})]},"complete-task")},$e=({content:n,pages:i,required:d})=>{const{buttonText:r,skipButtonText:t}=n,[o]=e.useConfig(c=>[c.tabTitle]),[m,f]=e.h(!1);return e.u("div",{children:[e.u("div",{className:_e,children:[e.u("p",{style:{marginTop:"auto"},children:n.selectTabText}),e.u("div",{className:"ul-select-tab-container",children:e.u("p",{className:Te,children:o})})]}),e.u("div",{className:d?"":ae,children:[e.u(b.Button,{disabled:m,onClick:pe.bind(null,{pages:i,setIsRequestingPermission:f}),children:r}),e.u(le,{required:d,skipButtonText:t})]})]})},Ve=({content:n})=>e.u(b.Html,{className:e.cc(ke,"ul_permission_svg_container","ul_recorded-task-inset-spacing","ul-center-horizontally"),html:n.svg},"ul-permission-request-graphic"),Ue=({content:n,pages:i,required:d})=>{const{permissionDeniedHeadline:r,permissionDeniedBody:t,skipButtonText:o,tryAgainButtonText:m}=n,f=oe(i[0])?i[0]:null;return e.p(()=>{const c=setInterval(()=>{f!==null&&de({currentPage:f,pages:i})},1e3);return()=>clearInterval(c)},[f,i]),f?e.u("div",{children:[e.u("div",{className:_e,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:Te,children:t})]})}),e.u("div",{className:ae,children:[e.u(b.Button,{onClick:de.bind(null,{currentPage:f,pages:i}),children:m}),e.u(le,{required:d,skipButtonText:o})]})]}):null},We=({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)}}),je=({content:n,pages:i,required:d})=>{const{skipButtonText:r}=n,{avStream:t}=te.getState();return me(i),e.u("div",{children:[e.u(We,{stream:t}),e.u("div",{className:"ul-vertical-button-container-center",children:[e.u(b.Button,{onClick:pe.bind(null,{pages:i}),children:n.buttonText}),e.u(le,{bottom:!0,required:d,skipButtonText:r})]})]})},Ze=({properties:n})=>{const{pages:i,required:d}=n,{avStream:r,currentPage:t}=te.getState();if(t===void 0)return null;switch(t==null?void 0:t.type){case"av_permission":{const o=Ce(r,t);return o===ue?e.u(Ve,{content:t}):o===Se?e.u(Ue,{content:t,pages:i,required:d}):e.u(je,{content:t,pages:i,required:d})}case"screen_permission":return e.u($e,{content:t,pages:i,required:d});case"start_task":return e.u(Ae,{content:t,pages:i,required:d});case"complete_task":return e.u(He,{content:t,pages:i,properties:n});default:return null}},ze=({className:n,properties:i,next:d,questionId:r})=>{const t=e.useConfig(),{surveyId:o,responseGroupUid:m,userId:f,update:c}=t,g=te(),{screenPermissionRequested:l}=g,v=te(p=>p.avStream);let u=te(p=>p.currentPage);u||(u=function({pages:p,userId:x,responseGroupUid:h,surveyId:w,questionId:M,next:F}){const{updatePage:Q}=te.getState(),{eventEmitFn:D,recorderEventEmitter:y}=e.useConfig.getState(),I={questionId:M,surveyId:w,visitorId:x,responseGroupUid:h};let P=0;y.emit("recorded.task.permission.screen"),D("recorded.task.permission.screen"),y.emit("permission.status",{"permission.status.callback":(E,_,W,k)=>{const L=p[P],{type:j}=L,z=["screen"];if(oe(L)){const{permissionDescriptors:V}=L,J=V==null?void 0:V.includes("microphone"),s=V==null?void 0:V.includes("camera");J&&z.push("audio"),s&&z.push("video"),(E!=null&&E.active&&!s||E!=null&&E.active&&_)&&P++}he(p[P])&&W&&(P++,y.emit("begin.recording",{"recording.media.types":z,"start.recording.callback":V=>Q({mediaRecordingUids:V})})),Q({currentPage:p[P],avStream:E,screenPermissionRequested:W,nextQuestion:F,type:j,passthroughData:I,recordingMediaTypes:z,captureStream:k})}});const R=p[P];return R.type==="av_permission"&&de({currentPage:R,pages:p}),R}({questionId:r,surveyId:o,next:p=>{d(p,!0)},pages:i.pages,responseGroupUid:m,userId:f}));let N=u.headline,a=u.captionText;const S=Ce(v,u);return he(u)&&l&&(N=u.permissionDeniedHeadline,a=u.permissionDeniedCaptionText),oe(u)&&S===xe&&(N=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(b.Header,{isRequired:i==null?void 0:i.required,message:N,properties:{captionText:a}}),e.u(b.QuestionBodyWrapper,{children:e.u(Ze,{properties:i})})]})},Ge=({richTextBody:n,plaintextBody:i})=>n?e.u(b.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,Ye=({className:n,message:i,next:d,properties:r,questionId:t,type:o})=>{const{visitorAttributes:m,isLongFormSurvey:f}=e.useConfig(v=>({visitorAttributes:v.visitorAttributes,isLongFormSurvey:K.isLongFormSurvey(v.studyType)})),c=(v,u=!1)=>{d({value:u?{skipped:!0}:void 0,questionId:t,type:o},!0)},g=b.getAttributedUrl(r&&r.buttonUrl,m),l=f&&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(b.Header,{isRequired:f&&(r==null?void 0:r.required),message:i,properties:{questionHtml:r.questionHtml}}),e.u(b.QuestionBodyWrapper,{children:e.u(Ge,{plaintextBody:r==null?void 0:r.body,richTextBody:r==null?void 0:r.richTextBody})}),e.u(b.MobileEmbedView,{properties:r,children:!l&&e.u(b.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:g,id:"ul-card-text__button",onClick:c,onKeyPress:v=>{v.key!=="Enter"&&v.key!==" "||d({value:void 0,questionId:t,type:o},!0)},rel:"noreferrer",role:g?"link":"button",tabIndex:0,target:"_blank",children:e.getButtonText(r)}),r.required===!1&&e.u("button",{className:"ul-card-skip__button",onClick:v=>c(0,!0),children:e.getSkipButtonText(r)})]})})})]},t)},Ke=({className:n,questionId:i})=>{const{border:d,destroy:r,endCard:t,forceBrandedLogo:o,update:m}=e.useConfig(g=>({border:g.border,destroy:g.destroy,endCard:g.endCard,forceBrandedLogo:g.forceBrandedLogo,update:g.update}));e.p(()=>{setTimeout(()=>{r(K.APP_ID)},o?4e3:2e3)},[r,o]);const f=t&&t.subheader?e.u("p",{className:"ul-caption",children:t.subheader}):null,c=t&&t.headline?t.headline:"";return e.p(()=>{m()},[m]),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(b.Header,{message:c}),f]})})},i)},Xe=({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(b.Header,{message:`${d} (${t}% complete)`}),e.u("p",{className:"ul-caption",children:r})]})},we=e.F$1(void 0),Je=({value:n,children:i})=>e.u(we.Provider,{value:n,children:i}),et=({isRightLabel:n,isLeftLabel:i})=>n?e.MaxDiffChoice.RIGHT:i?e.MaxDiffChoice.LEFT:null,tt="Best",rt="Worst",nt=({className:n,labels:i,message:d,properties:r,options:t,questionId:o,type:m,next:f})=>{var M,F,Q,D;const[c,g]=e.h(t.map((y,I)=>({...y,label:y.label===""?`Item ${I+1}`:y.label,isRightLabel:!1,isLeftLabel:!1}))),l=(()=>{const y=e.q(we);if(y===void 0)throw new Error("usePreviousResponses must be used within a PreviousResponsesProvider");return y})(),v={padding:"24px",display:"flex",cursor:"pointer",width:"auto"},[u,N]=e.h(!1);e.p(()=>{const y=c.findIndex(L=>L.isRightLabel),I=c.findIndex(L=>L.isLeftLabel),P=y!==-1&&I!==-1;N(P);const R=!r.required||r.required&&P,E=c.map(L=>({id:L.id,option:L.label,selected:et(L)})),_=Math.floor(o),W=Object.keys(l).filter(L=>L.startsWith(_.toString())).map(Number).sort((L,j)=>L-j).at(-1),k=[];if(typeof W=="number"){const L=l[W],j=JSON.parse(L);k.push(...j)}k.push(E),setTimeout(()=>{f({value:k,questionId:o,type:m},R,P),N(!1)},P?500:0)},[c]);const{border:a,useMobileStyling:S,enableCspTrustedTypes:p}=e.useConfig(y=>({border:y.border,useMobileStyling:y.useMobileStyling,enableCspTrustedTypes:y.enableCspTrustedTypes})),x=(y,I)=>()=>{u||g(P=>((R,E,_)=>R.map(W=>W.id===E?{...W,isRightLabel:_===e.MaxDiffChoice.RIGHT,isLeftLabel:_===e.MaxDiffChoice.LEFT}:_===e.MaxDiffChoice.RIGHT&&W.isRightLabel||_===e.MaxDiffChoice.LEFT&&W.isLeftLabel?{...W,isRightLabel:!1,isLeftLabel:!1}:W))(P,y,I))},h=(M=r.ratingIcons)==null?void 0:M[0].svg,w=(F=r.ratingIcons)==null?void 0:F[1].svg;return e.u("form",{className:e.cc(n,"ul-card-maxdiff","fade-in-transition"),children:[e.u(b.Header,{isRequired:r==null?void 0:r.required,message:d,properties:r}),e.u(b.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)||((Q=r==null?void 0:r.labels)==null?void 0:Q.left)||tt}),e.u("div",{children:" "}),e.u("div",{className:"ul-card-maxdiff__label",children:(i==null?void 0:i.right)||((D=r==null?void 0:r.labels)==null?void 0:D.right)||rt}),c.map(({id:y,label:I,isLeftLabel:P,isRightLabel:R})=>e.u(e.g,{children:[e.u("div",{className:"ul-card-maxdiff__option-control "+(w?"smiley":""),children:w?e.u(ve,{ariaPressed:P,className:P?"ul-card-maxdiff__option-btn ul-card-maxdiff__option-selected good":"ul-card-maxdiff__option-btn",enableCspTrustedTypes:p,html:w,id:`smiley-good-${y}`,onClick:x(y,e.MaxDiffChoice.LEFT)}):e.u(b.Option,{allowTextEntry:!1,ariaLabel:`bestLabel-${I}`,border:a,choiceStyle:v,error:!1,id:`${y}`,isRadio:!0,isSelected:P,onUserInputChanged:x(y,e.MaxDiffChoice.LEFT),useMobileStyling:S})}),e.u("div",{className:"ul-card-maxdiff__option-label",children:I}),e.u("div",{className:"ul-card-maxdiff__option-control "+(h?"smiley":""),children:h?e.u(ve,{ariaPressed:R,className:R?"ul-card-maxdiff__option-btn ul-card-maxdiff__option-selected bad":"ul-card-maxdiff__option-btn",enableCspTrustedTypes:p,html:h,id:`smiley-bad-${y}`,onClick:x(y,e.MaxDiffChoice.RIGHT)}):e.u(b.Option,{allowTextEntry:!1,ariaLabel:`worstLabel-${I}`,border:a,choiceStyle:v,error:!1,id:`${y}`,isRadio:!0,isSelected:R,onUserInputChanged:x(y,e.MaxDiffChoice.RIGHT),useMobileStyling:S})})]}))]})})]},o)},ve=({enableCspTrustedTypes:n,ariaPressed:i,className:d,html:r,id:t,onClick:o})=>{const m=e.F(()=>K.getHtml(r,n),[n,r]);return e.u("span",{"aria-pressed":i,className:d,dangerouslySetInnerHTML:{__html:m},id:t,onClick:o,tabIndex:0,type:"button"})},it=({className:n,labels:i,message:d,next:r,properties:t,questionId:o,type:m,onSubmitButtonClick:f,options:c,showIndividualSubmit:g=!1})=>{const l=e._(null),v=e._(0),u=e._(0),N=e._(null),a=e._(!1),S=e._([]),[p,x]=e.h(()=>(t==null?void 0:t.required)===!0),[h,w]=e.h(()=>c.map(T=>({...T,rank:null}))),M=e.F(()=>Array.from({length:c.length},(T,$)=>$+1),[c.length]),{isLongFormSurvey:F,focusedQuestionId:Q,setFocusedQuestionId:D,useMobileStyling:y,isPreview:I,headers:P}=e.useConfig(T=>({useMobileStyling:T.useMobileStyling,isLongFormSurvey:K.isLongFormSurvey(T.studyType),focusedQuestionId:T.focusedQuestionId,setFocusedQuestionId:T.setFocusedQuestionId,isPreview:T.isPreview,headers:T.headers})),R=(P==null?void 0:P["userleap-platform"])==="android",E=y&&!I&&!R,_=!E&&!R,W=F&&Q===o,k=T=>{T.preventDefault(),C(h),f&&f()},L=(T,$)=>{w(H=>{const B=parseInt($),U=H.map(G=>({...G}));U.some(G=>G.rank==null)&&U.forEach((G,ie)=>G.rank=ie+1);const ee=U.findIndex(G=>G.id===T);if(ee===-1)return H;const Y=U[ee].rank;return B<Y?U.forEach(G=>{G.id!==T&&G.rank>=B&&G.rank<Y&&(G.rank=G.rank+1)}):B>Y&&U.forEach(G=>{G.id!==T&&G.rank>Y&&G.rank<=B&&(G.rank=G.rank-1)}),U[ee].rank=B,U.sort((G,ie)=>G.rank-ie.rank),q(U),U})},j=(T,$)=>{for(let H=0;H<S.current.length;H++){const B=S.current[H];if(!B||B===N.current)continue;const U=B.getBoundingClientRect();if(T>=U.left&&T<=U.right&&$>=U.top&&$<=U.bottom)return{element:B,index:H}}return null},z=T=>$=>{if(!E)return;$.preventDefault(),$.stopPropagation(),a.current=!0,l.current=T;const H=$.touches[0];v.current=H.clientY,u.current=H.clientY;const B=$.currentTarget.closest(".ul-card-rank__option");B&&(N.current=B,B.classList.add("is-dragging"))},V=T=>{if(!E||!a.current||l.current===null)return;T.preventDefault(),T.stopPropagation();const $=T.touches[0];u.current=$.clientY;const H=u.current-v.current;N.current&&(N.current.style.transform=`translateY(${H}px)`,N.current.style.zIndex="1000"),S.current.forEach(U=>{U&&U!==N.current&&U.classList.remove("is-drop-target")});const B=j($.clientX,$.clientY);B&&B.element.classList.add("is-drop-target")},J=T=>{if(!E||!a.current||l.current===null)return;T.preventDefault(),T.stopPropagation();const $=T.changedTouches[0],H=j($.clientX,$.clientY);N.current&&(N.current.style.transform="",N.current.style.zIndex="",N.current.classList.remove("is-dragging")),S.current.forEach(B=>{B&&B.classList.remove("is-drop-target")}),H&&H.index!==l.current&&s(l.current,H.index),l.current=null,N.current=null,a.current=!1},s=(T,$)=>{w(H=>{const B=H.map(ee=>({...ee})),[U]=B.splice(T,1);return B.splice($,0,U),B.forEach((ee,Y)=>{ee.rank=Y+1}),q(B),B})},C=T=>{const $={};T.reduce((H,B)=>(H[B.id]=B.rank,H),$),r({value:$,questionId:o,type:m},!0)},q=T=>{x(!1),F&&C(T)},{left:O,right:A}=i,Z=c.length,X=T=>{T.preventDefault(),T.currentTarget.classList.add("is-drop-target")},re=T=>{T.currentTarget.classList.remove("is-drop-target")},ne=T=>{l.current=null,T.currentTarget.classList.remove("is-dragging")};return e.u("form",{className:e.cc(n,"ul-card-rank","fade-in-transition",F&&!W&&"ul-card--unfocused"),onClick:F&&!W?()=>{D(o)}:void 0,onSubmit:k,children:[e.u(b.Header,{isRequired:t==null?void 0:t.required,message:d,properties:t}),e.u(b.MobileEmbedView,{properties:t,children:R?e.u(e.g,{children:[e.u(b.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:h.map(({id:T,label:$,rank:H})=>e.u("li",{className:"ul-card-rank__option",children:[e.u("select",{"aria-label":`Rank for ${$}`,className:e.cc("ul-card-rank__select",H==null&&"ul-card-rank__select--placeholder"),name:`rank[${T}]`,onChange:B=>L(T,B.currentTarget.value),value:H??"",children:[H==null&&e.u("option",{className:"ul-card-rank__select-option",disabled:!0,value:"",children:"-"}),M.map(B=>e.u("option",{className:"ul-card-rank__select-option",value:B,children:B},`${B}-${o}`))]}),e.u("span",{children:$})]},T))}),e.u("div",{className:"ul-card-rank__labels",children:e.u("span",{children:[Z," - ",A]})})]}),g&&e.u(b.LongformSubmitButton,{handleSubmit:k,isSubmitDisabled:p})]}),!F&&e.u(b.QuestionBodyFooterContainer,{children:e.u("div",{className:"ul-card__button-wrapper",children:e.u(b.Button,{disabled:p,children:e.getButtonText(t)})})})]}):e.u(e.g,{children:[e.u(b.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:R?void 0:T=>{T.preventDefault(),T.dataTransfer&&(T.dataTransfer.dropEffect="move")},children:h.map(({id:T,label:$,rank:H},B)=>{return e.u("li",{className:"ul-card-rank__option",draggable:!!_||void 0,onDragEnd:_?ne:void 0,onDragEnter:_?X:void 0,onDragLeave:_?re:void 0,onDragStart:_?(ee=B,Y=>{l.current=ee,Y.dataTransfer&&(Y.dataTransfer.effectAllowed="move",Y.dataTransfer.setData("text/plain",String(ee)),Y.currentTarget.classList.add("is-dragging"))}):void 0,onDrop:_?(U=B,Y=>{var ie,ge;Y.preventDefault(),Y.currentTarget.classList.remove("is-drop-target");const G=l.current;l.current=null,(ge=(ie=Y.currentTarget.closest(".ul-card-rank__list"))==null?void 0:ie.querySelector(".is-dragging"))==null||ge.classList.remove("is-dragging"),G!=null&&G!==U&&s(G,U)}):void 0,ref:Y=>S.current[B]=Y,children:[e.u("select",{"aria-label":`Rank for ${$}`,className:e.cc("ul-card-rank__select",H==null&&"ul-card-rank__select--placeholder"),name:`rank[${T}]`,onChange:Y=>L(T,Y.currentTarget.value),value:H??"",children:[H==null&&e.u("option",{className:"ul-card-rank__select-option",disabled:!0,value:"",children:"-"}),M.map(Y=>e.u("option",{className:"ul-card-rank__select-option",value:Y,children:Y},`${Y}-${o}`))]}),e.u("span",{children:$}),!R&&e.u("button",{"aria-label":`Drag ${$} to reorder`,className:"ul-card-rank__drag-btn",onTouchEnd:E?J:void 0,onTouchMove:E?V:void 0,onTouchStart:E?z(B):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"})})})]},T);var U,ee})}),e.u("div",{className:"ul-card-rank__labels",children:e.u("span",{children:[Z," - ",A]})})]}),g&&e.u(b.LongformSubmitButton,{handleSubmit:k,isSubmitDisabled:p})]}),!F&&e.u(b.QuestionBodyFooterContainer,{children:e.u("div",{className:"ul-card__button-wrapper",children:e.u(b.Button,{disabled:p,children:e.getButtonText(t)})})})]})})]},o)},st=new Set(["aidynamicfollowup","aidynamicstandalone","open","matrix","multipleselect","multiplechoice","rankorder"]),ye=({cardInstance:n,moveToNextQuestion:i,showIndividualSubmit:d,submitQuestion:r,updateCardValues:t,allResponsesArray:o})=>{const{isLongFormSurvey:m,createDynamicFollowupQuestion:f,cards:c,surveyVisitorAttributes:g}=e.useConfig(h=>({isLongFormSurvey:K.isLongFormSurvey(h.studyType),createDynamicFollowupQuestion:h.createDynamicFollowupQuestion,cards:h.cards,surveyVisitorAttributes:h.surveyVisitorAttributes}));if(!n)return null;const{name:l,type:v,props:u,childId:N}=n,a=d&&st.has(v),S=u==null?void 0:u.displayLogic;if(S!=null&&S.length&&!e.someDisplayLogicOptionMatches({displayLogic:S,allResponses:o,cards:c,surveyVisitorAttributes:g??{}}))return null;const p={className:"ul-card",next:(h,w,M=!0)=>r(h,w&&M),questionId:l,type:v,showIndividualSubmit:d,...a?{next:(h,w)=>{t(h.questionId,h,w??!0)},onSubmitButtonClick:(h=!1)=>{N?h?(i(l),f({parentQuestionId:l})):i(N):i(l)}}:{}},x=(()=>{switch(v){case"consentlegal":return e.u(Ne,{...p,...u});case"likert":return e.u(qe,{...p,...u});case"matrix":return e.u(Pe,{...p,...u});case"maxdiff":return e.u(nt,{...p,...u});case"multiplechoice":return e.u(Fe,{...p,...u});case"multipleselect":return e.u(Qe,{...p,...u});case"nps":return e.u(Ee,{...p,...u});case"open":case"aidynamicfollowup":case"aidynamicstandalone":return e.u(Oe,{...p,type:n.type,...u});case"rankorder":return e.u(it,{...p,...u});case"recordedtask":return e.u(ze,{...p,...u});case"texturlprompt":return e.u(Ye,{...p,...u});case"thanks":return e.u(Ke,{...p,...u});case"uploading":return e.u(Xe,{...p,...u});default:return null}})();return x?m?e.u("div",{className:"ul-card-scroll-wrapper",children:x},l):x:null},ot=({isSubmitDisabled:n=!1,onSubmit:i,buttonText:d})=>{var N;const{cards:r,forceBrandedLogo:t,index:o,marketingUrl:m,showSurveyBrand:f,slugName:c,surveyId:g,useMobileStyling:l}=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})),v=((N=r[o])==null?void 0:N.type)==="thanks",u=e.buildMarketingUrl({marketingUrl:m,slugName:c,surveyId:g,forceBrandedLogo:t});return e.u("footer",{className:e.cc("long-form-question-footer-container",l&&"long-form-question-footer-container--mobile",v&&"long-form-question-footer-container-center"),children:[v&&t?e.u(e.ThankYouLink,{marketingUrlLink:u}):e.u("div",{className:"long-form-question-footer-container-logo",children:f?e.u(e.SprigBrandLogo,{forceBrandedLogo:t,marketingUrlLink:u}):null}),!v&&e.u("div",{className:e.cc("ul-card__button-wrapper","ul-card-vertical__button-wrapper","long-form-question-footer-container-actions"),children:e.u(b.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"})})})})]})};exports.PageCard=({cards:n,next:i,previousResponses:d})=>{var J;const r=e._(null),[t,o]=e.h({}),[m,f]=e.h({}),{isLongFormSurvey:c,focusedQuestionId:g,setFocusedQuestionId:l,createDynamicFollowupQuestion:v,allResponses:u,cardIndexByName:N,surveyVisitorAttributes:a,cards:S,createDynamicStandaloneQuestion:p}=e.useConfig(s=>({isLongFormSurvey:K.isLongFormSurvey(s.studyType),focusedQuestionId:s.focusedQuestionId,setFocusedQuestionId:s.setFocusedQuestionId,createDynamicFollowupQuestion:s.createDynamicFollowupQuestion,allResponses:s.allResponses,cardIndexByName:s.cardIndexByName,surveyVisitorAttributes:s.surveyVisitorAttributes,cards:s.cards,createDynamicStandaloneQuestion:s.createDynamicStandaloneQuestion})),x=e.F(()=>({...d,...e.buildReadableResponseMap(n.map(s=>{var C,q;return{...s,value:((C=t[s.name])==null?void 0:C.value)??null,secondaryValue:((q=t[s.name])==null?void 0:q.secondaryValue)??null}}))}),[d,t,n]);b.useSetAllResponsesRaw(x);const h=e.pipeReadableResponsesIntoCards(n,x),w=e.F(()=>e.buildResponsesArrayForDisplayLogic({storeAllResponses:u,cards:n,cardValues:t,cardIndexByName:N}),[u,n,t,N]),M=e.F(()=>{const s=new Set;return n.forEach(C=>{var O;const q=(O=C.props)==null?void 0:O.displayLogic;if(!q||q.length===0)return void s.add(C.name);e.someDisplayLogicOptionMatches({displayLogic:q,allResponses:w,cards:S,surveyVisitorAttributes:a??{}})&&s.add(C.name)}),s},[n,w,a,S]);e.p(()=>{n.some(s=>{if(s.type==="aidynamicstandalone"&&s.props&&M.has(s.name)){if(s.props.loading===e.DynamicQuestionLoadingStates.inFlight)return!0;if(s.props.loading===void 0)return p({questionId:s.name}),!0}return!1})},[n,p,M]);const F=e._(null);e.p(()=>{const s=M,C=F.current;if(C!==null)for(const q of C)s.has(q)||(o(O=>{const A={...O};return delete A[q],A}),f(O=>{const A={...O};return delete A[q],A}));F.current=new Set(s)},[M]);const Q=e._(null),D=e._(!1),y=e._(null),I=e.T(s=>{var A,Z;D.current=!0;const C=n.findIndex(X=>X.name===s);if(!c||s===null||C===-1)return void(D.current=!1);const q=(A=Q.current)==null?void 0:A.querySelectorAll(".ul-card-scroll-wrapper")[C],O=(Z=Q.current)==null?void 0:Z.closest(".ul-card-main-content");if(q&&O){if(q&&O){const X=q.getBoundingClientRect(),re=O.getBoundingClientRect(),ne=X.top-re.top+O.scrollTop,T=ne+X.height/2,$=window.innerHeight-157;let H;X.height>=$?H=ne:H=T-O.clientHeight/2;const B=O.clientHeight,U=O.scrollHeight-B,ee=Math.max(0,Math.min(H,U));O.scrollTo({top:ee,behavior:"smooth"}),setTimeout(()=>{D.current=!1},500)}}else D.current=!1},[c,n]);e.p(()=>{g!==null&&n.findIndex(s=>s.name===g)!==-1||l(n[0].name)},[n,g,l]);const P=({displayCard:s,response:C})=>{if(s&&((s==null?void 0:s.childId)??0)>0){const q=e.buildReadableResponseMap([s].map(O=>({...O,value:(C==null?void 0:C.value)??null,secondaryValue:(C==null?void 0:C.secondaryValue)??null})));v({parentQuestionId:s==null?void 0:s.name,parentResponseConfig:q})}};function R(s,C){return s.filter(q=>M.has(q.name)).map(q=>{const O=C[q.name],A=h.find(Z=>Z.name===q.name);return{...O,questionText:A?e.getProcessedQuestionText(A):void 0}})}const E=s=>{if(!c)return;let C=n.findIndex(q=>q.name===s)+1;for(;C<n.length&&!M.has(n[C].name);)C++;C<n.length?l(n[C].name):l(s)};e.p(()=>{c&&g!==null&&(y.current!==g?I(g):y.current=null)},[g,c,I]);const _=e.T(()=>{var re,ne;if(D.current)return;const s=(re=Q.current)==null?void 0:re.closest(".ul-card-main-content");if(!s)return;const C=(ne=Q.current)==null?void 0:ne.querySelectorAll(".ul-card-scroll-wrapper");if(!C||C.length===0)return;const q=s.getBoundingClientRect(),O=q.top+q.height/2;let A=0,Z=1/0;C.forEach((T,$)=>{const H=T.getBoundingClientRect(),B=H.top+H.height/2,U=Math.abs(O-B);U<Z&&(Z=U,A=$)});const X=n[A];y.current=X.name,l(X.name)},[n,l]);e.p(()=>{var C;if(!c)return;const s=((C=Q.current)==null?void 0:C.closest(".ul-card__container"))||null;return s&&s.addEventListener("scroll",_,{passive:!0}),()=>{s&&s.removeEventListener("scroll",_)}},[_,c]);const W=e.F(()=>n.every(s=>{var C;return!M.has(s.name)||!(!(s!=null&&s.props)||!("properties"in s.props)||((C=s.props.properties)==null?void 0:C.required)!==!1)||m[s.name]}),[m,n,M]),k=async(s,C,q)=>{return f(A=>({...A,[s]:q})),await(O=A=>({...A,[s]:C}),new Promise(A=>{o(Z=>{const X=O(Z);return A(X),X})}));var O};e.p(()=>{var O;if(!c)return;const s=r.current,C=(O=n==null?void 0:n[0])==null?void 0:O.groupId;r.current=C;const q={};if(n.forEach(A=>{var Z,X;e.appCardHasPropertiesWithRequired(A)&&(A.props.properties.required||(q[A.name]={value:((Z=t[A.name])==null?void 0:Z.value)??null,secondaryValue:((X=t[A.name])==null?void 0:X.secondaryValue)??null,questionId:A.name,type:A.type}))}),s==null||s!==C)o(q),f({});else{o(Z=>({...Z,...q}));const A=n.reduce((Z,X)=>{var re;return X.type==="aidynamicfollowup"&&((re=X.props)==null?void 0:re.loading)===null&&(Z[X.name]=!0),Z},{});f(Z=>({...Z,...A}))}},[n,c]);const L=async(s,C)=>{if(c){const q=await k(s.questionId,s,C),O=j(s.type),A=z(s.type);if(O&&E(s.questionId),A&&C){const Z=R(n,q);i(Z)}}else{const q=h.find(A=>A.name===s.questionId),O={...s,questionText:q?e.getProcessedQuestionText(q):void 0};P({displayCard:q,response:s}),i([O])}},j=s=>new Set(["nps","likert","multiplechoice"]).has(s),z=s=>new Set(["videovoice","consentlegal","texturlprompt","maxdiff"]).has(s),V=((J=n[0])==null?void 0:J.type)==="thanks";return c?e.u("div",{className:"ul-card-list-container--longform","data-testid":"ui-container",ref:Q,children:[e.u(Je,{value:d,children:h.map((s,C)=>e.u(ye,{allResponsesArray:w,cardInstance:s,moveToNextQuestion:E,showIndividualSubmit:n.length>1&&C<n.length-1,submitQuestion:L,updateCardValues:k},(s==null?void 0:s.name)||C))}),!V&&e.u(ot,{isSubmitDisabled:!W,onSubmit:function(){const s=R(n,t);if((h==null?void 0:h.length)===1&&(s==null?void 0:s.length)===1){const C=h[0],q=s[0];P({displayCard:C,response:q})}i(s)}})]}):e.u(e.g,{children:[e.u("div",{"data-testid":"ui-container",style:{display:"none"}}),h.map((s,C)=>e.u(ye,{allResponsesArray:w,cardInstance:s,moveToNextQuestion:E,showIndividualSubmit:!1,submitQuestion:L,updateCardValues:k},(s==null?void 0:s.name)||C))]})};
@@ -6029,7 +6029,7 @@ const _f = (e) => e._config && e._config.installationMethod ? e._config.installa
6029
6029
  iu = !0, ou = e;
6030
6030
  };
6031
6031
  function Ue(e = {}) {
6032
- const t = { "Content-Type": "application/json", "userleap-platform": "web", "x-ul-sdk-version": "2.44.0", "x-ul-installation-method": _f(e), "sprig-modules": Df(), "x-ul-package-version": "2.44.0" };
6032
+ const t = { "Content-Type": "application/json", "userleap-platform": "web", "x-ul-sdk-version": "2.44.1", "x-ul-installation-method": _f(e), "sprig-modules": Df(), "x-ul-package-version": "2.44.1" };
6033
6033
  if (e.envId && (t["x-ul-environment-id"] = e.envId), e.token && (t.Authorization = "Bearer " + e.token), e.userId && (t["x-ul-user-id"] = e.userId), e.visitorId && (t["x-ul-visitor-id"] = e.visitorId), e.partnerAnonymousId && (t["x-ul-anonymous-id"] = e.partnerAnonymousId), e.mobileHeadersJSON) {
6034
6034
  const r = JSON.parse(e.mobileHeadersJSON);
6035
6035
  Object.assign(t, r);
@@ -6158,7 +6158,7 @@ const tr = async (e, t, r) => {
6158
6158
  window.UserLeap.container && Object.assign(window.UserLeap.container.style, { display: "flex" });
6159
6159
  };
6160
6160
  if (y.installationMethod === "web-npm" || y.installationMethod === "web-npm-bundled") {
6161
- const { default: H } = await import("./view-DcerBHpf.js").then((Le) => Le.B);
6161
+ const { default: H } = await import("./view-Bu60Bbor.js").then((Le) => Le.B);
6162
6162
  H.configure(y), P && window.UserLeap.container && _();
6163
6163
  } else F && (L.src = `${F}${window.UserLeap.isMobileSDK ? "" : `?t=${Date.now()}`}`, P && L.addEventListener("load", () => {
6164
6164
  window.UserLeap.container && _();
@@ -6982,7 +6982,7 @@ function cg(e = {}) {
6982
6982
  var m;
6983
6983
  await ze(Ae("1", [ot], "metrics"), { body: C, method: "POST", headers: { "x-ul-replay-enabled": `${!!((m = re.replay) != null && m.isReplayRecording())}` }, shouldDropOnRateLimit: !0 });
6984
6984
  } }), !c) {
6985
- const C = u.alwaysOnReplay ? { userAgent: globalThis.navigator.userAgent, surveyId: u.alwaysOnReplay.surveyId, responseGroupUuid: u.alwaysOnReplay.responseGroupUuid, sdkVersion: "2.44.0", maxDurationSeconds: u.alwaysOnReplay.maxDurationSeconds } : void 0;
6985
+ const C = u.alwaysOnReplay ? { userAgent: globalThis.navigator.userAgent, surveyId: u.alwaysOnReplay.surveyId, responseGroupUuid: u.alwaysOnReplay.responseGroupUuid, sdkVersion: "2.44.1", maxDurationSeconds: u.alwaysOnReplay.maxDurationSeconds } : void 0;
6986
6986
  await ((w = re.replay) == null ? void 0 : w.initializeReplay({ maxReplayDurationSeconds: u.maxReplayDurationSeconds, maxInflightRequests: globalThis.UserLeap.maxInflightReplayRequests ?? 2, replaySettings: u.replaySettings, apiUrl: globalThis.UserLeap._API_URL, alwaysOnConfig: C })), io = u.replaySettings;
6987
6987
  }
6988
6988
  ag(u), await og(u), globalThis.UserLeap._queue.unpause(), (p = globalThis.SprigLoggerCallback) == null || p.call(globalThis, "SdkReady"), z.emit(B.SDKReady, { mobileMetricsReportingEnabled: !!u.mobileMetricsReportingEnabled, metricsReportingInterval: u.metricsReportingIntervalSeconds || 0, metricsThresholds: u.metricThresholds || [], maxMobileReplayDurationSeconds: u.maxMobileReplayDurationSeconds, mobileReplaySettings: u.mobileReplaySettings }), z.emit(B.VisitorIDUpdated, { visitorId: globalThis.UserLeap.visitorId }), z.on(B.VisitorIDUpdated, () => {
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-B0e_zgRQ.cjs");exports.DismissReason=i.DismissReason,exports.Sprig=i.Sprig,exports.SprigAPI=i.SprigAPI,exports.SprigEvent=i.SprigEvent,exports.sprig=i.sprig;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-BmZLh0D5.cjs");exports.DismissReason=i.DismissReason,exports.Sprig=i.Sprig,exports.SprigAPI=i.SprigAPI,exports.SprigEvent=i.SprigEvent,exports.sprig=i.sprig;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { d as i, n as p, o as r, S as g, p as o } from "./index-BUTuSSuP.js";
1
+ import { d as i, n as p, o as r, S as g, p as o } from "./index-Rlf7G5CR.js";
2
2
  export {
3
3
  i as DismissReason,
4
4
  p as Sprig,