@inploi/plugin-chatbot 3.2.10 → 3.2.12
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/cdn/index.js +2 -2
- package/dist/chatbot.d.ts +7 -2
- package/dist/chatbot.utils.d.ts +8 -8
- package/dist/{index-08db93e2.cjs → index-141dd913.cjs} +12 -3
- package/dist/{index-17b40695.js → index-fd87b398.js} +12 -3
- package/dist/{job-application-content-cccdb8b6.js → job-application-content-4b948a26.js} +1 -13
- package/dist/{job-application-content-105f0dc9.cjs → job-application-content-e64a96de.cjs} +1 -13
- package/dist/plugin-chatbot.cjs +1 -1
- package/dist/plugin-chatbot.js +1 -1
- package/package.json +3 -3
package/cdn/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var $y=Object.defineProperty;var Sy=(Pt,Fe,Et)=>Fe in Pt?$y(Pt,Fe,{enumerable:!0,configurable:!0,writable:!0,value:Et}):Pt[Fe]=Et;var nf=(Pt,Fe,Et)=>(Sy(Pt,typeof Fe!="symbol"?Fe+"":Fe,Et),Et);(function(){"use strict";var Pt=e=>{throw new Error(`Unhandled discriminated union member: ${JSON.stringify(e)}`)};function Fe(e,t){if(!e)throw new Error(t)}var Et=e=>e,Cn,V,Gs,Zs,Vt,Js,Qs,Ro,ea,Qt={},ta=[],rf=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,hr=Array.isArray;function Je(e,t){for(var n in t)e[n]=t[n];return e}function na(e){var t=e.parentNode;t&&t.removeChild(e)}function N(e,t,n){var r,o,i,s={};for(i in t)i=="key"?r=t[i]:i=="ref"?o=t[i]:s[i]=t[i];if(arguments.length>2&&(s.children=arguments.length>3?Cn.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)s[i]===void 0&&(s[i]=e.defaultProps[i]);return An(e,s,r,o,null)}function An(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:o??++Gs};return o==null&&V.vnode!=null&&V.vnode(i),i}function ra(){return{current:null}}function ue(e){return e.children}function Pe(e,t){this.props=e,this.context=t}function pr(e,t){if(t==null)return e.__?pr(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?pr(e):null}function oa(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return oa(e)}}function No(e){(!e.__d&&(e.__d=!0)&&Vt.push(e)&&!mr.__r++||Js!==V.debounceRendering)&&((Js=V.debounceRendering)||Qs)(mr)}function mr(){var e,t,n,r,o,i,s,a,c;for(Vt.sort(Ro);e=Vt.shift();)e.__d&&(t=Vt.length,r=void 0,o=void 0,i=void 0,a=(s=(n=e).__v).__e,(c=n.__P)&&(r=[],o=[],(i=Je({},s)).__v=s.__v+1,Fo(c,s,i,n.__n,c.ownerSVGElement!==void 0,s.__h!=null?[a]:null,r,a??pr(s),s.__h,o),da(r,s,o),s.__e!=a&&oa(s)),Vt.length>t&&Vt.sort(Ro));mr.__r=0}function ia(e,t,n,r,o,i,s,a,c,u,d){var l,f,h,p,m,y,x,g,_,M,S=0,F=r&&r.__k||ta,R=F.length,C=R,E=t.length;for(n.__k=[],l=0;l<E;l++)(p=n.__k[l]=(p=t[l])==null||typeof p=="boolean"||typeof p=="function"?null:typeof p=="string"||typeof p=="number"||typeof p=="bigint"?An(null,p,null,null,p):hr(p)?An(ue,{children:p},null,null,null):p.__b>0?An(p.type,p.props,p.key,p.ref?p.ref:null,p.__v):p)!=null&&(p.__=n,p.__b=n.__b+1,(g=of(p,F,x=l+S,C))===-1?h=Qt:(h=F[g]||Qt,F[g]=void 0,C--),Fo(e,p,h,o,i,s,a,c,u,d),m=p.__e,(f=p.ref)&&h.ref!=f&&(h.ref&&Do(h.ref,null,p),d.push(f,p.__c||m,p)),m!=null&&(y==null&&(y=m),M=!(_=h===Qt||h.__v===null)&&g===x,_?g==-1&&S--:g!==x&&(g===x+1?(S++,M=!0):g>x?C>E-x?(S+=g-x,M=!0):S--:S=g<x&&g==x-1?g-x:0),x=l+S,M=M||g==l&&!_,typeof p.type!="function"||g===x&&h.__k!==p.__k?typeof p.type=="function"||M?p.__d!==void 0?(c=p.__d,p.__d=void 0):c=m.nextSibling:c=aa(e,m,c):c=sa(p,c,e),typeof n.type=="function"&&(n.__d=c)));for(n.__e=y,l=R;l--;)F[l]!=null&&(typeof n.type=="function"&&F[l].__e!=null&&F[l].__e==n.__d&&(n.__d=F[l].__e.nextSibling),fa(F[l],F[l]))}function sa(e,t,n){for(var r,o=e.__k,i=0;o&&i<o.length;i++)(r=o[i])&&(r.__=e,t=typeof r.type=="function"?sa(r,t,n):aa(n,r.__e,t));return t}function Qe(e,t){return t=t||[],e==null||typeof e=="boolean"||(hr(e)?e.some(function(n){Qe(n,t)}):t.push(e)),t}function aa(e,t,n){return n==null||n.parentNode!==e?e.insertBefore(t,null):t==n&&t.parentNode!=null||e.insertBefore(t,n),t.nextSibling}function of(e,t,n,r){var o=e.key,i=e.type,s=n-1,a=n+1,c=t[n];if(c===null||c&&o==c.key&&i===c.type)return n;if(r>(c!=null?1:0))for(;s>=0||a<t.length;){if(s>=0){if((c=t[s])&&o==c.key&&i===c.type)return s;s--}if(a<t.length){if((c=t[a])&&o==c.key&&i===c.type)return a;a++}}return-1}function sf(e,t,n,r,o){var i;for(i in n)i==="children"||i==="key"||i in t||vr(e,i,null,n[i],r);for(i in t)o&&typeof t[i]!="function"||i==="children"||i==="key"||i==="value"||i==="checked"||n[i]===t[i]||vr(e,i,t[i],n[i],r)}function ca(e,t,n){t[0]==="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||rf.test(t)?n:n+"px"}function vr(e,t,n,r,o){var i;e:if(t==="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||ca(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||ca(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")i=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r||e.addEventListener(t,i?ua:la,i):e.removeEventListener(t,i?ua:la,i);else if(t!=="dangerouslySetInnerHTML"){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 in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,n))}}function la(e){return this.l[e.type+!1](V.event?V.event(e):e)}function ua(e){return this.l[e.type+!0](V.event?V.event(e):e)}function Fo(e,t,n,r,o,i,s,a,c,u){var d,l,f,h,p,m,y,x,g,_,M,S,F,R,C,E=t.type;if(t.constructor!==void 0)return null;n.__h!=null&&(c=n.__h,a=t.__e=n.__e,t.__h=null,i=[a]),(d=V.__b)&&d(t);try{e:if(typeof E=="function"){if(x=t.props,g=(d=E.contextType)&&r[d.__c],_=d?g?g.props.value:d.__:r,n.__c?y=(l=t.__c=n.__c).__=l.__E:("prototype"in E&&E.prototype.render?t.__c=l=new E(x,_):(t.__c=l=new Pe(x,_),l.constructor=E,l.render=cf),g&&g.sub(l),l.props=x,l.state||(l.state={}),l.context=_,l.__n=r,f=l.__d=!0,l.__h=[],l._sb=[]),l.__s==null&&(l.__s=l.state),E.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=Je({},l.__s)),Je(l.__s,E.getDerivedStateFromProps(x,l.__s))),h=l.props,p=l.state,l.__v=t,f)E.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(E.getDerivedStateFromProps==null&&x!==h&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(x,_),!l.__e&&(l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(x,l.__s,_)===!1||t.__v===n.__v)){for(t.__v!==n.__v&&(l.props=x,l.state=l.__s,l.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(q){q&&(q.__=t)}),M=0;M<l._sb.length;M++)l.__h.push(l._sb[M]);l._sb=[],l.__h.length&&s.push(l);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(x,l.__s,_),l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(h,p,m)})}if(l.context=_,l.props=x,l.__P=e,l.__e=!1,S=V.__r,F=0,"prototype"in E&&E.prototype.render){for(l.state=l.__s,l.__d=!1,S&&S(t),d=l.render(l.props,l.state,l.context),R=0;R<l._sb.length;R++)l.__h.push(l._sb[R]);l._sb=[]}else do l.__d=!1,S&&S(t),d=l.render(l.props,l.state,l.context),l.state=l.__s;while(l.__d&&++F<25);l.state=l.__s,l.getChildContext!=null&&(r=Je(Je({},r),l.getChildContext())),f||l.getSnapshotBeforeUpdate==null||(m=l.getSnapshotBeforeUpdate(h,p)),ia(e,hr(C=d!=null&&d.type===ue&&d.key==null?d.props.children:d)?C:[C],t,n,r,o,i,s,a,c,u),l.base=t.__e,t.__h=null,l.__h.length&&s.push(l),y&&(l.__E=l.__=null)}else i==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=af(n.__e,t,n,r,o,i,s,c,u);(d=V.diffed)&&d(t)}catch(q){t.__v=null,(c||i!=null)&&(t.__e=a,t.__h=!!c,i[i.indexOf(a)]=null),V.__e(q,t,n)}}function da(e,t,n){for(var r=0;r<n.length;r++)Do(n[r],n[++r],n[++r]);V.__c&&V.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(i){i.call(o)})}catch(i){V.__e(i,o.__v)}})}function af(e,t,n,r,o,i,s,a,c){var u,d,l,f=n.props,h=t.props,p=t.type,m=0;if(p==="svg"&&(o=!0),i!=null){for(;m<i.length;m++)if((u=i[m])&&"setAttribute"in u==!!p&&(p?u.localName===p:u.nodeType===3)){e=u,i[m]=null;break}}if(e==null){if(p===null)return document.createTextNode(h);e=o?document.createElementNS("http://www.w3.org/2000/svg",p):document.createElement(p,h.is&&h),i=null,a=!1}if(p===null)f===h||a&&e.data===h||(e.data=h);else{if(i=i&&Cn.call(e.childNodes),d=(f=n.props||Qt).dangerouslySetInnerHTML,l=h.dangerouslySetInnerHTML,!a){if(i!=null)for(f={},m=0;m<e.attributes.length;m++)f[e.attributes[m].name]=e.attributes[m].value;(l||d)&&(l&&(d&&l.__html==d.__html||l.__html===e.innerHTML)||(e.innerHTML=l&&l.__html||""))}if(sf(e,h,f,o,a),l)t.__k=[];else if(ia(e,hr(m=t.props.children)?m:[m],t,n,r,o&&p!=="foreignObject",i,s,i?i[0]:n.__k&&pr(n,0),a,c),i!=null)for(m=i.length;m--;)i[m]!=null&&na(i[m]);a||("value"in h&&(m=h.value)!==void 0&&(m!==e.value||p==="progress"&&!m||p==="option"&&m!==f.value)&&vr(e,"value",m,f.value,!1),"checked"in h&&(m=h.checked)!==void 0&&m!==e.checked&&vr(e,"checked",m,f.checked,!1))}return e}function Do(e,t,n){try{typeof e=="function"?e(t):e.current=t}catch(r){V.__e(r,n)}}function fa(e,t,n){var r,o;if(V.unmount&&V.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||Do(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){V.__e(i,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&fa(r[o],t,n||typeof e.type!="function");n||e.__e==null||na(e.__e),e.__=e.__e=e.__d=void 0}function cf(e,t,n){return this.constructor(e,n)}function en(e,t,n){var r,o,i,s;V.__&&V.__(e,t),o=(r=typeof n=="function")?null:n&&n.__k||t.__k,i=[],s=[],Fo(t,e=(!r&&n||t).__k=N(ue,null,[e]),o||Qt,Qt,t.ownerSVGElement!==void 0,!r&&n?[n]:o?null:t.firstChild?Cn.call(t.childNodes):null,i,!r&&n?n:o?o.__e:t.firstChild,r,s),da(i,e,s)}function ha(e,t){en(e,t,ha)}function lf(e,t,n){var r,o,i,s,a=Je({},e.props);for(i in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)i=="key"?r=t[i]:i=="ref"?o=t[i]:a[i]=t[i]===void 0&&s!==void 0?s[i]:t[i];return arguments.length>2&&(a.children=arguments.length>3?Cn.call(arguments,2):n),An(e.type,a,r||e.key,o||e.ref,null)}function De(e,t){var n={__c:t="__cC"+ea++,__:e,Consumer:function(r,o){return r.children(o)},Provider:function(r){var o,i;return this.getChildContext||(o=[],(i={})[t]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(s){this.props.value!==s.value&&o.some(function(a){a.__e=!0,No(a)})},this.sub=function(s){o.push(s);var a=s.componentWillUnmount;s.componentWillUnmount=function(){o.splice(o.indexOf(s),1),a&&a.call(s)}}),r.children}};return n.Provider.__=n.Consumer.contextType=n}Cn=ta.slice,V={__e:function(e,t,n,r){for(var o,i,s;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&i.getDerivedStateFromError!=null&&(o.setState(i.getDerivedStateFromError(e)),s=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,r||{}),s=o.__d),s)return o.__E=o}catch(a){e=a}throw e}},Gs=0,Zs=function(e){return e!=null&&e.constructor===void 0},Pe.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Je({},this.state),typeof e=="function"&&(e=e(Je({},n),this.props)),e&&Je(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),No(this))},Pe.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),No(this))},Pe.prototype.render=ue,Vt=[],Qs=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ro=function(e,t){return e.__v.__b-t.__v.__b},mr.__r=0,ea=0;var et,J,Io,pa,tn=0,ma=[],gr=[],va=V.__b,ga=V.__r,ba=V.diffed,ya=V.__c,wa=V.unmount;function Ot(e,t){V.__h&&V.__h(J,e,tn||t),tn=0;var n=J.__H||(J.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:gr}),n.__[e]}function ae(e){return tn=1,br($a,e)}function br(e,t,n){var r=Ot(et++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):$a(void 0,t),function(a){var c=r.__N?r.__N[0]:r.__[0],u=r.t(c,a);c!==u&&(r.__N=[u,r.__[1]],r.__c.setState({}))}],r.__c=J,!J.u)){var o=function(a,c,u){if(!r.__c.__H)return!0;var d=r.__c.__H.__.filter(function(f){return f.__c});if(d.every(function(f){return!f.__N}))return!i||i.call(this,a,c,u);var l=!1;return d.forEach(function(f){if(f.__N){var h=f.__[0];f.__=f.__N,f.__N=void 0,h!==f.__[0]&&(l=!0)}}),!(!l&&r.__c.props===a)&&(!i||i.call(this,a,c,u))};J.u=!0;var i=J.shouldComponentUpdate,s=J.componentWillUpdate;J.componentWillUpdate=function(a,c,u){if(this.__e){var d=i;i=void 0,o(a,c,u),i=d}s&&s.call(this,a,c,u)},J.shouldComponentUpdate=o}return r.__N||r.__}function G(e,t){var n=Ot(et++,3);!V.__s&&Bo(n.__H,t)&&(n.__=e,n.i=t,J.__H.__h.push(n))}function Be(e,t){var n=Ot(et++,4);!V.__s&&Bo(n.__H,t)&&(n.__=e,n.i=t,J.__h.push(n))}function U(e){return tn=5,de(function(){return{current:e}},[])}function _a(e,t,n){tn=6,Be(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},n==null?n:n.concat(e))}function de(e,t){var n=Ot(et++,7);return Bo(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function me(e,t){return tn=8,de(function(){return e},t)}function we(e){var t=J.context[e.__c],n=Ot(et++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(J)),t.props.value):e.__}function xa(e,t){V.useDebugValue&&V.useDebugValue(t?t(e):e)}function uf(e){var t=Ot(et++,10),n=ae();return t.__=e,J.componentDidCatch||(J.componentDidCatch=function(r,o){t.__&&t.__(r,o),n[1](r)}),[n[0],function(){n[1](void 0)}]}function yr(){var e=Ot(et++,11);if(!e.__){for(var t=J.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function df(){for(var e;e=ma.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(wr),e.__H.__h.forEach(zo),e.__H.__h=[]}catch(t){e.__H.__h=[],V.__e(t,e.__v)}}V.__b=function(e){J=null,va&&va(e)},V.__r=function(e){ga&&ga(e),et=0;var t=(J=e.__c).__H;t&&(Io===J?(t.__h=[],J.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=gr,n.__N=n.i=void 0})):(t.__h.forEach(wr),t.__h.forEach(zo),t.__h=[],et=0)),Io=J},V.diffed=function(e){ba&&ba(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(ma.push(t)!==1&&pa===V.requestAnimationFrame||((pa=V.requestAnimationFrame)||ff)(df)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==gr&&(n.__=n.__V),n.i=void 0,n.__V=gr})),Io=J=null},V.__c=function(e,t){t.some(function(n){try{n.__h.forEach(wr),n.__h=n.__h.filter(function(r){return!r.__||zo(r)})}catch(r){t.some(function(o){o.__h&&(o.__h=[])}),t=[],V.__e(r,n.__v)}}),ya&&ya(e,t)},V.unmount=function(e){wa&&wa(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{wr(r)}catch(o){t=o}}),n.__H=void 0,t&&V.__e(t,n.__v))};var ka=typeof requestAnimationFrame=="function";function ff(e){var t,n=function(){clearTimeout(r),ka&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);ka&&(t=requestAnimationFrame(n))}function wr(e){var t=J,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),J=t}function zo(e){var t=J;e.__c=e.__(),J=t}function Bo(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function $a(e,t){return typeof t=="function"?t(e):t}function _r(){throw new Error("Cycle detected")}var hf=Symbol.for("preact-signals");function xr(){if(dt>1)dt--;else{for(var e,t=!1;Pn!==void 0;){var n=Pn;for(Pn=void 0,jo++;n!==void 0;){var r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&Ma(n))try{n.c()}catch(o){t||(e=o,t=!0)}n=r}}if(jo=0,dt--,t)throw e}}function pf(e){if(dt>0)return e();dt++;try{return e()}finally{xr()}}var oe=void 0,Pn=void 0,dt=0,jo=0,kr=0;function Sa(e){if(oe!==void 0){var t=e.n;if(t===void 0||t.t!==oe)return t={i:0,S:e,p:oe.s,n:void 0,t:oe,e:void 0,x:void 0,r:t},oe.s!==void 0&&(oe.s.n=t),oe.s=t,e.n=t,32&oe.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=oe.s,t.n=void 0,oe.s.n=t,oe.s=t),t}}function ve(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}ve.prototype.brand=hf,ve.prototype.h=function(){return!0},ve.prototype.S=function(e){this.t!==e&&e.e===void 0&&(e.x=this.t,this.t!==void 0&&(this.t.e=e),this.t=e)},ve.prototype.U=function(e){if(this.t!==void 0){var t=e.e,n=e.x;t!==void 0&&(t.x=n,e.e=void 0),n!==void 0&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n)}},ve.prototype.subscribe=function(e){var t=this;return Uo(function(){var n=t.value,r=32&this.f;this.f&=-33;try{e(n)}finally{this.f|=r}})},ve.prototype.valueOf=function(){return this.value},ve.prototype.toString=function(){return this.value+""},ve.prototype.toJSON=function(){return this.value},ve.prototype.peek=function(){return this.v},Object.defineProperty(ve.prototype,"value",{get:function(){var e=Sa(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(oe instanceof ft&&function(){throw new Error("Computed cannot have side-effects")}(),e!==this.v){jo>100&&_r(),this.v=e,this.i++,kr++,dt++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{xr()}}}});function En(e){return new ve(e)}function Ma(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function Ta(e){for(var t=e.s;t!==void 0;t=t.n){var n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function Ca(e){for(var t=e.s,n=void 0;t!==void 0;){var r=t.p;t.i===-1?(t.S.U(t),r!==void 0&&(r.n=t.n),t.n!==void 0&&(t.n.p=r)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=r}e.s=n}function ft(e){ve.call(this,void 0),this.x=e,this.s=void 0,this.g=kr-1,this.f=4}(ft.prototype=new ve).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===kr))return!0;if(this.g=kr,this.f|=1,this.i>0&&!Ma(this))return this.f&=-2,!0;var e=oe;try{Ta(this),oe=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(n){this.v=n,this.f|=16,this.i++}return oe=e,Ca(this),this.f&=-2,!0},ft.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}ve.prototype.S.call(this,e)},ft.prototype.U=function(e){if(this.t!==void 0&&(ve.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}},ft.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}},ft.prototype.peek=function(){if(this.h()||_r(),16&this.f)throw this.v;return this.v},Object.defineProperty(ft.prototype,"value",{get:function(){1&this.f&&_r();var e=Sa(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function mf(e){return new ft(e)}function Aa(e){var t=e.u;if(e.u=void 0,typeof t=="function"){dt++;var n=oe;oe=void 0;try{t()}catch(r){throw e.f&=-2,e.f|=8,Ho(e),r}finally{oe=n,xr()}}}function Ho(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Aa(e)}function vf(e){if(oe!==this)throw new Error("Out-of-order effect");Ca(this),oe=e,this.f&=-2,8&this.f&&Ho(this),xr()}function Vn(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}Vn.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.u=t)}finally{e()}},Vn.prototype.S=function(){1&this.f&&_r(),this.f|=1,this.f&=-9,Aa(this),Ta(this),dt++;var e=oe;return oe=this,vf.bind(this,e)},Vn.prototype.N=function(){2&this.f||(this.f|=2,this.o=Pn,Pn=this)},Vn.prototype.d=function(){this.f|=8,1&this.f||Ho(this)};function Uo(e){var t=new Vn(e);try{t.c()}catch(n){throw t.d(),n}return t.d.bind(t)}var Xo;function nn(e,t){V[e]=t.bind(null,V[e]||function(){})}function $r(e){Xo&&Xo(),Xo=e&&e.S()}function Pa(e){var t=this,n=e.data,r=bf(n);r.value=n;var o=de(function(){for(var i=t.__v;i=i.__;)if(i.__c){i.__c.__$f|=4;break}return t.__$u.c=function(){var s;!Zs(o.peek())&&((s=t.base)==null?void 0:s.nodeType)===3?t.base.data=o.peek():(t.__$f|=1,t.setState({}))},mf(function(){var s=r.value.value;return s===0?0:s===!0?"":s||""})},[]);return o.value}Pa.displayName="_st",Object.defineProperties(ve.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Pa},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),nn("__b",function(e,t){if(typeof t.type=="string"){var n,r=t.props;for(var o in r)if(o!=="children"){var i=r[o];i instanceof ve&&(n||(t.__np=n={}),n[o]=i,r[o]=i.peek())}}e(t)}),nn("__r",function(e,t){$r();var n,r=t.__c;r&&(r.__$f&=-2,(n=r.__$u)===void 0&&(r.__$u=n=function(o){var i;return Uo(function(){i=this}),i.c=function(){r.__$f|=1,r.setState({})},i}())),$r(n),e(t)}),nn("__e",function(e,t,n,r){$r(),e(t,n,r)}),nn("diffed",function(e,t){$r();var n;if(typeof t.type=="string"&&(n=t.__e)){var r=t.__np,o=t.props;if(r){var i=n.U;if(i)for(var s in i){var a=i[s];a!==void 0&&!(s in r)&&(a.d(),i[s]=void 0)}else n.U=i={};for(var c in r){var u=i[c],d=r[c];u===void 0?(u=gf(n,c,d,o),i[c]=u):u.o(d,o)}}}e(t)});function gf(e,t,n,r){var o=t in e&&e.ownerSVGElement===void 0,i=En(n);return{o:function(s,a){i.value=s,r=a},d:Uo(function(){var s=i.value.value;r[t]!==s&&(r[t]=s,o?e[t]=s:s?e.setAttribute(t,s):e.removeAttribute(t))})}}nn("unmount",function(e,t){if(typeof t.type=="string"){var n=t.__e;if(n){var r=n.U;if(r){n.U=void 0;for(var o in r){var i=r[o];i&&i.d()}}}}else{var s=t.__c;if(s){var a=s.__$u;a&&(s.__$u=void 0,a.d())}}e(t)}),nn("__h",function(e,t,n,r){(r<3||r===9)&&(t.__$f|=2),e(t,n,r)}),Pe.prototype.shouldComponentUpdate=function(e,t){var n=this.__$u;if(!(n&&n.s!==void 0||4&this.__$f)||3&this.__$f)return!0;for(var r in t)return!0;for(var o in e)if(o!=="__source"&&e[o]!==this.props[o])return!0;for(var i in this.props)if(!(i in e))return!0;return!1};function bf(e){return de(function(){return En(e)},[])}function Te(){return Te=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Te.apply(this,arguments)}function Ea(e,t){for(var n in t)e[n]=t[n];return e}function qo(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var r in t)if(r!=="__source"&&e[r]!==t[r])return!0;return!1}function Wo(e,t){return e===t&&(e!==0||1/e==1/t)||e!=e&&t!=t}function Sr(e){this.props=e}function Va(e,t){function n(o){var i=this.props.ref,s=i==o.ref;return!s&&i&&(i.call?i(null):i.current=null),t?!t(this.props,o)||!s:qo(this.props,o)}function r(o){return this.shouldComponentUpdate=n,N(e,o)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(Sr.prototype=new Pe).isPureReactComponent=!0,Sr.prototype.shouldComponentUpdate=function(e,t){return qo(this.props,e)||qo(this.state,t)};var Oa=V.__b;V.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Oa&&Oa(e)};var yf=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function _e(e){function t(n){var r=Ea({},n);return delete r.ref,e(r,n.ref||null)}return t.$$typeof=yf,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var La=function(e,t){return e==null?null:Qe(Qe(e).map(t))},je={map:La,forEach:La,count:function(e){return e?Qe(e).length:0},only:function(e){var t=Qe(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:Qe},wf=V.__e;V.__e=function(e,t,n,r){if(e.then){for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t)}wf(e,t,n,r)};var Ra=V.unmount;function Na(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),e.__c.__H=null),(e=Ea({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return Na(r,t,n)})),e}function Fa(e,t,n){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return Fa(r,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=n)),e}function rn(){this.__u=0,this.t=null,this.__b=null}function Da(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Ko(e){var t,n,r;function o(i){if(t||(t=e()).then(function(s){n=s.default||s},function(s){r=s}),r)throw r;if(!n)throw t;return N(n,i)}return o.displayName="Lazy",o.__f=!0,o}function on(){this.u=null,this.o=null}V.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&e.__h===!0&&(e.type=null),Ra&&Ra(e)},(rn.prototype=new Pe).__c=function(e,t){var n=t.__c,r=this;r.t==null&&(r.t=[]),r.t.push(n);var o=Da(r.__v),i=!1,s=function(){i||(i=!0,n.__R=null,o?o(a):a())};n.__R=s;var a=function(){if(!--r.__u){if(r.state.__a){var u=r.state.__a;r.__v.__k[0]=Fa(u,u.__c.__P,u.__c.__O)}var d;for(r.setState({__a:r.__b=null});d=r.t.pop();)d.forceUpdate()}},c=t.__h===!0;r.__u++||c||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(s,s)},rn.prototype.componentWillUnmount=function(){this.t=[]},rn.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=Na(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&N(ue,null,e.fallback);return o&&(o.__h=null),[N(ue,null,t.__a?null:e.children),o]};var Ia=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};function _f(e){return this.getChildContext=function(){return e.context},e.children}function xf(e){var t=this,n=e.i;t.componentWillUnmount=function(){en(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),e.__v?(t.l||(t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(r){this.childNodes.push(r),t.i.appendChild(r)},insertBefore:function(r,o){this.childNodes.push(r),t.i.appendChild(r)},removeChild:function(r){this.childNodes.splice(this.childNodes.indexOf(r)>>>1,1),t.i.removeChild(r)}}),en(N(_f,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function za(e,t){var n=N(xf,{__v:e,i:t});return n.containerInfo=t,n}(on.prototype=new Pe).__a=function(e){var t=this,n=Da(t.__v),r=t.o.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),Ia(t,e,r)):o()};n?n(i):i()}},on.prototype.render=function(e){this.u=null,this.o=new Map;var t=Qe(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},on.prototype.componentDidUpdate=on.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,n){Ia(e,n,t)})};var Ba=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,kf=/^(?: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]/,$f=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Sf=/[A-Z0-9]/g,Mf=typeof document<"u",Tf=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function ja(e,t,n){return t.__k==null&&(t.textContent=""),en(e,t),typeof n=="function"&&n(),e?e.__c:null}function Ha(e,t,n){return ha(e,t),typeof n=="function"&&n(),e?e.__c:null}Pe.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(Pe.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Ua=V.event;function Cf(){}function Af(){return this.cancelBubble}function Pf(){return this.defaultPrevented}V.event=function(e){return Ua&&(e=Ua(e)),e.persist=Cf,e.isPropagationStopped=Af,e.isDefaultPrevented=Pf,e.nativeEvent=e};var Yo,Ef={enumerable:!1,configurable:!0,get:function(){return this.class}},Xa=V.vnode;V.vnode=function(e){typeof e.type=="string"&&function(t){var n=t.props,r=t.type,o={};for(var i in n){var s=n[i];if(!(i==="value"&&"defaultValue"in n&&s==null||Mf&&i==="children"&&r==="noscript"||i==="class"||i==="className")){var a=i.toLowerCase();i==="defaultValue"&&"value"in n&&n.value==null?i="value":i==="download"&&s===!0?s="":a==="ondoubleclick"?i="ondblclick":a!=="onchange"||r!=="input"&&r!=="textarea"||Tf(n.type)?a==="onfocus"?i="onfocusin":a==="onblur"?i="onfocusout":$f.test(i)?i=a:r.indexOf("-")===-1&&kf.test(i)?i=i.replace(Sf,"-$&").toLowerCase():s===null&&(s=void 0):a=i="oninput",a==="oninput"&&o[i=a]&&(i="oninputCapture"),o[i]=s}}r=="select"&&o.multiple&&Array.isArray(o.value)&&(o.value=Qe(n.children).forEach(function(c){c.props.selected=o.value.indexOf(c.props.value)!=-1})),r=="select"&&o.defaultValue!=null&&(o.value=Qe(n.children).forEach(function(c){c.props.selected=o.multiple?o.defaultValue.indexOf(c.props.value)!=-1:o.defaultValue==c.props.value})),n.class&&!n.className?(o.class=n.class,Object.defineProperty(o,"className",Ef)):(n.className&&!n.class||n.class&&n.className)&&(o.class=o.className=n.className),t.props=o}(e),e.$$typeof=Ba,Xa&&Xa(e)};var qa=V.__r;V.__r=function(e){qa&&qa(e),Yo=e.__c};var Wa=V.diffed;V.diffed=function(e){Wa&&Wa(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value),Yo=null};var Ka={ReactCurrentDispatcher:{current:{readContext:function(e){return Yo.__n[e.__c].props.value}}}},Vf="17.0.2";function Ya(e){return N.bind(null,e)}function ht(e){return!!e&&e.$$typeof===Ba}function pt(e){return ht(e)?lf.apply(null,arguments):e}function Ga(e){return!!e.__k&&(en(null,e),!0)}function Za(e){return e&&(e.base||e.nodeType===1&&e)||null}var Ja=function(e,t){return e(t)},Mr=function(e,t){return e(t)},Qa=ue;function Go(e){e()}function ec(e){return e}function tc(){return[!1,Go]}var Tr=Be;function nc(e,t){var n=t(),r=ae({h:{__:n,v:t}}),o=r[0].h,i=r[1];return Be(function(){o.__=n,o.v=t,Wo(o.__,t())||i({h:o})},[e,n,t]),G(function(){return Wo(o.__,o.v())||i({h:o}),e(function(){Wo(o.__,o.v())||i({h:o})})},[e]),n}var Ie={useState:ae,useId:yr,useReducer:br,useEffect:G,useLayoutEffect:Be,useInsertionEffect:Tr,useTransition:tc,useDeferredValue:ec,useSyncExternalStore:nc,startTransition:Go,useRef:U,useImperativeHandle:_a,useMemo:de,useCallback:me,useContext:we,useDebugValue:xa,version:"17.0.2",Children:je,render:ja,hydrate:Ha,unmountComponentAtNode:Ga,createPortal:za,createElement:N,createContext:De,createFactory:Ya,cloneElement:pt,createRef:ra,Fragment:ue,isValidElement:ht,findDOMNode:Za,Component:Pe,PureComponent:Sr,memo:Va,forwardRef:_e,flushSync:Mr,unstable_batchedUpdates:Ja,StrictMode:Qa,Suspense:rn,SuspenseList:on,lazy:Ko,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Ka};const Of=Object.freeze(Object.defineProperty({__proto__:null,Children:je,Component:Pe,Fragment:ue,PureComponent:Sr,StrictMode:Qa,Suspense:rn,SuspenseList:on,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Ka,cloneElement:pt,createContext:De,createElement:N,createFactory:Ya,createPortal:za,createRef:ra,default:Ie,findDOMNode:Za,flushSync:Mr,forwardRef:_e,hydrate:Ha,isValidElement:ht,lazy:Ko,memo:Va,render:ja,startTransition:Go,unmountComponentAtNode:Ga,unstable_batchedUpdates:Ja,useCallback:me,useContext:we,useDebugValue:xa,useDeferredValue:ec,useEffect:G,useErrorBoundary:uf,useId:yr,useImperativeHandle:_a,useInsertionEffect:Tr,useLayoutEffect:Be,useMemo:de,useReducer:br,useRef:U,useState:ae,useSyncExternalStore:nc,useTransition:tc,version:Vf},Symbol.toStringTag,{value:"Module"}));function sn(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Lf(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function rc(...e){return t=>e.forEach(n=>Lf(n,t))}function On(...e){return me(rc(...e),e)}function Rf(e,t=[]){let n=[];function r(i,s){const a=De(s),c=n.length;n=[...n,s];function u(l){const{scope:f,children:h,...p}=l,m=(f==null?void 0:f[e][c])||a,y=de(()=>p,Object.values(p));return N(m.Provider,{value:y},h)}function d(l,f){const h=(f==null?void 0:f[e][c])||a,p=we(h);if(p)return p;if(s!==void 0)return s;throw new Error(`\`${l}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,d]}const o=()=>{const i=n.map(s=>De(s));return function(a){const c=(a==null?void 0:a[e])||i;return de(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return o.scopeName=e,[r,Nf(o,...t)]}function Nf(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:c,scopeName:u})=>{const l=c(i)[`__scope${u}`];return{...a,...l}},{});return de(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}const Zo=globalThis!=null&&globalThis.document?Be:()=>{},Ff=Of["useId".toString()]||(()=>{});let Df=0;function Jo(e){const[t,n]=ae(Ff());return Zo(()=>{e||n(r=>r??String(Df++))},[e]),e||(t?`radix-${t}`:"")}function Lt(e){const t=U(e);return G(()=>{t.current=e}),de(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function If({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=zf({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=Lt(n),c=me(u=>{if(i){const l=typeof u=="function"?u(e):u;l!==e&&a(l)}else o(u)},[i,e,o,a]);return[s,c]}function zf({defaultProp:e,onChange:t}){const n=ae(e),[r]=n,o=U(r),i=Lt(t);return G(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const Qo=_e((e,t)=>{const{children:n,...r}=e,o=je.toArray(n),i=o.find(jf);if(i){const s=i.props.children,a=o.map(c=>c===i?je.count(s)>1?je.only(null):ht(s)?s.props.children:null:c);return N(ei,Te({},r,{ref:t}),ht(s)?pt(s,void 0,a):null)}return N(ei,Te({},r,{ref:t}),n)});Qo.displayName="Slot";const ei=_e((e,t)=>{const{children:n,...r}=e;return ht(n)?pt(n,{...Hf(r,n.props),ref:t?rc(t,n.ref):n.ref}):je.count(n)>1?je.only(null):null});ei.displayName="SlotClone";const Bf=({children:e})=>N(ue,null,e);function jf(e){return ht(e)&&e.type===Bf}function Hf(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const ti=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>{const n=_e((r,o)=>{const{asChild:i,...s}=r,a=i?Qo:t;return G(()=>{window[Symbol.for("radix-ui")]=!0},[]),N(a,Te({},s,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Uf(e,t){e&&Mr(()=>e.dispatchEvent(t))}function Xf(e,t=globalThis==null?void 0:globalThis.document){const n=Lt(e);G(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const ni="dismissableLayer.update",qf="dismissableLayer.pointerDownOutside",Wf="dismissableLayer.focusOutside";let oc;const Kf=De({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Yf=_e((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:a,onDismiss:c,...u}=e,d=we(Kf),[l,f]=ae(null),h=(n=l==null?void 0:l.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,p]=ae({}),m=On(t,C=>f(C)),y=Array.from(d.layers),[x]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),g=y.indexOf(x),_=l?y.indexOf(l):-1,M=d.layersWithOutsidePointerEventsDisabled.size>0,S=_>=g,F=Gf(C=>{const E=C.target,q=[...d.branches].some(K=>K.contains(E));!S||q||(i==null||i(C),a==null||a(C),C.defaultPrevented||c==null||c())},h),R=Zf(C=>{const E=C.target;[...d.branches].some(K=>K.contains(E))||(s==null||s(C),a==null||a(C),C.defaultPrevented||c==null||c())},h);return Xf(C=>{_===d.layers.size-1&&(o==null||o(C),!C.defaultPrevented&&c&&(C.preventDefault(),c()))},h),G(()=>{if(l)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(oc=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(l)),d.layers.add(l),ic(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=oc)}},[l,h,r,d]),G(()=>()=>{l&&(d.layers.delete(l),d.layersWithOutsidePointerEventsDisabled.delete(l),ic())},[l,d]),G(()=>{const C=()=>p({});return document.addEventListener(ni,C),()=>document.removeEventListener(ni,C)},[]),N(ti.div,Te({},u,{ref:m,style:{pointerEvents:M?S?"auto":"none":void 0,...e.style},onFocusCapture:sn(e.onFocusCapture,R.onFocusCapture),onBlurCapture:sn(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:sn(e.onPointerDownCapture,F.onPointerDownCapture)}))});function Gf(e,t=globalThis==null?void 0:globalThis.document){const n=Lt(e),r=U(!1),o=U(()=>{});return G(()=>{const i=a=>{if(a.target&&!r.current){let u=function(){sc(qf,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=u,t.addEventListener("click",o.current,{once:!0})):u()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Zf(e,t=globalThis==null?void 0:globalThis.document){const n=Lt(e),r=U(!1);return G(()=>{const o=i=>{i.target&&!r.current&&sc(Wf,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function ic(){const e=new CustomEvent(ni);document.dispatchEvent(e)}function sc(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Uf(o,i):o.dispatchEvent(i)}const ri="focusScope.autoFocusOnMount",oi="focusScope.autoFocusOnUnmount",ac={bubbles:!1,cancelable:!0},Jf=_e((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,c]=ae(null),u=Lt(o),d=Lt(i),l=U(null),f=On(t,m=>c(m)),h=U({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;G(()=>{if(r){let m=function(_){if(h.paused||!a)return;const M=_.target;a.contains(M)?l.current=M:mt(l.current,{select:!0})},y=function(_){if(h.paused||!a)return;const M=_.relatedTarget;M!==null&&(a.contains(M)||mt(l.current,{select:!0}))},x=function(_){if(document.activeElement===document.body)for(const S of _)S.removedNodes.length>0&&mt(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",y);const g=new MutationObserver(x);return a&&g.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",y),g.disconnect()}}},[r,a,h.paused]),G(()=>{if(a){uc.add(h);const m=document.activeElement;if(!a.contains(m)){const x=new CustomEvent(ri,ac);a.addEventListener(ri,u),a.dispatchEvent(x),x.defaultPrevented||(Qf(oh(cc(a)),{select:!0}),document.activeElement===m&&mt(a))}return()=>{a.removeEventListener(ri,u),setTimeout(()=>{const x=new CustomEvent(oi,ac);a.addEventListener(oi,d),a.dispatchEvent(x),x.defaultPrevented||mt(m??document.body,{select:!0}),a.removeEventListener(oi,d),uc.remove(h)},0)}}},[a,u,d,h]);const p=me(m=>{if(!n&&!r||h.paused)return;const y=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,x=document.activeElement;if(y&&x){const g=m.currentTarget,[_,M]=eh(g);_&&M?!m.shiftKey&&x===M?(m.preventDefault(),n&&mt(_,{select:!0})):m.shiftKey&&x===_&&(m.preventDefault(),n&&mt(M,{select:!0})):x===g&&m.preventDefault()}},[n,r,h.paused]);return N(ti.div,Te({tabIndex:-1},s,{ref:f,onKeyDown:p}))});function Qf(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(mt(r,{select:t}),document.activeElement!==n)return}function eh(e){const t=cc(e),n=lc(t,e),r=lc(t.reverse(),e);return[n,r]}function cc(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function lc(e,t){for(const n of e)if(!th(n,{upTo:t}))return n}function th(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function nh(e){return e instanceof HTMLInputElement&&"select"in e}function mt(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&nh(e)&&t&&e.select()}}const uc=rh();function rh(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=dc(e,t),e.unshift(t)},remove(t){var n;e=dc(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function dc(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function oh(e){return e.filter(t=>t.tagName!=="A")}function ih(e,t){return br((n,r)=>{const o=t[n][r];return o??n},e)}const ii=e=>{const{present:t,children:n}=e,r=sh(t),o=typeof n=="function"?n({present:r.isPresent}):je.only(n),i=On(r.ref,o.ref);return typeof n=="function"||r.isPresent?pt(o,{ref:i}):null};ii.displayName="Presence";function sh(e){const[t,n]=ae(),r=U({}),o=U(e),i=U("none"),s=e?"mounted":"unmounted",[a,c]=ih(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return G(()=>{const u=Cr(r.current);i.current=a==="mounted"?u:"none"},[a]),Zo(()=>{const u=r.current,d=o.current;if(d!==e){const f=i.current,h=Cr(u);e?c("MOUNT"):h==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&f!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),Zo(()=>{if(t){const u=l=>{const h=Cr(r.current).includes(l.animationName);l.target===t&&h&&Mr(()=>c("ANIMATION_END"))},d=l=>{l.target===t&&(i.current=Cr(r.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:me(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function Cr(e){return(e==null?void 0:e.animationName)||"none"}let si=0;function ah(){G(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:fc()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:fc()),si++,()=>{si===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),si--}},[])}function fc(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var He=function(){return He=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},He.apply(this,arguments)};function hc(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function ch(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var Ar="right-scroll-bar-position",Pr="width-before-scroll-bar",lh="with-scroll-bars-hidden",uh="--removed-body-scroll-bar-size";function dh(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function fh(e,t){var n=ae(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}function hh(e,t){return fh(t||null,function(n){return e.forEach(function(r){return dh(r,n)})})}function ph(e){return e}function mh(e,t){t===void 0&&(t=ph);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var s=t(i,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(i),s=n}var c=function(){var d=s;s=[],d.forEach(i)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(d){s.push(d),u()},filter:function(d){return s=s.filter(d),n}}}};return o}function vh(e){e===void 0&&(e={});var t=mh(null);return t.options=He({async:!0,ssr:!1},e),t}var pc=function(e){var t=e.sideCar,n=hc(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return N(r,He({},n))};pc.isSideCarExport=!0;function gh(e,t){return e.useMedium(t),pc}var mc=vh(),ai=function(){},Er=_e(function(e,t){var n=U(null),r=ae({onScrollCapture:ai,onWheelCapture:ai,onTouchMoveCapture:ai}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,l=e.shards,f=e.sideCar,h=e.noIsolation,p=e.inert,m=e.allowPinchZoom,y=e.as,x=y===void 0?"div":y,g=hc(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),_=f,M=hh([n,t]),S=He(He({},g),o);return N(ue,null,d&&N(_,{sideCar:mc,removeScrollBar:u,shards:l,noIsolation:h,inert:p,setCallbacks:i,allowPinchZoom:!!m,lockRef:n}),s?pt(je.only(a),He(He({},S),{ref:M})):N(x,He({},S,{className:c,ref:M}),a))});Er.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Er.classNames={fullWidth:Pr,zeroRight:Ar};var vc,bh=function(){if(vc)return vc;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function yh(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=bh();return t&&e.setAttribute("nonce",t),e}function wh(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function _h(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var xh=function(){var e=0,t=null;return{add:function(n){e==0&&(t=yh())&&(wh(t,n),_h(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},kh=function(){var e=xh();return function(t,n){G(function(){return e.add(t),function(){e.remove()}},[t&&n])}},gc=function(){var e=kh(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},$h={left:0,top:0,right:0,gap:0},ci=function(e){return parseInt(e||"",10)||0},Sh=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[ci(n),ci(r),ci(o)]},Mh=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return $h;var t=Sh(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Th=gc(),Ch=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
1
|
+
var $y=Object.defineProperty;var Sy=(Pt,Fe,Et)=>Fe in Pt?$y(Pt,Fe,{enumerable:!0,configurable:!0,writable:!0,value:Et}):Pt[Fe]=Et;var nf=(Pt,Fe,Et)=>(Sy(Pt,typeof Fe!="symbol"?Fe+"":Fe,Et),Et);(function(){"use strict";const Pt=e=>{throw new Error(`Unhandled discriminated union member: ${JSON.stringify(e)}`)};function Fe(e,t){if(!e)throw new Error(t)}var Et=e=>e,Cn,V,Gs,Zs,Vt,Js,Qs,Ro,ea,Qt={},ta=[],rf=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,hr=Array.isArray;function Je(e,t){for(var n in t)e[n]=t[n];return e}function na(e){var t=e.parentNode;t&&t.removeChild(e)}function N(e,t,n){var r,o,i,s={};for(i in t)i=="key"?r=t[i]:i=="ref"?o=t[i]:s[i]=t[i];if(arguments.length>2&&(s.children=arguments.length>3?Cn.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)s[i]===void 0&&(s[i]=e.defaultProps[i]);return An(e,s,r,o,null)}function An(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:o??++Gs};return o==null&&V.vnode!=null&&V.vnode(i),i}function ra(){return{current:null}}function ue(e){return e.children}function Pe(e,t){this.props=e,this.context=t}function pr(e,t){if(t==null)return e.__?pr(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?pr(e):null}function oa(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return oa(e)}}function No(e){(!e.__d&&(e.__d=!0)&&Vt.push(e)&&!mr.__r++||Js!==V.debounceRendering)&&((Js=V.debounceRendering)||Qs)(mr)}function mr(){var e,t,n,r,o,i,s,a,c;for(Vt.sort(Ro);e=Vt.shift();)e.__d&&(t=Vt.length,r=void 0,o=void 0,i=void 0,a=(s=(n=e).__v).__e,(c=n.__P)&&(r=[],o=[],(i=Je({},s)).__v=s.__v+1,Fo(c,s,i,n.__n,c.ownerSVGElement!==void 0,s.__h!=null?[a]:null,r,a??pr(s),s.__h,o),da(r,s,o),s.__e!=a&&oa(s)),Vt.length>t&&Vt.sort(Ro));mr.__r=0}function ia(e,t,n,r,o,i,s,a,c,u,d){var l,f,h,p,m,y,x,g,_,M,S=0,F=r&&r.__k||ta,R=F.length,C=R,E=t.length;for(n.__k=[],l=0;l<E;l++)(p=n.__k[l]=(p=t[l])==null||typeof p=="boolean"||typeof p=="function"?null:typeof p=="string"||typeof p=="number"||typeof p=="bigint"?An(null,p,null,null,p):hr(p)?An(ue,{children:p},null,null,null):p.__b>0?An(p.type,p.props,p.key,p.ref?p.ref:null,p.__v):p)!=null&&(p.__=n,p.__b=n.__b+1,(g=of(p,F,x=l+S,C))===-1?h=Qt:(h=F[g]||Qt,F[g]=void 0,C--),Fo(e,p,h,o,i,s,a,c,u,d),m=p.__e,(f=p.ref)&&h.ref!=f&&(h.ref&&Do(h.ref,null,p),d.push(f,p.__c||m,p)),m!=null&&(y==null&&(y=m),M=!(_=h===Qt||h.__v===null)&&g===x,_?g==-1&&S--:g!==x&&(g===x+1?(S++,M=!0):g>x?C>E-x?(S+=g-x,M=!0):S--:S=g<x&&g==x-1?g-x:0),x=l+S,M=M||g==l&&!_,typeof p.type!="function"||g===x&&h.__k!==p.__k?typeof p.type=="function"||M?p.__d!==void 0?(c=p.__d,p.__d=void 0):c=m.nextSibling:c=aa(e,m,c):c=sa(p,c,e),typeof n.type=="function"&&(n.__d=c)));for(n.__e=y,l=R;l--;)F[l]!=null&&(typeof n.type=="function"&&F[l].__e!=null&&F[l].__e==n.__d&&(n.__d=F[l].__e.nextSibling),fa(F[l],F[l]))}function sa(e,t,n){for(var r,o=e.__k,i=0;o&&i<o.length;i++)(r=o[i])&&(r.__=e,t=typeof r.type=="function"?sa(r,t,n):aa(n,r.__e,t));return t}function Qe(e,t){return t=t||[],e==null||typeof e=="boolean"||(hr(e)?e.some(function(n){Qe(n,t)}):t.push(e)),t}function aa(e,t,n){return n==null||n.parentNode!==e?e.insertBefore(t,null):t==n&&t.parentNode!=null||e.insertBefore(t,n),t.nextSibling}function of(e,t,n,r){var o=e.key,i=e.type,s=n-1,a=n+1,c=t[n];if(c===null||c&&o==c.key&&i===c.type)return n;if(r>(c!=null?1:0))for(;s>=0||a<t.length;){if(s>=0){if((c=t[s])&&o==c.key&&i===c.type)return s;s--}if(a<t.length){if((c=t[a])&&o==c.key&&i===c.type)return a;a++}}return-1}function sf(e,t,n,r,o){var i;for(i in n)i==="children"||i==="key"||i in t||vr(e,i,null,n[i],r);for(i in t)o&&typeof t[i]!="function"||i==="children"||i==="key"||i==="value"||i==="checked"||n[i]===t[i]||vr(e,i,t[i],n[i],r)}function ca(e,t,n){t[0]==="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||rf.test(t)?n:n+"px"}function vr(e,t,n,r,o){var i;e:if(t==="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||ca(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||ca(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")i=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r||e.addEventListener(t,i?ua:la,i):e.removeEventListener(t,i?ua:la,i);else if(t!=="dangerouslySetInnerHTML"){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 in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,n))}}function la(e){return this.l[e.type+!1](V.event?V.event(e):e)}function ua(e){return this.l[e.type+!0](V.event?V.event(e):e)}function Fo(e,t,n,r,o,i,s,a,c,u){var d,l,f,h,p,m,y,x,g,_,M,S,F,R,C,E=t.type;if(t.constructor!==void 0)return null;n.__h!=null&&(c=n.__h,a=t.__e=n.__e,t.__h=null,i=[a]),(d=V.__b)&&d(t);try{e:if(typeof E=="function"){if(x=t.props,g=(d=E.contextType)&&r[d.__c],_=d?g?g.props.value:d.__:r,n.__c?y=(l=t.__c=n.__c).__=l.__E:("prototype"in E&&E.prototype.render?t.__c=l=new E(x,_):(t.__c=l=new Pe(x,_),l.constructor=E,l.render=cf),g&&g.sub(l),l.props=x,l.state||(l.state={}),l.context=_,l.__n=r,f=l.__d=!0,l.__h=[],l._sb=[]),l.__s==null&&(l.__s=l.state),E.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=Je({},l.__s)),Je(l.__s,E.getDerivedStateFromProps(x,l.__s))),h=l.props,p=l.state,l.__v=t,f)E.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(E.getDerivedStateFromProps==null&&x!==h&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(x,_),!l.__e&&(l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(x,l.__s,_)===!1||t.__v===n.__v)){for(t.__v!==n.__v&&(l.props=x,l.state=l.__s,l.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(q){q&&(q.__=t)}),M=0;M<l._sb.length;M++)l.__h.push(l._sb[M]);l._sb=[],l.__h.length&&s.push(l);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(x,l.__s,_),l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(h,p,m)})}if(l.context=_,l.props=x,l.__P=e,l.__e=!1,S=V.__r,F=0,"prototype"in E&&E.prototype.render){for(l.state=l.__s,l.__d=!1,S&&S(t),d=l.render(l.props,l.state,l.context),R=0;R<l._sb.length;R++)l.__h.push(l._sb[R]);l._sb=[]}else do l.__d=!1,S&&S(t),d=l.render(l.props,l.state,l.context),l.state=l.__s;while(l.__d&&++F<25);l.state=l.__s,l.getChildContext!=null&&(r=Je(Je({},r),l.getChildContext())),f||l.getSnapshotBeforeUpdate==null||(m=l.getSnapshotBeforeUpdate(h,p)),ia(e,hr(C=d!=null&&d.type===ue&&d.key==null?d.props.children:d)?C:[C],t,n,r,o,i,s,a,c,u),l.base=t.__e,t.__h=null,l.__h.length&&s.push(l),y&&(l.__E=l.__=null)}else i==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=af(n.__e,t,n,r,o,i,s,c,u);(d=V.diffed)&&d(t)}catch(q){t.__v=null,(c||i!=null)&&(t.__e=a,t.__h=!!c,i[i.indexOf(a)]=null),V.__e(q,t,n)}}function da(e,t,n){for(var r=0;r<n.length;r++)Do(n[r],n[++r],n[++r]);V.__c&&V.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(i){i.call(o)})}catch(i){V.__e(i,o.__v)}})}function af(e,t,n,r,o,i,s,a,c){var u,d,l,f=n.props,h=t.props,p=t.type,m=0;if(p==="svg"&&(o=!0),i!=null){for(;m<i.length;m++)if((u=i[m])&&"setAttribute"in u==!!p&&(p?u.localName===p:u.nodeType===3)){e=u,i[m]=null;break}}if(e==null){if(p===null)return document.createTextNode(h);e=o?document.createElementNS("http://www.w3.org/2000/svg",p):document.createElement(p,h.is&&h),i=null,a=!1}if(p===null)f===h||a&&e.data===h||(e.data=h);else{if(i=i&&Cn.call(e.childNodes),d=(f=n.props||Qt).dangerouslySetInnerHTML,l=h.dangerouslySetInnerHTML,!a){if(i!=null)for(f={},m=0;m<e.attributes.length;m++)f[e.attributes[m].name]=e.attributes[m].value;(l||d)&&(l&&(d&&l.__html==d.__html||l.__html===e.innerHTML)||(e.innerHTML=l&&l.__html||""))}if(sf(e,h,f,o,a),l)t.__k=[];else if(ia(e,hr(m=t.props.children)?m:[m],t,n,r,o&&p!=="foreignObject",i,s,i?i[0]:n.__k&&pr(n,0),a,c),i!=null)for(m=i.length;m--;)i[m]!=null&&na(i[m]);a||("value"in h&&(m=h.value)!==void 0&&(m!==e.value||p==="progress"&&!m||p==="option"&&m!==f.value)&&vr(e,"value",m,f.value,!1),"checked"in h&&(m=h.checked)!==void 0&&m!==e.checked&&vr(e,"checked",m,f.checked,!1))}return e}function Do(e,t,n){try{typeof e=="function"?e(t):e.current=t}catch(r){V.__e(r,n)}}function fa(e,t,n){var r,o;if(V.unmount&&V.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||Do(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){V.__e(i,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&fa(r[o],t,n||typeof e.type!="function");n||e.__e==null||na(e.__e),e.__=e.__e=e.__d=void 0}function cf(e,t,n){return this.constructor(e,n)}function en(e,t,n){var r,o,i,s;V.__&&V.__(e,t),o=(r=typeof n=="function")?null:n&&n.__k||t.__k,i=[],s=[],Fo(t,e=(!r&&n||t).__k=N(ue,null,[e]),o||Qt,Qt,t.ownerSVGElement!==void 0,!r&&n?[n]:o?null:t.firstChild?Cn.call(t.childNodes):null,i,!r&&n?n:o?o.__e:t.firstChild,r,s),da(i,e,s)}function ha(e,t){en(e,t,ha)}function lf(e,t,n){var r,o,i,s,a=Je({},e.props);for(i in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)i=="key"?r=t[i]:i=="ref"?o=t[i]:a[i]=t[i]===void 0&&s!==void 0?s[i]:t[i];return arguments.length>2&&(a.children=arguments.length>3?Cn.call(arguments,2):n),An(e.type,a,r||e.key,o||e.ref,null)}function De(e,t){var n={__c:t="__cC"+ea++,__:e,Consumer:function(r,o){return r.children(o)},Provider:function(r){var o,i;return this.getChildContext||(o=[],(i={})[t]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(s){this.props.value!==s.value&&o.some(function(a){a.__e=!0,No(a)})},this.sub=function(s){o.push(s);var a=s.componentWillUnmount;s.componentWillUnmount=function(){o.splice(o.indexOf(s),1),a&&a.call(s)}}),r.children}};return n.Provider.__=n.Consumer.contextType=n}Cn=ta.slice,V={__e:function(e,t,n,r){for(var o,i,s;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&i.getDerivedStateFromError!=null&&(o.setState(i.getDerivedStateFromError(e)),s=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,r||{}),s=o.__d),s)return o.__E=o}catch(a){e=a}throw e}},Gs=0,Zs=function(e){return e!=null&&e.constructor===void 0},Pe.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Je({},this.state),typeof e=="function"&&(e=e(Je({},n),this.props)),e&&Je(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),No(this))},Pe.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),No(this))},Pe.prototype.render=ue,Vt=[],Qs=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ro=function(e,t){return e.__v.__b-t.__v.__b},mr.__r=0,ea=0;var et,J,Io,pa,tn=0,ma=[],gr=[],va=V.__b,ga=V.__r,ba=V.diffed,ya=V.__c,wa=V.unmount;function Ot(e,t){V.__h&&V.__h(J,e,tn||t),tn=0;var n=J.__H||(J.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:gr}),n.__[e]}function ae(e){return tn=1,br($a,e)}function br(e,t,n){var r=Ot(et++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):$a(void 0,t),function(a){var c=r.__N?r.__N[0]:r.__[0],u=r.t(c,a);c!==u&&(r.__N=[u,r.__[1]],r.__c.setState({}))}],r.__c=J,!J.u)){var o=function(a,c,u){if(!r.__c.__H)return!0;var d=r.__c.__H.__.filter(function(f){return f.__c});if(d.every(function(f){return!f.__N}))return!i||i.call(this,a,c,u);var l=!1;return d.forEach(function(f){if(f.__N){var h=f.__[0];f.__=f.__N,f.__N=void 0,h!==f.__[0]&&(l=!0)}}),!(!l&&r.__c.props===a)&&(!i||i.call(this,a,c,u))};J.u=!0;var i=J.shouldComponentUpdate,s=J.componentWillUpdate;J.componentWillUpdate=function(a,c,u){if(this.__e){var d=i;i=void 0,o(a,c,u),i=d}s&&s.call(this,a,c,u)},J.shouldComponentUpdate=o}return r.__N||r.__}function G(e,t){var n=Ot(et++,3);!V.__s&&Bo(n.__H,t)&&(n.__=e,n.i=t,J.__H.__h.push(n))}function Be(e,t){var n=Ot(et++,4);!V.__s&&Bo(n.__H,t)&&(n.__=e,n.i=t,J.__h.push(n))}function U(e){return tn=5,de(function(){return{current:e}},[])}function _a(e,t,n){tn=6,Be(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},n==null?n:n.concat(e))}function de(e,t){var n=Ot(et++,7);return Bo(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function me(e,t){return tn=8,de(function(){return e},t)}function we(e){var t=J.context[e.__c],n=Ot(et++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(J)),t.props.value):e.__}function xa(e,t){V.useDebugValue&&V.useDebugValue(t?t(e):e)}function uf(e){var t=Ot(et++,10),n=ae();return t.__=e,J.componentDidCatch||(J.componentDidCatch=function(r,o){t.__&&t.__(r,o),n[1](r)}),[n[0],function(){n[1](void 0)}]}function yr(){var e=Ot(et++,11);if(!e.__){for(var t=J.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function df(){for(var e;e=ma.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(wr),e.__H.__h.forEach(zo),e.__H.__h=[]}catch(t){e.__H.__h=[],V.__e(t,e.__v)}}V.__b=function(e){J=null,va&&va(e)},V.__r=function(e){ga&&ga(e),et=0;var t=(J=e.__c).__H;t&&(Io===J?(t.__h=[],J.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=gr,n.__N=n.i=void 0})):(t.__h.forEach(wr),t.__h.forEach(zo),t.__h=[],et=0)),Io=J},V.diffed=function(e){ba&&ba(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(ma.push(t)!==1&&pa===V.requestAnimationFrame||((pa=V.requestAnimationFrame)||ff)(df)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==gr&&(n.__=n.__V),n.i=void 0,n.__V=gr})),Io=J=null},V.__c=function(e,t){t.some(function(n){try{n.__h.forEach(wr),n.__h=n.__h.filter(function(r){return!r.__||zo(r)})}catch(r){t.some(function(o){o.__h&&(o.__h=[])}),t=[],V.__e(r,n.__v)}}),ya&&ya(e,t)},V.unmount=function(e){wa&&wa(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{wr(r)}catch(o){t=o}}),n.__H=void 0,t&&V.__e(t,n.__v))};var ka=typeof requestAnimationFrame=="function";function ff(e){var t,n=function(){clearTimeout(r),ka&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);ka&&(t=requestAnimationFrame(n))}function wr(e){var t=J,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),J=t}function zo(e){var t=J;e.__c=e.__(),J=t}function Bo(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function $a(e,t){return typeof t=="function"?t(e):t}function _r(){throw new Error("Cycle detected")}var hf=Symbol.for("preact-signals");function xr(){if(dt>1)dt--;else{for(var e,t=!1;Pn!==void 0;){var n=Pn;for(Pn=void 0,jo++;n!==void 0;){var r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&Ma(n))try{n.c()}catch(o){t||(e=o,t=!0)}n=r}}if(jo=0,dt--,t)throw e}}function pf(e){if(dt>0)return e();dt++;try{return e()}finally{xr()}}var oe=void 0,Pn=void 0,dt=0,jo=0,kr=0;function Sa(e){if(oe!==void 0){var t=e.n;if(t===void 0||t.t!==oe)return t={i:0,S:e,p:oe.s,n:void 0,t:oe,e:void 0,x:void 0,r:t},oe.s!==void 0&&(oe.s.n=t),oe.s=t,e.n=t,32&oe.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=oe.s,t.n=void 0,oe.s.n=t,oe.s=t),t}}function ve(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}ve.prototype.brand=hf,ve.prototype.h=function(){return!0},ve.prototype.S=function(e){this.t!==e&&e.e===void 0&&(e.x=this.t,this.t!==void 0&&(this.t.e=e),this.t=e)},ve.prototype.U=function(e){if(this.t!==void 0){var t=e.e,n=e.x;t!==void 0&&(t.x=n,e.e=void 0),n!==void 0&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n)}},ve.prototype.subscribe=function(e){var t=this;return Uo(function(){var n=t.value,r=32&this.f;this.f&=-33;try{e(n)}finally{this.f|=r}})},ve.prototype.valueOf=function(){return this.value},ve.prototype.toString=function(){return this.value+""},ve.prototype.toJSON=function(){return this.value},ve.prototype.peek=function(){return this.v},Object.defineProperty(ve.prototype,"value",{get:function(){var e=Sa(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(oe instanceof ft&&function(){throw new Error("Computed cannot have side-effects")}(),e!==this.v){jo>100&&_r(),this.v=e,this.i++,kr++,dt++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{xr()}}}});function En(e){return new ve(e)}function Ma(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function Ta(e){for(var t=e.s;t!==void 0;t=t.n){var n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function Ca(e){for(var t=e.s,n=void 0;t!==void 0;){var r=t.p;t.i===-1?(t.S.U(t),r!==void 0&&(r.n=t.n),t.n!==void 0&&(t.n.p=r)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=r}e.s=n}function ft(e){ve.call(this,void 0),this.x=e,this.s=void 0,this.g=kr-1,this.f=4}(ft.prototype=new ve).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===kr))return!0;if(this.g=kr,this.f|=1,this.i>0&&!Ma(this))return this.f&=-2,!0;var e=oe;try{Ta(this),oe=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(n){this.v=n,this.f|=16,this.i++}return oe=e,Ca(this),this.f&=-2,!0},ft.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}ve.prototype.S.call(this,e)},ft.prototype.U=function(e){if(this.t!==void 0&&(ve.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}},ft.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}},ft.prototype.peek=function(){if(this.h()||_r(),16&this.f)throw this.v;return this.v},Object.defineProperty(ft.prototype,"value",{get:function(){1&this.f&&_r();var e=Sa(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function mf(e){return new ft(e)}function Aa(e){var t=e.u;if(e.u=void 0,typeof t=="function"){dt++;var n=oe;oe=void 0;try{t()}catch(r){throw e.f&=-2,e.f|=8,Ho(e),r}finally{oe=n,xr()}}}function Ho(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Aa(e)}function vf(e){if(oe!==this)throw new Error("Out-of-order effect");Ca(this),oe=e,this.f&=-2,8&this.f&&Ho(this),xr()}function Vn(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}Vn.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.u=t)}finally{e()}},Vn.prototype.S=function(){1&this.f&&_r(),this.f|=1,this.f&=-9,Aa(this),Ta(this),dt++;var e=oe;return oe=this,vf.bind(this,e)},Vn.prototype.N=function(){2&this.f||(this.f|=2,this.o=Pn,Pn=this)},Vn.prototype.d=function(){this.f|=8,1&this.f||Ho(this)};function Uo(e){var t=new Vn(e);try{t.c()}catch(n){throw t.d(),n}return t.d.bind(t)}var Xo;function nn(e,t){V[e]=t.bind(null,V[e]||function(){})}function $r(e){Xo&&Xo(),Xo=e&&e.S()}function Pa(e){var t=this,n=e.data,r=bf(n);r.value=n;var o=de(function(){for(var i=t.__v;i=i.__;)if(i.__c){i.__c.__$f|=4;break}return t.__$u.c=function(){var s;!Zs(o.peek())&&((s=t.base)==null?void 0:s.nodeType)===3?t.base.data=o.peek():(t.__$f|=1,t.setState({}))},mf(function(){var s=r.value.value;return s===0?0:s===!0?"":s||""})},[]);return o.value}Pa.displayName="_st",Object.defineProperties(ve.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Pa},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),nn("__b",function(e,t){if(typeof t.type=="string"){var n,r=t.props;for(var o in r)if(o!=="children"){var i=r[o];i instanceof ve&&(n||(t.__np=n={}),n[o]=i,r[o]=i.peek())}}e(t)}),nn("__r",function(e,t){$r();var n,r=t.__c;r&&(r.__$f&=-2,(n=r.__$u)===void 0&&(r.__$u=n=function(o){var i;return Uo(function(){i=this}),i.c=function(){r.__$f|=1,r.setState({})},i}())),$r(n),e(t)}),nn("__e",function(e,t,n,r){$r(),e(t,n,r)}),nn("diffed",function(e,t){$r();var n;if(typeof t.type=="string"&&(n=t.__e)){var r=t.__np,o=t.props;if(r){var i=n.U;if(i)for(var s in i){var a=i[s];a!==void 0&&!(s in r)&&(a.d(),i[s]=void 0)}else n.U=i={};for(var c in r){var u=i[c],d=r[c];u===void 0?(u=gf(n,c,d,o),i[c]=u):u.o(d,o)}}}e(t)});function gf(e,t,n,r){var o=t in e&&e.ownerSVGElement===void 0,i=En(n);return{o:function(s,a){i.value=s,r=a},d:Uo(function(){var s=i.value.value;r[t]!==s&&(r[t]=s,o?e[t]=s:s?e.setAttribute(t,s):e.removeAttribute(t))})}}nn("unmount",function(e,t){if(typeof t.type=="string"){var n=t.__e;if(n){var r=n.U;if(r){n.U=void 0;for(var o in r){var i=r[o];i&&i.d()}}}}else{var s=t.__c;if(s){var a=s.__$u;a&&(s.__$u=void 0,a.d())}}e(t)}),nn("__h",function(e,t,n,r){(r<3||r===9)&&(t.__$f|=2),e(t,n,r)}),Pe.prototype.shouldComponentUpdate=function(e,t){var n=this.__$u;if(!(n&&n.s!==void 0||4&this.__$f)||3&this.__$f)return!0;for(var r in t)return!0;for(var o in e)if(o!=="__source"&&e[o]!==this.props[o])return!0;for(var i in this.props)if(!(i in e))return!0;return!1};function bf(e){return de(function(){return En(e)},[])}function Te(){return Te=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Te.apply(this,arguments)}function Ea(e,t){for(var n in t)e[n]=t[n];return e}function qo(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var r in t)if(r!=="__source"&&e[r]!==t[r])return!0;return!1}function Wo(e,t){return e===t&&(e!==0||1/e==1/t)||e!=e&&t!=t}function Sr(e){this.props=e}function Va(e,t){function n(o){var i=this.props.ref,s=i==o.ref;return!s&&i&&(i.call?i(null):i.current=null),t?!t(this.props,o)||!s:qo(this.props,o)}function r(o){return this.shouldComponentUpdate=n,N(e,o)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(Sr.prototype=new Pe).isPureReactComponent=!0,Sr.prototype.shouldComponentUpdate=function(e,t){return qo(this.props,e)||qo(this.state,t)};var Oa=V.__b;V.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Oa&&Oa(e)};var yf=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function _e(e){function t(n){var r=Ea({},n);return delete r.ref,e(r,n.ref||null)}return t.$$typeof=yf,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var La=function(e,t){return e==null?null:Qe(Qe(e).map(t))},je={map:La,forEach:La,count:function(e){return e?Qe(e).length:0},only:function(e){var t=Qe(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:Qe},wf=V.__e;V.__e=function(e,t,n,r){if(e.then){for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t)}wf(e,t,n,r)};var Ra=V.unmount;function Na(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),e.__c.__H=null),(e=Ea({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return Na(r,t,n)})),e}function Fa(e,t,n){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return Fa(r,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=n)),e}function rn(){this.__u=0,this.t=null,this.__b=null}function Da(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Ko(e){var t,n,r;function o(i){if(t||(t=e()).then(function(s){n=s.default||s},function(s){r=s}),r)throw r;if(!n)throw t;return N(n,i)}return o.displayName="Lazy",o.__f=!0,o}function on(){this.u=null,this.o=null}V.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&e.__h===!0&&(e.type=null),Ra&&Ra(e)},(rn.prototype=new Pe).__c=function(e,t){var n=t.__c,r=this;r.t==null&&(r.t=[]),r.t.push(n);var o=Da(r.__v),i=!1,s=function(){i||(i=!0,n.__R=null,o?o(a):a())};n.__R=s;var a=function(){if(!--r.__u){if(r.state.__a){var u=r.state.__a;r.__v.__k[0]=Fa(u,u.__c.__P,u.__c.__O)}var d;for(r.setState({__a:r.__b=null});d=r.t.pop();)d.forceUpdate()}},c=t.__h===!0;r.__u++||c||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(s,s)},rn.prototype.componentWillUnmount=function(){this.t=[]},rn.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=Na(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&N(ue,null,e.fallback);return o&&(o.__h=null),[N(ue,null,t.__a?null:e.children),o]};var Ia=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};function _f(e){return this.getChildContext=function(){return e.context},e.children}function xf(e){var t=this,n=e.i;t.componentWillUnmount=function(){en(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),e.__v?(t.l||(t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(r){this.childNodes.push(r),t.i.appendChild(r)},insertBefore:function(r,o){this.childNodes.push(r),t.i.appendChild(r)},removeChild:function(r){this.childNodes.splice(this.childNodes.indexOf(r)>>>1,1),t.i.removeChild(r)}}),en(N(_f,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function za(e,t){var n=N(xf,{__v:e,i:t});return n.containerInfo=t,n}(on.prototype=new Pe).__a=function(e){var t=this,n=Da(t.__v),r=t.o.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),Ia(t,e,r)):o()};n?n(i):i()}},on.prototype.render=function(e){this.u=null,this.o=new Map;var t=Qe(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},on.prototype.componentDidUpdate=on.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,n){Ia(e,n,t)})};var Ba=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,kf=/^(?: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]/,$f=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Sf=/[A-Z0-9]/g,Mf=typeof document<"u",Tf=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function ja(e,t,n){return t.__k==null&&(t.textContent=""),en(e,t),typeof n=="function"&&n(),e?e.__c:null}function Ha(e,t,n){return ha(e,t),typeof n=="function"&&n(),e?e.__c:null}Pe.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(Pe.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Ua=V.event;function Cf(){}function Af(){return this.cancelBubble}function Pf(){return this.defaultPrevented}V.event=function(e){return Ua&&(e=Ua(e)),e.persist=Cf,e.isPropagationStopped=Af,e.isDefaultPrevented=Pf,e.nativeEvent=e};var Yo,Ef={enumerable:!1,configurable:!0,get:function(){return this.class}},Xa=V.vnode;V.vnode=function(e){typeof e.type=="string"&&function(t){var n=t.props,r=t.type,o={};for(var i in n){var s=n[i];if(!(i==="value"&&"defaultValue"in n&&s==null||Mf&&i==="children"&&r==="noscript"||i==="class"||i==="className")){var a=i.toLowerCase();i==="defaultValue"&&"value"in n&&n.value==null?i="value":i==="download"&&s===!0?s="":a==="ondoubleclick"?i="ondblclick":a!=="onchange"||r!=="input"&&r!=="textarea"||Tf(n.type)?a==="onfocus"?i="onfocusin":a==="onblur"?i="onfocusout":$f.test(i)?i=a:r.indexOf("-")===-1&&kf.test(i)?i=i.replace(Sf,"-$&").toLowerCase():s===null&&(s=void 0):a=i="oninput",a==="oninput"&&o[i=a]&&(i="oninputCapture"),o[i]=s}}r=="select"&&o.multiple&&Array.isArray(o.value)&&(o.value=Qe(n.children).forEach(function(c){c.props.selected=o.value.indexOf(c.props.value)!=-1})),r=="select"&&o.defaultValue!=null&&(o.value=Qe(n.children).forEach(function(c){c.props.selected=o.multiple?o.defaultValue.indexOf(c.props.value)!=-1:o.defaultValue==c.props.value})),n.class&&!n.className?(o.class=n.class,Object.defineProperty(o,"className",Ef)):(n.className&&!n.class||n.class&&n.className)&&(o.class=o.className=n.className),t.props=o}(e),e.$$typeof=Ba,Xa&&Xa(e)};var qa=V.__r;V.__r=function(e){qa&&qa(e),Yo=e.__c};var Wa=V.diffed;V.diffed=function(e){Wa&&Wa(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value),Yo=null};var Ka={ReactCurrentDispatcher:{current:{readContext:function(e){return Yo.__n[e.__c].props.value}}}},Vf="17.0.2";function Ya(e){return N.bind(null,e)}function ht(e){return!!e&&e.$$typeof===Ba}function pt(e){return ht(e)?lf.apply(null,arguments):e}function Ga(e){return!!e.__k&&(en(null,e),!0)}function Za(e){return e&&(e.base||e.nodeType===1&&e)||null}var Ja=function(e,t){return e(t)},Mr=function(e,t){return e(t)},Qa=ue;function Go(e){e()}function ec(e){return e}function tc(){return[!1,Go]}var Tr=Be;function nc(e,t){var n=t(),r=ae({h:{__:n,v:t}}),o=r[0].h,i=r[1];return Be(function(){o.__=n,o.v=t,Wo(o.__,t())||i({h:o})},[e,n,t]),G(function(){return Wo(o.__,o.v())||i({h:o}),e(function(){Wo(o.__,o.v())||i({h:o})})},[e]),n}var Ie={useState:ae,useId:yr,useReducer:br,useEffect:G,useLayoutEffect:Be,useInsertionEffect:Tr,useTransition:tc,useDeferredValue:ec,useSyncExternalStore:nc,startTransition:Go,useRef:U,useImperativeHandle:_a,useMemo:de,useCallback:me,useContext:we,useDebugValue:xa,version:"17.0.2",Children:je,render:ja,hydrate:Ha,unmountComponentAtNode:Ga,createPortal:za,createElement:N,createContext:De,createFactory:Ya,cloneElement:pt,createRef:ra,Fragment:ue,isValidElement:ht,findDOMNode:Za,Component:Pe,PureComponent:Sr,memo:Va,forwardRef:_e,flushSync:Mr,unstable_batchedUpdates:Ja,StrictMode:Qa,Suspense:rn,SuspenseList:on,lazy:Ko,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Ka};const Of=Object.freeze(Object.defineProperty({__proto__:null,Children:je,Component:Pe,Fragment:ue,PureComponent:Sr,StrictMode:Qa,Suspense:rn,SuspenseList:on,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Ka,cloneElement:pt,createContext:De,createElement:N,createFactory:Ya,createPortal:za,createRef:ra,default:Ie,findDOMNode:Za,flushSync:Mr,forwardRef:_e,hydrate:Ha,isValidElement:ht,lazy:Ko,memo:Va,render:ja,startTransition:Go,unmountComponentAtNode:Ga,unstable_batchedUpdates:Ja,useCallback:me,useContext:we,useDebugValue:xa,useDeferredValue:ec,useEffect:G,useErrorBoundary:uf,useId:yr,useImperativeHandle:_a,useInsertionEffect:Tr,useLayoutEffect:Be,useMemo:de,useReducer:br,useRef:U,useState:ae,useSyncExternalStore:nc,useTransition:tc,version:Vf},Symbol.toStringTag,{value:"Module"}));function sn(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Lf(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function rc(...e){return t=>e.forEach(n=>Lf(n,t))}function On(...e){return me(rc(...e),e)}function Rf(e,t=[]){let n=[];function r(i,s){const a=De(s),c=n.length;n=[...n,s];function u(l){const{scope:f,children:h,...p}=l,m=(f==null?void 0:f[e][c])||a,y=de(()=>p,Object.values(p));return N(m.Provider,{value:y},h)}function d(l,f){const h=(f==null?void 0:f[e][c])||a,p=we(h);if(p)return p;if(s!==void 0)return s;throw new Error(`\`${l}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,d]}const o=()=>{const i=n.map(s=>De(s));return function(a){const c=(a==null?void 0:a[e])||i;return de(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return o.scopeName=e,[r,Nf(o,...t)]}function Nf(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:c,scopeName:u})=>{const l=c(i)[`__scope${u}`];return{...a,...l}},{});return de(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}const Zo=globalThis!=null&&globalThis.document?Be:()=>{},Ff=Of["useId".toString()]||(()=>{});let Df=0;function Jo(e){const[t,n]=ae(Ff());return Zo(()=>{e||n(r=>r??String(Df++))},[e]),e||(t?`radix-${t}`:"")}function Lt(e){const t=U(e);return G(()=>{t.current=e}),de(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function If({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=zf({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=Lt(n),c=me(u=>{if(i){const l=typeof u=="function"?u(e):u;l!==e&&a(l)}else o(u)},[i,e,o,a]);return[s,c]}function zf({defaultProp:e,onChange:t}){const n=ae(e),[r]=n,o=U(r),i=Lt(t);return G(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const Qo=_e((e,t)=>{const{children:n,...r}=e,o=je.toArray(n),i=o.find(jf);if(i){const s=i.props.children,a=o.map(c=>c===i?je.count(s)>1?je.only(null):ht(s)?s.props.children:null:c);return N(ei,Te({},r,{ref:t}),ht(s)?pt(s,void 0,a):null)}return N(ei,Te({},r,{ref:t}),n)});Qo.displayName="Slot";const ei=_e((e,t)=>{const{children:n,...r}=e;return ht(n)?pt(n,{...Hf(r,n.props),ref:t?rc(t,n.ref):n.ref}):je.count(n)>1?je.only(null):null});ei.displayName="SlotClone";const Bf=({children:e})=>N(ue,null,e);function jf(e){return ht(e)&&e.type===Bf}function Hf(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const ti=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>{const n=_e((r,o)=>{const{asChild:i,...s}=r,a=i?Qo:t;return G(()=>{window[Symbol.for("radix-ui")]=!0},[]),N(a,Te({},s,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Uf(e,t){e&&Mr(()=>e.dispatchEvent(t))}function Xf(e,t=globalThis==null?void 0:globalThis.document){const n=Lt(e);G(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const ni="dismissableLayer.update",qf="dismissableLayer.pointerDownOutside",Wf="dismissableLayer.focusOutside";let oc;const Kf=De({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Yf=_e((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:a,onDismiss:c,...u}=e,d=we(Kf),[l,f]=ae(null),h=(n=l==null?void 0:l.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,p]=ae({}),m=On(t,C=>f(C)),y=Array.from(d.layers),[x]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),g=y.indexOf(x),_=l?y.indexOf(l):-1,M=d.layersWithOutsidePointerEventsDisabled.size>0,S=_>=g,F=Gf(C=>{const E=C.target,q=[...d.branches].some(K=>K.contains(E));!S||q||(i==null||i(C),a==null||a(C),C.defaultPrevented||c==null||c())},h),R=Zf(C=>{const E=C.target;[...d.branches].some(K=>K.contains(E))||(s==null||s(C),a==null||a(C),C.defaultPrevented||c==null||c())},h);return Xf(C=>{_===d.layers.size-1&&(o==null||o(C),!C.defaultPrevented&&c&&(C.preventDefault(),c()))},h),G(()=>{if(l)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(oc=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(l)),d.layers.add(l),ic(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=oc)}},[l,h,r,d]),G(()=>()=>{l&&(d.layers.delete(l),d.layersWithOutsidePointerEventsDisabled.delete(l),ic())},[l,d]),G(()=>{const C=()=>p({});return document.addEventListener(ni,C),()=>document.removeEventListener(ni,C)},[]),N(ti.div,Te({},u,{ref:m,style:{pointerEvents:M?S?"auto":"none":void 0,...e.style},onFocusCapture:sn(e.onFocusCapture,R.onFocusCapture),onBlurCapture:sn(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:sn(e.onPointerDownCapture,F.onPointerDownCapture)}))});function Gf(e,t=globalThis==null?void 0:globalThis.document){const n=Lt(e),r=U(!1),o=U(()=>{});return G(()=>{const i=a=>{if(a.target&&!r.current){let u=function(){sc(qf,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=u,t.addEventListener("click",o.current,{once:!0})):u()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Zf(e,t=globalThis==null?void 0:globalThis.document){const n=Lt(e),r=U(!1);return G(()=>{const o=i=>{i.target&&!r.current&&sc(Wf,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function ic(){const e=new CustomEvent(ni);document.dispatchEvent(e)}function sc(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Uf(o,i):o.dispatchEvent(i)}const ri="focusScope.autoFocusOnMount",oi="focusScope.autoFocusOnUnmount",ac={bubbles:!1,cancelable:!0},Jf=_e((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,c]=ae(null),u=Lt(o),d=Lt(i),l=U(null),f=On(t,m=>c(m)),h=U({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;G(()=>{if(r){let m=function(_){if(h.paused||!a)return;const M=_.target;a.contains(M)?l.current=M:mt(l.current,{select:!0})},y=function(_){if(h.paused||!a)return;const M=_.relatedTarget;M!==null&&(a.contains(M)||mt(l.current,{select:!0}))},x=function(_){if(document.activeElement===document.body)for(const S of _)S.removedNodes.length>0&&mt(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",y);const g=new MutationObserver(x);return a&&g.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",y),g.disconnect()}}},[r,a,h.paused]),G(()=>{if(a){uc.add(h);const m=document.activeElement;if(!a.contains(m)){const x=new CustomEvent(ri,ac);a.addEventListener(ri,u),a.dispatchEvent(x),x.defaultPrevented||(Qf(oh(cc(a)),{select:!0}),document.activeElement===m&&mt(a))}return()=>{a.removeEventListener(ri,u),setTimeout(()=>{const x=new CustomEvent(oi,ac);a.addEventListener(oi,d),a.dispatchEvent(x),x.defaultPrevented||mt(m??document.body,{select:!0}),a.removeEventListener(oi,d),uc.remove(h)},0)}}},[a,u,d,h]);const p=me(m=>{if(!n&&!r||h.paused)return;const y=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,x=document.activeElement;if(y&&x){const g=m.currentTarget,[_,M]=eh(g);_&&M?!m.shiftKey&&x===M?(m.preventDefault(),n&&mt(_,{select:!0})):m.shiftKey&&x===_&&(m.preventDefault(),n&&mt(M,{select:!0})):x===g&&m.preventDefault()}},[n,r,h.paused]);return N(ti.div,Te({tabIndex:-1},s,{ref:f,onKeyDown:p}))});function Qf(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(mt(r,{select:t}),document.activeElement!==n)return}function eh(e){const t=cc(e),n=lc(t,e),r=lc(t.reverse(),e);return[n,r]}function cc(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function lc(e,t){for(const n of e)if(!th(n,{upTo:t}))return n}function th(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function nh(e){return e instanceof HTMLInputElement&&"select"in e}function mt(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&nh(e)&&t&&e.select()}}const uc=rh();function rh(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=dc(e,t),e.unshift(t)},remove(t){var n;e=dc(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function dc(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function oh(e){return e.filter(t=>t.tagName!=="A")}function ih(e,t){return br((n,r)=>{const o=t[n][r];return o??n},e)}const ii=e=>{const{present:t,children:n}=e,r=sh(t),o=typeof n=="function"?n({present:r.isPresent}):je.only(n),i=On(r.ref,o.ref);return typeof n=="function"||r.isPresent?pt(o,{ref:i}):null};ii.displayName="Presence";function sh(e){const[t,n]=ae(),r=U({}),o=U(e),i=U("none"),s=e?"mounted":"unmounted",[a,c]=ih(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return G(()=>{const u=Cr(r.current);i.current=a==="mounted"?u:"none"},[a]),Zo(()=>{const u=r.current,d=o.current;if(d!==e){const f=i.current,h=Cr(u);e?c("MOUNT"):h==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&f!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),Zo(()=>{if(t){const u=l=>{const h=Cr(r.current).includes(l.animationName);l.target===t&&h&&Mr(()=>c("ANIMATION_END"))},d=l=>{l.target===t&&(i.current=Cr(r.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:me(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function Cr(e){return(e==null?void 0:e.animationName)||"none"}let si=0;function ah(){G(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:fc()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:fc()),si++,()=>{si===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),si--}},[])}function fc(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var He=function(){return He=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},He.apply(this,arguments)};function hc(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function ch(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var Ar="right-scroll-bar-position",Pr="width-before-scroll-bar",lh="with-scroll-bars-hidden",uh="--removed-body-scroll-bar-size";function dh(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function fh(e,t){var n=ae(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}function hh(e,t){return fh(t||null,function(n){return e.forEach(function(r){return dh(r,n)})})}function ph(e){return e}function mh(e,t){t===void 0&&(t=ph);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var s=t(i,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(i),s=n}var c=function(){var d=s;s=[],d.forEach(i)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(d){s.push(d),u()},filter:function(d){return s=s.filter(d),n}}}};return o}function vh(e){e===void 0&&(e={});var t=mh(null);return t.options=He({async:!0,ssr:!1},e),t}var pc=function(e){var t=e.sideCar,n=hc(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return N(r,He({},n))};pc.isSideCarExport=!0;function gh(e,t){return e.useMedium(t),pc}var mc=vh(),ai=function(){},Er=_e(function(e,t){var n=U(null),r=ae({onScrollCapture:ai,onWheelCapture:ai,onTouchMoveCapture:ai}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,l=e.shards,f=e.sideCar,h=e.noIsolation,p=e.inert,m=e.allowPinchZoom,y=e.as,x=y===void 0?"div":y,g=hc(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),_=f,M=hh([n,t]),S=He(He({},g),o);return N(ue,null,d&&N(_,{sideCar:mc,removeScrollBar:u,shards:l,noIsolation:h,inert:p,setCallbacks:i,allowPinchZoom:!!m,lockRef:n}),s?pt(je.only(a),He(He({},S),{ref:M})):N(x,He({},S,{className:c,ref:M}),a))});Er.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Er.classNames={fullWidth:Pr,zeroRight:Ar};var vc,bh=function(){if(vc)return vc;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function yh(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=bh();return t&&e.setAttribute("nonce",t),e}function wh(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function _h(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var xh=function(){var e=0,t=null;return{add:function(n){e==0&&(t=yh())&&(wh(t,n),_h(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},kh=function(){var e=xh();return function(t,n){G(function(){return e.add(t),function(){e.remove()}},[t&&n])}},gc=function(){var e=kh(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},$h={left:0,top:0,right:0,gap:0},ci=function(e){return parseInt(e||"",10)||0},Sh=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[ci(n),ci(r),ci(o)]},Mh=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return $h;var t=Sh(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Th=gc(),Ch=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
2
2
|
.`.concat(lh,` {
|
|
3
3
|
overflow: hidden `).concat(r,`;
|
|
4
4
|
padding-right: `).concat(a,"px ").concat(r,`;
|
|
@@ -54,4 +54,4 @@ var $y=Object.defineProperty;var Sy=(Pt,Fe,Et)=>Fe in Pt?$y(Pt,Fe,{enumerable:!0
|
|
|
54
54
|
${e.flatMap(n=>Object.entries(n.colors).map(([r,o])=>`--i-${n.name}-${r}: ${ob(o)};`).join(`
|
|
55
55
|
`)).join(`
|
|
56
56
|
`)}
|
|
57
|
-
}`,sb=({_internal_domManager:e=fg(),theme:t})=>Et(({apiClient:n,logger:r,analytics:o})=>{let i=!1;const s=()=>{if(typeof window>"u")return;const a=e.getOrCreateChatbotElement();e.addStyle(dg,"inploi-chatbot-style");const c=ib([{name:"a",colors:xd(t)},{name:"n",colors:xd({hue:t.hue,chroma:.1})}]);e.addStyle(c,"inploi-chatbot-theme"),en(N(jv,{apiClient:n,logger:r,analytics:o}),a),i=!0};return{prepare:async()=>{if(!(typeof window>"u"))try{if(i)return;s(),r.info("Chatbot plugin prepared")}catch(a){console.error(a),r.error("Error preparing chatbot plugin",a)}},startApplication:async({jobId:a})=>{if(!(typeof window>"u"))try{re.cancel(),pf(()=>{nt.value="maximised",re.current$.value={state:"loading"}}),ug({jobId:a,apiClient:n,logger:r}).then(c=>{c.ok?re.start(c.value):re.current$.value={state:"error",error:c.error}}),i||s()}catch(c){console.error(c),r.error("Error starting application",c)}},closeApplication:async()=>{typeof window>"u"||(r.info("Closing application from an external source"),re.cancel())}}});if(!window.inploi)throw new Error("Please insert the SDK script tag above the plugins.");window.inploi.chatbotPlugin=sb;const kd=({node:e,nodes:t,stopWhen:n})=>{if((n==null?void 0:n(e))===!0)return e;const r=e.nextId?t.find(o=>o.id===e.nextId):void 0;if(r)return kd({node:r,nodes:t,stopWhen:n})},ab=({childNode:e,nodes:t})=>{const r=t.filter(o=>o.type==="if-block").find(o=>{if(!o.branchId)return!1;const i=t.find(a=>a.id===o.branchId);if(!i)return!1;const s=kd({node:i,nodes:t,stopWhen:a=>a.id===e.id});return!(!s||s.id!==e.id)});if(r!=null&&r.nextId)return t.find(o=>o.id===r.nextId)},cb=({flow:e,analytics:t,logger:n,context:r,apiClient:o,getSubmissions:i,chatService:s,onFlowEnd:a,onInterpret:c})=>{const u=new AbortController,d=async(l,f)=>{const h=i();c==null||c(l,f);try{await lb({analytics:t,logger:n,apiClient:o,context:r,node:l,submissions:h,chat:{sendMessage:async p=>s.send({groupId:l.id,message:p,signal:u.signal}),userInput:async p=>s.input({input:p,signal:u.signal})},next:p=>{const m=p?e.find(y=>y.id===p):ab({childNode:l,nodes:e});return m?d(m,l):a==null?void 0:a(l)}})}catch(p){if(p instanceof Jn)return;throw p}};return{interpret:async l=>{const f=e.find(h=>h.id===l)??vu(e);return d(f)},abort:()=>{u.abort()}}};async function lb(e){return await tt(e).with({node:{type:"text"}},hb).with({node:{type:"image"}},pb).with({node:{type:"question-text"}},mb).with({node:{type:"question-enum"}},gb).with({node:{type:"question-number"}},vb).with({node:{type:"question-boolean"}},bb).with({node:{type:"question-file"}},wb).with({node:{type:"question-address"}},yb).with({node:{type:"end-flow"}},_b).with({node:{type:"if-block"}},fb).with({node:{type:"jump"}},({node:t,next:n})=>n(t.data.targetId)).with({node:{type:"link"}},db).with({node:{type:"submit"}},ub).exhaustive()}async function ub({chat:e,next:t,node:n,logger:r,apiClient:o,submissions:i,context:s}){await e.userInput({type:"multiple-choice",key:void 0,config:{options:[{label:"Submit my application",value:"submit"}],maxSelected:1,minSelected:1}}),await e.sendMessage({type:"system",variant:"info",text:"Submitting your application…"});const a=await o.fetch("/flow/apply",{method:"POST",body:JSON.stringify({...s,submissions:Lv(i||{})})}).catch(c=>c);await tt(a).with({redirect_url:Ae.string},async c=>{await e.sendMessage({type:"text",author:"bot",text:"Almost there! Please finalise your application on our partner’s website."}),await e.sendMessage({type:"link",href:c.redirect_url,text:"Finalise application on partner"})}).with({message:"Success"},async()=>{await e.sendMessage({type:"system",variant:"success",text:"Application submitted"}),t(n.nextId)}).otherwise(async c=>{r.error(c),await e.sendMessage({type:"system",variant:"error",text:"Failed to submit application"}),t(n.id)})}async function db({chat:e,next:t,node:n}){await e.sendMessage({type:"link",href:n.data.href,text:n.data.cta}),t(n.nextId)}async function fb({submissions:e,next:t,node:n}){const r=xb(n,e)?n.branchId:n.nextId;t(r)}async function hb({chat:e,next:t,node:n}){await e.sendMessage({author:"bot",type:"text",text:n.data.text}),t(n.nextId)}async function pb({chat:e,next:t,node:n}){await e.sendMessage({author:"bot",type:"image",url:n.data.url,height:n.data.height,width:n.data.width}),t(n.nextId)}async function mb({chat:e,next:t,node:n}){await e.sendMessage({author:"bot",type:"text",text:n.data.question});const r=await e.userInput({key:n.data.key,type:"text",config:{placeholder:n.data.placeholder,format:n.data.format}});await e.sendMessage({author:"user",type:"text",text:r.value}),t(n.nextId)}async function vb({chat:e,next:t,node:n}){await e.sendMessage({author:"bot",type:"text",text:n.data.question});const r=await e.userInput({key:n.data.key,type:"text",config:{placeholder:n.data.placeholder,format:"text"}});await e.sendMessage({author:"user",type:"text",text:r.value}),t(n.nextId)}async function gb({chat:e,next:t,node:n}){await e.sendMessage({author:"bot",type:"text",text:n.data.question});const r=await e.userInput({key:n.data.key,type:"multiple-choice",config:n.data});await e.sendMessage({author:"user",type:"text",text:r.value.join(", ")}),t(n.nextId)}async function bb({chat:e,next:t,node:n}){await e.sendMessage({author:"bot",type:"text",text:n.data.question});const o=(await e.userInput({key:n.data.key,type:"boolean",config:{labels:{true:n.data.trueLabel,false:n.data.falseLabel}}})).value,i={true:n.data.trueLabel,false:n.data.falseLabel};await e.sendMessage({author:"user",type:"text",text:i[o]}),t(n.nextId)}async function yb({chat:e,next:t,node:n}){await e.sendMessage({author:"bot",type:"text",text:"Address questions are not implemented yet"}),t(n.nextId)}async function wb({node:e,chat:t,next:n}){await t.sendMessage({author:"bot",type:"text",text:e.data.question});const r=await t.userInput({key:e.data.key,type:"file",config:{extensions:e.data.extensions,fileSizeLimitKib:e.data.maxSizeKb,allowMultiple:e.data.multiple===!0}});for await(const o of r.value)await t.sendMessage({author:"user",type:"file",fileName:o.name,fileSizeKb:o.sizeKb});n(e.nextId)}async function _b({chat:e,next:t,node:n}){await e.sendMessage({type:"system",variant:"info",text:n.data.systemMessage||"Conversation finished"}),t(void 0)}const $d=Ae.union(Ae.string,Ae.array(Ae.string)),xb=(e,t)=>{const n=t==null?void 0:t[e.data.compareKey];return n?tt({...e.data,answer:n}).with({compare:"equals"},({compareValue:r})=>typeof n.value=="string"||typeof n.value=="boolean"?r===n.value.toString():!1).with({compare:"notEquals"},({compareValue:r})=>typeof n.value=="string"||typeof n.value=="boolean"?r!==n.value.toString():!1).with({compare:"contains",answer:{value:$d}},({compareValue:r,answer:o})=>o.value.includes(r)).with({compare:"notContains",answer:{value:$d}},({compareValue:r,answer:o})=>!o.value.includes(r)).with({answer:{type:"file"}},()=>!1).exhaustive():!1},ko=({class:e,...t})=>b("button",{class:Xt("bg-accent-7 active:bg-accent-10 active:text-accent-2 text-lowest pointer-coarse:touch-hitbox focus-visible:ring-accent-7/50 flex-shrink-0 rounded-full p-2 transition-all focus:outline-none focus-visible:ring-4 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:b("svg",{class:"block",width:"16",height:"16",viewBox:"0 0 16 16",fill:"transparent",stroke:"currentColor","stroke-linecap":"round","stroke-width":"2",children:[b("title",{children:"Send"}),b("path",{d:"M3.5 7.5L8 3L12.5 7.5"}),b("path",{d:"M8 4V13"})]})}),Fs=()=>{const e=U(null);return G(()=>{var t;(t=e.current)==null||t.focus()},[]),e},Sd=["true","false"],kb=Qv(Sd),$b="answer",Sb=({input:e,onSubmitSuccess:t,onHeightChange:n})=>{const r=Fs();return n(),b("form",{noValidate:!0,class:"flex items-center gap-2",onSubmit:o=>{o.preventDefault();const i=tt(o).with({nativeEvent:{submitter:Ae.select(Ae.union(Ae.instanceOf(HTMLButtonElement),Ae.instanceOf(HTMLInputElement)))}},a=>a.value).otherwise(()=>{throw new Error("invalid form")}),s=rs(kb,i);t(s)},children:Sd.map((o,i)=>b("button",{ref:i===0?r:null,type:"submit",name:$b,value:o,class:"bg-lowest ease-expo-out ring-neutral-12/5 text-neutral-12 active:ring-accent-7 active:bg-accent-2 active:text-accent-11 fr block flex-1 overflow-hidden rounded-2xl px-2.5 py-2.5 ring-2 transition-all duration-300 selection:bg-transparent",children:b("p",{class:"truncate text-center text-base",children:e.config.labels[o]})}))})},Ds=({error:e,onAnimationComplete:t})=>b(to,{children:e&&b(Kn.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},onAnimationComplete:t,role:"alert",class:"text-error-11 flex max-w-full items-center gap-1 overflow-hidden rounded-full p-0.5 px-1 opacity-0",children:[b("svg",{class:"text-error-10",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[b("circle",{cx:"8",cy:"8",r:"6.3",stroke:"currentColor","stroke-width":"1.4"}),b("rect",{x:"7",y:"4",width:"2",height:"5",fill:"currentColor"}),b("rect",{x:"7",y:"10",width:"2",height:"2",fill:"currentColor"})]}),b("p",{class:"truncate pr-1 text-sm",children:e.message})]})}),Mb=e=>new Promise((t,n)=>{const r=new FileReader;r.readAsDataURL(e),r.onload=()=>r.result?t(r.result.toString()):n("No result from reader"),r.onerror=n}),$o=e=>tt(e).with(Ae.number.lte(1e3),()=>`${Math.round(e)}KB`).with(Ae.number.lt(1e3*10),()=>`${(e/1e3).toFixed(1)}MB`).otherwise(()=>`${Math.round(e/1e3)}MB`),Tb=e=>e.reduce((t,n)=>t+n.sizeKb,0),Cb=ts("file"),Md=3,Ab=({file:e,class:t,...n})=>{const r=e.name.split(".").pop(),o=e.name.replace(new RegExp(`.${r}$`),"");return b("div",{class:Xt("bg-accent-1 outline-neutral-4 flex max-w-full gap-2 overflow-hidden rounded-lg px-3 py-2 text-sm outline",t),...n,children:[b("p",{"aria-label":"File name",class:"text-accent-12 flex flex-grow overflow-hidden",children:[b("span",{class:"block truncate",children:o}),b("span",{children:[".",r]})]}),b("p",{"aria-label":"File size",class:"text-neutral-10",children:$o(e.sizeKb)})]})},Td=({class:e,...t})=>b("li",{class:Xt("outline-neutral-6 text-neutral-11 bg-neutral-1 block rounded-md px-1 py-0.5 text-xs outline outline-1",e),...t}),Pb=({input:e,onSubmitSuccess:t,onHeightChange:n})=>{var l;const r=(l=re.current$.value.application)==null?void 0:l.data.submissions[e.key],[o,i]=ae(Cb(r)?r.value:[]),[s,a]=ae(),c=o.length-Md,u=Tb(o),d=Fs();return b("form",{class:"flex flex-col gap-1",onSubmit:f=>(f.preventDefault(),a(void 0),o.length===0&&a({type:"required",message:"Please select a file"}),e.config.fileSizeLimitKib&&u>e.config.fileSizeLimitKib&&a({type:"max",message:`File size exceeds limit of ${$o(e.config.fileSizeLimitKib)}`}),t(o)),children:[b("div",{class:"flex items-center gap-2",children:[b("label",{ref:d,for:"dropzone-file",class:"border-neutral-8 bg-neutral-2 flex h-48 w-full cursor-pointer flex-col items-center justify-center overflow-hidden rounded-2xl border border-dashed p-4",children:[o.length>0?b(ue,{children:[b("ul",{class:"flex max-w-full flex-wrap justify-center gap-1 overflow-hidden p-1",children:[o.slice(0,Md).map(f=>{const h=f.name.split(".").pop(),p=f.name.replace(new RegExp(`.${h}$`),"");return b(Td,{class:"flex overflow-hidden",children:[b("span",{class:"block truncate",children:p}),b("span",{children:[".",h]})]})}),c>0?b(Td,{children:["+",c," file",c!==1?"s":""]}):null]}),b("p",{class:"text-neutral-11 text-xs",children:[$o(u)," ",o.length>1?"total":""]})]}):b("div",{class:"flex flex-col justify-center gap-4 pb-6 pt-5",children:[b("header",{class:"flex flex-col items-center gap-0",children:[b("svg",{class:"text-neutral-11 mb-1 h-8 w-8","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 16",children:b("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M13 13h3a3 3 0 0 0 0-6h-.025A5.56 5.56 0 0 0 16 6.5 5.5 5.5 0 0 0 5.207 5.021C5.137 5.017 5.071 5 5 5a4 4 0 0 0 0 8h2.167M10 15V6m0 0L8 8m2-2 2 2"})}),b("p",{class:"text-neutral-12 tracking-[-0.01em] dark:text-gray-400",children:[e.config.allowMultiple?"Select files":"Select a file"," to upload"]}),e.config.fileSizeLimitKib?b("p",{class:"text-neutral-10 text-xs",children:["(max ",$o(e.config.fileSizeLimitKib),")"]}):null]}),b("aside",{class:"flex flex-col items-center gap-2",children:[b("p",{id:"accepted-filetypes",class:"sr-only",children:"Accepted file extensions"}),b("ul",{"aria-describedby":"accepted-filetypes",class:"flex flex-wrap justify-center gap-2",children:e.config.extensions.map(f=>b("li",{class:"ring-lowest outline-neutral-6 text-neutral-9 bg-neutral-1 rounded-md px-1 py-0.5 text-[11px] uppercase tracking-wide outline outline-1 ring-2",children:f.replace(".","")}))})]})]}),b("input",{id:"dropzone-file",onInput:async f=>{Fe(f.target instanceof HTMLInputElement);const h=f.target.files?Array.from(f.target.files):[],p=await Promise.allSettled(h.map(async y=>{const x=await Mb(y);return{name:y.name,data:x,sizeKb:y.size/1e3}}));if(p.some(({status:y})=>y==="rejected"))return a({type:"invalid",message:"Invalid file"});const m=p.map(y=>y.status==="fulfilled"?y.value:null).filter(Boolean);i(m)},multiple:e.config.allowMultiple,type:"file",class:"sr-only"})]}),b(ko,{disabled:o.length===0})]}),s&&b(Ds,{onAnimationComplete:n,error:s})]})};var lr=e=>e.type==="checkbox",Sn=e=>e instanceof Date,Me=e=>e==null;const Cd=e=>typeof e=="object";var fe=e=>!Me(e)&&!Array.isArray(e)&&Cd(e)&&!Sn(e),Eb=e=>fe(e)&&e.target?lr(e.target)?e.target.checked:e.target.value:e,Vb=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Ob=(e,t)=>e.has(Vb(t)),Lb=e=>{const t=e.constructor&&e.constructor.prototype;return fe(t)&&t.hasOwnProperty("isPrototypeOf")},Is=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function at(e){let t;const n=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(Is&&(e instanceof Blob||e instanceof FileList))&&(n||fe(e)))if(t=n?[]:{},!n&&!Lb(e))t=e;else for(const r in e)e.hasOwnProperty(r)&&(t[r]=at(e[r]));else return e;return t}var ur=e=>Array.isArray(e)?e.filter(Boolean):[],ie=e=>e===void 0,O=(e,t,n)=>{if(!t||!fe(e))return n;const r=ur(t.split(/[,[\].]+?/)).reduce((o,i)=>Me(o)?o:o[i],e);return ie(r)||r===e?ie(e[t])?n:e[t]:r},Mt=e=>typeof e=="boolean";const Ad={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},ze={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},ct={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"};Ie.createContext(null);var Rb=(e,t,n,r=!0)=>{const o={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(o,i,{get:()=>{const s=i;return t._proxyFormState[s]!==ze.all&&(t._proxyFormState[s]=!r||ze.all),n&&(n[s]=!0),e[s]}});return o},Oe=e=>fe(e)&&!Object.keys(e).length,Nb=(e,t,n,r)=>{n(e);const{name:o,...i}=e;return Oe(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(s=>t[s]===(!r||ze.all))},zs=e=>Array.isArray(e)?e:[e];function Fb(e){const t=Ie.useRef(e);t.current=e,Ie.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}var Ye=e=>typeof e=="string",Db=(e,t,n,r,o)=>Ye(e)?(r&&t.watch.add(e),O(n,e,o)):Array.isArray(e)?e.map(i=>(r&&t.watch.add(i),O(n,i))):(r&&(t.watchAll=!0),n),Bs=e=>/^\w*$/.test(e),Pd=e=>ur(e.replace(/["|']|\]/g,"").split(/\.|\[/));function Q(e,t,n){let r=-1;const o=Bs(t)?[t]:Pd(t),i=o.length,s=i-1;for(;++r<i;){const a=o[r];let c=n;if(r!==s){const u=e[a];c=fe(u)||Array.isArray(u)?u:isNaN(+o[r+1])?{}:[]}e[a]=c,e=e[a]}return e}var Ed=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},Vd=e=>({isOnSubmit:!e||e===ze.onSubmit,isOnBlur:e===ze.onBlur,isOnChange:e===ze.onChange,isOnAll:e===ze.all,isOnTouch:e===ze.onTouched}),Od=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const So=(e,t,n,r)=>{for(const o of n||Object.keys(e)){const i=O(e,o);if(i){const{_f:s,...a}=i;if(s){if(s.refs&&s.refs[0]&&t(s.refs[0],o)&&!r)break;if(s.ref&&t(s.ref,s.name)&&!r)break}else fe(a)&&So(a,t)}}};var Ib=(e,t,n)=>{const r=ur(O(e,n));return Q(r,"root",t[n]),Q(e,n,r),e},js=e=>e.type==="file",Tt=e=>typeof e=="function",Mo=e=>{if(!Is)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},To=e=>Ye(e),Hs=e=>e.type==="radio",Co=e=>e instanceof RegExp;const Ld={value:!1,isValid:!1},Rd={value:!0,isValid:!0};var Nd=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!ie(e[0].attributes.value)?ie(e[0].value)||e[0].value===""?Rd:{value:e[0].value,isValid:!0}:Rd:Ld}return Ld};const Fd={isValid:!1,value:null};var Dd=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,Fd):Fd;function Id(e,t,n="validate"){if(To(e)||Array.isArray(e)&&e.every(To)||Mt(e)&&!e)return{type:n,message:To(e)?e:"",ref:t}}var Mn=e=>fe(e)&&!Co(e)?e:{value:e,message:""},zd=async(e,t,n,r,o)=>{const{ref:i,refs:s,required:a,maxLength:c,minLength:u,min:d,max:l,pattern:f,validate:h,name:p,valueAsNumber:m,mount:y,disabled:x}=e._f,g=O(t,p);if(!y||x)return{};const _=s?s[0]:i,M=j=>{r&&_.reportValidity&&(_.setCustomValidity(Mt(j)?"":j||""),_.reportValidity())},S={},F=Hs(i),R=lr(i),C=F||R,E=(m||js(i))&&ie(i.value)&&ie(g)||Mo(i)&&i.value===""||g===""||Array.isArray(g)&&!g.length,q=Ed.bind(null,p,n,S),K=(j,B,H,X=ct.maxLength,ne=ct.minLength)=>{const se=j?B:H;S[p]={type:j?X:ne,message:se,ref:i,...q(j?X:ne,se)}};if(o?!Array.isArray(g)||!g.length:a&&(!C&&(E||Me(g))||Mt(g)&&!g||R&&!Nd(s).isValid||F&&!Dd(s).isValid)){const{value:j,message:B}=To(a)?{value:!!a,message:a}:Mn(a);if(j&&(S[p]={type:ct.required,message:B,ref:_,...q(ct.required,B)},!n))return M(B),S}if(!E&&(!Me(d)||!Me(l))){let j,B;const H=Mn(l),X=Mn(d);if(!Me(g)&&!isNaN(g)){const ne=i.valueAsNumber||g&&+g;Me(H.value)||(j=ne>H.value),Me(X.value)||(B=ne<X.value)}else{const ne=i.valueAsDate||new Date(g),se=lt=>new Date(new Date().toDateString()+" "+lt),Le=i.type=="time",Re=i.type=="week";Ye(H.value)&&g&&(j=Le?se(g)>se(H.value):Re?g>H.value:ne>new Date(H.value)),Ye(X.value)&&g&&(B=Le?se(g)<se(X.value):Re?g<X.value:ne<new Date(X.value))}if((j||B)&&(K(!!j,H.message,X.message,ct.max,ct.min),!n))return M(S[p].message),S}if((c||u)&&!E&&(Ye(g)||o&&Array.isArray(g))){const j=Mn(c),B=Mn(u),H=!Me(j.value)&&g.length>+j.value,X=!Me(B.value)&&g.length<+B.value;if((H||X)&&(K(H,j.message,B.message),!n))return M(S[p].message),S}if(f&&!E&&Ye(g)){const{value:j,message:B}=Mn(f);if(Co(j)&&!g.match(j)&&(S[p]={type:ct.pattern,message:B,ref:i,...q(ct.pattern,B)},!n))return M(B),S}if(h){if(Tt(h)){const j=await h(g,t),B=Id(j,_);if(B&&(S[p]={...B,...q(ct.validate,B.message)},!n))return M(B.message),S}else if(fe(h)){let j={};for(const B in h){if(!Oe(j)&&!n)break;const H=Id(await h[B](g,t),_,B);H&&(j={...H,...q(B,H.message)},M(H.message),n&&(S[p]=j))}if(!Oe(j)&&(S[p]={ref:_,...j},!n))return S}}return M(!0),S};function zb(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=ie(e)?r++:e[t[r++]];return e}function Bb(e){for(const t in e)if(e.hasOwnProperty(t)&&!ie(e[t]))return!1;return!0}function ye(e,t){const n=Array.isArray(t)?t:Bs(t)?[t]:Pd(t),r=n.length===1?e:zb(e,n),o=n.length-1,i=n[o];return r&&delete r[i],o!==0&&(fe(r)&&Oe(r)||Array.isArray(r)&&Bb(r))&&ye(e,n.slice(0,-1)),e}function Us(){let e=[];return{get observers(){return e},next:o=>{for(const i of e)i.next&&i.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(i=>i!==o)}}),unsubscribe:()=>{e=[]}}}var Ao=e=>Me(e)||!Cd(e);function Yt(e,t){if(Ao(e)||Ao(t))return e===t;if(Sn(e)&&Sn(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n){const i=e[o];if(!r.includes(o))return!1;if(o!=="ref"){const s=t[o];if(Sn(i)&&Sn(s)||fe(i)&&fe(s)||Array.isArray(i)&&Array.isArray(s)?!Yt(i,s):i!==s)return!1}}return!0}var Bd=e=>e.type==="select-multiple",jb=e=>Hs(e)||lr(e),Xs=e=>Mo(e)&&e.isConnected,jd=e=>{for(const t in e)if(Tt(e[t]))return!0;return!1};function Po(e,t={}){const n=Array.isArray(e);if(fe(e)||n)for(const r in e)Array.isArray(e[r])||fe(e[r])&&!jd(e[r])?(t[r]=Array.isArray(e[r])?[]:{},Po(e[r],t[r])):Me(e[r])||(t[r]=!0);return t}function Hd(e,t,n){const r=Array.isArray(e);if(fe(e)||r)for(const o in e)Array.isArray(e[o])||fe(e[o])&&!jd(e[o])?ie(t)||Ao(n[o])?n[o]=Array.isArray(e[o])?Po(e[o],[]):{...Po(e[o])}:Hd(e[o],Me(t)?{}:t[o],n[o]):n[o]=!Yt(e[o],t[o]);return n}var qs=(e,t)=>Hd(e,t,Po(t)),Ud=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>ie(e)?e:t?e===""?NaN:e&&+e:n&&Ye(e)?new Date(e):r?r(e):e;function Ws(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return js(t)?t.files:Hs(t)?Dd(e.refs).value:Bd(t)?[...t.selectedOptions].map(({value:n})=>n):lr(t)?Nd(e.refs).value:Ud(ie(t.value)?e.ref.value:t.value,e)}var Hb=(e,t,n,r)=>{const o={};for(const i of e){const s=O(t,i);s&&Q(o,i,s._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},dr=e=>ie(e)?e:Co(e)?e.source:fe(e)?Co(e.value)?e.value.source:e.value:e,Ub=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function Xd(e,t,n){const r=O(e,n);if(r||Bs(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const i=o.join("."),s=O(t,i),a=O(e,i);if(s&&!Array.isArray(s)&&n!==i)return{name:n};if(a&&a.type)return{name:i,error:a};o.pop()}return{name:n}}var Xb=(e,t,n,r,o)=>o.isOnAll?!1:!n&&o.isOnTouch?!(t||e):(n?r.isOnBlur:o.isOnBlur)?!e:(n?r.isOnChange:o.isOnChange)?e:!0,qb=(e,t)=>!ur(O(e,t)).length&&ye(e,t);const Wb={mode:ze.onSubmit,reValidateMode:ze.onChange,shouldFocusError:!0};function Kb(e={},t){let n={...Wb,...e},r={submitCount:0,isDirty:!1,isLoading:Tt(n.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:{},disabled:!1},o={},i=fe(n.defaultValues)||fe(n.values)?at(n.defaultValues||n.values)||{}:{},s=n.shouldUnregister?{}:at(i),a={action:!1,mount:!1,watch:!1},c={mount:new Set,unMount:new Set,array:new Set,watch:new Set},u,d=0;const l={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},f={values:Us(),array:Us(),state:Us()},h=e.resetOptions&&e.resetOptions.keepDirtyValues,p=Vd(n.mode),m=Vd(n.reValidateMode),y=n.criteriaMode===ze.all,x=v=>w=>{clearTimeout(d),d=setTimeout(v,w)},g=async v=>{if(l.isValid||v){const w=n.resolver?Oe((await E()).errors):await K(o,!0);w!==r.isValid&&f.state.next({isValid:w})}},_=v=>l.isValidating&&f.state.next({isValidating:v}),M=(v,w=[],k,L,P=!0,T=!0)=>{if(L&&k){if(a.action=!0,T&&Array.isArray(O(o,v))){const D=k(O(o,v),L.argA,L.argB);P&&Q(o,v,D)}if(T&&Array.isArray(O(r.errors,v))){const D=k(O(r.errors,v),L.argA,L.argB);P&&Q(r.errors,v,D),qb(r.errors,v)}if(l.touchedFields&&T&&Array.isArray(O(r.touchedFields,v))){const D=k(O(r.touchedFields,v),L.argA,L.argB);P&&Q(r.touchedFields,v,D)}l.dirtyFields&&(r.dirtyFields=qs(i,s)),f.state.next({name:v,isDirty:B(v,w),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else Q(s,v,w)},S=(v,w)=>{Q(r.errors,v,w),f.state.next({errors:r.errors})},F=(v,w,k,L)=>{const P=O(o,v);if(P){const T=O(s,v,ie(k)?O(i,v):k);ie(T)||L&&L.defaultChecked||w?Q(s,v,w?T:Ws(P._f)):ne(v,T),a.mount&&g()}},R=(v,w,k,L,P)=>{let T=!1,D=!1;const ee={name:v};if(!k||L){l.isDirty&&(D=r.isDirty,r.isDirty=ee.isDirty=B(),T=D!==ee.isDirty);const le=Yt(O(i,v),w);D=O(r.dirtyFields,v),le?ye(r.dirtyFields,v):Q(r.dirtyFields,v,!0),ee.dirtyFields=r.dirtyFields,T=T||l.dirtyFields&&D!==!le}if(k){const le=O(r.touchedFields,v);le||(Q(r.touchedFields,v,k),ee.touchedFields=r.touchedFields,T=T||l.touchedFields&&le!==k)}return T&&P&&f.state.next(ee),T?ee:{}},C=(v,w,k,L)=>{const P=O(r.errors,v),T=l.isValid&&Mt(w)&&r.isValid!==w;if(e.delayError&&k?(u=x(()=>S(v,k)),u(e.delayError)):(clearTimeout(d),u=null,k?Q(r.errors,v,k):ye(r.errors,v)),(k?!Yt(P,k):P)||!Oe(L)||T){const D={...L,...T&&Mt(w)?{isValid:w}:{},errors:r.errors,name:v};r={...r,...D},f.state.next(D)}_(!1)},E=async v=>n.resolver(s,n.context,Hb(v||c.mount,o,n.criteriaMode,n.shouldUseNativeValidation)),q=async v=>{const{errors:w}=await E(v);if(v)for(const k of v){const L=O(w,k);L?Q(r.errors,k,L):ye(r.errors,k)}else r.errors=w;return w},K=async(v,w,k={valid:!0})=>{for(const L in v){const P=v[L];if(P){const{_f:T,...D}=P;if(T){const ee=c.array.has(T.name),le=await zd(P,s,y,n.shouldUseNativeValidation&&!w,ee);if(le[T.name]&&(k.valid=!1,w))break;!w&&(O(le,T.name)?ee?Ib(r.errors,le,T.name):Q(r.errors,T.name,le[T.name]):ye(r.errors,T.name))}D&&await K(D,w,k)}}return k.valid},j=()=>{for(const v of c.unMount){const w=O(o,v);w&&(w._f.refs?w._f.refs.every(k=>!Xs(k)):!Xs(w._f.ref))&&Ze(v)}c.unMount=new Set},B=(v,w)=>(v&&w&&Q(s,v,w),!Yt(Ne(),i)),H=(v,w,k)=>Db(v,c,{...a.mount?s:ie(w)?i:Ye(v)?{[v]:w}:w},k,w),X=v=>ur(O(a.mount?s:i,v,e.shouldUnregister?O(i,v,[]):[])),ne=(v,w,k={})=>{const L=O(o,v);let P=w;if(L){const T=L._f;T&&(!T.disabled&&Q(s,v,Ud(w,T)),P=Mo(T.ref)&&Me(w)?"":w,Bd(T.ref)?[...T.ref.options].forEach(D=>D.selected=P.includes(D.value)):T.refs?lr(T.ref)?T.refs.length>1?T.refs.forEach(D=>(!D.defaultChecked||!D.disabled)&&(D.checked=Array.isArray(P)?!!P.find(ee=>ee===D.value):P===D.value)):T.refs[0]&&(T.refs[0].checked=!!P):T.refs.forEach(D=>D.checked=D.value===P):js(T.ref)?T.ref.value="":(T.ref.value=P,T.ref.type||f.values.next({name:v,values:{...s}})))}(k.shouldDirty||k.shouldTouch)&&R(v,P,k.shouldTouch,k.shouldDirty,!0),k.shouldValidate&&Y(v)},se=(v,w,k)=>{for(const L in w){const P=w[L],T=`${v}.${L}`,D=O(o,T);(c.array.has(v)||!Ao(P)||D&&!D._f)&&!Sn(P)?se(T,P,k):ne(T,P,k)}},Le=(v,w,k={})=>{const L=O(o,v),P=c.array.has(v),T=at(w);Q(s,v,T),P?(f.array.next({name:v,values:{...s}}),(l.isDirty||l.dirtyFields)&&k.shouldDirty&&f.state.next({name:v,dirtyFields:qs(i,s),isDirty:B(v,T)})):L&&!L._f&&!Me(T)?se(v,T,k):ne(v,T,k),Od(v,c)&&f.state.next({...r}),f.values.next({name:v,values:{...s}}),!a.mount&&t()},Re=async v=>{const w=v.target;let k=w.name,L=!0;const P=O(o,k),T=()=>w.type?Ws(P._f):Eb(v),D=ee=>{L=Number.isNaN(ee)||ee===O(s,k,ee)};if(P){let ee,le;const Lo=T(),Tn=v.type===Ad.BLUR||v.type===Ad.FOCUS_OUT,_y=!Ub(P._f)&&!n.resolver&&!O(r.errors,k)&&!P._f.deps||Xb(Tn,O(r.touchedFields,k),r.isSubmitted,m,p),Ks=Od(k,c,Tn);Q(s,k,Lo),Tn?(P._f.onBlur&&P._f.onBlur(v),u&&u(0)):P._f.onChange&&P._f.onChange(v);const Ys=R(k,Lo,Tn,!1),xy=!Oe(Ys)||Ks;if(!Tn&&f.values.next({name:k,type:v.type,values:{...s}}),_y)return l.isValid&&g(),xy&&f.state.next({name:k,...Ks?{}:Ys});if(!Tn&&Ks&&f.state.next({...r}),_(!0),n.resolver){const{errors:ef}=await E([k]);if(D(Lo),L){const ky=Xd(r.errors,o,k),tf=Xd(ef,o,ky.name||k);ee=tf.error,k=tf.name,le=Oe(ef)}}else ee=(await zd(P,s,y,n.shouldUseNativeValidation))[k],D(Lo),L&&(ee?le=!1:l.isValid&&(le=await K(o,!0)));L&&(P._f.deps&&Y(P._f.deps),C(k,le,ee,Ys))}},lt=(v,w)=>{if(O(r.errors,w)&&v.focus)return v.focus(),1},Y=async(v,w={})=>{let k,L;const P=zs(v);if(_(!0),n.resolver){const T=await q(ie(v)?v:P);k=Oe(T),L=v?!P.some(D=>O(T,D)):k}else v?(L=(await Promise.all(P.map(async T=>{const D=O(o,T);return await K(D&&D._f?{[T]:D}:D)}))).every(Boolean),!(!L&&!r.isValid)&&g()):L=k=await K(o);return f.state.next({...!Ye(v)||l.isValid&&k!==r.isValid?{}:{name:v},...n.resolver||!v?{isValid:k}:{},errors:r.errors,isValidating:!1}),w.shouldFocus&&!L&&So(o,lt,v?P:c.mount),L},Ne=v=>{const w={...i,...a.mount?s:{}};return ie(v)?w:Ye(v)?O(w,v):v.map(k=>O(w,k))},Ct=(v,w)=>({invalid:!!O((w||r).errors,v),isDirty:!!O((w||r).dirtyFields,v),isTouched:!!O((w||r).touchedFields,v),error:O((w||r).errors,v)}),At=v=>{v&&zs(v).forEach(w=>ye(r.errors,w)),f.state.next({errors:v?r.errors:{}})},Gt=(v,w,k)=>{const L=(O(o,v,{_f:{}})._f||{}).ref;Q(r.errors,v,{...w,ref:L}),f.state.next({name:v,errors:r.errors,isValid:!1}),k&&k.shouldFocus&&L&&L.focus&&L.focus()},Ge=(v,w)=>Tt(v)?f.values.subscribe({next:k=>v(H(void 0,w),k)}):H(v,w,!0),Ze=(v,w={})=>{for(const k of v?zs(v):c.mount)c.mount.delete(k),c.array.delete(k),w.keepValue||(ye(o,k),ye(s,k)),!w.keepError&&ye(r.errors,k),!w.keepDirty&&ye(r.dirtyFields,k),!w.keepTouched&&ye(r.touchedFields,k),!n.shouldUnregister&&!w.keepDefaultValue&&ye(i,k);f.values.next({values:{...s}}),f.state.next({...r,...w.keepDirty?{isDirty:B()}:{}}),!w.keepIsValid&&g()},Vo=({disabled:v,name:w,field:k,fields:L,value:P})=>{if(Mt(v)){const T=v?void 0:ie(P)?Ws(k?k._f:O(L,w)._f):P;Q(s,w,T),R(w,T,!1,!1,!0)}},Zt=(v,w={})=>{let k=O(o,v);const L=Mt(w.disabled);return Q(o,v,{...k||{},_f:{...k&&k._f?k._f:{ref:{name:v}},name:v,mount:!0,...w}}),c.mount.add(v),k?Vo({field:k,disabled:w.disabled,name:v}):F(v,!0,w.value),{...L?{disabled:w.disabled}:{},...n.progressive?{required:!!w.required,min:dr(w.min),max:dr(w.max),minLength:dr(w.minLength),maxLength:dr(w.maxLength),pattern:dr(w.pattern)}:{},name:v,onChange:Re,onBlur:Re,ref:P=>{if(P){Zt(v,w),k=O(o,v);const T=ie(P.value)&&P.querySelectorAll&&P.querySelectorAll("input,select,textarea")[0]||P,D=jb(T),ee=k._f.refs||[];if(D?ee.find(le=>le===T):T===k._f.ref)return;Q(o,v,{_f:{...k._f,...D?{refs:[...ee.filter(Xs),T,...Array.isArray(O(i,v))?[{}]:[]],ref:{type:T.type,name:v}}:{ref:T}}}),F(v,!1,void 0,T)}else k=O(o,v,{}),k._f&&(k._f.mount=!1),(n.shouldUnregister||w.shouldUnregister)&&!(Ob(c.array,v)&&a.action)&&c.unMount.add(v)}}},Jt=()=>n.shouldFocusError&&So(o,lt,c.mount),ut=v=>{Mt(v)&&(f.state.next({disabled:v}),So(o,w=>{w.disabled=v},0,!1))},fr=(v,w)=>async k=>{k&&(k.preventDefault&&k.preventDefault(),k.persist&&k.persist());let L=at(s);if(f.state.next({isSubmitting:!0}),n.resolver){const{errors:P,values:T}=await E();r.errors=P,L=T}else await K(o);ye(r.errors,"root"),Oe(r.errors)?(f.state.next({errors:{}}),await v(L,k)):(w&&await w({...r.errors},k),Jt(),setTimeout(Jt)),f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Oe(r.errors),submitCount:r.submitCount+1,errors:r.errors})},Oo=(v,w={})=>{O(o,v)&&(ie(w.defaultValue)?Le(v,O(i,v)):(Le(v,w.defaultValue),Q(i,v,w.defaultValue)),w.keepTouched||ye(r.touchedFields,v),w.keepDirty||(ye(r.dirtyFields,v),r.isDirty=w.defaultValue?B(v,O(i,v)):B()),w.keepError||(ye(r.errors,v),l.isValid&&g()),f.state.next({...r}))},Jd=(v,w={})=>{const k=v?at(v):i,L=at(k),P=v&&!Oe(v)?L:i;if(w.keepDefaultValues||(i=k),!w.keepValues){if(w.keepDirtyValues||h)for(const T of c.mount)O(r.dirtyFields,T)?Q(P,T,O(s,T)):Le(T,O(P,T));else{if(Is&&ie(v))for(const T of c.mount){const D=O(o,T);if(D&&D._f){const ee=Array.isArray(D._f.refs)?D._f.refs[0]:D._f.ref;if(Mo(ee)){const le=ee.closest("form");if(le){le.reset();break}}}}o={}}s=e.shouldUnregister?w.keepDefaultValues?at(i):{}:at(P),f.array.next({values:{...P}}),f.values.next({values:{...P}})}c={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},!a.mount&&t(),a.mount=!l.isValid||!!w.keepIsValid,a.watch=!!e.shouldUnregister,f.state.next({submitCount:w.keepSubmitCount?r.submitCount:0,isDirty:w.keepDirty?r.isDirty:!!(w.keepDefaultValues&&!Yt(v,i)),isSubmitted:w.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:w.keepDirtyValues?r.dirtyFields:w.keepDefaultValues&&v?qs(i,v):{},touchedFields:w.keepTouched?r.touchedFields:{},errors:w.keepErrors?r.errors:{},isSubmitSuccessful:w.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},Qd=(v,w)=>Jd(Tt(v)?v(s):v,w);return{control:{register:Zt,unregister:Ze,getFieldState:Ct,handleSubmit:fr,setError:Gt,_executeSchema:E,_getWatch:H,_getDirty:B,_updateValid:g,_removeUnmounted:j,_updateFieldArray:M,_updateDisabledField:Vo,_getFieldArray:X,_reset:Jd,_resetDefaultValues:()=>Tt(n.defaultValues)&&n.defaultValues().then(v=>{Qd(v,n.resetOptions),f.state.next({isLoading:!1})}),_updateFormState:v=>{r={...r,...v}},_disableForm:ut,_subjects:f,_proxyFormState:l,get _fields(){return o},get _formValues(){return s},get _state(){return a},set _state(v){a=v},get _defaultValues(){return i},get _names(){return c},set _names(v){c=v},get _formState(){return r},set _formState(v){r=v},get _options(){return n},set _options(v){n={...n,...v}}},trigger:Y,register:Zt,handleSubmit:fr,watch:Ge,setValue:Le,getValues:Ne,reset:Qd,resetField:Oo,clearErrors:At,unregister:Ze,setError:Gt,setFocus:(v,w={})=>{const k=O(o,v),L=k&&k._f;if(L){const P=L.refs?L.refs[0]:L.ref;P.focus&&(P.focus(),w.shouldSelect&&P.select())}},getFieldState:Ct}}function qd(e={}){const t=Ie.useRef(),n=Ie.useRef(),[r,o]=Ie.useState({isDirty:!1,isValidating:!1,isLoading:Tt(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:{},disabled:!1,defaultValues:Tt(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...Kb(e,()=>o(s=>({...s}))),formState:r});const i=t.current.control;return i._options=e,Fb({subject:i._subjects.state,next:s=>{Nb(s,i._proxyFormState,i._updateFormState,!0)&&o({...i._formState})}}),Ie.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),Ie.useEffect(()=>{if(i._proxyFormState.isDirty){const s=i._getDirty();s!==r.isDirty&&i._subjects.state.next({isDirty:s})}},[i,r.isDirty]),Ie.useEffect(()=>{e.values&&!Yt(e.values,n.current)?(i._reset(e.values,i._options.resetOptions),n.current=e.values):i._resetDefaultValues()},[e.values,i]),Ie.useEffect(()=>{i._state.mount||(i._updateValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),t.current.formState=Rb(r,i),t.current}var Wd=function(e,t,n){if(e&&"reportValidity"in e){var r=O(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},Yb=function(e,t){var n=function(o){var i=t.fields[o];i&&i.ref&&"reportValidity"in i.ref?Wd(i.ref,o,e):i.refs&&i.refs.forEach(function(s){return Wd(s,o,e)})};for(var r in t.fields)n(r)},Gb=function(e,t){t.shouldUseNativeValidation&&Yb(e,t);var n={};for(var r in e){var o=O(t.fields,r),i=Object.assign(e[r]||{},{ref:o&&o.ref});if(Jb(t.names||Object.keys(e),r)){var s=Object.assign({},Zb(O(n,r)));Q(s,"root",i),Q(n,r,s)}else Q(n,r,i)}return n},Zb=function(e){return Array.isArray(e)?e.filter(Boolean):[]},Jb=function(e,t){return e.some(function(n){return n.startsWith(t+".")})},Qb=function(e,t){for(var n={};e.issues.length;){var r=e.issues[0];if(r.path){var o=r.path.map(function(a){return a.key}).join(".");if(n[o]||(n[o]={message:r.message,type:r.validation}),t){var i=n[o].types,s=i&&i[r.validation];n[o]=Ed(o,t,n,r.validation,s?[].concat(s,r.message):r.message)}e.issues.shift()}}return n},Kd=function(e,t,n){return n===void 0&&(n={}),function(r,o,i){try{return Promise.resolve(function(s,a){try{var c=function(){function u(l){return{values:n.raw?r:l,errors:{}}}var d=Object.assign({},{abortEarly:!1,abortPipeEarly:!1},t);return n.mode==="sync"?u(rs(e,r,d)):Promise.resolve(rg(e,r,d)).then(u)}()}catch(u){return a(u)}return c&&c.then?c.then(void 0,a):c}(0,function(s){if(s instanceof so)return{values:{},errors:Gb(Qb(s,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw s}))}catch(s){return Promise.reject(s)}}};const ey=e=>{const t=Object.fromEntries(new FormData(e).entries());Object.keys(t).length&&e.dispatchEvent(new Event("submit",{bubbles:!0}))},ty=ts("multiple-choice"),ny=e=>{const t={min:e.minSelected??0,max:e.maxSelected??e.options.length};return Kd(gn({checked:ku(ng(Gv()),n=>Object.entries(n).filter(([r,o])=>o).map(([r,o])=>r),[sg(t.max,`Please select at most ${t.max} option${t.max!==1?"s":""}`),$u(t.min,`Please select at least ${t.min} option${t.min!==1?"s":""}`)])}))},ry=({input:e,onSubmitSuccess:t,onHeightChange:n})=>{var u,d;const r=e.key?(u=re.current$.value.application)==null?void 0:u.data.submissions[e.key]:void 0,{register:o,handleSubmit:i,formState:{errors:s}}=qd({defaultValues:{checked:ty(r)?Object.fromEntries(r.value.map(l=>[l,!0])):{}},resolver:ny(e.config)}),a=Fs(),c=e.config.minSelected===1&&e.config.maxSelected===1;return b("form",{noValidate:!0,class:"flex flex-col gap-1",onChange:l=>{c&&ey(l.currentTarget)},onSubmit:i(l=>{const f=l.checked;t(f)}),children:[b("div",{class:"flex items-center gap-2",children:[b("div",{class:Xt("flex w-full flex-1 flex-wrap gap-3 p-1",{"justify-center":e.config.options.length===1}),children:e.config.options.map((l,f)=>{const h=`checked.${l.value}`,{ref:p,...m}=o(h);return b("div",{children:[b("input",{autoFocus:f===0,ref:y=>{y&&f===0&&(a.current=y),p(y)},id:h,...m,class:"peer sr-only",type:"checkbox"}),b("label",{class:"bg-lowest peer-focus-visible:ring-accent-7 active:outline-neutral-10 ease-expo-out outline-neutral-12/5 text-neutral-11 peer-checked:outline-accent-7 peer-checked:bg-accent-2 peer-checked:text-accent-9 block rounded-2xl px-2.5 py-1 outline outline-2 ring-0 ring-transparent transition-all duration-300 selection:bg-transparent peer-focus-visible:ring-4 peer-focus-visible:ring-offset-2",htmlFor:h,children:l.label})]},l.value)})}),!c&&b(ko,{})]}),b(Ds,{onAnimationComplete:n,error:(d=s.checked)==null?void 0:d.root})]})},Eo={email:"That doesn’t look like a valid email address",phone:"That doesn’t look like a valid phone number"},oy=We(Eo.phone,[ag(/^\+?[0-9 -]+$/,Eo.phone)]),iy={email:We(Eo.email,[ig(Eo.email)]),phone:ku(oy,e=>e.replace(/[^0-9]/g,"")),text:We([$u(1,"Please enter some text")]),url:We([cg("That doesn’t look like a valid URL")])},sy={email:{type:"email",inputMode:"email",formNoValidate:!0},phone:{type:"tel",inputMode:"tel"},text:{type:"text",inputMode:"text"},url:{type:"url",inputMode:"url",formNoValidate:!0}},ay=ts("text"),cy=e=>Kd(gn({text:iy[e.format]})),ly=({input:e,onSubmitSuccess:t,onHeightChange:n})=>{var d;const r=e.key?(d=re.current$.value.application)==null?void 0:d.data.submissions[e.key]:void 0,{register:o,handleSubmit:i,formState:{errors:s}}=qd({defaultValues:{text:ay(r)?r.value:""},resolver:cy(e.config)}),{ref:a,...c}=o("text",{required:!0}),u=U();return Be(()=>{u.current&&(u.current.focus(),u.current.select())},[]),b("form",{noValidate:!0,class:"flex flex-col gap-1",onSubmit:i(l=>{t(l.text)}),children:[b("div",{class:"flex items-center gap-2",children:[b("input",{id:"chat-input",...c,...sy[e.config.format],autocomplete:"off",autoCapitalize:"off",autoCorrect:"off",autoFocus:!0,ref:l=>{l&&(u.current=l),a(l)},class:"outline-neutral-12/5 ease-expo-out placeholder:text-neutral-5 focus-visible:outline-accent-7 caret-accent-9 flex-grow rounded-full px-3 py-1 text-base outline outline-2 transition-all duration-300",placeholder:e.config.placeholder}),b(ko,{})]}),b(Ds,{onAnimationComplete:n,error:s.text})]})},uy=({onSubmit:e,onInputChange:t,input:n})=>{const r=U(null),o=me(()=>{r.current&&(ns.value=r.current.getBoundingClientRect().height)},[]);G(()=>{o(),t(n==null?void 0:n.type)},[n==null?void 0:n.type,t,o]);const i=s=>a=>e({type:s,value:a});return b(Kn.div,{initial:{height:0},animate:{height:ns.value},exit:{height:0,opacity:0},class:"bg-neutral-2/80 absolute bottom-0 w-full overflow-hidden rounded-b-3xl backdrop-blur-md backdrop-saturate-150",children:b("div",{ref:r,class:"border-neutral-12/5 border-t p-2.5",children:tt({application:re,input:n,onHeightChange:o}).with({input:Ae.nullish},()=>b("div",{class:"flex items-center gap-2",children:[b("input",{"aria-hidden":"true",id:"chat-input",class:"outline-neutral-12/5 placeholder:text-neutral-4 focus-visible:outline-accent-9 caret-accent-9 flex-grow rounded-full px-3 py-1 text-base outline outline-2",disabled:!0}),b(ko,{disabled:!0,"aria-hidden":"true",tabIndex:-1})]})).with({input:{type:"text"}},s=>b(ly,{onSubmitSuccess:i(s.input.type),...s})).with({input:{type:"multiple-choice"}},s=>b(ry,{onSubmitSuccess:i(s.input.type),...s})).with({input:{type:"boolean"}},s=>b(Sb,{onSubmitSuccess:i(s.input.type),...s})).with({input:{type:"file"}},s=>b(Pb,{onSubmitSuccess:i(s.input.type),...s})).exhaustive()})})},Yd=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,Gd=Xt,Zd=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Gd(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(u=>{const d=n==null?void 0:n[u],l=i==null?void 0:i[u];if(d===null)return null;const f=Yd(d)||Yd(l);return o[u][f]}),a=n&&Object.entries(n).reduce((u,d)=>{let[l,f]=d;return f===void 0||(u[l]=f),u},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:l,className:f,...h}=d;return Object.entries(h).every(p=>{let[m,y]=p;return Array.isArray(y)?y.includes({...i,...a}[m]):{...i,...a}[m]===y})?[...u,l,f]:u},[]);return Gd(e,s,c,n==null?void 0:n.class,n==null?void 0:n.className)},dy=Zd("max-w-[min(100%,24rem)] [text-wrap:pretty] leading-snug flex-shrink-1 min-w-[2rem] text-md py-2 px-3 rounded-[18px] min-h-[36px] break-words",{variants:{side:{left:"bg-lowest text-neutral-12 shadow-surface-sm outline outline-1 outline-neutral-11/[.08] rounded-bl-md",right:"ml-auto bg-accent-7 text-lowest rounded-br-md bubble-right"},transitionState:{entering:"opacity-0 translate-y-8",entered:"opacity-100 translate-y-0",exiting:"opacity-0 scale-0",exited:""}},defaultVariants:{side:"left"}}),fy={hidden:{y:"100%",scale:.75},shown:{y:0,scale:1}},hy=({children:e,className:t,transitionState:n,side:r,...o})=>b(Kn.p,{variants:fy,initial:"hidden",animate:"shown",transition:{type:"spring",damping:25,stiffness:500},"data-transition":n,style:{transformOrigin:r==="left"?"0% 50%":"100% 50%"},class:dy({className:t,side:r,transitionState:n}),...o,children:e}),py=({className:e,...t})=>b("div",{class:Xt("flex gap-1 p-4",e),...t,children:Array.from({length:3},(n,r)=>b("div",{class:"bg-accent-7 h-1.5 w-1.5 animate-bounce rounded-full",style:{animationDelay:`${-r*200}ms`}}))}),my={bot:"left",user:"right"},vy=Zd("w-full select-none py-2 text-center text-[10px] uppercase tracking-widest drop-shadow-[0_1.5px_white]",{variants:{variant:{info:"text-neutral-8",warning:"text-[#FFC107]",error:"text-error-9",success:"text-[#4CAF50]"}}}),gy=({messages:e,isBotTyping:t})=>b("ol",{"aria-label":"Chat messages",class:"flex flex-grow flex-col justify-end gap-2 p-2 pt-[calc(var(--header-height)+1rem)]",children:[b(to,{initial:!1,children:e.map((n,r)=>b("li",{class:"flex",children:tt(n).with({type:"system"},o=>b("p",{class:vy({variant:o.variant}),children:o.text})).with({type:"text",author:Ae.union("bot","user")},o=>b(hy,{side:my[o.author],children:o.text},r)).with({type:"link"},o=>b("div",{class:"bg-accent-8/5 flex w-full items-center justify-center overflow-hidden rounded-xl py-2",children:b("a",{class:"bg-lowest shadow-surface-sm ring-accent-8/20 hover:ring-accent-8 active:bg-accent-2 active:text-accent-10 text-accent-9 focus-visible:ring-accent-7/50 flex items-center gap-1.5 truncate rounded-full py-2 pl-4 pr-2.5 no-underline ring-1 transition-all focus:outline-none focus-visible:ring-4 focus-visible:ring-offset-2",target:"_blank",href:o.href,children:[o.text,b("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:b("path",{d:"M3.64645 11.3536C3.45118 11.1583 3.45118 10.8417 3.64645 10.6465L10.2929 4L6 4C5.72386 4 5.5 3.77614 5.5 3.5C5.5 3.22386 5.72386 3 6 3L11.5 3C11.6326 3 11.7598 3.05268 11.8536 3.14645C11.9473 3.24022 12 3.36739 12 3.5L12 9.00001C12 9.27615 11.7761 9.50001 11.5 9.50001C11.2239 9.50001 11 9.27615 11 9.00001V4.70711L4.35355 11.3536C4.15829 11.5488 3.84171 11.5488 3.64645 11.3536Z",fill:"currentColor","fill-rule":"evenodd","clip-rule":"evenodd"})})]})})).with({type:"image"},o=>b("img",{class:"shadow-surface-md w-full max-w-[min(100%,24rem)] rounded-2xl",src:o.url,style:{aspectRatio:o.width/o.height}})).with({type:"file"},o=>b(Ab,{class:o.author==="bot"?"":"ml-auto",file:{name:o.fileName,sizeKb:o.fileSizeKb}})).exhaustive()},r))}),b("aside",{"aria-hidden":!0,children:t&&b(py,{})})]}),by=25,yy=()=>{const e=U(null),[t,n]=ae(!1),[r,o]=ae(()=>()=>{}),i=de(()=>a=>{var c;return(c=e.current)==null?void 0:c.scrollTo({top:e.current.scrollHeight,...a})},[e]),s=de(()=>({send:async({message:a,signal:c,groupId:u})=>{if(await tt(a).with({author:"bot",type:"text"},async d=>{if(c!=null&&c.aborted)throw new Jn;n(!0);const l=Math.max(20,d.text.length)*by;await new Promise(f=>setTimeout(f,l,{signal:c})),n(!1)}).otherwise(async()=>{}),c!=null&&c.aborted)throw new Jn;re.addMessage(a,u)},input:async({input:a,signal:c})=>{if(c!=null&&c.aborted)throw new Jn;return re.setInput(a),await new Promise(u=>{const d=l=>{if(c!=null&&c.aborted)throw new Jn;re.setInput(void 0),a.key&&re.setSubmission(a.key,l),u(l)};o(()=>d)})}}),[]);return{chatRef:e,chatService:s,isBotTyping:t,onSubmitSuccessFn:r,scrollToEnd:i}},wy=Object.freeze(Object.defineProperty({__proto__:null,JobApplicationContent:({currentApplication:e,logger:t,apiClient:n,analytics:r})=>{const{chatRef:o,chatService:i,isBotTyping:s,onSubmitSuccessFn:a,scrollToEnd:c}=yy(),u=nt.value,d=e.flow,l=e.job;return Be(()=>{u==="maximised"&&c({behavior:"instant"})},[c,u]),G(()=>{c({behavior:"smooth"})},[e.data.messages,c]),Be(()=>{const{state:f,application:h}=re.current$.peek();if(f!=="loaded")throw new Error(Ev.invalid_state);const p=h.data.currentNodeId;if(c({behavior:"instant"}),re.setInput(void 0),h.data.isFinished)return;h.data.messages.length===0&&r.log({event:"APPLY_START",properties:{job_id:l.id},customProperties:{flow_id:d.id}}),re.removeLastGroupMessagesById(p);const{interpret:y,abort:x}=cb({context:{jobId:l.id,flowId:d.id},analytics:r,apiClient:n,logger:t,flow:d.nodes,chatService:i,getSubmissions:()=>{var g;return(g=re.current$.peek().application)==null?void 0:g.data.submissions},onInterpret:(g,_)=>{r.log({event:"FLOW_NODE",properties:{flow_id:d.id,flow_version:d.version,job_id:l.id,from_node_id:_?_.id:null,to_node_id:g.id,sequence:1}}),re.setCurrentNodeId(g.id)},onFlowEnd:async()=>{re.markAsFinished()}});return y(p),x},[r,n,i,t,c,d,l.id,e.startedAt]),b(ue,{children:[b("div",{ref:o,className:"hide-scrollbars relative flex max-w-full flex-grow flex-col overflow-y-scroll",style:{WebkitOverflowScrolling:"touch",paddingBottom:ns.value},children:b(to,{children:b(gy,{isBotTyping:s,messages:e.data.messages})})}),b(uy,{input:e.data.currentInput,onInputChange:()=>c({behavior:"smooth"}),onSubmit:a})]})}},Symbol.toStringTag,{value:"Module"}))})();
|
|
57
|
+
}`,sb=({_internal_domManager:e=fg(),theme:t})=>Et(({apiClient:n,logger:r,analytics:o})=>{let i=!1;const s=()=>{if(typeof window>"u")return;const a=e.getOrCreateChatbotElement();e.addStyle(dg,"inploi-chatbot-style");const c=ib([{name:"a",colors:xd(t)},{name:"n",colors:xd({hue:t.hue,chroma:.1})}]);e.addStyle(c,"inploi-chatbot-theme"),en(N(jv,{apiClient:n,logger:r,analytics:o}),a),i=!0};return{prepare:async()=>{if(!(typeof window>"u"))try{if(i)return;s(),r.info("Chatbot plugin prepared")}catch(a){console.error(a),r.error("Error preparing chatbot plugin",a)}},startApplication:async({jobId:a})=>{if(!(typeof window>"u"))try{re.cancel(),pf(()=>{nt.value="maximised",re.current$.value={state:"loading"}}),ug({jobId:a,apiClient:n,logger:r}).then(async c=>{c.ok?(await o.log({event:"APPLY_START",properties:{job_id:a},customProperties:{flow_id:c.value.flow.id}}).catch(r.error),re.start(c.value)):re.current$.value={state:"error",error:c.error}}),i||s()}catch(c){console.error(c),r.error("Error starting application",c)}},closeApplication:async()=>{typeof window>"u"||(r.info("Closing application from an external source"),re.cancel())}}});if(!window.inploi)throw new Error("Please insert the SDK script tag above the plugins.");window.inploi.chatbotPlugin=sb;const kd=({node:e,nodes:t,stopWhen:n})=>{if((n==null?void 0:n(e))===!0)return e;const r=e.nextId?t.find(o=>o.id===e.nextId):void 0;if(r)return kd({node:r,nodes:t,stopWhen:n})},ab=({childNode:e,nodes:t})=>{const r=t.filter(o=>o.type==="if-block").find(o=>{if(!o.branchId)return!1;const i=t.find(a=>a.id===o.branchId);if(!i)return!1;const s=kd({node:i,nodes:t,stopWhen:a=>a.id===e.id});return!(!s||s.id!==e.id)});if(r!=null&&r.nextId)return t.find(o=>o.id===r.nextId)},cb=({flow:e,analytics:t,logger:n,context:r,apiClient:o,getSubmissions:i,chatService:s,onFlowEnd:a,onInterpret:c})=>{const u=new AbortController,d=async(l,f)=>{const h=i();c==null||c(l,f);try{await lb({analytics:t,logger:n,apiClient:o,context:r,node:l,submissions:h,chat:{sendMessage:async p=>s.send({groupId:l.id,message:p,signal:u.signal}),userInput:async p=>s.input({input:p,signal:u.signal})},next:p=>{const m=p?e.find(y=>y.id===p):ab({childNode:l,nodes:e});return m?d(m,l):a==null?void 0:a(l)}})}catch(p){if(p instanceof Jn)return;throw p}};return{interpret:async l=>{const f=e.find(h=>h.id===l)??vu(e);return d(f)},abort:()=>{u.abort()}}};async function lb(e){return await tt(e).with({node:{type:"text"}},hb).with({node:{type:"image"}},pb).with({node:{type:"question-text"}},mb).with({node:{type:"question-enum"}},gb).with({node:{type:"question-number"}},vb).with({node:{type:"question-boolean"}},bb).with({node:{type:"question-file"}},wb).with({node:{type:"question-address"}},yb).with({node:{type:"end-flow"}},_b).with({node:{type:"if-block"}},fb).with({node:{type:"jump"}},({node:t,next:n})=>n(t.data.targetId)).with({node:{type:"link"}},db).with({node:{type:"submit"}},ub).exhaustive()}async function ub({chat:e,next:t,node:n,logger:r,apiClient:o,submissions:i,context:s}){await e.userInput({type:"multiple-choice",key:void 0,config:{options:[{label:"Submit my application",value:"submit"}],maxSelected:1,minSelected:1}}),await e.sendMessage({type:"system",variant:"info",text:"Submitting your application…"});const a=await o.fetch("/flow/apply",{method:"POST",body:JSON.stringify({...s,submissions:Lv(i||{})})}).catch(c=>c);await tt(a).with({redirect_url:Ae.string},async c=>{await e.sendMessage({type:"text",author:"bot",text:"Almost there! Please finalise your application on our partner’s website."}),await e.sendMessage({type:"link",href:c.redirect_url,text:"Finalise application on partner"})}).with({message:"Success"},async()=>{await e.sendMessage({type:"system",variant:"success",text:"Application submitted"}),t(n.nextId)}).otherwise(async c=>{r.error(c),await e.sendMessage({type:"system",variant:"error",text:"Failed to submit application"}),t(n.id)})}async function db({chat:e,next:t,node:n}){await e.sendMessage({type:"link",href:n.data.href,text:n.data.cta}),t(n.nextId)}async function fb({submissions:e,next:t,node:n}){const r=xb(n,e)?n.branchId:n.nextId;t(r)}async function hb({chat:e,next:t,node:n}){await e.sendMessage({author:"bot",type:"text",text:n.data.text}),t(n.nextId)}async function pb({chat:e,next:t,node:n}){await e.sendMessage({author:"bot",type:"image",url:n.data.url,height:n.data.height,width:n.data.width}),t(n.nextId)}async function mb({chat:e,next:t,node:n}){await e.sendMessage({author:"bot",type:"text",text:n.data.question});const r=await e.userInput({key:n.data.key,type:"text",config:{placeholder:n.data.placeholder,format:n.data.format}});await e.sendMessage({author:"user",type:"text",text:r.value}),t(n.nextId)}async function vb({chat:e,next:t,node:n}){await e.sendMessage({author:"bot",type:"text",text:n.data.question});const r=await e.userInput({key:n.data.key,type:"text",config:{placeholder:n.data.placeholder,format:"text"}});await e.sendMessage({author:"user",type:"text",text:r.value}),t(n.nextId)}async function gb({chat:e,next:t,node:n}){await e.sendMessage({author:"bot",type:"text",text:n.data.question});const r=await e.userInput({key:n.data.key,type:"multiple-choice",config:n.data});await e.sendMessage({author:"user",type:"text",text:r.value.join(", ")}),t(n.nextId)}async function bb({chat:e,next:t,node:n}){await e.sendMessage({author:"bot",type:"text",text:n.data.question});const o=(await e.userInput({key:n.data.key,type:"boolean",config:{labels:{true:n.data.trueLabel,false:n.data.falseLabel}}})).value,i={true:n.data.trueLabel,false:n.data.falseLabel};await e.sendMessage({author:"user",type:"text",text:i[o]}),t(n.nextId)}async function yb({chat:e,next:t,node:n}){await e.sendMessage({author:"bot",type:"text",text:"Address questions are not implemented yet"}),t(n.nextId)}async function wb({node:e,chat:t,next:n}){await t.sendMessage({author:"bot",type:"text",text:e.data.question});const r=await t.userInput({key:e.data.key,type:"file",config:{extensions:e.data.extensions,fileSizeLimitKib:e.data.maxSizeKb,allowMultiple:e.data.multiple===!0}});for await(const o of r.value)await t.sendMessage({author:"user",type:"file",fileName:o.name,fileSizeKb:o.sizeKb});n(e.nextId)}async function _b({chat:e,next:t,node:n}){await e.sendMessage({type:"system",variant:"info",text:n.data.systemMessage||"Conversation finished"}),t(void 0)}const $d=Ae.union(Ae.string,Ae.array(Ae.string)),xb=(e,t)=>{const n=t==null?void 0:t[e.data.compareKey];return n?tt({...e.data,answer:n}).with({compare:"equals"},({compareValue:r})=>typeof n.value=="string"||typeof n.value=="boolean"?r===n.value.toString():!1).with({compare:"notEquals"},({compareValue:r})=>typeof n.value=="string"||typeof n.value=="boolean"?r!==n.value.toString():!1).with({compare:"contains",answer:{value:$d}},({compareValue:r,answer:o})=>o.value.includes(r)).with({compare:"notContains",answer:{value:$d}},({compareValue:r,answer:o})=>!o.value.includes(r)).with({answer:{type:"file"}},()=>!1).exhaustive():!1},ko=({class:e,...t})=>b("button",{class:Xt("bg-accent-7 active:bg-accent-10 active:text-accent-2 text-lowest pointer-coarse:touch-hitbox focus-visible:ring-accent-7/50 flex-shrink-0 rounded-full p-2 transition-all focus:outline-none focus-visible:ring-4 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:b("svg",{class:"block",width:"16",height:"16",viewBox:"0 0 16 16",fill:"transparent",stroke:"currentColor","stroke-linecap":"round","stroke-width":"2",children:[b("title",{children:"Send"}),b("path",{d:"M3.5 7.5L8 3L12.5 7.5"}),b("path",{d:"M8 4V13"})]})}),Fs=()=>{const e=U(null);return G(()=>{var t;(t=e.current)==null||t.focus()},[]),e},Sd=["true","false"],kb=Qv(Sd),$b="answer",Sb=({input:e,onSubmitSuccess:t,onHeightChange:n})=>{const r=Fs();return n(),b("form",{noValidate:!0,class:"flex items-center gap-2",onSubmit:o=>{o.preventDefault();const i=tt(o).with({nativeEvent:{submitter:Ae.select(Ae.union(Ae.instanceOf(HTMLButtonElement),Ae.instanceOf(HTMLInputElement)))}},a=>a.value).otherwise(()=>{throw new Error("invalid form")}),s=rs(kb,i);t(s)},children:Sd.map((o,i)=>b("button",{ref:i===0?r:null,type:"submit",name:$b,value:o,class:"bg-lowest ease-expo-out ring-neutral-12/5 text-neutral-12 active:ring-accent-7 active:bg-accent-2 active:text-accent-11 fr block flex-1 overflow-hidden rounded-2xl px-2.5 py-2.5 ring-2 transition-all duration-300 selection:bg-transparent",children:b("p",{class:"truncate text-center text-base",children:e.config.labels[o]})}))})},Ds=({error:e,onAnimationComplete:t})=>b(to,{children:e&&b(Kn.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},onAnimationComplete:t,role:"alert",class:"text-error-11 flex max-w-full items-center gap-1 overflow-hidden rounded-full p-0.5 px-1 opacity-0",children:[b("svg",{class:"text-error-10",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[b("circle",{cx:"8",cy:"8",r:"6.3",stroke:"currentColor","stroke-width":"1.4"}),b("rect",{x:"7",y:"4",width:"2",height:"5",fill:"currentColor"}),b("rect",{x:"7",y:"10",width:"2",height:"2",fill:"currentColor"})]}),b("p",{class:"truncate pr-1 text-sm",children:e.message})]})}),Mb=e=>new Promise((t,n)=>{const r=new FileReader;r.readAsDataURL(e),r.onload=()=>r.result?t(r.result.toString()):n("No result from reader"),r.onerror=n}),$o=e=>tt(e).with(Ae.number.lte(1e3),()=>`${Math.round(e)}KB`).with(Ae.number.lt(1e3*10),()=>`${(e/1e3).toFixed(1)}MB`).otherwise(()=>`${Math.round(e/1e3)}MB`),Tb=e=>e.reduce((t,n)=>t+n.sizeKb,0),Cb=ts("file"),Md=3,Ab=({file:e,class:t,...n})=>{const r=e.name.split(".").pop(),o=e.name.replace(new RegExp(`.${r}$`),"");return b("div",{class:Xt("bg-accent-1 outline-neutral-4 flex max-w-full gap-2 overflow-hidden rounded-lg px-3 py-2 text-sm outline",t),...n,children:[b("p",{"aria-label":"File name",class:"text-accent-12 flex flex-grow overflow-hidden",children:[b("span",{class:"block truncate",children:o}),b("span",{children:[".",r]})]}),b("p",{"aria-label":"File size",class:"text-neutral-10",children:$o(e.sizeKb)})]})},Td=({class:e,...t})=>b("li",{class:Xt("outline-neutral-6 text-neutral-11 bg-neutral-1 block rounded-md px-1 py-0.5 text-xs outline outline-1",e),...t}),Pb=({input:e,onSubmitSuccess:t,onHeightChange:n})=>{var l;const r=(l=re.current$.value.application)==null?void 0:l.data.submissions[e.key],[o,i]=ae(Cb(r)?r.value:[]),[s,a]=ae(),c=o.length-Md,u=Tb(o),d=Fs();return b("form",{class:"flex flex-col gap-1",onSubmit:f=>(f.preventDefault(),a(void 0),o.length===0&&a({type:"required",message:"Please select a file"}),e.config.fileSizeLimitKib&&u>e.config.fileSizeLimitKib&&a({type:"max",message:`File size exceeds limit of ${$o(e.config.fileSizeLimitKib)}`}),t(o)),children:[b("div",{class:"flex items-center gap-2",children:[b("label",{ref:d,for:"dropzone-file",class:"border-neutral-8 bg-neutral-2 flex h-48 w-full cursor-pointer flex-col items-center justify-center overflow-hidden rounded-2xl border border-dashed p-4",children:[o.length>0?b(ue,{children:[b("ul",{class:"flex max-w-full flex-wrap justify-center gap-1 overflow-hidden p-1",children:[o.slice(0,Md).map(f=>{const h=f.name.split(".").pop(),p=f.name.replace(new RegExp(`.${h}$`),"");return b(Td,{class:"flex overflow-hidden",children:[b("span",{class:"block truncate",children:p}),b("span",{children:[".",h]})]})}),c>0?b(Td,{children:["+",c," file",c!==1?"s":""]}):null]}),b("p",{class:"text-neutral-11 text-xs",children:[$o(u)," ",o.length>1?"total":""]})]}):b("div",{class:"flex flex-col justify-center gap-4 pb-6 pt-5",children:[b("header",{class:"flex flex-col items-center gap-0",children:[b("svg",{class:"text-neutral-11 mb-1 h-8 w-8","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 16",children:b("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M13 13h3a3 3 0 0 0 0-6h-.025A5.56 5.56 0 0 0 16 6.5 5.5 5.5 0 0 0 5.207 5.021C5.137 5.017 5.071 5 5 5a4 4 0 0 0 0 8h2.167M10 15V6m0 0L8 8m2-2 2 2"})}),b("p",{class:"text-neutral-12 tracking-[-0.01em] dark:text-gray-400",children:[e.config.allowMultiple?"Select files":"Select a file"," to upload"]}),e.config.fileSizeLimitKib?b("p",{class:"text-neutral-10 text-xs",children:["(max ",$o(e.config.fileSizeLimitKib),")"]}):null]}),b("aside",{class:"flex flex-col items-center gap-2",children:[b("p",{id:"accepted-filetypes",class:"sr-only",children:"Accepted file extensions"}),b("ul",{"aria-describedby":"accepted-filetypes",class:"flex flex-wrap justify-center gap-2",children:e.config.extensions.map(f=>b("li",{class:"ring-lowest outline-neutral-6 text-neutral-9 bg-neutral-1 rounded-md px-1 py-0.5 text-[11px] uppercase tracking-wide outline outline-1 ring-2",children:f.replace(".","")}))})]})]}),b("input",{id:"dropzone-file",onInput:async f=>{Fe(f.target instanceof HTMLInputElement);const h=f.target.files?Array.from(f.target.files):[],p=await Promise.allSettled(h.map(async y=>{const x=await Mb(y);return{name:y.name,data:x,sizeKb:y.size/1e3}}));if(p.some(({status:y})=>y==="rejected"))return a({type:"invalid",message:"Invalid file"});const m=p.map(y=>y.status==="fulfilled"?y.value:null).filter(Boolean);i(m)},multiple:e.config.allowMultiple,type:"file",class:"sr-only"})]}),b(ko,{disabled:o.length===0})]}),s&&b(Ds,{onAnimationComplete:n,error:s})]})};var lr=e=>e.type==="checkbox",Sn=e=>e instanceof Date,Me=e=>e==null;const Cd=e=>typeof e=="object";var fe=e=>!Me(e)&&!Array.isArray(e)&&Cd(e)&&!Sn(e),Eb=e=>fe(e)&&e.target?lr(e.target)?e.target.checked:e.target.value:e,Vb=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Ob=(e,t)=>e.has(Vb(t)),Lb=e=>{const t=e.constructor&&e.constructor.prototype;return fe(t)&&t.hasOwnProperty("isPrototypeOf")},Is=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function at(e){let t;const n=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(Is&&(e instanceof Blob||e instanceof FileList))&&(n||fe(e)))if(t=n?[]:{},!n&&!Lb(e))t=e;else for(const r in e)e.hasOwnProperty(r)&&(t[r]=at(e[r]));else return e;return t}var ur=e=>Array.isArray(e)?e.filter(Boolean):[],ie=e=>e===void 0,O=(e,t,n)=>{if(!t||!fe(e))return n;const r=ur(t.split(/[,[\].]+?/)).reduce((o,i)=>Me(o)?o:o[i],e);return ie(r)||r===e?ie(e[t])?n:e[t]:r},Mt=e=>typeof e=="boolean";const Ad={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},ze={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},ct={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"};Ie.createContext(null);var Rb=(e,t,n,r=!0)=>{const o={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(o,i,{get:()=>{const s=i;return t._proxyFormState[s]!==ze.all&&(t._proxyFormState[s]=!r||ze.all),n&&(n[s]=!0),e[s]}});return o},Oe=e=>fe(e)&&!Object.keys(e).length,Nb=(e,t,n,r)=>{n(e);const{name:o,...i}=e;return Oe(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(s=>t[s]===(!r||ze.all))},zs=e=>Array.isArray(e)?e:[e];function Fb(e){const t=Ie.useRef(e);t.current=e,Ie.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}var Ye=e=>typeof e=="string",Db=(e,t,n,r,o)=>Ye(e)?(r&&t.watch.add(e),O(n,e,o)):Array.isArray(e)?e.map(i=>(r&&t.watch.add(i),O(n,i))):(r&&(t.watchAll=!0),n),Bs=e=>/^\w*$/.test(e),Pd=e=>ur(e.replace(/["|']|\]/g,"").split(/\.|\[/));function Q(e,t,n){let r=-1;const o=Bs(t)?[t]:Pd(t),i=o.length,s=i-1;for(;++r<i;){const a=o[r];let c=n;if(r!==s){const u=e[a];c=fe(u)||Array.isArray(u)?u:isNaN(+o[r+1])?{}:[]}e[a]=c,e=e[a]}return e}var Ed=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},Vd=e=>({isOnSubmit:!e||e===ze.onSubmit,isOnBlur:e===ze.onBlur,isOnChange:e===ze.onChange,isOnAll:e===ze.all,isOnTouch:e===ze.onTouched}),Od=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const So=(e,t,n,r)=>{for(const o of n||Object.keys(e)){const i=O(e,o);if(i){const{_f:s,...a}=i;if(s){if(s.refs&&s.refs[0]&&t(s.refs[0],o)&&!r)break;if(s.ref&&t(s.ref,s.name)&&!r)break}else fe(a)&&So(a,t)}}};var Ib=(e,t,n)=>{const r=ur(O(e,n));return Q(r,"root",t[n]),Q(e,n,r),e},js=e=>e.type==="file",Tt=e=>typeof e=="function",Mo=e=>{if(!Is)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},To=e=>Ye(e),Hs=e=>e.type==="radio",Co=e=>e instanceof RegExp;const Ld={value:!1,isValid:!1},Rd={value:!0,isValid:!0};var Nd=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!ie(e[0].attributes.value)?ie(e[0].value)||e[0].value===""?Rd:{value:e[0].value,isValid:!0}:Rd:Ld}return Ld};const Fd={isValid:!1,value:null};var Dd=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,Fd):Fd;function Id(e,t,n="validate"){if(To(e)||Array.isArray(e)&&e.every(To)||Mt(e)&&!e)return{type:n,message:To(e)?e:"",ref:t}}var Mn=e=>fe(e)&&!Co(e)?e:{value:e,message:""},zd=async(e,t,n,r,o)=>{const{ref:i,refs:s,required:a,maxLength:c,minLength:u,min:d,max:l,pattern:f,validate:h,name:p,valueAsNumber:m,mount:y,disabled:x}=e._f,g=O(t,p);if(!y||x)return{};const _=s?s[0]:i,M=j=>{r&&_.reportValidity&&(_.setCustomValidity(Mt(j)?"":j||""),_.reportValidity())},S={},F=Hs(i),R=lr(i),C=F||R,E=(m||js(i))&&ie(i.value)&&ie(g)||Mo(i)&&i.value===""||g===""||Array.isArray(g)&&!g.length,q=Ed.bind(null,p,n,S),K=(j,B,H,X=ct.maxLength,ne=ct.minLength)=>{const se=j?B:H;S[p]={type:j?X:ne,message:se,ref:i,...q(j?X:ne,se)}};if(o?!Array.isArray(g)||!g.length:a&&(!C&&(E||Me(g))||Mt(g)&&!g||R&&!Nd(s).isValid||F&&!Dd(s).isValid)){const{value:j,message:B}=To(a)?{value:!!a,message:a}:Mn(a);if(j&&(S[p]={type:ct.required,message:B,ref:_,...q(ct.required,B)},!n))return M(B),S}if(!E&&(!Me(d)||!Me(l))){let j,B;const H=Mn(l),X=Mn(d);if(!Me(g)&&!isNaN(g)){const ne=i.valueAsNumber||g&&+g;Me(H.value)||(j=ne>H.value),Me(X.value)||(B=ne<X.value)}else{const ne=i.valueAsDate||new Date(g),se=lt=>new Date(new Date().toDateString()+" "+lt),Le=i.type=="time",Re=i.type=="week";Ye(H.value)&&g&&(j=Le?se(g)>se(H.value):Re?g>H.value:ne>new Date(H.value)),Ye(X.value)&&g&&(B=Le?se(g)<se(X.value):Re?g<X.value:ne<new Date(X.value))}if((j||B)&&(K(!!j,H.message,X.message,ct.max,ct.min),!n))return M(S[p].message),S}if((c||u)&&!E&&(Ye(g)||o&&Array.isArray(g))){const j=Mn(c),B=Mn(u),H=!Me(j.value)&&g.length>+j.value,X=!Me(B.value)&&g.length<+B.value;if((H||X)&&(K(H,j.message,B.message),!n))return M(S[p].message),S}if(f&&!E&&Ye(g)){const{value:j,message:B}=Mn(f);if(Co(j)&&!g.match(j)&&(S[p]={type:ct.pattern,message:B,ref:i,...q(ct.pattern,B)},!n))return M(B),S}if(h){if(Tt(h)){const j=await h(g,t),B=Id(j,_);if(B&&(S[p]={...B,...q(ct.validate,B.message)},!n))return M(B.message),S}else if(fe(h)){let j={};for(const B in h){if(!Oe(j)&&!n)break;const H=Id(await h[B](g,t),_,B);H&&(j={...H,...q(B,H.message)},M(H.message),n&&(S[p]=j))}if(!Oe(j)&&(S[p]={ref:_,...j},!n))return S}}return M(!0),S};function zb(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=ie(e)?r++:e[t[r++]];return e}function Bb(e){for(const t in e)if(e.hasOwnProperty(t)&&!ie(e[t]))return!1;return!0}function ye(e,t){const n=Array.isArray(t)?t:Bs(t)?[t]:Pd(t),r=n.length===1?e:zb(e,n),o=n.length-1,i=n[o];return r&&delete r[i],o!==0&&(fe(r)&&Oe(r)||Array.isArray(r)&&Bb(r))&&ye(e,n.slice(0,-1)),e}function Us(){let e=[];return{get observers(){return e},next:o=>{for(const i of e)i.next&&i.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(i=>i!==o)}}),unsubscribe:()=>{e=[]}}}var Ao=e=>Me(e)||!Cd(e);function Yt(e,t){if(Ao(e)||Ao(t))return e===t;if(Sn(e)&&Sn(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n){const i=e[o];if(!r.includes(o))return!1;if(o!=="ref"){const s=t[o];if(Sn(i)&&Sn(s)||fe(i)&&fe(s)||Array.isArray(i)&&Array.isArray(s)?!Yt(i,s):i!==s)return!1}}return!0}var Bd=e=>e.type==="select-multiple",jb=e=>Hs(e)||lr(e),Xs=e=>Mo(e)&&e.isConnected,jd=e=>{for(const t in e)if(Tt(e[t]))return!0;return!1};function Po(e,t={}){const n=Array.isArray(e);if(fe(e)||n)for(const r in e)Array.isArray(e[r])||fe(e[r])&&!jd(e[r])?(t[r]=Array.isArray(e[r])?[]:{},Po(e[r],t[r])):Me(e[r])||(t[r]=!0);return t}function Hd(e,t,n){const r=Array.isArray(e);if(fe(e)||r)for(const o in e)Array.isArray(e[o])||fe(e[o])&&!jd(e[o])?ie(t)||Ao(n[o])?n[o]=Array.isArray(e[o])?Po(e[o],[]):{...Po(e[o])}:Hd(e[o],Me(t)?{}:t[o],n[o]):n[o]=!Yt(e[o],t[o]);return n}var qs=(e,t)=>Hd(e,t,Po(t)),Ud=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>ie(e)?e:t?e===""?NaN:e&&+e:n&&Ye(e)?new Date(e):r?r(e):e;function Ws(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return js(t)?t.files:Hs(t)?Dd(e.refs).value:Bd(t)?[...t.selectedOptions].map(({value:n})=>n):lr(t)?Nd(e.refs).value:Ud(ie(t.value)?e.ref.value:t.value,e)}var Hb=(e,t,n,r)=>{const o={};for(const i of e){const s=O(t,i);s&&Q(o,i,s._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},dr=e=>ie(e)?e:Co(e)?e.source:fe(e)?Co(e.value)?e.value.source:e.value:e,Ub=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function Xd(e,t,n){const r=O(e,n);if(r||Bs(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const i=o.join("."),s=O(t,i),a=O(e,i);if(s&&!Array.isArray(s)&&n!==i)return{name:n};if(a&&a.type)return{name:i,error:a};o.pop()}return{name:n}}var Xb=(e,t,n,r,o)=>o.isOnAll?!1:!n&&o.isOnTouch?!(t||e):(n?r.isOnBlur:o.isOnBlur)?!e:(n?r.isOnChange:o.isOnChange)?e:!0,qb=(e,t)=>!ur(O(e,t)).length&&ye(e,t);const Wb={mode:ze.onSubmit,reValidateMode:ze.onChange,shouldFocusError:!0};function Kb(e={},t){let n={...Wb,...e},r={submitCount:0,isDirty:!1,isLoading:Tt(n.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:{},disabled:!1},o={},i=fe(n.defaultValues)||fe(n.values)?at(n.defaultValues||n.values)||{}:{},s=n.shouldUnregister?{}:at(i),a={action:!1,mount:!1,watch:!1},c={mount:new Set,unMount:new Set,array:new Set,watch:new Set},u,d=0;const l={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},f={values:Us(),array:Us(),state:Us()},h=e.resetOptions&&e.resetOptions.keepDirtyValues,p=Vd(n.mode),m=Vd(n.reValidateMode),y=n.criteriaMode===ze.all,x=v=>w=>{clearTimeout(d),d=setTimeout(v,w)},g=async v=>{if(l.isValid||v){const w=n.resolver?Oe((await E()).errors):await K(o,!0);w!==r.isValid&&f.state.next({isValid:w})}},_=v=>l.isValidating&&f.state.next({isValidating:v}),M=(v,w=[],k,L,P=!0,T=!0)=>{if(L&&k){if(a.action=!0,T&&Array.isArray(O(o,v))){const D=k(O(o,v),L.argA,L.argB);P&&Q(o,v,D)}if(T&&Array.isArray(O(r.errors,v))){const D=k(O(r.errors,v),L.argA,L.argB);P&&Q(r.errors,v,D),qb(r.errors,v)}if(l.touchedFields&&T&&Array.isArray(O(r.touchedFields,v))){const D=k(O(r.touchedFields,v),L.argA,L.argB);P&&Q(r.touchedFields,v,D)}l.dirtyFields&&(r.dirtyFields=qs(i,s)),f.state.next({name:v,isDirty:B(v,w),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else Q(s,v,w)},S=(v,w)=>{Q(r.errors,v,w),f.state.next({errors:r.errors})},F=(v,w,k,L)=>{const P=O(o,v);if(P){const T=O(s,v,ie(k)?O(i,v):k);ie(T)||L&&L.defaultChecked||w?Q(s,v,w?T:Ws(P._f)):ne(v,T),a.mount&&g()}},R=(v,w,k,L,P)=>{let T=!1,D=!1;const ee={name:v};if(!k||L){l.isDirty&&(D=r.isDirty,r.isDirty=ee.isDirty=B(),T=D!==ee.isDirty);const le=Yt(O(i,v),w);D=O(r.dirtyFields,v),le?ye(r.dirtyFields,v):Q(r.dirtyFields,v,!0),ee.dirtyFields=r.dirtyFields,T=T||l.dirtyFields&&D!==!le}if(k){const le=O(r.touchedFields,v);le||(Q(r.touchedFields,v,k),ee.touchedFields=r.touchedFields,T=T||l.touchedFields&&le!==k)}return T&&P&&f.state.next(ee),T?ee:{}},C=(v,w,k,L)=>{const P=O(r.errors,v),T=l.isValid&&Mt(w)&&r.isValid!==w;if(e.delayError&&k?(u=x(()=>S(v,k)),u(e.delayError)):(clearTimeout(d),u=null,k?Q(r.errors,v,k):ye(r.errors,v)),(k?!Yt(P,k):P)||!Oe(L)||T){const D={...L,...T&&Mt(w)?{isValid:w}:{},errors:r.errors,name:v};r={...r,...D},f.state.next(D)}_(!1)},E=async v=>n.resolver(s,n.context,Hb(v||c.mount,o,n.criteriaMode,n.shouldUseNativeValidation)),q=async v=>{const{errors:w}=await E(v);if(v)for(const k of v){const L=O(w,k);L?Q(r.errors,k,L):ye(r.errors,k)}else r.errors=w;return w},K=async(v,w,k={valid:!0})=>{for(const L in v){const P=v[L];if(P){const{_f:T,...D}=P;if(T){const ee=c.array.has(T.name),le=await zd(P,s,y,n.shouldUseNativeValidation&&!w,ee);if(le[T.name]&&(k.valid=!1,w))break;!w&&(O(le,T.name)?ee?Ib(r.errors,le,T.name):Q(r.errors,T.name,le[T.name]):ye(r.errors,T.name))}D&&await K(D,w,k)}}return k.valid},j=()=>{for(const v of c.unMount){const w=O(o,v);w&&(w._f.refs?w._f.refs.every(k=>!Xs(k)):!Xs(w._f.ref))&&Ze(v)}c.unMount=new Set},B=(v,w)=>(v&&w&&Q(s,v,w),!Yt(Ne(),i)),H=(v,w,k)=>Db(v,c,{...a.mount?s:ie(w)?i:Ye(v)?{[v]:w}:w},k,w),X=v=>ur(O(a.mount?s:i,v,e.shouldUnregister?O(i,v,[]):[])),ne=(v,w,k={})=>{const L=O(o,v);let P=w;if(L){const T=L._f;T&&(!T.disabled&&Q(s,v,Ud(w,T)),P=Mo(T.ref)&&Me(w)?"":w,Bd(T.ref)?[...T.ref.options].forEach(D=>D.selected=P.includes(D.value)):T.refs?lr(T.ref)?T.refs.length>1?T.refs.forEach(D=>(!D.defaultChecked||!D.disabled)&&(D.checked=Array.isArray(P)?!!P.find(ee=>ee===D.value):P===D.value)):T.refs[0]&&(T.refs[0].checked=!!P):T.refs.forEach(D=>D.checked=D.value===P):js(T.ref)?T.ref.value="":(T.ref.value=P,T.ref.type||f.values.next({name:v,values:{...s}})))}(k.shouldDirty||k.shouldTouch)&&R(v,P,k.shouldTouch,k.shouldDirty,!0),k.shouldValidate&&Y(v)},se=(v,w,k)=>{for(const L in w){const P=w[L],T=`${v}.${L}`,D=O(o,T);(c.array.has(v)||!Ao(P)||D&&!D._f)&&!Sn(P)?se(T,P,k):ne(T,P,k)}},Le=(v,w,k={})=>{const L=O(o,v),P=c.array.has(v),T=at(w);Q(s,v,T),P?(f.array.next({name:v,values:{...s}}),(l.isDirty||l.dirtyFields)&&k.shouldDirty&&f.state.next({name:v,dirtyFields:qs(i,s),isDirty:B(v,T)})):L&&!L._f&&!Me(T)?se(v,T,k):ne(v,T,k),Od(v,c)&&f.state.next({...r}),f.values.next({name:v,values:{...s}}),!a.mount&&t()},Re=async v=>{const w=v.target;let k=w.name,L=!0;const P=O(o,k),T=()=>w.type?Ws(P._f):Eb(v),D=ee=>{L=Number.isNaN(ee)||ee===O(s,k,ee)};if(P){let ee,le;const Lo=T(),Tn=v.type===Ad.BLUR||v.type===Ad.FOCUS_OUT,_y=!Ub(P._f)&&!n.resolver&&!O(r.errors,k)&&!P._f.deps||Xb(Tn,O(r.touchedFields,k),r.isSubmitted,m,p),Ks=Od(k,c,Tn);Q(s,k,Lo),Tn?(P._f.onBlur&&P._f.onBlur(v),u&&u(0)):P._f.onChange&&P._f.onChange(v);const Ys=R(k,Lo,Tn,!1),xy=!Oe(Ys)||Ks;if(!Tn&&f.values.next({name:k,type:v.type,values:{...s}}),_y)return l.isValid&&g(),xy&&f.state.next({name:k,...Ks?{}:Ys});if(!Tn&&Ks&&f.state.next({...r}),_(!0),n.resolver){const{errors:ef}=await E([k]);if(D(Lo),L){const ky=Xd(r.errors,o,k),tf=Xd(ef,o,ky.name||k);ee=tf.error,k=tf.name,le=Oe(ef)}}else ee=(await zd(P,s,y,n.shouldUseNativeValidation))[k],D(Lo),L&&(ee?le=!1:l.isValid&&(le=await K(o,!0)));L&&(P._f.deps&&Y(P._f.deps),C(k,le,ee,Ys))}},lt=(v,w)=>{if(O(r.errors,w)&&v.focus)return v.focus(),1},Y=async(v,w={})=>{let k,L;const P=zs(v);if(_(!0),n.resolver){const T=await q(ie(v)?v:P);k=Oe(T),L=v?!P.some(D=>O(T,D)):k}else v?(L=(await Promise.all(P.map(async T=>{const D=O(o,T);return await K(D&&D._f?{[T]:D}:D)}))).every(Boolean),!(!L&&!r.isValid)&&g()):L=k=await K(o);return f.state.next({...!Ye(v)||l.isValid&&k!==r.isValid?{}:{name:v},...n.resolver||!v?{isValid:k}:{},errors:r.errors,isValidating:!1}),w.shouldFocus&&!L&&So(o,lt,v?P:c.mount),L},Ne=v=>{const w={...i,...a.mount?s:{}};return ie(v)?w:Ye(v)?O(w,v):v.map(k=>O(w,k))},Ct=(v,w)=>({invalid:!!O((w||r).errors,v),isDirty:!!O((w||r).dirtyFields,v),isTouched:!!O((w||r).touchedFields,v),error:O((w||r).errors,v)}),At=v=>{v&&zs(v).forEach(w=>ye(r.errors,w)),f.state.next({errors:v?r.errors:{}})},Gt=(v,w,k)=>{const L=(O(o,v,{_f:{}})._f||{}).ref;Q(r.errors,v,{...w,ref:L}),f.state.next({name:v,errors:r.errors,isValid:!1}),k&&k.shouldFocus&&L&&L.focus&&L.focus()},Ge=(v,w)=>Tt(v)?f.values.subscribe({next:k=>v(H(void 0,w),k)}):H(v,w,!0),Ze=(v,w={})=>{for(const k of v?zs(v):c.mount)c.mount.delete(k),c.array.delete(k),w.keepValue||(ye(o,k),ye(s,k)),!w.keepError&&ye(r.errors,k),!w.keepDirty&&ye(r.dirtyFields,k),!w.keepTouched&&ye(r.touchedFields,k),!n.shouldUnregister&&!w.keepDefaultValue&&ye(i,k);f.values.next({values:{...s}}),f.state.next({...r,...w.keepDirty?{isDirty:B()}:{}}),!w.keepIsValid&&g()},Vo=({disabled:v,name:w,field:k,fields:L,value:P})=>{if(Mt(v)){const T=v?void 0:ie(P)?Ws(k?k._f:O(L,w)._f):P;Q(s,w,T),R(w,T,!1,!1,!0)}},Zt=(v,w={})=>{let k=O(o,v);const L=Mt(w.disabled);return Q(o,v,{...k||{},_f:{...k&&k._f?k._f:{ref:{name:v}},name:v,mount:!0,...w}}),c.mount.add(v),k?Vo({field:k,disabled:w.disabled,name:v}):F(v,!0,w.value),{...L?{disabled:w.disabled}:{},...n.progressive?{required:!!w.required,min:dr(w.min),max:dr(w.max),minLength:dr(w.minLength),maxLength:dr(w.maxLength),pattern:dr(w.pattern)}:{},name:v,onChange:Re,onBlur:Re,ref:P=>{if(P){Zt(v,w),k=O(o,v);const T=ie(P.value)&&P.querySelectorAll&&P.querySelectorAll("input,select,textarea")[0]||P,D=jb(T),ee=k._f.refs||[];if(D?ee.find(le=>le===T):T===k._f.ref)return;Q(o,v,{_f:{...k._f,...D?{refs:[...ee.filter(Xs),T,...Array.isArray(O(i,v))?[{}]:[]],ref:{type:T.type,name:v}}:{ref:T}}}),F(v,!1,void 0,T)}else k=O(o,v,{}),k._f&&(k._f.mount=!1),(n.shouldUnregister||w.shouldUnregister)&&!(Ob(c.array,v)&&a.action)&&c.unMount.add(v)}}},Jt=()=>n.shouldFocusError&&So(o,lt,c.mount),ut=v=>{Mt(v)&&(f.state.next({disabled:v}),So(o,w=>{w.disabled=v},0,!1))},fr=(v,w)=>async k=>{k&&(k.preventDefault&&k.preventDefault(),k.persist&&k.persist());let L=at(s);if(f.state.next({isSubmitting:!0}),n.resolver){const{errors:P,values:T}=await E();r.errors=P,L=T}else await K(o);ye(r.errors,"root"),Oe(r.errors)?(f.state.next({errors:{}}),await v(L,k)):(w&&await w({...r.errors},k),Jt(),setTimeout(Jt)),f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Oe(r.errors),submitCount:r.submitCount+1,errors:r.errors})},Oo=(v,w={})=>{O(o,v)&&(ie(w.defaultValue)?Le(v,O(i,v)):(Le(v,w.defaultValue),Q(i,v,w.defaultValue)),w.keepTouched||ye(r.touchedFields,v),w.keepDirty||(ye(r.dirtyFields,v),r.isDirty=w.defaultValue?B(v,O(i,v)):B()),w.keepError||(ye(r.errors,v),l.isValid&&g()),f.state.next({...r}))},Jd=(v,w={})=>{const k=v?at(v):i,L=at(k),P=v&&!Oe(v)?L:i;if(w.keepDefaultValues||(i=k),!w.keepValues){if(w.keepDirtyValues||h)for(const T of c.mount)O(r.dirtyFields,T)?Q(P,T,O(s,T)):Le(T,O(P,T));else{if(Is&&ie(v))for(const T of c.mount){const D=O(o,T);if(D&&D._f){const ee=Array.isArray(D._f.refs)?D._f.refs[0]:D._f.ref;if(Mo(ee)){const le=ee.closest("form");if(le){le.reset();break}}}}o={}}s=e.shouldUnregister?w.keepDefaultValues?at(i):{}:at(P),f.array.next({values:{...P}}),f.values.next({values:{...P}})}c={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},!a.mount&&t(),a.mount=!l.isValid||!!w.keepIsValid,a.watch=!!e.shouldUnregister,f.state.next({submitCount:w.keepSubmitCount?r.submitCount:0,isDirty:w.keepDirty?r.isDirty:!!(w.keepDefaultValues&&!Yt(v,i)),isSubmitted:w.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:w.keepDirtyValues?r.dirtyFields:w.keepDefaultValues&&v?qs(i,v):{},touchedFields:w.keepTouched?r.touchedFields:{},errors:w.keepErrors?r.errors:{},isSubmitSuccessful:w.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},Qd=(v,w)=>Jd(Tt(v)?v(s):v,w);return{control:{register:Zt,unregister:Ze,getFieldState:Ct,handleSubmit:fr,setError:Gt,_executeSchema:E,_getWatch:H,_getDirty:B,_updateValid:g,_removeUnmounted:j,_updateFieldArray:M,_updateDisabledField:Vo,_getFieldArray:X,_reset:Jd,_resetDefaultValues:()=>Tt(n.defaultValues)&&n.defaultValues().then(v=>{Qd(v,n.resetOptions),f.state.next({isLoading:!1})}),_updateFormState:v=>{r={...r,...v}},_disableForm:ut,_subjects:f,_proxyFormState:l,get _fields(){return o},get _formValues(){return s},get _state(){return a},set _state(v){a=v},get _defaultValues(){return i},get _names(){return c},set _names(v){c=v},get _formState(){return r},set _formState(v){r=v},get _options(){return n},set _options(v){n={...n,...v}}},trigger:Y,register:Zt,handleSubmit:fr,watch:Ge,setValue:Le,getValues:Ne,reset:Qd,resetField:Oo,clearErrors:At,unregister:Ze,setError:Gt,setFocus:(v,w={})=>{const k=O(o,v),L=k&&k._f;if(L){const P=L.refs?L.refs[0]:L.ref;P.focus&&(P.focus(),w.shouldSelect&&P.select())}},getFieldState:Ct}}function qd(e={}){const t=Ie.useRef(),n=Ie.useRef(),[r,o]=Ie.useState({isDirty:!1,isValidating:!1,isLoading:Tt(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:{},disabled:!1,defaultValues:Tt(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...Kb(e,()=>o(s=>({...s}))),formState:r});const i=t.current.control;return i._options=e,Fb({subject:i._subjects.state,next:s=>{Nb(s,i._proxyFormState,i._updateFormState,!0)&&o({...i._formState})}}),Ie.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),Ie.useEffect(()=>{if(i._proxyFormState.isDirty){const s=i._getDirty();s!==r.isDirty&&i._subjects.state.next({isDirty:s})}},[i,r.isDirty]),Ie.useEffect(()=>{e.values&&!Yt(e.values,n.current)?(i._reset(e.values,i._options.resetOptions),n.current=e.values):i._resetDefaultValues()},[e.values,i]),Ie.useEffect(()=>{i._state.mount||(i._updateValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),t.current.formState=Rb(r,i),t.current}var Wd=function(e,t,n){if(e&&"reportValidity"in e){var r=O(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},Yb=function(e,t){var n=function(o){var i=t.fields[o];i&&i.ref&&"reportValidity"in i.ref?Wd(i.ref,o,e):i.refs&&i.refs.forEach(function(s){return Wd(s,o,e)})};for(var r in t.fields)n(r)},Gb=function(e,t){t.shouldUseNativeValidation&&Yb(e,t);var n={};for(var r in e){var o=O(t.fields,r),i=Object.assign(e[r]||{},{ref:o&&o.ref});if(Jb(t.names||Object.keys(e),r)){var s=Object.assign({},Zb(O(n,r)));Q(s,"root",i),Q(n,r,s)}else Q(n,r,i)}return n},Zb=function(e){return Array.isArray(e)?e.filter(Boolean):[]},Jb=function(e,t){return e.some(function(n){return n.startsWith(t+".")})},Qb=function(e,t){for(var n={};e.issues.length;){var r=e.issues[0];if(r.path){var o=r.path.map(function(a){return a.key}).join(".");if(n[o]||(n[o]={message:r.message,type:r.validation}),t){var i=n[o].types,s=i&&i[r.validation];n[o]=Ed(o,t,n,r.validation,s?[].concat(s,r.message):r.message)}e.issues.shift()}}return n},Kd=function(e,t,n){return n===void 0&&(n={}),function(r,o,i){try{return Promise.resolve(function(s,a){try{var c=function(){function u(l){return{values:n.raw?r:l,errors:{}}}var d=Object.assign({},{abortEarly:!1,abortPipeEarly:!1},t);return n.mode==="sync"?u(rs(e,r,d)):Promise.resolve(rg(e,r,d)).then(u)}()}catch(u){return a(u)}return c&&c.then?c.then(void 0,a):c}(0,function(s){if(s instanceof so)return{values:{},errors:Gb(Qb(s,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw s}))}catch(s){return Promise.reject(s)}}};const ey=e=>{const t=Object.fromEntries(new FormData(e).entries());Object.keys(t).length&&e.dispatchEvent(new Event("submit",{bubbles:!0}))},ty=ts("multiple-choice"),ny=e=>{const t={min:e.minSelected??0,max:e.maxSelected??e.options.length};return Kd(gn({checked:ku(ng(Gv()),n=>Object.entries(n).filter(([r,o])=>o).map(([r,o])=>r),[sg(t.max,`Please select at most ${t.max} option${t.max!==1?"s":""}`),$u(t.min,`Please select at least ${t.min} option${t.min!==1?"s":""}`)])}))},ry=({input:e,onSubmitSuccess:t,onHeightChange:n})=>{var u,d;const r=e.key?(u=re.current$.value.application)==null?void 0:u.data.submissions[e.key]:void 0,{register:o,handleSubmit:i,formState:{errors:s}}=qd({defaultValues:{checked:ty(r)?Object.fromEntries(r.value.map(l=>[l,!0])):{}},resolver:ny(e.config)}),a=Fs(),c=e.config.minSelected===1&&e.config.maxSelected===1;return b("form",{noValidate:!0,class:"flex flex-col gap-1",onChange:l=>{c&&ey(l.currentTarget)},onSubmit:i(l=>{const f=l.checked;t(f)}),children:[b("div",{class:"flex items-center gap-2",children:[b("div",{class:Xt("flex w-full flex-1 flex-wrap gap-3 p-1",{"justify-center":e.config.options.length===1}),children:e.config.options.map((l,f)=>{const h=`checked.${l.value}`,{ref:p,...m}=o(h);return b("div",{children:[b("input",{autoFocus:f===0,ref:y=>{y&&f===0&&(a.current=y),p(y)},id:h,...m,class:"peer sr-only",type:"checkbox"}),b("label",{class:"bg-lowest peer-focus-visible:ring-accent-7 active:outline-neutral-10 ease-expo-out outline-neutral-12/5 text-neutral-11 peer-checked:outline-accent-7 peer-checked:bg-accent-2 peer-checked:text-accent-9 block rounded-2xl px-2.5 py-1 outline outline-2 ring-0 ring-transparent transition-all duration-300 selection:bg-transparent peer-focus-visible:ring-4 peer-focus-visible:ring-offset-2",htmlFor:h,children:l.label})]},l.value)})}),!c&&b(ko,{})]}),b(Ds,{onAnimationComplete:n,error:(d=s.checked)==null?void 0:d.root})]})},Eo={email:"That doesn’t look like a valid email address",phone:"That doesn’t look like a valid phone number"},oy=We(Eo.phone,[ag(/^\+?[0-9 -]+$/,Eo.phone)]),iy={email:We(Eo.email,[ig(Eo.email)]),phone:ku(oy,e=>e.replace(/[^0-9]/g,"")),text:We([$u(1,"Please enter some text")]),url:We([cg("That doesn’t look like a valid URL")])},sy={email:{type:"email",inputMode:"email",formNoValidate:!0},phone:{type:"tel",inputMode:"tel"},text:{type:"text",inputMode:"text"},url:{type:"url",inputMode:"url",formNoValidate:!0}},ay=ts("text"),cy=e=>Kd(gn({text:iy[e.format]})),ly=({input:e,onSubmitSuccess:t,onHeightChange:n})=>{var d;const r=e.key?(d=re.current$.value.application)==null?void 0:d.data.submissions[e.key]:void 0,{register:o,handleSubmit:i,formState:{errors:s}}=qd({defaultValues:{text:ay(r)?r.value:""},resolver:cy(e.config)}),{ref:a,...c}=o("text",{required:!0}),u=U();return Be(()=>{u.current&&(u.current.focus(),u.current.select())},[]),b("form",{noValidate:!0,class:"flex flex-col gap-1",onSubmit:i(l=>{t(l.text)}),children:[b("div",{class:"flex items-center gap-2",children:[b("input",{id:"chat-input",...c,...sy[e.config.format],autocomplete:"off",autoCapitalize:"off",autoCorrect:"off",autoFocus:!0,ref:l=>{l&&(u.current=l),a(l)},class:"outline-neutral-12/5 ease-expo-out placeholder:text-neutral-5 focus-visible:outline-accent-7 caret-accent-9 flex-grow rounded-full px-3 py-1 text-base outline outline-2 transition-all duration-300",placeholder:e.config.placeholder}),b(ko,{})]}),b(Ds,{onAnimationComplete:n,error:s.text})]})},uy=({onSubmit:e,onInputChange:t,input:n})=>{const r=U(null),o=me(()=>{r.current&&(ns.value=r.current.getBoundingClientRect().height)},[]);G(()=>{o(),t(n==null?void 0:n.type)},[n==null?void 0:n.type,t,o]);const i=s=>a=>e({type:s,value:a});return b(Kn.div,{initial:{height:0},animate:{height:ns.value},exit:{height:0,opacity:0},class:"bg-neutral-2/80 absolute bottom-0 w-full overflow-hidden rounded-b-3xl backdrop-blur-md backdrop-saturate-150",children:b("div",{ref:r,class:"border-neutral-12/5 border-t p-2.5",children:tt({application:re,input:n,onHeightChange:o}).with({input:Ae.nullish},()=>b("div",{class:"flex items-center gap-2",children:[b("input",{"aria-hidden":"true",id:"chat-input",class:"outline-neutral-12/5 placeholder:text-neutral-4 focus-visible:outline-accent-9 caret-accent-9 flex-grow rounded-full px-3 py-1 text-base outline outline-2",disabled:!0}),b(ko,{disabled:!0,"aria-hidden":"true",tabIndex:-1})]})).with({input:{type:"text"}},s=>b(ly,{onSubmitSuccess:i(s.input.type),...s})).with({input:{type:"multiple-choice"}},s=>b(ry,{onSubmitSuccess:i(s.input.type),...s})).with({input:{type:"boolean"}},s=>b(Sb,{onSubmitSuccess:i(s.input.type),...s})).with({input:{type:"file"}},s=>b(Pb,{onSubmitSuccess:i(s.input.type),...s})).exhaustive()})})},Yd=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,Gd=Xt,Zd=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Gd(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(u=>{const d=n==null?void 0:n[u],l=i==null?void 0:i[u];if(d===null)return null;const f=Yd(d)||Yd(l);return o[u][f]}),a=n&&Object.entries(n).reduce((u,d)=>{let[l,f]=d;return f===void 0||(u[l]=f),u},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:l,className:f,...h}=d;return Object.entries(h).every(p=>{let[m,y]=p;return Array.isArray(y)?y.includes({...i,...a}[m]):{...i,...a}[m]===y})?[...u,l,f]:u},[]);return Gd(e,s,c,n==null?void 0:n.class,n==null?void 0:n.className)},dy=Zd("max-w-[min(100%,24rem)] [text-wrap:pretty] leading-snug flex-shrink-1 min-w-[2rem] text-md py-2 px-3 rounded-[18px] min-h-[36px] break-words",{variants:{side:{left:"bg-lowest text-neutral-12 shadow-surface-sm outline outline-1 outline-neutral-11/[.08] rounded-bl-md",right:"ml-auto bg-accent-7 text-lowest rounded-br-md bubble-right"},transitionState:{entering:"opacity-0 translate-y-8",entered:"opacity-100 translate-y-0",exiting:"opacity-0 scale-0",exited:""}},defaultVariants:{side:"left"}}),fy={hidden:{y:"100%",scale:.75},shown:{y:0,scale:1}},hy=({children:e,className:t,transitionState:n,side:r,...o})=>b(Kn.p,{variants:fy,initial:"hidden",animate:"shown",transition:{type:"spring",damping:25,stiffness:500},"data-transition":n,style:{transformOrigin:r==="left"?"0% 50%":"100% 50%"},class:dy({className:t,side:r,transitionState:n}),...o,children:e}),py=({className:e,...t})=>b("div",{class:Xt("flex gap-1 p-4",e),...t,children:Array.from({length:3},(n,r)=>b("div",{class:"bg-accent-7 h-1.5 w-1.5 animate-bounce rounded-full",style:{animationDelay:`${-r*200}ms`}}))}),my={bot:"left",user:"right"},vy=Zd("w-full select-none py-2 text-center text-[10px] uppercase tracking-widest drop-shadow-[0_1.5px_white]",{variants:{variant:{info:"text-neutral-8",warning:"text-[#FFC107]",error:"text-error-9",success:"text-[#4CAF50]"}}}),gy=({messages:e,isBotTyping:t})=>b("ol",{"aria-label":"Chat messages",class:"flex flex-grow flex-col justify-end gap-2 p-2 pt-[calc(var(--header-height)+1rem)]",children:[b(to,{initial:!1,children:e.map((n,r)=>b("li",{class:"flex",children:tt(n).with({type:"system"},o=>b("p",{class:vy({variant:o.variant}),children:o.text})).with({type:"text",author:Ae.union("bot","user")},o=>b(hy,{side:my[o.author],children:o.text},r)).with({type:"link"},o=>b("div",{class:"bg-accent-8/5 flex w-full items-center justify-center overflow-hidden rounded-xl py-2",children:b("a",{class:"bg-lowest shadow-surface-sm ring-accent-8/20 hover:ring-accent-8 active:bg-accent-2 active:text-accent-10 text-accent-9 focus-visible:ring-accent-7/50 flex items-center gap-1.5 truncate rounded-full py-2 pl-4 pr-2.5 no-underline ring-1 transition-all focus:outline-none focus-visible:ring-4 focus-visible:ring-offset-2",target:"_blank",href:o.href,children:[o.text,b("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:b("path",{d:"M3.64645 11.3536C3.45118 11.1583 3.45118 10.8417 3.64645 10.6465L10.2929 4L6 4C5.72386 4 5.5 3.77614 5.5 3.5C5.5 3.22386 5.72386 3 6 3L11.5 3C11.6326 3 11.7598 3.05268 11.8536 3.14645C11.9473 3.24022 12 3.36739 12 3.5L12 9.00001C12 9.27615 11.7761 9.50001 11.5 9.50001C11.2239 9.50001 11 9.27615 11 9.00001V4.70711L4.35355 11.3536C4.15829 11.5488 3.84171 11.5488 3.64645 11.3536Z",fill:"currentColor","fill-rule":"evenodd","clip-rule":"evenodd"})})]})})).with({type:"image"},o=>b("img",{class:"shadow-surface-md w-full max-w-[min(100%,24rem)] rounded-2xl",src:o.url,style:{aspectRatio:o.width/o.height}})).with({type:"file"},o=>b(Ab,{class:o.author==="bot"?"":"ml-auto",file:{name:o.fileName,sizeKb:o.fileSizeKb}})).exhaustive()},r))}),b("aside",{"aria-hidden":!0,children:t&&b(py,{})})]}),by=25,yy=()=>{const e=U(null),[t,n]=ae(!1),[r,o]=ae(()=>()=>{}),i=de(()=>a=>{var c;return(c=e.current)==null?void 0:c.scrollTo({top:e.current.scrollHeight,...a})},[e]),s=de(()=>({send:async({message:a,signal:c,groupId:u})=>{if(await tt(a).with({author:"bot",type:"text"},async d=>{if(c!=null&&c.aborted)throw new Jn;n(!0);const l=Math.max(20,d.text.length)*by;await new Promise(f=>setTimeout(f,l,{signal:c})),n(!1)}).otherwise(async()=>{}),c!=null&&c.aborted)throw new Jn;re.addMessage(a,u)},input:async({input:a,signal:c})=>{if(c!=null&&c.aborted)throw new Jn;return re.setInput(a),await new Promise(u=>{const d=l=>{if(c!=null&&c.aborted)throw new Jn;re.setInput(void 0),a.key&&re.setSubmission(a.key,l),u(l)};o(()=>d)})}}),[]);return{chatRef:e,chatService:s,isBotTyping:t,onSubmitSuccessFn:r,scrollToEnd:i}},wy=Object.freeze(Object.defineProperty({__proto__:null,JobApplicationContent:({currentApplication:e,logger:t,apiClient:n,analytics:r})=>{const{chatRef:o,chatService:i,isBotTyping:s,onSubmitSuccessFn:a,scrollToEnd:c}=yy(),u=nt.value,d=e.flow,l=e.job;return Be(()=>{u==="maximised"&&c({behavior:"instant"})},[c,u]),G(()=>{c({behavior:"smooth"})},[e.data.messages,c]),Be(()=>{const{state:f,application:h}=re.current$.peek();if(f!=="loaded")throw new Error(Ev.invalid_state);const p=h.data.currentNodeId;if(c({behavior:"instant"}),re.setInput(void 0),h.data.isFinished)return;re.removeLastGroupMessagesById(p);const{interpret:m,abort:y}=cb({context:{jobId:l.id,flowId:d.id},analytics:r,apiClient:n,logger:t,flow:d.nodes,chatService:i,getSubmissions:()=>{var x;return(x=re.current$.peek().application)==null?void 0:x.data.submissions},onInterpret:(x,g)=>{r.log({event:"FLOW_NODE",properties:{flow_id:d.id,flow_version:d.version,job_id:l.id,from_node_id:g?g.id:null,to_node_id:x.id,sequence:1}}),re.setCurrentNodeId(x.id)},onFlowEnd:async()=>{re.markAsFinished()}});return m(p),y},[r,n,i,t,c,d,l.id,e.startedAt]),b(ue,{children:[b("div",{ref:o,className:"hide-scrollbars relative flex max-w-full flex-grow flex-col overflow-y-scroll",style:{WebkitOverflowScrolling:"touch",paddingBottom:ns.value},children:b(to,{children:b(gy,{isBotTyping:s,messages:e.data.messages})})}),b(uy,{input:e.data.currentInput,onInputChange:()=>c({behavior:"smooth"}),onSubmit:a})]})}},Symbol.toStringTag,{value:"Module"}))})();
|
package/dist/chatbot.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { ChatbotDomManager } from './chatbot.dom';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
type RemoveInternal<T extends object> = {
|
|
3
|
+
[P in keyof T as string extends P ? never : P extends `_${string}` ? never : P]: T[P];
|
|
4
|
+
};
|
|
5
|
+
export type ChatbotPlugin = typeof chatbotPlugin;
|
|
6
|
+
export type ChatbotPluginParams = RemoveInternal<Parameters<ChatbotPlugin>[0]>;
|
|
7
|
+
export type Chatbot = ReturnType<ReturnType<ChatbotPlugin>>;
|
|
4
8
|
export declare const chatbotPlugin: ({ _internal_domManager: dom, theme, }: {
|
|
5
9
|
geolocationApiKey?: string | undefined;
|
|
6
10
|
theme: {
|
|
@@ -26,3 +30,4 @@ export declare const chatbotPlugin: ({ _internal_domManager: dom, theme, }: {
|
|
|
26
30
|
}) => Promise<void>;
|
|
27
31
|
closeApplication: () => Promise<void>;
|
|
28
32
|
};
|
|
33
|
+
export {};
|
package/dist/chatbot.utils.d.ts
CHANGED
|
@@ -2,14 +2,6 @@ import { FlowNode } from '@inploi/core/flows';
|
|
|
2
2
|
import { ApplicationSubmission, KeyToSubmissionMap } from './chatbot.state';
|
|
3
3
|
export type DistributivePick<T, K extends keyof T> = T extends unknown ? Pick<T, K> : never;
|
|
4
4
|
export declare const getHeadOrThrow: (nodes: FlowNode[]) => {
|
|
5
|
-
id: string;
|
|
6
|
-
data: {
|
|
7
|
-
text: string;
|
|
8
|
-
};
|
|
9
|
-
type: "text";
|
|
10
|
-
isHead?: boolean | undefined;
|
|
11
|
-
nextId?: string | undefined;
|
|
12
|
-
} | {
|
|
13
5
|
id: string;
|
|
14
6
|
data: {
|
|
15
7
|
systemMessage?: string | undefined;
|
|
@@ -34,6 +26,14 @@ export declare const getHeadOrThrow: (nodes: FlowNode[]) => {
|
|
|
34
26
|
type: "link";
|
|
35
27
|
isHead?: boolean | undefined;
|
|
36
28
|
nextId?: string | undefined;
|
|
29
|
+
} | {
|
|
30
|
+
id: string;
|
|
31
|
+
data: {
|
|
32
|
+
text: string;
|
|
33
|
+
};
|
|
34
|
+
type: "text";
|
|
35
|
+
isHead?: boolean | undefined;
|
|
36
|
+
nextId?: string | undefined;
|
|
37
37
|
} | {
|
|
38
38
|
id: string;
|
|
39
39
|
data: {
|
|
@@ -1039,7 +1039,7 @@ function useSignal(n2) {
|
|
|
1039
1039
|
return a$1(n2);
|
|
1040
1040
|
}, []);
|
|
1041
1041
|
}
|
|
1042
|
-
|
|
1042
|
+
const exhaustive = (value) => {
|
|
1043
1043
|
throw new Error(`Unhandled discriminated union member: ${JSON.stringify(value)}`);
|
|
1044
1044
|
};
|
|
1045
1045
|
function invariant$1(condition, message) {
|
|
@@ -8296,7 +8296,7 @@ const ChatbotHeader = ({
|
|
|
8296
8296
|
})]
|
|
8297
8297
|
});
|
|
8298
8298
|
};
|
|
8299
|
-
const JobApplicationContent = M$1(() => Promise.resolve().then(() => require("./job-application-content-
|
|
8299
|
+
const JobApplicationContent = M$1(() => Promise.resolve().then(() => require("./job-application-content-e64a96de.cjs")).then((module2) => module2.JobApplicationContent));
|
|
8300
8300
|
const MotionProvider = ({
|
|
8301
8301
|
children
|
|
8302
8302
|
}) => {
|
|
@@ -12251,8 +12251,17 @@ const chatbotPlugin = ({
|
|
|
12251
12251
|
jobId,
|
|
12252
12252
|
apiClient,
|
|
12253
12253
|
logger
|
|
12254
|
-
}).then((res) => {
|
|
12254
|
+
}).then(async (res) => {
|
|
12255
12255
|
if (res.ok) {
|
|
12256
|
+
await analytics.log({
|
|
12257
|
+
event: "APPLY_START",
|
|
12258
|
+
properties: {
|
|
12259
|
+
job_id: jobId
|
|
12260
|
+
},
|
|
12261
|
+
customProperties: {
|
|
12262
|
+
flow_id: res.value.flow.id
|
|
12263
|
+
}
|
|
12264
|
+
}).catch(logger.error);
|
|
12256
12265
|
application.start(res.value);
|
|
12257
12266
|
} else {
|
|
12258
12267
|
application.current$.value = {
|
|
@@ -1038,7 +1038,7 @@ function useSignal(n2) {
|
|
|
1038
1038
|
return a$1(n2);
|
|
1039
1039
|
}, []);
|
|
1040
1040
|
}
|
|
1041
|
-
|
|
1041
|
+
const exhaustive = (value) => {
|
|
1042
1042
|
throw new Error(`Unhandled discriminated union member: ${JSON.stringify(value)}`);
|
|
1043
1043
|
};
|
|
1044
1044
|
function invariant$1(condition, message) {
|
|
@@ -8295,7 +8295,7 @@ const ChatbotHeader = ({
|
|
|
8295
8295
|
})]
|
|
8296
8296
|
});
|
|
8297
8297
|
};
|
|
8298
|
-
const JobApplicationContent = M$1(() => import("./job-application-content-
|
|
8298
|
+
const JobApplicationContent = M$1(() => import("./job-application-content-4b948a26.js").then((module) => module.JobApplicationContent));
|
|
8299
8299
|
const MotionProvider = ({
|
|
8300
8300
|
children
|
|
8301
8301
|
}) => {
|
|
@@ -12250,8 +12250,17 @@ const chatbotPlugin = ({
|
|
|
12250
12250
|
jobId,
|
|
12251
12251
|
apiClient,
|
|
12252
12252
|
logger
|
|
12253
|
-
}).then((res) => {
|
|
12253
|
+
}).then(async (res) => {
|
|
12254
12254
|
if (res.ok) {
|
|
12255
|
+
await analytics.log({
|
|
12256
|
+
event: "APPLY_START",
|
|
12257
|
+
properties: {
|
|
12258
|
+
job_id: jobId
|
|
12259
|
+
},
|
|
12260
|
+
customProperties: {
|
|
12261
|
+
flow_id: res.value.flow.id
|
|
12262
|
+
}
|
|
12263
|
+
}).catch(logger.error);
|
|
12255
12264
|
application.start(res.value);
|
|
12256
12265
|
} else {
|
|
12257
12266
|
application.current$.value = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _, g as getHeadOrThrow, A as AbortedError, N, a as getApplicationSubmissionsPayload, o as o$1, c as clsx, b as _$1, p, d as parse, e as picklist, m, f as AnimatePresence, h as application, i as h, k, j as invariant, l as isSubmissionOfType, C as Cn, n as parseAsync, V as ValiError, q as object, t as transform, r as maxLength, s as minLength, u as record, v as boolean, w as string, x as email, y as url, z as regex, B as y, T, D as inputHeight, F, E as viewState, G as ERROR_MESSAGES } from "./index-
|
|
1
|
+
import { _, g as getHeadOrThrow, A as AbortedError, N, a as getApplicationSubmissionsPayload, o as o$1, c as clsx, b as _$1, p, d as parse, e as picklist, m, f as AnimatePresence, h as application, i as h, k, j as invariant, l as isSubmissionOfType, C as Cn, n as parseAsync, V as ValiError, q as object, t as transform, r as maxLength, s as minLength, u as record, v as boolean, w as string, x as email, y as url, z as regex, B as y, T, D as inputHeight, F, E as viewState, G as ERROR_MESSAGES } from "./index-fd87b398.js";
|
|
2
2
|
import "@inploi/sdk";
|
|
3
3
|
const followNodes = ({
|
|
4
4
|
node,
|
|
@@ -2831,18 +2831,6 @@ const JobApplicationContent = ({
|
|
|
2831
2831
|
application.setInput(void 0);
|
|
2832
2832
|
if (currentApplication2.data.isFinished)
|
|
2833
2833
|
return;
|
|
2834
|
-
const fromBeginning = currentApplication2.data.messages.length === 0;
|
|
2835
|
-
if (fromBeginning) {
|
|
2836
|
-
analytics.log({
|
|
2837
|
-
event: "APPLY_START",
|
|
2838
|
-
properties: {
|
|
2839
|
-
job_id: job.id
|
|
2840
|
-
},
|
|
2841
|
-
customProperties: {
|
|
2842
|
-
flow_id: flow.id
|
|
2843
|
-
}
|
|
2844
|
-
});
|
|
2845
|
-
}
|
|
2846
2834
|
application.removeLastGroupMessagesById(fromNodeId);
|
|
2847
2835
|
const {
|
|
2848
2836
|
interpret: interpret2,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const index = require("./index-
|
|
3
|
+
const index = require("./index-141dd913.cjs");
|
|
4
4
|
require("@inploi/sdk");
|
|
5
5
|
const followNodes = ({
|
|
6
6
|
node,
|
|
@@ -2833,18 +2833,6 @@ const JobApplicationContent = ({
|
|
|
2833
2833
|
index.application.setInput(void 0);
|
|
2834
2834
|
if (currentApplication2.data.isFinished)
|
|
2835
2835
|
return;
|
|
2836
|
-
const fromBeginning = currentApplication2.data.messages.length === 0;
|
|
2837
|
-
if (fromBeginning) {
|
|
2838
|
-
analytics.log({
|
|
2839
|
-
event: "APPLY_START",
|
|
2840
|
-
properties: {
|
|
2841
|
-
job_id: job.id
|
|
2842
|
-
},
|
|
2843
|
-
customProperties: {
|
|
2844
|
-
flow_id: flow.id
|
|
2845
|
-
}
|
|
2846
|
-
});
|
|
2847
|
-
}
|
|
2848
2836
|
index.application.removeLastGroupMessagesById(fromNodeId);
|
|
2849
2837
|
const {
|
|
2850
2838
|
interpret: interpret2,
|
package/dist/plugin-chatbot.cjs
CHANGED
package/dist/plugin-chatbot.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inploi/plugin-chatbot",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.12",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/plugin-chatbot.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
"vite": "^4.4.5",
|
|
67
67
|
"vite-plugin-dts": "^3.7.0",
|
|
68
68
|
"vite-tsconfig-paths": "^4.2.1",
|
|
69
|
-
"@inploi/
|
|
70
|
-
"@inploi/
|
|
69
|
+
"@inploi/sdk": "1.7.5",
|
|
70
|
+
"@inploi/core": "1.7.0",
|
|
71
71
|
"eslint-config-custom": "0.1.0",
|
|
72
72
|
"tsconfig": "0.1.0"
|
|
73
73
|
},
|