UNPKG

@sprig-technologies/sprig-browser

Version:

npm package for the sprig web sdk

12 lines 161 kB
"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&&gt(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=>` .${Oe} { border-color: ${e}; } .${Oe} .select-radio, .${Oe}.select-radio { border: 6px solid ${e}; box-shadow: none; } .${br} { border-color: ${$.ERROR_BORDER_COLOR}; } `,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"},tab