UNPKG

@sprig-technologies/sprig-bundled

Version:

npm package for the sprig web sdk with bundled dependencies

1 lines • 113 kB
"use strict";const I=require("./index-BzAnV7nc.cjs");var ge,C,tr,Y,pt,rr,ze,nr,pe={},or=[],un=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Re=Array.isArray;function $(e,t){for(var r in t)e[r]=t[r];return e}function ir(e){var t=e.parentNode;t&&t.removeChild(e)}function V(e,t,r){var o,n,i,a={};for(i in t)i=="key"?o=t[i]:i=="ref"?n=t[i]:a[i]=t[i];if(arguments.length>2&&(a.children=arguments.length>3?ge.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 de(e,a,o,n,null)}function de(e,t,r,o,n){var i={type:e,props:t,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:n??++tr,__i:-1,__u:0};return n==null&&C.vnode!=null&&C.vnode(i),i}function ar(){return{current:null}}function M(e){return e.children}function D(e,t){this.props=e,this.context=t}function ie(e,t){if(t==null)return e.__?ie(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"?ie(e):null}function sr(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 sr(e)}}function Be(e){(!e.__d&&(e.__d=!0)&&Y.push(e)&&!Ce.__r++||pt!==C.debounceRendering)&&((pt=C.debounceRendering)||rr)(Ce)}function Ce(){var e,t,r,o,n,i,a,s,l;for(Y.sort(ze);e=Y.shift();)e.__d&&(t=Y.length,o=void 0,i=(n=(r=e).__v).__e,s=[],l=[],(a=r.__P)&&((o=$({},n)).__v=n.__v+1,C.vnode&&C.vnode(o),Xe(a,o,n,r.__n,a.ownerSVGElement!==void 0,32&n.__u?[i]:null,s,i??ie(n),!!(32&n.__u),l),o.__.__k[o.__i]=o,cr(s,o,l),o.__e!=i&&sr(o)),Y.length>t&&Y.sort(ze));Ce.__r=0}function lr(e,t,r,o,n,i,a,s,l,u,d){var c,_,p,h,m,g=o&&o.__k||or,x=t.length;for(r.__d=l,function(f,k,w){var b,v,y,E,R,N=k.length,T=w.length,U=T,L=0;for(f.__k=[],b=0;b<N;b++)(v=f.__k[b]=(v=k[b])==null||typeof v=="boolean"||typeof v=="function"?null:typeof v=="string"||typeof v=="number"||typeof v=="bigint"||v.constructor==String?de(null,v,null,null,v):Re(v)?de(M,{children:v},null,null,null):v.constructor===void 0&&v.__b>0?de(v.type,v.props,v.key,v.ref?v.ref:null,v.__v):v)!=null?(v.__=f,v.__b=f.__b+1,R=cn(v,w,E=b+L,U),v.__i=R,y=null,R!==-1&&(U--,(y=w[R])&&(y.__u|=131072)),y==null||y.__v===null?(R==-1&&L--,typeof v.type!="function"&&(v.__u|=65536)):R!==E&&(R===E+1?L++:R>E?U>N-E?L+=R-E:L--:L=R<E&&R==E-1?R-E:0,R!==b+L&&(v.__u|=65536))):(y=w[b])&&y.key==null&&y.__e&&(y.__e==f.__d&&(f.__d=ie(y)),$e(y,y,!1),w[b]=null,U--);if(U)for(b=0;b<T;b++)(y=w[b])!=null&&!(131072&y.__u)&&(y.__e==f.__d&&(f.__d=ie(y)),$e(y,y))}(r,t,g),l=r.__d,c=0;c<x;c++)(p=r.__k[c])!=null&&typeof p!="boolean"&&typeof p!="function"&&(_=p.__i===-1?pe:g[p.__i]||pe,p.__i=c,Xe(e,p,_,n,i,a,s,l,u,d),h=p.__e,p.ref&&_.ref!=p.ref&&(_.ref&&et(_.ref,null,p),d.push(p.ref,p.__c||h,p)),m==null&&h!=null&&(m=h),65536&p.__u||_.__k===p.__k?l=ur(p,l,e):typeof p.type=="function"&&p.__d!==void 0?l=p.__d:h&&(l=h.nextSibling),p.__d=void 0,p.__u&=-196609);r.__d=l,r.__e=m}function ur(e,t,r){var o,n;if(typeof e.type=="function"){for(o=e.__k,n=0;o&&n<o.length;n++)o[n]&&(o[n].__=e,t=ur(o[n],t,r));return t}return e.__e!=t&&(r.insertBefore(e.__e,t||null),t=e.__e),t&&t.nextSibling}function Q(e,t){return t=t||[],e==null||typeof e=="boolean"||(Re(e)?e.some(function(r){Q(r,t)}):t.push(e)),t}function cn(e,t,r,o){var n=e.key,i=e.type,a=r-1,s=r+1,l=t[r];if(l===null||l&&n==l.key&&i===l.type)return r;if(o>(l==null||131072&l.__u?0:1))for(;a>=0||s<t.length;){if(a>=0){if((l=t[a])&&!(131072&l.__u)&&n==l.key&&i===l.type)return a;a--}if(s<t.length){if((l=t[s])&&!(131072&l.__u)&&n==l.key&&i===l.type)return s;s++}}return-1}function ft(e,t,r){t[0]==="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||un.test(t)?r:r+"px"}function ve(e,t,r,o,n){var i;e:if(t==="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof o=="string"&&(e.style.cssText=o=""),o)for(t in o)r&&t in r||ft(e.style,t,"");if(r)for(t in r)o&&r[t]===o[t]||ft(e.style,t,r[t])}else if(t[0]==="o"&&t[1]==="n")i=t!==(t=t.replace(/(PointerCapture)$|Capture$/,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=r,r?o?r.u=o.u:(r.u=Date.now(),e.addEventListener(t,i?_t:mt,i)):e.removeEventListener(t,i?_t:mt,i);else{if(n)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!=="width"&&t!=="height"&&t!=="href"&&t!=="list"&&t!=="form"&&t!=="tabIndex"&&t!=="download"&&t!=="rowSpan"&&t!=="colSpan"&&t!=="role"&&t in e)try{e[t]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,r))}}function mt(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(C.event?C.event(e):e)}function _t(e){return this.l[e.type+!0](C.event?C.event(e):e)}function Xe(e,t,r,o,n,i,a,s,l,u){var d,c,_,p,h,m,g,x,f,k,w,b,v,y,E,R=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(l=!!(32&r.__u),i=[s=t.__e=r.__e]),(d=C.__b)&&d(t);e:if(typeof R=="function")try{if(x=t.props,f=(d=R.contextType)&&o[d.__c],k=d?f?f.props.value:d.__:o,r.__c?g=(c=t.__c=r.__c).__=c.__E:("prototype"in R&&R.prototype.render?t.__c=c=new R(x,k):(t.__c=c=new D(x,k),c.constructor=R,c.render=pn),f&&f.sub(c),c.props=x,c.state||(c.state={}),c.context=k,c.__n=o,_=c.__d=!0,c.__h=[],c._sb=[]),c.__s==null&&(c.__s=c.state),R.getDerivedStateFromProps!=null&&(c.__s==c.state&&(c.__s=$({},c.__s)),$(c.__s,R.getDerivedStateFromProps(x,c.__s))),p=c.props,h=c.state,c.__v=t,_)R.getDerivedStateFromProps==null&&c.componentWillMount!=null&&c.componentWillMount(),c.componentDidMount!=null&&c.__h.push(c.componentDidMount);else{if(R.getDerivedStateFromProps==null&&x!==p&&c.componentWillReceiveProps!=null&&c.componentWillReceiveProps(x,k),!c.__e&&(c.shouldComponentUpdate!=null&&c.shouldComponentUpdate(x,c.__s,k)===!1||t.__v===r.__v)){for(t.__v!==r.__v&&(c.props=x,c.state=c.__s,c.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.forEach(function(N){N&&(N.__=t)}),w=0;w<c._sb.length;w++)c.__h.push(c._sb[w]);c._sb=[],c.__h.length&&a.push(c);break e}c.componentWillUpdate!=null&&c.componentWillUpdate(x,c.__s,k),c.componentDidUpdate!=null&&c.__h.push(function(){c.componentDidUpdate(p,h,m)})}if(c.context=k,c.props=x,c.__P=e,c.__e=!1,b=C.__r,v=0,"prototype"in R&&R.prototype.render){for(c.state=c.__s,c.__d=!1,b&&b(t),d=c.render(c.props,c.state,c.context),y=0;y<c._sb.length;y++)c.__h.push(c._sb[y]);c._sb=[]}else do c.__d=!1,b&&b(t),d=c.render(c.props,c.state,c.context),c.state=c.__s;while(c.__d&&++v<25);c.state=c.__s,c.getChildContext!=null&&(o=$($({},o),c.getChildContext())),_||c.getSnapshotBeforeUpdate==null||(m=c.getSnapshotBeforeUpdate(p,h)),lr(e,Re(E=d!=null&&d.type===M&&d.key==null?d.props.children:d)?E:[E],t,r,o,n,i,a,s,l,u),c.base=t.__e,t.__u&=-161,c.__h.length&&a.push(c),g&&(c.__E=c.__=null)}catch(N){t.__v=null,l||i!=null?(t.__e=s,t.__u|=l?160:32,i[i.indexOf(s)]=null):(t.__e=r.__e,t.__k=r.__k),C.__e(N,t,r)}else i==null&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=dn(r.__e,t,r,o,n,i,a,l,u);(d=C.diffed)&&d(t)}function cr(e,t,r){t.__d=void 0;for(var o=0;o<r.length;o++)et(r[o],r[++o],r[++o]);C.__c&&C.__c(t,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(i){i.call(n)})}catch(i){C.__e(i,n.__v)}})}function dn(e,t,r,o,n,i,a,s,l){var u,d,c,_,p,h,m,g=r.props,x=t.props,f=t.type;if(f==="svg"&&(n=!0),i!=null){for(u=0;u<i.length;u++)if((p=i[u])&&"setAttribute"in p==!!f&&(f?p.localName===f:p.nodeType===3)){e=p,i[u]=null;break}}if(e==null){if(f===null)return document.createTextNode(x);e=n?document.createElementNS("http://www.w3.org/2000/svg",f):document.createElement(f,x.is&&x),i=null,s=!1}if(f===null)g===x||s&&e.data===x||(e.data=x);else{if(i=i&&ge.call(e.childNodes),g=r.props||pe,!s&&i!=null)for(g={},u=0;u<e.attributes.length;u++)g[(p=e.attributes[u]).name]=p.value;for(u in g)p=g[u],u=="children"||(u=="dangerouslySetInnerHTML"?c=p:u==="key"||u in x||ve(e,u,null,p,n));for(u in x)p=x[u],u=="children"?_=p:u=="dangerouslySetInnerHTML"?d=p:u=="value"?h=p:u=="checked"?m=p:u==="key"||s&&typeof p!="function"||g[u]===p||ve(e,u,p,g[u],n);if(d)s||c&&(d.__html===c.__html||d.__html===e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(c&&(e.innerHTML=""),lr(e,Re(_)?_:[_],t,r,o,n&&f!=="foreignObject",i,a,i?i[0]:r.__k&&ie(r,0),s,l),i!=null)for(u=i.length;u--;)i[u]!=null&&ir(i[u]);s||(u="value",h!==void 0&&(h!==e[u]||f==="progress"&&!h||f==="option"&&h!==g[u])&&ve(e,u,h,g[u],!1),u="checked",m!==void 0&&m!==e[u]&&ve(e,u,m,g[u],!1))}return e}function et(e,t,r){try{typeof e=="function"?e(t):e.current=t}catch(o){C.__e(o,r)}}function $e(e,t,r){var o,n;if(C.unmount&&C.unmount(e),(o=e.ref)&&(o.current&&o.current!==e.__e||et(o,null,t)),(o=e.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(i){C.__e(i,t)}o.base=o.__P=null,e.__c=void 0}if(o=e.__k)for(n=0;n<o.length;n++)o[n]&&$e(o[n],t,r||typeof e.type!="function");r||e.__e==null||ir(e.__e),e.__=e.__e=e.__d=void 0}function pn(e,t,r){return this.constructor(e,r)}function ae(e,t,r){var o,n,i,a;C.__&&C.__(e,t),n=(o=typeof r=="function")?null:r&&r.__k||t.__k,i=[],a=[],Xe(t,e=(!o&&r||t).__k=V(M,null,[e]),n||pe,pe,t.ownerSVGElement!==void 0,!o&&r?[r]:n?null:t.firstChild?ge.call(t.childNodes):null,i,!o&&r?r:n?n.__e:t.firstChild,o,a),cr(i,e,a)}function dr(e,t){ae(e,t,dr)}function fn(e,t,r){var o,n,i,a,s=$({},e.props);for(i in e.type&&e.type.defaultProps&&(a=e.type.defaultProps),t)i=="key"?o=t[i]:i=="ref"?n=t[i]:s[i]=t[i]===void 0&&a!==void 0?a[i]:t[i];return arguments.length>2&&(s.children=arguments.length>3?ge.call(arguments,2):r),de(e.type,s,o||e.key,n||e.ref,null)}function tt(e,t){var r={__c:t="__cC"+nr++,__:e,Consumer:function(o,n){return o.children(n)},Provider:function(o){var n,i;return this.getChildContext||(n=[],(i={})[t]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(a){this.props.value!==a.value&&n.some(function(s){s.__e=!0,Be(s)})},this.sub=function(a){n.push(a);var s=a.componentWillUnmount;a.componentWillUnmount=function(){n.splice(n.indexOf(a),1),s&&s.call(a)}}),o.children}};return r.Provider.__=r.Consumer.contextType=r}ge=or.slice,C={__e:function(e,t,r,o){for(var n,i,a;t=t.__;)if((n=t.__c)&&!n.__)try{if((i=n.constructor)&&i.getDerivedStateFromError!=null&&(n.setState(i.getDerivedStateFromError(e)),a=n.__d),n.componentDidCatch!=null&&(n.componentDidCatch(e,o||{}),a=n.__d),a)return n.__E=n}catch(s){e=s}throw e}},tr=0,D.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=$({},this.state),typeof e=="function"&&(e=e($({},r),this.props)),e&&$(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),Be(this))},D.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Be(this))},D.prototype.render=M,Y=[],rr=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ze=function(e,t){return e.__v.__b-t.__v.__b},Ce.__r=0,nr=0;var mn=0;function S(e,t,r,o,n,i){var a,s,l={};for(s in t)s=="ref"?a=t[s]:l[s]=t[s];var u={type:e,props:l,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--mn,__i:-1,__u:0,__source:n,__self:i};if(typeof e=="function"&&(a=e.defaultProps))for(s in a)l[s]===void 0&&(l[s]=a[s]);return C.vnode&&C.vnode(u),u}var W,j,Ne,gt,se=0,pr=[],xe=[],ht=C.__b,yt=C.__r,bt=C.diffed,vt=C.__c,xt=C.unmount;function X(e,t){C.__h&&C.__h(j,e,se||t),se=0;var r=j.__H||(j.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:xe}),r.__[e]}function G(e){return se=1,rt(_r,e)}function rt(e,t,r){var o=X(W++,2);if(o.t=e,!o.__c&&(o.__=[r?r(t):_r(void 0,t),function(s){var l=o.__N?o.__N[0]:o.__[0],u=o.t(l,s);l!==u&&(o.__N=[u,o.__[1]],o.__c.setState({}))}],o.__c=j,!j.u)){var n=function(s,l,u){if(!o.__c.__H)return!0;var d=o.__c.__H.__.filter(function(_){return _.__c});if(d.every(function(_){return!_.__N}))return!i||i.call(this,s,l,u);var c=!1;return d.forEach(function(_){if(_.__N){var p=_.__[0];_.__=_.__N,_.__N=void 0,p!==_.__[0]&&(c=!0)}}),!(!c&&o.__c.props===s)&&(!i||i.call(this,s,l,u))};j.u=!0;var i=j.shouldComponentUpdate,a=j.componentWillUpdate;j.componentWillUpdate=function(s,l,u){if(this.__e){var d=i;i=void 0,n(s,l,u),i=d}a&&a.call(this,s,l,u)},j.shouldComponentUpdate=n}return o.__N||o.__}function q(e,t){var r=X(W++,3);!C.__s&&it(r.__H,t)&&(r.__=e,r.i=t,j.__H.__h.push(r))}function le(e,t){var r=X(W++,4);!C.__s&&it(r.__H,t)&&(r.__=e,r.i=t,j.__h.push(r))}function K(e){return se=5,J(function(){return{current:e}},[])}function fr(e,t,r){se=6,le(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 J(e,t){var r=X(W++,7);return it(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function fe(e,t){return se=8,J(function(){return e},t)}function nt(e){var t=j.context[e.__c],r=X(W++,9);return r.c=e,t?(r.__==null&&(r.__=!0,t.sub(j)),t.props.value):e.__}function ot(e,t){C.useDebugValue&&C.useDebugValue(t?t(e):e)}function mr(){var e=X(W++,11);if(!e.__){for(var t=j.__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 _n(){for(var e;e=pr.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(ke),e.__H.__h.forEach(Qe),e.__H.__h=[]}catch(t){e.__H.__h=[],C.__e(t,e.__v)}}C.__b=function(e){j=null,ht&&ht(e)},C.__r=function(e){yt&&yt(e),W=0;var t=(j=e.__c).__H;t&&(Ne===j?(t.__h=[],j.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.__V=xe,r.__N=r.i=void 0})):(t.__h.forEach(ke),t.__h.forEach(Qe),t.__h=[],W=0)),Ne=j},C.diffed=function(e){bt&&bt(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(pr.push(t)!==1&&gt===C.requestAnimationFrame||((gt=C.requestAnimationFrame)||gn)(_n)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.__V!==xe&&(r.__=r.__V),r.i=void 0,r.__V=xe})),Ne=j=null},C.__c=function(e,t){t.some(function(r){try{r.__h.forEach(ke),r.__h=r.__h.filter(function(o){return!o.__||Qe(o)})}catch(o){t.some(function(n){n.__h&&(n.__h=[])}),t=[],C.__e(o,r.__v)}}),vt&&vt(e,t)},C.unmount=function(e){xt&&xt(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(o){try{ke(o)}catch(n){t=n}}),r.__H=void 0,t&&C.__e(t,r.__v))};var kt=typeof requestAnimationFrame=="function";function gn(e){var t,r=function(){clearTimeout(o),kt&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(r,100);kt&&(t=requestAnimationFrame(r))}function ke(e){var t=j,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),j=t}function Qe(e){var t=j;e.__c=e.__(),j=t}function it(e,t){return!e||e.length!==t.length||t.some(function(r,o){return r!==e[o]})}function _r(e,t){return typeof t=="function"?t(e):t}function gr(e,t){for(var r in t)e[r]=t[r];return e}function We(e,t){for(var r in e)if(r!=="__source"&&!(r in t))return!0;for(var o in t)if(o!=="__source"&&e[o]!==t[o])return!0;return!1}function Se(e){this.props=e}function hr(e,t){function r(n){var i=this.props.ref,a=i==n.ref;return!a&&i&&(i.call?i(null):i.current=null),t?!t(this.props,n)||!a:We(this.props,n)}function o(n){return this.shouldComponentUpdate=r,V(e,n)}return o.displayName="Memo("+(e.displayName||e.name)+")",o.prototype.isReactComponent=!0,o.__f=!0,o}(Se.prototype=new D).isPureReactComponent=!0,Se.prototype.shouldComponentUpdate=function(e,t){return We(this.props,e)||We(this.state,t)};var wt=C.__b;C.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),wt&&wt(e)};var hn=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function at(e){function t(r){var o=gr({},r);return delete o.ref,e(o,r.ref||null)}return t.$$typeof=hn,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var Ct=function(e,t){return e==null?null:Q(Q(e).map(t))},yr={map:Ct,forEach:Ct,count:function(e){return e?Q(e).length:0},only:function(e){var t=Q(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:Q},yn=C.__e;C.__e=function(e,t,r,o){if(e.then){for(var n,i=t;i=i.__;)if((n=i.__c)&&n.__c)return t.__e==null&&(t.__e=r.__e,t.__k=r.__k),n.__c(e,t)}yn(e,t,r,o)};var St=C.unmount;function br(e,t,r){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(o){typeof o.__c=="function"&&o.__c()}),e.__c.__H=null),(e=gr({},e)).__c!=null&&(e.__c.__P===r&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(o){return br(o,t,r)})),e}function vr(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(o){return vr(o,t,r)}),e.__c&&e.__c.__P===t&&(e.__e&&r.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=r)),e}function oe(){this.__u=0,this.t=null,this.__b=null}function xr(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Ee(e){var t,r,o;function n(i){if(t||(t=e()).then(function(a){r=a.default||a},function(a){o=a}),o)throw o;if(!r)throw t;return V(r,i)}return n.displayName="Lazy",n.__f=!0,n}function re(){this.u=null,this.o=null}C.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),St&&St(e)},(oe.prototype=new D).__c=function(e,t){var r=t.__c,o=this;o.t==null&&(o.t=[]),o.t.push(r);var n=xr(o.__v),i=!1,a=function(){i||(i=!0,r.__R=null,n?n(s):s())};r.__R=a;var s=function(){if(!--o.__u){if(o.state.__a){var l=o.state.__a;o.__v.__k[0]=vr(l,l.__c.__P,l.__c.__O)}var u;for(o.setState({__a:o.__b=null});u=o.t.pop();)u.forceUpdate()}};o.__u++||32&t.__u||o.setState({__a:o.__b=o.__v.__k[0]}),e.then(a,a)},oe.prototype.componentWillUnmount=function(){this.t=[]},oe.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=br(this.__b,r,o.__O=o.__P)}this.__b=null}var n=t.__a&&V(M,null,e.fallback);return n&&(n.__u&=-33),[V(M,null,t.__a?null:e.children),n]};var It=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 bn(e){return this.getChildContext=function(){return e.context},e.children}function vn(e){var t=this,r=e.i;t.componentWillUnmount=function(){ae(null,t.l),t.l=null,t.i=null},t.i&&t.i!==r&&t.componentWillUnmount(),t.l||(t.i=r,t.l={nodeType:1,parentNode:r,childNodes:[],appendChild:function(o){this.childNodes.push(o),t.i.appendChild(o)},insertBefore:function(o,n){this.childNodes.push(o),t.i.appendChild(o)},removeChild:function(o){this.childNodes.splice(this.childNodes.indexOf(o)>>>1,1),t.i.removeChild(o)}}),ae(V(bn,{context:t.context},e.__v),t.l)}function kr(e,t){var r=V(vn,{__v:e,i:t});return r.containerInfo=t,r}(re.prototype=new D).__a=function(e){var t=this,r=xr(t.__v),o=t.o.get(e);return o[0]++,function(n){var i=function(){t.props.revealOrder?(o.push(n),It(t,e,o)):n()};r?r(i):i()}},re.prototype.render=function(e){this.u=null,this.o=new Map;var t=Q(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var r=t.length;r--;)this.o.set(t[r],this.u=[1,0,this.u]);return e.children},re.prototype.componentDidUpdate=re.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,r){It(e,r,t)})};var wr=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,xn=/^(?: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]/,kn=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,wn=/[A-Z0-9]/g,Cn=typeof document<"u",Sn=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function Cr(e,t,r){return t.__k==null&&(t.textContent=""),ae(e,t),typeof r=="function"&&r(),e?e.__c:null}function Sr(e,t,r){return dr(e,t),typeof r=="function"&&r(),e?e.__c:null}D.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(D.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var At=C.event;function In(){}function An(){return this.cancelBubble}function Rn(){return this.defaultPrevented}C.event=function(e){return At&&(e=At(e)),e.persist=In,e.isPropagationStopped=An,e.isDefaultPrevented=Rn,e.nativeEvent=e};var st,En={enumerable:!1,configurable:!0,get:function(){return this.class}},Rt=C.vnode;C.vnode=function(e){typeof e.type=="string"&&function(t){var r=t.props,o=t.type,n={};for(var i in r){var a=r[i];if(!(i==="value"&&"defaultValue"in r&&a==null||Cn&&i==="children"&&o==="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"||o!=="input"&&o!=="textarea"||Sn(r.type)?s==="onfocus"?i="onfocusin":s==="onblur"?i="onfocusout":kn.test(i)?i=s:o.indexOf("-")===-1&&xn.test(i)?i=i.replace(wn,"-$&").toLowerCase():a===null&&(a=void 0):s=i="oninput",s==="oninput"&&n[i=s]&&(i="oninputCapture"),n[i]=a}}o=="select"&&n.multiple&&Array.isArray(n.value)&&(n.value=Q(r.children).forEach(function(l){l.props.selected=n.value.indexOf(l.props.value)!=-1})),o=="select"&&n.defaultValue!=null&&(n.value=Q(r.children).forEach(function(l){l.props.selected=n.multiple?n.defaultValue.indexOf(l.props.value)!=-1:n.defaultValue==l.props.value})),r.class&&!r.className?(n.class=r.class,Object.defineProperty(n,"className",En)):(r.className&&!r.class||r.class&&r.className)&&(n.class=n.className=r.className),t.props=n}(e),e.$$typeof=wr,Rt&&Rt(e)};var Et=C.__r;C.__r=function(e){Et&&Et(e),st=e.__c};var jt=C.diffed;C.diffed=function(e){jt&&jt(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),st=null};var Ir={ReactCurrentDispatcher:{current:{readContext:function(e){return st.__n[e.__c].props.value}}}};function Ar(e){return V.bind(null,e)}function he(e){return!!e&&e.$$typeof===wr}function Rr(e){return he(e)&&e.type===M}function Er(e){return he(e)?fn.apply(null,arguments):e}function Ie(e){return!!e.__k&&(ae(null,e),!0)}function jr(e){return e&&(e.base||e.nodeType===1&&e)||null}var Lr=function(e,t){return e(t)},Nr=function(e,t){return e(t)},Tr=M;function lt(e){e()}function Ur(e){return e}function Or(){return[!1,lt]}var Pr=le,Vr=he;function qr(e,t){var r=t(),o=G({h:{__:r,v:t}}),n=o[0].h,i=o[1];return le(function(){n.__=r,n.v=t,Te(n)&&i({h:n})},[e,r,t]),q(function(){return Te(n)&&i({h:n}),e(function(){Te(n)&&i({h:n})})},[e]),r}function Te(e){var t,r,o=e.v,n=e.__;try{var i=o();return!((t=n)===(r=i)&&(t!==0||1/t==1/r)||t!=t&&r!=r)}catch{return!0}}var Mr={useState:G,useId:mr,useReducer:rt,useEffect:q,useLayoutEffect:le,useInsertionEffect:Pr,useTransition:Or,useDeferredValue:Ur,useSyncExternalStore:qr,startTransition:lt,useRef:K,useImperativeHandle:fr,useMemo:J,useCallback:fe,useContext:nt,useDebugValue:ot,version:"17.0.2",Children:yr,render:Cr,hydrate:Sr,unmountComponentAtNode:Ie,createPortal:kr,createElement:V,createContext:tt,createFactory:Ar,cloneElement:Er,createRef:ar,Fragment:M,isValidElement:he,isElement:Vr,isFragment:Rr,findDOMNode:jr,Component:D,PureComponent:Se,memo:hr,forwardRef:at,flushSync:Nr,unstable_batchedUpdates:Lr,StrictMode:Tr,Suspense:oe,SuspenseList:re,lazy:Ee,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Ir};const jn=Object.freeze(Object.defineProperty({__proto__:null,Children:yr,Component:D,Fragment:M,PureComponent:Se,StrictMode:Tr,Suspense:oe,SuspenseList:re,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Ir,cloneElement:Er,createContext:tt,createElement:V,createFactory:Ar,createPortal:kr,createRef:ar,default:Mr,findDOMNode:jr,flushSync:Nr,forwardRef:at,hydrate:Sr,isElement:Vr,isFragment:Rr,isValidElement:he,lazy:Ee,memo:hr,render:Cr,startTransition:lt,unmountComponentAtNode:Ie,unstable_batchedUpdates:Lr,useCallback:fe,useContext:nt,useDebugValue:ot,useDeferredValue:Ur,useEffect:q,useErrorBoundary:function(e){var t=X(W++,10),r=G();return t.__=e,j.componentDidCatch||(j.componentDidCatch=function(o,n){t.__&&t.__(o,n),r[1](o)}),[r[0],function(){r[1](void 0)}]},useId:mr,useImperativeHandle:fr,useInsertionEffect:Pr,useLayoutEffect:le,useMemo:J,useReducer:rt,useRef:K,useState:G,useSyncExternalStore:qr,useTransition:Or,version:"17.0.2"},Symbol.toStringTag,{value:"Module"})),Lt=e=>{let t;const r=new Set,o=(a,s)=>{const l=typeof a=="function"?a(t):a;if(!Object.is(l,t)){const u=t;t=s??typeof l!="object"?l:Object.assign({},t,l),r.forEach(d=>d(t,u))}},n=()=>t,i={setState:o,getState:n,subscribe:a=>(r.add(a),()=>r.delete(a)),destroy:()=>r.clear()};return t=e(o,n,i),i};function Ln(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Nn(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=function o(){return this instanceof o?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(o){var n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(r,o,n.get?n:{enumerable:!0,get:function(){return e[o]}})}),r}var Nt={exports:{}},Ue={};const Hr=Nn(jn);var Tt,Ut,Ot,Pt,Vt={exports:{}},Oe={};function Tn(){return Ut||(Ut=1,Vt.exports=function(){if(Tt)return Oe;Tt=1;var e=Hr,t=typeof Object.is=="function"?Object.is:function(l,u){return l===u&&(l!==0||1/l==1/u)||l!=l&&u!=u},r=e.useState,o=e.useEffect,n=e.useLayoutEffect,i=e.useDebugValue;function a(l){var u=l.getSnapshot;l=l.value;try{var d=u();return!t(l,d)}catch{return!0}}var s=typeof window>"u"||window.document===void 0||window.document.createElement===void 0?function(l,u){return u()}:function(l,u){var d=u(),c=r({inst:{value:d,getSnapshot:u}}),_=c[0].inst,p=c[1];return n(function(){_.value=d,_.getSnapshot=u,a(_)&&p({inst:_})},[l,d,u]),o(function(){return a(_)&&p({inst:_}),l(function(){a(_)&&p({inst:_})})},[l]),i(d),d};return Oe.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:s,Oe}()),Vt.exports}var Un=(Pt||(Pt=1,Nt.exports=function(){if(Ot)return Ue;Ot=1;var e=Hr,t=Tn(),r=typeof Object.is=="function"?Object.is:function(l,u){return l===u&&(l!==0||1/l==1/u)||l!=l&&u!=u},o=t.useSyncExternalStore,n=e.useRef,i=e.useEffect,a=e.useMemo,s=e.useDebugValue;return Ue.useSyncExternalStoreWithSelector=function(l,u,d,c,_){var p=n(null);if(p.current===null){var h={hasValue:!1,value:null};p.current=h}else h=p.current;p=a(function(){function g(b){if(!k){if(k=!0,x=b,b=c(b),_!==void 0&&h.hasValue){var v=h.value;if(_(v,b))return f=v}return f=b}if(v=f,r(x,b))return v;var y=c(b);return _!==void 0&&_(v,y)?v:(x=b,f=y)}var x,f,k=!1,w=d===void 0?null:d;return[function(){return g(u())},w===null?void 0:function(){return g(w())}]},[u,d,c,_]);var m=o(l,p[0],p[1]);return i(function(){h.hasValue=!0,h.value=m},[m]),s(m),m},Ue}()),Nt.exports);const On=Ln(Un),{useSyncExternalStoreWithSelector:Pn}=On,qt=e=>{const t=typeof e=="function"?(o=>o?Lt(o):Lt)(e):e,r=(o,n)=>function(i,a=i.getState,s){const l=Pn(i.subscribe,i.getState,i.getServerState||i.getState,a,s);return ot(l),l}(t,o,n);return Object.assign(r,t),r},Fr=e=>e?qt(e):qt;var Dr=(e=>(e.RIGHT="right",e.LEFT="left",e))(Dr||{});const Pe=e=>e!=null&&typeof e=="object"&&typeof Reflect.get(e,"taskStatus")=="string",Mt=e=>e!=null&&typeof e=="object"&&!Array.isArray(e)&&Object.values(e).every(t=>t===null||typeof t=="string"),Ht=e=>e!=null&&typeof e=="object"&&!Array.isArray(e)&&Object.values(e).every(t=>t===null||typeof t=="number"),Ft=e=>Array.isArray(e)&&e.every(t=>Array.isArray(t)&&t.every(r=>{if(typeof r!="object"||r===null)return!1;const o=Reflect.get(r,"selected");return o==="left"||o==="right"||o===null})),Ze=(e,t)=>{const{allowUndefined:r=!0,rejectBooleanRecord:o=!1}=t??{};if(e===void 0)return r;if(e===null||typeof e=="string"||typeof e=="number"||Array.isArray(e))return!0;if(typeof e=="object"&&e!==null){if(o){const n=Object.values(e);if(n.length>0&&n.every(i=>typeof i=="boolean"))return!1}return!0}return!1},Ge=(e,t)=>{var r;if(t===null)return null;if(e.type==="texturlprompt")return(o=>o===void 0||typeof o=="object"&&o!==null&&"skipped"in o)(t)?t:void 0;if(t===void 0)return null;if(e.type==="consentlegal")return typeof t=="object"&&"submitted"in t&&t.submitted===!0?t:null;if(e.type==="multipleselect"){const o=(r=e.props)==null?void 0:r.options;if(Array.isArray(o)&&(n=>typeof n=="object"&&n!==null&&!Array.isArray(n)&&Object.values(n).every(i=>typeof i=="boolean"))(t)){const n=t;return o.reduce((i,a)=>(n[String(a.id)]&&i.push(a.value),i),[])}}if(e.type==="multiplechoice"){if(typeof t=="object"&&t!==null&&!Array.isArray(t)){if(Object.keys(t).length===0)return null;const o=Object.values(t).find(n=>n!==!1&&n!==void 0);if(o!==void 0)return o}return Ze(t,{allowUndefined:!1,rejectBooleanRecord:!0})?t:null}return Ze(t,{allowUndefined:!1,rejectBooleanRecord:!0})?t:null},Vn=/<piped-value\b([^>]*)>.*?<\/piped-value>/gis,Dt=["questionHtml","captionHtml","footerHtml","richTextBody"],Ke=e=>!!e.props&&typeof e.props=="object"&&"properties"in e.props,Ve=e=>!!e.props&&typeof e.props=="object"&&"options"in e.props&&Array.isArray(e.props.options),zt=e=>["string","number"].includes(typeof e),Bt=e=>e.length===0?"":e.length===1?e[0]:e.join(", "),qn=e=>{var r,o;const t=(n=>n!=null&&typeof n=="object"&&"value"in n)(e)?e.value:void 0;if(t!=null){if(e.type==="multipleselect"&&Ve(e)&&(n=>!!n&&typeof n=="object"&&!Array.isArray(n))(t)){const n=e.secondaryValue??null,i=e.props.options.filter(a=>t[String(a.id)]===!0).map(a=>{var s;return a.label+((s=n==null?void 0:n[String(a.id)])!=null&&s.userText?`: ${n[String(a.id)].userText}`:"")});return i.length?Bt(i):"No options selected"}if(e.type==="multiplechoice"&&typeof t=="object"&&t!==null){const n=Object.keys(t);if(n.length===0)return"No options selected";const i=e.secondaryValue??null,a=n[0];if(a){const s=e.props.options.find(l=>String(l.id)===a);return(s==null?void 0:s.label)+((r=i==null?void 0:i[a])!=null&&r.userText?`: ${(o=i==null?void 0:i[a])==null?void 0:o.userText}`:"")}}if(e.type==="matrix"&&Ve(e)&&(n=>{if(!Ke(n))return!1;const i=n.props.properties;return!!i&&typeof i=="object"&&"matrixColumn"in i})(e)){const n=e.props.options,i=e.props.properties.matrixColumn,a=[];for(const[s,l]of Object.entries(t)){const u=n.find(h=>String(h.id)===s),d=(u==null?void 0:u.label)??s,c=zt(l)?String(l):JSON.stringify(l),_=i.find(h=>h.value===c),p=(_==null?void 0:_.label)??c;a.push(`${d}: ${p}`)}return a.join("; ")}if(e.type==="rankorder"&&Ve(e)){const n=e.props.options.reduce((a,s)=>(a[String(s.id)]=s.label,a),{}),i=[];for(const[a,s]of Object.entries(t)){const l=n[a];l&&(i[s-1]=l)}return Bt(i)}if(zt(t)){const n=String(t).replaceAll(/[\u200B-\u200D\uFEFF]/g,"").trim();return n===""?void 0:n}try{return JSON.stringify(t)}catch{return String(t)}}},$t=(e,t)=>{const r=new RegExp(`${t}="([^"]*)"`,"i").exec(e);return(r==null?void 0:r[1])??null},Mn=(e,t)=>{if(e==null)return e;let r=!1;const o=e.replace(Vn,(n,i)=>{r=!0;const a=$t(i,"answer-id"),s=$t(i,"fallback-text")??"";if(!a)return s;const l=a.startsWith("attr-")?a:Number(a);if(Object.hasOwn(t,l)){const u=t[l];return String(u)}return s});return r?o:e},Je=(e,t)=>{const r={};if(t)for(const[o,n]of Object.entries(t))typeof n=="string"?r[`attr-${o}`]=n:n!=null&&(r[`attr-${o}`]=JSON.stringify(n));for(const o of e){const n=qn(o);n!==void 0&&(r[o.name]=n)}return r},Hn=(e,t,r)=>{switch(t){case"videovoice":return!!(e!=null&&e.value);case"open":return!!r;case"multipleselect":return!!(r&&Object.keys(r).length);case"recordedtask":return r!==null&&typeof r=="object"&&"taskStatus"in r&&r.taskStatus==="completed";case"texturlprompt":return!e.value;case"consentlegal":case"nps":case"likert":return r!==null;case"multiplechoice":return r!==void 0;case"matrix":return!!(r&&Object.values(r).every(o=>o!==null));default:return!0}},zr=(e,t)=>{if(t==="matrix"&&e&&typeof e=="object"){const r=Object.keys(e).length,o=Object.values(e).filter(n=>n!==null).length;return o>0&&o<r}return!1},Ae=e=>e==null?"":typeof e=="object"?JSON.stringify(e):typeof e=="string"?e:String(e),ne={eq:(e,t)=>Number(e)===Number(t),neq:(e,t)=>!ne.eq(e,t),gt:(e,t)=>Number(e)>Number(t),gte:(e,t)=>Number(e)>=Number(t),lt:(e,t)=>Number(e)<Number(t),lte:(e,t)=>Number(e)<=Number(t),list_exact(e,t){if(!Array.isArray(e)||!Array.isArray(t))return!1;const r=(o,n)=>String(o).localeCompare(String(n));return e.slice().sort(r).join(",")===t.slice().sort(r).join(",")},list_all:(e,t)=>!(!Array.isArray(e)||!Array.isArray(t))&&!t.some(r=>!e.includes(r)),list_alo(e,t){if(!Array.isArray(t))return!1;const r=Array.isArray(e)?e:[e],o=new Set(r);return t.some(n=>o.has(n))},list_dni(e,t){if(!Array.isArray(t))return!1;const r=Array.isArray(e)?e:[e],o=new Set(r);return t.every(n=>!o.has(n))},contains(e,t){const r=Ae(e).toLowerCase(),o=Ae(t).toLowerCase();return r.includes(o)},notcontains:(e,t)=>!ne.contains(e,t)},me={eq:(e,t)=>e==t,neq:(e,t)=>!me.eq(e,t),gt:(e,t)=>Number(e)>Number(t),gte:(e,t)=>Number(e)>=Number(t),lt:(e,t)=>Number(e)<Number(t),lte:(e,t)=>Number(e)<=Number(t),list_exact(e,t){if(!Array.isArray(e)||!Array.isArray(t))return!1;const r=(o,n)=>String(o).localeCompare(String(n));return e.slice().sort(r).join(",")===t.slice().sort(r).join(",")},list_all:(e,t)=>!(!Array.isArray(e)||!Array.isArray(t))&&!t.some(r=>!e.includes(r)),list_alo(e,t){if(!Array.isArray(t))return!1;const r=Array.isArray(e)?e:[e],o=new Set(r);return t.some(n=>o.has(n))},list_dni(e,t){if(!Array.isArray(t))return!1;const r=Array.isArray(e)?e:[e],o=new Set(r);return t.every(n=>!o.has(n))},contains(e,t){const r=String(e??"").toLowerCase(),o=String(t??"").toLowerCase();return r.includes(o)},notcontains:(e,t)=>!me.contains(e,t)},Fn=e=>e in me,Br=1,Dn=2,zn=e=>{var o,n,i;switch(e.type){case"multipleselect":return e&&e.props&&e.props.options?e.props.options.length>13?e.props.options.map(a=>[a.value]):(t=e.props.options.map(a=>a.value),r=!e.props.properties.required,t.reduce((a,s)=>a.concat(a.map(l=>[...l,s])),[[]]).filter(a=>r||a.length>0)):null;case"multiplechoice":{if(!e||!e.props||!e.props.options)return null;const a=e.props.options.map(s=>s.value);return e.props.properties.required||a.push(void 0),a}case"matrix":{if(!((o=e==null?void 0:e.props)!=null&&o.options))return null;const a=e.props.properties.matrixColumn,s=e.props.options,l=s.reduce((d,c)=>(d[c.id]=null,d),{}),u=[{...l,[s[0].id]:a[0].value},s.reduce((d,c)=>(d[c.id]=a[0].value,d),{})];return e.props.properties.required||u.push(l),u}case"likert":{const a=Number((i=(n=e.props)==null?void 0:n.properties)==null?void 0:i.range)||5;return[...Array.from(new Array(a).keys()).map(l=>l+1),...e.props.properties.required?[]:[null]]}case"nps":return[0,1,2,3,4,5,6,7,8,9,10,...e.props.properties.required?[]:[null]];case"videovoice":case"open":return["1",...e.props.properties.required?[]:[""]];case"recordedtask":{const a=[{taskStatus:"completed"},{taskStatus:"given.up"}];return e.props.properties.required||a.push({taskStatus:"abandoned"}),a}case"texturlprompt":return[void 0,...e.props.properties.required?[]:[{skipped:!0}]];case"consentlegal":return[1,...e.props.properties.required?[]:[null]];default:return[1]}var t,r},Bn=e=>typeof e=="object"&&e!==null&&"taskStatus"in e,$n=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)&&"comparator"in e&&"questionIndex"in e,$r=(e,t)=>{const r=[];for(const o of e)Array.isArray(o)?r.push(...$r(o,t)):$n(o)&&o.questionIndex===t&&r.push(o);return r},Qn=(e,t=[])=>t.reduce((r,o)=>{const{group:n,target:i}=o;if(!(n!=null&&n.length))return[...r];const a=$r(n,e).map(s=>{const{comparator:l,value:u}=s;return{comparator:l,target:i,value:u}});return[...r,...a]},[]),Qr=(e,t,r)=>r>0?t?e.length-3:e.length-2:t?e.length-2:e.length-1,Wr=({cards:e,index:t,hasEndCard:r,allResponses:o,uploadProgress:n={},surveyVisitorAttributes:i={}})=>{var c,_,p;if(t>=e.length||t<0)return null;const a=e[t];let s=t+1;const l=a.props.routingOptions||[];for(const h of l){if(!Zr(h))continue;const{group:m,target:g}=h;if(Jr({group:m,allResponses:o,cards:e,surveyVisitorAttributes:i})){s=g===-1&&r?e.length-1:g;break}}const u=e.findIndex(h=>h.type==="uploading"),d=Qr(e,r,u);for(;s!==null&&s!==-1&&s<=d&&((_=(c=e[s])==null?void 0:c.props)!=null&&_.displayLogic)&&e[s].props.displayLogic.length>0;){const h=e[s].props.displayLogic||[];if(ut({displayLogic:h,allResponses:o,cards:e,surveyVisitorAttributes:i}))break;s++}if(s!==-1&&((p=e==null?void 0:e[s])!=null&&p.parentId)){const h=e.findIndex(m=>{var g;return m.name===((g=e==null?void 0:e[s])==null?void 0:g.parentId)});if(h>-1){const m=e[h],g=o[h],x=_e({comparator:"answered",type:m.type,response:g}),f=m.type==="matrix"&&_e({comparator:"partial",type:m.type,response:g});x||f||s++}}return t>=d||s===-1||s!==null&&s>d?u>0&&Object.values(n).some(m=>m.isSubmitted&&!m.isComplete)?u:r?e.length-1:null:s===-1?null:s},Zr=e=>typeof e=="object"&&e!==null&&"group"in e,Gr=e=>e===Br||e===Dn,Qt=({segment:e,allResponses:t,cards:r,surveyVisitorAttributes:o})=>Array.isArray(e)?Kr({segments:e,allResponses:t,cards:r,surveyVisitorAttributes:o}):!Gr(e)&&!!(n=>typeof n=="object"&&n!==null&&!Array.isArray(n)&&"comparator"in n)(e)&&(({rule:n,allResponses:i,cards:a,surveyVisitorAttributes:s})=>{if(n.questionIndex===void 0||typeof n.questionIndex=="number"&&n.questionIndex>=i.length)return!1;const l=(({rule:u,allResponses:d,cards:c,surveyVisitorAttributes:_})=>{if(u.questionIndex===void 0)return null;if(typeof(p=u.questionIndex)=="string"&&p.startsWith("attr-")){const m=(g=>g.slice(5))(u.questionIndex);return m in _?{response:_[m],type:"AttributeCheck"}:null}var p;const h=u.questionIndex;return{response:d[h],type:c[h].type}})({rule:n,allResponses:i,cards:a,surveyVisitorAttributes:s});return l!==null&&!!_e({comparator:n.comparator,response:l.response,type:l.type,value:n.value})})({rule:e,allResponses:t,cards:r,surveyVisitorAttributes:o}),Kr=({segments:e,allResponses:t,cards:r,surveyVisitorAttributes:o})=>{if(!e||e.length===0)return!1;let n=Qt({segment:e[0],allResponses:t,cards:r,surveyVisitorAttributes:o}),i=1;for(;i<e.length;){const a=e[i];if(!Gr(a)||(i+=1,i>=e.length))return!1;const s=Qt({segment:e[i],allResponses:t,cards:r,surveyVisitorAttributes:o});i+=1,n=a===Br?n&&s:n||s}return n},ut=({displayLogic:e,allResponses:t,cards:r,surveyVisitorAttributes:o})=>e.some(n=>!!Zr(n)&&Jr({group:n.group,allResponses:t,cards:r,surveyVisitorAttributes:o})),Jr=({group:e,allResponses:t,cards:r,surveyVisitorAttributes:o})=>Kr({segments:e,allResponses:t,cards:r,surveyVisitorAttributes:o}),_e=({comparator:e,response:t,type:r,value:o})=>{if(r==="AttributeCheck")return((i,a,s)=>{const l=Ae(a),u=Ae(s),d=Number(a),c=Number(s),_=!Number.isNaN(d)&&l===String(d),p=!Number.isNaN(c)&&u===String(c),h=_&&p;switch(i){case"eq":return h?d===c:l.toLowerCase()===u.toLowerCase();case"neq":return h?d!==c:l.toLowerCase()!==u.toLowerCase();case"contains":case"notcontains":return ne[i](l,u);case"gt":case"gte":case"lt":case"lte":return h?ne[i](d,c):ne[i](l.localeCompare(u),0);case"list_exact":case"list_all":case"list_alo":case"list_dni":{const m=Array.isArray(a)?a:[a],g=Array.isArray(s)?s:[s];return ne[i](m,g)}default:return!1}})(e,t,o);if(!Ze(t))return!1;const n=t;if(e==="answered")switch(r){case"texturlprompt":return n===void 0;case"consentlegal":return n&&(i=>i===null||i!==void 0&&typeof i=="object"&&"submitted"in i&&typeof i.submitted=="boolean")(n)&&n.submitted===!0;case"recordedtask":return Pe(n)&&n.taskStatus==="completed";case"likert":case"nps":return Number.isInteger(n);case"rankorder":return Ht(n)&&Object.values(n).every(i=>i!==null);case"matrix":return Mt(n)&&Object.values(n).every(i=>i!==null);case"maxdiff":return Ft(n)&&n.every(i=>{if(!Array.isArray(i))return!1;const a=i.some(l=>l.selected==="left"),s=i.some(l=>l.selected==="right");return a&&s});case"multiplechoice":return!!n;case"multipleselect":return n&&Array.isArray(n)&&(n.length??0)>0;case"open":case"aidynamicstandalone":return typeof n=="string"&&!!n;case"videovoice":return(i=>i!=null&&typeof i=="object"&&"mediaRecordingUid"in i&&typeof i.mediaRecordingUid=="string")(n)&&!!n.mediaRecordingUid;default:return!1}if(e==="given_up")return r!=="recordedtask"||Pe(n)&&n.taskStatus==="given.up";if(e==="partial")return zr(n,r);if(e==="skipped")switch(r){case"texturlprompt":return(i=>i!==null&&(i===void 0||typeof i=="object"))(n)&&!!(typeof n=="object"&&n!==null&&"skipped"in n&&n.skipped);case"consentlegal":case"likert":case"nps":case"videovoice":return n===null;case"recordedtask":return Pe(n)&&n.taskStatus==="abandoned";case"open":case"aidynamicstandalone":return n===null||typeof n=="string"&&n.length===0;case"multiplechoice":return n==null;case"multipleselect":return n===null||Array.isArray(n)&&n.length===0;case"matrix":return n===null||Mt(n)&&Object.values(n).every(i=>i===null);case"maxdiff":return n===null||!Ft(n)||n.some(i=>{if(!Array.isArray(i))return!0;const a=i.some(l=>l.selected==="left"),s=i.some(l=>l.selected==="right");return!(a&&s)});case"rankorder":return n===null||Ht(n)&&Object.values(n).includes(null);default:return!1}return o!==void 0&&me[e](n,o)};var Yr=(e=>(e.CONTINUE="CONTINUE",e.EXTERNAL="EXTERNAL",e.NO_BUTTON="NO_BUTTON",e))(Yr||{}),Z=(e=>(e.failure="failure",e.success="success",e.inFlight="inFlight",e))(Z||{}),Xr=(e=>(e.Unlimited="Unlimited",e.Maximum="Maximum",e.Range="Range",e))(Xr||{});const Wn=e=>{var t,r,o,n,i,a,s,l,u;switch(e.type){case"rankorder":case"multipleselect":case"multiplechoice":return(r=(t=e==null?void 0:e.props)==null?void 0:t.options)==null?void 0:r.map(d=>d.label);case"nps":return"1-10";case"likert":return`1-${((n=(o=e==null?void 0:e.props)==null?void 0:o.properties)==null?void 0:n.range)??5}`;case"matrix":return{matrixColumns:(s=(a=(i=e==null?void 0:e.props)==null?void 0:i.properties)==null?void 0:a.matrixColumn)==null?void 0:s.map(d=>d.label),matrixRows:(u=(l=e==null?void 0:e.props)==null?void 0:l.options)==null?void 0:u.map(d=>d.label)};default:return}},Zn=new Set(["rankorder","multipleselect","multiplechoice","matrix","likert","nps","open","aidynamicfollowup","aidynamicstandalone"]),Wt=({cards:e,combinedReadableRawResponses:t,targetQuestionId:r,generateQuestionType:o})=>{let n=1,i=1;const a=e.reduce((s,l)=>{if(l.name>0&&Zn.has(l.type)){if(r===l.name&&(i=n,o==="aidynamicstandalone"))return n++,s;if((l.type==="aidynamicfollowup"||l.type==="aidynamicstandalone")&&l.props.loading!==Z.success)return s;const u="properties"in l.props&&l.props.properties&&"captionText"in l.props.properties?l.props.properties.captionText:void 0,d=(c=>c.type!=="uploading"&&c.type!=="thanks")(l)?{order:n++,question:l.props.message,questionDescription:u,questionType:l.type,response:t==null?void 0:t[l.name],options:Wn(l)}:{order:n++,questionType:l.type,response:t==null?void 0:t[l.name]};s.push(d)}return s},[]);return{targetQuestionOrder:i,questionsResponses:a}},Zt=e=>{var t;return"props"in e&&"loading"in e.props&&((t=e==null?void 0:e.props)==null?void 0:t.loading)!==void 0},qe=(e,t,r)=>{let o=!1;const n=e.map(i=>i&&i.parentId===t?(o=!0,r(i)):i);return o?n:e},Me=(e,t,r)=>{let o=!1;const n=e.map(i=>i&&i.name===t?(o=!0,r(i)):i);return o?n:e},Gt=e=>{const{props:t}=e;return t&&"message"in t&&"properties"in t?{...e,props:{...t,loading:Z.inFlight}}:e},Kt=({isPreview:e,apiURL:t,envId:r,userId:o,headers:n})=>e?{url:`${t}/sdk/1/environments/${r}/dynamic-question-preview`,visitorIdHeader:"0"}:{url:`${t}/sdk/1/environments/${r}/visitors/${o}/dynamic-question`,visitorIdHeader:n["x-ul-visitor-id"]},He=new Set(["thanks","uploading"]),z=Fr()((e,t)=>({addResponseGroupMeta:void 0,allResponses:[],allResponsesRaw:{},answers:void 0,apiURL:"",avatars:{agentAvatar:{"1x":"","2x":""},respondentAvatar:{"1x":"","2x":""}},border:"#000000",cards:[],cardIndexByName:{},close:async(r=I.APP_ID)=>{const o=t(),{fadeout:n,remove:i,trackHistory:a,studyType:s}=o;await n(r),Fe(o)||a({event:"closed"}),I.breadcrumbsLogger.info("SurveyClosing",{surveyId:o.surveyId}),I.ConflictingWidgets.enable(),i({initiator:I.DismissReason.Closed,studyType:s})},configureExitOnOverlayClick:()=>{},customMetadata:{},destroy:async r=>{const{eventEmitFn:o,fadeout:n,remove:i,studyType:a,surveyId:s}=t();o("survey.complete",s),await n(r),I.ConflictingWidgets.enable(),i({initiator:I.DismissReason.Complete,studyType:a})},enableCspTrustedTypes:!1,endCard:{headline:""},envId:"",eventEmitFn:I.eventEmitter.emit.bind(I.eventEmitter),fadeout:async r=>{const{eventEmitFn:o,headers:n,viewDocument:i}=t();return I.shouldDirectEmbed(n)?Promise.resolve():(o(I.SprigEvent.SurveyFadingOut),new Promise(a=>{const 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:o,eventEmitFn:n,index:i}=t();n(r,{qid:o[i].name,props:o[i].props}),e(()=>({hasViewedEmbed:!0}))},handleUploadUpdate:({mediaRecordingUid:r,isComplete:o,progressPct:n,isSubmitted:i})=>{var p,h,m;const{cards:a,destroy:s,index:l,uploadProgress:u}=t(),d=o||((p=u[r])==null?void 0:p.isComplete),c={...u,[r]:{progressPct:d?100:n||((h=u[r])==null?void 0:h.progressPct),isComplete:d,isSubmitted:i||((m=u[r])==null?void 0:m.isSubmitted)}};if(e({uploadProgress:c}),a[l].type!=="uploading")return;const _=Object.entries(u).every(([g,x])=>!x.isSubmitted||x.isComplete||r==g&&o);if(_&&l>=a.length-1)return s(I.APP_ID);e({index:_?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,isConversationalUI:!1,isPreview:!1,layout:"default",marketingUrl:"https://sprig.com",meta:{ch:0,cw:0,l:"",mode:null,p:"",sh:0,sw:0},mode:void 0,next:r=>{const{allResponses:o,cards:n,eventEmitFn:i,index:a,responseGroupUid:s,submit:l,trackHistory:u,uploadProgress:d,viewedCardCount:c}=t(),_=Array.isArray(r.data)?r.data:[r.data],p=Date.now(),h=[...n],m={response:[],responseGroupUid:s,questionIndex:a};let g=null;const x=o.slice(0);let f=a;_.forEach((b,v)=>{const y=Math.floor(b.questionId),E=h.findIndex(L=>L.name===y),R=E>=0?h[E]:h[a+v],N={value:b.value,questionId:y,answeredAt:p,...b.secondaryValue!==void 0&&{secondaryValue:b.secondaryValue},...b.questionText!==void 0&&{questionText:b.questionText}},T=N.value;(L=>L&&!He.has(L.type))(R)&&(R.value=T,R.secondaryValue=N.secondaryValue||null),m.response.push(N);const U=E>=0?E:a+v;x[U]=Ge(R,T),U>f&&(f=U)}),g=Wr({cards:h,index:f,hasEndCard:!!r.endCard,uploadProgress:d,allResponses:x,surveyVisitorAttributes:t().surveyVisitorAttributes}),e({allResponses:x}),(g===null||He.has(h[g].type))&&(m.completedAt=p);const k=l(m);if(g===null)return void r.completeSurvey();g&&!He.has(h[g].type)&&k.finally(()=>{u({event:"seen",index:g})});const w=h[g];h[g]&&i&&i("survey.question",{qid:w.name,props:w.props}),e({cards:h,hasViewedEmbed:!1,index:g,viewedCardCount:c+1})},pendingRemoveIframeReason:null,previewKey:null,recorder:()=>{},recorderEventEmitter:I.eventEmitter,resolveTrackedPromise:()=>{const{removeIframeIfReady:r}=t();e(o=>({unresolvedRequestCount:o.unresolvedRequestCount-1})),r()},responseGroupUid:"",remove:({initiator:r,studyType:o})=>{const{eventEmitFn:n,removeIframeIfReady:i,surveyId:a}=t();e({pendingRemoveIframeReason:r,studyType:o}),n(I.SprigEvent.SurveyCloseRequested,{name:I.SprigEvent.SurveyCloseRequested,initiator:r,studyType:o,"survey.id":a}),i()},removeIframeIfReady:()=>{const{eventEmitFn:r,pendingRemoveIframeReason:o,unresolvedRequestCount:n,studyType:i,surveyId:a}=t();o&&n===0&&(r(I.SprigEvent.SurveyWillClose,{name:I.SprigEvent.SurveyWillClose,initiator:o,studyType:i,"survey.id":a}),e({pendingRemoveIframeReason:null,studyType:i}))},seen:async()=>{const{trackHistory:r}=t();return r({event:"seen",isNew:!0})},createDynamicStandaloneQuestion:async({questionId:r})=>{var _,p,h;let o=!1;if(e(m=>{const g=m.cards.find(x=>(x==null?void 0:x.name)===r);return!(g!=null&&g.name)||Zt(g)?m:(o=!0,{cards:Me(m.cards,r,Gt)})}),!o)return;const n=t(),{targetQuestionOrder:i,questionsResponses:a}=Wt({cards:n.cards,combinedReadableRawResponses:n.allResponsesRaw,targetQuestionId:r,generateQuestionType:"aidynamicstandalone"}),s={surveyId:n.surveyId,responseGroupUid:n.responseGroupUid,standaloneQuestionOrder:i,questionsResponses:a,standaloneQuestionId:r,customMetadata:n.customMetadata,meta:n.meta,previewKey:n.previewKey,isPreview:n.isPreview};let l=!1;const u=()=>{if(l)return;l=!0;const m=t(),g=m.cards.find(({name:x})=>x===r);if(e(x=>({cards:Me(x.cards,r,f=>{const{props:k}=f;return k&&"message"in k&&"properties"in k?{...f,value:"",props:{...k,loading:Z.failure,properties:{...k.properties,required:!1}}}:f})})),I.isLongFormSurvey(m.studyType)&&(g!=null&&g.groupId)){const x=m.cards.reduce((w,b)=>((b==null?void 0:b.groupId)===g.groupId&&w.push(b),w),[]),f=x.findIndex(w=>w.name===g.name),k=f+1;if(k<x.length){const w=x[k].name;m.setFocusedQuestionId(w)}else{const w=x[f-1].name;m.setFocusedQuestionId(w)}}else m.next({data:{value:"",questionId:g.name,type:g.type},completeSurvey:()=>m.destroy(I.APP_ID),endCard:m.endCard})},d=new AbortController,c=setTimeout(()=>{d.abort(),u();const m=new Error("Timeout reached—question skipped");n.trackPromise(te(n,"aidynamicstandalone",m))},3e3);try{const{url:m,visitorIdHeader:g}=Kt(n),x=await n.trackPromise(I.sprigFetch(m,{body:JSON.stringify(s),headers:{...n.headers,"x-ul-visitor-id":g},method:"POST",signal:d.signal}));if(!x.ok||!((h=(p=(_=x==null?void 0:x.json)==null?void 0:_.props)==null?void 0:p.message)!=null&&h.length))return u(),void await n.trackPromise(te(n,"dynamicQuestion",x.error));if(l)return;l=!0,e(f=>({cards:Me(f.cards,r,k=>{const w=k.props;return w&&"message"in w&&"properties"in w?{...k,props:{...w,loading:Z.success,message:x.json.props.message}}:k})}))}finally{clearTimeout(c)}},createDynamicFollowupQuestion:async({parentQuestionId:r,parentResponseConfig:o})=>{var m,g,x;let n=!1;e(f=>{const k=f.cards.find(w=>(w==null?void 0:w.parentId)===r);return!(k!=null&&k.name)||Zt(k)?f:(n=!0,{cards:qe(f.cards,r,Gt)})});const i=t(),a={...i.allResponsesRaw,...o||{}},{targetQuestionOrder:s,questionsResponses:l}=Wt({cards:i.cards,c