dgz-ui-shared
Version:
Custom ui library using React.js, Shadcn/ui, TailwindCSS, Typescript, dgz-ui library
13 lines (11 loc) • 31.5 kB
JavaScript
;const T=require("react"),G=require("./MyInput-3qarivly.cjs"),$e=require("./useDateRangeStore-DUQ6Akf6.cjs"),B=require("./dayjs.min-BoFVZSwB.cjs");function De(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const s=De(T);var M={},ie;function Ie(){if(ie)return M;ie=1,Object.defineProperty(M,"__esModule",{value:!0}),M.parse=c,M.serialize=i;const e=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,t=/^[\u0021-\u003A\u003C-\u007E]*$/,r=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,o=/^[\u0020-\u003A\u003D-\u007E]*$/,n=Object.prototype.toString,a=(()=>{const h=function(){};return h.prototype=Object.create(null),h})();function c(h,y){const f=new a,g=h.length;if(g<2)return f;const x=(y==null?void 0:y.decode)||m;let d=0;do{const v=h.indexOf("=",d);if(v===-1)break;const w=h.indexOf(";",d),R=w===-1?g:w;if(v>R){d=h.lastIndexOf(";",v-1)+1;continue}const S=u(h,d,v),N=l(h,v,S),$=h.slice(S,N);if(f[$]===void 0){let A=u(h,v+1,R),C=l(h,R,A);const D=x(h.slice(A,C));f[$]=D}d=R+1}while(d<g);return f}function u(h,y,f){do{const g=h.charCodeAt(y);if(g!==32&&g!==9)return y}while(++y<f);return f}function l(h,y,f){for(;y>f;){const g=h.charCodeAt(--y);if(g!==32&&g!==9)return y+1}return f}function i(h,y,f){const g=(f==null?void 0:f.encode)||encodeURIComponent;if(!e.test(h))throw new TypeError(`argument name is invalid: ${h}`);const x=g(y);if(!t.test(x))throw new TypeError(`argument val is invalid: ${y}`);let d=h+"="+x;if(!f)return d;if(f.maxAge!==void 0){if(!Number.isInteger(f.maxAge))throw new TypeError(`option maxAge is invalid: ${f.maxAge}`);d+="; Max-Age="+f.maxAge}if(f.domain){if(!r.test(f.domain))throw new TypeError(`option domain is invalid: ${f.domain}`);d+="; Domain="+f.domain}if(f.path){if(!o.test(f.path))throw new TypeError(`option path is invalid: ${f.path}`);d+="; Path="+f.path}if(f.expires){if(!p(f.expires)||!Number.isFinite(f.expires.valueOf()))throw new TypeError(`option expires is invalid: ${f.expires}`);d+="; Expires="+f.expires.toUTCString()}if(f.httpOnly&&(d+="; HttpOnly"),f.secure&&(d+="; Secure"),f.partitioned&&(d+="; Partitioned"),f.priority)switch(typeof f.priority=="string"?f.priority.toLowerCase():void 0){case"low":d+="; Priority=Low";break;case"medium":d+="; Priority=Medium";break;case"high":d+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${f.priority}`)}if(f.sameSite)switch(typeof f.sameSite=="string"?f.sameSite.toLowerCase():f.sameSite){case!0:case"strict":d+="; SameSite=Strict";break;case"lax":d+="; SameSite=Lax";break;case"none":d+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${f.sameSite}`)}return d}function m(h){if(h.indexOf("%")===-1)return h;try{return decodeURIComponent(h)}catch{return h}}function p(h){return n.call(h)==="[object Date]"}return M}Ie();/**
* react-router v7.6.2
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function E(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function b(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Q({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function Z(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let o=e.indexOf("?");o>=0&&(t.search=e.substring(o),e=e.substring(0,o)),e&&(t.pathname=e)}return t}function fe(e,t,r="/"){return Oe(e,t,r,!1)}function Oe(e,t,r,o){let n=typeof t=="string"?Z(t):t,a=I(n.pathname||"/",r);if(a==null)return null;let c=de(e);Ae(c);let u=null;for(let l=0;u==null&&l<c.length;++l){let i=ze(a);u=We(c[l],i,o)}return u}function de(e,t=[],r=[],o=""){let n=(a,c,u)=>{let l={relativePath:u===void 0?a.path||"":u,caseSensitive:a.caseSensitive===!0,childrenIndex:c,route:a};l.relativePath.startsWith("/")&&(E(l.relativePath.startsWith(o),`Absolute route path "${l.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),l.relativePath=l.relativePath.slice(o.length));let i=P([o,l.relativePath]),m=r.concat(l);a.children&&a.children.length>0&&(E(a.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${i}".`),de(a.children,t,m,i)),!(a.path==null&&!a.index)&&t.push({path:i,score:Be(i,a.index),routesMeta:m})};return e.forEach((a,c)=>{var u;if(a.path===""||!((u=a.path)!=null&&u.includes("?")))n(a,c);else for(let l of he(a.path))n(a,c,l)}),t}function he(e){let t=e.split("/");if(t.length===0)return[];let[r,...o]=t,n=r.endsWith("?"),a=r.replace(/\?$/,"");if(o.length===0)return n?[a,""]:[a];let c=he(o.join("/")),u=[];return u.push(...c.map(l=>l===""?a:[a,l].join("/"))),n&&u.push(...c),u.map(l=>e.startsWith("/")&&l===""?"/":l)}function Ae(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:je(t.routesMeta.map(o=>o.childrenIndex),r.routesMeta.map(o=>o.childrenIndex)))}var Te=/^:[\w-]+$/,Ne=3,Fe=2,Me=1,_e=10,Ue=-2,ue=e=>e==="*";function Be(e,t){let r=e.split("/"),o=r.length;return r.some(ue)&&(o+=Ue),t&&(o+=Fe),r.filter(n=>!ue(n)).reduce((n,a)=>n+(Te.test(a)?Ne:a===""?Me:_e),o)}function je(e,t){return e.length===t.length&&e.slice(0,-1).every((o,n)=>o===t[n])?e[e.length-1]-t[t.length-1]:0}function We(e,t,r=!1){let{routesMeta:o}=e,n={},a="/",c=[];for(let u=0;u<o.length;++u){let l=o[u],i=u===o.length-1,m=a==="/"?t:t.slice(a.length)||"/",p=z({path:l.relativePath,caseSensitive:l.caseSensitive,end:i},m),h=l.route;if(!p&&i&&r&&!o[o.length-1].route.index&&(p=z({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},m)),!p)return null;Object.assign(n,p.params),c.push({params:n,pathname:P([a,p.pathname]),pathnameBase:Ke(P([a,p.pathnameBase])),route:h}),p.pathnameBase!=="/"&&(a=P([a,p.pathnameBase]))}return c}function z(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,o]=He(e.path,e.caseSensitive,e.end),n=t.match(r);if(!n)return null;let a=n[0],c=a.replace(/(.)\/+$/,"$1"),u=n.slice(1);return{params:o.reduce((i,{paramName:m,isOptional:p},h)=>{if(m==="*"){let f=u[h]||"";c=a.slice(0,a.length-f.length).replace(/(.)\/+$/,"$1")}const y=u[h];return p&&!y?i[m]=void 0:i[m]=(y||"").replace(/%2F/g,"/"),i},{}),pathname:a,pathnameBase:c,pattern:e}}function He(e,t=!1,r=!0){b(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let o=[],n="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,u,l)=>(o.push({paramName:u,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(o.push({paramName:"*"}),n+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?n+="\\/*$":e!==""&&e!=="/"&&(n+="(?:(?=\\/|$))"),[new RegExp(n,t?void 0:"i"),o]}function ze(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return b(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function I(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,o=e.charAt(r);return o&&o!=="/"?null:e.slice(r)||"/"}function Ve(e,t="/"){let{pathname:r,search:o="",hash:n=""}=typeof e=="string"?Z(e):e;return{pathname:r?r.startsWith("/")?r:qe(r,t):t,search:Ye(o),hash:Ge(n)}}function qe(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(n=>{n===".."?r.length>1&&r.pop():n!=="."&&r.push(n)}),r.length>1?r.join("/"):"/"}function K(e,t,r,o){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(o)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Je(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function me(e){let t=Je(e);return t.map((r,o)=>o===t.length-1?r.pathname:r.pathnameBase)}function pe(e,t,r,o=!1){let n;typeof e=="string"?n=Z(e):(n={...e},E(!n.pathname||!n.pathname.includes("?"),K("?","pathname","search",n)),E(!n.pathname||!n.pathname.includes("#"),K("#","pathname","hash",n)),E(!n.search||!n.search.includes("#"),K("#","search","hash",n)));let a=e===""||n.pathname==="",c=a?"/":n.pathname,u;if(c==null)u=r;else{let p=t.length-1;if(!o&&c.startsWith("..")){let h=c.split("/");for(;h[0]==="..";)h.shift(),p-=1;n.pathname=h.join("/")}u=p>=0?t[p]:"/"}let l=Ve(n,u),i=c&&c!=="/"&&c.endsWith("/"),m=(a||c===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(i||m)&&(l.pathname+="/"),l}var P=e=>e.join("/").replace(/\/\/+/g,"/"),Ke=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Ye=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Ge=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Qe(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var ge=["POST","PUT","PATCH","DELETE"];new Set(ge);var Xe=["GET",...ge];new Set(Xe);var F=s.createContext(null);F.displayName="DataRouter";var V=s.createContext(null);V.displayName="DataRouterState";var ye=s.createContext({isTransitioning:!1});ye.displayName="ViewTransition";var Ze=s.createContext(new Map);Ze.displayName="Fetchers";var et=s.createContext(null);et.displayName="Await";var L=s.createContext(null);L.displayName="Navigation";var ee=s.createContext(null);ee.displayName="Location";var k=s.createContext({outlet:null,matches:[],isDataRoute:!1});k.displayName="Route";var te=s.createContext(null);te.displayName="RouteError";function tt(e,{relative:t}={}){E(q(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:o}=s.useContext(L),{hash:n,pathname:a,search:c}=U(e,{relative:t}),u=a;return r!=="/"&&(u=a==="/"?r:P([r,a])),o.createHref({pathname:u,search:c,hash:n})}function q(){return s.useContext(ee)!=null}function O(){return E(q(),"useLocation() may be used only in the context of a <Router> component."),s.useContext(ee).location}var ve="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function we(e){s.useContext(L).static||s.useLayoutEffect(e)}function xe(){let{isDataRoute:e}=s.useContext(k);return e?mt():rt()}function rt(){E(q(),"useNavigate() may be used only in the context of a <Router> component.");let e=s.useContext(F),{basename:t,navigator:r}=s.useContext(L),{matches:o}=s.useContext(k),{pathname:n}=O(),a=JSON.stringify(me(o)),c=s.useRef(!1);return we(()=>{c.current=!0}),s.useCallback((l,i={})=>{if(b(c.current,ve),!c.current)return;if(typeof l=="number"){r.go(l);return}let m=pe(l,JSON.parse(a),n,i.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:P([t,m.pathname])),(i.replace?r.replace:r.push)(m,i.state,i)},[t,r,a,n,e])}s.createContext(null);function U(e,{relative:t}={}){let{matches:r}=s.useContext(k),{pathname:o}=O(),n=JSON.stringify(me(r));return s.useMemo(()=>pe(e,JSON.parse(n),o,t==="path"),[e,n,o,t])}function nt(e,t,r,o){E(q(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:n}=s.useContext(L),{matches:a}=s.useContext(k),c=a[a.length-1],u=c?c.params:{},l=c?c.pathname:"/",i=c?c.pathnameBase:"/",m=c&&c.route;{let d=m&&m.path||"";Ee(l,!m||d.endsWith("*")||d.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${d}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
Please change the parent <Route path="${d}"> to <Route path="${d==="/"?"*":`${d}/*`}">.`)}let p=O(),h;h=p;let y=h.pathname||"/",f=y;if(i!=="/"){let d=i.replace(/^\//,"").split("/");f="/"+y.replace(/^\//,"").split("/").slice(d.length).join("/")}let g=fe(e,{pathname:f});return b(m||g!=null,`No routes matched location "${h.pathname}${h.search}${h.hash}" `),b(g==null||g[g.length-1].route.element!==void 0||g[g.length-1].route.Component!==void 0||g[g.length-1].route.lazy!==void 0,`Matched leaf route at location "${h.pathname}${h.search}${h.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),ut(g&&g.map(d=>Object.assign({},d,{params:Object.assign({},u,d.params),pathname:P([i,n.encodeLocation?n.encodeLocation(d.pathname).pathname:d.pathname]),pathnameBase:d.pathnameBase==="/"?i:P([i,n.encodeLocation?n.encodeLocation(d.pathnameBase).pathname:d.pathnameBase])})),a,r,o)}function at(){let e=ht(),t=Qe(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,o="rgba(200,200,200, 0.5)",n={padding:"0.5rem",backgroundColor:o},a={padding:"2px 4px",backgroundColor:o},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=s.createElement(s.Fragment,null,s.createElement("p",null,"💿 Hey developer 👋"),s.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",s.createElement("code",{style:a},"ErrorBoundary")," or"," ",s.createElement("code",{style:a},"errorElement")," prop on your route.")),s.createElement(s.Fragment,null,s.createElement("h2",null,"Unexpected Application Error!"),s.createElement("h3",{style:{fontStyle:"italic"}},t),r?s.createElement("pre",{style:n},r):null,c)}var ot=s.createElement(at,null),lt=class extends s.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?s.createElement(k.Provider,{value:this.props.routeContext},s.createElement(te.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function it({routeContext:e,match:t,children:r}){let o=s.useContext(F);return o&&o.static&&o.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=t.route.id),s.createElement(k.Provider,{value:e},r)}function ut(e,t=[],r=null,o=null){if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let n=e,a=r==null?void 0:r.errors;if(a!=null){let l=n.findIndex(i=>i.route.id&&(a==null?void 0:a[i.route.id])!==void 0);E(l>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(",")}`),n=n.slice(0,Math.min(n.length,l+1))}let c=!1,u=-1;if(r)for(let l=0;l<n.length;l++){let i=n[l];if((i.route.HydrateFallback||i.route.hydrateFallbackElement)&&(u=l),i.route.id){let{loaderData:m,errors:p}=r,h=i.route.loader&&!m.hasOwnProperty(i.route.id)&&(!p||p[i.route.id]===void 0);if(i.route.lazy||h){c=!0,u>=0?n=n.slice(0,u+1):n=[n[0]];break}}}return n.reduceRight((l,i,m)=>{let p,h=!1,y=null,f=null;r&&(p=a&&i.route.id?a[i.route.id]:void 0,y=i.route.errorElement||ot,c&&(u<0&&m===0?(Ee("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),h=!0,f=null):u===m&&(h=!0,f=i.route.hydrateFallbackElement||null)));let g=t.concat(n.slice(0,m+1)),x=()=>{let d;return p?d=y:h?d=f:i.route.Component?d=s.createElement(i.route.Component,null):i.route.element?d=i.route.element:d=l,s.createElement(it,{match:i,routeContext:{outlet:l,matches:g,isDataRoute:r!=null},children:d})};return r&&(i.route.ErrorBoundary||i.route.errorElement||m===0)?s.createElement(lt,{location:r.location,revalidation:r.revalidation,component:y,error:p,children:x(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):x()},null)}function re(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function st(e){let t=s.useContext(F);return E(t,re(e)),t}function ct(e){let t=s.useContext(V);return E(t,re(e)),t}function ft(e){let t=s.useContext(k);return E(t,re(e)),t}function ne(e){let t=ft(e),r=t.matches[t.matches.length-1];return E(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function dt(){return ne("useRouteId")}function ht(){var o;let e=s.useContext(te),t=ct("useRouteError"),r=ne("useRouteError");return e!==void 0?e:(o=t.errors)==null?void 0:o[r]}function mt(){let{router:e}=st("useNavigate"),t=ne("useNavigate"),r=s.useRef(!1);return we(()=>{r.current=!0}),s.useCallback(async(n,a={})=>{b(r.current,ve),r.current&&(typeof n=="number"?e.navigate(n):await e.navigate(n,{fromRouteId:t,...a}))},[e,t])}var se={};function Ee(e,t,r){!t&&!se[e]&&(se[e]=!0,b(!1,r))}s.memo(pt);function pt({routes:e,future:t,state:r}){return nt(e,void 0,r,t)}var W="get",H="application/x-www-form-urlencoded";function J(e){return e!=null&&typeof e.tagName=="string"}function gt(e){return J(e)&&e.tagName.toLowerCase()==="button"}function yt(e){return J(e)&&e.tagName.toLowerCase()==="form"}function vt(e){return J(e)&&e.tagName.toLowerCase()==="input"}function wt(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function xt(e,t){return e.button===0&&(!t||t==="_self")&&!wt(e)}function X(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let o=e[r];return t.concat(Array.isArray(o)?o.map(n=>[r,n]):[[r,o]])},[]))}function Et(e,t){let r=X(e);return t&&t.forEach((o,n)=>{r.has(n)||t.getAll(n).forEach(a=>{r.append(n,a)})}),r}var j=null;function Rt(){if(j===null)try{new FormData(document.createElement("form"),0),j=!1}catch{j=!0}return j}var Ct=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Y(e){return e!=null&&!Ct.has(e)?(b(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${H}"`),null):e}function St(e,t){let r,o,n,a,c;if(yt(e)){let u=e.getAttribute("action");o=u?I(u,t):null,r=e.getAttribute("method")||W,n=Y(e.getAttribute("enctype"))||H,a=new FormData(e)}else if(gt(e)||vt(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||u.getAttribute("action");if(o=l?I(l,t):null,r=e.getAttribute("formmethod")||u.getAttribute("method")||W,n=Y(e.getAttribute("formenctype"))||Y(u.getAttribute("enctype"))||H,a=new FormData(u,e),!Rt()){let{name:i,type:m,value:p}=e;if(m==="image"){let h=i?`${i}.`:"";a.append(`${h}x`,"0"),a.append(`${h}y`,"0")}else i&&a.append(i,p)}}else{if(J(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=W,o=null,n=H,c=e}return a&&n==="text/plain"&&(c=a,a=void 0),{action:o,method:r.toLowerCase(),encType:n,formData:a,body:c}}function ae(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}async function bt(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Pt(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function Lt(e,t,r){let o=await Promise.all(e.map(async n=>{let a=t.routes[n.route.id];if(a){let c=await bt(a,r);return c.links?c.links():[]}return[]}));return It(o.flat(1).filter(Pt).filter(n=>n.rel==="stylesheet"||n.rel==="preload").map(n=>n.rel==="stylesheet"?{...n,rel:"prefetch",as:"style"}:{...n,rel:"prefetch"}))}function ce(e,t,r,o,n,a){let c=(l,i)=>r[i]?l.route.id!==r[i].route.id:!0,u=(l,i)=>{var m;return r[i].pathname!==l.pathname||((m=r[i].route.path)==null?void 0:m.endsWith("*"))&&r[i].params["*"]!==l.params["*"]};return a==="assets"?t.filter((l,i)=>c(l,i)||u(l,i)):a==="data"?t.filter((l,i)=>{var p;let m=o.routes[l.route.id];if(!m||!m.hasLoader)return!1;if(c(l,i)||u(l,i))return!0;if(l.route.shouldRevalidate){let h=l.route.shouldRevalidate({currentUrl:new URL(n.pathname+n.search+n.hash,window.origin),currentParams:((p=r[0])==null?void 0:p.params)||{},nextUrl:new URL(e,window.origin),nextParams:l.params,defaultShouldRevalidate:!0});if(typeof h=="boolean")return h}return!0}):[]}function kt(e,t,{includeHydrateFallback:r}={}){return $t(e.map(o=>{let n=t.routes[o.route.id];if(!n)return[];let a=[n.module];return n.clientActionModule&&(a=a.concat(n.clientActionModule)),n.clientLoaderModule&&(a=a.concat(n.clientLoaderModule)),r&&n.hydrateFallbackModule&&(a=a.concat(n.hydrateFallbackModule)),n.imports&&(a=a.concat(n.imports)),a}).flat(1))}function $t(e){return[...new Set(e)]}function Dt(e){let t={},r=Object.keys(e).sort();for(let o of r)t[o]=e[o];return t}function It(e,t){let r=new Set;return new Set(t),e.reduce((o,n)=>{let a=JSON.stringify(Dt(n));return r.has(a)||(r.add(a),o.push({key:a,link:n})),o},[])}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Ot=new Set([100,101,204,205]);function At(e,t){let r=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r.pathname==="/"?r.pathname="_root.data":t&&I(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.data`:r.pathname=`${r.pathname.replace(/\/$/,"")}.data`,r}function Re(){let e=s.useContext(F);return ae(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Tt(){let e=s.useContext(V);return ae(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var oe=s.createContext(void 0);oe.displayName="FrameworkContext";function Ce(){let e=s.useContext(oe);return ae(e,"You must render this element inside a <HydratedRouter> element"),e}function Nt(e,t){let r=s.useContext(oe),[o,n]=s.useState(!1),[a,c]=s.useState(!1),{onFocus:u,onBlur:l,onMouseEnter:i,onMouseLeave:m,onTouchStart:p}=t,h=s.useRef(null);s.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let g=d=>{d.forEach(v=>{c(v.isIntersecting)})},x=new IntersectionObserver(g,{threshold:.5});return h.current&&x.observe(h.current),()=>{x.disconnect()}}},[e]),s.useEffect(()=>{if(o){let g=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(g)}}},[o]);let y=()=>{n(!0)},f=()=>{n(!1),c(!1)};return r?e!=="intent"?[a,h,{}]:[a,h,{onFocus:_(u,y),onBlur:_(l,f),onMouseEnter:_(i,y),onMouseLeave:_(m,f),onTouchStart:_(p,y)}]:[!1,h,{}]}function _(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function Ft({page:e,...t}){let{router:r}=Re(),o=s.useMemo(()=>fe(r.routes,e,r.basename),[r.routes,e,r.basename]);return o?s.createElement(_t,{page:e,matches:o,...t}):null}function Mt(e){let{manifest:t,routeModules:r}=Ce(),[o,n]=s.useState([]);return s.useEffect(()=>{let a=!1;return Lt(e,t,r).then(c=>{a||n(c)}),()=>{a=!0}},[e,t,r]),o}function _t({page:e,matches:t,...r}){let o=O(),{manifest:n,routeModules:a}=Ce(),{basename:c}=Re(),{loaderData:u,matches:l}=Tt(),i=s.useMemo(()=>ce(e,t,l,n,o,"data"),[e,t,l,n,o]),m=s.useMemo(()=>ce(e,t,l,n,o,"assets"),[e,t,l,n,o]),p=s.useMemo(()=>{if(e===o.pathname+o.search+o.hash)return[];let f=new Set,g=!1;if(t.forEach(d=>{var w;let v=n.routes[d.route.id];!v||!v.hasLoader||(!i.some(R=>R.route.id===d.route.id)&&d.route.id in u&&((w=a[d.route.id])!=null&&w.shouldRevalidate)||v.hasClientLoader?g=!0:f.add(d.route.id))}),f.size===0)return[];let x=At(e,c);return g&&f.size>0&&x.searchParams.set("_routes",t.filter(d=>f.has(d.route.id)).map(d=>d.route.id).join(",")),[x.pathname+x.search]},[c,u,o,n,i,t,e,a]),h=s.useMemo(()=>kt(m,n),[m,n]),y=Mt(m);return s.createElement(s.Fragment,null,p.map(f=>s.createElement("link",{key:f,rel:"prefetch",as:"fetch",href:f,...r})),h.map(f=>s.createElement("link",{key:f,rel:"modulepreload",href:f,...r})),y.map(({key:f,link:g})=>s.createElement("link",{key:f,...g})))}function Ut(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var Se=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Se&&(window.__reactRouterVersion="7.6.2")}catch{}var be=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Pe=s.forwardRef(function({onClick:t,discover:r="render",prefetch:o="none",relative:n,reloadDocument:a,replace:c,state:u,target:l,to:i,preventScrollReset:m,viewTransition:p,...h},y){let{basename:f}=s.useContext(L),g=typeof i=="string"&&be.test(i),x,d=!1;if(typeof i=="string"&&g&&(x=i,Se))try{let C=new URL(window.location.href),D=i.startsWith("//")?new URL(C.protocol+i):new URL(i),le=I(D.pathname,f);D.origin===C.origin&&le!=null?i=le+D.search+D.hash:d=!0}catch{b(!1,`<Link to="${i}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let v=tt(i,{relative:n}),[w,R,S]=Nt(o,h),N=Ht(i,{replace:c,state:u,target:l,preventScrollReset:m,relative:n,viewTransition:p});function $(C){t&&t(C),C.defaultPrevented||N(C)}let A=s.createElement("a",{...h,...S,href:x||v,onClick:d||a?t:$,ref:Ut(y,R),target:l,"data-discover":!g&&r==="render"?"true":void 0});return w&&!g?s.createElement(s.Fragment,null,A,s.createElement(Ft,{page:v})):A});Pe.displayName="Link";var Bt=s.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:o="",end:n=!1,style:a,to:c,viewTransition:u,children:l,...i},m){let p=U(c,{relative:i.relative}),h=O(),y=s.useContext(V),{navigator:f,basename:g}=s.useContext(L),x=y!=null&&Yt(p)&&u===!0,d=f.encodeLocation?f.encodeLocation(p).pathname:p.pathname,v=h.pathname,w=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;r||(v=v.toLowerCase(),w=w?w.toLowerCase():null,d=d.toLowerCase()),w&&g&&(w=I(w,g)||w);const R=d!=="/"&&d.endsWith("/")?d.length-1:d.length;let S=v===d||!n&&v.startsWith(d)&&v.charAt(R)==="/",N=w!=null&&(w===d||!n&&w.startsWith(d)&&w.charAt(d.length)==="/"),$={isActive:S,isPending:N,isTransitioning:x},A=S?t:void 0,C;typeof o=="function"?C=o($):C=[o,S?"active":null,N?"pending":null,x?"transitioning":null].filter(Boolean).join(" ");let D=typeof a=="function"?a($):a;return s.createElement(Pe,{...i,"aria-current":A,className:C,ref:m,style:D,to:c,viewTransition:u},typeof l=="function"?l($):l)});Bt.displayName="NavLink";var jt=s.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:o,replace:n,state:a,method:c=W,action:u,onSubmit:l,relative:i,preventScrollReset:m,viewTransition:p,...h},y)=>{let f=Jt(),g=Kt(u,{relative:i}),x=c.toLowerCase()==="get"?"get":"post",d=typeof u=="string"&&be.test(u),v=w=>{if(l&&l(w),w.defaultPrevented)return;w.preventDefault();let R=w.nativeEvent.submitter,S=(R==null?void 0:R.getAttribute("formmethod"))||c;f(R||w.currentTarget,{fetcherKey:t,method:S,navigate:r,replace:n,state:a,relative:i,preventScrollReset:m,viewTransition:p})};return s.createElement("form",{ref:y,method:x,action:g,onSubmit:o?l:v,...h,"data-discover":!d&&e==="render"?"true":void 0})});jt.displayName="Form";function Wt(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Le(e){let t=s.useContext(F);return E(t,Wt(e)),t}function Ht(e,{target:t,replace:r,state:o,preventScrollReset:n,relative:a,viewTransition:c}={}){let u=xe(),l=O(),i=U(e,{relative:a});return s.useCallback(m=>{if(xt(m,t)){m.preventDefault();let p=r!==void 0?r:Q(l)===Q(i);u(e,{replace:p,state:o,preventScrollReset:n,relative:a,viewTransition:c})}},[l,u,i,r,o,t,e,n,a,c])}function zt(e){b(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=s.useRef(X(e)),r=s.useRef(!1),o=O(),n=s.useMemo(()=>Et(o.search,r.current?null:t.current),[o.search]),a=xe(),c=s.useCallback((u,l)=>{const i=X(typeof u=="function"?u(n):u);r.current=!0,a("?"+i,l)},[a,n]);return[n,c]}var Vt=0,qt=()=>`__${String(++Vt)}__`;function Jt(){let{router:e}=Le("useSubmit"),{basename:t}=s.useContext(L),r=dt();return s.useCallback(async(o,n={})=>{let{action:a,method:c,encType:u,formData:l,body:i}=St(o,t);if(n.navigate===!1){let m=n.fetcherKey||qt();await e.fetch(m,r,n.action||a,{preventScrollReset:n.preventScrollReset,formData:l,body:i,formMethod:n.method||c,formEncType:n.encType||u,flushSync:n.flushSync})}else await e.navigate(n.action||a,{preventScrollReset:n.preventScrollReset,formData:l,body:i,formMethod:n.method||c,formEncType:n.encType||u,replace:n.replace,state:n.state,fromRouteId:r,flushSync:n.flushSync,viewTransition:n.viewTransition})},[e,t,r])}function Kt(e,{relative:t}={}){let{basename:r}=s.useContext(L),o=s.useContext(k);E(o,"useFormAction must be used inside a RouteContext");let[n]=o.matches.slice(-1),a={...U(e||".",{relative:t})},c=O();if(e==null){a.search=c.search;let u=new URLSearchParams(a.search),l=u.getAll("index");if(l.some(m=>m==="")){u.delete("index"),l.filter(p=>p).forEach(p=>u.append("index",p));let m=u.toString();a.search=m?`?${m}`:""}}return(!e||e===".")&&n.route.index&&(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(a.pathname=a.pathname==="/"?r:P([r,a.pathname])),Q(a)}function Yt(e,t={}){let r=s.useContext(ye);E(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=Le("useViewTransitionState"),n=U(e,{relative:t.relative});if(!r.isTransitioning)return!1;let a=I(r.currentLocation.pathname,o)||r.currentLocation.pathname,c=I(r.nextLocation.pathname,o)||r.nextLocation.pathname;return z(n.pathname,c)!=null||z(n.pathname,a)!=null}[...Ot];const ke=e=>{const[t,r]=zt(),o=T.useMemo(()=>(e==null?void 0:e.excludeParams)||[],[e==null?void 0:e.excludeParams]),n=T.useMemo(()=>{const c={};return t.forEach((u,l)=>{if(!o.includes(l)){const i=t.getAll(l);c[l]=i.length>1?i:u}}),c},[t,o]),a=T.useCallback(c=>{const u=new URLSearchParams;Object.entries(c).forEach(([l,i])=>{G.lodashExports.isNil(i)?u.delete(l):Array.isArray(i)?i.forEach(m=>u.append(l,String(m))):u.set(l,String(i))}),r(u,{replace:!0})},[r]);return{params:n,handleSetParams:a}},Gt=e=>{const{params:t}=ke(),{storedRanges:r,setStoredRange:o}=$e.useDateRangeStore(),[n,a]=T.useState();return T.useEffect(()=>{const u=G.lodashExports.get(t,"start")||B.dayjs$1().subtract(2,"week").startOf("day"),l=G.lodashExports.get(t,"end")||B.dayjs$1().endOf("day");u&&l&&a({from:B.dayjs$1(u).toDate(),to:B.dayjs$1(l).toDate()})},[t]),T.useEffect(()=>{let u={...r};n?u={...u,[e]:n}:Object.prototype.hasOwnProperty.call(u,e)&&delete u[e],o({...u})},[n,JSON.stringify(r),e]),{range:n,handleRangeSelected:u=>{a(u)}}};exports.useDateRange=Gt;exports.useQueryParams=ke;