hello-csv
Version:
A modern CSV importer written in Preact
4 lines • 299 kB
JavaScript
(function(De,Ee){typeof exports=="object"&&typeof module<"u"?Ee(exports):typeof define=="function"&&define.amd?define(["exports"],Ee):(De=typeof globalThis<"u"?globalThis:De||self,Ee(De["hello-csv"]={}))})(this,function(De){"use strict";var mv=Object.defineProperty;var gv=(De,Ee,J)=>Ee in De?mv(De,Ee,{enumerable:!0,configurable:!0,writable:!0,value:J}):De[Ee]=J;var ze=(De,Ee,J)=>gv(De,typeof Ee!="symbol"?Ee+"":Ee,J);var Ee,J,Xo,xt,Zo,Jo,gr,Qo,hr,vr,_r,ei,en={},ti=[],Ua=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Mn=Array.isArray;function tt(e,t){for(var n in t)e[n]=t[n];return e}function wr(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function F(e,t,n){var r,o,i,l={};for(i in t)i=="key"?r=t[i]:i=="ref"?o=t[i]:l[i]=t[i];if(arguments.length>2&&(l.children=arguments.length>3?Ee.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)l[i]===void 0&&(l[i]=e.defaultProps[i]);return tn(e,l,r,o,null)}function tn(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++Xo,__i:-1,__u:0};return o==null&&J.vnode!=null&&J.vnode(i),i}function On(){return{current:null}}function me(e){return e.children}function je(e,t){this.props=e,this.context=t}function kt(e,t){if(t==null)return e.__?kt(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?kt(e):null}function ni(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 ni(e)}}function yr(e){(!e.__d&&(e.__d=!0)&&xt.push(e)&&!Fn.__r++||Zo!==J.debounceRendering)&&((Zo=J.debounceRendering)||Jo)(Fn)}function Fn(){var e,t,n,r,o,i,l,s;for(xt.sort(gr);e=xt.shift();)e.__d&&(t=xt.length,r=void 0,i=(o=(n=e).__v).__e,l=[],s=[],n.__P&&((r=tt({},o)).__v=o.__v+1,J.vnode&&J.vnode(r),br(n.__P,r,o,n.__n,n.__P.namespaceURI,32&o.__u?[i]:null,l,i??kt(o),!!(32&o.__u),s),r.__v=o.__v,r.__.__k[r.__i]=r,si(l,r,s),r.__e!=i&&ni(r)),xt.length>t&&xt.sort(gr));Fn.__r=0}function ri(e,t,n,r,o,i,l,s,a,u,c){var d,p,f,g,h,v,w=r&&r.__k||ti,b=t.length;for(a=Wa(n,t,w,a,b),d=0;d<b;d++)(f=n.__k[d])!=null&&(p=f.__i===-1?en:w[f.__i]||en,f.__i=d,v=br(e,f,p,o,i,l,s,a,u,c),g=f.__e,f.ref&&p.ref!=f.ref&&(p.ref&&xr(p.ref,null,f),c.push(f.ref,f.__c||g,f)),h==null&&g!=null&&(h=g),4&f.__u||p.__k===f.__k?a=oi(f,a,e):typeof f.type=="function"&&v!==void 0?a=v:g&&(a=g.nextSibling),f.__u&=-7);return n.__e=h,a}function Wa(e,t,n,r,o){var i,l,s,a,u,c=n.length,d=c,p=0;for(e.__k=new Array(o),i=0;i<o;i++)(l=t[i])!=null&&typeof l!="boolean"&&typeof l!="function"?(a=i+p,(l=e.__k[i]=typeof l=="string"||typeof l=="number"||typeof l=="bigint"||l.constructor==String?tn(null,l,null,null,null):Mn(l)?tn(me,{children:l},null,null,null):l.constructor===void 0&&l.__b>0?tn(l.type,l.props,l.key,l.ref?l.ref:null,l.__v):l).__=e,l.__b=e.__b+1,s=null,(u=l.__i=Ga(l,n,a,d))!==-1&&(d--,(s=n[u])&&(s.__u|=2)),s==null||s.__v===null?(u==-1&&p--,typeof l.type!="function"&&(l.__u|=4)):u!=a&&(u==a-1?p--:u==a+1?p++:(u>a?p--:p++,l.__u|=4))):e.__k[i]=null;if(d)for(i=0;i<c;i++)(s=n[i])!=null&&(2&s.__u)==0&&(s.__e==r&&(r=kt(s)),ai(s,s));return r}function oi(e,t,n){var r,o;if(typeof e.type=="function"){for(r=e.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=e,t=oi(r[o],t,n));return t}e.__e!=t&&(t&&e.type&&!n.contains(t)&&(t=kt(e)),n.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function nt(e,t){return t=t||[],e==null||typeof e=="boolean"||(Mn(e)?e.some(function(n){nt(n,t)}):t.push(e)),t}function Ga(e,t,n,r){var o,i,l=e.key,s=e.type,a=t[n];if(a===null||a&&l==a.key&&s===a.type&&(2&a.__u)==0)return n;if(r>(a!=null&&(2&a.__u)==0?1:0))for(o=n-1,i=n+1;o>=0||i<t.length;){if(o>=0){if((a=t[o])&&(2&a.__u)==0&&l==a.key&&s===a.type)return o;o--}if(i<t.length){if((a=t[i])&&(2&a.__u)==0&&l==a.key&&s===a.type)return i;i++}}return-1}function ii(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||Ua.test(t)?n:n+"px"}function Pn(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||ii(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||ii(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(Qo,"$1")),t=t.toLowerCase()in e||t=="onFocusOut"||t=="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n.u=r.u:(n.u=hr,e.addEventListener(t,i?_r:vr,i)):e.removeEventListener(t,i?_r:vr,i);else{if(o=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&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,t=="popover"&&n==1?"":n))}}function li(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=hr++;else if(t.t<n.u)return;return n(J.event?J.event(t):t)}}}function br(e,t,n,r,o,i,l,s,a,u){var c,d,p,f,g,h,v,w,b,C,E,I,M,R,_,y,x,S=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(a=!!(32&n.__u),i=[s=t.__e=n.__e]),(c=J.__b)&&c(t);e:if(typeof S=="function")try{if(w=t.props,b="prototype"in S&&S.prototype.render,C=(c=S.contextType)&&r[c.__c],E=c?C?C.props.value:c.__:r,n.__c?v=(d=t.__c=n.__c).__=d.__E:(b?t.__c=d=new S(w,E):(t.__c=d=new je(w,E),d.constructor=S,d.render=Ka),C&&C.sub(d),d.props=w,d.state||(d.state={}),d.context=E,d.__n=r,p=d.__d=!0,d.__h=[],d._sb=[]),b&&d.__s==null&&(d.__s=d.state),b&&S.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=tt({},d.__s)),tt(d.__s,S.getDerivedStateFromProps(w,d.__s))),f=d.props,g=d.state,d.__v=t,p)b&&S.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),b&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(b&&S.getDerivedStateFromProps==null&&w!==f&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(w,E),!d.__e&&(d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(w,d.__s,E)===!1||t.__v==n.__v)){for(t.__v!=n.__v&&(d.props=w,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(T){T&&(T.__=t)}),I=0;I<d._sb.length;I++)d.__h.push(d._sb[I]);d._sb=[],d.__h.length&&l.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(w,d.__s,E),b&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(f,g,h)})}if(d.context=E,d.props=w,d.__P=e,d.__e=!1,M=J.__r,R=0,b){for(d.state=d.__s,d.__d=!1,M&&M(t),c=d.render(d.props,d.state,d.context),_=0;_<d._sb.length;_++)d.__h.push(d._sb[_]);d._sb=[]}else do d.__d=!1,M&&M(t),c=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++R<25);d.state=d.__s,d.getChildContext!=null&&(r=tt(tt({},r),d.getChildContext())),b&&!p&&d.getSnapshotBeforeUpdate!=null&&(h=d.getSnapshotBeforeUpdate(f,g)),s=ri(e,Mn(y=c!=null&&c.type===me&&c.key==null?c.props.children:c)?y:[y],t,n,r,o,i,l,s,a,u),d.base=t.__e,t.__u&=-161,d.__h.length&&l.push(d),v&&(d.__E=d.__=null)}catch(T){if(t.__v=null,a||i!=null)if(T.then){for(t.__u|=a?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;i[i.indexOf(s)]=null,t.__e=s}else for(x=i.length;x--;)wr(i[x]);else t.__e=n.__e,t.__k=n.__k;J.__e(T,t,n)}else i==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=qa(n.__e,t,n,r,o,i,l,a,u);return(c=J.diffed)&&c(t),128&t.__u?void 0:s}function si(e,t,n){for(var r=0;r<n.length;r++)xr(n[r],n[++r],n[++r]);J.__c&&J.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(i){i.call(o)})}catch(i){J.__e(i,o.__v)}})}function qa(e,t,n,r,o,i,l,s,a){var u,c,d,p,f,g,h,v=n.props,w=t.props,b=t.type;if(b=="svg"?o="http://www.w3.org/2000/svg":b=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),i!=null){for(u=0;u<i.length;u++)if((f=i[u])&&"setAttribute"in f==!!b&&(b?f.localName==b:f.nodeType==3)){e=f,i[u]=null;break}}if(e==null){if(b==null)return document.createTextNode(w);e=document.createElementNS(o,b,w.is&&w),s&&(J.__m&&J.__m(t,i),s=!1),i=null}if(b===null)v===w||s&&e.data===w||(e.data=w);else{if(i=i&&Ee.call(e.childNodes),v=n.props||en,!s&&i!=null)for(v={},u=0;u<e.attributes.length;u++)v[(f=e.attributes[u]).name]=f.value;for(u in v)if(f=v[u],u!="children"){if(u=="dangerouslySetInnerHTML")d=f;else if(!(u in w)){if(u=="value"&&"defaultValue"in w||u=="checked"&&"defaultChecked"in w)continue;Pn(e,u,null,f,o)}}for(u in w)f=w[u],u=="children"?p=f:u=="dangerouslySetInnerHTML"?c=f:u=="value"?g=f:u=="checked"?h=f:s&&typeof f!="function"||v[u]===f||Pn(e,u,f,v[u],o);if(c)s||d&&(c.__html===d.__html||c.__html===e.innerHTML)||(e.innerHTML=c.__html),t.__k=[];else if(d&&(e.innerHTML=""),ri(e,Mn(p)?p:[p],t,n,r,b=="foreignObject"?"http://www.w3.org/1999/xhtml":o,i,l,i?i[0]:n.__k&&kt(n,0),s,a),i!=null)for(u=i.length;u--;)wr(i[u]);s||(u="value",b=="progress"&&g==null?e.removeAttribute("value"):g!==void 0&&(g!==e[u]||b=="progress"&&!g||b=="option"&&g!==v[u])&&Pn(e,u,g,v[u],o),u="checked",h!==void 0&&h!==e[u]&&Pn(e,u,h,v[u],o))}return e}function xr(e,t,n){try{if(typeof e=="function"){var r=typeof e.__u=="function";r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(o){J.__e(o,n)}}function ai(e,t,n){var r,o;if(J.unmount&&J.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||xr(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){J.__e(i,t)}r.base=r.__P=null}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&ai(r[o],t,n||typeof e.type!="function");n||wr(e.__e),e.__c=e.__=e.__e=void 0}function Ka(e,t,n){return this.constructor(e,n)}function At(e,t,n){var r,o,i,l;t==document&&(t=document.documentElement),J.__&&J.__(e,t),o=(r=typeof n=="function")?null:n&&n.__k||t.__k,i=[],l=[],br(t,e=(!r&&n||t).__k=F(me,null,[e]),o||en,en,t.namespaceURI,!r&&n?[n]:o?null:t.firstChild?Ee.call(t.childNodes):null,i,!r&&n?n:o?o.__e:t.firstChild,r,l),si(i,e,l)}function ui(e,t){At(e,t,ui)}function Ya(e,t,n){var r,o,i,l,s=tt({},e.props);for(i in e.type&&e.type.defaultProps&&(l=e.type.defaultProps),t)i=="key"?r=t[i]:i=="ref"?o=t[i]:s[i]=t[i]===void 0&&l!==void 0?l[i]:t[i];return arguments.length>2&&(s.children=arguments.length>3?Ee.call(arguments,2):n),tn(e.type,s,r||e.key,o||e.ref,null)}function fe(e,t){var n={__c:t="__cC"+ei++,__:e,Consumer:function(r,o){return r.children(o)},Provider:function(r){var o,i;return this.getChildContext||(o=new Set,(i={})[t]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){o=null},this.shouldComponentUpdate=function(l){this.props.value!==l.value&&o.forEach(function(s){s.__e=!0,yr(s)})},this.sub=function(l){o.add(l);var s=l.componentWillUnmount;l.componentWillUnmount=function(){o&&o.delete(l),s&&s.call(l)}}),r.children}};return n.Provider.__=n.Consumer.contextType=n}Ee=ti.slice,J={__e:function(e,t,n,r){for(var o,i,l;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&i.getDerivedStateFromError!=null&&(o.setState(i.getDerivedStateFromError(e)),l=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,r||{}),l=o.__d),l)return o.__E=o}catch(s){e=s}throw e}},Xo=0,je.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=tt({},this.state),typeof e=="function"&&(e=e(tt({},n),this.props)),e&&tt(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),yr(this))},je.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),yr(this))},je.prototype.render=me,xt=[],Jo=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,gr=function(e,t){return e.__v.__b-t.__v.__b},Fn.__r=0,Qo=/(PointerCapture)$|Capture$/i,hr=0,vr=li(!1),_r=li(!0),ei=0;var Xa=0;function m(e,t,n,r,o,i){t||(t={});var l,s,a=t;if("ref"in a)for(s in a={},t)s=="ref"?l=t[s]:a[s]=t[s];var u={type:e,props:a,key:n,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Xa,__i:-1,__u:0,__source:o,__self:i};if(typeof e=="function"&&(l=e.defaultProps))for(s in l)a[s]===void 0&&(a[s]=l[s]);return J.vnode&&J.vnode(u),u}var rt,pe,Cr,ci,Dt=0,di=[],ve=J,fi=ve.__b,pi=ve.__r,mi=ve.diffed,gi=ve.__c,hi=ve.unmount,vi=ve.__;function Ct(e,t){ve.__h&&ve.__h(pe,e,Dt||t),Dt=0;var n=pe.__H||(pe.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function j(e){return Dt=1,ot(wi,e)}function ot(e,t,n){var r=Ct(rt++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):wi(void 0,t),function(s){var a=r.__N?r.__N[0]:r.__[0],u=r.t(a,s);a!==u&&(r.__N=[u,r.__[1]],r.__c.setState({}))}],r.__c=pe,!pe.u)){var o=function(s,a,u){if(!r.__c.__H)return!0;var c=r.__c.__H.__.filter(function(p){return!!p.__c});if(c.every(function(p){return!p.__N}))return!i||i.call(this,s,a,u);var d=r.__c.props!==s;return c.forEach(function(p){if(p.__N){var f=p.__[0];p.__=p.__N,p.__N=void 0,f!==p.__[0]&&(d=!0)}}),i&&i.call(this,s,a,u)||d};pe.u=!0;var i=pe.shouldComponentUpdate,l=pe.componentWillUpdate;pe.componentWillUpdate=function(s,a,u){if(this.__e){var c=i;i=void 0,o(s,a,u),i=c}l&&l.call(this,s,a,u)},pe.shouldComponentUpdate=o}return r.__N||r.__}function oe(e,t){var n=Ct(rt++,3);!ve.__s&&$r(n.__H,t)&&(n.__=e,n.i=t,pe.__H.__h.push(n))}function Ge(e,t){var n=Ct(rt++,4);!ve.__s&&$r(n.__H,t)&&(n.__=e,n.i=t,pe.__h.push(n))}function D(e){return Dt=5,W(function(){return{current:e}},[])}function Sr(e,t,n){Dt=6,Ge(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 W(e,t){var n=Ct(rt++,7);return $r(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function ie(e,t){return Dt=8,W(function(){return e},t)}function ae(e){var t=pe.context[e.__c],n=Ct(rt++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(pe)),t.props.value):e.__}function Er(e,t){ve.useDebugValue&&ve.useDebugValue(t?t(e):e)}function Za(e){var t=Ct(rt++,10),n=j();return t.__=e,pe.componentDidCatch||(pe.componentDidCatch=function(r,o){t.__&&t.__(r,o),n[1](r)}),[n[0],function(){n[1](void 0)}]}function Re(){var e=Ct(rt++,11);if(!e.__){for(var t=pe.__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 Ja(){for(var e;e=di.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Nn),e.__H.__h.forEach(Rr),e.__H.__h=[]}catch(t){e.__H.__h=[],ve.__e(t,e.__v)}}ve.__b=function(e){pe=null,fi&&fi(e)},ve.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),vi&&vi(e,t)},ve.__r=function(e){pi&&pi(e),rt=0;var t=(pe=e.__c).__H;t&&(Cr===pe?(t.__h=[],pe.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.i=n.__N=void 0})):(t.__h.forEach(Nn),t.__h.forEach(Rr),t.__h=[],rt=0)),Cr=pe},ve.diffed=function(e){mi&&mi(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(di.push(t)!==1&&ci===ve.requestAnimationFrame||((ci=ve.requestAnimationFrame)||Qa)(Ja)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.i=void 0})),Cr=pe=null},ve.__c=function(e,t){t.some(function(n){try{n.__h.forEach(Nn),n.__h=n.__h.filter(function(r){return!r.__||Rr(r)})}catch(r){t.some(function(o){o.__h&&(o.__h=[])}),t=[],ve.__e(r,n.__v)}}),gi&&gi(e,t)},ve.unmount=function(e){hi&&hi(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{Nn(r)}catch(o){t=o}}),n.__H=void 0,t&&ve.__e(t,n.__v))};var _i=typeof requestAnimationFrame=="function";function Qa(e){var t,n=function(){clearTimeout(r),_i&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);_i&&(t=requestAnimationFrame(n))}function Nn(e){var t=pe,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),pe=t}function Rr(e){var t=pe;e.__c=e.__(),pe=t}function $r(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function wi(e,t){return typeof t=="function"?t(e):t}function yi(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=yi(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function eu(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=yi(e))&&(r&&(r+=" "),r+=t);return r}const bi=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,xi=eu,St=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return xi(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,l=Object.keys(o).map(u=>{const c=n==null?void 0:n[u],d=i==null?void 0:i[u];if(c===null)return null;const p=bi(c)||bi(d);return o[u][p]}),s=n&&Object.entries(n).reduce((u,c)=>{let[d,p]=c;return p===void 0||(u[d]=p),u},{}),a=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,c)=>{let{class:d,className:p,...f}=c;return Object.entries(f).every(g=>{let[h,v]=g;return Array.isArray(v)?v.includes({...i,...s}[h]):{...i,...s}[h]===v})?[...u,d,p]:u},[]);return xi(e,l,a,n==null?void 0:n.class,n==null?void 0:n.className)},tu=St("text-center inline-block font-semibold px-3 py-2 rounded-md text-sm",{variants:{variant:{primary:"shadow-xs bg-hello-csv-primary text-white",secondary:"bg-white text-hello-csv-primary ring-1 shadow-xs ring-bg-hello-csv-primary ring-inset",tertiary:"bg-white text-gray-900 ring-1 shadow-xs ring-hello-csv-tertiary ring-inset",success:"shadow-xs bg-hello-csv-success text-white",danger:"shadow-xs bg-hello-csv-danger text-white"},withFullWidth:{true:"w-full",false:""},disabled:{true:"opacity-50 cursor-not-allowed pointer-events-none",false:"cursor-pointer"}},compoundVariants:[{variant:"primary",disabled:!1,className:"hover:bg-hello-csv-primary-light focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-hello-csv-primary"},{variant:"secondary",disabled:!1,className:"hover:opacity-80 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-hello-csv-secondary"},{variant:"tertiary",disabled:!1,className:"hover:bg-hello-csv-tertiary-light"},{variant:"success",disabled:!1,className:"hover:opacity-80 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-hello-csv-success"},{variant:"danger",disabled:!1,className:"hover:bg-hello-csv-danger-light focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-hello-csv-danger"}],defaultVariants:{withFullWidth:!1,variant:"primary",disabled:!1}});function Be({children:e,variant:t,disabled:n,onClick:r,withFullWidth:o}){const i=tu({variant:t,disabled:n,withFullWidth:o});return m("div",{role:"button",tabIndex:0,className:i,onClick:r,"aria-disabled":n,children:e})}function Ci(e,t){for(var n in t)e[n]=t[n];return e}function Tr(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 kn(e,t){var n=t(),r=j({t:{__:n,u:t}}),o=r[0].t,i=r[1];return Ge(function(){o.__=n,o.u=t,Ir(o)&&i({t:o})},[e,n,t]),oe(function(){return Ir(o)&&i({t:o}),e(function(){Ir(o)&&i({t:o})})},[e]),n}function Ir(e){var t,n,r=e.u,o=e.__;try{var i=r();return!((t=o)===(n=i)&&(t!==0||1/t==1/n)||t!=t&&n!=n)}catch{return!0}}function Mr(e){e()}function Or(e){return e}function Fr(){return[!1,Mr]}var Pr=Ge;function An(e,t){this.props=e,this.context=t}function Si(e,t){function n(o){var i=this.props.ref,l=i==o.ref;return!l&&i&&(i.call?i(null):i.current=null),t?!t(this.props,o)||!l:Tr(this.props,o)}function r(o){return this.shouldComponentUpdate=n,F(e,o)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(An.prototype=new je).isPureReactComponent=!0,An.prototype.shouldComponentUpdate=function(e,t){return Tr(this.props,e)||Tr(this.state,t)};var Ei=J.__b;J.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Ei&&Ei(e)};var nu=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function de(e){function t(n){var r=Ci({},n);return delete r.ref,e(r,n.ref||null)}return t.$$typeof=nu,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var Ri=function(e,t){return e==null?null:nt(nt(e).map(t))},$i={map:Ri,forEach:Ri,count:function(e){return e?nt(e).length:0},only:function(e){var t=nt(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:nt},ru=J.__e;J.__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)}ru(e,t,n,r)};var Ti=J.unmount;function Ii(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=Ci({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return Ii(r,t,n)})),e}function Mi(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return Mi(r,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function nn(){this.__u=0,this.o=null,this.__b=null}function Oi(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Fi(e){var t,n,r;function o(i){if(t||(t=e()).then(function(l){n=l.default||l},function(l){r=l}),r)throw r;if(!n)throw t;return F(n,i)}return o.displayName="Lazy",o.__f=!0,o}function Lt(){this.i=null,this.l=null}J.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Ti&&Ti(e)},(nn.prototype=new je).__c=function(e,t){var n=t.__c,r=this;r.o==null&&(r.o=[]),r.o.push(n);var o=Oi(r.__v),i=!1,l=function(){i||(i=!0,n.__R=null,o?o(s):s())};n.__R=l;var s=function(){if(!--r.__u){if(r.state.__a){var a=r.state.__a;r.__v.__k[0]=Mi(a,a.__c.__P,a.__c.__O)}var u;for(r.setState({__a:r.__b=null});u=r.o.pop();)u.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(l,l)},nn.prototype.componentWillUnmount=function(){this.o=[]},nn.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]=Ii(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&F(me,null,e.fallback);return o&&(o.__u&=-33),[F(me,null,t.__a?null:e.children),o]};var Pi=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};function ou(e){return this.getChildContext=function(){return e.context},e.children}function iu(e){var t=this,n=e.h;t.componentWillUnmount=function(){At(null,t.v),t.v=null,t.h=null},t.h&&t.h!==n&&t.componentWillUnmount(),t.v||(t.h=n,t.v={nodeType:1,parentNode:n,childNodes:[],contains:function(){return!0},appendChild:function(r){this.childNodes.push(r),t.h.appendChild(r)},insertBefore:function(r,o){this.childNodes.push(r),t.h.insertBefore(r,o)},removeChild:function(r){this.childNodes.splice(this.childNodes.indexOf(r)>>>1,1),t.h.removeChild(r)}}),At(F(ou,{context:t.context},e.__v),t.v)}function rn(e,t){var n=F(iu,{__v:e,h:t});return n.containerInfo=t,n}(Lt.prototype=new je).__a=function(e){var t=this,n=Oi(t.__v),r=t.l.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),Pi(t,e,r)):o()};n?n(i):i()}},Lt.prototype.render=function(e){this.i=null,this.l=new Map;var t=nt(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},Lt.prototype.componentDidUpdate=Lt.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){Pi(e,n,t)})};var Ni=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,lu=/^(?: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]/,su=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,au=/[A-Z0-9]/g,uu=typeof document<"u",cu=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function ki(e,t,n){return t.__k==null&&(t.textContent=""),At(e,t),typeof n=="function"&&n(),e?e.__c:null}function Ai(e,t,n){return ui(e,t),typeof n=="function"&&n(),e?e.__c:null}je.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(je.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Di=J.event;function du(){}function fu(){return this.cancelBubble}function pu(){return this.defaultPrevented}J.event=function(e){return Di&&(e=Di(e)),e.persist=du,e.isPropagationStopped=fu,e.isDefaultPrevented=pu,e.nativeEvent=e};var Nr,mu={enumerable:!1,configurable:!0,get:function(){return this.class}},Li=J.vnode;J.vnode=function(e){typeof e.type=="string"&&function(t){var n=t.props,r=t.type,o={},i=r.indexOf("-")===-1;for(var l in n){var s=n[l];if(!(l==="value"&&"defaultValue"in n&&s==null||uu&&l==="children"&&r==="noscript"||l==="class"||l==="className")){var a=l.toLowerCase();l==="defaultValue"&&"value"in n&&n.value==null?l="value":l==="download"&&s===!0?s="":a==="translate"&&s==="no"?s=!1:a[0]==="o"&&a[1]==="n"?a==="ondoubleclick"?l="ondblclick":a!=="onchange"||r!=="input"&&r!=="textarea"||cu(n.type)?a==="onfocus"?l="onfocusin":a==="onblur"?l="onfocusout":su.test(l)&&(l=a):a=l="oninput":i&&lu.test(l)?l=l.replace(au,"-$&").toLowerCase():s===null&&(s=void 0),a==="oninput"&&o[l=a]&&(l="oninputCapture"),o[l]=s}}r=="select"&&o.multiple&&Array.isArray(o.value)&&(o.value=nt(n.children).forEach(function(u){u.props.selected=o.value.indexOf(u.props.value)!=-1})),r=="select"&&o.defaultValue!=null&&(o.value=nt(n.children).forEach(function(u){u.props.selected=o.multiple?o.defaultValue.indexOf(u.props.value)!=-1:o.defaultValue==u.props.value})),n.class&&!n.className?(o.class=n.class,Object.defineProperty(o,"className",mu)):(n.className&&!n.class||n.class&&n.className)&&(o.class=o.className=n.className),t.props=o}(e),e.$$typeof=Ni,Li&&Li(e)};var Vi=J.__r;J.__r=function(e){Vi&&Vi(e),Nr=e.__c};var Hi=J.diffed;J.diffed=function(e){Hi&&Hi(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),Nr=null};var zi={ReactCurrentDispatcher:{current:{readContext:function(e){return Nr.__n[e.__c].props.value},useCallback:ie,useContext:ae,useDebugValue:Er,useDeferredValue:Or,useEffect:oe,useId:Re,useImperativeHandle:Sr,useInsertionEffect:Pr,useLayoutEffect:Ge,useMemo:W,useReducer:ot,useRef:D,useState:j,useSyncExternalStore:kn,useTransition:Fr}}},gu="18.3.1";function Bi(e){return F.bind(null,e)}function Vt(e){return!!e&&e.$$typeof===Ni}function ji(e){return Vt(e)&&e.type===me}function Ui(e){return!!e&&!!e.displayName&&(typeof e.displayName=="string"||e.displayName instanceof String)&&e.displayName.startsWith("Memo(")}function kr(e){return Vt(e)?Ya.apply(null,arguments):e}function Wi(e){return!!e.__k&&(At(null,e),!0)}function Gi(e){return e&&(e.base||e.nodeType===1&&e)||null}var qi=function(e,t){return e(t)},Le=function(e,t){return e(t)},Ki=me,Yi=Vt,L={useState:j,useId:Re,useReducer:ot,useEffect:oe,useLayoutEffect:Ge,useInsertionEffect:Pr,useTransition:Fr,useDeferredValue:Or,useSyncExternalStore:kn,startTransition:Mr,useRef:D,useImperativeHandle:Sr,useMemo:W,useCallback:ie,useContext:ae,useDebugValue:Er,version:"18.3.1",Children:$i,render:ki,hydrate:Ai,unmountComponentAtNode:Wi,createPortal:rn,createElement:F,createContext:fe,createFactory:Bi,cloneElement:kr,createRef:On,Fragment:me,isValidElement:Vt,isElement:Yi,isFragment:ji,isMemo:Ui,findDOMNode:Gi,Component:je,PureComponent:An,memo:Si,forwardRef:de,flushSync:Le,unstable_batchedUpdates:qi,StrictMode:Ki,Suspense:nn,SuspenseList:Lt,lazy:Fi,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:zi};const Ar=Object.freeze(Object.defineProperty({__proto__:null,Children:$i,Component:je,Fragment:me,PureComponent:An,StrictMode:Ki,Suspense:nn,SuspenseList:Lt,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:zi,cloneElement:kr,createContext:fe,createElement:F,createFactory:Bi,createPortal:rn,createRef:On,default:L,findDOMNode:Gi,flushSync:Le,forwardRef:de,hydrate:Ai,isElement:Yi,isFragment:ji,isMemo:Ui,isValidElement:Vt,lazy:Fi,memo:Si,render:ki,startTransition:Mr,unmountComponentAtNode:Wi,unstable_batchedUpdates:qi,useCallback:ie,useContext:ae,useDebugValue:Er,useDeferredValue:Or,useEffect:oe,useErrorBoundary:Za,useId:Re,useImperativeHandle:Sr,useInsertionEffect:Pr,useLayoutEffect:Ge,useMemo:W,useReducer:ot,useRef:D,useState:j,useSyncExternalStore:kn,useTransition:Fr,version:gu},Symbol.toStringTag,{value:"Module"})),hu=St("overflow-hidden rounded-md border border-gray-200",{variants:{variant:{default:"bg-white",muted:"bg-hello-csv-muted"},withPadding:{true:"px-4 py-5 sm:p-6",false:""}},defaultVariants:{variant:"default",withPadding:!0}}),Xi=de(({children:e,className:t,variant:n,withPadding:r=!0},o)=>{const i=hu({variant:n,withPadding:r});return m("div",{ref:o,className:`${i} ${t}`,children:e})});function Zi({checked:e,setChecked:t,label:n}){const r=Re();return m("div",{className:"flex gap-3",children:[m("div",{className:"flex h-6 shrink-0 items-center",children:m("div",{className:"group grid size-4 grid-cols-1",children:[m("input",{checked:e,onChange:o=>t(o.target.checked),id:r,type:"checkbox",className:"checked:border-hello-csv-primary checked:bg-hello-csv-primary indeterminate:border-hello-csv-primary indeterminate:bg-hello-csv-primary focus-visible:outline-hello-csv-hello-csv-primary col-start-1 row-start-1 appearance-none rounded-sm border border-gray-300 bg-white focus-visible:outline-2 focus-visible:outline-offset-2 disabled:border-gray-300 disabled:bg-gray-100 disabled:checked:bg-gray-100 forced-colors:appearance-auto"}),m("svg",{fill:"none",viewBox:"0 0 14 14",className:"pointer-events-none col-start-1 row-start-1 size-3.5 self-center justify-self-center stroke-white group-has-disabled:stroke-gray-950/25",children:[m("path",{d:"M3 8L6 11L11 3.5",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"opacity-0 group-has-checked:opacity-100"}),m("path",{d:"M3 7H11",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"opacity-0 group-has-indeterminate:opacity-100"})]})]})}),n&&m("div",{className:"text-sm/6",children:m("label",{htmlFor:r,className:"font-medium text-gray-900",children:n})})]})}let vu=!1;function Dr(){return vu}const Ji=typeof document<"u"?L.useLayoutEffect:()=>{};function _u(e){const t=D(null);return Ji(()=>{t.current=e},[e]),ie((...n)=>{const r=t.current;return r==null?void 0:r(...n)},[])}const dt=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},Et=e=>e&&"window"in e&&e.window===e?e:dt(e).defaultView||window;function wu(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function yu(e){return wu(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}function Qi(e,t){if(!Dr())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let n=t;for(;n!==null;){if(n===e)return!0;n.tagName==="SLOT"&&n.assignedSlot?n=n.assignedSlot.parentNode:yu(n)?n=n.host:n=n.parentNode}return!1}const Lr=(e=document)=>{var t;if(!Dr())return e.activeElement;let n=e.activeElement;for(;n&&"shadowRoot"in n&&(!((t=n.shadowRoot)===null||t===void 0)&&t.activeElement);)n=n.shadowRoot.activeElement;return n};function el(e){return Dr()&&e.target.shadowRoot&&e.composedPath?e.composedPath()[0]:e.target}function bu(e){var t;return typeof window>"u"||window.navigator==null?!1:((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands.some(n=>e.test(n.brand)))||e.test(window.navigator.userAgent)}function xu(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function tl(e){let t=null;return()=>(t==null&&(t=e()),t)}const Cu=tl(function(){return xu(/^Mac/i)}),Su=tl(function(){return bu(/Android/i)});function nl(){let e=D(new Map),t=ie((o,i,l,s)=>{let a=s!=null&&s.once?(...u)=>{e.current.delete(l),l(...u)}:l;e.current.set(l,{type:i,eventTarget:o,fn:a,options:s}),o.addEventListener(i,a,s)},[]),n=ie((o,i,l,s)=>{var a;let u=((a=e.current.get(l))===null||a===void 0?void 0:a.fn)||l;o.removeEventListener(i,u,s),e.current.delete(l)},[]),r=ie(()=>{e.current.forEach((o,i)=>{n(o.eventTarget,o.type,i,o.options)})},[n]);return oe(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function Eu(e){return e.mozInputSource===0&&e.isTrusted?!0:Su()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function rl(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function Ru(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function ol(e){let t=D({isFocused:!1,observer:null});Ji(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=_u(r=>{e==null||e(r)});return ie(r=>{if(r.target instanceof HTMLButtonElement||r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement||r.target instanceof HTMLSelectElement){t.current.isFocused=!0;let o=r.target,i=l=>{if(t.current.isFocused=!1,o.disabled){let s=rl(l);n(s)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};o.addEventListener("focusout",i,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&o.disabled){var l;(l=t.current.observer)===null||l===void 0||l.disconnect();let s=o===document.activeElement?null:document.activeElement;o.dispatchEvent(new FocusEvent("blur",{relatedTarget:s})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:s}))}}),t.current.observer.observe(o,{attributes:!0,attributeFilter:["disabled"]})}},[n])}let $u=!1,on=null,Vr=new Set,ln=new Map,Rt=!1,Hr=!1;const Tu={Tab:!0,Escape:!0};function zr(e,t){for(let n of Vr)n(e,t)}function Iu(e){return!(e.metaKey||!Cu()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function Dn(e){Rt=!0,Iu(e)&&(on="keyboard",zr("keyboard",e))}function Ht(e){on="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(Rt=!0,zr("pointer",e))}function il(e){Eu(e)&&(Rt=!0,on="virtual")}function ll(e){e.target===window||e.target===document||$u||!e.isTrusted||(!Rt&&!Hr&&(on="virtual",zr("virtual",e)),Rt=!1,Hr=!1)}function sl(){Rt=!1,Hr=!0}function Br(e){if(typeof window>"u"||ln.get(Et(e)))return;const t=Et(e),n=dt(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){Rt=!0,r.apply(this,arguments)},n.addEventListener("keydown",Dn,!0),n.addEventListener("keyup",Dn,!0),n.addEventListener("click",il,!0),t.addEventListener("focus",ll,!0),t.addEventListener("blur",sl,!1),typeof PointerEvent<"u"&&(n.addEventListener("pointerdown",Ht,!0),n.addEventListener("pointermove",Ht,!0),n.addEventListener("pointerup",Ht,!0)),t.addEventListener("beforeunload",()=>{al(e)},{once:!0}),ln.set(t,{focus:r})}const al=(e,t)=>{const n=Et(e),r=dt(e);t&&r.removeEventListener("DOMContentLoaded",t),ln.has(n)&&(n.HTMLElement.prototype.focus=ln.get(n).focus,r.removeEventListener("keydown",Dn,!0),r.removeEventListener("keyup",Dn,!0),r.removeEventListener("click",il,!0),n.removeEventListener("focus",ll,!0),n.removeEventListener("blur",sl,!1),typeof PointerEvent<"u"&&(r.removeEventListener("pointerdown",Ht,!0),r.removeEventListener("pointermove",Ht,!0),r.removeEventListener("pointerup",Ht,!0)),ln.delete(n))};function Mu(e){const t=dt(e);let n;return t.readyState!=="loading"?Br(e):(n=()=>{Br(e)},t.addEventListener("DOMContentLoaded",n)),()=>al(e,n)}typeof document<"u"&&Mu();function ul(){return on!=="pointer"}const Ou=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Fu(e,t,n){let r=dt(n==null?void 0:n.target);const o=typeof window<"u"?Et(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,i=typeof window<"u"?Et(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,l=typeof window<"u"?Et(n==null?void 0:n.target).HTMLElement:HTMLElement,s=typeof window<"u"?Et(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return e=e||r.activeElement instanceof o&&!Ou.has(r.activeElement.type)||r.activeElement instanceof i||r.activeElement instanceof l&&r.activeElement.isContentEditable,!(e&&t==="keyboard"&&n instanceof s&&!Tu[n.key])}function Pu(e,t,n){Br(),oe(()=>{let r=(o,i)=>{Fu(!!(n!=null&&n.isTextInput),o,i)&&e(ul())};return Vr.add(r),()=>{Vr.delete(r)}},t)}function Nu(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:o}=e;const i=ie(a=>{if(a.target===a.currentTarget)return r&&r(a),o&&o(!1),!0},[r,o]),l=ol(i),s=ie(a=>{const u=dt(a.target),c=u?Lr(u):Lr();a.target===a.currentTarget&&c===el(a.nativeEvent)&&(n&&n(a),o&&o(!0),l(a))},[o,n,l]);return{focusProps:{onFocus:!t&&(n||o||r)?s:void 0,onBlur:!t&&(r||o)?i:void 0}}}function ku(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=e,i=D({isFocusWithin:!1}),{addGlobalListener:l,removeAllGlobalListeners:s}=nl(),a=ie(d=>{d.currentTarget.contains(d.target)&&i.current.isFocusWithin&&!d.currentTarget.contains(d.relatedTarget)&&(i.current.isFocusWithin=!1,s(),n&&n(d),o&&o(!1))},[n,o,i,s]),u=ol(a),c=ie(d=>{if(!d.currentTarget.contains(d.target))return;const p=dt(d.target),f=Lr(p);if(!i.current.isFocusWithin&&f===el(d.nativeEvent)){r&&r(d),o&&o(!0),i.current.isFocusWithin=!0,u(d);let g=d.currentTarget;l(p,"focus",h=>{if(i.current.isFocusWithin&&!Qi(g,h.target)){let v=new p.defaultView.FocusEvent("blur",{relatedTarget:h.target});Ru(v,g);let w=rl(v);a(w)}},{capture:!0})}},[r,o,u,l,a]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:c,onBlur:a}}}let jr=!1,Ur=0;function Au(){jr=!0,setTimeout(()=>{jr=!1},50)}function cl(e){e.pointerType==="touch"&&Au()}function Du(){if(!(typeof document>"u"))return typeof PointerEvent<"u"&&document.addEventListener("pointerup",cl),Ur++,()=>{Ur--,!(Ur>0)&&typeof PointerEvent<"u"&&document.removeEventListener("pointerup",cl)}}function dl(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:o}=e,[i,l]=j(!1),s=D({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;oe(Du,[]);let{addGlobalListener:a,removeAllGlobalListeners:u}=nl(),{hoverProps:c,triggerHoverEnd:d}=W(()=>{let p=(h,v)=>{if(s.pointerType=v,o||v==="touch"||s.isHovered||!h.currentTarget.contains(h.target))return;s.isHovered=!0;let w=h.currentTarget;s.target=w,a(dt(h.target),"pointerover",b=>{s.isHovered&&s.target&&!Qi(s.target,b.target)&&f(b,b.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:w,pointerType:v}),n&&n(!0),l(!0)},f=(h,v)=>{let w=s.target;s.pointerType="",s.target=null,!(v==="touch"||!s.isHovered||!w)&&(s.isHovered=!1,u(),r&&r({type:"hoverend",target:w,pointerType:v}),n&&n(!1),l(!1))},g={};return typeof PointerEvent<"u"&&(g.onPointerEnter=h=>{jr&&h.pointerType==="mouse"||p(h,h.pointerType)},g.onPointerLeave=h=>{!o&&h.currentTarget.contains(h.target)&&f(h,h.pointerType)}),{hoverProps:g,triggerHoverEnd:f}},[t,n,r,o,s,a,u]);return oe(()=>{o&&d({currentTarget:s.target},s.pointerType)},[o]),{hoverProps:c,isHovered:i}}function fl(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,o=D({isFocused:!1,isFocusVisible:t||ul()}),[i,l]=j(!1),[s,a]=j(()=>o.current.isFocused&&o.current.isFocusVisible),u=ie(()=>a(o.current.isFocused&&o.current.isFocusVisible),[]),c=ie(f=>{o.current.isFocused=f,l(f),u()},[u]);Pu(f=>{o.current.isFocusVisible=f,u()},[],{isTextInput:n});let{focusProps:d}=Nu({isDisabled:r,onFocusChange:c}),{focusWithinProps:p}=ku({isDisabled:!r,onFocusWithinChange:c});return{isFocused:i,isFocusVisible:s,focusProps:r?p:d}}var Lu=Object.defineProperty,Vu=(e,t,n)=>t in e?Lu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Wr=(e,t,n)=>(Vu(e,typeof t!="symbol"?t+"":t,n),n);let Hu=class{constructor(){Wr(this,"current",this.detect()),Wr(this,"handoffState","pending"),Wr(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},$t=new Hu;function zt(e){return $t.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}function Ln(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function qe(){let e=[],t={addEventListener(n,r,o,i){return n.addEventListener(r,o,i),t.add(()=>n.removeEventListener(r,o,i))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return t.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return Ln(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,o){let i=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:o}),this.add(()=>{Object.assign(n.style,{[r]:i})})},group(n){let r=qe();return n(r),this.add(()=>r.dispose())},add(n){return e.includes(n)||e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let o of e.splice(r,1))o()}},dispose(){for(let n of e.splice(0))n()}};return t}function Tt(){let[e]=j(qe);return oe(()=>()=>e.dispose(),[e]),e}let ce=(e,t)=>{$t.isServer?oe(e,t):Ge(e,t)};function ft(e){let t=D(e);return ce(()=>{t.current=e},[e]),t}let U=function(e){let t=ft(e);return L.useCallback((...n)=>t.current(...n),[t])};function zu(e){let t=e.width/2,n=e.height/2;return{top:e.clientY-n,right:e.clientX+t,bottom:e.clientY+n,left:e.clientX-t}}function Bu(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function ju({disabled:e=!1}={}){let t=D(null),[n,r]=j(!1),o=Tt(),i=U(()=>{t.current=null,r(!1),o.dispose()}),l=U(s=>{if(o.dispose(),t.current===null){t.current=s.currentTarget,r(!0);{let a=zt(s.currentTarget);o.addEventListener(a,"pointerup",i,!1),o.addEventListener(a,"pointermove",u=>{if(t.current){let c=zu(u);r(Bu(c,t.current.getBoundingClientRect()))}},!1),o.addEventListener(a,"pointercancel",i,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:l,onPointerUp:i,onClick:i}}}let Uu=fe(void 0);function Gr(){return ae(Uu)}function qr(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function ke(e,t,...n){if(e in t){let o=t[e];return typeof o=="function"?o(...n):o}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(o=>`"${o}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,ke),r}var Bt=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Bt||{}),pt=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(pt||{});function Ce(){let e=Gu();return ie(t=>Wu({mergeRefs:e,...t}),[e])}function Wu({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:i=!0,name:l,mergeRefs:s}){s=s??qu;let a=pl(t,e);if(i)return Vn(a,n,r,l,s);let u=o??0;if(u&2){let{static:c=!1,...d}=a;if(c)return Vn(d,n,r,l,s)}if(u&1){let{unmount:c=!0,...d}=a;return ke(c?0:1,{0(){return null},1(){return Vn({...d,hidden:!0,style:{display:"none"}},n,r,l,s)}})}return Vn(a,n,r,l,s)}function Vn(e,t={},n,r,o){let{as:i=n,children:l,refName:s="ref",...a}=Yr(e,["unmount","static"]),u=e.ref!==void 0?{[s]:e.ref}:{},c=typeof l=="function"?l(t):l;"className"in a&&a.className&&typeof a.className=="function"&&(a.className=a.className(t)),a["aria-labelledby"]&&a["aria-labelledby"]===a.id&&(a["aria-labelledby"]=void 0);let d={};if(t){let p=!1,f=[];for(let[g,h]of Object.entries(t))typeof h=="boolean"&&(p=!0),h===!0&&f.push(g.replace(/([A-Z])/g,v=>`-${v.toLowerCase()}`));if(p){d["data-headlessui-state"]=f.join(" ");for(let g of f)d[`data-${g}`]=""}}if(i===me&&(Object.keys(mt(a)).length>0||Object.keys(mt(d)).length>0))if(!Vt(c)||Array.isArray(c)&&c.length>1){if(Object.keys(mt(a)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(mt(a)).concat(Object.keys(mt(d))).map(p=>` - ${p}`).join(`
`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(p=>` - ${p}`).join(`
`)].join(`
`))}else{let p=c.props,f=p==null?void 0:p.className,g=typeof f=="function"?(...w)=>qr(f(...w),a.className):qr(f,a.className),h=g?{className:g}:{},v=pl(c.props,mt(Yr(a,["ref"])));for(let w in d)w in v&&delete d[w];return kr(c,Object.assign({},v,d,u,{ref:o(Ku(c),u.ref)},h))}return F(i,Object.assign({},Yr(a,["ref"]),i!==me&&u,i!==me&&d),c)}function Gu(){let e=D([]),t=ie(n=>{for(let r of e.current)r!=null&&(typeof r=="function"?r(n):r.current=n)},[]);return(...n)=>{if(!n.every(r=>r==null))return e.current=n,t}}function qu(...e){return e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}function pl(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];if(t.disabled||t["aria-disabled"])for(let r in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(r)&&(n[r]=[o=>{var i;return(i=o==null?void 0:o.preventDefault)==null?void 0:i.call(o)}]);for(let r in n)Object.assign(t,{[r](o,...i){let l=n[r];for(let s of l){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;s(o,...i)}}});return t}function Kr(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];for(let r in n)Object.assign(t,{[r](...o){let i=n[r];for(let l of i)l==null||l(...o)}});return t}function be(e){var t;return Object.assign(de(e),{displayName:(t=e.displayName)!=null?t:e.name})}function mt(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function Yr(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function Ku(e){return L.version.split(".")[0]>="19"?e.props.ref:e.ref}function Yu(e,t,n){let[r,o]=j(n),i=e!==void 0,l=D(i),s=D(!1),a=D(!1);return i&&!l.current&&!s.current?(s.current=!0,l.current=i,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!i&&l.current&&!a.current&&(a.current=!0,l.current=i,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[i?e:r,U(u=>(i||o(u),t==null?void 0:t(u)))]}function Xu(e){let[t]=j(e);return t}function ml(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))hl(n,gl(t,r),o);return n}function gl(e,t){return e?e+"["+t+"]":t}function hl(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())hl(e,gl(t,r.toString()),o);else n instanceof Date?e.push([t,n.toISOString()]):typeof n=="boolean"?e.push([t,n?"1":"0"]):typeof n=="string"?e.push([t,n]):typeof n=="number"?e.push([t,`${n}`]):n==null?e.push([t,""]):ml(n,t,e)}let Zu="span";var jt=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(jt||{});function Ju(e,t){var n;let{features:r=1,...o}=e,i={ref:t,"aria-hidden":(r&2)===2?!0:(n=o["aria-hidden"])!=null?n:void 0,hidden:(r&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return Ce()({ourProps:i,theirProps:o,slot:{},defaultTag:Zu,name:"Hidden"})}let sn=be(Ju),Qu=fe(null);function ec({children:e}){let t=ae(Qu);if(!t)return L.createElement(L.Fragment,null,e);let{target:n}=t;return n?rn(L.createElement(L.Fragment,null,e),n):null}function tc({data:e,form:t,disabled:n,onReset:r,overrides:o}){let[i,l]=j(null),s=Tt();return oe(()=>{if(r&&i)return s.addEventListener(i,"reset",r)},[i,t,r]),L.createElement(ec,null,L.createElement(nc,{setForm:l,formId:t}),ml(e).map(([a,u])=>L.createElement(sn,{features:jt.Hidden,...mt({key:a,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:n,name:a,value:u,...o})})))}function nc({setForm:e,formId:t}){return oe(()=>{if(t){let n=document.getElementById(t);n&&e(n)}},[e,t]),t?null:L.createElement(sn,{features:jt.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:n=>{if(!n)return;let r=n.closest("form");r&&e(r)}})}let rc=fe(void 0);function vl(){return ae(rc)}function oc(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&ic(n)?!1:r}function ic(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}let _l=Symbol();function lc(e,t=!0){return Object.assign(e,{[_l]:t})}function Fe(...e){let t=D(e);oe(()=>{t.current=e},[e]);let n=U(r=>{for(let o of t.current)o!=null&&(typeof o=="function"?o(r):o.current=r)});return e.every(r=>r==null||(r==null?void 0:r[_l]))?void 0:n}let Hn=fe(null);Hn.displayName="DescriptionContext";function wl(){let e=ae(Hn);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,wl),t}return e}function sc(){var e,t;return(t=(e=ae(Hn))==null?void 0:e.value)!=null?t:void 0}function ac(){let[e,t]=j([]);return[e.length>0?e.join(" "):void 0,W(()=>function(n){let r=U(i=>(t(l=>[...l,i]),()=>t(l=>{let s=l.slice(),a=