@attabot/complaint-app 1.0.1 β†’ 1.0.2

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.
@@ -1,12 +1,12 @@
1
- (function(S,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],l):(S=typeof globalThis<"u"?globalThis:S||self,l(S.ComplaintApp={},S["react/jsx-runtime"],S.React))})(this,(function(S,l,F){"use strict";var _t=typeof document<"u"?document.currentScript:null;function xa(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const b=xa(F);function Le(){return Le=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Le.apply(null,arguments)}var ne;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(ne||(ne={}));const hn="popstate";function Ta(e){e===void 0&&(e={});function t(r,a){let{pathname:o,search:s,hash:i}=r.location;return Nt("",{pathname:o,search:s,hash:i},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function n(r,a){return typeof a=="string"?a:Be(a)}return Pa(t,n,null,e)}function x(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function H(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Aa(){return Math.random().toString(36).substr(2,8)}function pn(e,t){return{usr:e.state,key:e.key,idx:t}}function Nt(e,t,n,r){return n===void 0&&(n=null),Le({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Se(t):t,{state:n,key:t&&t.key||r||Aa()})}function Be(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Se(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function Pa(e,t,n,r){r===void 0&&(r={});let{window:a=document.defaultView,v5Compat:o=!1}=r,s=a.history,i=ne.Pop,c=null,f=u();f==null&&(f=0,s.replaceState(Le({},s.state,{idx:f}),""));function u(){return(s.state||{idx:null}).idx}function d(){i=ne.Pop;let g=u(),m=g==null?null:g-f;f=g,c&&c({action:i,location:N.location,delta:m})}function p(g,m){i=ne.Push;let y=Nt(N.location,g,m);f=u()+1;let w=pn(y,f),C=N.createHref(y);try{s.pushState(w,"",C)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;a.location.assign(C)}o&&c&&c({action:i,location:N.location,delta:1})}function E(g,m){i=ne.Replace;let y=Nt(N.location,g,m);f=u();let w=pn(y,f),C=N.createHref(y);s.replaceState(w,"",C),o&&c&&c({action:i,location:N.location,delta:0})}function v(g){let m=a.location.origin!=="null"?a.location.origin:a.location.href,y=typeof g=="string"?g:Be(g);return y=y.replace(/ $/,"%20"),x(m,"No window.location.(origin|href) available to create URL for href: "+y),new URL(y,m)}let N={get action(){return i},get location(){return e(a,s)},listen(g){if(c)throw new Error("A history only accepts one active listener");return a.addEventListener(hn,d),c=g,()=>{a.removeEventListener(hn,d),c=null}},createHref(g){return t(a,g)},createURL:v,encodeLocation(g){let m=v(g);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:p,replace:E,go(g){return s.go(g)}};return N}var mn;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(mn||(mn={}));function Fa(e,t,n){return n===void 0&&(n="/"),Da(e,t,n)}function Da(e,t,n,r){let a=typeof t=="string"?Se(t):t,o=re(a.pathname||"/",n);if(o==null)return null;let s=gn(e);ka(s);let i=null,c=za(o);for(let f=0;i==null&&f<s.length;++f)i=Va(s[f],c);return i}function gn(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let a=(o,s,i)=>{let c={relativePath:i===void 0?o.path||"":i,caseSensitive:o.caseSensitive===!0,childrenIndex:s,route:o};c.relativePath.startsWith("/")&&(x(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let f=Y([r,c.relativePath]),u=n.concat(c);o.children&&o.children.length>0&&(x(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+f+'".')),gn(o.children,t,u,f)),!(o.path==null&&!o.index)&&t.push({path:f,score:ja(f,o.index),routesMeta:u})};return e.forEach((o,s)=>{var i;if(o.path===""||!((i=o.path)!=null&&i.includes("?")))a(o,s);else for(let c of yn(o.path))a(o,s,c)}),t}function yn(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return a?[o,""]:[o];let s=yn(r.join("/")),i=[];return i.push(...s.map(c=>c===""?o:[o,c].join("/"))),a&&i.push(...s),i.map(c=>e.startsWith("/")&&c===""?"/":c)}function ka(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:$a(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const La=/^:[\w-]+$/,Ba=3,Ua=2,Ra=1,Ia=10,Ma=-2,bn=e=>e==="*";function ja(e,t){let n=e.split("/"),r=n.length;return n.some(bn)&&(r+=Ma),t&&(r+=Ua),n.filter(a=>!bn(a)).reduce((a,o)=>a+(La.test(o)?Ba:o===""?Ra:Ia),r)}function $a(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function Va(e,t,n){let{routesMeta:r}=e,a={},o="/",s=[];for(let i=0;i<r.length;++i){let c=r[i],f=i===r.length-1,u=o==="/"?t:t.slice(o.length)||"/",d=Ct({path:c.relativePath,caseSensitive:c.caseSensitive,end:f},u),p=c.route;if(!d)return null;Object.assign(a,d.params),s.push({params:a,pathname:Y([o,d.pathname]),pathnameBase:Xa(Y([o,d.pathnameBase])),route:p}),d.pathnameBase!=="/"&&(o=Y([o,d.pathnameBase]))}return s}function Ct(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Ha(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let o=a[0],s=o.replace(/(.)\/+$/,"$1"),i=a.slice(1);return{params:r.reduce((f,u,d)=>{let{paramName:p,isOptional:E}=u;if(p==="*"){let N=i[d]||"";s=o.slice(0,o.length-N.length).replace(/(.)\/+$/,"$1")}const v=i[d];return E&&!v?f[p]=void 0:f[p]=(v||"").replace(/%2F/g,"/"),f},{}),pathname:o,pathnameBase:s,pattern:e}}function Ha(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),H(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 r=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,i,c)=>(r.push({paramName:i,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function za(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return H(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function re(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}const qa=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Wa=e=>qa.test(e);function Ja(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?Se(e):e,o;if(n)if(Wa(n))o=n;else{if(n.includes("//")){let s=n;n=Sn(n),H(!1,"Pathnames cannot have embedded double slashes - normalizing "+(s+" -> "+n))}n.startsWith("/")?o=vn(n.substring(1),"/"):o=vn(n,t)}else o=t;return{pathname:o,search:Ga(r),hash:Ya(a)}}function vn(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function Ot(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Ka(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function wn(e,t){let n=Ka(e);return t?n.map((r,a)=>a===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function En(e,t,n,r){r===void 0&&(r=!1);let a;typeof e=="string"?a=Se(e):(a=Le({},e),x(!a.pathname||!a.pathname.includes("?"),Ot("?","pathname","search",a)),x(!a.pathname||!a.pathname.includes("#"),Ot("#","pathname","hash",a)),x(!a.search||!a.search.includes("#"),Ot("#","search","hash",a)));let o=e===""||a.pathname==="",s=o?"/":a.pathname,i;if(s==null)i=n;else{let d=t.length-1;if(!r&&s.startsWith("..")){let p=s.split("/");for(;p[0]==="..";)p.shift(),d-=1;a.pathname=p.join("/")}i=d>=0?t[d]:"/"}let c=Ja(a,i),f=s&&s!=="/"&&s.endsWith("/"),u=(o||s===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(f||u)&&(c.pathname+="/"),c}const Sn=e=>e.replace(/\/\/+/g,"/"),Y=e=>Sn(e.join("/")),Xa=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Ga=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Ya=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Qa(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const _n=["post","put","patch","delete"];new Set(_n);const Za=["get",..._n];new Set(Za);function Ue(){return Ue=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ue.apply(null,arguments)}const Re=b.createContext(null);process.env.NODE_ENV!=="production"&&(Re.displayName="DataRouter");const xt=b.createContext(null);process.env.NODE_ENV!=="production"&&(xt.displayName="DataRouterState");const eo=b.createContext(null);process.env.NODE_ENV!=="production"&&(eo.displayName="Await");const W=b.createContext(null);process.env.NODE_ENV!=="production"&&(W.displayName="Navigation");const Ie=b.createContext(null);process.env.NODE_ENV!=="production"&&(Ie.displayName="Location");const J=b.createContext({outlet:null,matches:[],isDataRoute:!1});process.env.NODE_ENV!=="production"&&(J.displayName="Route");const Tt=b.createContext(null);process.env.NODE_ENV!=="production"&&(Tt.displayName="RouteError");function to(e,t){let{relative:n}=t===void 0?{}:t;Me()||(process.env.NODE_ENV!=="production"?x(!1,"useHref() may be used only in the context of a <Router> component."):x(!1));let{basename:r,navigator:a}=b.useContext(W),{hash:o,pathname:s,search:i}=je(e,{relative:n}),c=s;return r!=="/"&&(c=s==="/"?r:Y([r,s])),a.createHref({pathname:c,search:i,hash:o})}function Me(){return b.useContext(Ie)!=null}function ue(){return Me()||(process.env.NODE_ENV!=="production"?x(!1,"useLocation() may be used only in the context of a <Router> component."):x(!1)),b.useContext(Ie).location}const Nn="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Cn(e){b.useContext(W).static||b.useLayoutEffect(e)}function et(){let{isDataRoute:e}=b.useContext(J);return e?yo():no()}function no(){Me()||(process.env.NODE_ENV!=="production"?x(!1,"useNavigate() may be used only in the context of a <Router> component."):x(!1));let e=b.useContext(Re),{basename:t,future:n,navigator:r}=b.useContext(W),{matches:a}=b.useContext(J),{pathname:o}=ue(),s=JSON.stringify(wn(a,n.v7_relativeSplatPath)),i=b.useRef(!1);return Cn(()=>{i.current=!0}),b.useCallback(function(f,u){if(u===void 0&&(u={}),process.env.NODE_ENV!=="production"&&H(i.current,Nn),!i.current)return;if(typeof f=="number"){r.go(f);return}let d=En(f,JSON.parse(s),o,u.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Y([t,d.pathname])),(u.replace?r.replace:r.push)(d,u.state,u)},[t,r,s,o,e])}function ro(){let{matches:e}=b.useContext(J),t=e[e.length-1];return t?t.params:{}}function je(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=b.useContext(W),{matches:a}=b.useContext(J),{pathname:o}=ue(),s=JSON.stringify(wn(a,r.v7_relativeSplatPath));return b.useMemo(()=>En(e,JSON.parse(s),o,n==="path"),[e,s,o,n])}function ao(e,t){return oo(e,t)}function oo(e,t,n,r){Me()||(process.env.NODE_ENV!=="production"?x(!1,"useRoutes() may be used only in the context of a <Router> component."):x(!1));let{navigator:a}=b.useContext(W),{matches:o}=b.useContext(J),s=o[o.length-1],i=s?s.params:{},c=s?s.pathname:"/",f=s?s.pathnameBase:"/",u=s&&s.route;if(process.env.NODE_ENV!=="production"){let y=u&&u.path||"";Tn(c,!u||y.endsWith("*"),"You rendered descendant <Routes> (or called `useRoutes()`) at "+('"'+c+'" (under <Route path="'+y+'">) 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.
1
+ (function(g,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("react/jsx-runtime"),require("react"),require("react-dom"),require("react-redux"),require("@reduxjs/toolkit")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom","react-redux","@reduxjs/toolkit"],l):(g=typeof globalThis<"u"?globalThis:g||self,l(g.ComplaintApp={},g["react/jsx-runtime"],g.React,g.ReactDOM,g.ReactRedux,g.RTK))})(this,(function(g,l,D,Ic,Ya,ft){"use strict";var $t=typeof document<"u"?document.currentScript:null;function Qa(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const b=Qa(D);function Ve(){return Ve=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ve.apply(null,arguments)}var oe;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(oe||(oe={}));const Dn="popstate";function Za(e){e===void 0&&(e={});function t(r,a){let{pathname:o,search:s,hash:i}=r.location;return Wt("",{pathname:o,search:s,hash:i},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function n(r,a){return typeof a=="string"?a:ze(a)}return to(t,n,null,e)}function T(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function V(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function eo(){return Math.random().toString(36).substr(2,8)}function Fn(e,t){return{usr:e.state,key:e.key,idx:t}}function Wt(e,t,n,r){return n===void 0&&(n=null),Ve({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Fe(t):t,{state:n,key:t&&t.key||r||eo()})}function ze(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Fe(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function to(e,t,n,r){r===void 0&&(r={});let{window:a=document.defaultView,v5Compat:o=!1}=r,s=a.history,i=oe.Pop,c=null,f=u();f==null&&(f=0,s.replaceState(Ve({},s.state,{idx:f}),""));function u(){return(s.state||{idx:null}).idx}function d(){i=oe.Pop;let y=u(),m=y==null?null:y-f;f=y,c&&c({action:i,location:_.location,delta:m})}function h(y,m){i=oe.Push;let w=Wt(_.location,y,m);f=u()+1;let S=Fn(w,f),N=_.createHref(w);try{s.pushState(S,"",N)}catch(x){if(x instanceof DOMException&&x.name==="DataCloneError")throw x;a.location.assign(N)}o&&c&&c({action:i,location:_.location,delta:1})}function E(y,m){i=oe.Replace;let w=Wt(_.location,y,m);f=u();let S=Fn(w,f),N=_.createHref(w);s.replaceState(S,"",N),o&&c&&c({action:i,location:_.location,delta:0})}function v(y){let m=a.location.origin!=="null"?a.location.origin:a.location.href,w=typeof y=="string"?y:ze(y);return w=w.replace(/ $/,"%20"),T(m,"No window.location.(origin|href) available to create URL for href: "+w),new URL(w,m)}let _={get action(){return i},get location(){return e(a,s)},listen(y){if(c)throw new Error("A history only accepts one active listener");return a.addEventListener(Dn,d),c=y,()=>{a.removeEventListener(Dn,d),c=null}},createHref(y){return t(a,y)},createURL:v,encodeLocation(y){let m=v(y);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:h,replace:E,go(y){return s.go(y)}};return _}var kn;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(kn||(kn={}));function no(e,t,n){return n===void 0&&(n="/"),ro(e,t,n)}function ro(e,t,n,r){let a=typeof t=="string"?Fe(t):t,o=se(a.pathname||"/",n);if(o==null)return null;let s=Ln(e);ao(s);let i=null,c=go(o);for(let f=0;i==null&&f<s.length;++f)i=ho(s[f],c);return i}function Ln(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let a=(o,s,i)=>{let c={relativePath:i===void 0?o.path||"":i,caseSensitive:o.caseSensitive===!0,childrenIndex:s,route:o};c.relativePath.startsWith("/")&&(T(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let f=Z([r,c.relativePath]),u=n.concat(c);o.children&&o.children.length>0&&(T(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+f+'".')),Ln(o.children,t,u,f)),!(o.path==null&&!o.index)&&t.push({path:f,score:fo(f,o.index),routesMeta:u})};return e.forEach((o,s)=>{var i;if(o.path===""||!((i=o.path)!=null&&i.includes("?")))a(o,s);else for(let c of Bn(o.path))a(o,s,c)}),t}function Bn(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return a?[o,""]:[o];let s=Bn(r.join("/")),i=[];return i.push(...s.map(c=>c===""?o:[o,c].join("/"))),a&&i.push(...s),i.map(c=>e.startsWith("/")&&c===""?"/":c)}function ao(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:po(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const oo=/^:[\w-]+$/,so=3,io=2,lo=1,co=10,uo=-2,In=e=>e==="*";function fo(e,t){let n=e.split("/"),r=n.length;return n.some(In)&&(r+=uo),t&&(r+=io),n.filter(a=>!In(a)).reduce((a,o)=>a+(oo.test(o)?so:o===""?lo:co),r)}function po(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function ho(e,t,n){let{routesMeta:r}=e,a={},o="/",s=[];for(let i=0;i<r.length;++i){let c=r[i],f=i===r.length-1,u=o==="/"?t:t.slice(o.length)||"/",d=Vt({path:c.relativePath,caseSensitive:c.caseSensitive,end:f},u),h=c.route;if(!d)return null;Object.assign(a,d.params),s.push({params:a,pathname:Z([o,d.pathname]),pathnameBase:So(Z([o,d.pathnameBase])),route:h}),d.pathnameBase!=="/"&&(o=Z([o,d.pathnameBase]))}return s}function Vt(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=mo(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let o=a[0],s=o.replace(/(.)\/+$/,"$1"),i=a.slice(1);return{params:r.reduce((f,u,d)=>{let{paramName:h,isOptional:E}=u;if(h==="*"){let _=i[d]||"";s=o.slice(0,o.length-_.length).replace(/(.)\/+$/,"$1")}const v=i[d];return E&&!v?f[h]=void 0:f[h]=(v||"").replace(/%2F/g,"/"),f},{}),pathname:o,pathnameBase:s,pattern:e}}function mo(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),V(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 r=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,i,c)=>(r.push({paramName:i,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function go(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return V(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function se(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}const yo=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,wo=e=>yo.test(e);function bo(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?Fe(e):e,o;if(n)if(wo(n))o=n;else{if(n.includes("//")){let s=n;n=jn(n),V(!1,"Pathnames cannot have embedded double slashes - normalizing "+(s+" -> "+n))}n.startsWith("/")?o=Rn(n.substring(1),"/"):o=Rn(n,t)}else o=t;return{pathname:o,search:Eo(r),hash:Co(a)}}function Rn(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function zt(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function vo(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Un(e,t){let n=vo(e);return t?n.map((r,a)=>a===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Mn(e,t,n,r){r===void 0&&(r=!1);let a;typeof e=="string"?a=Fe(e):(a=Ve({},e),T(!a.pathname||!a.pathname.includes("?"),zt("?","pathname","search",a)),T(!a.pathname||!a.pathname.includes("#"),zt("#","pathname","hash",a)),T(!a.search||!a.search.includes("#"),zt("#","search","hash",a)));let o=e===""||a.pathname==="",s=o?"/":a.pathname,i;if(s==null)i=n;else{let d=t.length-1;if(!r&&s.startsWith("..")){let h=s.split("/");for(;h[0]==="..";)h.shift(),d-=1;a.pathname=h.join("/")}i=d>=0?t[d]:"/"}let c=bo(a,i),f=s&&s!=="/"&&s.endsWith("/"),u=(o||s===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(f||u)&&(c.pathname+="/"),c}const jn=e=>e.replace(/\/\/+/g,"/"),Z=e=>jn(e.join("/")),So=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Eo=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Co=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function _o(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const $n=["post","put","patch","delete"];new Set($n);const No=["get",...$n];new Set(No);function He(){return He=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},He.apply(null,arguments)}const qe=b.createContext(null);process.env.NODE_ENV!=="production"&&(qe.displayName="DataRouter");const Ht=b.createContext(null);process.env.NODE_ENV!=="production"&&(Ht.displayName="DataRouterState");const Oo=b.createContext(null);process.env.NODE_ENV!=="production"&&(Oo.displayName="Await");const q=b.createContext(null);process.env.NODE_ENV!=="production"&&(q.displayName="Navigation");const Je=b.createContext(null);process.env.NODE_ENV!=="production"&&(Je.displayName="Location");const K=b.createContext({outlet:null,matches:[],isDataRoute:!1});process.env.NODE_ENV!=="production"&&(K.displayName="Route");const qt=b.createContext(null);process.env.NODE_ENV!=="production"&&(qt.displayName="RouteError");function To(e,t){let{relative:n}=t===void 0?{}:t;Ke()||(process.env.NODE_ENV!=="production"?T(!1,"useHref() may be used only in the context of a <Router> component."):T(!1));let{basename:r,navigator:a}=b.useContext(q),{hash:o,pathname:s,search:i}=Xe(e,{relative:n}),c=s;return r!=="/"&&(c=s==="/"?r:Z([r,s])),a.createHref({pathname:c,search:i,hash:o})}function Ke(){return b.useContext(Je)!=null}function he(){return Ke()||(process.env.NODE_ENV!=="production"?T(!1,"useLocation() may be used only in the context of a <Router> component."):T(!1)),b.useContext(Je).location}const Wn="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Vn(e){b.useContext(q).static||b.useLayoutEffect(e)}function pt(){let{isDataRoute:e}=b.useContext(K);return e?Wo():Ao()}function Ao(){Ke()||(process.env.NODE_ENV!=="production"?T(!1,"useNavigate() may be used only in the context of a <Router> component."):T(!1));let e=b.useContext(qe),{basename:t,future:n,navigator:r}=b.useContext(q),{matches:a}=b.useContext(K),{pathname:o}=he(),s=JSON.stringify(Un(a,n.v7_relativeSplatPath)),i=b.useRef(!1);return Vn(()=>{i.current=!0}),b.useCallback(function(f,u){if(u===void 0&&(u={}),process.env.NODE_ENV!=="production"&&V(i.current,Wn),!i.current)return;if(typeof f=="number"){r.go(f);return}let d=Mn(f,JSON.parse(s),o,u.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Z([t,d.pathname])),(u.replace?r.replace:r.push)(d,u.state,u)},[t,r,s,o,e])}function Po(){let{matches:e}=b.useContext(K),t=e[e.length-1];return t?t.params:{}}function Xe(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=b.useContext(q),{matches:a}=b.useContext(K),{pathname:o}=he(),s=JSON.stringify(Un(a,r.v7_relativeSplatPath));return b.useMemo(()=>Mn(e,JSON.parse(s),o,n==="path"),[e,s,o,n])}function xo(e,t){return Do(e,t)}function Do(e,t,n,r){Ke()||(process.env.NODE_ENV!=="production"?T(!1,"useRoutes() may be used only in the context of a <Router> component."):T(!1));let{navigator:a}=b.useContext(q),{matches:o}=b.useContext(K),s=o[o.length-1],i=s?s.params:{},c=s?s.pathname:"/",f=s?s.pathnameBase:"/",u=s&&s.route;if(process.env.NODE_ENV!=="production"){let w=u&&u.path||"";qn(c,!u||w.endsWith("*"),"You rendered descendant <Routes> (or called `useRoutes()`) at "+('"'+c+'" (under <Route path="'+w+'">) 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.
2
2
 
3
- `+('Please change the parent <Route path="'+y+'"> to <Route ')+('path="'+(y==="/"?"*":y+"/*")+'">.'))}let d=ue(),p;if(t){var E;let y=typeof t=="string"?Se(t):t;f==="/"||(E=y.pathname)!=null&&E.startsWith(f)||(process.env.NODE_ENV!=="production"?x(!1,"When overriding the location using `<Routes location>` or `useRoutes(routes, location)`, the location pathname must begin with the portion of the URL pathname that was "+('matched by all parent routes. The current pathname base is "'+f+'" ')+('but pathname "'+y.pathname+'" was given in the `location` prop.')):x(!1)),p=y}else p=d;let v=p.pathname||"/",N=v;if(f!=="/"){let y=f.replace(/^\//,"").split("/");N="/"+v.replace(/^\//,"").split("/").slice(y.length).join("/")}let g=Fa(e,{pathname:N});process.env.NODE_ENV!=="production"&&(process.env.NODE_ENV!=="production"&&H(u||g!=null,'No routes matched location "'+p.pathname+p.search+p.hash+'" '),process.env.NODE_ENV!=="production"&&H(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 "'+p.pathname+p.search+p.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.'));let m=uo(g&&g.map(y=>Object.assign({},y,{params:Object.assign({},i,y.params),pathname:Y([f,a.encodeLocation?a.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?f:Y([f,a.encodeLocation?a.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),o,n,r);return t&&m?b.createElement(Ie.Provider,{value:{location:Ue({pathname:"/",search:"",hash:"",state:null,key:"default"},p),navigationType:ne.Pop}},m):m}function so(){let e=go(),t=Qa(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},s=null;return process.env.NODE_ENV!=="production"&&(console.error("Error handled by React Router default ErrorBoundary:",e),s=b.createElement(b.Fragment,null,b.createElement("p",null,"πŸ’Ώ Hey developer πŸ‘‹"),b.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",b.createElement("code",{style:o},"ErrorBoundary")," or"," ",b.createElement("code",{style:o},"errorElement")," prop on your route."))),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},t),n?b.createElement("pre",{style:a},n):null,s)}const io=b.createElement(so,null);class lo extends b.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?b.createElement(J.Provider,{value:this.props.routeContext},b.createElement(Tt.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function co(e){let{routeContext:t,match:n,children:r}=e,a=b.useContext(Re);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),b.createElement(J.Provider,{value:t},r)}function uo(e,t,n,r){var a;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var o;if(!n)return null;if(n.errors)e=n.matches;else if((o=r)!=null&&o.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let s=e,i=(a=n)==null?void 0:a.errors;if(i!=null){let u=s.findIndex(d=>d.route.id&&i?.[d.route.id]!==void 0);u>=0||(process.env.NODE_ENV!=="production"?x(!1,"Could not find a matching route for errors on route IDs: "+Object.keys(i).join(",")):x(!1)),s=s.slice(0,Math.min(s.length,u+1))}let c=!1,f=-1;if(n&&r&&r.v7_partialHydration)for(let u=0;u<s.length;u++){let d=s[u];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(f=u),d.route.id){let{loaderData:p,errors:E}=n,v=d.route.loader&&p[d.route.id]===void 0&&(!E||E[d.route.id]===void 0);if(d.route.lazy||v){c=!0,f>=0?s=s.slice(0,f+1):s=[s[0]];break}}}return s.reduceRight((u,d,p)=>{let E,v=!1,N=null,g=null;n&&(E=i&&d.route.id?i[d.route.id]:void 0,N=d.route.errorElement||io,c&&(f<0&&p===0?(Tn("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),v=!0,g=null):f===p&&(v=!0,g=d.route.hydrateFallbackElement||null)));let m=t.concat(s.slice(0,p+1)),y=()=>{let w;return E?w=N:v?w=g:d.route.Component?w=b.createElement(d.route.Component,null):d.route.element?w=d.route.element:w=u,b.createElement(co,{match:d,routeContext:{outlet:u,matches:m,isDataRoute:n!=null},children:w})};return n&&(d.route.ErrorBoundary||d.route.errorElement||p===0)?b.createElement(lo,{location:n.location,revalidation:n.revalidation,component:N,error:E,children:y(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):y()},null)}var On=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(On||{}),$e=(function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e})($e||{});function At(e){return e+" must be used within a data router. See https://reactrouter.com/v6/routers/picking-a-router."}function fo(e){let t=b.useContext(Re);return t||(process.env.NODE_ENV!=="production"?x(!1,At(e)):x(!1)),t}function ho(e){let t=b.useContext(xt);return t||(process.env.NODE_ENV!=="production"?x(!1,At(e)):x(!1)),t}function po(e){let t=b.useContext(J);return t||(process.env.NODE_ENV!=="production"?x(!1,At(e)):x(!1)),t}function Pt(e){let t=po(e),n=t.matches[t.matches.length-1];return n.route.id||(process.env.NODE_ENV!=="production"?x(!1,e+' can only be used on routes that contain a unique "id"'):x(!1)),n.route.id}function mo(){return Pt($e.UseRouteId)}function go(){var e;let t=b.useContext(Tt),n=ho($e.UseRouteError),r=Pt($e.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function yo(){let{router:e}=fo(On.UseNavigateStable),t=Pt($e.UseNavigateStable),n=b.useRef(!1);return Cn(()=>{n.current=!0}),b.useCallback(function(a,o){o===void 0&&(o={}),process.env.NODE_ENV!=="production"&&H(n.current,Nn),n.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,Ue({fromRouteId:t},o)))},[e,t])}const xn={};function Tn(e,t,n){!t&&!xn[e]&&(xn[e]=!0,process.env.NODE_ENV!=="production"&&H(!1,n))}const An={};function bo(e,t){process.env.NODE_ENV!=="production"&&!An[t]&&(An[t]=!0,console.warn(t))}const Pn=(e,t,n)=>bo(e,"⚠️ React Router Future Flag Warning: "+t+". "+("You can use the `"+e+"` future flag to opt-in early. ")+("For more information, see "+n+"."));function vo(e,t){e?.v7_startTransition===void 0&&Pn("v7_startTransition","React Router will begin wrapping state updates in `React.startTransition` in v7","https://reactrouter.com/v6/upgrading/future#v7_starttransition"),e?.v7_relativeSplatPath===void 0&&Pn("v7_relativeSplatPath","Relative route resolution within Splat routes is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath")}function tt(e){process.env.NODE_ENV!=="production"?x(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>."):x(!1)}function wo(e){let{basename:t="/",children:n=null,location:r,navigationType:a=ne.Pop,navigator:o,static:s=!1,future:i}=e;Me()&&(process.env.NODE_ENV!=="production"?x(!1,"You cannot render a <Router> inside another <Router>. You should never have more than one in your app."):x(!1));let c=t.replace(/^\/*/,"/"),f=b.useMemo(()=>({basename:c,navigator:o,static:s,future:Ue({v7_relativeSplatPath:!1},i)}),[c,i,o,s]);typeof r=="string"&&(r=Se(r));let{pathname:u="/",search:d="",hash:p="",state:E=null,key:v="default"}=r,N=b.useMemo(()=>{let g=re(u,c);return g==null?null:{location:{pathname:g,search:d,hash:p,state:E,key:v},navigationType:a}},[c,u,d,p,E,v,a]);return process.env.NODE_ENV!=="production"&&H(N!=null,'<Router basename="'+c+'"> is not able to match the URL '+('"'+u+d+p+'" because it does not start with the ')+"basename, so the <Router> won't render anything."),N==null?null:b.createElement(W.Provider,{value:f},b.createElement(Ie.Provider,{children:n,value:N}))}function Eo(e){let{children:t,location:n}=e;return ao(Ft(t),n)}new Promise(()=>{});function Ft(e,t){t===void 0&&(t=[]);let n=[];return b.Children.forEach(e,(r,a)=>{if(!b.isValidElement(r))return;let o=[...t,a];if(r.type===b.Fragment){n.push.apply(n,Ft(r.props.children,o));return}r.type!==tt&&(process.env.NODE_ENV!=="production"?x(!1,"["+(typeof r.type=="string"?r.type:r.type.name)+"] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>"):x(!1)),!r.props.index||!r.props.children||(process.env.NODE_ENV!=="production"?x(!1,"An index route cannot have child routes."):x(!1));let s={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(s.children=Ft(r.props.children,o)),n.push(s)}),n}function _e(){return _e=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_e.apply(null,arguments)}function Dt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}const nt="get",rt="application/x-www-form-urlencoded";function at(e){return e!=null&&typeof e.tagName=="string"}function So(e){return at(e)&&e.tagName.toLowerCase()==="button"}function _o(e){return at(e)&&e.tagName.toLowerCase()==="form"}function No(e){return at(e)&&e.tagName.toLowerCase()==="input"}function Co(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Oo(e,t){return e.button===0&&(!t||t==="_self")&&!Co(e)}function kt(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(a=>[n,a]):[[n,r]])},[]))}function xo(e,t){let n=kt(e);return t&&t.forEach((r,a)=>{n.has(a)||t.getAll(a).forEach(o=>{n.append(a,o)})}),n}let ot=null;function To(){if(ot===null)try{new FormData(document.createElement("form"),0),ot=!1}catch{ot=!0}return ot}const Ao=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Lt(e){return e!=null&&!Ao.has(e)?(process.env.NODE_ENV!=="production"&&H(!1,'"'+e+'" is not a valid `encType` for `<Form>`/`<fetcher.Form>` '+('and will default to "'+rt+'"')),null):e}function Po(e,t){let n,r,a,o,s;if(_o(e)){let i=e.getAttribute("action");r=i?re(i,t):null,n=e.getAttribute("method")||nt,a=Lt(e.getAttribute("enctype"))||rt,o=new FormData(e)}else if(So(e)||No(e)&&(e.type==="submit"||e.type==="image")){let i=e.form;if(i==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let c=e.getAttribute("formaction")||i.getAttribute("action");if(r=c?re(c,t):null,n=e.getAttribute("formmethod")||i.getAttribute("method")||nt,a=Lt(e.getAttribute("formenctype"))||Lt(i.getAttribute("enctype"))||rt,o=new FormData(i,e),!To()){let{name:f,type:u,value:d}=e;if(u==="image"){let p=f?f+".":"";o.append(p+"x","0"),o.append(p+"y","0")}else f&&o.append(f,d)}}else{if(at(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=nt,r=null,a=rt,s=e}return o&&a==="text/plain"&&(s=o,o=void 0),{action:r,method:n.toLowerCase(),encType:a,formData:o,body:s}}const Fo=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Do=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],ko=["fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","viewTransition"],Lo="6";try{window.__reactRouterVersion=Lo}catch{}const Fn=b.createContext({isTransitioning:!1});process.env.NODE_ENV!=="production"&&(Fn.displayName="ViewTransition");const Bo=b.createContext(new Map);process.env.NODE_ENV!=="production"&&(Bo.displayName="Fetchers");const Dn=b["startTransition"];function Uo(e){let{basename:t,children:n,future:r,window:a}=e,o=b.useRef();o.current==null&&(o.current=Ta({window:a,v5Compat:!0}));let s=o.current,[i,c]=b.useState({action:s.action,location:s.location}),{v7_startTransition:f}=r||{},u=b.useCallback(d=>{f&&Dn?Dn(()=>c(d)):c(d)},[c,f]);return b.useLayoutEffect(()=>s.listen(u),[s,u]),b.useEffect(()=>vo(r),[r]),b.createElement(wo,{basename:t,children:n,location:i.location,navigationType:i.action,navigator:s,future:r})}process.env.NODE_ENV;const Ro=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Io=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,kn=b.forwardRef(function(t,n){let{onClick:r,relative:a,reloadDocument:o,replace:s,state:i,target:c,to:f,preventScrollReset:u,viewTransition:d}=t,p=Dt(t,Fo),{basename:E}=b.useContext(W),v,N=!1;if(typeof f=="string"&&Io.test(f)&&(v=f,Ro))try{let w=new URL(window.location.href),C=f.startsWith("//")?new URL(w.protocol+f):new URL(f),P=re(C.pathname,E);C.origin===w.origin&&P!=null?f=P+C.search+C.hash:N=!0}catch{process.env.NODE_ENV!=="production"&&H(!1,'<Link to="'+f+'"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.')}let g=to(f,{relative:a}),m=Vo(f,{replace:s,state:i,target:c,preventScrollReset:u,relative:a,viewTransition:d});function y(w){r&&r(w),w.defaultPrevented||m(w)}return b.createElement("a",_e({},p,{href:v||g,onClick:N||o?r:y,ref:n,target:c}))});process.env.NODE_ENV!=="production"&&(kn.displayName="Link");const Mo=b.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:a=!1,className:o="",end:s=!1,style:i,to:c,viewTransition:f,children:u}=t,d=Dt(t,Do),p=je(c,{relative:d.relative}),E=ue(),v=b.useContext(xt),{navigator:N,basename:g}=b.useContext(W),m=v!=null&&Xo(p)&&f===!0,y=N.encodeLocation?N.encodeLocation(p).pathname:p.pathname,w=E.pathname,C=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;a||(w=w.toLowerCase(),C=C?C.toLowerCase():null,y=y.toLowerCase()),C&&g&&(C=re(C,g)||C);const P=y!=="/"&&y.endsWith("/")?y.length-1:y.length;let T=w===y||!s&&w.startsWith(y)&&w.charAt(P)==="/",$=C!=null&&(C===y||!s&&C.startsWith(y)&&C.charAt(y.length)==="/"),Z={isActive:T,isPending:$,isTransitioning:m},B=T?r:void 0,D;typeof o=="function"?D=o(Z):D=[o,T?"active":null,$?"pending":null,m?"transitioning":null].filter(Boolean).join(" ");let U=typeof i=="function"?i(Z):i;return b.createElement(kn,_e({},d,{"aria-current":B,className:D,ref:n,style:U,to:c,viewTransition:f}),typeof u=="function"?u(Z):u)});process.env.NODE_ENV!=="production"&&(Mo.displayName="NavLink");const jo=b.forwardRef((e,t)=>{let{fetcherKey:n,navigate:r,reloadDocument:a,replace:o,state:s,method:i=nt,action:c,onSubmit:f,relative:u,preventScrollReset:d,viewTransition:p}=e,E=Dt(e,ko),v=Jo(),N=Ko(c,{relative:u}),g=i.toLowerCase()==="get"?"get":"post",m=y=>{if(f&&f(y),y.defaultPrevented)return;y.preventDefault();let w=y.nativeEvent.submitter,C=w?.getAttribute("formmethod")||i;v(w||y.currentTarget,{fetcherKey:n,method:C,navigate:r,replace:o,state:s,relative:u,preventScrollReset:d,viewTransition:p})};return b.createElement("form",_e({ref:t,method:g,action:N,onSubmit:a?f:m},E))});process.env.NODE_ENV!=="production"&&(jo.displayName="Form"),process.env.NODE_ENV;var st;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(st||(st={}));var Ln;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Ln||(Ln={}));function $o(e){return e+" must be used within a data router. See https://reactrouter.com/v6/routers/picking-a-router."}function Bn(e){let t=b.useContext(Re);return t||(process.env.NODE_ENV!=="production"?x(!1,$o(e)):x(!1)),t}function Vo(e,t){let{target:n,replace:r,state:a,preventScrollReset:o,relative:s,viewTransition:i}=t===void 0?{}:t,c=et(),f=ue(),u=je(e,{relative:s});return b.useCallback(d=>{if(Oo(d,n)){d.preventDefault();let p=r!==void 0?r:Be(f)===Be(u);c(e,{replace:p,state:a,preventScrollReset:o,relative:s,viewTransition:i})}},[f,c,u,r,a,n,e,o,s,i])}function Ho(e){process.env.NODE_ENV!=="production"&&H(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=b.useRef(kt(e)),n=b.useRef(!1),r=ue(),a=b.useMemo(()=>xo(r.search,n.current?null:t.current),[r.search]),o=et(),s=b.useCallback((i,c)=>{const f=kt(typeof i=="function"?i(a):i);n.current=!0,o("?"+f,c)},[o,a]);return[a,s]}function zo(){if(typeof document>"u")throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}let qo=0,Wo=()=>"__"+String(++qo)+"__";function Jo(){let{router:e}=Bn(st.UseSubmit),{basename:t}=b.useContext(W),n=mo();return b.useCallback(function(r,a){a===void 0&&(a={}),zo();let{action:o,method:s,encType:i,formData:c,body:f}=Po(r,t);if(a.navigate===!1){let u=a.fetcherKey||Wo();e.fetch(u,n,a.action||o,{preventScrollReset:a.preventScrollReset,formData:c,body:f,formMethod:a.method||s,formEncType:a.encType||i,flushSync:a.flushSync})}else e.navigate(a.action||o,{preventScrollReset:a.preventScrollReset,formData:c,body:f,formMethod:a.method||s,formEncType:a.encType||i,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[e,t,n])}function Ko(e,t){let{relative:n}=t===void 0?{}:t,{basename:r}=b.useContext(W),a=b.useContext(J);a||(process.env.NODE_ENV!=="production"?x(!1,"useFormAction must be used inside a RouteContext"):x(!1));let[o]=a.matches.slice(-1),s=_e({},je(e||".",{relative:n})),i=ue();if(e==null){s.search=i.search;let c=new URLSearchParams(s.search),f=c.getAll("index");if(f.some(d=>d==="")){c.delete("index"),f.filter(p=>p).forEach(p=>c.append("index",p));let d=c.toString();s.search=d?"?"+d:""}}return(!e||e===".")&&o.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(s.pathname=s.pathname==="/"?r:Y([r,s.pathname])),Be(s)}function Xo(e,t){t===void 0&&(t={});let n=b.useContext(Fn);n==null&&(process.env.NODE_ENV!=="production"?x(!1,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"):x(!1));let{basename:r}=Bn(st.useViewTransitionState),a=je(e,{relative:t.relative});if(!n.isTransitioning)return!1;let o=re(n.currentLocation.pathname,r)||n.currentLocation.pathname,s=re(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Ct(a.pathname,s)!=null||Ct(a.pathname,o)!=null}function Un(e,t){return function(){return e.apply(t,arguments)}}const{toString:Go}=Object.prototype,{getPrototypeOf:Ne}=Object,{iterator:Ve,toStringTag:Rn}=Symbol,it=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),He=(e,t)=>{let n=e;const r=[];for(;n!=null&&n!==Object.prototype;){if(r.indexOf(n)!==-1)return!1;if(r.push(n),it(n,t))return!0;n=Ne(n)}return!1},Yo=(e,t)=>e!=null&&He(e,t)?e[t]:void 0,Bt=(e=>t=>{const n=Go.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),z=e=>(e=e.toLowerCase(),t=>Bt(t)===e),lt=e=>t=>typeof t===e,{isArray:fe}=Array,he=lt("undefined");function Ce(e){return e!==null&&!he(e)&&e.constructor!==null&&!he(e.constructor)&&j(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const In=z("ArrayBuffer");function Qo(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&In(e.buffer),t}const Zo=lt("string"),j=lt("function"),Mn=lt("number"),Oe=e=>e!==null&&typeof e=="object",es=e=>e===!0||e===!1,ct=e=>{if(!Oe(e))return!1;const t=Ne(e);return(t===null||t===Object.prototype||Ne(t)===null)&&!He(e,Rn)&&!He(e,Ve)},ts=e=>{if(!Oe(e)||Ce(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},ns=z("Date"),rs=z("File"),as=e=>!!(e&&typeof e.uri<"u"),os=e=>e&&typeof e.getParts<"u",ss=z("Blob"),is=z("FileList"),ls=z("Set"),cs=e=>Oe(e)&&j(e.pipe);function ds(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const jn=ds(),$n=typeof jn.FormData<"u"?jn.FormData:void 0,us=e=>{if(!e)return!1;if($n&&e instanceof $n)return!0;const t=Ne(e);if(!t||t===Object.prototype||!j(e.append))return!1;const n=Bt(e);return n==="formdata"||n==="object"&&j(e.toString)&&e.toString()==="[object FormData]"},fs=z("URLSearchParams"),[hs,ps,ms,gs]=["ReadableStream","Request","Response","Headers"].map(z),ys=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ze(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,a;if(typeof e!="object"&&(e=[e]),fe(e))for(r=0,a=e.length;r<a;r++)t.call(null,e[r],r,e);else{if(Ce(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let i;for(r=0;r<s;r++)i=o[r],t.call(null,e[i],i,e)}}function Vn(e,t){if(Ce(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,a;for(;r-- >0;)if(a=n[r],t===a.toLowerCase())return a;return null}const pe=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Hn=e=>!he(e)&&e!==pe;function Ut(...e){const{caseless:t,skipUndefined:n}=Hn(this)&&this||{},r={},a=(o,s)=>{if(s==="__proto__"||s==="constructor"||s==="prototype")return;const i=t&&typeof s=="string"&&Vn(r,s)||s,c=it(r,i)?r[i]:void 0;ct(c)&&ct(o)?r[i]=Ut(c,o):ct(o)?r[i]=Ut({},o):fe(o)?r[i]=o.slice():(!n||!he(o))&&(r[i]=o)};for(let o=0,s=e.length;o<s;o++){const i=e[o];if(!i||Ce(i)||(ze(i,a),typeof i!="object"||fe(i)))continue;const c=Object.getOwnPropertySymbols(i);for(let f=0;f<c.length;f++){const u=c[f];As.call(i,u)&&a(i[u],u)}}return r}const bs=(e,t,n,{allOwnKeys:r}={})=>(ze(t,(a,o)=>{n&&j(a)?Object.defineProperty(e,o,{__proto__:null,value:Un(a,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,o,{__proto__:null,value:a,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),vs=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),ws=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},Es=(e,t,n,r)=>{let a,o,s;const i={};if(t=t||{},e==null)return t;do{for(a=Object.getOwnPropertyNames(e),o=a.length;o-- >0;)s=a[o],(!r||r(s,e,t))&&!i[s]&&(t[s]=e[s],i[s]=!0);e=n!==!1&&Ne(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Ss=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},_s=e=>{if(!e)return null;if(fe(e))return e;let t=e.length;if(!Mn(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Ns=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Ne(Uint8Array)),Cs=(e,t)=>{const r=(e&&e[Ve]).call(e);let a;for(;(a=r.next())&&!a.done;){const o=a.value;t.call(e,o[0],o[1])}},Os=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},xs=z("HTMLFormElement"),Ts=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,a){return r.toUpperCase()+a}),{propertyIsEnumerable:As}=Object.prototype,Ps=z("RegExp"),zn=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};ze(n,(a,o)=>{let s;(s=t(a,o,e))!==!1&&(r[o]=s||a)}),Object.defineProperties(e,r)},Fs=e=>{zn(e,(t,n)=>{if(j(e)&&["arguments","caller","callee"].includes(n))return!1;const r=e[n];if(j(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Ds=(e,t)=>{const n={},r=a=>{a.forEach(o=>{n[o]=!0})};return fe(e)?r(e):r(String(e).split(t)),n},ks=()=>{},Ls=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Bs(e){return!!(e&&j(e.append)&&e[Rn]==="FormData"&&e[Ve])}const Us=e=>{const t=new WeakSet,n=r=>{if(Oe(r)){if(t.has(r))return;if(Ce(r))return r;if(!("toJSON"in r)){t.add(r);let a;if(ls(r)){a=[];for(const o of r){const s=n(o);!he(s)&&a.push(s)}}else a=fe(r)?[]:{},ze(r,(o,s)=>{const i=n(o);!he(i)&&(a[s]=i)});return t.delete(r),a}}return r};return n(e)},Rs=z("AsyncFunction"),Is=e=>e&&(Oe(e)||j(e))&&j(e.then)&&j(e.catch),qn=((e,t)=>e?setImmediate:t?((n,r)=>(pe.addEventListener("message",({source:a,data:o})=>{a===pe&&o===n&&r.length&&r.shift()()},!1),a=>{r.push(a),pe.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",j(pe.postMessage)),Ms=typeof queueMicrotask<"u"?queueMicrotask.bind(pe):typeof process<"u"&&process.nextTick||qn,Wn=e=>e!=null&&j(e[Ve]),h={isArray:fe,isArrayBuffer:In,isBuffer:Ce,isFormData:us,isArrayBufferView:Qo,isString:Zo,isNumber:Mn,isBoolean:es,isObject:Oe,isPlainObject:ct,isEmptyObject:ts,isReadableStream:hs,isRequest:ps,isResponse:ms,isHeaders:gs,isUndefined:he,isDate:ns,isFile:rs,isReactNativeBlob:as,isReactNative:os,isBlob:ss,isRegExp:Ps,isFunction:j,isStream:cs,isURLSearchParams:fs,isTypedArray:Ns,isFileList:is,forEach:ze,merge:Ut,extend:bs,trim:ys,stripBOM:vs,inherits:ws,toFlatObject:Es,kindOf:Bt,kindOfTest:z,endsWith:Ss,toArray:_s,forEachEntry:Cs,matchAll:Os,isHTMLForm:xs,hasOwnProperty:it,hasOwnProp:it,hasOwnInPrototypeChain:He,getSafeProp:Yo,reduceDescriptors:zn,freezeMethods:Fs,toObjectSet:Ds,toCamelCase:Ts,noop:ks,toFiniteNumber:Ls,findKey:Vn,global:pe,isContextDefined:Hn,isSpecCompliantForm:Bs,toJSONObject:Us,isAsyncFn:Rs,isThenable:Is,setImmediate:qn,asap:Ms,isIterable:Wn,isSafeIterable:e=>e!=null&&He(e,Ve)&&Wn(e)},js=h.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),$s=e=>{const t={};let n,r,a;return e&&e.split(`
4
- `).forEach(function(s){a=s.indexOf(":"),n=s.substring(0,a).trim().toLowerCase(),r=s.substring(a+1).trim();const i=h.hasOwnProp(t,n);!n||i&&h.hasOwnProp(js,n)||(n==="set-cookie"?i?t[n].push(r):t[n]=[r]:t[n]=i?t[n]+", "+r:r)}),t};function Vs(e){let t=0,n=e.length;for(;t<n;){const r=e.charCodeAt(t);if(r!==9&&r!==32)break;t+=1}for(;n>t;){const r=e.charCodeAt(n-1);if(r!==9&&r!==32)break;n-=1}return t===0&&n===e.length?e:e.slice(t,n)}const Hs=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),zs=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function Rt(e,t){return h.isArray(e)?e.map(n=>Rt(n,t)):Vs(String(e).replace(t,""))}const qs=e=>Rt(e,Hs),Ws=e=>Rt(e,zs);function Jn(e){const t=Object.create(null);return h.forEach(e.toJSON(),(n,r)=>{t[r]=Ws(n)}),t}const Kn=Symbol("internals");function qe(e){return e&&String(e).trim().toLowerCase()}function dt(e){return e===!1||e==null?e:h.isArray(e)?e.map(dt):qs(String(e))}function Js(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const Ks=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function It(e){let t=0,n=e.length;for(;t<n;){const r=e.charCodeAt(t);if(r!==9&&r!==32)break;t+=1}for(;n>t;){const r=e.charCodeAt(n-1);if(r!==9&&r!==32)break;n-=1}return t===0&&n===e.length?e:e.slice(t,n)}function Xs(e){const t=e.length-1;if(t<1||e.charCodeAt(0)!==34||e.charCodeAt(t)!==34)return e;let n="";for(let r=1;r<t;r++){const a=e.charCodeAt(r);if(a===34||a===92&&(r+=1,r>=t))return e;n+=e[r]}return n}function Gs(e){const t=Object.create(null),n=String(e);let r=0,a=!1,o=!1;function s(i){const c=It(n.slice(r,i)),f=c.indexOf("=");if(f<1)return;const u=It(c.slice(0,f));if(!Ks.test(u))return;const d=u.toLowerCase();if(d==="__proto__"||d==="constructor"||d==="prototype")return;const p=It(c.slice(f+1));t[d]=Xs(p)}for(let i=0;i<n.length;i++){const c=n.charCodeAt(i);a?o?o=!1:c===92?o=!0:c===34&&(a=!1):c===34?a=!0:(c===44||c===59)&&(s(i),r=i+1)}return s(n.length),t}const Ys=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Mt(e,t,n,r,a){if(h.isFunction(r))return r.call(this,t,n);if(a&&(t=n),!!h.isString(t)){if(h.isString(r))return t.indexOf(r)!==-1;if(h.isRegExp(r))return r.test(t)}}function Qs(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Zs(e,t){const n=h.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{__proto__:null,value:function(a,o,s){return this[r].call(this,t,a,o,s)},configurable:!0})})}let I=class{constructor(t){t&&this.set(t)}set(t,n,r){const a=this;function o(i,c,f){const u=qe(c);if(!u)return;const d=h.findKey(a,u);(!d||a[d]===void 0||f===!0||f===void 0&&a[d]!==!1)&&(a[d||c]=dt(i))}const s=(i,c)=>h.forEach(i,(f,u)=>o(f,u,c));if(h.isPlainObject(t)||t instanceof this.constructor)s(t,n);else if(h.isString(t)&&(t=t.trim())&&!Ys(t))s($s(t),n);else if(h.isObject(t)&&h.isSafeIterable(t)){let i=Object.create(null),c,f;for(const u of t){if(!h.isArray(u))throw new TypeError("Object iterator must return a key-value pair");f=u[0],h.hasOwnProp(i,f)?(c=i[f],i[f]=h.isArray(c)?[...c,u[1]]:[c,u[1]]):i[f]=u[1]}s(i,n)}else t!=null&&o(n,t,r);return this}get(t,n){if(t=qe(t),t){const r=h.findKey(this,t);if(r){const a=this[r];if(!n)return a;if(n===!0)return Js(a);if(h.isFunction(n))return n.call(this,a,r);if(h.isRegExp(n))return n.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=qe(t),t){const r=h.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Mt(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let a=!1;function o(s){if(s=qe(s),s){const i=h.findKey(r,s);i&&(!n||Mt(r,r[i],i,n))&&(delete r[i],a=!0)}}return h.isArray(t)?t.forEach(o):o(t),a}clear(t){const n=Object.keys(this);let r=n.length,a=!1;for(;r--;){const o=n[r];(!t||Mt(this,this[o],o,t,!0))&&(delete this[o],a=!0)}return a}normalize(t){const n=this,r={};return h.forEach(this,(a,o)=>{const s=h.findKey(r,o);if(s){n[s]=dt(a),delete n[o];return}const i=t?Qs(o):String(o).trim();i!==o&&delete n[o],n[i]=dt(a),r[i]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return h.forEach(this,(r,a)=>{r!=null&&r!==!1&&(n[a]=t&&h.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
5
- `)}getSetCookie(){const t=this.get("set-cookie");return h.isArray(t)?t:t==null||t===!1?[]:[t]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static parseParameters(t){return Gs(t)}static concat(t,...n){const r=new this(t);return n.forEach(a=>r.set(a)),r}static accessor(t){const r=(this[Kn]=this[Kn]={accessors:{}}).accessors,a=this.prototype;function o(s){const i=qe(s);r[i]||(Zs(a,s),r[i]=!0)}return h.isArray(t)?t.forEach(o):o(t),this}};I.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),h.reduceDescriptors(I.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),h.freezeMethods(I);const ut="[REDACTED ****]";function ei(e){if(h.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(h.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}function ti(e,t){const n=new Set(t.map(o=>String(o).toLowerCase())),r=[],a=o=>{if(o===null||typeof o!="object"||h.isBuffer(o))return o;if(r.indexOf(o)!==-1)return;o instanceof I&&(o=o.toJSON()),r.push(o);let s;if(h.isArray(o))s=[],o.forEach((i,c)=>{const f=a(i);h.isUndefined(f)||(s[c]=f)});else{if(!h.isPlainObject(o)&&ei(o))return r.pop(),o;s=Object.create(null);for(const[i,c]of Object.entries(o)){const f=n.has(i.toLowerCase())?ut:a(c);h.isUndefined(f)||(s[i]=f)}}return r.pop(),s};return a(e)}function Xn(e){try{return String(e)}catch{return""}}function ni(e){return e.errors.map(n=>{try{return n&&n.message?Xn(n.message):Xn(n)}catch{return""}}).filter(Boolean).join("; ")||e.name||"AggregateError"}let _=class Ca extends Error{static from(t,n,r,a,o,s){let i=t.message;!i&&h.isArray(t.errors)&&t.errors.length&&(i=ni(t));const c=new Ca(i,n||t.code,r,a,o);return Object.defineProperty(c,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),c.name=t.name,t.status!=null&&c.status==null&&(c.status=t.status),s&&Object.assign(c,s),c}constructor(t,n,r,a,o){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),r&&(this.config=r),a&&(this.request=a),o&&(this.response=o,this.status=o.status)}toJSON(){const t=this.config,n=t&&h.hasOwnProp(t,"redact")?t.redact:void 0,r=h.isArray(n)&&n.length>0?ti(t,n):h.toJSONObject(t);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:r,code:this.code,status:this.status}}};_.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",_.ERR_BAD_OPTION="ERR_BAD_OPTION",_.ECONNABORTED="ECONNABORTED",_.ETIMEDOUT="ETIMEDOUT",_.ECONNREFUSED="ECONNREFUSED",_.ERR_NETWORK="ERR_NETWORK",_.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",_.ERR_DEPRECATED="ERR_DEPRECATED",_.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",_.ERR_BAD_REQUEST="ERR_BAD_REQUEST",_.ERR_CANCELED="ERR_CANCELED",_.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",_.ERR_INVALID_URL="ERR_INVALID_URL",_.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const ri=null,Gn=100;function jt(e){return h.isPlainObject(e)||h.isArray(e)}function Yn(e){return h.endsWith(e,"[]")?e.slice(0,-2):e}function $t(e,t,n){return e?e.concat(t).map(function(a,o){return a=Yn(a),!n&&o?"["+a+"]":a}).join(n?".":""):t}function ai(e){return h.isArray(e)&&!e.some(jt)}const oi=h.toFlatObject(h,{},null,function(t){return/^is[A-Z]/.test(t)});function ft(e,t,n){if(!h.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=h.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,w){return!h.isUndefined(w[y])});const r=n.metaTokens,a=n.visitor||v,o=n.dots,s=n.indexes,i=n.Blob||typeof Blob<"u"&&Blob,c=n.maxDepth===void 0?Gn:n.maxDepth,f=i&&h.isSpecCompliantForm(t),u=[];if(!h.isFunction(a))throw new TypeError("visitor must be a function");function d(m){if(m===null)return"";if(h.isDate(m))return m.toISOString();if(h.isBoolean(m))return m.toString();if(!f&&h.isBlob(m))throw new _("Blob is not supported. Use a Buffer instead.");if(h.isArrayBuffer(m)||h.isTypedArray(m)){if(f&&typeof i=="function")return new i([m]);throw new _("Blob is not supported. Use a Buffer instead.",_.ERR_NOT_SUPPORT)}return m}function p(m){if(m>c)throw new _("Object is too deeply nested ("+m+" levels). Max depth: "+c,_.ERR_FORM_DATA_DEPTH_EXCEEDED)}function E(m,y){if(c===1/0)return JSON.stringify(m);const w=[];return JSON.stringify(m,function(P,T){if(!h.isObject(T))return T;for(;w.length&&w[w.length-1]!==this;)w.pop();return w.push(T),p(y+w.length-1),T})}function v(m,y,w){let C=m;if(h.isReactNative(t)&&h.isReactNativeBlob(m))return t.append($t(w,y,o),d(m)),!1;if(m&&!w&&typeof m=="object"){if(h.endsWith(y,"{}"))y=r?y:y.slice(0,-2),m=E(m,1);else if(h.isArray(m)&&ai(m)||(h.isFileList(m)||h.endsWith(y,"[]"))&&(C=h.toArray(m)))return y=Yn(y),C.forEach(function(T,$){!(h.isUndefined(T)||T===null)&&t.append(s===!0?$t([y],$,o):s===null?y:y+"[]",d(T))}),!1}return jt(m)?!0:(t.append($t(w,y,o),d(m)),!1)}const N=Object.assign(oi,{defaultVisitor:v,convertValue:d,isVisitable:jt});function g(m,y,w=0){if(!h.isUndefined(m)){if(p(w),u.indexOf(m)!==-1)throw new Error("Circular reference detected in "+y.join("."));u.push(m),h.forEach(m,function(P,T){(!(h.isUndefined(P)||P===null)&&a.call(t,P,h.isString(T)?T.trim():T,y,N))===!0&&g(P,y?y.concat(T):[T],w+1)}),u.pop()}}if(!h.isObject(e))throw new TypeError("data must be an object");return g(e),t}function Qn(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(r){return t[r]})}function Vt(e,t){this._pairs=[],e&&ft(e,this,t)}const Zn=Vt.prototype;Zn.append=function(t,n){this._pairs.push([t,n])},Zn.toString=function(t){const n=t?r=>t.call(this,r,Qn):Qn;return this._pairs.map(function(a){return n(a[0])+"="+n(a[1])},"").join("&")};function si(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function er(e,t,n){if(!t)return e;e=e||"";const r=h.isFunction(n)?{serialize:n}:n,a=h.getSafeProp(r,"encode")||si,o=h.getSafeProp(r,"serialize");let s;if(o?s=o(t,r):s=h.isURLSearchParams(t)?t.toString():new Vt(t,r).toString(a),s){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class tr{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){h.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Ht={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},ii={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Vt,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},zt=typeof window<"u"&&typeof document<"u",qt=typeof navigator=="object"&&navigator||void 0,li=zt&&(!qt||["ReactNative","NativeScript","NS"].indexOf(qt.product)<0),ci=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",di=zt&&window.location.href||"http://localhost",L={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:zt,hasStandardBrowserEnv:li,hasStandardBrowserWebWorkerEnv:ci,navigator:qt,origin:di},Symbol.toStringTag,{value:"Module"})),...ii};function ui(e,t){return ft(e,new L.classes.URLSearchParams,{visitor:function(n,r,a,o){return L.isNode&&h.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}const nr=Gn;function rr(e){if(e>nr)throw new _("FormData field is too deeply nested ("+e+" levels). Max depth: "+nr,_.ERR_FORM_DATA_DEPTH_EXCEEDED)}function fi(e){const t=[],n=/[^.[\]]+|\[([^.[\]]*)]/g;let r;for(;(r=n.exec(e))!==null;)rr(t.length),t.push(r[0]==="[]"?"":r[1]||r[0]);return t}function hi(e){const t={},n=Object.keys(e);let r;const a=n.length;let o;for(r=0;r<a;r++)o=n[r],t[o]=e[o];return t}function ar(e){function t(n,r,a,o){rr(o);let s=n[o++];if(s==="__proto__")return!0;const i=Number.isFinite(+s),c=o>=n.length;return s=!s&&h.isArray(a)?a.length:s,c?(h.hasOwnProp(a,s)?a[s]=h.isArray(a[s])?a[s].concat(r):[a[s],r]:a[s]=r,!i):((!h.hasOwnProp(a,s)||!h.isObject(a[s]))&&(a[s]=[]),t(n,r,a[s],o)&&h.isArray(a[s])&&(a[s]=hi(a[s])),!i)}if(h.isFormData(e)&&h.isFunction(e.entries)){const n={};return h.forEachEntry(e,(r,a)=>{t(fi(r),a,n,0)}),n}return null}const xe=(e,t)=>e!=null&&h.hasOwnProp(e,t)?e[t]:void 0;function pi(e,t,n){if(h.isString(e))try{return(t||JSON.parse)(e),h.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const We={transitional:Ht,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",a=r.indexOf("application/json")>-1,o=h.isObject(t);if(o&&h.isHTMLForm(t)&&(t=new FormData(t)),h.isFormData(t))return a?JSON.stringify(ar(t)):t;if(h.isArrayBuffer(t)||h.isBuffer(t)||h.isStream(t)||h.isFile(t)||h.isBlob(t)||h.isReadableStream(t))return t;if(h.isArrayBufferView(t))return t.buffer;if(h.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let i;if(o){const c=xe(this,"formSerializer");if(r.indexOf("application/x-www-form-urlencoded")>-1)return ui(t,c).toString();if((i=h.isFileList(t))||r.indexOf("multipart/form-data")>-1){const f=xe(this,"env"),u=f&&f.FormData;return ft(i?{"files[]":t}:t,u&&new u,c)}}return o||a?(n.setContentType("application/json",!1),pi(t)):t}],transformResponse:[function(t){const n=xe(this,"transitional")||We.transitional,r=n&&n.forcedJSONParsing,a=xe(this,"responseType"),o=a==="json";if(h.isResponse(t)||h.isReadableStream(t))return t;if(t&&h.isString(t)&&(r&&!a||o)){const i=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(t,xe(this,"parseReviver"))}catch(c){if(i)throw c.name==="SyntaxError"?_.from(c,_.ERR_BAD_RESPONSE,this,null,xe(this,"response")):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:L.classes.FormData,Blob:L.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};h.forEach(["delete","get","head","post","put","patch","query"],e=>{We.headers[e]={}});function Wt(e,t){const n=this||We,r=t||n,a=I.from(r.headers);let o=r.data;return h.forEach(e,function(i){o=i.call(n,o,a.normalize(),t?t.status:void 0)}),a.normalize(),o}function or(e){return!!(e&&e.__CANCEL__)}let Je=class extends _{constructor(t,n,r){super(t??"canceled",_.ERR_CANCELED,n,r),this.name="CanceledError",this.__CANCEL__=!0}};function sr(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new _("Request failed with status code "+n.status,n.status>=400&&n.status<500?_.ERR_BAD_REQUEST:_.ERR_BAD_RESPONSE,n.config,n.request,n))}function mi(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}function gi(e,t){e=e||10;const n=new Array(e),r=new Array(e);let a=0,o=0,s;return t=t!==void 0?t:1e3,function(c){const f=Date.now(),u=r[o];s||(s=f),n[a]=c,r[a]=f;let d=o,p=0;for(;d!==a;)p+=n[d++],d=d%e;if(a=(a+1)%e,a===o&&(o=(o+1)%e),f-s<t)return;const E=u&&f-u;return E?Math.round(p*1e3/E):void 0}}function yi(e,t){let n=0,r=1e3/t,a,o;const s=(f,u=Date.now())=>{n=u,a=null,o&&(clearTimeout(o),o=null),e(...f)};return[(...f)=>{const u=Date.now(),d=u-n;d>=r?s(f,u):(a=f,o||(o=setTimeout(()=>{o=null,s(a)},r-d)))},()=>a&&s(a)]}const ht=(e,t,n=3)=>{let r=0;const a=gi(50,250);return yi(o=>{if(!o||typeof o.loaded!="number")return;const s=o.loaded,i=o.lengthComputable?o.total:void 0,c=Math.max(0,i!=null?Math.min(s,i):s),f=Math.max(0,c-r),u=a(f);r=Math.max(r,c);const d={loaded:c,total:i,progress:i?c/i:void 0,bytes:f,rate:u||void 0,estimated:u&&i?(i-c)/u:void 0,event:o,lengthComputable:i!=null,[t?"download":"upload"]:!0};e(d)},n)},ir=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},lr=(e,t=h.asap)=>(...n)=>t(()=>e(...n)),bi=L.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,L.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(L.origin),L.navigator&&/(msie|trident)/i.test(L.navigator.userAgent)):()=>!0,vi=L.hasStandardBrowserEnv?{write(e,t,n,r,a,o,s){if(typeof document>"u")return;const i=[`${e}=${encodeURIComponent(t)}`];h.isNumber(n)&&i.push(`expires=${new Date(n).toUTCString()}`),h.isString(r)&&i.push(`path=${r}`),h.isString(a)&&i.push(`domain=${a}`),o===!0&&i.push("secure"),h.isString(s)&&i.push(`SameSite=${s}`),document.cookie=i.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.split(";");for(let n=0;n<t.length;n++){const r=t[n].replace(/^\s+/,""),a=r.indexOf("=");if(a!==-1&&r.slice(0,a)===e)try{return decodeURIComponent(r.slice(a+1))}catch{return r.slice(a+1)}}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function wi(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Ei(e,t){if(!t)return e;let n=e.length;for(;n>0&&e.charCodeAt(n-1)===47;)n--;return e.slice(0,n)+"/"+t.replace(/^\/+/,"")}const Si=/^https?:(?!\/\/)/i,_i=/[\t\n\r]/g;function Ni(e){let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t)}function Ci(e){return Ni(e).replace(_i,"")}function Oi(e){return e&&e.replace(/(^|&)([^=&]*=)?[^&]+/g,(t,n,r="")=>`${n}${r}${ut}`)}function xi(e){const t=e.replace(/^(https?:\/{0,2})[^/?#]*@/i,`$1${ut}@`),n=t.indexOf("#"),a=(n===-1?t:t.slice(0,n)).replace(/([?&][^=&#]*=)[^&#]*/g,`$1${ut}`);return n===-1?a:`${a}#${Oi(t.slice(n+1))}`}function cr(e,t){if(typeof e=="string"){const n=Ci(e);if(Si.test(n))throw new _(`Invalid URL ${JSON.stringify(xi(n))}: missing "//" after protocol`,_.ERR_INVALID_URL,t)}}function dr(e,t,n,r){cr(t,r);let a=!wi(t);return e&&(a||n===!1)?(cr(e,r),Ei(e,t)):t}const ur=e=>e instanceof I?{...e}:e,Ti=e=>Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(e).concat(Object.getOwnPropertySymbols(e).filter(t=>Object.getOwnPropertyDescriptor(e,t).enumerable)):Object.keys(e);function me(e,t){e=e||{},t=t||{};const n=Object.create(null);Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function r(u,d,p,E){return h.isPlainObject(u)&&h.isPlainObject(d)?h.merge.call({caseless:E},u,d):h.isPlainObject(d)?h.merge({},d):h.isArray(d)?d.slice():d}function a(u,d,p,E){if(h.isUndefined(d)){if(!h.isUndefined(u))return r(void 0,u,p,E)}else return r(u,d,p,E)}function o(u,d){if(!h.isUndefined(d))return r(void 0,d)}function s(u,d){if(h.isUndefined(d)){if(!h.isUndefined(u))return r(void 0,u)}else return r(void 0,d)}function i(u){const d=h.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!h.isUndefined(d))if(h.isPlainObject(d)){if(h.hasOwnProp(d,u))return d[u]}else return;const p=h.hasOwnProp(e,"transitional")?e.transitional:void 0;if(h.isPlainObject(p)&&h.hasOwnProp(p,u))return p[u]}function c(u,d,p){if(h.hasOwnProp(t,p))return r(u,d);if(h.hasOwnProp(e,p))return r(void 0,u)}const f={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,allowedSocketPaths:s,responseEncoding:s,validateStatus:c,headers:(u,d,p)=>a(ur(u),ur(d),p,!0)};return h.forEach(Ti({...e,...t}),function(d){if(d==="__proto__"||d==="constructor"||d==="prototype")return;const p=h.hasOwnProp(f,d)?f[d]:a,E=h.hasOwnProp(e,d)?e[d]:void 0,v=h.hasOwnProp(t,d)?t[d]:void 0,N=p(E,v,d);h.isUndefined(N)&&p!==c||(n[d]=N)}),h.hasOwnProp(t,"validateStatus")&&h.isUndefined(t.validateStatus)&&i("validateStatusUndefinedResolves")===!1&&(h.hasOwnProp(e,"validateStatus")?n.validateStatus=r(void 0,e.validateStatus):delete n.validateStatus),n}const Ai=["content-type","content-length"];function Pi(e,t,n){if(n!=="content-only"){e.set(t);return}Object.entries(t||{}).forEach(([r,a])=>{Ai.includes(r.toLowerCase())&&e.set(r,a)})}const Fi=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,n)=>String.fromCharCode(parseInt(n,16)));function fr(e){const t=me({},e),n=p=>h.hasOwnProp(t,p)?t[p]:void 0,r=n("data");let a=n("withXSRFToken");const o=n("xsrfHeaderName"),s=n("xsrfCookieName");let i=n("headers");const c=n("auth"),f=n("baseURL"),u=n("allowAbsoluteUrls"),d=n("url");if(t.headers=i=I.from(i),t.url=er(dr(f,d,u,t),n("params"),n("paramsSerializer")),c){const p=h.getSafeProp(c,"username")||"",E=h.getSafeProp(c,"password")||"";try{i.set("Authorization","Basic "+btoa(p+":"+(E?Fi(E):"")))}catch(v){throw _.from(v,_.ERR_BAD_OPTION_VALUE,e)}}if(h.isFormData(r)&&(L.hasStandardBrowserEnv||L.hasStandardBrowserWebWorkerEnv||h.isReactNative(r)?i.setContentType(void 0):h.isFunction(r.getHeaders)&&Pi(i,r.getHeaders(),n("formDataHeaderPolicy"))),L.hasStandardBrowserEnv&&(h.isFunction(a)&&(a=a(t)),a===!0||a==null&&bi(t.url))){const E=o&&s&&vi.read(s);E&&i.set(o,E)}return t}const Di=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const a=fr(e);let o=a.data;const s=I.from(a.headers).normalize();let{responseType:i,onUploadProgress:c,onDownloadProgress:f}=a,u,d,p,E,v;function N(){E&&E(),v&&v(),a.cancelToken&&a.cancelToken.unsubscribe(u),a.signal&&a.signal.removeEventListener("abort",u)}let g=new XMLHttpRequest;g.open(a.method.toUpperCase(),a.url,!0),g.timeout=a.timeout;function m(){if(!g)return;const w=I.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders()),P={data:!i||i==="text"||i==="json"?g.responseText:g.response,status:g.status,statusText:g.statusText,headers:w,config:e,request:g};sr(function($){n($),N()},function($){r($),N()},P),g=null}"onloadend"in g?g.onloadend=m:g.onreadystatechange=function(){!g||g.readyState!==4||g.status===0&&!(g.responseURL&&g.responseURL.startsWith("file:"))||setTimeout(m)},g.onabort=function(){g&&(r(new _("Request aborted",_.ECONNABORTED,e,g)),N(),g=null)},g.onerror=function(C){const P=C&&C.message?C.message:"Network Error",T=new _(P,_.ERR_NETWORK,e,g);T.event=C||null,r(T),N(),g=null},g.ontimeout=function(){let C=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const P=a.transitional||Ht;a.timeoutErrorMessage&&(C=a.timeoutErrorMessage),r(new _(C,P.clarifyTimeoutError?_.ETIMEDOUT:_.ECONNABORTED,e,g)),N(),g=null},o===void 0&&s.setContentType(null),"setRequestHeader"in g&&h.forEach(Jn(s),function(C,P){g.setRequestHeader(P,C)}),h.isUndefined(a.withCredentials)||(g.withCredentials=!!a.withCredentials),i&&i!=="json"&&(g.responseType=a.responseType),f&&([p,v]=ht(f,!0),g.addEventListener("progress",p)),c&&g.upload&&([d,E]=ht(c),g.upload.addEventListener("progress",d),g.upload.addEventListener("loadend",E)),(a.cancelToken||a.signal)&&(u=w=>{g&&(r(!w||w.type?new Je(null,e,g):w),g.abort(),N(),g=null)},a.cancelToken&&a.cancelToken.subscribe(u),a.signal&&(a.signal.aborted?u():a.signal.addEventListener("abort",u)));const y=mi(a.url);if(y&&!L.protocols.includes(y)){r(new _("Unsupported protocol "+y+":",_.ERR_BAD_REQUEST,e)),N();return}g.send(o||null)})},ki=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const n=new AbortController;let r=!1;const a=function(c){if(!r){r=!0,s();const f=c instanceof Error?c:this.reason;n.abort(f instanceof _?f:new Je(f instanceof Error?f.message:f))}};let o=t&&setTimeout(()=>{o=null,a(new _(`timeout of ${t}ms exceeded`,_.ETIMEDOUT))},t);const s=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(a):c.removeEventListener("abort",a)}),e=null)};e.forEach(c=>{if(!r){if(c.aborted){a.call(c);return}c.addEventListener("abort",a,{once:!0})}});const{signal:i}=n;return i.unsubscribe=()=>h.asap(s),i},Li=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,a;for(;r<n;)a=r+t,yield e.slice(r,a),r=a},Bi=async function*(e,t){for await(const n of Ui(e))yield*Li(n,t)},Ui=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},hr=(e,t,n,r)=>{const a=Bi(e,t);let o=0,s,i=c=>{s||(s=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:f,value:u}=await a.next();if(f){i(),c.close();return}let d=u.byteLength;if(n){let p=o+=d;n(p)}c.enqueue(new Uint8Array(u))}catch(f){throw i(f),f}},cancel(c){return i(c),a.return()}},{highWaterMark:2})},pr=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,mr=(e,t,n)=>t+2<n&&pr(e.charCodeAt(t+1))&&pr(e.charCodeAt(t+2)),gr=e=>e<=57?e-48:(e&223)-55,Ri=e=>e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===43||e===47||e===45||e===95,Ii=e=>e===9||e===10||e===12||e===13||e===32,Mi=e=>{const t=Math.floor(e/4),n=e%4;return t*3+(n===2?1:n===3?2:0)},ji=e=>{const t=e.length;let n=0;return t>0&&e.charCodeAt(t-1)===61&&(n++,t>1&&e.charCodeAt(t-2)===61&&n++),Math.floor((t-n)*3/4)},$i=e=>{const t=e.length;let n=0,r=0,a=!1;for(let o=0;o<t;o++){let s=e.charCodeAt(o);if(s===37&&mr(e,o,t)&&(s=gr(e.charCodeAt(o+1))*16+gr(e.charCodeAt(o+2)),o+=2),!Ii(s)){if(s===61){r++;continue}if(!Ri(s)||r>0){a=!0;continue}n++}}return a||r>2||r>0&&(n+r)%4!==0||n%4===1?ji(e):Mi(n)},Vi=(e,t)=>{if(!e||typeof e!="string"||!e.startsWith("data:"))return 0;const n=e.indexOf(",");if(n<0)return 0;const r=e.slice(5,n),a=e.slice(n+1);if(/;base64/i.test(r))return t(a);let s=0;for(let i=0,c=a.length;i<c;i++){const f=a.charCodeAt(i);if(f===37&&mr(a,i,c))s+=1,i+=2;else if(f<128)s+=1;else if(f<2048)s+=2;else if(f>=55296&&f<=56319&&i+1<c){const u=a.charCodeAt(i+1);u>=56320&&u<=57343?(s+=4,i++):s+=3}else s+=3}return s};function Hi(e){const t=typeof e=="string"?e.indexOf("#"):-1;return Vi(t===-1?e:e.slice(0,t),$i)}const Jt="1.19.0",yr=64*1024,{isFunction:pt}=h,zi=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,n)=>String.fromCharCode(parseInt(n,16))),br=e=>{if(!h.isString(e))return e;try{return decodeURIComponent(e)}catch{return e}},vr=(e,...t)=>{try{return!!e(...t)}catch{return!1}},qi=e=>{const t=e.indexOf("://");let n=e;return t!==-1&&(n=n.slice(t+3)),n.includes("@")||n.includes(":")},Wi=e=>{const t=h.global!==void 0&&h.global!==null?h.global:globalThis,{ReadableStream:n,TextEncoder:r}=t;e=h.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:a,Request:o,Response:s}=e,i=a?pt(a):typeof fetch=="function",c=pt(o),f=pt(s);if(!i)return!1;const u=i&&pt(n),d=i&&(typeof r=="function"?(m=>y=>m.encode(y))(new r):async m=>new Uint8Array(await new o(m).arrayBuffer())),p=c&&u&&vr(()=>{let m=!1;const y=new o(L.origin,{body:new n,method:"POST",get duplex(){return m=!0,"half"}}),w=y.headers.has("Content-Type");return y.body!=null&&y.body.cancel(),m&&!w}),E=f&&u&&vr(()=>h.isReadableStream(new s("").body)),v={stream:E&&(m=>m.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(m=>{!v[m]&&(v[m]=(y,w)=>{let C=y&&y[m];if(C)return C.call(y);throw new _(`Response type '${m}' is not supported`,_.ERR_NOT_SUPPORT,w)})});const N=async m=>{if(m==null)return 0;if(h.isBlob(m))return m.size;if(h.isSpecCompliantForm(m))return(await new o(L.origin,{method:"POST",body:m}).arrayBuffer()).byteLength;if(h.isArrayBufferView(m)||h.isArrayBuffer(m))return m.byteLength;if(h.isURLSearchParams(m)&&(m=m+""),h.isString(m))return(await d(m)).byteLength},g=async(m,y)=>{const w=h.toFiniteNumber(m.getContentLength());return w??N(y)};return async m=>{let{url:y,method:w,data:C,signal:P,cancelToken:T,timeout:$,onDownloadProgress:Z,onUploadProgress:B,responseType:D,headers:U,withCredentials:De="same-origin",fetchOptions:ba,maxContentLength:G,maxBodyLength:Et}=fr(m);const Ye=h.isNumber(G)&&G>-1,un=h.isNumber(Et)&&Et>-1,Fl=A=>h.hasOwnProp(m,A)?m[A]:void 0;let va=a||fetch;D=D?(D+"").toLowerCase():"text";let ce=ki([P,T&&T.toAbortSignal()],$),R=null;const we=ce&&ce.unsubscribe&&(()=>{ce.unsubscribe()});let ke,Qe=null;const wa=()=>new _("Request body larger than maxBodyLength limit",_.ERR_BAD_REQUEST,m,R);try{let A;const q=Fl("auth");if(q){const O=h.getSafeProp(q,"username")||"",V=h.getSafeProp(q,"password")||"";A={username:O,password:V}}if(qi(y)){const O=new URL(y,L.origin);if(!A&&(O.username||O.password)){const V=br(O.username),de=br(O.password);A={username:V,password:de}}(O.username||O.password)&&(O.username="",O.password="",y=O.href)}if(A&&(U.delete("authorization"),U.set("Authorization","Basic "+btoa(zi((A.username||"")+":"+(A.password||""))))),Ye&&typeof y=="string"&&y.startsWith("data:")&&Hi(y)>G)throw new _("maxContentLength size of "+G+" exceeded",_.ERR_BAD_RESPONSE,m,R);if(un&&w!=="get"&&w!=="head"){const O=await N(C);if(typeof O=="number"&&isFinite(O)&&(ke=O,O>Et))throw wa()}const St=un&&(h.isReadableStream(C)||h.isStream(C)),Ea=(O,V,de)=>hr(O,yr,Ee=>{if(un&&Ee>Et)throw Qe=wa();V&&V(Ee)},de);if(p&&w!=="get"&&w!=="head"&&(B||St)){if(ke=ke??await g(U,C),ke!==0||St){let O=new o(y,{method:"POST",body:C,duplex:"half"}),V;if(h.isFormData(C)&&(V=O.headers.get("content-type"))&&U.setContentType(V),O.body){const[de,Ee]=B&&ir(ke,ht(lr(B)))||[];C=Ea(O.body,de,Ee)}}}else if(St&&!c&&u&&w!=="get"&&w!=="head")C=Ea(C);else if(St&&c&&!p&&w!=="get"&&w!=="head")throw new _("Stream request bodies are not supported by the current fetch implementation",_.ERR_NOT_SUPPORT,m,R);h.isString(De)||(De=De?"include":"omit");const Dl=c&&"credentials"in o.prototype;if(h.isFormData(C)){const O=U.getContentType();O&&/^multipart\/form-data/i.test(O)&&!/boundary=/i.test(O)&&U.delete("content-type")}U.set("User-Agent","axios/"+Jt,!1);const Sa={...ba,signal:ce,method:w.toUpperCase(),headers:Jn(U.normalize()),body:C,duplex:"half",credentials:Dl?De:void 0};R=c&&new o(y,Sa);let ee=await(c?va(R,ba):va(y,Sa));const _a=I.from(ee.headers);if(Ye){const O=h.toFiniteNumber(_a.getContentLength());if(O!=null&&O>G)throw new _("maxContentLength size of "+G+" exceeded",_.ERR_BAD_RESPONSE,m,R)}const fn=E&&(D==="stream"||D==="response");if(E&&ee.body&&(Z||Ye||fn&&we)){const O={};["status","statusText","headers"].forEach(Ze=>{O[Ze]=ee[Ze]});const V=h.toFiniteNumber(_a.getContentLength()),[de,Ee]=Z&&ir(V,ht(lr(Z),!0))||[];let Na=0;const kl=Ze=>{if(Ye&&(Na=Ze,Na>G))throw new _("maxContentLength size of "+G+" exceeded",_.ERR_BAD_RESPONSE,m,R);de&&de(Ze)};ee=new s(hr(ee.body,yr,kl,()=>{Ee&&Ee(),we&&we()}),O)}D=D||"text";let te=await v[h.findKey(v,D)||"text"](ee,m);if(Ye&&!E&&!fn){let O;if(te!=null&&(typeof te.byteLength=="number"?O=te.byteLength:typeof te.size=="number"?O=te.size:typeof te=="string"&&(O=typeof r=="function"?new r().encode(te).byteLength:te.length)),typeof O=="number"&&O>G)throw new _("maxContentLength size of "+G+" exceeded",_.ERR_BAD_RESPONSE,m,R)}return!fn&&we&&we(),await new Promise((O,V)=>{sr(O,V,{data:te,headers:I.from(ee.headers),status:ee.status,statusText:ee.statusText,config:m,request:R})})}catch(A){if(we&&we(),ce&&ce.aborted&&ce.reason instanceof _){const q=ce.reason;throw q.config=m,R&&(q.request=R),A!==q&&Object.defineProperty(q,"cause",{__proto__:null,value:A,writable:!0,enumerable:!1,configurable:!0}),q}if(Qe)throw R&&!Qe.request&&(Qe.request=R),Qe;if(A instanceof _)throw R&&!A.request&&(A.request=R),A;if(A&&A.name==="TypeError"&&/Load failed|fetch/i.test(A.message)){const q=new _("Network Error",_.ERR_NETWORK,m,R,A&&A.response);throw Object.defineProperty(q,"cause",{__proto__:null,value:A.cause||A,writable:!0,enumerable:!1,configurable:!0}),q}throw _.from(A,A&&A.code,m,R,A&&A.response)}}},Ji=new Map,wr=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:a}=t,o=[r,a,n];let s=o.length,i=s,c,f,u=Ji;for(;i--;)c=o[i],f=u.get(c),f===void 0&&u.set(c,f=i?new Map:Wi(t)),u=f;return f};wr();const Kt={http:ri,xhr:Di,fetch:{get:wr}};h.forEach(Kt,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const Er=e=>`- ${e}`,Ki=e=>h.isFunction(e)||e===null||e===!1;function Xi(e,t){e=h.isArray(e)?e:[e];const{length:n}=e;let r,a;const o={};for(let s=0;s<n;s++){r=e[s];let i;if(a=r,!Ki(r)&&(a=Kt[(i=String(r)).toLowerCase()],a===void 0))throw new _(`Unknown adapter '${i}'`);if(a&&(h.isFunction(a)||(a=a.get(t))))break;o[i||"#"+s]=a}if(!a){const s=Object.entries(o).map(([c,f])=>`adapter ${c} `+(f===!1?"is not supported by the environment":"is not available in the build"));let i=n?s.length>1?`since :
6
- `+s.map(Er).join(`
7
- `):" "+Er(s[0]):"as no adapter specified";throw new _("There is no suitable adapter to dispatch the request "+i,_.ERR_NOT_SUPPORT)}return a}const Sr={getAdapter:Xi,adapters:Kt};function Xt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Je(null,e)}function Gt(e){return Xt(e),e.headers=I.from(e.headers),e.data=Wt.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Sr.getAdapter(e.adapter||We.adapter,e)(e).then(function(r){Xt(e),e.response=r;try{r.data=Wt.call(e,e.transformResponse,r)}finally{delete e.response}return r.headers=I.from(r.headers),r},function(r){if(!or(r)&&(Xt(e),r&&r.response)){e.response=r.response;try{r.response.data=Wt.call(e,e.transformResponse,r.response)}finally{delete e.response}r.response.headers=I.from(r.response.headers)}return Promise.reject(r)})}const mt={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{mt[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const _r={};mt.transitional=function(t,n,r){function a(o,s){return"[Axios v"+Jt+"] Transitional option '"+o+"'"+s+(r?". "+r:"")}return(o,s,i)=>{if(t===!1)throw new _(a(s," has been removed"+(n?" in "+n:"")),_.ERR_DEPRECATED);return n&&!_r[s]&&(_r[s]=!0,console.warn(a(s," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,s,i):!0}},mt.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Gi(e,t,n){if(typeof e!="object"||e===null)throw new _("options must be an object",_.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let a=r.length;for(;a-- >0;){const o=r[a],s=Object.prototype.hasOwnProperty.call(t,o)?t[o]:void 0;if(s){const i=e[o],c=i===void 0||s(i,o,e);if(c!==!0)throw new _("option "+o+" must be "+c,_.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new _("Unknown option "+o,_.ERR_BAD_OPTION)}}const gt={assertOptions:Gi,validators:mt},M=gt.validators;let ge=class{constructor(t){this.defaults=t||{},this.interceptors={request:new tr,response:new tr}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let a={};Error.captureStackTrace?Error.captureStackTrace(a):a=new Error;const o=(()=>{if(!a.stack)return"";const s=a.stack.indexOf(`
3
+ `+('Please change the parent <Route path="'+w+'"> to <Route ')+('path="'+(w==="/"?"*":w+"/*")+'">.'))}let d=he(),h;if(t){var E;let w=typeof t=="string"?Fe(t):t;f==="/"||(E=w.pathname)!=null&&E.startsWith(f)||(process.env.NODE_ENV!=="production"?T(!1,"When overriding the location using `<Routes location>` or `useRoutes(routes, location)`, the location pathname must begin with the portion of the URL pathname that was "+('matched by all parent routes. The current pathname base is "'+f+'" ')+('but pathname "'+w.pathname+'" was given in the `location` prop.')):T(!1)),h=w}else h=d;let v=h.pathname||"/",_=v;if(f!=="/"){let w=f.replace(/^\//,"").split("/");_="/"+v.replace(/^\//,"").split("/").slice(w.length).join("/")}let y=no(e,{pathname:_});process.env.NODE_ENV!=="production"&&(process.env.NODE_ENV!=="production"&&V(u||y!=null,'No routes matched location "'+h.pathname+h.search+h.hash+'" '),process.env.NODE_ENV!=="production"&&V(y==null||y[y.length-1].route.element!==void 0||y[y.length-1].route.Component!==void 0||y[y.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.'));let m=Io(y&&y.map(w=>Object.assign({},w,{params:Object.assign({},i,w.params),pathname:Z([f,a.encodeLocation?a.encodeLocation(w.pathname).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?f:Z([f,a.encodeLocation?a.encodeLocation(w.pathnameBase).pathname:w.pathnameBase])})),o,n,r);return t&&m?b.createElement(Je.Provider,{value:{location:He({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:oe.Pop}},m):m}function Fo(){let e=$o(),t=_o(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},s=null;return process.env.NODE_ENV!=="production"&&(console.error("Error handled by React Router default ErrorBoundary:",e),s=b.createElement(b.Fragment,null,b.createElement("p",null,"πŸ’Ώ Hey developer πŸ‘‹"),b.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",b.createElement("code",{style:o},"ErrorBoundary")," or"," ",b.createElement("code",{style:o},"errorElement")," prop on your route."))),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},t),n?b.createElement("pre",{style:a},n):null,s)}const ko=b.createElement(Fo,null);class Lo extends b.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?b.createElement(K.Provider,{value:this.props.routeContext},b.createElement(qt.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Bo(e){let{routeContext:t,match:n,children:r}=e,a=b.useContext(qe);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),b.createElement(K.Provider,{value:t},r)}function Io(e,t,n,r){var a;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var o;if(!n)return null;if(n.errors)e=n.matches;else if((o=r)!=null&&o.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let s=e,i=(a=n)==null?void 0:a.errors;if(i!=null){let u=s.findIndex(d=>d.route.id&&i?.[d.route.id]!==void 0);u>=0||(process.env.NODE_ENV!=="production"?T(!1,"Could not find a matching route for errors on route IDs: "+Object.keys(i).join(",")):T(!1)),s=s.slice(0,Math.min(s.length,u+1))}let c=!1,f=-1;if(n&&r&&r.v7_partialHydration)for(let u=0;u<s.length;u++){let d=s[u];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(f=u),d.route.id){let{loaderData:h,errors:E}=n,v=d.route.loader&&h[d.route.id]===void 0&&(!E||E[d.route.id]===void 0);if(d.route.lazy||v){c=!0,f>=0?s=s.slice(0,f+1):s=[s[0]];break}}}return s.reduceRight((u,d,h)=>{let E,v=!1,_=null,y=null;n&&(E=i&&d.route.id?i[d.route.id]:void 0,_=d.route.errorElement||ko,c&&(f<0&&h===0?(qn("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),v=!0,y=null):f===h&&(v=!0,y=d.route.hydrateFallbackElement||null)));let m=t.concat(s.slice(0,h+1)),w=()=>{let S;return E?S=_:v?S=y:d.route.Component?S=b.createElement(d.route.Component,null):d.route.element?S=d.route.element:S=u,b.createElement(Bo,{match:d,routeContext:{outlet:u,matches:m,isDataRoute:n!=null},children:S})};return n&&(d.route.ErrorBoundary||d.route.errorElement||h===0)?b.createElement(Lo,{location:n.location,revalidation:n.revalidation,component:_,error:E,children:w(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):w()},null)}var zn=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(zn||{}),Ge=(function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e})(Ge||{});function Jt(e){return e+" must be used within a data router. See https://reactrouter.com/v6/routers/picking-a-router."}function Ro(e){let t=b.useContext(qe);return t||(process.env.NODE_ENV!=="production"?T(!1,Jt(e)):T(!1)),t}function Uo(e){let t=b.useContext(Ht);return t||(process.env.NODE_ENV!=="production"?T(!1,Jt(e)):T(!1)),t}function Mo(e){let t=b.useContext(K);return t||(process.env.NODE_ENV!=="production"?T(!1,Jt(e)):T(!1)),t}function Kt(e){let t=Mo(e),n=t.matches[t.matches.length-1];return n.route.id||(process.env.NODE_ENV!=="production"?T(!1,e+' can only be used on routes that contain a unique "id"'):T(!1)),n.route.id}function jo(){return Kt(Ge.UseRouteId)}function $o(){var e;let t=b.useContext(qt),n=Uo(Ge.UseRouteError),r=Kt(Ge.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function Wo(){let{router:e}=Ro(zn.UseNavigateStable),t=Kt(Ge.UseNavigateStable),n=b.useRef(!1);return Vn(()=>{n.current=!0}),b.useCallback(function(a,o){o===void 0&&(o={}),process.env.NODE_ENV!=="production"&&V(n.current,Wn),n.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,He({fromRouteId:t},o)))},[e,t])}const Hn={};function qn(e,t,n){!t&&!Hn[e]&&(Hn[e]=!0,process.env.NODE_ENV!=="production"&&V(!1,n))}const Jn={};function Vo(e,t){process.env.NODE_ENV!=="production"&&!Jn[t]&&(Jn[t]=!0,console.warn(t))}const Kn=(e,t,n)=>Vo(e,"⚠️ React Router Future Flag Warning: "+t+". "+("You can use the `"+e+"` future flag to opt-in early. ")+("For more information, see "+n+"."));function zo(e,t){e?.v7_startTransition===void 0&&Kn("v7_startTransition","React Router will begin wrapping state updates in `React.startTransition` in v7","https://reactrouter.com/v6/upgrading/future#v7_starttransition"),e?.v7_relativeSplatPath===void 0&&Kn("v7_relativeSplatPath","Relative route resolution within Splat routes is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath")}function ht(e){process.env.NODE_ENV!=="production"?T(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>."):T(!1)}function Ho(e){let{basename:t="/",children:n=null,location:r,navigationType:a=oe.Pop,navigator:o,static:s=!1,future:i}=e;Ke()&&(process.env.NODE_ENV!=="production"?T(!1,"You cannot render a <Router> inside another <Router>. You should never have more than one in your app."):T(!1));let c=t.replace(/^\/*/,"/"),f=b.useMemo(()=>({basename:c,navigator:o,static:s,future:He({v7_relativeSplatPath:!1},i)}),[c,i,o,s]);typeof r=="string"&&(r=Fe(r));let{pathname:u="/",search:d="",hash:h="",state:E=null,key:v="default"}=r,_=b.useMemo(()=>{let y=se(u,c);return y==null?null:{location:{pathname:y,search:d,hash:h,state:E,key:v},navigationType:a}},[c,u,d,h,E,v,a]);return process.env.NODE_ENV!=="production"&&V(_!=null,'<Router basename="'+c+'"> is not able to match the URL '+('"'+u+d+h+'" because it does not start with the ')+"basename, so the <Router> won't render anything."),_==null?null:b.createElement(q.Provider,{value:f},b.createElement(Je.Provider,{children:n,value:_}))}function qo(e){let{children:t,location:n}=e;return xo(Xt(t),n)}new Promise(()=>{});function Xt(e,t){t===void 0&&(t=[]);let n=[];return b.Children.forEach(e,(r,a)=>{if(!b.isValidElement(r))return;let o=[...t,a];if(r.type===b.Fragment){n.push.apply(n,Xt(r.props.children,o));return}r.type!==ht&&(process.env.NODE_ENV!=="production"?T(!1,"["+(typeof r.type=="string"?r.type:r.type.name)+"] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>"):T(!1)),!r.props.index||!r.props.children||(process.env.NODE_ENV!=="production"?T(!1,"An index route cannot have child routes."):T(!1));let s={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(s.children=Xt(r.props.children,o)),n.push(s)}),n}function ke(){return ke=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ke.apply(null,arguments)}function Gt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}const mt="get",gt="application/x-www-form-urlencoded";function yt(e){return e!=null&&typeof e.tagName=="string"}function Jo(e){return yt(e)&&e.tagName.toLowerCase()==="button"}function Ko(e){return yt(e)&&e.tagName.toLowerCase()==="form"}function Xo(e){return yt(e)&&e.tagName.toLowerCase()==="input"}function Go(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Yo(e,t){return e.button===0&&(!t||t==="_self")&&!Go(e)}function Yt(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(a=>[n,a]):[[n,r]])},[]))}function Qo(e,t){let n=Yt(e);return t&&t.forEach((r,a)=>{n.has(a)||t.getAll(a).forEach(o=>{n.append(a,o)})}),n}let wt=null;function Zo(){if(wt===null)try{new FormData(document.createElement("form"),0),wt=!1}catch{wt=!0}return wt}const es=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Qt(e){return e!=null&&!es.has(e)?(process.env.NODE_ENV!=="production"&&V(!1,'"'+e+'" is not a valid `encType` for `<Form>`/`<fetcher.Form>` '+('and will default to "'+gt+'"')),null):e}function ts(e,t){let n,r,a,o,s;if(Ko(e)){let i=e.getAttribute("action");r=i?se(i,t):null,n=e.getAttribute("method")||mt,a=Qt(e.getAttribute("enctype"))||gt,o=new FormData(e)}else if(Jo(e)||Xo(e)&&(e.type==="submit"||e.type==="image")){let i=e.form;if(i==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let c=e.getAttribute("formaction")||i.getAttribute("action");if(r=c?se(c,t):null,n=e.getAttribute("formmethod")||i.getAttribute("method")||mt,a=Qt(e.getAttribute("formenctype"))||Qt(i.getAttribute("enctype"))||gt,o=new FormData(i,e),!Zo()){let{name:f,type:u,value:d}=e;if(u==="image"){let h=f?f+".":"";o.append(h+"x","0"),o.append(h+"y","0")}else f&&o.append(f,d)}}else{if(yt(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=mt,r=null,a=gt,s=e}return o&&a==="text/plain"&&(s=o,o=void 0),{action:r,method:n.toLowerCase(),encType:a,formData:o,body:s}}const ns=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],rs=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],as=["fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","viewTransition"],os="6";try{window.__reactRouterVersion=os}catch{}const Xn=b.createContext({isTransitioning:!1});process.env.NODE_ENV!=="production"&&(Xn.displayName="ViewTransition");const ss=b.createContext(new Map);process.env.NODE_ENV!=="production"&&(ss.displayName="Fetchers");const Gn=b["startTransition"];function is(e){let{basename:t,children:n,future:r,window:a}=e,o=b.useRef();o.current==null&&(o.current=Za({window:a,v5Compat:!0}));let s=o.current,[i,c]=b.useState({action:s.action,location:s.location}),{v7_startTransition:f}=r||{},u=b.useCallback(d=>{f&&Gn?Gn(()=>c(d)):c(d)},[c,f]);return b.useLayoutEffect(()=>s.listen(u),[s,u]),b.useEffect(()=>zo(r),[r]),b.createElement(Ho,{basename:t,children:n,location:i.location,navigationType:i.action,navigator:s,future:r})}process.env.NODE_ENV;const ls=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",cs=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Yn=b.forwardRef(function(t,n){let{onClick:r,relative:a,reloadDocument:o,replace:s,state:i,target:c,to:f,preventScrollReset:u,viewTransition:d}=t,h=Gt(t,ns),{basename:E}=b.useContext(q),v,_=!1;if(typeof f=="string"&&cs.test(f)&&(v=f,ls))try{let S=new URL(window.location.href),N=f.startsWith("//")?new URL(S.protocol+f):new URL(f),x=se(N.pathname,E);N.origin===S.origin&&x!=null?f=x+N.search+N.hash:_=!0}catch{process.env.NODE_ENV!=="production"&&V(!1,'<Link to="'+f+'"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.')}let y=To(f,{relative:a}),m=ps(f,{replace:s,state:i,target:c,preventScrollReset:u,relative:a,viewTransition:d});function w(S){r&&r(S),S.defaultPrevented||m(S)}return b.createElement("a",ke({},h,{href:v||y,onClick:_||o?r:w,ref:n,target:c}))});process.env.NODE_ENV!=="production"&&(Yn.displayName="Link");const ds=b.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:a=!1,className:o="",end:s=!1,style:i,to:c,viewTransition:f,children:u}=t,d=Gt(t,rs),h=Xe(c,{relative:d.relative}),E=he(),v=b.useContext(Ht),{navigator:_,basename:y}=b.useContext(q),m=v!=null&&vs(h)&&f===!0,w=_.encodeLocation?_.encodeLocation(h).pathname:h.pathname,S=E.pathname,N=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;a||(S=S.toLowerCase(),N=N?N.toLowerCase():null,w=w.toLowerCase()),N&&y&&(N=se(N,y)||N);const x=w!=="/"&&w.endsWith("/")?w.length-1:w.length;let A=S===w||!s&&S.startsWith(w)&&S.charAt(x)==="/",$=N!=null&&(N===w||!s&&N.startsWith(w)&&N.charAt(w.length)==="/"),ne={isActive:A,isPending:$,isTransitioning:m},Pe=A?r:void 0,F;typeof o=="function"?F=o(ne):F=[o,A?"active":null,$?"pending":null,m?"transitioning":null].filter(Boolean).join(" ");let L=typeof i=="function"?i(ne):i;return b.createElement(Yn,ke({},d,{"aria-current":Pe,className:F,ref:n,style:L,to:c,viewTransition:f}),typeof u=="function"?u(ne):u)});process.env.NODE_ENV!=="production"&&(ds.displayName="NavLink");const us=b.forwardRef((e,t)=>{let{fetcherKey:n,navigate:r,reloadDocument:a,replace:o,state:s,method:i=mt,action:c,onSubmit:f,relative:u,preventScrollReset:d,viewTransition:h}=e,E=Gt(e,as),v=ws(),_=bs(c,{relative:u}),y=i.toLowerCase()==="get"?"get":"post",m=w=>{if(f&&f(w),w.defaultPrevented)return;w.preventDefault();let S=w.nativeEvent.submitter,N=S?.getAttribute("formmethod")||i;v(S||w.currentTarget,{fetcherKey:n,method:N,navigate:r,replace:o,state:s,relative:u,preventScrollReset:d,viewTransition:h})};return b.createElement("form",ke({ref:t,method:y,action:_,onSubmit:a?f:m},E))});process.env.NODE_ENV!=="production"&&(us.displayName="Form"),process.env.NODE_ENV;var bt;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(bt||(bt={}));var Qn;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Qn||(Qn={}));function fs(e){return e+" must be used within a data router. See https://reactrouter.com/v6/routers/picking-a-router."}function Zn(e){let t=b.useContext(qe);return t||(process.env.NODE_ENV!=="production"?T(!1,fs(e)):T(!1)),t}function ps(e,t){let{target:n,replace:r,state:a,preventScrollReset:o,relative:s,viewTransition:i}=t===void 0?{}:t,c=pt(),f=he(),u=Xe(e,{relative:s});return b.useCallback(d=>{if(Yo(d,n)){d.preventDefault();let h=r!==void 0?r:ze(f)===ze(u);c(e,{replace:h,state:a,preventScrollReset:o,relative:s,viewTransition:i})}},[f,c,u,r,a,n,e,o,s,i])}function hs(e){process.env.NODE_ENV!=="production"&&V(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=b.useRef(Yt(e)),n=b.useRef(!1),r=he(),a=b.useMemo(()=>Qo(r.search,n.current?null:t.current),[r.search]),o=pt(),s=b.useCallback((i,c)=>{const f=Yt(typeof i=="function"?i(a):i);n.current=!0,o("?"+f,c)},[o,a]);return[a,s]}function ms(){if(typeof document>"u")throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}let gs=0,ys=()=>"__"+String(++gs)+"__";function ws(){let{router:e}=Zn(bt.UseSubmit),{basename:t}=b.useContext(q),n=jo();return b.useCallback(function(r,a){a===void 0&&(a={}),ms();let{action:o,method:s,encType:i,formData:c,body:f}=ts(r,t);if(a.navigate===!1){let u=a.fetcherKey||ys();e.fetch(u,n,a.action||o,{preventScrollReset:a.preventScrollReset,formData:c,body:f,formMethod:a.method||s,formEncType:a.encType||i,flushSync:a.flushSync})}else e.navigate(a.action||o,{preventScrollReset:a.preventScrollReset,formData:c,body:f,formMethod:a.method||s,formEncType:a.encType||i,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[e,t,n])}function bs(e,t){let{relative:n}=t===void 0?{}:t,{basename:r}=b.useContext(q),a=b.useContext(K);a||(process.env.NODE_ENV!=="production"?T(!1,"useFormAction must be used inside a RouteContext"):T(!1));let[o]=a.matches.slice(-1),s=ke({},Xe(e||".",{relative:n})),i=he();if(e==null){s.search=i.search;let c=new URLSearchParams(s.search),f=c.getAll("index");if(f.some(d=>d==="")){c.delete("index"),f.filter(h=>h).forEach(h=>c.append("index",h));let d=c.toString();s.search=d?"?"+d:""}}return(!e||e===".")&&o.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(s.pathname=s.pathname==="/"?r:Z([r,s.pathname])),ze(s)}function vs(e,t){t===void 0&&(t={});let n=b.useContext(Xn);n==null&&(process.env.NODE_ENV!=="production"?T(!1,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"):T(!1));let{basename:r}=Zn(bt.useViewTransitionState),a=Xe(e,{relative:t.relative});if(!n.isTransitioning)return!1;let o=se(n.currentLocation.pathname,r)||n.currentLocation.pathname,s=se(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Vt(a.pathname,s)!=null||Vt(a.pathname,o)!=null}function er(e,t){return function(){return e.apply(t,arguments)}}const{toString:Ss}=Object.prototype,{getPrototypeOf:Le}=Object,{iterator:Ye,toStringTag:tr}=Symbol,vt=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Qe=(e,t)=>{let n=e;const r=[];for(;n!=null&&n!==Object.prototype;){if(r.indexOf(n)!==-1)return!1;if(r.push(n),vt(n,t))return!0;n=Le(n)}return!1},Es=(e,t)=>e!=null&&Qe(e,t)?e[t]:void 0,Zt=(e=>t=>{const n=Ss.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),z=e=>(e=e.toLowerCase(),t=>Zt(t)===e),St=e=>t=>typeof t===e,{isArray:me}=Array,ge=St("undefined");function Be(e){return e!==null&&!ge(e)&&e.constructor!==null&&!ge(e.constructor)&&M(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const nr=z("ArrayBuffer");function Cs(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&nr(e.buffer),t}const _s=St("string"),M=St("function"),rr=St("number"),Ie=e=>e!==null&&typeof e=="object",Ns=e=>e===!0||e===!1,Et=e=>{if(!Ie(e))return!1;const t=Le(e);return(t===null||t===Object.prototype||Le(t)===null)&&!Qe(e,tr)&&!Qe(e,Ye)},Os=e=>{if(!Ie(e)||Be(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Ts=z("Date"),As=z("File"),Ps=e=>!!(e&&typeof e.uri<"u"),xs=e=>e&&typeof e.getParts<"u",Ds=z("Blob"),Fs=z("FileList"),ks=z("Set"),Ls=e=>Ie(e)&&M(e.pipe);function Bs(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const ar=Bs(),or=typeof ar.FormData<"u"?ar.FormData:void 0,Is=e=>{if(!e)return!1;if(or&&e instanceof or)return!0;const t=Le(e);if(!t||t===Object.prototype||!M(e.append))return!1;const n=Zt(e);return n==="formdata"||n==="object"&&M(e.toString)&&e.toString()==="[object FormData]"},Rs=z("URLSearchParams"),[Us,Ms,js,$s]=["ReadableStream","Request","Response","Headers"].map(z),Ws=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ze(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,a;if(typeof e!="object"&&(e=[e]),me(e))for(r=0,a=e.length;r<a;r++)t.call(null,e[r],r,e);else{if(Be(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let i;for(r=0;r<s;r++)i=o[r],t.call(null,e[i],i,e)}}function sr(e,t){if(Be(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,a;for(;r-- >0;)if(a=n[r],t===a.toLowerCase())return a;return null}const ye=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ir=e=>!ge(e)&&e!==ye;function en(...e){const{caseless:t,skipUndefined:n}=ir(this)&&this||{},r={},a=(o,s)=>{if(s==="__proto__"||s==="constructor"||s==="prototype")return;const i=t&&typeof s=="string"&&sr(r,s)||s,c=vt(r,i)?r[i]:void 0;Et(c)&&Et(o)?r[i]=en(c,o):Et(o)?r[i]=en({},o):me(o)?r[i]=o.slice():(!n||!ge(o))&&(r[i]=o)};for(let o=0,s=e.length;o<s;o++){const i=e[o];if(!i||Be(i)||(Ze(i,a),typeof i!="object"||me(i)))continue;const c=Object.getOwnPropertySymbols(i);for(let f=0;f<c.length;f++){const u=c[f];ei.call(i,u)&&a(i[u],u)}}return r}const Vs=(e,t,n,{allOwnKeys:r}={})=>(Ze(t,(a,o)=>{n&&M(a)?Object.defineProperty(e,o,{__proto__:null,value:er(a,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,o,{__proto__:null,value:a,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),zs=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Hs=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},qs=(e,t,n,r)=>{let a,o,s;const i={};if(t=t||{},e==null)return t;do{for(a=Object.getOwnPropertyNames(e),o=a.length;o-- >0;)s=a[o],(!r||r(s,e,t))&&!i[s]&&(t[s]=e[s],i[s]=!0);e=n!==!1&&Le(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Js=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},Ks=e=>{if(!e)return null;if(me(e))return e;let t=e.length;if(!rr(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Xs=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Le(Uint8Array)),Gs=(e,t)=>{const r=(e&&e[Ye]).call(e);let a;for(;(a=r.next())&&!a.done;){const o=a.value;t.call(e,o[0],o[1])}},Ys=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Qs=z("HTMLFormElement"),Zs=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,a){return r.toUpperCase()+a}),{propertyIsEnumerable:ei}=Object.prototype,ti=z("RegExp"),lr=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Ze(n,(a,o)=>{let s;(s=t(a,o,e))!==!1&&(r[o]=s||a)}),Object.defineProperties(e,r)},ni=e=>{lr(e,(t,n)=>{if(M(e)&&["arguments","caller","callee"].includes(n))return!1;const r=e[n];if(M(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},ri=(e,t)=>{const n={},r=a=>{a.forEach(o=>{n[o]=!0})};return me(e)?r(e):r(String(e).split(t)),n},ai=()=>{},oi=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function si(e){return!!(e&&M(e.append)&&e[tr]==="FormData"&&e[Ye])}const ii=e=>{const t=new WeakSet,n=r=>{if(Ie(r)){if(t.has(r))return;if(Be(r))return r;if(!("toJSON"in r)){t.add(r);let a;if(ks(r)){a=[];for(const o of r){const s=n(o);!ge(s)&&a.push(s)}}else a=me(r)?[]:{},Ze(r,(o,s)=>{const i=n(o);!ge(i)&&(a[s]=i)});return t.delete(r),a}}return r};return n(e)},li=z("AsyncFunction"),ci=e=>e&&(Ie(e)||M(e))&&M(e.then)&&M(e.catch),cr=((e,t)=>e?setImmediate:t?((n,r)=>(ye.addEventListener("message",({source:a,data:o})=>{a===ye&&o===n&&r.length&&r.shift()()},!1),a=>{r.push(a),ye.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",M(ye.postMessage)),di=typeof queueMicrotask<"u"?queueMicrotask.bind(ye):typeof process<"u"&&process.nextTick||cr,dr=e=>e!=null&&M(e[Ye]),p={isArray:me,isArrayBuffer:nr,isBuffer:Be,isFormData:Is,isArrayBufferView:Cs,isString:_s,isNumber:rr,isBoolean:Ns,isObject:Ie,isPlainObject:Et,isEmptyObject:Os,isReadableStream:Us,isRequest:Ms,isResponse:js,isHeaders:$s,isUndefined:ge,isDate:Ts,isFile:As,isReactNativeBlob:Ps,isReactNative:xs,isBlob:Ds,isRegExp:ti,isFunction:M,isStream:Ls,isURLSearchParams:Rs,isTypedArray:Xs,isFileList:Fs,forEach:Ze,merge:en,extend:Vs,trim:Ws,stripBOM:zs,inherits:Hs,toFlatObject:qs,kindOf:Zt,kindOfTest:z,endsWith:Js,toArray:Ks,forEachEntry:Gs,matchAll:Ys,isHTMLForm:Qs,hasOwnProperty:vt,hasOwnProp:vt,hasOwnInPrototypeChain:Qe,getSafeProp:Es,reduceDescriptors:lr,freezeMethods:ni,toObjectSet:ri,toCamelCase:Zs,noop:ai,toFiniteNumber:oi,findKey:sr,global:ye,isContextDefined:ir,isSpecCompliantForm:si,toJSONObject:ii,isAsyncFn:li,isThenable:ci,setImmediate:cr,asap:di,isIterable:dr,isSafeIterable:e=>e!=null&&Qe(e,Ye)&&dr(e)},ui=p.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),fi=e=>{const t={};let n,r,a;return e&&e.split(`
4
+ `).forEach(function(s){a=s.indexOf(":"),n=s.substring(0,a).trim().toLowerCase(),r=s.substring(a+1).trim();const i=p.hasOwnProp(t,n);!n||i&&p.hasOwnProp(ui,n)||(n==="set-cookie"?i?t[n].push(r):t[n]=[r]:t[n]=i?t[n]+", "+r:r)}),t};function pi(e){let t=0,n=e.length;for(;t<n;){const r=e.charCodeAt(t);if(r!==9&&r!==32)break;t+=1}for(;n>t;){const r=e.charCodeAt(n-1);if(r!==9&&r!==32)break;n-=1}return t===0&&n===e.length?e:e.slice(t,n)}const hi=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),mi=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function tn(e,t){return p.isArray(e)?e.map(n=>tn(n,t)):pi(String(e).replace(t,""))}const gi=e=>tn(e,hi),yi=e=>tn(e,mi);function ur(e){const t=Object.create(null);return p.forEach(e.toJSON(),(n,r)=>{t[r]=yi(n)}),t}const fr=Symbol("internals");function et(e){return e&&String(e).trim().toLowerCase()}function Ct(e){return e===!1||e==null?e:p.isArray(e)?e.map(Ct):gi(String(e))}function wi(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const bi=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function nn(e){let t=0,n=e.length;for(;t<n;){const r=e.charCodeAt(t);if(r!==9&&r!==32)break;t+=1}for(;n>t;){const r=e.charCodeAt(n-1);if(r!==9&&r!==32)break;n-=1}return t===0&&n===e.length?e:e.slice(t,n)}function vi(e){const t=e.length-1;if(t<1||e.charCodeAt(0)!==34||e.charCodeAt(t)!==34)return e;let n="";for(let r=1;r<t;r++){const a=e.charCodeAt(r);if(a===34||a===92&&(r+=1,r>=t))return e;n+=e[r]}return n}function Si(e){const t=Object.create(null),n=String(e);let r=0,a=!1,o=!1;function s(i){const c=nn(n.slice(r,i)),f=c.indexOf("=");if(f<1)return;const u=nn(c.slice(0,f));if(!bi.test(u))return;const d=u.toLowerCase();if(d==="__proto__"||d==="constructor"||d==="prototype")return;const h=nn(c.slice(f+1));t[d]=vi(h)}for(let i=0;i<n.length;i++){const c=n.charCodeAt(i);a?o?o=!1:c===92?o=!0:c===34&&(a=!1):c===34?a=!0:(c===44||c===59)&&(s(i),r=i+1)}return s(n.length),t}const Ei=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function rn(e,t,n,r,a){if(p.isFunction(r))return r.call(this,t,n);if(a&&(t=n),!!p.isString(t)){if(p.isString(r))return t.indexOf(r)!==-1;if(p.isRegExp(r))return r.test(t)}}function Ci(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function _i(e,t){const n=p.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{__proto__:null,value:function(a,o,s){return this[r].call(this,t,a,o,s)},configurable:!0})})}let R=class{constructor(t){t&&this.set(t)}set(t,n,r){const a=this;function o(i,c,f){const u=et(c);if(!u)return;const d=p.findKey(a,u);(!d||a[d]===void 0||f===!0||f===void 0&&a[d]!==!1)&&(a[d||c]=Ct(i))}const s=(i,c)=>p.forEach(i,(f,u)=>o(f,u,c));if(p.isPlainObject(t)||t instanceof this.constructor)s(t,n);else if(p.isString(t)&&(t=t.trim())&&!Ei(t))s(fi(t),n);else if(p.isObject(t)&&p.isSafeIterable(t)){let i=Object.create(null),c,f;for(const u of t){if(!p.isArray(u))throw new TypeError("Object iterator must return a key-value pair");f=u[0],p.hasOwnProp(i,f)?(c=i[f],i[f]=p.isArray(c)?[...c,u[1]]:[c,u[1]]):i[f]=u[1]}s(i,n)}else t!=null&&o(n,t,r);return this}get(t,n){if(t=et(t),t){const r=p.findKey(this,t);if(r){const a=this[r];if(!n)return a;if(n===!0)return wi(a);if(p.isFunction(n))return n.call(this,a,r);if(p.isRegExp(n))return n.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=et(t),t){const r=p.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||rn(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let a=!1;function o(s){if(s=et(s),s){const i=p.findKey(r,s);i&&(!n||rn(r,r[i],i,n))&&(delete r[i],a=!0)}}return p.isArray(t)?t.forEach(o):o(t),a}clear(t){const n=Object.keys(this);let r=n.length,a=!1;for(;r--;){const o=n[r];(!t||rn(this,this[o],o,t,!0))&&(delete this[o],a=!0)}return a}normalize(t){const n=this,r={};return p.forEach(this,(a,o)=>{const s=p.findKey(r,o);if(s){n[s]=Ct(a),delete n[o];return}const i=t?Ci(o):String(o).trim();i!==o&&delete n[o],n[i]=Ct(a),r[i]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return p.forEach(this,(r,a)=>{r!=null&&r!==!1&&(n[a]=t&&p.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
5
+ `)}getSetCookie(){const t=this.get("set-cookie");return p.isArray(t)?t:t==null||t===!1?[]:[t]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static parseParameters(t){return Si(t)}static concat(t,...n){const r=new this(t);return n.forEach(a=>r.set(a)),r}static accessor(t){const r=(this[fr]=this[fr]={accessors:{}}).accessors,a=this.prototype;function o(s){const i=et(s);r[i]||(_i(a,s),r[i]=!0)}return p.isArray(t)?t.forEach(o):o(t),this}};R.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),p.reduceDescriptors(R.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),p.freezeMethods(R);const _t="[REDACTED ****]";function Ni(e){if(p.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(p.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}function Oi(e,t){const n=new Set(t.map(o=>String(o).toLowerCase())),r=[],a=o=>{if(o===null||typeof o!="object"||p.isBuffer(o))return o;if(r.indexOf(o)!==-1)return;o instanceof R&&(o=o.toJSON()),r.push(o);let s;if(p.isArray(o))s=[],o.forEach((i,c)=>{const f=a(i);p.isUndefined(f)||(s[c]=f)});else{if(!p.isPlainObject(o)&&Ni(o))return r.pop(),o;s=Object.create(null);for(const[i,c]of Object.entries(o)){const f=n.has(i.toLowerCase())?_t:a(c);p.isUndefined(f)||(s[i]=f)}}return r.pop(),s};return a(e)}function pr(e){try{return String(e)}catch{return""}}function Ti(e){return e.errors.map(n=>{try{return n&&n.message?pr(n.message):pr(n)}catch{return""}}).filter(Boolean).join("; ")||e.name||"AggregateError"}let C=class Xa extends Error{static from(t,n,r,a,o,s){let i=t.message;!i&&p.isArray(t.errors)&&t.errors.length&&(i=Ti(t));const c=new Xa(i,n||t.code,r,a,o);return Object.defineProperty(c,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),c.name=t.name,t.status!=null&&c.status==null&&(c.status=t.status),s&&Object.assign(c,s),c}constructor(t,n,r,a,o){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),r&&(this.config=r),a&&(this.request=a),o&&(this.response=o,this.status=o.status)}toJSON(){const t=this.config,n=t&&p.hasOwnProp(t,"redact")?t.redact:void 0,r=p.isArray(n)&&n.length>0?Oi(t,n):p.toJSONObject(t);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:r,code:this.code,status:this.status}}};C.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",C.ERR_BAD_OPTION="ERR_BAD_OPTION",C.ECONNABORTED="ECONNABORTED",C.ETIMEDOUT="ETIMEDOUT",C.ECONNREFUSED="ECONNREFUSED",C.ERR_NETWORK="ERR_NETWORK",C.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",C.ERR_DEPRECATED="ERR_DEPRECATED",C.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",C.ERR_BAD_REQUEST="ERR_BAD_REQUEST",C.ERR_CANCELED="ERR_CANCELED",C.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",C.ERR_INVALID_URL="ERR_INVALID_URL",C.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const Ai=null,hr=100;function an(e){return p.isPlainObject(e)||p.isArray(e)}function mr(e){return p.endsWith(e,"[]")?e.slice(0,-2):e}function on(e,t,n){return e?e.concat(t).map(function(a,o){return a=mr(a),!n&&o?"["+a+"]":a}).join(n?".":""):t}function Pi(e){return p.isArray(e)&&!e.some(an)}const xi=p.toFlatObject(p,{},null,function(t){return/^is[A-Z]/.test(t)});function Nt(e,t,n){if(!p.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=p.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(w,S){return!p.isUndefined(S[w])});const r=n.metaTokens,a=n.visitor||v,o=n.dots,s=n.indexes,i=n.Blob||typeof Blob<"u"&&Blob,c=n.maxDepth===void 0?hr:n.maxDepth,f=i&&p.isSpecCompliantForm(t),u=[];if(!p.isFunction(a))throw new TypeError("visitor must be a function");function d(m){if(m===null)return"";if(p.isDate(m))return m.toISOString();if(p.isBoolean(m))return m.toString();if(!f&&p.isBlob(m))throw new C("Blob is not supported. Use a Buffer instead.");if(p.isArrayBuffer(m)||p.isTypedArray(m)){if(f&&typeof i=="function")return new i([m]);throw new C("Blob is not supported. Use a Buffer instead.",C.ERR_NOT_SUPPORT)}return m}function h(m){if(m>c)throw new C("Object is too deeply nested ("+m+" levels). Max depth: "+c,C.ERR_FORM_DATA_DEPTH_EXCEEDED)}function E(m,w){if(c===1/0)return JSON.stringify(m);const S=[];return JSON.stringify(m,function(x,A){if(!p.isObject(A))return A;for(;S.length&&S[S.length-1]!==this;)S.pop();return S.push(A),h(w+S.length-1),A})}function v(m,w,S){let N=m;if(p.isReactNative(t)&&p.isReactNativeBlob(m))return t.append(on(S,w,o),d(m)),!1;if(m&&!S&&typeof m=="object"){if(p.endsWith(w,"{}"))w=r?w:w.slice(0,-2),m=E(m,1);else if(p.isArray(m)&&Pi(m)||(p.isFileList(m)||p.endsWith(w,"[]"))&&(N=p.toArray(m)))return w=mr(w),N.forEach(function(A,$){!(p.isUndefined(A)||A===null)&&t.append(s===!0?on([w],$,o):s===null?w:w+"[]",d(A))}),!1}return an(m)?!0:(t.append(on(S,w,o),d(m)),!1)}const _=Object.assign(xi,{defaultVisitor:v,convertValue:d,isVisitable:an});function y(m,w,S=0){if(!p.isUndefined(m)){if(h(S),u.indexOf(m)!==-1)throw new Error("Circular reference detected in "+w.join("."));u.push(m),p.forEach(m,function(x,A){(!(p.isUndefined(x)||x===null)&&a.call(t,x,p.isString(A)?A.trim():A,w,_))===!0&&y(x,w?w.concat(A):[A],S+1)}),u.pop()}}if(!p.isObject(e))throw new TypeError("data must be an object");return y(e),t}function gr(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(r){return t[r]})}function sn(e,t){this._pairs=[],e&&Nt(e,this,t)}const yr=sn.prototype;yr.append=function(t,n){this._pairs.push([t,n])},yr.toString=function(t){const n=t?r=>t.call(this,r,gr):gr;return this._pairs.map(function(a){return n(a[0])+"="+n(a[1])},"").join("&")};function Di(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function wr(e,t,n){if(!t)return e;e=e||"";const r=p.isFunction(n)?{serialize:n}:n,a=p.getSafeProp(r,"encode")||Di,o=p.getSafeProp(r,"serialize");let s;if(o?s=o(t,r):s=p.isURLSearchParams(t)?t.toString():new sn(t,r).toString(a),s){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class br{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){p.forEach(this.handlers,function(r){r!==null&&t(r)})}}const ln={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},Fi={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:sn,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},cn=typeof window<"u"&&typeof document<"u",dn=typeof navigator=="object"&&navigator||void 0,ki=cn&&(!dn||["ReactNative","NativeScript","NS"].indexOf(dn.product)<0),Li=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Bi=cn&&window.location.href||"http://localhost",B={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:cn,hasStandardBrowserEnv:ki,hasStandardBrowserWebWorkerEnv:Li,navigator:dn,origin:Bi},Symbol.toStringTag,{value:"Module"})),...Fi};function Ii(e,t){return Nt(e,new B.classes.URLSearchParams,{visitor:function(n,r,a,o){return B.isNode&&p.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}const vr=hr;function Sr(e){if(e>vr)throw new C("FormData field is too deeply nested ("+e+" levels). Max depth: "+vr,C.ERR_FORM_DATA_DEPTH_EXCEEDED)}function Ri(e){const t=[],n=/[^.[\]]+|\[([^.[\]]*)]/g;let r;for(;(r=n.exec(e))!==null;)Sr(t.length),t.push(r[0]==="[]"?"":r[1]||r[0]);return t}function Ui(e){const t={},n=Object.keys(e);let r;const a=n.length;let o;for(r=0;r<a;r++)o=n[r],t[o]=e[o];return t}function Er(e){function t(n,r,a,o){Sr(o);let s=n[o++];if(s==="__proto__")return!0;const i=Number.isFinite(+s),c=o>=n.length;return s=!s&&p.isArray(a)?a.length:s,c?(p.hasOwnProp(a,s)?a[s]=p.isArray(a[s])?a[s].concat(r):[a[s],r]:a[s]=r,!i):((!p.hasOwnProp(a,s)||!p.isObject(a[s]))&&(a[s]=[]),t(n,r,a[s],o)&&p.isArray(a[s])&&(a[s]=Ui(a[s])),!i)}if(p.isFormData(e)&&p.isFunction(e.entries)){const n={};return p.forEachEntry(e,(r,a)=>{t(Ri(r),a,n,0)}),n}return null}const Re=(e,t)=>e!=null&&p.hasOwnProp(e,t)?e[t]:void 0;function Mi(e,t,n){if(p.isString(e))try{return(t||JSON.parse)(e),p.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const tt={transitional:ln,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",a=r.indexOf("application/json")>-1,o=p.isObject(t);if(o&&p.isHTMLForm(t)&&(t=new FormData(t)),p.isFormData(t))return a?JSON.stringify(Er(t)):t;if(p.isArrayBuffer(t)||p.isBuffer(t)||p.isStream(t)||p.isFile(t)||p.isBlob(t)||p.isReadableStream(t))return t;if(p.isArrayBufferView(t))return t.buffer;if(p.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let i;if(o){const c=Re(this,"formSerializer");if(r.indexOf("application/x-www-form-urlencoded")>-1)return Ii(t,c).toString();if((i=p.isFileList(t))||r.indexOf("multipart/form-data")>-1){const f=Re(this,"env"),u=f&&f.FormData;return Nt(i?{"files[]":t}:t,u&&new u,c)}}return o||a?(n.setContentType("application/json",!1),Mi(t)):t}],transformResponse:[function(t){const n=Re(this,"transitional")||tt.transitional,r=n&&n.forcedJSONParsing,a=Re(this,"responseType"),o=a==="json";if(p.isResponse(t)||p.isReadableStream(t))return t;if(t&&p.isString(t)&&(r&&!a||o)){const i=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(t,Re(this,"parseReviver"))}catch(c){if(i)throw c.name==="SyntaxError"?C.from(c,C.ERR_BAD_RESPONSE,this,null,Re(this,"response")):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:B.classes.FormData,Blob:B.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};p.forEach(["delete","get","head","post","put","patch","query"],e=>{tt.headers[e]={}});function un(e,t){const n=this||tt,r=t||n,a=R.from(r.headers);let o=r.data;return p.forEach(e,function(i){o=i.call(n,o,a.normalize(),t?t.status:void 0)}),a.normalize(),o}function Cr(e){return!!(e&&e.__CANCEL__)}let nt=class extends C{constructor(t,n,r){super(t??"canceled",C.ERR_CANCELED,n,r),this.name="CanceledError",this.__CANCEL__=!0}};function _r(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new C("Request failed with status code "+n.status,n.status>=400&&n.status<500?C.ERR_BAD_REQUEST:C.ERR_BAD_RESPONSE,n.config,n.request,n))}function ji(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}function $i(e,t){e=e||10;const n=new Array(e),r=new Array(e);let a=0,o=0,s;return t=t!==void 0?t:1e3,function(c){const f=Date.now(),u=r[o];s||(s=f),n[a]=c,r[a]=f;let d=o,h=0;for(;d!==a;)h+=n[d++],d=d%e;if(a=(a+1)%e,a===o&&(o=(o+1)%e),f-s<t)return;const E=u&&f-u;return E?Math.round(h*1e3/E):void 0}}function Wi(e,t){let n=0,r=1e3/t,a,o;const s=(f,u=Date.now())=>{n=u,a=null,o&&(clearTimeout(o),o=null),e(...f)};return[(...f)=>{const u=Date.now(),d=u-n;d>=r?s(f,u):(a=f,o||(o=setTimeout(()=>{o=null,s(a)},r-d)))},()=>a&&s(a)]}const Ot=(e,t,n=3)=>{let r=0;const a=$i(50,250);return Wi(o=>{if(!o||typeof o.loaded!="number")return;const s=o.loaded,i=o.lengthComputable?o.total:void 0,c=Math.max(0,i!=null?Math.min(s,i):s),f=Math.max(0,c-r),u=a(f);r=Math.max(r,c);const d={loaded:c,total:i,progress:i?c/i:void 0,bytes:f,rate:u||void 0,estimated:u&&i?(i-c)/u:void 0,event:o,lengthComputable:i!=null,[t?"download":"upload"]:!0};e(d)},n)},Nr=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Or=(e,t=p.asap)=>(...n)=>t(()=>e(...n)),Vi=B.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,B.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(B.origin),B.navigator&&/(msie|trident)/i.test(B.navigator.userAgent)):()=>!0,zi=B.hasStandardBrowserEnv?{write(e,t,n,r,a,o,s){if(typeof document>"u")return;const i=[`${e}=${encodeURIComponent(t)}`];p.isNumber(n)&&i.push(`expires=${new Date(n).toUTCString()}`),p.isString(r)&&i.push(`path=${r}`),p.isString(a)&&i.push(`domain=${a}`),o===!0&&i.push("secure"),p.isString(s)&&i.push(`SameSite=${s}`),document.cookie=i.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.split(";");for(let n=0;n<t.length;n++){const r=t[n].replace(/^\s+/,""),a=r.indexOf("=");if(a!==-1&&r.slice(0,a)===e)try{return decodeURIComponent(r.slice(a+1))}catch{return r.slice(a+1)}}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Hi(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function qi(e,t){if(!t)return e;let n=e.length;for(;n>0&&e.charCodeAt(n-1)===47;)n--;return e.slice(0,n)+"/"+t.replace(/^\/+/,"")}const Ji=/^https?:(?!\/\/)/i,Ki=/[\t\n\r]/g;function Xi(e){let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t)}function Gi(e){return Xi(e).replace(Ki,"")}function Yi(e){return e&&e.replace(/(^|&)([^=&]*=)?[^&]+/g,(t,n,r="")=>`${n}${r}${_t}`)}function Qi(e){const t=e.replace(/^(https?:\/{0,2})[^/?#]*@/i,`$1${_t}@`),n=t.indexOf("#"),a=(n===-1?t:t.slice(0,n)).replace(/([?&][^=&#]*=)[^&#]*/g,`$1${_t}`);return n===-1?a:`${a}#${Yi(t.slice(n+1))}`}function Tr(e,t){if(typeof e=="string"){const n=Gi(e);if(Ji.test(n))throw new C(`Invalid URL ${JSON.stringify(Qi(n))}: missing "//" after protocol`,C.ERR_INVALID_URL,t)}}function Ar(e,t,n,r){Tr(t,r);let a=!Hi(t);return e&&(a||n===!1)?(Tr(e,r),qi(e,t)):t}const Pr=e=>e instanceof R?{...e}:e,Zi=e=>Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(e).concat(Object.getOwnPropertySymbols(e).filter(t=>Object.getOwnPropertyDescriptor(e,t).enumerable)):Object.keys(e);function we(e,t){e=e||{},t=t||{};const n=Object.create(null);Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function r(u,d,h,E){return p.isPlainObject(u)&&p.isPlainObject(d)?p.merge.call({caseless:E},u,d):p.isPlainObject(d)?p.merge({},d):p.isArray(d)?d.slice():d}function a(u,d,h,E){if(p.isUndefined(d)){if(!p.isUndefined(u))return r(void 0,u,h,E)}else return r(u,d,h,E)}function o(u,d){if(!p.isUndefined(d))return r(void 0,d)}function s(u,d){if(p.isUndefined(d)){if(!p.isUndefined(u))return r(void 0,u)}else return r(void 0,d)}function i(u){const d=p.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!p.isUndefined(d))if(p.isPlainObject(d)){if(p.hasOwnProp(d,u))return d[u]}else return;const h=p.hasOwnProp(e,"transitional")?e.transitional:void 0;if(p.isPlainObject(h)&&p.hasOwnProp(h,u))return h[u]}function c(u,d,h){if(p.hasOwnProp(t,h))return r(u,d);if(p.hasOwnProp(e,h))return r(void 0,u)}const f={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,allowedSocketPaths:s,responseEncoding:s,validateStatus:c,headers:(u,d,h)=>a(Pr(u),Pr(d),h,!0)};return p.forEach(Zi({...e,...t}),function(d){if(d==="__proto__"||d==="constructor"||d==="prototype")return;const h=p.hasOwnProp(f,d)?f[d]:a,E=p.hasOwnProp(e,d)?e[d]:void 0,v=p.hasOwnProp(t,d)?t[d]:void 0,_=h(E,v,d);p.isUndefined(_)&&h!==c||(n[d]=_)}),p.hasOwnProp(t,"validateStatus")&&p.isUndefined(t.validateStatus)&&i("validateStatusUndefinedResolves")===!1&&(p.hasOwnProp(e,"validateStatus")?n.validateStatus=r(void 0,e.validateStatus):delete n.validateStatus),n}const el=["content-type","content-length"];function tl(e,t,n){if(n!=="content-only"){e.set(t);return}Object.entries(t||{}).forEach(([r,a])=>{el.includes(r.toLowerCase())&&e.set(r,a)})}const nl=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,n)=>String.fromCharCode(parseInt(n,16)));function xr(e){const t=we({},e),n=h=>p.hasOwnProp(t,h)?t[h]:void 0,r=n("data");let a=n("withXSRFToken");const o=n("xsrfHeaderName"),s=n("xsrfCookieName");let i=n("headers");const c=n("auth"),f=n("baseURL"),u=n("allowAbsoluteUrls"),d=n("url");if(t.headers=i=R.from(i),t.url=wr(Ar(f,d,u,t),n("params"),n("paramsSerializer")),c){const h=p.getSafeProp(c,"username")||"",E=p.getSafeProp(c,"password")||"";try{i.set("Authorization","Basic "+btoa(h+":"+(E?nl(E):"")))}catch(v){throw C.from(v,C.ERR_BAD_OPTION_VALUE,e)}}if(p.isFormData(r)&&(B.hasStandardBrowserEnv||B.hasStandardBrowserWebWorkerEnv||p.isReactNative(r)?i.setContentType(void 0):p.isFunction(r.getHeaders)&&tl(i,r.getHeaders(),n("formDataHeaderPolicy"))),B.hasStandardBrowserEnv&&(p.isFunction(a)&&(a=a(t)),a===!0||a==null&&Vi(t.url))){const E=o&&s&&zi.read(s);E&&i.set(o,E)}return t}const rl=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const a=xr(e);let o=a.data;const s=R.from(a.headers).normalize();let{responseType:i,onUploadProgress:c,onDownloadProgress:f}=a,u,d,h,E,v;function _(){E&&E(),v&&v(),a.cancelToken&&a.cancelToken.unsubscribe(u),a.signal&&a.signal.removeEventListener("abort",u)}let y=new XMLHttpRequest;y.open(a.method.toUpperCase(),a.url,!0),y.timeout=a.timeout;function m(){if(!y)return;const S=R.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),x={data:!i||i==="text"||i==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:S,config:e,request:y};_r(function($){n($),_()},function($){r($),_()},x),y=null}"onloadend"in y?y.onloadend=m:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.startsWith("file:"))||setTimeout(m)},y.onabort=function(){y&&(r(new C("Request aborted",C.ECONNABORTED,e,y)),_(),y=null)},y.onerror=function(N){const x=N&&N.message?N.message:"Network Error",A=new C(x,C.ERR_NETWORK,e,y);A.event=N||null,r(A),_(),y=null},y.ontimeout=function(){let N=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const x=a.transitional||ln;a.timeoutErrorMessage&&(N=a.timeoutErrorMessage),r(new C(N,x.clarifyTimeoutError?C.ETIMEDOUT:C.ECONNABORTED,e,y)),_(),y=null},o===void 0&&s.setContentType(null),"setRequestHeader"in y&&p.forEach(ur(s),function(N,x){y.setRequestHeader(x,N)}),p.isUndefined(a.withCredentials)||(y.withCredentials=!!a.withCredentials),i&&i!=="json"&&(y.responseType=a.responseType),f&&([h,v]=Ot(f,!0),y.addEventListener("progress",h)),c&&y.upload&&([d,E]=Ot(c),y.upload.addEventListener("progress",d),y.upload.addEventListener("loadend",E)),(a.cancelToken||a.signal)&&(u=S=>{y&&(r(!S||S.type?new nt(null,e,y):S),y.abort(),_(),y=null)},a.cancelToken&&a.cancelToken.subscribe(u),a.signal&&(a.signal.aborted?u():a.signal.addEventListener("abort",u)));const w=ji(a.url);if(w&&!B.protocols.includes(w)){r(new C("Unsupported protocol "+w+":",C.ERR_BAD_REQUEST,e)),_();return}y.send(o||null)})},al=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const n=new AbortController;let r=!1;const a=function(c){if(!r){r=!0,s();const f=c instanceof Error?c:this.reason;n.abort(f instanceof C?f:new nt(f instanceof Error?f.message:f))}};let o=t&&setTimeout(()=>{o=null,a(new C(`timeout of ${t}ms exceeded`,C.ETIMEDOUT))},t);const s=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(a):c.removeEventListener("abort",a)}),e=null)};e.forEach(c=>{if(!r){if(c.aborted){a.call(c);return}c.addEventListener("abort",a,{once:!0})}});const{signal:i}=n;return i.unsubscribe=()=>p.asap(s),i},ol=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,a;for(;r<n;)a=r+t,yield e.slice(r,a),r=a},sl=async function*(e,t){for await(const n of il(e))yield*ol(n,t)},il=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},Dr=(e,t,n,r)=>{const a=sl(e,t);let o=0,s,i=c=>{s||(s=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:f,value:u}=await a.next();if(f){i(),c.close();return}let d=u.byteLength;if(n){let h=o+=d;n(h)}c.enqueue(new Uint8Array(u))}catch(f){throw i(f),f}},cancel(c){return i(c),a.return()}},{highWaterMark:2})},Fr=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,kr=(e,t,n)=>t+2<n&&Fr(e.charCodeAt(t+1))&&Fr(e.charCodeAt(t+2)),Lr=e=>e<=57?e-48:(e&223)-55,ll=e=>e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===43||e===47||e===45||e===95,cl=e=>e===9||e===10||e===12||e===13||e===32,dl=e=>{const t=Math.floor(e/4),n=e%4;return t*3+(n===2?1:n===3?2:0)},ul=e=>{const t=e.length;let n=0;return t>0&&e.charCodeAt(t-1)===61&&(n++,t>1&&e.charCodeAt(t-2)===61&&n++),Math.floor((t-n)*3/4)},fl=e=>{const t=e.length;let n=0,r=0,a=!1;for(let o=0;o<t;o++){let s=e.charCodeAt(o);if(s===37&&kr(e,o,t)&&(s=Lr(e.charCodeAt(o+1))*16+Lr(e.charCodeAt(o+2)),o+=2),!cl(s)){if(s===61){r++;continue}if(!ll(s)||r>0){a=!0;continue}n++}}return a||r>2||r>0&&(n+r)%4!==0||n%4===1?ul(e):dl(n)},pl=(e,t)=>{if(!e||typeof e!="string"||!e.startsWith("data:"))return 0;const n=e.indexOf(",");if(n<0)return 0;const r=e.slice(5,n),a=e.slice(n+1);if(/;base64/i.test(r))return t(a);let s=0;for(let i=0,c=a.length;i<c;i++){const f=a.charCodeAt(i);if(f===37&&kr(a,i,c))s+=1,i+=2;else if(f<128)s+=1;else if(f<2048)s+=2;else if(f>=55296&&f<=56319&&i+1<c){const u=a.charCodeAt(i+1);u>=56320&&u<=57343?(s+=4,i++):s+=3}else s+=3}return s};function hl(e){const t=typeof e=="string"?e.indexOf("#"):-1;return pl(t===-1?e:e.slice(0,t),fl)}const fn="1.19.0",Br=64*1024,{isFunction:Tt}=p,ml=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,n)=>String.fromCharCode(parseInt(n,16))),Ir=e=>{if(!p.isString(e))return e;try{return decodeURIComponent(e)}catch{return e}},Rr=(e,...t)=>{try{return!!e(...t)}catch{return!1}},gl=e=>{const t=e.indexOf("://");let n=e;return t!==-1&&(n=n.slice(t+3)),n.includes("@")||n.includes(":")},yl=e=>{const t=p.global!==void 0&&p.global!==null?p.global:globalThis,{ReadableStream:n,TextEncoder:r}=t;e=p.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:a,Request:o,Response:s}=e,i=a?Tt(a):typeof fetch=="function",c=Tt(o),f=Tt(s);if(!i)return!1;const u=i&&Tt(n),d=i&&(typeof r=="function"?(m=>w=>m.encode(w))(new r):async m=>new Uint8Array(await new o(m).arrayBuffer())),h=c&&u&&Rr(()=>{let m=!1;const w=new o(B.origin,{body:new n,method:"POST",get duplex(){return m=!0,"half"}}),S=w.headers.has("Content-Type");return w.body!=null&&w.body.cancel(),m&&!S}),E=f&&u&&Rr(()=>p.isReadableStream(new s("").body)),v={stream:E&&(m=>m.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(m=>{!v[m]&&(v[m]=(w,S)=>{let N=w&&w[m];if(N)return N.call(w);throw new C(`Response type '${m}' is not supported`,C.ERR_NOT_SUPPORT,S)})});const _=async m=>{if(m==null)return 0;if(p.isBlob(m))return m.size;if(p.isSpecCompliantForm(m))return(await new o(B.origin,{method:"POST",body:m}).arrayBuffer()).byteLength;if(p.isArrayBufferView(m)||p.isArrayBuffer(m))return m.byteLength;if(p.isURLSearchParams(m)&&(m=m+""),p.isString(m))return(await d(m)).byteLength},y=async(m,w)=>{const S=p.toFiniteNumber(m.getContentLength());return S??_(w)};return async m=>{let{url:w,method:S,data:N,signal:x,cancelToken:A,timeout:$,onDownloadProgress:ne,onUploadProgress:Pe,responseType:F,headers:L,withCredentials:J="same-origin",fetchOptions:Ut,maxContentLength:Q,maxBodyLength:Mt}=xr(m);const ct=p.isNumber(Q)&&Q>-1,Pn=p.isNumber(Mt)&&Mt>-1,kc=P=>p.hasOwnProp(m,P)?m[P]:void 0;let Va=a||fetch;F=F?(F+"").toLowerCase():"text";let fe=al([x,A&&A.toAbortSignal()],$),I=null;const xe=fe&&fe.unsubscribe&&(()=>{fe.unsubscribe()});let We,dt=null;const za=()=>new C("Request body larger than maxBodyLength limit",C.ERR_BAD_REQUEST,m,I);try{let P;const H=kc("auth");if(H){const O=p.getSafeProp(H,"username")||"",W=p.getSafeProp(H,"password")||"";P={username:O,password:W}}if(gl(w)){const O=new URL(w,B.origin);if(!P&&(O.username||O.password)){const W=Ir(O.username),pe=Ir(O.password);P={username:W,password:pe}}(O.username||O.password)&&(O.username="",O.password="",w=O.href)}if(P&&(L.delete("authorization"),L.set("Authorization","Basic "+btoa(ml((P.username||"")+":"+(P.password||""))))),ct&&typeof w=="string"&&w.startsWith("data:")&&hl(w)>Q)throw new C("maxContentLength size of "+Q+" exceeded",C.ERR_BAD_RESPONSE,m,I);if(Pn&&S!=="get"&&S!=="head"){const O=await _(N);if(typeof O=="number"&&isFinite(O)&&(We=O,O>Mt))throw za()}const jt=Pn&&(p.isReadableStream(N)||p.isStream(N)),Ha=(O,W,pe)=>Dr(O,Br,De=>{if(Pn&&De>Mt)throw dt=za();W&&W(De)},pe);if(h&&S!=="get"&&S!=="head"&&(Pe||jt)){if(We=We??await y(L,N),We!==0||jt){let O=new o(w,{method:"POST",body:N,duplex:"half"}),W;if(p.isFormData(N)&&(W=O.headers.get("content-type"))&&L.setContentType(W),O.body){const[pe,De]=Pe&&Nr(We,Ot(Or(Pe)))||[];N=Ha(O.body,pe,De)}}}else if(jt&&!c&&u&&S!=="get"&&S!=="head")N=Ha(N);else if(jt&&c&&!h&&S!=="get"&&S!=="head")throw new C("Stream request bodies are not supported by the current fetch implementation",C.ERR_NOT_SUPPORT,m,I);p.isString(J)||(J=J?"include":"omit");const Lc=c&&"credentials"in o.prototype;if(p.isFormData(N)){const O=L.getContentType();O&&/^multipart\/form-data/i.test(O)&&!/boundary=/i.test(O)&&L.delete("content-type")}L.set("User-Agent","axios/"+fn,!1);const qa={...Ut,signal:fe,method:S.toUpperCase(),headers:ur(L.normalize()),body:N,duplex:"half",credentials:Lc?J:void 0};I=c&&new o(w,qa);let re=await(c?Va(I,Ut):Va(w,qa));const Ja=R.from(re.headers);if(ct){const O=p.toFiniteNumber(Ja.getContentLength());if(O!=null&&O>Q)throw new C("maxContentLength size of "+Q+" exceeded",C.ERR_BAD_RESPONSE,m,I)}const xn=E&&(F==="stream"||F==="response");if(E&&re.body&&(ne||ct||xn&&xe)){const O={};["status","statusText","headers"].forEach(ut=>{O[ut]=re[ut]});const W=p.toFiniteNumber(Ja.getContentLength()),[pe,De]=ne&&Nr(W,Ot(Or(ne),!0))||[];let Ka=0;const Bc=ut=>{if(ct&&(Ka=ut,Ka>Q))throw new C("maxContentLength size of "+Q+" exceeded",C.ERR_BAD_RESPONSE,m,I);pe&&pe(ut)};re=new s(Dr(re.body,Br,Bc,()=>{De&&De(),xe&&xe()}),O)}F=F||"text";let ae=await v[p.findKey(v,F)||"text"](re,m);if(ct&&!E&&!xn){let O;if(ae!=null&&(typeof ae.byteLength=="number"?O=ae.byteLength:typeof ae.size=="number"?O=ae.size:typeof ae=="string"&&(O=typeof r=="function"?new r().encode(ae).byteLength:ae.length)),typeof O=="number"&&O>Q)throw new C("maxContentLength size of "+Q+" exceeded",C.ERR_BAD_RESPONSE,m,I)}return!xn&&xe&&xe(),await new Promise((O,W)=>{_r(O,W,{data:ae,headers:R.from(re.headers),status:re.status,statusText:re.statusText,config:m,request:I})})}catch(P){if(xe&&xe(),fe&&fe.aborted&&fe.reason instanceof C){const H=fe.reason;throw H.config=m,I&&(H.request=I),P!==H&&Object.defineProperty(H,"cause",{__proto__:null,value:P,writable:!0,enumerable:!1,configurable:!0}),H}if(dt)throw I&&!dt.request&&(dt.request=I),dt;if(P instanceof C)throw I&&!P.request&&(P.request=I),P;if(P&&P.name==="TypeError"&&/Load failed|fetch/i.test(P.message)){const H=new C("Network Error",C.ERR_NETWORK,m,I,P&&P.response);throw Object.defineProperty(H,"cause",{__proto__:null,value:P.cause||P,writable:!0,enumerable:!1,configurable:!0}),H}throw C.from(P,P&&P.code,m,I,P&&P.response)}}},wl=new Map,Ur=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:a}=t,o=[r,a,n];let s=o.length,i=s,c,f,u=wl;for(;i--;)c=o[i],f=u.get(c),f===void 0&&u.set(c,f=i?new Map:yl(t)),u=f;return f};Ur();const pn={http:Ai,xhr:rl,fetch:{get:Ur}};p.forEach(pn,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const Mr=e=>`- ${e}`,bl=e=>p.isFunction(e)||e===null||e===!1;function vl(e,t){e=p.isArray(e)?e:[e];const{length:n}=e;let r,a;const o={};for(let s=0;s<n;s++){r=e[s];let i;if(a=r,!bl(r)&&(a=pn[(i=String(r)).toLowerCase()],a===void 0))throw new C(`Unknown adapter '${i}'`);if(a&&(p.isFunction(a)||(a=a.get(t))))break;o[i||"#"+s]=a}if(!a){const s=Object.entries(o).map(([c,f])=>`adapter ${c} `+(f===!1?"is not supported by the environment":"is not available in the build"));let i=n?s.length>1?`since :
6
+ `+s.map(Mr).join(`
7
+ `):" "+Mr(s[0]):"as no adapter specified";throw new C("There is no suitable adapter to dispatch the request "+i,C.ERR_NOT_SUPPORT)}return a}const jr={getAdapter:vl,adapters:pn};function hn(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new nt(null,e)}function mn(e){return hn(e),e.headers=R.from(e.headers),e.data=un.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),jr.getAdapter(e.adapter||tt.adapter,e)(e).then(function(r){hn(e),e.response=r;try{r.data=un.call(e,e.transformResponse,r)}finally{delete e.response}return r.headers=R.from(r.headers),r},function(r){if(!Cr(r)&&(hn(e),r&&r.response)){e.response=r.response;try{r.response.data=un.call(e,e.transformResponse,r.response)}finally{delete e.response}r.response.headers=R.from(r.response.headers)}return Promise.reject(r)})}const At={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{At[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const $r={};At.transitional=function(t,n,r){function a(o,s){return"[Axios v"+fn+"] Transitional option '"+o+"'"+s+(r?". "+r:"")}return(o,s,i)=>{if(t===!1)throw new C(a(s," has been removed"+(n?" in "+n:"")),C.ERR_DEPRECATED);return n&&!$r[s]&&($r[s]=!0,console.warn(a(s," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,s,i):!0}},At.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Sl(e,t,n){if(typeof e!="object"||e===null)throw new C("options must be an object",C.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let a=r.length;for(;a-- >0;){const o=r[a],s=Object.prototype.hasOwnProperty.call(t,o)?t[o]:void 0;if(s){const i=e[o],c=i===void 0||s(i,o,e);if(c!==!0)throw new C("option "+o+" must be "+c,C.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new C("Unknown option "+o,C.ERR_BAD_OPTION)}}const Pt={assertOptions:Sl,validators:At},U=Pt.validators;let be=class{constructor(t){this.defaults=t||{},this.interceptors={request:new br,response:new br}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let a={};Error.captureStackTrace?Error.captureStackTrace(a):a=new Error;const o=(()=>{if(!a.stack)return"";const s=a.stack.indexOf(`
8
8
  `);return s===-1?"":a.stack.slice(s+1)})();try{if(!r.stack)r.stack=o;else if(o){const s=o.indexOf(`
9
9
  `),i=s===-1?-1:o.indexOf(`
10
10
  `,s+1),c=i===-1?"":o.slice(i+1);String(r.stack).endsWith(c)||(r.stack+=`
11
- `+o)}}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=me(this.defaults,n);const{transitional:r,paramsSerializer:a,headers:o}=n;r!==void 0&&gt.assertOptions(r,{silentJSONParsing:M.transitional(M.boolean),forcedJSONParsing:M.transitional(M.boolean),clarifyTimeoutError:M.transitional(M.boolean),legacyInterceptorReqResOrdering:M.transitional(M.boolean),advertiseZstdAcceptEncoding:M.transitional(M.boolean),validateStatusUndefinedResolves:M.transitional(M.boolean)},!1),a!=null&&(h.isFunction(a)?n.paramsSerializer={serialize:a}:gt.assertOptions(a,{encode:M.function,serialize:M.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),gt.assertOptions(n,{baseUrl:M.spelling("baseURL"),withXsrfToken:M.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=o&&h.merge(o.common,o[n.method]);o&&h.forEach(["delete","get","head","post","put","patch","query","common"],v=>{delete o[v]}),n.headers=I.concat(s,o);const i=[];let c=!0;this.interceptors.request.forEach(function(N){if(typeof N.runWhen=="function"&&N.runWhen(n)===!1)return;c=c&&N.synchronous;const g=n.transitional||Ht;g&&g.legacyInterceptorReqResOrdering?i.unshift(N.fulfilled,N.rejected):i.push(N.fulfilled,N.rejected)});const f=[];this.interceptors.response.forEach(function(N){f.push(N.fulfilled,N.rejected)});let u,d=0,p;if(!c){const v=[Gt.bind(this),void 0];for(v.unshift(...i),v.push(...f),p=v.length,u=Promise.resolve(n);d<p;)u=u.then(v[d++],v[d++]);return u}p=i.length;let E=n;for(;d<p;){const v=i[d++],N=i[d++];try{E=v?v(E):E}catch(g){if(!N){u=Promise.reject(g);break}try{const m=N.call(this,g);h.isThenable(m)&&(u=Promise.resolve(m).then(()=>Gt.call(this,E)))}catch(m){u=Promise.reject(m)}break}}if(!u)try{u=Gt.call(this,E)}catch(v){u=Promise.reject(v)}for(d=0,p=f.length;d<p;)u=u.then(f[d++],f[d++]);return u}getUri(t){t=me(this.defaults,t);const n=dr(t.baseURL,t.url,t.allowAbsoluteUrls,t);return er(n,t.params,t.paramsSerializer)}};h.forEach(["delete","get","head","options"],function(t){ge.prototype[t]=function(n,r){return this.request(me(r||{},{method:t,url:n,data:r&&h.hasOwnProp(r,"data")?r.data:void 0}))}}),h.forEach(["post","put","patch","query"],function(t){function n(r){return function(o,s,i){return this.request(me(i||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:s}))}}ge.prototype[t]=n(),t!=="query"&&(ge.prototype[t+"Form"]=n(!0))});let Yi=class Oa{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(a=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](a);r._listeners=null}),this.promise.then=a=>{let o;const s=new Promise(i=>{r.subscribe(i),o=i}).then(a);return s.cancel=function(){r.unsubscribe(o)},s},t(function(o,s,i){r.reason||(r.reason=new Je(o,s,i),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Oa(function(a){t=a}),cancel:t}}};function Qi(e){return function(n){return e.apply(null,n)}}function Zi(e){return h.isObject(e)&&e.isAxiosError===!0}const Yt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Yt).forEach(([e,t])=>{Yt[t]=e});function Nr(e){const t=new ge(e),n=Un(ge.prototype.request,t);return h.extend(n,ge.prototype,t,{allOwnKeys:!0}),h.extend(n,t,null,{allOwnKeys:!0}),n.create=function(a){return Nr(me(e,a))},n}const k=Nr(We);k.Axios=ge,k.CanceledError=Je,k.CancelToken=Yi,k.isCancel=or,k.VERSION=Jt,k.toFormData=ft,k.AxiosError=_,k.Cancel=k.CanceledError,k.all=function(t){return Promise.all(t)},k.spread=Qi,k.isAxiosError=Zi,k.mergeConfig=me,k.AxiosHeaders=I,k.formToJSON=e=>ar(h.isHTMLForm(e)?new FormData(e):e),k.getAdapter=Sr.getAdapter,k.HttpStatusCode=Yt,k.default=k;const{Axios:$l,AxiosError:Vl,CanceledError:Hl,isCancel:zl,CancelToken:ql,VERSION:Wl,all:Jl,Cancel:Kl,isAxiosError:Xl,spread:Gl,toFormData:Yl,AxiosHeaders:Ql,HttpStatusCode:Zl,formToJSON:ec,getAdapter:tc,mergeConfig:nc,create:rc}=k;function yt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)r!=="__proto__"&&(e[r]=n[r])}return e}var el={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function Qt(e,t){function n(a,o,s){if(!(typeof document>"u")){s=yt({},t,s),typeof s.expires=="number"&&(s.expires=new Date(Date.now()+s.expires*864e5)),s.expires&&(s.expires=s.expires.toUTCString()),a=encodeURIComponent(a).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var i="";for(var c in s)s[c]&&(i+="; "+c,s[c]!==!0&&(i+="="+s[c].split(";")[0]));return document.cookie=a+"="+e.write(o,a)+i}}function r(a){if(!(typeof document>"u"||arguments.length&&!a)){for(var o=document.cookie?document.cookie.split("; "):[],s={},i=0;i<o.length;i++){var c=o[i].split("="),f=c.slice(1).join("=");try{var u=decodeURIComponent(c[0]);if(u in s||(s[u]=e.read(f,u)),a===u)break}catch{}}return a?s[a]:s}}return Object.create({set:n,get:r,remove:function(a,o){n(a,"",yt({},o,{expires:-1}))},withAttributes:function(a){return Qt(this.converter,yt({},this.attributes,a))},withConverter:function(a){return Qt(yt({},this.converter,a),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var ae=Qt(el,{path:"/"});const tl={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};let Te="";try{if(typeof{url:typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:_t&&_t.tagName.toUpperCase()==="SCRIPT"&&_t.src||new URL("complaint-app.umd.js",document.baseURI).href}<"u"&&tl?.VITE_API_URL)Te=void 0;else{const e=typeof process<"u"?process:null;e?.env?.VITE_API_URL&&(Te=e.env.VITE_API_URL)}}catch{}const Cr=e=>{Te=e||"",Ke.defaults.baseURL=Te},Or=e=>{e?ae.set("token",e,{secure:!0,sameSite:"Strict"}):ae.remove("token")},nl=()=>ae.get("token")||null,Ke=k.create({baseURL:Te,transformRequest:[function(e,t){const n=nl();return n?t.Authorization=`Bearer ${n}`:delete t.Authorization,e==null||typeof e=="string"?e:JSON.stringify(e)}],headers:{Accept:"application/json","Content-Type":"application/json"}});let Zt=!1,en=null;Ke.interceptors.response.use(e=>e,async e=>{const t=e.config,n=e.response;if(n&&(n.status===401||n.status===402)){const r=ae.get("refreshToken");if(r)try{Zt||(Zt=!0,en=k.post(`${Te}/api/v1/auth/refresh`,{},{headers:{Authorization:`Bearer ${r}`}}));const a=await en,{token:o,refreshToken:s}=a.data;return ae.set("token",o,{secure:!0,sameSite:"Strict"}),s&&ae.set("refreshToken",s),t.headers.Authorization=`Bearer ${o}`,Ke(t)}catch{ae.remove("token"),ae.remove("refreshToken")}finally{Zt=!1,en=null}}return Promise.reject(e)});const rl=F.createContext(null),xr=({children:e,apiUrl:t,authToken:n})=>(F.useEffect(()=>{t&&Cr(t)},[t]),F.useEffect(()=>{Or(n||null)},[n]),l.jsx(rl.Provider,{value:{apiUrl:t,authToken:n},children:e})),Q={mode:"light",colors:{primary:"#2D64B8",primaryHover:"#2557A3",text:"#111827",textSecondary:"#6B7280",textMuted:"#9CA3AF",border:"#E5E7EB",borderLight:"#F3F4F6",background:"#F5F5F5",surface:"#FFFFFF",white:"#FFFFFF",onPrimary:"#FFFFFF",activeBg:"#ECFDF5",activeBorder:"#A7F3D0",activeText:"#059669",inactiveBg:"#F3F4F6",inactiveBorder:"#D1D5DB",inactiveText:"#6B7280",link:"#2D64B8",divider:"#E5E7EB",accentBorder:"#C5D7F0",accentBg:"#EEF4FB",stepDone:"#D6E4F7",success:"#22C55E",danger:"#EF4444",secondaryBtn:"#D1D5DB",secondaryBtnHover:"#C4C9D1",inputBg:"#FFFFFF",tableHeadBg:"#EEF4FB",sidebarBg:"#FAFBFD",overlay:"rgba(16, 24, 40, 0.06)"},radii:{sm:"6px",md:"8px",lg:"12px",xl:"16px",pill:"999px"},spacing:{xs:"4px",sm:"8px",md:"12px",lg:"16px",xl:"24px",xxl:"32px"},typography:{fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',h1Size:"28px",h2Size:"16px",bodySize:"14px",labelSize:"13px",valueSize:"22px",smallSize:"13px"},shadow:{card:"0 1px 2px rgba(16, 24, 40, 0.04)",settings:"0 1px 3px rgba(16, 24, 40, 0.06)"}},Xe={mode:"dark",colors:{primary:"#5B8DEF",primaryHover:"#7BA3F3",text:"#F3F4F6",textSecondary:"#A1A1AA",textMuted:"#71717A",border:"#3F3F46",borderLight:"#27272A",background:"#0F1115",surface:"#18181B",white:"#FFFFFF",onPrimary:"#FFFFFF",activeBg:"#052E1C",activeBorder:"#166534",activeText:"#4ADE80",inactiveBg:"#27272A",inactiveBorder:"#3F3F46",inactiveText:"#A1A1AA",link:"#7BA3F3",divider:"#3F3F46",accentBorder:"#2A3A55",accentBg:"#1A2333",stepDone:"#1E3A5F",success:"#22C55E",danger:"#F87171",secondaryBtn:"#3F3F46",secondaryBtnHover:"#52525B",inputBg:"#18181B",tableHeadBg:"#1A2333",sidebarBg:"#12141A",overlay:"rgba(0, 0, 0, 0.35)"},radii:{sm:"6px",md:"8px",lg:"12px",xl:"16px",pill:"999px"},spacing:{xs:"4px",sm:"8px",md:"12px",lg:"16px",xl:"24px",xxl:"32px"},typography:{fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',h1Size:"28px",h2Size:"16px",bodySize:"14px",labelSize:"13px",valueSize:"22px",smallSize:"13px"},shadow:{card:"0 1px 2px rgba(0, 0, 0, 0.35)",settings:"0 1px 3px rgba(0, 0, 0, 0.4)"}},Tr={light:Q,dark:Xe};function Ae(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)}function Pe(e,t){if(!Ae(t))return e;const n={...e};return Object.keys(t).forEach(r=>{const a=t[r];Ae(a)&&Ae(e[r])?n[r]=Pe(e[r],a):a!==void 0&&(n[r]=a)}),n}function Ar(e){return!e||!Ae(e)?{light:Q,dark:Xe}:Ae(e.light)||Ae(e.dark)?{light:Pe(Q,e.light||{}),dark:Pe(Xe,e.dark||{})}:{light:Pe(Q,e),dark:Pe(Xe,e)}}function Pr(e,t=!1){const n=Ar(e);return{...t?n.dark:n.light,mode:t?"dark":"light",__pack:n}}const al={primary:"--ca-primary",primaryHover:"--ca-primary-hover",text:"--ca-text",textSecondary:"--ca-text-secondary",textMuted:"--ca-text-muted",border:"--ca-border",borderLight:"--ca-border-light",background:"--ca-bg",surface:"--ca-surface",white:"--ca-white",onPrimary:"--ca-on-primary",activeBg:"--ca-active-bg",activeBorder:"--ca-active-border",activeText:"--ca-active-text",inactiveBg:"--ca-inactive-bg",inactiveBorder:"--ca-inactive-border",inactiveText:"--ca-inactive-text",link:"--ca-link",divider:"--ca-divider",accentBorder:"--ca-accent-border",accentBg:"--ca-accent-bg",stepDone:"--ca-step-done",success:"--ca-success",danger:"--ca-danger",secondaryBtn:"--ca-secondary-btn",secondaryBtnHover:"--ca-secondary-btn-hover",inputBg:"--ca-input-bg",tableHeadBg:"--ca-table-head-bg",sidebarBg:"--ca-sidebar-bg",overlay:"--ca-overlay"},ol={sm:"--ca-radius-sm",md:"--ca-radius-md",lg:"--ca-radius-lg",xl:"--ca-radius-xl",pill:"--ca-radius-pill"},sl={fontFamily:"--ca-font",h1Size:"--ca-h1-size",h2Size:"--ca-h2-size",bodySize:"--ca-body-size",labelSize:"--ca-label-size",valueSize:"--ca-value-size",smallSize:"--ca-small-size"},il={card:"--ca-shadow-card",settings:"--ca-shadow-settings"};function Fr(e){const t={};return e?.colors&&Object.entries(al).forEach(([n,r])=>{e.colors[n]!=null&&(t[r]=e.colors[n])}),e?.radii&&Object.entries(ol).forEach(([n,r])=>{e.radii[n]!=null&&(t[r]=e.radii[n])}),e?.typography&&Object.entries(sl).forEach(([n,r])=>{e.typography[n]!=null&&(t[r]=e.typography[n])}),e?.shadow&&Object.entries(il).forEach(([n,r])=>{e.shadow[n]!=null&&(t[r]=e.shadow[n])}),t["--ca-on-primary"]&&!t["--ca-white"]&&(t["--ca-white"]=t["--ca-on-primary"]),t}const Dr=F.createContext({darkMode:!1,theme:null,themeFile:Tr,cssVars:{}});function kr({theme:e,darkMode:t=!1,children:n}){const r=F.useMemo(()=>{const a=Pr(e,!!t),o=Fr(a);return{darkMode:!!t,theme:a,themeFile:a.__pack,cssVars:o,mode:a.mode}},[e,t]);return l.jsx(Dr.Provider,{value:r,children:n})}function Lr(){return F.useContext(Dr)}function K({children:e,variant:t="primary",size:n="md",startIcon:r,endIcon:a,className:o="",type:s="button",disabled:i=!1,onClick:c,...f}){const u=["ca-btn",`ca-btn--${t}`,n==="sm"?"ca-btn--sm":"",n==="lg"?"ca-btn--lg":"",o].filter(Boolean).join(" ");return l.jsxs("button",{type:s,className:u,disabled:i,onClick:c,...f,children:[r?l.jsx("span",{className:"ca-btn__icon",children:r}):null,e,a?l.jsx("span",{className:"ca-btn__icon",children:a}):null]})}function tn({size:e=16,color:t="currentColor",...n}){return l.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...n,children:l.jsx("path",{d:"M12 5v14M5 12h14",stroke:t,strokeWidth:"2",strokeLinecap:"round"})})}const Br={h1:"ca-h1",h2:"ca-h2",body:"ca-body",label:"ca-label",value:"ca-value",small:"ca-small",link:"ca-link"},ll={h1:"h1",h2:"h2",body:"p",label:"span",value:"span",small:"span",link:"button"};function oe({variant:e="body",as:t,className:n="",children:r,...a}){const o=t||ll[e]||"p",s=Br[e]||Br.body;return l.jsx(o,{className:`${s} ${n}`.trim(),...a,children:r})}function nn(e){return l.jsx(oe,{variant:"h1",...e})}function se(e){return l.jsx(oe,{variant:"h2",...e})}function X(e){return l.jsx(oe,{variant:"body",...e})}function bt(e){return l.jsx(oe,{variant:"label",...e})}function Ur(e){return l.jsx(oe,{variant:"value",...e})}function Rr(e){return l.jsx(oe,{variant:"link",type:"button",...e})}function Ir({title:e="Complaint Management",description:t,actionLabel:n="Create New Form",onAction:r,className:a=""}){return l.jsxs("header",{className:`ca-page-header ${a}`.trim(),children:[l.jsxs("div",{className:"ca-page-header__text",children:[l.jsx(nn,{children:e}),t?l.jsx(X,{children:t}):null]}),l.jsx("div",{className:"ca-page-header__actions",children:l.jsx(K,{startIcon:l.jsx(tn,{}),onClick:r,children:n})})]})}function rn({status:e="inactive",label:t,className:n=""}){const a=String(e).toLowerCase()==="active",o=t??(a?"Active":"Inactive");return l.jsx("span",{className:`ca-badge ca-badge--${a?"active":"inactive"} ${n}`.trim(),children:o})}function Mr({title:e,status:t,statusLabel:n,titleAsLink:r=!1,onTitleClick:a,className:o=""}){return l.jsxs("div",{className:`ca-system-card__header ${o}`.trim(),children:[l.jsx("div",{className:"ca-system-card__title-wrap",children:r?l.jsx("button",{type:"button",className:"ca-h2 ca-h2--link",onClick:a,children:e}):l.jsx(se,{children:e})}),l.jsx(rn,{status:t,label:n})]})}function Ge({size:e=16,color:t="currentColor",...n}){return l.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...n,children:l.jsx("path",{d:"M9 6l6 6-6 6",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function jr({updatedOn:e,configureLabel:t="Configure",onConfigure:n,className:r=""}){return l.jsxs("div",{className:`ca-system-card__footer ${r}`.trim(),children:[l.jsx(oe,{variant:"small",as:"span",children:e?`Updated on ${e}`:""}),l.jsx(K,{size:"sm",onClick:n,endIcon:l.jsx(Ge,{size:14,color:"#fff"}),children:t})]})}function $r({label:e,value:t,className:n=""}){const r=t==null?"β€”":typeof t=="number"?String(t).padStart(2,"0"):t;return l.jsxs("div",{className:`ca-data-point ${n}`.trim(),children:[l.jsx(bt,{children:e}),l.jsx(Ur,{children:r})]})}function Vr({className:e=""}){return l.jsx("div",{className:`ca-divider ${e}`.trim(),role:"separator","aria-orientation":"vertical"})}function Hr({id:e,title:t,status:n="inactive",statusLabel:r,description:a,descriptionHref:o,departments:s,workflows:i,fields:c,formsFilled:f,updatedOn:u,titleAsLink:d=!1,onTitleClick:p,onDescriptionClick:E,onConfigure:v,className:N=""}){const g=()=>{v?.({id:e,title:t,status:n,departments:s,workflows:i,fields:c,formsFilled:f,updatedOn:u})},m=()=>{if(E){E({id:e,title:t,descriptionHref:o});return}o&&typeof window<"u"&&window.open(o,"_blank","noopener,noreferrer")},y=[{label:"Departments",value:s},{label:"Workflows",value:i},{label:"Fields",value:c},{label:"Forms Filled",value:f}];return l.jsxs("article",{className:`ca-system-card ${N}`.trim(),children:[l.jsx(Mr,{title:t,status:n,statusLabel:r,titleAsLink:d,onTitleClick:()=>p?.({id:e,title:t})}),a?l.jsx(Rr,{onClick:m,children:a}):null,l.jsx("div",{className:"ca-system-card__stats",children:y.map((w,C)=>l.jsxs(F.Fragment,{children:[C>0?l.jsx(Vr,{}):null,l.jsx($r,{label:w.label,value:w.value})]},w.label))}),l.jsx(jr,{updatedOn:u,onConfigure:g})]})}function zr({systems:e=[],onConfigure:t,onTitleClick:n,onDescriptionClick:r,emptyMessage:a="No systems found.",className:o=""}){return e.length?l.jsx("div",{className:`ca-system-grid ${o}`.trim(),children:e.map(s=>l.jsx(Hr,{...s,onConfigure:t,onTitleClick:n,onDescriptionClick:r},s.id??s.title))}):l.jsx("div",{className:`ca-system-grid ${o}`.trim(),children:l.jsx("div",{className:"ca-empty",children:l.jsx(X,{children:a})})})}function ie({value:e,onChange:t,placeholder:n,type:r="text",icon:a,className:o="",inputClassName:s="",...i}){return l.jsxs("div",{className:`ca-input-wrap ${o}`.trim(),children:[a?l.jsx("span",{className:"ca-input-wrap__icon",children:a}):null,l.jsx("input",{type:r,className:`ca-input ${a?"ca-input--with-icon":""} ${s}`.trim(),value:e,onChange:t,placeholder:n,...i})]})}function qr({size:e=18,color:t="currentColor",...n}){return l.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...n,children:[l.jsx("path",{d:"M10.5 18a7.5 7.5 0 1 1 0-15 7.5 7.5 0 0 1 0 15Z",stroke:t,strokeWidth:"1.75"}),l.jsx("path",{d:"M16.5 16.5 21 21",stroke:t,strokeWidth:"1.75",strokeLinecap:"round"})]})}function Wr({value:e,onChange:t,onSearch:n,placeholder:r="Search",className:a=""}){const o=s=>{s.key==="Enter"&&n&&n(e)};return l.jsx("div",{className:`ca-search ${a}`.trim(),children:l.jsx(ie,{value:e,onChange:t,onKeyDown:o,placeholder:r,icon:l.jsx(qr,{}),"aria-label":r})})}function Jr({text:e="Loading",fullScreen:t=!1}){return l.jsxs("div",{className:"ca-loading",style:t?{minHeight:"calc(100vh - 80px)"}:void 0,role:"status","aria-live":"polite",children:[l.jsx("span",{className:"ca-loading__spinner"}),l.jsxs("span",{children:[e,"…"]})]})}const Kr=[{id:"qms",title:"QMS - Query Management System",status:"active",description:"Description of the template",departments:3,workflows:12,fields:55,formsFilled:234,updatedOn:"12 Mar 2024",titleAsLink:!0},{id:"cms",title:"CMS - Complaint Management System",status:"active",description:"Description of the template",departments:5,workflows:8,fields:42,formsFilled:189,updatedOn:"08 Mar 2024"},{id:"fms",title:"FMS - Feedback Management System",status:"inactive",description:"Description of the template",departments:2,workflows:4,fields:28,formsFilled:56,updatedOn:"01 Feb 2024"},{id:"rms",title:"RMS - Request Management System",status:"active",description:"Description of the template",departments:4,workflows:10,fields:61,formsFilled:312,updatedOn:"20 Mar 2024"}],Xr="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi.";function Gr(e=[]){return e.map((t,n)=>({id:t.id??t._id??`system-${n}`,title:t.title??t.name??"Untitled",status:t.status??"inactive",statusLabel:t.statusLabel,description:t.description??t.templateDescription,descriptionHref:t.descriptionHref??t.url,departments:t.departments??t.departmentCount??0,workflows:t.workflows??t.workflowCount??0,fields:t.fields??t.fieldCount??0,formsFilled:t.formsFilled??t.formFilledCount??t.forms_filled??0,updatedOn:t.updatedOn??t.updatedAt??t.updated_on,titleAsLink:!!(t.titleAsLink??t.isLink)}))}function Yr({title:e="Complaint Management",description:t=Xr,systems:n,systemsEndpoint:r,useDemoData:a=!0,createLabel:o="Create New Form",onCreateForm:s,onConfigure:i,onTitleClick:c,onDescriptionClick:f,onSearch:u}){const d=et(),[p,E]=F.useState(""),[v,N]=F.useState(null),[g,m]=F.useState(null),[y,w]=F.useState(r&&!n?"loading":"idle");F.useEffect(()=>{if(!r||n)return;const B=new AbortController;return Ke.get(r,{signal:B.signal}).then(D=>{const U=D?.data,De=Array.isArray(U)?U:U?.data??U?.systems??U?.results??[];N(Gr(De)),m(null),w("success")}).catch(D=>{B.signal.aborted||(m(D?.message||"Failed to load systems"),N([]),w("error"))}),()=>B.abort()},[r,n]);const C=F.useMemo(()=>n?Gr(n):v||(a?Kr:[]),[n,v,a]),P=F.useMemo(()=>{const B=p.trim().toLowerCase();return B?C.filter(D=>`${D.title} ${D.description??""} ${D.status??""}`.toLowerCase().includes(B)):C},[C,p]),T=B=>{const D=B.target.value;E(D),u?.(D)},$=B=>{i?.(B),d(`/settings/${B.id??"new"}?step=1`)},Z=y==="loading";return l.jsxs(l.Fragment,{children:[l.jsx(Ir,{title:e,description:t,actionLabel:o,onAction:s}),l.jsx(Wr,{value:p,onChange:T,placeholder:"Search"}),Z?l.jsx(Jr,{text:"Loading systems"}):g?l.jsx("div",{className:"ca-empty",children:l.jsx("p",{className:"ca-body",children:g})}):l.jsx(zr,{systems:P,onConfigure:$,onTitleClick:c,onDescriptionClick:f,emptyMessage:p?"No systems match your search.":"No systems found."})]})}function an({steps:e=[],currentStep:t=1,onStepClick:n,className:r="",size:a="md"}){return l.jsx("nav",{className:`ca-stepper ca-stepper--${a} ${r}`.trim(),"aria-label":"Progress",children:e.map((o,s)=>{const i=o.id??s+1,c=i===t,f=i<t,u=!!n&&(f||c);return l.jsxs(F.Fragment,{children:[s>0?l.jsx("div",{className:`ca-stepper__line ${f||c?"ca-stepper__line--active":""}`}):null,l.jsxs("button",{type:"button",className:["ca-stepper__item",c?"ca-stepper__item--active":"",f?"ca-stepper__item--done":""].filter(Boolean).join(" "),onClick:()=>u&&n?.(i),disabled:!u,"aria-current":c?"step":void 0,children:[l.jsx("span",{className:"ca-stepper__circle",children:i}),l.jsx("span",{className:"ca-stepper__label",children:o.label})]})]},i)})})}const Qr=F.createContext(null),cl={categoryType:"qms",active:!0,description:"",roles:["Store Staff","HR Executive","HR Manager"],departmentRows:[{id:"1",department:"",subDepartment:"",roles:""}],priorityDraft:"",priorities:[],defaultPriorityId:null,selectedDeptNode:"payroll",workflow:{name:"",tatMinutes:"",description:"",statuses:[],steps:[]},fieldDraft:{name:"",type:""},formFields:[]};function Zr({children:e,initialValues:t}){const[n,r]=F.useState({...cl,...t}),a=F.useCallback(i=>{r(c=>({...c,...i}))},[]),o=F.useCallback(i=>{r(c=>({...c,workflow:{...c.workflow,...i}}))},[]),s=F.useMemo(()=>({state:n,setState:r,update:a,updateWorkflow:o}),[n,a,o]);return l.jsx(Qr.Provider,{value:s,children:e})}function ye(){const e=F.useContext(Qr);if(!e)throw new Error("useSettingsWizard must be used within SettingsWizardProvider");return e}const be=[{id:1,key:"category",label:"Category Type",title:"Category Type",description:"Define the type and basic details for this category type."},{id:2,key:"departments",label:"Departments",title:"Departments",description:"----"},{id:3,key:"priorities",label:"Priorities",title:"Priorities",description:"----"},{id:4,key:"workflow",label:"Workflow",title:"Workflow",description:"----"},{id:5,key:"formFields",label:"Form Fields",title:"Form Fields",description:"----"},{id:6,key:"review",label:"Review & Publish",title:"Review & Publish",description:"Review your configuration and publish."}],on=[{id:1,label:"Create Workflow"},{id:2,label:"Statuses"},{id:3,label:"Workflow Steps"}],dl=["Urgent","High","Medium","Low"],ea=[{id:"short",label:"Textfield / Short Answer",icon:"text"},{id:"long",label:"Description / Long Answer",icon:"doc"},{id:"date",label:"Date",icon:"calendar"},{id:"time",label:"Time",icon:"clock"},{id:"single",label:"Dropdown - Single Select",icon:"chevron"},{id:"multi",label:"Dropdown - Multiple Select",icon:"chevron"}],ta=["Store Staff","HR Executive","HR Manager","Store Manager","Admin"],na=[{value:"qms",label:"QMS - Query Management System"},{value:"cms",label:"CMS - Complaint Management System"},{value:"fms",label:"FMS - Feedback Management System"},{value:"rms",label:"RMS - Request Management System"}],ul=[{id:"hr",name:"HR",children:[{id:"payroll",name:"Payroll"},{id:"recruitment",name:"Recruitment"}]},{id:"finance",name:"Finance",children:[{id:"ap",name:"Accounts Payable"}]},{id:"it",name:"IT",children:[]}],fl=[{value:"#EF4444",label:"Red"},{value:"#F59E0B",label:"Orange"},{value:"#EAB308",label:"Yellow"},{value:"#22C55E",label:"Green"},{value:"#3B82F6",label:"Blue"},{value:"#8B5CF6",label:"Purple"}];function ra({size:e=28,color:t="currentColor",...n}){return l.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",style:{color:"var(--ca-primary)"},...n,children:[l.jsx("path",{d:"M12 3 3 8l9 5 9-5-9-5Z",stroke:t,strokeWidth:"1.6",strokeLinejoin:"round"}),l.jsx("path",{d:"M3 12.5 12 17.5l9-5",stroke:t,strokeWidth:"1.6",strokeLinejoin:"round",strokeLinecap:"round"}),l.jsx("path",{d:"M3 16.5 12 21.5l9-5",stroke:t,strokeWidth:"1.6",strokeLinejoin:"round",strokeLinecap:"round"})]})}function aa({title:e,description:t,nextLabel:n="Next",onNext:r,showNext:a=!0,nextDisabled:o=!1,nextVariant:s="primary",className:i=""}){return l.jsxs("div",{className:`ca-settings-card__header ${i}`.trim(),children:[l.jsxs("div",{className:"ca-settings-card__heading",children:[l.jsx(ra,{}),l.jsxs("div",{children:[l.jsx(se,{children:e}),t?l.jsx(X,{className:"ca-settings-card__desc",children:t}):null]})]}),a?l.jsx(K,{variant:s,disabled:o,onClick:r,endIcon:l.jsx(Ge,{size:14,color:"currentColor"}),children:n}):null]})}function ve({title:e,description:t,onNext:n,nextLabel:r,showNext:a=!0,nextDisabled:o,nextVariant:s,children:i,footer:c,className:f=""}){return l.jsxs("section",{className:`ca-settings-card ${f}`.trim(),children:[l.jsx(aa,{title:e,description:t,onNext:n,nextLabel:r,showNext:a,nextDisabled:o,nextVariant:s}),l.jsx("div",{className:"ca-settings-card__divider"}),l.jsx("div",{className:"ca-settings-card__body",children:i}),c?l.jsx("div",{className:"ca-settings-card__footer",children:c}):null]})}function Fe({children:e,hint:t,htmlFor:n,className:r=""}){return l.jsxs("div",{className:`ca-field-label ${r}`.trim(),children:[l.jsx("label",{className:"ca-label",htmlFor:n,children:e}),t!=null?l.jsx("span",{className:"ca-field-label__hint",children:t}):null]})}function oa({size:e=16,color:t="currentColor",...n}){return l.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...n,children:l.jsx("path",{d:"M6 9l6 6 6-6",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function le({value:e,onChange:t,options:n=[],placeholder:r="Select",className:a="",disabled:o=!1,...s}){return l.jsxs("div",{className:`ca-select ${a}`.trim(),children:[l.jsxs("select",{className:"ca-select__control",value:e??"",onChange:t,disabled:o,...s,children:[l.jsx("option",{value:"",disabled:!0,children:r}),n.map(i=>{const c=typeof i=="string"?i:i.value,f=typeof i=="string"?i:i.label;return l.jsx("option",{value:c,children:f},c)})]}),l.jsx("span",{className:"ca-select__chevron",children:l.jsx(oa,{size:16})})]})}function sa({value:e,onChange:t,placeholder:n,maxLength:r,rows:a=4,className:o="",...s}){return l.jsx("textarea",{className:`ca-textarea ${o}`.trim(),value:e,onChange:t,placeholder:n,maxLength:r,rows:a,...s})}function vt({label:e,hint:t,children:n,className:r="",htmlFor:a}){return l.jsxs("div",{className:`ca-form-field ${r}`.trim(),children:[e!=null?l.jsx(Fe,{htmlFor:a,hint:t,children:e}):null,n]})}function sn({label:e,hint:t,...n}){return l.jsx(vt,{label:e,hint:t,htmlFor:n.id,children:l.jsx(ie,{...n})})}function ia({label:e,hint:t,...n}){return l.jsx(vt,{label:e,hint:t,htmlFor:n.id,children:l.jsx(le,{...n})})}function ln({label:e,hint:t,maxLength:n,value:r="",...a}){const o=t??(n!=null?`${String(r).length}/${n}`:void 0);return l.jsx(vt,{label:e,hint:o,htmlFor:a.id,children:l.jsx(sa,{value:r,maxLength:n,...a})})}function cn({checked:e=!1,onChange:t,disabled:n=!1,"aria-label":r="Toggle",className:a=""}){return l.jsx("button",{type:"button",role:"switch","aria-checked":e,"aria-label":r,disabled:n,className:`ca-toggle ${e?"ca-toggle--on":""} ${a}`.trim(),onClick:()=>t?.(!e),children:l.jsx("span",{className:"ca-toggle__thumb"})})}function la({label:e="Active",checked:t,onChange:n,className:r=""}){return l.jsxs("div",{className:`ca-toggle-field ${r}`.trim(),children:[l.jsx(bt,{children:e}),l.jsx(cn,{checked:t,onChange:n,"aria-label":e})]})}function ca({size:e=12,color:t="currentColor",...n}){return l.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...n,children:l.jsx("path",{d:"M6 6l12 12M18 6L6 18",stroke:t,strokeWidth:"2",strokeLinecap:"round"})})}function da({label:e,onRemove:t,className:n=""}){return l.jsxs("span",{className:`ca-tag ${n}`.trim(),children:[e,t?l.jsx("button",{type:"button",className:"ca-tag__remove",onClick:t,"aria-label":`Remove ${e}`,children:l.jsx(ca,{size:10})}):null]})}function ua({label:e="Select Roles",options:t=[],value:n=[],onChange:r,placeholder:a="Select roles",className:o=""}){const[s,i]=F.useState(""),c=t.filter(d=>{const p=typeof d=="string"?d:d.value;return!n.includes(p)}),f=d=>{const p=d.target.value;p&&(r?.([...n,p]),i(""))},u=d=>{r?.(n.filter(p=>p!==d))};return l.jsxs("div",{className:`ca-role-select ${o}`.trim(),children:[l.jsx(Fe,{children:e}),l.jsx(le,{value:s,onChange:f,options:c,placeholder:a}),n.length>0?l.jsx("div",{className:"ca-tag-list",children:n.map(d=>l.jsx(da,{label:d,onRemove:()=>u(d)},d))}):null]})}function hl({onNext:e,stepMeta:t}){const{state:n,update:r}=ye();return l.jsxs(ve,{title:t.title,description:t.description,onNext:e,children:[l.jsx("div",{className:"ca-step-section",children:l.jsxs("div",{className:"ca-step-row ca-step-row--category",children:[l.jsx(ia,{label:"Category Type",className:"ca-step-row__grow",value:n.categoryType,onChange:a=>r({categoryType:a.target.value}),options:na,placeholder:"Select category type"}),l.jsx(la,{checked:n.active,onChange:a=>r({active:a})})]})}),l.jsx("div",{className:"ca-step-section",children:l.jsx(ln,{label:"Description",placeholder:"Enter description",maxLength:500,value:n.description,onChange:a=>r({description:a.target.value}),rows:5})}),l.jsx("div",{className:"ca-step-section ca-step-section--last",children:l.jsx(ua,{options:ta,value:n.roles,onChange:a=>r({roles:a})})})]})}const pl=["HR","Finance","IT","Operations","Sales"];function ml(){return{id:`${Date.now()}-${Math.random().toString(36).slice(2,7)}`,department:"",subDepartment:"",roles:""}}function gl({onNext:e,stepMeta:t}){const{state:n,update:r}=ye(),a=n.departmentRows,o=(i,c)=>{r({departmentRows:a.map(f=>f.id===i?{...f,...c}:f)})},s=()=>{r({departmentRows:[...a,ml()]})};return l.jsx(ve,{title:t.title,description:t.description,onNext:e,children:l.jsxs("div",{className:"ca-dept-table",children:[l.jsxs("div",{className:"ca-dept-table__head",children:[l.jsx("div",{children:"Department"}),l.jsx("div",{children:"Sub-department"}),l.jsx("div",{children:"Roles"}),l.jsx("div",{})]}),a.map(i=>l.jsxs("div",{className:"ca-dept-table__row",children:[l.jsx(le,{value:i.department,onChange:c=>o(i.id,{department:c.target.value}),options:pl,placeholder:"Select or add department"}),l.jsxs("div",{className:"ca-input-with-action",children:[l.jsx(ie,{value:i.subDepartment,onChange:c=>o(i.id,{subDepartment:c.target.value}),placeholder:"Add sub-department"}),l.jsx("button",{type:"button",className:"ca-input-with-action__btn","aria-label":"Add sub-department",onClick:()=>{i.subDepartment.trim()},children:l.jsx(tn,{size:14,color:"currentColor"})})]}),l.jsx(le,{value:i.roles,onChange:c=>o(i.id,{roles:c.target.value}),options:ta,placeholder:"Select roles"}),l.jsx(K,{variant:"link",size:"sm",onClick:s,children:"+ Add"})]},i.id))]})})}function fa({children:e,onClick:t,className:n="",active:r=!1}){return l.jsx("button",{type:"button",className:`ca-chip ${r?"ca-chip--active":""} ${n}`.trim(),onClick:t,children:e})}function ha({checked:e=!1,onChange:t,name:n,value:r,"aria-label":a,className:o=""}){return l.jsxs("label",{className:`ca-radio ${o}`.trim(),children:[l.jsx("input",{type:"radio",className:"ca-radio__input",name:n,value:r,checked:e,onChange:t,"aria-label":a}),l.jsx("span",{className:"ca-radio__mark"})]})}function dn({size:e=16,color:t="#9CA3AF",...n}){return l.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...n,children:[l.jsx("circle",{cx:"5",cy:"4",r:"1.2",fill:t}),l.jsx("circle",{cx:"11",cy:"4",r:"1.2",fill:t}),l.jsx("circle",{cx:"5",cy:"8",r:"1.2",fill:t}),l.jsx("circle",{cx:"11",cy:"8",r:"1.2",fill:t}),l.jsx("circle",{cx:"5",cy:"12",r:"1.2",fill:t}),l.jsx("circle",{cx:"11",cy:"12",r:"1.2",fill:t})]})}function pa(e){return{id:`${Date.now()}-${Math.random().toString(36).slice(2,7)}`,name:e,color:""}}function yl({onNext:e,stepMeta:t}){const{state:n,update:r}=ye(),{priorityDraft:a,priorities:o,defaultPriorityId:s}=n,i=u=>{const d=(u??a).trim();if(!d)return;if(o.some(E=>E.name.toLowerCase()===d.toLowerCase())){r({priorityDraft:""});return}const p=[...o,pa(d)];r({priorities:p,priorityDraft:"",defaultPriorityId:s??p[0].id})},c=(u,d)=>{r({priorities:o.map(p=>p.id===u?{...p,...d}:p)})},f=fl.map(u=>({value:u.value,label:u.label}));return l.jsxs(ve,{title:t.title,description:t.description,onNext:e,children:[l.jsxs("div",{className:"ca-priority-add",children:[l.jsx(Fe,{children:"Priorities"}),l.jsxs("div",{className:"ca-priority-add__row",children:[l.jsx(ie,{value:a,onChange:u=>r({priorityDraft:u.target.value}),placeholder:"Add priority",onKeyDown:u=>{u.key==="Enter"&&(u.preventDefault(),i())}}),l.jsx(K,{variant:"outline",onClick:()=>i(),children:"+ Add"})]}),l.jsx("div",{className:"ca-chip-row",children:dl.map(u=>l.jsxs(fa,{onClick:()=>i(u),children:["+ ",u]},u))})]}),l.jsxs("div",{className:"ca-priority-table",children:[l.jsxs("div",{className:"ca-priority-table__head",children:[l.jsx("div",{children:"Priority"}),l.jsx("div",{children:"Color"}),l.jsx("div",{children:"Default"})]}),(o.length?o:[pa("")]).map((u,d)=>{const p=!o.length;return l.jsxs("div",{className:"ca-priority-table__row",children:[l.jsxs("div",{className:"ca-priority-table__name",children:[l.jsx(dn,{}),l.jsx(ie,{value:p?a:u.name,onChange:E=>{p?r({priorityDraft:E.target.value}):c(u.id,{name:E.target.value})},placeholder:"Add priority"})]}),l.jsx(le,{value:u.color,onChange:E=>{p||c(u.id,{color:E.target.value})},options:f,placeholder:"Select color"}),l.jsx(ha,{name:"default-priority",value:u.id,checked:!p&&s===u.id,onChange:()=>!p&&r({defaultPriorityId:u.id}),"aria-label":"Default priority"})]},u.id||d)})]})]})}function bl({onNext:e,stepMeta:t,substep:n=1,onSubstepChange:r}){const{state:a,update:o,updateWorkflow:s}=ye(),{selectedDeptNode:i,workflow:c}=a,f=()=>{if(n<on.length){r?.(n+1);return}e?.()};return l.jsx(ve,{title:t.title,description:t.description,onNext:e,nextVariant:"secondary",children:l.jsxs("div",{className:"ca-workflow",children:[l.jsxs("aside",{className:"ca-workflow__sidebar",children:[l.jsx("h3",{className:"ca-workflow__sidebar-title",children:"Select Department"}),l.jsx("p",{className:"ca-small",children:"Add workflow for selected department"}),l.jsx("ul",{className:"ca-dept-tree",children:ul.map(u=>l.jsxs("li",{className:"ca-dept-tree__group",children:[l.jsx("button",{type:"button",className:`ca-dept-tree__item ${i===u.id?"ca-dept-tree__item--active":""}`,onClick:()=>o({selectedDeptNode:u.id}),children:u.name}),u.children?.length?l.jsx("ul",{className:"ca-dept-tree__children",children:u.children.map(d=>l.jsx("li",{children:l.jsxs("button",{type:"button",className:`ca-dept-tree__item ca-dept-tree__item--child ${i===d.id?"ca-dept-tree__item--active":""}`,onClick:()=>o({selectedDeptNode:d.id}),children:[l.jsx("span",{className:"ca-dept-tree__branch","aria-hidden":"true",children:"β””"}),d.name]})},d.id))}):null]},u.id))})]}),l.jsxs("div",{className:"ca-workflow__main",children:[l.jsx(an,{steps:on,currentStep:n,onStepClick:r,size:"sm",className:"ca-workflow__substepper"}),n===1?l.jsxs("div",{className:"ca-workflow__form",children:[l.jsxs("div",{className:"ca-step-row",children:[l.jsx(sn,{className:"ca-step-row__grow",label:"Name",placeholder:"Enter name",value:c.name,onChange:u=>s({name:u.target.value})}),l.jsx(sn,{className:"ca-step-row__grow",label:"TAT Minutes",placeholder:"Enter here",value:c.tatMinutes,onChange:u=>s({tatMinutes:u.target.value})})]}),l.jsx(ln,{label:"Description",placeholder:"Enter description",value:c.description,onChange:u=>s({description:u.target.value}),rows:5})]}):null,n===2?l.jsx("div",{className:"ca-workflow__placeholder",children:l.jsx("p",{className:"ca-body",children:"Configure workflow statuses for the selected department."})}):null,n===3?l.jsx("div",{className:"ca-workflow__placeholder",children:l.jsx("p",{className:"ca-body",children:"Define ordered workflow steps and assignees."})}):null,l.jsx("div",{className:"ca-workflow__actions",children:l.jsx(K,{onClick:f,endIcon:l.jsx(Ge,{size:14,color:"#fff"}),children:"Next Step"})})]})]})})}function ma({size:e=16,color:t="#9CA3AF",...n}){return l.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...n,children:l.jsx("path",{d:"M4 7h16M9 7V5a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2m2 0v12a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2V7h12Z",stroke:t,strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}const wt=ea.map(e=>({value:e.id,label:e.label}));function vl({type:e}){const t={text:"A",doc:"ΒΆ",calendar:"口",clock:"β—·",chevron:"β–Ύ"};return l.jsx("span",{className:"ca-field-lib__glyph",children:t[e]||"β–Ύ"})}function wl({onNext:e,stepMeta:t}){const{state:n,update:r}=ye(),{fieldDraft:a,formFields:o}=n,s=d=>r({fieldDraft:{...a,...d}}),i=()=>{if(!a.name.trim()||!a.type)return;const d=wt.find(p=>p.value===a.type)?.label||a.type;r({formFields:[...o,{id:`${Date.now()}`,name:a.name.trim(),type:a.type,typeLabel:d,required:!1}],fieldDraft:{name:"",type:""}})},c=(d,p)=>{r({formFields:o.map(E=>E.id===d?{...E,...p}:E)})},f=d=>{r({formFields:o.filter(p=>p.id!==d)})},u=d=>{s({type:d.id})};return l.jsx(ve,{title:t.title,description:t.description,showNext:!1,footer:l.jsx(K,{onClick:e,endIcon:l.jsx(Ge,{size:14,color:"#fff"}),children:"Next"}),children:l.jsxs("div",{className:"ca-form-fields",children:[l.jsxs("aside",{className:"ca-field-lib",children:[l.jsx("h3",{className:"ca-field-lib__title",children:"Field Library"}),l.jsx("p",{className:"ca-small",children:"Drag and drop the fields to add."}),l.jsx("ul",{className:"ca-field-lib__list",children:ea.map(d=>l.jsx("li",{children:l.jsxs("button",{type:"button",className:"ca-field-lib__item",draggable:!0,onDragStart:p=>{p.dataTransfer.setData("text/plain",d.id)},onClick:()=>u(d),children:[l.jsx(vl,{type:d.icon}),l.jsx("span",{children:d.label})]})},d.id))})]}),l.jsxs("div",{className:"ca-form-fields__main",children:[l.jsxs("div",{className:"ca-add-fields",onDragOver:d=>d.preventDefault(),onDrop:d=>{d.preventDefault();const p=d.dataTransfer.getData("text/plain");p&&s({type:p})},children:[l.jsxs("div",{className:"ca-add-fields__top",children:[l.jsx("h3",{className:"ca-add-fields__title",children:"Add Fields"}),l.jsx(K,{onClick:i,children:"Add Field"})]}),l.jsxs("div",{className:"ca-step-row",children:[l.jsxs("div",{className:"ca-step-row__grow",children:[l.jsx(Fe,{children:"Name of Field"}),l.jsx(ie,{value:a.name,onChange:d=>s({name:d.target.value}),placeholder:"Enter name of the field."})]}),l.jsxs("div",{className:"ca-step-row__grow",children:[l.jsx(Fe,{children:"Type of Field"}),l.jsx(le,{value:a.type,onChange:d=>s({type:d.target.value}),options:wt,placeholder:"Select type of the field."})]})]})]}),l.jsxs("div",{className:"ca-fields-table",children:[l.jsxs("div",{className:"ca-fields-table__head",children:[l.jsx("div",{children:"Field Name"}),l.jsx("div",{children:"Field Type"}),l.jsx("div",{children:"Required"}),l.jsx("div",{})]}),o.length===0?l.jsx("div",{className:"ca-fields-table__empty",children:l.jsx("p",{className:"ca-small",children:"No fields added yet."})}):o.map(d=>l.jsxs("div",{className:"ca-fields-table__row",children:[l.jsxs("div",{className:"ca-fields-table__name",children:[l.jsx(dn,{}),l.jsx(ie,{value:d.name,onChange:p=>c(d.id,{name:p.target.value})})]}),l.jsx(le,{value:d.type,onChange:p=>{const E=p.target.value,v=wt.find(N=>N.value===E)?.label||E;c(d.id,{type:E,typeLabel:v})},options:wt,placeholder:"Select type"}),l.jsx(cn,{checked:d.required,onChange:p=>c(d.id,{required:p}),"aria-label":"Required"}),l.jsx("button",{type:"button",className:"ca-icon-btn","aria-label":"Delete field",onClick:()=>f(d.id),children:l.jsx(ma,{})})]},d.id))]})]})]})})}function El({onPublish:e,stepMeta:t}){const{state:n}=ye(),r=na.find(a=>a.value===n.categoryType)?.label||n.categoryType;return l.jsx(ve,{title:t.title,description:t.description,nextLabel:"Publish",onNext:e,children:l.jsxs("div",{className:"ca-review",children:[l.jsxs("section",{className:"ca-review__block",children:[l.jsx(se,{children:"Category Type"}),l.jsxs("div",{className:"ca-review__row",children:[l.jsx(bt,{children:r}),l.jsx(rn,{status:n.active?"active":"inactive"})]}),n.description?l.jsx(X,{children:n.description}):null,n.roles.length?l.jsxs(X,{children:["Roles: ",n.roles.join(", ")]}):null]}),l.jsxs("section",{className:"ca-review__block",children:[l.jsx(se,{children:"Departments"}),l.jsxs(X,{children:[n.departmentRows.filter(a=>a.department).length," department row(s) configured"]})]}),l.jsxs("section",{className:"ca-review__block",children:[l.jsx(se,{children:"Priorities"}),l.jsx(X,{children:n.priorities.length?n.priorities.map(a=>a.name).join(", "):"No priorities added"})]}),l.jsxs("section",{className:"ca-review__block",children:[l.jsx(se,{children:"Workflow"}),l.jsx(X,{children:n.workflow.name?`${n.workflow.name} (TAT: ${n.workflow.tatMinutes||"β€”"} min)`:"No workflow created yet"})]}),l.jsxs("section",{className:"ca-review__block ca-review__block--last",children:[l.jsx(se,{children:"Form Fields"}),l.jsx(X,{children:n.formFields.length?n.formFields.map(a=>a.name).join(", "):"No form fields added"})]}),l.jsx("div",{className:"ca-workflow__actions",children:l.jsx(K,{onClick:e,children:"Publish"})})]})})}function Sl(e){const t=Number(e);return!Number.isFinite(t)||t<1?1:t>be.length?be.length:Math.floor(t)}function _l(e){const t=Number(e);return!Number.isFinite(t)||t<1?1:t>3?3:Math.floor(t)}function ga({title:e="Complaint Management Settings",onPublish:t,onStepChange:n}){const r=et(),{systemId:a}=ro(),[o,s]=Ho(),i=Sl(o.get("step")||1),c=_l(o.get("substep")||1);F.useEffect(()=>{if(!o.get("step")){const v=new URLSearchParams(o);v.set("step","1"),s(v,{replace:!0})}},[o,s]);const f=F.useMemo(()=>be.find(v=>v.id===i)||be[0],[i]),u=F.useCallback((v,N)=>{const g=new URLSearchParams(o);g.set("step",String(v)),v===4?g.set("substep",String(N??(v===i?c:1))):g.delete("substep"),s(g,{replace:!1}),n?.({systemId:a,step:v,substep:N})},[o,s,n,a,i,c]),d=()=>{i<be.length&&u(i+1,1)},p=v=>{u(4,v)},E=()=>{t?.({systemId:a,step:i})};return l.jsx(Zr,{children:l.jsxs("div",{className:"ca-settings-page",children:[l.jsx(nn,{children:e}),l.jsx(an,{steps:be,currentStep:i,onStepClick:v=>u(v,v===4?1:void 0),className:"ca-settings-page__stepper"}),i===1?l.jsx(hl,{onNext:d,stepMeta:f}):null,i===2?l.jsx(gl,{onNext:d,stepMeta:f}):null,i===3?l.jsx(yl,{onNext:d,stepMeta:f}):null,i===4?l.jsx(bl,{onNext:d,stepMeta:f,substep:c,onSubstepChange:p}):null,i===5?l.jsx(wl,{onNext:d,stepMeta:f}):null,i===6?l.jsx(El,{onPublish:E,stepMeta:f}):null,l.jsx("button",{type:"button",className:"ca-back-link",onClick:()=>r("/"),children:"← Back to Complaint Management"})]})})}function Nl({pageProps:e,onPublish:t,onStepChange:n,children:r}){const a=r??l.jsx(Yr,{...e});return l.jsxs(Eo,{children:[l.jsx(tt,{path:"/",element:a}),l.jsx(tt,{path:"/settings/:systemId",element:l.jsx(ga,{onPublish:t,onStepChange:n})}),l.jsx(tt,{path:"*",element:a})]})}function Cl({pageProps:e,onPublish:t,onStepChange:n,children:r}){return l.jsx(Nl,{pageProps:e,onPublish:t,onStepChange:n,children:r})}function Ol({children:e}){const{cssVars:t,darkMode:n,mode:r}=Lr();return l.jsx("div",{className:`ca-root ${n?"ca-root--dark":"ca-root--light"}`,"data-ca-theme":r,style:t,children:e})}const ya=({apiUrl:e,authToken:t,basePath:n="/",theme:r,darkMode:a=!1,title:o,description:s,systems:i,systemsEndpoint:c,useDemoData:f=!0,createLabel:u,onCreateForm:d,onConfigure:p,onTitleClick:E,onDescriptionClick:v,onSearch:N,onPublish:g,onStepChange:m,children:y})=>{const w={title:o,description:s,systems:i,systemsEndpoint:c,useDemoData:f,createLabel:u,onCreateForm:d,onConfigure:p,onTitleClick:E,onDescriptionClick:v,onSearch:N};return l.jsx(kr,{theme:r,darkMode:a,children:l.jsx(Ol,{children:l.jsx(xr,{apiUrl:e,authToken:t,children:l.jsx(Uo,{basename:n,children:l.jsx(Cl,{pageProps:w,onPublish:g,onStepChange:m,children:y})})})})})},xl=Q.colors,Tl=Q.radii,Al=Q.spacing,Pl=Q.typography;S.ApiProvider=xr,S.BodyText=X,S.Button=K,S.CardFooter=jr,S.CardHeader=Mr,S.ChevronDownIcon=oa,S.ChevronRightIcon=Ge,S.Chip=fa,S.CloseIcon=ca,S.ComplaintApp=ya,S.ComplaintManagementPage=Yr,S.ComplaintSettingsPage=ga,S.DEFAULT_PAGE_DESCRIPTION=Xr,S.DEMO_SYSTEMS=Kr,S.DataPoint=$r,S.Divider=Vr,S.DragHandleIcon=dn,S.FieldLabel=Fe,S.FormField=vt,S.FormInput=sn,S.FormSelect=ia,S.FormTextarea=ln,S.Heading1=nn,S.Heading2=se,S.Input=ie,S.LabelText=bt,S.LayersIcon=ra,S.LinkText=Rr,S.Loading=Jr,S.PageHeader=Ir,S.PlusIcon=tn,S.Radio=ha,S.RoleMultiSelect=ua,S.SETTINGS_STEPS=be,S.SearchBar=Wr,S.SearchIcon=qr,S.Select=le,S.SettingsCard=ve,S.SettingsCardHeader=aa,S.SettingsWizardProvider=Zr,S.StatusBadge=rn,S.Stepper=an,S.SystemCard=Hr,S.SystemCardGrid=zr,S.Tag=da,S.Textarea=sa,S.ThemeProvider=kr,S.Toggle=cn,S.ToggleField=la,S.TrashIcon=ma,S.Typography=oe,S.ValueText=Ur,S.WORKFLOW_SUBSTEPS=on,S.api=Ke,S.colors=xl,S.darkTheme=Xe,S.deepMerge=Pe,S.default=ya,S.defaultThemeFile=Tr,S.lightTheme=Q,S.normalizeThemeFile=Ar,S.radii=Tl,S.resolveActiveTheme=Pr,S.setAuthToken=Or,S.setBaseUrl=Cr,S.spacing=Al,S.themeToCssVars=Fr,S.typography=Pl,S.useSettingsWizard=ye,S.useTheme=Lr,Object.defineProperties(S,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
11
+ `+o)}}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=we(this.defaults,n);const{transitional:r,paramsSerializer:a,headers:o}=n;r!==void 0&&Pt.assertOptions(r,{silentJSONParsing:U.transitional(U.boolean),forcedJSONParsing:U.transitional(U.boolean),clarifyTimeoutError:U.transitional(U.boolean),legacyInterceptorReqResOrdering:U.transitional(U.boolean),advertiseZstdAcceptEncoding:U.transitional(U.boolean),validateStatusUndefinedResolves:U.transitional(U.boolean)},!1),a!=null&&(p.isFunction(a)?n.paramsSerializer={serialize:a}:Pt.assertOptions(a,{encode:U.function,serialize:U.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Pt.assertOptions(n,{baseUrl:U.spelling("baseURL"),withXsrfToken:U.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=o&&p.merge(o.common,o[n.method]);o&&p.forEach(["delete","get","head","post","put","patch","query","common"],v=>{delete o[v]}),n.headers=R.concat(s,o);const i=[];let c=!0;this.interceptors.request.forEach(function(_){if(typeof _.runWhen=="function"&&_.runWhen(n)===!1)return;c=c&&_.synchronous;const y=n.transitional||ln;y&&y.legacyInterceptorReqResOrdering?i.unshift(_.fulfilled,_.rejected):i.push(_.fulfilled,_.rejected)});const f=[];this.interceptors.response.forEach(function(_){f.push(_.fulfilled,_.rejected)});let u,d=0,h;if(!c){const v=[mn.bind(this),void 0];for(v.unshift(...i),v.push(...f),h=v.length,u=Promise.resolve(n);d<h;)u=u.then(v[d++],v[d++]);return u}h=i.length;let E=n;for(;d<h;){const v=i[d++],_=i[d++];try{E=v?v(E):E}catch(y){if(!_){u=Promise.reject(y);break}try{const m=_.call(this,y);p.isThenable(m)&&(u=Promise.resolve(m).then(()=>mn.call(this,E)))}catch(m){u=Promise.reject(m)}break}}if(!u)try{u=mn.call(this,E)}catch(v){u=Promise.reject(v)}for(d=0,h=f.length;d<h;)u=u.then(f[d++],f[d++]);return u}getUri(t){t=we(this.defaults,t);const n=Ar(t.baseURL,t.url,t.allowAbsoluteUrls,t);return wr(n,t.params,t.paramsSerializer)}};p.forEach(["delete","get","head","options"],function(t){be.prototype[t]=function(n,r){return this.request(we(r||{},{method:t,url:n,data:r&&p.hasOwnProp(r,"data")?r.data:void 0}))}}),p.forEach(["post","put","patch","query"],function(t){function n(r){return function(o,s,i){return this.request(we(i||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:s}))}}be.prototype[t]=n(),t!=="query"&&(be.prototype[t+"Form"]=n(!0))});let El=class Ga{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(a=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](a);r._listeners=null}),this.promise.then=a=>{let o;const s=new Promise(i=>{r.subscribe(i),o=i}).then(a);return s.cancel=function(){r.unsubscribe(o)},s},t(function(o,s,i){r.reason||(r.reason=new nt(o,s,i),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Ga(function(a){t=a}),cancel:t}}};function Cl(e){return function(n){return e.apply(null,n)}}function _l(e){return p.isObject(e)&&e.isAxiosError===!0}const gn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(gn).forEach(([e,t])=>{gn[t]=e});function Wr(e){const t=new be(e),n=er(be.prototype.request,t);return p.extend(n,be.prototype,t,{allOwnKeys:!0}),p.extend(n,t,null,{allOwnKeys:!0}),n.create=function(a){return Wr(we(e,a))},n}const k=Wr(tt);k.Axios=be,k.CanceledError=nt,k.CancelToken=El,k.isCancel=Cr,k.VERSION=fn,k.toFormData=Nt,k.AxiosError=C,k.Cancel=k.CanceledError,k.all=function(t){return Promise.all(t)},k.spread=Cl,k.isAxiosError=_l,k.mergeConfig=we,k.AxiosHeaders=R,k.formToJSON=e=>Er(p.isHTMLForm(e)?new FormData(e):e),k.getAdapter=jr.getAdapter,k.HttpStatusCode=gn,k.default=k;const{Axios:zc,AxiosError:Hc,CanceledError:qc,isCancel:Jc,CancelToken:Kc,VERSION:Xc,all:Gc,Cancel:Yc,isAxiosError:Qc,spread:Zc,toFormData:ed,AxiosHeaders:td,HttpStatusCode:nd,formToJSON:rd,getAdapter:ad,mergeConfig:od,create:sd}=k;function xt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)r!=="__proto__"&&(e[r]=n[r])}return e}var Nl={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function yn(e,t){function n(a,o,s){if(!(typeof document>"u")){s=xt({},t,s),typeof s.expires=="number"&&(s.expires=new Date(Date.now()+s.expires*864e5)),s.expires&&(s.expires=s.expires.toUTCString()),a=encodeURIComponent(a).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var i="";for(var c in s)s[c]&&(i+="; "+c,s[c]!==!0&&(i+="="+s[c].split(";")[0]));return document.cookie=a+"="+e.write(o,a)+i}}function r(a){if(!(typeof document>"u"||arguments.length&&!a)){for(var o=document.cookie?document.cookie.split("; "):[],s={},i=0;i<o.length;i++){var c=o[i].split("="),f=c.slice(1).join("=");try{var u=decodeURIComponent(c[0]);if(u in s||(s[u]=e.read(f,u)),a===u)break}catch{}}return a?s[a]:s}}return Object.create({set:n,get:r,remove:function(a,o){n(a,"",xt({},o,{expires:-1}))},withAttributes:function(a){return yn(this.converter,xt({},this.attributes,a))},withConverter:function(a){return yn(xt({},this.converter,a),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var ie=yn(Nl,{path:"/"});const Ol={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};let Ue="https://api-grievance.airaops.com";try{if(typeof{url:typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:$t&&$t.tagName.toUpperCase()==="SCRIPT"&&$t.src||new URL("complaint-app.umd.js",document.baseURI).href}<"u"&&Ol?.VITE_API_URL)Ue=void 0;else{const e=typeof process<"u"?process:null;e?.env?.VITE_API_URL&&(Ue=e.env.VITE_API_URL)}}catch{}const Vr=e=>{Ue=e||"",j.defaults.baseURL=Ue},zr=e=>{e?ie.set("token",e,{secure:!0,sameSite:"Strict"}):ie.remove("token")},Tl=()=>ie.get("token")||null,j=k.create({baseURL:Ue,transformRequest:[function(e,t){const n=Tl();return n?t.Authorization=`Bearer ${n}`:delete t.Authorization,e==null||typeof e=="string"?e:JSON.stringify(e)}],headers:{Accept:"application/json","Content-Type":"application/json"}});let wn=!1,bn=null;j.interceptors.response.use(e=>e,async e=>{const t=e.config,n=e.response;if(n&&(n.status===401||n.status===402)){const r=ie.get("refreshToken");if(r)try{wn||(wn=!0,bn=k.post(`${Ue}/api/v1/auth/refresh`,{},{headers:{Authorization:`Bearer ${r}`}}));const a=await bn,{token:o,refreshToken:s}=a.data;return ie.set("token",o,{secure:!0,sameSite:"Strict"}),s&&ie.set("refreshToken",s),t.headers.Authorization=`Bearer ${o}`,j(t)}catch{ie.remove("token"),ie.remove("refreshToken")}finally{wn=!1,bn=null}}return Promise.reject(e)});const Al=D.createContext(null),Hr=({children:e,apiUrl:t,authToken:n})=>(D.useEffect(()=>{t&&Vr(t)},[t]),D.useEffect(()=>{zr(n||null)},[n]),l.jsx(Al.Provider,{value:{apiUrl:t,authToken:n},children:e})),ee={mode:"light",colors:{primary:"#2D64B8",primaryHover:"#2557A3",text:"#111827",textSecondary:"#6B7280",textMuted:"#9CA3AF",border:"#E5E7EB",borderLight:"#F3F4F6",background:"#F5F5F5",surface:"#FFFFFF",white:"#FFFFFF",onPrimary:"#FFFFFF",activeBg:"#ECFDF5",activeBorder:"#A7F3D0",activeText:"#059669",inactiveBg:"#F3F4F6",inactiveBorder:"#D1D5DB",inactiveText:"#6B7280",link:"#2D64B8",divider:"#E5E7EB",accentBorder:"#C5D7F0",accentBg:"#EEF4FB",stepDone:"#D6E4F7",success:"#22C55E",danger:"#EF4444",secondaryBtn:"#D1D5DB",secondaryBtnHover:"#C4C9D1",inputBg:"#FFFFFF",tableHeadBg:"#EEF4FB",sidebarBg:"#FAFBFD",overlay:"rgba(16, 24, 40, 0.06)"},radii:{sm:"6px",md:"8px",lg:"12px",xl:"16px",pill:"999px"},spacing:{xs:"4px",sm:"8px",md:"12px",lg:"16px",xl:"24px",xxl:"32px"},typography:{fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',h1Size:"28px",h2Size:"16px",bodySize:"14px",labelSize:"13px",valueSize:"22px",smallSize:"13px"},shadow:{card:"0 1px 2px rgba(16, 24, 40, 0.04)",settings:"0 1px 3px rgba(16, 24, 40, 0.06)"}},rt={mode:"dark",colors:{primary:"#5B8DEF",primaryHover:"#7BA3F3",text:"#F3F4F6",textSecondary:"#A1A1AA",textMuted:"#71717A",border:"#3F3F46",borderLight:"#27272A",background:"#0F1115",surface:"#18181B",white:"#FFFFFF",onPrimary:"#FFFFFF",activeBg:"#052E1C",activeBorder:"#166534",activeText:"#4ADE80",inactiveBg:"#27272A",inactiveBorder:"#3F3F46",inactiveText:"#A1A1AA",link:"#7BA3F3",divider:"#3F3F46",accentBorder:"#2A3A55",accentBg:"#1A2333",stepDone:"#1E3A5F",success:"#22C55E",danger:"#F87171",secondaryBtn:"#3F3F46",secondaryBtnHover:"#52525B",inputBg:"#18181B",tableHeadBg:"#1A2333",sidebarBg:"#12141A",overlay:"rgba(0, 0, 0, 0.35)"},radii:{sm:"6px",md:"8px",lg:"12px",xl:"16px",pill:"999px"},spacing:{xs:"4px",sm:"8px",md:"12px",lg:"16px",xl:"24px",xxl:"32px"},typography:{fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',h1Size:"28px",h2Size:"16px",bodySize:"14px",labelSize:"13px",valueSize:"22px",smallSize:"13px"},shadow:{card:"0 1px 2px rgba(0, 0, 0, 0.35)",settings:"0 1px 3px rgba(0, 0, 0, 0.4)"}},qr={light:ee,dark:rt};function Me(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)}function je(e,t){if(!Me(t))return e;const n={...e};return Object.keys(t).forEach(r=>{const a=t[r];Me(a)&&Me(e[r])?n[r]=je(e[r],a):a!==void 0&&(n[r]=a)}),n}function Jr(e){return!e||!Me(e)?{light:ee,dark:rt}:Me(e.light)||Me(e.dark)?{light:je(ee,e.light||{}),dark:je(rt,e.dark||{})}:{light:je(ee,e),dark:je(rt,e)}}function Kr(e,t=!1){const n=Jr(e);return{...t?n.dark:n.light,mode:t?"dark":"light",__pack:n}}const Pl={primary:"--ca-primary",primaryHover:"--ca-primary-hover",text:"--ca-text",textSecondary:"--ca-text-secondary",textMuted:"--ca-text-muted",border:"--ca-border",borderLight:"--ca-border-light",background:"--ca-bg",surface:"--ca-surface",white:"--ca-white",onPrimary:"--ca-on-primary",activeBg:"--ca-active-bg",activeBorder:"--ca-active-border",activeText:"--ca-active-text",inactiveBg:"--ca-inactive-bg",inactiveBorder:"--ca-inactive-border",inactiveText:"--ca-inactive-text",link:"--ca-link",divider:"--ca-divider",accentBorder:"--ca-accent-border",accentBg:"--ca-accent-bg",stepDone:"--ca-step-done",success:"--ca-success",danger:"--ca-danger",secondaryBtn:"--ca-secondary-btn",secondaryBtnHover:"--ca-secondary-btn-hover",inputBg:"--ca-input-bg",tableHeadBg:"--ca-table-head-bg",sidebarBg:"--ca-sidebar-bg",overlay:"--ca-overlay"},xl={sm:"--ca-radius-sm",md:"--ca-radius-md",lg:"--ca-radius-lg",xl:"--ca-radius-xl",pill:"--ca-radius-pill"},Dl={fontFamily:"--ca-font",h1Size:"--ca-h1-size",h2Size:"--ca-h2-size",bodySize:"--ca-body-size",labelSize:"--ca-label-size",valueSize:"--ca-value-size",smallSize:"--ca-small-size"},Fl={card:"--ca-shadow-card",settings:"--ca-shadow-settings"};function Xr(e){const t={};return e?.colors&&Object.entries(Pl).forEach(([n,r])=>{e.colors[n]!=null&&(t[r]=e.colors[n])}),e?.radii&&Object.entries(xl).forEach(([n,r])=>{e.radii[n]!=null&&(t[r]=e.radii[n])}),e?.typography&&Object.entries(Dl).forEach(([n,r])=>{e.typography[n]!=null&&(t[r]=e.typography[n])}),e?.shadow&&Object.entries(Fl).forEach(([n,r])=>{e.shadow[n]!=null&&(t[r]=e.shadow[n])}),t["--ca-on-primary"]&&!t["--ca-white"]&&(t["--ca-white"]=t["--ca-on-primary"]),t}const Gr=D.createContext({darkMode:!1,theme:null,themeFile:qr,cssVars:{}});function Yr({theme:e,darkMode:t=!1,children:n}){const r=D.useMemo(()=>{const a=Kr(e,!!t),o=Xr(a);return{darkMode:!!t,theme:a,themeFile:a.__pack,cssVars:o,mode:a.mode}},[e,t]);return l.jsx(Gr.Provider,{value:r,children:n})}function Qr(){return D.useContext(Gr)}const X=Object.freeze({types:"/api/v1/complaints/types",departments:"/api/v1/complaints/departments",departmentTree:"/api/v1/complaints/departments/tree",priorities:"/api/v1/complaints/priorities",workflows:"/api/v1/complaints/workflows",workflowSteps:"/api/v1/complaints/workflows/steps",statuses:"/api/v1/complaints/statuses"}),kl=(e,t)=>t.rejectWithValue({status:e?.response?.status??e?.status,message:e?.response?.data?.message??e?.response?.data?.error??e?.message??"Something went wrong"}),te=(e,t)=>ft.createAsyncThunk(e,async(n,r)=>{try{return(await t(n,r)).data}catch(a){return kl(a,r)}}),at=(e,t)=>({list:te(`complaint/${e}/list`,(n,{signal:r})=>j.get(t,{params:n,signal:r})),getById:te(`complaint/${e}/getById`,(n,{signal:r})=>j.get(`${t}/${n}`,{signal:r})),create:te(`complaint/${e}/create`,n=>j.post(t,n)),update:te(`complaint/${e}/update`,({id:n,data:r})=>j.patch(`${t}/${n}`,r)),remove:te(`complaint/${e}/remove`,n=>j.delete(`${t}/${n}`))}),ve=at("types",X.types),Se=at("departments",X.departments),Ee=at("priorities",X.priorities),Ce=at("workflows",X.workflows),_e=at("statuses",X.statuses),Dt=te("complaint/departments/getTree",(e,{signal:t})=>j.get(X.departmentTree,{signal:t})),Ft=te("complaint/workflows/getSteps",(e,{signal:t})=>j.get(`${X.workflowSteps}/${e}`,{signal:t})),kt=te("complaint/workflows/saveSteps",e=>j.post(X.workflowSteps,e)),Zr=te("complaint/workflows/deleteSteps",e=>j.delete(`${X.workflowSteps}/${e}`)),Ll=ve.list,Bl=ve.getById,Il=ve.create,Rl=ve.update,Ul=ve.remove,Ml=Se.list,jl=Se.getById,$l=Se.create,Wl=Se.update,Vl=Se.remove,zl=Ee.list,Hl=Ee.getById,ql=Ee.create,Jl=Ee.update,Kl=Ee.remove,Xl=Ce.list,Gl=Ce.getById,Yl=Ce.create,Ql=Ce.update,Zl=Ce.remove,ec=_e.list,tc=_e.getById,nc=_e.create,rc=_e.update,ac=_e.remove,ot=()=>({data:[],selected:null,pagination:null,isLoading:!1,isMutating:!1,error:null}),ea={types:ot(),departments:ot(),priorities:ot(),workflows:ot(),statuses:ot(),departmentTree:[],workflowSteps:{},isLoadingDepartmentTree:!1,isLoadingWorkflowSteps:!1,error:null},oc=e=>{if(Array.isArray(e))return{data:e,pagination:null};const t=e?.data??e;return Array.isArray(t)?{data:t,pagination:e?.pagination??null}:{data:t?.results??t?.items??[],pagination:t?.pagination??e?.pagination??null}},st=e=>e?.data??e,Lt=e=>e?.id??e?._id,sc=(e,t)=>{if(!t||typeof t!="object")return e;const n=Lt(t);if(n==null)return e;const r=e.findIndex(o=>Lt(o)===n);if(r<0)return[t,...e];const a=[...e];return a[r]=t,a},Ne=e=>e.payload?.message??e.error?.message??"Something went wrong",it=(e,t,n)=>{e.addCase(n.list.pending,r=>{r[t].isLoading=!0,r[t].error=null}).addCase(n.list.fulfilled,(r,a)=>{const o=oc(a.payload);r[t].isLoading=!1,r[t].data=o.data,r[t].pagination=o.pagination}).addCase(n.list.rejected,(r,a)=>{r[t].isLoading=!1,r[t].error=Ne(a)}).addCase(n.getById.pending,r=>{r[t].isLoading=!0,r[t].error=null}).addCase(n.getById.fulfilled,(r,a)=>{r[t].isLoading=!1,r[t].selected=st(a.payload)}).addCase(n.getById.rejected,(r,a)=>{r[t].isLoading=!1,r[t].error=Ne(a)}),[n.create,n.update].forEach(r=>{e.addCase(r.pending,a=>{a[t].isMutating=!0,a[t].error=null}).addCase(r.fulfilled,(a,o)=>{const s=st(o.payload);a[t].isMutating=!1,a[t].selected=s,a[t].data=sc(a[t].data,s)}).addCase(r.rejected,(a,o)=>{a[t].isMutating=!1,a[t].error=Ne(o)})}),e.addCase(n.remove.pending,r=>{r[t].isMutating=!0,r[t].error=null}).addCase(n.remove.fulfilled,(r,a)=>{const o=a.meta.arg;r[t].isMutating=!1,r[t].data=r[t].data.filter(s=>Lt(s)!==o),Lt(r[t].selected)===o&&(r[t].selected=null)}).addCase(n.remove.rejected,(r,a)=>{r[t].isMutating=!1,r[t].error=Ne(a)})},ta=ft.createSlice({name:"complaintAppComplaint",initialState:ea,reducers:{clearComplaintError(e,t){const n=t.payload;n&&e[n]?.error!==void 0?e[n].error=null:e.error=null},clearSelectedComplaintResource(e,t){const n=t.payload;n&&e[n]?.selected!==void 0&&(e[n].selected=null)},resetComplaintState(){return ea}},extraReducers:e=>{it(e,"types",ve),it(e,"departments",Se),it(e,"priorities",Ee),it(e,"workflows",Ce),it(e,"statuses",_e),e.addCase(Dt.pending,t=>{t.isLoadingDepartmentTree=!0,t.error=null}).addCase(Dt.fulfilled,(t,n)=>{t.isLoadingDepartmentTree=!1;const r=st(n.payload);t.departmentTree=Array.isArray(r)?r:r?.tree??r?.items??[]}).addCase(Dt.rejected,(t,n)=>{t.isLoadingDepartmentTree=!1,t.error=Ne(n)}).addCase(Ft.pending,t=>{t.isLoadingWorkflowSteps=!0,t.error=null}).addCase(Ft.fulfilled,(t,n)=>{t.isLoadingWorkflowSteps=!1,t.workflowSteps[n.meta.arg]=st(n.payload)}).addCase(Ft.rejected,(t,n)=>{t.isLoadingWorkflowSteps=!1,t.error=Ne(n)}).addCase(kt.pending,t=>{t.isLoadingWorkflowSteps=!0,t.error=null}).addCase(kt.fulfilled,(t,n)=>{t.isLoadingWorkflowSteps=!1;const r=st(n.payload),a=n.meta.arg?.workflowId??r?.workflowId??r?.id;a!==void 0&&(t.workflowSteps[a]=r)}).addCase(kt.rejected,(t,n)=>{t.isLoadingWorkflowSteps=!1,t.error=Ne(n)}).addCase(Zr.fulfilled,(t,n)=>{delete t.workflowSteps[n.meta.arg]})}}),{clearComplaintError:ic,clearSelectedComplaintResource:lc,resetComplaintState:cc}=ta.actions,na=ta.reducer,dc=ft.combineReducers({complaintAppComplaint:na}),ra=e=>ft.configureStore({reducer:dc,preloadedState:e,middleware:t=>t({immutableCheck:!1,serializableCheck:!1})}),aa=ra();function G({children:e,variant:t="primary",size:n="md",startIcon:r,endIcon:a,className:o="",type:s="button",disabled:i=!1,onClick:c,...f}){const u=["ca-btn",`ca-btn--${t}`,n==="sm"?"ca-btn--sm":"",n==="lg"?"ca-btn--lg":"",o].filter(Boolean).join(" ");return l.jsxs("button",{type:s,className:u,disabled:i,onClick:c,...f,children:[r?l.jsx("span",{className:"ca-btn__icon",children:r}):null,e,a?l.jsx("span",{className:"ca-btn__icon",children:a}):null]})}function vn({size:e=16,color:t="currentColor",...n}){return l.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...n,children:l.jsx("path",{d:"M12 5v14M5 12h14",stroke:t,strokeWidth:"2",strokeLinecap:"round"})})}const oa={h1:"ca-h1",h2:"ca-h2",body:"ca-body",label:"ca-label",value:"ca-value",small:"ca-small",link:"ca-link"},uc={h1:"h1",h2:"h2",body:"p",label:"span",value:"span",small:"span",link:"button"};function le({variant:e="body",as:t,className:n="",children:r,...a}){const o=t||uc[e]||"p",s=oa[e]||oa.body;return l.jsx(o,{className:`${s} ${n}`.trim(),...a,children:r})}function Sn(e){return l.jsx(le,{variant:"h1",...e})}function ce(e){return l.jsx(le,{variant:"h2",...e})}function Y(e){return l.jsx(le,{variant:"body",...e})}function Bt(e){return l.jsx(le,{variant:"label",...e})}function sa(e){return l.jsx(le,{variant:"value",...e})}function ia(e){return l.jsx(le,{variant:"link",type:"button",...e})}function la({title:e="Complaint Management",description:t,actionLabel:n="Create New Form",onAction:r,className:a=""}){return l.jsxs("header",{className:`ca-page-header ${a}`.trim(),children:[l.jsxs("div",{className:"ca-page-header__text",children:[l.jsx(Sn,{children:e}),t?l.jsx(Y,{children:t}):null]}),l.jsx("div",{className:"ca-page-header__actions",children:l.jsx(G,{startIcon:l.jsx(vn,{}),onClick:r,children:n})})]})}function En({status:e="inactive",label:t,className:n=""}){const a=String(e).toLowerCase()==="active",o=t??(a?"Active":"Inactive");return l.jsx("span",{className:`ca-badge ca-badge--${a?"active":"inactive"} ${n}`.trim(),children:o})}function ca({title:e,status:t,statusLabel:n,titleAsLink:r=!1,onTitleClick:a,className:o=""}){return l.jsxs("div",{className:`ca-system-card__header ${o}`.trim(),children:[l.jsx("div",{className:"ca-system-card__title-wrap",children:r?l.jsx("button",{type:"button",className:"ca-h2 ca-h2--link",onClick:a,children:e}):l.jsx(ce,{children:e})}),l.jsx(En,{status:t,label:n})]})}function lt({size:e=16,color:t="currentColor",...n}){return l.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...n,children:l.jsx("path",{d:"M9 6l6 6-6 6",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function da({updatedOn:e,configureLabel:t="Configure",onConfigure:n,className:r=""}){return l.jsxs("div",{className:`ca-system-card__footer ${r}`.trim(),children:[l.jsx(le,{variant:"small",as:"span",children:e?`Updated on ${e}`:""}),l.jsx(G,{size:"sm",onClick:n,endIcon:l.jsx(lt,{size:14,color:"#fff"}),children:t})]})}function ua({label:e,value:t,className:n=""}){const r=t==null?"β€”":typeof t=="number"?String(t).padStart(2,"0"):t;return l.jsxs("div",{className:`ca-data-point ${n}`.trim(),children:[l.jsx(Bt,{children:e}),l.jsx(sa,{children:r})]})}function fa({className:e=""}){return l.jsx("div",{className:`ca-divider ${e}`.trim(),role:"separator","aria-orientation":"vertical"})}function pa({id:e,title:t,status:n="inactive",statusLabel:r,description:a,descriptionHref:o,departments:s,workflows:i,fields:c,formsFilled:f,updatedOn:u,titleAsLink:d=!1,onTitleClick:h,onDescriptionClick:E,onConfigure:v,className:_=""}){const y=()=>{v?.({id:e,title:t,status:n,departments:s,workflows:i,fields:c,formsFilled:f,updatedOn:u})},m=()=>{if(E){E({id:e,title:t,descriptionHref:o});return}o&&typeof window<"u"&&window.open(o,"_blank","noopener,noreferrer")},w=[{label:"Departments",value:s},{label:"Workflows",value:i},{label:"Fields",value:c},{label:"Forms Filled",value:f}];return l.jsxs("article",{className:`ca-system-card ${_}`.trim(),children:[l.jsx(ca,{title:t,status:n,statusLabel:r,titleAsLink:d,onTitleClick:()=>h?.({id:e,title:t})}),a?l.jsx(ia,{onClick:m,children:a}):null,l.jsx("div",{className:"ca-system-card__stats",children:w.map((S,N)=>l.jsxs(D.Fragment,{children:[N>0?l.jsx(fa,{}):null,l.jsx(ua,{label:S.label,value:S.value})]},S.label))}),l.jsx(da,{updatedOn:u,onConfigure:y})]})}function ha({systems:e=[],onConfigure:t,onTitleClick:n,onDescriptionClick:r,emptyMessage:a="No systems found.",className:o=""}){return e.length?l.jsx("div",{className:`ca-system-grid ${o}`.trim(),children:e.map(s=>l.jsx(pa,{...s,onConfigure:t,onTitleClick:n,onDescriptionClick:r},s.id??s.title))}):l.jsx("div",{className:`ca-system-grid ${o}`.trim(),children:l.jsx("div",{className:"ca-empty",children:l.jsx(Y,{children:a})})})}function de({value:e,onChange:t,placeholder:n,type:r="text",icon:a,className:o="",inputClassName:s="",...i}){return l.jsxs("div",{className:`ca-input-wrap ${o}`.trim(),children:[a?l.jsx("span",{className:"ca-input-wrap__icon",children:a}):null,l.jsx("input",{type:r,className:`ca-input ${a?"ca-input--with-icon":""} ${s}`.trim(),value:e,onChange:t,placeholder:n,...i})]})}function ma({size:e=18,color:t="currentColor",...n}){return l.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...n,children:[l.jsx("path",{d:"M10.5 18a7.5 7.5 0 1 1 0-15 7.5 7.5 0 0 1 0 15Z",stroke:t,strokeWidth:"1.75"}),l.jsx("path",{d:"M16.5 16.5 21 21",stroke:t,strokeWidth:"1.75",strokeLinecap:"round"})]})}function ga({value:e,onChange:t,onSearch:n,placeholder:r="Search",className:a=""}){const o=s=>{s.key==="Enter"&&n&&n(e)};return l.jsx("div",{className:`ca-search ${a}`.trim(),children:l.jsx(de,{value:e,onChange:t,onKeyDown:o,placeholder:r,icon:l.jsx(ma,{}),"aria-label":r})})}function ya({text:e="Loading",fullScreen:t=!1}){return l.jsxs("div",{className:"ca-loading",style:t?{minHeight:"calc(100vh - 80px)"}:void 0,role:"status","aria-live":"polite",children:[l.jsx("span",{className:"ca-loading__spinner"}),l.jsxs("span",{children:[e,"…"]})]})}const wa=[{id:"qms",title:"QMS - Query Management System",status:"active",description:"Description of the template",departments:3,workflows:12,fields:55,formsFilled:234,updatedOn:"12 Mar 2024",titleAsLink:!0},{id:"cms",title:"CMS - Complaint Management System",status:"active",description:"Description of the template",departments:5,workflows:8,fields:42,formsFilled:189,updatedOn:"08 Mar 2024"},{id:"fms",title:"FMS - Feedback Management System",status:"inactive",description:"Description of the template",departments:2,workflows:4,fields:28,formsFilled:56,updatedOn:"01 Feb 2024"},{id:"rms",title:"RMS - Request Management System",status:"active",description:"Description of the template",departments:4,workflows:10,fields:61,formsFilled:312,updatedOn:"20 Mar 2024"}],ba="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi.";function va(e=[]){return e.map((t,n)=>({id:t.id??t._id??`system-${n}`,title:t.title??t.name??"Untitled",status:t.status??"inactive",statusLabel:t.statusLabel,description:t.description??t.templateDescription,descriptionHref:t.descriptionHref??t.url,departments:t.departments??t.departmentCount??0,workflows:t.workflows??t.workflowCount??0,fields:t.fields??t.fieldCount??0,formsFilled:t.formsFilled??t.formFilledCount??t.forms_filled??0,updatedOn:t.updatedOn??t.updatedAt??t.updated_on,titleAsLink:!!(t.titleAsLink??t.isLink)}))}function Sa({title:e="Complaint Management",description:t=ba,systems:n,systemsEndpoint:r,useDemoData:a=!0,createLabel:o="Create New Form",onCreateForm:s,onConfigure:i,onTitleClick:c,onDescriptionClick:f,onSearch:u}){const d=pt(),[h,E]=D.useState(""),[v,_]=D.useState(null),[y,m]=D.useState(null),[w,S]=D.useState(r&&!n?"loading":"idle");D.useEffect(()=>{if(!r||n)return;const F=new AbortController;return j.get(r,{signal:F.signal}).then(L=>{const J=L?.data,Ut=Array.isArray(J)?J:J?.data??J?.systems??J?.results??[];_(va(Ut)),m(null),S("success")}).catch(L=>{F.signal.aborted||(m(L?.message||"Failed to load systems"),_([]),S("error"))}),()=>F.abort()},[r,n]);const N=D.useMemo(()=>n?va(n):v||(a?wa:[]),[n,v,a]),x=D.useMemo(()=>{const F=h.trim().toLowerCase();return F?N.filter(L=>`${L.title} ${L.description??""} ${L.status??""}`.toLowerCase().includes(F)):N},[N,h]),A=F=>{const L=F.target.value;E(L),u?.(L)},$=F=>{i?.(F),d(`/settings/${F.id??"new"}?step=1`)},ne=()=>{s?.(),d("/settings/new?step=1")},Pe=w==="loading";return l.jsxs(l.Fragment,{children:[l.jsx(la,{title:e,description:t,actionLabel:o,onAction:ne}),l.jsx(ga,{value:h,onChange:A,placeholder:"Search"}),Pe?l.jsx(ya,{text:"Loading systems"}):y?l.jsx("div",{className:"ca-empty",children:l.jsx("p",{className:"ca-body",children:y})}):l.jsx(ha,{systems:x,onConfigure:$,onTitleClick:c,onDescriptionClick:f,emptyMessage:h?"No systems match your search.":"No systems found."})]})}function Cn({steps:e=[],currentStep:t=1,onStepClick:n,className:r="",size:a="md"}){return l.jsx("nav",{className:`ca-stepper ca-stepper--${a} ${r}`.trim(),"aria-label":"Progress",children:e.map((o,s)=>{const i=o.id??s+1,c=i===t,f=i<t,u=!!n&&(f||c);return l.jsxs(D.Fragment,{children:[s>0?l.jsx("div",{className:`ca-stepper__line ${f||c?"ca-stepper__line--active":""}`}):null,l.jsxs("button",{type:"button",className:["ca-stepper__item",c?"ca-stepper__item--active":"",f?"ca-stepper__item--done":""].filter(Boolean).join(" "),onClick:()=>u&&n?.(i),disabled:!u,"aria-current":c?"step":void 0,children:[l.jsx("span",{className:"ca-stepper__circle",children:i}),l.jsx("span",{className:"ca-stepper__label",children:o.label})]})]},i)})})}const Ea=D.createContext(null),Ca=()=>({categoryType:"",active:!1,description:"",roles:[],departmentRows:[{id:"1",department:"",subDepartment:"",roles:""}],priorityDraft:"",priorities:[],defaultPriorityId:null,selectedDeptNode:null,workflow:{name:"",tatMinutes:"",description:"",statuses:[],steps:[]},fieldDraft:{name:"",type:""},formFields:[]});function _a({children:e,initialValues:t}){const[n,r]=D.useState(()=>({...Ca(),...t,workflow:{...Ca().workflow,...t?.workflow}})),a=D.useCallback(i=>{r(c=>({...c,...i}))},[]),o=D.useCallback(i=>{r(c=>({...c,workflow:{...c.workflow,...i}}))},[]),s=D.useMemo(()=>({state:n,setState:r,update:a,updateWorkflow:o}),[n,a,o]);return l.jsx(Ea.Provider,{value:s,children:e})}function Oe(){const e=D.useContext(Ea);if(!e)throw new Error("useSettingsWizard must be used within SettingsWizardProvider");return e}const Te=[{id:1,key:"category",label:"Category Type",title:"Category Type",description:"Define the type and basic details for this category type."},{id:2,key:"departments",label:"Departments",title:"Departments",description:"----"},{id:3,key:"priorities",label:"Priorities",title:"Priorities",description:"----"},{id:4,key:"workflow",label:"Workflow",title:"Workflow",description:"----"},{id:5,key:"formFields",label:"Form Fields",title:"Form Fields",description:"----"},{id:6,key:"review",label:"Review & Publish",title:"Review & Publish",description:"Review your configuration and publish."}],_n=[{id:1,label:"Create Workflow"},{id:2,label:"Statuses"},{id:3,label:"Workflow Steps"}],fc=["Urgent","High","Medium","Low"],Na=[{id:"short",label:"Textfield / Short Answer",icon:"text"},{id:"long",label:"Description / Long Answer",icon:"doc"},{id:"date",label:"Date",icon:"calendar"},{id:"time",label:"Time",icon:"clock"},{id:"single",label:"Dropdown - Single Select",icon:"chevron"},{id:"multi",label:"Dropdown - Multiple Select",icon:"chevron"}],Oa=["Store Staff","HR Executive","HR Manager","Store Manager","Admin"],Ta=[{value:"qms",label:"QMS - Query Management System"},{value:"cms",label:"CMS - Complaint Management System"},{value:"fms",label:"FMS - Feedback Management System"},{value:"rms",label:"RMS - Request Management System"}],pc=[{id:"hr",name:"HR",children:[{id:"payroll",name:"Payroll"},{id:"recruitment",name:"Recruitment"}]},{id:"finance",name:"Finance",children:[{id:"ap",name:"Accounts Payable"}]},{id:"it",name:"IT",children:[]}],hc=[{value:"#EF4444",label:"Red"},{value:"#F59E0B",label:"Orange"},{value:"#EAB308",label:"Yellow"},{value:"#22C55E",label:"Green"},{value:"#3B82F6",label:"Blue"},{value:"#8B5CF6",label:"Purple"}];function Aa({size:e=28,color:t="currentColor",...n}){return l.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",style:{color:"var(--ca-primary)"},...n,children:[l.jsx("path",{d:"M12 3 3 8l9 5 9-5-9-5Z",stroke:t,strokeWidth:"1.6",strokeLinejoin:"round"}),l.jsx("path",{d:"M3 12.5 12 17.5l9-5",stroke:t,strokeWidth:"1.6",strokeLinejoin:"round",strokeLinecap:"round"}),l.jsx("path",{d:"M3 16.5 12 21.5l9-5",stroke:t,strokeWidth:"1.6",strokeLinejoin:"round",strokeLinecap:"round"})]})}function Pa({title:e,description:t,nextLabel:n="Next",onNext:r,showNext:a=!0,nextDisabled:o=!1,nextVariant:s="primary",className:i=""}){return l.jsxs("div",{className:`ca-settings-card__header ${i}`.trim(),children:[l.jsxs("div",{className:"ca-settings-card__heading",children:[l.jsx(Aa,{}),l.jsxs("div",{children:[l.jsx(ce,{children:e}),t?l.jsx(Y,{className:"ca-settings-card__desc",children:t}):null]})]}),a?l.jsx(G,{variant:s,disabled:o,onClick:r,endIcon:l.jsx(lt,{size:14,color:"currentColor"}),children:n}):null]})}function Ae({title:e,description:t,onNext:n,nextLabel:r,showNext:a=!0,nextDisabled:o,nextVariant:s,children:i,footer:c,className:f=""}){return l.jsxs("section",{className:`ca-settings-card ${f}`.trim(),children:[l.jsx(Pa,{title:e,description:t,onNext:n,nextLabel:r,showNext:a,nextDisabled:o,nextVariant:s}),l.jsx("div",{className:"ca-settings-card__divider"}),l.jsx("div",{className:"ca-settings-card__body",children:i}),c?l.jsx("div",{className:"ca-settings-card__footer",children:c}):null]})}function $e({children:e,hint:t,htmlFor:n,className:r=""}){return l.jsxs("div",{className:`ca-field-label ${r}`.trim(),children:[l.jsx("label",{className:"ca-label",htmlFor:n,children:e}),t!=null?l.jsx("span",{className:"ca-field-label__hint",children:t}):null]})}function xa({size:e=16,color:t="currentColor",...n}){return l.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...n,children:l.jsx("path",{d:"M6 9l6 6 6-6",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function ue({value:e,onChange:t,options:n=[],placeholder:r="Select",className:a="",disabled:o=!1,...s}){return l.jsxs("div",{className:`ca-select ${a}`.trim(),children:[l.jsxs("select",{className:"ca-select__control",value:e??"",onChange:t,disabled:o,...s,children:[l.jsx("option",{value:"",disabled:!0,children:r}),n.map(i=>{const c=typeof i=="string"?i:i.value,f=typeof i=="string"?i:i.label;return l.jsx("option",{value:c,children:f},c)})]}),l.jsx("span",{className:"ca-select__chevron",children:l.jsx(xa,{size:16})})]})}function Da({value:e,onChange:t,placeholder:n,maxLength:r,rows:a=4,className:o="",...s}){return l.jsx("textarea",{className:`ca-textarea ${o}`.trim(),value:e,onChange:t,placeholder:n,maxLength:r,rows:a,...s})}function It({label:e,hint:t,children:n,className:r="",htmlFor:a}){return l.jsxs("div",{className:`ca-form-field ${r}`.trim(),children:[e!=null?l.jsx($e,{htmlFor:a,hint:t,children:e}):null,n]})}function Nn({label:e,hint:t,...n}){return l.jsx(It,{label:e,hint:t,htmlFor:n.id,children:l.jsx(de,{...n})})}function Fa({label:e,hint:t,...n}){return l.jsx(It,{label:e,hint:t,htmlFor:n.id,children:l.jsx(ue,{...n})})}function On({label:e,hint:t,maxLength:n,value:r="",...a}){const o=t??(n!=null?`${String(r).length}/${n}`:void 0);return l.jsx(It,{label:e,hint:o,htmlFor:a.id,children:l.jsx(Da,{value:r,maxLength:n,...a})})}function Tn({checked:e=!1,onChange:t,disabled:n=!1,"aria-label":r="Toggle",className:a=""}){return l.jsx("button",{type:"button",role:"switch","aria-checked":e,"aria-label":r,disabled:n,className:`ca-toggle ${e?"ca-toggle--on":""} ${a}`.trim(),onClick:()=>t?.(!e),children:l.jsx("span",{className:"ca-toggle__thumb"})})}function ka({label:e="Active",checked:t,onChange:n,className:r=""}){return l.jsxs("div",{className:`ca-toggle-field ${r}`.trim(),children:[l.jsx(Bt,{children:e}),l.jsx(Tn,{checked:t,onChange:n,"aria-label":e})]})}function La({size:e=12,color:t="currentColor",...n}){return l.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...n,children:l.jsx("path",{d:"M6 6l12 12M18 6L6 18",stroke:t,strokeWidth:"2",strokeLinecap:"round"})})}function Ba({label:e,onRemove:t,className:n=""}){return l.jsxs("span",{className:`ca-tag ${n}`.trim(),children:[e,t?l.jsx("button",{type:"button",className:"ca-tag__remove",onClick:t,"aria-label":`Remove ${e}`,children:l.jsx(La,{size:10})}):null]})}function Ia({label:e="Select Roles",options:t=[],value:n=[],onChange:r,placeholder:a="Select roles",className:o=""}){const[s,i]=D.useState(""),c=t.filter(d=>{const h=typeof d=="string"?d:d.value;return!n.includes(h)}),f=d=>{const h=d.target.value;h&&(r?.([...n,h]),i(""))},u=d=>{r?.(n.filter(h=>h!==d))};return l.jsxs("div",{className:`ca-role-select ${o}`.trim(),children:[l.jsx($e,{children:e}),l.jsx(ue,{value:s,onChange:f,options:c,placeholder:a}),n.length>0?l.jsx("div",{className:"ca-tag-list",children:n.map(d=>l.jsx(Ba,{label:d,onRemove:()=>u(d)},d))}):null]})}function mc({onNext:e,stepMeta:t}){const{state:n,update:r}=Oe();return l.jsxs(Ae,{title:t.title,description:t.description,onNext:e,children:[l.jsx("div",{className:"ca-step-section",children:l.jsxs("div",{className:"ca-step-row ca-step-row--category",children:[l.jsx(Fa,{label:"Category Type",className:"ca-step-row__grow",value:n.categoryType,onChange:a=>r({categoryType:a.target.value}),options:Ta,placeholder:"Select category type"}),l.jsx(ka,{checked:n.active,onChange:a=>r({active:a})})]})}),l.jsx("div",{className:"ca-step-section",children:l.jsx(On,{label:"Description",placeholder:"Enter description",maxLength:500,value:n.description,onChange:a=>r({description:a.target.value}),rows:5})}),l.jsx("div",{className:"ca-step-section ca-step-section--last",children:l.jsx(Ia,{options:Oa,value:n.roles,onChange:a=>r({roles:a})})})]})}const gc=["HR","Finance","IT","Operations","Sales"];function yc(){return{id:`${Date.now()}-${Math.random().toString(36).slice(2,7)}`,department:"",subDepartment:"",roles:""}}function wc({onNext:e,stepMeta:t}){const{state:n,update:r}=Oe(),a=n.departmentRows,o=(i,c)=>{r({departmentRows:a.map(f=>f.id===i?{...f,...c}:f)})},s=()=>{r({departmentRows:[...a,yc()]})};return l.jsx(Ae,{title:t.title,description:t.description,onNext:e,children:l.jsxs("div",{className:"ca-dept-table",children:[l.jsxs("div",{className:"ca-dept-table__head",children:[l.jsx("div",{children:"Department"}),l.jsx("div",{children:"Sub-department"}),l.jsx("div",{children:"Roles"}),l.jsx("div",{})]}),a.map(i=>l.jsxs("div",{className:"ca-dept-table__row",children:[l.jsx(ue,{value:i.department,onChange:c=>o(i.id,{department:c.target.value}),options:gc,placeholder:"Select or add department"}),l.jsxs("div",{className:"ca-input-with-action",children:[l.jsx(de,{value:i.subDepartment,onChange:c=>o(i.id,{subDepartment:c.target.value}),placeholder:"Add sub-department"}),l.jsx("button",{type:"button",className:"ca-input-with-action__btn","aria-label":"Add sub-department",onClick:()=>{i.subDepartment.trim()},children:l.jsx(vn,{size:14,color:"currentColor"})})]}),l.jsx(ue,{value:i.roles,onChange:c=>o(i.id,{roles:c.target.value}),options:Oa,placeholder:"Select roles"}),l.jsx(G,{variant:"link",size:"sm",onClick:s,children:"+ Add"})]},i.id))]})})}function Ra({children:e,onClick:t,className:n="",active:r=!1}){return l.jsx("button",{type:"button",className:`ca-chip ${r?"ca-chip--active":""} ${n}`.trim(),onClick:t,children:e})}function Ua({checked:e=!1,onChange:t,name:n,value:r,"aria-label":a,className:o=""}){return l.jsxs("label",{className:`ca-radio ${o}`.trim(),children:[l.jsx("input",{type:"radio",className:"ca-radio__input",name:n,value:r,checked:e,onChange:t,"aria-label":a}),l.jsx("span",{className:"ca-radio__mark"})]})}function An({size:e=16,color:t="#9CA3AF",...n}){return l.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...n,children:[l.jsx("circle",{cx:"5",cy:"4",r:"1.2",fill:t}),l.jsx("circle",{cx:"11",cy:"4",r:"1.2",fill:t}),l.jsx("circle",{cx:"5",cy:"8",r:"1.2",fill:t}),l.jsx("circle",{cx:"11",cy:"8",r:"1.2",fill:t}),l.jsx("circle",{cx:"5",cy:"12",r:"1.2",fill:t}),l.jsx("circle",{cx:"11",cy:"12",r:"1.2",fill:t})]})}function Ma(e){return{id:`${Date.now()}-${Math.random().toString(36).slice(2,7)}`,name:e,color:""}}function bc({onNext:e,stepMeta:t}){const{state:n,update:r}=Oe(),{priorityDraft:a,priorities:o,defaultPriorityId:s}=n,i=u=>{const d=(u??a).trim();if(!d)return;if(o.some(E=>E.name.toLowerCase()===d.toLowerCase())){r({priorityDraft:""});return}const h=[...o,Ma(d)];r({priorities:h,priorityDraft:"",defaultPriorityId:s??h[0].id})},c=(u,d)=>{r({priorities:o.map(h=>h.id===u?{...h,...d}:h)})},f=hc.map(u=>({value:u.value,label:u.label}));return l.jsxs(Ae,{title:t.title,description:t.description,onNext:e,children:[l.jsxs("div",{className:"ca-priority-add",children:[l.jsx($e,{children:"Priorities"}),l.jsxs("div",{className:"ca-priority-add__row",children:[l.jsx(de,{value:a,onChange:u=>r({priorityDraft:u.target.value}),placeholder:"Add priority",onKeyDown:u=>{u.key==="Enter"&&(u.preventDefault(),i())}}),l.jsx(G,{variant:"outline",onClick:()=>i(),children:"+ Add"})]}),l.jsx("div",{className:"ca-chip-row",children:fc.map(u=>l.jsxs(Ra,{onClick:()=>i(u),children:["+ ",u]},u))})]}),l.jsxs("div",{className:"ca-priority-table",children:[l.jsxs("div",{className:"ca-priority-table__head",children:[l.jsx("div",{children:"Priority"}),l.jsx("div",{children:"Color"}),l.jsx("div",{children:"Default"})]}),(o.length?o:[Ma("")]).map((u,d)=>{const h=!o.length;return l.jsxs("div",{className:"ca-priority-table__row",children:[l.jsxs("div",{className:"ca-priority-table__name",children:[l.jsx(An,{}),l.jsx(de,{value:h?a:u.name,onChange:E=>{h?r({priorityDraft:E.target.value}):c(u.id,{name:E.target.value})},placeholder:"Add priority"})]}),l.jsx(ue,{value:u.color,onChange:E=>{h||c(u.id,{color:E.target.value})},options:f,placeholder:"Select color"}),l.jsx(Ua,{name:"default-priority",value:u.id,checked:!h&&s===u.id,onChange:()=>!h&&r({defaultPriorityId:u.id}),"aria-label":"Default priority"})]},u.id||d)})]})]})}function vc({onNext:e,stepMeta:t,substep:n=1,onSubstepChange:r}){const{state:a,update:o,updateWorkflow:s}=Oe(),{selectedDeptNode:i,workflow:c}=a,f=()=>{if(n<_n.length){r?.(n+1);return}e?.()};return l.jsx(Ae,{title:t.title,description:t.description,onNext:e,nextVariant:"secondary",children:l.jsxs("div",{className:"ca-workflow",children:[l.jsxs("aside",{className:"ca-workflow__sidebar",children:[l.jsx("h3",{className:"ca-workflow__sidebar-title",children:"Select Department"}),l.jsx("p",{className:"ca-small",children:"Add workflow for selected department"}),l.jsx("ul",{className:"ca-dept-tree",children:pc.map(u=>l.jsxs("li",{className:"ca-dept-tree__group",children:[l.jsx("button",{type:"button",className:`ca-dept-tree__item ${i===u.id?"ca-dept-tree__item--active":""}`,onClick:()=>o({selectedDeptNode:u.id}),children:u.name}),u.children?.length?l.jsx("ul",{className:"ca-dept-tree__children",children:u.children.map(d=>l.jsx("li",{children:l.jsxs("button",{type:"button",className:`ca-dept-tree__item ca-dept-tree__item--child ${i===d.id?"ca-dept-tree__item--active":""}`,onClick:()=>o({selectedDeptNode:d.id}),children:[l.jsx("span",{className:"ca-dept-tree__branch","aria-hidden":"true",children:"β””"}),d.name]})},d.id))}):null]},u.id))})]}),l.jsxs("div",{className:"ca-workflow__main",children:[l.jsx(Cn,{steps:_n,currentStep:n,onStepClick:r,size:"sm",className:"ca-workflow__substepper"}),n===1?l.jsxs("div",{className:"ca-workflow__form",children:[l.jsxs("div",{className:"ca-step-row",children:[l.jsx(Nn,{className:"ca-step-row__grow",label:"Name",placeholder:"Enter name",value:c.name,onChange:u=>s({name:u.target.value})}),l.jsx(Nn,{className:"ca-step-row__grow",label:"TAT Minutes",placeholder:"Enter here",value:c.tatMinutes,onChange:u=>s({tatMinutes:u.target.value})})]}),l.jsx(On,{label:"Description",placeholder:"Enter description",value:c.description,onChange:u=>s({description:u.target.value}),rows:5})]}):null,n===2?l.jsx("div",{className:"ca-workflow__placeholder",children:l.jsx("p",{className:"ca-body",children:"Configure workflow statuses for the selected department."})}):null,n===3?l.jsx("div",{className:"ca-workflow__placeholder",children:l.jsx("p",{className:"ca-body",children:"Define ordered workflow steps and assignees."})}):null,l.jsx("div",{className:"ca-workflow__actions",children:l.jsx(G,{onClick:f,endIcon:l.jsx(lt,{size:14,color:"#fff"}),children:"Next Step"})})]})]})})}function ja({size:e=16,color:t="#9CA3AF",...n}){return l.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...n,children:l.jsx("path",{d:"M4 7h16M9 7V5a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2m2 0v12a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2V7h12Z",stroke:t,strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}const Rt=Na.map(e=>({value:e.id,label:e.label}));function Sc({type:e}){const t={text:"A",doc:"ΒΆ",calendar:"口",clock:"β—·",chevron:"β–Ύ"};return l.jsx("span",{className:"ca-field-lib__glyph",children:t[e]||"β–Ύ"})}function Ec({onNext:e,stepMeta:t}){const{state:n,update:r}=Oe(),{fieldDraft:a,formFields:o}=n,s=d=>r({fieldDraft:{...a,...d}}),i=()=>{if(!a.name.trim()||!a.type)return;const d=Rt.find(h=>h.value===a.type)?.label||a.type;r({formFields:[...o,{id:`${Date.now()}`,name:a.name.trim(),type:a.type,typeLabel:d,required:!1}],fieldDraft:{name:"",type:""}})},c=(d,h)=>{r({formFields:o.map(E=>E.id===d?{...E,...h}:E)})},f=d=>{r({formFields:o.filter(h=>h.id!==d)})},u=d=>{s({type:d.id})};return l.jsx(Ae,{title:t.title,description:t.description,showNext:!1,footer:l.jsx(G,{onClick:e,endIcon:l.jsx(lt,{size:14,color:"#fff"}),children:"Next"}),children:l.jsxs("div",{className:"ca-form-fields",children:[l.jsxs("aside",{className:"ca-field-lib",children:[l.jsx("h3",{className:"ca-field-lib__title",children:"Field Library"}),l.jsx("p",{className:"ca-small",children:"Drag and drop the fields to add."}),l.jsx("ul",{className:"ca-field-lib__list",children:Na.map(d=>l.jsx("li",{children:l.jsxs("button",{type:"button",className:"ca-field-lib__item",draggable:!0,onDragStart:h=>{h.dataTransfer.setData("text/plain",d.id)},onClick:()=>u(d),children:[l.jsx(Sc,{type:d.icon}),l.jsx("span",{children:d.label})]})},d.id))})]}),l.jsxs("div",{className:"ca-form-fields__main",children:[l.jsxs("div",{className:"ca-add-fields",onDragOver:d=>d.preventDefault(),onDrop:d=>{d.preventDefault();const h=d.dataTransfer.getData("text/plain");h&&s({type:h})},children:[l.jsxs("div",{className:"ca-add-fields__top",children:[l.jsx("h3",{className:"ca-add-fields__title",children:"Add Fields"}),l.jsx(G,{onClick:i,children:"Add Field"})]}),l.jsxs("div",{className:"ca-step-row",children:[l.jsxs("div",{className:"ca-step-row__grow",children:[l.jsx($e,{children:"Name of Field"}),l.jsx(de,{value:a.name,onChange:d=>s({name:d.target.value}),placeholder:"Enter name of the field."})]}),l.jsxs("div",{className:"ca-step-row__grow",children:[l.jsx($e,{children:"Type of Field"}),l.jsx(ue,{value:a.type,onChange:d=>s({type:d.target.value}),options:Rt,placeholder:"Select type of the field."})]})]})]}),l.jsxs("div",{className:"ca-fields-table",children:[l.jsxs("div",{className:"ca-fields-table__head",children:[l.jsx("div",{children:"Field Name"}),l.jsx("div",{children:"Field Type"}),l.jsx("div",{children:"Required"}),l.jsx("div",{})]}),o.length===0?l.jsx("div",{className:"ca-fields-table__empty",children:l.jsx("p",{className:"ca-small",children:"No fields added yet."})}):o.map(d=>l.jsxs("div",{className:"ca-fields-table__row",children:[l.jsxs("div",{className:"ca-fields-table__name",children:[l.jsx(An,{}),l.jsx(de,{value:d.name,onChange:h=>c(d.id,{name:h.target.value})})]}),l.jsx(ue,{value:d.type,onChange:h=>{const E=h.target.value,v=Rt.find(_=>_.value===E)?.label||E;c(d.id,{type:E,typeLabel:v})},options:Rt,placeholder:"Select type"}),l.jsx(Tn,{checked:d.required,onChange:h=>c(d.id,{required:h}),"aria-label":"Required"}),l.jsx("button",{type:"button",className:"ca-icon-btn","aria-label":"Delete field",onClick:()=>f(d.id),children:l.jsx(ja,{})})]},d.id))]})]})]})})}function Cc({onPublish:e,stepMeta:t}){const{state:n}=Oe(),r=Ta.find(a=>a.value===n.categoryType)?.label||n.categoryType;return l.jsx(Ae,{title:t.title,description:t.description,nextLabel:"Publish",onNext:e,children:l.jsxs("div",{className:"ca-review",children:[l.jsxs("section",{className:"ca-review__block",children:[l.jsx(ce,{children:"Category Type"}),l.jsxs("div",{className:"ca-review__row",children:[l.jsx(Bt,{children:r}),l.jsx(En,{status:n.active?"active":"inactive"})]}),n.description?l.jsx(Y,{children:n.description}):null,n.roles.length?l.jsxs(Y,{children:["Roles: ",n.roles.join(", ")]}):null]}),l.jsxs("section",{className:"ca-review__block",children:[l.jsx(ce,{children:"Departments"}),l.jsxs(Y,{children:[n.departmentRows.filter(a=>a.department).length," department row(s) configured"]})]}),l.jsxs("section",{className:"ca-review__block",children:[l.jsx(ce,{children:"Priorities"}),l.jsx(Y,{children:n.priorities.length?n.priorities.map(a=>a.name).join(", "):"No priorities added"})]}),l.jsxs("section",{className:"ca-review__block",children:[l.jsx(ce,{children:"Workflow"}),l.jsx(Y,{children:n.workflow.name?`${n.workflow.name} (TAT: ${n.workflow.tatMinutes||"β€”"} min)`:"No workflow created yet"})]}),l.jsxs("section",{className:"ca-review__block ca-review__block--last",children:[l.jsx(ce,{children:"Form Fields"}),l.jsx(Y,{children:n.formFields.length?n.formFields.map(a=>a.name).join(", "):"No form fields added"})]}),l.jsx("div",{className:"ca-workflow__actions",children:l.jsx(G,{onClick:e,children:"Publish"})})]})})}function _c(e){const t=Number(e);return!Number.isFinite(t)||t<1?1:t>Te.length?Te.length:Math.floor(t)}function Nc(e){const t=Number(e);return!Number.isFinite(t)||t<1?1:t>3?3:Math.floor(t)}function $a({title:e="Complaint Management Settings",onPublish:t,onStepChange:n}){const r=pt(),{systemId:a}=Po(),[o,s]=hs(),i=_c(o.get("step")||1),c=Nc(o.get("substep")||1);D.useEffect(()=>{if(!o.get("step")){const v=new URLSearchParams(o);v.set("step","1"),s(v,{replace:!0})}},[o,s]);const f=D.useMemo(()=>Te.find(v=>v.id===i)||Te[0],[i]),u=D.useCallback((v,_)=>{const y=new URLSearchParams(o);y.set("step",String(v)),v===4?y.set("substep",String(_??(v===i?c:1))):y.delete("substep"),s(y,{replace:!1}),n?.({systemId:a,step:v,substep:_})},[o,s,n,a,i,c]),d=()=>{i<Te.length&&u(i+1,1)},h=v=>{u(4,v)},E=()=>{t?.({systemId:a,step:i})};return l.jsx(_a,{children:l.jsxs("div",{className:"ca-settings-page",children:[l.jsx(Sn,{children:e}),l.jsx(Cn,{steps:Te,currentStep:i,onStepClick:v=>u(v,v===4?1:void 0),className:"ca-settings-page__stepper"}),i===1?l.jsx(mc,{onNext:d,stepMeta:f}):null,i===2?l.jsx(wc,{onNext:d,stepMeta:f}):null,i===3?l.jsx(bc,{onNext:d,stepMeta:f}):null,i===4?l.jsx(vc,{onNext:d,stepMeta:f,substep:c,onSubstepChange:h}):null,i===5?l.jsx(Ec,{onNext:d,stepMeta:f}):null,i===6?l.jsx(Cc,{onPublish:E,stepMeta:f}):null,l.jsx("button",{type:"button",className:"ca-back-link",onClick:()=>r("/"),children:"← Back to Complaint Management"})]})},a||"new")}function Oc({pageProps:e,onPublish:t,onStepChange:n,children:r}){const a=r??l.jsx(Sa,{...e});return l.jsxs(qo,{children:[l.jsx(ht,{path:"/",element:a}),l.jsx(ht,{path:"/settings/:systemId",element:l.jsx($a,{onPublish:t,onStepChange:n})}),l.jsx(ht,{path:"*",element:a})]})}function Tc({pageProps:e,onPublish:t,onStepChange:n,children:r}){return l.jsx(Oc,{pageProps:e,onPublish:t,onStepChange:n,children:r})}function Ac({children:e}){const{cssVars:t,darkMode:n,mode:r}=Qr();return l.jsx("div",{className:`ca-root ${n?"ca-root--dark":"ca-root--light"}`,"data-ca-theme":r,style:t,children:e})}const Wa=({apiUrl:e,authToken:t,store:n=aa,basePath:r="/",theme:a,darkMode:o=!1,title:s,description:i,systems:c,systemsEndpoint:f,useDemoData:u=!0,createLabel:d,onCreateForm:h,onConfigure:E,onTitleClick:v,onDescriptionClick:_,onSearch:y,onPublish:m,onStepChange:w,children:S})=>{const N={title:s,description:i,systems:c,systemsEndpoint:f,useDemoData:u,createLabel:d,onCreateForm:h,onConfigure:E,onTitleClick:v,onDescriptionClick:_,onSearch:y};return l.jsx(Yr,{theme:a,darkMode:o,children:l.jsx(Ya.Provider,{store:n,children:l.jsx(Ac,{children:l.jsx(Hr,{apiUrl:e,authToken:t,children:l.jsx(is,{basename:r,children:l.jsx(Tc,{pageProps:N,onPublish:m,onStepChange:w,children:S})})})})})})},Pc=ee.colors,xc=ee.radii,Dc=ee.spacing,Fc=ee.typography;g.ApiProvider=Hr,g.BodyText=Y,g.Button=G,g.COMPLAINT_ENDPOINTS=X,g.CardFooter=da,g.CardHeader=ca,g.ChevronDownIcon=xa,g.ChevronRightIcon=lt,g.Chip=Ra,g.CloseIcon=La,g.ComplaintApp=Wa,g.ComplaintManagementPage=Sa,g.ComplaintSettingsPage=$a,g.DEFAULT_PAGE_DESCRIPTION=ba,g.DEMO_SYSTEMS=wa,g.DataPoint=ua,g.Divider=fa,g.DragHandleIcon=An,g.FieldLabel=$e,g.FormField=It,g.FormInput=Nn,g.FormSelect=Fa,g.FormTextarea=On,g.Heading1=Sn,g.Heading2=ce,g.Input=de,g.LabelText=Bt,g.LayersIcon=Aa,g.LinkText=ia,g.Loading=ya,g.PageHeader=la,g.PlusIcon=vn,g.Radio=Ua,g.RoleMultiSelect=Ia,g.SETTINGS_STEPS=Te,g.SearchBar=ga,g.SearchIcon=ma,g.Select=ue,g.SettingsCard=Ae,g.SettingsCardHeader=Pa,g.SettingsWizardProvider=_a,g.StatusBadge=En,g.Stepper=Cn,g.SystemCard=pa,g.SystemCardGrid=ha,g.Tag=Ba,g.Textarea=Da,g.ThemeProvider=Yr,g.Toggle=Tn,g.ToggleField=ka,g.TrashIcon=ja,g.Typography=le,g.ValueText=sa,g.WORKFLOW_SUBSTEPS=_n,g.api=j,g.clearComplaintError=ic,g.clearSelectedComplaintResource=lc,g.colors=Pc,g.complaintDepartmentActions=Se,g.complaintPriorityActions=Ee,g.complaintReducer=na,g.complaintStatusActions=_e,g.complaintTypeActions=ve,g.complaintWorkflowActions=Ce,g.createComplaintDepartment=$l,g.createComplaintPriority=ql,g.createComplaintStatus=nc,g.createComplaintStore=ra,g.createComplaintType=Il,g.createComplaintWorkflow=Yl,g.darkTheme=rt,g.deepMerge=je,g.default=Wa,g.defaultThemeFile=qr,g.deleteComplaintDepartment=Vl,g.deleteComplaintPriority=Kl,g.deleteComplaintStatus=ac,g.deleteComplaintType=Ul,g.deleteComplaintWorkflow=Zl,g.deleteWorkflowSteps=Zr,g.getComplaintDepartmentById=jl,g.getComplaintDepartments=Ml,g.getComplaintPriorities=zl,g.getComplaintPriorityById=Hl,g.getComplaintStatusById=tc,g.getComplaintStatuses=ec,g.getComplaintTypeById=Bl,g.getComplaintTypes=Ll,g.getComplaintWorkflowById=Gl,g.getComplaintWorkflows=Xl,g.getDepartmentTree=Dt,g.getWorkflowSteps=Ft,g.lightTheme=ee,g.normalizeThemeFile=Jr,g.radii=xc,g.resetComplaintState=cc,g.resolveActiveTheme=Kr,g.saveWorkflowSteps=kt,g.setAuthToken=zr,g.setBaseUrl=Vr,g.spacing=Dc,g.store=aa,g.themeToCssVars=Xr,g.typography=Fc,g.updateComplaintDepartment=Wl,g.updateComplaintPriority=Jl,g.updateComplaintStatus=rc,g.updateComplaintType=Rl,g.updateComplaintWorkflow=Ql,g.useSettingsWizard=Oe,g.useTheme=Qr,Object.defineProperties(g,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
12
12
  //# sourceMappingURL=complaint-app.umd.js.map