@sprig-technologies/sprig-bundled 1.1.2 → 1.1.4
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/index-Ce9gtwb7.js +37 -0
- package/dist/index-ZlfwE4U0.cjs +37 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +174 -239
- package/dist/index.js +1 -7
- package/dist/view-BLX4LEzJ.js +28 -0
- package/dist/view-DqFVd4zL.cjs +28 -0
- package/package.json +3 -2
- package/dist/index-2R2XP7B7.js +0 -8891
- package/dist/view-MqQxb9ia.js +0 -3977
package/dist/index.js
CHANGED
|
@@ -1,7 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
export {
|
|
3
|
-
i as DismissReason,
|
|
4
|
-
r as SprigAPI,
|
|
5
|
-
p as SprigEvent,
|
|
6
|
-
e as sprig
|
|
7
|
-
};
|
|
1
|
+
import{D as s,g as a,S as i,h as r}from"./index-Ce9gtwb7.js";export{s as DismissReason,a as SprigAPI,i as SprigEvent,r as sprig};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import{i as Oe,C as st,D as ct,A as ne,e as ye,s as xe,S as K,a as qe,c as rn,b as nn,u as on,E as an,d as pe,f as Ue,r as ln,v as ut,o as sn}from"./index-Ce9gtwb7.js";var me,k,dt,Y,pt,mt,He,_t,_e={},ht=[],cn=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ke=Array.isArray;function W(e,t){for(var r in t)e[r]=t[r];return e}function ft(e){var t=e.parentNode;t&&t.removeChild(e)}function L(e,t,r){var n,o,i,a={};for(i in t)i=="key"?n=t[i]:i=="ref"?o=t[i]:a[i]=t[i];if(arguments.length>2&&(a.children=arguments.length>3?me.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)a[i]===void 0&&(a[i]=e.defaultProps[i]);return he(e,a,n,o,null)}function he(e,t,r,n,o){var i={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:o??++dt,__i:-1,__u:0};return o==null&&k.vnode!=null&&k.vnode(i),i}function gt(){return{current:null}}function D(e){return e.children}function j(e,t){this.props=e,this.context=t}function oe(e,t){if(t==null)return e.__?oe(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?oe(e):null}function vt(e){var t,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return vt(e)}}function De(e){(!e.__d&&(e.__d=!0)&&Y.push(e)&&!we.__r++||pt!==k.debounceRendering)&&((pt=k.debounceRendering)||mt)(we)}function we(){var e,t,r,n,o,i,a,s,u;for(Y.sort(He);e=Y.shift();)e.__d&&(t=Y.length,n=void 0,i=(o=(r=e).__v).__e,s=[],u=[],(a=r.__P)&&((n=W({},o)).__v=o.__v+1,k.vnode&&k.vnode(n),Ae(a,n,o,r.__n,a.ownerSVGElement!==void 0,32&o.__u?[i]:null,s,i??oe(o),!!(32&o.__u),u),n.__.__k[n.__i]=n,Ct(s,n,u),n.__e!=i&&vt(n)),Y.length>t&&Y.sort(He));we.__r=0}function bt(e,t,r,n,o,i,a,s,u,d,p){var l,m,_,h,f,v=n&&n.__k||ht,b=t.length;for(r.__d=u,un(r,t,v),u=r.__d,l=0;l<b;l++)(_=r.__k[l])!=null&&typeof _!="boolean"&&typeof _!="function"&&(m=_.__i===-1?_e:v[_.__i]||_e,_.__i=l,Ae(e,_,m,o,i,a,s,u,d,p),h=_.__e,_.ref&&m.ref!=_.ref&&(m.ref&&Ve(m.ref,null,_),p.push(_.ref,_.__c||h,_)),f==null&&h!=null&&(f=h),65536&_.__u||m.__k===_.__k?u=yt(_,u,e):typeof _.type=="function"&&_.__d!==void 0?u=_.__d:h&&(u=h.nextSibling),_.__d=void 0,_.__u&=-196609);r.__d=u,r.__e=f}function un(e,t,r){var n,o,i,a,s,u=t.length,d=r.length,p=d,l=0;for(e.__k=[],n=0;n<u;n++)(o=e.__k[n]=(o=t[n])==null||typeof o=="boolean"||typeof o=="function"?null:typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?he(null,o,null,null,o):ke(o)?he(D,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?he(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)!=null?(o.__=e,o.__b=e.__b+1,s=dn(o,r,a=n+l,p),o.__i=s,i=null,s!==-1&&(p--,(i=r[s])&&(i.__u|=131072)),i==null||i.__v===null?(s==-1&&l--,typeof o.type!="function"&&(o.__u|=65536)):s!==a&&(s===a+1?l++:s>a?p>u-a?l+=s-a:l--:l=s<a&&s==a-1?s-a:0,s!==n+l&&(o.__u|=65536))):(i=r[n])&&i.key==null&&i.__e&&(i.__e==e.__d&&(e.__d=oe(i)),je(i,i,!1),r[n]=null,p--);if(p)for(n=0;n<d;n++)(i=r[n])!=null&&!(131072&i.__u)&&(i.__e==e.__d&&(e.__d=oe(i)),je(i,i))}function yt(e,t,r){var n,o;if(typeof e.type=="function"){for(n=e.__k,o=0;n&&o<n.length;o++)n[o]&&(n[o].__=e,t=yt(n[o],t,r));return t}return e.__e!=t&&(r.insertBefore(e.__e,t||null),t=e.__e),t&&t.nextSibling}function Z(e,t){return t=t||[],e==null||typeof e=="boolean"||(ke(e)?e.some(function(r){Z(r,t)}):t.push(e)),t}function dn(e,t,r,n){var o=e.key,i=e.type,a=r-1,s=r+1,u=t[r];if(u===null||u&&o==u.key&&i===u.type)return r;if(n>(u!=null&&!(131072&u.__u)?1:0))for(;a>=0||s<t.length;){if(a>=0){if((u=t[a])&&!(131072&u.__u)&&o==u.key&&i===u.type)return a;a--}if(s<t.length){if((u=t[s])&&!(131072&u.__u)&&o==u.key&&i===u.type)return s;s++}}return-1}function xt(e,t,r){t[0]==="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||cn.test(t)?r:r+"px"}function Ce(e,t,r,n,o){var i;e:if(t==="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||xt(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||xt(e.style,t,r[t])}else if(t[0]==="o"&&t[1]==="n")i=t!==(t=t.replace(/(PointerCapture)$|Capture$/,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=r,r?n?r.u=n.u:(r.u=Date.now(),e.addEventListener(t,i?wt:kt,i)):e.removeEventListener(t,i?wt:kt,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]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,r))}}function kt(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(k.event?k.event(e):e)}function wt(e){return this.l[e.type+!0](k.event?k.event(e):e)}function Ae(e,t,r,n,o,i,a,s,u,d){var p,l,m,_,h,f,v,b,x,y,E,T,w,P,C,g=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(u=!!(32&r.__u),i=[s=t.__e=r.__e]),(p=k.__b)&&p(t);e:if(typeof g=="function")try{if(b=t.props,x=(p=g.contextType)&&n[p.__c],y=p?x?x.props.value:p.__:n,r.__c?v=(l=t.__c=r.__c).__=l.__E:("prototype"in g&&g.prototype.render?t.__c=l=new g(b,y):(t.__c=l=new j(b,y),l.constructor=g,l.render=mn),x&&x.sub(l),l.props=b,l.state||(l.state={}),l.context=y,l.__n=n,m=l.__d=!0,l.__h=[],l._sb=[]),l.__s==null&&(l.__s=l.state),g.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=W({},l.__s)),W(l.__s,g.getDerivedStateFromProps(b,l.__s))),_=l.props,h=l.state,l.__v=t,m)g.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(g.getDerivedStateFromProps==null&&b!==_&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(b,y),!l.__e&&(l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(b,l.__s,y)===!1||t.__v===r.__v)){for(t.__v!==r.__v&&(l.props=b,l.state=l.__s,l.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.forEach(function(S){S&&(S.__=t)}),E=0;E<l._sb.length;E++)l.__h.push(l._sb[E]);l._sb=[],l.__h.length&&a.push(l);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(b,l.__s,y),l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(_,h,f)})}if(l.context=y,l.props=b,l.__P=e,l.__e=!1,T=k.__r,w=0,"prototype"in g&&g.prototype.render){for(l.state=l.__s,l.__d=!1,T&&T(t),p=l.render(l.props,l.state,l.context),P=0;P<l._sb.length;P++)l.__h.push(l._sb[P]);l._sb=[]}else do l.__d=!1,T&&T(t),p=l.render(l.props,l.state,l.context),l.state=l.__s;while(l.__d&&++w<25);l.state=l.__s,l.getChildContext!=null&&(n=W(W({},n),l.getChildContext())),m||l.getSnapshotBeforeUpdate==null||(f=l.getSnapshotBeforeUpdate(_,h)),bt(e,ke(C=p!=null&&p.type===D&&p.key==null?p.props.children:p)?C:[C],t,r,n,o,i,a,s,u,d),l.base=t.__e,t.__u&=-161,l.__h.length&&a.push(l),v&&(l.__E=l.__=null)}catch(S){t.__v=null,u||i!=null?(t.__e=s,t.__u|=u?160:32,i[i.indexOf(s)]=null):(t.__e=r.__e,t.__k=r.__k),k.__e(S,t,r)}else i==null&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=pn(r.__e,t,r,n,o,i,a,u,d);(p=k.diffed)&&p(t)}function Ct(e,t,r){t.__d=void 0;for(var n=0;n<r.length;n++)Ve(r[n],r[++n],r[++n]);k.__c&&k.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(i){i.call(o)})}catch(i){k.__e(i,o.__v)}})}function pn(e,t,r,n,o,i,a,s,u){var d,p,l,m,_,h,f,v=r.props,b=t.props,x=t.type;if(x==="svg"&&(o=!0),i!=null){for(d=0;d<i.length;d++)if((_=i[d])&&"setAttribute"in _==!!x&&(x?_.localName===x:_.nodeType===3)){e=_,i[d]=null;break}}if(e==null){if(x===null)return document.createTextNode(b);e=o?document.createElementNS("http://www.w3.org/2000/svg",x):document.createElement(x,b.is&&b),i=null,s=!1}if(x===null)v===b||s&&e.data===b||(e.data=b);else{if(i=i&&me.call(e.childNodes),v=r.props||_e,!s&&i!=null)for(v={},d=0;d<e.attributes.length;d++)v[(_=e.attributes[d]).name]=_.value;for(d in v)_=v[d],d=="children"||(d=="dangerouslySetInnerHTML"?l=_:d==="key"||d in b||Ce(e,d,null,_,o));for(d in b)_=b[d],d=="children"?m=_:d=="dangerouslySetInnerHTML"?p=_:d=="value"?h=_:d=="checked"?f=_:d==="key"||s&&typeof _!="function"||v[d]===_||Ce(e,d,_,v[d],o);if(p)s||l&&(p.__html===l.__html||p.__html===e.innerHTML)||(e.innerHTML=p.__html),t.__k=[];else if(l&&(e.innerHTML=""),bt(e,ke(m)?m:[m],t,r,n,o&&x!=="foreignObject",i,a,i?i[0]:r.__k&&oe(r,0),s,u),i!=null)for(d=i.length;d--;)i[d]!=null&&ft(i[d]);s||(d="value",h!==void 0&&(h!==e[d]||x==="progress"&&!h||x==="option"&&h!==v[d])&&Ce(e,d,h,v[d],!1),d="checked",f!==void 0&&f!==e[d]&&Ce(e,d,f,v[d],!1))}return e}function Ve(e,t,r){try{typeof e=="function"?e(t):e.current=t}catch(n){k.__e(n,r)}}function je(e,t,r){var n,o;if(k.unmount&&k.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||Ve(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(i){k.__e(i,t)}n.base=n.__P=null,e.__c=void 0}if(n=e.__k)for(o=0;o<n.length;o++)n[o]&&je(n[o],t,r||typeof e.type!="function");r||e.__e==null||ft(e.__e),e.__=e.__e=e.__d=void 0}function mn(e,t,r){return this.constructor(e,r)}function ie(e,t,r){var n,o,i,a;k.__&&k.__(e,t),o=(n=typeof r=="function")?null:r&&r.__k||t.__k,i=[],a=[],Ae(t,e=(!n&&r||t).__k=L(D,null,[e]),o||_e,_e,t.ownerSVGElement!==void 0,!n&&r?[r]:o?null:t.firstChild?me.call(t.childNodes):null,i,!n&&r?r:o?o.__e:t.firstChild,n,a),Ct(i,e,a)}function St(e,t){ie(e,t,St)}function _n(e,t,r){var n,o,i,a,s=W({},e.props);for(i in e.type&&e.type.defaultProps&&(a=e.type.defaultProps),t)i=="key"?n=t[i]:i=="ref"?o=t[i]:s[i]=t[i]===void 0&&a!==void 0?a[i]:t[i];return arguments.length>2&&(s.children=arguments.length>3?me.call(arguments,2):r),he(e.type,s,n||e.key,o||e.ref,null)}function Tt(e,t){var r={__c:t="__cC"+_t++,__:e,Consumer:function(n,o){return n.children(o)},Provider:function(n){var o,i;return this.getChildContext||(o=[],(i={})[t]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(a){this.props.value!==a.value&&o.some(function(s){s.__e=!0,De(s)})},this.sub=function(a){o.push(a);var s=a.componentWillUnmount;a.componentWillUnmount=function(){o.splice(o.indexOf(a),1),s&&s.call(a)}}),n.children}};return r.Provider.__=r.Consumer.contextType=r}me=ht.slice,k={__e:function(e,t,r,n){for(var o,i,a;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&i.getDerivedStateFromError!=null&&(o.setState(i.getDerivedStateFromError(e)),a=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,n||{}),a=o.__d),a)return o.__E=o}catch(s){e=s}throw e}},dt=0,j.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=W({},this.state),typeof e=="function"&&(e=e(W({},r),this.props)),e&&W(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),De(this))},j.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),De(this))},j.prototype.render=D,Y=[],mt=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,He=function(e,t){return e.__v.__b-t.__v.__b},we.__r=0,_t=0;var G,R,Be,Nt,ae=0,Pt=[],Se=[],It=k.__b,Et=k.__r,Rt=k.diffed,Mt=k.__c,Lt=k.unmount;function X(e,t){k.__h&&k.__h(R,e,ae||t),ae=0;var r=R.__H||(R.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:Se}),r.__[e]}function H(e){return ae=1,$e(Dt,e)}function $e(e,t,r){var n=X(G++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):Dt(void 0,t),function(s){var u=n.__N?n.__N[0]:n.__[0],d=n.t(u,s);u!==d&&(n.__N=[d,n.__[1]],n.__c.setState({}))}],n.__c=R,!R.u)){var o=function(s,u,d){if(!n.__c.__H)return!0;var p=n.__c.__H.__.filter(function(m){return m.__c});if(p.every(function(m){return!m.__N}))return!i||i.call(this,s,u,d);var l=!1;return p.forEach(function(m){if(m.__N){var _=m.__[0];m.__=m.__N,m.__N=void 0,_!==m.__[0]&&(l=!0)}}),!(!l&&n.__c.props===s)&&(!i||i.call(this,s,u,d))};R.u=!0;var i=R.shouldComponentUpdate,a=R.componentWillUpdate;R.componentWillUpdate=function(s,u,d){if(this.__e){var p=i;i=void 0,o(s,u,d),i=p}a&&a.call(this,s,u,d)},R.shouldComponentUpdate=o}return n.__N||n.__}function A(e,t){var r=X(G++,3);!k.__s&&Ze(r.__H,t)&&(r.__=e,r.i=t,R.__H.__h.push(r))}function fe(e,t){var r=X(G++,4);!k.__s&&Ze(r.__H,t)&&(r.__=e,r.i=t,R.__h.push(r))}function $(e){return ae=5,ge(function(){return{current:e}},[])}function Ot(e,t,r){ae=6,fe(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},r==null?r:r.concat(e))}function ge(e,t){var r=X(G++,7);return Ze(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function ze(e,t){return ae=8,ge(function(){return e},t)}function qt(e){var t=R.context[e.__c],r=X(G++,9);return r.c=e,t?(r.__==null&&(r.__=!0,t.sub(R)),t.props.value):e.__}function Fe(e,t){k.useDebugValue&&k.useDebugValue(t?t(e):e)}function hn(e){var t=X(G++,10),r=H();return t.__=e,R.componentDidCatch||(R.componentDidCatch=function(n,o){t.__&&t.__(n,o),r[1](n)}),[r[0],function(){r[1](void 0)}]}function Ut(){var e=X(G++,11);if(!e.__){for(var t=R.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var r=t.__m||(t.__m=[0,0]);e.__="P"+r[0]+"-"+r[1]++}return e.__}function fn(){for(var e;e=Pt.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Te),e.__H.__h.forEach(We),e.__H.__h=[]}catch(t){e.__H.__h=[],k.__e(t,e.__v)}}k.__b=function(e){R=null,It&&It(e)},k.__r=function(e){Et&&Et(e),G=0;var t=(R=e.__c).__H;t&&(Be===R?(t.__h=[],R.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.__V=Se,r.__N=r.i=void 0})):(t.__h.forEach(Te),t.__h.forEach(We),t.__h=[],G=0)),Be=R},k.diffed=function(e){Rt&&Rt(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Pt.push(t)!==1&&Nt===k.requestAnimationFrame||((Nt=k.requestAnimationFrame)||gn)(fn)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.__V!==Se&&(r.__=r.__V),r.i=void 0,r.__V=Se})),Be=R=null},k.__c=function(e,t){t.some(function(r){try{r.__h.forEach(Te),r.__h=r.__h.filter(function(n){return!n.__||We(n)})}catch(n){t.some(function(o){o.__h&&(o.__h=[])}),t=[],k.__e(n,r.__v)}}),Mt&&Mt(e,t)},k.unmount=function(e){Lt&&Lt(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{Te(n)}catch(o){t=o}}),r.__H=void 0,t&&k.__e(t,r.__v))};var Ht=typeof requestAnimationFrame=="function";function gn(e){var t,r=function(){clearTimeout(n),Ht&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);Ht&&(t=requestAnimationFrame(r))}function Te(e){var t=R,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),R=t}function We(e){var t=R;e.__c=e.__(),R=t}function Ze(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function Dt(e,t){return typeof t=="function"?t(e):t}function At(e,t){for(var r in t)e[r]=t[r];return e}function Ge(e,t){for(var r in e)if(r!=="__source"&&!(r in t))return!0;for(var n in t)if(n!=="__source"&&e[n]!==t[n])return!0;return!1}function Ne(e){this.props=e}function Vt(e,t){function r(o){var i=this.props.ref,a=i==o.ref;return!a&&i&&(i.call?i(null):i.current=null),t?!t(this.props,o)||!a:Ge(this.props,o)}function n(o){return this.shouldComponentUpdate=r,L(e,o)}return n.displayName="Memo("+(e.displayName||e.name)+")",n.prototype.isReactComponent=!0,n.__f=!0,n}(Ne.prototype=new j).isPureReactComponent=!0,Ne.prototype.shouldComponentUpdate=function(e,t){return Ge(this.props,e)||Ge(this.state,t)};var jt=k.__b;k.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),jt&&jt(e)};var vn=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function Bt(e){function t(r){var n=At({},r);return delete n.ref,e(n,r.ref||null)}return t.$$typeof=vn,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var $t=function(e,t){return e==null?null:Z(Z(e).map(t))},zt={map:$t,forEach:$t,count:function(e){return e?Z(e).length:0},only:function(e){var t=Z(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:Z},bn=k.__e;k.__e=function(e,t,r,n){if(e.then){for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return t.__e==null&&(t.__e=r.__e,t.__k=r.__k),o.__c(e,t)}bn(e,t,r,n)};var Ft=k.unmount;function Wt(e,t,r){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(n){typeof n.__c=="function"&&n.__c()}),e.__c.__H=null),(e=At({},e)).__c!=null&&(e.__c.__P===r&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(n){return Wt(n,t,r)})),e}function Zt(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(n){return Zt(n,t,r)}),e.__c&&e.__c.__P===t&&(e.__e&&r.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=r)),e}function ve(){this.__u=0,this.t=null,this.__b=null}function Gt(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Kt(e){var t,r,n;function o(i){if(t||(t=e()).then(function(a){r=a.default||a},function(a){n=a}),n)throw n;if(!r)throw t;return L(r,i)}return o.displayName="Lazy",o.__f=!0,o}function le(){this.u=null,this.o=null}k.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Ft&&Ft(e)},(ve.prototype=new j).__c=function(e,t){var r=t.__c,n=this;n.t==null&&(n.t=[]),n.t.push(r);var o=Gt(n.__v),i=!1,a=function(){i||(i=!0,r.__R=null,o?o(s):s())};r.__R=a;var s=function(){if(!--n.__u){if(n.state.__a){var u=n.state.__a;n.__v.__k[0]=Zt(u,u.__c.__P,u.__c.__O)}var d;for(n.setState({__a:n.__b=null});d=n.t.pop();)d.forceUpdate()}};n.__u++||32&t.__u||n.setState({__a:n.__b=n.__v.__k[0]}),e.then(a,a)},ve.prototype.componentWillUnmount=function(){this.t=[]},ve.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=Wt(this.__b,r,n.__O=n.__P)}this.__b=null}var o=t.__a&&L(D,null,e.fallback);return o&&(o.__u&=-33),[L(D,null,t.__a?null:e.children),o]};var Qt=function(e,t,r){if(++r[1]===r[0]&&e.o.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.o.size))for(r=e.u;r;){for(;r.length>3;)r.pop()();if(r[1]<r[0])break;e.u=r=r[2]}};function yn(e){return this.getChildContext=function(){return e.context},e.children}function xn(e){var t=this,r=e.i;t.componentWillUnmount=function(){ie(null,t.l),t.l=null,t.i=null},t.i&&t.i!==r&&t.componentWillUnmount(),t.l||(t.i=r,t.l={nodeType:1,parentNode:r,childNodes:[],appendChild:function(n){this.childNodes.push(n),t.i.appendChild(n)},insertBefore:function(n,o){this.childNodes.push(n),t.i.appendChild(n)},removeChild:function(n){this.childNodes.splice(this.childNodes.indexOf(n)>>>1,1),t.i.removeChild(n)}}),ie(L(yn,{context:t.context},e.__v),t.l)}function Jt(e,t){var r=L(xn,{__v:e,i:t});return r.containerInfo=t,r}(le.prototype=new j).__a=function(e){var t=this,r=Gt(t.__v),n=t.o.get(e);return n[0]++,function(o){var i=function(){t.props.revealOrder?(n.push(o),Qt(t,e,n)):o()};r?r(i):i()}},le.prototype.render=function(e){this.u=null,this.o=new Map;var t=Z(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var r=t.length;r--;)this.o.set(t[r],this.u=[1,0,this.u]);return e.children},le.prototype.componentDidUpdate=le.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,r){Qt(e,r,t)})};var Yt=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,kn=/^(?: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]/,wn=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Cn=/[A-Z0-9]/g,Sn=typeof document<"u",Tn=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function Xt(e,t,r){return t.__k==null&&(t.textContent=""),ie(e,t),typeof r=="function"&&r(),e?e.__c:null}function er(e,t,r){return St(e,t),typeof r=="function"&&r(),e?e.__c:null}j.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(j.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var tr=k.event;function Nn(){}function Pn(){return this.cancelBubble}function In(){return this.defaultPrevented}k.event=function(e){return tr&&(e=tr(e)),e.persist=Nn,e.isPropagationStopped=Pn,e.isDefaultPrevented=In,e.nativeEvent=e};var Ke,En={enumerable:!1,configurable:!0,get:function(){return this.class}},rr=k.vnode;k.vnode=function(e){typeof e.type=="string"&&function(t){var r=t.props,n=t.type,o={};for(var i in r){var a=r[i];if(!(i==="value"&&"defaultValue"in r&&a==null||Sn&&i==="children"&&n==="noscript"||i==="class"||i==="className")){var s=i.toLowerCase();i==="defaultValue"&&"value"in r&&r.value==null?i="value":i==="download"&&a===!0?a="":s==="ondoubleclick"?i="ondblclick":s!=="onchange"||n!=="input"&&n!=="textarea"||Tn(r.type)?s==="onfocus"?i="onfocusin":s==="onblur"?i="onfocusout":wn.test(i)?i=s:n.indexOf("-")===-1&&kn.test(i)?i=i.replace(Cn,"-$&").toLowerCase():a===null&&(a=void 0):s=i="oninput",s==="oninput"&&o[i=s]&&(i="oninputCapture"),o[i]=a}}n=="select"&&o.multiple&&Array.isArray(o.value)&&(o.value=Z(r.children).forEach(function(u){u.props.selected=o.value.indexOf(u.props.value)!=-1})),n=="select"&&o.defaultValue!=null&&(o.value=Z(r.children).forEach(function(u){u.props.selected=o.multiple?o.defaultValue.indexOf(u.props.value)!=-1:o.defaultValue==u.props.value})),r.class&&!r.className?(o.class=r.class,Object.defineProperty(o,"className",En)):(r.className&&!r.class||r.class&&r.className)&&(o.class=o.className=r.className),t.props=o}(e),e.$$typeof=Yt,rr&&rr(e)};var nr=k.__r;k.__r=function(e){nr&&nr(e),Ke=e.__c};var or=k.diffed;k.diffed=function(e){or&&or(e);var t=e.props,r=e.__e;r!=null&&e.type==="textarea"&&"value"in t&&t.value!==r.value&&(r.value=t.value==null?"":t.value),Ke=null};var ir={ReactCurrentDispatcher:{current:{readContext:function(e){return Ke.__n[e.__c].props.value}}}},Rn="17.0.2";function ar(e){return L.bind(null,e)}function be(e){return!!e&&e.$$typeof===Yt}function lr(e){return be(e)&&e.type===D}function sr(e){return be(e)?_n.apply(null,arguments):e}function cr(e){return!!e.__k&&(ie(null,e),!0)}function ur(e){return e&&(e.base||e.nodeType===1&&e)||null}var dr=function(e,t){return e(t)},pr=function(e,t){return e(t)},mr=D;function Qe(e){e()}function _r(e){return e}function hr(){return[!1,Qe]}var fr=fe,gr=be;function vr(e,t){var r=t(),n=H({h:{__:r,v:t}}),o=n[0].h,i=n[1];return fe(function(){o.__=r,o.v=t,Je(o)&&i({h:o})},[e,r,t]),A(function(){return Je(o)&&i({h:o}),e(function(){Je(o)&&i({h:o})})},[e]),r}function Je(e){var t,r,n=e.v,o=e.__;try{var i=n();return!((t=o)===(r=i)&&(t!==0||1/t==1/r)||t!=t&&r!=r)}catch{return!0}}var Mn={useState:H,useId:Ut,useReducer:$e,useEffect:A,useLayoutEffect:fe,useInsertionEffect:fr,useTransition:hr,useDeferredValue:_r,useSyncExternalStore:vr,startTransition:Qe,useRef:$,useImperativeHandle:Ot,useMemo:ge,useCallback:ze,useContext:qt,useDebugValue:Fe,version:"17.0.2",Children:zt,render:Xt,hydrate:er,unmountComponentAtNode:cr,createPortal:Jt,createElement:L,createContext:Tt,createFactory:ar,cloneElement:sr,createRef:gt,Fragment:D,isValidElement:be,isElement:gr,isFragment:lr,findDOMNode:ur,Component:j,PureComponent:Ne,memo:Vt,forwardRef:Bt,flushSync:pr,unstable_batchedUpdates:dr,StrictMode:mr,Suspense:ve,SuspenseList:le,lazy:Kt,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:ir};const Ln=Object.freeze(Object.defineProperty({__proto__:null,Children:zt,Component:j,Fragment:D,PureComponent:Ne,StrictMode:mr,Suspense:ve,SuspenseList:le,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:ir,cloneElement:sr,createContext:Tt,createElement:L,createFactory:ar,createPortal:Jt,createRef:gt,default:Mn,findDOMNode:ur,flushSync:pr,forwardRef:Bt,hydrate:er,isElement:gr,isFragment:lr,isValidElement:be,lazy:Kt,memo:Vt,render:Xt,startTransition:Qe,unmountComponentAtNode:cr,unstable_batchedUpdates:dr,useCallback:ze,useContext:qt,useDebugValue:Fe,useDeferredValue:_r,useEffect:A,useErrorBoundary:hn,useId:Ut,useImperativeHandle:Ot,useInsertionEffect:fr,useLayoutEffect:fe,useMemo:ge,useReducer:$e,useRef:$,useState:H,useSyncExternalStore:vr,useTransition:hr,version:Rn},Symbol.toStringTag,{value:"Module"})),br=e=>{let t;const r=new Set,n=(a,s)=>{const u=typeof a=="function"?a(t):a;if(!Object.is(u,t)){const d=t;t=s??typeof u!="object"?u:Object.assign({},t,u),r.forEach(p=>p(t,d))}},o=()=>t,i={setState:n,getState:o,subscribe:a=>(r.add(a),()=>r.delete(a)),destroy:()=>r.clear()};return t=e(n,o,i),i},On=e=>e?br(e):br;function qn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Un(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}),r}var yr={exports:{}},xr={};const kr=Un(Ln);var wr={exports:{}},Cr={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* use-sync-external-store-shim.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var se=kr;function Hn(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Dn=typeof Object.is=="function"?Object.is:Hn,An=se.useState,Vn=se.useEffect,jn=se.useLayoutEffect,Bn=se.useDebugValue;function $n(e,t){var r=t(),n=An({inst:{value:r,getSnapshot:t}}),o=n[0].inst,i=n[1];return jn(function(){o.value=r,o.getSnapshot=t,Ye(o)&&i({inst:o})},[e,r,t]),Vn(function(){return Ye(o)&&i({inst:o}),e(function(){Ye(o)&&i({inst:o})})},[e]),Bn(r),r}function Ye(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Dn(e,r)}catch{return!0}}function zn(e,t){return t()}var Fn=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?zn:$n;Cr.useSyncExternalStore=se.useSyncExternalStore!==void 0?se.useSyncExternalStore:Fn,wr.exports=Cr;var Wn=wr.exports;/**
|
|
10
|
+
* @license React
|
|
11
|
+
* use-sync-external-store-shim/with-selector.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Pe=kr,Zn=Wn;function Gn(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Kn=typeof Object.is=="function"?Object.is:Gn,Qn=Zn.useSyncExternalStore,Jn=Pe.useRef,Yn=Pe.useEffect,Xn=Pe.useMemo,eo=Pe.useDebugValue;xr.useSyncExternalStoreWithSelector=function(e,t,r,n,o){var i=Jn(null);if(i.current===null){var a={hasValue:!1,value:null};i.current=a}else a=i.current;i=Xn(function(){function u(_){if(!d){if(d=!0,p=_,_=n(_),o!==void 0&&a.hasValue){var h=a.value;if(o(h,_))return l=h}return l=_}if(h=l,Kn(p,_))return h;var f=n(_);return o!==void 0&&o(h,f)?h:(p=_,l=f)}var d=!1,p,l,m=r===void 0?null:r;return[function(){return u(t())},m===null?void 0:function(){return u(m())}]},[t,r,n,o]);var s=Qn(e,i[0],i[1]);return Yn(function(){a.hasValue=!0,a.value=s},[s]),eo(s),s},yr.exports=xr;var to=yr.exports;const ro=qn(to),{useSyncExternalStoreWithSelector:no}=ro;function oo(e,t=e.getState,r){const n=no(e.subscribe,e.getState,e.getServerState||e.getState,t,r);return Fe(n),n}const Sr=e=>{const t=typeof e=="function"?On(e):e,r=(n,o)=>oo(t,n,o);return Object.assign(r,t),r},Tr=e=>e?Sr(e):Sr,Nr={And:1,Or:2},Pr=1,Xe={eq(e,t){return e==t},neq(e,t){return!this.eq(e,t)},gt(e,t){return e>t},gte(e,t){return e>=t},lt(e,t){return e<t},lte(e,t){return e<=t},list_exact(e,t){return!Array.isArray(e)||!Array.isArray(t)?!1:e.slice().sort().join(",")===t.slice().sort().join(",")},list_all(e,t){return!Array.isArray(e)||!Array.isArray(t)?!1:!t.some(r=>e.indexOf(r)===-1)},list_alo(e,t){if(!Array.isArray(t))return!1;const r=Array.isArray(e)?e:[e],n=new Set(r);return t.some(o=>n.has(o))},list_dni(e,t){if(!Array.isArray(t))return!1;const r=Array.isArray(e)?e:[e],n=new Set(r);return t.every(o=>!n.has(o))},contains(e,t){const r=e.toLowerCase(),n=t.toLowerCase();return r.includes(n)},notcontains(e,t){return!this.contains(e,t)}},io=(e,t,r)=>{switch(t){case"videovoice":return!!(e&&e.value);case"open":return!!r;case"multipleselect":return!!(r&&Object.keys(r).length);case"recordedtask":return r?.taskStatus==="completed";case"texturlprompt":return!e.value;case"consentlegal":return r!==null;case"multiplechoice":return r!==void 0;case"matrix":return!!(r&&Object.values(r).every(n=>n!==null));case"nps":return r!==null;case"likert":return r!==null;default:return!0}},Ir=(e,t)=>{if(t==="matrix"){const r=Object.keys(e).length,n=Object.values(e).filter(o=>o!==null).length;return n>0&&n<r}return!1},Er=({cards:e,index:t,hasEndCard:r,allResponses:n,uploadProgress:o={}})=>{if(t>=e.length||t<0)return null;const i=e[t];let a=t+1;const s=i.props.routingOptions||[];for(let p=0;p<s.length;p++){const{group:l,target:m}=s[p];if(!(l!=null&&l.length))continue;const _=l[0];if(_.questionIndex===void 0||_.questionIndex>n.length)continue;let h=Rr({comparator:_.comparator,response:n[_.questionIndex],type:i.type,value:_.value});for(let f=1;f<l.length;f+=2){const v=l[f],b=l[f+1],x=Rr({comparator:b.comparator,response:n[b.questionIndex],type:e[b.questionIndex].type,value:b.value});v===Nr.And?h&&(h=x):v===Nr.Or&&(h||(h=x))}if(h){a=m===-1&&r?e.length-1:m;break}}const u=e.findIndex(p=>p.type==="uploading");let d;return u>0?d=r?e.length-3:e.length-2:d=e.length-1,t>=d||a===-1||a!==null&&a>d?u>0&&Object.values(o).some(p=>p.isSubmitted&&!p.isComplete)?u:r?e.length-1:null:a===-1?null:a},Rr=({comparator:e,response:t,type:r,value:n})=>{if(e==="answered")switch(r){case"texturlprompt":return t===void 0;case"consentlegal":return t&&t.submitted===!0;case"recordedtask":return"taskStatus"in t&&t.taskStatus==="completed";case"likert":return Number.isInteger(t);case"matrix":return Object.values(t).every(o=>o!==null);case"multiplechoice":case"multipleselect":return Object.keys(t).length>0;case"nps":return Number.isInteger(t);case"open":return t&&t.length>0;case"videovoice":return!!(t!=null&&t.mediaRecordingUid);default:return!1}if(e==="given_up")return r==="recordedtask"?"taskStatus"in t&&t.taskStatus==="given.up":!0;if(e==="partial")return r==="matrix"?Ir(t,r):!1;if(e==="skipped")switch(r){case"texturlprompt":return t?.skipped;case"consentlegal":return t===null;case"recordedtask":return"taskStatus"in t&&t.taskStatus==="abandoned";case"likert":return t===null;case"open":return t?.length===0;case"multiplechoice":return t===void 0;case"multipleselect":return t?.length===0;case"matrix":return Object.values(t).every(o=>o===null);case"nps":return t===null;case"videovoice":return t===null;default:return!1}return Xe[e](t,n)},ao=13,lo=(e,t)=>e.reduce((r,n)=>r.concat(r.map(o=>[...o,n])),[[]]).filter(r=>t||r.length>0),so=e=>{var t,r,n;switch(e.type){case"multipleselect":return!e||!e.props||!e.props.options?null:e.props.options.length>ao?e.props.options.map(o=>[o.value]):lo(e.props.options.map(o=>o.value),!e.props.properties.required);case"multiplechoice":{if(!e||!e.props||!e.props.options)return null;const o=e.props.options.map(i=>i.value);return e.props.properties.required||o.push(void 0),o}case"matrix":{if(!((t=e?.props)!=null&&t.options))return null;const o=e.props.properties.matrixColumn,i=e.props.options,a=i.reduce((p,l)=>(p[l.id]=null,p),{}),s={...a,[i[0].id]:o[0].value},u=i.reduce((p,l)=>(p[l.id]=o[0].value,p),{}),d=[s,u];return e.props.properties.required||d.push(a),d}case"likert":{const o=Number((n=(r=e.props)==null?void 0:r.properties)==null?void 0:n.range)||5;return[...Array.from(Array(o).keys()).map(i=>i+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 o=[{taskStatus:"completed"},{taskStatus:"given.up"}];return e.props.properties.required||o.push({taskStatus:"abandoned"}),o}case"texturlprompt":return[void 0,...e.props.properties.required?[]:[{skipped:!0}]];case"consentlegal":return[Pr,...e.props.properties.required?[]:[null]];default:return[Pr]}},co=e=>e in Xe,uo=e=>typeof e=="object"&&e!==null&&"taskStatus"in e,po=(e,t=[])=>t.reduce((r,n)=>{const{group:o,target:i}=n;if(!(o!=null&&o.length))return[...r];const a=o.filter(s=>Number(s)?!0:typeof s=="object"?s.questionIndex===e:!1).map(s=>{const{comparator:u,value:d}=s;return{comparator:u,target:i,value:d}});return[...r,...a]},[]),mo=(e,t)=>{const r=new Set(["thanks","uploading"]);if(t>=e.length||t<0||r.has(e[t].type))return 0;const n=e.filter(i=>!r.has(i.type));if(t===n.length-1)return 1;const o={[n.length-1]:1,[-1]:0};for(let i=n.length-2;i>=t;i--){const a=n[i],s=po(i,a.props.routingOptions);if(s.length===0){o[i]=o[i+1]+1;continue}let u=0,d=so(a);if(d===null)return n.length-1-t;for(let p=0;p<s.length&&d.length!==0;p++){const{comparator:l,target:m,value:_}=s[p],h=d.filter(f=>{const v=io({value:f},a.type,f),b=Ir(f,a.type);return!(v&&l==="answered"||b&&l==="partial"||!v&&!b&&l==="skipped"||l==="given_up"&&uo(f)&&f.taskStatus==="given.up"||v&&a.type==="open"&&(l==="contains"||l==="notcontains")||v&&co(l)&&Xe[l](f,_))});if(h.length<d.length){const f=parseInt(String(m),10);if(f!==-1&&f<=i||f>=n.length)return n.length-1-t;u=Math.max(o[f]+1,u)}d=h}d.length>0&&(u=Math.max(o[i+1]+1,u)),o[i]=u}return o[t]},et=new Set(["thanks","uploading"]),_o=e=>!et.has(e.type),M=Tr()((e,t)=>({allResponses:[],answers:void 0,apiURL:"",border:"#000000",cards:[],close:async(r=ne)=>{const n=t(),{fadeout:o,remove:i,trackHistory:a,studyType:s}=n;await o(r),tt(n)||a({event:"closed"}),Oe(`Closing survey: ${n.surveyId}`),st.enable(),i({initiator:ct.Closed,studyType:s})},configureExitOnOverlayClick:()=>{},customMetadata:{},destroy:async r=>{const{eventEmitFn:n,fadeout:o,remove:i,studyType:a,surveyId:s}=t();n("survey.complete",s),await o(r),st.enable(),i({initiator:ct.Complete,studyType:a})},endCard:{headline:""},envId:"",eventEmitFn:ye.emit.bind(ye),fadeout:async r=>{const{eventEmitFn:n,headers:o,viewDocument:i}=t();return xe(o)?Promise.resolve():(n(K.SurveyFadingOut),new Promise(a=>{const s=i.getElementById(r);s?(s.addEventListener("transitionend",()=>{a()}),s.classList.remove("ul-app--visible")):a()}))},forceBrandedLogo:!1,frame:document.createElement("iframe"),handleClickEmbedButton:r=>{const{cards:n,eventEmitFn:o,index:i}=t();o(r,{qid:n[i].name,props:n[i].props}),e(()=>({hasViewedEmbed:!0}))},handleUploadUpdate:({mediaRecordingUid:r,isComplete:n,progressPct:o,isSubmitted:i})=>{var a,s,u;const{cards:d,destroy:p,index:l,uploadProgress:m}=t(),_=n||((a=m[r])==null?void 0:a.isComplete),h={...m,[r]:{progressPct:_?100:o||((s=m[r])==null?void 0:s.progressPct),isComplete:_,isSubmitted:i||((u=m[r])==null?void 0:u.isSubmitted)}};if(e({uploadProgress:h}),d[l].type!=="uploading")return;const f=Object.entries(m).every(([v,b])=>!b.isSubmitted||b.isComplete||r==v&&n);if(f&&l>=d.length-1)return p(ne);e({index:f?l+1:l,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:r=>{const{allResponses:n,cards:o,eventEmitFn:i,index:a,responseGroupUid:s,submit:u,trackHistory:d,uploadProgress:p,viewedCardCount:l}=t(),m=Date.now(),_=[...o],h=_[a],{type:f}=r.data,v={...r.data},b=v.value;_o(h)&&(h.value=b),v.answeredAt=m,delete v.type;const x={response:v,responseGroupUid:s,questionIndex:a};let y=f==="multiplechoice"?Object.values(b).find(C=>C!==!1):b;f==="multipleselect"&&(y=_[a].props.options.reduce((C,g)=>(b[g.id]&&C.push(g.value),C),[]));const E=n.slice(0);E[a]=y,e({allResponses:E});const T=Er({cards:_,index:a,hasEndCard:!!r.endCard,uploadProgress:p,allResponses:E});if(T===null){x.completedAt=m,u(x),r.completeSurvey();return}else et.has(_[T].type)&&(x.completedAt=m);const w=u(x);et.has(_[T].type)||w.finally(()=>{d({event:"seen",index:T})});const P=_[T];_[T]&&i&&i("survey.question",{qid:P.name,props:P.props}),e({cards:_,hasViewedEmbed:!1,index:T,viewedCardCount:l+1})},pendingRemoveIframeReason:null,previewKey:null,recorder:()=>{},recorderEventEmitter:ye,resolveTrackedPromise:()=>{const{removeIframeIfReady:r}=t();e(n=>({unresolvedRequestCount:n.unresolvedRequestCount-1})),r()},responseGroupUid:"",remove:({initiator:r,studyType:n})=>{const{removeIframeIfReady:o}=t();e({pendingRemoveIframeReason:r,studyType:n}),o()},removeIframeIfReady:()=>{const{eventEmitFn:r,pendingRemoveIframeReason:n,unresolvedRequestCount:o,studyType:i}=t();n&&o===0&&(r(K.SurveyWillClose,{name:K.SurveyWillClose,initiator:n,studyType:i}),e({pendingRemoveIframeReason:null,studyType:i}))},seen:async()=>{const{trackHistory:r}=t();return r({event:"seen",isNew:!0})},slugName:null,showStripes:!1,showSurveyBrand:!1,styleNonce:"",submit:async({completedAt:r,questionIndex:n,response:o,responseGroupUid:i})=>{const a=t();if(!i||tt(a))return;const s={responseGroupUid:i,meta:a.meta,customMetadata:a.customMetadata,responses:[o],completedAt:r,previewKey:a.previewKey};Oe(`Submitting response: ${JSON.stringify(o.value,null,2)} for survey: ${a.surveyId}`),r&&Oe("Survey complete");const u=await a.trackPromise(qe(`${a.apiURL}/sdk/1/environments/${a.envId}/visitors/${a.userId}/responses/submit`,{body:JSON.stringify(s),headers:a.headers,method:"POST"}));if(!u.ok){u.reportError&&(console.warn("[Sprig] (ERR-427) Failed to submit response",u.error),await a.trackPromise(Mr(a,"submitResponse",u.error)));return}a.eventEmitFn(K.QuestionAnswered,{...o,questionIndex:n})},surveyId:0,tabTitle:"",trackHistory:async({event:r,index:n,isNew:o=!1})=>{const i=t();if(tt(i))return;const{cards:a,index:s}=i,u=n!==void 0?a[n]:a[s],d={sid:i.surveyId,qid:u.name,action:r,vid:i.userId,eid:i.envId,isNew:o,responseGroupUid:i.responseGroupUid,previewKey:i.previewKey},p=await i.trackPromise(qe(`${i.apiURL}/sdk/1/visitors/${i.userId}/surveys/${i.surveyId}/history`,{body:JSON.stringify(d),headers:i.headers,method:"POST"}));!p.ok&&p.reportError&&(console.warn("[Sprig] (ERR-428) Failed to track survey event",p.error),await i.trackPromise(Mr(i,"trackHistory",p.error)))},trackPromise:async r=>{const{resolveTrackedPromise:n}=t();return e(o=>({unresolvedRequestCount:o.unresolvedRequestCount+1})),r.then(o=>(n(),o)).catch(o=>{throw n(),o})},unresolvedRequestCount:0,update:()=>{const{cards:r,index:n,headers:o,eventEmitFn:i,frame:a,useMobileStyling:s,viewDocument:u}=t(),d=r[n].type==="matrix";setTimeout(()=>{var p,l;const[m,_]=rn(u);xe(o)?i(K.SurveyHeight,{name:K.SurveyHeight,contentFrameHeight:m}):((p=a.setHeight)==null||p.call(a,m),s||(l=a.setWidth)==null||l.call(a,d?_:parseInt(nn)))},100)},uploadingCardViewed:!1,uploadProgress:{},useDesktopPrototype:void 0,useMobileStyling:!1,userId:"",viewDocument:window.document,viewedCardCount:0})),tt=e=>!e.userId||e.meta&&e.meta.mode==="test"||e.isPreview,Mr=async(e,t,r)=>{const{mode:n,userId:o,envId:i,apiURL:a,headers:s,viewDocument:u}=e,d=u.documentElement,p={mode:n,screenWidth:window.screen.width,screenHeight:window.screen.height,clientWidth:d.clientWidth,clientHeight:d.clientHeight,location:window.location.href,language:window.navigator.language},l={action:t,err:{message:r?.message,stack:r?.stack},meta:p,vid:o,envId:i},m=await qe(`${a}/sdk/1/errors`,{method:"POST",headers:Object.assign({"x-ul-error":window.btoa(`userleap-${Date.now()}-error`)},s),body:JSON.stringify(l)});if(!m.ok)console.warn("[Sprig] (ERR-444) Failed to report error to API",r);else{const{presignedUrl:_}=m.json;on(_)}},I=(...e)=>e.filter(Boolean).join(" "),U=(e,t,r)=>{const n=t?"--mobile":"--desktop",o=r?`${n}_${r}`:"";return`${e+n} ${e+o} ${e}`},ho=(e,t)=>`${e} ${e}__${t}`;var fo=0;function c(e,t,r,n,o,i){var a,s,u={};for(s in t)s=="ref"?a=t[s]:u[s]=t[s];var d={type:e,props:u,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--fo,__i:-1,__u:0,__source:o,__self:i};if(typeof e=="function"&&(a=e.defaultProps))for(s in a)u[s]===void 0&&(u[s]=a[s]);return k.vnode&&k.vnode(d),d}const V=e=>c("button",{...e,className:I("ul-card-text__button",e.className),id:"ul-card-text__button"}),Lr=({plainText:e,richText:t,id:r,className:n,isHeader:o})=>t?c("div",{className:n,dangerouslySetInnerHTML:{__html:t},id:r}):e?o?c("h1",{className:n,id:r,children:e}):c("p",{className:n,id:r,children:e}):null,z=({message:e,properties:t})=>{const r=t?.captionText;return c("div",{className:"question-header-container",children:[c(Lr,{className:"ul-question",id:"ul-question",isHeader:!0,plainText:e,richText:t?.questionHtml}),c(Lr,{className:"ul-caption",id:"ul-caption",plainText:r,richText:t?.captionHtml})]})},Or=({buttonText:e="View Prototype",handleClick:t})=>c("button",{className:"prototype-button",onClick:t,children:e},"prototype-btn"),Q=({defaultBody:e,embeddedType:t="prototype",properties:r})=>{var n;const{handleClickEmbedButton:o,hasViewedEmbed:i,headers:a,useDesktopPrototype:s}=M(m=>({handleClickEmbedButton:m.handleClickEmbedButton,hasViewedEmbed:m.hasViewedEmbed,headers:m.headers,useDesktopPrototype:m.useDesktopPrototype})),u=r?.conceptUrl||((n=r?.consentDocument)==null?void 0:n.url),d=window.innerWidth<an,p=a["userleap-platform"],l=(m,_)=>{m.preventDefault(),o(_)};if(!s&&d&&!i&&u&&["email","link"].includes(p)){if(t==="prototype")return c(Or,{handleClick:m=>{l(m,"question.prototype.click")}});if(t==="pdf")return c(Or,{buttonText:r?.viewDocumentText||"View Document",handleClick:m=>{l(m,"question.agreement.click")}})}return e()},go=e=>L("svg",{fill:"none",height:10,viewBox:"0 0 10 10",width:10,xmlns:"http://www.w3.org/2000/svg",...e},L("path",{d:"M9.15377 1.30774L4.07685 8.23082L1.30762 5.00005",stroke:"white",strokeLinecap:"round",strokeWidth:2})),qr=({isSelected:e,id:t,divId:r,themeColor:n})=>c("div",{"aria-checked":e,"aria-labelledby":`label-${t}`,className:"select-checkbox",id:r,role:"checkbox",style:e?{backgroundColor:n,borderColor:n,boxShadow:"none"}:{},tabIndex:0,children:e&&c(go,{})}),Ur=(e,t)=>{const r=$(0),n=()=>{if(e.current){const o=e.current;o.style.height="1px";const i=o.scrollHeight,a=o.offsetHeight-o.clientHeight,s=i+a,u=parseInt(window.getComputedStyle(o).getPropertyValue("max-height")),d=s<=u?s:u;r.current!==d&&t(),r.current=d,o.style.height=`${d}px`}};return A(n,[]),n},rt=({ariaLabel:e,border:t,choiceStyle:r={},label:n,isSelected:o,value:i,text:a,id:s,isRadio:u,useMobileStyling:d,error:p,allowTextEntry:l,noneOfTheAbove:m,promptText:_,onUserInputChanged:h})=>{const{styleNonce:f,viewDocument:v}=M(q=>({styleNonce:q.styleNonce,viewDocument:q.viewDocument})),[b,x]=H(!1);yo(v,t,f);const y=({isSelected:q,userText:ue})=>{h&&h({id:s,selected:q,value:i,userText:ue,noneOfTheAbove:m})},E=q=>{q.stopPropagation(),y({isSelected:u||!o,userText:a}),x(!1)},T=()=>{b||x(!0)},w=()=>{b&&x(!1)},P=q=>{(q.key==="Enter"||q.key===" ")&&E(q)},C={onClick:q=>E(q),onKeyPress:q=>P(q)};"ontouchstart"in v.documentElement?(C.onTouchStart=w,C.onTouchCancel=w,C.onTouchEnd=w):(C.onMouseDown=T,C.onMouseLeave=w);const g=u?`radio-${s}`:`checkbox-${s}`,S=o||b?[Ie]:[],O=[...p?[Dr]:[],...S],B=n?{"aria-labelledby":`label-${s}`}:{"aria-label":e};return c("div",{className:I(U("choice",d),...O),id:`choice-div-${s}`,style:{...r,...p?{borderColor:pe}:{}},...C,children:[c("div",{className:I("choice-label-container"),children:[u?c("div",{...B,className:I("select-radio",...S),id:g,role:"radio",tabIndex:0}):c(qr,{divId:g,id:s,isSelected:o,themeColor:t}),n&&c("label",{className:I(U("select-label",d)),htmlFor:g,id:`label-${s}`,children:n})]}),l&&o&&c("div",{className:I("choice-text-entry-container",...S),children:c(vo,{onTextChange:q=>y({isSelected:o,userText:q}),promptText:_||"Please specify",textValue:a,useMobileStyling:d})})]})},vo=({promptText:e,textValue:t,onTextChange:r,useMobileStyling:n})=>{const o=$(null),{update:i}=M(s=>({update:s.update})),a=Ur(o,()=>i());return A(()=>{o.current&&o.current.focus()},[]),c("textarea",{"aria-label":e,"aria-multiline":"true","aria-placeholder":e,className:I(U("choice-text-input",n)),"data-gramm":"false",maxLength:5e3,name:"text",onChange:s=>{a(),s.stopPropagation(),r(s.currentTarget.value)},onClick:s=>{s.stopPropagation()},onKeyPress:s=>{s.stopPropagation()},placeholder:e,ref:o,role:"textbox",rows:1,value:t})},Hr="ul-select-style-element",Ie="ul-select-active-dynamic-style",Dr="ul-select-error-dynamic-style",bo=e=>e.tagName.toLowerCase()==="style",yo=(e,t,r)=>{let n=e.getElementById(Hr),o=!1;n||(n=e.createElement("style"),o=!0),bo(n)&&(n.id=Hr,r&&(n.nonce=r),n.textContent=xo(t),o&&e.head.appendChild(n))},xo=e=>`
|
|
18
|
+
.${Ie} {
|
|
19
|
+
border-color: ${e};
|
|
20
|
+
}
|
|
21
|
+
.${Ie} .select-radio, .${Ie}.select-radio {
|
|
22
|
+
border: 6px solid ${e};
|
|
23
|
+
box-shadow: none;
|
|
24
|
+
}
|
|
25
|
+
.${Dr} {
|
|
26
|
+
border-color: ${pe};
|
|
27
|
+
}
|
|
28
|
+
`,ce=e=>e?.buttonText||"Next",Ar=e=>e?.skipButtonText||"Skip",ko=({className:e,message:t,next:r,properties:n,questionId:o,type:i})=>{const{useMobileStyling:a,border:s}=M(g=>({useMobileStyling:g.useMobileStyling,border:g.border})),[u,d]=H(!1),[p,l]=H(""),[m,_]=H(!1),h=n?.collectName,f=n?.nameLabelText||"Full Name",v=n?.consentText||"I agree to the stated conditions",b=n?.submitButtonText||"Submit",x=!!p.trim(),y=u&&(!h||x),E=(g,S=!1)=>{g.preventDefault(),g.stopPropagation();let O=null;if(!S){if(!y){_(!0);return}O={submitted:!0},h&&(O.name=p)}r({value:O,questionId:o,type:i})},T=g=>{g.preventDefault(),g.stopPropagation(),l(g.currentTarget.value)},w=g=>{g.currentTarget.style.borderColor=m&&!x?pe:s},P=g=>{g.currentTarget.style.borderColor=m&&!x?pe:Ue},C=()=>c("div",{children:[c(rt,{allowTextEntry:!1,border:s,error:m&&!u,id:"consent",isRadio:!1,isSelected:u,label:v,onUserInputChanged:({selected:g})=>{g!==u&&d(!u)},useMobileStyling:a}),h&&c("input",{"aria-label":f,"aria-placeholder":f,className:I(U("ul-consent-legal__name-input",a)),"data-gramm":"false",maxLength:250,name:"name",onBlur:P,onFocus:w,onInput:T,placeholder:f,style:m&&!x?{borderColor:pe}:{},tabIndex:0,value:p}),c("div",{className:"ul-card__button-wrapper ul-card-vertical__button-wrapper",children:[c(V,{className:y?"":"sprig-button-disabled",onClick:E,children:b}),n.required===!1&&c("button",{className:"ul-card-skip__button",onClick:g=>E(g,!0),children:Ar(n)})]})]});return c("div",{className:I(e,"ul-card__consent-legal","fade-in-transition"),children:[c(z,{message:t}),c("div",{className:"ul-rich-text-body",dangerouslySetInnerHTML:n!=null&&n.richTextBody?{__html:n.richTextBody}:void 0,id:"ul-card__consent-legal-body-container"}),c(Q,{properties:n,defaultBody:C,embeddedType:"pdf"})]},o)},wo=({activeValue:e,border:t,icon:r,isPressed:n,onSubmit:o,range:i,scaleLabelType:a,setActiveValue:s,setIsPressed:u,useMobileStyling:d,value:p})=>{const l=`option-${p}`,m=a==="number",_=a==="star",h=m&&p===e,[f,v]=p<=e&&_||p===e?n?[t,1]:[t,.3]:["",1],b=()=>{switch(a){case"star":return I(U("likert-star",d),U(`likert-star-${p}`,d));case"smiley":return I(U("likert-smiley",d),U(`likert-smiley-${p}`,d));default:return p===i?I(U("likert-number",d),U(`likert-number-${p}`,d),U("likert-last-option",d)):I(U("likert-number",d),U(`likert-number-${p}`,d))}},x=()=>{s(-1),u(!1)};return c("div",{"aria-label":m?void 0:String(p),className:b(),dangerouslySetInnerHTML:{__html:r},id:l,onClick:()=>o(),onPointerDown:()=>u(!0),onPointerEnter:()=>s(p),onPointerLeave:x,role:"radio",style:{color:m?"":f,borderColor:h?f:"",fillOpacity:h?"":v,zIndex:h?3:"auto"},tabIndex:0})},Co=({className:e,labels:t,message:r,next:n,properties:o,questionId:i,type:a})=>{const{border:s,useMobileStyling:u}=M(C=>({border:C.border,useMobileStyling:C.useMobileStyling})),[d,p]=H(-1),[l,m]=H(!1),_=t&&t.left,h=t&&t.right;let f;const{range:v,scaleLabelType:b,ratingIcons:x}=o;v&&(f=Number(v));const y=f||5,E=C=>{var g,S;switch(b){case"star":return(g=x[0])==null?void 0:g.svg;case"smiley":return(S=x[C])==null?void 0:S.svg;default:return String(C+1)}},T=[...Array(y)].map((C,g)=>{const S=g+1;return c(wo,{activeValue:d,border:s,icon:E(g),isPressed:l,onSubmit:()=>n({value:S,questionId:i,type:a}),range:y,scaleLabelType:b,setActiveValue:p,setIsPressed:m,useMobileStyling:u,value:S},g)}),w=C=>{C.preventDefault(),C.stopPropagation(),n({value:null,questionId:i,type:a})},P=()=>c(D,{children:[c("div",{"aria-label":`Rating (1 - ${y})`,className:"ul-card--likert__numbers",role:"radiogroup",children:T}),c("div",{className:"ul-card--likert__labels",children:[c("span",{children:_}),c("span",{children:h})]}),!o.required&&c("div",{className:"ul-vertical-centered-container",children:c(V,{onClick:w,children:ce(o)})})]});return c("form",{className:I(e,"ul-card--likert","fade-in-transition"),children:[c(z,{message:r,properties:o}),c(Q,{properties:o,defaultBody:P})]},i)},So=({className:e,message:t,next:r,options:n,properties:o,questionId:i,type:a})=>{const{border:s,useMobileStyling:u}=M(g=>({border:g.border,useMobileStyling:g.useMobileStyling})),d=o.matrixColumn,p=n.length,l=d.length,m=o.required,_=$(null),[h,f]=H(!1),v=()=>{const g=_.current;g&&f(g.clientWidth+Math.abs(g.scrollLeft)<g.scrollWidth)};A(()=>{let g;if(_.current){g=_.current;const S=new ResizeObserver(O=>{f(Math.round(O[0].contentRect.width)<g.scrollWidth)});return S.observe(g),()=>{g&&S.unobserve(g)}}},[]);const b=g=>{g.preventDefault(),g.stopPropagation(),r({value:y,questionId:i,type:a})},x=n.reduce((g,S)=>(g[S.id]=null,g),{}),[y,E]=H(x),T=(g,S)=>{E(O=>({...O,[g]:S}))},w=m&&Object.values(y).every(g=>g==null),P=n.map(g=>c(D,{children:[c("div",{"aria-label":g.label,className:"ul-matrix-row-label",children:g.label},g.label),c("div",{className:"ul-matrix-row-options",role:"radiogroup",children:d.map((S,O)=>{const B=O===l-1;return c("div",{className:I("ul-matrix-option-wrapper",B&&"ul-matrix-last-option"),children:c(rt,{allowTextEntry:!1,ariaLabel:`${g.label}-${S.label}`,border:s,choiceStyle:{background:"transparent",border:"none",marginBottom:"0",padding:"0"},error:!1,id:`${g.id}-${S.value}`,isRadio:!0,isSelected:y[g.id]===S.value,onUserInputChanged:()=>T(g.id,S.value),useMobileStyling:u})},S.value)})})]})),C=()=>c("div",{className:"ul-card--matrix_question_container",children:[c("div",{className:I("ul-card--matrix_container",h&&"ul-matrix-scroll-gradient"),onScroll:()=>{v()},ref:_,children:c("div",{className:"ul-card--matrix_grid",style:`--numColumns: ${l}; --numRows: ${p+1}`,children:[c("div",{})," ",d.map(g=>c("div",{className:"ul-matrix-column-label",children:g.label},g.label)),P]})}),h&&c("button",{className:"ul-matrix-scroll-arrow",onClick:g=>{g.preventDefault();const S=_.current;if(S){const O=getComputedStyle(S).direction==="rtl";S.scrollLeft=O?S.clientWidth-S.scrollWidth:S.scrollWidth}},children:c("svg",{fill:"currentColor",height:"32",viewBox:"0 0 256 256",width:"32",xmlns:"http://www.w3.org/2000/svg",children:c("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"})})}),c("div",{className:"ul-card__button-wrapper",children:c(V,{disabled:w,children:ce(o)})})]});return c("form",{className:I(e,"fade-in-transition","ul-card__matrix"),id:"text-form",onSubmit:b,children:[c(z,{message:t,properties:o}),c(Q,{properties:o,defaultBody:C})]},i)},To=e=>L("svg",{fill:"none",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",...e},L("path",{d:"M17 10L12 15L7 10",stroke:"#0B2330",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5})),No=({options:e,selectItem:t,selectedOptions:r,showCheckbox:n})=>{const[o,i]=H("0px"),a=$(!1),{themeColor:s,doc:u}=M(l=>({doc:l.viewDocument,themeColor:l.border})),d=ze(l=>{if(a.current)return;const m=u.documentElement.clientHeight,_=30,h=l?.getBoundingClientRect().height??0,f=m-_;let v=h;const b=l?.getBoundingClientRect().bottom??0;b>f&&(v-=b-f),i(`-${v}px`),a.current=!0},[u.documentElement.clientHeight]),p=l=>`checkbox-div-${l}`;return c("div",{className:"select-list",ref:d,style:{marginBottom:o},children:e.map(l=>c("div",{className:"select-option",onClick:m=>{t(l),m.stopPropagation()},role:"option",children:[n&&c(qr,{divId:p(l.id),id:l.id,isSelected:r.includes(l),themeColor:s}),l.label]},l.id))})},Po=({isMultiSelect:e=!1,multiselectText:t="choices selected",onChange:r,options:n,placeholderText:o,value:i})=>{const[a,s]=H(!1),{viewDocument:u,update:d}=M(h=>({viewDocument:h.viewDocument,update:h.update})),p=()=>i.length===0?o:i.length===1?i[0].label:`${i.length} ${t}`,l=()=>{s(!a),d()};A(()=>{var h;const f=()=>{s(!1),d()};return u.addEventListener("click",f),(h=window.parent)==null||h.addEventListener("click",f),()=>{var v;(v=window.parent)==null||v.removeEventListener("click",f),u.removeEventListener("click",f)}},[u,d]);const m=h=>{var f;const v=i.some(x=>x.id===h.id),b=i.some(x=>{var y;return(y=x.optionProperties)==null?void 0:y.noneOfTheAbove});(f=h.optionProperties)!=null&&f.noneOfTheAbove&&!v?r([h]):e?r(v?i.filter(x=>x.id!==h.id):b?[h]:[...i,h]):v||r([h]),e||l()},_=i.length===0?["select-button-placeholder"]:[];return c(D,{children:[c("button",{"aria-label":"choice dropdown button",className:I("select-button",..._),onClick:h=>{h.stopPropagation(),l()},type:"button",children:[c("span",{children:p()}),c(To,{})]}),a&&c(No,{options:n,selectedOptions:i,selectItem:m,showCheckbox:e})]})},Vr=({className:e,message:t,onSubmit:r,options:n=[],properties:o,questionId:i,type:a})=>{const{border:s,useMobileStyling:u}=M(w=>({border:w.border,useMobileStyling:w.useMobileStyling})),d=n.reduce((w,P)=>(w[P.id]={isSelected:!1},w),{}),[p,l]=H(d),m=a==="multiplechoice",_=o.required,h=n.find(w=>{var P;return(P=w.optionProperties)==null?void 0:P.noneOfTheAbove}),f=Object.entries(p).some(([w,P])=>{var C;const g=n.find(O=>`${O.id}`===w),S=P.userText===void 0||P.userText.trim()==="";return((C=g?.optionProperties)==null?void 0:C.allowsTextEntry)&&S&&P.isSelected}),v=Object.values(p).some(w=>w.isSelected),b=f||_&&!v,x=n.map(({id:w,label:P,value:C,optionProperties:g})=>{var S,O;const B=`${w}`,{allowsTextEntry:q,noneOfTheAbove:ue}={allowsTextEntry:!1,noneOfTheAbove:!1,...g};return c(rt,{allowTextEntry:q,border:s,error:!1,id:B,isRadio:m,isSelected:!!((S=p[B])!=null&&S.isSelected),label:P,noneOfTheAbove:ue,onUserInputChanged:te=>E(te.id,te.selected,te.userText,te.noneOfTheAbove),promptText:"Please specify",text:(O=p[w])==null?void 0:O.userText,useMobileStyling:u,value:C},B)}),y=w=>{w.preventDefault(),w.stopPropagation(),r(p)},E=(w,P,C,g)=>{const S=Object.assign({},p);if((m||g)&&P)for(const O of Object.values(S))O.isSelected=!1,delete O.userText;else h&&!g&&p[h.id].isSelected&&(S[h.id].isSelected=!1);S[w]={isSelected:P,userText:C},l(S)},T=()=>c("div",{children:[o.isDropdown?c(Po,{isMultiSelect:!m,multiselectText:o.dropdownMultiselectedText??"choices selected",onChange:w=>{const P={...p};for(const C of n)w.includes(C)?P[C.id].isSelected=!0:P[C.id].isSelected=!1;l(P)},options:n,placeholderText:o.dropdownPlaceholderText??(m?"Select choice":"Select choice(s)"),value:n.filter(w=>p[w.id].isSelected)}):c("div",{className:I(U("ul-card__choices",u)),role:m?"radiogroup":"group",children:x}),c("div",{className:"ul-card__button-wrapper",children:c(V,{disabled:b,onClick:y,children:ce(o)})})]});return c("form",{className:I(e,"ul-card--multiple","fade-in-transition"),id:"text-form",onSubmit:y,children:[c(z,{message:t,properties:o}),c(Q,{properties:o,defaultBody:T})]},i)},Io=e=>{const{questionId:t,type:r,next:n,options:o}=e;return c(Vr,{...e,onSubmit:i=>{const a=Object.entries(i).find(([,l])=>l.isSelected)||[void 0,void 0],[s,u]=a,d=o.find(l=>`${l.id}`===s),p=u!=null&&u.userText?{[s]:{userText:u.userText}}:null;n({value:d&&s?{[s]:d.value}:{},secondaryValue:p,questionId:t,type:r})}})},Eo=e=>{const{questionId:t,type:r,next:n}=e;return c(Vr,{...e,onSubmit:o=>{const i={},a=Object.entries(o).reduce((u,[d,p])=>(u[d]=p.isSelected,u),i),s=Object.entries(o).reduce((u,[d,p])=>{if(!p.userText)return u;const l=u||{};return l[d]={userText:p.userText},l},null);n({value:a,secondaryValue:s,questionId:t,type:r})}})},Ro=({className:e,props:{labels:t,message:r,properties:n},next:o,questionId:i,type:a})=>{const{border:s,useMobileStyling:u}=M(h=>({border:h.border,useMobileStyling:h.useMobileStyling})),d=t&&t.left,p=t&&t.right,l=[...Array(11)].map((h,f)=>c("div",{className:I(U("nps-number",u),U(`nps-number-${f}`,u)),id:`option-${f}`,onClick:()=>o({value:f,questionId:i,type:a}),onKeyPress:v=>{v.preventDefault(),(v.key==="Enter"||v.key===" ")&&o({value:f,questionId:i,type:a})},onPointerDown:v=>{v.currentTarget.style.zIndex="2",v.currentTarget.style.borderColor=s},onPointerLeave:v=>{v.currentTarget.style.zIndex="auto",v.currentTarget.style.borderColor=Ue},role:"radio",tabIndex:0,children:f},f)),m=h=>{h.preventDefault(),h.stopPropagation(),o({value:null,questionId:i,type:a})},_=()=>c("div",{children:[c("div",{className:"ul-card--nps__numbers",children:l}),c("div",{className:"ul-card--nps__labels",children:[c("span",{children:d}),c("span",{children:p})]}),!n.required&&c("div",{className:"ul-vertical-centered-container",children:c(V,{onClick:m,children:ce(n)})})]});return c("form",{className:I(e,"ul-card--nps","fade-in-transition"),children:[c(z,{message:r,properties:n}),c(Q,{properties:n,defaultBody:_})]},i)},Mo=({className:e,message:t,next:r,properties:n,questionId:o,type:i})=>{const{border:a,useMobileStyling:s,update:u}=M(T=>({border:T.border,useMobileStyling:T.useMobileStyling,update:T.update})),[d,p]=H(""),l=$(null),m=d.trim(),_=n.required===!0&&!m,h=Ur(l,()=>u()),f=T=>{h(),T.preventDefault(),T.stopPropagation(),p(T.currentTarget.value)},v=T=>{T.preventDefault(),T.stopPropagation(),r({value:d,questionId:o,type:i})},b=n&&n.openTextPlaceholder?n.openTextPlaceholder:"",x=T=>{T.currentTarget.style.borderColor=a},y=T=>{T.currentTarget.style.borderColor=Ue},E=()=>c("div",{className:"ul-card-text",children:[c("div",{className:"ul-card-text__container",children:c("textarea",{"aria-label":b,"aria-labelledby":"ul-question","aria-multiline":"true","aria-placeholder":b,className:I(U("ul-card-text__input",s)),"data-gramm":"false",maxLength:5e3,name:"text",onBlur:y,onChange:f,onFocus:x,placeholder:b,ref:l,role:"textbox",tabIndex:0})}),c(V,{disabled:_,onClick:v,style:{backgroundColor:_?"":a},children:ce(n)}),n.footerHtml&&c("div",{className:"footer",dangerouslySetInnerHTML:{__html:n.footerHtml}})]});return c("form",{className:I(e,"ul-card--text","fade-in-transition"),id:"text-form",children:[c(z,{message:t,properties:n}),c(Q,{defaultBody:E,properties:n})]},o)},ee={RequestNeeded:1,TryAgain:2,Ready:3},Ee=e=>e.type==="av_permission",jr=e=>e.type==="screen_permission",Lo=(e,t)=>!(Ee(t)?t.permissionDescriptors:[]).includes("camera")||e.getVideoTracks().length>0,Br=(e,t)=>{if(e===void 0)return ee.RequestNeeded;if(e){if(!Lo(e,t))return ee.RequestNeeded}else return ee.TryAgain;return ee.Ready},$r={avStream:null,currentPage:null,mediaRecordingUids:null,nextQuestion:()=>{},passthroughData:void 0,recordingMediaTypes:void 0,screenPermissionRequested:!1,type:void 0},F=Tr(e=>({...$r,reset:()=>{e($r)},updatePage:t=>{e(t)}}));function nt({currentPage:e,pages:t}){const{avStream:r,recordingMediaTypes:n,updatePage:o}=F.getState(),{recorderEventEmitter:i}=M.getState();i.emit("av.permission",{"permission.descriptors":e.permissionDescriptors,"stream.ready":(a,s)=>{if(r===a)return;let u=e;if(a&&!e.permissionDescriptors.includes("camera")){const d=t.indexOf(e),p=s!=null&&s.active?d+2:d+1;s!=null&&s.active&&n&&i.emit("begin.recording",{"recording.media.types":n,"start.recording.callback":l=>o({mediaRecordingUids:l})}),u=t[p]}o({currentPage:u,avStream:a})}})}function Oo({pages:e,userId:t,responseGroupUid:r,surveyId:n,questionId:o,next:i}){const{updatePage:a}=F.getState(),{eventEmitFn:s,recorderEventEmitter:u}=M.getState(),d={questionId:o,surveyId:n,visitorId:t,responseGroupUid:r};let p=0;u.emit("recorded.task.permission.screen"),s("recorded.task.permission.screen"),u.emit("permission.status",{"permission.status.callback":(m,_,h,f)=>{const v=e[p],{type:b}=v,x=["screen"];if(Ee(v)){const{permissionDescriptors:y}=v,E=y?.includes("microphone"),T=y?.includes("camera");E&&x.push("audio"),T&&x.push("video");const w=m?.active&&!T,P=m?.active&&_;(w||P)&&p++}jr(e[p])&&h&&(p++,u.emit("begin.recording",{"recording.media.types":x,"start.recording.callback":y=>a({mediaRecordingUids:y})})),a({currentPage:e[p],avStream:m,screenPermissionRequested:h,nextQuestion:i,type:b,passthroughData:d,recordingMediaTypes:x,captureStream:f})}});const l=e[p];return l.type==="av_permission"&&nt({currentPage:l,pages:e}),l}function ot({status:e}){const{nextQuestion:t,passthroughData:r,mediaRecordingUids:n,reset:o}=F.getState(),{recorderEventEmitter:i,handleUploadUpdate:a,index:s}=M.getState(),u={value:{taskStatus:e},type:"recordedtask",questionId:r?.questionId||1};r&&i.emit("finish.task",{"begin.callback":d=>{a({mediaRecordingUid:d,isSubmitted:!0,progressPct:0,isComplete:!1})},"progress.callback":(d,p)=>{a({mediaRecordingUid:d,progressPct:p.detail,isSubmitted:!1,isComplete:!1})},"upload.callback":d=>{d&&a({mediaRecordingUid:d,isComplete:!0,isSubmitted:!0,progressPct:100})},"passthrough.data":r,"current.index":s,"task.response":u,"task.complete.callback":d=>{u.value.taskDurationMillisecond=d,n&&(u.value.mediaRecordingUids=n),o(),t(u)}})}function it({pages:e,setIsRequestingPermission:t}){const{recorderEventEmitter:r,eventEmitFn:n}=M.getState(),{updatePage:o,currentPage:i,recordingMediaTypes:a,screenPermissionRequested:s}=F.getState();if(!i)return;const u=e.indexOf(i);switch(i.type){case"av_permission":{const d=s?u+2:u+1;s&&a&&r.emit("begin.recording",{"recording.media.types":a,"start.recording.callback":p=>{o({mediaRecordingUids:p})}}),o({currentPage:e[d]});return}case"screen_permission":r.emit("screen.permission",{"screen.permission.requested":t,"stream.ready.callback":(d,p)=>{const l=p?e[u+1]:i;p&&a&&r.emit("begin.recording",{"recording.media.types":a,"start.recording.callback":m=>{o({captureStream:p,mediaRecordingUids:m})}}),o({currentPage:l,screenPermissionRequested:!0,captureStream:p})}});return;case"start_task":n("recorded.task.start"),r.emit("recorded.task.start"),r.emit("start.task"),o({currentPage:e[u+1],screenPermissionRequested:!0});return;case"complete_task":return}}const zr="ul-permission-graphics-container",Fr="ul-permission-body",Wr=I(zr,"ul_recorded-task-inset-spacing"),Re=I("ul-horizontal-button-container","ul-horizontal-button-container-left"),Zr=({richTextBody:e})=>c("div",{className:"ul-rich-text-body",dangerouslySetInnerHTML:{__html:e},id:"ul-task-detail-container"}),Me=({required:e,skipButtonText:t,bottom:r=!1})=>e?null:c(V,{className:I(r&&"ul-skip-button-below","ul-button-inactive"),onClick:ot.bind(null,{status:"abandoned"}),children:t||"Skip"}),at=e=>{const{avStream:t,captureStream:r,recordingMediaTypes:n,updatePage:o}=F.getState(),i=n?.includes("audio")||n?.includes("video");A(()=>{const a=setInterval(()=>{i&&t&&!t.active?o({avStream:null,currentPage:e[0]}):(!r||!r.active)&&o({captureStream:void 0,currentPage:e[i?1:0]})},1e3);return()=>clearInterval(a)},[t,r,i,e,n,o])},qo=({content:e,pages:t,required:r})=>{const{buttonText:n,skipButtonText:o,taskDetail:i}=e;return at(t),c("div",{className:"ul-task-page",children:[i&&c(Zr,{richTextBody:i}),c("div",{className:Re,children:[c(V,{onClick:it.bind(null,{pages:t}),children:n}),c(Me,{required:r,skipButtonText:o})]})]},"start-task")},Uo=({content:e,pages:t,properties:r})=>{const{buttonText:n,skipButtonText:o}=e;at(t);const i=c(Q,{properties:r,defaultBody:()=>c("div",{className:Re,children:[c(V,{className:"ul-complete-task-button",onClick:ot.bind(null,{status:"completed"}),children:n}),c(V,{className:I("ul-button-inactive"),onClick:ot.bind(null,{status:"given.up"}),children:o})]})});return c("div",{className:"ul-task-page",children:[e.taskDetail&&c(Zr,{richTextBody:e.taskDetail}),i]},"complete-task")},Ho=({content:e,pages:t,required:r})=>{const{buttonText:n,skipButtonText:o}=e,[i]=M(u=>[u.tabTitle]),[a,s]=H(!1);return c("div",{children:[c("div",{className:Wr,children:[c("p",{style:{marginTop:"auto"},children:e.selectTabText}),c("div",{className:"ul-select-tab-container",children:c("p",{className:Fr,children:i})})]}),c("div",{className:r?"":Re,children:[c(V,{disabled:a,onClick:it.bind(null,{pages:t,setIsRequestingPermission:s}),children:n}),c(Me,{required:r,skipButtonText:o})]})]})},Do=({content:e})=>c("div",{className:I(zr,"ul_permission_svg_container","ul_recorded-task-inset-spacing","ul-center-horizontally"),dangerouslySetInnerHTML:{__html:e.svg}},"ul-permission-request-graphic"),Ao=({content:e,pages:t,required:r})=>{const{permissionDeniedHeadline:n,permissionDeniedBody:o,skipButtonText:i,tryAgainButtonText:a}=e,s=Ee(t[0])?t[0]:null;return A(()=>{const u=setInterval(()=>{s!==null&&nt({currentPage:s,pages:t})},1e3);return()=>clearInterval(u)},[s,t]),s?c("div",{children:[c("div",{className:Wr,children:c("p",{className:"ul-av-permission-denied-paragraph",children:[c("span",{className:"ul-av-permission-denied-headline",children:n}),c("span",{className:Fr,children:o})]})}),c("div",{className:Re,children:[c(V,{onClick:nt.bind(null,{currentPage:s,pages:t}),children:a}),c(Me,{required:r,skipButtonText:i})]})]}):null},Vo=({stream:e})=>c("video",{autoPlay:!0,className:I("ul_recorded-task-inset-spacing"),id:"ul-record-task-video-preview",muted:!0,ref:t=>{t&&(t.srcObject=e||null)}}),jo=({content:e,pages:t,required:r})=>{const{skipButtonText:n}=e,{avStream:o}=F.getState();return at(t),c("div",{children:[c(Vo,{stream:o}),c("div",{className:"ul-vertical-button-container-center",children:[c(V,{onClick:it.bind(null,{pages:t}),children:e.buttonText}),c(Me,{bottom:!0,required:r,skipButtonText:n})]})]})},Bo=({properties:e})=>{const{pages:t,required:r}=e,{avStream:n,currentPage:o}=F.getState();if(o===void 0)return null;switch(o?.type){case"av_permission":{const i=Br(n,o);return i===ee.RequestNeeded?c(Do,{content:o}):i===ee.TryAgain?c(Ao,{content:o,pages:t,required:r}):c(jo,{content:o,pages:t,required:r})}case"screen_permission":return c(Ho,{content:o,pages:t,required:r});case"start_task":return c(qo,{content:o,pages:t,required:r});case"complete_task":return c(Uo,{content:o,pages:t,properties:e});default:return null}},$o=({className:e,properties:t,next:r,questionId:n})=>{const o=M(),{surveyId:i,responseGroupUid:a,userId:s}=o,u=F(),{screenPermissionRequested:d}=u,p=F(f=>f.avStream);let l=F(f=>f.currentPage);l||(l=Oo({questionId:n,surveyId:i,next:f=>{r(f)},pages:t.pages,responseGroupUid:a,userId:s}));let m=l.headline,_=l.captionText;const h=Br(p,l);return jr(l)&&d&&(m=l.permissionDeniedHeadline,_=l.permissionDeniedCaptionText),Ee(l)&&h===ee.Ready&&(m=l.permissionGrantedHeadline,_=l.permissionGrantedCaptionText),c("div",{className:I(e,"ul-center-horizontally","fade-in-transition"),children:[c(z,{message:m,properties:{captionText:_}}),c(Bo,{properties:t})]})},zo={"{{user_id}}":"externalUserId","{{email}}":"email"},Fo=(e=void 0,t={})=>{if(!e)return e;let r=e;const n=[];for(const[s,u]of Object.entries(zo))if(r.toLowerCase().includes(s))if(t[u]){const d=new RegExp(s,"gi");r=r.replace(d,t[u])}else n.push(s);if(n.length===0||!r.includes("?"))return r;const o=r.slice(0,r.indexOf("?")),i=r.slice(r.indexOf("?")+1).split("&").map(s=>s.split("=")).filter(s=>!n.includes(s[1]));if(i.length===0)return o;const a=i.map(s=>s.join("=")).join("&");return`${o}?${a}`},Wo=({className:e,message:t,next:r,properties:n,questionId:o,type:i})=>{const{visitorAttributes:a}=M(l=>({visitorAttributes:l.visitorAttributes})),s=(l,m=!1)=>{r({value:m?{skipped:!0}:void 0,questionId:o,type:i})},u=l=>{(l.key==="Enter"||l.key===" ")&&r({value:void 0,questionId:o,type:i})},d=()=>{const l=Fo(n&&n.buttonUrl,a);return c("div",{className:"ul-card-button-group",children:[c("a",{className:"ul-card-text__button ul-card__text-url-prompt-button",href:l,id:"ul-card-text__button",onClick:s,onKeyPress:u,rel:"noreferrer",role:l?"link":"button",tabIndex:0,target:"_blank",children:ce(n)}),n.required===!1&&c("button",{className:"ul-card-skip__button",onClick:m=>s(m,!0),children:Ar(n)})]})},p=(l,m)=>l?c("div",{className:"ul-rich-text-body",dangerouslySetInnerHTML:{__html:l},id:"ul-card__text-url-body-container"}):c("div",{className:"ul-rich-text-body",id:"ul-card__text-url-body-container",children:(m?m.split(/\n\s*\n/g):[]).map((_,h)=>c("p",{children:_},h))});return c("div",{className:I(e,"ul-card__text-url-prompt","fade-in-transition"),children:[c(z,{message:t}),p(n?.richTextBody,n?.body),c(Q,{defaultBody:d,properties:n})]},o)},Zo=({className:e,questionId:t})=>{const{border:r,destroy:n,endCard:o,forceBrandedLogo:i}=M(u=>({border:u.border,destroy:u.destroy,endCard:u.endCard,forceBrandedLogo:u.forceBrandedLogo}));A(()=>{setTimeout(()=>{n(ne)},i?4e3:2e3)},[n,i]);const a=o&&o.subheader?c("p",{className:"ul-caption",children:o.subheader}):null,s=o&&o.headline?o.headline:"";return c("div",{className:I(e,"ul-card--thanks","fade-in-transition"),children:c("div",{children:c("div",{className:"ul-card--thanks-content",children:[c("div",{className:"ul-thanks-check",children:c("svg",{"aria-labelledby":"title",fill:"none",height:"99",viewBox:"0 0 81 99",width:"81",xmlns:"http://www.w3.org/2000/svg",children:[c("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:r,fillRule:"evenodd"}),c("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:r,fillRule:"evenodd"}),c("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"})]})}),c(z,{message:s}),a]})})},t)},Go=({className:e})=>{const{uploadProgress:t}=M(i=>({uploadProgress:i.uploadProgress}));let r,n;Object.values(t).filter(i=>i.isSubmitted).length>1?(r="Your responses are processing",n="Please keep this tab open until your responses are fully processed."):(r="Your response is processing",n="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 c("div",{className:I(e,"ul-card--uploading","fade-in-transition"),children:[c("div",{"aria-busy":"true","aria-label":"Processing...","aria-live":"polite",className:"ul-loading-spinner-container",role:"progressbar",children:c("div",{className:"ul-loading-spinner",children:[c("div",{className:"first"}),c("div",{className:"second"}),c("div",{className:"third"}),c("div",{className:"fourth"})]})}),c(z,{message:`${r} (${o}% complete)`}),c("p",{className:"ul-caption",children:n})]})},Gr=({logoOnly:e=!1,style:t={}})=>c("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&&c("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"}),c("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"}),c("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"}),c("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"}),c("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"}),c("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"})]}),Ko=()=>{const{border:e,cards:t,forceBrandedLogo:r,headers:n,index:o,marketingUrl:i,showSurveyBrand:a,slugName:s,surveyId:u,viewedCardCount:d}=M(y=>({border:y.border,cards:y.cards,forceBrandedLogo:y.forceBrandedLogo,headers:y.headers,index:y.index,marketingUrl:y.marketingUrl,showSurveyBrand:y.showSurveyBrand,slugName:y.slugName,surveyId:y.surveyId,viewedCardCount:y.viewedCardCount})),p=$(null),l=t.filter(y=>y.type!=="uploading"&&y.type!=="thanks"),m=mo(t,o),_=d+1,h=_/(_+m),f=`${i}?utm_source=survey_branding&utm_medium=website&utm_campaign=${s}&utm_content=${u}${r&&"&utm_term=poweredby_pill"}`;A(()=>{p.current&&(p.current.style.width=`${h*100}%`)},[h]);const v=()=>c(D,{children:[l.length>1&&c("div",{id:"ul-progress-bar-container",children:c("div",{id:"ul-progress-bar-current",ref:p,style:{border:`1px solid ${e||"#000"}`}})}),a?c("div",{className:r?"yellow-footer-logo":"",style:{marginTop:"4px"},children:c("a",{href:f,rel:"noreferrer",target:"_blank",children:c("div",{style:{display:"flex"},children:[c(Gr,{logoOnly:!1}),r&&c(Kr,{style:{display:"block",margin:"auto 0 auto 4px",transform:"rotateY(0deg) rotate(-45deg)"}})]})})}):null]}),b=()=>c("a",{dir:"ltr",href:f,rel:"noreferrer",target:"_blank",children:c("div",{className:"thank-you-card-link",children:[c("div",{className:"sprig-box-logo",children:c(Gr,{logoOnly:!0,style:{margin:"auto"}})}),c("div",{children:c("p",{children:["Capture insights about your own product",c(Kr,{style:{display:"inline-flex",marginInlineStart:"4px",verticalAlign:"middle"}})]})})]})}),x=t[o].type==="thanks";return c("footer",{className:`ul-footer ${n["userleap-platform"]==="link"?"ul-footer__link":""}`,style:a?{}:{marginBottom:"10px"},children:x&&r?b():v()})},Kr=({style:e})=>c("svg",{fill:"none",height:"10",style:e,viewBox:"0 0 12 10",width:"12",xmlns:"http://www.w3.org/2000/svg",children:[c("path",{d:"M1.47839 5.2085L10.9384 5.2085",stroke:"black",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.35"}),c("path",{d:"M7.0686 1.15845L10.9386 5.20845L7.0686 9.25845",stroke:"black",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.35"})]}),Qo=()=>{const{answers:e,border:t,cards:r,close:n,configureExitOnOverlayClick:o,destroy:i,endCard:a,eventEmitFn:s,fontFamily:u,headers:d,index:p,next:l,productConfig:m,showStripes:_,studyType:h,surveyId:f,update:v,useMobileStyling:b,viewDocument:x}=M(N=>({answers:N.answers,border:N.border,cards:N.cards,close:N.close,configureExitOnOverlayClick:N.configureExitOnOverlayClick,destroy:N.destroy,endCard:N.endCard,eventEmitFn:N.eventEmitFn,fontFamily:N.fontFamily,headers:N.headers,index:N.index,productConfig:N.productConfig,next:N.next,showStripes:N.showStripes,studyType:N.studyType,surveyId:N.surveyId,update:N.update,useMobileStyling:N.useMobileStyling,viewDocument:N.viewDocument})),y=$(null),E=$(!1),T=d["userleap-platform"],{props:w,type:P,name:C}=r[p],g=r.length;A(()=>{y.current&&(y.current.classList.contains("ul-app--visible")||y.current.classList.add("ul-app--visible"),!E.current&&s&&(E.current=!0,s(K.SurveyAppeared,{name:K.SurveyAppeared,"survey.id":f})))},[s,f]),A(()=>{v()},[p,v]),A(()=>{o(()=>n())},[n,o]);const S=ge(()=>()=>n(ne),[n]),O=N=>{N.key==="Enter"&&S()},B=async function(N){l({data:N,completeSurvey:()=>{i(ne)},endCard:a}),ln(x)};if(e){for(const N of e)if(N.questionId===C){let re;if(P==="multiplechoice"){const J=w.options.find(({value:de})=>de===N.value);if(!J)break;re={[J.id]:J.value}}else re=N.value;B({value:re,type:P,questionId:N.questionId});break}}const q=()=>["email","link"].includes(d["userleap-platform"])?!1:!a||p+1!==g,ue=()=>{const N={className:"ul-card",next:B,questionId:C,type:P};switch(P){case"consentlegal":return L(ko,{...N,...w,key:C});case"likert":return L(Co,{...N,...w,key:C});case"matrix":return L(So,{...N,...w,key:C});case"multiplechoice":return L(Io,{...N,...w,key:C});case"multipleselect":return L(Eo,{...N,...w,key:C});case"nps":return L(Ro,{...N,key:C,props:w});case"open":return L(Mo,{...N,...w,key:C});case"recordedtask":return L($o,{...N,...w,key:C});case"texturlprompt":return L(Wo,{...N,...w,key:C});case"thanks":return L(Zo,{...N,...w,key:C});case"uploading":return L(Go,{...N,...w,key:C});case"videovoice":return null;default:return null}},te=N=>{var re;const J=window.sprigAPI,de=N.target;if(!J||!de)return;const tn=[de,de.parentElement];for(const Le of tn)if(((re=Le?.tagName)==null?void 0:re.toLowerCase())==="a"){N.preventDefault(),J?.openUrl(Le.href);return}},en=!b&&(m?.framePosition==="center"||m?.desktopDisplay==="center-modal"||(m?.placement||"").includes("center"));return c("div",{className:I("ul-app",xe(d)?"ul-app--visible":"ul-app--overlay"),dir:"auto",id:ne,onClick:te,ref:y,style:{"--theme":t,...u?{fontFamily:u.replace(";","")}:{},...en?{position:"relative"}:{}},children:c("div",{className:"ul-app__container",children:c("div",{className:I(U("ul-card__container",b,h)),style:{...h!=="feedbackButton"||m?.desktopDisplay==="center-modal"?{borderColor:t}:{},...m?.desktopDisplay==="slider"?{margin:"0px"}:{}},children:[q()&&c("div",{className:I(U("close-container",b)),children:c("div",{"aria-label":"Close button",className:"close-btn",onClick:S,onKeyPress:O,role:"button",tabIndex:0,children:c("svg",{fill:"none",height:"18px",viewBox:"0 0 13 13",width:"18px",xmlns:"http://www.w3.org/2000/svg",children:c("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"})})})}),_&&c("div",{className:"ul-header__container",dir:"ltr",children:c("div",{className:"ul-header",children:"For development purposes only"})}),c("div",{className:I(ho("ul-card-main-content",T)),children:ue()}),c(Ko,{})]})})})},Jo='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;margin:auto;text-align:start;min-width:200px}.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}.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;overflow:auto;padding:20px 20px 5px;position:relative;text-align:center;word-break:break-word}.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;margin-bottom:3px;display:flex;gap:16px;justify-content:center}.ul-rich-text-body{min-height:2em}.ul-rich-text-body,.ul-rich-text-body p{margin-top:10px;margin-bottom:10px}.ul-rich-text-body li{margin:5px 0}.ul-rich-text-body p,.ul-rich-text-body li{font-size:15px;line-height:130.35%;letter-spacing:.02em;color:#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{flex-grow:55;display:flex}.ul-card-main-content__web,.ul-card-main-content__android,.ul-card-main-content__ios{margin-bottom:5px}.question-header-container{margin-bottom:15px}.ul-question{color:#343442;display:block;font-size:20px;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:15px;line-height:130.35%;letter-spacing:.02em;color:#6c6c6e;text-align:start;margin-top:8px}.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}.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}.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}.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}.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}.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{flex:1 0 auto;margin-top:2px;margin-bottom:3px;align-items:center;display:flex;flex-wrap:wrap;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-voice__video{align-items:center;display:flex;flex-direction:column}#ul-card-voice__video>div{margin-bottom:10px;width:100%}#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;max-height:190px;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}#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;left:0;position:absolute;top:0;width:100%}.ul-footer{display:flex;flex-direction:column;align-items:center;justify-content:center;margin-top:auto;flex-grow:1;width:100%}.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%}.close-btn{cursor:pointer;height:18px;margin-inline-end:-10px;position:relative;top:-10px;width:18px;z-index:1}.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:25px 0}#ul-progress-bar-current{transition:width 1s ease;width:0%;height:0;border-radius:2px}.prototype-button{width:100%;background:#00000003;border:1.5px solid #e6e6e6;border-radius:4px 0 0 4px;flex:none;flex-grow:1;margin:0;padding:20px 0;font-size:14px;font-family:inherit;text-decoration:underline}.prototype-button:hover{cursor:pointer}',Yo=async(e,t)=>{var r;const n=await fetch(t,{method:"POST",cache:"no-cache",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(n.ok){const o=await n.json();return(r=o?.upload)==null?void 0:r.url}else return null},Qr=()=>MediaRecorder.isTypeSupported("video/webm")?"video/webm":"video/mp4",Jr=e=>{const t={audioBitsPerSecond:128e3,videoBitsPerSecond:25e5,mimeType:Qr()};return new MediaRecorder(e,t)},Yr=(e,t,r)=>{r[t]=[],e.ondataavailable=function(n){r[t].push(n.data)},e.currentMediaRecordingUid=t,e.start()};function Xr(e,t,r,n,o,i){if(e&&e.state!=="inactive"){const{"begin.callback":a}=n,s=e.currentMediaRecordingUid;if(!s)return;a&&a(s),e.onstop=()=>Xo(t,e,r,n,s,o,i),e.stop()}}async function Xo(e,t,r,n,o,i,a){const s=M.getState().viewDocument,{"upload.callback":u,"progress.callback":d}=n,p={mediaType:r,updatedAt:new Date().toISOString(),mediaRecordingUid:o,...n["passthrough.data"]},l=await Yo(p,e);if(!l){u&&u(null,{message:"failed to get upload url"});return}const m=new Blob(a,{type:Qr()});if(!s.defaultView)return;const _=new s.defaultView.File([m],`recording video ${Date.now()}`),h=i.createUpload({endpoint:l,file:_,chunkSize:5120});h.on("error",f=>{u&&u(null,f)}),h.on("progress",f=>{d&&d(o,f)}),h.on("success",()=>{u&&u(o,!0)})}const ei={chunks:{}},ti={state:{...ei},stopRecording(e){const{uploadApiEndpoint:t,avRecorder:r,screenRecorder:n,UpChunk:o}=this.state,i=this.state.avStream&&this.state.avStream.getVideoTracks().length>0?"video":"audio";this.state.chunks&&t&&o&&(r!=null&&r.currentMediaRecordingUid&&Xr(r,t,i,e,o,this.state.chunks[r?.currentMediaRecordingUid]),n!=null&&n.currentMediaRecordingUid&&Xr(n,t,"screen",e,o,this.state.chunks[n?.currentMediaRecordingUid]))},handleCancelledStream(e){const t=e.getVideoTracks(),r=e.getAudioTracks();let n=t.length&&t[0];n=n||r.length&&r[0],n&&n.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 r=>{this.avPermissionCallback(r)}),e.on("begin.recording",this.beginRecordingCallback.bind(this)),e.on("start.task",this.startTaskCallback.bind(this)),e.on("screen.permission",async r=>{this.screenPermissionCallback(r)}),e.on("finish.task",async r=>{this.finishTaskCallback(r)})},async avPermissionCallback(e){var t,r,n;const{"stream.ready":o,"permission.descriptors":i}=e;try{(t=this.state.avStream)!=null&&t.active&&(this.state.avStream.getTracks().map(a=>a.readyState==="live"&&a.stop()),((r=this.state.captureStream)==null?void 0:r.getAudioTracks().length)===1&&this.state.captureStream.removeTrack(this.state.captureStream.getAudioTracks()[0])),this.state.avStream=await navigator.mediaDevices.getUserMedia({video:i.includes("camera"),audio:!0}),((n=this.state.captureStream)==null?void 0:n.getAudioTracks().length)===0&&this.state.captureStream.addTrack(this.state.avStream.getAudioTracks()[0]),this.handleCancelledStream(this.state.avStream)}catch(a){console.warn("Error: failed to get permissions: "+a),o&&o(null,null);return}o&&o(this.state.avStream,this.state.captureStream)},async screenPermissionCallback(e){const{"screen.permission.requested":t,"stream.ready.callback":r}=e;t?.(!0);try{this.state.captureStream=await navigator.mediaDevices.getDisplayMedia({video:!0,cursor:"always",displaySurface:"browser",preferCurrentTab:!0})}catch(n){t?.(!1),console.warn("Error: failed to get permissions: "+n),r&&r(null,null);return}t?.(!1),this.state.avStream&&this.state.avStream.getAudioTracks().length>0&&this.state.captureStream.addTrack(this.state.avStream.getAudioTracks()[0]),this.handleCancelledStream(this.state.captureStream),r&&r(this.state.avStream||null,this.state.captureStream)},beginRecordingCallback(e){const{"recording.media.types":t,"start.recording.callback":r=()=>{}}=e;if(!t)return;const n=[];if(t.includes("video")&&this.state.avStream){this.state.avRecorder=Jr(this.state.avStream);const o=ut();Yr(this.state.avRecorder,o,this.state.chunks),n.push(o)}if(t.includes("screen")&&this.state.captureStream){this.state.screenRecorder=Jr(this.state.captureStream);const o=ut();Yr(this.state.screenRecorder,o,this.state.chunks),n.push(o)}n&&r&&r(n)},async finishTaskCallback(e){const{"current.index":t,"task.response":r,"task.complete.callback":n}=e;await this.stopRecording(e),n&&n(this.taskDurationMillisecond()),this.state.cards&&this.state.hasEndCard!==void 0&&this.lookAheadAndStopStream(t,r,this.state.cards,this.state.hasEndCard)},startTaskCallback(){this.state.startTime=new Date},permissionStatusCallback(e){var t;const{["permission.status.callback"]:r}=e,n=this.state.avStream;r&&r(n,n?n?.getVideoTracks().length>0:!1,!!((t=this.state.captureStream)!=null&&t.active),this.state.captureStream)},lookAheadAndStopStream(e,t,r,n){const{avRecorder:o,screenRecorder:i}=this.state,{allResponses:a}=M.getState(),s=Er({cards:r,index:e,hasEndCard:n,allResponses:a});s!==null&&r[s].type==="recordedtask"||[o,i].map(u=>{u&&(u.state==="recording"&&u.stop(),u.stream.getTracks().map(d=>{d.readyState==="live"&&d.stop()}))})}},lt=Object.create(ti);Object.freeze(lt);const ri=(e,t)=>{const r=[...e],n=new Set(["videovoice","recordedtask"]);return e.some(o=>n.has(o.type))&&r.push({name:-2,props:{routingOptions:[]},type:"uploading"}),t&&r.push({name:-1,props:{routingOptions:[]},type:"thanks"}),r},ni=({mode:e=null,viewWindow:t,viewDocument:r})=>{const n=r.documentElement;let o;try{o=t.parent.location.href}catch{o=t.location.href}return{mode:e,sw:t.screen.width,sh:t.screen.height,cw:n.clientWidth,ch:n.clientHeight,p:o,l:t.navigator.language}};function oi(e,t=!0){var r;const{answers:n,apiURL:o,customStyles:i,endCard:a,eventEmitFn:s,fontFamilyURL:u,frame:d,previewKey:p,viewDocument:l,viewWindow:m}=e,_=xe(e.headers)?e.frame:l.body,h=e.UpChunk||window.UpChunk,f=ye,v=ri(e.cards,!!a);lt.configure(f,{cards:v,hasEndCard:!!a,apiURL:o,UpChunk:h}),M.setState({apiURL:o,answers:n,border:e.border,index:e.startingQuestionIdx||0,cards:v,configureExitOnOverlayClick:e.configureExitOnOverlayClick,customMetadata:e.customMetadata,endCard:e.endCard,envId:e.envId,eventEmitFn:s,fontFamily:e.fontFamily,forceBrandedLogo:e.forceBrandedLogo,frame:d,headers:e.headers,hasViewedEmbed:!1,isPreview:e.isPreview,marketingUrl:"https://sprig.com",meta:ni({mode:e.mode,viewWindow:m,viewDocument:l}),mode:e.mode,previewKey:p,productConfig:e.productConfig,recorder:lt,recorderEventEmitter:f,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{seen:b}=M.getState();b();const{head:x}=l,y=l.createElement("style");if(y.id="sprig-style",y.textContent=Jo,y.nonce=e.styleNonce,x.appendChild(y),e.fontFamily&&u&&parent){const w=l.createElement("link");w.rel="stylesheet",w.href=u,x.appendChild(w)}e.customStyles&&sn(l,i,e.styleNonce);const E="2.28.0",T=s||((r=d.eventEmitter)==null?void 0:r.emit);T?.("verify.view.version",{"view.version":E}),_&&t&&ie(c(Qo,{}),_)}const ii={configure:oi};export{ii as default};
|