@sprig-technologies/sprig-browser 2.33.2 → 2.33.3
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/{core-C0XvmpIu.js → core-DLrmR9wp.js} +3 -3
- package/dist/{core-B164snRL.cjs → core-nhbrlHf1.cjs} +2 -2
- package/dist/core.cjs +1 -1
- package/dist/core.js +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/{metricsReporter-BLXrIaei.cjs → metricsReporter-DNdFkQ0C.cjs} +1 -1
- package/dist/{metricsReporter-uTmb1eaJ.js → metricsReporter-qetrFwEv.js} +1 -1
- package/dist/replay.cjs +1 -1
- package/dist/replay.js +8 -5
- package/dist/{view-yOVTCqu5.cjs → view-Bd-x6oh5.cjs} +3 -3
- package/dist/{view-DuNLA499.js → view-Bml35A_s.js} +228 -226
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=require("./core-B164snRL.cjs"),B=require("./metricsReporter-BLXrIaei.cjs");var Te,R,kn,_e,It,wn,it,Cn,Ie={},En=[],Ur=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Fe=Array.isArray;function le(e,t){for(var n in t)e[n]=t[n];return e}function Sn(e){var t=e.parentNode;t&&t.removeChild(e)}function z(e,t,n){var r,o,i,s={};for(i in t)i=="key"?r=t[i]:i=="ref"?o=t[i]:s[i]=t[i];if(arguments.length>2&&(s.children=arguments.length>3?Te.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)s[i]===void 0&&(s[i]=e.defaultProps[i]);return Se(e,s,r,o,null)}function Se(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:o??++kn,__i:-1,__u:0};return o==null&&R.vnode!=null&&R.vnode(i),i}function jn(){return{current:null}}function K(e){return e.children}function ne(e,t){this.props=e,this.context=t}function we(e,t){if(t==null)return e.__?we(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?we(e):null}function In(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return In(e)}}function st(e){(!e.__d&&(e.__d=!0)&&_e.push(e)&&!Ae.__r++||It!==R.debounceRendering)&&((It=R.debounceRendering)||wn)(Ae)}function Ae(){var e,t,n,r,o,i,s,d,a;for(_e.sort(it);e=_e.shift();)e.__d&&(t=_e.length,r=void 0,i=(o=(n=e).__v).__e,d=[],a=[],(s=n.__P)&&((r=le({},o)).__v=o.__v+1,R.vnode&&R.vnode(r),mt(s,r,o,n.__n,s.ownerSVGElement!==void 0,32&o.__u?[i]:null,d,i??we(o),!!(32&o.__u),a),r.__.__k[r.__i]=r,Pn(d,r,a),r.__e!=i&&In(r)),_e.length>t&&_e.sort(it));Ae.__r=0}function Tn(e,t,n,r,o,i,s,d,a,u,h){var c,p,m,g,b,v=r&&r.__k||En,_=t.length;for(n.__d=a,function(f,T,S){var w,x,j,P,y,E=T.length,k=S.length,I=k,L=0;for(f.__k=[],w=0;w<E;w++)(x=f.__k[w]=(x=T[w])==null||typeof x=="boolean"||typeof x=="function"?null:typeof x=="string"||typeof x=="number"||typeof x=="bigint"||x.constructor==String?Se(null,x,null,null,x):Fe(x)?Se(K,{children:x},null,null,null):x.constructor===void 0&&x.__b>0?Se(x.type,x.props,x.key,x.ref?x.ref:null,x.__v):x)!=null?(x.__=f,x.__b=f.__b+1,y=Hr(x,S,P=w+L,I),x.__i=y,j=null,y!==-1&&(I--,(j=S[y])&&(j.__u|=131072)),j==null||j.__v===null?(y==-1&&L--,typeof x.type!="function"&&(x.__u|=65536)):y!==P&&(y===P+1?L++:y>P?I>E-P?L+=y-P:L--:L=y<P&&y==P-1?y-P:0,y!==w+L&&(x.__u|=65536))):(j=S[w])&&j.key==null&&j.__e&&(j.__e==f.__d&&(f.__d=we(j)),at(j,j,!1),S[w]=null,I--);if(I)for(w=0;w<k;w++)(j=S[w])!=null&&!(131072&j.__u)&&(j.__e==f.__d&&(f.__d=we(j)),at(j,j))}(n,t,v),a=n.__d,c=0;c<_;c++)(m=n.__k[c])!=null&&typeof m!="boolean"&&typeof m!="function"&&(p=m.__i===-1?Ie:v[m.__i]||Ie,m.__i=c,mt(e,m,p,o,i,s,d,a,u,h),g=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&>(p.ref,null,m),h.push(m.ref,m.__c||g,m)),b==null&&g!=null&&(b=g),65536&m.__u||p.__k===m.__k?a=Rn(m,a,e):typeof m.type=="function"&&m.__d!==void 0?a=m.__d:g&&(a=g.nextSibling),m.__d=void 0,m.__u&=-196609);n.__d=a,n.__e=b}function Rn(e,t,n){var r,o;if(typeof e.type=="function"){for(r=e.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=e,t=Rn(r[o],t,n));return t}return e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e),t&&t.nextSibling}function de(e,t){return t=t||[],e==null||typeof e=="boolean"||(Fe(e)?e.some(function(n){de(n,t)}):t.push(e)),t}function Hr(e,t,n,r){var o=e.key,i=e.type,s=n-1,d=n+1,a=t[n];if(a===null||a&&o==a.key&&i===a.type)return n;if(r>(a==null||131072&a.__u?0:1))for(;s>=0||d<t.length;){if(s>=0){if((a=t[s])&&!(131072&a.__u)&&o==a.key&&i===a.type)return s;s--}if(d<t.length){if((a=t[d])&&!(131072&a.__u)&&o==a.key&&i===a.type)return d;d++}}return-1}function Tt(e,t,n){t[0]==="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||Ur.test(t)?n:n+"px"}function Le(e,t,n,r,o){var i;e:if(t==="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||Tt(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||Tt(e.style,t,n[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]=n,n?r?n.u=r.u:(n.u=Date.now(),e.addEventListener(t,i?Pt:Rt,i)):e.removeEventListener(t,i?Pt:Rt,i);else{if(o)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]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,n))}}function Rt(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(R.event?R.event(e):e)}function Pt(e){return this.l[e.type+!0](R.event?R.event(e):e)}function mt(e,t,n,r,o,i,s,d,a,u){var h,c,p,m,g,b,v,_,f,T,S,w,x,j,P,y=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(a=!!(32&n.__u),i=[d=t.__e=n.__e]),(h=R.__b)&&h(t);e:if(typeof y=="function")try{if(_=t.props,f=(h=y.contextType)&&r[h.__c],T=h?f?f.props.value:h.__:r,n.__c?v=(c=t.__c=n.__c).__=c.__E:("prototype"in y&&y.prototype.render?t.__c=c=new y(_,T):(t.__c=c=new ne(_,T),c.constructor=y,c.render=Br),f&&f.sub(c),c.props=_,c.state||(c.state={}),c.context=T,c.__n=r,p=c.__d=!0,c.__h=[],c._sb=[]),c.__s==null&&(c.__s=c.state),y.getDerivedStateFromProps!=null&&(c.__s==c.state&&(c.__s=le({},c.__s)),le(c.__s,y.getDerivedStateFromProps(_,c.__s))),m=c.props,g=c.state,c.__v=t,p)y.getDerivedStateFromProps==null&&c.componentWillMount!=null&&c.componentWillMount(),c.componentDidMount!=null&&c.__h.push(c.componentDidMount);else{if(y.getDerivedStateFromProps==null&&_!==m&&c.componentWillReceiveProps!=null&&c.componentWillReceiveProps(_,T),!c.__e&&(c.shouldComponentUpdate!=null&&c.shouldComponentUpdate(_,c.__s,T)===!1||t.__v===n.__v)){for(t.__v!==n.__v&&(c.props=_,c.state=c.__s,c.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(E){E&&(E.__=t)}),S=0;S<c._sb.length;S++)c.__h.push(c._sb[S]);c._sb=[],c.__h.length&&s.push(c);break e}c.componentWillUpdate!=null&&c.componentWillUpdate(_,c.__s,T),c.componentDidUpdate!=null&&c.__h.push(function(){c.componentDidUpdate(m,g,b)})}if(c.context=T,c.props=_,c.__P=e,c.__e=!1,w=R.__r,x=0,"prototype"in y&&y.prototype.render){for(c.state=c.__s,c.__d=!1,w&&w(t),h=c.render(c.props,c.state,c.context),j=0;j<c._sb.length;j++)c.__h.push(c._sb[j]);c._sb=[]}else do c.__d=!1,w&&w(t),h=c.render(c.props,c.state,c.context),c.state=c.__s;while(c.__d&&++x<25);c.state=c.__s,c.getChildContext!=null&&(r=le(le({},r),c.getChildContext())),p||c.getSnapshotBeforeUpdate==null||(b=c.getSnapshotBeforeUpdate(m,g)),Tn(e,Fe(P=h!=null&&h.type===K&&h.key==null?h.props.children:h)?P:[P],t,n,r,o,i,s,d,a,u),c.base=t.__e,t.__u&=-161,c.__h.length&&s.push(c),v&&(c.__E=c.__=null)}catch(E){t.__v=null,a||i!=null?(t.__e=d,t.__u|=a?160:32,i[i.indexOf(d)]=null):(t.__e=n.__e,t.__k=n.__k),R.__e(E,t,n)}else i==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=Ar(n.__e,t,n,r,o,i,s,a,u);(h=R.diffed)&&h(t)}function Pn(e,t,n){t.__d=void 0;for(var r=0;r<n.length;r++)gt(n[r],n[++r],n[++r]);R.__c&&R.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(i){i.call(o)})}catch(i){R.__e(i,o.__v)}})}function Ar(e,t,n,r,o,i,s,d,a){var u,h,c,p,m,g,b,v=n.props,_=t.props,f=t.type;if(f==="svg"&&(o=!0),i!=null){for(u=0;u<i.length;u++)if((m=i[u])&&"setAttribute"in m==!!f&&(f?m.localName===f:m.nodeType===3)){e=m,i[u]=null;break}}if(e==null){if(f===null)return document.createTextNode(_);e=o?document.createElementNS("http://www.w3.org/2000/svg",f):document.createElement(f,_.is&&_),i=null,d=!1}if(f===null)v===_||d&&e.data===_||(e.data=_);else{if(i=i&&Te.call(e.childNodes),v=n.props||Ie,!d&&i!=null)for(v={},u=0;u<e.attributes.length;u++)v[(m=e.attributes[u]).name]=m.value;for(u in v)m=v[u],u=="children"||(u=="dangerouslySetInnerHTML"?c=m:u==="key"||u in _||Le(e,u,null,m,o));for(u in _)m=_[u],u=="children"?p=m:u=="dangerouslySetInnerHTML"?h=m:u=="value"?g=m:u=="checked"?b=m:u==="key"||d&&typeof m!="function"||v[u]===m||Le(e,u,m,v[u],o);if(h)d||c&&(h.__html===c.__html||h.__html===e.innerHTML)||(e.innerHTML=h.__html),t.__k=[];else if(c&&(e.innerHTML=""),Tn(e,Fe(p)?p:[p],t,n,r,o&&f!=="foreignObject",i,s,i?i[0]:n.__k&&we(n,0),d,a),i!=null)for(u=i.length;u--;)i[u]!=null&&Sn(i[u]);d||(u="value",g!==void 0&&(g!==e[u]||f==="progress"&&!g||f==="option"&&g!==v[u])&&Le(e,u,g,v[u],!1),u="checked",b!==void 0&&b!==e[u]&&Le(e,u,b,v[u],!1))}return e}function gt(e,t,n){try{typeof e=="function"?e(t):e.current=t}catch(r){R.__e(r,n)}}function at(e,t,n){var r,o;if(R.unmount&&R.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||gt(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){R.__e(i,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&at(r[o],t,n||typeof e.type!="function");n||e.__e==null||Sn(e.__e),e.__=e.__e=e.__d=void 0}function Br(e,t,n){return this.constructor(e,n)}function Ce(e,t,n){var r,o,i,s;R.__&&R.__(e,t),o=(r=typeof n=="function")?null:n&&n.__k||t.__k,i=[],s=[],mt(t,e=(!r&&n||t).__k=z(K,null,[e]),o||Ie,Ie,t.ownerSVGElement!==void 0,!r&&n?[n]:o?null:t.firstChild?Te.call(t.childNodes):null,i,!r&&n?n:o?o.__e:t.firstChild,r,s),Pn(i,e,s)}function Dn(e,t){Ce(e,t,Dn)}function qr(e,t,n){var r,o,i,s,d=le({},e.props);for(i in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)i=="key"?r=t[i]:i=="ref"?o=t[i]:d[i]=t[i]===void 0&&s!==void 0?s[i]:t[i];return arguments.length>2&&(d.children=arguments.length>3?Te.call(arguments,2):n),Se(e.type,d,r||e.key,o||e.ref,null)}function Ln(e,t){var n={__c:t="__cC"+Cn++,__:e,Consumer:function(r,o){return r.children(o)},Provider:function(r){var o,i;return this.getChildContext||(o=[],(i={})[t]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(s){this.props.value!==s.value&&o.some(function(d){d.__e=!0,st(d)})},this.sub=function(s){o.push(s);var d=s.componentWillUnmount;s.componentWillUnmount=function(){o.splice(o.indexOf(s),1),d&&d.call(s)}}),r.children}};return n.Provider.__=n.Consumer.contextType=n}Te=En.slice,R={__e:function(e,t,n,r){for(var o,i,s;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&i.getDerivedStateFromError!=null&&(o.setState(i.getDerivedStateFromError(e)),s=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,r||{}),s=o.__d),s)return o.__E=o}catch(d){e=d}throw e}},kn=0,ne.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=le({},this.state),typeof e=="function"&&(e=e(le({},n),this.props)),e&&le(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),st(this))},ne.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),st(this))},ne.prototype.render=K,_e=[],wn=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,it=function(e,t){return e.__v.__b-t.__v.__b},Ae.__r=0,Cn=0;var Vr=0;function l(e,t,n,r,o,i){var s,d,a={};for(d in t)d=="ref"?s=t[d]:a[d]=t[d];var u={type:e,props:a,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--Vr,__i:-1,__u:0,__source:o,__self:i};if(typeof e=="function"&&(s=e.defaultProps))for(d in s)a[d]===void 0&&(a[d]=s[d]);return R.vnode&&R.vnode(u),u}var ce,V,Ge,Dt,Ee=0,Mn=[],Me=[],Lt=R.__b,Mt=R.__r,Nt=R.diffed,Ot=R.__c,Ut=R.unmount;function ye(e,t){R.__h&&R.__h(V,e,Ee||t),Ee=0;var n=V.__H||(V.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:Me}),n.__[e]}function F(e){return Ee=1,vt(Hn,e)}function vt(e,t,n){var r=ye(ce++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Hn(void 0,t),function(d){var a=r.__N?r.__N[0]:r.__[0],u=r.t(a,d);a!==u&&(r.__N=[u,r.__[1]],r.__c.setState({}))}],r.__c=V,!V.u)){var o=function(d,a,u){if(!r.__c.__H)return!0;var h=r.__c.__H.__.filter(function(p){return p.__c});if(h.every(function(p){return!p.__N}))return!i||i.call(this,d,a,u);var c=!1;return h.forEach(function(p){if(p.__N){var m=p.__[0];p.__=p.__N,p.__N=void 0,m!==p.__[0]&&(c=!0)}}),!(!c&&r.__c.props===d)&&(!i||i.call(this,d,a,u))};V.u=!0;var i=V.shouldComponentUpdate,s=V.componentWillUpdate;V.componentWillUpdate=function(d,a,u){if(this.__e){var h=i;i=void 0,o(d,a,u),i=h}s&&s.call(this,d,a,u)},V.shouldComponentUpdate=o}return r.__N||r.__}function Z(e,t){var n=ye(ce++,3);!R.__s&&_t(n.__H,t)&&(n.__=e,n.i=t,V.__H.__h.push(n))}function Re(e,t){var n=ye(ce++,4);!R.__s&&_t(n.__H,t)&&(n.__=e,n.i=t,V.__h.push(n))}function ee(e){return Ee=5,Pe(function(){return{current:e}},[])}function Nn(e,t,n){Ee=6,Re(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},n==null?n:n.concat(e))}function Pe(e,t){var n=ye(ce++,7);return _t(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function Be(e,t){return Ee=8,Pe(function(){return e},t)}function On(e){var t=V.context[e.__c],n=ye(ce++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(V)),t.props.value):e.__}function ft(e,t){R.useDebugValue&&R.useDebugValue(t?t(e):e)}function Un(){var e=ye(ce++,11);if(!e.__){for(var t=V.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function zr(){for(var e;e=Mn.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Ne),e.__H.__h.forEach(lt),e.__H.__h=[]}catch(t){e.__H.__h=[],R.__e(t,e.__v)}}R.__b=function(e){V=null,Lt&&Lt(e)},R.__r=function(e){Mt&&Mt(e),ce=0;var t=(V=e.__c).__H;t&&(Ge===V?(t.__h=[],V.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=Me,n.__N=n.i=void 0})):(t.__h.forEach(Ne),t.__h.forEach(lt),t.__h=[],ce=0)),Ge=V},R.diffed=function(e){Nt&&Nt(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Mn.push(t)!==1&&Dt===R.requestAnimationFrame||((Dt=R.requestAnimationFrame)||Fr)(zr)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==Me&&(n.__=n.__V),n.i=void 0,n.__V=Me})),Ge=V=null},R.__c=function(e,t){t.some(function(n){try{n.__h.forEach(Ne),n.__h=n.__h.filter(function(r){return!r.__||lt(r)})}catch(r){t.some(function(o){o.__h&&(o.__h=[])}),t=[],R.__e(r,n.__v)}}),Ot&&Ot(e,t)},R.unmount=function(e){Ut&&Ut(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{Ne(r)}catch(o){t=o}}),n.__H=void 0,t&&R.__e(t,n.__v))};var Ht=typeof requestAnimationFrame=="function";function Fr(e){var t,n=function(){clearTimeout(r),Ht&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);Ht&&(t=requestAnimationFrame(n))}function Ne(e){var t=V,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),V=t}function lt(e){var t=V;e.__c=e.__(),V=t}function _t(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function Hn(e,t){return typeof t=="function"?t(e):t}function An(e,t){for(var n in t)e[n]=t[n];return e}function dt(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var r in t)if(r!=="__source"&&e[r]!==t[r])return!0;return!1}function qe(e){this.props=e}function Bn(e,t){function n(o){var i=this.props.ref,s=i==o.ref;return!s&&i&&(i.call?i(null):i.current=null),t?!t(this.props,o)||!s:dt(this.props,o)}function r(o){return this.shouldComponentUpdate=n,z(e,o)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(qe.prototype=new ne).isPureReactComponent=!0,qe.prototype.shouldComponentUpdate=function(e,t){return dt(this.props,e)||dt(this.state,t)};var At=R.__b;R.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),At&&At(e)};var $r=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function bt(e){function t(n){var r=An({},n);return delete r.ref,e(r,n.ref||null)}return t.$$typeof=$r,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var Bt=function(e,t){return e==null?null:de(de(e).map(t))},qn={map:Bt,forEach:Bt,count:function(e){return e?de(e).length:0},only:function(e){var t=de(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:de},Wr=R.__e;R.__e=function(e,t,n,r){if(e.then){for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t)}Wr(e,t,n,r)};var qt=R.unmount;function Vn(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),e.__c.__H=null),(e=An({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return Vn(r,t,n)})),e}function zn(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return zn(r,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function je(){this.__u=0,this.t=null,this.__b=null}function Fn(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function $n(e){var t,n,r;function o(i){if(t||(t=e()).then(function(s){n=s.default||s},function(s){r=s}),r)throw r;if(!n)throw t;return z(n,i)}return o.displayName="Lazy",o.__f=!0,o}function ke(){this.u=null,this.o=null}R.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),qt&&qt(e)},(je.prototype=new ne).__c=function(e,t){var n=t.__c,r=this;r.t==null&&(r.t=[]),r.t.push(n);var o=Fn(r.__v),i=!1,s=function(){i||(i=!0,n.__R=null,o?o(d):d())};n.__R=s;var d=function(){if(!--r.__u){if(r.state.__a){var a=r.state.__a;r.__v.__k[0]=zn(a,a.__c.__P,a.__c.__O)}var u;for(r.setState({__a:r.__b=null});u=r.t.pop();)u.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(s,s)},je.prototype.componentWillUnmount=function(){this.t=[]},je.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=Vn(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&z(K,null,e.fallback);return o&&(o.__u&=-33),[z(K,null,t.__a?null:e.children),o]};var Vt=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};function Zr(e){return this.getChildContext=function(){return e.context},e.children}function Gr(e){var t=this,n=e.i;t.componentWillUnmount=function(){Ce(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),t.l||(t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(r){this.childNodes.push(r),t.i.appendChild(r)},insertBefore:function(r,o){this.childNodes.push(r),t.i.appendChild(r)},removeChild:function(r){this.childNodes.splice(this.childNodes.indexOf(r)>>>1,1),t.i.removeChild(r)}}),Ce(z(Zr,{context:t.context},e.__v),t.l)}function Wn(e,t){var n=z(Gr,{__v:e,i:t});return n.containerInfo=t,n}(ke.prototype=new ne).__a=function(e){var t=this,n=Fn(t.__v),r=t.o.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),Vt(t,e,r)):o()};n?n(i):i()}},ke.prototype.render=function(e){this.u=null,this.o=new Map;var t=de(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},ke.prototype.componentDidUpdate=ke.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,n){Vt(e,n,t)})};var Zn=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Kr=/^(?: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]/,Yr=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Qr=/[A-Z0-9]/g,Jr=typeof document<"u",Xr=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function Gn(e,t,n){return t.__k==null&&(t.textContent=""),Ce(e,t),typeof n=="function"&&n(),e?e.__c:null}function Kn(e,t,n){return Dn(e,t),typeof n=="function"&&n(),e?e.__c:null}ne.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(ne.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var zt=R.event;function eo(){}function to(){return this.cancelBubble}function no(){return this.defaultPrevented}R.event=function(e){return zt&&(e=zt(e)),e.persist=eo,e.isPropagationStopped=to,e.isDefaultPrevented=no,e.nativeEvent=e};var yt,ro={enumerable:!1,configurable:!0,get:function(){return this.class}},Ft=R.vnode;R.vnode=function(e){typeof e.type=="string"&&function(t){var n=t.props,r=t.type,o={};for(var i in n){var s=n[i];if(!(i==="value"&&"defaultValue"in n&&s==null||Jr&&i==="children"&&r==="noscript"||i==="class"||i==="className")){var d=i.toLowerCase();i==="defaultValue"&&"value"in n&&n.value==null?i="value":i==="download"&&s===!0?s="":d==="ondoubleclick"?i="ondblclick":d!=="onchange"||r!=="input"&&r!=="textarea"||Xr(n.type)?d==="onfocus"?i="onfocusin":d==="onblur"?i="onfocusout":Yr.test(i)?i=d:r.indexOf("-")===-1&&Kr.test(i)?i=i.replace(Qr,"-$&").toLowerCase():s===null&&(s=void 0):d=i="oninput",d==="oninput"&&o[i=d]&&(i="oninputCapture"),o[i]=s}}r=="select"&&o.multiple&&Array.isArray(o.value)&&(o.value=de(n.children).forEach(function(a){a.props.selected=o.value.indexOf(a.props.value)!=-1})),r=="select"&&o.defaultValue!=null&&(o.value=de(n.children).forEach(function(a){a.props.selected=o.multiple?o.defaultValue.indexOf(a.props.value)!=-1:o.defaultValue==a.props.value})),n.class&&!n.className?(o.class=n.class,Object.defineProperty(o,"className",ro)):(n.className&&!n.class||n.class&&n.className)&&(o.class=o.className=n.className),t.props=o}(e),e.$$typeof=Zn,Ft&&Ft(e)};var $t=R.__r;R.__r=function(e){$t&&$t(e),yt=e.__c};var Wt=R.diffed;R.diffed=function(e){Wt&&Wt(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value),yt=null};var Yn={ReactCurrentDispatcher:{current:{readContext:function(e){return yt.__n[e.__c].props.value}}}};function Qn(e){return z.bind(null,e)}function De(e){return!!e&&e.$$typeof===Zn}function Jn(e){return De(e)&&e.type===K}function Xn(e){return De(e)?qr.apply(null,arguments):e}function er(e){return!!e.__k&&(Ce(null,e),!0)}function tr(e){return e&&(e.base||e.nodeType===1&&e)||null}var nr=function(e,t){return e(t)},rr=function(e,t){return e(t)},or=K;function xt(e){e()}function ir(e){return e}function sr(){return[!1,xt]}var ar=Re,lr=De;function dr(e,t){var n=t(),r=F({h:{__:n,v:t}}),o=r[0].h,i=r[1];return Re(function(){o.__=n,o.v=t,Ke(o)&&i({h:o})},[e,n,t]),Z(function(){return Ke(o)&&i({h:o}),e(function(){Ke(o)&&i({h:o})})},[e]),n}function Ke(e){var t,n,r=e.v,o=e.__;try{var i=r();return!((t=o)===(n=i)&&(t!==0||1/t==1/n)||t!=t&&n!=n)}catch{return!0}}var oo={useState:F,useId:Un,useReducer:vt,useEffect:Z,useLayoutEffect:Re,useInsertionEffect:ar,useTransition:sr,useDeferredValue:ir,useSyncExternalStore:dr,startTransition:xt,useRef:ee,useImperativeHandle:Nn,useMemo:Pe,useCallback:Be,useContext:On,useDebugValue:ft,version:"17.0.2",Children:qn,render:Gn,hydrate:Kn,unmountComponentAtNode:er,createPortal:Wn,createElement:z,createContext:Ln,createFactory:Qn,cloneElement:Xn,createRef:jn,Fragment:K,isValidElement:De,isElement:lr,isFragment:Jn,findDOMNode:tr,Component:ne,PureComponent:qe,memo:Bn,forwardRef:bt,flushSync:rr,unstable_batchedUpdates:nr,StrictMode:or,Suspense:je,SuspenseList:ke,lazy:$n,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Yn};const io=Object.freeze(Object.defineProperty({__proto__:null,Children:qn,Component:ne,Fragment:K,PureComponent:qe,StrictMode:or,Suspense:je,SuspenseList:ke,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Yn,cloneElement:Xn,createContext:Ln,createElement:z,createFactory:Qn,createPortal:Wn,createRef:jn,default:oo,findDOMNode:tr,flushSync:rr,forwardRef:bt,hydrate:Kn,isElement:lr,isFragment:Jn,isValidElement:De,lazy:$n,memo:Bn,render:Gn,startTransition:xt,unmountComponentAtNode:er,unstable_batchedUpdates:nr,useCallback:Be,useContext:On,useDebugValue:ft,useDeferredValue:ir,useEffect:Z,useErrorBoundary:function(e){var t=ye(ce++,10),n=F();return t.__=e,V.componentDidCatch||(V.componentDidCatch=function(r,o){t.__&&t.__(r,o),n[1](r)}),[n[0],function(){n[1](void 0)}]},useId:Un,useImperativeHandle:Nn,useInsertionEffect:ar,useLayoutEffect:Re,useMemo:Pe,useReducer:vt,useRef:ee,useState:F,useSyncExternalStore:dr,useTransition:sr,version:"17.0.2"},Symbol.toStringTag,{value:"Module"})),Zt=e=>{let t;const n=new Set,r=(s,d)=>{const a=typeof s=="function"?s(t):s;if(!Object.is(a,t)){const u=t;t=d??typeof a!="object"?a:Object.assign({},t,a),n.forEach(h=>h(t,u))}},o=()=>t,i={setState:r,getState:o,subscribe:s=>(n.add(s),()=>n.delete(s)),destroy:()=>n.clear()};return t=e(r,o,i),i};function so(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ao(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var Gt={exports:{}},Ye={};const cr=ao(io);var Kt,Yt,Qt,Jt,Xt={exports:{}},Qe={};function lo(){return Yt||(Yt=1,Xt.exports=function(){if(Kt)return Qe;Kt=1;var e=cr,t=typeof Object.is=="function"?Object.is:function(a,u){return a===u&&(a!==0||1/a==1/u)||a!=a&&u!=u},n=e.useState,r=e.useEffect,o=e.useLayoutEffect,i=e.useDebugValue;function s(a){var u=a.getSnapshot;a=a.value;try{var h=u();return!t(a,h)}catch{return!0}}var d=typeof window>"u"||window.document===void 0||window.document.createElement===void 0?function(a,u){return u()}:function(a,u){var h=u(),c=n({inst:{value:h,getSnapshot:u}}),p=c[0].inst,m=c[1];return o(function(){p.value=h,p.getSnapshot=u,s(p)&&m({inst:p})},[a,h,u]),r(function(){return s(p)&&m({inst:p}),a(function(){s(p)&&m({inst:p})})},[a]),i(h),h};return Qe.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,Qe}()),Xt.exports}var co=(Jt||(Jt=1,Gt.exports=function(){if(Qt)return Ye;Qt=1;var e=cr,t=lo(),n=typeof Object.is=="function"?Object.is:function(a,u){return a===u&&(a!==0||1/a==1/u)||a!=a&&u!=u},r=t.useSyncExternalStore,o=e.useRef,i=e.useEffect,s=e.useMemo,d=e.useDebugValue;return Ye.useSyncExternalStoreWithSelector=function(a,u,h,c,p){var m=o(null);if(m.current===null){var g={hasValue:!1,value:null};m.current=g}else g=m.current;m=s(function(){function v(w){if(!T){if(T=!0,_=w,w=c(w),p!==void 0&&g.hasValue){var x=g.value;if(p(x,w))return f=x}return f=w}if(x=f,n(_,w))return x;var j=c(w);return p!==void 0&&p(x,j)?x:(_=w,f=j)}var _,f,T=!1,S=h===void 0?null:h;return[function(){return v(u())},S===null?void 0:function(){return v(S())}]},[u,h,c,p]);var b=r(a,m[0],m[1]);return i(function(){g.hasValue=!0,g.value=b},[b]),d(b),b},Ye}()),Gt.exports);const uo=so(co),{useSyncExternalStoreWithSelector:po}=uo,en=e=>{const t=typeof e=="function"?(r=>r?Zt(r):Zt)(e):e,n=(r,o)=>function(i,s=i.getState,d){const a=po(i.subscribe,i.getState,i.getServerState||i.getState,s,d);return ft(a),a}(t,r,o);return Object.assign(n,t),n},ur=e=>e?en(e):en,ho=1,mo=2,kt={eq:(e,t)=>e==t,neq(e,t){return!this.eq(e,t)},gt:(e,t)=>e>t,gte:(e,t)=>e>=t,lt:(e,t)=>e<t,lte:(e,t)=>e<=t,list_exact:(e,t)=>!(!Array.isArray(e)||!Array.isArray(t))&&e.slice().sort().join(",")===t.slice().sort().join(","),list_all:(e,t)=>!(!Array.isArray(e)||!Array.isArray(t))&&!t.some(n=>e.indexOf(n)===-1),list_alo(e,t){if(!Array.isArray(t))return!1;const n=Array.isArray(e)?e:[e],r=new Set(n);return t.some(o=>r.has(o))},list_dni(e,t){if(!Array.isArray(t))return!1;const n=Array.isArray(e)?e:[e],r=new Set(n);return t.every(o=>!r.has(o))},contains(e,t){const n=e.toLowerCase(),r=t.toLowerCase();return n.includes(r)},notcontains(e,t){return!this.contains(e,t)}},go=(e,t,n)=>{switch(t){case"videovoice":return!!(e&&e.value);case"open":return!!n;case"multipleselect":return!!(n&&Object.keys(n).length);case"recordedtask":return(n==null?void 0:n.taskStatus)==="completed";case"texturlprompt":return!e.value;case"consentlegal":case"nps":case"likert":return n!==null;case"multiplechoice":return n!==void 0;case"matrix":return!!(n&&Object.values(n).every(r=>r!==null));default:return!0}},pr=(e,t)=>{if(t==="matrix"){const n=Object.keys(e).length,r=Object.values(e).filter(o=>o!==null).length;return r>0&&r<n}return!1},hr=({cards:e,index:t,hasEndCard:n,allResponses:r,uploadProgress:o={}})=>{if(t>=e.length||t<0)return null;const i=e[t];let s=t+1;const d=i.props.routingOptions||[];for(let h=0;h<d.length;h++){const{group:c,target:p}=d[h];if(!(c!=null&&c.length))continue;const m=c[0];if(m.questionIndex===void 0||m.questionIndex>r.length)continue;let g=tn({comparator:m.comparator,response:r[m.questionIndex],type:i.type,value:m.value});for(let b=1;b<c.length;b+=2){const v=c[b],_=c[b+1],f=tn({comparator:_.comparator,response:r[_.questionIndex],type:e[_.questionIndex].type,value:_.value});v===ho?g&&(g=f):v===mo&&(g||(g=f))}if(g){s=p===-1&&n?e.length-1:p;break}}const a=e.findIndex(h=>h.type==="uploading");let u;return u=a>0?n?e.length-3:e.length-2:e.length-1,t>=u||s===-1||s!==null&&s>u?a>0&&Object.values(o).some(c=>c.isSubmitted&&!c.isComplete)?a:n?e.length-1:null:s===-1?null:s},tn=({comparator:e,response:t,type:n,value:r})=>{if(e==="answered")switch(n){case"texturlprompt":return t===void 0;case"consentlegal":return t&&t.submitted===!0;case"recordedtask":return"taskStatus"in t&&t.taskStatus==="completed";case"likert":case"nps":return Number.isInteger(t);case"matrix":return Object.values(t).every(o=>o!==null);case"multiplechoice":return t!==void 0;case"multipleselect":return(t==null?void 0:t.length)>0;case"open":return t&&t.length>0;case"videovoice":return!!(t!=null&&t.mediaRecordingUid);default:return!1}if(e==="given_up")return n!=="recordedtask"||"taskStatus"in t&&t.taskStatus==="given.up";if(e==="partial")return n==="matrix"&&pr(t,n);if(e==="skipped")switch(n){case"texturlprompt":return t==null?void 0:t.skipped;case"consentlegal":case"likert":case"nps":case"videovoice":return t===null;case"recordedtask":return"taskStatus"in t&&t.taskStatus==="abandoned";case"open":case"multipleselect":return(t==null?void 0:t.length)===0;case"multiplechoice":return t===void 0;case"matrix":return Object.values(t).every(o=>o===null);default:return!1}return kt[e](t,r)},vo=e=>{var r,o,i;switch(e.type){case"multipleselect":return e&&e.props&&e.props.options?e.props.options.length>13?e.props.options.map(s=>[s.value]):(t=e.props.options.map(s=>s.value),n=!e.props.properties.required,t.reduce((s,d)=>s.concat(s.map(a=>[...a,d])),[[]]).filter(s=>n||s.length>0)):null;case"multiplechoice":{if(!e||!e.props||!e.props.options)return null;const s=e.props.options.map(d=>d.value);return e.props.properties.required||s.push(void 0),s}case"matrix":{if(!((r=e==null?void 0:e.props)!=null&&r.options))return null;const s=e.props.properties.matrixColumn,d=e.props.options,a=d.reduce((h,c)=>(h[c.id]=null,h),{}),u=[{...a,[d[0].id]:s[0].value},d.reduce((h,c)=>(h[c.id]=s[0].value,h),{})];return e.props.properties.required||u.push(a),u}case"likert":{const s=Number((i=(o=e.props)==null?void 0:o.properties)==null?void 0:i.range)||5;return[...Array.from(Array(s).keys()).map(a=>a+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 s=[{taskStatus:"completed"},{taskStatus:"given.up"}];return e.props.properties.required||s.push({taskStatus:"abandoned"}),s}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,n},fo=e=>e in kt,_o=e=>typeof e=="object"&&e!==null&&"taskStatus"in e,bo=(e,t=[])=>t.reduce((n,r)=>{const{group:o,target:i}=r;if(!(o!=null&&o.length))return[...n];const s=o.filter(d=>!!Number(d)||typeof d=="object"&&d.questionIndex===e).map(d=>{const{comparator:a,value:u}=d;return{comparator:a,target:i,value:u}});return[...n,...s]},[]),Je=new Set(["thanks","uploading"]),U=ur()((e,t)=>({allResponses:[],answers:void 0,apiURL:"",border:"#000000",cards:[],close:async(n=$.APP_ID)=>{const r=t(),{fadeout:o,remove:i,trackHistory:s,studyType:d}=r;await o(n),Xe(r)||s({event:"closed"}),B.breadcrumbsLogger.info("SurveyClosing",{surveyId:r.surveyId}),$.ConflictingWidgets.enable(),i({initiator:B.DismissReason.Closed,studyType:d})},configureExitOnOverlayClick:()=>{},customMetadata:{},destroy:async n=>{const{eventEmitFn:r,fadeout:o,remove:i,studyType:s,surveyId:d}=t();r("survey.complete",d),await o(n),$.ConflictingWidgets.enable(),i({initiator:B.DismissReason.Complete,studyType:s})},endCard:{headline:""},envId:"",eventEmitFn:B.eventEmitter.emit.bind(B.eventEmitter),fadeout:async n=>{const{eventEmitFn:r,headers:o,viewDocument:i}=t();return B.shouldDirectEmbed(o)?Promise.resolve():(r(B.SprigEvent.SurveyFadingOut),new Promise(s=>{const d=i.getElementById(n);d?(d.addEventListener("transitionend",()=>{s()}),d.classList.remove("ul-app--visible")):s()}))},forceBrandedLogo:!1,frame:document.createElement("iframe"),handleClickEmbedButton:n=>{const{cards:r,eventEmitFn:o,index:i}=t();o(n,{qid:r[i].name,props:r[i].props}),e(()=>({hasViewedEmbed:!0}))},handleUploadUpdate:({mediaRecordingUid:n,isComplete:r,progressPct:o,isSubmitted:i})=>{var m,g,b;const{cards:s,destroy:d,index:a,uploadProgress:u}=t(),h=r||((m=u[n])==null?void 0:m.isComplete),c={...u,[n]:{progressPct:h?100:o||((g=u[n])==null?void 0:g.progressPct),isComplete:h,isSubmitted:i||((b=u[n])==null?void 0:b.isSubmitted)}};if(e({uploadProgress:c}),s[a].type!=="uploading")return;const p=Object.entries(u).every(([v,_])=>!_.isSubmitted||_.isComplete||n==v&&r);if(p&&a>=s.length-1)return d($.APP_ID);e({index:p?a+1:a,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,isPreview:!1,marketingUrl:"https://sprig.com",meta:{ch:0,cw:0,l:"",mode:null,p:"",sh:0,sw:0},mode:void 0,next:n=>{const{allResponses:r,cards:o,eventEmitFn:i,index:s,responseGroupUid:d,submit:a,trackHistory:u,uploadProgress:h,viewedCardCount:c}=t();e({minScrollableHeight:void 0});const p=Date.now(),m=[...o],g=m[s],{type:b}=n.data,v={...n.data},_=v.value;(P=>!Je.has(P.type))(g)&&(g.value=_),v.answeredAt=p,delete v.type;const f={response:v,responseGroupUid:d,questionIndex:s};let T=b==="multiplechoice"?Object.values(_).find(P=>P!==!1):_;b==="multipleselect"&&(T=m[s].props.options.reduce((P,y)=>(_[y.id]&&P.push(y.value),P),[]));const S=r.slice(0);S[s]=T,e({allResponses:S});const w=hr({cards:m,index:s,hasEndCard:!!n.endCard,uploadProgress:h,allResponses:S});if(w===null)return f.completedAt=p,a(f),void n.completeSurvey();Je.has(m[w].type)&&(f.completedAt=p);const x=a(f);Je.has(m[w].type)||x.finally(()=>{u({event:"seen",index:w})});const j=m[w];m[w]&&i&&i("survey.question",{qid:j.name,props:j.props}),e({cards:m,hasViewedEmbed:!1,index:w,viewedCardCount:c+1})},pendingRemoveIframeReason:null,previewKey:null,previewMode:void 0,recorder:()=>{},recorderEventEmitter:B.eventEmitter,resolveTrackedPromise:()=>{const{removeIframeIfReady:n}=t();e(r=>({unresolvedRequestCount:r.unresolvedRequestCount-1})),n()},responseGroupUid:"",remove:({initiator:n,studyType:r})=>{const{eventEmitFn:o,removeIframeIfReady:i,surveyId:s}=t();e({pendingRemoveIframeReason:n,studyType:r}),o(B.SprigEvent.SurveyCloseRequested,{name:B.SprigEvent.SurveyCloseRequested,initiator:n,studyType:r,"survey.id":s}),i()},removeIframeIfReady:()=>{const{eventEmitFn:n,pendingRemoveIframeReason:r,unresolvedRequestCount:o,studyType:i,surveyId:s}=t();r&&o===0&&(n(B.SprigEvent.SurveyWillClose,{name:B.SprigEvent.SurveyWillClose,initiator:r,studyType:i,"survey.id":s}),e({pendingRemoveIframeReason:null,studyType:i}))},seen:async()=>{const{trackHistory:n}=t();return n({event:"seen",isNew:!0})},slugName:null,showStripes:!1,showSurveyBrand:!1,styleNonce:"",submit:async({completedAt:n,questionIndex:r,response:o,responseGroupUid:i})=>{const s=t();if(!i||Xe(s))return;const d={responseGroupUid:i,meta:s.meta,customMetadata:s.customMetadata,responses:[o],completedAt:n,previewKey:s.previewKey},a=await s.trackPromise(B.sprigFetch(`${s.apiURL}/sdk/1/environments/${s.envId}/visitors/${s.userId}/responses/submit`,{body:JSON.stringify(d),headers:s.headers,method:"POST"}));a.ok?s.eventEmitFn(B.SprigEvent.QuestionAnswered,{...o,questionIndex:r,"survey.id":s.surveyId}):a.reportError&&(console.warn("[Sprig] (ERR-427) Failed to submit response",a.error),await s.trackPromise(nn(s,"submitResponse",a.error)))},surveyId:0,tabTitle:"",trackHistory:async({event:n,index:r,isNew:o=!1})=>{const i=t();if(Xe(i))return;const{cards:s,index:d}=i,a=r!==void 0?s[r]:s[d],u={sid:i.surveyId,qid:a.name,action:n,vid:i.userId,eid:i.envId,isNew:o,responseGroupUid:i.responseGroupUid,previewKey:i.previewKey},h=await i.trackPromise(B.sprigFetch(`${i.apiURL}/sdk/1/visitors/${i.userId}/surveys/${i.surveyId}/history`,{body:JSON.stringify(u),headers:i.headers,method:"POST"}));!h.ok&&h.reportError&&(console.warn("[Sprig] (ERR-428) Failed to track survey event",h.error),await i.trackPromise(nn(i,"trackHistory",h.error)))},trackPromise:async n=>{const{resolveTrackedPromise:r}=t();return e(o=>({unresolvedRequestCount:o.unresolvedRequestCount+1})),n.then(o=>(r(),o)).catch(o=>{throw r(),o})},unresolvedRequestCount:0,update:()=>{const{cards:n,index:r,headers:o,eventEmitFn:i,frame:s,useMobileStyling:d,surveyId:a,viewDocument:u}=t(),h=o["userleap-platform"]==="web",c=B.shouldDirectEmbed(o),p=n[r],m=p.type==="matrix"&&!(p.props.properties.displayMatrixAsAccordion||d);e({minScrollableHeight:void 0}),setTimeout(()=>{var _,f,T;!c&&!d&&((_=s==null?void 0:s.setWidth)==null||_.call(s,$.DEFAULT_WIDTH_PX));const[g,b,v]=$.calculateFrameDimensions(u,h&&!d,c);c?(i(B.SprigEvent.SurveyHeight,{name:B.SprigEvent.SurveyHeight,contentFrameHeight:g,"survey.id":a}),i(B.SprigEvent.SurveyWidth,{name:B.SprigEvent.SurveyWidth,contentFrameWidth:b,"survey.id":a})):((f=s.setHeight)==null||f.call(s,g),e({minScrollableHeight:v}),!d&&m&&((T=s.setWidth)==null||T.call(s,b)))},100)},uploadingCardViewed:!1,uploadProgress:{},useDesktopPrototype:void 0,useMobileStyling:!1,userId:"",viewDocument:window.document,viewedCardCount:0})),Xe=e=>!e.userId||e.meta&&e.meta.mode==="test"||e.isPreview||e.previewMode,nn=async(e,t,n)=>{const{mode:r,userId:o,envId:i,apiURL:s,headers:d,viewDocument:a}=e,u=a.documentElement,h={mode:r,screenWidth:window.screen.width,screenHeight:window.screen.height,clientWidth:u.clientWidth,clientHeight:u.clientHeight,location:window.location.href,language:window.navigator.language},c={action:t,err:{message:`${n==null?void 0:n.name} - ${n==null?void 0:n.message}`,stack:n==null?void 0:n.stack},meta:h,vid:o,envId:i};(await B.sprigFetch(`${s}/sdk/1/errors`,{method:"POST",headers:Object.assign({"x-ul-error":window.btoa(`userleap-${Date.now()}-error`)},d),body:JSON.stringify(c)})).ok||console.warn("[Sprig] (ERR-444) Failed to report error to API",n)},mr=e=>z("svg",{fill:"none",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",...e},z("path",{d:"M17 10L12 15L7 10",stroke:"#0B2330",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5})),gr=e=>z("svg",{fill:"none",height:10,viewBox:"0 0 10 10",width:10,xmlns:"http://www.w3.org/2000/svg",...e},z("path",{d:"M9.15377 1.30774L4.07685 8.23082L1.30762 5.00005",stroke:"white",strokeLinecap:"round",strokeWidth:2})),yo=({visible:e})=>l("div",{className:"sprig-check-background",style:{opacity:e?1:0},children:l(gr,{className:"sprig-check"})}),rn="250ms",xo=bt(({animate:e,children:t,header:n,isOpen:r,onClick:o,showHeaderCheck:i},s)=>{const d=ee(null),[a,u]=F(0),[h,c]=F("none"),[p,m]=F(!0);return Z(()=>{var b;const g=(b=d.current)==null?void 0:b.getBoundingClientRect();u(r&&g?g.height:0)},[r]),Z(()=>{!a&&r||!p||m(!1),c(e&&!p?`height ${rn} ease`:"none")},[e,p,a,r]),l("div",{className:"sprig-accordion",ref:s,children:[l("button",{className:"sprig-accordion-header-container",onClick:o,type:"button",children:[l("div",{className:"sprig-header-label-container",children:[l("span",{className:"sprig-header-label",children:n}),l(yo,{visible:i})]}),l(mr,{className:"sprig-caret",style:{transitionDuration:e?rn:"0",transform:r?"rotate(-180deg)":"none"}})]}),l("div",{className:"sprig-accordion-body",style:{transition:h,height:a},children:l("div",{ref:d,children:t})})]})}),M=(...e)=>e.filter(Boolean).join(" "),G=(e,t,n)=>{const r=t?"--mobile":"--desktop";return`${e+r} ${e+(n?`${r}_${n}`:"")} ${e}`},ko=(e,t)=>`${e} ${e}__${t}`,J=e=>l("button",{...e,className:M("ul-card-text__button",e.className),id:"ul-card-text__button"}),vr=()=>{const{viewDocument:e}=U(r=>({viewDocument:r.viewDocument})),[t,n]=F(!1);return Z(()=>{const r=e.querySelector(".sprig-question-body"),o=new ResizeObserver(()=>{window.requestAnimationFrame(()=>{n(!!(r&&$.isHTMLElement(r)&&r.scrollHeight>r.offsetHeight))})});return r&&o.observe(r),()=>{r&&o.unobserve(r)}},[e]),t},on=({plainText:e,richText:t,id:n,className:r,isHeader:o})=>t?l("div",{className:r,dangerouslySetInnerHTML:{__html:t},id:n}):e?l(o?"h1":"p",{className:r,id:n,children:e}):null,wo=()=>{const{cards:e,close:t,endCard:n,headers:r,index:o}=U(d=>({cards:d.cards,close:d.close,endCard:d.endCard,headers:d.headers,index:d.index,useMobileStyling:d.useMobileStyling})),i=e.length,s=Pe(()=>()=>t($.APP_ID),[t]);return["email","link"].includes(r["userleap-platform"])||n&&o+1===i?null:l("div",{"aria-label":"Close button",className:"close-btn",onClick:s,onKeyPress:d=>{d.key==="Enter"&&s()},role:"button",tabIndex:0,children:l("svg",{fill:"none",height:"16px",viewBox:"0 0 13 13",width:"16px",xmlns:"http://www.w3.org/2000/svg",children:l("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:"#262136"})})})},re=({message:e,properties:t})=>{const n=ee(null),r=t==null?void 0:t.captionText,o=vr();return l("div",{className:M("question-header-container","sprig-header-container",o?"sprig-border-bottom":null),ref:n,children:[l("div",{className:"question-header-button-container",children:[l(on,{className:"ul-question",id:"ul-question",isHeader:!0,plainText:e,richText:t==null?void 0:t.questionHtml}),l(wo,{})]}),l(on,{className:"ul-caption",id:"ul-caption",plainText:r,richText:t==null?void 0:t.captionHtml})]})},sn=({buttonText:e="View Prototype",handleClick:t})=>l("button",{className:"prototype-button",onClick:t,children:e},"prototype-btn"),ue=({defaultBody:e,embeddedType:t="prototype",properties:n})=>{var c;const{handleClickEmbedButton:r,hasViewedEmbed:o,headers:i,useDesktopPrototype:s}=U(p=>({handleClickEmbedButton:p.handleClickEmbedButton,hasViewedEmbed:p.hasViewedEmbed,headers:p.headers,useDesktopPrototype:p.useDesktopPrototype})),d=(n==null?void 0:n.conceptUrl)||((c=n==null?void 0:n.consentDocument)==null?void 0:c.url),a=window.innerWidth<$.EMBED_MOBILE_MAX_WIDTH,u=i["userleap-platform"],h=(p,m)=>{p.preventDefault(),r(m)};if(!s&&a&&!o&&d&&["email","link"].includes(u)){if(t==="prototype")return l(sn,{handleClick:p=>{h(p,"question.prototype.click")}});if(t==="pdf")return l(sn,{buttonText:(n==null?void 0:n.viewDocumentText)||"View Document",handleClick:p=>{h(p,"question.agreement.click")}})}return e()},fr=({isSelected:e,id:t,divId:n,themeColor:r})=>l("div",{"aria-checked":e,"aria-labelledby":`label-${t}`,className:"select-checkbox",id:n,role:"checkbox",style:e?{backgroundColor:r,borderColor:r,boxShadow:"none"}:{},tabIndex:0,children:e&&l(gr,{})}),_r=(e,t)=>{const n=ee(0);return()=>{if(e.current){const r=e.current;r.style.height="1px";const o=r.scrollHeight+(r.offsetHeight-r.clientHeight),i=parseInt(window.getComputedStyle(r).getPropertyValue("max-height")),s=o<=i?o:i;n.current!==s&&t(),n.current=s,r.style.height=`${s}px`}}},$e=({ariaLabel:e,border:t,choiceStyle:n={},label:r,isSelected:o,value:i,text:s,id:d,isRadio:a,useMobileStyling:u,error:h,allowTextEntry:c,noneOfTheAbove:p,promptText:m,onUserInputChanged:g})=>{const{styleNonce:b,viewDocument:v}=U(I=>({styleNonce:I.styleNonce,viewDocument:I.viewDocument})),[_,f]=F(!1);Eo(v,t,b);const T=({isSelected:I,userText:L})=>{g&&g({id:d,selected:I,value:i,userText:L,noneOfTheAbove:p})},S=I=>{I.stopPropagation(),T({isSelected:a||!o,userText:s}),f(!1)},w=()=>{_||f(!0)},x=()=>{_&&f(!1)},j={onClick:I=>S(I),onKeyPress:I=>(L=>{L.key!=="Enter"&&L.key!==" "||S(L)})(I)};"ontouchstart"in v.documentElement?(j.onTouchStart=x,j.onTouchCancel=x,j.onTouchEnd=x):(j.onMouseDown=w,j.onMouseLeave=x);const P=a?`radio-${d}`:`checkbox-${d}`,y=o||_?[Oe]:[],E=[...h?[br]:[],...y],k=r?{"aria-labelledby":`label-${d}`}:{"aria-label":e};return l("div",{className:M(G("choice",u),...E),id:`choice-div-${d}`,style:{...n,...h?{borderColor:$.ERROR_BORDER_COLOR}:{}},...j,children:[l("div",{className:M("choice-label-container"),children:[a?l("div",{...k,className:M("select-radio",...y),id:P,role:"radio",tabIndex:0}):l(fr,{divId:P,id:d,isSelected:o,themeColor:t}),r&&l("label",{className:M(G("select-label",u)),htmlFor:P,id:`label-${d}`,children:r})]}),c&&o&&l("div",{className:M("choice-text-entry-container",...y),children:l(Co,{onTextChange:I=>T({isSelected:o,userText:I}),promptText:m||"Please specify",textValue:s,useMobileStyling:u})})]})},Co=({promptText:e,textValue:t,onTextChange:n,useMobileStyling:r})=>{const o=ee(null),{update:i}=U(d=>({update:d.update})),s=_r(o,()=>i());return Z(()=>(s(),o.current&&o.current.focus(),()=>{i()}),[]),l("textarea",{"aria-label":e,"aria-multiline":"true","aria-placeholder":e,className:M(G("choice-text-input",r)),"data-gramm":"false",maxLength:5e3,name:"text",onChange:d=>{s(),d.stopPropagation(),n(d.currentTarget.value)},onClick:d=>{d.stopPropagation()},onKeyPress:d=>{d.stopPropagation()},placeholder:e,ref:o,role:"textbox",rows:1,value:t})},an="ul-select-style-element",Oe="ul-select-active-dynamic-style",br="ul-select-error-dynamic-style",Eo=(e,t,n)=>{let r=e.getElementById(an),o=!1;r||(r=e.createElement("style"),o=!0),r.tagName.toLowerCase()==="style"&&(r.id=an,n&&(r.nonce=n),r.textContent=So(t),o&&e.head.appendChild(r))},So=e=>`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=require("./core-nhbrlHf1.cjs"),U=require("./metricsReporter-DNdFkQ0C.cjs");var Te,R,wn,_e,Tt,Cn,it,En,Ie={},Sn=[],Ur=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Fe=Array.isArray;function le(e,t){for(var n in t)e[n]=t[n];return e}function jn(e){var t=e.parentNode;t&&t.removeChild(e)}function z(e,t,n){var r,o,i,s={};for(i in t)i=="key"?r=t[i]:i=="ref"?o=t[i]:s[i]=t[i];if(arguments.length>2&&(s.children=arguments.length>3?Te.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)s[i]===void 0&&(s[i]=e.defaultProps[i]);return Se(e,s,r,o,null)}function Se(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:o??++wn,__i:-1,__u:0};return o==null&&R.vnode!=null&&R.vnode(i),i}function In(){return{current:null}}function K(e){return e.children}function ne(e,t){this.props=e,this.context=t}function we(e,t){if(t==null)return e.__?we(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?we(e):null}function Tn(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return Tn(e)}}function st(e){(!e.__d&&(e.__d=!0)&&_e.push(e)&&!Ae.__r++||Tt!==R.debounceRendering)&&((Tt=R.debounceRendering)||Cn)(Ae)}function Ae(){var e,t,n,r,o,i,s,d,a;for(_e.sort(it);e=_e.shift();)e.__d&&(t=_e.length,r=void 0,i=(o=(n=e).__v).__e,d=[],a=[],(s=n.__P)&&((r=le({},o)).__v=o.__v+1,R.vnode&&R.vnode(r),mt(s,r,o,n.__n,s.ownerSVGElement!==void 0,32&o.__u?[i]:null,d,i??we(o),!!(32&o.__u),a),r.__.__k[r.__i]=r,Dn(d,r,a),r.__e!=i&&Tn(r)),_e.length>t&&_e.sort(it));Ae.__r=0}function Rn(e,t,n,r,o,i,s,d,a,u,h){var c,p,m,g,b,v=r&&r.__k||Sn,_=t.length;for(n.__d=a,function(f,T,S){var w,x,j,P,y,E=T.length,k=S.length,I=k,L=0;for(f.__k=[],w=0;w<E;w++)(x=f.__k[w]=(x=T[w])==null||typeof x=="boolean"||typeof x=="function"?null:typeof x=="string"||typeof x=="number"||typeof x=="bigint"||x.constructor==String?Se(null,x,null,null,x):Fe(x)?Se(K,{children:x},null,null,null):x.constructor===void 0&&x.__b>0?Se(x.type,x.props,x.key,x.ref?x.ref:null,x.__v):x)!=null?(x.__=f,x.__b=f.__b+1,y=Hr(x,S,P=w+L,I),x.__i=y,j=null,y!==-1&&(I--,(j=S[y])&&(j.__u|=131072)),j==null||j.__v===null?(y==-1&&L--,typeof x.type!="function"&&(x.__u|=65536)):y!==P&&(y===P+1?L++:y>P?I>E-P?L+=y-P:L--:L=y<P&&y==P-1?y-P:0,y!==w+L&&(x.__u|=65536))):(j=S[w])&&j.key==null&&j.__e&&(j.__e==f.__d&&(f.__d=we(j)),at(j,j,!1),S[w]=null,I--);if(I)for(w=0;w<k;w++)(j=S[w])!=null&&!(131072&j.__u)&&(j.__e==f.__d&&(f.__d=we(j)),at(j,j))}(n,t,v),a=n.__d,c=0;c<_;c++)(m=n.__k[c])!=null&&typeof m!="boolean"&&typeof m!="function"&&(p=m.__i===-1?Ie:v[m.__i]||Ie,m.__i=c,mt(e,m,p,o,i,s,d,a,u,h),g=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&>(p.ref,null,m),h.push(m.ref,m.__c||g,m)),b==null&&g!=null&&(b=g),65536&m.__u||p.__k===m.__k?a=Pn(m,a,e):typeof m.type=="function"&&m.__d!==void 0?a=m.__d:g&&(a=g.nextSibling),m.__d=void 0,m.__u&=-196609);n.__d=a,n.__e=b}function Pn(e,t,n){var r,o;if(typeof e.type=="function"){for(r=e.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=e,t=Pn(r[o],t,n));return t}return e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e),t&&t.nextSibling}function de(e,t){return t=t||[],e==null||typeof e=="boolean"||(Fe(e)?e.some(function(n){de(n,t)}):t.push(e)),t}function Hr(e,t,n,r){var o=e.key,i=e.type,s=n-1,d=n+1,a=t[n];if(a===null||a&&o==a.key&&i===a.type)return n;if(r>(a==null||131072&a.__u?0:1))for(;s>=0||d<t.length;){if(s>=0){if((a=t[s])&&!(131072&a.__u)&&o==a.key&&i===a.type)return s;s--}if(d<t.length){if((a=t[d])&&!(131072&a.__u)&&o==a.key&&i===a.type)return d;d++}}return-1}function Rt(e,t,n){t[0]==="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||Ur.test(t)?n:n+"px"}function Le(e,t,n,r,o){var i;e:if(t==="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||Rt(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||Rt(e.style,t,n[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]=n,n?r?n.u=r.u:(n.u=Date.now(),e.addEventListener(t,i?Dt:Pt,i)):e.removeEventListener(t,i?Dt:Pt,i);else{if(o)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]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,n))}}function Pt(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(R.event?R.event(e):e)}function Dt(e){return this.l[e.type+!0](R.event?R.event(e):e)}function mt(e,t,n,r,o,i,s,d,a,u){var h,c,p,m,g,b,v,_,f,T,S,w,x,j,P,y=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(a=!!(32&n.__u),i=[d=t.__e=n.__e]),(h=R.__b)&&h(t);e:if(typeof y=="function")try{if(_=t.props,f=(h=y.contextType)&&r[h.__c],T=h?f?f.props.value:h.__:r,n.__c?v=(c=t.__c=n.__c).__=c.__E:("prototype"in y&&y.prototype.render?t.__c=c=new y(_,T):(t.__c=c=new ne(_,T),c.constructor=y,c.render=Br),f&&f.sub(c),c.props=_,c.state||(c.state={}),c.context=T,c.__n=r,p=c.__d=!0,c.__h=[],c._sb=[]),c.__s==null&&(c.__s=c.state),y.getDerivedStateFromProps!=null&&(c.__s==c.state&&(c.__s=le({},c.__s)),le(c.__s,y.getDerivedStateFromProps(_,c.__s))),m=c.props,g=c.state,c.__v=t,p)y.getDerivedStateFromProps==null&&c.componentWillMount!=null&&c.componentWillMount(),c.componentDidMount!=null&&c.__h.push(c.componentDidMount);else{if(y.getDerivedStateFromProps==null&&_!==m&&c.componentWillReceiveProps!=null&&c.componentWillReceiveProps(_,T),!c.__e&&(c.shouldComponentUpdate!=null&&c.shouldComponentUpdate(_,c.__s,T)===!1||t.__v===n.__v)){for(t.__v!==n.__v&&(c.props=_,c.state=c.__s,c.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(E){E&&(E.__=t)}),S=0;S<c._sb.length;S++)c.__h.push(c._sb[S]);c._sb=[],c.__h.length&&s.push(c);break e}c.componentWillUpdate!=null&&c.componentWillUpdate(_,c.__s,T),c.componentDidUpdate!=null&&c.__h.push(function(){c.componentDidUpdate(m,g,b)})}if(c.context=T,c.props=_,c.__P=e,c.__e=!1,w=R.__r,x=0,"prototype"in y&&y.prototype.render){for(c.state=c.__s,c.__d=!1,w&&w(t),h=c.render(c.props,c.state,c.context),j=0;j<c._sb.length;j++)c.__h.push(c._sb[j]);c._sb=[]}else do c.__d=!1,w&&w(t),h=c.render(c.props,c.state,c.context),c.state=c.__s;while(c.__d&&++x<25);c.state=c.__s,c.getChildContext!=null&&(r=le(le({},r),c.getChildContext())),p||c.getSnapshotBeforeUpdate==null||(b=c.getSnapshotBeforeUpdate(m,g)),Rn(e,Fe(P=h!=null&&h.type===K&&h.key==null?h.props.children:h)?P:[P],t,n,r,o,i,s,d,a,u),c.base=t.__e,t.__u&=-161,c.__h.length&&s.push(c),v&&(c.__E=c.__=null)}catch(E){t.__v=null,a||i!=null?(t.__e=d,t.__u|=a?160:32,i[i.indexOf(d)]=null):(t.__e=n.__e,t.__k=n.__k),R.__e(E,t,n)}else i==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=Ar(n.__e,t,n,r,o,i,s,a,u);(h=R.diffed)&&h(t)}function Dn(e,t,n){t.__d=void 0;for(var r=0;r<n.length;r++)gt(n[r],n[++r],n[++r]);R.__c&&R.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(i){i.call(o)})}catch(i){R.__e(i,o.__v)}})}function Ar(e,t,n,r,o,i,s,d,a){var u,h,c,p,m,g,b,v=n.props,_=t.props,f=t.type;if(f==="svg"&&(o=!0),i!=null){for(u=0;u<i.length;u++)if((m=i[u])&&"setAttribute"in m==!!f&&(f?m.localName===f:m.nodeType===3)){e=m,i[u]=null;break}}if(e==null){if(f===null)return document.createTextNode(_);e=o?document.createElementNS("http://www.w3.org/2000/svg",f):document.createElement(f,_.is&&_),i=null,d=!1}if(f===null)v===_||d&&e.data===_||(e.data=_);else{if(i=i&&Te.call(e.childNodes),v=n.props||Ie,!d&&i!=null)for(v={},u=0;u<e.attributes.length;u++)v[(m=e.attributes[u]).name]=m.value;for(u in v)m=v[u],u=="children"||(u=="dangerouslySetInnerHTML"?c=m:u==="key"||u in _||Le(e,u,null,m,o));for(u in _)m=_[u],u=="children"?p=m:u=="dangerouslySetInnerHTML"?h=m:u=="value"?g=m:u=="checked"?b=m:u==="key"||d&&typeof m!="function"||v[u]===m||Le(e,u,m,v[u],o);if(h)d||c&&(h.__html===c.__html||h.__html===e.innerHTML)||(e.innerHTML=h.__html),t.__k=[];else if(c&&(e.innerHTML=""),Rn(e,Fe(p)?p:[p],t,n,r,o&&f!=="foreignObject",i,s,i?i[0]:n.__k&&we(n,0),d,a),i!=null)for(u=i.length;u--;)i[u]!=null&&jn(i[u]);d||(u="value",g!==void 0&&(g!==e[u]||f==="progress"&&!g||f==="option"&&g!==v[u])&&Le(e,u,g,v[u],!1),u="checked",b!==void 0&&b!==e[u]&&Le(e,u,b,v[u],!1))}return e}function gt(e,t,n){try{typeof e=="function"?e(t):e.current=t}catch(r){R.__e(r,n)}}function at(e,t,n){var r,o;if(R.unmount&&R.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||gt(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){R.__e(i,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&at(r[o],t,n||typeof e.type!="function");n||e.__e==null||jn(e.__e),e.__=e.__e=e.__d=void 0}function Br(e,t,n){return this.constructor(e,n)}function Ce(e,t,n){var r,o,i,s;R.__&&R.__(e,t),o=(r=typeof n=="function")?null:n&&n.__k||t.__k,i=[],s=[],mt(t,e=(!r&&n||t).__k=z(K,null,[e]),o||Ie,Ie,t.ownerSVGElement!==void 0,!r&&n?[n]:o?null:t.firstChild?Te.call(t.childNodes):null,i,!r&&n?n:o?o.__e:t.firstChild,r,s),Dn(i,e,s)}function Ln(e,t){Ce(e,t,Ln)}function qr(e,t,n){var r,o,i,s,d=le({},e.props);for(i in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)i=="key"?r=t[i]:i=="ref"?o=t[i]:d[i]=t[i]===void 0&&s!==void 0?s[i]:t[i];return arguments.length>2&&(d.children=arguments.length>3?Te.call(arguments,2):n),Se(e.type,d,r||e.key,o||e.ref,null)}function Mn(e,t){var n={__c:t="__cC"+En++,__:e,Consumer:function(r,o){return r.children(o)},Provider:function(r){var o,i;return this.getChildContext||(o=[],(i={})[t]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(s){this.props.value!==s.value&&o.some(function(d){d.__e=!0,st(d)})},this.sub=function(s){o.push(s);var d=s.componentWillUnmount;s.componentWillUnmount=function(){o.splice(o.indexOf(s),1),d&&d.call(s)}}),r.children}};return n.Provider.__=n.Consumer.contextType=n}Te=Sn.slice,R={__e:function(e,t,n,r){for(var o,i,s;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&i.getDerivedStateFromError!=null&&(o.setState(i.getDerivedStateFromError(e)),s=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,r||{}),s=o.__d),s)return o.__E=o}catch(d){e=d}throw e}},wn=0,ne.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=le({},this.state),typeof e=="function"&&(e=e(le({},n),this.props)),e&&le(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),st(this))},ne.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),st(this))},ne.prototype.render=K,_e=[],Cn=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,it=function(e,t){return e.__v.__b-t.__v.__b},Ae.__r=0,En=0;var Vr=0;function l(e,t,n,r,o,i){var s,d,a={};for(d in t)d=="ref"?s=t[d]:a[d]=t[d];var u={type:e,props:a,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--Vr,__i:-1,__u:0,__source:o,__self:i};if(typeof e=="function"&&(s=e.defaultProps))for(d in s)a[d]===void 0&&(a[d]=s[d]);return R.vnode&&R.vnode(u),u}var ce,V,Ge,Lt,Ee=0,Nn=[],Me=[],Mt=R.__b,Nt=R.__r,Ot=R.diffed,Ut=R.__c,Ht=R.unmount;function ye(e,t){R.__h&&R.__h(V,e,Ee||t),Ee=0;var n=V.__H||(V.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:Me}),n.__[e]}function F(e){return Ee=1,vt(An,e)}function vt(e,t,n){var r=ye(ce++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):An(void 0,t),function(d){var a=r.__N?r.__N[0]:r.__[0],u=r.t(a,d);a!==u&&(r.__N=[u,r.__[1]],r.__c.setState({}))}],r.__c=V,!V.u)){var o=function(d,a,u){if(!r.__c.__H)return!0;var h=r.__c.__H.__.filter(function(p){return p.__c});if(h.every(function(p){return!p.__N}))return!i||i.call(this,d,a,u);var c=!1;return h.forEach(function(p){if(p.__N){var m=p.__[0];p.__=p.__N,p.__N=void 0,m!==p.__[0]&&(c=!0)}}),!(!c&&r.__c.props===d)&&(!i||i.call(this,d,a,u))};V.u=!0;var i=V.shouldComponentUpdate,s=V.componentWillUpdate;V.componentWillUpdate=function(d,a,u){if(this.__e){var h=i;i=void 0,o(d,a,u),i=h}s&&s.call(this,d,a,u)},V.shouldComponentUpdate=o}return r.__N||r.__}function Z(e,t){var n=ye(ce++,3);!R.__s&&_t(n.__H,t)&&(n.__=e,n.i=t,V.__H.__h.push(n))}function Re(e,t){var n=ye(ce++,4);!R.__s&&_t(n.__H,t)&&(n.__=e,n.i=t,V.__h.push(n))}function ee(e){return Ee=5,Pe(function(){return{current:e}},[])}function On(e,t,n){Ee=6,Re(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},n==null?n:n.concat(e))}function Pe(e,t){var n=ye(ce++,7);return _t(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function Be(e,t){return Ee=8,Pe(function(){return e},t)}function Un(e){var t=V.context[e.__c],n=ye(ce++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(V)),t.props.value):e.__}function ft(e,t){R.useDebugValue&&R.useDebugValue(t?t(e):e)}function Hn(){var e=ye(ce++,11);if(!e.__){for(var t=V.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function zr(){for(var e;e=Nn.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Ne),e.__H.__h.forEach(lt),e.__H.__h=[]}catch(t){e.__H.__h=[],R.__e(t,e.__v)}}R.__b=function(e){V=null,Mt&&Mt(e)},R.__r=function(e){Nt&&Nt(e),ce=0;var t=(V=e.__c).__H;t&&(Ge===V?(t.__h=[],V.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=Me,n.__N=n.i=void 0})):(t.__h.forEach(Ne),t.__h.forEach(lt),t.__h=[],ce=0)),Ge=V},R.diffed=function(e){Ot&&Ot(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Nn.push(t)!==1&&Lt===R.requestAnimationFrame||((Lt=R.requestAnimationFrame)||Fr)(zr)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==Me&&(n.__=n.__V),n.i=void 0,n.__V=Me})),Ge=V=null},R.__c=function(e,t){t.some(function(n){try{n.__h.forEach(Ne),n.__h=n.__h.filter(function(r){return!r.__||lt(r)})}catch(r){t.some(function(o){o.__h&&(o.__h=[])}),t=[],R.__e(r,n.__v)}}),Ut&&Ut(e,t)},R.unmount=function(e){Ht&&Ht(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{Ne(r)}catch(o){t=o}}),n.__H=void 0,t&&R.__e(t,n.__v))};var At=typeof requestAnimationFrame=="function";function Fr(e){var t,n=function(){clearTimeout(r),At&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);At&&(t=requestAnimationFrame(n))}function Ne(e){var t=V,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),V=t}function lt(e){var t=V;e.__c=e.__(),V=t}function _t(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function An(e,t){return typeof t=="function"?t(e):t}function Bn(e,t){for(var n in t)e[n]=t[n];return e}function dt(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var r in t)if(r!=="__source"&&e[r]!==t[r])return!0;return!1}function qe(e){this.props=e}function qn(e,t){function n(o){var i=this.props.ref,s=i==o.ref;return!s&&i&&(i.call?i(null):i.current=null),t?!t(this.props,o)||!s:dt(this.props,o)}function r(o){return this.shouldComponentUpdate=n,z(e,o)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(qe.prototype=new ne).isPureReactComponent=!0,qe.prototype.shouldComponentUpdate=function(e,t){return dt(this.props,e)||dt(this.state,t)};var Bt=R.__b;R.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Bt&&Bt(e)};var $r=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function bt(e){function t(n){var r=Bn({},n);return delete r.ref,e(r,n.ref||null)}return t.$$typeof=$r,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var qt=function(e,t){return e==null?null:de(de(e).map(t))},Vn={map:qt,forEach:qt,count:function(e){return e?de(e).length:0},only:function(e){var t=de(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:de},Wr=R.__e;R.__e=function(e,t,n,r){if(e.then){for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t)}Wr(e,t,n,r)};var Vt=R.unmount;function zn(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),e.__c.__H=null),(e=Bn({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return zn(r,t,n)})),e}function Fn(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return Fn(r,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function je(){this.__u=0,this.t=null,this.__b=null}function $n(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Wn(e){var t,n,r;function o(i){if(t||(t=e()).then(function(s){n=s.default||s},function(s){r=s}),r)throw r;if(!n)throw t;return z(n,i)}return o.displayName="Lazy",o.__f=!0,o}function ke(){this.u=null,this.o=null}R.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Vt&&Vt(e)},(je.prototype=new ne).__c=function(e,t){var n=t.__c,r=this;r.t==null&&(r.t=[]),r.t.push(n);var o=$n(r.__v),i=!1,s=function(){i||(i=!0,n.__R=null,o?o(d):d())};n.__R=s;var d=function(){if(!--r.__u){if(r.state.__a){var a=r.state.__a;r.__v.__k[0]=Fn(a,a.__c.__P,a.__c.__O)}var u;for(r.setState({__a:r.__b=null});u=r.t.pop();)u.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(s,s)},je.prototype.componentWillUnmount=function(){this.t=[]},je.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=zn(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&z(K,null,e.fallback);return o&&(o.__u&=-33),[z(K,null,t.__a?null:e.children),o]};var zt=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};function Zr(e){return this.getChildContext=function(){return e.context},e.children}function Gr(e){var t=this,n=e.i;t.componentWillUnmount=function(){Ce(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),t.l||(t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(r){this.childNodes.push(r),t.i.appendChild(r)},insertBefore:function(r,o){this.childNodes.push(r),t.i.appendChild(r)},removeChild:function(r){this.childNodes.splice(this.childNodes.indexOf(r)>>>1,1),t.i.removeChild(r)}}),Ce(z(Zr,{context:t.context},e.__v),t.l)}function Zn(e,t){var n=z(Gr,{__v:e,i:t});return n.containerInfo=t,n}(ke.prototype=new ne).__a=function(e){var t=this,n=$n(t.__v),r=t.o.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),zt(t,e,r)):o()};n?n(i):i()}},ke.prototype.render=function(e){this.u=null,this.o=new Map;var t=de(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},ke.prototype.componentDidUpdate=ke.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,n){zt(e,n,t)})};var Gn=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Kr=/^(?: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]/,Yr=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Qr=/[A-Z0-9]/g,Jr=typeof document<"u",Xr=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function Kn(e,t,n){return t.__k==null&&(t.textContent=""),Ce(e,t),typeof n=="function"&&n(),e?e.__c:null}function Yn(e,t,n){return Ln(e,t),typeof n=="function"&&n(),e?e.__c:null}ne.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(ne.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Ft=R.event;function eo(){}function to(){return this.cancelBubble}function no(){return this.defaultPrevented}R.event=function(e){return Ft&&(e=Ft(e)),e.persist=eo,e.isPropagationStopped=to,e.isDefaultPrevented=no,e.nativeEvent=e};var yt,ro={enumerable:!1,configurable:!0,get:function(){return this.class}},$t=R.vnode;R.vnode=function(e){typeof e.type=="string"&&function(t){var n=t.props,r=t.type,o={};for(var i in n){var s=n[i];if(!(i==="value"&&"defaultValue"in n&&s==null||Jr&&i==="children"&&r==="noscript"||i==="class"||i==="className")){var d=i.toLowerCase();i==="defaultValue"&&"value"in n&&n.value==null?i="value":i==="download"&&s===!0?s="":d==="ondoubleclick"?i="ondblclick":d!=="onchange"||r!=="input"&&r!=="textarea"||Xr(n.type)?d==="onfocus"?i="onfocusin":d==="onblur"?i="onfocusout":Yr.test(i)?i=d:r.indexOf("-")===-1&&Kr.test(i)?i=i.replace(Qr,"-$&").toLowerCase():s===null&&(s=void 0):d=i="oninput",d==="oninput"&&o[i=d]&&(i="oninputCapture"),o[i]=s}}r=="select"&&o.multiple&&Array.isArray(o.value)&&(o.value=de(n.children).forEach(function(a){a.props.selected=o.value.indexOf(a.props.value)!=-1})),r=="select"&&o.defaultValue!=null&&(o.value=de(n.children).forEach(function(a){a.props.selected=o.multiple?o.defaultValue.indexOf(a.props.value)!=-1:o.defaultValue==a.props.value})),n.class&&!n.className?(o.class=n.class,Object.defineProperty(o,"className",ro)):(n.className&&!n.class||n.class&&n.className)&&(o.class=o.className=n.className),t.props=o}(e),e.$$typeof=Gn,$t&&$t(e)};var Wt=R.__r;R.__r=function(e){Wt&&Wt(e),yt=e.__c};var Zt=R.diffed;R.diffed=function(e){Zt&&Zt(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value),yt=null};var Qn={ReactCurrentDispatcher:{current:{readContext:function(e){return yt.__n[e.__c].props.value}}}};function Jn(e){return z.bind(null,e)}function De(e){return!!e&&e.$$typeof===Gn}function Xn(e){return De(e)&&e.type===K}function er(e){return De(e)?qr.apply(null,arguments):e}function xt(e){return!!e.__k&&(Ce(null,e),!0)}function tr(e){return e&&(e.base||e.nodeType===1&&e)||null}var nr=function(e,t){return e(t)},rr=function(e,t){return e(t)},or=K;function kt(e){e()}function ir(e){return e}function sr(){return[!1,kt]}var ar=Re,lr=De;function dr(e,t){var n=t(),r=F({h:{__:n,v:t}}),o=r[0].h,i=r[1];return Re(function(){o.__=n,o.v=t,Ke(o)&&i({h:o})},[e,n,t]),Z(function(){return Ke(o)&&i({h:o}),e(function(){Ke(o)&&i({h:o})})},[e]),n}function Ke(e){var t,n,r=e.v,o=e.__;try{var i=r();return!((t=o)===(n=i)&&(t!==0||1/t==1/n)||t!=t&&n!=n)}catch{return!0}}var oo={useState:F,useId:Hn,useReducer:vt,useEffect:Z,useLayoutEffect:Re,useInsertionEffect:ar,useTransition:sr,useDeferredValue:ir,useSyncExternalStore:dr,startTransition:kt,useRef:ee,useImperativeHandle:On,useMemo:Pe,useCallback:Be,useContext:Un,useDebugValue:ft,version:"17.0.2",Children:Vn,render:Kn,hydrate:Yn,unmountComponentAtNode:xt,createPortal:Zn,createElement:z,createContext:Mn,createFactory:Jn,cloneElement:er,createRef:In,Fragment:K,isValidElement:De,isElement:lr,isFragment:Xn,findDOMNode:tr,Component:ne,PureComponent:qe,memo:qn,forwardRef:bt,flushSync:rr,unstable_batchedUpdates:nr,StrictMode:or,Suspense:je,SuspenseList:ke,lazy:Wn,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Qn};const io=Object.freeze(Object.defineProperty({__proto__:null,Children:Vn,Component:ne,Fragment:K,PureComponent:qe,StrictMode:or,Suspense:je,SuspenseList:ke,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Qn,cloneElement:er,createContext:Mn,createElement:z,createFactory:Jn,createPortal:Zn,createRef:In,default:oo,findDOMNode:tr,flushSync:rr,forwardRef:bt,hydrate:Yn,isElement:lr,isFragment:Xn,isValidElement:De,lazy:Wn,memo:qn,render:Kn,startTransition:kt,unmountComponentAtNode:xt,unstable_batchedUpdates:nr,useCallback:Be,useContext:Un,useDebugValue:ft,useDeferredValue:ir,useEffect:Z,useErrorBoundary:function(e){var t=ye(ce++,10),n=F();return t.__=e,V.componentDidCatch||(V.componentDidCatch=function(r,o){t.__&&t.__(r,o),n[1](r)}),[n[0],function(){n[1](void 0)}]},useId:Hn,useImperativeHandle:On,useInsertionEffect:ar,useLayoutEffect:Re,useMemo:Pe,useReducer:vt,useRef:ee,useState:F,useSyncExternalStore:dr,useTransition:sr,version:"17.0.2"},Symbol.toStringTag,{value:"Module"})),Gt=e=>{let t;const n=new Set,r=(s,d)=>{const a=typeof s=="function"?s(t):s;if(!Object.is(a,t)){const u=t;t=d??typeof a!="object"?a:Object.assign({},t,a),n.forEach(h=>h(t,u))}},o=()=>t,i={setState:r,getState:o,subscribe:s=>(n.add(s),()=>n.delete(s)),destroy:()=>n.clear()};return t=e(r,o,i),i};function so(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ao(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var Kt={exports:{}},Ye={};const cr=ao(io);var Yt,Qt,Jt,Xt,en={exports:{}},Qe={};function lo(){return Qt||(Qt=1,en.exports=function(){if(Yt)return Qe;Yt=1;var e=cr,t=typeof Object.is=="function"?Object.is:function(a,u){return a===u&&(a!==0||1/a==1/u)||a!=a&&u!=u},n=e.useState,r=e.useEffect,o=e.useLayoutEffect,i=e.useDebugValue;function s(a){var u=a.getSnapshot;a=a.value;try{var h=u();return!t(a,h)}catch{return!0}}var d=typeof window>"u"||window.document===void 0||window.document.createElement===void 0?function(a,u){return u()}:function(a,u){var h=u(),c=n({inst:{value:h,getSnapshot:u}}),p=c[0].inst,m=c[1];return o(function(){p.value=h,p.getSnapshot=u,s(p)&&m({inst:p})},[a,h,u]),r(function(){return s(p)&&m({inst:p}),a(function(){s(p)&&m({inst:p})})},[a]),i(h),h};return Qe.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,Qe}()),en.exports}var co=(Xt||(Xt=1,Kt.exports=function(){if(Jt)return Ye;Jt=1;var e=cr,t=lo(),n=typeof Object.is=="function"?Object.is:function(a,u){return a===u&&(a!==0||1/a==1/u)||a!=a&&u!=u},r=t.useSyncExternalStore,o=e.useRef,i=e.useEffect,s=e.useMemo,d=e.useDebugValue;return Ye.useSyncExternalStoreWithSelector=function(a,u,h,c,p){var m=o(null);if(m.current===null){var g={hasValue:!1,value:null};m.current=g}else g=m.current;m=s(function(){function v(w){if(!T){if(T=!0,_=w,w=c(w),p!==void 0&&g.hasValue){var x=g.value;if(p(x,w))return f=x}return f=w}if(x=f,n(_,w))return x;var j=c(w);return p!==void 0&&p(x,j)?x:(_=w,f=j)}var _,f,T=!1,S=h===void 0?null:h;return[function(){return v(u())},S===null?void 0:function(){return v(S())}]},[u,h,c,p]);var b=r(a,m[0],m[1]);return i(function(){g.hasValue=!0,g.value=b},[b]),d(b),b},Ye}()),Kt.exports);const uo=so(co),{useSyncExternalStoreWithSelector:po}=uo,tn=e=>{const t=typeof e=="function"?(r=>r?Gt(r):Gt)(e):e,n=(r,o)=>function(i,s=i.getState,d){const a=po(i.subscribe,i.getState,i.getServerState||i.getState,s,d);return ft(a),a}(t,r,o);return Object.assign(n,t),n},ur=e=>e?tn(e):tn,ho=1,mo=2,wt={eq:(e,t)=>e==t,neq(e,t){return!this.eq(e,t)},gt:(e,t)=>e>t,gte:(e,t)=>e>=t,lt:(e,t)=>e<t,lte:(e,t)=>e<=t,list_exact:(e,t)=>!(!Array.isArray(e)||!Array.isArray(t))&&e.slice().sort().join(",")===t.slice().sort().join(","),list_all:(e,t)=>!(!Array.isArray(e)||!Array.isArray(t))&&!t.some(n=>e.indexOf(n)===-1),list_alo(e,t){if(!Array.isArray(t))return!1;const n=Array.isArray(e)?e:[e],r=new Set(n);return t.some(o=>r.has(o))},list_dni(e,t){if(!Array.isArray(t))return!1;const n=Array.isArray(e)?e:[e],r=new Set(n);return t.every(o=>!r.has(o))},contains(e,t){const n=e.toLowerCase(),r=t.toLowerCase();return n.includes(r)},notcontains(e,t){return!this.contains(e,t)}},go=(e,t,n)=>{switch(t){case"videovoice":return!!(e&&e.value);case"open":return!!n;case"multipleselect":return!!(n&&Object.keys(n).length);case"recordedtask":return(n==null?void 0:n.taskStatus)==="completed";case"texturlprompt":return!e.value;case"consentlegal":case"nps":case"likert":return n!==null;case"multiplechoice":return n!==void 0;case"matrix":return!!(n&&Object.values(n).every(r=>r!==null));default:return!0}},pr=(e,t)=>{if(t==="matrix"){const n=Object.keys(e).length,r=Object.values(e).filter(o=>o!==null).length;return r>0&&r<n}return!1},hr=({cards:e,index:t,hasEndCard:n,allResponses:r,uploadProgress:o={}})=>{if(t>=e.length||t<0)return null;const i=e[t];let s=t+1;const d=i.props.routingOptions||[];for(let h=0;h<d.length;h++){const{group:c,target:p}=d[h];if(!(c!=null&&c.length))continue;const m=c[0];if(m.questionIndex===void 0||m.questionIndex>r.length)continue;let g=nn({comparator:m.comparator,response:r[m.questionIndex],type:i.type,value:m.value});for(let b=1;b<c.length;b+=2){const v=c[b],_=c[b+1],f=nn({comparator:_.comparator,response:r[_.questionIndex],type:e[_.questionIndex].type,value:_.value});v===ho?g&&(g=f):v===mo&&(g||(g=f))}if(g){s=p===-1&&n?e.length-1:p;break}}const a=e.findIndex(h=>h.type==="uploading");let u;return u=a>0?n?e.length-3:e.length-2:e.length-1,t>=u||s===-1||s!==null&&s>u?a>0&&Object.values(o).some(c=>c.isSubmitted&&!c.isComplete)?a:n?e.length-1:null:s===-1?null:s},nn=({comparator:e,response:t,type:n,value:r})=>{if(e==="answered")switch(n){case"texturlprompt":return t===void 0;case"consentlegal":return t&&t.submitted===!0;case"recordedtask":return"taskStatus"in t&&t.taskStatus==="completed";case"likert":case"nps":return Number.isInteger(t);case"matrix":return Object.values(t).every(o=>o!==null);case"multiplechoice":return t!==void 0;case"multipleselect":return(t==null?void 0:t.length)>0;case"open":return t&&t.length>0;case"videovoice":return!!(t!=null&&t.mediaRecordingUid);default:return!1}if(e==="given_up")return n!=="recordedtask"||"taskStatus"in t&&t.taskStatus==="given.up";if(e==="partial")return n==="matrix"&&pr(t,n);if(e==="skipped")switch(n){case"texturlprompt":return t==null?void 0:t.skipped;case"consentlegal":case"likert":case"nps":case"videovoice":return t===null;case"recordedtask":return"taskStatus"in t&&t.taskStatus==="abandoned";case"open":case"multipleselect":return(t==null?void 0:t.length)===0;case"multiplechoice":return t===void 0;case"matrix":return Object.values(t).every(o=>o===null);default:return!1}return wt[e](t,r)},vo=e=>{var r,o,i;switch(e.type){case"multipleselect":return e&&e.props&&e.props.options?e.props.options.length>13?e.props.options.map(s=>[s.value]):(t=e.props.options.map(s=>s.value),n=!e.props.properties.required,t.reduce((s,d)=>s.concat(s.map(a=>[...a,d])),[[]]).filter(s=>n||s.length>0)):null;case"multiplechoice":{if(!e||!e.props||!e.props.options)return null;const s=e.props.options.map(d=>d.value);return e.props.properties.required||s.push(void 0),s}case"matrix":{if(!((r=e==null?void 0:e.props)!=null&&r.options))return null;const s=e.props.properties.matrixColumn,d=e.props.options,a=d.reduce((h,c)=>(h[c.id]=null,h),{}),u=[{...a,[d[0].id]:s[0].value},d.reduce((h,c)=>(h[c.id]=s[0].value,h),{})];return e.props.properties.required||u.push(a),u}case"likert":{const s=Number((i=(o=e.props)==null?void 0:o.properties)==null?void 0:i.range)||5;return[...Array.from(Array(s).keys()).map(a=>a+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 s=[{taskStatus:"completed"},{taskStatus:"given.up"}];return e.props.properties.required||s.push({taskStatus:"abandoned"}),s}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,n},fo=e=>e in wt,_o=e=>typeof e=="object"&&e!==null&&"taskStatus"in e,bo=(e,t=[])=>t.reduce((n,r)=>{const{group:o,target:i}=r;if(!(o!=null&&o.length))return[...n];const s=o.filter(d=>!!Number(d)||typeof d=="object"&&d.questionIndex===e).map(d=>{const{comparator:a,value:u}=d;return{comparator:a,target:i,value:u}});return[...n,...s]},[]),Je=new Set(["thanks","uploading"]),H=ur()((e,t)=>({allResponses:[],answers:void 0,apiURL:"",border:"#000000",cards:[],close:async(n=$.APP_ID)=>{const r=t(),{fadeout:o,remove:i,trackHistory:s,studyType:d}=r;await o(n),Xe(r)||s({event:"closed"}),U.breadcrumbsLogger.info("SurveyClosing",{surveyId:r.surveyId}),$.ConflictingWidgets.enable(),i({initiator:U.DismissReason.Closed,studyType:d})},configureExitOnOverlayClick:()=>{},customMetadata:{},destroy:async n=>{const{eventEmitFn:r,fadeout:o,remove:i,studyType:s,surveyId:d}=t();r("survey.complete",d),await o(n),$.ConflictingWidgets.enable(),i({initiator:U.DismissReason.Complete,studyType:s})},endCard:{headline:""},envId:"",eventEmitFn:U.eventEmitter.emit.bind(U.eventEmitter),fadeout:async n=>{const{eventEmitFn:r,headers:o,viewDocument:i}=t();return U.shouldDirectEmbed(o)?Promise.resolve():(r(U.SprigEvent.SurveyFadingOut),new Promise(s=>{const d=i.getElementById(n);d?(d.addEventListener("transitionend",()=>{s()}),d.classList.remove("ul-app--visible")):s()}))},forceBrandedLogo:!1,frame:document.createElement("iframe"),handleClickEmbedButton:n=>{const{cards:r,eventEmitFn:o,index:i}=t();o(n,{qid:r[i].name,props:r[i].props}),e(()=>({hasViewedEmbed:!0}))},handleUploadUpdate:({mediaRecordingUid:n,isComplete:r,progressPct:o,isSubmitted:i})=>{var m,g,b;const{cards:s,destroy:d,index:a,uploadProgress:u}=t(),h=r||((m=u[n])==null?void 0:m.isComplete),c={...u,[n]:{progressPct:h?100:o||((g=u[n])==null?void 0:g.progressPct),isComplete:h,isSubmitted:i||((b=u[n])==null?void 0:b.isSubmitted)}};if(e({uploadProgress:c}),s[a].type!=="uploading")return;const p=Object.entries(u).every(([v,_])=>!_.isSubmitted||_.isComplete||n==v&&r);if(p&&a>=s.length-1)return d($.APP_ID);e({index:p?a+1:a,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,isPreview:!1,marketingUrl:"https://sprig.com",meta:{ch:0,cw:0,l:"",mode:null,p:"",sh:0,sw:0},mode:void 0,next:n=>{const{allResponses:r,cards:o,eventEmitFn:i,index:s,responseGroupUid:d,submit:a,trackHistory:u,uploadProgress:h,viewedCardCount:c}=t();e({minScrollableHeight:void 0});const p=Date.now(),m=[...o],g=m[s],{type:b}=n.data,v={...n.data},_=v.value;(P=>!Je.has(P.type))(g)&&(g.value=_),v.answeredAt=p,delete v.type;const f={response:v,responseGroupUid:d,questionIndex:s};let T=b==="multiplechoice"?Object.values(_).find(P=>P!==!1):_;b==="multipleselect"&&(T=m[s].props.options.reduce((P,y)=>(_[y.id]&&P.push(y.value),P),[]));const S=r.slice(0);S[s]=T,e({allResponses:S});const w=hr({cards:m,index:s,hasEndCard:!!n.endCard,uploadProgress:h,allResponses:S});if(w===null)return f.completedAt=p,a(f),void n.completeSurvey();Je.has(m[w].type)&&(f.completedAt=p);const x=a(f);Je.has(m[w].type)||x.finally(()=>{u({event:"seen",index:w})});const j=m[w];m[w]&&i&&i("survey.question",{qid:j.name,props:j.props}),e({cards:m,hasViewedEmbed:!1,index:w,viewedCardCount:c+1})},pendingRemoveIframeReason:null,previewKey:null,previewMode:void 0,recorder:()=>{},recorderEventEmitter:U.eventEmitter,resolveTrackedPromise:()=>{const{removeIframeIfReady:n}=t();e(r=>({unresolvedRequestCount:r.unresolvedRequestCount-1})),n()},responseGroupUid:"",remove:({initiator:n,studyType:r})=>{const{eventEmitFn:o,removeIframeIfReady:i,surveyId:s}=t();e({pendingRemoveIframeReason:n,studyType:r}),o(U.SprigEvent.SurveyCloseRequested,{name:U.SprigEvent.SurveyCloseRequested,initiator:n,studyType:r,"survey.id":s}),i()},removeIframeIfReady:()=>{const{eventEmitFn:n,pendingRemoveIframeReason:r,unresolvedRequestCount:o,studyType:i,surveyId:s}=t();r&&o===0&&(n(U.SprigEvent.SurveyWillClose,{name:U.SprigEvent.SurveyWillClose,initiator:r,studyType:i,"survey.id":s}),e({pendingRemoveIframeReason:null,studyType:i}))},seen:async()=>{const{trackHistory:n}=t();return n({event:"seen",isNew:!0})},slugName:null,showStripes:!1,showSurveyBrand:!1,styleNonce:"",submit:async({completedAt:n,questionIndex:r,response:o,responseGroupUid:i})=>{const s=t();if(!i||Xe(s))return;const d={responseGroupUid:i,meta:s.meta,customMetadata:s.customMetadata,responses:[o],completedAt:n,previewKey:s.previewKey},a=await s.trackPromise(U.sprigFetch(`${s.apiURL}/sdk/1/environments/${s.envId}/visitors/${s.userId}/responses/submit`,{body:JSON.stringify(d),headers:s.headers,method:"POST"}));a.ok?s.eventEmitFn(U.SprigEvent.QuestionAnswered,{...o,questionIndex:r,"survey.id":s.surveyId}):a.reportError&&(console.warn("[Sprig] (ERR-427) Failed to submit response",a.error),await s.trackPromise(rn(s,"submitResponse",a.error)))},surveyId:0,tabTitle:"",trackHistory:async({event:n,index:r,isNew:o=!1})=>{const i=t();if(Xe(i))return;const{cards:s,index:d}=i,a=r!==void 0?s[r]:s[d],u={sid:i.surveyId,qid:a.name,action:n,vid:i.userId,eid:i.envId,isNew:o,responseGroupUid:i.responseGroupUid,previewKey:i.previewKey},h=await i.trackPromise(U.sprigFetch(`${i.apiURL}/sdk/1/visitors/${i.userId}/surveys/${i.surveyId}/history`,{body:JSON.stringify(u),headers:i.headers,method:"POST"}));!h.ok&&h.reportError&&(console.warn("[Sprig] (ERR-428) Failed to track survey event",h.error),await i.trackPromise(rn(i,"trackHistory",h.error)))},trackPromise:async n=>{const{resolveTrackedPromise:r}=t();return e(o=>({unresolvedRequestCount:o.unresolvedRequestCount+1})),n.then(o=>(r(),o)).catch(o=>{throw r(),o})},unresolvedRequestCount:0,update:()=>{const{cards:n,index:r,headers:o,eventEmitFn:i,frame:s,useMobileStyling:d,surveyId:a,viewDocument:u}=t(),h=o["userleap-platform"]==="web",c=U.shouldDirectEmbed(o),p=n[r],m=p.type==="matrix"&&!(p.props.properties.displayMatrixAsAccordion||d);e({minScrollableHeight:void 0}),setTimeout(()=>{var _,f,T;!c&&!d&&((_=s==null?void 0:s.setWidth)==null||_.call(s,$.DEFAULT_WIDTH_PX));const[g,b,v]=$.calculateFrameDimensions(u,h&&!d,c);c?(i(U.SprigEvent.SurveyHeight,{name:U.SprigEvent.SurveyHeight,contentFrameHeight:g,"survey.id":a}),i(U.SprigEvent.SurveyWidth,{name:U.SprigEvent.SurveyWidth,contentFrameWidth:b,"survey.id":a})):((f=s.setHeight)==null||f.call(s,g),e({minScrollableHeight:v}),!d&&m&&((T=s.setWidth)==null||T.call(s,b)))},100)},uploadingCardViewed:!1,uploadProgress:{},useDesktopPrototype:void 0,useMobileStyling:!1,userId:"",viewDocument:window.document,viewedCardCount:0})),Xe=e=>!e.userId||e.meta&&e.meta.mode==="test"||e.isPreview||e.previewMode,rn=async(e,t,n)=>{const{mode:r,userId:o,envId:i,apiURL:s,headers:d,viewDocument:a}=e,u=a.documentElement,h={mode:r,screenWidth:window.screen.width,screenHeight:window.screen.height,clientWidth:u.clientWidth,clientHeight:u.clientHeight,location:window.location.href,language:window.navigator.language},c={action:t,err:{message:`${n==null?void 0:n.name} - ${n==null?void 0:n.message}`,stack:n==null?void 0:n.stack},meta:h,vid:o,envId:i};(await U.sprigFetch(`${s}/sdk/1/errors`,{method:"POST",headers:Object.assign({"x-ul-error":window.btoa(`userleap-${Date.now()}-error`)},d),body:JSON.stringify(c)})).ok||console.warn("[Sprig] (ERR-444) Failed to report error to API",n)},mr=e=>z("svg",{fill:"none",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",...e},z("path",{d:"M17 10L12 15L7 10",stroke:"#0B2330",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5})),gr=e=>z("svg",{fill:"none",height:10,viewBox:"0 0 10 10",width:10,xmlns:"http://www.w3.org/2000/svg",...e},z("path",{d:"M9.15377 1.30774L4.07685 8.23082L1.30762 5.00005",stroke:"white",strokeLinecap:"round",strokeWidth:2})),yo=({visible:e})=>l("div",{className:"sprig-check-background",style:{opacity:e?1:0},children:l(gr,{className:"sprig-check"})}),on="250ms",xo=bt(({animate:e,children:t,header:n,isOpen:r,onClick:o,showHeaderCheck:i},s)=>{const d=ee(null),[a,u]=F(0),[h,c]=F("none"),[p,m]=F(!0);return Z(()=>{var b;const g=(b=d.current)==null?void 0:b.getBoundingClientRect();u(r&&g?g.height:0)},[r]),Z(()=>{!a&&r||!p||m(!1),c(e&&!p?`height ${on} ease`:"none")},[e,p,a,r]),l("div",{className:"sprig-accordion",ref:s,children:[l("button",{className:"sprig-accordion-header-container",onClick:o,type:"button",children:[l("div",{className:"sprig-header-label-container",children:[l("span",{className:"sprig-header-label",children:n}),l(yo,{visible:i})]}),l(mr,{className:"sprig-caret",style:{transitionDuration:e?on:"0",transform:r?"rotate(-180deg)":"none"}})]}),l("div",{className:"sprig-accordion-body",style:{transition:h,height:a},children:l("div",{ref:d,children:t})})]})}),M=(...e)=>e.filter(Boolean).join(" "),G=(e,t,n)=>{const r=t?"--mobile":"--desktop";return`${e+r} ${e+(n?`${r}_${n}`:"")} ${e}`},ko=(e,t)=>`${e} ${e}__${t}`,J=e=>l("button",{...e,className:M("ul-card-text__button",e.className),id:"ul-card-text__button"}),vr=()=>{const{viewDocument:e}=H(r=>({viewDocument:r.viewDocument})),[t,n]=F(!1);return Z(()=>{const r=e.querySelector(".sprig-question-body"),o=new ResizeObserver(()=>{window.requestAnimationFrame(()=>{n(!!(r&&$.isHTMLElement(r)&&r.scrollHeight>r.offsetHeight))})});return r&&o.observe(r),()=>{r&&o.disconnect()}},[e]),t},sn=({plainText:e,richText:t,id:n,className:r,isHeader:o})=>t?l("div",{className:r,dangerouslySetInnerHTML:{__html:t},id:n}):e?l(o?"h1":"p",{className:r,id:n,children:e}):null,wo=()=>{const{cards:e,close:t,endCard:n,headers:r,index:o}=H(d=>({cards:d.cards,close:d.close,endCard:d.endCard,headers:d.headers,index:d.index,useMobileStyling:d.useMobileStyling})),i=e.length,s=Pe(()=>()=>t($.APP_ID),[t]);return["email","link"].includes(r["userleap-platform"])||n&&o+1===i?null:l("div",{"aria-label":"Close button",className:"close-btn",onClick:s,onKeyPress:d=>{d.key==="Enter"&&s()},role:"button",tabIndex:0,children:l("svg",{fill:"none",height:"16px",viewBox:"0 0 13 13",width:"16px",xmlns:"http://www.w3.org/2000/svg",children:l("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:"#262136"})})})},re=({message:e,properties:t})=>{const n=ee(null),r=t==null?void 0:t.captionText,o=vr();return l("div",{className:M("question-header-container","sprig-header-container",o?"sprig-border-bottom":null),ref:n,children:[l("div",{className:"question-header-button-container",children:[l(sn,{className:"ul-question",id:"ul-question",isHeader:!0,plainText:e,richText:t==null?void 0:t.questionHtml}),l(wo,{})]}),l(sn,{className:"ul-caption",id:"ul-caption",plainText:r,richText:t==null?void 0:t.captionHtml})]})},an=({buttonText:e="View Prototype",handleClick:t})=>l("button",{className:"prototype-button",onClick:t,children:e},"prototype-btn"),ue=({defaultBody:e,embeddedType:t="prototype",properties:n})=>{var c;const{handleClickEmbedButton:r,hasViewedEmbed:o,headers:i,useDesktopPrototype:s}=H(p=>({handleClickEmbedButton:p.handleClickEmbedButton,hasViewedEmbed:p.hasViewedEmbed,headers:p.headers,useDesktopPrototype:p.useDesktopPrototype})),d=(n==null?void 0:n.conceptUrl)||((c=n==null?void 0:n.consentDocument)==null?void 0:c.url),a=window.innerWidth<$.EMBED_MOBILE_MAX_WIDTH,u=i["userleap-platform"],h=(p,m)=>{p.preventDefault(),r(m)};if(!s&&a&&!o&&d&&["email","link"].includes(u)){if(t==="prototype")return l(an,{handleClick:p=>{h(p,"question.prototype.click")}});if(t==="pdf")return l(an,{buttonText:(n==null?void 0:n.viewDocumentText)||"View Document",handleClick:p=>{h(p,"question.agreement.click")}})}return e()},fr=({isSelected:e,id:t,divId:n,themeColor:r})=>l("div",{"aria-checked":e,"aria-labelledby":`label-${t}`,className:"select-checkbox",id:n,role:"checkbox",style:e?{backgroundColor:r,borderColor:r,boxShadow:"none"}:{},tabIndex:0,children:e&&l(gr,{})}),_r=(e,t)=>{const n=ee(0);return()=>{if(e.current){const r=e.current;r.style.height="1px";const o=r.scrollHeight+(r.offsetHeight-r.clientHeight),i=parseInt(window.getComputedStyle(r).getPropertyValue("max-height")),s=o<=i?o:i;n.current!==s&&t(),n.current=s,r.style.height=`${s}px`}}},$e=({ariaLabel:e,border:t,choiceStyle:n={},label:r,isSelected:o,value:i,text:s,id:d,isRadio:a,useMobileStyling:u,error:h,allowTextEntry:c,noneOfTheAbove:p,promptText:m,onUserInputChanged:g})=>{const{styleNonce:b,viewDocument:v}=H(I=>({styleNonce:I.styleNonce,viewDocument:I.viewDocument})),[_,f]=F(!1);Eo(v,t,b);const T=({isSelected:I,userText:L})=>{g&&g({id:d,selected:I,value:i,userText:L,noneOfTheAbove:p})},S=I=>{I.stopPropagation(),T({isSelected:a||!o,userText:s}),f(!1)},w=()=>{_||f(!0)},x=()=>{_&&f(!1)},j={onClick:I=>S(I),onKeyPress:I=>(L=>{L.key!=="Enter"&&L.key!==" "||S(L)})(I)};"ontouchstart"in v.documentElement?(j.onTouchStart=x,j.onTouchCancel=x,j.onTouchEnd=x):(j.onMouseDown=w,j.onMouseLeave=x);const P=a?`radio-${d}`:`checkbox-${d}`,y=o||_?[Oe]:[],E=[...h?[br]:[],...y],k=r?{"aria-labelledby":`label-${d}`}:{"aria-label":e};return l("div",{className:M(G("choice",u),...E),id:`choice-div-${d}`,style:{...n,...h?{borderColor:$.ERROR_BORDER_COLOR}:{}},...j,children:[l("div",{className:M("choice-label-container"),children:[a?l("div",{...k,className:M("select-radio",...y),id:P,role:"radio",tabIndex:0}):l(fr,{divId:P,id:d,isSelected:o,themeColor:t}),r&&l("label",{className:M(G("select-label",u)),htmlFor:P,id:`label-${d}`,children:r})]}),c&&o&&l("div",{className:M("choice-text-entry-container",...y),children:l(Co,{onTextChange:I=>T({isSelected:o,userText:I}),promptText:m||"Please specify",textValue:s,useMobileStyling:u})})]})},Co=({promptText:e,textValue:t,onTextChange:n,useMobileStyling:r})=>{const o=ee(null),{update:i}=H(d=>({update:d.update})),s=_r(o,()=>i());return Z(()=>(s(),o.current&&o.current.focus(),()=>{i()}),[]),l("textarea",{"aria-label":e,"aria-multiline":"true","aria-placeholder":e,className:M(G("choice-text-input",r)),"data-gramm":"false",maxLength:5e3,name:"text",onChange:d=>{s(),d.stopPropagation(),n(d.currentTarget.value)},onClick:d=>{d.stopPropagation()},onKeyPress:d=>{d.stopPropagation()},placeholder:e,ref:o,role:"textbox",rows:1,value:t})},ln="ul-select-style-element",Oe="ul-select-active-dynamic-style",br="ul-select-error-dynamic-style",Eo=(e,t,n)=>{let r=e.getElementById(ln),o=!1;r||(r=e.createElement("style"),o=!0),r.tagName.toLowerCase()==="style"&&(r.id=ln,n&&(r.nonce=n),r.textContent=So(t),o&&e.head.appendChild(r))},So=e=>`
|
|
2
2
|
.${Oe} {
|
|
3
3
|
border-color: ${e};
|
|
4
4
|
}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
.${br} {
|
|
10
10
|
border-color: ${$.ERROR_BORDER_COLOR};
|
|
11
11
|
}
|
|
12
|
-
`,pe=({children:e})=>l("div",{className:"sprig-question-body",children:e}),ve=({children:e})=>{const t=vr();return l("div",{className:M("sprig-question-footer-container",t?"sprig-border-top":null),children:e})},xe=e=>(e==null?void 0:e.buttonText)||"Next",wt=e=>(e==null?void 0:e.skipButtonText)||"Skip",jo=({className:e,message:t,next:n,properties:r,questionId:o,type:i})=>{const{useMobileStyling:s,border:d}=U(y=>({useMobileStyling:y.useMobileStyling,border:y.border})),[a,u]=F(!1),[h,c]=F(""),[p,m]=F(!1),g=r==null?void 0:r.collectName,b=(r==null?void 0:r.nameLabelText)||"Full Name",v=(r==null?void 0:r.consentText)||"I agree to the stated conditions",_=(r==null?void 0:r.submitButtonText)||"Submit",f=!!h.trim(),T=a&&(!g||f),S=(y,E=!1)=>{y.preventDefault(),y.stopPropagation();let k=null;if(!E){if(!T)return void m(!0);k={submitted:!0},g&&(k.name=h)}n({value:k,questionId:o,type:i})},w=y=>{y.preventDefault(),y.stopPropagation(),c(y.currentTarget.value)},x=y=>{y.currentTarget.style.borderColor=p&&!f?$.ERROR_BORDER_COLOR:d},j=y=>{y.currentTarget.style.borderColor=p&&!f?$.ERROR_BORDER_COLOR:$.DEFAULT_BORDER_COLOR},P=()=>l(ve,{children:[l("div",{className:"sprig-stretch",children:[l($e,{allowTextEntry:!1,border:d,error:p&&!a,id:"consent",isRadio:!1,isSelected:a,label:v,onUserInputChanged:({selected:y})=>{y!==a&&u(!a)},useMobileStyling:s}),g&&l("input",{"aria-label":b,"aria-placeholder":b,className:M(G("ul-consent-legal__name-input",s)),"data-gramm":"false",maxLength:250,name:"name",onBlur:j,onFocus:x,onInput:w,placeholder:b,style:p&&!f?{borderColor:$.ERROR_BORDER_COLOR}:{},tabIndex:0,value:h})]}),l("div",{className:"ul-card__button-wrapper ul-card-vertical__button-wrapper",children:[l(J,{className:T?"":"sprig-button-disabled",onClick:S,children:_}),r.required===!1&&l("button",{className:"ul-card-skip__button",onClick:y=>S(y,!0),children:wt(r)})]})]});return l("div",{className:M(e,"ul-card__consent-legal","fade-in-transition"),children:[l(re,{message:t,properties:{questionHtml:r.questionHtml}}),l(K,{children:[r!=null&&r.richTextBody?l(pe,{children:l("div",{className:"ul-rich-text-body",dangerouslySetInnerHTML:r!=null&&r.richTextBody?{__html:r.richTextBody}:void 0,id:"ul-card__consent-legal-body-container"})}):null,l(ue,{properties:r,defaultBody:P,embeddedType:"pdf"})]})]},o)},Io=({activeValue:e,border:t,icon:n,isPressed:r,onSubmit:o,range:i,scaleLabelType:s,setActiveValue:d,setIsPressed:a,useMobileStyling:u,value:h,viewDocument:c})=>{const p=`option-${h}`,m=s==="number",g=s==="star",b=m&&h===e,[v,_]=h<=e&&g||h===e?r?[t,1]:[t,.3]:["",1];return l("button",{"aria-label":m?void 0:String(h),className:(()=>{switch(s){case"star":return M(G("likert-star",u),G(`likert-star-${h}`,u));case"smiley":return M(G("likert-smiley",u),G(`likert-smiley-${h}`,u));default:return h===i?M(G("likert-number",u),G(`likert-number-${h}`,u),G("likert-last-option",u)):M(G("likert-number",u),G(`likert-number-${h}`,u))}})(),dangerouslySetInnerHTML:{__html:n},id:p,onClick:()=>o(),onKeyDown:f=>{var w,x;const T=c.querySelectorAll(`.likert-${s??"number"}`),S=h-1;f.key==="ArrowRight"?(w=T[S+1])==null||w.focus():f.key==="ArrowLeft"?(x=T[S-1])==null||x.focus():f.key!=="Enter"&&f.key!==" "||o()},onPointerDown:()=>a(!0),onPointerEnter:()=>d(h),onPointerLeave:()=>{d(-1),a(!1)},style:{color:m?"":v,borderColor:b?v:"",fillOpacity:b?"":_,zIndex:b?3:"auto"},tabIndex:0})},To=({className:e,labels:t,message:n,next:r,properties:o,questionId:i,type:s})=>{const{border:d,useMobileStyling:a,viewDocument:u}=U(P=>({border:P.border,useMobileStyling:P.useMobileStyling,viewDocument:P.viewDocument})),[h,c]=F(-1),[p,m]=F(!1),g=t&&t.left,b=t&&t.right;let v;const{range:_,scaleLabelType:f,ratingIcons:T}=o;_&&(v=Number(_));const S=v||5,w=P=>{var y,E;switch(f){case"star":return(y=T[0])==null?void 0:y.svg;case"smiley":return(E=T[P])==null?void 0:E.svg;default:return String(P+1)}},x=[...Array(S)].map((P,y)=>{const E=y+1;return l(Io,{activeValue:h,border:d,icon:w(y),isPressed:p,onSubmit:()=>r({value:E,questionId:i,type:s}),range:S,scaleLabelType:f,setActiveValue:c,setIsPressed:m,useMobileStyling:a,value:E,viewDocument:u},y)}),j=P=>{P.preventDefault(),P.stopPropagation(),r({value:null,questionId:i,type:s})};return l("form",{className:M(e,"ul-card--likert","fade-in-transition"),children:[l(re,{message:n,properties:o}),l(ue,{properties:o,defaultBody:()=>l(K,{children:[l(pe,{children:[l("div",{"aria-label":`Rating (1 - ${S})`,className:"ul-card--likert__numbers",role:"radiogroup",children:x}),l("div",{className:"ul-card--likert__labels",children:[l("span",{children:g}),l("span",{children:b})]})]}),!o.required&&l(ve,{children:l("div",{className:"ul-vertical-centered-container",children:l(J,{onClick:j,children:xe(o)})})})]})})]},i)},yr=e=>e&&(e.scrollHeight>e.offsetHeight?e:yr(e.parentElement)),Ro=e=>{if(!e||!(n=>n instanceof HTMLElement)(e))return 0;const t=getComputedStyle(e);return parseFloat(t.marginTop)+parseFloat(t.marginBottom)+(parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth))},Po=({columns:e,onSelect:t,options:n,selectedOptions:r})=>{const o=ee([]),{border:i,useMobileStyling:s}=U(p=>({border:p.border,useMobileStyling:p.useMobileStyling})),d=n.findIndex(p=>r[p.id]===null),[a,u]=F(d),h=Be((p,m)=>{t(p,m);const g=a+1,b=n[g];if(b&&r[b.id]===null){u(g);const v=o.current[a];if(v!=null&&v.firstElementChild){const _=yr(v),f=v.firstElementChild,T=Ro(v)+f.clientHeight;_==null||_.scrollTo(0,v.offsetTop+T)}}},[t,n,r,a]),c=Be((p,m)=>{const g=a===p;return l(xo,{animate:!0,header:m.label,isOpen:g,onClick:()=>u(g&&!window.UserLeap.isMobileSDK?-1:p),ref:b=>{b&&(o.current[p]=b)},showHeaderCheck:r[m.id]!==null,children:l("div",{style:{paddingTop:"12px"},children:e.map(b=>l($e,{allowTextEntry:!1,ariaLabel:`${m.label}-${b.label}`,border:i,error:!1,id:`${m.id}-${b.value}`,isRadio:!0,isSelected:r[m.id]===b.value,label:b.label,onUserInputChanged:()=>h(m.id,b.value),useMobileStyling:s},b.label))})},m.id)},[i,e,a,h,r,s]);return l("div",{children:n.map((p,m)=>c(m,p))})},Do=({columns:e,onSelect:t,options:n,selectedOptions:r})=>{const{border:o,useMobileStyling:i}=U(c=>({border:c.border,useMobileStyling:c.useMobileStyling})),s=n.length,d=e.length,a=ee(null),[u,h]=F(!1);return Z(()=>{const c=a.current,p=new ResizeObserver(m=>{window.requestAnimationFrame(()=>{c&&h(Math.round(m[0].contentRect.width)<c.scrollWidth)})});return c&&p.observe(c),()=>{c&&p.unobserve(c)}},[]),l("div",{className:"ul-card--matrix_question_container",children:[l("div",{className:M("ul-card--matrix_container",u&&"ul-matrix-scroll-gradient"),onScroll:()=>{(()=>{const c=a.current;c&&h(c.clientWidth+Math.abs(c.scrollLeft)<c.scrollWidth)})()},ref:a,children:l("div",{className:"ul-card--matrix_grid",style:`--numColumns: ${d}; --numRows: ${s+1}`,children:[l("div",{})," ",e.map(c=>l("div",{className:"ul-matrix-column-label",children:c.label},c.label)),n.map(c=>l(K,{children:[l("div",{"aria-label":c.label,className:"ul-matrix-row-label",children:c.label},c.label),l("div",{className:"ul-matrix-row-options",role:"radiogroup",children:e.map((p,m)=>l("div",{className:M("ul-matrix-option-wrapper",m===d-1&&"ul-matrix-last-option"),children:l($e,{allowTextEntry:!1,ariaLabel:`${c.label}-${p.label}`,border:o,choiceStyle:{background:"transparent",border:"none",marginBottom:"0",padding:"0"},error:!1,id:`${c.id}-${p.value}`,isRadio:!0,isSelected:r[c.id]===p.value,onUserInputChanged:()=>t(c.id,p.value),useMobileStyling:i})},p.value))})]}))]})}),u&&l("button",{className:"ul-matrix-scroll-arrow",onClick:c=>{c.preventDefault();const p=a.current;if(p){const m=getComputedStyle(p).direction==="rtl";p.scrollLeft=m?p.clientWidth-p.scrollWidth:p.scrollWidth}},children:l("svg",{fill:"currentColor",height:"32",viewBox:"0 0 256 256",width:"32",xmlns:"http://www.w3.org/2000/svg",children:l("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"})})})]})},Lo=({className:e,message:t,next:n,options:r,properties:o,questionId:i,type:s})=>{const{useMobileStyling:d}=U(v=>({useMobileStyling:v.useMobileStyling})),a=o.matrixColumn,u=o.required,h=r.reduce((v,_)=>(v[_.id]=null,v),{}),[c,p]=F(h),m=(v,_)=>{p(f=>({...f,[v]:_}))},g=u&&Object.values(c).every(v=>v==null),b=o.displayMatrixAsAccordion||d;return l("form",{className:M(e,"fade-in-transition","ul-card__matrix"),id:"text-form",onSubmit:v=>{v.preventDefault(),v.stopPropagation(),n({value:c,questionId:i,type:s})},children:[l(re,{message:t,properties:o}),l(ue,{properties:o,defaultBody:()=>l(K,{children:[l(pe,{children:l(b?Po:Do,{columns:a,onSelect:m,options:r,selectedOptions:c})}),l(ve,{children:l("div",{className:"ul-card__button-wrapper",children:l(J,{disabled:g,children:xe(o)})})})]})})]},i)},Mo=({options:e,selectItem:t,selectedOptions:n,showCheckbox:r})=>{const{themeColor:o}=U(i=>({doc:i.viewDocument,themeColor:i.border}));return l("div",{className:"select-list",children:e.map(i=>{return l("div",{className:"select-option",onClick:d=>{t(i),d.stopPropagation()},role:"option",children:[r&&l(fr,{divId:(s=i.id,`checkbox-div-${s}`),id:i.id,isSelected:n.includes(i),themeColor:o}),i.label]},i.id);var s})})},No=({isMultiSelect:e=!1,multiselectText:t="choices selected",onChange:n,options:r,placeholderText:o,value:i})=>{const[s,d]=F(!1),{viewDocument:a,update:u}=U(p=>({viewDocument:p.viewDocument,update:p.update})),h=()=>{d(!s),u()};Z(()=>{var m;const p=()=>{d(!1),u()};a.addEventListener("click",p);try{(m=window.parent)==null||m.addEventListener("click",p)}catch{window.addEventListener("click",p)}return()=>{var g;a.removeEventListener("click",p);try{(g=window.parent)==null||g.removeEventListener("click",p)}catch{window.removeEventListener("click",p)}}},[a,u]);const c=i.length===0?["select-button-placeholder"]:[];return l(K,{children:[l("button",{"aria-label":"choice dropdown button",className:M("select-button",...c),onClick:p=>{p.stopPropagation(),h()},type:"button",children:[l("span",{children:i.length===0?o:i.length===1?i[0].label:`${i.length} ${t}`}),l(mr,{})]}),s&&l(Mo,{options:r,selectedOptions:i,selectItem:p=>{var b;const m=i.some(v=>v.id===p.id),g=i.some(v=>{var _;return(_=v.optionProperties)==null?void 0:_.noneOfTheAbove});(b=p.optionProperties)!=null&&b.noneOfTheAbove&&!m?n([p]):e?n(m?i.filter(v=>v.id!==p.id):g?[p]:[...i,p]):m||n([p]),e||h()},showCheckbox:e})]})},xr=({className:e,message:t,onSubmit:n,options:r=[],properties:o,questionId:i,type:s})=>{const{border:d,useMobileStyling:a}=U(w=>({border:w.border,useMobileStyling:w.useMobileStyling})),u=r.reduce((w,x)=>(w[x.id]={isSelected:!1},w),{}),[h,c]=F(u),p=s==="multiplechoice",m=o.required,g=r.find(w=>{var x;return(x=w.optionProperties)==null?void 0:x.noneOfTheAbove}),b=Object.entries(h).some(([w,x])=>{var y;const j=r.find(E=>`${E.id}`===w),P=x.userText===void 0||x.userText.trim()==="";return((y=j==null?void 0:j.optionProperties)==null?void 0:y.allowsTextEntry)&&P&&x.isSelected}),v=Object.values(h).some(w=>w.isSelected),_=b||m&&!v,f=r.map(({id:w,label:x,value:j,optionProperties:P})=>{var I,L;const y=`${w}`,{allowsTextEntry:E,noneOfTheAbove:k}={allowsTextEntry:!1,noneOfTheAbove:!1,...P};return l($e,{allowTextEntry:E,border:d,error:!1,id:y,isRadio:p,isSelected:!!((I=h[y])!=null&&I.isSelected),label:x,noneOfTheAbove:k,onUserInputChanged:C=>S(C.id,C.selected,C.userText,C.noneOfTheAbove),promptText:"Please specify",text:(L=h[w])==null?void 0:L.userText,useMobileStyling:a,value:j},y)}),T=w=>{w.preventDefault(),w.stopPropagation(),n(h)},S=(w,x,j,P)=>{const y=Object.assign({},h);if((p||P)&&x)for(const E of Object.values(y))E.isSelected=!1,delete E.userText;else g&&!P&&h[g.id].isSelected&&(y[g.id].isSelected=!1);y[w]={isSelected:x,userText:j},c(y)};return l("form",{className:M(e,"ul-card--multiple","fade-in-transition"),id:"text-form",onSubmit:T,children:[l(re,{message:t,properties:o}),l(ue,{properties:o,defaultBody:()=>l(K,{children:[l(pe,{children:o.isDropdown?l(No,{isMultiSelect:!p,multiselectText:o.dropdownMultiselectedText??"choices selected",onChange:w=>{const x={...h};for(const j of r)w.includes(j)?x[j.id].isSelected=!0:x[j.id].isSelected=!1;c(x)},options:r,placeholderText:o.dropdownPlaceholderText??(p?"Select choice":"Select choice(s)"),value:r.filter(w=>h[w.id].isSelected)}):l("div",{className:M(G("ul-card__choices",a)),role:p?"radiogroup":"group",children:f})}),l(ve,{children:l("div",{className:"ul-card__button-wrapper",children:l(J,{disabled:_,onClick:T,children:xe(o)})})})]})})]},i)},Oo=e=>{const{questionId:t,type:n,next:r,options:o}=e;return l(xr,{...e,onSubmit:i=>{const s=Object.entries(i).find(([,c])=>c.isSelected)||[void 0,void 0],[d,a]=s,u=o.find(c=>`${c.id}`===d),h=a!=null&&a.userText?{[d]:{userText:a.userText}}:null;r({value:u&&d?{[d]:u.value}:{},secondaryValue:h,questionId:t,type:n})}})},Uo=e=>{const{questionId:t,type:n,next:r}=e;return l(xr,{...e,onSubmit:o=>{const i=Object.entries(o).reduce((d,[a,u])=>(d[a]=u.isSelected,d),{}),s=Object.entries(o).reduce((d,[a,u])=>{if(!u.userText)return d;const h=d||{};return h[a]={userText:u.userText},h},null);r({value:i,secondaryValue:s,questionId:t,type:n})}})},Ho=({className:e,props:{labels:t,message:n,properties:r},next:o,questionId:i,type:s})=>{const{border:d,useMobileStyling:a,viewDocument:u}=U(g=>({border:g.border,useMobileStyling:g.useMobileStyling,viewDocument:g.viewDocument})),h=t&&t.left,c=t&&t.right,p=[...Array(11)].map((g,b)=>l("button",{className:M(G("nps-number",a),G(`nps-number-${b}`,a)),id:`option-${b}`,onClick:()=>o({value:b,questionId:i,type:s}),onKeyDown:v=>{var f,T;const _=u.querySelectorAll("button.nps-number");v.key==="ArrowRight"?(f=_[b+1])==null||f.focus():v.key==="ArrowLeft"?(T=_[b-1])==null||T.focus():v.key!=="Enter"&&v.key!==" "||o({value:b,questionId:i,type:s})},onPointerDown:v=>{v.currentTarget.style.zIndex="2",v.currentTarget.style.borderColor=d},onPointerLeave:v=>{v.currentTarget.style.zIndex="auto",v.currentTarget.style.borderColor=$.DEFAULT_BORDER_COLOR},tabIndex:0,children:b},b)),m=g=>{g.preventDefault(),g.stopPropagation(),o({value:null,questionId:i,type:s})};return l("form",{className:M(e,"ul-card--nps","fade-in-transition"),children:[l(re,{message:n,properties:r}),l(ue,{properties:r,defaultBody:()=>l(K,{children:[l(pe,{children:[l("div",{className:"ul-card--nps__numbers",children:p}),l("div",{className:"ul-card--nps__labels",children:[l("span",{children:h}),l("span",{children:c})]})]}),!r.required&&l(ve,{children:l("div",{className:"ul-vertical-centered-container",children:l(J,{onClick:m,children:xe(r)})})})]})})]},i)},Ao=({className:e,message:t,next:n,properties:r,questionId:o,type:i})=>{const{border:s,useMobileStyling:d,update:a}=U(S=>({border:S.border,useMobileStyling:S.useMobileStyling,update:S.update})),[u,h]=F(""),c=ee(null),p=u.trim(),m=r.required===!0&&!p,g=_r(c,()=>a()),b=S=>{g(),S.preventDefault(),S.stopPropagation(),h(S.currentTarget.value)},v=S=>{S.preventDefault(),S.stopPropagation(),n({value:u,questionId:o,type:i})},_=r&&r.openTextPlaceholder?r.openTextPlaceholder:"",f=S=>{S.currentTarget.style.borderColor=s},T=S=>{S.currentTarget.style.borderColor=$.DEFAULT_BORDER_COLOR};return l("form",{className:M(e,"ul-card--text","fade-in-transition"),id:"text-form",children:[l(re,{message:t,properties:r}),l(ue,{defaultBody:()=>l("div",{className:"ul-card-text",children:[l(pe,{children:l("div",{className:"ul-card-text__container",children:l("textarea",{"aria-labelledby":"ul-question","aria-describedby":"ul-caption","aria-multiline":"true","aria-placeholder":_,className:M(G("ul-card-text__input",d)),"data-gramm":"false",maxLength:5e3,name:"text",onBlur:T,onChange:b,onFocus:f,placeholder:_,ref:c,role:"textbox",tabIndex:0})})}),l(ve,{children:[l(J,{disabled:m,onClick:v,children:xe(r)}),r.footerHtml&&l("div",{className:"footer",dangerouslySetInnerHTML:{__html:r.footerHtml}})]})]}),properties:r})]},o)},ct=1,kr=2,wr=3,Ve=e=>e.type==="av_permission",ln=e=>e.type==="screen_permission",Cr=(e,t)=>e===void 0?ct:e?((n,r)=>!(Ve(r)?r.permissionDescriptors:[]).includes("camera")||n.getVideoTracks().length>0)(e,t)?wr:ct:kr,dn={avStream:null,currentPage:null,mediaRecordingUids:null,nextQuestion:()=>{},passthroughData:void 0,recordingMediaTypes:void 0,screenPermissionRequested:!1,type:void 0},se=ur(e=>({...dn,reset:()=>{e(dn)},updatePage:t=>{e(t)}}));function ut({currentPage:e,pages:t}){const{avStream:n,recordingMediaTypes:r,updatePage:o}=se.getState(),{recorderEventEmitter:i}=U.getState();i.emit("av.permission",{"permission.descriptors":e.permissionDescriptors,"stream.ready":(s,d)=>{if(n===s)return;let a=e;if(s&&!e.permissionDescriptors.includes("camera")){const u=t.indexOf(e),h=d!=null&&d.active?u+2:u+1;d!=null&&d.active&&r&&i.emit("begin.recording",{"recording.media.types":r,"start.recording.callback":c=>o({mediaRecordingUids:c})}),a=t[h]}o({currentPage:a,avStream:s})}})}function pt({status:e}){const{nextQuestion:t,passthroughData:n,mediaRecordingUids:r,reset:o}=se.getState(),{recorderEventEmitter:i,handleUploadUpdate:s,index:d}=U.getState(),a={value:{taskStatus:e},type:"recordedtask",questionId:(n==null?void 0:n.questionId)||1};n&&i.emit("finish.task",{"begin.callback":u=>{s({mediaRecordingUid:u,isSubmitted:!0,progressPct:0,isComplete:!1})},"progress.callback":(u,h)=>{s({mediaRecordingUid:u,progressPct:h.detail,isSubmitted:!1,isComplete:!1})},"upload.callback":u=>{u&&s({mediaRecordingUid:u,isComplete:!0,isSubmitted:!0,progressPct:100})},"passthrough.data":n,"current.index":d,"task.response":a,"task.complete.callback":u=>{a.value.taskDurationMillisecond=u,r&&(a.value.mediaRecordingUids=r),o(),t(a)}})}function Ct({pages:e,setIsRequestingPermission:t}){const{recorderEventEmitter:n,eventEmitFn:r}=U.getState(),{updatePage:o,currentPage:i,recordingMediaTypes:s,screenPermissionRequested:d}=se.getState();if(!i)return;const a=e.indexOf(i);switch(i.type){case"av_permission":{const u=d?a+2:a+1;return d&&s&&n.emit("begin.recording",{"recording.media.types":s,"start.recording.callback":h=>{o({mediaRecordingUids:h})}}),void o({currentPage:e[u]})}case"screen_permission":return void n.emit("screen.permission",{"screen.permission.requested":t,"stream.ready.callback":(u,h)=>{const c=h?e[a+1]:i;h&&s&&n.emit("begin.recording",{"recording.media.types":s,"start.recording.callback":p=>{o({captureStream:h,mediaRecordingUids:p})}}),o({currentPage:c,screenPermissionRequested:!0,captureStream:h})}});case"start_task":return r("recorded.task.start"),n.emit("recorded.task.start"),n.emit("start.task"),void o({currentPage:e[a+1],screenPermissionRequested:!0});case"complete_task":return}}const Er="ul-permission-graphics-container",Sr="ul-permission-body",jr=M(Er,"ul_recorded-task-inset-spacing"),We=M("ul-horizontal-button-container","ul-horizontal-button-container-left"),Ir=({richTextBody:e})=>l("div",{className:"ul-rich-text-body",dangerouslySetInnerHTML:{__html:e},id:"ul-task-detail-container"}),Ze=({required:e,skipButtonText:t,bottom:n=!1})=>e?null:l(J,{className:M(n&&"ul-skip-button-below","ul-button-inactive"),onClick:pt.bind(null,{status:"abandoned"}),children:t||"Skip"}),Et=e=>{const{avStream:t,captureStream:n,recordingMediaTypes:r,updatePage:o}=se.getState(),i=(r==null?void 0:r.includes("audio"))||(r==null?void 0:r.includes("video"));Z(()=>{const s=setInterval(()=>{i&&t&&!t.active?o({avStream:null,currentPage:e[0]}):n&&n.active||o({captureStream:void 0,currentPage:e[i?1:0]})},1e3);return()=>clearInterval(s)},[t,n,i,e,r,o])},Bo=({content:e,pages:t,required:n})=>{const{buttonText:r,skipButtonText:o,taskDetail:i}=e;return Et(t),l("div",{className:"ul-task-page",children:[i&&l(Ir,{richTextBody:i}),l("div",{className:We,children:[l(J,{onClick:Ct.bind(null,{pages:t}),children:r}),l(Ze,{required:n,skipButtonText:o})]})]},"start-task")},qo=({content:e,pages:t,properties:n})=>{const{buttonText:r,skipButtonText:o}=e;Et(t);const i=l(ue,{properties:n,defaultBody:()=>l("div",{className:We,children:[l(J,{className:"ul-complete-task-button",onClick:pt.bind(null,{status:"completed"}),children:r}),l(J,{className:M("ul-button-inactive"),onClick:pt.bind(null,{status:"given.up"}),children:o})]})});return l("div",{className:"ul-task-page",children:[e.taskDetail&&l(Ir,{richTextBody:e.taskDetail}),i]},"complete-task")},Vo=({content:e,pages:t,required:n})=>{const{buttonText:r,skipButtonText:o}=e,[i]=U(a=>[a.tabTitle]),[s,d]=F(!1);return l("div",{children:[l("div",{className:jr,children:[l("p",{style:{marginTop:"auto"},children:e.selectTabText}),l("div",{className:"ul-select-tab-container",children:l("p",{className:Sr,children:i})})]}),l("div",{className:n?"":We,children:[l(J,{disabled:s,onClick:Ct.bind(null,{pages:t,setIsRequestingPermission:d}),children:r}),l(Ze,{required:n,skipButtonText:o})]})]})},zo=({content:e})=>l("div",{className:M(Er,"ul_permission_svg_container","ul_recorded-task-inset-spacing","ul-center-horizontally"),dangerouslySetInnerHTML:{__html:e.svg}},"ul-permission-request-graphic"),Fo=({content:e,pages:t,required:n})=>{const{permissionDeniedHeadline:r,permissionDeniedBody:o,skipButtonText:i,tryAgainButtonText:s}=e,d=Ve(t[0])?t[0]:null;return Z(()=>{const a=setInterval(()=>{d!==null&&ut({currentPage:d,pages:t})},1e3);return()=>clearInterval(a)},[d,t]),d?l("div",{children:[l("div",{className:jr,children:l("p",{className:"ul-av-permission-denied-paragraph",children:[l("span",{className:"ul-av-permission-denied-headline",children:r}),l("span",{className:Sr,children:o})]})}),l("div",{className:We,children:[l(J,{onClick:ut.bind(null,{currentPage:d,pages:t}),children:s}),l(Ze,{required:n,skipButtonText:i})]})]}):null},$o=({stream:e})=>l("video",{autoPlay:!0,className:M("ul_recorded-task-inset-spacing"),id:"ul-record-task-video-preview",muted:!0,ref:t=>{t&&(t.srcObject=e||null)}}),Wo=({content:e,pages:t,required:n})=>{const{skipButtonText:r}=e,{avStream:o}=se.getState();return Et(t),l("div",{children:[l($o,{stream:o}),l("div",{className:"ul-vertical-button-container-center",children:[l(J,{onClick:Ct.bind(null,{pages:t}),children:e.buttonText}),l(Ze,{bottom:!0,required:n,skipButtonText:r})]})]})},Zo=({properties:e})=>{const{pages:t,required:n}=e,{avStream:r,currentPage:o}=se.getState();if(o===void 0)return null;switch(o==null?void 0:o.type){case"av_permission":{const i=Cr(r,o);return i===ct?l(zo,{content:o}):l(i===kr?Fo:Wo,{content:o,pages:t,required:n})}case"screen_permission":return l(Vo,{content:o,pages:t,required:n});case"start_task":return l(Bo,{content:o,pages:t,required:n});case"complete_task":return l(qo,{content:o,pages:t,properties:e});default:return null}},Go=({className:e,properties:t,next:n,questionId:r})=>{const o=U(),{surveyId:i,responseGroupUid:s,userId:d}=o,a=se(),{screenPermissionRequested:u}=a,h=se(b=>b.avStream);let c=se(b=>b.currentPage);c||(c=function({pages:b,userId:v,responseGroupUid:_,surveyId:f,questionId:T,next:S}){const{updatePage:w}=se.getState(),{eventEmitFn:x,recorderEventEmitter:j}=U.getState(),P={questionId:T,surveyId:f,visitorId:v,responseGroupUid:_};let y=0;j.emit("recorded.task.permission.screen"),x("recorded.task.permission.screen"),j.emit("permission.status",{"permission.status.callback":(k,I,L,C)=>{const H=b[y],{type:O}=H,q=["screen"];if(Ve(H)){const{permissionDescriptors:A}=H,Y=A==null?void 0:A.includes("microphone"),W=A==null?void 0:A.includes("camera");Y&&q.push("audio"),W&&q.push("video"),(k!=null&&k.active&&!W||k!=null&&k.active&&I)&&y++}ln(b[y])&&L&&(y++,j.emit("begin.recording",{"recording.media.types":q,"start.recording.callback":A=>w({mediaRecordingUids:A})})),w({currentPage:b[y],avStream:k,screenPermissionRequested:L,nextQuestion:S,type:O,passthroughData:P,recordingMediaTypes:q,captureStream:C})}});const E=b[y];return E.type==="av_permission"&&ut({currentPage:E,pages:b}),E}({questionId:r,surveyId:i,next:b=>{n(b)},pages:t.pages,responseGroupUid:s,userId:d}));let p=c.headline,m=c.captionText;const g=Cr(h,c);return ln(c)&&u&&(p=c.permissionDeniedHeadline,m=c.permissionDeniedCaptionText),Ve(c)&&g===wr&&(p=c.permissionGrantedHeadline,m=c.permissionGrantedCaptionText),l("div",{className:M(e,"ul-center-horizontally","fade-in-transition"),children:[l(re,{message:p,properties:{captionText:m}}),l(pe,{children:l(Zo,{properties:t})})]})},Ko={"{{user_id}}":"externalUserId","{{email}}":"email"},Yo=({className:e,message:t,next:n,properties:r,questionId:o,type:i})=>{const{visitorAttributes:s}=U(p=>({visitorAttributes:p.visitorAttributes})),d=(p,m=!1)=>{n({value:m?{skipped:!0}:void 0,questionId:o,type:i})},a=p=>{p.key!=="Enter"&&p.key!==" "||n({value:void 0,questionId:o,type:i})},u=((p,m={})=>{if(!p)return p;try{const f=new URL(p);if(f.protocol!=="http:"&&f.protocol!=="https:")return}catch{return}let g=p;const b=[];for(const[f,T]of Object.entries(Ko))if(g.toLowerCase().includes(f))if(m[T]){const S=new RegExp(f,"gi");g=g.replace(S,m[T])}else b.push(f);if(b.length===0||!g.includes("?"))return g;const v=g.slice(0,g.indexOf("?")),_=g.slice(g.indexOf("?")+1).split("&").map(f=>f.split("=")).filter(f=>!b.includes(f[1]));return _.length===0?v:`${v}?${_.map(f=>f.join("=")).join("&")}`})(r&&r.buttonUrl,s);return l("div",{className:M(e,"ul-card__text-url-prompt","fade-in-transition"),children:[l(re,{message:t,properties:{questionHtml:r.questionHtml}}),l(pe,{children:(h=r==null?void 0:r.richTextBody,c=r==null?void 0:r.body,h?l("div",{className:"ul-rich-text-body",dangerouslySetInnerHTML:{__html:h},id:"ul-card__text-url-body-container"}):c?l("div",{className:"ul-rich-text-body",id:"ul-card__text-url-body-container",children:(c?c.split(/\n\s*\n/g):[]).map((p,m)=>l("p",{children:p},m))}):null)}),l(ue,{defaultBody:()=>l(ve,{children:l("div",{className:"ul-card-button-group",children:[l("a",{className:"ul-card-text__button ul-card__text-url-prompt-button",href:u,id:"ul-card-text__button",onClick:d,onKeyPress:a,rel:"noreferrer",role:u?"link":"button",tabIndex:0,target:"_blank",children:xe(r)}),r.required===!1&&l("button",{className:"ul-card-skip__button",onClick:p=>d(0,!0),children:wt(r)})]})}),properties:r})]},o);var h,c},Qo=({className:e,questionId:t})=>{const{border:n,destroy:r,endCard:o,forceBrandedLogo:i}=U(a=>({border:a.border,destroy:a.destroy,endCard:a.endCard,forceBrandedLogo:a.forceBrandedLogo}));Z(()=>{setTimeout(()=>{r($.APP_ID)},i?4e3:2e3)},[r,i]);const s=o&&o.subheader?l("p",{className:"ul-caption",children:o.subheader}):null,d=o&&o.headline?o.headline:"";return l("div",{className:M(e,"ul-card--thanks","fade-in-transition"),children:l("div",{children:l("div",{className:"ul-card--thanks-content",children:[l("div",{className:"ul-thanks-check",children:l("svg",{"aria-labelledby":"title",fill:"none",height:"99",viewBox:"0 0 81 99",width:"81",xmlns:"http://www.w3.org/2000/svg",children:[l("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:n,fillRule:"evenodd"}),l("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:n,fillRule:"evenodd"}),l("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"})]})}),l(re,{message:d}),s]})})},t)},be="https://cdn.sprig.com",D={document:void 0,videojs:void 0},St=e=>e+"-loading-spiner",Q="hidden",cn=".m3u8",et="questionId",tt="ul-video-recorder-camera-off-button",nt="ul-recording-in-session",Jo=[{type:"link",content:`${be}/dependencies/videojs-record-4.5.0.min.css`},{type:"script",content:`${be}/dependencies/RecordRTC-5.6.2.js`},{type:"script",content:`${be}/dependencies/adapter.8.0.0.min.js`},{type:"script",content:`${be}/dependencies/videojs-record-4.5.0.min.js`},{type:"script",content:`${be}/userleap-web-upchunk-v2.2.2.js`}],Tr=[{type:"link",content:`${be}/dependencies/video-js-7.18.0.min.css`},{type:"script",content:`${be}/dependencies/video-js-7.18.0.min.js`},{type:"style",content:`/* progress control styles */
|
|
12
|
+
`,pe=({children:e})=>l("div",{className:"sprig-question-body",children:e}),ve=({children:e})=>{const t=vr();return l("div",{className:M("sprig-question-footer-container",t?"sprig-border-top":null),children:e})},xe=e=>(e==null?void 0:e.buttonText)||"Next",Ct=e=>(e==null?void 0:e.skipButtonText)||"Skip",jo=({className:e,message:t,next:n,properties:r,questionId:o,type:i})=>{const{useMobileStyling:s,border:d}=H(y=>({useMobileStyling:y.useMobileStyling,border:y.border})),[a,u]=F(!1),[h,c]=F(""),[p,m]=F(!1),g=r==null?void 0:r.collectName,b=(r==null?void 0:r.nameLabelText)||"Full Name",v=(r==null?void 0:r.consentText)||"I agree to the stated conditions",_=(r==null?void 0:r.submitButtonText)||"Submit",f=!!h.trim(),T=a&&(!g||f),S=(y,E=!1)=>{y.preventDefault(),y.stopPropagation();let k=null;if(!E){if(!T)return void m(!0);k={submitted:!0},g&&(k.name=h)}n({value:k,questionId:o,type:i})},w=y=>{y.preventDefault(),y.stopPropagation(),c(y.currentTarget.value)},x=y=>{y.currentTarget.style.borderColor=p&&!f?$.ERROR_BORDER_COLOR:d},j=y=>{y.currentTarget.style.borderColor=p&&!f?$.ERROR_BORDER_COLOR:$.DEFAULT_BORDER_COLOR},P=()=>l(ve,{children:[l("div",{className:"sprig-stretch",children:[l($e,{allowTextEntry:!1,border:d,error:p&&!a,id:"consent",isRadio:!1,isSelected:a,label:v,onUserInputChanged:({selected:y})=>{y!==a&&u(!a)},useMobileStyling:s}),g&&l("input",{"aria-label":b,"aria-placeholder":b,className:M(G("ul-consent-legal__name-input",s)),"data-gramm":"false",maxLength:250,name:"name",onBlur:j,onFocus:x,onInput:w,placeholder:b,style:p&&!f?{borderColor:$.ERROR_BORDER_COLOR}:{},tabIndex:0,value:h})]}),l("div",{className:"ul-card__button-wrapper ul-card-vertical__button-wrapper",children:[l(J,{className:T?"":"sprig-button-disabled",onClick:S,children:_}),r.required===!1&&l("button",{className:"ul-card-skip__button",onClick:y=>S(y,!0),children:Ct(r)})]})]});return l("div",{className:M(e,"ul-card__consent-legal","fade-in-transition"),children:[l(re,{message:t,properties:{questionHtml:r.questionHtml}}),l(K,{children:[r!=null&&r.richTextBody?l(pe,{children:l("div",{className:"ul-rich-text-body",dangerouslySetInnerHTML:r!=null&&r.richTextBody?{__html:r.richTextBody}:void 0,id:"ul-card__consent-legal-body-container"})}):null,l(ue,{properties:r,defaultBody:P,embeddedType:"pdf"})]})]},o)},Io=({activeValue:e,border:t,icon:n,isPressed:r,onSubmit:o,range:i,scaleLabelType:s,setActiveValue:d,setIsPressed:a,useMobileStyling:u,value:h,viewDocument:c})=>{const p=`option-${h}`,m=s==="number",g=s==="star",b=m&&h===e,[v,_]=h<=e&&g||h===e?r?[t,1]:[t,.3]:["",1];return l("button",{"aria-label":m?void 0:String(h),className:(()=>{switch(s){case"star":return M(G("likert-star",u),G(`likert-star-${h}`,u));case"smiley":return M(G("likert-smiley",u),G(`likert-smiley-${h}`,u));default:return h===i?M(G("likert-number",u),G(`likert-number-${h}`,u),G("likert-last-option",u)):M(G("likert-number",u),G(`likert-number-${h}`,u))}})(),dangerouslySetInnerHTML:{__html:n},id:p,onClick:()=>o(),onKeyDown:f=>{var w,x;const T=c.querySelectorAll(`.likert-${s??"number"}`),S=h-1;f.key==="ArrowRight"?(w=T[S+1])==null||w.focus():f.key==="ArrowLeft"?(x=T[S-1])==null||x.focus():f.key!=="Enter"&&f.key!==" "||o()},onPointerDown:()=>a(!0),onPointerEnter:()=>d(h),onPointerLeave:()=>{d(-1),a(!1)},style:{color:m?"":v,borderColor:b?v:"",fillOpacity:b?"":_,zIndex:b?3:"auto"},tabIndex:0})},To=({className:e,labels:t,message:n,next:r,properties:o,questionId:i,type:s})=>{const{border:d,useMobileStyling:a,viewDocument:u}=H(P=>({border:P.border,useMobileStyling:P.useMobileStyling,viewDocument:P.viewDocument})),[h,c]=F(-1),[p,m]=F(!1),g=t&&t.left,b=t&&t.right;let v;const{range:_,scaleLabelType:f,ratingIcons:T}=o;_&&(v=Number(_));const S=v||5,w=P=>{var y,E;switch(f){case"star":return(y=T[0])==null?void 0:y.svg;case"smiley":return(E=T[P])==null?void 0:E.svg;default:return String(P+1)}},x=[...Array(S)].map((P,y)=>{const E=y+1;return l(Io,{activeValue:h,border:d,icon:w(y),isPressed:p,onSubmit:()=>r({value:E,questionId:i,type:s}),range:S,scaleLabelType:f,setActiveValue:c,setIsPressed:m,useMobileStyling:a,value:E,viewDocument:u},y)}),j=P=>{P.preventDefault(),P.stopPropagation(),r({value:null,questionId:i,type:s})};return l("form",{className:M(e,"ul-card--likert","fade-in-transition"),children:[l(re,{message:n,properties:o}),l(ue,{properties:o,defaultBody:()=>l(K,{children:[l(pe,{children:[l("div",{"aria-label":`Rating (1 - ${S})`,className:"ul-card--likert__numbers",role:"radiogroup",children:x}),l("div",{className:"ul-card--likert__labels",children:[l("span",{children:g}),l("span",{children:b})]})]}),!o.required&&l(ve,{children:l("div",{className:"ul-vertical-centered-container",children:l(J,{onClick:j,children:xe(o)})})})]})})]},i)},yr=e=>e&&(e.scrollHeight>e.offsetHeight?e:yr(e.parentElement)),Ro=e=>{if(!e||!(n=>n instanceof HTMLElement)(e))return 0;const t=getComputedStyle(e);return parseFloat(t.marginTop)+parseFloat(t.marginBottom)+(parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth))},Po=({columns:e,onSelect:t,options:n,selectedOptions:r})=>{const o=ee([]),{border:i,useMobileStyling:s}=H(p=>({border:p.border,useMobileStyling:p.useMobileStyling})),d=n.findIndex(p=>r[p.id]===null),[a,u]=F(d),h=Be((p,m)=>{t(p,m);const g=a+1,b=n[g];if(b&&r[b.id]===null){u(g);const v=o.current[a];if(v!=null&&v.firstElementChild){const _=yr(v),f=v.firstElementChild,T=Ro(v)+f.clientHeight;_==null||_.scrollTo(0,v.offsetTop+T)}}},[t,n,r,a]),c=Be((p,m)=>{const g=a===p;return l(xo,{animate:!0,header:m.label,isOpen:g,onClick:()=>u(g&&!window.UserLeap.isMobileSDK?-1:p),ref:b=>{b&&(o.current[p]=b)},showHeaderCheck:r[m.id]!==null,children:l("div",{style:{paddingTop:"12px"},children:e.map(b=>l($e,{allowTextEntry:!1,ariaLabel:`${m.label}-${b.label}`,border:i,error:!1,id:`${m.id}-${b.value}`,isRadio:!0,isSelected:r[m.id]===b.value,label:b.label,onUserInputChanged:()=>h(m.id,b.value),useMobileStyling:s},b.label))})},m.id)},[i,e,a,h,r,s]);return l("div",{children:n.map((p,m)=>c(m,p))})},Do=({columns:e,onSelect:t,options:n,selectedOptions:r})=>{const{border:o,useMobileStyling:i}=H(c=>({border:c.border,useMobileStyling:c.useMobileStyling})),s=n.length,d=e.length,a=ee(null),[u,h]=F(!1);return Z(()=>{const c=a.current,p=new ResizeObserver(m=>{window.requestAnimationFrame(()=>{c&&h(Math.round(m[0].contentRect.width)<c.scrollWidth)})});return c&&p.observe(c),()=>{c&&p.unobserve(c)}},[]),l("div",{className:"ul-card--matrix_question_container",children:[l("div",{className:M("ul-card--matrix_container",u&&"ul-matrix-scroll-gradient"),onScroll:()=>{(()=>{const c=a.current;c&&h(c.clientWidth+Math.abs(c.scrollLeft)<c.scrollWidth)})()},ref:a,children:l("div",{className:"ul-card--matrix_grid",style:`--numColumns: ${d}; --numRows: ${s+1}`,children:[l("div",{})," ",e.map(c=>l("div",{className:"ul-matrix-column-label",children:c.label},c.label)),n.map(c=>l(K,{children:[l("div",{"aria-label":c.label,className:"ul-matrix-row-label",children:c.label},c.label),l("div",{className:"ul-matrix-row-options",role:"radiogroup",children:e.map((p,m)=>l("div",{className:M("ul-matrix-option-wrapper",m===d-1&&"ul-matrix-last-option"),children:l($e,{allowTextEntry:!1,ariaLabel:`${c.label}-${p.label}`,border:o,choiceStyle:{background:"transparent",border:"none",marginBottom:"0",padding:"0"},error:!1,id:`${c.id}-${p.value}`,isRadio:!0,isSelected:r[c.id]===p.value,onUserInputChanged:()=>t(c.id,p.value),useMobileStyling:i})},p.value))})]}))]})}),u&&l("button",{className:"ul-matrix-scroll-arrow",onClick:c=>{c.preventDefault();const p=a.current;if(p){const m=getComputedStyle(p).direction==="rtl";p.scrollLeft=m?p.clientWidth-p.scrollWidth:p.scrollWidth}},children:l("svg",{fill:"currentColor",height:"32",viewBox:"0 0 256 256",width:"32",xmlns:"http://www.w3.org/2000/svg",children:l("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"})})})]})},Lo=({className:e,message:t,next:n,options:r,properties:o,questionId:i,type:s})=>{const{useMobileStyling:d}=H(v=>({useMobileStyling:v.useMobileStyling})),a=o.matrixColumn,u=o.required,h=r.reduce((v,_)=>(v[_.id]=null,v),{}),[c,p]=F(h),m=(v,_)=>{p(f=>({...f,[v]:_}))},g=u&&Object.values(c).every(v=>v==null),b=o.displayMatrixAsAccordion||d;return l("form",{className:M(e,"fade-in-transition","ul-card__matrix"),id:"text-form",onSubmit:v=>{v.preventDefault(),v.stopPropagation(),n({value:c,questionId:i,type:s})},children:[l(re,{message:t,properties:o}),l(ue,{properties:o,defaultBody:()=>l(K,{children:[l(pe,{children:l(b?Po:Do,{columns:a,onSelect:m,options:r,selectedOptions:c})}),l(ve,{children:l("div",{className:"ul-card__button-wrapper",children:l(J,{disabled:g,children:xe(o)})})})]})})]},i)},Mo=({options:e,selectItem:t,selectedOptions:n,showCheckbox:r})=>{const{themeColor:o}=H(i=>({doc:i.viewDocument,themeColor:i.border}));return l("div",{className:"select-list",children:e.map(i=>{return l("div",{className:"select-option",onClick:d=>{t(i),d.stopPropagation()},role:"option",children:[r&&l(fr,{divId:(s=i.id,`checkbox-div-${s}`),id:i.id,isSelected:n.includes(i),themeColor:o}),i.label]},i.id);var s})})},No=({isMultiSelect:e=!1,multiselectText:t="choices selected",onChange:n,options:r,placeholderText:o,value:i})=>{const[s,d]=F(!1),{viewDocument:a,update:u}=H(p=>({viewDocument:p.viewDocument,update:p.update})),h=()=>{d(!s),u()};Z(()=>{var m;const p=()=>{d(!1),u()};a.addEventListener("click",p);try{(m=window.parent)==null||m.addEventListener("click",p)}catch{window.addEventListener("click",p)}return()=>{var g;a.removeEventListener("click",p);try{(g=window.parent)==null||g.removeEventListener("click",p)}catch{window.removeEventListener("click",p)}}},[a,u]);const c=i.length===0?["select-button-placeholder"]:[];return l(K,{children:[l("button",{"aria-label":"choice dropdown button",className:M("select-button",...c),onClick:p=>{p.stopPropagation(),h()},type:"button",children:[l("span",{children:i.length===0?o:i.length===1?i[0].label:`${i.length} ${t}`}),l(mr,{})]}),s&&l(Mo,{options:r,selectedOptions:i,selectItem:p=>{var b;const m=i.some(v=>v.id===p.id),g=i.some(v=>{var _;return(_=v.optionProperties)==null?void 0:_.noneOfTheAbove});(b=p.optionProperties)!=null&&b.noneOfTheAbove&&!m?n([p]):e?n(m?i.filter(v=>v.id!==p.id):g?[p]:[...i,p]):m||n([p]),e||h()},showCheckbox:e})]})},xr=({className:e,message:t,onSubmit:n,options:r=[],properties:o,questionId:i,type:s})=>{const{border:d,useMobileStyling:a}=H(w=>({border:w.border,useMobileStyling:w.useMobileStyling})),u=r.reduce((w,x)=>(w[x.id]={isSelected:!1},w),{}),[h,c]=F(u),p=s==="multiplechoice",m=o.required,g=r.find(w=>{var x;return(x=w.optionProperties)==null?void 0:x.noneOfTheAbove}),b=Object.entries(h).some(([w,x])=>{var y;const j=r.find(E=>`${E.id}`===w),P=x.userText===void 0||x.userText.trim()==="";return((y=j==null?void 0:j.optionProperties)==null?void 0:y.allowsTextEntry)&&P&&x.isSelected}),v=Object.values(h).some(w=>w.isSelected),_=b||m&&!v,f=r.map(({id:w,label:x,value:j,optionProperties:P})=>{var I,L;const y=`${w}`,{allowsTextEntry:E,noneOfTheAbove:k}={allowsTextEntry:!1,noneOfTheAbove:!1,...P};return l($e,{allowTextEntry:E,border:d,error:!1,id:y,isRadio:p,isSelected:!!((I=h[y])!=null&&I.isSelected),label:x,noneOfTheAbove:k,onUserInputChanged:C=>S(C.id,C.selected,C.userText,C.noneOfTheAbove),promptText:"Please specify",text:(L=h[w])==null?void 0:L.userText,useMobileStyling:a,value:j},y)}),T=w=>{w.preventDefault(),w.stopPropagation(),n(h)},S=(w,x,j,P)=>{const y=Object.assign({},h);if((p||P)&&x)for(const E of Object.values(y))E.isSelected=!1,delete E.userText;else g&&!P&&h[g.id].isSelected&&(y[g.id].isSelected=!1);y[w]={isSelected:x,userText:j},c(y)};return l("form",{className:M(e,"ul-card--multiple","fade-in-transition"),id:"text-form",onSubmit:T,children:[l(re,{message:t,properties:o}),l(ue,{properties:o,defaultBody:()=>l(K,{children:[l(pe,{children:o.isDropdown?l(No,{isMultiSelect:!p,multiselectText:o.dropdownMultiselectedText??"choices selected",onChange:w=>{const x={...h};for(const j of r)w.includes(j)?x[j.id].isSelected=!0:x[j.id].isSelected=!1;c(x)},options:r,placeholderText:o.dropdownPlaceholderText??(p?"Select choice":"Select choice(s)"),value:r.filter(w=>h[w.id].isSelected)}):l("div",{className:M(G("ul-card__choices",a)),role:p?"radiogroup":"group",children:f})}),l(ve,{children:l("div",{className:"ul-card__button-wrapper",children:l(J,{disabled:_,onClick:T,children:xe(o)})})})]})})]},i)},Oo=e=>{const{questionId:t,type:n,next:r,options:o}=e;return l(xr,{...e,onSubmit:i=>{const s=Object.entries(i).find(([,c])=>c.isSelected)||[void 0,void 0],[d,a]=s,u=o.find(c=>`${c.id}`===d),h=a!=null&&a.userText?{[d]:{userText:a.userText}}:null;r({value:u&&d?{[d]:u.value}:{},secondaryValue:h,questionId:t,type:n})}})},Uo=e=>{const{questionId:t,type:n,next:r}=e;return l(xr,{...e,onSubmit:o=>{const i=Object.entries(o).reduce((d,[a,u])=>(d[a]=u.isSelected,d),{}),s=Object.entries(o).reduce((d,[a,u])=>{if(!u.userText)return d;const h=d||{};return h[a]={userText:u.userText},h},null);r({value:i,secondaryValue:s,questionId:t,type:n})}})},Ho=({className:e,props:{labels:t,message:n,properties:r},next:o,questionId:i,type:s})=>{const{border:d,useMobileStyling:a,viewDocument:u}=H(g=>({border:g.border,useMobileStyling:g.useMobileStyling,viewDocument:g.viewDocument})),h=t&&t.left,c=t&&t.right,p=[...Array(11)].map((g,b)=>l("button",{className:M(G("nps-number",a),G(`nps-number-${b}`,a)),id:`option-${b}`,onClick:()=>o({value:b,questionId:i,type:s}),onKeyDown:v=>{var f,T;const _=u.querySelectorAll("button.nps-number");v.key==="ArrowRight"?(f=_[b+1])==null||f.focus():v.key==="ArrowLeft"?(T=_[b-1])==null||T.focus():v.key!=="Enter"&&v.key!==" "||o({value:b,questionId:i,type:s})},onPointerDown:v=>{v.currentTarget.style.zIndex="2",v.currentTarget.style.borderColor=d},onPointerLeave:v=>{v.currentTarget.style.zIndex="auto",v.currentTarget.style.borderColor=$.DEFAULT_BORDER_COLOR},tabIndex:0,children:b},b)),m=g=>{g.preventDefault(),g.stopPropagation(),o({value:null,questionId:i,type:s})};return l("form",{className:M(e,"ul-card--nps","fade-in-transition"),children:[l(re,{message:n,properties:r}),l(ue,{properties:r,defaultBody:()=>l(K,{children:[l(pe,{children:[l("div",{className:"ul-card--nps__numbers",children:p}),l("div",{className:"ul-card--nps__labels",children:[l("span",{children:h}),l("span",{children:c})]})]}),!r.required&&l(ve,{children:l("div",{className:"ul-vertical-centered-container",children:l(J,{onClick:m,children:xe(r)})})})]})})]},i)},Ao=({className:e,message:t,next:n,properties:r,questionId:o,type:i})=>{const{border:s,useMobileStyling:d,update:a}=H(S=>({border:S.border,useMobileStyling:S.useMobileStyling,update:S.update})),[u,h]=F(""),c=ee(null),p=u.trim(),m=r.required===!0&&!p,g=_r(c,()=>a()),b=S=>{g(),S.preventDefault(),S.stopPropagation(),h(S.currentTarget.value)},v=S=>{S.preventDefault(),S.stopPropagation(),n({value:u,questionId:o,type:i})},_=r&&r.openTextPlaceholder?r.openTextPlaceholder:"",f=S=>{S.currentTarget.style.borderColor=s},T=S=>{S.currentTarget.style.borderColor=$.DEFAULT_BORDER_COLOR};return l("form",{className:M(e,"ul-card--text","fade-in-transition"),id:"text-form",children:[l(re,{message:t,properties:r}),l(ue,{defaultBody:()=>l("div",{className:"ul-card-text",children:[l(pe,{children:l("div",{className:"ul-card-text__container",children:l("textarea",{"aria-labelledby":"ul-question","aria-describedby":"ul-caption","aria-multiline":"true","aria-placeholder":_,className:M(G("ul-card-text__input",d)),"data-gramm":"false",maxLength:5e3,name:"text",onBlur:T,onChange:b,onFocus:f,placeholder:_,ref:c,role:"textbox",tabIndex:0})})}),l(ve,{children:[l(J,{disabled:m,onClick:v,children:xe(r)}),r.footerHtml&&l("div",{className:"footer",dangerouslySetInnerHTML:{__html:r.footerHtml}})]})]}),properties:r})]},o)},ct=1,kr=2,wr=3,Ve=e=>e.type==="av_permission",dn=e=>e.type==="screen_permission",Cr=(e,t)=>e===void 0?ct:e?((n,r)=>!(Ve(r)?r.permissionDescriptors:[]).includes("camera")||n.getVideoTracks().length>0)(e,t)?wr:ct:kr,cn={avStream:null,currentPage:null,mediaRecordingUids:null,nextQuestion:()=>{},passthroughData:void 0,recordingMediaTypes:void 0,screenPermissionRequested:!1,type:void 0},se=ur(e=>({...cn,reset:()=>{e(cn)},updatePage:t=>{e(t)}}));function ut({currentPage:e,pages:t}){const{avStream:n,recordingMediaTypes:r,updatePage:o}=se.getState(),{recorderEventEmitter:i}=H.getState();i.emit("av.permission",{"permission.descriptors":e.permissionDescriptors,"stream.ready":(s,d)=>{if(n===s)return;let a=e;if(s&&!e.permissionDescriptors.includes("camera")){const u=t.indexOf(e),h=d!=null&&d.active?u+2:u+1;d!=null&&d.active&&r&&i.emit("begin.recording",{"recording.media.types":r,"start.recording.callback":c=>o({mediaRecordingUids:c})}),a=t[h]}o({currentPage:a,avStream:s})}})}function pt({status:e}){const{nextQuestion:t,passthroughData:n,mediaRecordingUids:r,reset:o}=se.getState(),{recorderEventEmitter:i,handleUploadUpdate:s,index:d}=H.getState(),a={value:{taskStatus:e},type:"recordedtask",questionId:(n==null?void 0:n.questionId)||1};n&&i.emit("finish.task",{"begin.callback":u=>{s({mediaRecordingUid:u,isSubmitted:!0,progressPct:0,isComplete:!1})},"progress.callback":(u,h)=>{s({mediaRecordingUid:u,progressPct:h.detail,isSubmitted:!1,isComplete:!1})},"upload.callback":u=>{u&&s({mediaRecordingUid:u,isComplete:!0,isSubmitted:!0,progressPct:100})},"passthrough.data":n,"current.index":d,"task.response":a,"task.complete.callback":u=>{a.value.taskDurationMillisecond=u,r&&(a.value.mediaRecordingUids=r),o(),t(a)}})}function Et({pages:e,setIsRequestingPermission:t}){const{recorderEventEmitter:n,eventEmitFn:r}=H.getState(),{updatePage:o,currentPage:i,recordingMediaTypes:s,screenPermissionRequested:d}=se.getState();if(!i)return;const a=e.indexOf(i);switch(i.type){case"av_permission":{const u=d?a+2:a+1;return d&&s&&n.emit("begin.recording",{"recording.media.types":s,"start.recording.callback":h=>{o({mediaRecordingUids:h})}}),void o({currentPage:e[u]})}case"screen_permission":return void n.emit("screen.permission",{"screen.permission.requested":t,"stream.ready.callback":(u,h)=>{const c=h?e[a+1]:i;h&&s&&n.emit("begin.recording",{"recording.media.types":s,"start.recording.callback":p=>{o({captureStream:h,mediaRecordingUids:p})}}),o({currentPage:c,screenPermissionRequested:!0,captureStream:h})}});case"start_task":return r("recorded.task.start"),n.emit("recorded.task.start"),n.emit("start.task"),void o({currentPage:e[a+1],screenPermissionRequested:!0});case"complete_task":return}}const Er="ul-permission-graphics-container",Sr="ul-permission-body",jr=M(Er,"ul_recorded-task-inset-spacing"),We=M("ul-horizontal-button-container","ul-horizontal-button-container-left"),Ir=({richTextBody:e})=>l("div",{className:"ul-rich-text-body",dangerouslySetInnerHTML:{__html:e},id:"ul-task-detail-container"}),Ze=({required:e,skipButtonText:t,bottom:n=!1})=>e?null:l(J,{className:M(n&&"ul-skip-button-below","ul-button-inactive"),onClick:pt.bind(null,{status:"abandoned"}),children:t||"Skip"}),St=e=>{const{avStream:t,captureStream:n,recordingMediaTypes:r,updatePage:o}=se.getState(),i=(r==null?void 0:r.includes("audio"))||(r==null?void 0:r.includes("video"));Z(()=>{const s=setInterval(()=>{i&&t&&!t.active?o({avStream:null,currentPage:e[0]}):n&&n.active||o({captureStream:void 0,currentPage:e[i?1:0]})},1e3);return()=>clearInterval(s)},[t,n,i,e,r,o])},Bo=({content:e,pages:t,required:n})=>{const{buttonText:r,skipButtonText:o,taskDetail:i}=e;return St(t),l("div",{className:"ul-task-page",children:[i&&l(Ir,{richTextBody:i}),l("div",{className:We,children:[l(J,{onClick:Et.bind(null,{pages:t}),children:r}),l(Ze,{required:n,skipButtonText:o})]})]},"start-task")},qo=({content:e,pages:t,properties:n})=>{const{buttonText:r,skipButtonText:o}=e;St(t);const i=l(ue,{properties:n,defaultBody:()=>l("div",{className:We,children:[l(J,{className:"ul-complete-task-button",onClick:pt.bind(null,{status:"completed"}),children:r}),l(J,{className:M("ul-button-inactive"),onClick:pt.bind(null,{status:"given.up"}),children:o})]})});return l("div",{className:"ul-task-page",children:[e.taskDetail&&l(Ir,{richTextBody:e.taskDetail}),i]},"complete-task")},Vo=({content:e,pages:t,required:n})=>{const{buttonText:r,skipButtonText:o}=e,[i]=H(a=>[a.tabTitle]),[s,d]=F(!1);return l("div",{children:[l("div",{className:jr,children:[l("p",{style:{marginTop:"auto"},children:e.selectTabText}),l("div",{className:"ul-select-tab-container",children:l("p",{className:Sr,children:i})})]}),l("div",{className:n?"":We,children:[l(J,{disabled:s,onClick:Et.bind(null,{pages:t,setIsRequestingPermission:d}),children:r}),l(Ze,{required:n,skipButtonText:o})]})]})},zo=({content:e})=>l("div",{className:M(Er,"ul_permission_svg_container","ul_recorded-task-inset-spacing","ul-center-horizontally"),dangerouslySetInnerHTML:{__html:e.svg}},"ul-permission-request-graphic"),Fo=({content:e,pages:t,required:n})=>{const{permissionDeniedHeadline:r,permissionDeniedBody:o,skipButtonText:i,tryAgainButtonText:s}=e,d=Ve(t[0])?t[0]:null;return Z(()=>{const a=setInterval(()=>{d!==null&&ut({currentPage:d,pages:t})},1e3);return()=>clearInterval(a)},[d,t]),d?l("div",{children:[l("div",{className:jr,children:l("p",{className:"ul-av-permission-denied-paragraph",children:[l("span",{className:"ul-av-permission-denied-headline",children:r}),l("span",{className:Sr,children:o})]})}),l("div",{className:We,children:[l(J,{onClick:ut.bind(null,{currentPage:d,pages:t}),children:s}),l(Ze,{required:n,skipButtonText:i})]})]}):null},$o=({stream:e})=>l("video",{autoPlay:!0,className:M("ul_recorded-task-inset-spacing"),id:"ul-record-task-video-preview",muted:!0,ref:t=>{t&&(t.srcObject=e||null)}}),Wo=({content:e,pages:t,required:n})=>{const{skipButtonText:r}=e,{avStream:o}=se.getState();return St(t),l("div",{children:[l($o,{stream:o}),l("div",{className:"ul-vertical-button-container-center",children:[l(J,{onClick:Et.bind(null,{pages:t}),children:e.buttonText}),l(Ze,{bottom:!0,required:n,skipButtonText:r})]})]})},Zo=({properties:e})=>{const{pages:t,required:n}=e,{avStream:r,currentPage:o}=se.getState();if(o===void 0)return null;switch(o==null?void 0:o.type){case"av_permission":{const i=Cr(r,o);return i===ct?l(zo,{content:o}):l(i===kr?Fo:Wo,{content:o,pages:t,required:n})}case"screen_permission":return l(Vo,{content:o,pages:t,required:n});case"start_task":return l(Bo,{content:o,pages:t,required:n});case"complete_task":return l(qo,{content:o,pages:t,properties:e});default:return null}},Go=({className:e,properties:t,next:n,questionId:r})=>{const o=H(),{surveyId:i,responseGroupUid:s,userId:d}=o,a=se(),{screenPermissionRequested:u}=a,h=se(b=>b.avStream);let c=se(b=>b.currentPage);c||(c=function({pages:b,userId:v,responseGroupUid:_,surveyId:f,questionId:T,next:S}){const{updatePage:w}=se.getState(),{eventEmitFn:x,recorderEventEmitter:j}=H.getState(),P={questionId:T,surveyId:f,visitorId:v,responseGroupUid:_};let y=0;j.emit("recorded.task.permission.screen"),x("recorded.task.permission.screen"),j.emit("permission.status",{"permission.status.callback":(k,I,L,C)=>{const A=b[y],{type:O}=A,q=["screen"];if(Ve(A)){const{permissionDescriptors:B}=A,Y=B==null?void 0:B.includes("microphone"),W=B==null?void 0:B.includes("camera");Y&&q.push("audio"),W&&q.push("video"),(k!=null&&k.active&&!W||k!=null&&k.active&&I)&&y++}dn(b[y])&&L&&(y++,j.emit("begin.recording",{"recording.media.types":q,"start.recording.callback":B=>w({mediaRecordingUids:B})})),w({currentPage:b[y],avStream:k,screenPermissionRequested:L,nextQuestion:S,type:O,passthroughData:P,recordingMediaTypes:q,captureStream:C})}});const E=b[y];return E.type==="av_permission"&&ut({currentPage:E,pages:b}),E}({questionId:r,surveyId:i,next:b=>{n(b)},pages:t.pages,responseGroupUid:s,userId:d}));let p=c.headline,m=c.captionText;const g=Cr(h,c);return dn(c)&&u&&(p=c.permissionDeniedHeadline,m=c.permissionDeniedCaptionText),Ve(c)&&g===wr&&(p=c.permissionGrantedHeadline,m=c.permissionGrantedCaptionText),l("div",{className:M(e,"ul-center-horizontally","fade-in-transition"),children:[l(re,{message:p,properties:{captionText:m}}),l(pe,{children:l(Zo,{properties:t})})]})},Ko={"{{user_id}}":"externalUserId","{{email}}":"email"},Yo=({className:e,message:t,next:n,properties:r,questionId:o,type:i})=>{const{visitorAttributes:s}=H(p=>({visitorAttributes:p.visitorAttributes})),d=(p,m=!1)=>{n({value:m?{skipped:!0}:void 0,questionId:o,type:i})},a=p=>{p.key!=="Enter"&&p.key!==" "||n({value:void 0,questionId:o,type:i})},u=((p,m={})=>{if(!p)return p;try{const f=new URL(p);if(f.protocol!=="http:"&&f.protocol!=="https:")return}catch{return}let g=p;const b=[];for(const[f,T]of Object.entries(Ko))if(g.toLowerCase().includes(f))if(m[T]){const S=new RegExp(f,"gi");g=g.replace(S,m[T])}else b.push(f);if(b.length===0||!g.includes("?"))return g;const v=g.slice(0,g.indexOf("?")),_=g.slice(g.indexOf("?")+1).split("&").map(f=>f.split("=")).filter(f=>!b.includes(f[1]));return _.length===0?v:`${v}?${_.map(f=>f.join("=")).join("&")}`})(r&&r.buttonUrl,s);return l("div",{className:M(e,"ul-card__text-url-prompt","fade-in-transition"),children:[l(re,{message:t,properties:{questionHtml:r.questionHtml}}),l(pe,{children:(h=r==null?void 0:r.richTextBody,c=r==null?void 0:r.body,h?l("div",{className:"ul-rich-text-body",dangerouslySetInnerHTML:{__html:h},id:"ul-card__text-url-body-container"}):c?l("div",{className:"ul-rich-text-body",id:"ul-card__text-url-body-container",children:(c?c.split(/\n\s*\n/g):[]).map((p,m)=>l("p",{children:p},m))}):null)}),l(ue,{defaultBody:()=>l(ve,{children:l("div",{className:"ul-card-button-group",children:[l("a",{className:"ul-card-text__button ul-card__text-url-prompt-button",href:u,id:"ul-card-text__button",onClick:d,onKeyPress:a,rel:"noreferrer",role:u?"link":"button",tabIndex:0,target:"_blank",children:xe(r)}),r.required===!1&&l("button",{className:"ul-card-skip__button",onClick:p=>d(0,!0),children:Ct(r)})]})}),properties:r})]},o);var h,c},Qo=({className:e,questionId:t})=>{const{border:n,destroy:r,endCard:o,forceBrandedLogo:i}=H(a=>({border:a.border,destroy:a.destroy,endCard:a.endCard,forceBrandedLogo:a.forceBrandedLogo}));Z(()=>{setTimeout(()=>{r($.APP_ID)},i?4e3:2e3)},[r,i]);const s=o&&o.subheader?l("p",{className:"ul-caption",children:o.subheader}):null,d=o&&o.headline?o.headline:"";return l("div",{className:M(e,"ul-card--thanks","fade-in-transition"),children:l("div",{children:l("div",{className:"ul-card--thanks-content",children:[l("div",{className:"ul-thanks-check",children:l("svg",{"aria-labelledby":"title",fill:"none",height:"99",viewBox:"0 0 81 99",width:"81",xmlns:"http://www.w3.org/2000/svg",children:[l("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:n,fillRule:"evenodd"}),l("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:n,fillRule:"evenodd"}),l("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"})]})}),l(re,{message:d}),s]})})},t)},be="https://cdn.sprig.com",D={document:void 0,videojs:void 0},jt=e=>e+"-loading-spiner",Q="hidden",un=".m3u8",et="questionId",tt="ul-video-recorder-camera-off-button",nt="ul-recording-in-session",Jo=[{type:"link",content:`${be}/dependencies/videojs-record-4.5.0.min.css`},{type:"script",content:`${be}/dependencies/RecordRTC-5.6.2.js`},{type:"script",content:`${be}/dependencies/adapter.8.0.0.min.js`},{type:"script",content:`${be}/dependencies/videojs-record-4.5.0.min.js`},{type:"script",content:`${be}/userleap-web-upchunk-v2.2.2.js`}],Tr=[{type:"link",content:`${be}/dependencies/video-js-7.18.0.min.css`},{type:"script",content:`${be}/dependencies/video-js-7.18.0.min.js`},{type:"style",content:`/* progress control styles */
|
|
13
13
|
.video-js .vjs-control {
|
|
14
14
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
|
|
15
15
|
}
|
|
@@ -666,4 +666,4 @@ span.ul-button-text {
|
|
|
666
666
|
.vjs-poster {
|
|
667
667
|
background-size: cover;
|
|
668
668
|
}
|
|
669
|
-
`}],Rr="-video-player",un="-secondary-video-player",pn="-video-recorder";let ie,hn;const ge=async({event:e,apiBase:t,headers:n,visitorId:r,envId:o,metadata:i})=>{const s=D.document.documentElement;if(!r||!o)return;const d={event:`SDK - ${e}`,visitorId:r,environmentId:o,metadata:{...i||{},screenWidth:window.screen.width,screenHeight:window.screen.height,clientWidth:s.clientWidth,clientHeight:s.clientHeight,location:window.location.href,language:navigator.language}};(await fetch(`${t}/sdk/1/visitors/${r}/analytics`,{method:"POST",cache:"no-cache",headers:n,body:JSON.stringify(d)})).ok||console.warn("[Sprig] (ERR-444) Failed to track analytics",e)},ae=async(e,t,n,r,o,i)=>{ge({event:`Video Error ${t}`,apiBase:n,headers:r,visitorId:o,envId:i,metadata:{errorMessage:e.message}});const s=D.document.documentElement,d={screenWidth:window.screen.width,screenHeight:window.screen.height,clientWidth:s.clientWidth,clientHeight:s.clientHeight,location:window.location.href,language:navigator.language},a={action:t,err:{message:e.message,stack:e.stack},meta:d,vid:o,envId:i};(await fetch(`${n}/sdk/1/errors`,{method:"POST",cache:"no-cache",headers:{...r,"userleap-platform":"video_recorder","x-ul-error":window.btoa(`userleap-${Date.now()}-error`)},body:JSON.stringify(a)})).ok||console.warn("[Sprig] (ERR-444) Failed to report error to API",e)},Pr=(e,t)=>{if(e.length===0)return t&&t();Promise.all(e.reduce((n,r)=>(n.push(((o,{type:i,content:s})=>new Promise(function(d,a){let u;i==="script"?(u=D.document.createElement("script"),u.src=s):i==="link"?(u=D.document.createElement("link"),u.rel="stylesheet",u.href=s,u.type="text/css"):(u=D.document.createElement("style"),u.innerHTML=s),u.onload=function(){d(s)},u.onerror=function(){a(s)},u.async=!1,u.id=btoa(s),o.appendChild(u)}))(D.document.head,r)),n),[])).then(()=>{D.videojs=D.document.defaultView.videojs,t&&t()}).catch(function(n){console.log(n+" failed to load")})},mn=(e,t,n)=>{if(t==="start"&&(e.style.visibility="visible"),t==="none")e.style.visibility=Q;else if(t==="success")e.style.visibility=Q,e.innerHTML="Upload succeeded!";else{const r=Math.round(parseFloat(n));e.innerHTML=`Uploading <span class="ul-upload-progress-label__time">${r}%</span>`,e.style.background=`linear-gradient(to right, #E0E0EB 0%, #E0E0EB ${r}%, #FCFCFD ${r}%, #FCFCFD 100%)`}},rt=(e,t)=>{const n=D.videojs(e.id());return n==null?void 0:n.payload[t]},Dr=(e,t)=>{const n=new(D.videojs.getComponent("Component"))(e);return n.addClass("ul-buttons-panel"),t.map(r=>{n.addChild(r)}),Xo(n),n},Xo=e=>{e.children().forEach(t=>{if(te[t.name_]){const n=Ue(te[t.name_],`ul-${te[t.name_]}`);t.el_.appendChild(n)}})},Ue=(e,t="")=>{const n=D.document.createElement("span");return n.className="ul-button-text",n.innerHTML=e,n.id=t,n},Lr=(e,t,n,r,o=!1,i)=>{e.addClass("ul-video-player");const s=new(D.videojs.getComponent("Component"))(e);s.addClass("ul-control-panel"),e.progressBar=s.addChild("ProgressControl"),n&&e.src(n),e.audioPlayerPlaceholder=new(D.videojs.getComponent("Component"))(e),e.audioPlayerPlaceholder.addClass("ul-audio-recorder-placeholder");const d=n&&n.src?ri(n.src):null;!n||!o&&d?(e.audioPlayerPlaceholder.hide(),D.document.getElementById(`${e.id()}_html5_api`).style.height="100%",d&&e.poster(d)):(e.children()[0].classList.add("vjs-hidden"),D.document.getElementById(`${e.id()}_html5_api`).style.height="0px"),e.on("play",()=>{o||!n||d||ti(e),i==null||i.play()}),e.on("pause",()=>{i==null||i.pause()}),e.on("seeked",()=>{i==null||i.currentTime(e.currentTime())}),e.on("ratechange",()=>{i==null||i.playbackRate(e.playbackRate())}),e.addChild(e.audioPlayerPlaceholder,{},1),s.addChild(t),e.addChild(s),r&&r(e)},ei=(e,t,n,r,o,i,s,d=!1)=>{hn=Date.now();const a=ze(t,{controls:!1,bigPlayButton:!1,fluid:!1,width:1280,height:720,playsinline:!0,plugins:{record:{audio:!0,video:{mandatory:{minWidth:1280,minHeight:720}},frameWidth:1280,frameHeight:720,maxLength:600,autoMuteDevice:!0}}});if(!a)return;a.payload=n;const{surveyId:u,questionId:h,responseGroupUid:c,visitorId:p,envId:m}=n;let g;const b=E=>{const k=tt,I=tt+"-audio-only";mn(a.uploadProgressLabel,"none"),ie&&ie.startTime>=hn&&ie.abort();const L=D.document.getElementById("ul-camera-button");E?(a.children()[0].classList.add("vjs-hidden"),T.removeClass(k),T.addClass(I),L.innerHTML=te.TurnOnCamera,a.audioPlayerPlaceholder.removeClass("vjs-hidden"),g==null||g.getTracks().forEach(C=>{C.stop()}),window.navigator.mediaDevices.getUserMedia({video:!0,audio:!0}).then(C=>{g=C,C.getVideoTracks().forEach(H=>{H.enabled=!1}),a.record().onDeviceReady(C)}).catch(a.record().onDeviceError.bind(a.record()))):(g==null||g.getVideoTracks().forEach(C=>{C.enabled=!0}),a.children()[0].classList.remove("vjs-hidden"),a.record().getDevice(),T.removeClass(I),T.addClass(k),L.innerHTML=te.TurnOffCamera,a.audioPlayerPlaceholder.addClass("vjs-hidden"))},v=new(D.videojs.getComponent("Button"))(a,{clickHandler:()=>{v.hasClass(Q)||(ge({event:"Video Delete Button Clicked",apiBase:r,headers:s,visitorId:p,envId:m,metadata:{questionId:h,responseGroupUid:c,surveyId:u}}),b(a.cameraOff),o(N.DELETE,{}),T.removeClass(Q),v.addClass(Q))}});v.addClass("ul-video-recorder-delete-button"),v.el_.appendChild(Ue(te.DeleteButton,"ul-delete-button"));const _=D.document.getElementById(t),f=()=>{_.classList.contains("vjs-fullscreen")&&a.cameraOff?_.style.display="table":_.style.display="flex"};f();const T=new(D.videojs.getComponent("Button"))(a,{clickHandler:()=>{a.record().isRecording()||(a.cameraOff=!a.cameraOff,ge({event:"Video Camera Button Clicked",apiBase:r,headers:s,visitorId:n.visitorId,envId:n.envId,metadata:{questionId:h,responseGroupUid:c,surveyId:u,cameraOff:a.cameraOff}}),b(a.cameraOff),!v.hasClass(Q)&&v.addClass(Q),o(N.DELETE,{}),f())}});T.addClass(tt),T.el_.appendChild(Ue(te.TurnOffCamera,"ul-camera-button"));const S=new(D.videojs.getComponent("Button"))(a,{clickHandler:()=>{const E=D.document.getElementById("ul-recorder-toggle");if(a.record().isRecording())a.record().stop(),E&&(E.innerHTML=te.RecordButton),S.removeClass(nt),v.removeClass(Q);else{const k=D.document.getElementById("ul-recording-countdown-screen");if(k)k.remove(),E&&(E.innerHTML=te.RecordButton),b(a.cameraOff),o(N.DELETE,{}),T.removeClass(Q),v.addClass(Q),S.removeClass(nt),j.show();else{S.addClass(nt),j.hide(),T.addClass(Q),v.addClass(Q),E&&(E.innerHTML=te.StopButton);const I=D.document.createElement("div");I.id="ul-recording-countdown-screen",_.insertBefore(I,_.children[1]),I.style.height=`${_.offsetHeight}px`,Mr(a,3)}}}});S.addClass("ul-video-recorder-toggle-button"),S.el_.appendChild(Ue(te.RecordButton,"ul-recorder-toggle"));const w=D.document.createElement("p");w.style.visibility="hidden",w.className="ul-upload-progress-label",e.appendChild(w),a.uploadProgressLabel=w;const x=Dr(a,[v,T,"PlayToggle",S,"FullscreenToggle"]),j=x.children().find(E=>E.name_==="FullscreenToggle");j.hasClass("vjs-disabled")&&j.hide();const P=x.children().find(E=>E.name_==="PlayToggle");P.hide(),v.addClass(Q),Lr(a,x,i,!1,d),a.on("stopRecord",()=>{S.hide(),P.show(),j.show(),v.removeClass(Q)}),a.on("deviceReady",()=>{S.show(),P.hide(),v.addClass(Q)}),((E,k,I,L,C)=>{const{surveyId:H,responseGroupUid:O,visitorId:q,envId:A}=E.payload;E.on("deviceError",function(){console.warn("device error: ",E.deviceErrorCode),E.deviceErrorCode.message==="Permission denied"?(E.deviceButton.addClass("permission-denied"),I&&I(N.ERROR,{type:N.PERMISSION_DENIED}),ge({event:"Video Permission Denied",apiBase:k,headers:C,visitorId:q,envId:A,metadata:{questionId:rt(E,et),responseGroupUid:O,surveyId:H}})):(I&&I(N.ERROR,{type:N.OTHER}),ae(new Error(E.deviceErrorCode.message),"recorderDeviceError",k,C,q,A))}),E.on("error",function(Y,W){ae(W||E.error(),"recorderError",k,C,q,A)}),E.on("startRecord",function(Y,W){L(E.uploadProgressLabel,"none"),ge({event:"Video Record Start",apiBase:k,headers:C,visitorId:q,envId:A,metadata:{questionId:rt(E,et),responseGroupUid:O,surveyId:H}})}),E.on("finishRecord",async function(){L(E.uploadProgressLabel,"start",0);const Y=rt(E,et);if(!H){const oe="internal error: missing fields in payload";return I&&I(N.ERROR,{type:N.OTHER}),ae(new Error(oe),"finishRecord",k,C,q,A),null}E.record().stopDevice();const W=E.cameraOff?N.MEDIA_TYPE_AUDIO:N.MEDIA_TYPE_VIDEO,X=B.v4();ge({event:"Video Record Finish",apiBase:k,headers:C,visitorId:q,envId:A,metadata:{mediaRecordingUid:X,questionId:Y,responseGroupUid:O,surveyId:H,mediaType:W}});const he={surveyId:H,updatedAt:new Date().toISOString(),mediaType:W,mediaRecordingUid:X};Y&&(he.questionId=Y),O&&(he.responseGroupUid=O),q&&(he.visitorId=q);const me=await(async()=>{const oe=await fetch(`${k}/2/environments/integrations/upload`,{method:"POST",cache:"no-cache",headers:{"Content-Type":"application/json"},body:JSON.stringify(he)});if(oe.ok){const jt=await oe.json();return I&&I(N.UPLOAD_STARTED,{[N.UPLOAD_ID]:jt.upload.id,[N.MEDIA_TYPE]:W,[N.MEDIA_RECORDING_UID]:X}),jt.upload.url}return I&&I(N.ERROR,{type:N.OTHER,response:oe}),ae(new Error("failed to get upload response with url"),"finishRecord",k,C,q,A),null})();me&&(ie=D.document.defaultView.UpChunk.createUpload({endpoint:me,file:new D.document.defaultView.File([E.recordedData],`recording ${W} ${Date.now()}`),chunkSize:5120}),ie.startTime=Date.now(),ge({event:"Video Upload Start",apiBase:k,headers:C,visitorId:q,envId:A,metadata:{mediaRecordingUid:X,questionId:Y,responseGroupUid:O,surveyId:H,mediaType:W,url:me}}),ie.on("error",oe=>{L(E.uploadProgressLabel,"none"),I&&I(N.UPLOAD_FINISHED,{[N.MEDIA_RECORDING_UID]:X}),ae(oe,"finishRecord",k,C,q,A)}),ie.on("progress",oe=>{I&&I(N.UPLOAD_PROGRESS,{[N.MEDIA_RECORDING_UID]:X,[N.UPLOAD_PROGRESS_PCT]:oe.detail}),L(E.uploadProgressLabel,"progress",oe.detail)}),ie.on("success",()=>{L(E.uploadProgressLabel,"success"),I&&I(N.UPLOAD_FINISHED,{[N.MEDIA_RECORDING_UID]:X}),ge({event:"Video Upload Success",apiBase:k,headers:C,visitorId:q,envId:A,metadata:{mediaRecordingUid:X,questionId:Y,responseGroupUid:O,surveyId:H,mediaType:W,url:me,elapsedMs:ie.startTime&&Date.now()-ie.startTime}})}))})})(a,r,o,mn,s);const y=[{name:"microphone"}];!a.cameraOff&&y.push({name:"camera"}),Promise.all(y.map(E=>{var k;return(k=navigator==null?void 0:navigator.permissions)==null?void 0:k.query(E)})).then(E=>{E.reduce((k,I)=>k&I.state==="granted",!0)&&a&&(a.deviceButton&&a.deviceButton.hide(),a.record().getDevice())}).catch(E=>{})},Mr=(e,t=3)=>{const n=D.document.getElementById("ul-recording-countdown-screen");n&&t===0?(n.remove(),e.record().start()):n&&(n.innerHTML=`<span class='ul-countdown-text'>Recording in... ${t}</span>`,setTimeout(()=>{Mr(e,t-1)},1e3))},Nr=e=>{const t=D.document.createElement("div");return t.className="ul-video-container",t.appendChild((n=>{const r=D.document.createElement("div");return r.className="ul-video-player-loading",r.id=St(n),["first","second","third","fourth"].map(o=>{const i=D.document.createElement("div");i.className=o,r.appendChild(i)}),r})(e)),t},ht=(e,t)=>{const n=D.document.createElement("video");n.id=e,n.className="video-js vjs-default-skin ul-video-player-video";const r=D.document.createElement("p");r.className="vjs-no-js",r.innerHTML="To view this video please enable JavaScript, and consider upgrading to a web browser that";const o=D.document.createElement("a");return o.href="https://videojs.com/html5-video-support/",o.target="_blank",o.innerHTML="supports HTML5 video",r.appendChild(o),n.appendChild(r),t.appendChild(n),t},ti=(e,t)=>{e.children()[0].classList.remove("vjs-hidden"),e.audioPlayerPlaceholder.hide(),D.document.getElementById(`${e.id()}_html5_api`).style.height="100%"},ze=(e,t)=>D.document.getElementById(e)?t?D.videojs(e,t):D.videojs(e):(console.error(`Error in finding player element with ID, ${e}`),null),ni=(e,t,n,r=!1,o="https://api.sprig.com",i=document,s=null,d=null)=>{D.document=i;const a=e+Rr,u=Nr(a);return D.document.addEventListener("securitypolicyviolation",h=>{ae(new Error(`Voice & Video feature violates ${h.violatedDirective} web page CSP policies for the question player.`),"playerDeviceError",o,{})}),Pr(Tr,()=>{D.document.getElementById(St(a)).remove(),ht(a,u);const h={playsinline:!0,playbackRates:[.5,1,1.5,2],fill:!0};try{const c=e+un;ht(c,u);const p=ze(a,h),m=ze(c,{muted:!0,...h});if(!p||!m)return;((v,_,f)=>{v.addClass(`ul${un}`);const T=new(D.videojs.getComponent("Component"))(v);_&&v.src(_),v.addChild(T),f&&f(v)})(m,s,d),s||m.addClass(Q);const g=Dr(p,["PlaybackRateMenuButton","PlayToggle","FullscreenToggle"]),b=g.children().find(v=>v.name_==="FullscreenToggle");b.hasClass("vjs-disabled")&&b.hide(),Lr(p,g,t,n,r,m)}catch(c){return void ae(new Error(`Error when creating video player object ${c}`),"playerDeviceError",o,{})}}),u},ri=e=>{if(!e)return null;const t=e.match(/https:\/\/stream.mux.com\/(.*)/);let n=t?t[1]:null;return n.includes(cn)&&(n=n.replace(cn,"")),n?`https://image.mux.com/${n}/thumbnail.jpg?time=0`:null},N={UPLOAD_STARTED:"upload.started",UPLOAD_PROGRESS:"upload.progress",UPLOAD_FINISHED:"upload.finished",DELETE:"delete",ERROR:"error",MEDIA_TYPE:"media.type",PERMISSION_DENIED:"permission_denied",OTHER:"other",UPLOAD_ID:"upload.id",UPLOAD_PROGRESS_PCT:"upload.progress.pct",MEDIA_RECORDING_UID:"media.recording.uid",MEDIA_TYPE_VIDEO:"video",MEDIA_TYPE_AUDIO:"audio"},te={PlaybackRateMenuButton:"Speed",PlayToggle:"Play",FullscreenToggle:"Expand",TurnOnCamera:"Turn on",TurnOffCamera:"Turn off",DeleteButton:"Delete",RecordButton:"Record",StopButton:"Stop",PauseButton:"Pause"},fe="ul-card-video__player_recorder",gn="ul-video-btn",ot=0,vn=1,oi=({className:e,message:t,next:n,properties:r,questionId:o,type:i})=>{const{apiURL:s,envId:d,handleUploadUpdate:a,headers:u,responseGroupUid:h,surveyId:c,update:p,viewDocument:m,visitorId:g}=U(k=>({apiURL:k.apiURL,envId:k.envId,handleUploadUpdate:k.handleUploadUpdate,headers:k.headers,responseGroupUid:k.responseGroupUid,surveyId:k.surveyId,update:k.update,viewDocument:k.viewDocument,visitorId:k.userId})),[b,v]=F(!1),[_,f]=F(null),[T,S]=F(null),[w,x]=F(ot),j=ee(null),P=r&&r.videoUrl;Z(()=>{const k=j.current,I=new ResizeObserver(()=>{p()});return k&&I.observe(k),()=>{k&&I.unobserve(k)}},[p]);const y=(k,I)=>{k===N.UPLOAD_STARTED?(f(I[N.UPLOAD_ID]),S(I[N.MEDIA_RECORDING_UID]),v(!0)):k===N.DELETE?(f(null),S(null),v(!1)):k===N.UPLOAD_PROGRESS?isNaN(I[N.UPLOAD_PROGRESS_PCT])?a({mediaRecordingUid:I[N.MEDIA_RECORDING_UID],isComplete:!0}):a({mediaRecordingUid:I[N.MEDIA_RECORDING_UID],progressPct:I[N.UPLOAD_PROGRESS_PCT]}):k===N.UPLOAD_FINISHED&&a({mediaRecordingUid:I[N.MEDIA_RECORDING_UID],isComplete:!0})},E=k=>{k.preventDefault(),k.stopPropagation(),document.getElementById(fe)&&(I=>{const L=I+pn;if(D.document.getElementById(L)&&D.videojs){try{if(!D.videojs(L).record().stream)return}catch{return}D.videojs(L).record().stop(),D.videojs(L).record().stopDevice()}})(fe),_&&T?(a({mediaRecordingUid:T,isSubmitted:!0}),n({value:{mediaRecordingUid:T},questionId:o,type:i})):n({value:null,questionId:o,type:i})};return l("form",{className:M(e,"ul-card--video","fade-in-transition"),id:"ul-video-interview-form",children:[l(re,{message:t,properties:r}),l(pe,{children:[l("div",{id:"ul-question-player-container",ref:j,style:{display:w===ot?"":"none"},children:[l("div",{id:fe,ref:k=>{if(k&&k.children.length===0&&!r.hideRecordedPrompt){const I=ni(fe,{src:P,type:"application/x-mpegURL"},void 0,r.mediaType===N.MEDIA_TYPE_AUDIO,s,m);k.appendChild(I)}}}),l(ue,{defaultBody:()=>l("button",{className:`${gn} ul-record-response-btn`,onClick:k=>{k.preventDefault(),k.stopPropagation(),document.getElementById(fe)&&(I=>{const L=ze(I+Rr);L==null||L.pause()})(fe),x(vn)}}),properties:r})]}),l("div",{style:{display:w===vn?"block":"none"},children:[l("button",{className:`${gn} ul-back-question-btn`,onClick:k=>{k.preventDefault(),k.stopPropagation(),x(ot)},style:{display:r.hideRecordedPrompt?"none":"block"}}),l("div",{id:"ul-recorder-player-container",ref:k=>{if(k&&k.children.length===0){const I=((L,C={},H="https://api.userleap.com",O,q,A,Y=!1,W=document)=>{D.document=W;const X=L+pn,he=Nr(X);return D.document.addEventListener("securitypolicyviolation",me=>{ae(new Error(`Voice & Video feature violates ${me.violatedDirective} web page CSP policies for the recorder player.`),"recorderDeviceError",H,A,C.visitorId,C.envId)}),Pr(Tr.concat(Jo),()=>{ht(X,he),D.document.getElementById(St(X)).remove();try{ei(he,X,C,H,O,q,A,Y)}catch(me){return void ae(new Error(`Error when creating video recorder player object ${me}`),"recorderDeviceError",H,A,C.visitorId,C.envId)}}),he})(fe,{surveyId:c,responseGroupUid:h,questionId:o,visitorId:g,envId:d},s,y,void 0,{...u,"x-ul-video-recorder-origin":"sdk"},r.mediaType===N.MEDIA_TYPE_AUDIO,m);k.appendChild(I)}}})]})]}),l(ve,{children:[l(J,{disabled:!b,onClick:E,children:xe(r)}),l("button",{className:"ul-card-text__button ul-button-inactive ul-card-skip__button",id:"ul-card-video__skip_button",onClick:E,style:{display:r.required?"none":"block",...b?{display:"none"}:{}},children:wt(r)})]})]})},ii=({className:e})=>{const{uploadProgress:t}=U(i=>({uploadProgress:i.uploadProgress}));let n,r;Object.values(t).filter(i=>i.isSubmitted).length>1?(n="Your responses are processing",r="Please keep this tab open until your responses are fully processed."):(n="Your response is processing",r="Please keep this tab open until your response is fully processed.");const o=Math.round(Math.min(99,...Object.values(t).filter(i=>i.isSubmitted).map(i=>i.progressPct||0)));return l("div",{className:M(e,"ul-card--uploading","fade-in-transition"),children:[l("div",{"aria-busy":"true","aria-label":"Processing...","aria-live":"polite",className:"ul-loading-spinner-container",role:"progressbar",children:l("div",{className:"ul-loading-spinner",children:[l("div",{className:"first"}),l("div",{className:"second"}),l("div",{className:"third"}),l("div",{className:"fourth"})]})}),l(re,{message:`${n} (${o}% complete)`}),l("p",{className:"ul-caption",children:r})]})},fn=({logoOnly:e=!1,style:t={}})=>l("svg",{alt:(e?"Powered by ":"")+"Sprig",width:e?"35":"112",height:"15",viewBox:e?"79 0 31 15":"0 0 112 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{display:"block",...t},children:[!e&&l("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:"black",fillOpacity:"0.7"}),l("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:"black",fillOpacity:"0.7"}),l("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:"black",fillOpacity:"0.7"}),l("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:"black",fillOpacity:"0.7"}),l("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:"black",fillOpacity:"0.7"}),l("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:"black",fillOpacity:"0.7"})]}),si=()=>{const{border:e,cards:t,forceBrandedLogo:n,headers:r,index:o,marketingUrl:i,showSurveyBrand:s,slugName:d,surveyId:a,viewedCardCount:u}=U(_=>({border:_.border,cards:_.cards,forceBrandedLogo:_.forceBrandedLogo,headers:_.headers,index:_.index,marketingUrl:_.marketingUrl,showSurveyBrand:_.showSurveyBrand,slugName:_.slugName,surveyId:_.surveyId,viewedCardCount:_.viewedCardCount})),h=ee(null),c=t.filter(_=>_.type!=="uploading"&&_.type!=="thanks"),p=((_,f)=>{const T=new Set(["thanks","uploading"]);if(f>=_.length||f<0||T.has(_[f].type))return 0;const S=_.filter(x=>!T.has(x.type));if(f===S.length-1)return 1;const w={[S.length-1]:1,[-1]:0};for(let x=S.length-2;x>=f;x--){const j=S[x],P=bo(x,j.props.routingOptions);if(P.length===0){w[x]=w[x+1]+1;continue}let y=0,E=vo(j);if(E===null)return S.length-1-f;for(let k=0;k<P.length&&E.length!==0;k++){const{comparator:I,target:L,value:C}=P[k],H=E.filter(O=>{const q=go({value:O},j.type,O),A=pr(O,j.type);return!(q&&I==="answered"||A&&I==="partial"||!q&&!A&&I==="skipped"||I==="given_up"&&_o(O)&&O.taskStatus==="given.up"||q&&j.type==="open"&&(I==="contains"||I==="notcontains")||q&&fo(I)&&kt[I](O,C))});if(H.length<E.length){const O=parseInt(String(L),10);if(O!==-1&&O<=x||O>=S.length)return S.length-1-f;y=Math.max(w[O]+1,y)}E=H}E.length>0&&(y=Math.max(w[x+1]+1,y)),w[x]=y}return w[f]})(t,o),m=u+1,g=m/(m+p),b=`${i}?utm_source=survey_branding&utm_medium=website&utm_campaign=${d}&utm_content=${a}${n&&"&utm_term=poweredby_pill"}`;Z(()=>{h.current&&(h.current.style.width=100*g+"%")},[g]);const v=t[o].type==="thanks";return l("footer",{className:"ul-footer "+(r["userleap-platform"]==="link"?"ul-footer__link":""),children:v&&n?l("a",{dir:"ltr",href:b,rel:"noreferrer",target:"_blank",children:l("div",{className:"thank-you-card-link",children:[l("div",{className:"sprig-box-logo",children:l(fn,{logoOnly:!0,style:{margin:"auto"}})}),l("div",{children:l("p",{children:["Capture insights about your own product",l(_n,{style:{display:"inline-flex",marginInlineStart:"4px",verticalAlign:"middle"}})]})})]})}):l(K,{children:[c.length>1&&l("div",{id:"ul-progress-bar-container",children:l("div",{id:"ul-progress-bar-current",ref:h,style:{border:`1px solid ${e||"#000"}`}})}),s?l("div",{className:n?"yellow-footer-logo":"",style:{marginTop:"4px",marginBottom:"4px"},children:l("a",{href:b,rel:"noreferrer",target:"_blank",children:l("div",{style:{display:"flex"},children:[l(fn,{logoOnly:!1}),n&&l(_n,{style:{display:"block",margin:"auto 0 auto 4px",transform:"rotateY(0deg) rotate(-45deg)"}})]})})}):null]})})},_n=({style:e})=>l("svg",{fill:"none",height:"10",style:e,viewBox:"0 0 12 10",width:"12",xmlns:"http://www.w3.org/2000/svg",children:[l("path",{d:"M1.47839 5.2085L10.9384 5.2085",stroke:"black",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.35"}),l("path",{d:"M7.0686 1.15845L10.9386 5.20845L7.0686 9.25845",stroke:"black",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.35"})]}),ai=()=>{const{answers:e,border:t,cards:n,close:r,configureExitOnOverlayClick:o,destroy:i,endCard:s,eventEmitFn:d,fontFamily:a,headers:u,index:h,minScrollableHeight:c,next:p,previewMode:m,productConfig:g,seen:b,showStripes:v,studyType:_,surveyId:f,update:T,useMobileStyling:S,viewDocument:w}=U(C=>({answers:C.answers,border:C.border,cards:C.cards,close:C.close,configureExitOnOverlayClick:C.configureExitOnOverlayClick,destroy:C.destroy,endCard:C.endCard,eventEmitFn:C.eventEmitFn,fontFamily:C.fontFamily,headers:C.headers,index:C.index,previewMode:C.previewMode,productConfig:C.productConfig,minScrollableHeight:C.minScrollableHeight,next:C.next,seen:C.seen,showStripes:C.showStripes,studyType:C.studyType,surveyId:C.surveyId,update:C.update,useMobileStyling:C.useMobileStyling,viewDocument:C.viewDocument})),x=ee(null),j=ee(!1),P=u["userleap-platform"],{props:y,type:E,name:k}=n[h];Z(()=>{if(window.Sprig)return window.Sprig.trackHistory=C=>U.getState().trackHistory(C),()=>{window.Sprig.trackHistory=void 0}},[]),Z(()=>{x.current&&(x.current.classList.contains("ul-app--visible")||x.current.classList.add("ul-app--visible"),!j.current&&d&&(j.current=!0,d(B.SprigEvent.SurveyAppeared,{name:B.SprigEvent.SurveyAppeared,"survey.id":f})))},[d,f]),Z(()=>{const C=()=>{w.visibilityState==="visible"&&(b(),w.removeEventListener("visibilitychange",C))};return w.addEventListener("visibilitychange",C),C(),()=>{w.removeEventListener("visibilitychange",C)}},[b,w]),Z(()=>{T()},[h,T]),Z(()=>{o(()=>r())},[r,o]);const I=async function(C){p({data:C,completeSurvey:()=>{i($.APP_ID)},endCard:s}),$.resetScrollPosition(w)};if(e){for(const C of e)if(C.questionId===k){let H;if(E==="multiplechoice"){const O=y.options.find(({value:q})=>q===C.value);if(!O)break;H={[O.id]:O.value}}else H=C.value;I({value:H,type:E,questionId:C.questionId});break}}const L=!S&&((g==null?void 0:g.framePosition)==="center"||(g==null?void 0:g.desktopDisplay)==="center-modal"||((g==null?void 0:g.placement)||"").includes("center"));return l("div",{className:M("ul-app",B.shouldDirectEmbed(u)?"ul-app--visible":"ul-app--overlay"),dir:"auto",id:$.APP_ID,onClick:C=>{var A;const H=window.sprigAPI,O=C.target;if(!H||!O)return;const q=[O,O.parentElement];for(const Y of q)if(((A=Y==null?void 0:Y.tagName)==null?void 0:A.toLowerCase())==="a"){C.preventDefault();try{const W=new URL(Y.href);W.protocol!=="http:"&&W.protocol!=="https:"||(H==null||H.openUrl(W.toString()))}catch(W){console.error(W)}return}},ref:x,style:{"--theme":t,...a?{fontFamily:a.replace(";","")}:{},...L?{position:"relative"}:{}},children:l("div",{className:"ul-app__container",children:l("div",{className:M(G("ul-card__container",S,_)),style:{..._!=="feedbackButton"||(g==null?void 0:g.desktopDisplay)==="center-modal"?{borderColor:t}:{},...(g==null?void 0:g.desktopDisplay)==="slider"?{margin:"0px"}:{}},children:l("div",{className:"sprig-container",style:{minHeight:c},children:[v&&l("div",{className:"ul-header__container",dir:"ltr",children:l("div",{className:"ul-header",children:"For development purposes only"})}),m&&l("div",{className:"ul-header__container",dir:"ltr",children:l("div",{className:"ul-header",children:"Preview Mode: Response will not be recorded."})}),l("div",{className:M(ko("ul-card-main-content",P)),children:(()=>{const C={className:"ul-card",next:I,questionId:k,type:E};switch(E){case"consentlegal":return z(jo,{...C,...y,key:k});case"likert":return z(To,{...C,...y,key:k});case"matrix":return z(Lo,{...C,...y,key:k});case"multiplechoice":return z(Oo,{...C,...y,key:k});case"multipleselect":return z(Uo,{...C,...y,key:k});case"nps":return z(Ho,{...C,key:k,props:y});case"open":return z(Ao,{...C,...y,key:k});case"recordedtask":return z(Go,{...C,...y,key:k});case"texturlprompt":return z(Yo,{...C,...y,key:k});case"thanks":return z(Qo,{...C,...y,key:k});case"uploading":return z(ii,{...C,...y,key:k});case"videovoice":return z(oi,{...C,...y,key:k});default:return null}})()}),l(si,{})]})})})})},Or=()=>MediaRecorder.isTypeSupported("video/webm")?"video/webm":"video/mp4",bn=e=>{const t={audioBitsPerSecond:128e3,videoBitsPerSecond:25e5,mimeType:Or()};return new MediaRecorder(e,t)},yn=(e,t,n)=>{n[t]=[],e.ondataavailable=function(r){n[t].push(r.data)},e.currentMediaRecordingUid=t,e.start()};function xn(e,t,n,r,o,i){if(e&&e.state!=="inactive"){const{"begin.callback":s}=r,d=e.currentMediaRecordingUid;if(!d)return;s&&s(d),e.onstop=()=>async function(a,u,h,c,p,m,g){const b=U.getState().viewDocument,{"upload.callback":v,"progress.callback":_}=c,f={mediaType:h,updatedAt:new Date().toISOString(),mediaRecordingUid:p,...c["passthrough.data"]},T=await(async(j,P)=>{var E;const y=await fetch(P,{method:"POST",cache:"no-cache",headers:{"Content-Type":"application/json"},body:JSON.stringify(j)});if(y.ok){const k=await y.json();return(E=k==null?void 0:k.upload)==null?void 0:E.url}return null})(f,a);if(!T)return void(v&&v(null,{message:"failed to get upload url"}));const S=new Blob(g,{type:Or()});if(!b.defaultView)return;const w=new b.defaultView.File([S],`recording video ${Date.now()}`),x=m.createUpload({endpoint:T,file:w,chunkSize:5120});x.on("error",j=>{v&&v(null,j)}),x.on("progress",j=>{_&&_(p,j)}),x.on("success",()=>{v&&v(p,!0)})}(t,0,n,r,d,o,i),e.stop()}}const li={state:{chunks:{}},stopRecording(e){const{uploadApiEndpoint:t,avRecorder:n,screenRecorder:r,UpChunk:o}=this.state,i=this.state.avStream&&this.state.avStream.getVideoTracks().length>0?"video":"audio";this.state.chunks&&t&&o&&(n!=null&&n.currentMediaRecordingUid&&xn(n,t,i,e,o,this.state.chunks[n==null?void 0:n.currentMediaRecordingUid]),r!=null&&r.currentMediaRecordingUid&&xn(r,t,"screen",e,o,this.state.chunks[r==null?void 0:r.currentMediaRecordingUid]))},handleCancelledStream(e){const t=e.getVideoTracks(),n=e.getAudioTracks();let r=t.length&&t[0];r=r||n.length&&n[0],r&&r.addEventListener("ended",()=>{[this.state.avRecorder,this.state.screenRecorder].map(o=>{o&&(o.state==="recording"&&o.stop(),o.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 n=>{this.avPermissionCallback(n)}),e.on("begin.recording",this.beginRecordingCallback.bind(this)),e.on("start.task",this.startTaskCallback.bind(this)),e.on("screen.permission",async n=>{this.screenPermissionCallback(n)}),e.on("finish.task",async n=>{this.finishTaskCallback(n)})},async avPermissionCallback(e){var r,o,i;const{"stream.ready":t,"permission.descriptors":n}=e;try{(r=this.state.avStream)!=null&&r.active&&(this.state.avStream.getTracks().map(s=>s.readyState==="live"&&s.stop()),((o=this.state.captureStream)==null?void 0:o.getAudioTracks().length)===1&&this.state.captureStream.removeTrack(this.state.captureStream.getAudioTracks()[0])),this.state.avStream=await navigator.mediaDevices.getUserMedia({video:n.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(s){return console.warn("Error: failed to get permissions: "+s),void(t&&t(null,null))}t&&t(this.state.avStream,this.state.captureStream)},async screenPermissionCallback(e){const{"screen.permission.requested":t,"stream.ready.callback":n}=e;t==null||t(!0);try{this.state.captureStream=await navigator.mediaDevices.getDisplayMedia({video:!0,cursor:"always",displaySurface:"browser",preferCurrentTab:!0})}catch(r){return t==null||t(!1),console.warn("Error: failed to get permissions: "+r),void(n&&n(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),n&&n(this.state.avStream||null,this.state.captureStream)},beginRecordingCallback(e){const{"recording.media.types":t,"start.recording.callback":n=()=>{}}=e;if(!t)return;const r=[];if(t.includes("video")&&this.state.avStream){this.state.avRecorder=bn(this.state.avStream);const o=B.v4();yn(this.state.avRecorder,o,this.state.chunks),r.push(o)}if(t.includes("screen")&&this.state.captureStream){this.state.screenRecorder=bn(this.state.captureStream);const o=B.v4();yn(this.state.screenRecorder,o,this.state.chunks),r.push(o)}r&&n&&n(r)},async finishTaskCallback(e){const{"current.index":t,"task.response":n,"task.complete.callback":r}=e;await this.stopRecording(e),r&&r(this.taskDurationMillisecond()),this.state.cards&&this.state.hasEndCard!==void 0&&this.lookAheadAndStopStream(t,n,this.state.cards,this.state.hasEndCard)},startTaskCallback(){this.state.startTime=new Date},permissionStatusCallback(e){var r;const{"permission.status.callback":t}=e,n=this.state.avStream;t&&t(n,!!n&&(n==null?void 0:n.getVideoTracks().length)>0,!!((r=this.state.captureStream)!=null&&r.active),this.state.captureStream)},lookAheadAndStopStream(e,t,n,r){const{avRecorder:o,screenRecorder:i}=this.state,{allResponses:s}=U.getState(),d=hr({cards:n,index:e,hasEndCard:r,allResponses:s});d!==null&&n[d].type==="recordedtask"||[o,i].map(a=>{a&&(a.state==="recording"&&a.stop(),a.stream.getTracks().map(u=>{u.readyState==="live"&&u.stop()}))})}},He=Object.create(li);Object.freeze(He);const di=({mode:e=null,viewWindow:t,viewDocument:n,trackPageViewUrl:r})=>{const o=n.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:o.clientWidth,ch:o.clientHeight,p:r??i,l:t.navigator.language}},ci={configure:function(e,t=!0){var _;const{answers:n,apiURL:r,endCard:o,eventEmitFn:i,fontFamilyURL:s,frame:d,previewKey:a,viewDocument:u,viewWindow:h}=e,c=B.shouldDirectEmbed(e.headers)?e.frame:u.body,p=e.UpChunk||window.UpChunk,m=B.eventEmitter,g=((f,T)=>{const S=[...f],w=new Set(["videovoice","recordedtask"]);return f.some(x=>w.has(x.type))&&S.push({name:-2,props:{routingOptions:[]},type:"uploading"}),T&&S.push({name:-1,props:{routingOptions:[]},type:"thanks"}),S})(e.cards,!!o);He.configure(m,{cards:g,hasEndCard:!!o,apiURL:r,UpChunk:p}),U.setState({apiURL:r,answers:n,border:e.border,index:e.startingQuestionIdx||0,cards:g,configureExitOnOverlayClick:e.configureExitOnOverlayClick,customMetadata:e.customMetadata,endCard:e.endCard,envId:e.envId,eventEmitFn:i,fontFamily:e.fontFamily,forceBrandedLogo:e.forceBrandedLogo,frame:d,headers:e.headers,hasViewedEmbed:!1,isPreview:e.isPreview,marketingUrl:"https://sprig.com",meta:di({mode:e.mode,viewWindow:h,viewDocument:u,trackPageViewUrl:e.trackPageViewUrl}),mode:e.mode,previewKey:a,previewMode:e.previewMode,productConfig:e.productConfig,recorder:He,recorderEventEmitter:m,responseGroupUid:e.responseGroupUid,showStripes:e.showStripes,showSurveyBrand:e.showSurveyBrand,slugName:e.slugName,styleNonce:e.styleNonce,studyType:e.studyType,surveyId:e.surveyId,tabTitle:e.tabTitle,uploadingCardViewed:!1,uploadProgress:{},useMobileStyling:e.useMobileStyling,useDesktopPrototype:e.useDesktopPrototype,userId:e.userId,viewDocument:e.viewDocument,visitorAttributes:e.visitorAttributes,viewedCardCount:e.startingQuestionIdx||0});const{head:b}=u;if($.setSurveyStyles({document:u,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;min-height:0;justify-content:center}.ul-card__container--desktop{border:2px solid #fff;box-shadow:0 0 15px #00000026;margin:15px}.ul-card__container--mobile{border-width:0;box-shadow:0 0 5px #00000040;margin-top:5px}.sprig-container{display:flex;flex-direction:column;width:100%;height:fit-content;flex:1 1 auto;min-height:0;justify-content:center}.ul-card__container{background:#fff;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:break-word;overflow:auto}.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}.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:#343442;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}.sprig-border-bottom{border-bottom:1px solid rgba(0,0,0,.1)}.sprig-border-top{border-top:1px solid rgba(0,0,0,.1)}.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:#343442;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:#6c6c6e;text-align:start;margin-top:4px}.ul-card__choices{margin:5px 0 0;flex:1 0}.choice--mobile{border:2px solid #e6e6e6}.choice--desktop{border:1px solid #e6e6e6}.choice{align-items:flex-start;color:#262136;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:#00000003}.choice--desktop:hover,.choice--desktop:active,.choice--mobile:active{background-color:#0000000d}.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:transparent;color:#343442;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:0;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:#6c6c6e80}.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 #b0b5b7;flex-shrink:0}.select-radio{height:16px;width:16px;border-radius:16px;border:1px solid #323232;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:#000000b3}[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:#343442;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:#efefee;display:flex;align-items:center;justify-content:center}.sprig-check{height:9px;width:9px;margin-left:-1px}.sprig-check path{stroke:#506067;stroke-width:1.5}.sprig-caret{height:20px;width:20px;transition-property:transform}.sprig-caret path{stroke:#000}.ul-consent-legal__name-input--mobile{border:2px solid #e6e6e6}.ul-consent-legal__name-input--desktop{border:1px solid #e6e6e6}.ul-consent-legal__name-input{background:#00000003;box-sizing:border-box;color:#343442;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:#6c6c6e80}.ul-consent-legal__name-input:focus{outline:none;background:#fff}.ul-consent-legal__name-input--desktop:hover:not(:focus){background-color:#0000000d}.ul-card__consent-legal .choice{font-size:15px;padding:10px 15px;background-color:#00000003}.ul-card__consent-legal .choice--desktop:hover,.ul-card__consent-legal .choice--desktop:active,.ul-card__consent-legal .choice--mobile:active{background-color:#0000000d}.ul-card--likert__numbers{align-items:center;border-radius:5px;display:flex;flex-direction:row;flex:1 0;justify-content:center;margin:5px 0 0}.ul-card--likert__numbers>button{padding:unset}.likert-number--mobile{border:2px solid #e6e6e6}.likert-number--mobile:not(:first-child){margin-inline-start:-2px}.likert-number--desktop{border:1px solid #e6e6e6}.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;background-color:#00000003;font-size:18px;line-height:24px;height:67px}.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,.likert-number--desktop:hover{background-color:#0000000d;font-weight:500}.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:transparent;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:transparent;line-height:24px;height:67px;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:#262136;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--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-matrix-row-options{display:grid;grid-column:2/-1;grid-template-columns:subgrid}.ul-matrix-column-label{font-size:15px;max-width:150px;padding:10px 12px;text-align:center}.ul-card--matrix_container{margin-bottom:16px;overflow:auto}.ul-card--matrix_question_container{display:flex;flex-direction:column}.ul-matrix-scroll-gradient{-webkit-mask-image:linear-gradient(90deg,#000 90%,transparent);mask-image:linear-gradient(90deg,#000 90%,transparent)}.ul-matrix-scroll-gradient:dir(rtl){-webkit-mask-image:linear-gradient(270deg,#000,90%,transparent);mask-image:linear-gradient(270deg,#000,90%,transparent)}.ul-matrix-scroll-gradient:dir(rtl)+.ul-matrix-scroll-arrow{rotate:180deg}.ul-matrix-scroll-arrow{align-self:flex-end;background:none;border:none;color:#000;padding:0;position:absolute;top:45%}.ul-matrix-scroll-arrow:hover{cursor:pointer}.ul-matrix-option-wrapper{align-items:center;background:#f9f9f8;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:#f9f9f8;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%}.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 #e6e6e6}.nps-number--mobile:not(:first-child){margin-inline-start:-2px}.nps-number--desktop{border:1px solid #e6e6e6}.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;background-color:#00000003;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:#0000000d;font-weight:500}.ul-card--nps__labels{align-items:center;color:#262136;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-text{margin-top:2px;margin-bottom:3px;align-items:center;display:flex;flex-direction:column;justify-content:center;padding:0}.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 #e6e6e6;max-height:63px}.ul-card-text__input--desktop{border:1px solid #e6e6e6;max-height:150px}.ul-card-text__input{background:#00000003;box-sizing:border-box;color:#343442;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:#6c6c6e80}.ul-card-text__input:focus{outline:none;background:#fff}.ul-card-text__input--desktop:hover:not(:focus){background-color:#0000000d}.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:#0000000d;text-align:center;flex-direction:column;margin-left:auto;margin-right:auto;border-radius:5px;display:flex;align-items:center;font-size:15px;color:#000000b3}.ul-av-permission-denied-paragraph{margin:auto 15px;font-size:12px}.ul-av-permission-denied-headline{font-size:14px;color:#262136;text-decoration:underline;font-size:12px}.ul-permission-body{color:#000;margin:5px auto 5px 5px;line-height:135%;text-align:center}.ul-select-tab-container{width:240px;height:46px;background:#fff;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:#4b575d;margin:5px;line-height:135%;text-align:center}button.ul-task-skip-button{color:#000;background-color:#fff}#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:#4c4c4c}#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);border-radius:3px;border:none;color:#fff;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:#0000001a;color:#0003}.ul-card-text__button.ul-button-inactive{background-color:#fff!important;color:#5d696f!important}.ul-card-skip__button{color:#00000080;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 #0b2330;box-shadow:0 0 0 2px #c8cccc;cursor:pointer;display:flex;font-size:15px;justify-content:space-between;margin-bottom:8px;padding:4px 8px 4px 16px;width:100%}.select-button:hover{background-color:#f3f3f3}.select-button:active{background-color:#eee}.select-button span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select-button.select-button-placeholder{color:#b0b5b7}.select-button svg{flex-shrink:0}.select-list{position:relative;height:fit-content;padding:4px 0;z-index:100;background-color:#fff;border:1px solid #E2E3E1;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:#f3f3f3}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}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:repeating-linear-gradient(120deg,#ebebeb,#ebebeb 24px,#fff 24px,#fff 48px);border-bottom:2px solid #ebebeb;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}.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:#00000003;border:1px solid #e6e6e6;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:#00000008}.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:#f9c600;border-radius:5px;display:flex;padding:4px}.close-container{display:flex;justify-content:flex-end;width:100%;height:0}.close-btn{cursor:pointer;height:16px;margin-inline-end:-10px;position:relative;top:-10px;width:16px;z-index:1;align-self:flex-start;justify-self:end;flex-shrink:0}.ul-app__container{transition:opacity .3s ease-out}.ul-center-horizontally{text-align:center}#ul-progress-bar-container{width:100%;height:2px;background-color:#0000001a;border-radius:2px;max-width:250px;margin:16px 0}#ul-progress-bar-current{transition:width 1s ease;width:0%;height:0;border-radius:2px}.prototype-button{align-self:stretch;background:#00000003;border:1.5px solid #e6e6e6;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}'}),e.customStyles&&$.setSurveyStyles({document:u,elementId:"ul-custom-style",styleString:e.customStyles,nonce:e.styleNonce}),e.fontFamily&&s&&parent){const f=u.createElement("link");f.rel="stylesheet",f.href=s,b.appendChild(f)}if(!p&&e.cards.some(f=>f.type==="recordedtask")){const f=u.createElement("script");f.src=e.upchunkLibraryURL??"https://cdn.sprig.com/userleap-web-upchunk-v2.2.2.js",f.onload=()=>{He.setUpChunk(h.UpChunk)},f.onerror=()=>{console.warn("[Sprig] - recording functionality not configured due to UpChunk library load failure")},b.appendChild(f)}const v=i||((_=d.eventEmitter)==null?void 0:_.emit);v==null||v("verify.view.version",{"view.version":"2.33.2"}),c&&t&&Ce(l(ai,{}),c)}};exports.default=ci;
|
|
669
|
+
`}],Rr="-video-player",pn="-secondary-video-player",hn="-video-recorder";let ie,mn;const ge=async({event:e,apiBase:t,headers:n,visitorId:r,envId:o,metadata:i})=>{const s=D.document.documentElement;if(!r||!o)return;const d={event:`SDK - ${e}`,visitorId:r,environmentId:o,metadata:{...i||{},screenWidth:window.screen.width,screenHeight:window.screen.height,clientWidth:s.clientWidth,clientHeight:s.clientHeight,location:window.location.href,language:navigator.language}};(await fetch(`${t}/sdk/1/visitors/${r}/analytics`,{method:"POST",cache:"no-cache",headers:n,body:JSON.stringify(d)})).ok||console.warn("[Sprig] (ERR-444) Failed to track analytics",e)},ae=async(e,t,n,r,o,i)=>{ge({event:`Video Error ${t}`,apiBase:n,headers:r,visitorId:o,envId:i,metadata:{errorMessage:e.message}});const s=D.document.documentElement,d={screenWidth:window.screen.width,screenHeight:window.screen.height,clientWidth:s.clientWidth,clientHeight:s.clientHeight,location:window.location.href,language:navigator.language},a={action:t,err:{message:e.message,stack:e.stack},meta:d,vid:o,envId:i};(await fetch(`${n}/sdk/1/errors`,{method:"POST",cache:"no-cache",headers:{...r,"userleap-platform":"video_recorder","x-ul-error":window.btoa(`userleap-${Date.now()}-error`)},body:JSON.stringify(a)})).ok||console.warn("[Sprig] (ERR-444) Failed to report error to API",e)},Pr=(e,t)=>{if(e.length===0)return t&&t();Promise.all(e.reduce((n,r)=>(n.push(((o,{type:i,content:s})=>new Promise(function(d,a){let u;i==="script"?(u=D.document.createElement("script"),u.src=s):i==="link"?(u=D.document.createElement("link"),u.rel="stylesheet",u.href=s,u.type="text/css"):(u=D.document.createElement("style"),u.innerHTML=s),u.onload=function(){d(s)},u.onerror=function(){a(s)},u.async=!1,u.id=btoa(s),o.appendChild(u)}))(D.document.head,r)),n),[])).then(()=>{D.videojs=D.document.defaultView.videojs,t&&t()}).catch(function(n){console.log(n+" failed to load")})},gn=(e,t,n)=>{if(t==="start"&&(e.style.visibility="visible"),t==="none")e.style.visibility=Q;else if(t==="success")e.style.visibility=Q,e.innerHTML="Upload succeeded!";else{const r=Math.round(parseFloat(n));e.innerHTML=`Uploading <span class="ul-upload-progress-label__time">${r}%</span>`,e.style.background=`linear-gradient(to right, #E0E0EB 0%, #E0E0EB ${r}%, #FCFCFD ${r}%, #FCFCFD 100%)`}},rt=(e,t)=>{const n=D.videojs(e.id());return n==null?void 0:n.payload[t]},Dr=(e,t)=>{const n=new(D.videojs.getComponent("Component"))(e);return n.addClass("ul-buttons-panel"),t.map(r=>{n.addChild(r)}),Xo(n),n},Xo=e=>{e.children().forEach(t=>{if(te[t.name_]){const n=Ue(te[t.name_],`ul-${te[t.name_]}`);t.el_.appendChild(n)}})},Ue=(e,t="")=>{const n=D.document.createElement("span");return n.className="ul-button-text",n.innerHTML=e,n.id=t,n},Lr=(e,t,n,r,o=!1,i)=>{e.addClass("ul-video-player");const s=new(D.videojs.getComponent("Component"))(e);s.addClass("ul-control-panel"),e.progressBar=s.addChild("ProgressControl"),n&&e.src(n),e.audioPlayerPlaceholder=new(D.videojs.getComponent("Component"))(e),e.audioPlayerPlaceholder.addClass("ul-audio-recorder-placeholder");const d=n&&n.src?ri(n.src):null;!n||!o&&d?(e.audioPlayerPlaceholder.hide(),D.document.getElementById(`${e.id()}_html5_api`).style.height="100%",d&&e.poster(d)):(e.children()[0].classList.add("vjs-hidden"),D.document.getElementById(`${e.id()}_html5_api`).style.height="0px"),e.on("play",()=>{o||!n||d||ti(e),i==null||i.play()}),e.on("pause",()=>{i==null||i.pause()}),e.on("seeked",()=>{i==null||i.currentTime(e.currentTime())}),e.on("ratechange",()=>{i==null||i.playbackRate(e.playbackRate())}),e.addChild(e.audioPlayerPlaceholder,{},1),s.addChild(t),e.addChild(s),r&&r(e)},ei=(e,t,n,r,o,i,s,d=!1)=>{mn=Date.now();const a=ze(t,{controls:!1,bigPlayButton:!1,fluid:!1,width:1280,height:720,playsinline:!0,plugins:{record:{audio:!0,video:{mandatory:{minWidth:1280,minHeight:720}},frameWidth:1280,frameHeight:720,maxLength:600,autoMuteDevice:!0}}});if(!a)return;a.payload=n;const{surveyId:u,questionId:h,responseGroupUid:c,visitorId:p,envId:m}=n;let g;const b=E=>{const k=tt,I=tt+"-audio-only";gn(a.uploadProgressLabel,"none"),ie&&ie.startTime>=mn&&ie.abort();const L=D.document.getElementById("ul-camera-button");E?(a.children()[0].classList.add("vjs-hidden"),T.removeClass(k),T.addClass(I),L.innerHTML=te.TurnOnCamera,a.audioPlayerPlaceholder.removeClass("vjs-hidden"),g==null||g.getTracks().forEach(C=>{C.stop()}),window.navigator.mediaDevices.getUserMedia({video:!0,audio:!0}).then(C=>{g=C,C.getVideoTracks().forEach(A=>{A.enabled=!1}),a.record().onDeviceReady(C)}).catch(a.record().onDeviceError.bind(a.record()))):(g==null||g.getVideoTracks().forEach(C=>{C.enabled=!0}),a.children()[0].classList.remove("vjs-hidden"),a.record().getDevice(),T.removeClass(I),T.addClass(k),L.innerHTML=te.TurnOffCamera,a.audioPlayerPlaceholder.addClass("vjs-hidden"))},v=new(D.videojs.getComponent("Button"))(a,{clickHandler:()=>{v.hasClass(Q)||(ge({event:"Video Delete Button Clicked",apiBase:r,headers:s,visitorId:p,envId:m,metadata:{questionId:h,responseGroupUid:c,surveyId:u}}),b(a.cameraOff),o(N.DELETE,{}),T.removeClass(Q),v.addClass(Q))}});v.addClass("ul-video-recorder-delete-button"),v.el_.appendChild(Ue(te.DeleteButton,"ul-delete-button"));const _=D.document.getElementById(t),f=()=>{_.classList.contains("vjs-fullscreen")&&a.cameraOff?_.style.display="table":_.style.display="flex"};f();const T=new(D.videojs.getComponent("Button"))(a,{clickHandler:()=>{a.record().isRecording()||(a.cameraOff=!a.cameraOff,ge({event:"Video Camera Button Clicked",apiBase:r,headers:s,visitorId:n.visitorId,envId:n.envId,metadata:{questionId:h,responseGroupUid:c,surveyId:u,cameraOff:a.cameraOff}}),b(a.cameraOff),!v.hasClass(Q)&&v.addClass(Q),o(N.DELETE,{}),f())}});T.addClass(tt),T.el_.appendChild(Ue(te.TurnOffCamera,"ul-camera-button"));const S=new(D.videojs.getComponent("Button"))(a,{clickHandler:()=>{const E=D.document.getElementById("ul-recorder-toggle");if(a.record().isRecording())a.record().stop(),E&&(E.innerHTML=te.RecordButton),S.removeClass(nt),v.removeClass(Q);else{const k=D.document.getElementById("ul-recording-countdown-screen");if(k)k.remove(),E&&(E.innerHTML=te.RecordButton),b(a.cameraOff),o(N.DELETE,{}),T.removeClass(Q),v.addClass(Q),S.removeClass(nt),j.show();else{S.addClass(nt),j.hide(),T.addClass(Q),v.addClass(Q),E&&(E.innerHTML=te.StopButton);const I=D.document.createElement("div");I.id="ul-recording-countdown-screen",_.insertBefore(I,_.children[1]),I.style.height=`${_.offsetHeight}px`,Mr(a,3)}}}});S.addClass("ul-video-recorder-toggle-button"),S.el_.appendChild(Ue(te.RecordButton,"ul-recorder-toggle"));const w=D.document.createElement("p");w.style.visibility="hidden",w.className="ul-upload-progress-label",e.appendChild(w),a.uploadProgressLabel=w;const x=Dr(a,[v,T,"PlayToggle",S,"FullscreenToggle"]),j=x.children().find(E=>E.name_==="FullscreenToggle");j.hasClass("vjs-disabled")&&j.hide();const P=x.children().find(E=>E.name_==="PlayToggle");P.hide(),v.addClass(Q),Lr(a,x,i,!1,d),a.on("stopRecord",()=>{S.hide(),P.show(),j.show(),v.removeClass(Q)}),a.on("deviceReady",()=>{S.show(),P.hide(),v.addClass(Q)}),((E,k,I,L,C)=>{const{surveyId:A,responseGroupUid:O,visitorId:q,envId:B}=E.payload;E.on("deviceError",function(){console.warn("device error: ",E.deviceErrorCode),E.deviceErrorCode.message==="Permission denied"?(E.deviceButton.addClass("permission-denied"),I&&I(N.ERROR,{type:N.PERMISSION_DENIED}),ge({event:"Video Permission Denied",apiBase:k,headers:C,visitorId:q,envId:B,metadata:{questionId:rt(E,et),responseGroupUid:O,surveyId:A}})):(I&&I(N.ERROR,{type:N.OTHER}),ae(new Error(E.deviceErrorCode.message),"recorderDeviceError",k,C,q,B))}),E.on("error",function(Y,W){ae(W||E.error(),"recorderError",k,C,q,B)}),E.on("startRecord",function(Y,W){L(E.uploadProgressLabel,"none"),ge({event:"Video Record Start",apiBase:k,headers:C,visitorId:q,envId:B,metadata:{questionId:rt(E,et),responseGroupUid:O,surveyId:A}})}),E.on("finishRecord",async function(){L(E.uploadProgressLabel,"start",0);const Y=rt(E,et);if(!A){const oe="internal error: missing fields in payload";return I&&I(N.ERROR,{type:N.OTHER}),ae(new Error(oe),"finishRecord",k,C,q,B),null}E.record().stopDevice();const W=E.cameraOff?N.MEDIA_TYPE_AUDIO:N.MEDIA_TYPE_VIDEO,X=U.v4();ge({event:"Video Record Finish",apiBase:k,headers:C,visitorId:q,envId:B,metadata:{mediaRecordingUid:X,questionId:Y,responseGroupUid:O,surveyId:A,mediaType:W}});const he={surveyId:A,updatedAt:new Date().toISOString(),mediaType:W,mediaRecordingUid:X};Y&&(he.questionId=Y),O&&(he.responseGroupUid=O),q&&(he.visitorId=q);const me=await(async()=>{const oe=await fetch(`${k}/2/environments/integrations/upload`,{method:"POST",cache:"no-cache",headers:{"Content-Type":"application/json"},body:JSON.stringify(he)});if(oe.ok){const It=await oe.json();return I&&I(N.UPLOAD_STARTED,{[N.UPLOAD_ID]:It.upload.id,[N.MEDIA_TYPE]:W,[N.MEDIA_RECORDING_UID]:X}),It.upload.url}return I&&I(N.ERROR,{type:N.OTHER,response:oe}),ae(new Error("failed to get upload response with url"),"finishRecord",k,C,q,B),null})();me&&(ie=D.document.defaultView.UpChunk.createUpload({endpoint:me,file:new D.document.defaultView.File([E.recordedData],`recording ${W} ${Date.now()}`),chunkSize:5120}),ie.startTime=Date.now(),ge({event:"Video Upload Start",apiBase:k,headers:C,visitorId:q,envId:B,metadata:{mediaRecordingUid:X,questionId:Y,responseGroupUid:O,surveyId:A,mediaType:W,url:me}}),ie.on("error",oe=>{L(E.uploadProgressLabel,"none"),I&&I(N.UPLOAD_FINISHED,{[N.MEDIA_RECORDING_UID]:X}),ae(oe,"finishRecord",k,C,q,B)}),ie.on("progress",oe=>{I&&I(N.UPLOAD_PROGRESS,{[N.MEDIA_RECORDING_UID]:X,[N.UPLOAD_PROGRESS_PCT]:oe.detail}),L(E.uploadProgressLabel,"progress",oe.detail)}),ie.on("success",()=>{L(E.uploadProgressLabel,"success"),I&&I(N.UPLOAD_FINISHED,{[N.MEDIA_RECORDING_UID]:X}),ge({event:"Video Upload Success",apiBase:k,headers:C,visitorId:q,envId:B,metadata:{mediaRecordingUid:X,questionId:Y,responseGroupUid:O,surveyId:A,mediaType:W,url:me,elapsedMs:ie.startTime&&Date.now()-ie.startTime}})}))})})(a,r,o,gn,s);const y=[{name:"microphone"}];!a.cameraOff&&y.push({name:"camera"}),Promise.all(y.map(E=>{var k;return(k=navigator==null?void 0:navigator.permissions)==null?void 0:k.query(E)})).then(E=>{E.reduce((k,I)=>k&I.state==="granted",!0)&&a&&(a.deviceButton&&a.deviceButton.hide(),a.record().getDevice())}).catch(E=>{})},Mr=(e,t=3)=>{const n=D.document.getElementById("ul-recording-countdown-screen");n&&t===0?(n.remove(),e.record().start()):n&&(n.innerHTML=`<span class='ul-countdown-text'>Recording in... ${t}</span>`,setTimeout(()=>{Mr(e,t-1)},1e3))},Nr=e=>{const t=D.document.createElement("div");return t.className="ul-video-container",t.appendChild((n=>{const r=D.document.createElement("div");return r.className="ul-video-player-loading",r.id=jt(n),["first","second","third","fourth"].map(o=>{const i=D.document.createElement("div");i.className=o,r.appendChild(i)}),r})(e)),t},ht=(e,t)=>{const n=D.document.createElement("video");n.id=e,n.className="video-js vjs-default-skin ul-video-player-video";const r=D.document.createElement("p");r.className="vjs-no-js",r.innerHTML="To view this video please enable JavaScript, and consider upgrading to a web browser that";const o=D.document.createElement("a");return o.href="https://videojs.com/html5-video-support/",o.target="_blank",o.innerHTML="supports HTML5 video",r.appendChild(o),n.appendChild(r),t.appendChild(n),t},ti=(e,t)=>{e.children()[0].classList.remove("vjs-hidden"),e.audioPlayerPlaceholder.hide(),D.document.getElementById(`${e.id()}_html5_api`).style.height="100%"},ze=(e,t)=>D.document.getElementById(e)?t?D.videojs(e,t):D.videojs(e):(console.error(`Error in finding player element with ID, ${e}`),null),ni=(e,t,n,r=!1,o="https://api.sprig.com",i=document,s=null,d=null)=>{D.document=i;const a=e+Rr,u=Nr(a);return D.document.addEventListener("securitypolicyviolation",h=>{ae(new Error(`Voice & Video feature violates ${h.violatedDirective} web page CSP policies for the question player.`),"playerDeviceError",o,{})}),Pr(Tr,()=>{D.document.getElementById(jt(a)).remove(),ht(a,u);const h={playsinline:!0,playbackRates:[.5,1,1.5,2],fill:!0};try{const c=e+pn;ht(c,u);const p=ze(a,h),m=ze(c,{muted:!0,...h});if(!p||!m)return;((v,_,f)=>{v.addClass(`ul${pn}`);const T=new(D.videojs.getComponent("Component"))(v);_&&v.src(_),v.addChild(T),f&&f(v)})(m,s,d),s||m.addClass(Q);const g=Dr(p,["PlaybackRateMenuButton","PlayToggle","FullscreenToggle"]),b=g.children().find(v=>v.name_==="FullscreenToggle");b.hasClass("vjs-disabled")&&b.hide(),Lr(p,g,t,n,r,m)}catch(c){return void ae(new Error(`Error when creating video player object ${c}`),"playerDeviceError",o,{})}}),u},ri=e=>{if(!e)return null;const t=e.match(/https:\/\/stream.mux.com\/(.*)/);let n=t?t[1]:null;return n.includes(un)&&(n=n.replace(un,"")),n?`https://image.mux.com/${n}/thumbnail.jpg?time=0`:null},N={UPLOAD_STARTED:"upload.started",UPLOAD_PROGRESS:"upload.progress",UPLOAD_FINISHED:"upload.finished",DELETE:"delete",ERROR:"error",MEDIA_TYPE:"media.type",PERMISSION_DENIED:"permission_denied",OTHER:"other",UPLOAD_ID:"upload.id",UPLOAD_PROGRESS_PCT:"upload.progress.pct",MEDIA_RECORDING_UID:"media.recording.uid",MEDIA_TYPE_VIDEO:"video",MEDIA_TYPE_AUDIO:"audio"},te={PlaybackRateMenuButton:"Speed",PlayToggle:"Play",FullscreenToggle:"Expand",TurnOnCamera:"Turn on",TurnOffCamera:"Turn off",DeleteButton:"Delete",RecordButton:"Record",StopButton:"Stop",PauseButton:"Pause"},fe="ul-card-video__player_recorder",vn="ul-video-btn",ot=0,fn=1,oi=({className:e,message:t,next:n,properties:r,questionId:o,type:i})=>{const{apiURL:s,envId:d,handleUploadUpdate:a,headers:u,responseGroupUid:h,surveyId:c,update:p,viewDocument:m,visitorId:g}=H(k=>({apiURL:k.apiURL,envId:k.envId,handleUploadUpdate:k.handleUploadUpdate,headers:k.headers,responseGroupUid:k.responseGroupUid,surveyId:k.surveyId,update:k.update,viewDocument:k.viewDocument,visitorId:k.userId})),[b,v]=F(!1),[_,f]=F(null),[T,S]=F(null),[w,x]=F(ot),j=ee(null),P=r&&r.videoUrl;Z(()=>{const k=j.current,I=new ResizeObserver(()=>{p()});return k&&I.observe(k),()=>{k&&I.unobserve(k)}},[p]);const y=(k,I)=>{k===N.UPLOAD_STARTED?(f(I[N.UPLOAD_ID]),S(I[N.MEDIA_RECORDING_UID]),v(!0)):k===N.DELETE?(f(null),S(null),v(!1)):k===N.UPLOAD_PROGRESS?isNaN(I[N.UPLOAD_PROGRESS_PCT])?a({mediaRecordingUid:I[N.MEDIA_RECORDING_UID],isComplete:!0}):a({mediaRecordingUid:I[N.MEDIA_RECORDING_UID],progressPct:I[N.UPLOAD_PROGRESS_PCT]}):k===N.UPLOAD_FINISHED&&a({mediaRecordingUid:I[N.MEDIA_RECORDING_UID],isComplete:!0})},E=k=>{k.preventDefault(),k.stopPropagation(),document.getElementById(fe)&&(I=>{const L=I+hn;if(D.document.getElementById(L)&&D.videojs){try{if(!D.videojs(L).record().stream)return}catch{return}D.videojs(L).record().stop(),D.videojs(L).record().stopDevice()}})(fe),_&&T?(a({mediaRecordingUid:T,isSubmitted:!0}),n({value:{mediaRecordingUid:T},questionId:o,type:i})):n({value:null,questionId:o,type:i})};return l("form",{className:M(e,"ul-card--video","fade-in-transition"),id:"ul-video-interview-form",children:[l(re,{message:t,properties:r}),l(pe,{children:[l("div",{id:"ul-question-player-container",ref:j,style:{display:w===ot?"":"none"},children:[l("div",{id:fe,ref:k=>{if(k&&k.children.length===0&&!r.hideRecordedPrompt){const I=ni(fe,{src:P,type:"application/x-mpegURL"},void 0,r.mediaType===N.MEDIA_TYPE_AUDIO,s,m);k.appendChild(I)}}}),l(ue,{defaultBody:()=>l("button",{className:`${vn} ul-record-response-btn`,onClick:k=>{k.preventDefault(),k.stopPropagation(),document.getElementById(fe)&&(I=>{const L=ze(I+Rr);L==null||L.pause()})(fe),x(fn)}}),properties:r})]}),l("div",{style:{display:w===fn?"block":"none"},children:[l("button",{className:`${vn} ul-back-question-btn`,onClick:k=>{k.preventDefault(),k.stopPropagation(),x(ot)},style:{display:r.hideRecordedPrompt?"none":"block"}}),l("div",{id:"ul-recorder-player-container",ref:k=>{if(k&&k.children.length===0){const I=((L,C={},A="https://api.userleap.com",O,q,B,Y=!1,W=document)=>{D.document=W;const X=L+hn,he=Nr(X);return D.document.addEventListener("securitypolicyviolation",me=>{ae(new Error(`Voice & Video feature violates ${me.violatedDirective} web page CSP policies for the recorder player.`),"recorderDeviceError",A,B,C.visitorId,C.envId)}),Pr(Tr.concat(Jo),()=>{ht(X,he),D.document.getElementById(jt(X)).remove();try{ei(he,X,C,A,O,q,B,Y)}catch(me){return void ae(new Error(`Error when creating video recorder player object ${me}`),"recorderDeviceError",A,B,C.visitorId,C.envId)}}),he})(fe,{surveyId:c,responseGroupUid:h,questionId:o,visitorId:g,envId:d},s,y,void 0,{...u,"x-ul-video-recorder-origin":"sdk"},r.mediaType===N.MEDIA_TYPE_AUDIO,m);k.appendChild(I)}}})]})]}),l(ve,{children:[l(J,{disabled:!b,onClick:E,children:xe(r)}),l("button",{className:"ul-card-text__button ul-button-inactive ul-card-skip__button",id:"ul-card-video__skip_button",onClick:E,style:{display:r.required?"none":"block",...b?{display:"none"}:{}},children:Ct(r)})]})]})},ii=({className:e})=>{const{uploadProgress:t}=H(i=>({uploadProgress:i.uploadProgress}));let n,r;Object.values(t).filter(i=>i.isSubmitted).length>1?(n="Your responses are processing",r="Please keep this tab open until your responses are fully processed."):(n="Your response is processing",r="Please keep this tab open until your response is fully processed.");const o=Math.round(Math.min(99,...Object.values(t).filter(i=>i.isSubmitted).map(i=>i.progressPct||0)));return l("div",{className:M(e,"ul-card--uploading","fade-in-transition"),children:[l("div",{"aria-busy":"true","aria-label":"Processing...","aria-live":"polite",className:"ul-loading-spinner-container",role:"progressbar",children:l("div",{className:"ul-loading-spinner",children:[l("div",{className:"first"}),l("div",{className:"second"}),l("div",{className:"third"}),l("div",{className:"fourth"})]})}),l(re,{message:`${n} (${o}% complete)`}),l("p",{className:"ul-caption",children:r})]})},_n=({logoOnly:e=!1,style:t={}})=>l("svg",{alt:(e?"Powered by ":"")+"Sprig",width:e?"35":"112",height:"15",viewBox:e?"79 0 31 15":"0 0 112 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{display:"block",...t},children:[!e&&l("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:"black",fillOpacity:"0.7"}),l("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:"black",fillOpacity:"0.7"}),l("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:"black",fillOpacity:"0.7"}),l("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:"black",fillOpacity:"0.7"}),l("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:"black",fillOpacity:"0.7"}),l("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:"black",fillOpacity:"0.7"})]}),si=()=>{const{border:e,cards:t,forceBrandedLogo:n,headers:r,index:o,marketingUrl:i,showSurveyBrand:s,slugName:d,surveyId:a,viewedCardCount:u}=H(_=>({border:_.border,cards:_.cards,forceBrandedLogo:_.forceBrandedLogo,headers:_.headers,index:_.index,marketingUrl:_.marketingUrl,showSurveyBrand:_.showSurveyBrand,slugName:_.slugName,surveyId:_.surveyId,viewedCardCount:_.viewedCardCount})),h=ee(null),c=t.filter(_=>_.type!=="uploading"&&_.type!=="thanks"),p=((_,f)=>{const T=new Set(["thanks","uploading"]);if(f>=_.length||f<0||T.has(_[f].type))return 0;const S=_.filter(x=>!T.has(x.type));if(f===S.length-1)return 1;const w={[S.length-1]:1,[-1]:0};for(let x=S.length-2;x>=f;x--){const j=S[x],P=bo(x,j.props.routingOptions);if(P.length===0){w[x]=w[x+1]+1;continue}let y=0,E=vo(j);if(E===null)return S.length-1-f;for(let k=0;k<P.length&&E.length!==0;k++){const{comparator:I,target:L,value:C}=P[k],A=E.filter(O=>{const q=go({value:O},j.type,O),B=pr(O,j.type);return!(q&&I==="answered"||B&&I==="partial"||!q&&!B&&I==="skipped"||I==="given_up"&&_o(O)&&O.taskStatus==="given.up"||q&&j.type==="open"&&(I==="contains"||I==="notcontains")||q&&fo(I)&&wt[I](O,C))});if(A.length<E.length){const O=parseInt(String(L),10);if(O!==-1&&O<=x||O>=S.length)return S.length-1-f;y=Math.max(w[O]+1,y)}E=A}E.length>0&&(y=Math.max(w[x+1]+1,y)),w[x]=y}return w[f]})(t,o),m=u+1,g=m/(m+p),b=`${i}?utm_source=survey_branding&utm_medium=website&utm_campaign=${d}&utm_content=${a}${n&&"&utm_term=poweredby_pill"}`;Z(()=>{h.current&&(h.current.style.width=100*g+"%")},[g]);const v=t[o].type==="thanks";return l("footer",{className:"ul-footer "+(r["userleap-platform"]==="link"?"ul-footer__link":""),children:v&&n?l("a",{dir:"ltr",href:b,rel:"noreferrer",target:"_blank",children:l("div",{className:"thank-you-card-link",children:[l("div",{className:"sprig-box-logo",children:l(_n,{logoOnly:!0,style:{margin:"auto"}})}),l("div",{children:l("p",{children:["Capture insights about your own product",l(bn,{style:{display:"inline-flex",marginInlineStart:"4px",verticalAlign:"middle"}})]})})]})}):l(K,{children:[c.length>1&&l("div",{id:"ul-progress-bar-container",children:l("div",{id:"ul-progress-bar-current",ref:h,style:{border:`1px solid ${e||"#000"}`}})}),s?l("div",{className:n?"yellow-footer-logo":"",style:{marginTop:"4px",marginBottom:"4px"},children:l("a",{href:b,rel:"noreferrer",target:"_blank",children:l("div",{style:{display:"flex"},children:[l(_n,{logoOnly:!1}),n&&l(bn,{style:{display:"block",margin:"auto 0 auto 4px",transform:"rotateY(0deg) rotate(-45deg)"}})]})})}):null]})})},bn=({style:e})=>l("svg",{fill:"none",height:"10",style:e,viewBox:"0 0 12 10",width:"12",xmlns:"http://www.w3.org/2000/svg",children:[l("path",{d:"M1.47839 5.2085L10.9384 5.2085",stroke:"black",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.35"}),l("path",{d:"M7.0686 1.15845L10.9386 5.20845L7.0686 9.25845",stroke:"black",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.35"})]}),ai=()=>{const{answers:e,border:t,cards:n,close:r,configureExitOnOverlayClick:o,destroy:i,endCard:s,eventEmitFn:d,fontFamily:a,headers:u,index:h,minScrollableHeight:c,next:p,previewMode:m,productConfig:g,seen:b,showStripes:v,studyType:_,surveyId:f,update:T,useMobileStyling:S,viewDocument:w}=H(C=>({answers:C.answers,border:C.border,cards:C.cards,close:C.close,configureExitOnOverlayClick:C.configureExitOnOverlayClick,destroy:C.destroy,endCard:C.endCard,eventEmitFn:C.eventEmitFn,fontFamily:C.fontFamily,headers:C.headers,index:C.index,previewMode:C.previewMode,productConfig:C.productConfig,minScrollableHeight:C.minScrollableHeight,next:C.next,seen:C.seen,showStripes:C.showStripes,studyType:C.studyType,surveyId:C.surveyId,update:C.update,useMobileStyling:C.useMobileStyling,viewDocument:C.viewDocument})),x=ee(null),j=ee(!1),P=u["userleap-platform"],{props:y,type:E,name:k}=n[h];Z(()=>{if(window.Sprig)return window.Sprig.trackHistory=C=>H.getState().trackHistory(C),()=>{window.Sprig.trackHistory=void 0}},[]),Z(()=>{x.current&&(x.current.classList.contains("ul-app--visible")||x.current.classList.add("ul-app--visible"),!j.current&&d&&(j.current=!0,d(U.SprigEvent.SurveyAppeared,{name:U.SprigEvent.SurveyAppeared,"survey.id":f})))},[d,f]),Z(()=>{const C=()=>{w.visibilityState==="visible"&&(b(),w.removeEventListener("visibilitychange",C))};return w.addEventListener("visibilitychange",C),C(),()=>{w.removeEventListener("visibilitychange",C)}},[b,w]),Z(()=>{T()},[h,T]),Z(()=>{o(()=>r())},[r,o]);const I=async function(C){p({data:C,completeSurvey:()=>{i($.APP_ID)},endCard:s}),$.resetScrollPosition(w)};if(e){for(const C of e)if(C.questionId===k){let A;if(E==="multiplechoice"){const O=y.options.find(({value:q})=>q===C.value);if(!O)break;A={[O.id]:O.value}}else A=C.value;I({value:A,type:E,questionId:C.questionId});break}}const L=!S&&((g==null?void 0:g.framePosition)==="center"||(g==null?void 0:g.desktopDisplay)==="center-modal"||((g==null?void 0:g.placement)||"").includes("center"));return l("div",{className:M("ul-app",U.shouldDirectEmbed(u)?"ul-app--visible":"ul-app--overlay"),dir:"auto",id:$.APP_ID,onClick:C=>{var B;const A=window.sprigAPI,O=C.target;if(!A||!O)return;const q=[O,O.parentElement];for(const Y of q)if(((B=Y==null?void 0:Y.tagName)==null?void 0:B.toLowerCase())==="a"){C.preventDefault();try{const W=new URL(Y.href);W.protocol!=="http:"&&W.protocol!=="https:"||(A==null||A.openUrl(W.toString()))}catch(W){console.error(W)}return}},ref:x,style:{"--theme":t,...a?{fontFamily:a.replace(";","")}:{},...L?{position:"relative"}:{}},children:l("div",{className:"ul-app__container",children:l("div",{className:M(G("ul-card__container",S,_)),style:{..._!=="feedbackButton"||(g==null?void 0:g.desktopDisplay)==="center-modal"?{borderColor:t}:{},...(g==null?void 0:g.desktopDisplay)==="slider"?{margin:"0px"}:{}},children:l("div",{className:"sprig-container",style:{minHeight:c},children:[v&&l("div",{className:"ul-header__container",dir:"ltr",children:l("div",{className:"ul-header",children:"For development purposes only"})}),m&&l("div",{className:"ul-header__container",dir:"ltr",children:l("div",{className:"ul-header",children:"Preview Mode: Response will not be recorded."})}),l("div",{className:M(ko("ul-card-main-content",P)),children:(()=>{const C={className:"ul-card",next:I,questionId:k,type:E};switch(E){case"consentlegal":return z(jo,{...C,...y,key:k});case"likert":return z(To,{...C,...y,key:k});case"matrix":return z(Lo,{...C,...y,key:k});case"multiplechoice":return z(Oo,{...C,...y,key:k});case"multipleselect":return z(Uo,{...C,...y,key:k});case"nps":return z(Ho,{...C,key:k,props:y});case"open":return z(Ao,{...C,...y,key:k});case"recordedtask":return z(Go,{...C,...y,key:k});case"texturlprompt":return z(Yo,{...C,...y,key:k});case"thanks":return z(Qo,{...C,...y,key:k});case"uploading":return z(ii,{...C,...y,key:k});case"videovoice":return z(oi,{...C,...y,key:k});default:return null}})()}),l(si,{})]})})})})},Or=()=>MediaRecorder.isTypeSupported("video/webm")?"video/webm":"video/mp4",yn=e=>{const t={audioBitsPerSecond:128e3,videoBitsPerSecond:25e5,mimeType:Or()};return new MediaRecorder(e,t)},xn=(e,t,n)=>{n[t]=[],e.ondataavailable=function(r){n[t].push(r.data)},e.currentMediaRecordingUid=t,e.start()};function kn(e,t,n,r,o,i){if(e&&e.state!=="inactive"){const{"begin.callback":s}=r,d=e.currentMediaRecordingUid;if(!d)return;s&&s(d),e.onstop=()=>async function(a,u,h,c,p,m,g){const b=H.getState().viewDocument,{"upload.callback":v,"progress.callback":_}=c,f={mediaType:h,updatedAt:new Date().toISOString(),mediaRecordingUid:p,...c["passthrough.data"]},T=await(async(j,P)=>{var E;const y=await fetch(P,{method:"POST",cache:"no-cache",headers:{"Content-Type":"application/json"},body:JSON.stringify(j)});if(y.ok){const k=await y.json();return(E=k==null?void 0:k.upload)==null?void 0:E.url}return null})(f,a);if(!T)return void(v&&v(null,{message:"failed to get upload url"}));const S=new Blob(g,{type:Or()});if(!b.defaultView)return;const w=new b.defaultView.File([S],`recording video ${Date.now()}`),x=m.createUpload({endpoint:T,file:w,chunkSize:5120});x.on("error",j=>{v&&v(null,j)}),x.on("progress",j=>{_&&_(p,j)}),x.on("success",()=>{v&&v(p,!0)})}(t,0,n,r,d,o,i),e.stop()}}const li={state:{chunks:{}},stopRecording(e){const{uploadApiEndpoint:t,avRecorder:n,screenRecorder:r,UpChunk:o}=this.state,i=this.state.avStream&&this.state.avStream.getVideoTracks().length>0?"video":"audio";this.state.chunks&&t&&o&&(n!=null&&n.currentMediaRecordingUid&&kn(n,t,i,e,o,this.state.chunks[n==null?void 0:n.currentMediaRecordingUid]),r!=null&&r.currentMediaRecordingUid&&kn(r,t,"screen",e,o,this.state.chunks[r==null?void 0:r.currentMediaRecordingUid]))},handleCancelledStream(e){const t=e.getVideoTracks(),n=e.getAudioTracks();let r=t.length&&t[0];r=r||n.length&&n[0],r&&r.addEventListener("ended",()=>{[this.state.avRecorder,this.state.screenRecorder].map(o=>{o&&(o.state==="recording"&&o.stop(),o.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 n=>{this.avPermissionCallback(n)}),e.on("begin.recording",this.beginRecordingCallback.bind(this)),e.on("start.task",this.startTaskCallback.bind(this)),e.on("screen.permission",async n=>{this.screenPermissionCallback(n)}),e.on("finish.task",async n=>{this.finishTaskCallback(n)})},async avPermissionCallback(e){var r,o,i;const{"stream.ready":t,"permission.descriptors":n}=e;try{(r=this.state.avStream)!=null&&r.active&&(this.state.avStream.getTracks().map(s=>s.readyState==="live"&&s.stop()),((o=this.state.captureStream)==null?void 0:o.getAudioTracks().length)===1&&this.state.captureStream.removeTrack(this.state.captureStream.getAudioTracks()[0])),this.state.avStream=await navigator.mediaDevices.getUserMedia({video:n.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(s){return console.warn("Error: failed to get permissions: "+s),void(t&&t(null,null))}t&&t(this.state.avStream,this.state.captureStream)},async screenPermissionCallback(e){const{"screen.permission.requested":t,"stream.ready.callback":n}=e;t==null||t(!0);try{this.state.captureStream=await navigator.mediaDevices.getDisplayMedia({video:!0,cursor:"always",displaySurface:"browser",preferCurrentTab:!0})}catch(r){return t==null||t(!1),console.warn("Error: failed to get permissions: "+r),void(n&&n(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),n&&n(this.state.avStream||null,this.state.captureStream)},beginRecordingCallback(e){const{"recording.media.types":t,"start.recording.callback":n=()=>{}}=e;if(!t)return;const r=[];if(t.includes("video")&&this.state.avStream){this.state.avRecorder=yn(this.state.avStream);const o=U.v4();xn(this.state.avRecorder,o,this.state.chunks),r.push(o)}if(t.includes("screen")&&this.state.captureStream){this.state.screenRecorder=yn(this.state.captureStream);const o=U.v4();xn(this.state.screenRecorder,o,this.state.chunks),r.push(o)}r&&n&&n(r)},async finishTaskCallback(e){const{"current.index":t,"task.response":n,"task.complete.callback":r}=e;await this.stopRecording(e),r&&r(this.taskDurationMillisecond()),this.state.cards&&this.state.hasEndCard!==void 0&&this.lookAheadAndStopStream(t,n,this.state.cards,this.state.hasEndCard)},startTaskCallback(){this.state.startTime=new Date},permissionStatusCallback(e){var r;const{"permission.status.callback":t}=e,n=this.state.avStream;t&&t(n,!!n&&(n==null?void 0:n.getVideoTracks().length)>0,!!((r=this.state.captureStream)!=null&&r.active),this.state.captureStream)},lookAheadAndStopStream(e,t,n,r){const{avRecorder:o,screenRecorder:i}=this.state,{allResponses:s}=H.getState(),d=hr({cards:n,index:e,hasEndCard:r,allResponses:s});d!==null&&n[d].type==="recordedtask"||[o,i].map(a=>{a&&(a.state==="recording"&&a.stop(),a.stream.getTracks().map(u=>{u.readyState==="live"&&u.stop()}))})}},He=Object.create(li);Object.freeze(He);const di=({mode:e=null,viewWindow:t,viewDocument:n,trackPageViewUrl:r})=>{const o=n.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:o.clientWidth,ch:o.clientHeight,p:r??i,l:t.navigator.language}},ci={configure:function(e,t=!0){var _;const{answers:n,apiURL:r,endCard:o,eventEmitFn:i,fontFamilyURL:s,frame:d,previewKey:a,viewDocument:u,viewWindow:h}=e,c=U.shouldDirectEmbed(e.headers)?e.frame:u.body,p=e.UpChunk||window.UpChunk,m=U.eventEmitter,g=((f,T)=>{const S=[...f],w=new Set(["videovoice","recordedtask"]);return f.some(x=>w.has(x.type))&&S.push({name:-2,props:{routingOptions:[]},type:"uploading"}),T&&S.push({name:-1,props:{routingOptions:[]},type:"thanks"}),S})(e.cards,!!o);He.configure(m,{cards:g,hasEndCard:!!o,apiURL:r,UpChunk:p}),H.setState({apiURL:r,answers:n,border:e.border,index:e.startingQuestionIdx||0,cards:g,configureExitOnOverlayClick:e.configureExitOnOverlayClick,customMetadata:e.customMetadata,endCard:e.endCard,envId:e.envId,eventEmitFn:i,fontFamily:e.fontFamily,forceBrandedLogo:e.forceBrandedLogo,frame:d,headers:e.headers,hasViewedEmbed:!1,isPreview:e.isPreview,marketingUrl:"https://sprig.com",meta:di({mode:e.mode,viewWindow:h,viewDocument:u,trackPageViewUrl:e.trackPageViewUrl}),mode:e.mode,previewKey:a,previewMode:e.previewMode,productConfig:e.productConfig,recorder:He,recorderEventEmitter:m,responseGroupUid:e.responseGroupUid,showStripes:e.showStripes,showSurveyBrand:e.showSurveyBrand,slugName:e.slugName,styleNonce:e.styleNonce,studyType:e.studyType,surveyId:e.surveyId,tabTitle:e.tabTitle,uploadingCardViewed:!1,uploadProgress:{},useMobileStyling:e.useMobileStyling,useDesktopPrototype:e.useDesktopPrototype,userId:e.userId,viewDocument:e.viewDocument,visitorAttributes:e.visitorAttributes,viewedCardCount:e.startingQuestionIdx||0});const{head:b}=u;if($.setSurveyStyles({document:u,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;min-height:0;justify-content:center}.ul-card__container--desktop{border:2px solid #fff;box-shadow:0 0 15px #00000026;margin:15px}.ul-card__container--mobile{border-width:0;box-shadow:0 0 5px #00000040;margin-top:5px}.sprig-container{display:flex;flex-direction:column;width:100%;height:fit-content;flex:1 1 auto;min-height:0;justify-content:center}.ul-card__container{background:#fff;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:break-word;overflow:auto}.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}.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:#343442;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}.sprig-border-bottom{border-bottom:1px solid rgba(0,0,0,.1)}.sprig-border-top{border-top:1px solid rgba(0,0,0,.1)}.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:#343442;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:#6c6c6e;text-align:start;margin-top:4px}.ul-card__choices{margin:5px 0 0;flex:1 0}.choice--mobile{border:2px solid #e6e6e6}.choice--desktop{border:1px solid #e6e6e6}.choice{align-items:flex-start;color:#262136;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:#00000003}.choice--desktop:hover,.choice--desktop:active,.choice--mobile:active{background-color:#0000000d}.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:transparent;color:#343442;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:0;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:#6c6c6e80}.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 #b0b5b7;flex-shrink:0}.select-radio{height:16px;width:16px;border-radius:16px;border:1px solid #323232;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:#000000b3}[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:#343442;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:#efefee;display:flex;align-items:center;justify-content:center}.sprig-check{height:9px;width:9px;margin-left:-1px}.sprig-check path{stroke:#506067;stroke-width:1.5}.sprig-caret{height:20px;width:20px;transition-property:transform}.sprig-caret path{stroke:#000}.ul-consent-legal__name-input--mobile{border:2px solid #e6e6e6}.ul-consent-legal__name-input--desktop{border:1px solid #e6e6e6}.ul-consent-legal__name-input{background:#00000003;box-sizing:border-box;color:#343442;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:#6c6c6e80}.ul-consent-legal__name-input:focus{outline:none;background:#fff}.ul-consent-legal__name-input--desktop:hover:not(:focus){background-color:#0000000d}.ul-card__consent-legal .choice{font-size:15px;padding:10px 15px;background-color:#00000003}.ul-card__consent-legal .choice--desktop:hover,.ul-card__consent-legal .choice--desktop:active,.ul-card__consent-legal .choice--mobile:active{background-color:#0000000d}.ul-card--likert__numbers{align-items:center;border-radius:5px;display:flex;flex-direction:row;flex:1 0;justify-content:center;margin:5px 0 0}.ul-card--likert__numbers>button{padding:unset}.likert-number--mobile{border:2px solid #e6e6e6}.likert-number--mobile:not(:first-child){margin-inline-start:-2px}.likert-number--desktop{border:1px solid #e6e6e6}.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;background-color:#00000003;font-size:18px;line-height:24px;height:67px}.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,.likert-number--desktop:hover{background-color:#0000000d;font-weight:500}.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:transparent;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:transparent;line-height:24px;height:67px;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:#262136;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--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-matrix-row-options{display:grid;grid-column:2/-1;grid-template-columns:subgrid}.ul-matrix-column-label{font-size:15px;max-width:150px;padding:10px 12px;text-align:center}.ul-card--matrix_container{margin-bottom:16px;overflow:auto}.ul-card--matrix_question_container{display:flex;flex-direction:column}.ul-matrix-scroll-gradient{-webkit-mask-image:linear-gradient(90deg,#000 90%,transparent);mask-image:linear-gradient(90deg,#000 90%,transparent)}.ul-matrix-scroll-gradient:dir(rtl){-webkit-mask-image:linear-gradient(270deg,#000,90%,transparent);mask-image:linear-gradient(270deg,#000,90%,transparent)}.ul-matrix-scroll-gradient:dir(rtl)+.ul-matrix-scroll-arrow{rotate:180deg}.ul-matrix-scroll-arrow{align-self:flex-end;background:none;border:none;color:#000;padding:0;position:absolute;top:45%}.ul-matrix-scroll-arrow:hover{cursor:pointer}.ul-matrix-option-wrapper{align-items:center;background:#f9f9f8;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:#f9f9f8;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%}.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 #e6e6e6}.nps-number--mobile:not(:first-child){margin-inline-start:-2px}.nps-number--desktop{border:1px solid #e6e6e6}.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;background-color:#00000003;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:#0000000d;font-weight:500}.ul-card--nps__labels{align-items:center;color:#262136;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-text{margin-top:2px;margin-bottom:3px;align-items:center;display:flex;flex-direction:column;justify-content:center;padding:0}.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 #e6e6e6;max-height:63px}.ul-card-text__input--desktop{border:1px solid #e6e6e6;max-height:150px}.ul-card-text__input{background:#00000003;box-sizing:border-box;color:#343442;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:#6c6c6e80}.ul-card-text__input:focus{outline:none;background:#fff}.ul-card-text__input--desktop:hover:not(:focus){background-color:#0000000d}.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:#0000000d;text-align:center;flex-direction:column;margin-left:auto;margin-right:auto;border-radius:5px;display:flex;align-items:center;font-size:15px;color:#000000b3}.ul-av-permission-denied-paragraph{margin:auto 15px;font-size:12px}.ul-av-permission-denied-headline{font-size:14px;color:#262136;text-decoration:underline;font-size:12px}.ul-permission-body{color:#000;margin:5px auto 5px 5px;line-height:135%;text-align:center}.ul-select-tab-container{width:240px;height:46px;background:#fff;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:#4b575d;margin:5px;line-height:135%;text-align:center}button.ul-task-skip-button{color:#000;background-color:#fff}#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:#4c4c4c}#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);border-radius:3px;border:none;color:#fff;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:#0000001a;color:#0003}.ul-card-text__button.ul-button-inactive{background-color:#fff!important;color:#5d696f!important}.ul-card-skip__button{color:#00000080;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 #0b2330;box-shadow:0 0 0 2px #c8cccc;cursor:pointer;display:flex;font-size:15px;justify-content:space-between;margin-bottom:8px;padding:4px 8px 4px 16px;width:100%}.select-button:hover{background-color:#f3f3f3}.select-button:active{background-color:#eee}.select-button span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select-button.select-button-placeholder{color:#b0b5b7}.select-button svg{flex-shrink:0}.select-list{position:relative;height:fit-content;padding:4px 0;z-index:100;background-color:#fff;border:1px solid #E2E3E1;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:#f3f3f3}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}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:repeating-linear-gradient(120deg,#ebebeb,#ebebeb 24px,#fff 24px,#fff 48px);border-bottom:2px solid #ebebeb;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}.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:#00000003;border:1px solid #e6e6e6;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:#00000008}.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:#f9c600;border-radius:5px;display:flex;padding:4px}.close-container{display:flex;justify-content:flex-end;width:100%;height:0}.close-btn{cursor:pointer;height:16px;margin-inline-end:-10px;position:relative;top:-10px;width:16px;z-index:1;align-self:flex-start;justify-self:end;flex-shrink:0}.ul-app__container{transition:opacity .3s ease-out}.ul-center-horizontally{text-align:center}#ul-progress-bar-container{width:100%;height:2px;background-color:#0000001a;border-radius:2px;max-width:250px;margin:16px 0}#ul-progress-bar-current{transition:width 1s ease;width:0%;height:0;border-radius:2px}.prototype-button{align-self:stretch;background:#00000003;border:1.5px solid #e6e6e6;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}'}),e.customStyles&&$.setSurveyStyles({document:u,elementId:"ul-custom-style",styleString:e.customStyles,nonce:e.styleNonce}),e.fontFamily&&s&&parent){const f=u.createElement("link");f.rel="stylesheet",f.href=s,b.appendChild(f)}if(!p&&e.cards.some(f=>f.type==="recordedtask")){const f=u.createElement("script");f.src=e.upchunkLibraryURL??"https://cdn.sprig.com/userleap-web-upchunk-v2.2.2.js",f.onload=()=>{He.setUpChunk(h.UpChunk)},f.onerror=()=>{console.warn("[Sprig] - recording functionality not configured due to UpChunk library load failure")},b.appendChild(f)}const v=i||((_=d.eventEmitter)==null?void 0:_.emit);v==null||v("verify.view.version",{"view.version":"2.33.3"}),c&&t&&(Ce(l(ai,{}),c),U.eventEmitter.once(U.SprigEvent.SurveyClosed,()=>{xt(c)}))}};exports.default=ci;
|