@moderta/mint-ai-assistant 0.1.1 → 0.1.4

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,5 +1,5 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(`.mint-pointer-events-none{pointer-events:none}.mint-fixed{position:fixed}.mint-absolute{position:absolute}.mint-relative{position:relative}.mint-inset-0{top:0;right:0;bottom:0;left:0}.mint-bottom-0{bottom:0}.mint-bottom-4{bottom:1rem}.mint-bottom-6{bottom:1.5rem}.mint-bottom-8{bottom:2rem}.mint-left-4{left:1rem}.mint-left-\\[66px\\]{left:66px}.mint-right-2{right:.5rem}.mint-right-4{right:1rem}.mint-right-6{right:1.5rem}.mint-right-\\[66px\\]{right:66px}.mint-top-1\\/2{top:50%}.mint-top-4{top:1rem}.mint-z-widget{z-index:2147483000}.mint-col-span-1{grid-column:span 1 / span 1}.mint-m-0{margin:0}.mint-mx-2{margin-left:.5rem;margin-right:.5rem}.mint-mx-6{margin-left:1.5rem;margin-right:1.5rem}.mint-mt-1{margin-top:.25rem}.mint-mt-2{margin-top:.5rem}.mint-mt-3{margin-top:.75rem}.mint-mt-4{margin-top:1rem}.mint-mt-6{margin-top:1.5rem}.mint-block{display:block}.mint-inline-block{display:inline-block}.mint-flex{display:flex}.mint-inline-flex{display:inline-flex}.mint-grid{display:grid}.mint-h-10{height:2.5rem}.mint-h-11{height:2.75rem}.mint-h-12{height:3rem}.mint-h-14{height:3.5rem}.mint-h-2{height:.5rem}.mint-h-2\\.5{height:.625rem}.mint-h-3{height:.75rem}.mint-h-4{height:1rem}.mint-h-5{height:1.25rem}.mint-h-6{height:1.5rem}.mint-h-7{height:1.75rem}.mint-h-8{height:2rem}.mint-h-9{height:2.25rem}.mint-h-\\[20px\\]{height:20px}.mint-h-\\[640px\\]{height:640px}.mint-h-\\[72px\\]{height:72px}.mint-h-\\[82px\\]{height:82px}.mint-h-\\[min\\(720px\\,calc\\(100vh-112px\\)\\)\\]{height:min(720px,calc(100vh - 112px))}.mint-h-\\[min\\(92vh\\,614px\\)\\]{height:min(92vh,614px)}.mint-h-px{height:1px}.mint-max-h-20{max-height:5rem}.mint-max-h-\\[85vh\\]{max-height:85vh}.mint-min-h-3{min-height:.75rem}.mint-min-h-screen{min-height:100vh}.mint-w-10{width:2.5rem}.mint-w-11{width:2.75rem}.mint-w-12{width:3rem}.mint-w-14{width:3.5rem}.mint-w-2{width:.5rem}.mint-w-2\\.5{width:.625rem}.mint-w-3{width:.75rem}.mint-w-4{width:1rem}.mint-w-7{width:1.75rem}.mint-w-8{width:2rem}.mint-w-9{width:2.25rem}.mint-w-\\[20px\\]{width:20px}.mint-w-\\[226px\\]{width:226px}.mint-w-\\[230px\\]{width:230px}.mint-w-\\[370px\\]{width:370px}.mint-w-\\[420px\\]{width:420px}.mint-w-\\[min\\(1080px\\,calc\\(100vw-32px\\)\\)\\]{width:min(1080px,calc(100vw - 32px))}.mint-w-\\[min\\(1100px\\,calc\\(100vw-32px\\)\\)\\]{width:min(1100px,calc(100vw - 32px))}.mint-w-fit{width:-moz-fit-content;width:fit-content}.mint-w-full{width:100%}.mint-min-w-0{min-width:0px}.mint-min-w-\\[320px\\]{min-width:320px}.mint-max-w-\\[520px\\]{max-width:520px}.mint-max-w-\\[78\\%\\]{max-width:78%}.mint-max-w-\\[calc\\(100vw-32px\\)\\]{max-width:calc(100vw - 32px)}.mint-max-w-full{max-width:100%}.mint-flex-1{flex:1 1 0%}.mint-shrink-0{flex-shrink:0}.mint--translate-y-1\\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.mint-translate-y-\\[2px\\]{--tw-translate-y: 2px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes mint-bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.mint-animate-bounce{animation:mint-bounce 1s infinite}.mint-resize-none{resize:none}.mint-appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.mint-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.mint-flex-row-reverse{flex-direction:row-reverse}.mint-flex-col{flex-direction:column}.mint-flex-wrap{flex-wrap:wrap}.mint-items-start{align-items:flex-start}.mint-items-end{align-items:flex-end}.mint-items-center{align-items:center}.mint-justify-start{justify-content:flex-start}.mint-justify-end{justify-content:flex-end}.mint-justify-center{justify-content:center}.mint-justify-between{justify-content:space-between}.mint-gap-0\\.5{gap:.125rem}.mint-gap-1{gap:.25rem}.mint-gap-1\\.5{gap:.375rem}.mint-gap-2{gap:.5rem}.mint-gap-3{gap:.75rem}.mint-gap-5{gap:1.25rem}.mint-gap-6{gap:1.5rem}.mint-gap-x-3{-moz-column-gap:.75rem;column-gap:.75rem}.mint-gap-y-3{row-gap:.75rem}.mint-self-end{align-self:flex-end}.mint-overflow-hidden{overflow:hidden}.mint-overflow-y-auto{overflow-y:auto}.mint-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mint-whitespace-nowrap{white-space:nowrap}.mint-whitespace-pre-wrap{white-space:pre-wrap}.mint-break-words{overflow-wrap:break-word}.mint-rounded{border-radius:.25rem}.mint-rounded-2xl{border-radius:1rem}.mint-rounded-\\[7px\\]{border-radius:7px}.mint-rounded-full{border-radius:9999px}.mint-rounded-lg{border-radius:.5rem}.mint-rounded-md{border-radius:.375rem}.mint-rounded-xl{border-radius:.75rem}.mint-rounded-tl-sm{border-top-left-radius:.125rem}.mint-rounded-tr-sm{border-top-right-radius:.125rem}.mint-border{border-width:1px}.mint-border-0{border-width:0px}.mint-border-\\[0\\.125px\\]{border-width:.125px}.mint-border-b{border-bottom-width:1px}.mint-border-solid{border-style:solid}.mint-border-assistant-accent{--tw-border-opacity: 1;border-color:rgb(94 236 176 / var(--tw-border-opacity, 1))}.mint-border-grey-100{--tw-border-opacity: 1;border-color:rgb(249 250 251 / var(--tw-border-opacity, 1))}.mint-border-grey-200{--tw-border-opacity: 1;border-color:rgb(244 246 248 / var(--tw-border-opacity, 1))}.mint-border-grey-300{--tw-border-opacity: 1;border-color:rgb(223 227 232 / var(--tw-border-opacity, 1))}.mint-border-primary-light{--tw-border-opacity: 1;border-color:rgb(91 228 155 / var(--tw-border-opacity, 1))}.mint-bg-assistant-accent\\/5{background-color:#5eecb00d}.mint-bg-assistant-action{--tw-bg-opacity: 1;background-color:rgb(94 236 176 / var(--tw-bg-opacity, 1))}.mint-bg-assistant-divider{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.mint-bg-assistant-shell{--tw-bg-opacity: 1;background-color:rgb(223 227 232 / var(--tw-bg-opacity, 1))}.mint-bg-black\\/20{background-color:#0003}.mint-bg-current{background-color:currentColor}.mint-bg-error\\/10{background-color:#ff56301a}.mint-bg-grey-100{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.mint-bg-grey-200{--tw-bg-opacity: 1;background-color:rgb(244 246 248 / var(--tw-bg-opacity, 1))}.mint-bg-grey-300{--tw-bg-opacity: 1;background-color:rgb(223 227 232 / var(--tw-bg-opacity, 1))}.mint-bg-grey-500{--tw-bg-opacity: 1;background-color:rgb(145 158 171 / var(--tw-bg-opacity, 1))}.mint-bg-primary{--tw-bg-opacity: 1;background-color:rgb(0 167 111 / var(--tw-bg-opacity, 1))}.mint-bg-primary-dark{--tw-bg-opacity: 1;background-color:rgb(0 120 103 / var(--tw-bg-opacity, 1))}.mint-bg-primary-light{--tw-bg-opacity: 1;background-color:rgb(91 228 155 / var(--tw-bg-opacity, 1))}.mint-bg-primary-lighter\\/40{background-color:#c8fad666}.mint-bg-transparent{background-color:transparent}.mint-bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.mint-bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.mint-from-primary-light{--tw-gradient-from: #5BE49B var(--tw-gradient-from-position);--tw-gradient-to: rgb(91 228 155 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.mint-to-primary{--tw-gradient-to: #00A76F var(--tw-gradient-to-position)}.mint-object-cover{-o-object-fit:cover;object-fit:cover}.mint-p-0{padding:0}.mint-p-1{padding:.25rem}.mint-p-2{padding:.5rem}.mint-p-3{padding:.75rem}.mint-p-4{padding:1rem}.mint-p-5{padding:1.25rem}.mint-p-6{padding:1.5rem}.mint-px-1{padding-left:.25rem;padding-right:.25rem}.mint-px-2{padding-left:.5rem;padding-right:.5rem}.mint-px-2\\.5{padding-left:.625rem;padding-right:.625rem}.mint-px-3{padding-left:.75rem;padding-right:.75rem}.mint-px-4{padding-left:1rem;padding-right:1rem}.mint-px-5{padding-left:1.25rem;padding-right:1.25rem}.mint-px-6{padding-left:1.5rem;padding-right:1.5rem}.mint-px-\\[66px\\]{padding-left:66px;padding-right:66px}.mint-py-1{padding-top:.25rem;padding-bottom:.25rem}.mint-py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.mint-py-2{padding-top:.5rem;padding-bottom:.5rem}.mint-py-3{padding-top:.75rem;padding-bottom:.75rem}.mint-py-4{padding-top:1rem;padding-bottom:1rem}.mint-py-5{padding-top:1.25rem;padding-bottom:1.25rem}.mint-pb-28{padding-bottom:7rem}.mint-pb-5{padding-bottom:1.25rem}.mint-pr-5{padding-right:1.25rem}.mint-pt-3{padding-top:.75rem}.mint-text-left{text-align:left}.mint-text-center{text-align:center}.mint-text-2xl{font-size:1.5rem;line-height:2rem}.mint-text-3xl{font-size:1.875rem;line-height:2.25rem}.mint-text-\\[10px\\]{font-size:10px}.mint-text-\\[22px\\]{font-size:22px}.mint-text-\\[24px\\]{font-size:24px}.mint-text-\\[28px\\]{font-size:28px}.mint-text-\\[6px\\]{font-size:6px}.mint-text-\\[7px\\]{font-size:7px}.mint-text-\\[9px\\]{font-size:9px}.mint-text-lg{font-size:1.125rem;line-height:1.75rem}.mint-text-sm{font-size:.875rem;line-height:1.25rem}.mint-text-xs{font-size:.75rem;line-height:1rem}.mint-font-bold{font-weight:700}.mint-font-extrabold{font-weight:800}.mint-font-medium{font-weight:500}.mint-font-normal{font-weight:400}.mint-font-semibold{font-weight:600}.mint-leading-3{line-height:.75rem}.mint-leading-4{line-height:1rem}.mint-leading-5{line-height:1.25rem}.mint-leading-7{line-height:1.75rem}.mint-leading-9{line-height:2.25rem}.mint-leading-none{line-height:1}.mint-leading-relaxed{line-height:1.625}.mint-text-assistant-action{--tw-text-opacity: 1;color:rgb(94 236 176 / var(--tw-text-opacity, 1))}.mint-text-error{--tw-text-opacity: 1;color:rgb(255 86 48 / var(--tw-text-opacity, 1))}.mint-text-grey-500{--tw-text-opacity: 1;color:rgb(145 158 171 / var(--tw-text-opacity, 1))}.mint-text-grey-600{--tw-text-opacity: 1;color:rgb(99 115 129 / var(--tw-text-opacity, 1))}.mint-text-grey-700{--tw-text-opacity: 1;color:rgb(69 79 91 / var(--tw-text-opacity, 1))}.mint-text-grey-800{--tw-text-opacity: 1;color:rgb(28 37 46 / var(--tw-text-opacity, 1))}.mint-text-grey-900{--tw-text-opacity: 1;color:rgb(20 26 33 / var(--tw-text-opacity, 1))}.mint-text-primary{--tw-text-opacity: 1;color:rgb(0 167 111 / var(--tw-text-opacity, 1))}.mint-text-primary-contrast{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.mint-text-primary-dark{--tw-text-opacity: 1;color:rgb(0 120 103 / var(--tw-text-opacity, 1))}.mint-text-primary-light{--tw-text-opacity: 1;color:rgb(91 228 155 / var(--tw-text-opacity, 1))}.mint-opacity-60{opacity:.6}.mint-shadow-composer{--tw-shadow: 0 1px 2px rgba(145,158,171,.08), 0 8px 24px rgba(145,158,171,.16);--tw-shadow-colored: 0 1px 2px var(--tw-shadow-color), 0 8px 24px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.mint-shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.mint-shadow-widget{--tw-shadow: 0 0 2px 0 rgba(145,158,171,.2), 0 12px 24px -4px rgba(145,158,171,.12);--tw-shadow-colored: 0 0 2px 0 var(--tw-shadow-color), 0 12px 24px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.mint-outline-none{outline:2px solid transparent;outline-offset:2px}.mint-transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.mint-transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.\\[animation-delay\\:-0\\.15s\\]{animation-delay:-.15s}.\\[animation-delay\\:-0\\.3s\\]{animation-delay:-.3s}.mint-ai-root,.mint-ai-root *{box-sizing:border-box}.mint-ai-root{font-family:'"Public Sans Variable"',system-ui,sans-serif;line-height:1.5;color:#1c252e}.mint-ai-root button,.mint-ai-root textarea{font-family:inherit}.mint-ai-root button{-webkit-appearance:none;-moz-appearance:none;appearance:none}.mint-ai-shell{width:min(440px,calc(100vw - 32px));height:min(560px,calc(100vh - 112px));padding:12px;border-radius:16px;background:#dfe3e8}.mint-ai-panel{width:100%;height:100%;font-family:Roboto,'"Public Sans Variable"',system-ui,sans-serif}.mint-ai-root .mint-scroll{scrollbar-width:thin;scrollbar-color:#C4CDD5 transparent}.mint-ai-root .mint-scroll::-webkit-scrollbar{width:6px;height:6px}.mint-ai-root .mint-scroll::-webkit-scrollbar-thumb{background-color:#c4cdd5;border-radius:9999px}.placeholder\\:mint-text-grey-600::-moz-placeholder{--tw-text-opacity: 1;color:rgb(99 115 129 / var(--tw-text-opacity, 1))}.placeholder\\:mint-text-grey-600::placeholder{--tw-text-opacity: 1;color:rgb(99 115 129 / var(--tw-text-opacity, 1))}.hover\\:mint-scale-105:hover{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\\:mint-border-primary:hover{--tw-border-opacity: 1;border-color:rgb(0 167 111 / var(--tw-border-opacity, 1))}.hover\\:mint-bg-grey-100:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.hover\\:mint-bg-primary-darker:hover{--tw-bg-opacity: 1;background-color:rgb(0 75 80 / var(--tw-bg-opacity, 1))}.hover\\:mint-bg-primary-lighter:hover{--tw-bg-opacity: 1;background-color:rgb(200 250 214 / var(--tw-bg-opacity, 1))}.hover\\:mint-text-primary:hover{--tw-text-opacity: 1;color:rgb(0 167 111 / var(--tw-text-opacity, 1))}.focus\\:mint-border-primary:focus{--tw-border-opacity: 1;border-color:rgb(0 167 111 / var(--tw-border-opacity, 1))}.disabled\\:mint-opacity-40:disabled{opacity:.4}.disabled\\:hover\\:mint-scale-100:hover:disabled{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}`)),document.head.appendChild(t)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();
2
- "use strict";var Os=Object.defineProperty;var ks=(e,t,n)=>t in e?Os(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ie=(e,t,n)=>ks(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("react/jsx-runtime"),T=require("react");function Is(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 se=Is(T);var Nt={exports:{}},ln={};/**
1
+ (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(`.mint-pointer-events-none{pointer-events:none}.mint-fixed{position:fixed}.mint-absolute{position:absolute}.mint-relative{position:relative}.mint-inset-0{top:0;right:0;bottom:0;left:0}.mint-bottom-0{bottom:0}.mint-bottom-4{bottom:1rem}.mint-bottom-6{bottom:1.5rem}.mint-bottom-8{bottom:2rem}.mint-left-4{left:1rem}.mint-left-\\[66px\\]{left:66px}.mint-right-2{right:.5rem}.mint-right-4{right:1rem}.mint-right-6{right:1.5rem}.mint-right-\\[66px\\]{right:66px}.mint-top-1\\/2{top:50%}.mint-top-4{top:1rem}.mint-z-widget{z-index:2147483000}.mint-col-span-1{grid-column:span 1 / span 1}.mint-m-0{margin:0}.mint-mx-2{margin-left:.5rem;margin-right:.5rem}.mint-mx-6{margin-left:1.5rem;margin-right:1.5rem}.mint-mt-1{margin-top:.25rem}.mint-mt-2{margin-top:.5rem}.mint-mt-3{margin-top:.75rem}.mint-mt-4{margin-top:1rem}.mint-mt-6{margin-top:1.5rem}.mint-inline-block{display:inline-block}.mint-flex{display:flex}.mint-inline-flex{display:inline-flex}.mint-grid{display:grid}.mint-h-10{height:2.5rem}.mint-h-11{height:2.75rem}.mint-h-12{height:3rem}.mint-h-14{height:3.5rem}.mint-h-2{height:.5rem}.mint-h-2\\.5{height:.625rem}.mint-h-3{height:.75rem}.mint-h-4{height:1rem}.mint-h-5{height:1.25rem}.mint-h-6{height:1.5rem}.mint-h-7{height:1.75rem}.mint-h-8{height:2rem}.mint-h-9{height:2.25rem}.mint-h-\\[20px\\]{height:20px}.mint-h-\\[640px\\]{height:640px}.mint-h-\\[72px\\]{height:72px}.mint-h-\\[82px\\]{height:82px}.mint-h-\\[min\\(720px\\,calc\\(100vh-112px\\)\\)\\]{height:min(720px,calc(100vh - 112px))}.mint-h-\\[min\\(92vh\\,614px\\)\\]{height:min(92vh,614px)}.mint-h-px{height:1px}.mint-max-h-20{max-height:5rem}.mint-max-h-\\[85vh\\]{max-height:85vh}.mint-min-h-3{min-height:.75rem}.mint-min-h-screen{min-height:100vh}.mint-w-10{width:2.5rem}.mint-w-11{width:2.75rem}.mint-w-12{width:3rem}.mint-w-14{width:3.5rem}.mint-w-2{width:.5rem}.mint-w-2\\.5{width:.625rem}.mint-w-3{width:.75rem}.mint-w-4{width:1rem}.mint-w-7{width:1.75rem}.mint-w-8{width:2rem}.mint-w-9{width:2.25rem}.mint-w-\\[20px\\]{width:20px}.mint-w-\\[226px\\]{width:226px}.mint-w-\\[230px\\]{width:230px}.mint-w-\\[370px\\]{width:370px}.mint-w-\\[420px\\]{width:420px}.mint-w-\\[min\\(1080px\\,calc\\(100vw-32px\\)\\)\\]{width:min(1080px,calc(100vw - 32px))}.mint-w-\\[min\\(1100px\\,calc\\(100vw-32px\\)\\)\\]{width:min(1100px,calc(100vw - 32px))}.mint-w-fit{width:-moz-fit-content;width:fit-content}.mint-w-full{width:100%}.mint-min-w-0{min-width:0px}.mint-min-w-\\[320px\\]{min-width:320px}.mint-max-w-\\[520px\\]{max-width:520px}.mint-max-w-\\[78\\%\\]{max-width:78%}.mint-max-w-\\[calc\\(100vw-32px\\)\\]{max-width:calc(100vw - 32px)}.mint-max-w-full{max-width:100%}.mint-flex-1{flex:1 1 0%}.mint-shrink-0{flex-shrink:0}.mint--translate-y-1\\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.mint-translate-y-\\[2px\\]{--tw-translate-y: 2px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes mint-bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.mint-animate-bounce{animation:mint-bounce 1s infinite}.mint-resize-none{resize:none}.mint-appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.mint-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.mint-flex-row-reverse{flex-direction:row-reverse}.mint-flex-col{flex-direction:column}.mint-flex-wrap{flex-wrap:wrap}.mint-items-start{align-items:flex-start}.mint-items-end{align-items:flex-end}.mint-items-center{align-items:center}.mint-justify-start{justify-content:flex-start}.mint-justify-end{justify-content:flex-end}.mint-justify-center{justify-content:center}.mint-justify-between{justify-content:space-between}.mint-gap-0\\.5{gap:.125rem}.mint-gap-1{gap:.25rem}.mint-gap-1\\.5{gap:.375rem}.mint-gap-2{gap:.5rem}.mint-gap-3{gap:.75rem}.mint-gap-5{gap:1.25rem}.mint-gap-6{gap:1.5rem}.mint-gap-x-3{-moz-column-gap:.75rem;column-gap:.75rem}.mint-gap-y-3{row-gap:.75rem}.mint-self-end{align-self:flex-end}.mint-overflow-hidden{overflow:hidden}.mint-overflow-y-auto{overflow-y:auto}.mint-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mint-whitespace-nowrap{white-space:nowrap}.mint-whitespace-pre-wrap{white-space:pre-wrap}.mint-break-words{overflow-wrap:break-word}.mint-rounded{border-radius:.25rem}.mint-rounded-2xl{border-radius:1rem}.mint-rounded-\\[7px\\]{border-radius:7px}.mint-rounded-full{border-radius:9999px}.mint-rounded-lg{border-radius:.5rem}.mint-rounded-md{border-radius:.375rem}.mint-rounded-xl{border-radius:.75rem}.mint-rounded-tl-sm{border-top-left-radius:.125rem}.mint-rounded-tr-sm{border-top-right-radius:.125rem}.mint-border{border-width:1px}.mint-border-0{border-width:0px}.mint-border-\\[0\\.125px\\]{border-width:.125px}.mint-border-b{border-bottom-width:1px}.mint-border-solid{border-style:solid}.mint-border-assistant-accent{--tw-border-opacity: 1;border-color:rgb(94 236 176 / var(--tw-border-opacity, 1))}.mint-border-grey-100{--tw-border-opacity: 1;border-color:rgb(249 250 251 / var(--tw-border-opacity, 1))}.mint-border-grey-200{--tw-border-opacity: 1;border-color:rgb(244 246 248 / var(--tw-border-opacity, 1))}.mint-border-grey-300{--tw-border-opacity: 1;border-color:rgb(223 227 232 / var(--tw-border-opacity, 1))}.mint-border-primary-light{--tw-border-opacity: 1;border-color:rgb(91 228 155 / var(--tw-border-opacity, 1))}.mint-bg-assistant-accent\\/5{background-color:#5eecb00d}.mint-bg-assistant-action{--tw-bg-opacity: 1;background-color:rgb(94 236 176 / var(--tw-bg-opacity, 1))}.mint-bg-assistant-divider{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.mint-bg-assistant-shell{--tw-bg-opacity: 1;background-color:rgb(223 227 232 / var(--tw-bg-opacity, 1))}.mint-bg-black\\/20{background-color:#0003}.mint-bg-error\\/10{background-color:#ff56301a}.mint-bg-grey-100{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.mint-bg-grey-200{--tw-bg-opacity: 1;background-color:rgb(244 246 248 / var(--tw-bg-opacity, 1))}.mint-bg-grey-300{--tw-bg-opacity: 1;background-color:rgb(223 227 232 / var(--tw-bg-opacity, 1))}.mint-bg-grey-500{--tw-bg-opacity: 1;background-color:rgb(145 158 171 / var(--tw-bg-opacity, 1))}.mint-bg-primary{--tw-bg-opacity: 1;background-color:rgb(0 167 111 / var(--tw-bg-opacity, 1))}.mint-bg-primary-dark{--tw-bg-opacity: 1;background-color:rgb(0 120 103 / var(--tw-bg-opacity, 1))}.mint-bg-primary-light{--tw-bg-opacity: 1;background-color:rgb(91 228 155 / var(--tw-bg-opacity, 1))}.mint-bg-primary-lighter\\/40{background-color:#c8fad666}.mint-bg-transparent{background-color:transparent}.mint-bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.mint-bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.mint-from-primary-light{--tw-gradient-from: #5BE49B var(--tw-gradient-from-position);--tw-gradient-to: rgb(91 228 155 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.mint-to-primary{--tw-gradient-to: #00A76F var(--tw-gradient-to-position)}.mint-object-cover{-o-object-fit:cover;object-fit:cover}.mint-p-0{padding:0}.mint-p-1{padding:.25rem}.mint-p-2{padding:.5rem}.mint-p-3{padding:.75rem}.mint-p-4{padding:1rem}.mint-p-5{padding:1.25rem}.mint-p-6{padding:1.5rem}.mint-px-1{padding-left:.25rem;padding-right:.25rem}.mint-px-2{padding-left:.5rem;padding-right:.5rem}.mint-px-2\\.5{padding-left:.625rem;padding-right:.625rem}.mint-px-3{padding-left:.75rem;padding-right:.75rem}.mint-px-4{padding-left:1rem;padding-right:1rem}.mint-px-5{padding-left:1.25rem;padding-right:1.25rem}.mint-px-6{padding-left:1.5rem;padding-right:1.5rem}.mint-px-\\[66px\\]{padding-left:66px;padding-right:66px}.mint-py-1{padding-top:.25rem;padding-bottom:.25rem}.mint-py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.mint-py-2{padding-top:.5rem;padding-bottom:.5rem}.mint-py-3{padding-top:.75rem;padding-bottom:.75rem}.mint-py-4{padding-top:1rem;padding-bottom:1rem}.mint-py-5{padding-top:1.25rem;padding-bottom:1.25rem}.mint-pb-28{padding-bottom:7rem}.mint-pb-5{padding-bottom:1.25rem}.mint-pr-5{padding-right:1.25rem}.mint-pt-3{padding-top:.75rem}.mint-text-left{text-align:left}.mint-text-center{text-align:center}.mint-text-2xl{font-size:1.5rem;line-height:2rem}.mint-text-3xl{font-size:1.875rem;line-height:2.25rem}.mint-text-\\[10px\\]{font-size:10px}.mint-text-\\[22px\\]{font-size:22px}.mint-text-\\[24px\\]{font-size:24px}.mint-text-\\[28px\\]{font-size:28px}.mint-text-\\[6px\\]{font-size:6px}.mint-text-\\[7px\\]{font-size:7px}.mint-text-\\[9px\\]{font-size:9px}.mint-text-lg{font-size:1.125rem;line-height:1.75rem}.mint-text-sm{font-size:.875rem;line-height:1.25rem}.mint-text-xs{font-size:.75rem;line-height:1rem}.mint-font-bold{font-weight:700}.mint-font-extrabold{font-weight:800}.mint-font-medium{font-weight:500}.mint-font-normal{font-weight:400}.mint-font-semibold{font-weight:600}.mint-leading-3{line-height:.75rem}.mint-leading-4{line-height:1rem}.mint-leading-5{line-height:1.25rem}.mint-leading-7{line-height:1.75rem}.mint-leading-9{line-height:2.25rem}.mint-leading-none{line-height:1}.mint-leading-relaxed{line-height:1.625}.mint-text-assistant-action{--tw-text-opacity: 1;color:rgb(94 236 176 / var(--tw-text-opacity, 1))}.mint-text-error{--tw-text-opacity: 1;color:rgb(255 86 48 / var(--tw-text-opacity, 1))}.mint-text-grey-500{--tw-text-opacity: 1;color:rgb(145 158 171 / var(--tw-text-opacity, 1))}.mint-text-grey-600{--tw-text-opacity: 1;color:rgb(99 115 129 / var(--tw-text-opacity, 1))}.mint-text-grey-700{--tw-text-opacity: 1;color:rgb(69 79 91 / var(--tw-text-opacity, 1))}.mint-text-grey-800{--tw-text-opacity: 1;color:rgb(28 37 46 / var(--tw-text-opacity, 1))}.mint-text-grey-900{--tw-text-opacity: 1;color:rgb(20 26 33 / var(--tw-text-opacity, 1))}.mint-text-primary{--tw-text-opacity: 1;color:rgb(0 167 111 / var(--tw-text-opacity, 1))}.mint-text-primary-contrast{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.mint-text-primary-dark{--tw-text-opacity: 1;color:rgb(0 120 103 / var(--tw-text-opacity, 1))}.mint-text-primary-light{--tw-text-opacity: 1;color:rgb(91 228 155 / var(--tw-text-opacity, 1))}.mint-opacity-60{opacity:.6}.mint-shadow-composer{--tw-shadow: 0 1px 2px rgba(145,158,171,.08), 0 8px 24px rgba(145,158,171,.16);--tw-shadow-colored: 0 1px 2px var(--tw-shadow-color), 0 8px 24px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.mint-shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.mint-shadow-widget{--tw-shadow: 0 0 2px 0 rgba(145,158,171,.2), 0 12px 24px -4px rgba(145,158,171,.12);--tw-shadow-colored: 0 0 2px 0 var(--tw-shadow-color), 0 12px 24px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.mint-outline-none{outline:2px solid transparent;outline-offset:2px}.mint-transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.mint-transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.\\[animation-delay\\:-0\\.15s\\]{animation-delay:-.15s}.\\[animation-delay\\:-0\\.3s\\]{animation-delay:-.3s}.mint-ai-root,.mint-ai-root *{box-sizing:border-box}.mint-ai-root{font-family:'"Public Sans Variable"',system-ui,sans-serif;line-height:1.5;color:#1c252e}.mint-ai-root button,.mint-ai-root textarea{font-family:inherit}.mint-ai-root button{-webkit-appearance:none;-moz-appearance:none;appearance:none}.mint-ai-shell{width:min(440px,calc(100vw - 32px));height:min(560px,calc(100vh - 112px));padding:12px;border-radius:16px;background:#dfe3e8}.mint-ai-panel{width:100%;height:100%;font-family:Roboto,'"Public Sans Variable"',system-ui,sans-serif}.mint-ai-root .mint-svg-asset>svg{display:block;width:100%;height:100%}.mint-ai-root .mint-scroll{scrollbar-width:thin;scrollbar-color:#C4CDD5 transparent}.mint-ai-root .mint-scroll::-webkit-scrollbar{width:6px;height:6px}.mint-ai-root .mint-scroll::-webkit-scrollbar-thumb{background-color:#c4cdd5;border-radius:9999px}.placeholder\\:mint-text-grey-600::-moz-placeholder{--tw-text-opacity: 1;color:rgb(99 115 129 / var(--tw-text-opacity, 1))}.placeholder\\:mint-text-grey-600::placeholder{--tw-text-opacity: 1;color:rgb(99 115 129 / var(--tw-text-opacity, 1))}.hover\\:mint-scale-105:hover{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\\:mint-border-primary:hover{--tw-border-opacity: 1;border-color:rgb(0 167 111 / var(--tw-border-opacity, 1))}.hover\\:mint-bg-grey-100:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.hover\\:mint-bg-primary-darker:hover{--tw-bg-opacity: 1;background-color:rgb(0 75 80 / var(--tw-bg-opacity, 1))}.hover\\:mint-bg-primary-lighter:hover{--tw-bg-opacity: 1;background-color:rgb(200 250 214 / var(--tw-bg-opacity, 1))}.hover\\:mint-text-primary:hover{--tw-text-opacity: 1;color:rgb(0 167 111 / var(--tw-text-opacity, 1))}.focus\\:mint-border-primary:focus{--tw-border-opacity: 1;border-color:rgb(0 167 111 / var(--tw-border-opacity, 1))}.disabled\\:mint-opacity-40:disabled{opacity:.4}.disabled\\:hover\\:mint-scale-100:hover:disabled{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}`)),document.head.appendChild(t)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();
2
+ "use strict";var As=Object.defineProperty;var Ps=(e,t,n)=>t in e?As(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ie=(e,t,n)=>Ps(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("react/jsx-runtime"),T=require("react");function Ds(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 se=Ds(T);var Nt={exports:{}},cn={};/**
3
3
  * @license React
4
4
  * use-sync-external-store-with-selector.production.js
5
5
  *
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * This source code is licensed under the MIT license found in the
9
9
  * LICENSE file in the root directory of this source tree.
10
- */var ur;function Ms(){if(ur)return ln;ur=1;var e=T;function t(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,i=e.useRef,s=e.useEffect,o=e.useMemo,a=e.useDebugValue;return ln.useSyncExternalStoreWithSelector=function(c,u,l,y,j){var b=i(null);if(b.current===null){var h={hasValue:!1,value:null};b.current=h}else h=b.current;b=o(function(){function m(f){if(!S){if(S=!0,M=f,f=y(f),j!==void 0&&h.hasValue){var d=h.value;if(j(d,f))return x=d}return x=f}if(d=x,n(M,f))return d;var N=y(f);return j!==void 0&&j(d,N)?(M=f,d):(M=f,x=N)}var S=!1,M,x,v=l===void 0?null:l;return[function(){return m(u())},v===null?void 0:function(){return m(v())}]},[u,l,y,j]);var _=r(c,b[0],b[1]);return s(function(){h.hasValue=!0,h.value=_},[_]),a(_),_},ln}var dn={};/**
10
+ */var dr;function Rs(){if(dr)return cn;dr=1;var e=T;function t(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,i=e.useRef,s=e.useEffect,o=e.useMemo,a=e.useDebugValue;return cn.useSyncExternalStoreWithSelector=function(c,u,l,y,j){var b=i(null);if(b.current===null){var h={hasValue:!1,value:null};b.current=h}else h=b.current;b=o(function(){function m(f){if(!S){if(S=!0,M=f,f=y(f),j!==void 0&&h.hasValue){var d=h.value;if(j(d,f))return x=d}return x=f}if(d=x,n(M,f))return d;var N=y(f);return j!==void 0&&j(d,N)?(M=f,d):(M=f,x=N)}var S=!1,M,x,v=l===void 0?null:l;return[function(){return m(u())},v===null?void 0:function(){return m(v())}]},[u,l,y,j]);var _=r(c,b[0],b[1]);return s(function(){h.hasValue=!0,h.value=_},[_]),a(_),_},cn}var un={};/**
11
11
  * @license React
12
12
  * use-sync-external-store-with-selector.development.js
13
13
  *
@@ -15,29 +15,49 @@
15
15
  *
16
16
  * This source code is licensed under the MIT license found in the
17
17
  * LICENSE file in the root directory of this source tree.
18
- */var lr;function Ps(){return lr||(lr=1,process.env.NODE_ENV!=="production"&&(function(){function e(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=T,n=typeof Object.is=="function"?Object.is:e,r=t.useSyncExternalStore,i=t.useRef,s=t.useEffect,o=t.useMemo,a=t.useDebugValue;dn.useSyncExternalStoreWithSelector=function(c,u,l,y,j){var b=i(null);if(b.current===null){var h={hasValue:!1,value:null};b.current=h}else h=b.current;b=o(function(){function m(f){if(!S){if(S=!0,M=f,f=y(f),j!==void 0&&h.hasValue){var d=h.value;if(j(d,f))return x=d}return x=f}if(d=x,n(M,f))return d;var N=y(f);return j!==void 0&&j(d,N)?(M=f,d):(M=f,x=N)}var S=!1,M,x,v=l===void 0?null:l;return[function(){return m(u())},v===null?void 0:function(){return m(v())}]},[u,l,y,j]);var _=r(c,b[0],b[1]);return s(function(){h.hasValue=!0,h.value=_},[_]),a(_),_},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),dn}var dr;function As(){return dr||(dr=1,process.env.NODE_ENV==="production"?Nt.exports=Ms():Nt.exports=Ps()),Nt.exports}var Ds=As();function ci(e){e()}function Rs(){let e=null,t=null;return{clear(){e=null,t=null},notify(){ci(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var fr={notify(){},get:()=>[]};function Ts(e,t){let n,r=fr,i=0,s=!1;function o(_){l();const m=r.subscribe(_);let S=!1;return()=>{S||(S=!0,m(),y())}}function a(){r.notify()}function c(){h.onStateChange&&h.onStateChange()}function u(){return s}function l(){i++,n||(n=e.subscribe(c),r=Rs())}function y(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=fr)}function j(){s||(s=!0,l())}function b(){s&&(s=!1,y())}const h={addNestedSub:o,notifyNestedSubs:a,handleChangeWrapper:c,isSubscribed:u,trySubscribe:j,tryUnsubscribe:b,getListeners:()=>r};return h}var Vs=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Fs=Vs(),$s=()=>typeof navigator<"u"&&navigator.product==="ReactNative",Ls=$s(),Qs=()=>Fs||Ls?se.useLayoutEffect:se.useEffect,Us=Qs();function mr(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function Ze(e,t){if(mr(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i=0;i<n.length;i++)if(!Object.prototype.hasOwnProperty.call(t,n[i])||!mr(e[n[i]],t[n[i]]))return!1;return!0}var fn=Symbol.for("react-redux-context"),mn=typeof globalThis<"u"?globalThis:{};function qs(){if(!se.createContext)return{};const e=mn[fn]??(mn[fn]=new Map);let t=e.get(se.createContext);return t||(t=se.createContext(null),process.env.NODE_ENV!=="production"&&(t.displayName="ReactRedux"),e.set(se.createContext,t)),t}var Ce=qs();function zs(e){const{children:t,context:n,serverState:r,store:i}=e,s=se.useMemo(()=>{const c=Ts(i),u={store:i,subscription:c,getServerState:r?()=>r:void 0};if(process.env.NODE_ENV==="production")return u;{const{identityFunctionCheck:l="once",stabilityCheck:y="once"}=e;return Object.assign(u,{stabilityCheck:y,identityFunctionCheck:l})}},[i,r]),o=se.useMemo(()=>i.getState(),[i]);Us(()=>{const{subscription:c}=s;return c.onStateChange=c.notifyNestedSubs,c.trySubscribe(),o!==i.getState()&&c.notifyNestedSubs(),()=>{c.tryUnsubscribe(),c.onStateChange=void 0}},[s,o]);const a=n||Ce;return se.createElement(a.Provider,{value:s},t)}var Ws=zs;function Un(e=Ce){return function(){const n=se.useContext(e);if(process.env.NODE_ENV!=="production"&&!n)throw new Error("could not find react-redux context value; please ensure the component is wrapped in a <Provider>");return n}}var ui=Un();function li(e=Ce){const t=e===Ce?ui:Un(e),n=()=>{const{store:r}=t();return r};return Object.assign(n,{withTypes:()=>n}),n}var di=li();function fi(e=Ce){const t=e===Ce?di:li(e),n=()=>t().dispatch;return Object.assign(n,{withTypes:()=>n}),n}var Hs=fi(),Bs=(e,t)=>e===t;function mi(e=Ce){const t=e===Ce?ui:Un(e),n=(r,i={})=>{const{equalityFn:s=Bs}=typeof i=="function"?{equalityFn:i}:i;if(process.env.NODE_ENV!=="production"){if(!r)throw new Error("You must pass a selector to useSelector");if(typeof r!="function")throw new Error("You must pass a function as a selector to useSelector");if(typeof s!="function")throw new Error("You must pass a function as an equality function to useSelector")}const o=t(),{store:a,subscription:c,getServerState:u}=o,l=se.useRef(!0),y=se.useCallback({[r.name](b){const h=r(b);if(process.env.NODE_ENV!=="production"){const{devModeChecks:_={}}=typeof i=="function"?{}:i,{identityFunctionCheck:m,stabilityCheck:S}=o,{identityFunctionCheck:M,stabilityCheck:x}={stabilityCheck:S,identityFunctionCheck:m,..._};if(x==="always"||x==="once"&&l.current){const v=r(b);if(!s(h,v)){let f;try{throw new Error}catch(d){({stack:f}=d)}console.warn("Selector "+(r.name||"unknown")+` returned a different result when called with the same parameters. This can lead to unnecessary rerenders.
18
+ */var fr;function Ts(){return fr||(fr=1,process.env.NODE_ENV!=="production"&&(function(){function e(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=T,n=typeof Object.is=="function"?Object.is:e,r=t.useSyncExternalStore,i=t.useRef,s=t.useEffect,o=t.useMemo,a=t.useDebugValue;un.useSyncExternalStoreWithSelector=function(c,u,l,y,j){var b=i(null);if(b.current===null){var h={hasValue:!1,value:null};b.current=h}else h=b.current;b=o(function(){function m(f){if(!S){if(S=!0,M=f,f=y(f),j!==void 0&&h.hasValue){var d=h.value;if(j(d,f))return x=d}return x=f}if(d=x,n(M,f))return d;var N=y(f);return j!==void 0&&j(d,N)?(M=f,d):(M=f,x=N)}var S=!1,M,x,v=l===void 0?null:l;return[function(){return m(u())},v===null?void 0:function(){return m(v())}]},[u,l,y,j]);var _=r(c,b[0],b[1]);return s(function(){h.hasValue=!0,h.value=_},[_]),a(_),_},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),un}var mr;function Vs(){return mr||(mr=1,process.env.NODE_ENV==="production"?Nt.exports=Rs():Nt.exports=Ts()),Nt.exports}var Ls=Vs();function li(e){e()}function Fs(){let e=null,t=null;return{clear(){e=null,t=null},notify(){li(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var pr={notify(){},get:()=>[]};function Qs(e,t){let n,r=pr,i=0,s=!1;function o(_){l();const m=r.subscribe(_);let S=!1;return()=>{S||(S=!0,m(),y())}}function a(){r.notify()}function c(){h.onStateChange&&h.onStateChange()}function u(){return s}function l(){i++,n||(n=e.subscribe(c),r=Fs())}function y(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=pr)}function j(){s||(s=!0,l())}function b(){s&&(s=!1,y())}const h={addNestedSub:o,notifyNestedSubs:a,handleChangeWrapper:c,isSubscribed:u,trySubscribe:j,tryUnsubscribe:b,getListeners:()=>r};return h}var zs=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",$s=zs(),qs=()=>typeof navigator<"u"&&navigator.product==="ReactNative",Us=qs(),Ws=()=>$s||Us?se.useLayoutEffect:se.useEffect,Hs=Ws();function hr(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function Je(e,t){if(hr(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i=0;i<n.length;i++)if(!Object.prototype.hasOwnProperty.call(t,n[i])||!hr(e[n[i]],t[n[i]]))return!1;return!0}var ln=Symbol.for("react-redux-context"),dn=typeof globalThis<"u"?globalThis:{};function Bs(){if(!se.createContext)return{};const e=dn[ln]??(dn[ln]=new Map);let t=e.get(se.createContext);return t||(t=se.createContext(null),process.env.NODE_ENV!=="production"&&(t.displayName="ReactRedux"),e.set(se.createContext,t)),t}var Ce=Bs();function Ks(e){const{children:t,context:n,serverState:r,store:i}=e,s=se.useMemo(()=>{const c=Qs(i),u={store:i,subscription:c,getServerState:r?()=>r:void 0};if(process.env.NODE_ENV==="production")return u;{const{identityFunctionCheck:l="once",stabilityCheck:y="once"}=e;return Object.assign(u,{stabilityCheck:y,identityFunctionCheck:l})}},[i,r]),o=se.useMemo(()=>i.getState(),[i]);Hs(()=>{const{subscription:c}=s;return c.onStateChange=c.notifyNestedSubs,c.trySubscribe(),o!==i.getState()&&c.notifyNestedSubs(),()=>{c.tryUnsubscribe(),c.onStateChange=void 0}},[s,o]);const a=n||Ce;return se.createElement(a.Provider,{value:s},t)}var Gs=Ks;function $n(e=Ce){return function(){const n=se.useContext(e);if(process.env.NODE_ENV!=="production"&&!n)throw new Error("could not find react-redux context value; please ensure the component is wrapped in a <Provider>");return n}}var di=$n();function fi(e=Ce){const t=e===Ce?di:$n(e),n=()=>{const{store:r}=t();return r};return Object.assign(n,{withTypes:()=>n}),n}var mi=fi();function pi(e=Ce){const t=e===Ce?mi:fi(e),n=()=>t().dispatch;return Object.assign(n,{withTypes:()=>n}),n}var Ys=pi(),Xs=(e,t)=>e===t;function hi(e=Ce){const t=e===Ce?di:$n(e),n=(r,i={})=>{const{equalityFn:s=Xs}=typeof i=="function"?{equalityFn:i}:i;if(process.env.NODE_ENV!=="production"){if(!r)throw new Error("You must pass a selector to useSelector");if(typeof r!="function")throw new Error("You must pass a function as a selector to useSelector");if(typeof s!="function")throw new Error("You must pass a function as an equality function to useSelector")}const o=t(),{store:a,subscription:c,getServerState:u}=o,l=se.useRef(!0),y=se.useCallback({[r.name](b){const h=r(b);if(process.env.NODE_ENV!=="production"){const{devModeChecks:_={}}=typeof i=="function"?{}:i,{identityFunctionCheck:m,stabilityCheck:S}=o,{identityFunctionCheck:M,stabilityCheck:x}={stabilityCheck:S,identityFunctionCheck:m,..._};if(x==="always"||x==="once"&&l.current){const v=r(b);if(!s(h,v)){let f;try{throw new Error}catch(d){({stack:f}=d)}console.warn("Selector "+(r.name||"unknown")+` returned a different result when called with the same parameters. This can lead to unnecessary rerenders.
19
19
  Selectors that return a new reference (such as an object or an array) should be memoized: https://redux.js.org/usage/deriving-data-selectors#optimizing-selectors-with-memoization`,{state:b,selected:h,selected2:v,stack:f})}}if((M==="always"||M==="once"&&l.current)&&h===b){let v;try{throw new Error}catch(f){({stack:v}=f)}console.warn("Selector "+(r.name||"unknown")+` returned the root state when called. This can lead to unnecessary rerenders.
20
- Selectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.`,{stack:v})}l.current&&(l.current=!1)}return h}}[r.name],[r]),j=Ds.useSyncExternalStoreWithSelector(c.addNestedSub,a.getState,u||a.getState,y,s);return se.useDebugValue(j),j};return Object.assign(n,{withTypes:()=>n}),n}var Ks=mi(),Gs=ci;let Nn=null;function Ys(e){Nn=e}function Xs(){if(!Nn)throw new Error("[mint-ai-assistant] Config not initialised. Render <MintAIAssistant /> before calling the API.");return Nn}const Js={placement:"bottom-right",title:"ESM Sustainability AI",welcomeMessage:"What can I help with?",defaultOpen:!1,enableExpandMode:!1},pi=T.createContext(null);function Zs({config:e,children:t}){const n=T.useMemo(()=>({...Js,...e}),[e]);return Ys(n),p.jsx(pi.Provider,{value:n,children:t})}function ze(){const e=T.useContext(pi);if(!e)throw new Error("useConfig must be used within <MintAIAssistant />");return e}const qn=T.createContext(null);function ee(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var eo=typeof Symbol=="function"&&Symbol.observable||"@@observable",pr=eo,pn=()=>Math.random().toString(36).substring(7).split("").join("."),to={INIT:`@@redux/INIT${pn()}`,REPLACE:`@@redux/REPLACE${pn()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${pn()}`},Ie=to;function pe(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function no(e){if(e===void 0)return"undefined";if(e===null)return"null";const t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(so(e))return"date";if(io(e))return"error";const n=ro(e);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return Object.prototype.toString.call(e).slice(8,-1).toLowerCase().replace(/\s/g,"")}function ro(e){return typeof e.constructor=="function"?e.constructor.name:null}function io(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function so(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function Se(e){let t=typeof e;return process.env.NODE_ENV!=="production"&&(t=no(e)),t}function hi(e,t,n){if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?ee(2):`Expected the root reducer to be a function. Instead, received: '${Se(e)}'`);if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?ee(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(process.env.NODE_ENV==="production"?ee(1):`Expected the enhancer to be a function. Instead, received: '${Se(n)}'`);return n(hi)(e,t)}let r=e,i=t,s=new Map,o=s,a=0,c=!1;function u(){o===s&&(o=new Map,s.forEach((m,S)=>{o.set(S,m)}))}function l(){if(c)throw new Error(process.env.NODE_ENV==="production"?ee(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return i}function y(m){if(typeof m!="function")throw new Error(process.env.NODE_ENV==="production"?ee(4):`Expected the listener to be a function. Instead, received: '${Se(m)}'`);if(c)throw new Error(process.env.NODE_ENV==="production"?ee(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");let S=!0;u();const M=a++;return o.set(M,m),function(){if(S){if(c)throw new Error(process.env.NODE_ENV==="production"?ee(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");S=!1,u(),o.delete(M),s=null}}}function j(m){if(!pe(m))throw new Error(process.env.NODE_ENV==="production"?ee(7):`Actions must be plain objects. Instead, the actual type was: '${Se(m)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);if(typeof m.type>"u")throw new Error(process.env.NODE_ENV==="production"?ee(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(typeof m.type!="string")throw new Error(process.env.NODE_ENV==="production"?ee(17):`Action "type" property must be a string. Instead, the actual type was: '${Se(m.type)}'. Value was: '${m.type}' (stringified)`);if(c)throw new Error(process.env.NODE_ENV==="production"?ee(9):"Reducers may not dispatch actions.");try{c=!0,i=r(i,m)}finally{c=!1}return(s=o).forEach(M=>{M()}),m}function b(m){if(typeof m!="function")throw new Error(process.env.NODE_ENV==="production"?ee(10):`Expected the nextReducer to be a function. Instead, received: '${Se(m)}`);r=m,j({type:Ie.REPLACE})}function h(){const m=y;return{subscribe(S){if(typeof S!="object"||S===null)throw new Error(process.env.NODE_ENV==="production"?ee(11):`Expected the observer to be an object. Instead, received: '${Se(S)}'`);function M(){const v=S;v.next&&v.next(l())}return M(),{unsubscribe:m(M)}},[pr](){return this}}}return j({type:Ie.INIT}),{dispatch:j,subscribe:y,getState:l,replaceReducer:b,[pr]:h}}function hr(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function oo(e,t,n,r){const i=Object.keys(t),s=n&&n.type===Ie.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(i.length===0)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!pe(e))return`The ${s} has unexpected type of "${Se(e)}". Expected argument to be an object with the following keys: "${i.join('", "')}"`;const o=Object.keys(e).filter(a=>!t.hasOwnProperty(a)&&!r[a]);if(o.forEach(a=>{r[a]=!0}),!(n&&n.type===Ie.REPLACE)&&o.length>0)return`Unexpected ${o.length>1?"keys":"key"} "${o.join('", "')}" found in ${s}. Expected to find one of the known reducer keys instead: "${i.join('", "')}". Unexpected keys will be ignored.`}function ao(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:Ie.INIT})>"u")throw new Error(process.env.NODE_ENV==="production"?ee(12):`The slice reducer for key "${t}" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);if(typeof n(void 0,{type:Ie.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?ee(13):`The slice reducer for key "${t}" returned undefined when probed with a random type. Don't try to handle '${Ie.INIT}' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`)})}function gi(e){const t=Object.keys(e),n={};for(let o=0;o<t.length;o++){const a=t[o];process.env.NODE_ENV!=="production"&&typeof e[a]>"u"&&hr(`No reducer provided for key "${a}"`),typeof e[a]=="function"&&(n[a]=e[a])}const r=Object.keys(n);let i;process.env.NODE_ENV!=="production"&&(i={});let s;try{ao(n)}catch(o){s=o}return function(a={},c){if(s)throw s;if(process.env.NODE_ENV!=="production"){const y=oo(a,n,c,i);y&&hr(y)}let u=!1;const l={};for(let y=0;y<r.length;y++){const j=r[y],b=n[j],h=a[j],_=b(h,c);if(typeof _>"u"){const m=c&&c.type;throw new Error(process.env.NODE_ENV==="production"?ee(14):`When called with an action of type ${m?`"${String(m)}"`:"(unknown type)"}, the slice reducer for key "${j}" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`)}l[j]=_,u=u||_!==h}return u=u||r.length!==Object.keys(a).length,u?l:a}}function $t(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function co(...e){return t=>(n,r)=>{const i=t(n,r);let s=()=>{throw new Error(process.env.NODE_ENV==="production"?ee(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")};const o={getState:i.getState,dispatch:(c,...u)=>s(c,...u)},a=e.map(c=>c(o));return s=$t(...a)(i.dispatch),{...i,dispatch:s}}}function zn(e){return pe(e)&&"type"in e&&typeof e.type=="string"}var Wn=Symbol.for("immer-nothing"),et=Symbol.for("immer-draftable"),Z=Symbol.for("immer-state"),yi=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function J(e,...t){if(process.env.NODE_ENV!=="production"){const n=yi[e],r=Ne(n)?n.apply(null,t):n;throw new Error(`[Immer] ${r}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var oe=Object,Me=oe.getPrototypeOf,st="constructor",pt="prototype",Cn="configurable",Lt="enumerable",Dt="writable",ot="value",ae=e=>!!e&&!!e[Z];function ce(e){var t;return e?bi(e)||gt(e)||!!e[et]||!!((t=e[st])!=null&&t[et])||yt(e)||bt(e):!1}var uo=oe[pt][st].toString(),gr=new WeakMap;function bi(e){if(!e||!$e(e))return!1;const t=Me(e);if(t===null||t===oe[pt])return!0;const n=oe.hasOwnProperty.call(t,st)&&t[st];if(n===Object)return!0;if(!Ne(n))return!1;let r=gr.get(n);return r===void 0&&(r=Function.toString.call(n),gr.set(n,r)),r===uo}function lo(e){return ae(e)||J(15,e),e[Z].base_}function ht(e,t,n=!0){Pe(e)===0?(n?Reflect.ownKeys(e):oe.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function Pe(e){const t=e[Z];return t?t.type_:gt(e)?1:yt(e)?2:bt(e)?3:0}var tt=(e,t,n=Pe(e))=>n===2?e.has(t):oe[pt].hasOwnProperty.call(e,t),ge=(e,t,n=Pe(e))=>n===2?e.get(t):e[t],Qt=(e,t,n,r=Pe(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function fo(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var gt=Array.isArray,yt=e=>e instanceof Map,bt=e=>e instanceof Set,$e=e=>typeof e=="object",Ne=e=>typeof e=="function",hn=e=>typeof e=="boolean";function mo(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var po=e=>$e(e)?e==null?void 0:e[Z]:null,ye=e=>e.copy_||e.base_,Hn=e=>e.modified_?e.copy_:e.base_;function _n(e,t){if(yt(e))return new Map(e);if(bt(e))return new Set(e);if(gt(e))return Array[pt].slice.call(e);const n=bi(e);if(t===!0||t==="class_only"&&!n){const r=oe.getOwnPropertyDescriptors(e);delete r[Z];let i=Reflect.ownKeys(r);for(let s=0;s<i.length;s++){const o=i[s],a=r[o];a[Dt]===!1&&(a[Dt]=!0,a[Cn]=!0),(a.get||a.set)&&(r[o]={[Cn]:!0,[Dt]:!0,[Lt]:a[Lt],[ot]:e[o]})}return oe.create(Me(e),r)}else{const r=Me(e);if(r!==null&&n)return{...e};const i=oe.create(r);return oe.assign(i,e)}}function Bn(e,t=!1){return tn(e)||ae(e)||!ce(e)||(Pe(e)>1&&oe.defineProperties(e,{set:Ct,add:Ct,clear:Ct,delete:Ct}),oe.freeze(e),t&&ht(e,(n,r)=>{Bn(r,!0)},!1)),e}function ho(){J(2)}var Ct={[ot]:ho};function tn(e){return e===null||!$e(e)?!0:oe.isFrozen(e)}var Ut="MapSet",qt="Patches",yr="ArrayMethods",zt={};function Ae(e){const t=zt[e];return t||J(0,e),t}var br=e=>!!zt[e];function go(e,t){zt[e]||(zt[e]=t)}var at,xi=()=>at,yo=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:br(Ut)?Ae(Ut):void 0,arrayMethodsPlugin_:br(yr)?Ae(yr):void 0});function xr(e,t){t&&(e.patchPlugin_=Ae(qt),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function jn(e){On(e),e.drafts_.forEach(bo),e.drafts_=null}function On(e){e===at&&(at=e.parent_)}var vr=e=>at=yo(at,e);function bo(e){const t=e[Z];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function wr(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[Z].modified_&&(jn(t),J(4)),ce(e)&&(e=Er(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[Z].base_,e,t)}else e=Er(t,n);return xo(t,e,!0),jn(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Wn?e:void 0}function Er(e,t){if(tn(t))return t;const n=t[Z];if(!n)return Wt(t,e.handledSet_,e);if(!nn(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:r}=n;if(r)for(;r.length>0;)r.pop()(e);Ei(n,e)}return n.copy_}function xo(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Bn(t,n)}function vi(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var nn=(e,t)=>e.scope_===t,vo=[];function wi(e,t,n,r){const i=ye(e),s=e.type_;if(r!==void 0&&ge(i,r,s)===t){Qt(i,r,n,s);return}if(!e.draftLocations_){const a=e.draftLocations_=new Map;ht(i,(c,u)=>{if(ae(u)){const l=a.get(u)||[];l.push(c),a.set(u,l)}})}const o=e.draftLocations_.get(t)??vo;for(const a of o)Qt(i,a,n,s)}function wo(e,t,n){e.callbacks_.push(function(i){var a;const s=t;if(!s||!nn(s,i))return;(a=i.mapSetPlugin_)==null||a.fixSetContents(s);const o=Hn(s);wi(e,s.draft_??s,o,n),Ei(s,i)})}function Ei(e,t){var r;if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(((r=e.assigned_)==null?void 0:r.size)??0)>0)){const{patchPlugin_:i}=t;if(i){const s=i.getPath(e);s&&i.generatePatches_(e,s,t)}vi(e)}}function Eo(e,t,n){const{scope_:r}=e;if(ae(n)){const i=n[Z];nn(i,r)&&i.callbacks_.push(function(){Rt(e);const o=Hn(i);wi(e,n,o,t)})}else ce(n)&&e.callbacks_.push(function(){const s=ye(e);e.type_===3?s.has(n)&&Wt(n,r.handledSet_,r):ge(s,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Wt(ge(e.copy_,t,e.type_),r.handledSet_,r)})}function Wt(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||ae(e)||t.has(e)||!ce(e)||tn(e)||(t.add(e),ht(e,(r,i)=>{if(ae(i)){const s=i[Z];if(nn(s,n)){const o=Hn(s);Qt(e,r,o,e.type_),vi(s)}}else ce(i)&&Wt(i,t,n)})),e}function So(e,t){const n=gt(e),r={type_:n?1:0,scope_:t?t.scope_:xi(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let i=r,s=Ht;n&&(i=[r],s=ct);const{revoke:o,proxy:a}=Proxy.revocable(i,s);return r.draft_=a,r.revoke_=o,[a,r]}var Ht={get(e,t){if(t===Z)return e;let n=e.scope_.arrayMethodsPlugin_;const r=e.type_===1&&typeof t=="string";if(r&&n!=null&&n.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const i=ye(e);if(!tt(i,t,e.type_))return No(e,i,t);const s=i[t];if(e.finalized_||!ce(s)||r&&e.operationMethod&&(n!=null&&n.isMutatingArrayMethod(e.operationMethod))&&mo(t))return s;if(s===gn(e.base_,t)){Rt(e);const o=e.type_===1?+t:t,a=In(e.scope_,s,e,o);return e.copy_[o]=a}return s},has(e,t){return t in ye(e)},ownKeys(e){return Reflect.ownKeys(ye(e))},set(e,t,n){const r=Si(ye(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=gn(ye(e),t),s=i==null?void 0:i[Z];if(s&&s.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(fo(n,i)&&(n!==void 0||tt(e.base_,t,e.type_)))return!0;Rt(e),kn(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),Eo(e,t,n)),!0},deleteProperty(e,t){return Rt(e),gn(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),kn(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=ye(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[Dt]:!0,[Cn]:e.type_!==1||t!=="length",[Lt]:r[Lt],[ot]:n[t]}},defineProperty(){J(11)},getPrototypeOf(e){return Me(e.base_)},setPrototypeOf(){J(12)}},ct={};for(let e in Ht){let t=Ht[e];ct[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}ct.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&J(13),ct.set.call(this,e,t,void 0)};ct.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&J(14),Ht.set.call(this,e[0],t,n,e[0])};function gn(e,t){const n=e[Z];return(n?ye(n):e)[t]}function No(e,t,n){var i;const r=Si(t,n);return r?ot in r?r[ot]:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function Si(e,t){if(!(t in e))return;let n=Me(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Me(n)}}function kn(e){e.modified_||(e.modified_=!0,e.parent_&&kn(e.parent_))}function Rt(e){e.copy_||(e.assigned_=new Map,e.copy_=_n(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Co=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,n,r)=>{if(Ne(t)&&!Ne(n)){const s=n;n=t;const o=this;return function(c=s,...u){return o.produce(c,l=>n.call(this,l,...u))}}Ne(n)||J(6),r!==void 0&&!Ne(r)&&J(7);let i;if(ce(t)){const s=vr(this),o=In(s,t,void 0);let a=!0;try{i=n(o),a=!1}finally{a?jn(s):On(s)}return xr(s,r),wr(i,s)}else if(!t||!$e(t)){if(i=n(t),i===void 0&&(i=t),i===Wn&&(i=void 0),this.autoFreeze_&&Bn(i,!0),r){const s=[],o=[];Ae(qt).generateReplacementPatches_(t,i,{patches_:s,inversePatches_:o}),r(s,o)}return i}else J(1,t)},this.produceWithPatches=(t,n)=>{if(Ne(t))return(o,...a)=>this.produceWithPatches(o,c=>t(c,...a));let r,i;return[this.produce(t,n,(o,a)=>{r=o,i=a}),r,i]},hn(e==null?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),hn(e==null?void 0:e.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),hn(e==null?void 0:e.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){ce(e)||J(8),ae(e)&&(e=Ni(e));const t=vr(this),n=In(t,e,void 0);return n[Z].isManual_=!0,On(t),n}finishDraft(e,t){const n=e&&e[Z];(!n||!n.isManual_)&&J(9);const{scope_:r}=n;return xr(r,t),wr(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=Ae(qt).applyPatches_;return ae(e)?r(e,t):this.produce(e,i=>r(i,t))}};function In(e,t,n,r){const[i,s]=yt(t)?Ae(Ut).proxyMap_(t,n):bt(t)?Ae(Ut).proxySet_(t,n):So(t,n);return((n==null?void 0:n.scope_)??xi()).drafts_.push(i),s.callbacks_=(n==null?void 0:n.callbacks_)??[],s.key_=r,n&&r!==void 0?wo(n,s,r):s.callbacks_.push(function(c){var l;(l=c.mapSetPlugin_)==null||l.fixSetContents(s);const{patchPlugin_:u}=c;s.modified_&&u&&u.generatePatches_(s,[],c)}),i}function Ni(e){return ae(e)||J(10,e),Ci(e)}function Ci(e){if(!ce(e)||tn(e))return e;const t=e[Z];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=_n(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=_n(e,!0);return ht(n,(i,s)=>{Qt(n,i,Ci(s))},r),t&&(t.finalized_=!1),n}function _o(){process.env.NODE_ENV!=="production"&&yi.push('Sets cannot have "replace" patches.',function(h){return"Unsupported patch operation: "+h},function(h){return"Cannot apply patch, path doesn't resolve: "+h},"Patching reserved attributes like __proto__, prototype and constructor is not allowed");function t(h,_=[]){if(h.key_!==void 0){const m=h.parent_.copy_??h.parent_.base_,S=po(ge(m,h.key_)),M=ge(m,h.key_);if(M===void 0||M!==h.draft_&&M!==h.base_&&M!==h.copy_||S!=null&&S.base_!==h.base_)return null;const x=h.parent_.type_===3;let v;if(x){const f=h.parent_;v=Array.from(f.drafts_.keys()).indexOf(h.key_)}else v=h.key_;if(!(x&&m.size>v||tt(m,v)))return null;_.push(v)}if(h.parent_)return t(h.parent_,_);_.reverse();try{n(h.copy_,_)}catch{return null}return _}function n(h,_){let m=h;for(let S=0;S<_.length-1;S++){const M=_[S];if(m=ge(m,M),!$e(m)||m===null)throw new Error(`Cannot resolve path at '${_.join("/")}'`)}return m}const r="replace",i="add",s="remove";function o(h,_,m){if(h.scope_.processedForPatches_.has(h))return;h.scope_.processedForPatches_.add(h);const{patches_:S,inversePatches_:M}=m;switch(h.type_){case 0:case 2:return c(h,_,S,M);case 1:return a(h,_,S,M);case 3:return u(h,_,S,M)}}function a(h,_,m,S){let{base_:M,assigned_:x}=h,v=h.copy_;v.length<M.length&&([M,v]=[v,M],[m,S]=[S,m]);const f=h.allIndicesReassigned_===!0;for(let d=0;d<M.length;d++){const N=v[d],O=M[d];if((f||(x==null?void 0:x.get(d.toString())))&&N!==O){const E=N==null?void 0:N[Z];if(E&&E.modified_)continue;const g=_.concat([d]);m.push({op:r,path:g,value:b(N)}),S.push({op:r,path:g,value:b(O)})}}for(let d=M.length;d<v.length;d++){const N=_.concat([d]);m.push({op:i,path:N,value:b(v[d])})}for(let d=v.length-1;M.length<=d;--d){const N=_.concat([d]);S.push({op:s,path:N})}}function c(h,_,m,S){const{base_:M,copy_:x,type_:v}=h;ht(h.assigned_,(f,d)=>{const N=ge(M,f,v),O=ge(x,f,v),C=d?tt(M,f)?r:i:s;if(N===O&&C===r)return;const E=_.concat(f);m.push(C===s?{op:C,path:E}:{op:C,path:E,value:b(O)}),S.push(C===i?{op:s,path:E}:C===s?{op:i,path:E,value:b(N)}:{op:r,path:E,value:b(N)})})}function u(h,_,m,S){let{base_:M,copy_:x}=h,v=0;M.forEach(f=>{if(!x.has(f)){const d=_.concat([v]);m.push({op:s,path:d,value:f}),S.unshift({op:i,path:d,value:f})}v++}),v=0,x.forEach(f=>{if(!M.has(f)){const d=_.concat([v]);m.push({op:i,path:d,value:f}),S.unshift({op:s,path:d,value:f})}v++})}function l(h,_,m){const{patches_:S,inversePatches_:M}=m;S.push({op:r,path:[],value:_===Wn?void 0:_}),M.push({op:r,path:[],value:h})}function y(h,_){return _.forEach(m=>{const{path:S,op:M}=m;let x=h;for(let N=0;N<S.length-1;N++){const O=Pe(x);let C=S[N];typeof C!="string"&&typeof C!="number"&&(C=""+C),(O===0||O===1)&&(C==="__proto__"||C===st)&&J(19),Ne(x)&&C===pt&&J(19),x=ge(x,C),$e(x)||J(18,S.join("/"))}const v=Pe(x),f=j(m.value),d=S[S.length-1];switch(M){case r:switch(v){case 2:return x.set(d,f);case 3:J(16);default:return x[d]=f}case i:switch(v){case 1:return d==="-"?x.push(f):x.splice(d,0,f);case 2:return x.set(d,f);case 3:return x.add(f);default:return x[d]=f}case s:switch(v){case 1:return x.splice(d,1);case 2:return x.delete(d);case 3:return x.delete(m.value);default:return delete x[d]}default:J(17,M)}}),h}function j(h){if(!ce(h))return h;if(gt(h))return h.map(j);if(yt(h))return new Map(Array.from(h.entries()).map(([m,S])=>[m,j(S)]));if(bt(h))return new Set(Array.from(h).map(j));const _=Object.create(Me(h));for(const m in h)_[m]=j(h[m]);return tt(h,et)&&(_[et]=h[et]),_}function b(h){return ae(h)?j(h):h}go(qt,{applyPatches_:y,generatePatches_:o,generateReplacementPatches_:l,getPath:t})}var ut=new Co,xt=ut.produce,_i=ut.produceWithPatches.bind(ut),Sr=ut.applyPatches.bind(ut),jo=(e,t,n)=>{if(t.length===1&&t[0]===n){let r=!1;try{const i={};e(i)===i&&(r=!0)}catch{}if(r){let i;try{throw new Error}catch(s){({stack:i}=s)}console.warn(`The result function returned its own inputs without modification. e.g
20
+ Selectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.`,{stack:v})}l.current&&(l.current=!1)}return h}}[r.name],[r]),j=Ls.useSyncExternalStoreWithSelector(c.addNestedSub,a.getState,u||a.getState,y,s);return se.useDebugValue(j),j};return Object.assign(n,{withTypes:()=>n}),n}var Zs=hi(),Js=li;let En=null;function eo(e){En=e}function to(){if(!En)throw new Error("[mint-ai-assistant] Config not initialised. Render <MintAIAssistant /> before calling the API.");return En}const no={placement:"bottom-right",title:"ESM Sustainability AI",welcomeMessage:"What can I help with?",defaultOpen:!1,enableExpandMode:!1},gi=T.createContext(null);function ro({config:e,children:t}){const n=T.useMemo(()=>({...no,...e}),[e]);return eo(n),p.jsx(gi.Provider,{value:n,children:t})}function Ue(){const e=T.useContext(gi);if(!e)throw new Error("useConfig must be used within <MintAIAssistant />");return e}const qn=T.createContext(null);function ee(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var io=typeof Symbol=="function"&&Symbol.observable||"@@observable",gr=io,fn=()=>Math.random().toString(36).substring(7).split("").join("."),so={INIT:`@@redux/INIT${fn()}`,REPLACE:`@@redux/REPLACE${fn()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${fn()}`},Me=so;function pe(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function oo(e){if(e===void 0)return"undefined";if(e===null)return"null";const t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(uo(e))return"date";if(co(e))return"error";const n=ao(e);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return Object.prototype.toString.call(e).slice(8,-1).toLowerCase().replace(/\s/g,"")}function ao(e){return typeof e.constructor=="function"?e.constructor.name:null}function co(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function uo(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function Se(e){let t=typeof e;return process.env.NODE_ENV!=="production"&&(t=oo(e)),t}function yi(e,t,n){if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?ee(2):`Expected the root reducer to be a function. Instead, received: '${Se(e)}'`);if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?ee(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(process.env.NODE_ENV==="production"?ee(1):`Expected the enhancer to be a function. Instead, received: '${Se(n)}'`);return n(yi)(e,t)}let r=e,i=t,s=new Map,o=s,a=0,c=!1;function u(){o===s&&(o=new Map,s.forEach((m,S)=>{o.set(S,m)}))}function l(){if(c)throw new Error(process.env.NODE_ENV==="production"?ee(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return i}function y(m){if(typeof m!="function")throw new Error(process.env.NODE_ENV==="production"?ee(4):`Expected the listener to be a function. Instead, received: '${Se(m)}'`);if(c)throw new Error(process.env.NODE_ENV==="production"?ee(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");let S=!0;u();const M=a++;return o.set(M,m),function(){if(S){if(c)throw new Error(process.env.NODE_ENV==="production"?ee(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");S=!1,u(),o.delete(M),s=null}}}function j(m){if(!pe(m))throw new Error(process.env.NODE_ENV==="production"?ee(7):`Actions must be plain objects. Instead, the actual type was: '${Se(m)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);if(typeof m.type>"u")throw new Error(process.env.NODE_ENV==="production"?ee(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(typeof m.type!="string")throw new Error(process.env.NODE_ENV==="production"?ee(17):`Action "type" property must be a string. Instead, the actual type was: '${Se(m.type)}'. Value was: '${m.type}' (stringified)`);if(c)throw new Error(process.env.NODE_ENV==="production"?ee(9):"Reducers may not dispatch actions.");try{c=!0,i=r(i,m)}finally{c=!1}return(s=o).forEach(M=>{M()}),m}function b(m){if(typeof m!="function")throw new Error(process.env.NODE_ENV==="production"?ee(10):`Expected the nextReducer to be a function. Instead, received: '${Se(m)}`);r=m,j({type:Me.REPLACE})}function h(){const m=y;return{subscribe(S){if(typeof S!="object"||S===null)throw new Error(process.env.NODE_ENV==="production"?ee(11):`Expected the observer to be an object. Instead, received: '${Se(S)}'`);function M(){const v=S;v.next&&v.next(l())}return M(),{unsubscribe:m(M)}},[gr](){return this}}}return j({type:Me.INIT}),{dispatch:j,subscribe:y,getState:l,replaceReducer:b,[gr]:h}}function yr(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function lo(e,t,n,r){const i=Object.keys(t),s=n&&n.type===Me.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(i.length===0)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!pe(e))return`The ${s} has unexpected type of "${Se(e)}". Expected argument to be an object with the following keys: "${i.join('", "')}"`;const o=Object.keys(e).filter(a=>!t.hasOwnProperty(a)&&!r[a]);if(o.forEach(a=>{r[a]=!0}),!(n&&n.type===Me.REPLACE)&&o.length>0)return`Unexpected ${o.length>1?"keys":"key"} "${o.join('", "')}" found in ${s}. Expected to find one of the known reducer keys instead: "${i.join('", "')}". Unexpected keys will be ignored.`}function fo(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:Me.INIT})>"u")throw new Error(process.env.NODE_ENV==="production"?ee(12):`The slice reducer for key "${t}" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);if(typeof n(void 0,{type:Me.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?ee(13):`The slice reducer for key "${t}" returned undefined when probed with a random type. Don't try to handle '${Me.INIT}' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`)})}function bi(e){const t=Object.keys(e),n={};for(let o=0;o<t.length;o++){const a=t[o];process.env.NODE_ENV!=="production"&&typeof e[a]>"u"&&yr(`No reducer provided for key "${a}"`),typeof e[a]=="function"&&(n[a]=e[a])}const r=Object.keys(n);let i;process.env.NODE_ENV!=="production"&&(i={});let s;try{fo(n)}catch(o){s=o}return function(a={},c){if(s)throw s;if(process.env.NODE_ENV!=="production"){const y=lo(a,n,c,i);y&&yr(y)}let u=!1;const l={};for(let y=0;y<r.length;y++){const j=r[y],b=n[j],h=a[j],_=b(h,c);if(typeof _>"u"){const m=c&&c.type;throw new Error(process.env.NODE_ENV==="production"?ee(14):`When called with an action of type ${m?`"${String(m)}"`:"(unknown type)"}, the slice reducer for key "${j}" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`)}l[j]=_,u=u||_!==h}return u=u||r.length!==Object.keys(a).length,u?l:a}}function Ft(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function mo(...e){return t=>(n,r)=>{const i=t(n,r);let s=()=>{throw new Error(process.env.NODE_ENV==="production"?ee(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")};const o={getState:i.getState,dispatch:(c,...u)=>s(c,...u)},a=e.map(c=>c(o));return s=Ft(...a)(i.dispatch),{...i,dispatch:s}}}function Un(e){return pe(e)&&"type"in e&&typeof e.type=="string"}var Wn=Symbol.for("immer-nothing"),et=Symbol.for("immer-draftable"),J=Symbol.for("immer-state"),xi=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function X(e,...t){if(process.env.NODE_ENV!=="production"){const n=xi[e],r=Ne(n)?n.apply(null,t):n;throw new Error(`[Immer] ${r}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var oe=Object,Ae=oe.getPrototypeOf,st="constructor",pt="prototype",Sn="configurable",Qt="enumerable",Dt="writable",ot="value",ae=e=>!!e&&!!e[J];function ce(e){var t;return e?vi(e)||gt(e)||!!e[et]||!!((t=e[st])!=null&&t[et])||yt(e)||bt(e):!1}var po=oe[pt][st].toString(),br=new WeakMap;function vi(e){if(!e||!Qe(e))return!1;const t=Ae(e);if(t===null||t===oe[pt])return!0;const n=oe.hasOwnProperty.call(t,st)&&t[st];if(n===Object)return!0;if(!Ne(n))return!1;let r=br.get(n);return r===void 0&&(r=Function.toString.call(n),br.set(n,r)),r===po}function ho(e){return ae(e)||X(15,e),e[J].base_}function ht(e,t,n=!0){Pe(e)===0?(n?Reflect.ownKeys(e):oe.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function Pe(e){const t=e[J];return t?t.type_:gt(e)?1:yt(e)?2:bt(e)?3:0}var tt=(e,t,n=Pe(e))=>n===2?e.has(t):oe[pt].hasOwnProperty.call(e,t),ge=(e,t,n=Pe(e))=>n===2?e.get(t):e[t],zt=(e,t,n,r=Pe(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function go(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var gt=Array.isArray,yt=e=>e instanceof Map,bt=e=>e instanceof Set,Qe=e=>typeof e=="object",Ne=e=>typeof e=="function",mn=e=>typeof e=="boolean";function yo(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var bo=e=>Qe(e)?e==null?void 0:e[J]:null,ye=e=>e.copy_||e.base_,Hn=e=>e.modified_?e.copy_:e.base_;function Nn(e,t){if(yt(e))return new Map(e);if(bt(e))return new Set(e);if(gt(e))return Array[pt].slice.call(e);const n=vi(e);if(t===!0||t==="class_only"&&!n){const r=oe.getOwnPropertyDescriptors(e);delete r[J];let i=Reflect.ownKeys(r);for(let s=0;s<i.length;s++){const o=i[s],a=r[o];a[Dt]===!1&&(a[Dt]=!0,a[Sn]=!0),(a.get||a.set)&&(r[o]={[Sn]:!0,[Dt]:!0,[Qt]:a[Qt],[ot]:e[o]})}return oe.create(Ae(e),r)}else{const r=Ae(e);if(r!==null&&n)return{...e};const i=oe.create(r);return oe.assign(i,e)}}function Bn(e,t=!1){return Jt(e)||ae(e)||!ce(e)||(Pe(e)>1&&oe.defineProperties(e,{set:Ct,add:Ct,clear:Ct,delete:Ct}),oe.freeze(e),t&&ht(e,(n,r)=>{Bn(r,!0)},!1)),e}function xo(){X(2)}var Ct={[ot]:xo};function Jt(e){return e===null||!Qe(e)?!0:oe.isFrozen(e)}var $t="MapSet",qt="Patches",xr="ArrayMethods",Ut={};function De(e){const t=Ut[e];return t||X(0,e),t}var vr=e=>!!Ut[e];function vo(e,t){Ut[e]||(Ut[e]=t)}var at,wi=()=>at,wo=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:vr($t)?De($t):void 0,arrayMethodsPlugin_:vr(xr)?De(xr):void 0});function wr(e,t){t&&(e.patchPlugin_=De(qt),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Cn(e){_n(e),e.drafts_.forEach(Eo),e.drafts_=null}function _n(e){e===at&&(at=e.parent_)}var Er=e=>at=wo(at,e);function Eo(e){const t=e[J];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Sr(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[J].modified_&&(Cn(t),X(4)),ce(e)&&(e=Nr(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[J].base_,e,t)}else e=Nr(t,n);return So(t,e,!0),Cn(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Wn?e:void 0}function Nr(e,t){if(Jt(t))return t;const n=t[J];if(!n)return Wt(t,e.handledSet_,e);if(!en(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:r}=n;if(r)for(;r.length>0;)r.pop()(e);Ni(n,e)}return n.copy_}function So(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Bn(t,n)}function Ei(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var en=(e,t)=>e.scope_===t,No=[];function Si(e,t,n,r){const i=ye(e),s=e.type_;if(r!==void 0&&ge(i,r,s)===t){zt(i,r,n,s);return}if(!e.draftLocations_){const a=e.draftLocations_=new Map;ht(i,(c,u)=>{if(ae(u)){const l=a.get(u)||[];l.push(c),a.set(u,l)}})}const o=e.draftLocations_.get(t)??No;for(const a of o)zt(i,a,n,s)}function Co(e,t,n){e.callbacks_.push(function(i){var a;const s=t;if(!s||!en(s,i))return;(a=i.mapSetPlugin_)==null||a.fixSetContents(s);const o=Hn(s);Si(e,s.draft_??s,o,n),Ni(s,i)})}function Ni(e,t){var r;if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(((r=e.assigned_)==null?void 0:r.size)??0)>0)){const{patchPlugin_:i}=t;if(i){const s=i.getPath(e);s&&i.generatePatches_(e,s,t)}Ei(e)}}function _o(e,t,n){const{scope_:r}=e;if(ae(n)){const i=n[J];en(i,r)&&i.callbacks_.push(function(){Rt(e);const o=Hn(i);Si(e,n,o,t)})}else ce(n)&&e.callbacks_.push(function(){const s=ye(e);e.type_===3?s.has(n)&&Wt(n,r.handledSet_,r):ge(s,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Wt(ge(e.copy_,t,e.type_),r.handledSet_,r)})}function Wt(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||ae(e)||t.has(e)||!ce(e)||Jt(e)||(t.add(e),ht(e,(r,i)=>{if(ae(i)){const s=i[J];if(en(s,n)){const o=Hn(s);zt(e,r,o,e.type_),Ei(s)}}else ce(i)&&Wt(i,t,n)})),e}function jo(e,t){const n=gt(e),r={type_:n?1:0,scope_:t?t.scope_:wi(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let i=r,s=Ht;n&&(i=[r],s=ct);const{revoke:o,proxy:a}=Proxy.revocable(i,s);return r.draft_=a,r.revoke_=o,[a,r]}var Ht={get(e,t){if(t===J)return e;let n=e.scope_.arrayMethodsPlugin_;const r=e.type_===1&&typeof t=="string";if(r&&n!=null&&n.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const i=ye(e);if(!tt(i,t,e.type_))return Oo(e,i,t);const s=i[t];if(e.finalized_||!ce(s)||r&&e.operationMethod&&(n!=null&&n.isMutatingArrayMethod(e.operationMethod))&&yo(t))return s;if(s===pn(e.base_,t)){Rt(e);const o=e.type_===1?+t:t,a=On(e.scope_,s,e,o);return e.copy_[o]=a}return s},has(e,t){return t in ye(e)},ownKeys(e){return Reflect.ownKeys(ye(e))},set(e,t,n){const r=Ci(ye(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=pn(ye(e),t),s=i==null?void 0:i[J];if(s&&s.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(go(n,i)&&(n!==void 0||tt(e.base_,t,e.type_)))return!0;Rt(e),jn(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),_o(e,t,n)),!0},deleteProperty(e,t){return Rt(e),pn(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),jn(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=ye(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[Dt]:!0,[Sn]:e.type_!==1||t!=="length",[Qt]:r[Qt],[ot]:n[t]}},defineProperty(){X(11)},getPrototypeOf(e){return Ae(e.base_)},setPrototypeOf(){X(12)}},ct={};for(let e in Ht){let t=Ht[e];ct[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}ct.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&X(13),ct.set.call(this,e,t,void 0)};ct.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&X(14),Ht.set.call(this,e[0],t,n,e[0])};function pn(e,t){const n=e[J];return(n?ye(n):e)[t]}function Oo(e,t,n){var i;const r=Ci(t,n);return r?ot in r?r[ot]:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function Ci(e,t){if(!(t in e))return;let n=Ae(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Ae(n)}}function jn(e){e.modified_||(e.modified_=!0,e.parent_&&jn(e.parent_))}function Rt(e){e.copy_||(e.assigned_=new Map,e.copy_=Nn(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Io=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,n,r)=>{if(Ne(t)&&!Ne(n)){const s=n;n=t;const o=this;return function(c=s,...u){return o.produce(c,l=>n.call(this,l,...u))}}Ne(n)||X(6),r!==void 0&&!Ne(r)&&X(7);let i;if(ce(t)){const s=Er(this),o=On(s,t,void 0);let a=!0;try{i=n(o),a=!1}finally{a?Cn(s):_n(s)}return wr(s,r),Sr(i,s)}else if(!t||!Qe(t)){if(i=n(t),i===void 0&&(i=t),i===Wn&&(i=void 0),this.autoFreeze_&&Bn(i,!0),r){const s=[],o=[];De(qt).generateReplacementPatches_(t,i,{patches_:s,inversePatches_:o}),r(s,o)}return i}else X(1,t)},this.produceWithPatches=(t,n)=>{if(Ne(t))return(o,...a)=>this.produceWithPatches(o,c=>t(c,...a));let r,i;return[this.produce(t,n,(o,a)=>{r=o,i=a}),r,i]},mn(e==null?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),mn(e==null?void 0:e.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),mn(e==null?void 0:e.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){ce(e)||X(8),ae(e)&&(e=_i(e));const t=Er(this),n=On(t,e,void 0);return n[J].isManual_=!0,_n(t),n}finishDraft(e,t){const n=e&&e[J];(!n||!n.isManual_)&&X(9);const{scope_:r}=n;return wr(r,t),Sr(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=De(qt).applyPatches_;return ae(e)?r(e,t):this.produce(e,i=>r(i,t))}};function On(e,t,n,r){const[i,s]=yt(t)?De($t).proxyMap_(t,n):bt(t)?De($t).proxySet_(t,n):jo(t,n);return((n==null?void 0:n.scope_)??wi()).drafts_.push(i),s.callbacks_=(n==null?void 0:n.callbacks_)??[],s.key_=r,n&&r!==void 0?Co(n,s,r):s.callbacks_.push(function(c){var l;(l=c.mapSetPlugin_)==null||l.fixSetContents(s);const{patchPlugin_:u}=c;s.modified_&&u&&u.generatePatches_(s,[],c)}),i}function _i(e){return ae(e)||X(10,e),ji(e)}function ji(e){if(!ce(e)||Jt(e))return e;const t=e[J];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Nn(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Nn(e,!0);return ht(n,(i,s)=>{zt(n,i,ji(s))},r),t&&(t.finalized_=!1),n}function ko(){process.env.NODE_ENV!=="production"&&xi.push('Sets cannot have "replace" patches.',function(h){return"Unsupported patch operation: "+h},function(h){return"Cannot apply patch, path doesn't resolve: "+h},"Patching reserved attributes like __proto__, prototype and constructor is not allowed");function t(h,_=[]){if(h.key_!==void 0){const m=h.parent_.copy_??h.parent_.base_,S=bo(ge(m,h.key_)),M=ge(m,h.key_);if(M===void 0||M!==h.draft_&&M!==h.base_&&M!==h.copy_||S!=null&&S.base_!==h.base_)return null;const x=h.parent_.type_===3;let v;if(x){const f=h.parent_;v=Array.from(f.drafts_.keys()).indexOf(h.key_)}else v=h.key_;if(!(x&&m.size>v||tt(m,v)))return null;_.push(v)}if(h.parent_)return t(h.parent_,_);_.reverse();try{n(h.copy_,_)}catch{return null}return _}function n(h,_){let m=h;for(let S=0;S<_.length-1;S++){const M=_[S];if(m=ge(m,M),!Qe(m)||m===null)throw new Error(`Cannot resolve path at '${_.join("/")}'`)}return m}const r="replace",i="add",s="remove";function o(h,_,m){if(h.scope_.processedForPatches_.has(h))return;h.scope_.processedForPatches_.add(h);const{patches_:S,inversePatches_:M}=m;switch(h.type_){case 0:case 2:return c(h,_,S,M);case 1:return a(h,_,S,M);case 3:return u(h,_,S,M)}}function a(h,_,m,S){let{base_:M,assigned_:x}=h,v=h.copy_;v.length<M.length&&([M,v]=[v,M],[m,S]=[S,m]);const f=h.allIndicesReassigned_===!0;for(let d=0;d<M.length;d++){const N=v[d],O=M[d];if((f||(x==null?void 0:x.get(d.toString())))&&N!==O){const E=N==null?void 0:N[J];if(E&&E.modified_)continue;const g=_.concat([d]);m.push({op:r,path:g,value:b(N)}),S.push({op:r,path:g,value:b(O)})}}for(let d=M.length;d<v.length;d++){const N=_.concat([d]);m.push({op:i,path:N,value:b(v[d])})}for(let d=v.length-1;M.length<=d;--d){const N=_.concat([d]);S.push({op:s,path:N})}}function c(h,_,m,S){const{base_:M,copy_:x,type_:v}=h;ht(h.assigned_,(f,d)=>{const N=ge(M,f,v),O=ge(x,f,v),C=d?tt(M,f)?r:i:s;if(N===O&&C===r)return;const E=_.concat(f);m.push(C===s?{op:C,path:E}:{op:C,path:E,value:b(O)}),S.push(C===i?{op:s,path:E}:C===s?{op:i,path:E,value:b(N)}:{op:r,path:E,value:b(N)})})}function u(h,_,m,S){let{base_:M,copy_:x}=h,v=0;M.forEach(f=>{if(!x.has(f)){const d=_.concat([v]);m.push({op:s,path:d,value:f}),S.unshift({op:i,path:d,value:f})}v++}),v=0,x.forEach(f=>{if(!M.has(f)){const d=_.concat([v]);m.push({op:i,path:d,value:f}),S.unshift({op:s,path:d,value:f})}v++})}function l(h,_,m){const{patches_:S,inversePatches_:M}=m;S.push({op:r,path:[],value:_===Wn?void 0:_}),M.push({op:r,path:[],value:h})}function y(h,_){return _.forEach(m=>{const{path:S,op:M}=m;let x=h;for(let N=0;N<S.length-1;N++){const O=Pe(x);let C=S[N];typeof C!="string"&&typeof C!="number"&&(C=""+C),(O===0||O===1)&&(C==="__proto__"||C===st)&&X(19),Ne(x)&&C===pt&&X(19),x=ge(x,C),Qe(x)||X(18,S.join("/"))}const v=Pe(x),f=j(m.value),d=S[S.length-1];switch(M){case r:switch(v){case 2:return x.set(d,f);case 3:X(16);default:return x[d]=f}case i:switch(v){case 1:return d==="-"?x.push(f):x.splice(d,0,f);case 2:return x.set(d,f);case 3:return x.add(f);default:return x[d]=f}case s:switch(v){case 1:return x.splice(d,1);case 2:return x.delete(d);case 3:return x.delete(m.value);default:return delete x[d]}default:X(17,M)}}),h}function j(h){if(!ce(h))return h;if(gt(h))return h.map(j);if(yt(h))return new Map(Array.from(h.entries()).map(([m,S])=>[m,j(S)]));if(bt(h))return new Set(Array.from(h).map(j));const _=Object.create(Ae(h));for(const m in h)_[m]=j(h[m]);return tt(h,et)&&(_[et]=h[et]),_}function b(h){return ae(h)?j(h):h}vo(qt,{applyPatches_:y,generatePatches_:o,generateReplacementPatches_:l,getPath:t})}var ut=new Io,xt=ut.produce,Oi=ut.produceWithPatches.bind(ut),Cr=ut.applyPatches.bind(ut),Mo=(e,t,n)=>{if(t.length===1&&t[0]===n){let r=!1;try{const i={};e(i)===i&&(r=!0)}catch{}if(r){let i;try{throw new Error}catch(s){({stack:i}=s)}console.warn(`The result function returned its own inputs without modification. e.g
21
21
  \`createSelector([state => state.todos], todos => todos)\`
22
22
  This could lead to inefficient memoization and unnecessary re-renders.
23
- Ensure transformation logic is in the result function, and extraction logic is in the input selectors.`,{stack:i})}}},Oo=(e,t,n)=>{const{memoize:r,memoizeOptions:i}=t,{inputSelectorResults:s,inputSelectorResultsCopy:o}=e,a=r(()=>({}),...i);if(!(a.apply(null,s)===a.apply(null,o))){let u;try{throw new Error}catch(l){({stack:u}=l)}console.warn(`An input selector returned a different result when passed same arguments.
23
+ Ensure transformation logic is in the result function, and extraction logic is in the input selectors.`,{stack:i})}}},Ao=(e,t,n)=>{const{memoize:r,memoizeOptions:i}=t,{inputSelectorResults:s,inputSelectorResultsCopy:o}=e,a=r(()=>({}),...i);if(!(a.apply(null,s)===a.apply(null,o))){let u;try{throw new Error}catch(l){({stack:u}=l)}console.warn(`An input selector returned a different result when passed same arguments.
24
24
  This means your output selector will likely run more frequently than intended.
25
25
  Avoid returning a new reference inside your input selector, e.g.
26
- \`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)\``,{arguments:n,firstInputs:s,secondInputs:o,stack:u})}},ko={inputStabilityCheck:"once",identityFunctionCheck:"once"};function Io(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Mo(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var Nr=e=>Array.isArray(e)?e:[e];function Po(e){const t=Array.isArray(e[0])?e[0]:e;return Mo(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Cr(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var Ao=(e,t)=>{const{identityFunctionCheck:n,inputStabilityCheck:r}={...ko,...t};return{identityFunctionCheck:{shouldRun:n==="always"||n==="once"&&e,run:jo},inputStabilityCheck:{shouldRun:r==="always"||r==="once"&&e,run:Oo}}},Do=class{constructor(e){this.value=e}deref(){return this.value}},Ro=()=>typeof WeakRef>"u"?Do:WeakRef,ji=Ro(),To=0,_r=1;function _t(){return{s:To,v:void 0,o:null,p:null}}function Vo(e){return e instanceof ji?e.deref():e}function Bt(e,t={}){let n=_t();const{resultEqualityCheck:r}=t;let i,s=0;function o(){let a=n;const{length:c}=arguments;for(let y=0,j=c;y<j;y++){const b=arguments[y];if(typeof b=="function"||typeof b=="object"&&b!==null){let h=a.o;h===null&&(a.o=h=new WeakMap);const _=h.get(b);_===void 0?(a=_t(),h.set(b,a)):a=_}else{let h=a.p;h===null&&(a.p=h=new Map);const _=h.get(b);_===void 0?(a=_t(),h.set(b,a)):a=_}}const u=a;let l;if(a.s===_r)l=a.v;else if(l=e.apply(null,arguments),s++,r){const y=Vo(i);y!=null&&r(y,l)&&(l=y,s!==0&&s--),i=typeof l=="object"&&l!==null||typeof l=="function"?new ji(l):l}return u.s=_r,u.v=l,l}return o.clearCache=()=>{n=_t(),o.resetResultsCount()},o.resultsCount=()=>s,o.resetResultsCount=()=>{s=0},o}function Fo(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let s=0,o=0,a,c={},u=i.pop();typeof u=="object"&&(c=u,u=i.pop()),Io(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);const l={...n,...c},{memoize:y,memoizeOptions:j=[],argsMemoize:b=Bt,argsMemoizeOptions:h=[]}=l,_=Nr(j),m=Nr(h),S=Po(i),M=y(function(){return s++,u.apply(null,arguments)},..._);let x=!0;const v=b(function(){o++;const d=Cr(S,arguments);if(a=M.apply(null,d),process.env.NODE_ENV!=="production"){const{devModeChecks:N={}}=l,{identityFunctionCheck:O,inputStabilityCheck:C}=Ao(x,N);if(O.shouldRun&&O.run(u,d,a),C.shouldRun){const E=Cr(S,arguments);C.run({inputSelectorResults:d,inputSelectorResultsCopy:E},{memoize:y,memoizeOptions:_},arguments)}x&&(x=!1)}return a},...m);return Object.assign(v,{resultFunc:u,memoizedResultFunc:M,dependencies:S,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>a,recomputations:()=>s,resetRecomputations:()=>{s=0},memoize:y,argsMemoize:b})};return Object.assign(r,{withTypes:()=>r}),r}var Oi=Fo(Bt);function ki(e){return({dispatch:n,getState:r})=>i=>s=>typeof s=="function"?s(n,r,e):i(s)}var $o=ki(),Lo=ki,Qo=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?$t:$t.apply(null,arguments)},Ii=e=>e&&typeof e.match=="function";function me(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(process.env.NODE_ENV==="production"?q(0):"prepareAction did not return an object");return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=r=>zn(r)&&r.type===e,n}function Uo(e){return typeof e=="function"&&"type"in e&&Ii(e)}function qo(e){const t=e?`${e}`.split("/"):[],n=t[t.length-1]||"actionCreator";return`Detected an action creator with type "${e||"unknown"}" being dispatched.
27
- Make sure you're calling the action creator before dispatching, i.e. \`dispatch(${n}())\` instead of \`dispatch(${n})\`. This is necessary even if the action has no payload.`}function zo(e={}){if(process.env.NODE_ENV==="production")return()=>n=>r=>n(r);const{isActionCreator:t=Uo}=e;return()=>n=>r=>(t(r)&&console.warn(qo(r.type)),n(r))}function Mi(e,t){let n=0;return{measureTime(r){const i=Date.now();try{return r()}finally{const s=Date.now();n+=s-i}},warnIfExceeded(){n>e&&console.warn(`${t} took ${n}ms, which is more than the warning threshold of ${e}ms.
26
+ \`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)\``,{arguments:n,firstInputs:s,secondInputs:o,stack:u})}},Po={inputStabilityCheck:"once",identityFunctionCheck:"once"};function Do(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Ro(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var _r=e=>Array.isArray(e)?e:[e];function To(e){const t=Array.isArray(e[0])?e[0]:e;return Ro(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function jr(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var Vo=(e,t)=>{const{identityFunctionCheck:n,inputStabilityCheck:r}={...Po,...t};return{identityFunctionCheck:{shouldRun:n==="always"||n==="once"&&e,run:Mo},inputStabilityCheck:{shouldRun:r==="always"||r==="once"&&e,run:Ao}}},Lo=class{constructor(e){this.value=e}deref(){return this.value}},Fo=()=>typeof WeakRef>"u"?Lo:WeakRef,Ii=Fo(),Qo=0,Or=1;function _t(){return{s:Qo,v:void 0,o:null,p:null}}function zo(e){return e instanceof Ii?e.deref():e}function Bt(e,t={}){let n=_t();const{resultEqualityCheck:r}=t;let i,s=0;function o(){let a=n;const{length:c}=arguments;for(let y=0,j=c;y<j;y++){const b=arguments[y];if(typeof b=="function"||typeof b=="object"&&b!==null){let h=a.o;h===null&&(a.o=h=new WeakMap);const _=h.get(b);_===void 0?(a=_t(),h.set(b,a)):a=_}else{let h=a.p;h===null&&(a.p=h=new Map);const _=h.get(b);_===void 0?(a=_t(),h.set(b,a)):a=_}}const u=a;let l;if(a.s===Or)l=a.v;else if(l=e.apply(null,arguments),s++,r){const y=zo(i);y!=null&&r(y,l)&&(l=y,s!==0&&s--),i=typeof l=="object"&&l!==null||typeof l=="function"?new Ii(l):l}return u.s=Or,u.v=l,l}return o.clearCache=()=>{n=_t(),o.resetResultsCount()},o.resultsCount=()=>s,o.resetResultsCount=()=>{s=0},o}function $o(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let s=0,o=0,a,c={},u=i.pop();typeof u=="object"&&(c=u,u=i.pop()),Do(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);const l={...n,...c},{memoize:y,memoizeOptions:j=[],argsMemoize:b=Bt,argsMemoizeOptions:h=[]}=l,_=_r(j),m=_r(h),S=To(i),M=y(function(){return s++,u.apply(null,arguments)},..._);let x=!0;const v=b(function(){o++;const d=jr(S,arguments);if(a=M.apply(null,d),process.env.NODE_ENV!=="production"){const{devModeChecks:N={}}=l,{identityFunctionCheck:O,inputStabilityCheck:C}=Vo(x,N);if(O.shouldRun&&O.run(u,d,a),C.shouldRun){const E=jr(S,arguments);C.run({inputSelectorResults:d,inputSelectorResultsCopy:E},{memoize:y,memoizeOptions:_},arguments)}x&&(x=!1)}return a},...m);return Object.assign(v,{resultFunc:u,memoizedResultFunc:M,dependencies:S,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>a,recomputations:()=>s,resetRecomputations:()=>{s=0},memoize:y,argsMemoize:b})};return Object.assign(r,{withTypes:()=>r}),r}var ki=$o(Bt);function Mi(e){return({dispatch:n,getState:r})=>i=>s=>typeof s=="function"?s(n,r,e):i(s)}var qo=Mi(),Uo=Mi,Wo=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Ft:Ft.apply(null,arguments)},Ai=e=>e&&typeof e.match=="function";function me(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(process.env.NODE_ENV==="production"?q(0):"prepareAction did not return an object");return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=r=>Un(r)&&r.type===e,n}function Ho(e){return typeof e=="function"&&"type"in e&&Ai(e)}function Bo(e){const t=e?`${e}`.split("/"):[],n=t[t.length-1]||"actionCreator";return`Detected an action creator with type "${e||"unknown"}" being dispatched.
27
+ Make sure you're calling the action creator before dispatching, i.e. \`dispatch(${n}())\` instead of \`dispatch(${n})\`. This is necessary even if the action has no payload.`}function Ko(e={}){if(process.env.NODE_ENV==="production")return()=>n=>r=>n(r);const{isActionCreator:t=Ho}=e;return()=>n=>r=>(t(r)&&console.warn(Bo(r.type)),n(r))}function Pi(e,t){let n=0;return{measureTime(r){const i=Date.now();try{return r()}finally{const s=Date.now();n+=s-i}},warnIfExceeded(){n>e&&console.warn(`${t} took ${n}ms, which is more than the warning threshold of ${e}ms.
28
28
  If your state or actions are very large, you may want to disable the middleware as it might cause too much of a slowdown in development mode. See https://redux-toolkit.js.org/api/getDefaultMiddleware for instructions.
29
- It is disabled in production builds, so you don't need to worry about that.`)}}}var Pi=class Ye extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Ye.prototype)}static get[Symbol.species](){return Ye}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Ye(...t[0].concat(this)):new Ye(...t.concat(this))}};function jr(e){return ce(e)?xt(e,()=>{}):e}function jt(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function Wo(e){return typeof e!="object"||e==null||Object.isFrozen(e)}function Ho(e,t,n){const r=Ai(e,t,n);return{detectMutations(){return Di(e,t,r,n)}}}function Ai(e,t=[],n,r="",i=new Set){const s={value:n};if(!e(n)&&!i.has(n)){i.add(n),s.children={};const o=t.length>0;for(const a in n){const c=r?r+"."+a:a;o&&t.some(l=>l instanceof RegExp?l.test(c):c===l)||(s.children[a]=Ai(e,t,n[a],c))}}return s}function Di(e,t=[],n,r,i=!1,s=""){const o=n?n.value:void 0,a=o===r;if(i&&!a&&!Number.isNaN(r))return{wasMutated:!0,path:s};if(e(o)||e(r))return{wasMutated:!1};const c={};for(let l in n.children)c[l]=!0;for(let l in r)c[l]=!0;const u=t.length>0;for(let l in c){const y=s?s+"."+l:l;if(u&&t.some(h=>h instanceof RegExp?h.test(y):y===h))continue;const j=Di(e,t,n.children[l],r[l],a,y);if(j.wasMutated)return j}return{wasMutated:!1}}function Bo(e={}){if(process.env.NODE_ENV==="production")return()=>t=>n=>t(n);{let t=function(a,c,u,l){return JSON.stringify(a,n(c,l),u)},n=function(a,c){let u=[],l=[];return c||(c=function(y,j){return u[0]===j?"[Circular ~]":"[Circular ~."+l.slice(0,u.indexOf(j)).join(".")+"]"}),function(y,j){if(u.length>0){var b=u.indexOf(this);~b?u.splice(b+1):u.push(this),~b?l.splice(b,1/0,y):l.push(y),~u.indexOf(j)&&(j=c.call(this,y,j))}else u.push(j);return a==null?j:a.call(this,y,j)}},{isImmutable:r=Wo,ignoredPaths:i,warnAfter:s=32}=e;const o=Ho.bind(null,r,i);return({getState:a})=>{let c=a(),u=o(c),l;return y=>j=>{const b=Mi(s,"ImmutableStateInvariantMiddleware");b.measureTime(()=>{if(c=a(),l=u.detectMutations(),u=o(c),l.wasMutated)throw new Error(process.env.NODE_ENV==="production"?q(19):`A state mutation was detected between dispatches, in the path '${l.path||""}'. This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`)});const h=y(j);return b.measureTime(()=>{if(c=a(),l=u.detectMutations(),u=o(c),l.wasMutated)throw new Error(process.env.NODE_ENV==="production"?q(20):`A state mutation was detected inside a dispatch, in the path: ${l.path||""}. Take a look at the reducer(s) handling the action ${t(j)}. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`)}),b.warnIfExceeded(),h}}}}function Ri(e){const t=typeof e;return e==null||t==="string"||t==="boolean"||t==="number"||Array.isArray(e)||pe(e)}function Mn(e,t="",n=Ri,r,i=[],s){let o;if(!n(e))return{keyPath:t||"<root>",value:e};if(typeof e!="object"||e===null||s!=null&&s.has(e))return!1;const a=r!=null?r(e):Object.entries(e),c=i.length>0;for(const[u,l]of a){const y=t?t+"."+u:u;if(!(c&&i.some(b=>b instanceof RegExp?b.test(y):y===b))){if(!n(l))return{keyPath:y,value:l};if(typeof l=="object"&&(o=Mn(l,y,n,r,i,s),o))return o}}return s&&Ti(e)&&s.add(e),!1}function Ti(e){if(!Object.isFrozen(e))return!1;for(const t of Object.values(e))if(!(typeof t!="object"||t===null)&&!Ti(t))return!1;return!0}function Ko(e={}){if(process.env.NODE_ENV==="production")return()=>t=>n=>t(n);{const{isSerializable:t=Ri,getEntries:n,ignoredActions:r=[],ignoredActionPaths:i=["meta.arg","meta.baseQueryMeta"],ignoredPaths:s=[],warnAfter:o=32,ignoreState:a=!1,ignoreActions:c=!1,disableCache:u=!1}=e,l=!u&&WeakSet?new WeakSet:void 0;return y=>j=>b=>{if(!zn(b))return j(b);const h=j(b),_=Mi(o,"SerializableStateInvariantMiddleware");return!c&&!(r.length&&r.indexOf(b.type)!==-1)&&_.measureTime(()=>{const m=Mn(b,"",t,n,i,l);if(m){const{keyPath:S,value:M}=m;console.error(`A non-serializable value was detected in an action, in the path: \`${S}\`. Value:`,M,`
29
+ It is disabled in production builds, so you don't need to worry about that.`)}}}var Di=class Ye extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Ye.prototype)}static get[Symbol.species](){return Ye}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Ye(...t[0].concat(this)):new Ye(...t.concat(this))}};function Ir(e){return ce(e)?xt(e,()=>{}):e}function jt(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function Go(e){return typeof e!="object"||e==null||Object.isFrozen(e)}function Yo(e,t,n){const r=Ri(e,t,n);return{detectMutations(){return Ti(e,t,r,n)}}}function Ri(e,t=[],n,r="",i=new Set){const s={value:n};if(!e(n)&&!i.has(n)){i.add(n),s.children={};const o=t.length>0;for(const a in n){const c=r?r+"."+a:a;o&&t.some(l=>l instanceof RegExp?l.test(c):c===l)||(s.children[a]=Ri(e,t,n[a],c))}}return s}function Ti(e,t=[],n,r,i=!1,s=""){const o=n?n.value:void 0,a=o===r;if(i&&!a&&!Number.isNaN(r))return{wasMutated:!0,path:s};if(e(o)||e(r))return{wasMutated:!1};const c={};for(let l in n.children)c[l]=!0;for(let l in r)c[l]=!0;const u=t.length>0;for(let l in c){const y=s?s+"."+l:l;if(u&&t.some(h=>h instanceof RegExp?h.test(y):y===h))continue;const j=Ti(e,t,n.children[l],r[l],a,y);if(j.wasMutated)return j}return{wasMutated:!1}}function Xo(e={}){if(process.env.NODE_ENV==="production")return()=>t=>n=>t(n);{let t=function(a,c,u,l){return JSON.stringify(a,n(c,l),u)},n=function(a,c){let u=[],l=[];return c||(c=function(y,j){return u[0]===j?"[Circular ~]":"[Circular ~."+l.slice(0,u.indexOf(j)).join(".")+"]"}),function(y,j){if(u.length>0){var b=u.indexOf(this);~b?u.splice(b+1):u.push(this),~b?l.splice(b,1/0,y):l.push(y),~u.indexOf(j)&&(j=c.call(this,y,j))}else u.push(j);return a==null?j:a.call(this,y,j)}},{isImmutable:r=Go,ignoredPaths:i,warnAfter:s=32}=e;const o=Yo.bind(null,r,i);return({getState:a})=>{let c=a(),u=o(c),l;return y=>j=>{const b=Pi(s,"ImmutableStateInvariantMiddleware");b.measureTime(()=>{if(c=a(),l=u.detectMutations(),u=o(c),l.wasMutated)throw new Error(process.env.NODE_ENV==="production"?q(19):`A state mutation was detected between dispatches, in the path '${l.path||""}'. This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`)});const h=y(j);return b.measureTime(()=>{if(c=a(),l=u.detectMutations(),u=o(c),l.wasMutated)throw new Error(process.env.NODE_ENV==="production"?q(20):`A state mutation was detected inside a dispatch, in the path: ${l.path||""}. Take a look at the reducer(s) handling the action ${t(j)}. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`)}),b.warnIfExceeded(),h}}}}function Vi(e){const t=typeof e;return e==null||t==="string"||t==="boolean"||t==="number"||Array.isArray(e)||pe(e)}function In(e,t="",n=Vi,r,i=[],s){let o;if(!n(e))return{keyPath:t||"<root>",value:e};if(typeof e!="object"||e===null||s!=null&&s.has(e))return!1;const a=r!=null?r(e):Object.entries(e),c=i.length>0;for(const[u,l]of a){const y=t?t+"."+u:u;if(!(c&&i.some(b=>b instanceof RegExp?b.test(y):y===b))){if(!n(l))return{keyPath:y,value:l};if(typeof l=="object"&&(o=In(l,y,n,r,i,s),o))return o}}return s&&Li(e)&&s.add(e),!1}function Li(e){if(!Object.isFrozen(e))return!1;for(const t of Object.values(e))if(!(typeof t!="object"||t===null)&&!Li(t))return!1;return!0}function Zo(e={}){if(process.env.NODE_ENV==="production")return()=>t=>n=>t(n);{const{isSerializable:t=Vi,getEntries:n,ignoredActions:r=[],ignoredActionPaths:i=["meta.arg","meta.baseQueryMeta"],ignoredPaths:s=[],warnAfter:o=32,ignoreState:a=!1,ignoreActions:c=!1,disableCache:u=!1}=e,l=!u&&WeakSet?new WeakSet:void 0;return y=>j=>b=>{if(!Un(b))return j(b);const h=j(b),_=Pi(o,"SerializableStateInvariantMiddleware");return!c&&!(r.length&&r.indexOf(b.type)!==-1)&&_.measureTime(()=>{const m=In(b,"",t,n,i,l);if(m){const{keyPath:S,value:M}=m;console.error(`A non-serializable value was detected in an action, in the path: \`${S}\`. Value:`,M,`
30
30
  Take a look at the logic that dispatched this action: `,b,`
31
31
  (See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)`,`
32
- (To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)`)}}),a||(_.measureTime(()=>{const m=y.getState(),S=Mn(m,"",t,n,s,l);if(S){const{keyPath:M,value:x}=S;console.error(`A non-serializable value was detected in the state, in the path: \`${M}\`. Value:`,x,`
32
+ (To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)`)}}),a||(_.measureTime(()=>{const m=y.getState(),S=In(m,"",t,n,s,l);if(S){const{keyPath:M,value:x}=S;console.error(`A non-serializable value was detected in the state, in the path: \`${M}\`. Value:`,x,`
33
33
  Take a look at the reducer(s) handling this action type: ${b.type}.
34
- (See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)`)}}),_.warnIfExceeded()),h}}}function Ot(e){return typeof e=="boolean"}var Go=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:s=!0}=t??{};let o=new Pi;if(n&&(Ot(n)?o.push($o):o.push(Lo(n.extraArgument))),process.env.NODE_ENV!=="production"){if(r){let a={};Ot(r)||(a=r),o.unshift(Bo(a))}if(i){let a={};Ot(i)||(a=i),o.push(Ko(a))}if(s){let a={};Ot(s)||(a=s),o.unshift(zo(a))}}return o},rn="RTK_autoBatch",We=()=>e=>({payload:e,meta:{[rn]:!0}}),Or=e=>t=>{setTimeout(t,e)},Yo=(e,t)=>n=>{let r=!1;const i=()=>{r||(r=!0,cancelAnimationFrame(s),clearTimeout(o),n())},s=e(i),o=setTimeout(i,t)},Xo=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,s=!1,o=!1;const a=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?Yo(window.requestAnimationFrame,100):Or(10):e.type==="callback"?e.queueNotification:Or(e.timeout),u=()=>{o=!1,s&&(s=!1,a.forEach(l=>l()))};return Object.assign({},r,{subscribe(l){const y=()=>i&&l(),j=r.subscribe(y);return a.add(l),()=>{j(),a.delete(l)}},dispatch(l){var y;try{return i=!((y=l==null?void 0:l.meta)!=null&&y[rn]),s=!i,s&&(o||(o=!0,c(u))),r.dispatch(l)}finally{i=!0}}})},Jo=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new Pi(e);return r&&i.push(Xo(typeof r=="object"?r:void 0)),i};function Zo(e){const t=Go(),{reducer:n=void 0,middleware:r,devTools:i=!0,duplicateMiddlewareCheck:s=!0,preloadedState:o=void 0,enhancers:a=void 0}=e||{};let c;if(typeof n=="function")c=n;else if(pe(n))c=gi(n);else throw new Error(process.env.NODE_ENV==="production"?q(1):"`reducer` is a required argument, and must be a function or an object of functions that can be passed to combineReducers");if(process.env.NODE_ENV!=="production"&&r&&typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?q(2):"`middleware` field must be a callback");let u;if(typeof r=="function"){if(u=r(t),process.env.NODE_ENV!=="production"&&!Array.isArray(u))throw new Error(process.env.NODE_ENV==="production"?q(3):"when using a middleware builder function, an array of middleware must be returned")}else u=t();if(process.env.NODE_ENV!=="production"&&u.some(_=>typeof _!="function"))throw new Error(process.env.NODE_ENV==="production"?q(4):"each middleware provided to configureStore must be a function");if(process.env.NODE_ENV!=="production"&&s){let _=new Set;u.forEach(m=>{if(_.has(m))throw new Error(process.env.NODE_ENV==="production"?q(42):"Duplicate middleware references found when creating the store. Ensure that each middleware is only included once.");_.add(m)})}let l=$t;i&&(l=Qo({trace:process.env.NODE_ENV!=="production",...typeof i=="object"&&i}));const y=co(...u),j=Jo(y);if(process.env.NODE_ENV!=="production"&&a&&typeof a!="function")throw new Error(process.env.NODE_ENV==="production"?q(5):"`enhancers` field must be a callback");let b=typeof a=="function"?a(j):j();if(process.env.NODE_ENV!=="production"&&!Array.isArray(b))throw new Error(process.env.NODE_ENV==="production"?q(6):"`enhancers` callback must return an array");if(process.env.NODE_ENV!=="production"&&b.some(_=>typeof _!="function"))throw new Error(process.env.NODE_ENV==="production"?q(7):"each enhancer provided to configureStore must be a function");process.env.NODE_ENV!=="production"&&u.length&&!b.includes(y)&&console.error("middlewares were provided, but middleware enhancer was not included in final enhancers - make sure to call `getDefaultEnhancers`");const h=l(...b);return hi(c,o,h)}function Vi(e){const t={},n=[];let r;const i={addCase(s,o){if(process.env.NODE_ENV!=="production"){if(n.length>0)throw new Error(process.env.NODE_ENV==="production"?q(26):"`builder.addCase` should only be called before calling `builder.addMatcher`");if(r)throw new Error(process.env.NODE_ENV==="production"?q(27):"`builder.addCase` should only be called before calling `builder.addDefaultCase`")}const a=typeof s=="string"?s:s.type;if(!a)throw new Error(process.env.NODE_ENV==="production"?q(28):"`builder.addCase` cannot be called with an empty action type");if(a in t)throw new Error(process.env.NODE_ENV==="production"?q(29):`\`builder.addCase\` cannot be called with two reducers for the same action type '${a}'`);return t[a]=o,i},addAsyncThunk(s,o){if(process.env.NODE_ENV!=="production"&&r)throw new Error(process.env.NODE_ENV==="production"?q(43):"`builder.addAsyncThunk` should only be called before calling `builder.addDefaultCase`");return o.pending&&(t[s.pending.type]=o.pending),o.rejected&&(t[s.rejected.type]=o.rejected),o.fulfilled&&(t[s.fulfilled.type]=o.fulfilled),o.settled&&n.push({matcher:s.settled,reducer:o.settled}),i},addMatcher(s,o){if(process.env.NODE_ENV!=="production"&&r)throw new Error(process.env.NODE_ENV==="production"?q(30):"`builder.addMatcher` should only be called before calling `builder.addDefaultCase`");return n.push({matcher:s,reducer:o}),i},addDefaultCase(s){if(process.env.NODE_ENV!=="production"&&r)throw new Error(process.env.NODE_ENV==="production"?q(31):"`builder.addDefaultCase` can only be called once");return r=s,i}};return e(i),[t,n,r]}function ea(e){return typeof e=="function"}function ta(e,t){if(process.env.NODE_ENV!=="production"&&typeof t=="object")throw new Error(process.env.NODE_ENV==="production"?q(8):"The object notation for `createReducer` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer");let[n,r,i]=Vi(t),s;if(ea(e))s=()=>jr(e());else{const a=jr(e);s=()=>a}function o(a=s(),c){let u=[n[c.type],...r.filter(({matcher:l})=>l(c)).map(({reducer:l})=>l)];return u.filter(l=>!!l).length===0&&(u=[i]),u.reduce((l,y)=>{if(y)if(ae(l)){const b=y(l,c);return b===void 0?l:b}else{if(ce(l))return xt(l,j=>y(j,c));{const j=y(l,c);if(j===void 0){if(l===null)return l;throw Error("A case reducer on a non-draftable value must not return undefined")}return j}}return l},a)}return o.getInitialState=s,o}var Fi=(e,t)=>Ii(e)?e.match(t):e(t);function be(...e){return t=>e.some(n=>Fi(n,t))}function nt(...e){return t=>e.every(n=>Fi(n,t))}function sn(e,t){if(!e||!e.meta)return!1;const n=typeof e.meta.requestId=="string",r=t.indexOf(e.meta.requestStatus)>-1;return n&&r}function vt(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function Kn(...e){return e.length===0?t=>sn(t,["pending"]):vt(e)?be(...e.map(t=>t.pending)):Kn()(e[0])}function Le(...e){return e.length===0?t=>sn(t,["rejected"]):vt(e)?be(...e.map(t=>t.rejected)):Le()(e[0])}function on(...e){const t=n=>n&&n.meta&&n.meta.rejectedWithValue;return e.length===0?nt(Le(...e),t):vt(e)?nt(Le(...e),t):on()(e[0])}function _e(...e){return e.length===0?t=>sn(t,["fulfilled"]):vt(e)?be(...e.map(t=>t.fulfilled)):_e()(e[0])}function Pn(...e){return e.length===0?t=>sn(t,["pending","fulfilled","rejected"]):vt(e)?be(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):Pn()(e[0])}var na="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Gn=(e=21)=>{let t="",n=e;for(;n--;)t+=na[Math.random()*64|0];return t},ra=["name","message","stack","code"],yn=class{constructor(e,t){ie(this,"payload");ie(this,"meta");ie(this,"_type");this.payload=e,this.meta=t}},kr=class{constructor(e,t){ie(this,"payload");ie(this,"meta");ie(this,"_type");this.payload=e,this.meta=t}},ia=e=>{if(typeof e=="object"&&e!==null){const t={};for(const n of ra)typeof e[n]=="string"&&(t[n]=e[n]);return t}return{message:String(e)}},Ir="External signal was aborted",Mr=(()=>{function e(t,n,r){const i=me(t+"/fulfilled",(c,u,l,y)=>({payload:c,meta:{...y||{},arg:l,requestId:u,requestStatus:"fulfilled"}})),s=me(t+"/pending",(c,u,l)=>({payload:void 0,meta:{...l||{},arg:u,requestId:c,requestStatus:"pending"}})),o=me(t+"/rejected",(c,u,l,y,j)=>({payload:y,error:(r&&r.serializeError||ia)(c||"Rejected"),meta:{...j||{},arg:l,requestId:u,rejectedWithValue:!!y,requestStatus:"rejected",aborted:(c==null?void 0:c.name)==="AbortError",condition:(c==null?void 0:c.name)==="ConditionError"}}));function a(c,{signal:u}={}){return(l,y,j)=>{const b=r!=null&&r.idGenerator?r.idGenerator(c):Gn(),h=new AbortController;let _,m;function S(x){m=x,h.abort()}u&&(u.aborted?S(Ir):u.addEventListener("abort",()=>S(Ir),{once:!0}));const M=(async function(){var f,d;let x;try{let N=(f=r==null?void 0:r.condition)==null?void 0:f.call(r,c,{getState:y,extra:j});if(oa(N)&&(N=await N),N===!1||h.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const O=new Promise((C,E)=>{_=()=>{E({name:"AbortError",message:m||"Aborted"})},h.signal.addEventListener("abort",_,{once:!0})});l(s(b,c,(d=r==null?void 0:r.getPendingMeta)==null?void 0:d.call(r,{requestId:b,arg:c},{getState:y,extra:j}))),x=await Promise.race([O,Promise.resolve(n(c,{dispatch:l,getState:y,extra:j,requestId:b,signal:h.signal,abort:S,rejectWithValue:((C,E)=>new yn(C,E)),fulfillWithValue:((C,E)=>new kr(C,E))})).then(C=>{if(C instanceof yn)throw C;return C instanceof kr?i(C.payload,b,c,C.meta):i(C,b,c)})])}catch(N){x=N instanceof yn?o(null,b,c,N.payload,N.meta):o(N,b,c)}finally{_&&h.signal.removeEventListener("abort",_)}return r&&!r.dispatchConditionRejection&&o.match(x)&&x.meta.condition||l(x),x})();return Object.assign(M,{abort:S,requestId:b,arg:c,unwrap(){return M.then(sa)}})}}return Object.assign(a,{pending:s,rejected:o,fulfilled:i,settled:be(o,i),typePrefix:t})}return e.withTypes=()=>e,e})();function sa(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function oa(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var aa=Symbol.for("rtk-slice-createasyncthunk");function ca(e,t){return`${e}/${t}`}function ua({creators:e}={}){var n;const t=(n=e==null?void 0:e.asyncThunk)==null?void 0:n[aa];return function(i){const{name:s,reducerPath:o=s}=i;if(!s)throw new Error(process.env.NODE_ENV==="production"?q(11):"`name` is a required option for createSlice");typeof process<"u"&&process.env.NODE_ENV==="development"&&i.initialState===void 0&&console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`");const a=(typeof i.reducers=="function"?i.reducers(da()):i.reducers)||{},c=Object.keys(a),u={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},l={addCase(v,f){const d=typeof v=="string"?v:v.type;if(!d)throw new Error(process.env.NODE_ENV==="production"?q(12):"`context.addCase` cannot be called with an empty action type");if(d in u.sliceCaseReducersByType)throw new Error(process.env.NODE_ENV==="production"?q(13):"`context.addCase` cannot be called with two reducers for the same action type: "+d);return u.sliceCaseReducersByType[d]=f,l},addMatcher(v,f){return u.sliceMatchers.push({matcher:v,reducer:f}),l},exposeAction(v,f){return u.actionCreators[v]=f,l},exposeCaseReducer(v,f){return u.sliceCaseReducersByName[v]=f,l}};c.forEach(v=>{const f=a[v],d={reducerName:v,type:ca(s,v),createNotation:typeof i.reducers=="function"};ma(f)?ha(d,f,l,t):fa(d,f,l)});function y(){if(process.env.NODE_ENV!=="production"&&typeof i.extraReducers=="object")throw new Error(process.env.NODE_ENV==="production"?q(14):"The object notation for `createSlice.extraReducers` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice");const[v={},f=[],d=void 0]=typeof i.extraReducers=="function"?Vi(i.extraReducers):[i.extraReducers],N={...v,...u.sliceCaseReducersByType};return ta(i.initialState,O=>{for(let C in N)O.addCase(C,N[C]);for(let C of u.sliceMatchers)O.addMatcher(C.matcher,C.reducer);for(let C of f)O.addMatcher(C.matcher,C.reducer);d&&O.addDefaultCase(d)})}const j=v=>v,b=new Map,h=new WeakMap;let _;function m(v,f){return _||(_=y()),_(v,f)}function S(){return _||(_=y()),_.getInitialState()}function M(v,f=!1){function d(O){let C=O[v];if(typeof C>"u"){if(f)C=jt(h,d,S);else if(process.env.NODE_ENV!=="production")throw new Error(process.env.NODE_ENV==="production"?q(15):"selectSlice returned undefined for an uninjected slice reducer")}return C}function N(O=j){const C=jt(b,f,()=>new WeakMap);return jt(C,O,()=>{const E={};for(const[g,w]of Object.entries(i.selectors??{}))E[g]=la(w,O,()=>jt(h,O,S),f);return E})}return{reducerPath:v,getSelectors:N,get selectors(){return N(d)},selectSlice:d}}const x={name:s,reducer:m,actions:u.actionCreators,caseReducers:u.sliceCaseReducersByName,getInitialState:S,...M(o),injectInto(v,{reducerPath:f,...d}={}){const N=f??o;return v.inject({reducerPath:N,reducer:m},d),{...x,...M(N,!0)}}};return x}}function la(e,t,n,r){function i(s,...o){let a=t(s);if(typeof a>"u"){if(r)a=n();else if(process.env.NODE_ENV!=="production")throw new Error(process.env.NODE_ENV==="production"?q(16):"selectState returned undefined for an uninjected slice reducer")}return e(a,...o)}return i.unwrapped=e,i}var ke=ua();function da(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function fa({type:e,reducerName:t,createNotation:n},r,i){let s,o;if("reducer"in r){if(n&&!pa(r))throw new Error(process.env.NODE_ENV==="production"?q(17):"Please use the `create.preparedReducer` notation for prepared action creators with the `create` notation.");s=r.reducer,o=r.prepare}else s=r;i.addCase(e,s).exposeCaseReducer(t,s).exposeAction(t,o?me(e,o):me(e))}function ma(e){return e._reducerDefinitionType==="asyncThunk"}function pa(e){return e._reducerDefinitionType==="reducerWithPrepare"}function ha({type:e,reducerName:t},n,r,i){if(!i)throw new Error(process.env.NODE_ENV==="production"?q(18):"Cannot use `create.asyncThunk` in the built-in `createSlice`. Use `buildCreateSlice({ creators: { asyncThunk: asyncThunkCreator } })` to create a customised version of `createSlice`.");const{payloadCreator:s,fulfilled:o,pending:a,rejected:c,settled:u,options:l}=n,y=i(e,s,l);r.exposeAction(t,y),o&&r.addCase(y.fulfilled,o),a&&r.addCase(y.pending,a),c&&r.addCase(y.rejected,c),u&&r.addMatcher(y.settled,u),r.exposeCaseReducer(t,{fulfilled:o||kt,pending:a||kt,rejected:c||kt,settled:u||kt})}function kt(){}function q(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var ga=class extends Error{constructor(t){super(t[0].message);ie(this,"issues");this.name="SchemaError",this.issues=t}},$i=(e=>(e.uninitialized="uninitialized",e.pending="pending",e.fulfilled="fulfilled",e.rejected="rejected",e))($i||{}),xe="uninitialized",An="pending",Xe="fulfilled",Je="rejected";function Pr(e){return{status:e,isUninitialized:e===xe,isLoading:e===An,isSuccess:e===Xe,isError:e===Je}}var Ar=pe;function Yn(e,t){if(e===t||!(Ar(e)&&Ar(t)||Array.isArray(e)&&Array.isArray(t)))return t;const n=Object.keys(t),r=Object.keys(e);let i=n.length===r.length;const s=Array.isArray(t)?[]:{};for(const o of n)s[o]=Yn(e[o],t[o]),i&&(i=e[o]===s[o]);return i?e:s}function Dn(e,t,n){return e.reduce((r,i,s)=>(t(i,s)&&r.push(n(i,s)),r),[]).flat()}function ya(e){return new RegExp("(^|:)//").test(e)}function ba(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function Xn(e){return e!=null}function Dr(e){return[...(e==null?void 0:e.values())??[]].filter(Xn)}function xa(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var va=e=>e.replace(/\/$/,""),wa=e=>e.replace(/^\//,"");function Ea(e,t){if(!e)return t;if(!t)return e;if(ya(t))return t;const n=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=va(e),t=wa(t),`${e}${n}${t}`}function Kt(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}var Rn=()=>new Map,Sa=e=>{const t=new AbortController;return setTimeout(()=>{const n="signal timed out",r="TimeoutError";t.abort(typeof DOMException<"u"?new DOMException(n,r):Object.assign(new Error(n),{name:r}))},e),t.signal},Na=(...e)=>{for(const n of e)if(n.aborted)return AbortSignal.abort(n.reason);const t=new AbortController;for(const n of e)n.addEventListener("abort",()=>t.abort(n.reason),{signal:t.signal,once:!0});return t.signal},Rr=(...e)=>fetch(...e),Ca=e=>e.status>=200&&e.status<=299,_a=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function Tr(e){if(!pe(e))return e;const t={...e};for(const[n,r]of Object.entries(t))r===void 0&&delete t[n];return t}var ja=e=>typeof e=="object"&&(pe(e)||Array.isArray(e)||typeof e.toJSON=="function");function Oa({baseUrl:e,prepareHeaders:t=y=>y,fetchFn:n=Rr,paramsSerializer:r,isJsonContentType:i=_a,jsonContentType:s="application/json",jsonReplacer:o,timeout:a,responseHandler:c,validateStatus:u,...l}={}){return typeof fetch>"u"&&n===Rr&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),async(j,b,h)=>{const{getState:_,extra:m,endpoint:S,forced:M,type:x}=b;let v,{url:f,headers:d=new Headers(l.headers),params:N=void 0,responseHandler:O=c??"json",validateStatus:C=u??Ca,timeout:E=a,...g}=typeof j=="string"?{url:j}:j,w={...l,signal:E?Na(b.signal,Sa(E)):b.signal,...g};d=new Headers(Tr(d)),w.headers=await t(d,{getState:_,arg:j,extra:m,endpoint:S,forced:M,type:x,extraOptions:h})||d;const k=ja(w.body);if(w.body!=null&&!k&&typeof w.body!="string"&&w.headers.delete("content-type"),!w.headers.has("content-type")&&k&&w.headers.set("content-type",s),k&&i(w.headers)&&(w.body=JSON.stringify(w.body,o)),w.headers.has("accept")||(O==="json"?w.headers.set("accept","application/json"):O==="text"&&w.headers.set("accept","text/plain, text/html, */*")),N){const V=~f.indexOf("?")?"&":"?",F=r?r(N):new URLSearchParams(Tr(N));f+=V+F}f=Ea(e,f);const I=new Request(f,w);v={request:new Request(f,w)};let D;try{D=await n(I)}catch(V){return{error:{status:(V instanceof Error||typeof DOMException<"u"&&V instanceof DOMException)&&V.name==="TimeoutError"?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(V)},meta:v}}const $=D.clone();v.response=$;let R,P="";try{let V;if(await Promise.all([y(D,O).then(F=>R=F,F=>V=F),$.text().then(F=>P=F,()=>{})]),V)throw V}catch(V){return{error:{status:"PARSING_ERROR",originalStatus:D.status,data:P,error:String(V)},meta:v}}return C(D,R)?{data:R,meta:v}:{error:{status:D.status,data:R},meta:v}};async function y(j,b){if(typeof b=="function")return b(j);if(b==="content-type"&&(b=i(j.headers)?"json":"text"),b==="json"){const h=await j.text();return h.length?JSON.parse(h):null}return j.text()}}var Vr=class{constructor(e,t=void 0){ie(this,"value");ie(this,"meta");this.value=e,this.meta=t}},an="__rtkq/",ka="online",Ia="offline",Li="focused",Jn=me(`${an}${Li}`),Qi=me(`${an}un${Li}`),Zn=me(`${an}${ka}`),Ui=me(`${an}${Ia}`),wt="query",qi="mutation",zi="infinitequery";function cn(e){return e.type===wt}function Ma(e){return e.type===qi}function Et(e){return e.type===zi}function Gt(e){return cn(e)||Et(e)}function er(e,t,n,r,i,s){const o=Pa(e)?e(t,n,r,i):e;return o?Dn(o,Xn,a=>s(Wi(a))):[]}function Pa(e){return typeof e=="function"}function Wi(e){return typeof e=="string"?{type:e}:e}function Aa(e,t){return e.catch(t)}var Qe=(e,t)=>e.endpointDefinitions[t],lt=Symbol("forceQueryFn"),Tn=e=>typeof e[lt]=="function";function Da({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:n,mutationThunk:r,api:i,context:s,getInternalState:o}){const a=f=>{var d;return(d=o(f))==null?void 0:d.runningQueries},c=f=>{var d;return(d=o(f))==null?void 0:d.runningMutations},{unsubscribeQueryResult:u,removeMutationResult:l,updateSubscriptionOptions:y}=i.internalActions;return{buildInitiateQuery:M,buildInitiateInfiniteQuery:x,buildInitiateMutation:v,getRunningQueryThunk:j,getRunningMutationThunk:b,getRunningQueriesThunk:h,getRunningMutationsThunk:_};function j(f,d){return N=>{var E;const O=Qe(s,f),C=e({queryArgs:d,endpointDefinition:O,endpointName:f});return(E=a(N))==null?void 0:E.get(C)}}function b(f,d){return N=>{var O;return(O=c(N))==null?void 0:O.get(d)}}function h(){return f=>Dr(a(f))}function _(){return f=>Dr(c(f))}function m(f){if(process.env.NODE_ENV!=="production"){if(m.triggered)return;const d=f(i.internalActions.internal_getRTKQSubscriptions());if(m.triggered=!0,typeof d!="object"||typeof(d==null?void 0:d.type)=="string")throw new Error(process.env.NODE_ENV==="production"?q(34):`Warning: Middleware for RTK-Query API at reducerPath "${i.reducerPath}" has not been added to the store.
35
- You must add the middleware for RTK-Query to function correctly!`)}}function S(f,d){const N=(O,{subscribe:C=!0,forceRefetch:E,subscriptionOptions:g,[lt]:w,...k}={})=>(I,A)=>{var W;const D=e({queryArgs:O,endpointDefinition:d,endpointName:f});let $;const R={...k,type:wt,subscribe:C,forceRefetch:E,subscriptionOptions:g,endpointName:f,originalArgs:O,queryCacheKey:D,[lt]:w};if(cn(d))$=t(R);else{const{direction:Q,initialPageParam:te,refetchCachedPages:z}=k;$=n({...R,direction:Q,initialPageParam:te,refetchCachedPages:z})}const P=i.endpoints[f].select(O),V=I($),F=P(A());m(I);const{requestId:H,abort:K}=V,B=F.requestId!==H,X=(W=a(I))==null?void 0:W.get(D),G=()=>P(A()),L=Object.assign(w?V.then(G):B&&!X?Promise.resolve(F):Promise.all([X,V]).then(G),{arg:O,requestId:H,subscriptionOptions:g,queryCacheKey:D,abort:K,async unwrap(){const Q=await L;if(Q.isError)throw Q.error;return Q.data},refetch:Q=>I(N(O,{subscribe:!1,forceRefetch:!0,...Q})),unsubscribe(){C&&I(u({queryCacheKey:D,requestId:H}))},updateSubscriptionOptions(Q){L.subscriptionOptions=Q,I(y({endpointName:f,requestId:H,queryCacheKey:D,options:Q}))}});if(!X&&!B&&!w){const Q=a(I);Q.set(D,L),L.then(()=>{Q.delete(D)})}return L};return N}function M(f,d){return S(f,d)}function x(f,d){return S(f,d)}function v(f){return(d,{track:N=!0,fixedCacheKey:O}={})=>(C,E)=>{const g=r({type:"mutation",endpointName:f,originalArgs:d,track:N,fixedCacheKey:O}),w=C(g);m(C);const{requestId:k,abort:I,unwrap:A}=w,D=Aa(w.unwrap().then(V=>({data:V})),V=>({error:V})),$=()=>{C(l({requestId:k,fixedCacheKey:O}))},R=Object.assign(D,{arg:w.arg,requestId:k,abort:I,unwrap:A,reset:$}),P=c(C);return P.set(k,R),R.then(()=>{P.delete(k)}),O&&(P.set(O,R),R.then(()=>{P.get(O)===R&&P.delete(O)})),R}}}var Hi=class extends ga{constructor(t,n,r,i){super(t);ie(this,"value");ie(this,"schemaName");ie(this,"_bqMeta");this.value=n,this.schemaName=r,this._bqMeta=i}},je=(e,t)=>Array.isArray(e)?e.includes(t):!!e;async function Oe(e,t,n,r){const i=await e["~standard"].validate(t);if(i.issues)throw new Hi(i.issues,t,n,r);return i.value}function Fr(e){return e}var He=(e={})=>({...e,[rn]:!0});function Ra({reducerPath:e,baseQuery:t,context:{endpointDefinitions:n},serializeQueryArgs:r,api:i,assertTagType:s,selectors:o,onSchemaFailure:a,catchSchemaFailure:c,skipSchemaValidation:u}){const l=(g,w,k,I)=>(A,D)=>{const $=n[g],R=r({queryArgs:w,endpointDefinition:$,endpointName:g});if(A(i.internalActions.queryResultPatched({queryCacheKey:R,patches:k})),!I)return;const P=i.endpoints[g].select(w)(D()),V=er($.providesTags,P.data,void 0,w,{},s);A(i.internalActions.updateProvidedBy([{queryCacheKey:R,providedTags:V}]))};function y(g,w,k=0){const I=[w,...g];return k&&I.length>k?I.slice(0,-1):I}function j(g,w,k=0){const I=[...g,w];return k&&I.length>k?I.slice(1):I}const b=(g,w,k,I=!0)=>(A,D)=>{const R=i.endpoints[g].select(w)(D()),P={patches:[],inversePatches:[],undo:()=>A(i.util.patchQueryData(g,w,P.inversePatches,I))};if(R.status===xe)return P;let V;if("data"in R)if(ce(R.data)){const[F,H,K]=_i(R.data,k);P.patches.push(...H),P.inversePatches.push(...K),V=F}else V=k(R.data),P.patches.push({op:"replace",path:[],value:V}),P.inversePatches.push({op:"replace",path:[],value:R.data});return P.patches.length===0||A(i.util.patchQueryData(g,w,P.patches,I)),P},h=(g,w,k)=>I=>I(i.endpoints[g].initiate(w,{subscribe:!1,forceRefetch:!0,[lt]:()=>({data:k})})),_=(g,w)=>g.query&&g[w]?g[w]:Fr,m=async(g,{signal:w,abort:k,rejectWithValue:I,fulfillWithValue:A,dispatch:D,getState:$,extra:R})=>{var K,B;const P=n[g.endpointName],{metaSchema:V,skipSchemaValidation:F=u}=P,H=g.type===wt;try{let X=Fr;const G={signal:w,abort:k,dispatch:D,getState:$,extra:R,endpoint:g.endpointName,type:g.type,forced:H?S(g,$()):void 0,queryCacheKey:H?g.queryCacheKey:void 0},L=H?g[lt]:void 0;let W;const Q=async(z,U,ve,re)=>{if(U==null&&z.pages.length)return Promise.resolve({data:z});const De={queryArg:g.originalArgs,pageParam:U},le=await te(De),Re=re?y:j;return{data:{pages:Re(z.pages,le.data,ve),pageParams:Re(z.pageParams,U,ve)},meta:le.meta}};async function te(z){let U;const{extraOptions:ve,argSchema:re,rawResponseSchema:De,responseSchema:le}=P;if(re&&!je(F,"arg")&&(z=await Oe(re,z,"argSchema",{})),L?U=L():P.query?(X=_(P,"transformResponse"),U=await t(P.query(z),G,ve)):U=await P.queryFn(z,G,ve,ue=>t(ue,G,ve)),typeof process<"u"&&process.env.NODE_ENV==="development"){const ue=P.query?"`baseQuery`":"`queryFn`";let de;if(!U)de=`${ue} did not return anything.`;else if(typeof U!="object")de=`${ue} did not return an object.`;else if(U.error&&U.data)de=`${ue} returned an object containing both \`error\` and \`result\`.`;else if(U.error===void 0&&U.data===void 0)de=`${ue} returned an object containing neither a valid \`error\` and \`result\`. At least one of them should not be \`undefined\``;else for(const Ee of Object.keys(U))if(Ee!=="error"&&Ee!=="data"&&Ee!=="meta"){de=`The object returned by ${ue} has the unknown property ${Ee}.`;break}de&&console.error(`Error encountered handling the endpoint ${g.endpointName}.
34
+ (See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)`)}}),_.warnIfExceeded()),h}}}function Ot(e){return typeof e=="boolean"}var Jo=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:s=!0}=t??{};let o=new Di;if(n&&(Ot(n)?o.push(qo):o.push(Uo(n.extraArgument))),process.env.NODE_ENV!=="production"){if(r){let a={};Ot(r)||(a=r),o.unshift(Xo(a))}if(i){let a={};Ot(i)||(a=i),o.push(Zo(a))}if(s){let a={};Ot(s)||(a=s),o.unshift(Ko(a))}}return o},tn="RTK_autoBatch",We=()=>e=>({payload:e,meta:{[tn]:!0}}),kr=e=>t=>{setTimeout(t,e)},ea=(e,t)=>n=>{let r=!1;const i=()=>{r||(r=!0,cancelAnimationFrame(s),clearTimeout(o),n())},s=e(i),o=setTimeout(i,t)},ta=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,s=!1,o=!1;const a=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?ea(window.requestAnimationFrame,100):kr(10):e.type==="callback"?e.queueNotification:kr(e.timeout),u=()=>{o=!1,s&&(s=!1,a.forEach(l=>l()))};return Object.assign({},r,{subscribe(l){const y=()=>i&&l(),j=r.subscribe(y);return a.add(l),()=>{j(),a.delete(l)}},dispatch(l){var y;try{return i=!((y=l==null?void 0:l.meta)!=null&&y[tn]),s=!i,s&&(o||(o=!0,c(u))),r.dispatch(l)}finally{i=!0}}})},na=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new Di(e);return r&&i.push(ta(typeof r=="object"?r:void 0)),i};function ra(e){const t=Jo(),{reducer:n=void 0,middleware:r,devTools:i=!0,duplicateMiddlewareCheck:s=!0,preloadedState:o=void 0,enhancers:a=void 0}=e||{};let c;if(typeof n=="function")c=n;else if(pe(n))c=bi(n);else throw new Error(process.env.NODE_ENV==="production"?q(1):"`reducer` is a required argument, and must be a function or an object of functions that can be passed to combineReducers");if(process.env.NODE_ENV!=="production"&&r&&typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?q(2):"`middleware` field must be a callback");let u;if(typeof r=="function"){if(u=r(t),process.env.NODE_ENV!=="production"&&!Array.isArray(u))throw new Error(process.env.NODE_ENV==="production"?q(3):"when using a middleware builder function, an array of middleware must be returned")}else u=t();if(process.env.NODE_ENV!=="production"&&u.some(_=>typeof _!="function"))throw new Error(process.env.NODE_ENV==="production"?q(4):"each middleware provided to configureStore must be a function");if(process.env.NODE_ENV!=="production"&&s){let _=new Set;u.forEach(m=>{if(_.has(m))throw new Error(process.env.NODE_ENV==="production"?q(42):"Duplicate middleware references found when creating the store. Ensure that each middleware is only included once.");_.add(m)})}let l=Ft;i&&(l=Wo({trace:process.env.NODE_ENV!=="production",...typeof i=="object"&&i}));const y=mo(...u),j=na(y);if(process.env.NODE_ENV!=="production"&&a&&typeof a!="function")throw new Error(process.env.NODE_ENV==="production"?q(5):"`enhancers` field must be a callback");let b=typeof a=="function"?a(j):j();if(process.env.NODE_ENV!=="production"&&!Array.isArray(b))throw new Error(process.env.NODE_ENV==="production"?q(6):"`enhancers` callback must return an array");if(process.env.NODE_ENV!=="production"&&b.some(_=>typeof _!="function"))throw new Error(process.env.NODE_ENV==="production"?q(7):"each enhancer provided to configureStore must be a function");process.env.NODE_ENV!=="production"&&u.length&&!b.includes(y)&&console.error("middlewares were provided, but middleware enhancer was not included in final enhancers - make sure to call `getDefaultEnhancers`");const h=l(...b);return yi(c,o,h)}function Fi(e){const t={},n=[];let r;const i={addCase(s,o){if(process.env.NODE_ENV!=="production"){if(n.length>0)throw new Error(process.env.NODE_ENV==="production"?q(26):"`builder.addCase` should only be called before calling `builder.addMatcher`");if(r)throw new Error(process.env.NODE_ENV==="production"?q(27):"`builder.addCase` should only be called before calling `builder.addDefaultCase`")}const a=typeof s=="string"?s:s.type;if(!a)throw new Error(process.env.NODE_ENV==="production"?q(28):"`builder.addCase` cannot be called with an empty action type");if(a in t)throw new Error(process.env.NODE_ENV==="production"?q(29):`\`builder.addCase\` cannot be called with two reducers for the same action type '${a}'`);return t[a]=o,i},addAsyncThunk(s,o){if(process.env.NODE_ENV!=="production"&&r)throw new Error(process.env.NODE_ENV==="production"?q(43):"`builder.addAsyncThunk` should only be called before calling `builder.addDefaultCase`");return o.pending&&(t[s.pending.type]=o.pending),o.rejected&&(t[s.rejected.type]=o.rejected),o.fulfilled&&(t[s.fulfilled.type]=o.fulfilled),o.settled&&n.push({matcher:s.settled,reducer:o.settled}),i},addMatcher(s,o){if(process.env.NODE_ENV!=="production"&&r)throw new Error(process.env.NODE_ENV==="production"?q(30):"`builder.addMatcher` should only be called before calling `builder.addDefaultCase`");return n.push({matcher:s,reducer:o}),i},addDefaultCase(s){if(process.env.NODE_ENV!=="production"&&r)throw new Error(process.env.NODE_ENV==="production"?q(31):"`builder.addDefaultCase` can only be called once");return r=s,i}};return e(i),[t,n,r]}function ia(e){return typeof e=="function"}function sa(e,t){if(process.env.NODE_ENV!=="production"&&typeof t=="object")throw new Error(process.env.NODE_ENV==="production"?q(8):"The object notation for `createReducer` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer");let[n,r,i]=Fi(t),s;if(ia(e))s=()=>Ir(e());else{const a=Ir(e);s=()=>a}function o(a=s(),c){let u=[n[c.type],...r.filter(({matcher:l})=>l(c)).map(({reducer:l})=>l)];return u.filter(l=>!!l).length===0&&(u=[i]),u.reduce((l,y)=>{if(y)if(ae(l)){const b=y(l,c);return b===void 0?l:b}else{if(ce(l))return xt(l,j=>y(j,c));{const j=y(l,c);if(j===void 0){if(l===null)return l;throw Error("A case reducer on a non-draftable value must not return undefined")}return j}}return l},a)}return o.getInitialState=s,o}var Qi=(e,t)=>Ai(e)?e.match(t):e(t);function be(...e){return t=>e.some(n=>Qi(n,t))}function nt(...e){return t=>e.every(n=>Qi(n,t))}function nn(e,t){if(!e||!e.meta)return!1;const n=typeof e.meta.requestId=="string",r=t.indexOf(e.meta.requestStatus)>-1;return n&&r}function vt(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function Kn(...e){return e.length===0?t=>nn(t,["pending"]):vt(e)?be(...e.map(t=>t.pending)):Kn()(e[0])}function ze(...e){return e.length===0?t=>nn(t,["rejected"]):vt(e)?be(...e.map(t=>t.rejected)):ze()(e[0])}function rn(...e){const t=n=>n&&n.meta&&n.meta.rejectedWithValue;return e.length===0?nt(ze(...e),t):vt(e)?nt(ze(...e),t):rn()(e[0])}function _e(...e){return e.length===0?t=>nn(t,["fulfilled"]):vt(e)?be(...e.map(t=>t.fulfilled)):_e()(e[0])}function kn(...e){return e.length===0?t=>nn(t,["pending","fulfilled","rejected"]):vt(e)?be(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):kn()(e[0])}var oa="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Gn=(e=21)=>{let t="",n=e;for(;n--;)t+=oa[Math.random()*64|0];return t},aa=["name","message","stack","code"],hn=class{constructor(e,t){ie(this,"payload");ie(this,"meta");ie(this,"_type");this.payload=e,this.meta=t}},Mr=class{constructor(e,t){ie(this,"payload");ie(this,"meta");ie(this,"_type");this.payload=e,this.meta=t}},ca=e=>{if(typeof e=="object"&&e!==null){const t={};for(const n of aa)typeof e[n]=="string"&&(t[n]=e[n]);return t}return{message:String(e)}},Ar="External signal was aborted",Pr=(()=>{function e(t,n,r){const i=me(t+"/fulfilled",(c,u,l,y)=>({payload:c,meta:{...y||{},arg:l,requestId:u,requestStatus:"fulfilled"}})),s=me(t+"/pending",(c,u,l)=>({payload:void 0,meta:{...l||{},arg:u,requestId:c,requestStatus:"pending"}})),o=me(t+"/rejected",(c,u,l,y,j)=>({payload:y,error:(r&&r.serializeError||ca)(c||"Rejected"),meta:{...j||{},arg:l,requestId:u,rejectedWithValue:!!y,requestStatus:"rejected",aborted:(c==null?void 0:c.name)==="AbortError",condition:(c==null?void 0:c.name)==="ConditionError"}}));function a(c,{signal:u}={}){return(l,y,j)=>{const b=r!=null&&r.idGenerator?r.idGenerator(c):Gn(),h=new AbortController;let _,m;function S(x){m=x,h.abort()}u&&(u.aborted?S(Ar):u.addEventListener("abort",()=>S(Ar),{once:!0}));const M=(async function(){var f,d;let x;try{let N=(f=r==null?void 0:r.condition)==null?void 0:f.call(r,c,{getState:y,extra:j});if(la(N)&&(N=await N),N===!1||h.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const O=new Promise((C,E)=>{_=()=>{E({name:"AbortError",message:m||"Aborted"})},h.signal.addEventListener("abort",_,{once:!0})});l(s(b,c,(d=r==null?void 0:r.getPendingMeta)==null?void 0:d.call(r,{requestId:b,arg:c},{getState:y,extra:j}))),x=await Promise.race([O,Promise.resolve(n(c,{dispatch:l,getState:y,extra:j,requestId:b,signal:h.signal,abort:S,rejectWithValue:((C,E)=>new hn(C,E)),fulfillWithValue:((C,E)=>new Mr(C,E))})).then(C=>{if(C instanceof hn)throw C;return C instanceof Mr?i(C.payload,b,c,C.meta):i(C,b,c)})])}catch(N){x=N instanceof hn?o(null,b,c,N.payload,N.meta):o(N,b,c)}finally{_&&h.signal.removeEventListener("abort",_)}return r&&!r.dispatchConditionRejection&&o.match(x)&&x.meta.condition||l(x),x})();return Object.assign(M,{abort:S,requestId:b,arg:c,unwrap(){return M.then(ua)}})}}return Object.assign(a,{pending:s,rejected:o,fulfilled:i,settled:be(o,i),typePrefix:t})}return e.withTypes=()=>e,e})();function ua(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function la(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var da=Symbol.for("rtk-slice-createasyncthunk");function fa(e,t){return`${e}/${t}`}function ma({creators:e}={}){var n;const t=(n=e==null?void 0:e.asyncThunk)==null?void 0:n[da];return function(i){const{name:s,reducerPath:o=s}=i;if(!s)throw new Error(process.env.NODE_ENV==="production"?q(11):"`name` is a required option for createSlice");typeof process<"u"&&process.env.NODE_ENV==="development"&&i.initialState===void 0&&console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`");const a=(typeof i.reducers=="function"?i.reducers(ha()):i.reducers)||{},c=Object.keys(a),u={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},l={addCase(v,f){const d=typeof v=="string"?v:v.type;if(!d)throw new Error(process.env.NODE_ENV==="production"?q(12):"`context.addCase` cannot be called with an empty action type");if(d in u.sliceCaseReducersByType)throw new Error(process.env.NODE_ENV==="production"?q(13):"`context.addCase` cannot be called with two reducers for the same action type: "+d);return u.sliceCaseReducersByType[d]=f,l},addMatcher(v,f){return u.sliceMatchers.push({matcher:v,reducer:f}),l},exposeAction(v,f){return u.actionCreators[v]=f,l},exposeCaseReducer(v,f){return u.sliceCaseReducersByName[v]=f,l}};c.forEach(v=>{const f=a[v],d={reducerName:v,type:fa(s,v),createNotation:typeof i.reducers=="function"};ya(f)?xa(d,f,l,t):ga(d,f,l)});function y(){if(process.env.NODE_ENV!=="production"&&typeof i.extraReducers=="object")throw new Error(process.env.NODE_ENV==="production"?q(14):"The object notation for `createSlice.extraReducers` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice");const[v={},f=[],d=void 0]=typeof i.extraReducers=="function"?Fi(i.extraReducers):[i.extraReducers],N={...v,...u.sliceCaseReducersByType};return sa(i.initialState,O=>{for(let C in N)O.addCase(C,N[C]);for(let C of u.sliceMatchers)O.addMatcher(C.matcher,C.reducer);for(let C of f)O.addMatcher(C.matcher,C.reducer);d&&O.addDefaultCase(d)})}const j=v=>v,b=new Map,h=new WeakMap;let _;function m(v,f){return _||(_=y()),_(v,f)}function S(){return _||(_=y()),_.getInitialState()}function M(v,f=!1){function d(O){let C=O[v];if(typeof C>"u"){if(f)C=jt(h,d,S);else if(process.env.NODE_ENV!=="production")throw new Error(process.env.NODE_ENV==="production"?q(15):"selectSlice returned undefined for an uninjected slice reducer")}return C}function N(O=j){const C=jt(b,f,()=>new WeakMap);return jt(C,O,()=>{const E={};for(const[g,w]of Object.entries(i.selectors??{}))E[g]=pa(w,O,()=>jt(h,O,S),f);return E})}return{reducerPath:v,getSelectors:N,get selectors(){return N(d)},selectSlice:d}}const x={name:s,reducer:m,actions:u.actionCreators,caseReducers:u.sliceCaseReducersByName,getInitialState:S,...M(o),injectInto(v,{reducerPath:f,...d}={}){const N=f??o;return v.inject({reducerPath:N,reducer:m},d),{...x,...M(N,!0)}}};return x}}function pa(e,t,n,r){function i(s,...o){let a=t(s);if(typeof a>"u"){if(r)a=n();else if(process.env.NODE_ENV!=="production")throw new Error(process.env.NODE_ENV==="production"?q(16):"selectState returned undefined for an uninjected slice reducer")}return e(a,...o)}return i.unwrapped=e,i}var ke=ma();function ha(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function ga({type:e,reducerName:t,createNotation:n},r,i){let s,o;if("reducer"in r){if(n&&!ba(r))throw new Error(process.env.NODE_ENV==="production"?q(17):"Please use the `create.preparedReducer` notation for prepared action creators with the `create` notation.");s=r.reducer,o=r.prepare}else s=r;i.addCase(e,s).exposeCaseReducer(t,s).exposeAction(t,o?me(e,o):me(e))}function ya(e){return e._reducerDefinitionType==="asyncThunk"}function ba(e){return e._reducerDefinitionType==="reducerWithPrepare"}function xa({type:e,reducerName:t},n,r,i){if(!i)throw new Error(process.env.NODE_ENV==="production"?q(18):"Cannot use `create.asyncThunk` in the built-in `createSlice`. Use `buildCreateSlice({ creators: { asyncThunk: asyncThunkCreator } })` to create a customised version of `createSlice`.");const{payloadCreator:s,fulfilled:o,pending:a,rejected:c,settled:u,options:l}=n,y=i(e,s,l);r.exposeAction(t,y),o&&r.addCase(y.fulfilled,o),a&&r.addCase(y.pending,a),c&&r.addCase(y.rejected,c),u&&r.addMatcher(y.settled,u),r.exposeCaseReducer(t,{fulfilled:o||It,pending:a||It,rejected:c||It,settled:u||It})}function It(){}function q(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var va=class extends Error{constructor(t){super(t[0].message);ie(this,"issues");this.name="SchemaError",this.issues=t}},zi=(e=>(e.uninitialized="uninitialized",e.pending="pending",e.fulfilled="fulfilled",e.rejected="rejected",e))(zi||{}),xe="uninitialized",Mn="pending",Xe="fulfilled",Ze="rejected";function Dr(e){return{status:e,isUninitialized:e===xe,isLoading:e===Mn,isSuccess:e===Xe,isError:e===Ze}}var Rr=pe;function Yn(e,t){if(e===t||!(Rr(e)&&Rr(t)||Array.isArray(e)&&Array.isArray(t)))return t;const n=Object.keys(t),r=Object.keys(e);let i=n.length===r.length;const s=Array.isArray(t)?[]:{};for(const o of n)s[o]=Yn(e[o],t[o]),i&&(i=e[o]===s[o]);return i?e:s}function An(e,t,n){return e.reduce((r,i,s)=>(t(i,s)&&r.push(n(i,s)),r),[]).flat()}function wa(e){return new RegExp("(^|:)//").test(e)}function Ea(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function Xn(e){return e!=null}function Tr(e){return[...(e==null?void 0:e.values())??[]].filter(Xn)}function Sa(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var Na=e=>e.replace(/\/$/,""),Ca=e=>e.replace(/^\//,"");function _a(e,t){if(!e)return t;if(!t)return e;if(wa(t))return t;const n=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=Na(e),t=Ca(t),`${e}${n}${t}`}function Kt(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}var Pn=()=>new Map,ja=e=>{const t=new AbortController;return setTimeout(()=>{const n="signal timed out",r="TimeoutError";t.abort(typeof DOMException<"u"?new DOMException(n,r):Object.assign(new Error(n),{name:r}))},e),t.signal},Oa=(...e)=>{for(const n of e)if(n.aborted)return AbortSignal.abort(n.reason);const t=new AbortController;for(const n of e)n.addEventListener("abort",()=>t.abort(n.reason),{signal:t.signal,once:!0});return t.signal},Vr=(...e)=>fetch(...e),Ia=e=>e.status>=200&&e.status<=299,ka=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function Lr(e){if(!pe(e))return e;const t={...e};for(const[n,r]of Object.entries(t))r===void 0&&delete t[n];return t}var Ma=e=>typeof e=="object"&&(pe(e)||Array.isArray(e)||typeof e.toJSON=="function");function Aa({baseUrl:e,prepareHeaders:t=y=>y,fetchFn:n=Vr,paramsSerializer:r,isJsonContentType:i=ka,jsonContentType:s="application/json",jsonReplacer:o,timeout:a,responseHandler:c,validateStatus:u,...l}={}){return typeof fetch>"u"&&n===Vr&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),async(j,b,h)=>{const{getState:_,extra:m,endpoint:S,forced:M,type:x}=b;let v,{url:f,headers:d=new Headers(l.headers),params:N=void 0,responseHandler:O=c??"json",validateStatus:C=u??Ia,timeout:E=a,...g}=typeof j=="string"?{url:j}:j,w={...l,signal:E?Oa(b.signal,ja(E)):b.signal,...g};d=new Headers(Lr(d)),w.headers=await t(d,{getState:_,arg:j,extra:m,endpoint:S,forced:M,type:x,extraOptions:h})||d;const I=Ma(w.body);if(w.body!=null&&!I&&typeof w.body!="string"&&w.headers.delete("content-type"),!w.headers.has("content-type")&&I&&w.headers.set("content-type",s),I&&i(w.headers)&&(w.body=JSON.stringify(w.body,o)),w.headers.has("accept")||(O==="json"?w.headers.set("accept","application/json"):O==="text"&&w.headers.set("accept","text/plain, text/html, */*")),N){const V=~f.indexOf("?")?"&":"?",L=r?r(N):new URLSearchParams(Lr(N));f+=V+L}f=_a(e,f);const k=new Request(f,w);v={request:new Request(f,w)};let D;try{D=await n(k)}catch(V){return{error:{status:(V instanceof Error||typeof DOMException<"u"&&V instanceof DOMException)&&V.name==="TimeoutError"?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(V)},meta:v}}const F=D.clone();v.response=F;let R,A="";try{let V;if(await Promise.all([y(D,O).then(L=>R=L,L=>V=L),F.text().then(L=>A=L,()=>{})]),V)throw V}catch(V){return{error:{status:"PARSING_ERROR",originalStatus:D.status,data:A,error:String(V)},meta:v}}return C(D,R)?{data:R,meta:v}:{error:{status:D.status,data:R},meta:v}};async function y(j,b){if(typeof b=="function")return b(j);if(b==="content-type"&&(b=i(j.headers)?"json":"text"),b==="json"){const h=await j.text();return h.length?JSON.parse(h):null}return j.text()}}var Fr=class{constructor(e,t=void 0){ie(this,"value");ie(this,"meta");this.value=e,this.meta=t}},sn="__rtkq/",Pa="online",Da="offline",$i="focused",Zn=me(`${sn}${$i}`),qi=me(`${sn}un${$i}`),Jn=me(`${sn}${Pa}`),Ui=me(`${sn}${Da}`),wt="query",Wi="mutation",Hi="infinitequery";function on(e){return e.type===wt}function Ra(e){return e.type===Wi}function Et(e){return e.type===Hi}function Gt(e){return on(e)||Et(e)}function er(e,t,n,r,i,s){const o=Ta(e)?e(t,n,r,i):e;return o?An(o,Xn,a=>s(Bi(a))):[]}function Ta(e){return typeof e=="function"}function Bi(e){return typeof e=="string"?{type:e}:e}function Va(e,t){return e.catch(t)}var $e=(e,t)=>e.endpointDefinitions[t],lt=Symbol("forceQueryFn"),Dn=e=>typeof e[lt]=="function";function La({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:n,mutationThunk:r,api:i,context:s,getInternalState:o}){const a=f=>{var d;return(d=o(f))==null?void 0:d.runningQueries},c=f=>{var d;return(d=o(f))==null?void 0:d.runningMutations},{unsubscribeQueryResult:u,removeMutationResult:l,updateSubscriptionOptions:y}=i.internalActions;return{buildInitiateQuery:M,buildInitiateInfiniteQuery:x,buildInitiateMutation:v,getRunningQueryThunk:j,getRunningMutationThunk:b,getRunningQueriesThunk:h,getRunningMutationsThunk:_};function j(f,d){return N=>{var E;const O=$e(s,f),C=e({queryArgs:d,endpointDefinition:O,endpointName:f});return(E=a(N))==null?void 0:E.get(C)}}function b(f,d){return N=>{var O;return(O=c(N))==null?void 0:O.get(d)}}function h(){return f=>Tr(a(f))}function _(){return f=>Tr(c(f))}function m(f){if(process.env.NODE_ENV!=="production"){if(m.triggered)return;const d=f(i.internalActions.internal_getRTKQSubscriptions());if(m.triggered=!0,typeof d!="object"||typeof(d==null?void 0:d.type)=="string")throw new Error(process.env.NODE_ENV==="production"?q(34):`Warning: Middleware for RTK-Query API at reducerPath "${i.reducerPath}" has not been added to the store.
35
+ You must add the middleware for RTK-Query to function correctly!`)}}function S(f,d){const N=(O,{subscribe:C=!0,forceRefetch:E,subscriptionOptions:g,[lt]:w,...I}={})=>(k,P)=>{var W;const D=e({queryArgs:O,endpointDefinition:d,endpointName:f});let F;const R={...I,type:wt,subscribe:C,forceRefetch:E,subscriptionOptions:g,endpointName:f,originalArgs:O,queryCacheKey:D,[lt]:w};if(on(d))F=t(R);else{const{direction:z,initialPageParam:ne,refetchCachedPages:U}=I;F=n({...R,direction:z,initialPageParam:ne,refetchCachedPages:U})}const A=i.endpoints[f].select(O),V=k(F),L=A(P());m(k);const{requestId:H,abort:K}=V,B=L.requestId!==H,Y=(W=a(k))==null?void 0:W.get(D),G=()=>A(P()),Q=Object.assign(w?V.then(G):B&&!Y?Promise.resolve(L):Promise.all([Y,V]).then(G),{arg:O,requestId:H,subscriptionOptions:g,queryCacheKey:D,abort:K,async unwrap(){const z=await Q;if(z.isError)throw z.error;return z.data},refetch:z=>k(N(O,{subscribe:!1,forceRefetch:!0,...z})),unsubscribe(){C&&k(u({queryCacheKey:D,requestId:H}))},updateSubscriptionOptions(z){Q.subscriptionOptions=z,k(y({endpointName:f,requestId:H,queryCacheKey:D,options:z}))}});if(!Y&&!B&&!w){const z=a(k);z.set(D,Q),Q.then(()=>{z.delete(D)})}return Q};return N}function M(f,d){return S(f,d)}function x(f,d){return S(f,d)}function v(f){return(d,{track:N=!0,fixedCacheKey:O}={})=>(C,E)=>{const g=r({type:"mutation",endpointName:f,originalArgs:d,track:N,fixedCacheKey:O}),w=C(g);m(C);const{requestId:I,abort:k,unwrap:P}=w,D=Va(w.unwrap().then(V=>({data:V})),V=>({error:V})),F=()=>{C(l({requestId:I,fixedCacheKey:O}))},R=Object.assign(D,{arg:w.arg,requestId:I,abort:k,unwrap:P,reset:F}),A=c(C);return A.set(I,R),R.then(()=>{A.delete(I)}),O&&(A.set(O,R),R.then(()=>{A.get(O)===R&&A.delete(O)})),R}}}var Ki=class extends va{constructor(t,n,r,i){super(t);ie(this,"value");ie(this,"schemaName");ie(this,"_bqMeta");this.value=n,this.schemaName=r,this._bqMeta=i}},Oe=(e,t)=>Array.isArray(e)?e.includes(t):!!e;async function Ie(e,t,n,r){const i=await e["~standard"].validate(t);if(i.issues)throw new Ki(i.issues,t,n,r);return i.value}function Qr(e){return e}var He=(e={})=>({...e,[tn]:!0});function Fa({reducerPath:e,baseQuery:t,context:{endpointDefinitions:n},serializeQueryArgs:r,api:i,assertTagType:s,selectors:o,onSchemaFailure:a,catchSchemaFailure:c,skipSchemaValidation:u}){const l=(g,w,I,k)=>(P,D)=>{const F=n[g],R=r({queryArgs:w,endpointDefinition:F,endpointName:g});if(P(i.internalActions.queryResultPatched({queryCacheKey:R,patches:I})),!k)return;const A=i.endpoints[g].select(w)(D()),V=er(F.providesTags,A.data,void 0,w,{},s);P(i.internalActions.updateProvidedBy([{queryCacheKey:R,providedTags:V}]))};function y(g,w,I=0){const k=[w,...g];return I&&k.length>I?k.slice(0,-1):k}function j(g,w,I=0){const k=[...g,w];return I&&k.length>I?k.slice(1):k}const b=(g,w,I,k=!0)=>(P,D)=>{const R=i.endpoints[g].select(w)(D()),A={patches:[],inversePatches:[],undo:()=>P(i.util.patchQueryData(g,w,A.inversePatches,k))};if(R.status===xe)return A;let V;if("data"in R)if(ce(R.data)){const[L,H,K]=Oi(R.data,I);A.patches.push(...H),A.inversePatches.push(...K),V=L}else V=I(R.data),A.patches.push({op:"replace",path:[],value:V}),A.inversePatches.push({op:"replace",path:[],value:R.data});return A.patches.length===0||P(i.util.patchQueryData(g,w,A.patches,k)),A},h=(g,w,I)=>k=>k(i.endpoints[g].initiate(w,{subscribe:!1,forceRefetch:!0,[lt]:()=>({data:I})})),_=(g,w)=>g.query&&g[w]?g[w]:Qr,m=async(g,{signal:w,abort:I,rejectWithValue:k,fulfillWithValue:P,dispatch:D,getState:F,extra:R})=>{var K,B;const A=n[g.endpointName],{metaSchema:V,skipSchemaValidation:L=u}=A,H=g.type===wt;try{let Y=Qr;const G={signal:w,abort:I,dispatch:D,getState:F,extra:R,endpoint:g.endpointName,type:g.type,forced:H?S(g,F()):void 0,queryCacheKey:H?g.queryCacheKey:void 0},Q=H?g[lt]:void 0;let W;const z=async(U,$,ve,re)=>{if($==null&&U.pages.length)return Promise.resolve({data:U});const Re={queryArg:g.originalArgs,pageParam:$},le=await ne(Re),Te=re?y:j;return{data:{pages:Te(U.pages,le.data,ve),pageParams:Te(U.pageParams,$,ve)},meta:le.meta}};async function ne(U){let $;const{extraOptions:ve,argSchema:re,rawResponseSchema:Re,responseSchema:le}=A;if(re&&!Oe(L,"arg")&&(U=await Ie(re,U,"argSchema",{})),Q?$=Q():A.query?(Y=_(A,"transformResponse"),$=await t(A.query(U),G,ve)):$=await A.queryFn(U,G,ve,ue=>t(ue,G,ve)),typeof process<"u"&&process.env.NODE_ENV==="development"){const ue=A.query?"`baseQuery`":"`queryFn`";let de;if(!$)de=`${ue} did not return anything.`;else if(typeof $!="object")de=`${ue} did not return an object.`;else if($.error&&$.data)de=`${ue} returned an object containing both \`error\` and \`result\`.`;else if($.error===void 0&&$.data===void 0)de=`${ue} returned an object containing neither a valid \`error\` and \`result\`. At least one of them should not be \`undefined\``;else for(const Ee of Object.keys($))if(Ee!=="error"&&Ee!=="data"&&Ee!=="meta"){de=`The object returned by ${ue} has the unknown property ${Ee}.`;break}de&&console.error(`Error encountered handling the endpoint ${g.endpointName}.
36
36
  ${de}
37
37
  It needs to return an object with either the shape \`{ data: <value> }\` or \`{ error: <value> }\` that may contain an optional \`meta\` property.
38
- Object returned was:`,U)}if(U.error)throw new Vr(U.error,U.meta);let{data:Re}=U;De&&!je(F,"rawResponse")&&(Re=await Oe(De,U.data,"rawResponseSchema",U.meta));let we=await X(Re,U.meta,z);return le&&!je(F,"response")&&(we=await Oe(le,we,"responseSchema",U.meta)),{...U,data:we}}if(H&&"infiniteQueryOptions"in P){const{infiniteQueryOptions:z}=P,{maxPages:U=1/0}=z,ve=g.refetchCachedPages??z.refetchCachedPages??!0;let re;const De={pages:[],pageParams:[]},le=(K=o.selectQueryEntry($(),g.queryCacheKey))==null?void 0:K.data,we=S(g,$())&&!g.direction||!le?De:le;if("direction"in g&&g.direction&&we.pages.length){const ue=g.direction==="backward",Ee=(ue?Bi:Vn)(z,we,g.originalArgs);re=await Q(we,Ee,U,ue)}else{const{initialPageParam:ue=z.initialPageParam}=g,de=(le==null?void 0:le.pageParams)??[],Ee=de[0]??ue,_s=de.length;if(re=await Q(we,Ee,U),L&&(re={data:re.data.pages[0]}),ve)for(let cr=1;cr<_s;cr++){const js=Vn(z,re.data,g.originalArgs);re=await Q(re.data,js,U)}}W=re}else W=await te(g.originalArgs);return V&&!je(F,"meta")&&W.meta&&(W.meta=await Oe(V,W.meta,"metaSchema",W.meta)),A(W.data,He({fulfilledTimeStamp:Date.now(),baseQueryMeta:W.meta}))}catch(X){let G=X;if(G instanceof Vr){let L=_(P,"transformErrorResponse");const{rawErrorResponseSchema:W,errorResponseSchema:Q}=P;let{value:te,meta:z}=G;try{W&&!je(F,"rawErrorResponse")&&(te=await Oe(W,te,"rawErrorResponseSchema",z)),V&&!je(F,"meta")&&(z=await Oe(V,z,"metaSchema",z));let U=await L(te,z,g.originalArgs);return Q&&!je(F,"errorResponse")&&(U=await Oe(Q,U,"errorResponseSchema",z)),I(U,He({baseQueryMeta:z}))}catch(U){G=U}}try{if(G instanceof Hi){const L={endpoint:g.endpointName,arg:g.originalArgs,type:g.type,queryCacheKey:H?g.queryCacheKey:void 0};(B=P.onSchemaFailure)==null||B.call(P,G,L),a==null||a(G,L);const{catchSchemaFailure:W=c}=P;if(W)return I(W(G,L),He({baseQueryMeta:G._bqMeta}))}}catch(L){G=L}throw typeof process<"u"&&process.env.NODE_ENV!=="production"?console.error(`An unhandled error occurred processing a request for the endpoint "${g.endpointName}".
39
- In the case of an unhandled error, no tags will be "provided" or "invalidated".`,G):console.error(G),G}};function S(g,w){const k=o.selectQueryEntry(w,g.queryCacheKey),I=o.selectConfig(w).refetchOnMountOrArgChange,A=k==null?void 0:k.fulfilledTimeStamp,D=g.forceRefetch??(g.subscribe&&I);return D?D===!0||(Number(new Date)-Number(A))/1e3>=D:!1}const M=()=>Mr(`${e}/executeQuery`,m,{getPendingMeta({arg:w}){const k=n[w.endpointName];return He({startedTimeStamp:Date.now(),...Et(k)?{direction:w.direction}:{}})},condition(w,{getState:k}){var F;const I=k(),A=o.selectQueryEntry(I,w.queryCacheKey),D=A==null?void 0:A.fulfilledTimeStamp,$=w.originalArgs,R=A==null?void 0:A.originalArgs,P=n[w.endpointName],V=w.direction;return Tn(w)?!0:(A==null?void 0:A.status)==="pending"?!1:S(w,I)||cn(P)&&((F=P==null?void 0:P.forceRefetch)!=null&&F.call(P,{currentArg:$,previousArg:R,endpointState:A,state:I}))?!0:!(D&&!V)},dispatchConditionRejection:!0}),x=M(),v=M(),f=Mr(`${e}/executeMutation`,m,{getPendingMeta(){return He({startedTimeStamp:Date.now()})}}),d=g=>"force"in g,N=g=>"ifOlderThan"in g,O=(g,w,k={})=>(I,A)=>{const D=d(k)&&k.force,$=N(k)&&k.ifOlderThan,R=(V=!0)=>{const F={forceRefetch:V,subscribe:!1};return i.endpoints[g].initiate(w,F)},P=i.endpoints[g].select(w)(A());if(D)I(R());else if($){const V=P==null?void 0:P.fulfilledTimeStamp;if(!V){I(R());return}(Number(new Date)-Number(new Date(V)))/1e3>=$&&I(R())}else I(R(!1))};function C(g){return w=>{var k,I;return((I=(k=w==null?void 0:w.meta)==null?void 0:k.arg)==null?void 0:I.endpointName)===g}}function E(g,w){return{matchPending:nt(Kn(g),C(w)),matchFulfilled:nt(_e(g),C(w)),matchRejected:nt(Le(g),C(w))}}return{queryThunk:x,mutationThunk:f,infiniteQueryThunk:v,prefetch:O,updateQueryData:b,upsertQueryData:h,patchQueryData:l,buildMatchThunkActions:E}}function Vn(e,{pages:t,pageParams:n},r){const i=t.length-1;return e.getNextPageParam(t[i],t,n[i],n,r)}function Bi(e,{pages:t,pageParams:n},r){var i;return(i=e.getPreviousPageParam)==null?void 0:i.call(e,t[0],t,n[0],n,r)}function Ki(e,t,n,r){return er(n[e.meta.arg.endpointName][t],_e(e)?e.payload:void 0,on(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,r)}function $r(e){return ae(e)?Ni(e):e}function It(e,t,n){const r=e[t];r&&n(r)}function dt(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function Lr(e,t,n){const r=e[dt(t)];r&&n(r)}var Mt={};function Ta({reducerPath:e,queryThunk:t,mutationThunk:n,serializeQueryArgs:r,context:{endpointDefinitions:i,apiUid:s,extractRehydrationInfo:o,hasRehydrationInfo:a},assertTagType:c,config:u}){const l=me(`${e}/resetApiState`);function y(C,E,g,w){var k;C[k=E.queryCacheKey]??(C[k]={status:xe,endpointName:E.endpointName}),It(C,E.queryCacheKey,I=>{I.status=An,I.requestId=g&&I.requestId?I.requestId:w.requestId,E.originalArgs!==void 0&&(I.originalArgs=E.originalArgs),I.startedTimeStamp=w.startedTimeStamp;const A=i[w.arg.endpointName];Et(A)&&"direction"in E&&(I.direction=E.direction)})}function j(C,E,g,w){It(C,E.arg.queryCacheKey,k=>{if(k.requestId!==E.requestId&&!w)return;const{merge:I}=i[E.arg.endpointName];if(k.status=Xe,I)if(k.data!==void 0){const{fulfilledTimeStamp:A,arg:D,baseQueryMeta:$,requestId:R}=E;let P=xt(k.data,V=>I(V,g,{arg:D.originalArgs,baseQueryMeta:$,fulfilledTimeStamp:A,requestId:R}));k.data=P}else k.data=g;else k.data=i[E.arg.endpointName].structuralSharing??!0?Yn(ae(k.data)?lo(k.data):k.data,g):g;delete k.error,k.fulfilledTimeStamp=E.fulfilledTimeStamp})}const b=ke({name:`${e}/queries`,initialState:Mt,reducers:{removeQueryResult:{reducer(C,{payload:{queryCacheKey:E}}){delete C[E]},prepare:We()},cacheEntriesUpserted:{reducer(C,E){for(const g of E.payload){const{queryDescription:w,value:k}=g;y(C,w,!0,{arg:w,requestId:E.meta.requestId,startedTimeStamp:E.meta.timestamp}),j(C,{arg:w,requestId:E.meta.requestId,fulfilledTimeStamp:E.meta.timestamp,baseQueryMeta:{}},k,!0)}},prepare:C=>({payload:C.map(w=>{const{endpointName:k,arg:I,value:A}=w,D=i[k];return{queryDescription:{type:wt,endpointName:k,originalArgs:w.arg,queryCacheKey:r({queryArgs:I,endpointDefinition:D,endpointName:k})},value:A}}),meta:{[rn]:!0,requestId:Gn(),timestamp:Date.now()}})},queryResultPatched:{reducer(C,{payload:{queryCacheKey:E,patches:g}}){It(C,E,w=>{w.data=Sr(w.data,g.concat())})},prepare:We()}},extraReducers(C){C.addCase(t.pending,(E,{meta:g,meta:{arg:w}})=>{const k=Tn(w);y(E,w,k,g)}).addCase(t.fulfilled,(E,{meta:g,payload:w})=>{const k=Tn(g.arg);j(E,g,w,k)}).addCase(t.rejected,(E,{meta:{condition:g,arg:w,requestId:k},error:I,payload:A})=>{It(E,w.queryCacheKey,D=>{if(!g){if(D.requestId!==k)return;D.status=Je,D.error=A??I}})}).addMatcher(a,(E,g)=>{const{queries:w}=o(g);for(const[k,I]of Object.entries(w))((I==null?void 0:I.status)===Xe||(I==null?void 0:I.status)===Je)&&(E[k]=I)})}}),h=ke({name:`${e}/mutations`,initialState:Mt,reducers:{removeMutationResult:{reducer(C,{payload:E}){const g=dt(E);g in C&&delete C[g]},prepare:We()}},extraReducers(C){C.addCase(n.pending,(E,{meta:g,meta:{requestId:w,arg:k,startedTimeStamp:I}})=>{k.track&&(E[dt(g)]={requestId:w,status:An,endpointName:k.endpointName,startedTimeStamp:I})}).addCase(n.fulfilled,(E,{payload:g,meta:w})=>{w.arg.track&&Lr(E,w,k=>{k.requestId===w.requestId&&(k.status=Xe,k.data=g,k.fulfilledTimeStamp=w.fulfilledTimeStamp)})}).addCase(n.rejected,(E,{payload:g,error:w,meta:k})=>{k.arg.track&&Lr(E,k,I=>{I.requestId===k.requestId&&(I.status=Je,I.error=g??w)})}).addMatcher(a,(E,g)=>{const{mutations:w}=o(g);for(const[k,I]of Object.entries(w))((I==null?void 0:I.status)===Xe||(I==null?void 0:I.status)===Je)&&k!==(I==null?void 0:I.requestId)&&(E[k]=I)})}}),_={tags:{},keys:{}},m=ke({name:`${e}/invalidation`,initialState:_,reducers:{updateProvidedBy:{reducer(C,E){var g,w,k;for(const{queryCacheKey:I,providedTags:A}of E.payload){S(C,I);for(const{type:D,id:$}of A){const R=(w=(g=C.tags)[D]??(g[D]={}))[k=$||"__internal_without_id"]??(w[k]=[]);R.includes(I)||R.push(I)}C.keys[I]=A}},prepare:We()}},extraReducers(C){C.addCase(b.actions.removeQueryResult,(E,{payload:{queryCacheKey:g}})=>{S(E,g)}).addMatcher(a,(E,g)=>{var k,I,A;const{provided:w}=o(g);for(const[D,$]of Object.entries(w.tags??{}))for(const[R,P]of Object.entries($)){const V=(I=(k=E.tags)[D]??(k[D]={}))[A=R||"__internal_without_id"]??(I[A]=[]);for(const F of P)V.includes(F)||V.push(F),E.keys[F]=w.keys[F]}}).addMatcher(be(_e(t),on(t)),(E,g)=>{M(E,[g])}).addMatcher(b.actions.cacheEntriesUpserted.match,(E,g)=>{const w=g.payload.map(({queryDescription:k,value:I})=>({type:"UNKNOWN",payload:I,meta:{requestStatus:"fulfilled",requestId:"UNKNOWN",arg:k}}));M(E,w)})}});function S(C,E){var w;const g=$r(C.keys[E]??[]);for(const k of g){const I=k.type,A=k.id??"__internal_without_id",D=(w=C.tags[I])==null?void 0:w[A];D&&(C.tags[I][A]=$r(D).filter($=>$!==E))}delete C.keys[E]}function M(C,E){const g=E.map(w=>{const k=Ki(w,"providesTags",i,c),{queryCacheKey:I}=w.meta.arg;return{queryCacheKey:I,providedTags:k}});m.caseReducers.updateProvidedBy(C,m.actions.updateProvidedBy(g))}const x=ke({name:`${e}/subscriptions`,initialState:Mt,reducers:{updateSubscriptionOptions(C,E){},unsubscribeQueryResult(C,E){},internal_getRTKQSubscriptions(){}}}),v=ke({name:`${e}/internalSubscriptions`,initialState:Mt,reducers:{subscriptionsUpdated:{reducer(C,E){return Sr(C,E.payload)},prepare:We()}}}),f=ke({name:`${e}/config`,initialState:{online:xa(),focused:ba(),middlewareRegistered:!1,...u},reducers:{middlewareRegistered(C,{payload:E}){C.middlewareRegistered=C.middlewareRegistered==="conflict"||s!==E?"conflict":!0}},extraReducers:C=>{C.addCase(Zn,E=>{E.online=!0}).addCase(Ui,E=>{E.online=!1}).addCase(Jn,E=>{E.focused=!0}).addCase(Qi,E=>{E.focused=!1}).addMatcher(a,E=>({...E}))}}),d=gi({queries:b.reducer,mutations:h.reducer,provided:m.reducer,subscriptions:v.reducer,config:f.reducer}),N=(C,E)=>d(l.match(E)?void 0:C,E),O={...f.actions,...b.actions,...x.actions,...v.actions,...h.actions,...m.actions,resetApiState:l};return{reducer:N,actions:O}}var fe=Symbol.for("RTKQ/skipToken"),Gi={status:xe},Qr=xt(Gi,()=>{}),Ur=xt(Gi,()=>{});function Va({serializeQueryArgs:e,reducerPath:t,createSelector:n}){const r=x=>Qr,i=x=>Ur;return{buildQuerySelector:j,buildInfiniteQuerySelector:b,buildMutationSelector:h,selectInvalidatedBy:_,selectCachedArgsForQuery:m,selectApiState:o,selectQueries:a,selectMutations:u,selectQueryEntry:c,selectConfig:l};function s(x){return{...x,...Pr(x.status)}}function o(x){const v=x[t];if(process.env.NODE_ENV!=="production"&&!v){if(o.triggered)return v;o.triggered=!0,console.error(`Error: No data found at \`state.${t}\`. Did you forget to add the reducer to the store?`)}return v}function a(x){var v;return(v=o(x))==null?void 0:v.queries}function c(x,v){var f;return(f=a(x))==null?void 0:f[v]}function u(x){var v;return(v=o(x))==null?void 0:v.mutations}function l(x){var v;return(v=o(x))==null?void 0:v.config}function y(x,v,f){return d=>{if(d===fe)return n(r,f);const N=e({queryArgs:d,endpointDefinition:v,endpointName:x});return n(C=>c(C,N)??Qr,f)}}function j(x,v){return y(x,v,s)}function b(x,v){const{infiniteQueryOptions:f}=v;function d(N){const O={...N,...Pr(N.status)},{isLoading:C,isError:E,direction:g}=O,w=g==="forward",k=g==="backward";return{...O,hasNextPage:S(f,O.data,O.originalArgs),hasPreviousPage:M(f,O.data,O.originalArgs),isFetchingNextPage:C&&w,isFetchingPreviousPage:C&&k,isFetchNextPageError:E&&w,isFetchPreviousPageError:E&&k}}return y(x,v,d)}function h(){return(x=>{let v;return typeof x=="object"?v=dt(x)??fe:v=x,n(v===fe?i:N=>{var O,C;return((C=(O=o(N))==null?void 0:O.mutations)==null?void 0:C[v])??Ur},s)})}function _(x,v){const f=x[t],d=new Set,N=Dn(v,Xn,Wi);for(const O of N){const C=f.provided.tags[O.type];if(!C)continue;let E=(O.id!==void 0?C[O.id]:Object.values(C).flat())??[];for(const g of E)d.add(g)}return Array.from(d.values()).flatMap(O=>{const C=f.queries[O];return C?{queryCacheKey:O,endpointName:C.endpointName,originalArgs:C.originalArgs}:[]})}function m(x,v){return Dn(Object.values(a(x)),f=>(f==null?void 0:f.endpointName)===v&&f.status!==xe,f=>f.originalArgs)}function S(x,v,f){return v?Vn(x,v,f)!=null:!1}function M(x,v,f){return!v||!x.getPreviousPageParam?!1:Bi(x,v,f)!=null}}var Te=WeakMap?new WeakMap:void 0,qr=({endpointName:e,queryArgs:t})=>{let n="";const r=Te==null?void 0:Te.get(t);if(typeof r=="string")n=r;else{const i=JSON.stringify(t,(s,o)=>(o=typeof o=="bigint"?{$bigint:o.toString()}:o,o=pe(o)?Object.keys(o).sort().reduce((a,c)=>(a[c]=o[c],a),{}):o,o));pe(t)&&(Te==null||Te.set(t,i)),n=i}return`${e}(${n})`};function Yi(...e){return function(n){const r=Bt(u=>{var l;return(l=n.extractRehydrationInfo)==null?void 0:l.call(n,u,{reducerPath:n.reducerPath??"api"})}),i={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...n,extractRehydrationInfo:r,serializeQueryArgs(u){let l=qr;if("serializeQueryArgs"in u.endpointDefinition){const y=u.endpointDefinition.serializeQueryArgs;l=j=>{const b=y(j);return typeof b=="string"?b:qr({...j,queryArgs:b})}}else n.serializeQueryArgs&&(l=n.serializeQueryArgs);return l(u)},tagTypes:[...n.tagTypes||[]]},s={endpointDefinitions:{},batch(u){u()},apiUid:Gn(),extractRehydrationInfo:r,hasRehydrationInfo:Bt(u=>r(u)!=null)},o={injectEndpoints:c,enhanceEndpoints({addTagTypes:u,endpoints:l}){if(u)for(const y of u)i.tagTypes.includes(y)||i.tagTypes.push(y);if(l)for(const[y,j]of Object.entries(l))typeof j=="function"?j(Qe(s,y)):Object.assign(Qe(s,y)||{},j);return o}},a=e.map(u=>u.init(o,i,s));function c(u){const l=u.endpoints({query:y=>({...y,type:wt}),mutation:y=>({...y,type:qi}),infiniteQuery:y=>({...y,type:zi})});for(const[y,j]of Object.entries(l)){if(u.overrideExisting!==!0&&y in s.endpointDefinitions){if(u.overrideExisting==="throw")throw new Error(process.env.NODE_ENV==="production"?q(39):`called \`injectEndpoints\` to override already-existing endpointName ${y} without specifying \`overrideExisting: true\``);typeof process<"u"&&process.env.NODE_ENV==="development"&&console.error(`called \`injectEndpoints\` to override already-existing endpointName ${y} without specifying \`overrideExisting: true\``);continue}if(typeof process<"u"&&process.env.NODE_ENV==="development"&&Et(j)){const{infiniteQueryOptions:b}=j,{maxPages:h,getPreviousPageParam:_}=b;if(typeof h=="number"){if(h<1)throw new Error(process.env.NODE_ENV==="production"?q(40):`maxPages for endpoint '${y}' must be a number greater than 0`);if(typeof _!="function")throw new Error(process.env.NODE_ENV==="production"?q(41):`getPreviousPageParam for endpoint '${y}' must be a function if maxPages is used`)}}s.endpointDefinitions[y]=j;for(const b of a)b.injectEndpoint(y,j)}return o}return o.injectEndpoints({endpoints:n.endpoints})}}function he(e,...t){return Object.assign(e,...t)}var Fa=({api:e,queryThunk:t,internalState:n,mwApi:r})=>{const i=`${e.reducerPath}/subscriptions`;let s=null,o=null;const{updateSubscriptionOptions:a,unsubscribeQueryResult:c}=e.internalActions,u=(_,m)=>{if(a.match(m)){const{queryCacheKey:M,requestId:x,options:v}=m.payload,f=_.get(M);return f!=null&&f.has(x)&&f.set(x,v),!0}if(c.match(m)){const{queryCacheKey:M,requestId:x}=m.payload,v=_.get(M);return v&&v.delete(x),!0}if(e.internalActions.removeQueryResult.match(m))return _.delete(m.payload.queryCacheKey),!0;if(t.pending.match(m)){const{meta:{arg:M,requestId:x}}=m,v=Kt(_,M.queryCacheKey,Rn);return M.subscribe&&v.set(x,M.subscriptionOptions??v.get(x)??{}),!0}let S=!1;if(t.rejected.match(m)){const{meta:{condition:M,arg:x,requestId:v}}=m;if(M&&x.subscribe){const f=Kt(_,x.queryCacheKey,Rn);f.set(v,x.subscriptionOptions??f.get(v)??{}),S=!0}}return S},l=()=>n.currentSubscriptions,b={getSubscriptions:l,getSubscriptionCount:_=>{const S=l().get(_);return(S==null?void 0:S.size)??0},isRequestSubscribed:(_,m)=>{var M;const S=l();return!!((M=S==null?void 0:S.get(_))!=null&&M.get(m))}};function h(_){return JSON.parse(JSON.stringify(Object.fromEntries([..._].map(([m,S])=>[m,Object.fromEntries(S)]))))}return(_,m)=>{if(s||(s=h(n.currentSubscriptions)),e.util.resetApiState.match(_))return s={},n.currentSubscriptions.clear(),o=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(_))return[!1,b];const S=u(n.currentSubscriptions,_);let M=!0;if(process.env.NODE_ENV==="test"&&typeof _.type=="string"&&_.type===`${e.reducerPath}/getPolling`)return[!1,n.currentPolls];if(S){o||(o=setTimeout(()=>{const f=h(n.currentSubscriptions),[,d]=_i(s,()=>f);m.next(e.internalActions.subscriptionsUpdated(d)),s=f,o=null},500));const x=typeof _.type=="string"&&!!_.type.startsWith(i),v=t.rejected.match(_)&&_.meta.condition&&!!_.meta.arg.subscribe;M=!x&&!v}return[M,!1]}},$a=2147483647/1e3-1,La=({reducerPath:e,api:t,queryThunk:n,context:r,internalState:i,selectors:{selectQueryEntry:s,selectConfig:o},getRunningQueryThunk:a,mwApi:c})=>{const{removeQueryResult:u,unsubscribeQueryResult:l,cacheEntriesUpserted:y}=t.internalActions,j=be(l.match,n.fulfilled,n.rejected,y.match);function b(x){const v=i.currentSubscriptions.get(x);return v?v.size>0:!1}const h={};function _(x){var v;for(const f of x.values())(v=f==null?void 0:f.abort)==null||v.call(f)}const m=(x,v)=>{const f=v.getState(),d=o(f);if(j(x)){let N;if(y.match(x))N=x.payload.map(O=>O.queryDescription.queryCacheKey);else{const{queryCacheKey:O}=l.match(x)?x.payload:x.meta.arg;N=[O]}S(N,v,d)}if(t.util.resetApiState.match(x)){for(const[N,O]of Object.entries(h))O&&clearTimeout(O),delete h[N];_(i.runningQueries),_(i.runningMutations)}if(r.hasRehydrationInfo(x)){const{queries:N}=r.extractRehydrationInfo(x);S(Object.keys(N),v,d)}};function S(x,v,f){const d=v.getState();for(const N of x){const O=s(d,N);O!=null&&O.endpointName&&M(N,O.endpointName,v,f)}}function M(x,v,f,d){const N=Qe(r,v),O=(N==null?void 0:N.keepUnusedDataFor)??d.keepUnusedDataFor;if(O===1/0)return;const C=Math.max(0,Math.min(O,$a));if(!b(x)){const E=h[x];E&&clearTimeout(E),h[x]=setTimeout(()=>{if(!b(x)){const g=s(f.getState(),x);if(g!=null&&g.endpointName){const w=f.dispatch(a(g.endpointName,g.originalArgs));w==null||w.abort()}f.dispatch(u({queryCacheKey:x}))}delete h[x]},C*1e3)}}return m},zr=new Error("Promise never resolved before cacheEntryRemoved."),Qa=({api:e,reducerPath:t,context:n,queryThunk:r,mutationThunk:i,internalState:s,selectors:{selectQueryEntry:o,selectApiState:a}})=>{const c=Pn(r),u=Pn(i),l=_e(r,i),y={},{removeQueryResult:j,removeMutationResult:b,cacheEntriesUpserted:h}=e.internalActions;function _(f,d,N){const O=y[f];O!=null&&O.valueResolved&&(O.valueResolved({data:d,meta:N}),delete O.valueResolved)}function m(f){const d=y[f];d&&(delete y[f],d.cacheEntryRemoved())}function S(f){const{arg:d,requestId:N}=f.meta,{endpointName:O,originalArgs:C}=d;return[O,C,N]}const M=(f,d,N)=>{const O=x(f);function C(E,g,w,k){const I=o(N,g),A=o(d.getState(),g);!I&&A&&v(E,k,g,d,w)}if(r.pending.match(f)){const[E,g,w]=S(f);C(E,O,w,g)}else if(h.match(f))for(const{queryDescription:E,value:g}of f.payload){const{endpointName:w,originalArgs:k,queryCacheKey:I}=E;C(w,I,f.meta.requestId,k),_(I,g,{})}else if(i.pending.match(f)){if(d.getState()[t].mutations[O]){const[g,w,k]=S(f);v(g,w,O,d,k)}}else if(l(f))_(O,f.payload,f.meta.baseQueryMeta);else if(j.match(f)||b.match(f))m(O);else if(e.util.resetApiState.match(f))for(const E of Object.keys(y))m(E)};function x(f){return c(f)?f.meta.arg.queryCacheKey:u(f)?f.meta.arg.fixedCacheKey??f.meta.requestId:j.match(f)?f.payload.queryCacheKey:b.match(f)?dt(f.payload):""}function v(f,d,N,O,C){const E=Qe(n,f),g=E==null?void 0:E.onCacheEntryAdded;if(!g)return;const w={},k=new Promise(P=>{w.cacheEntryRemoved=P}),I=Promise.race([new Promise(P=>{w.valueResolved=P}),k.then(()=>{throw zr})]);I.catch(()=>{}),y[N]=w;const A=e.endpoints[f].select(Gt(E)?d:N),D=O.dispatch((P,V,F)=>F),$={...O,getCacheEntry:()=>A(O.getState()),requestId:C,extra:D,updateCachedData:Gt(E)?P=>O.dispatch(e.util.updateQueryData(f,d,P)):void 0,cacheDataLoaded:I,cacheEntryRemoved:k},R=g(d,$);Promise.resolve(R).catch(P=>{if(P!==zr)throw P})}return M},Ua=({api:e,context:{apiUid:t},reducerPath:n})=>(r,i)=>{var s,o;e.util.resetApiState.match(r)&&i.dispatch(e.internalActions.middlewareRegistered(t)),typeof process<"u"&&process.env.NODE_ENV==="development"&&e.internalActions.middlewareRegistered.match(r)&&r.payload===t&&((o=(s=i.getState()[n])==null?void 0:s.config)==null?void 0:o.middlewareRegistered)==="conflict"&&console.warn(`There is a mismatch between slice and middleware for the reducerPath "${n}".
38
+ Object returned was:`,$)}if($.error)throw new Fr($.error,$.meta);let{data:Te}=$;Re&&!Oe(L,"rawResponse")&&(Te=await Ie(Re,$.data,"rawResponseSchema",$.meta));let we=await Y(Te,$.meta,U);return le&&!Oe(L,"response")&&(we=await Ie(le,we,"responseSchema",$.meta)),{...$,data:we}}if(H&&"infiniteQueryOptions"in A){const{infiniteQueryOptions:U}=A,{maxPages:$=1/0}=U,ve=g.refetchCachedPages??U.refetchCachedPages??!0;let re;const Re={pages:[],pageParams:[]},le=(K=o.selectQueryEntry(F(),g.queryCacheKey))==null?void 0:K.data,we=S(g,F())&&!g.direction||!le?Re:le;if("direction"in g&&g.direction&&we.pages.length){const ue=g.direction==="backward",Ee=(ue?Gi:Rn)(U,we,g.originalArgs);re=await z(we,Ee,$,ue)}else{const{initialPageParam:ue=U.initialPageParam}=g,de=(le==null?void 0:le.pageParams)??[],Ee=de[0]??ue,ks=de.length;if(re=await z(we,Ee,$),Q&&(re={data:re.data.pages[0]}),ve)for(let lr=1;lr<ks;lr++){const Ms=Rn(U,re.data,g.originalArgs);re=await z(re.data,Ms,$)}}W=re}else W=await ne(g.originalArgs);return V&&!Oe(L,"meta")&&W.meta&&(W.meta=await Ie(V,W.meta,"metaSchema",W.meta)),P(W.data,He({fulfilledTimeStamp:Date.now(),baseQueryMeta:W.meta}))}catch(Y){let G=Y;if(G instanceof Fr){let Q=_(A,"transformErrorResponse");const{rawErrorResponseSchema:W,errorResponseSchema:z}=A;let{value:ne,meta:U}=G;try{W&&!Oe(L,"rawErrorResponse")&&(ne=await Ie(W,ne,"rawErrorResponseSchema",U)),V&&!Oe(L,"meta")&&(U=await Ie(V,U,"metaSchema",U));let $=await Q(ne,U,g.originalArgs);return z&&!Oe(L,"errorResponse")&&($=await Ie(z,$,"errorResponseSchema",U)),k($,He({baseQueryMeta:U}))}catch($){G=$}}try{if(G instanceof Ki){const Q={endpoint:g.endpointName,arg:g.originalArgs,type:g.type,queryCacheKey:H?g.queryCacheKey:void 0};(B=A.onSchemaFailure)==null||B.call(A,G,Q),a==null||a(G,Q);const{catchSchemaFailure:W=c}=A;if(W)return k(W(G,Q),He({baseQueryMeta:G._bqMeta}))}}catch(Q){G=Q}throw typeof process<"u"&&process.env.NODE_ENV!=="production"?console.error(`An unhandled error occurred processing a request for the endpoint "${g.endpointName}".
39
+ In the case of an unhandled error, no tags will be "provided" or "invalidated".`,G):console.error(G),G}};function S(g,w){const I=o.selectQueryEntry(w,g.queryCacheKey),k=o.selectConfig(w).refetchOnMountOrArgChange,P=I==null?void 0:I.fulfilledTimeStamp,D=g.forceRefetch??(g.subscribe&&k);return D?D===!0||(Number(new Date)-Number(P))/1e3>=D:!1}const M=()=>Pr(`${e}/executeQuery`,m,{getPendingMeta({arg:w}){const I=n[w.endpointName];return He({startedTimeStamp:Date.now(),...Et(I)?{direction:w.direction}:{}})},condition(w,{getState:I}){var L;const k=I(),P=o.selectQueryEntry(k,w.queryCacheKey),D=P==null?void 0:P.fulfilledTimeStamp,F=w.originalArgs,R=P==null?void 0:P.originalArgs,A=n[w.endpointName],V=w.direction;return Dn(w)?!0:(P==null?void 0:P.status)==="pending"?!1:S(w,k)||on(A)&&((L=A==null?void 0:A.forceRefetch)!=null&&L.call(A,{currentArg:F,previousArg:R,endpointState:P,state:k}))?!0:!(D&&!V)},dispatchConditionRejection:!0}),x=M(),v=M(),f=Pr(`${e}/executeMutation`,m,{getPendingMeta(){return He({startedTimeStamp:Date.now()})}}),d=g=>"force"in g,N=g=>"ifOlderThan"in g,O=(g,w,I={})=>(k,P)=>{const D=d(I)&&I.force,F=N(I)&&I.ifOlderThan,R=(V=!0)=>{const L={forceRefetch:V,subscribe:!1};return i.endpoints[g].initiate(w,L)},A=i.endpoints[g].select(w)(P());if(D)k(R());else if(F){const V=A==null?void 0:A.fulfilledTimeStamp;if(!V){k(R());return}(Number(new Date)-Number(new Date(V)))/1e3>=F&&k(R())}else k(R(!1))};function C(g){return w=>{var I,k;return((k=(I=w==null?void 0:w.meta)==null?void 0:I.arg)==null?void 0:k.endpointName)===g}}function E(g,w){return{matchPending:nt(Kn(g),C(w)),matchFulfilled:nt(_e(g),C(w)),matchRejected:nt(ze(g),C(w))}}return{queryThunk:x,mutationThunk:f,infiniteQueryThunk:v,prefetch:O,updateQueryData:b,upsertQueryData:h,patchQueryData:l,buildMatchThunkActions:E}}function Rn(e,{pages:t,pageParams:n},r){const i=t.length-1;return e.getNextPageParam(t[i],t,n[i],n,r)}function Gi(e,{pages:t,pageParams:n},r){var i;return(i=e.getPreviousPageParam)==null?void 0:i.call(e,t[0],t,n[0],n,r)}function Yi(e,t,n,r){return er(n[e.meta.arg.endpointName][t],_e(e)?e.payload:void 0,rn(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,r)}function zr(e){return ae(e)?_i(e):e}function kt(e,t,n){const r=e[t];r&&n(r)}function dt(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function $r(e,t,n){const r=e[dt(t)];r&&n(r)}var Mt={};function Qa({reducerPath:e,queryThunk:t,mutationThunk:n,serializeQueryArgs:r,context:{endpointDefinitions:i,apiUid:s,extractRehydrationInfo:o,hasRehydrationInfo:a},assertTagType:c,config:u}){const l=me(`${e}/resetApiState`);function y(C,E,g,w){var I;C[I=E.queryCacheKey]??(C[I]={status:xe,endpointName:E.endpointName}),kt(C,E.queryCacheKey,k=>{k.status=Mn,k.requestId=g&&k.requestId?k.requestId:w.requestId,E.originalArgs!==void 0&&(k.originalArgs=E.originalArgs),k.startedTimeStamp=w.startedTimeStamp;const P=i[w.arg.endpointName];Et(P)&&"direction"in E&&(k.direction=E.direction)})}function j(C,E,g,w){kt(C,E.arg.queryCacheKey,I=>{if(I.requestId!==E.requestId&&!w)return;const{merge:k}=i[E.arg.endpointName];if(I.status=Xe,k)if(I.data!==void 0){const{fulfilledTimeStamp:P,arg:D,baseQueryMeta:F,requestId:R}=E;let A=xt(I.data,V=>k(V,g,{arg:D.originalArgs,baseQueryMeta:F,fulfilledTimeStamp:P,requestId:R}));I.data=A}else I.data=g;else I.data=i[E.arg.endpointName].structuralSharing??!0?Yn(ae(I.data)?ho(I.data):I.data,g):g;delete I.error,I.fulfilledTimeStamp=E.fulfilledTimeStamp})}const b=ke({name:`${e}/queries`,initialState:Mt,reducers:{removeQueryResult:{reducer(C,{payload:{queryCacheKey:E}}){delete C[E]},prepare:We()},cacheEntriesUpserted:{reducer(C,E){for(const g of E.payload){const{queryDescription:w,value:I}=g;y(C,w,!0,{arg:w,requestId:E.meta.requestId,startedTimeStamp:E.meta.timestamp}),j(C,{arg:w,requestId:E.meta.requestId,fulfilledTimeStamp:E.meta.timestamp,baseQueryMeta:{}},I,!0)}},prepare:C=>({payload:C.map(w=>{const{endpointName:I,arg:k,value:P}=w,D=i[I];return{queryDescription:{type:wt,endpointName:I,originalArgs:w.arg,queryCacheKey:r({queryArgs:k,endpointDefinition:D,endpointName:I})},value:P}}),meta:{[tn]:!0,requestId:Gn(),timestamp:Date.now()}})},queryResultPatched:{reducer(C,{payload:{queryCacheKey:E,patches:g}}){kt(C,E,w=>{w.data=Cr(w.data,g.concat())})},prepare:We()}},extraReducers(C){C.addCase(t.pending,(E,{meta:g,meta:{arg:w}})=>{const I=Dn(w);y(E,w,I,g)}).addCase(t.fulfilled,(E,{meta:g,payload:w})=>{const I=Dn(g.arg);j(E,g,w,I)}).addCase(t.rejected,(E,{meta:{condition:g,arg:w,requestId:I},error:k,payload:P})=>{kt(E,w.queryCacheKey,D=>{if(!g){if(D.requestId!==I)return;D.status=Ze,D.error=P??k}})}).addMatcher(a,(E,g)=>{const{queries:w}=o(g);for(const[I,k]of Object.entries(w))((k==null?void 0:k.status)===Xe||(k==null?void 0:k.status)===Ze)&&(E[I]=k)})}}),h=ke({name:`${e}/mutations`,initialState:Mt,reducers:{removeMutationResult:{reducer(C,{payload:E}){const g=dt(E);g in C&&delete C[g]},prepare:We()}},extraReducers(C){C.addCase(n.pending,(E,{meta:g,meta:{requestId:w,arg:I,startedTimeStamp:k}})=>{I.track&&(E[dt(g)]={requestId:w,status:Mn,endpointName:I.endpointName,startedTimeStamp:k})}).addCase(n.fulfilled,(E,{payload:g,meta:w})=>{w.arg.track&&$r(E,w,I=>{I.requestId===w.requestId&&(I.status=Xe,I.data=g,I.fulfilledTimeStamp=w.fulfilledTimeStamp)})}).addCase(n.rejected,(E,{payload:g,error:w,meta:I})=>{I.arg.track&&$r(E,I,k=>{k.requestId===I.requestId&&(k.status=Ze,k.error=g??w)})}).addMatcher(a,(E,g)=>{const{mutations:w}=o(g);for(const[I,k]of Object.entries(w))((k==null?void 0:k.status)===Xe||(k==null?void 0:k.status)===Ze)&&I!==(k==null?void 0:k.requestId)&&(E[I]=k)})}}),_={tags:{},keys:{}},m=ke({name:`${e}/invalidation`,initialState:_,reducers:{updateProvidedBy:{reducer(C,E){var g,w,I;for(const{queryCacheKey:k,providedTags:P}of E.payload){S(C,k);for(const{type:D,id:F}of P){const R=(w=(g=C.tags)[D]??(g[D]={}))[I=F||"__internal_without_id"]??(w[I]=[]);R.includes(k)||R.push(k)}C.keys[k]=P}},prepare:We()}},extraReducers(C){C.addCase(b.actions.removeQueryResult,(E,{payload:{queryCacheKey:g}})=>{S(E,g)}).addMatcher(a,(E,g)=>{var I,k,P;const{provided:w}=o(g);for(const[D,F]of Object.entries(w.tags??{}))for(const[R,A]of Object.entries(F)){const V=(k=(I=E.tags)[D]??(I[D]={}))[P=R||"__internal_without_id"]??(k[P]=[]);for(const L of A)V.includes(L)||V.push(L),E.keys[L]=w.keys[L]}}).addMatcher(be(_e(t),rn(t)),(E,g)=>{M(E,[g])}).addMatcher(b.actions.cacheEntriesUpserted.match,(E,g)=>{const w=g.payload.map(({queryDescription:I,value:k})=>({type:"UNKNOWN",payload:k,meta:{requestStatus:"fulfilled",requestId:"UNKNOWN",arg:I}}));M(E,w)})}});function S(C,E){var w;const g=zr(C.keys[E]??[]);for(const I of g){const k=I.type,P=I.id??"__internal_without_id",D=(w=C.tags[k])==null?void 0:w[P];D&&(C.tags[k][P]=zr(D).filter(F=>F!==E))}delete C.keys[E]}function M(C,E){const g=E.map(w=>{const I=Yi(w,"providesTags",i,c),{queryCacheKey:k}=w.meta.arg;return{queryCacheKey:k,providedTags:I}});m.caseReducers.updateProvidedBy(C,m.actions.updateProvidedBy(g))}const x=ke({name:`${e}/subscriptions`,initialState:Mt,reducers:{updateSubscriptionOptions(C,E){},unsubscribeQueryResult(C,E){},internal_getRTKQSubscriptions(){}}}),v=ke({name:`${e}/internalSubscriptions`,initialState:Mt,reducers:{subscriptionsUpdated:{reducer(C,E){return Cr(C,E.payload)},prepare:We()}}}),f=ke({name:`${e}/config`,initialState:{online:Sa(),focused:Ea(),middlewareRegistered:!1,...u},reducers:{middlewareRegistered(C,{payload:E}){C.middlewareRegistered=C.middlewareRegistered==="conflict"||s!==E?"conflict":!0}},extraReducers:C=>{C.addCase(Jn,E=>{E.online=!0}).addCase(Ui,E=>{E.online=!1}).addCase(Zn,E=>{E.focused=!0}).addCase(qi,E=>{E.focused=!1}).addMatcher(a,E=>({...E}))}}),d=bi({queries:b.reducer,mutations:h.reducer,provided:m.reducer,subscriptions:v.reducer,config:f.reducer}),N=(C,E)=>d(l.match(E)?void 0:C,E),O={...f.actions,...b.actions,...x.actions,...v.actions,...h.actions,...m.actions,resetApiState:l};return{reducer:N,actions:O}}var fe=Symbol.for("RTKQ/skipToken"),Xi={status:xe},qr=xt(Xi,()=>{}),Ur=xt(Xi,()=>{});function za({serializeQueryArgs:e,reducerPath:t,createSelector:n}){const r=x=>qr,i=x=>Ur;return{buildQuerySelector:j,buildInfiniteQuerySelector:b,buildMutationSelector:h,selectInvalidatedBy:_,selectCachedArgsForQuery:m,selectApiState:o,selectQueries:a,selectMutations:u,selectQueryEntry:c,selectConfig:l};function s(x){return{...x,...Dr(x.status)}}function o(x){const v=x[t];if(process.env.NODE_ENV!=="production"&&!v){if(o.triggered)return v;o.triggered=!0,console.error(`Error: No data found at \`state.${t}\`. Did you forget to add the reducer to the store?`)}return v}function a(x){var v;return(v=o(x))==null?void 0:v.queries}function c(x,v){var f;return(f=a(x))==null?void 0:f[v]}function u(x){var v;return(v=o(x))==null?void 0:v.mutations}function l(x){var v;return(v=o(x))==null?void 0:v.config}function y(x,v,f){return d=>{if(d===fe)return n(r,f);const N=e({queryArgs:d,endpointDefinition:v,endpointName:x});return n(C=>c(C,N)??qr,f)}}function j(x,v){return y(x,v,s)}function b(x,v){const{infiniteQueryOptions:f}=v;function d(N){const O={...N,...Dr(N.status)},{isLoading:C,isError:E,direction:g}=O,w=g==="forward",I=g==="backward";return{...O,hasNextPage:S(f,O.data,O.originalArgs),hasPreviousPage:M(f,O.data,O.originalArgs),isFetchingNextPage:C&&w,isFetchingPreviousPage:C&&I,isFetchNextPageError:E&&w,isFetchPreviousPageError:E&&I}}return y(x,v,d)}function h(){return(x=>{let v;return typeof x=="object"?v=dt(x)??fe:v=x,n(v===fe?i:N=>{var O,C;return((C=(O=o(N))==null?void 0:O.mutations)==null?void 0:C[v])??Ur},s)})}function _(x,v){const f=x[t],d=new Set,N=An(v,Xn,Bi);for(const O of N){const C=f.provided.tags[O.type];if(!C)continue;let E=(O.id!==void 0?C[O.id]:Object.values(C).flat())??[];for(const g of E)d.add(g)}return Array.from(d.values()).flatMap(O=>{const C=f.queries[O];return C?{queryCacheKey:O,endpointName:C.endpointName,originalArgs:C.originalArgs}:[]})}function m(x,v){return An(Object.values(a(x)),f=>(f==null?void 0:f.endpointName)===v&&f.status!==xe,f=>f.originalArgs)}function S(x,v,f){return v?Rn(x,v,f)!=null:!1}function M(x,v,f){return!v||!x.getPreviousPageParam?!1:Gi(x,v,f)!=null}}var Ve=WeakMap?new WeakMap:void 0,Wr=({endpointName:e,queryArgs:t})=>{let n="";const r=Ve==null?void 0:Ve.get(t);if(typeof r=="string")n=r;else{const i=JSON.stringify(t,(s,o)=>(o=typeof o=="bigint"?{$bigint:o.toString()}:o,o=pe(o)?Object.keys(o).sort().reduce((a,c)=>(a[c]=o[c],a),{}):o,o));pe(t)&&(Ve==null||Ve.set(t,i)),n=i}return`${e}(${n})`};function Zi(...e){return function(n){const r=Bt(u=>{var l;return(l=n.extractRehydrationInfo)==null?void 0:l.call(n,u,{reducerPath:n.reducerPath??"api"})}),i={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...n,extractRehydrationInfo:r,serializeQueryArgs(u){let l=Wr;if("serializeQueryArgs"in u.endpointDefinition){const y=u.endpointDefinition.serializeQueryArgs;l=j=>{const b=y(j);return typeof b=="string"?b:Wr({...j,queryArgs:b})}}else n.serializeQueryArgs&&(l=n.serializeQueryArgs);return l(u)},tagTypes:[...n.tagTypes||[]]},s={endpointDefinitions:{},batch(u){u()},apiUid:Gn(),extractRehydrationInfo:r,hasRehydrationInfo:Bt(u=>r(u)!=null)},o={injectEndpoints:c,enhanceEndpoints({addTagTypes:u,endpoints:l}){if(u)for(const y of u)i.tagTypes.includes(y)||i.tagTypes.push(y);if(l)for(const[y,j]of Object.entries(l))typeof j=="function"?j($e(s,y)):Object.assign($e(s,y)||{},j);return o}},a=e.map(u=>u.init(o,i,s));function c(u){const l=u.endpoints({query:y=>({...y,type:wt}),mutation:y=>({...y,type:Wi}),infiniteQuery:y=>({...y,type:Hi})});for(const[y,j]of Object.entries(l)){if(u.overrideExisting!==!0&&y in s.endpointDefinitions){if(u.overrideExisting==="throw")throw new Error(process.env.NODE_ENV==="production"?q(39):`called \`injectEndpoints\` to override already-existing endpointName ${y} without specifying \`overrideExisting: true\``);typeof process<"u"&&process.env.NODE_ENV==="development"&&console.error(`called \`injectEndpoints\` to override already-existing endpointName ${y} without specifying \`overrideExisting: true\``);continue}if(typeof process<"u"&&process.env.NODE_ENV==="development"&&Et(j)){const{infiniteQueryOptions:b}=j,{maxPages:h,getPreviousPageParam:_}=b;if(typeof h=="number"){if(h<1)throw new Error(process.env.NODE_ENV==="production"?q(40):`maxPages for endpoint '${y}' must be a number greater than 0`);if(typeof _!="function")throw new Error(process.env.NODE_ENV==="production"?q(41):`getPreviousPageParam for endpoint '${y}' must be a function if maxPages is used`)}}s.endpointDefinitions[y]=j;for(const b of a)b.injectEndpoint(y,j)}return o}return o.injectEndpoints({endpoints:n.endpoints})}}function he(e,...t){return Object.assign(e,...t)}var $a=({api:e,queryThunk:t,internalState:n,mwApi:r})=>{const i=`${e.reducerPath}/subscriptions`;let s=null,o=null;const{updateSubscriptionOptions:a,unsubscribeQueryResult:c}=e.internalActions,u=(_,m)=>{if(a.match(m)){const{queryCacheKey:M,requestId:x,options:v}=m.payload,f=_.get(M);return f!=null&&f.has(x)&&f.set(x,v),!0}if(c.match(m)){const{queryCacheKey:M,requestId:x}=m.payload,v=_.get(M);return v&&v.delete(x),!0}if(e.internalActions.removeQueryResult.match(m))return _.delete(m.payload.queryCacheKey),!0;if(t.pending.match(m)){const{meta:{arg:M,requestId:x}}=m,v=Kt(_,M.queryCacheKey,Pn);return M.subscribe&&v.set(x,M.subscriptionOptions??v.get(x)??{}),!0}let S=!1;if(t.rejected.match(m)){const{meta:{condition:M,arg:x,requestId:v}}=m;if(M&&x.subscribe){const f=Kt(_,x.queryCacheKey,Pn);f.set(v,x.subscriptionOptions??f.get(v)??{}),S=!0}}return S},l=()=>n.currentSubscriptions,b={getSubscriptions:l,getSubscriptionCount:_=>{const S=l().get(_);return(S==null?void 0:S.size)??0},isRequestSubscribed:(_,m)=>{var M;const S=l();return!!((M=S==null?void 0:S.get(_))!=null&&M.get(m))}};function h(_){return JSON.parse(JSON.stringify(Object.fromEntries([..._].map(([m,S])=>[m,Object.fromEntries(S)]))))}return(_,m)=>{if(s||(s=h(n.currentSubscriptions)),e.util.resetApiState.match(_))return s={},n.currentSubscriptions.clear(),o=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(_))return[!1,b];const S=u(n.currentSubscriptions,_);let M=!0;if(process.env.NODE_ENV==="test"&&typeof _.type=="string"&&_.type===`${e.reducerPath}/getPolling`)return[!1,n.currentPolls];if(S){o||(o=setTimeout(()=>{const f=h(n.currentSubscriptions),[,d]=Oi(s,()=>f);m.next(e.internalActions.subscriptionsUpdated(d)),s=f,o=null},500));const x=typeof _.type=="string"&&!!_.type.startsWith(i),v=t.rejected.match(_)&&_.meta.condition&&!!_.meta.arg.subscribe;M=!x&&!v}return[M,!1]}},qa=2147483647/1e3-1,Ua=({reducerPath:e,api:t,queryThunk:n,context:r,internalState:i,selectors:{selectQueryEntry:s,selectConfig:o},getRunningQueryThunk:a,mwApi:c})=>{const{removeQueryResult:u,unsubscribeQueryResult:l,cacheEntriesUpserted:y}=t.internalActions,j=be(l.match,n.fulfilled,n.rejected,y.match);function b(x){const v=i.currentSubscriptions.get(x);return v?v.size>0:!1}const h={};function _(x){var v;for(const f of x.values())(v=f==null?void 0:f.abort)==null||v.call(f)}const m=(x,v)=>{const f=v.getState(),d=o(f);if(j(x)){let N;if(y.match(x))N=x.payload.map(O=>O.queryDescription.queryCacheKey);else{const{queryCacheKey:O}=l.match(x)?x.payload:x.meta.arg;N=[O]}S(N,v,d)}if(t.util.resetApiState.match(x)){for(const[N,O]of Object.entries(h))O&&clearTimeout(O),delete h[N];_(i.runningQueries),_(i.runningMutations)}if(r.hasRehydrationInfo(x)){const{queries:N}=r.extractRehydrationInfo(x);S(Object.keys(N),v,d)}};function S(x,v,f){const d=v.getState();for(const N of x){const O=s(d,N);O!=null&&O.endpointName&&M(N,O.endpointName,v,f)}}function M(x,v,f,d){const N=$e(r,v),O=(N==null?void 0:N.keepUnusedDataFor)??d.keepUnusedDataFor;if(O===1/0)return;const C=Math.max(0,Math.min(O,qa));if(!b(x)){const E=h[x];E&&clearTimeout(E),h[x]=setTimeout(()=>{if(!b(x)){const g=s(f.getState(),x);if(g!=null&&g.endpointName){const w=f.dispatch(a(g.endpointName,g.originalArgs));w==null||w.abort()}f.dispatch(u({queryCacheKey:x}))}delete h[x]},C*1e3)}}return m},Hr=new Error("Promise never resolved before cacheEntryRemoved."),Wa=({api:e,reducerPath:t,context:n,queryThunk:r,mutationThunk:i,internalState:s,selectors:{selectQueryEntry:o,selectApiState:a}})=>{const c=kn(r),u=kn(i),l=_e(r,i),y={},{removeQueryResult:j,removeMutationResult:b,cacheEntriesUpserted:h}=e.internalActions;function _(f,d,N){const O=y[f];O!=null&&O.valueResolved&&(O.valueResolved({data:d,meta:N}),delete O.valueResolved)}function m(f){const d=y[f];d&&(delete y[f],d.cacheEntryRemoved())}function S(f){const{arg:d,requestId:N}=f.meta,{endpointName:O,originalArgs:C}=d;return[O,C,N]}const M=(f,d,N)=>{const O=x(f);function C(E,g,w,I){const k=o(N,g),P=o(d.getState(),g);!k&&P&&v(E,I,g,d,w)}if(r.pending.match(f)){const[E,g,w]=S(f);C(E,O,w,g)}else if(h.match(f))for(const{queryDescription:E,value:g}of f.payload){const{endpointName:w,originalArgs:I,queryCacheKey:k}=E;C(w,k,f.meta.requestId,I),_(k,g,{})}else if(i.pending.match(f)){if(d.getState()[t].mutations[O]){const[g,w,I]=S(f);v(g,w,O,d,I)}}else if(l(f))_(O,f.payload,f.meta.baseQueryMeta);else if(j.match(f)||b.match(f))m(O);else if(e.util.resetApiState.match(f))for(const E of Object.keys(y))m(E)};function x(f){return c(f)?f.meta.arg.queryCacheKey:u(f)?f.meta.arg.fixedCacheKey??f.meta.requestId:j.match(f)?f.payload.queryCacheKey:b.match(f)?dt(f.payload):""}function v(f,d,N,O,C){const E=$e(n,f),g=E==null?void 0:E.onCacheEntryAdded;if(!g)return;const w={},I=new Promise(A=>{w.cacheEntryRemoved=A}),k=Promise.race([new Promise(A=>{w.valueResolved=A}),I.then(()=>{throw Hr})]);k.catch(()=>{}),y[N]=w;const P=e.endpoints[f].select(Gt(E)?d:N),D=O.dispatch((A,V,L)=>L),F={...O,getCacheEntry:()=>P(O.getState()),requestId:C,extra:D,updateCachedData:Gt(E)?A=>O.dispatch(e.util.updateQueryData(f,d,A)):void 0,cacheDataLoaded:k,cacheEntryRemoved:I},R=g(d,F);Promise.resolve(R).catch(A=>{if(A!==Hr)throw A})}return M},Ha=({api:e,context:{apiUid:t},reducerPath:n})=>(r,i)=>{var s,o;e.util.resetApiState.match(r)&&i.dispatch(e.internalActions.middlewareRegistered(t)),typeof process<"u"&&process.env.NODE_ENV==="development"&&e.internalActions.middlewareRegistered.match(r)&&r.payload===t&&((o=(s=i.getState()[n])==null?void 0:s.config)==null?void 0:o.middlewareRegistered)==="conflict"&&console.warn(`There is a mismatch between slice and middleware for the reducerPath "${n}".
40
40
  You can only have one api per reducer path, this will lead to crashes in various situations!${n==="api"?`
41
- If you have multiple apis, you *have* to specify the reducerPath option when using createApi!`:""}`)},qa=({reducerPath:e,context:t,context:{endpointDefinitions:n},mutationThunk:r,queryThunk:i,api:s,assertTagType:o,refetchQuery:a,internalState:c})=>{const{removeQueryResult:u}=s.internalActions,l=be(_e(r),on(r)),y=be(_e(i,r),Le(i,r));let j=[],b=0;const h=(S,M)=>{(i.pending.match(S)||r.pending.match(S))&&b++,y(S)&&(b=Math.max(0,b-1)),l(S)?m(Ki(S,"invalidatesTags",n,o),M):y(S)?m([],M):s.util.invalidateTags.match(S)&&m(er(S.payload,void 0,void 0,void 0,void 0,o),M)};function _(){return b>0}function m(S,M){const x=M.getState(),v=x[e];if(j.push(...S),v.config.invalidationBehavior==="delayed"&&_())return;const f=j;if(j=[],f.length===0)return;const d=s.util.selectInvalidatedBy(x,f);t.batch(()=>{const N=Array.from(d.values());for(const{queryCacheKey:O}of N){const C=v.queries[O],E=Kt(c.currentSubscriptions,O,Rn);C&&(E.size===0?M.dispatch(u({queryCacheKey:O})):C.status!==xe&&M.dispatch(a(C)))}})}return h},za=({reducerPath:e,queryThunk:t,api:n,refetchQuery:r,internalState:i})=>{const{currentPolls:s,currentSubscriptions:o}=i,a=new Set;let c=null;const u=(m,S)=>{(n.internalActions.updateSubscriptionOptions.match(m)||n.internalActions.unsubscribeQueryResult.match(m))&&l(m.payload.queryCacheKey,S),(t.pending.match(m)||t.rejected.match(m)&&m.meta.condition)&&l(m.meta.arg.queryCacheKey,S),(t.fulfilled.match(m)||t.rejected.match(m)&&!m.meta.condition)&&y(m.meta.arg,S),n.util.resetApiState.match(m)&&(h(),c&&(clearTimeout(c),c=null),a.clear())};function l(m,S){a.add(m),c||(c=setTimeout(()=>{for(const M of a)j({queryCacheKey:M},S);a.clear(),c=null},0))}function y({queryCacheKey:m},S){const M=S.getState()[e],x=M.queries[m],v=o.get(m);if(!x||x.status===xe)return;const{lowestPollingInterval:f,skipPollingIfUnfocused:d}=_(v);if(!Number.isFinite(f))return;const N=s.get(m);N!=null&&N.timeout&&(clearTimeout(N.timeout),N.timeout=void 0);const O=Date.now()+f;s.set(m,{nextPollTimestamp:O,pollingInterval:f,timeout:setTimeout(()=>{(M.config.focused||!d)&&S.dispatch(r(x)),y({queryCacheKey:m},S)},f)})}function j({queryCacheKey:m},S){const x=S.getState()[e].queries[m],v=o.get(m);if(!x||x.status===xe)return;const{lowestPollingInterval:f}=_(v);if(process.env.NODE_ENV==="test"){const O=s.pollUpdateCounters??(s.pollUpdateCounters={});O[m]??(O[m]=0),O[m]++}if(!Number.isFinite(f)){b(m);return}const d=s.get(m),N=Date.now()+f;(!d||N<d.nextPollTimestamp)&&y({queryCacheKey:m},S)}function b(m){const S=s.get(m);S!=null&&S.timeout&&clearTimeout(S.timeout),s.delete(m)}function h(){for(const m of s.keys())b(m)}function _(m=new Map){let S=!1,M=Number.POSITIVE_INFINITY;for(const x of m.values())x.pollingInterval&&(M=Math.min(x.pollingInterval,M),S=x.skipPollingIfUnfocused||S);return{lowestPollingInterval:M,skipPollingIfUnfocused:S}}return u},Wa=({api:e,context:t,queryThunk:n,mutationThunk:r})=>{const i=Kn(n,r),s=Le(n,r),o=_e(n,r),a={};return(u,l)=>{var y,j;if(i(u)){const{requestId:b,arg:{endpointName:h,originalArgs:_}}=u.meta,m=Qe(t,h),S=m==null?void 0:m.onQueryStarted;if(S){const M={},x=new Promise((N,O)=>{M.resolve=N,M.reject=O});x.catch(()=>{}),a[b]=M;const v=e.endpoints[h].select(Gt(m)?_:b),f=l.dispatch((N,O,C)=>C),d={...l,getCacheEntry:()=>v(l.getState()),requestId:b,extra:f,updateCachedData:Gt(m)?N=>l.dispatch(e.util.updateQueryData(h,_,N)):void 0,queryFulfilled:x};S(_,d)}}else if(o(u)){const{requestId:b,baseQueryMeta:h}=u.meta;(y=a[b])==null||y.resolve({data:u.payload,meta:h}),delete a[b]}else if(s(u)){const{requestId:b,rejectedWithValue:h,baseQueryMeta:_}=u.meta;(j=a[b])==null||j.reject({error:u.payload??u.error,isUnhandledError:!h,meta:_}),delete a[b]}}},Ha=({reducerPath:e,context:t,api:n,refetchQuery:r,internalState:i})=>{const{removeQueryResult:s}=n.internalActions,o=(c,u)=>{Jn.match(c)&&a(u,"refetchOnFocus"),Zn.match(c)&&a(u,"refetchOnReconnect")};function a(c,u){const l=c.getState()[e],y=l.queries,j=i.currentSubscriptions;t.batch(()=>{for(const b of j.keys()){const h=y[b],_=j.get(b);if(!_||!h)continue;const m=[..._.values()];(m.some(M=>M[u]===!0)||m.every(M=>M[u]===void 0)&&l.config[u])&&(_.size===0?c.dispatch(s({queryCacheKey:b})):h.status!==xe&&c.dispatch(r(h)))}})}return o};function Ba(e){const{reducerPath:t,queryThunk:n,api:r,context:i,getInternalState:s}=e,{apiUid:o}=i,a={invalidateTags:me(`${t}/invalidateTags`)},c=j=>j.type.startsWith(`${t}/`),u=[Ua,La,qa,za,Qa,Wa];return{middleware:j=>{let b=!1;const h=s(j.dispatch),_={...e,internalState:h,refetchQuery:y,isThisApiSliceAction:c,mwApi:j},m=u.map(x=>x(_)),S=Fa(_),M=Ha(_);return x=>v=>{if(!zn(v))return x(v);b||(b=!0,j.dispatch(r.internalActions.middlewareRegistered(o)));const f={...j,next:x},d=j.getState(),[N,O]=S(v,f,d);let C;if(N?C=x(v):C=O,j.getState()[t]&&(M(v,f,d),c(v)||i.hasRehydrationInfo(v)))for(const E of m)E(v,f,d);return C}},actions:a};function y(j){return e.api.endpoints[j.endpointName].initiate(j.originalArgs,{subscribe:!1,forceRefetch:!0})}}var Wr=Symbol(),Xi=({createSelector:e=Oi}={})=>({name:Wr,init(t,{baseQuery:n,tagTypes:r,reducerPath:i,serializeQueryArgs:s,keepUnusedDataFor:o,refetchOnMountOrArgChange:a,refetchOnFocus:c,refetchOnReconnect:u,invalidationBehavior:l,onSchemaFailure:y,catchSchemaFailure:j,skipSchemaValidation:b},h){_o();const _=L=>(typeof process<"u"&&process.env.NODE_ENV==="development"&&(r.includes(L.type)||console.error(`Tag type '${L.type}' was used, but not specified in \`tagTypes\`!`)),L);Object.assign(t,{reducerPath:i,endpoints:{},internalActions:{onOnline:Zn,onOffline:Ui,onFocus:Jn,onFocusLost:Qi},util:{}});const m=Va({serializeQueryArgs:s,reducerPath:i,createSelector:e}),{selectInvalidatedBy:S,selectCachedArgsForQuery:M,buildQuerySelector:x,buildInfiniteQuerySelector:v,buildMutationSelector:f}=m;he(t.util,{selectInvalidatedBy:S,selectCachedArgsForQuery:M});const{queryThunk:d,infiniteQueryThunk:N,mutationThunk:O,patchQueryData:C,updateQueryData:E,upsertQueryData:g,prefetch:w,buildMatchThunkActions:k}=Ra({baseQuery:n,reducerPath:i,context:h,api:t,serializeQueryArgs:s,assertTagType:_,selectors:m,onSchemaFailure:y,catchSchemaFailure:j,skipSchemaValidation:b}),{reducer:I,actions:A}=Ta({context:h,queryThunk:d,mutationThunk:O,serializeQueryArgs:s,reducerPath:i,assertTagType:_,config:{refetchOnFocus:c,refetchOnReconnect:u,refetchOnMountOrArgChange:a,keepUnusedDataFor:o,reducerPath:i,invalidationBehavior:l}});he(t.util,{patchQueryData:C,updateQueryData:E,upsertQueryData:g,prefetch:w,resetApiState:A.resetApiState,upsertQueryEntries:A.cacheEntriesUpserted}),he(t.internalActions,A);const D=new WeakMap,$=L=>Kt(D,L,()=>({currentSubscriptions:new Map,currentPolls:new Map,runningQueries:new Map,runningMutations:new Map})),{buildInitiateQuery:R,buildInitiateInfiniteQuery:P,buildInitiateMutation:V,getRunningMutationThunk:F,getRunningMutationsThunk:H,getRunningQueriesThunk:K,getRunningQueryThunk:B}=Da({queryThunk:d,mutationThunk:O,infiniteQueryThunk:N,api:t,serializeQueryArgs:s,context:h,getInternalState:$});he(t.util,{getRunningMutationThunk:F,getRunningMutationsThunk:H,getRunningQueryThunk:B,getRunningQueriesThunk:K});const{middleware:X,actions:G}=Ba({reducerPath:i,context:h,queryThunk:d,mutationThunk:O,infiniteQueryThunk:N,api:t,assertTagType:_,selectors:m,getRunningQueryThunk:B,getInternalState:$});return he(t.util,G),he(t,{reducer:I,middleware:X}),{name:Wr,injectEndpoint(L,W){var z;const te=(z=t.endpoints)[L]??(z[L]={});cn(W)&&he(te,{name:L,select:x(L,W),initiate:R(L,W)},k(d,L)),Ma(W)&&he(te,{name:L,select:f(),initiate:V(L)},k(O,L)),Et(W)&&he(te,{name:L,select:v(L,W),initiate:P(L,W)},k(d,L))}}}});Xi();function Pt(e){return e.replace(e[0],e[0].toUpperCase())}function Ka(e){let t=0;for(const n in e)t++;return t}var Ga="query",Ya="mutation",Xa="infinitequery";function Ja(e){return e.type===Ga}function Za(e){return e.type===Ya}function Ji(e){return e.type===Xa}function Be(e,...t){return Object.assign(e,...t)}var bn=Symbol();function xn(e){const t=T.useRef(e),n=T.useMemo(()=>Yn(t.current,e),[e]);return T.useEffect(()=>{t.current!==n&&(t.current=n)},[n]),n}function Ve(e){const t=T.useRef(e);return T.useEffect(()=>{Ze(t.current,e)||(t.current=e)},[e]),Ze(t.current,e)?t.current:e}var ec=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",tc=ec(),nc=()=>typeof navigator<"u"&&navigator.product==="ReactNative",rc=nc(),ic=()=>tc||rc?T.useLayoutEffect:T.useEffect,sc=ic(),Hr=e=>e.isUninitialized?{...e,isUninitialized:!1,isFetching:!0,isLoading:e.data===void 0,status:$i.pending}:e;function vn(e,...t){const n={};return t.forEach(r=>{n[r]=e[r]}),n}var wn=["data","status","isLoading","isSuccess","isError","error"];function oc({api:e,moduleOptions:{batch:t,hooks:{useDispatch:n,useSelector:r,useStore:i},unstable__sideEffectsInRender:s,createSelector:o},serializeQueryArgs:a,context:c}){const u=s?d=>d():T.useEffect,l=d=>{var N,O;return(O=(N=d.current)==null?void 0:N.unsubscribe)==null?void 0:O.call(N)},y=c.endpointDefinitions;return{buildQueryHooks:x,buildInfiniteQueryHooks:v,buildMutationHook:f,usePrefetch:h};function j(d,N,O){if(N!=null&&N.endpointName&&d.isUninitialized){const{endpointName:I}=N,A=y[I];O!==fe&&a({queryArgs:N.originalArgs,endpointDefinition:A,endpointName:I})===a({queryArgs:O,endpointDefinition:A,endpointName:I})&&(N=void 0)}let C=d.isSuccess?d.data:N==null?void 0:N.data;C===void 0&&(C=d.data);const E=C!==void 0,g=d.isLoading,w=(!N||N.isLoading||N.isUninitialized)&&!E&&g,k=d.isSuccess||E&&(g&&!(N!=null&&N.isError)||d.isUninitialized);return{...d,data:C,currentData:d.data,isFetching:g,isLoading:w,isSuccess:k}}function b(d,N,O){if(N!=null&&N.endpointName&&d.isUninitialized){const{endpointName:I}=N,A=y[I];O!==fe&&a({queryArgs:N.originalArgs,endpointDefinition:A,endpointName:I})===a({queryArgs:O,endpointDefinition:A,endpointName:I})&&(N=void 0)}let C=d.isSuccess?d.data:N==null?void 0:N.data;C===void 0&&(C=d.data);const E=C!==void 0,g=d.isLoading,w=(!N||N.isLoading||N.isUninitialized)&&!E&&g,k=d.isSuccess||E&&(g&&!(N!=null&&N.isError)||d.isUninitialized);return{...d,data:C,currentData:d.data,isFetching:g,isLoading:w,isSuccess:k}}function h(d,N){const O=n(),C=Ve(N);return T.useCallback((E,g)=>O(e.util.prefetch(d,E,{...C,...g})),[d,O,C])}function _(d,N,{refetchOnReconnect:O,refetchOnFocus:C,refetchOnMountOrArgChange:E,skip:g=!1,pollingInterval:w=0,skipPollingIfUnfocused:k=!1,...I}={}){const{initiate:A}=e.endpoints[d],D=n(),$=T.useRef(void 0);if(!$.current){const Q=D(e.internalActions.internal_getRTKQSubscriptions());if(process.env.NODE_ENV!=="production"&&(typeof Q!="object"||typeof(Q==null?void 0:Q.type)=="string"))throw new Error(process.env.NODE_ENV==="production"?q(37):`Warning: Middleware for RTK-Query API at reducerPath "${e.reducerPath}" has not been added to the store.
42
- You must add the middleware for RTK-Query to function correctly!`);$.current=Q}const R=xn(g?fe:N),P=Ve({refetchOnReconnect:O,refetchOnFocus:C,pollingInterval:w,skipPollingIfUnfocused:k}),V=I.initialPageParam,F=Ve(V),H=I.refetchCachedPages,K=Ve(H),B=T.useRef(void 0);let{queryCacheKey:X,requestId:G}=B.current||{},L=!1;X&&G&&(L=$.current.isRequestSubscribed(X,G));const W=!L&&B.current!==void 0;return u(()=>{W&&(B.current=void 0)},[W]),u(()=>{var z;const Q=B.current;if(typeof process<"u"&&process.env.NODE_ENV==="removeMeOnCompilation"&&console.log(W),R===fe){Q==null||Q.unsubscribe(),B.current=void 0;return}const te=(z=B.current)==null?void 0:z.subscriptionOptions;if(!Q||Q.arg!==R){Q==null||Q.unsubscribe();const U=D(A(R,{subscriptionOptions:P,forceRefetch:E,...Ji(y[d])?{initialPageParam:F,refetchCachedPages:K}:{}}));B.current=U}else P!==te&&Q.updateSubscriptionOptions(P)},[D,A,E,R,P,W,F,K,d]),[B,D,A,P]}function m(d,N){return(C,{skip:E=!1,selectFromResult:g}={})=>{const{select:w}=e.endpoints[d],k=xn(E?fe:C),I=T.useRef(void 0),A=T.useMemo(()=>o([w(k),(V,F)=>F,V=>k],N,{memoizeOptions:{resultEqualityCheck:Ze}}),[w,k]),D=T.useMemo(()=>g?o([A],g,{devModeChecks:{identityFunctionCheck:"never"}}):A,[A,g]),$=r(V=>D(V,I.current),Ze),R=i(),P=A(R.getState(),I.current);return sc(()=>{I.current=P},[P]),$}}function S(d){T.useEffect(()=>()=>{l(d),d.current=void 0},[d])}function M(d){if(!d.current)throw new Error(process.env.NODE_ENV==="production"?q(38):"Cannot refetch a query that has not been started yet.");return d.current.refetch()}function x(d){const N=(E,g={})=>{const[w]=_(d,E,g);return S(w),T.useMemo(()=>({refetch:()=>M(w)}),[w])},O=({refetchOnReconnect:E,refetchOnFocus:g,pollingInterval:w=0,skipPollingIfUnfocused:k=!1}={})=>{const{initiate:I}=e.endpoints[d],A=n(),[D,$]=T.useState(bn),R=T.useRef(void 0),P=Ve({refetchOnReconnect:E,refetchOnFocus:g,pollingInterval:w,skipPollingIfUnfocused:k});u(()=>{var B,X;const K=(B=R.current)==null?void 0:B.subscriptionOptions;P!==K&&((X=R.current)==null||X.updateSubscriptionOptions(P))},[P]);const V=T.useRef(P);u(()=>{V.current=P},[P]);const F=T.useCallback(function(K,B=!1){let X;return t(()=>{l(R),R.current=X=A(I(K,{subscriptionOptions:V.current,forceRefetch:!B})),$(K)}),X},[A,I]),H=T.useCallback(()=>{var K,B;(K=R.current)!=null&&K.queryCacheKey&&A(e.internalActions.removeQueryResult({queryCacheKey:(B=R.current)==null?void 0:B.queryCacheKey}))},[A]);return T.useEffect(()=>()=>{l(R)},[]),T.useEffect(()=>{D!==bn&&!R.current&&F(D,!0)},[D,F]),T.useMemo(()=>[F,D,{reset:H}],[F,D,H])},C=m(d,j);return{useQueryState:C,useQuerySubscription:N,useLazyQuerySubscription:O,useLazyQuery(E){const[g,w,{reset:k}]=O(E),I=C(w,{...E,skip:w===bn}),A=T.useMemo(()=>({lastArg:w}),[w]);return T.useMemo(()=>[g,{...I,reset:k},A],[g,I,k,A])},useQuery(E,g){const w=N(E,g),k=C(E,{selectFromResult:E===fe||g!=null&&g.skip?void 0:Hr,...g}),I=vn(k,...wn);return T.useDebugValue(I),T.useMemo(()=>({...k,...w}),[k,w])}}}function v(d){const N=(C,E={})=>{const[g,w,k,I]=_(d,C,E),A=T.useRef(I);u(()=>{A.current=I},[I]);const D=E.refetchCachedPages,$=Ve(D),R=T.useCallback(function(F,H){let K;return t(()=>{l(g),g.current=K=w(k(F,{subscriptionOptions:A.current,direction:H}))}),K},[g,w,k]);S(g);const P=xn(E.skip?fe:C),V=T.useCallback(F=>{if(!g.current)throw new Error(process.env.NODE_ENV==="production"?q(38):"Cannot refetch a query that has not been started yet.");const H={refetchCachedPages:(F==null?void 0:F.refetchCachedPages)??$};return g.current.refetch(H)},[g,$]);return T.useMemo(()=>({trigger:R,refetch:V,fetchNextPage:()=>R(P,"forward"),fetchPreviousPage:()=>R(P,"backward")}),[V,R,P])},O=m(d,b);return{useInfiniteQueryState:O,useInfiniteQuerySubscription:N,useInfiniteQuery(C,E){const{refetch:g,fetchNextPage:w,fetchPreviousPage:k}=N(C,E),I=O(C,{selectFromResult:C===fe||E!=null&&E.skip?void 0:Hr,...E}),A=vn(I,...wn,"hasNextPage","hasPreviousPage");return T.useDebugValue(A),T.useMemo(()=>({...I,fetchNextPage:w,fetchPreviousPage:k,refetch:g}),[I,w,k,g])}}}function f(d){return({selectFromResult:N,fixedCacheKey:O}={})=>{const{select:C,initiate:E}=e.endpoints[d],g=n(),[w,k]=T.useState();T.useEffect(()=>()=>{w!=null&&w.arg.fixedCacheKey||w==null||w.reset()},[w]);const I=T.useCallback(function(K){const B=g(E(K,{fixedCacheKey:O}));return k(B),B},[g,E,O]),{requestId:A}=w||{},D=T.useMemo(()=>C({fixedCacheKey:O,requestId:w==null?void 0:w.requestId}),[O,w,C]),$=T.useMemo(()=>N?o([D],N):D,[N,D]),R=r($,Ze),P=O==null?w==null?void 0:w.arg.originalArgs:void 0,V=T.useCallback(()=>{t(()=>{w&&k(void 0),O&&g(e.internalActions.removeMutationResult({requestId:A,fixedCacheKey:O}))})},[g,O,w,A]),F=vn(R,...wn,"endpointName");T.useDebugValue(F);const H=T.useMemo(()=>({...R,originalArgs:P,reset:V}),[R,P,V]);return T.useMemo(()=>[I,H],[I,H])}}}var ac=Symbol(),cc=({batch:e=Gs,hooks:t={useDispatch:Hs,useSelector:Ks,useStore:di},createSelector:n=Oi,unstable__sideEffectsInRender:r=!1,...i}={})=>{if(process.env.NODE_ENV!=="production"){const s=["useDispatch","useSelector","useStore"];let o=!1;for(const a of s)if(Ka(i)>0&&(i[a]&&(o||(console.warn("As of RTK 2.0, the hooks now need to be specified as one object, provided under a `hooks` key:\n`reactHooksModule({ hooks: { useDispatch, useSelector, useStore } })`"),o=!0)),t[a]=i[a]),typeof t[a]!="function")throw new Error(process.env.NODE_ENV==="production"?q(36):`When using custom hooks for context, all ${s.length} hooks need to be provided: ${s.join(", ")}.
43
- Hook ${a} was either not provided or not a function.`)}return{name:ac,init(s,{serializeQueryArgs:o},a){const c=s,{buildQueryHooks:u,buildInfiniteQueryHooks:l,buildMutationHook:y,usePrefetch:j}=oc({api:s,moduleOptions:{batch:e,hooks:t,unstable__sideEffectsInRender:r,createSelector:n},serializeQueryArgs:o,context:a});return Be(c,{usePrefetch:j}),Be(a,{batch:e}),{injectEndpoint(b,h){if(Ja(h)){const{useQuery:_,useLazyQuery:m,useLazyQuerySubscription:S,useQueryState:M,useQuerySubscription:x}=u(b);Be(c.endpoints[b],{useQuery:_,useLazyQuery:m,useLazyQuerySubscription:S,useQueryState:M,useQuerySubscription:x}),s[`use${Pt(b)}Query`]=_,s[`useLazy${Pt(b)}Query`]=m}if(Za(h)){const _=y(b);Be(c.endpoints[b],{useMutation:_}),s[`use${Pt(b)}Mutation`]=_}else if(Ji(h)){const{useInfiniteQuery:_,useInfiniteQuerySubscription:m,useInfiniteQueryState:S}=l(b);Be(c.endpoints[b],{useInfiniteQuery:_,useInfiniteQuerySubscription:m,useInfiniteQueryState:S}),s[`use${Pt(b)}InfiniteQuery`]=_}}}}}},uc=Yi(Xi(),cc());const lc=async(e,t,n)=>{const{baseUrl:r,getToken:i}=Xs();return Oa({baseUrl:r,prepareHeaders:async o=>{const a=await(i==null?void 0:i());return a&&o.set("Authorization",`Bearer ${a}`),o}})(e,t,n)},dc=["ChatHistory"],Zi={ChatHistory:"ChatHistory"},Br=e=>{var t,n;return{status:e==null?void 0:e.status,message:((t=e==null?void 0:e.data)==null?void 0:t.message)??((n=e==null?void 0:e.data)==null?void 0:n.error)??(e==null?void 0:e.error)??"Something went wrong. Please try again."}},fc={sendMessage:{getUrl:()=>"/chat/messages",method:"POST",transformResponse:e=>e,invalidatesTags:[Zi.ChatHistory]}},mc={getChatHistory:{getUrl:({conversationId:e})=>`/chat/conversations/${e}`,method:"GET",transformResponse:e=>e,providesTags:[Zi.ChatHistory]}},pc={submitFeedback:{getUrl:()=>"/chat/feedback",method:"POST",transformResponse:e=>e}},Kr={...fc,...pc},Gr={...mc},Tt=uc({reducerPath:"mintAiApi",baseQuery:lc,tagTypes:dc,endpoints:e=>{const t={};return Object.keys(Kr).forEach(n=>{const r=Kr[n];t[n]=e.mutation({query:i=>({url:r.getUrl(i),method:r.method,body:i}),transformResponse:i=>r.transformResponse(i),transformErrorResponse:i=>{var s;return((s=r.transformErrorResponse)==null?void 0:s.call(r,i))??Br(i)},invalidatesTags:r.invalidatesTags??[]})}),Object.keys(Gr).forEach(n=>{const r=Gr[n];t[n]=e.query({query:i=>({url:r.getUrl(i),method:r.method}),transformResponse:i=>r.transformResponse(i),transformErrorResponse:i=>Br(i),providesTags:r.providesTags??[]})}),t}}),{useSendMessageMutation:hc}=Tt,Yr={open:!1,expanded:!1,conversationId:void 0,messages:[],draft:""},es=ke({name:"chatUi",initialState:Yr,reducers:{setOpen(e,t){e.open=t.payload,t.payload||(e.expanded=!1)},setExpanded(e,t){e.expanded=t.payload,t.payload&&(e.open=!0)},toggleOpen(e){e.open=!e.open,e.open||(e.expanded=!1)},setConversationId(e,t){e.conversationId=t.payload},setDraft(e,t){e.draft=t.payload},addMessage(e,t){e.messages.push(t.payload)},setMessages(e,t){e.messages=t.payload},resetChat(){return Yr}}}),{setOpen:tr,setExpanded:ts,toggleOpen:gc,setConversationId:yc,setDraft:nr,addMessage:rt,setMessages:il,resetChat:sl}=es.actions,bc=es.reducer,xc=Zo({reducer:{[Tt.reducerPath]:Tt.reducer,chatUi:bc},middleware:e=>e().concat(Tt.middleware)});function vc({config:e,children:t}){return p.jsx(Ws,{store:xc,context:qn,children:p.jsx(Zs,{config:e,children:p.jsx("div",{className:"mint-ai-root",children:t})})})}const wc=fi(qn),Ec=mi(qn),St=()=>wc(),ft=Ec;function ns(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=ns(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Sc(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=ns(e))&&(r&&(r+=" "),r+=t);return r}function ne(...e){return Sc(e)}const rs=Object.freeze({left:0,top:0,width:16,height:16}),Yt=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),rr=Object.freeze({...rs,...Yt}),Fn=Object.freeze({...rr,body:"",hidden:!1});function Nc(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function Xr(e,t){const n=Nc(e,t);for(const r in Fn)r in Yt?r in e&&!(r in n)&&(n[r]=Yt[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function Cc(e,t){const n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function s(o){if(n[o])return i[o]=[];if(!(o in i)){i[o]=null;const a=r[o]&&r[o].parent,c=a&&s(a);c&&(i[o]=[a].concat(c))}return i[o]}return Object.keys(n).concat(Object.keys(r)).forEach(s),i}function _c(e,t,n){const r=e.icons,i=e.aliases||Object.create(null);let s={};function o(a){s=Xr(r[a]||i[a],s)}return o(t),n.forEach(o),Xr(e,s)}function is(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(i=>{t(i,null),n.push(i)});const r=Cc(e);for(const i in r){const s=r[i];s&&(t(i,_c(e,i,s)),n.push(i))}return n}const jc={provider:"",aliases:{},not_found:{},...rs};function En(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function ss(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!En(e,jc))return null;const n=t.icons;for(const i in n){const s=n[i];if(!i||typeof s.body!="string"||!En(s,Fn))return null}const r=t.aliases||Object.create(null);for(const i in r){const s=r[i],o=s.parent;if(!i||typeof o!="string"||!n[o]&&!r[o]||!En(s,Fn))return null}return t}const os=/^[a-z0-9]+(-[a-z0-9]+)*$/,un=(e,t,n,r="")=>{const i=e.split(":");if(e.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const a=i.pop(),c=i.pop(),u={provider:i.length>0?i[0]:r,prefix:c,name:a};return t&&!Vt(u)?null:u}const s=i[0],o=s.split("-");if(o.length>1){const a={provider:r,prefix:o.shift(),name:o.join("-")};return t&&!Vt(a)?null:a}if(n&&r===""){const a={provider:r,prefix:"",name:s};return t&&!Vt(a,n)?null:a}return null},Vt=(e,t)=>e?!!((t&&e.prefix===""||e.prefix)&&e.name):!1,Jr=Object.create(null);function Oc(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function Ue(e,t){const n=Jr[e]||(Jr[e]=Object.create(null));return n[t]||(n[t]=Oc(e,t))}function as(e,t){return ss(t)?is(t,(n,r)=>{r?e.icons[n]=r:e.missing.add(n)}):[]}function kc(e,t,n){try{if(typeof n.body=="string")return e.icons[t]={...n},!0}catch{}return!1}let mt=!1;function cs(e){return typeof e=="boolean"&&(mt=e),mt}function Zr(e){const t=typeof e=="string"?un(e,!0,mt):e;if(t){const n=Ue(t.provider,t.prefix),r=t.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function Ic(e,t){const n=un(e,!0,mt);if(!n)return!1;const r=Ue(n.provider,n.prefix);return t?kc(r,n.name,t):(r.missing.add(n.name),!0)}function Mc(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),mt&&!t&&!e.prefix){let i=!1;return ss(e)&&(e.prefix="",is(e,(s,o)=>{Ic(s,o)&&(i=!0)})),i}const n=e.prefix;if(!Vt({prefix:n,name:"a"}))return!1;const r=Ue(t,n);return!!as(r,e)}const us=Object.freeze({width:null,height:null}),ls=Object.freeze({...us,...Yt}),Pc=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Ac=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function ei(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const r=e.split(Pc);if(r===null||!r.length)return e;const i=[];let s=r.shift(),o=Ac.test(s);for(;;){if(o){const a=parseFloat(s);isNaN(a)?i.push(s):i.push(Math.ceil(a*t*n)/n)}else i.push(s);if(s=r.shift(),s===void 0)return i.join("");o=!o}}function Dc(e,t="defs"){let n="";const r=e.indexOf("<"+t);for(;r>=0;){const i=e.indexOf(">",r),s=e.indexOf("</"+t);if(i===-1||s===-1)break;const o=e.indexOf(">",s);if(o===-1)break;n+=e.slice(i+1,s).trim(),e=e.slice(0,r).trim()+e.slice(o+1)}return{defs:n,content:e}}function Rc(e,t){return e?"<defs>"+e+"</defs>"+t:t}function Tc(e,t,n){const r=Dc(e);return Rc(r.defs,t+r.content+n)}const Vc=e=>e==="unset"||e==="undefined"||e==="none";function Fc(e,t){const n={...rr,...e},r={...ls,...t},i={left:n.left,top:n.top,width:n.width,height:n.height};let s=n.body;[n,r].forEach(_=>{const m=[],S=_.hFlip,M=_.vFlip;let x=_.rotate;S?M?x+=2:(m.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),m.push("scale(-1 1)"),i.top=i.left=0):M&&(m.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),m.push("scale(1 -1)"),i.top=i.left=0);let v;switch(x<0&&(x-=Math.floor(x/4)*4),x=x%4,x){case 1:v=i.height/2+i.top,m.unshift("rotate(90 "+v.toString()+" "+v.toString()+")");break;case 2:m.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:v=i.width/2+i.left,m.unshift("rotate(-90 "+v.toString()+" "+v.toString()+")");break}x%2===1&&(i.left!==i.top&&(v=i.left,i.left=i.top,i.top=v),i.width!==i.height&&(v=i.width,i.width=i.height,i.height=v)),m.length&&(s=Tc(s,'<g transform="'+m.join(" ")+'">',"</g>"))});const o=r.width,a=r.height,c=i.width,u=i.height;let l,y;o===null?(y=a===null?"1em":a==="auto"?u:a,l=ei(y,c/u)):(l=o==="auto"?c:o,y=a===null?ei(l,u/c):a==="auto"?u:a);const j={},b=(_,m)=>{Vc(m)||(j[_]=m.toString())};b("width",l),b("height",y);const h=[i.left,i.top,c,u];return j.viewBox=h.join(" "),{attributes:j,viewBox:h,body:s}}const $c=/\sid="(\S+)"/g,Lc="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let Qc=0;function Uc(e,t=Lc){const n=[];let r;for(;r=$c.exec(e);)n.push(r[1]);if(!n.length)return e;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(s=>{const o=typeof t=="function"?t(s):t+(Qc++).toString(),a=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+o+i+"$3")}),e=e.replace(new RegExp(i,"g"),""),e}const $n=Object.create(null);function qc(e,t){$n[e]=t}function Ln(e){return $n[e]||$n[""]}function ir(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const sr=Object.create(null),Ke=["https://api.simplesvg.com","https://api.unisvg.com"],Ft=[];for(;Ke.length>0;)Ke.length===1||Math.random()>.5?Ft.push(Ke.shift()):Ft.push(Ke.pop());sr[""]=ir({resources:["https://api.iconify.design"].concat(Ft)});function zc(e,t){const n=ir(t);return n===null?!1:(sr[e]=n,!0)}function or(e){return sr[e]}const Wc=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let ti=Wc();function Hc(e,t){const n=or(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let i=0;n.resources.forEach(o=>{i=Math.max(i,o.length)});const s=t+".json?icons=";r=n.maxURL-i-n.path.length-s.length}return r}function Bc(e){return e===404}const Kc=(e,t,n)=>{const r=[],i=Hc(e,t),s="icons";let o={type:s,provider:e,prefix:t,icons:[]},a=0;return n.forEach((c,u)=>{a+=c.length+1,a>=i&&u>0&&(r.push(o),o={type:s,provider:e,prefix:t,icons:[]},a=c.length),o.icons.push(c)}),r.push(o),r};function Gc(e){if(typeof e=="string"){const t=or(e);if(t)return t.path}return"/"}const Yc=(e,t,n)=>{if(!ti){n("abort",424);return}let r=Gc(t.provider);switch(t.type){case"icons":{const s=t.prefix,a=t.icons.join(","),c=new URLSearchParams({icons:a});r+=s+".json?"+c.toString();break}case"custom":{const s=t.uri;r+=s.slice(0,1)==="/"?s.slice(1):s;break}default:n("abort",400);return}let i=503;ti(e+r).then(s=>{const o=s.status;if(o!==200){setTimeout(()=>{n(Bc(o)?"abort":"next",o)});return}return i=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?n("abort",s):n("next",i)});return}setTimeout(()=>{n("success",s)})}).catch(()=>{n("next",i)})},Xc={prepare:Kc,send:Yc};function Jc(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((i,s)=>i.provider!==s.provider?i.provider.localeCompare(s.provider):i.prefix!==s.prefix?i.prefix.localeCompare(s.prefix):i.name.localeCompare(s.name));let r={provider:"",prefix:"",name:""};return e.forEach(i=>{if(r.name===i.name&&r.prefix===i.prefix&&r.provider===i.provider)return;r=i;const s=i.provider,o=i.prefix,a=i.name,c=n[s]||(n[s]=Object.create(null)),u=c[o]||(c[o]=Ue(s,o));let l;a in u.icons?l=t.loaded:o===""||u.missing.has(a)?l=t.missing:l=t.pending;const y={provider:s,prefix:o,name:a};l.push(y)}),t}function ds(e,t){e.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(i=>i.id!==t))})}function Zc(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const r=e.provider,i=e.prefix;t.forEach(s=>{const o=s.icons,a=o.pending.length;o.pending=o.pending.filter(c=>{if(c.prefix!==i)return!0;const u=c.name;if(e.icons[u])o.loaded.push({provider:r,prefix:i,name:u});else if(e.missing.has(u))o.missing.push({provider:r,prefix:i,name:u});else return n=!0,!0;return!1}),o.pending.length!==a&&(n||ds([e],s.id),s.callback(o.loaded.slice(0),o.missing.slice(0),o.pending.slice(0),s.abort))})}))}let eu=0;function tu(e,t,n){const r=eu++,i=ds.bind(null,n,r);if(!t.pending.length)return i;const s={id:r,icons:t,callback:e,abort:i};return n.forEach(o=>{(o.loaderCallbacks||(o.loaderCallbacks=[])).push(s)}),i}function nu(e,t=!0,n=!1){const r=[];return e.forEach(i=>{const s=typeof i=="string"?un(i,t,n):i;s&&r.push(s)}),r}var ru={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function iu(e,t,n,r){const i=e.resources.length,s=e.random?Math.floor(Math.random()*i):e.index;let o;if(e.random){let d=e.resources.slice(0);for(o=[];d.length>1;){const N=Math.floor(Math.random()*d.length);o.push(d[N]),d=d.slice(0,N).concat(d.slice(N+1))}o=o.concat(d)}else o=e.resources.slice(s).concat(e.resources.slice(0,s));const a=Date.now();let c="pending",u=0,l,y=null,j=[],b=[];typeof r=="function"&&b.push(r);function h(){y&&(clearTimeout(y),y=null)}function _(){c==="pending"&&(c="aborted"),h(),j.forEach(d=>{d.status==="pending"&&(d.status="aborted")}),j=[]}function m(d,N){N&&(b=[]),typeof d=="function"&&b.push(d)}function S(){return{startTime:a,payload:t,status:c,queriesSent:u,queriesPending:j.length,subscribe:m,abort:_}}function M(){c="failed",b.forEach(d=>{d(void 0,l)})}function x(){j.forEach(d=>{d.status==="pending"&&(d.status="aborted")}),j=[]}function v(d,N,O){const C=N!=="success";switch(j=j.filter(E=>E!==d),c){case"pending":break;case"failed":if(C||!e.dataAfterTimeout)return;break;default:return}if(N==="abort"){l=O,M();return}if(C){l=O,j.length||(o.length?f():M());return}if(h(),x(),!e.random){const E=e.resources.indexOf(d.resource);E!==-1&&E!==e.index&&(e.index=E)}c="completed",b.forEach(E=>{E(O)})}function f(){if(c!=="pending")return;h();const d=o.shift();if(d===void 0){if(j.length){y=setTimeout(()=>{h(),c==="pending"&&(x(),M())},e.timeout);return}M();return}const N={status:"pending",resource:d,callback:(O,C)=>{v(N,O,C)}};j.push(N),u++,y=setTimeout(f,e.rotate),n(d,t,N.callback)}return setTimeout(f),S}function fs(e){const t={...ru,...e};let n=[];function r(){n=n.filter(a=>a().status==="pending")}function i(a,c,u){const l=iu(t,a,c,(y,j)=>{r(),u&&u(y,j)});return n.push(l),l}function s(a){return n.find(c=>a(c))||null}return{query:i,find:s,setIndex:a=>{t.index=a},getIndex:()=>t.index,cleanup:r}}function ni(){}const Sn=Object.create(null);function su(e){if(!Sn[e]){const t=or(e);if(!t)return;const n=fs(t),r={config:t,redundancy:n};Sn[e]=r}return Sn[e]}function ou(e,t,n){let r,i;if(typeof e=="string"){const s=Ln(e);if(!s)return n(void 0,424),ni;i=s.send;const o=su(e);o&&(r=o.redundancy)}else{const s=ir(e);if(s){r=fs(s);const o=e.resources?e.resources[0]:"",a=Ln(o);a&&(i=a.send)}}return!r||!i?(n(void 0,424),ni):r.query(t,i,n)().abort}function ri(){}function au(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Zc(e)}))}function cu(e){const t=[],n=[];return e.forEach(r=>{(r.match(os)?t:n).push(r)}),{valid:t,invalid:n}}function Ge(e,t,n){function r(){const i=e.pendingIcons;t.forEach(s=>{i&&i.delete(s),e.icons[s]||e.missing.add(s)})}if(n&&typeof n=="object")try{if(!as(e,n).length){r();return}}catch(i){console.error(i)}r(),au(e)}function ii(e,t){e instanceof Promise?e.then(n=>{t(n)}).catch(()=>{t(null)}):t(e)}function uu(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:r}=e,i=e.iconsToLoad;if(delete e.iconsToLoad,!i||!i.length)return;const s=e.loadIcon;if(e.loadIcons&&(i.length>1||!s)){ii(e.loadIcons(i,r,n),l=>{Ge(e,i,l)});return}if(s){i.forEach(l=>{const y=s(l,r,n);ii(y,j=>{const b=j?{prefix:r,icons:{[l]:j}}:null;Ge(e,[l],b)})});return}const{valid:o,invalid:a}=cu(i);if(a.length&&Ge(e,a,null),!o.length)return;const c=r.match(os)?Ln(n):null;if(!c){Ge(e,o,null);return}c.prepare(n,r,o).forEach(l=>{ou(n,l,y=>{Ge(e,l.icons,y)})})}))}const lu=(e,t)=>{const n=nu(e,!0,cs()),r=Jc(n);if(!r.pending.length){let c=!0;return t&&setTimeout(()=>{c&&t(r.loaded,r.missing,r.pending,ri)}),()=>{c=!1}}const i=Object.create(null),s=[];let o,a;return r.pending.forEach(c=>{const{provider:u,prefix:l}=c;if(l===a&&u===o)return;o=u,a=l,s.push(Ue(u,l));const y=i[u]||(i[u]=Object.create(null));y[l]||(y[l]=[])}),r.pending.forEach(c=>{const{provider:u,prefix:l,name:y}=c,j=Ue(u,l),b=j.pendingIcons||(j.pendingIcons=new Set);b.has(y)||(b.add(y),i[u][l].push(y))}),s.forEach(c=>{const u=i[c.provider][c.prefix];u.length&&uu(c,u)}),t?tu(t,r,s):ri};function du(e,t){const n={...e};for(const r in t){const i=t[r],s=typeof i;r in us?(i===null||i&&(s==="string"||s==="number"))&&(n[r]=i):s===typeof n[r]&&(n[r]=r==="rotate"?i%4:i)}return n}const fu=/[\s,]+/;function mu(e,t){t.split(fu).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function pu(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function r(i){for(;i<0;)i+=4;return i%4}if(n===""){const i=parseInt(e);return isNaN(i)?0:r(i)}else if(n!==e){let i=0;switch(n){case"%":i=25;break;case"deg":i=90}if(i){let s=parseFloat(e.slice(0,e.length-n.length));return isNaN(s)?0:(s=s/i,s%1===0?r(s):0)}}return t}function hu(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in t)n+=" "+r+'="'+t[r]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+e+"</svg>"}function gu(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function yu(e){return"data:image/svg+xml,"+gu(e)}function bu(e){return'url("'+yu(e)+'")'}let it;function xu(){try{it=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{it=null}}function vu(e){return it===void 0&&xu(),it?it.createHTML(e):e}const ms={...ls,inline:!1},wu={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},Eu={display:"inline-block"},Qn={backgroundColor:"currentColor"},ps={backgroundColor:"transparent"},si={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},oi={WebkitMask:Qn,mask:Qn,background:ps};for(const e in oi){const t=oi[e];for(const n in si)t[e+n]=si[n]}const Su={...ms,inline:!0};function ai(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}const Nu=(e,t,n)=>{const r=t.inline?Su:ms,i=du(r,t),s=t.mode||"svg",o={},a=t.style||{},c={...s==="svg"?wu:{}};if(n){const m=un(n,!1,!0);if(m){const S=["iconify"],M=["provider","prefix"];for(const x of M)m[x]&&S.push("iconify--"+m[x]);c.className=S.join(" ")}}for(let m in t){const S=t[m];if(S!==void 0)switch(m){case"icon":case"style":case"children":case"onLoad":case"mode":case"ssr":break;case"_ref":c.ref=S;break;case"className":c[m]=(c[m]?c[m]+" ":"")+S;break;case"inline":case"hFlip":case"vFlip":i[m]=S===!0||S==="true"||S===1;break;case"flip":typeof S=="string"&&mu(i,S);break;case"color":o.color=S;break;case"rotate":typeof S=="string"?i[m]=pu(S):typeof S=="number"&&(i[m]=S);break;case"ariaHidden":case"aria-hidden":S!==!0&&S!=="true"&&delete c["aria-hidden"];break;default:r[m]===void 0&&(c[m]=S)}}const u=Fc(e,i),l=u.attributes;if(i.inline&&(o.verticalAlign="-0.125em"),s==="svg"){c.style={...o,...a},Object.assign(c,l);let m=0,S=t.id;return typeof S=="string"&&(S=S.replace(/-/g,"_")),c.dangerouslySetInnerHTML={__html:vu(Uc(u.body,S?()=>S+"ID"+m++:"iconifyReact"))},T.createElement("svg",c)}const{body:y,width:j,height:b}=e,h=s==="mask"||(s==="bg"?!1:y.indexOf("currentColor")!==-1),_=hu(y,{...l,width:j+"",height:b+""});return c.style={...o,"--svg":bu(_),width:ai(l.width),height:ai(l.height),...Eu,...h?Qn:ps,...a},T.createElement("span",c)};cs(!0);qc("",Xc);if(typeof document<"u"&&typeof window<"u"){const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(r=>{try{(typeof r!="object"||r===null||r instanceof Array||typeof r.icons!="object"||typeof r.prefix!="string"||!Mc(r))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(let n in t){const r="IconifyProviders["+n+"] is invalid.";try{const i=t[n];if(typeof i!="object"||!i||i.resources===void 0)continue;zc(n,i)||console.error(r)}catch{console.error(r)}}}}function hs(e){const[t,n]=T.useState(!!e.ssr),[r,i]=T.useState({});function s(b){if(b){const h=e.icon;if(typeof h=="object")return{name:"",data:h};const _=Zr(h);if(_)return{name:h,data:_}}return{name:""}}const[o,a]=T.useState(s(!!e.ssr));function c(){const b=r.callback;b&&(b(),i({}))}function u(b){if(JSON.stringify(o)!==JSON.stringify(b))return c(),a(b),!0}function l(){var b;const h=e.icon;if(typeof h=="object"){u({name:"",data:h});return}const _=Zr(h);if(u({name:h,data:_}))if(_===void 0){const m=lu([h],l);i({callback:m})}else _&&((b=e.onLoad)===null||b===void 0||b.call(e,h))}T.useEffect(()=>(n(!0),c),[]),T.useEffect(()=>{t&&l()},[e.icon,t]);const{name:y,data:j}=o;return j?Nu({...rr,...j},e,y):e.children?e.children:e.fallback?e.fallback:T.createElement("span",{})}const Cu=T.forwardRef((e,t)=>hs({...e,_ref:t}));T.forwardRef((e,t)=>hs({inline:!0,...e,_ref:t}));function Y({className:e,width:t=20,...n}){return p.jsx(Cu,{className:ne("mint-inline-block mint-shrink-0",e),width:t,height:t,...n})}const qe="data:image/svg+xml,%3csvg%20width='10'%20height='10'%20viewBox='0%200%2010%2010'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.95261%200.335011C1.50592%20-0.11167%200.781703%20-0.11167%200.335011%200.335011C-0.11167%200.781703%20-0.11167%201.50592%200.335011%201.95261L2.95767%204.57524L0.335011%207.19789C-0.11167%207.64454%20-0.11167%208.3688%200.335011%208.81546C0.781703%209.26212%201.50592%209.26212%201.95261%208.81546L4.57524%206.19282L7.19789%208.81546C7.64454%209.26212%208.3688%209.26212%208.81546%208.81546C9.26212%208.3688%209.26212%207.64454%208.81546%207.19789L6.19282%204.57524L8.81546%201.95261C9.26212%201.50592%209.26212%200.781703%208.81546%200.335011C8.3688%20-0.11167%207.64454%20-0.11167%207.19789%200.335011L4.57524%202.95767L1.95261%200.335011Z'%20fill='currentColor'/%3e%3c/svg%3e";function _u({open:e,onClick:t}){return p.jsx("button",{type:"button","aria-label":e?"Close assistant":"Open assistant",onClick:t,className:"mint-flex mint-h-12 mint-w-12 mint-items-center mint-justify-center mint-self-end mint-rounded-full mint-border-0 mint-bg-primary-light mint-p-0 mint-text-grey-800 mint-shadow-widget mint-transition-transform hover:mint-scale-105",children:e?p.jsx("span",{"aria-hidden":"true",className:"mint-h-4 mint-w-4 mint-shrink-0 mint-bg-current",style:{WebkitMask:`url(${qe}) center / contain no-repeat`,mask:`url(${qe}) center / contain no-repeat`}}):p.jsx(Y,{icon:"solar:chat-round-dots-bold",width:22})})}const Xt="data:image/svg+xml,%3csvg%20width='14'%20height='9'%20viewBox='0%200%2014%209'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8.67742%200.814748L12.3467%204.48402L8.67742%208.15329M4.48397%208.15329L0.814697%204.48402L4.48397%200.814749'%20stroke='currentColor'%20stroke-width='1.6295'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e";function Jt(e="tmp"){return`${e}_${Math.random().toString(36).slice(2)}${Date.now().toString(36)}`}function ju(e){const t=e.timestamp??e.createdAt??new Date().toISOString();return{...e,createdAt:t instanceof Date?t.toISOString():String(t),status:"sent"}}function gs(){const e=St(),{context:t}=ze(),{messages:n,draft:r,conversationId:i}=ft(c=>c.chatUi),[s,{isLoading:o}]=hc(),a=T.useCallback(async c=>{const u=(c??r).trim();if(!u||o)return;const l={id:Jt("user"),role:"user",content:u,createdAt:new Date().toISOString(),status:"sending"};e(rt(l)),e(nr(""));try{const y=await s({conversationId:i,message:u,context:t}).unwrap();i||e(yc(y.conversationId)),e(rt(ju(y.reply)))}catch{e(rt({id:Jt("err"),role:"system",content:"Failed to send. Please try again.",createdAt:new Date().toISOString(),status:"error"}))}},[r,o,e,s,i,t]);return{messages:n,draft:r,isLoading:o,send:a}}const Zt="data:image/svg+xml,%3csvg%20width='25'%20height='25'%20viewBox='0%200%2025%2025'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.64672%2011.1835C4.49248%2010.3977%206.17077%209.26593%207.59099%207.84916C9.56882%205.86738%2010.9799%203.3921%2011.6775%200.680538C11.7081%200.560106%2011.778%200.453311%2011.8761%200.377031C11.9742%200.300751%2012.0949%200.259338%2012.2192%200.259338C12.3434%200.259338%2012.4641%200.300751%2012.5622%200.377031C12.6603%200.453311%2012.7302%200.560106%2012.7608%200.680538C13.4599%203.39175%2014.8712%205.86675%2016.8484%207.84916C18.2688%209.26576%2019.947%2010.3975%2021.7927%2011.1835C22.5149%2011.4946%2023.2571%2011.7446%2024.0171%2011.9368C24.1382%2011.9666%2024.2459%2012.0361%2024.3229%2012.1343C24.3999%2012.2325%2024.4417%2012.3537%2024.4417%2012.4784C24.4417%2012.6032%2024.3999%2012.7244%2024.3229%2012.8226C24.2459%2012.9208%2024.1382%2012.9903%2024.0171%2013.0201C23.2571%2013.2112%2022.5171%2013.4612%2021.7927%2013.7723C19.9469%2014.558%2018.2686%2015.6898%2016.8484%2017.1066C14.8701%2019.0886%2013.4586%2021.5643%2012.7608%2024.2763C12.731%2024.3975%2012.6615%2024.5052%2012.5633%2024.5822C12.4651%2024.6592%2012.3439%2024.701%2012.2192%2024.701C12.0944%2024.701%2011.9732%2024.6592%2011.875%2024.5822C11.7768%2024.5052%2011.7073%2024.3975%2011.6775%2024.2763C11.4864%2023.5153%2011.2364%2022.7753%2010.9253%2022.0509C10.1396%2020.2051%209.00779%2018.5268%207.59099%2017.1066C5.60883%2015.1287%203.13317%2013.7176%200.421247%2013.0201C0.300816%2012.9895%200.194021%2012.9196%200.117743%2012.8215C0.0414619%2012.7234%204.76837e-05%2012.6027%204.76837e-05%2012.4784C4.76837e-05%2012.3542%200.0414619%2012.2335%200.117743%2012.1354C0.194021%2012.0373%200.300816%2011.9674%200.421247%2011.9368C1.18196%2011.7454%201.92616%2011.4935%202.64672%2011.1835Z'%20fill='currentColor'/%3e%3cpath%20d='M1.32299%2021.3266C1.78379%2021.1304%202.20277%2020.8479%202.55733%2020.4942C3.05109%2019.9994%203.40336%2019.3815%203.57752%2018.7045C3.58517%2018.6745%203.60261%2018.6478%203.6271%2018.6287C3.65159%2018.6097%203.68173%2018.5994%203.71275%2018.5994C3.74377%2018.5994%203.77391%2018.6097%203.79839%2018.6287C3.82288%2018.6478%203.84033%2018.6745%203.84797%2018.7045C4.0225%2019.3814%204.37483%2019.9993%204.86844%2020.4942C5.22304%2020.8478%205.64201%2021.1304%206.10278%2021.3266C6.28308%2021.4042%206.46836%2021.4667%206.65809%2021.5146C6.68834%2021.5221%206.71523%2021.5394%206.73445%2021.5639C6.75367%2021.5885%206.76411%2021.6187%206.76411%2021.6499C6.76411%2021.681%206.75367%2021.7113%206.73445%2021.7358C6.71523%2021.7603%206.68834%2021.7777%206.65809%2021.7851C6.46836%2021.8328%206.28363%2021.8952%206.10278%2021.9729C5.64199%2022.169%205.223%2022.4516%204.86844%2022.8053C4.37455%2023.3001%204.02218%2023.9181%203.84797%2024.5952C3.84054%2024.6255%203.82318%2024.6523%203.79866%2024.6716C3.77415%2024.6908%203.7439%2024.7012%203.71275%2024.7012C3.6816%2024.7012%203.65135%2024.6908%203.62683%2024.6716C3.60232%2024.6523%203.58496%2024.6255%203.57752%2024.5952C3.52982%2024.4052%203.46741%2024.2205%203.38974%2024.0396C3.19359%2023.5788%202.91103%2023.1598%202.55733%2022.8053C2.06248%2022.3115%201.44443%2021.9592%200.767403%2021.7851C0.737337%2021.7774%200.710676%2021.76%200.691632%2021.7355C0.672589%2021.711%200.66225%2021.6809%200.66225%2021.6499C0.66225%2021.6188%200.672589%2021.5887%200.691632%2021.5642C0.710676%2021.5397%200.737337%2021.5223%200.767403%2021.5146C0.957315%2021.4669%201.1431%2021.404%201.32299%2021.3266Z'%20fill='currentColor'/%3e%3cpath%20d='M19.1215%202.95604C19.5735%202.74047%2019.9801%202.44036%2020.3193%202.07191C20.7916%201.55662%2021.1173%200.924249%2021.2625%200.240516C21.2688%200.210152%2021.2851%200.182773%2021.3088%200.162706C21.3325%200.142639%2021.3621%200.131029%2021.3931%200.12971C21.4241%200.128391%2021.4547%200.13744%2021.4799%200.155425C21.5052%200.17341%2021.5238%200.199305%2021.5327%200.229019C21.7358%200.897842%2022.1141%201.50019%2022.6283%201.97367C22.9976%202.31193%2023.4282%202.57641%2023.8969%202.75286C24.0804%202.82279%2024.2681%202.87727%2024.4597%202.91715C24.4903%202.92329%2024.5179%202.93949%2024.5381%202.96316C24.5584%202.98684%2024.5701%203.01662%2024.5714%203.04774C24.5727%203.07886%2024.5636%203.10953%2024.5454%203.13484C24.5272%203.16015%2024.5011%203.17863%2024.4712%203.18735C24.2837%203.24308%2024.1018%203.31328%2023.9244%203.39857C23.4724%203.61414%2023.0658%203.91425%2022.7266%204.2827C22.2541%204.79805%2021.9284%205.43052%2021.7831%206.11438C21.777%206.14492%2021.7608%206.17252%2021.7371%206.19277C21.7134%206.21301%2021.6836%206.22473%2021.6525%206.22605C21.6214%206.22738%2021.5907%206.21823%2021.5654%206.20007C21.5401%206.18191%2021.5216%206.15579%2021.5129%206.12588C21.4572%205.93807%2021.3869%205.75616%2021.3017%205.57878C21.0861%205.12673%2020.786%204.72013%2020.4175%204.38094C19.9021%203.90864%2019.2697%203.58296%2018.5859%203.43775C18.5555%203.4314%2018.5281%203.4151%2018.508%203.39144C18.488%203.36779%2018.4764%203.33812%2018.4751%203.30712C18.4737%203.27613%2018.4828%203.24558%2018.5008%203.2203C18.5188%203.19503%2018.5446%203.17647%2018.5744%203.16755C18.7621%203.11174%2018.945%203.04101%2019.1215%202.95604Z'%20fill='currentColor'/%3e%3c/svg%3e";function ys({onSend:e,disabled:t}){const n=St(),r=ft(o=>o.chatUi.draft),i=T.useRef(null),s=o=>{o.key==="Enter"&&!o.shiftKey&&(o.preventDefault(),e())};return p.jsx("div",{className:"mint-px-5 mint-pb-5",children:p.jsxs("div",{className:"mint-flex mint-h-12 mint-items-center mint-gap-3 mint-rounded-lg mint-border mint-border-grey-200 mint-bg-white mint-px-3 mint-shadow-composer",children:[p.jsx("span",{"aria-hidden":"true",className:"mint-h-[20px] mint-w-[20px] mint-shrink-0 mint-bg-current mint-text-assistant-action",style:{WebkitMask:`url(${Zt}) center / contain no-repeat`,mask:`url(${Zt}) center / contain no-repeat`}}),p.jsx("textarea",{ref:i,rows:1,value:r,placeholder:"Ask the AI",onChange:o=>n(nr(o.target.value)),onKeyDown:s,className:"mint-scroll mint-h-5 mint-max-h-20 mint-flex-1 mint-resize-none mint-border-0 mint-bg-transparent mint-p-0 mint-text-xs mint-leading-5 mint-text-grey-800 mint-outline-none placeholder:mint-text-grey-600"}),p.jsx("button",{type:"button","aria-label":"Send message",disabled:t||!r.trim(),onClick:e,className:"mint-flex mint-h-7 mint-w-7 mint-shrink-0 mint-items-center mint-justify-center mint-rounded-md mint-border-0 mint-bg-assistant-action mint-p-0 mint-text-primary-contrast mint-transition-transform hover:mint-scale-105 disabled:mint-opacity-40 disabled:hover:mint-scale-100",children:p.jsx(Y,{icon:"solar:plain-2-bold",width:17})})]})})}const Ou="data:image/svg+xml,%3csvg%20width='13'%20height='14'%20viewBox='0%200%2013%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M4.55012%201.53112C5.27634%201.09946%205.63936%200.883636%206.0381%200.883636C6.43683%200.883636%206.79986%201.09946%207.52605%201.53112L9.70463%202.82608C10.4308%203.25774%2010.7939%203.47357%2010.9933%203.82906C11.1926%204.18455%2011.1926%204.61621%2011.1926%205.47953V8.06944C11.1926%208.93274%2011.1926%209.36439%2010.9933%209.71991C10.7939%2010.0754%2010.4308%2010.2912%209.70463%2010.7229L7.52605%2012.0179C6.79986%2012.4495%206.43683%2012.6653%206.0381%2012.6653C5.63936%2012.6653%205.27634%2012.4495%204.55012%2012.0179L2.37158%2010.7229C1.6454%2010.2912%201.28231%2010.0754%201.08296%209.71991C0.883606%209.36439%200.883606%208.93274%200.883606%208.06944V5.47953C0.883606%204.61621%200.883606%204.18455%201.08296%203.82906C1.28231%203.47357%201.6454%203.25774%202.37158%202.82608L4.55012%201.53112Z'%20stroke='currentColor'%20stroke-opacity='0.9'%20stroke-width='1.76725'/%3e%3c/svg%3e",ku="data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M13.9908%205.89076H10.8422L13.1573%201.8408C13.2219%201.72876%2013.256%201.60164%2013.2559%201.47226C13.2558%201.34288%2013.2217%201.2158%2013.1569%201.10382C13.0921%200.991833%2012.9989%200.8989%2012.8868%200.834375C12.7746%200.769851%2012.6475%200.736013%2012.5181%200.736269H7.36361C7.22677%200.736205%207.09262%200.774272%206.97621%200.846199C6.8598%200.918126%206.76574%201.02107%206.70457%201.14347L3.02279%208.50703C2.96668%208.61932%202.9402%208.7441%202.94588%208.8695C2.95156%208.9949%202.98921%209.11677%203.05524%209.22353C3.12127%209.33029%203.2135%209.41839%203.32317%209.47948C3.43284%209.54056%203.5563%209.5726%203.68183%209.57254H7.1103L5.18547%2015.9884C5.13663%2016.1506%205.1452%2016.3247%205.20973%2016.4813C5.27427%2016.6379%205.39083%2016.7675%205.53976%2016.8482C5.68869%2016.9289%205.86089%2016.9557%206.02733%2016.9243C6.19377%2016.8928%206.34428%2016.8049%206.45347%2016.6754L14.5534%207.1028C14.6441%206.99557%2014.7023%206.86462%2014.7211%206.72541C14.7398%206.58619%2014.7184%206.44452%2014.6592%206.3171C14.6001%206.18968%2014.5057%206.08184%2014.3873%206.0063C14.2689%205.93076%2014.1313%205.89067%2013.9908%205.89076ZM7.61176%2013.0253L8.80539%209.04899C8.83861%208.93895%208.84561%208.82267%208.82582%208.70944C8.80604%208.59622%208.76003%208.48919%208.69146%208.39694C8.6229%208.30469%208.53369%208.22977%208.43098%208.17817C8.32827%208.12658%208.21491%208.09975%208.09996%208.09983H4.87325L7.81868%202.20898H11.2486L8.93352%206.25894C8.86883%206.37098%208.8348%206.4981%208.83487%206.62748C8.83493%206.75686%208.86908%206.88394%208.93388%206.99592C8.99868%207.10791%209.09185%207.20084%209.20399%207.26536C9.31613%207.32989%209.4433%207.36373%209.57268%207.36347H12.4032L7.61176%2013.0253Z'%20fill='currentColor'%20fill-opacity='0.9'/%3e%3c/svg%3e",Iu="data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8.83631%201.47263C8.83631%201.47263%2013.9908%205.23937%2013.9908%2010.0823C13.9908%2011.5094%2013.4477%2012.878%2012.4811%2013.8871C11.5144%2014.8962%2010.2034%2015.4629%208.83639%2015.4629C7.46934%2015.4629%206.1582%2014.8965%205.19154%2013.8874C4.22489%2012.8783%203.68182%2011.5094%203.68182%2010.0823C3.68182%205.23937%208.83631%201.47263%208.83631%201.47263Z'%20stroke='currentColor'%20stroke-opacity='0.9'%20stroke-width='1.76725'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e";function Mu({message:e}){const t=e.role==="user";return e.role==="system"?p.jsx("div",{className:"mint-flex mint-justify-center mint-py-1",children:p.jsx("span",{className:"mint-rounded-full mint-bg-error/10 mint-px-3 mint-py-1 mint-text-xs mint-text-error",children:e.content})}):p.jsx("div",{className:ne("mint-flex mint-w-full",t?"mint-justify-end":"mint-justify-start"),children:p.jsx("div",{className:ne("mint-max-w-[78%] mint-whitespace-pre-wrap mint-break-words mint-rounded-2xl mint-px-4 mint-py-3 mint-text-sm mint-leading-relaxed",t?"mint-rounded-tr-sm mint-bg-grey-100 mint-text-grey-800":"mint-rounded-tl-sm mint-bg-primary-lighter/40 mint-text-grey-800",e.status==="sending"&&"mint-opacity-60"),children:e.content})})}const Pu=[{label:"Organization Carbon",icon:Ou},{label:"Organization Energy",icon:ku},{label:"Water Footprint",icon:Iu}];function Au({messages:e,isLoading:t}){const{welcomeMessage:n}=ze(),r=T.useRef(null);return T.useEffect(()=>{var i;(i=r.current)==null||i.scrollIntoView({behavior:"smooth"})},[e.length,t]),p.jsxs("div",{className:"mint-scroll mint-flex mint-flex-1 mint-flex-col mint-gap-5 mint-overflow-y-auto mint-px-6 mint-py-5",children:[e.length===0&&p.jsxs("div",{className:"mint-flex mint-flex-1 mint-flex-col mint-items-center mint-justify-center mint-px-1",children:[p.jsx("h3",{className:"mint-m-0 mint-text-center mint-text-[24px] mint-font-bold mint-leading-7 mint-text-grey-900",children:n}),p.jsx("div",{className:"mint-mt-4 mint-flex mint-w-fit mint-max-w-full mint-flex-wrap mint-items-center mint-justify-center mint-gap-3",children:Pu.map(i=>p.jsxs("button",{type:"button",className:"mint-inline-flex mint-max-w-full mint-items-center mint-justify-center mint-gap-0.5 mint-whitespace-nowrap mint-rounded-[7px] mint-border-[0.125px] mint-border-solid mint-border-assistant-accent mint-bg-assistant-accent/5 mint-px-2.5 mint-py-1 mint-text-[7px] mint-font-normal mint-leading-none mint-text-grey-900",children:[p.jsx("span",{"aria-hidden":"true",className:"mint-h-3 mint-w-3 mint-shrink-0 mint-bg-current",style:{WebkitMask:`url(${i.icon}) center / contain no-repeat`,mask:`url(${i.icon}) center / contain no-repeat`}}),i.label]},i.label))})]}),e.map(i=>p.jsx(Mu,{message:i},i.id)),t&&p.jsx("div",{className:"mint-flex mint-justify-start",children:p.jsxs("div",{className:"mint-flex mint-gap-1 mint-rounded-2xl mint-rounded-tl-sm mint-bg-primary-lighter/40 mint-px-4 mint-py-3",children:[p.jsx("span",{className:"mint-h-2 mint-w-2 mint-animate-bounce mint-rounded-full mint-bg-grey-500 [animation-delay:-0.3s]"}),p.jsx("span",{className:"mint-h-2 mint-w-2 mint-animate-bounce mint-rounded-full mint-bg-grey-500 [animation-delay:-0.15s]"}),p.jsx("span",{className:"mint-h-2 mint-w-2 mint-animate-bounce mint-rounded-full mint-bg-grey-500"})]})}),p.jsx("div",{ref:r})]})}function Du(){const e=St(),{title:t,enableExpandMode:n,formContent:r,renderForm:i}=ze(),{messages:s,isLoading:o,send:a}=gs(),c=n||!!(i||r);return p.jsx("div",{className:"mint-ai-shell",children:p.jsxs("div",{className:"mint-ai-panel mint-flex mint-flex-col mint-overflow-hidden mint-rounded-xl mint-bg-white",children:[p.jsxs("div",{className:"mint-mx-2 mint-flex mint-h-[72px] mint-shrink-0 mint-items-center mint-justify-between mint-gap-3 mint-px-3 mint-py-2",children:[p.jsxs("div",{className:"mint-min-w-0",children:[p.jsx("h2",{className:"mint-m-0 mint-truncate mint-text-[22px] mint-font-bold mint-leading-7 mint-text-grey-900",children:t}),p.jsx("p",{className:"mint-m-0 mint-mt-2 mint-text-xs mint-leading-4 mint-text-grey-500",children:"AI assisted disclosure and operational data capture"})]}),p.jsxs("div",{className:"mint-flex mint-shrink-0 mint-items-center mint-gap-2",children:[c&&p.jsx("button",{type:"button","aria-label":"Open expand mode",onClick:()=>e(ts(!0)),className:"mint-flex mint-h-7 mint-w-7 mint-shrink-0 mint-items-center mint-justify-center mint-rounded-full mint-border-0 mint-bg-assistant-action mint-p-0 mint-text-grey-800 mint-transition-transform hover:mint-scale-105",children:p.jsx("span",{"aria-hidden":"true",className:"mint-block mint-h-2.5 mint-w-3 mint-shrink-0 mint-bg-current",style:{WebkitMask:`url(${Xt}) center / contain no-repeat`,mask:`url(${Xt}) center / contain no-repeat`}})}),p.jsx("button",{type:"button","aria-label":"Close assistant",onClick:()=>e(tr(!1)),className:"mint-flex mint-h-7 mint-w-7 mint-shrink-0 mint-items-center mint-justify-center mint-rounded-full mint-border-0 mint-bg-assistant-action mint-p-0 mint-text-grey-800 mint-transition-transform hover:mint-scale-105",children:p.jsx("span",{"aria-hidden":"true",className:"mint-block mint-h-2 mint-w-2 mint-shrink-0 mint-translate-y-[2px] mint-bg-current",style:{WebkitMask:`url(${qe}) center / contain no-repeat`,mask:`url(${qe}) center / contain no-repeat`}})})]})]}),p.jsx("div",{className:"mint-mx-2 mint-h-px mint-shrink-0 mint-bg-assistant-divider"}),p.jsx(Au,{messages:s,isLoading:o}),p.jsx(ys,{onSend:()=>a(),disabled:o})]})})}const Ru=["I found the Energy Consumption...","Explain sustainability data","We consumed 18,400 kWh electri..."],Tu={initials:"HW",name:"Henry Williams",email:"henrywilliams@company.com",avatarUrl:""},Vu={intro:"I found the Energy Consumption form. Expand to review fields and submit evidence. Matched form Energy Consumption Confidence 94% - 5 fields",fields:{emissionType:{label:"Emission Type",value:"Purchased electricity",options:["Purchased electricity","Facility level refrigerant leakage","Stationary combustion"]},factorSource:{label:"Emission Factor Source",value:"DEFRA",options:["DEFRA","IPCC"],helper:"Only IPCC / DEFRA (no Custom)."},month:{label:"Month",value:"February",options:["January","February","March","April"]},consumption:{label:"Consumption",value:18400},unit:{label:"Unit",value:"kWh",options:["kWh","MWh"],helper:"Electricity usage from the uploaded utility bill."},notes:{label:"AI Notes",value:"Matched because the user mentioned electricity usage, a facility, and a reporting month. Review evidence before submit."}}},Fu=[{id:"expanded-demo-user-mapped",role:"user",content:"I mapped this to Scope 2 purchased electricity and filled the matching fields.",createdAt:"2026-06-24T00:01:00.000Z",status:"sent"},{id:"expanded-demo-user-confirm",role:"user",content:"Please confirm the reporting period and upload or reference the utility bill.",createdAt:"2026-06-24T00:02:00.000Z",status:"sent"}],$u="Demo response: I kept the same temporary Energy Consumption preview values. Submit Entry will only show a frontend demo success message.";function bs({user:e,size:t="sm"}){const n=ne("mint-flex mint-shrink-0 mint-items-center mint-justify-center mint-overflow-hidden mint-rounded-full mint-bg-grey-200 mint-font-bold mint-text-grey-700",t==="md"?"mint-h-9 mint-w-9 mint-text-xs":"mint-h-8 mint-w-8 mint-text-xs");return e.avatarUrl?p.jsx("img",{src:e.avatarUrl,alt:e.name,className:ne(n,"mint-object-cover")}):p.jsx("div",{className:n,children:e.initials})}function Lu({user:e}){return p.jsxs("aside",{className:"mint-flex mint-w-[230px] mint-shrink-0 mint-flex-col mint-rounded-xl mint-border mint-border-grey-200 mint-bg-white mint-p-4 mint-shadow-sm",children:[p.jsx("h1",{className:"mint-m-0 mint-text-[28px] mint-font-extrabold mint-leading-9 mint-text-grey-900",children:"MINT AI"}),p.jsxs("div",{className:"mint-mt-6 mint-flex mint-h-9 mint-items-center mint-gap-2 mint-rounded-lg mint-border mint-border-grey-200 mint-bg-white mint-px-3 mint-shadow-sm",children:[p.jsx(Y,{icon:"solar:magnifer-linear",width:17,className:"mint-text-grey-500"}),p.jsx("span",{className:"mint-flex-1 mint-text-xs mint-text-grey-500",children:"Search"}),p.jsx("span",{"aria-hidden":"true",className:"mint-h-4 mint-w-4 mint-shrink-0 mint-bg-current mint-text-assistant-action",style:{WebkitMask:`url(${Zt}) center / contain no-repeat`,mask:`url(${Zt}) center / contain no-repeat`}}),p.jsx(Y,{icon:"solar:magic-stars-bold",width:16,className:"mint-text-primary-light"})]}),p.jsxs("button",{type:"button",className:"mint-mt-4 mint-flex mint-items-center mint-gap-2 mint-border-0 mint-bg-transparent mint-px-2 mint-py-1 mint-text-xs mint-font-semibold mint-text-grey-800",children:[p.jsx(Y,{icon:"solar:history-linear",width:17}),"History"]}),p.jsxs("div",{className:"mint-mt-4 mint-flex mint-flex-1 mint-flex-col mint-gap-1",children:[p.jsxs("div",{className:"mint-flex mint-items-center mint-gap-1 mint-px-2 mint-py-1 mint-text-xs mint-font-semibold mint-text-grey-700",children:["Recents",p.jsx(Y,{icon:"mingcute:down-line",width:13,className:"mint-text-grey-500"})]}),Ru.map((t,n)=>p.jsx("button",{type:"button",className:ne("mint-truncate mint-rounded mint-border-0 mint-bg-transparent mint-px-2 mint-py-1 mint-text-left mint-text-xs mint-text-grey-600",n===0&&"mint-bg-grey-200 mint-text-grey-700"),children:t},t))]}),p.jsxs("div",{className:"mint-flex mint-items-center mint-gap-2 mint-rounded-md mint-border mint-border-grey-200 mint-p-2",children:[p.jsx(bs,{user:e}),p.jsxs("div",{className:"mint-min-w-0",children:[p.jsx("p",{className:"mint-m-0 mint-truncate mint-text-[10px] mint-font-semibold mint-leading-3 mint-text-grey-900",children:e.name}),e.email&&p.jsx("p",{className:"mint-m-0 mint-truncate mint-text-[9px] mint-leading-3 mint-text-grey-500",children:e.email})]})]})]})}function Fe({children:e}){return p.jsx("label",{className:"mint-text-[7px] mint-font-semibold mint-leading-3 mint-text-grey-800",children:e})}function At({value:e,options:t}){return p.jsxs("div",{className:"mint-relative",children:[p.jsx("select",{defaultValue:e,className:"mint-h-6 mint-w-full mint-appearance-none mint-rounded mint-border mint-border-grey-200 mint-bg-white mint-px-2 mint-pr-5 mint-text-[7px] mint-text-grey-800 mint-outline-none",children:t.map(n=>p.jsx("option",{value:n,children:n},n))}),p.jsx(Y,{icon:"mingcute:down-line",width:10,className:"mint-pointer-events-none mint-absolute mint-right-2 mint-top-1/2 mint--translate-y-1/2 mint-text-grey-500"})]})}function Qu(){const[e,t]=T.useState(!1),{fields:n,intro:r}=Vu;return p.jsxs("div",{className:"mint-w-[370px] mint-max-w-full mint-rounded-md mint-bg-primary-lighter/40 mint-p-3",children:[p.jsx("p",{className:"mint-m-0 mint-text-[10px] mint-leading-4 mint-text-grey-900",children:r}),p.jsxs("div",{className:"mint-mt-3 mint-rounded-md mint-border mint-border-grey-100 mint-bg-white mint-p-3 mint-shadow-sm",children:[p.jsxs("div",{className:"mint-grid mint-grid-cols-2 mint-gap-x-3 mint-gap-y-3",children:[p.jsxs("div",{className:"mint-flex mint-flex-col mint-gap-1",children:[p.jsx(Fe,{children:n.emissionType.label}),p.jsx(At,{value:n.emissionType.value,options:n.emissionType.options})]}),p.jsxs("div",{className:"mint-flex mint-flex-col mint-gap-1",children:[p.jsx(Fe,{children:n.factorSource.label}),p.jsx(At,{value:n.factorSource.value,options:n.factorSource.options}),p.jsx("p",{className:"mint-m-0 mint-text-[6px] mint-leading-3 mint-text-grey-500",children:n.factorSource.helper})]}),p.jsxs("div",{className:"mint-flex mint-flex-col mint-gap-1",children:[p.jsx(Fe,{children:n.month.label}),p.jsx(At,{value:n.month.value,options:n.month.options})]}),p.jsxs("div",{className:"mint-flex mint-flex-col mint-gap-1",children:[p.jsx(Fe,{children:n.unit.label}),p.jsx(At,{value:n.unit.value,options:n.unit.options}),p.jsx("p",{className:"mint-m-0 mint-text-[6px] mint-leading-3 mint-text-grey-500",children:n.unit.helper})]}),p.jsxs("div",{className:"mint-flex mint-flex-col mint-gap-1",children:[p.jsx(Fe,{children:n.consumption.label}),p.jsx("input",{type:"number",defaultValue:n.consumption.value,className:"mint-h-6 mint-w-full mint-rounded mint-border mint-border-grey-200 mint-bg-white mint-px-2 mint-text-[7px] mint-text-grey-800 mint-outline-none"})]})]}),p.jsxs("div",{className:"mint-mt-3 mint-flex mint-flex-col mint-gap-1",children:[p.jsx(Fe,{children:n.notes.label}),p.jsx("textarea",{rows:2,defaultValue:n.notes.value,className:"mint-scroll mint-w-full mint-resize-none mint-rounded mint-border mint-border-primary-light mint-bg-primary-lighter/40 mint-px-2 mint-py-1.5 mint-text-[7px] mint-leading-3 mint-text-grey-800 mint-outline-none"})]}),e&&p.jsx("div",{className:"mint-mt-3 mint-rounded mint-border mint-border-primary-light mint-bg-primary-lighter/40 mint-px-2 mint-py-1.5 mint-text-[7px] mint-font-semibold mint-text-primary-dark",children:"Demo success: entry submitted."}),p.jsxs("div",{className:"mint-mt-3 mint-flex mint-items-center mint-justify-end mint-gap-2",children:[p.jsx("button",{type:"button",className:"mint-rounded mint-border mint-border-grey-300 mint-bg-white mint-px-2 mint-py-1 mint-text-[7px] mint-font-semibold mint-text-grey-700 mint-transition-colors hover:mint-bg-grey-100",children:"Save Draft"}),p.jsx("button",{type:"button",onClick:()=>t(!0),className:"mint-rounded mint-border-0 mint-bg-primary-dark mint-px-2 mint-py-1 mint-text-[7px] mint-font-semibold mint-text-primary-contrast mint-transition-colors hover:mint-bg-primary-darker",children:"Submit Entry"})]})]})]})}function Uu({message:e,user:t}){const n=e.role==="user";return p.jsxs("div",{className:ne("mint-flex mint-w-full mint-items-start mint-gap-3",n?"mint-justify-end":"mint-justify-start"),children:[n&&p.jsx(bs,{user:t,size:"md"}),p.jsx("div",{className:ne("mint-max-w-[520px] mint-whitespace-pre-wrap mint-break-words mint-rounded-md mint-px-5 mint-py-3 mint-text-xs mint-leading-5 mint-text-grey-800",n?"mint-bg-grey-100":"mint-bg-primary-lighter/40"),children:e.content})]})}function qu(){const e=St(),{title:t}=ze(),{messages:n,draft:r}=ft(a=>a.chatUi),i=Tu,s=[...Fu,...n],o=()=>{const a=r.trim();a&&(e(rt({id:Jt("user"),role:"user",content:a,createdAt:new Date().toISOString(),status:"sent"})),e(nr("")),e(rt({id:Jt("assistant"),role:"assistant",content:$u,createdAt:new Date().toISOString(),status:"sent"})))};return p.jsxs("div",{className:"mint-flex mint-h-[min(720px,calc(100vh-112px))] mint-w-[min(1100px,calc(100vw-32px))] mint-gap-3 mint-rounded-2xl mint-bg-assistant-shell mint-p-3",children:[p.jsx(Lu,{user:i}),p.jsxs("section",{className:"mint-relative mint-flex mint-min-w-0 mint-flex-1 mint-flex-col mint-overflow-hidden mint-rounded-xl mint-border mint-border-grey-200 mint-bg-white mint-shadow-sm",children:[p.jsxs("div",{className:"mint-flex mint-h-[82px] mint-shrink-0 mint-items-center mint-justify-between mint-gap-3 mint-px-6 mint-py-3",children:[p.jsxs("div",{className:"mint-min-w-0",children:[p.jsxs("h2",{className:"mint-m-0 mint-truncate mint-text-[22px] mint-font-bold mint-leading-7 mint-text-grey-900",children:[t," Expanded mode"]}),p.jsx("p",{className:"mint-m-0 mint-mt-2 mint-text-xs mint-leading-4 mint-text-grey-500",children:"AI conversation with live form filling"})]}),p.jsxs("div",{className:"mint-flex mint-items-center mint-gap-2",children:[p.jsx("button",{type:"button","aria-label":"Back to normal mode",onClick:()=>e(ts(!1)),className:"mint-flex mint-h-8 mint-w-8 mint-shrink-0 mint-items-center mint-justify-center mint-rounded-full mint-border-0 mint-bg-assistant-action mint-p-0 mint-text-grey-800 mint-transition-transform hover:mint-scale-105",children:p.jsx("span",{"aria-hidden":"true",className:"mint-block mint-h-3 mint-w-4 mint-shrink-0 mint-bg-current",style:{WebkitMask:`url(${Xt}) center / contain no-repeat`,mask:`url(${Xt}) center / contain no-repeat`}})}),p.jsx("button",{type:"button","aria-label":"Close assistant",onClick:()=>e(tr(!1)),className:"mint-flex mint-h-8 mint-w-8 mint-shrink-0 mint-items-center mint-justify-center mint-rounded-full mint-border-0 mint-bg-assistant-action mint-p-0 mint-text-grey-800 mint-transition-transform hover:mint-scale-105",children:p.jsx("span",{"aria-hidden":"true",className:"mint-block mint-h-2.5 mint-w-2.5 mint-shrink-0 mint-bg-current",style:{WebkitMask:`url(${qe}) center / contain no-repeat`,mask:`url(${qe}) center / contain no-repeat`}})})]})]}),p.jsx("div",{className:"mint-mx-6 mint-h-px mint-shrink-0 mint-bg-assistant-divider"}),p.jsxs("div",{className:"mint-scroll mint-flex mint-flex-1 mint-flex-col mint-gap-5 mint-overflow-y-auto mint-px-[66px] mint-pb-28 mint-pt-3",children:[p.jsx("div",{className:"mint-flex mint-justify-start",children:p.jsx(Qu,{})}),p.jsx("div",{className:"mint-min-h-3"}),s.map(a=>p.jsx(Uu,{message:a,user:i},a.id))]}),p.jsx("div",{className:"mint-absolute mint-bottom-0 mint-left-[66px] mint-right-[66px]",children:p.jsx(ys,{onSend:o})})]})]})}const zu={"bottom-right":"mint-bottom-4 mint-right-4 mint-items-end","bottom-left":"mint-bottom-4 mint-left-4 mint-items-start","top-right":"mint-top-4 mint-right-4 mint-items-end","top-left":"mint-top-4 mint-left-4 mint-items-start"},Wu={"bottom-right":"mint-items-end mint-justify-start","bottom-left":"mint-items-start mint-justify-start","top-right":"mint-items-end mint-justify-start","top-left":"mint-items-start mint-justify-start"};function Hu(){const e=St(),{placement:t,defaultOpen:n}=ze(),r=ft(s=>s.chatUi.open),i=ft(s=>s.chatUi.expanded);return T.useEffect(()=>{n&&e(tr(!0))},[n,e]),p.jsxs("div",{className:ne("mint-fixed mint-z-widget mint-flex mint-gap-3",i?`mint-inset-0 mint-flex-col mint-bg-black/20 mint-p-4 ${Wu[t]}`:`mint-flex-col ${zu[t]}`),children:[r&&(i?p.jsx(qu,{}):p.jsx(Du,{})),p.jsx("div",{className:i?"mint-absolute mint-bottom-4 mint-right-4":void 0,children:p.jsx(_u,{open:r,onClick:()=>e(gc())})})]})}function Bu({children:e,...t}){return p.jsxs(vc,{config:t,children:[p.jsx(Hu,{}),e]})}const xs="ESM Sustainability AI",vs="AI assisted disclosure and operational data capture",Ku="ESM Sustainability AI Expanded mode",Gu="AI conversation with live form filling",Yu=[{label:"Organization Carbon",icon:"solar:hexagon-linear"},{label:"Organization Energy",icon:"solar:bolt-bold"},{label:"Water Footprint",icon:"solar:waterdrop-linear"}],Xu=[{id:"t1",role:"assistant",content:"I found the Energy Consumption form. Expand to review fields and submit evidence. Matched form Energy Consumption Confidence 94% • 5 fields"},{id:"t2",role:"user",content:"I mapped this to Scope 2 purchased electricity and filled the matching fields."}];function en({icon:e,label:t,onClick:n,className:r}){return p.jsx("button",{type:"button","aria-label":t,onClick:n,className:ne("mint-flex mint-h-10 mint-w-10 mint-shrink-0 mint-items-center mint-justify-center","mint-rounded-full mint-border-0 mint-bg-primary-light mint-p-0 mint-text-grey-800","mint-transition-transform hover:mint-scale-105",r),children:p.jsx(Y,{icon:e,width:18})})}function ws({title:e,subtitle:t,large:n,onClose:r}){return p.jsxs("div",{className:"mint-flex mint-items-start mint-justify-between mint-gap-3 mint-border-b mint-border-grey-200 mint-px-6 mint-py-5",children:[p.jsxs("div",{className:"mint-min-w-0",children:[p.jsx("h2",{className:ne("mint-truncate mint-font-bold mint-text-grey-900",n?"mint-text-3xl":"mint-text-2xl"),children:e}),p.jsx("p",{className:"mint-mt-1 mint-text-sm mint-text-grey-500",children:t})]}),p.jsxs("div",{className:"mint-flex mint-items-center mint-gap-2",children:[p.jsx(en,{icon:"mingcute:code-line",label:"Toggle code view"}),p.jsx(en,{icon:"mingcute:close-line",label:"Close",onClick:r})]})]})}function Es(){return p.jsx("span",{className:"mint-flex mint-h-12 mint-w-12 mint-shrink-0 mint-items-center mint-justify-center mint-rounded-full mint-bg-gradient-to-br mint-from-primary-light mint-to-primary mint-text-lg mint-font-semibold mint-text-primary-contrast",children:"M"})}function Ju(){return p.jsx("span",{className:"mint-flex mint-h-12 mint-w-12 mint-shrink-0 mint-items-center mint-justify-center mint-overflow-hidden mint-rounded-full mint-bg-grey-300 mint-text-sm mint-font-semibold mint-text-grey-700",children:"HW"})}function ar({leading:e="attach",compact:t}){return t?p.jsxs("div",{className:"mint-flex mint-h-11 mint-items-center mint-gap-2 mint-rounded-lg mint-border mint-border-grey-200 mint-bg-white mint-px-3 mint-shadow-widget",children:[p.jsx(Y,{icon:"solar:magic-stars-bold",width:18,className:"mint-shrink-0 mint-text-primary-light"}),p.jsx("span",{className:"mint-flex-1 mint-text-xs mint-text-grey-500",children:"Ask the AI"}),p.jsx("button",{type:"button","aria-label":"Send",className:"mint-flex mint-h-7 mint-w-7 mint-items-center mint-justify-center mint-rounded-md mint-border-0 mint-bg-primary-light mint-p-0 mint-text-primary-contrast mint-shadow-sm mint-transition-transform hover:mint-scale-105",children:p.jsx(Y,{icon:"solar:plain-2-bold",width:17})})]}):p.jsxs("div",{className:"mint-rounded-2xl mint-border mint-border-grey-300 mint-bg-white mint-px-5 mint-py-4 mint-shadow-sm",children:[p.jsxs("div",{className:"mint-flex mint-items-center mint-gap-2 mint-text-lg mint-text-grey-500",children:[p.jsx(Y,{icon:"solar:magic-stars-bold",width:20,className:"mint-text-primary-light"}),p.jsx("span",{children:"Ask the AI"})]}),p.jsxs("div",{className:"mint-mt-4 mint-flex mint-items-end mint-justify-between",children:[p.jsx("button",{type:"button","aria-label":e==="attach"?"Attach file":"Add",className:"mint-flex mint-h-11 mint-w-11 mint-items-center mint-justify-center mint-rounded-full mint-border mint-border-primary-light mint-bg-transparent mint-p-0 mint-text-primary mint-transition-colors hover:mint-bg-primary-lighter",children:p.jsx(Y,{icon:e==="attach"?"solar:paperclip-linear":"mingcute:add-line",width:20})}),p.jsx("button",{type:"button","aria-label":"Send",className:"mint-flex mint-h-11 mint-w-11 mint-items-center mint-justify-center mint-rounded-xl mint-border-0 mint-bg-primary-light mint-p-0 mint-text-primary-contrast mint-shadow-sm mint-transition-transform hover:mint-scale-105",children:p.jsx(Y,{icon:"solar:arrow-up-linear",width:22})})]})]})}function Ss({onClose:e}){return p.jsxs("div",{className:"mint-flex mint-h-[640px] mint-max-h-[85vh] mint-w-[420px] mint-max-w-[calc(100vw-32px)] mint-flex-col mint-overflow-hidden mint-rounded-2xl mint-bg-white mint-shadow-widget",children:[p.jsx(ws,{title:xs,subtitle:vs,onClose:e}),p.jsxs("div",{className:"mint-flex mint-flex-1 mint-flex-col mint-items-center mint-justify-center mint-px-6",children:[p.jsx("h3",{className:"mint-text-center mint-text-3xl mint-font-bold mint-text-grey-900",children:"What can I help with?"}),p.jsx("div",{className:"mint-mt-6 mint-flex mint-flex-wrap mint-justify-center mint-gap-3",children:Yu.map(t=>p.jsxs("button",{type:"button",className:"mint-flex mint-items-center mint-gap-2 mint-rounded-full mint-border mint-border-grey-300 mint-bg-white mint-px-4 mint-py-2 mint-text-sm mint-font-medium mint-text-grey-700 mint-transition-colors hover:mint-border-primary hover:mint-text-primary",children:[p.jsx(Y,{icon:t.icon,width:16,className:"mint-text-grey-600"}),t.label]},t.label))})]}),p.jsx("div",{className:"mint-px-5 mint-pb-5",children:p.jsx(ar,{leading:"attach"})})]})}function Zu({role:e,children:t}){const n=e==="user";return p.jsxs("div",{className:ne("mint-flex mint-items-start mint-gap-3",n&&"mint-flex-row-reverse"),children:[n?p.jsx(Ju,{}):p.jsx(Es,{}),p.jsx("div",{className:ne("mint-max-w-[78%] mint-rounded-2xl mint-px-4 mint-py-3 mint-text-sm mint-leading-relaxed",n?"mint-rounded-tr-sm mint-bg-grey-100 mint-text-grey-800":"mint-rounded-tl-sm mint-bg-primary-lighter/40 mint-text-grey-800"),children:t})]})}function Ns({onClose:e}){return p.jsxs("div",{className:"mint-flex mint-h-[640px] mint-max-h-[85vh] mint-w-[420px] mint-max-w-[calc(100vw-32px)] mint-flex-col mint-overflow-hidden mint-rounded-2xl mint-bg-white mint-shadow-widget",children:[p.jsx(ws,{title:xs,subtitle:vs,onClose:e}),p.jsxs("div",{className:"mint-scroll mint-flex mint-flex-1 mint-flex-col mint-gap-5 mint-overflow-y-auto mint-px-5 mint-py-5",children:[Xu.map(t=>p.jsx(Zu,{role:t.role,children:t.content},t.id)),p.jsxs("div",{className:"mint-flex mint-items-start mint-gap-3",children:[p.jsx(Es,{}),p.jsxs("div",{className:"mint-max-w-[78%] mint-rounded-2xl mint-rounded-tl-sm mint-bg-primary-lighter/40 mint-px-4 mint-py-3",children:[p.jsx("p",{className:"mint-text-sm mint-font-semibold mint-text-grey-900",children:"AI conversation with live form filling"}),p.jsx("p",{className:"mint-mt-1 mint-text-sm mint-text-grey-700",children:"Expand to open the AI conversation and live form filling experience."}),p.jsxs("button",{type:"button",className:"mint-mt-3 mint-flex mint-items-center mint-gap-1.5 mint-rounded-lg mint-bg-gradient-to-br mint-from-primary-light mint-to-primary mint-px-3 mint-py-2 mint-text-xs mint-font-semibold mint-text-primary-contrast mint-transition-transform hover:mint-scale-105",children:[p.jsx(Y,{icon:"mingcute:code-line",width:14}),"Open Expand mode"]})]})]})]}),p.jsx("div",{className:"mint-px-5 mint-pb-5",children:p.jsx(ar,{leading:"attach"})})]})}function el(){return p.jsxs("aside",{className:"mint-flex mint-w-[226px] mint-shrink-0 mint-flex-col mint-gap-5 mint-rounded-xl mint-border mint-border-grey-200 mint-bg-white mint-p-4 mint-shadow-sm",children:[p.jsx("h1",{className:"mint-m-0 mint-text-[28px] mint-font-extrabold mint-leading-9 mint-text-grey-900",children:"MINT AI"}),p.jsxs("div",{className:"mint-flex mint-h-8 mint-items-center mint-gap-2 mint-rounded-lg mint-border mint-border-grey-200 mint-bg-white mint-px-3 mint-shadow-sm",children:[p.jsx(Y,{icon:"solar:magnifer-linear",width:17,className:"mint-text-grey-500"}),p.jsx("span",{className:"mint-flex-1 mint-text-xs mint-text-grey-500",children:"Search"}),p.jsx(Y,{icon:"solar:magic-stars-bold",width:16,className:"mint-text-primary-light"})]}),p.jsxs("button",{type:"button",className:"mint-flex mint-items-center mint-gap-2 mint-border-0 mint-bg-transparent mint-px-2 mint-text-xs mint-font-semibold mint-text-grey-800",children:[p.jsx(Y,{icon:"solar:history-linear",width:17}),"History"]}),p.jsx("div",{className:"mint-flex mint-flex-1 mint-flex-col mint-gap-1",children:p.jsxs("div",{className:"mint-flex mint-items-center mint-gap-1 mint-px-2 mint-py-1 mint-text-xs mint-font-semibold mint-text-grey-700",children:["Recents",p.jsx(Y,{icon:"mingcute:down-line",width:13,className:"mint-text-grey-500"})]})})]})}function Cs({onCollapse:e,onClose:t}){return p.jsxs("div",{className:"mint-flex mint-h-[min(92vh,614px)] mint-w-[min(1080px,calc(100vw-32px))] mint-gap-3 mint-rounded-2xl mint-bg-assistant-shell mint-p-2",children:[p.jsx(el,{}),p.jsxs("section",{className:"mint-relative mint-flex mint-flex-1 mint-flex-col mint-overflow-hidden mint-rounded-xl mint-border mint-border-grey-200 mint-bg-white mint-shadow-sm",children:[p.jsxs("div",{className:"mint-flex mint-items-start mint-justify-between mint-gap-3 mint-px-6 mint-py-3",children:[p.jsxs("div",{className:"mint-min-w-0",children:[p.jsx("h2",{className:"mint-m-0 mint-truncate mint-text-[22px] mint-font-bold mint-leading-7 mint-text-grey-900",children:Ku}),p.jsx("p",{className:"mint-m-0 mint-mt-1 mint-text-xs mint-leading-4 mint-text-grey-500",children:Gu})]}),p.jsxs("div",{className:"mint-flex mint-items-center mint-gap-2",children:[p.jsx(en,{icon:"mingcute:code-line",label:"Back to normal mode",onClick:e,className:"mint-h-8 mint-w-8"}),p.jsx(en,{icon:"mingcute:close-line",label:"Close",onClick:t,className:"mint-h-8 mint-w-8"})]})]}),p.jsx("div",{className:"mint-mx-6 mint-h-px mint-shrink-0 mint-bg-grey-300"}),p.jsx("div",{className:"mint-scroll mint-flex mint-flex-1 mint-flex-col mint-overflow-y-auto mint-px-[66px] mint-pb-28 mint-pt-3"}),p.jsx("div",{className:"mint-absolute mint-bottom-8 mint-left-[66px] mint-right-[66px]",children:p.jsx(ar,{leading:"add",compact:!0})})]})]})}const tl=[{id:"empty",label:"Empty"},{id:"conversation",label:"Conversation"},{id:"expanded",label:"Expand mode"}];function nl({initial:e="empty"}){const[t,n]=T.useState(e);return p.jsxs("div",{className:"mint-ai-root mint-flex mint-min-h-screen mint-flex-col mint-items-center mint-gap-6 mint-bg-grey-200 mint-p-6",children:[p.jsx("div",{className:"mint-flex mint-gap-1 mint-rounded-full mint-bg-white mint-p-1 mint-shadow-sm",children:tl.map(r=>p.jsx("button",{type:"button",onClick:()=>n(r.id),className:ne("mint-rounded-full mint-px-4 mint-py-2 mint-text-sm mint-font-semibold mint-transition-colors",t===r.id?"mint-bg-primary mint-text-primary-contrast":"mint-text-grey-600 hover:mint-bg-grey-100"),children:r.label},r.id))}),p.jsxs("div",{className:"mint-flex mint-w-full mint-flex-1 mint-items-center mint-justify-center",children:[t==="empty"&&p.jsx(Ss,{}),t==="conversation"&&p.jsx(Ns,{}),t==="expanded"&&p.jsx(Cs,{})]}),p.jsx("button",{type:"button","aria-label":"Close assistant",className:"mint-fixed mint-bottom-6 mint-right-6 mint-flex mint-h-14 mint-w-14 mint-items-center mint-justify-center mint-rounded-full mint-bg-primary-light mint-text-grey-800 mint-shadow-widget mint-transition-transform hover:mint-scale-105",children:p.jsx(Y,{icon:"mingcute:close-line",width:24})})]})}exports.MintAIAssistant=Bu;exports.SampleConversationPanel=Ns;exports.SampleEmptyPanel=Ss;exports.SampleExpandedMode=Cs;exports.SampleShowcase=nl;exports.useChat=gs;exports.useConfig=ze;
41
+ If you have multiple apis, you *have* to specify the reducerPath option when using createApi!`:""}`)},Ba=({reducerPath:e,context:t,context:{endpointDefinitions:n},mutationThunk:r,queryThunk:i,api:s,assertTagType:o,refetchQuery:a,internalState:c})=>{const{removeQueryResult:u}=s.internalActions,l=be(_e(r),rn(r)),y=be(_e(i,r),ze(i,r));let j=[],b=0;const h=(S,M)=>{(i.pending.match(S)||r.pending.match(S))&&b++,y(S)&&(b=Math.max(0,b-1)),l(S)?m(Yi(S,"invalidatesTags",n,o),M):y(S)?m([],M):s.util.invalidateTags.match(S)&&m(er(S.payload,void 0,void 0,void 0,void 0,o),M)};function _(){return b>0}function m(S,M){const x=M.getState(),v=x[e];if(j.push(...S),v.config.invalidationBehavior==="delayed"&&_())return;const f=j;if(j=[],f.length===0)return;const d=s.util.selectInvalidatedBy(x,f);t.batch(()=>{const N=Array.from(d.values());for(const{queryCacheKey:O}of N){const C=v.queries[O],E=Kt(c.currentSubscriptions,O,Pn);C&&(E.size===0?M.dispatch(u({queryCacheKey:O})):C.status!==xe&&M.dispatch(a(C)))}})}return h},Ka=({reducerPath:e,queryThunk:t,api:n,refetchQuery:r,internalState:i})=>{const{currentPolls:s,currentSubscriptions:o}=i,a=new Set;let c=null;const u=(m,S)=>{(n.internalActions.updateSubscriptionOptions.match(m)||n.internalActions.unsubscribeQueryResult.match(m))&&l(m.payload.queryCacheKey,S),(t.pending.match(m)||t.rejected.match(m)&&m.meta.condition)&&l(m.meta.arg.queryCacheKey,S),(t.fulfilled.match(m)||t.rejected.match(m)&&!m.meta.condition)&&y(m.meta.arg,S),n.util.resetApiState.match(m)&&(h(),c&&(clearTimeout(c),c=null),a.clear())};function l(m,S){a.add(m),c||(c=setTimeout(()=>{for(const M of a)j({queryCacheKey:M},S);a.clear(),c=null},0))}function y({queryCacheKey:m},S){const M=S.getState()[e],x=M.queries[m],v=o.get(m);if(!x||x.status===xe)return;const{lowestPollingInterval:f,skipPollingIfUnfocused:d}=_(v);if(!Number.isFinite(f))return;const N=s.get(m);N!=null&&N.timeout&&(clearTimeout(N.timeout),N.timeout=void 0);const O=Date.now()+f;s.set(m,{nextPollTimestamp:O,pollingInterval:f,timeout:setTimeout(()=>{(M.config.focused||!d)&&S.dispatch(r(x)),y({queryCacheKey:m},S)},f)})}function j({queryCacheKey:m},S){const x=S.getState()[e].queries[m],v=o.get(m);if(!x||x.status===xe)return;const{lowestPollingInterval:f}=_(v);if(process.env.NODE_ENV==="test"){const O=s.pollUpdateCounters??(s.pollUpdateCounters={});O[m]??(O[m]=0),O[m]++}if(!Number.isFinite(f)){b(m);return}const d=s.get(m),N=Date.now()+f;(!d||N<d.nextPollTimestamp)&&y({queryCacheKey:m},S)}function b(m){const S=s.get(m);S!=null&&S.timeout&&clearTimeout(S.timeout),s.delete(m)}function h(){for(const m of s.keys())b(m)}function _(m=new Map){let S=!1,M=Number.POSITIVE_INFINITY;for(const x of m.values())x.pollingInterval&&(M=Math.min(x.pollingInterval,M),S=x.skipPollingIfUnfocused||S);return{lowestPollingInterval:M,skipPollingIfUnfocused:S}}return u},Ga=({api:e,context:t,queryThunk:n,mutationThunk:r})=>{const i=Kn(n,r),s=ze(n,r),o=_e(n,r),a={};return(u,l)=>{var y,j;if(i(u)){const{requestId:b,arg:{endpointName:h,originalArgs:_}}=u.meta,m=$e(t,h),S=m==null?void 0:m.onQueryStarted;if(S){const M={},x=new Promise((N,O)=>{M.resolve=N,M.reject=O});x.catch(()=>{}),a[b]=M;const v=e.endpoints[h].select(Gt(m)?_:b),f=l.dispatch((N,O,C)=>C),d={...l,getCacheEntry:()=>v(l.getState()),requestId:b,extra:f,updateCachedData:Gt(m)?N=>l.dispatch(e.util.updateQueryData(h,_,N)):void 0,queryFulfilled:x};S(_,d)}}else if(o(u)){const{requestId:b,baseQueryMeta:h}=u.meta;(y=a[b])==null||y.resolve({data:u.payload,meta:h}),delete a[b]}else if(s(u)){const{requestId:b,rejectedWithValue:h,baseQueryMeta:_}=u.meta;(j=a[b])==null||j.reject({error:u.payload??u.error,isUnhandledError:!h,meta:_}),delete a[b]}}},Ya=({reducerPath:e,context:t,api:n,refetchQuery:r,internalState:i})=>{const{removeQueryResult:s}=n.internalActions,o=(c,u)=>{Zn.match(c)&&a(u,"refetchOnFocus"),Jn.match(c)&&a(u,"refetchOnReconnect")};function a(c,u){const l=c.getState()[e],y=l.queries,j=i.currentSubscriptions;t.batch(()=>{for(const b of j.keys()){const h=y[b],_=j.get(b);if(!_||!h)continue;const m=[..._.values()];(m.some(M=>M[u]===!0)||m.every(M=>M[u]===void 0)&&l.config[u])&&(_.size===0?c.dispatch(s({queryCacheKey:b})):h.status!==xe&&c.dispatch(r(h)))}})}return o};function Xa(e){const{reducerPath:t,queryThunk:n,api:r,context:i,getInternalState:s}=e,{apiUid:o}=i,a={invalidateTags:me(`${t}/invalidateTags`)},c=j=>j.type.startsWith(`${t}/`),u=[Ha,Ua,Ba,Ka,Wa,Ga];return{middleware:j=>{let b=!1;const h=s(j.dispatch),_={...e,internalState:h,refetchQuery:y,isThisApiSliceAction:c,mwApi:j},m=u.map(x=>x(_)),S=$a(_),M=Ya(_);return x=>v=>{if(!Un(v))return x(v);b||(b=!0,j.dispatch(r.internalActions.middlewareRegistered(o)));const f={...j,next:x},d=j.getState(),[N,O]=S(v,f,d);let C;if(N?C=x(v):C=O,j.getState()[t]&&(M(v,f,d),c(v)||i.hasRehydrationInfo(v)))for(const E of m)E(v,f,d);return C}},actions:a};function y(j){return e.api.endpoints[j.endpointName].initiate(j.originalArgs,{subscribe:!1,forceRefetch:!0})}}var Br=Symbol(),Ji=({createSelector:e=ki}={})=>({name:Br,init(t,{baseQuery:n,tagTypes:r,reducerPath:i,serializeQueryArgs:s,keepUnusedDataFor:o,refetchOnMountOrArgChange:a,refetchOnFocus:c,refetchOnReconnect:u,invalidationBehavior:l,onSchemaFailure:y,catchSchemaFailure:j,skipSchemaValidation:b},h){ko();const _=Q=>(typeof process<"u"&&process.env.NODE_ENV==="development"&&(r.includes(Q.type)||console.error(`Tag type '${Q.type}' was used, but not specified in \`tagTypes\`!`)),Q);Object.assign(t,{reducerPath:i,endpoints:{},internalActions:{onOnline:Jn,onOffline:Ui,onFocus:Zn,onFocusLost:qi},util:{}});const m=za({serializeQueryArgs:s,reducerPath:i,createSelector:e}),{selectInvalidatedBy:S,selectCachedArgsForQuery:M,buildQuerySelector:x,buildInfiniteQuerySelector:v,buildMutationSelector:f}=m;he(t.util,{selectInvalidatedBy:S,selectCachedArgsForQuery:M});const{queryThunk:d,infiniteQueryThunk:N,mutationThunk:O,patchQueryData:C,updateQueryData:E,upsertQueryData:g,prefetch:w,buildMatchThunkActions:I}=Fa({baseQuery:n,reducerPath:i,context:h,api:t,serializeQueryArgs:s,assertTagType:_,selectors:m,onSchemaFailure:y,catchSchemaFailure:j,skipSchemaValidation:b}),{reducer:k,actions:P}=Qa({context:h,queryThunk:d,mutationThunk:O,serializeQueryArgs:s,reducerPath:i,assertTagType:_,config:{refetchOnFocus:c,refetchOnReconnect:u,refetchOnMountOrArgChange:a,keepUnusedDataFor:o,reducerPath:i,invalidationBehavior:l}});he(t.util,{patchQueryData:C,updateQueryData:E,upsertQueryData:g,prefetch:w,resetApiState:P.resetApiState,upsertQueryEntries:P.cacheEntriesUpserted}),he(t.internalActions,P);const D=new WeakMap,F=Q=>Kt(D,Q,()=>({currentSubscriptions:new Map,currentPolls:new Map,runningQueries:new Map,runningMutations:new Map})),{buildInitiateQuery:R,buildInitiateInfiniteQuery:A,buildInitiateMutation:V,getRunningMutationThunk:L,getRunningMutationsThunk:H,getRunningQueriesThunk:K,getRunningQueryThunk:B}=La({queryThunk:d,mutationThunk:O,infiniteQueryThunk:N,api:t,serializeQueryArgs:s,context:h,getInternalState:F});he(t.util,{getRunningMutationThunk:L,getRunningMutationsThunk:H,getRunningQueryThunk:B,getRunningQueriesThunk:K});const{middleware:Y,actions:G}=Xa({reducerPath:i,context:h,queryThunk:d,mutationThunk:O,infiniteQueryThunk:N,api:t,assertTagType:_,selectors:m,getRunningQueryThunk:B,getInternalState:F});return he(t.util,G),he(t,{reducer:k,middleware:Y}),{name:Br,injectEndpoint(Q,W){var U;const ne=(U=t.endpoints)[Q]??(U[Q]={});on(W)&&he(ne,{name:Q,select:x(Q,W),initiate:R(Q,W)},I(d,Q)),Ra(W)&&he(ne,{name:Q,select:f(),initiate:V(Q)},I(O,Q)),Et(W)&&he(ne,{name:Q,select:v(Q,W),initiate:A(Q,W)},I(d,Q))}}}});Ji();function At(e){return e.replace(e[0],e[0].toUpperCase())}function Za(e){let t=0;for(const n in e)t++;return t}var Ja="query",ec="mutation",tc="infinitequery";function nc(e){return e.type===Ja}function rc(e){return e.type===ec}function es(e){return e.type===tc}function Be(e,...t){return Object.assign(e,...t)}var gn=Symbol();function yn(e){const t=T.useRef(e),n=T.useMemo(()=>Yn(t.current,e),[e]);return T.useEffect(()=>{t.current!==n&&(t.current=n)},[n]),n}function Le(e){const t=T.useRef(e);return T.useEffect(()=>{Je(t.current,e)||(t.current=e)},[e]),Je(t.current,e)?t.current:e}var ic=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",sc=ic(),oc=()=>typeof navigator<"u"&&navigator.product==="ReactNative",ac=oc(),cc=()=>sc||ac?T.useLayoutEffect:T.useEffect,uc=cc(),Kr=e=>e.isUninitialized?{...e,isUninitialized:!1,isFetching:!0,isLoading:e.data===void 0,status:zi.pending}:e;function bn(e,...t){const n={};return t.forEach(r=>{n[r]=e[r]}),n}var xn=["data","status","isLoading","isSuccess","isError","error"];function lc({api:e,moduleOptions:{batch:t,hooks:{useDispatch:n,useSelector:r,useStore:i},unstable__sideEffectsInRender:s,createSelector:o},serializeQueryArgs:a,context:c}){const u=s?d=>d():T.useEffect,l=d=>{var N,O;return(O=(N=d.current)==null?void 0:N.unsubscribe)==null?void 0:O.call(N)},y=c.endpointDefinitions;return{buildQueryHooks:x,buildInfiniteQueryHooks:v,buildMutationHook:f,usePrefetch:h};function j(d,N,O){if(N!=null&&N.endpointName&&d.isUninitialized){const{endpointName:k}=N,P=y[k];O!==fe&&a({queryArgs:N.originalArgs,endpointDefinition:P,endpointName:k})===a({queryArgs:O,endpointDefinition:P,endpointName:k})&&(N=void 0)}let C=d.isSuccess?d.data:N==null?void 0:N.data;C===void 0&&(C=d.data);const E=C!==void 0,g=d.isLoading,w=(!N||N.isLoading||N.isUninitialized)&&!E&&g,I=d.isSuccess||E&&(g&&!(N!=null&&N.isError)||d.isUninitialized);return{...d,data:C,currentData:d.data,isFetching:g,isLoading:w,isSuccess:I}}function b(d,N,O){if(N!=null&&N.endpointName&&d.isUninitialized){const{endpointName:k}=N,P=y[k];O!==fe&&a({queryArgs:N.originalArgs,endpointDefinition:P,endpointName:k})===a({queryArgs:O,endpointDefinition:P,endpointName:k})&&(N=void 0)}let C=d.isSuccess?d.data:N==null?void 0:N.data;C===void 0&&(C=d.data);const E=C!==void 0,g=d.isLoading,w=(!N||N.isLoading||N.isUninitialized)&&!E&&g,I=d.isSuccess||E&&(g&&!(N!=null&&N.isError)||d.isUninitialized);return{...d,data:C,currentData:d.data,isFetching:g,isLoading:w,isSuccess:I}}function h(d,N){const O=n(),C=Le(N);return T.useCallback((E,g)=>O(e.util.prefetch(d,E,{...C,...g})),[d,O,C])}function _(d,N,{refetchOnReconnect:O,refetchOnFocus:C,refetchOnMountOrArgChange:E,skip:g=!1,pollingInterval:w=0,skipPollingIfUnfocused:I=!1,...k}={}){const{initiate:P}=e.endpoints[d],D=n(),F=T.useRef(void 0);if(!F.current){const z=D(e.internalActions.internal_getRTKQSubscriptions());if(process.env.NODE_ENV!=="production"&&(typeof z!="object"||typeof(z==null?void 0:z.type)=="string"))throw new Error(process.env.NODE_ENV==="production"?q(37):`Warning: Middleware for RTK-Query API at reducerPath "${e.reducerPath}" has not been added to the store.
42
+ You must add the middleware for RTK-Query to function correctly!`);F.current=z}const R=yn(g?fe:N),A=Le({refetchOnReconnect:O,refetchOnFocus:C,pollingInterval:w,skipPollingIfUnfocused:I}),V=k.initialPageParam,L=Le(V),H=k.refetchCachedPages,K=Le(H),B=T.useRef(void 0);let{queryCacheKey:Y,requestId:G}=B.current||{},Q=!1;Y&&G&&(Q=F.current.isRequestSubscribed(Y,G));const W=!Q&&B.current!==void 0;return u(()=>{W&&(B.current=void 0)},[W]),u(()=>{var U;const z=B.current;if(typeof process<"u"&&process.env.NODE_ENV==="removeMeOnCompilation"&&console.log(W),R===fe){z==null||z.unsubscribe(),B.current=void 0;return}const ne=(U=B.current)==null?void 0:U.subscriptionOptions;if(!z||z.arg!==R){z==null||z.unsubscribe();const $=D(P(R,{subscriptionOptions:A,forceRefetch:E,...es(y[d])?{initialPageParam:L,refetchCachedPages:K}:{}}));B.current=$}else A!==ne&&z.updateSubscriptionOptions(A)},[D,P,E,R,A,W,L,K,d]),[B,D,P,A]}function m(d,N){return(C,{skip:E=!1,selectFromResult:g}={})=>{const{select:w}=e.endpoints[d],I=yn(E?fe:C),k=T.useRef(void 0),P=T.useMemo(()=>o([w(I),(V,L)=>L,V=>I],N,{memoizeOptions:{resultEqualityCheck:Je}}),[w,I]),D=T.useMemo(()=>g?o([P],g,{devModeChecks:{identityFunctionCheck:"never"}}):P,[P,g]),F=r(V=>D(V,k.current),Je),R=i(),A=P(R.getState(),k.current);return uc(()=>{k.current=A},[A]),F}}function S(d){T.useEffect(()=>()=>{l(d),d.current=void 0},[d])}function M(d){if(!d.current)throw new Error(process.env.NODE_ENV==="production"?q(38):"Cannot refetch a query that has not been started yet.");return d.current.refetch()}function x(d){const N=(E,g={})=>{const[w]=_(d,E,g);return S(w),T.useMemo(()=>({refetch:()=>M(w)}),[w])},O=({refetchOnReconnect:E,refetchOnFocus:g,pollingInterval:w=0,skipPollingIfUnfocused:I=!1}={})=>{const{initiate:k}=e.endpoints[d],P=n(),[D,F]=T.useState(gn),R=T.useRef(void 0),A=Le({refetchOnReconnect:E,refetchOnFocus:g,pollingInterval:w,skipPollingIfUnfocused:I});u(()=>{var B,Y;const K=(B=R.current)==null?void 0:B.subscriptionOptions;A!==K&&((Y=R.current)==null||Y.updateSubscriptionOptions(A))},[A]);const V=T.useRef(A);u(()=>{V.current=A},[A]);const L=T.useCallback(function(K,B=!1){let Y;return t(()=>{l(R),R.current=Y=P(k(K,{subscriptionOptions:V.current,forceRefetch:!B})),F(K)}),Y},[P,k]),H=T.useCallback(()=>{var K,B;(K=R.current)!=null&&K.queryCacheKey&&P(e.internalActions.removeQueryResult({queryCacheKey:(B=R.current)==null?void 0:B.queryCacheKey}))},[P]);return T.useEffect(()=>()=>{l(R)},[]),T.useEffect(()=>{D!==gn&&!R.current&&L(D,!0)},[D,L]),T.useMemo(()=>[L,D,{reset:H}],[L,D,H])},C=m(d,j);return{useQueryState:C,useQuerySubscription:N,useLazyQuerySubscription:O,useLazyQuery(E){const[g,w,{reset:I}]=O(E),k=C(w,{...E,skip:w===gn}),P=T.useMemo(()=>({lastArg:w}),[w]);return T.useMemo(()=>[g,{...k,reset:I},P],[g,k,I,P])},useQuery(E,g){const w=N(E,g),I=C(E,{selectFromResult:E===fe||g!=null&&g.skip?void 0:Kr,...g}),k=bn(I,...xn);return T.useDebugValue(k),T.useMemo(()=>({...I,...w}),[I,w])}}}function v(d){const N=(C,E={})=>{const[g,w,I,k]=_(d,C,E),P=T.useRef(k);u(()=>{P.current=k},[k]);const D=E.refetchCachedPages,F=Le(D),R=T.useCallback(function(L,H){let K;return t(()=>{l(g),g.current=K=w(I(L,{subscriptionOptions:P.current,direction:H}))}),K},[g,w,I]);S(g);const A=yn(E.skip?fe:C),V=T.useCallback(L=>{if(!g.current)throw new Error(process.env.NODE_ENV==="production"?q(38):"Cannot refetch a query that has not been started yet.");const H={refetchCachedPages:(L==null?void 0:L.refetchCachedPages)??F};return g.current.refetch(H)},[g,F]);return T.useMemo(()=>({trigger:R,refetch:V,fetchNextPage:()=>R(A,"forward"),fetchPreviousPage:()=>R(A,"backward")}),[V,R,A])},O=m(d,b);return{useInfiniteQueryState:O,useInfiniteQuerySubscription:N,useInfiniteQuery(C,E){const{refetch:g,fetchNextPage:w,fetchPreviousPage:I}=N(C,E),k=O(C,{selectFromResult:C===fe||E!=null&&E.skip?void 0:Kr,...E}),P=bn(k,...xn,"hasNextPage","hasPreviousPage");return T.useDebugValue(P),T.useMemo(()=>({...k,fetchNextPage:w,fetchPreviousPage:I,refetch:g}),[k,w,I,g])}}}function f(d){return({selectFromResult:N,fixedCacheKey:O}={})=>{const{select:C,initiate:E}=e.endpoints[d],g=n(),[w,I]=T.useState();T.useEffect(()=>()=>{w!=null&&w.arg.fixedCacheKey||w==null||w.reset()},[w]);const k=T.useCallback(function(K){const B=g(E(K,{fixedCacheKey:O}));return I(B),B},[g,E,O]),{requestId:P}=w||{},D=T.useMemo(()=>C({fixedCacheKey:O,requestId:w==null?void 0:w.requestId}),[O,w,C]),F=T.useMemo(()=>N?o([D],N):D,[N,D]),R=r(F,Je),A=O==null?w==null?void 0:w.arg.originalArgs:void 0,V=T.useCallback(()=>{t(()=>{w&&I(void 0),O&&g(e.internalActions.removeMutationResult({requestId:P,fixedCacheKey:O}))})},[g,O,w,P]),L=bn(R,...xn,"endpointName");T.useDebugValue(L);const H=T.useMemo(()=>({...R,originalArgs:A,reset:V}),[R,A,V]);return T.useMemo(()=>[k,H],[k,H])}}}var dc=Symbol(),fc=({batch:e=Js,hooks:t={useDispatch:Ys,useSelector:Zs,useStore:mi},createSelector:n=ki,unstable__sideEffectsInRender:r=!1,...i}={})=>{if(process.env.NODE_ENV!=="production"){const s=["useDispatch","useSelector","useStore"];let o=!1;for(const a of s)if(Za(i)>0&&(i[a]&&(o||(console.warn("As of RTK 2.0, the hooks now need to be specified as one object, provided under a `hooks` key:\n`reactHooksModule({ hooks: { useDispatch, useSelector, useStore } })`"),o=!0)),t[a]=i[a]),typeof t[a]!="function")throw new Error(process.env.NODE_ENV==="production"?q(36):`When using custom hooks for context, all ${s.length} hooks need to be provided: ${s.join(", ")}.
43
+ Hook ${a} was either not provided or not a function.`)}return{name:dc,init(s,{serializeQueryArgs:o},a){const c=s,{buildQueryHooks:u,buildInfiniteQueryHooks:l,buildMutationHook:y,usePrefetch:j}=lc({api:s,moduleOptions:{batch:e,hooks:t,unstable__sideEffectsInRender:r,createSelector:n},serializeQueryArgs:o,context:a});return Be(c,{usePrefetch:j}),Be(a,{batch:e}),{injectEndpoint(b,h){if(nc(h)){const{useQuery:_,useLazyQuery:m,useLazyQuerySubscription:S,useQueryState:M,useQuerySubscription:x}=u(b);Be(c.endpoints[b],{useQuery:_,useLazyQuery:m,useLazyQuerySubscription:S,useQueryState:M,useQuerySubscription:x}),s[`use${At(b)}Query`]=_,s[`useLazy${At(b)}Query`]=m}if(rc(h)){const _=y(b);Be(c.endpoints[b],{useMutation:_}),s[`use${At(b)}Mutation`]=_}else if(es(h)){const{useInfiniteQuery:_,useInfiniteQuerySubscription:m,useInfiniteQueryState:S}=l(b);Be(c.endpoints[b],{useInfiniteQuery:_,useInfiniteQuerySubscription:m,useInfiniteQueryState:S}),s[`use${At(b)}InfiniteQuery`]=_}}}}}},mc=Zi(Ji(),fc());const pc=async(e,t,n)=>{const{baseUrl:r,getToken:i}=to();return Aa({baseUrl:r,prepareHeaders:async o=>{const a=await(i==null?void 0:i());return a&&o.set("Authorization",`Bearer ${a}`),o}})(e,t,n)},hc=["ChatHistory"],ts={ChatHistory:"ChatHistory"},Gr=e=>{var t,n;return{status:e==null?void 0:e.status,message:((t=e==null?void 0:e.data)==null?void 0:t.message)??((n=e==null?void 0:e.data)==null?void 0:n.error)??(e==null?void 0:e.error)??"Something went wrong. Please try again."}},gc={sendMessage:{getUrl:()=>"/chat/messages",method:"POST",transformResponse:e=>e,invalidatesTags:[ts.ChatHistory]}},yc={getChatHistory:{getUrl:({conversationId:e})=>`/chat/conversations/${e}`,method:"GET",transformResponse:e=>e,providesTags:[ts.ChatHistory]}},bc={submitFeedback:{getUrl:()=>"/chat/feedback",method:"POST",transformResponse:e=>e}},Yr={...gc,...bc},Xr={...yc},Tt=mc({reducerPath:"mintAiApi",baseQuery:pc,tagTypes:hc,endpoints:e=>{const t={};return Object.keys(Yr).forEach(n=>{const r=Yr[n];t[n]=e.mutation({query:i=>({url:r.getUrl(i),method:r.method,body:i}),transformResponse:i=>r.transformResponse(i),transformErrorResponse:i=>{var s;return((s=r.transformErrorResponse)==null?void 0:s.call(r,i))??Gr(i)},invalidatesTags:r.invalidatesTags??[]})}),Object.keys(Xr).forEach(n=>{const r=Xr[n];t[n]=e.query({query:i=>({url:r.getUrl(i),method:r.method}),transformResponse:i=>r.transformResponse(i),transformErrorResponse:i=>Gr(i),providesTags:r.providesTags??[]})}),t}}),{useSendMessageMutation:xc}=Tt,Zr={open:!1,expanded:!1,conversationId:void 0,messages:[],draft:""},ns=ke({name:"chatUi",initialState:Zr,reducers:{setOpen(e,t){e.open=t.payload,t.payload||(e.expanded=!1)},setExpanded(e,t){e.expanded=t.payload,t.payload&&(e.open=!0)},toggleOpen(e){e.open=!e.open,e.open||(e.expanded=!1)},setConversationId(e,t){e.conversationId=t.payload},setDraft(e,t){e.draft=t.payload},addMessage(e,t){e.messages.push(t.payload)},setMessages(e,t){e.messages=t.payload},resetChat(){return Zr}}}),{setOpen:tr,setExpanded:rs,toggleOpen:vc,setConversationId:wc,setDraft:nr,addMessage:rt,setMessages:ul,resetChat:ll}=ns.actions,Ec=ns.reducer,Sc=ra({reducer:{[Tt.reducerPath]:Tt.reducer,chatUi:Ec},middleware:e=>e().concat(Tt.middleware)});function Nc({config:e,children:t}){return p.jsx(Gs,{store:Sc,context:qn,children:p.jsx(ro,{config:e,children:p.jsx("div",{className:"mint-ai-root",children:t})})})}const Cc=pi(qn),_c=hi(qn),St=()=>Cc(),ft=_c;function is(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=is(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function jc(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=is(e))&&(r&&(r+=" "),r+=t);return r}function te(...e){return jc(e)}const ss=Object.freeze({left:0,top:0,width:16,height:16}),Yt=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),rr=Object.freeze({...ss,...Yt}),Tn=Object.freeze({...rr,body:"",hidden:!1});function Oc(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function Jr(e,t){const n=Oc(e,t);for(const r in Tn)r in Yt?r in e&&!(r in n)&&(n[r]=Yt[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function Ic(e,t){const n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function s(o){if(n[o])return i[o]=[];if(!(o in i)){i[o]=null;const a=r[o]&&r[o].parent,c=a&&s(a);c&&(i[o]=[a].concat(c))}return i[o]}return Object.keys(n).concat(Object.keys(r)).forEach(s),i}function kc(e,t,n){const r=e.icons,i=e.aliases||Object.create(null);let s={};function o(a){s=Jr(r[a]||i[a],s)}return o(t),n.forEach(o),Jr(e,s)}function os(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(i=>{t(i,null),n.push(i)});const r=Ic(e);for(const i in r){const s=r[i];s&&(t(i,kc(e,i,s)),n.push(i))}return n}const Mc={provider:"",aliases:{},not_found:{},...ss};function vn(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function as(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!vn(e,Mc))return null;const n=t.icons;for(const i in n){const s=n[i];if(!i||typeof s.body!="string"||!vn(s,Tn))return null}const r=t.aliases||Object.create(null);for(const i in r){const s=r[i],o=s.parent;if(!i||typeof o!="string"||!n[o]&&!r[o]||!vn(s,Tn))return null}return t}const cs=/^[a-z0-9]+(-[a-z0-9]+)*$/,an=(e,t,n,r="")=>{const i=e.split(":");if(e.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const a=i.pop(),c=i.pop(),u={provider:i.length>0?i[0]:r,prefix:c,name:a};return t&&!Vt(u)?null:u}const s=i[0],o=s.split("-");if(o.length>1){const a={provider:r,prefix:o.shift(),name:o.join("-")};return t&&!Vt(a)?null:a}if(n&&r===""){const a={provider:r,prefix:"",name:s};return t&&!Vt(a,n)?null:a}return null},Vt=(e,t)=>e?!!((t&&e.prefix===""||e.prefix)&&e.name):!1,ei=Object.create(null);function Ac(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function qe(e,t){const n=ei[e]||(ei[e]=Object.create(null));return n[t]||(n[t]=Ac(e,t))}function us(e,t){return as(t)?os(t,(n,r)=>{r?e.icons[n]=r:e.missing.add(n)}):[]}function Pc(e,t,n){try{if(typeof n.body=="string")return e.icons[t]={...n},!0}catch{}return!1}let mt=!1;function ls(e){return typeof e=="boolean"&&(mt=e),mt}function ti(e){const t=typeof e=="string"?an(e,!0,mt):e;if(t){const n=qe(t.provider,t.prefix),r=t.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function Dc(e,t){const n=an(e,!0,mt);if(!n)return!1;const r=qe(n.provider,n.prefix);return t?Pc(r,n.name,t):(r.missing.add(n.name),!0)}function ir(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),mt&&!t&&!e.prefix){let i=!1;return as(e)&&(e.prefix="",os(e,(s,o)=>{Dc(s,o)&&(i=!0)})),i}const n=e.prefix;if(!Vt({prefix:n,name:"a"}))return!1;const r=qe(t,n);return!!us(r,e)}const ds=Object.freeze({width:null,height:null}),fs=Object.freeze({...ds,...Yt}),Rc=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Tc=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function ni(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const r=e.split(Rc);if(r===null||!r.length)return e;const i=[];let s=r.shift(),o=Tc.test(s);for(;;){if(o){const a=parseFloat(s);isNaN(a)?i.push(s):i.push(Math.ceil(a*t*n)/n)}else i.push(s);if(s=r.shift(),s===void 0)return i.join("");o=!o}}function Vc(e,t="defs"){let n="";const r=e.indexOf("<"+t);for(;r>=0;){const i=e.indexOf(">",r),s=e.indexOf("</"+t);if(i===-1||s===-1)break;const o=e.indexOf(">",s);if(o===-1)break;n+=e.slice(i+1,s).trim(),e=e.slice(0,r).trim()+e.slice(o+1)}return{defs:n,content:e}}function Lc(e,t){return e?"<defs>"+e+"</defs>"+t:t}function Fc(e,t,n){const r=Vc(e);return Lc(r.defs,t+r.content+n)}const Qc=e=>e==="unset"||e==="undefined"||e==="none";function zc(e,t){const n={...rr,...e},r={...fs,...t},i={left:n.left,top:n.top,width:n.width,height:n.height};let s=n.body;[n,r].forEach(_=>{const m=[],S=_.hFlip,M=_.vFlip;let x=_.rotate;S?M?x+=2:(m.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),m.push("scale(-1 1)"),i.top=i.left=0):M&&(m.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),m.push("scale(1 -1)"),i.top=i.left=0);let v;switch(x<0&&(x-=Math.floor(x/4)*4),x=x%4,x){case 1:v=i.height/2+i.top,m.unshift("rotate(90 "+v.toString()+" "+v.toString()+")");break;case 2:m.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:v=i.width/2+i.left,m.unshift("rotate(-90 "+v.toString()+" "+v.toString()+")");break}x%2===1&&(i.left!==i.top&&(v=i.left,i.left=i.top,i.top=v),i.width!==i.height&&(v=i.width,i.width=i.height,i.height=v)),m.length&&(s=Fc(s,'<g transform="'+m.join(" ")+'">',"</g>"))});const o=r.width,a=r.height,c=i.width,u=i.height;let l,y;o===null?(y=a===null?"1em":a==="auto"?u:a,l=ni(y,c/u)):(l=o==="auto"?c:o,y=a===null?ni(l,u/c):a==="auto"?u:a);const j={},b=(_,m)=>{Qc(m)||(j[_]=m.toString())};b("width",l),b("height",y);const h=[i.left,i.top,c,u];return j.viewBox=h.join(" "),{attributes:j,viewBox:h,body:s}}const $c=/\sid="(\S+)"/g,qc="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let Uc=0;function Wc(e,t=qc){const n=[];let r;for(;r=$c.exec(e);)n.push(r[1]);if(!n.length)return e;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(s=>{const o=typeof t=="function"?t(s):t+(Uc++).toString(),a=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+o+i+"$3")}),e=e.replace(new RegExp(i,"g"),""),e}const Vn=Object.create(null);function Hc(e,t){Vn[e]=t}function Ln(e){return Vn[e]||Vn[""]}function sr(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const or=Object.create(null),Ke=["https://api.simplesvg.com","https://api.unisvg.com"],Lt=[];for(;Ke.length>0;)Ke.length===1||Math.random()>.5?Lt.push(Ke.shift()):Lt.push(Ke.pop());or[""]=sr({resources:["https://api.iconify.design"].concat(Lt)});function Bc(e,t){const n=sr(t);return n===null?!1:(or[e]=n,!0)}function ar(e){return or[e]}const Kc=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let ri=Kc();function Gc(e,t){const n=ar(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let i=0;n.resources.forEach(o=>{i=Math.max(i,o.length)});const s=t+".json?icons=";r=n.maxURL-i-n.path.length-s.length}return r}function Yc(e){return e===404}const Xc=(e,t,n)=>{const r=[],i=Gc(e,t),s="icons";let o={type:s,provider:e,prefix:t,icons:[]},a=0;return n.forEach((c,u)=>{a+=c.length+1,a>=i&&u>0&&(r.push(o),o={type:s,provider:e,prefix:t,icons:[]},a=c.length),o.icons.push(c)}),r.push(o),r};function Zc(e){if(typeof e=="string"){const t=ar(e);if(t)return t.path}return"/"}const Jc=(e,t,n)=>{if(!ri){n("abort",424);return}let r=Zc(t.provider);switch(t.type){case"icons":{const s=t.prefix,a=t.icons.join(","),c=new URLSearchParams({icons:a});r+=s+".json?"+c.toString();break}case"custom":{const s=t.uri;r+=s.slice(0,1)==="/"?s.slice(1):s;break}default:n("abort",400);return}let i=503;ri(e+r).then(s=>{const o=s.status;if(o!==200){setTimeout(()=>{n(Yc(o)?"abort":"next",o)});return}return i=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?n("abort",s):n("next",i)});return}setTimeout(()=>{n("success",s)})}).catch(()=>{n("next",i)})},eu={prepare:Xc,send:Jc};function tu(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((i,s)=>i.provider!==s.provider?i.provider.localeCompare(s.provider):i.prefix!==s.prefix?i.prefix.localeCompare(s.prefix):i.name.localeCompare(s.name));let r={provider:"",prefix:"",name:""};return e.forEach(i=>{if(r.name===i.name&&r.prefix===i.prefix&&r.provider===i.provider)return;r=i;const s=i.provider,o=i.prefix,a=i.name,c=n[s]||(n[s]=Object.create(null)),u=c[o]||(c[o]=qe(s,o));let l;a in u.icons?l=t.loaded:o===""||u.missing.has(a)?l=t.missing:l=t.pending;const y={provider:s,prefix:o,name:a};l.push(y)}),t}function ms(e,t){e.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(i=>i.id!==t))})}function nu(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const r=e.provider,i=e.prefix;t.forEach(s=>{const o=s.icons,a=o.pending.length;o.pending=o.pending.filter(c=>{if(c.prefix!==i)return!0;const u=c.name;if(e.icons[u])o.loaded.push({provider:r,prefix:i,name:u});else if(e.missing.has(u))o.missing.push({provider:r,prefix:i,name:u});else return n=!0,!0;return!1}),o.pending.length!==a&&(n||ms([e],s.id),s.callback(o.loaded.slice(0),o.missing.slice(0),o.pending.slice(0),s.abort))})}))}let ru=0;function iu(e,t,n){const r=ru++,i=ms.bind(null,n,r);if(!t.pending.length)return i;const s={id:r,icons:t,callback:e,abort:i};return n.forEach(o=>{(o.loaderCallbacks||(o.loaderCallbacks=[])).push(s)}),i}function su(e,t=!0,n=!1){const r=[];return e.forEach(i=>{const s=typeof i=="string"?an(i,t,n):i;s&&r.push(s)}),r}var ou={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function au(e,t,n,r){const i=e.resources.length,s=e.random?Math.floor(Math.random()*i):e.index;let o;if(e.random){let d=e.resources.slice(0);for(o=[];d.length>1;){const N=Math.floor(Math.random()*d.length);o.push(d[N]),d=d.slice(0,N).concat(d.slice(N+1))}o=o.concat(d)}else o=e.resources.slice(s).concat(e.resources.slice(0,s));const a=Date.now();let c="pending",u=0,l,y=null,j=[],b=[];typeof r=="function"&&b.push(r);function h(){y&&(clearTimeout(y),y=null)}function _(){c==="pending"&&(c="aborted"),h(),j.forEach(d=>{d.status==="pending"&&(d.status="aborted")}),j=[]}function m(d,N){N&&(b=[]),typeof d=="function"&&b.push(d)}function S(){return{startTime:a,payload:t,status:c,queriesSent:u,queriesPending:j.length,subscribe:m,abort:_}}function M(){c="failed",b.forEach(d=>{d(void 0,l)})}function x(){j.forEach(d=>{d.status==="pending"&&(d.status="aborted")}),j=[]}function v(d,N,O){const C=N!=="success";switch(j=j.filter(E=>E!==d),c){case"pending":break;case"failed":if(C||!e.dataAfterTimeout)return;break;default:return}if(N==="abort"){l=O,M();return}if(C){l=O,j.length||(o.length?f():M());return}if(h(),x(),!e.random){const E=e.resources.indexOf(d.resource);E!==-1&&E!==e.index&&(e.index=E)}c="completed",b.forEach(E=>{E(O)})}function f(){if(c!=="pending")return;h();const d=o.shift();if(d===void 0){if(j.length){y=setTimeout(()=>{h(),c==="pending"&&(x(),M())},e.timeout);return}M();return}const N={status:"pending",resource:d,callback:(O,C)=>{v(N,O,C)}};j.push(N),u++,y=setTimeout(f,e.rotate),n(d,t,N.callback)}return setTimeout(f),S}function ps(e){const t={...ou,...e};let n=[];function r(){n=n.filter(a=>a().status==="pending")}function i(a,c,u){const l=au(t,a,c,(y,j)=>{r(),u&&u(y,j)});return n.push(l),l}function s(a){return n.find(c=>a(c))||null}return{query:i,find:s,setIndex:a=>{t.index=a},getIndex:()=>t.index,cleanup:r}}function ii(){}const wn=Object.create(null);function cu(e){if(!wn[e]){const t=ar(e);if(!t)return;const n=ps(t),r={config:t,redundancy:n};wn[e]=r}return wn[e]}function uu(e,t,n){let r,i;if(typeof e=="string"){const s=Ln(e);if(!s)return n(void 0,424),ii;i=s.send;const o=cu(e);o&&(r=o.redundancy)}else{const s=sr(e);if(s){r=ps(s);const o=e.resources?e.resources[0]:"",a=Ln(o);a&&(i=a.send)}}return!r||!i?(n(void 0,424),ii):r.query(t,i,n)().abort}function si(){}function lu(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,nu(e)}))}function du(e){const t=[],n=[];return e.forEach(r=>{(r.match(cs)?t:n).push(r)}),{valid:t,invalid:n}}function Ge(e,t,n){function r(){const i=e.pendingIcons;t.forEach(s=>{i&&i.delete(s),e.icons[s]||e.missing.add(s)})}if(n&&typeof n=="object")try{if(!us(e,n).length){r();return}}catch(i){console.error(i)}r(),lu(e)}function oi(e,t){e instanceof Promise?e.then(n=>{t(n)}).catch(()=>{t(null)}):t(e)}function fu(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:r}=e,i=e.iconsToLoad;if(delete e.iconsToLoad,!i||!i.length)return;const s=e.loadIcon;if(e.loadIcons&&(i.length>1||!s)){oi(e.loadIcons(i,r,n),l=>{Ge(e,i,l)});return}if(s){i.forEach(l=>{const y=s(l,r,n);oi(y,j=>{const b=j?{prefix:r,icons:{[l]:j}}:null;Ge(e,[l],b)})});return}const{valid:o,invalid:a}=du(i);if(a.length&&Ge(e,a,null),!o.length)return;const c=r.match(cs)?Ln(n):null;if(!c){Ge(e,o,null);return}c.prepare(n,r,o).forEach(l=>{uu(n,l,y=>{Ge(e,l.icons,y)})})}))}const mu=(e,t)=>{const n=su(e,!0,ls()),r=tu(n);if(!r.pending.length){let c=!0;return t&&setTimeout(()=>{c&&t(r.loaded,r.missing,r.pending,si)}),()=>{c=!1}}const i=Object.create(null),s=[];let o,a;return r.pending.forEach(c=>{const{provider:u,prefix:l}=c;if(l===a&&u===o)return;o=u,a=l,s.push(qe(u,l));const y=i[u]||(i[u]=Object.create(null));y[l]||(y[l]=[])}),r.pending.forEach(c=>{const{provider:u,prefix:l,name:y}=c,j=qe(u,l),b=j.pendingIcons||(j.pendingIcons=new Set);b.has(y)||(b.add(y),i[u][l].push(y))}),s.forEach(c=>{const u=i[c.provider][c.prefix];u.length&&fu(c,u)}),t?iu(t,r,s):si};function pu(e,t){const n={...e};for(const r in t){const i=t[r],s=typeof i;r in ds?(i===null||i&&(s==="string"||s==="number"))&&(n[r]=i):s===typeof n[r]&&(n[r]=r==="rotate"?i%4:i)}return n}const hu=/[\s,]+/;function gu(e,t){t.split(hu).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function yu(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function r(i){for(;i<0;)i+=4;return i%4}if(n===""){const i=parseInt(e);return isNaN(i)?0:r(i)}else if(n!==e){let i=0;switch(n){case"%":i=25;break;case"deg":i=90}if(i){let s=parseFloat(e.slice(0,e.length-n.length));return isNaN(s)?0:(s=s/i,s%1===0?r(s):0)}}return t}function bu(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in t)n+=" "+r+'="'+t[r]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+e+"</svg>"}function xu(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function vu(e){return"data:image/svg+xml,"+xu(e)}function wu(e){return'url("'+vu(e)+'")'}let it;function Eu(){try{it=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{it=null}}function Su(e){return it===void 0&&Eu(),it?it.createHTML(e):e}const hs={...fs,inline:!1},Nu={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},Cu={display:"inline-block"},Fn={backgroundColor:"currentColor"},gs={backgroundColor:"transparent"},ai={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},ci={WebkitMask:Fn,mask:Fn,background:gs};for(const e in ci){const t=ci[e];for(const n in ai)t[e+n]=ai[n]}const _u={...hs,inline:!0};function ui(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}const ju=(e,t,n)=>{const r=t.inline?_u:hs,i=pu(r,t),s=t.mode||"svg",o={},a=t.style||{},c={...s==="svg"?Nu:{}};if(n){const m=an(n,!1,!0);if(m){const S=["iconify"],M=["provider","prefix"];for(const x of M)m[x]&&S.push("iconify--"+m[x]);c.className=S.join(" ")}}for(let m in t){const S=t[m];if(S!==void 0)switch(m){case"icon":case"style":case"children":case"onLoad":case"mode":case"ssr":break;case"_ref":c.ref=S;break;case"className":c[m]=(c[m]?c[m]+" ":"")+S;break;case"inline":case"hFlip":case"vFlip":i[m]=S===!0||S==="true"||S===1;break;case"flip":typeof S=="string"&&gu(i,S);break;case"color":o.color=S;break;case"rotate":typeof S=="string"?i[m]=yu(S):typeof S=="number"&&(i[m]=S);break;case"ariaHidden":case"aria-hidden":S!==!0&&S!=="true"&&delete c["aria-hidden"];break;default:r[m]===void 0&&(c[m]=S)}}const u=zc(e,i),l=u.attributes;if(i.inline&&(o.verticalAlign="-0.125em"),s==="svg"){c.style={...o,...a},Object.assign(c,l);let m=0,S=t.id;return typeof S=="string"&&(S=S.replace(/-/g,"_")),c.dangerouslySetInnerHTML={__html:Su(Wc(u.body,S?()=>S+"ID"+m++:"iconifyReact"))},T.createElement("svg",c)}const{body:y,width:j,height:b}=e,h=s==="mask"||(s==="bg"?!1:y.indexOf("currentColor")!==-1),_=bu(y,{...l,width:j+"",height:b+""});return c.style={...o,"--svg":wu(_),width:ui(l.width),height:ui(l.height),...Cu,...h?Fn:gs,...a},T.createElement("span",c)};ls(!0);Hc("",eu);if(typeof document<"u"&&typeof window<"u"){const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(r=>{try{(typeof r!="object"||r===null||r instanceof Array||typeof r.icons!="object"||typeof r.prefix!="string"||!ir(r))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(let n in t){const r="IconifyProviders["+n+"] is invalid.";try{const i=t[n];if(typeof i!="object"||!i||i.resources===void 0)continue;Bc(n,i)||console.error(r)}catch{console.error(r)}}}}function ys(e){const[t,n]=T.useState(!!e.ssr),[r,i]=T.useState({});function s(b){if(b){const h=e.icon;if(typeof h=="object")return{name:"",data:h};const _=ti(h);if(_)return{name:h,data:_}}return{name:""}}const[o,a]=T.useState(s(!!e.ssr));function c(){const b=r.callback;b&&(b(),i({}))}function u(b){if(JSON.stringify(o)!==JSON.stringify(b))return c(),a(b),!0}function l(){var b;const h=e.icon;if(typeof h=="object"){u({name:"",data:h});return}const _=ti(h);if(u({name:h,data:_}))if(_===void 0){const m=mu([h],l);i({callback:m})}else _&&((b=e.onLoad)===null||b===void 0||b.call(e,h))}T.useEffect(()=>(n(!0),c),[]),T.useEffect(()=>{t&&l()},[e.icon,t]);const{name:y,data:j}=o;return j?ju({...rr,...j},e,y):e.children?e.children:e.fallback?e.fallback:T.createElement("span",{})}const Ou=T.forwardRef((e,t)=>ys({...e,_ref:t}));T.forwardRef((e,t)=>ys({inline:!0,...e,_ref:t}));const Qn={prefix:"solar",width:24,height:24,icons:{"chat-round-dots-bold":{body:'<defs><mask id="SVG4jZNKdNp"><g fill="none"><path fill="#fff" d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2S2 6.477 2 12c0 1.6.376 3.112 1.043 4.453c.178.356.237.763.134 1.148l-.595 2.226a1.3 1.3 0 0 0 1.591 1.592l2.226-.596a1.63 1.63 0 0 1 1.149.133A9.96 9.96 0 0 0 12 22"/><path fill="#000" d="M15 12a1 1 0 1 0 2 0a1 1 0 0 0-2 0m-4 0a1 1 0 1 0 2 0a1 1 0 0 0-2 0m-4 0a1 1 0 1 0 2 0a1 1 0 0 0-2 0"/></g></mask></defs><path fill="currentColor" d="M0 0h24v24H0z" mask="url(#SVG4jZNKdNp)"/>'},"plain-2-bold":{body:'<path fill="currentColor" d="m17.498 18.485l3.13-9.391c.791-2.373 1.331-3.994 1.37-5.115c.013-.377-.414-.503-.68-.236l-14.46 14.46c-.233.233-.177.626.14.716q.047.013.095.024c.5.123 1.153.034 2.46-.143l.07-.01c.369-.05.553-.075.73-.064c.32.02.63.124.898.303c.147.098.279.23.541.492l.252.252c1.51 1.51 2.265 2.265 3.066 2.226c.22-.011.438-.062.64-.151c.734-.324 1.072-1.337 1.747-3.363M14.906 3.372l-9.331 3.11c-2.082.694-3.123 1.041-3.439 1.804q-.112.271-.133.564c-.059.824.717 1.6 2.269 3.151l.283.283c.254.255.382.382.478.524c.19.28.297.606.31.944c.008.171-.019.35-.072.705c-.196 1.304-.294 1.956-.179 2.458l.013.052c.081.325.48.387.717.15L20.257 2.683c.267-.267.141-.694-.236-.68c-1.121.038-2.742.578-5.115 1.369"/>'},"magnifer-linear":{body:'<g fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="11.5" cy="11.5" r="9.5"/><path stroke-linecap="round" d="M18.5 18.5L22 22"/></g>'},"magic-stick-bold":{body:'<path fill="currentColor" d="M16.714 2.127c-.836-.43-1.922.263-4.095 1.65l-.562.36c-.618.394-.927.591-1.273.648c-.347.056-.692-.034-1.382-.215l-.628-.164C6.345 3.769 5.13 3.45 4.436 4.13s-.412 1.908.157 4.363l.147.635c.161.697.242 1.046.177 1.393c-.066.346-.27.65-.68 1.26l-.372.555c-1.439 2.145-2.158 3.217-1.753 4.067c.406.85 1.668.915 4.192 1.045l.654.033c.717.037 1.076.056 1.382.213c.306.158.524.436.962.994l.398.507c1.539 1.962 2.309 2.943 3.255 2.788c.945-.154 1.441-1.342 2.433-3.717l.257-.614c.282-.675.422-1.012.677-1.261c.255-.25.595-.382 1.274-.647l.618-.24c2.39-.933 3.586-1.4 3.765-2.345s-.777-1.744-2.688-3.342l-.495-.413c-.543-.454-.815-.68-.963-.992s-.158-.672-.175-1.393l-.016-.657c-.062-2.538-.093-3.806-.928-4.236M19.53 18.47a.75.75 0 1 0-1.06 1.06l2 2a.75.75 0 1 0 1.06-1.06z"/>'},"history-linear":{body:'<g fill="none"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M12 8v4l2.5 2.5"/><path fill="currentColor" d="m5.604 5.604l-.53-.53zM4.338 6.871l-.75.003a.75.75 0 0 0 .746.747zm2.542.762a.75.75 0 1 0 .007-1.5zM5.075 4.321a.75.75 0 1 0-1.5.008zm-1.248 6.464a.75.75 0 1 0-1.486-.204zm15.035-5.647c-3.82-3.82-9.993-3.86-13.788-.064l1.06 1.06c3.2-3.199 8.423-3.18 11.668.064zM5.138 18.862c3.82 3.82 9.993 3.86 13.788.064l-1.06-1.06c-3.2 3.199-8.423 3.18-11.668-.064zm13.788.064c3.795-3.795 3.756-9.968-.064-13.788l-1.06 1.06c3.244 3.245 3.263 8.468.064 11.668zM5.074 5.074L3.807 6.34L4.868 7.4l1.266-1.266zm-.74 2.547l2.546.012l.007-1.5l-2.545-.012zm.754-.754L5.075 4.32l-1.5.008l.013 2.545zM2.34 10.58a9.81 9.81 0 0 0 2.797 8.281l1.06-1.06a8.31 8.31 0 0 1-2.371-7.017z"/></g>'},"earth-linear":{body:'<g fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="12" cy="12" r="10"/><path d="M6 4.71c.78.711 2.388 2.653 2.575 4.737C8.75 11.396 10.035 12.98 12 13c.755.008 1.518-.537 1.516-1.292c0-.233-.039-.472-.099-.692A1.4 1.4 0 0 1 13.5 10c.61-1.257 1.81-1.595 2.76-2.278c.421-.303.806-.623.975-.88c.469-.71.937-2.131.703-2.842M22 13c-.33.931-.562 3.375-4.282 3.414c0 0-3.293 0-4.281 1.862c-.791 1.49-.33 3.103 0 3.724"/></g>'},"bolt-bold":{body:'<path fill="currentColor" d="m5.67 9.914l3.062-4.143c1.979-2.678 2.969-4.017 3.892-3.734s.923 1.925.923 5.21v.31c0 1.185 0 1.777.379 2.148l.02.02c.387.363 1.003.363 2.236.363c2.22 0 3.329 0 3.704.673l.018.034c.354.683-.289 1.553-1.574 3.29l-3.062 4.144c-1.98 2.678-2.969 4.017-3.892 3.734s-.923-1.925-.923-5.21v-.31c0-1.185 0-1.777-.379-2.148l-.02-.02c-.387-.363-1.003-.363-2.236-.363c-2.22 0-3.329 0-3.703-.673l-.019-.034c-.354-.683.289-1.552 1.574-3.29"/>'},"waterdrop-linear":{body:'<g fill="none" stroke="currentColor" stroke-width="1.5"><path d="M3 13.193C3 18.057 6.855 22 11.612 22h.777C17.145 22 21 18.057 21 13.193v-.265c0-4.611-2.729-8.765-6.903-10.507a5.43 5.43 0 0 0-4.194 0C5.73 4.163 3 8.317 3 12.928z"/><path stroke-linecap="round" d="M7.615 10.724c.634-2.006 2.016-3.636 3.77-4.448"/></g>'},"paperclip-linear":{body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="1.5" d="m7.918 17.807l7.89-7.553a2.253 2.253 0 0 0 0-3.284a2.503 2.503 0 0 0-3.43 0l-7.834 7.498a4.28 4.28 0 0 0 0 6.24c1.8 1.723 4.718 1.723 6.518 0l7.949-7.608c2.652-2.54 2.652-6.656 0-9.196s-6.954-2.539-9.607 0L3 10.034"/>'},"arrow-up-linear":{body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M12 20V4m0 0l6 6m-6-6l-6 6"/>'}}},zn={prefix:"mingcute",width:24,height:24,icons:{"down-line":{body:'<g fill="none" fill-rule="evenodd"><path d="M24 0v24H0V0zM12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"/><path fill="currentColor" d="M12.707 15.707a1 1 0 0 1-1.414 0L5.636 10.05A1 1 0 1 1 7.05 8.636l4.95 4.95l4.95-4.95a1 1 0 0 1 1.414 1.414z"/></g>'},"code-line":{body:'<g fill="none"><path d="M0 0h24v24H0z"/><path fill="currentColor" d="M14.486 3.143a1 1 0 0 1 .692 1.233l-4.43 15.788a1 1 0 0 1-1.926-.54l4.43-15.788a1 1 0 0 1 1.234-.693M7.207 7.05a1 1 0 0 1 0 1.414L3.672 12l3.535 3.535a1 1 0 1 1-1.414 1.415L1.55 12.707a1 1 0 0 1 0-1.414L5.793 7.05a1 1 0 0 1 1.414 0m9.586 1.414a1 1 0 1 1 1.414-1.414l4.243 4.243a1 1 0 0 1 0 1.414l-4.243 4.243a1 1 0 0 1-1.414-1.415L20.328 12z"/></g>'},"close-line":{body:'<g fill="none" fill-rule="evenodd"><path d="m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"/><path fill="currentColor" d="m12 13.414l5.657 5.657a1 1 0 0 0 1.414-1.414L13.414 12l5.657-5.657a1 1 0 0 0-1.414-1.414L12 10.586L6.343 4.929A1 1 0 0 0 4.93 6.343L10.586 12l-5.657 5.657a1 1 0 1 0 1.414 1.414z"/></g>'},"add-line":{body:'<g fill="none"><path d="m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"/><path fill="currentColor" d="M11 20a1 1 0 1 0 2 0v-7h7a1 1 0 1 0 0-2h-7V4a1 1 0 1 0-2 0v7H4a1 1 0 1 0 0 2h7z"/></g>'}}};ir(Qn);ir(zn);const Iu={[Qn.prefix]:Qn,[zn.prefix]:zn};function ku(e){var r;if(typeof e!="string")return null;const[t,n]=e.split(":");return!t||!n?null:((r=Iu[t])==null?void 0:r.icons[n])??null}function Z({className:e,icon:t,width:n=20,height:r=n,...i}){const s=ku(t);return s?p.jsx("svg",{"aria-hidden":"true",className:te("mint-inline-block mint-shrink-0",e),width:n,height:r,viewBox:"0 0 24 24",dangerouslySetInnerHTML:{__html:s.body},...i}):p.jsx(Ou,{className:te("mint-inline-block mint-shrink-0",e),icon:t,width:n,height:r,...i})}const cr=`<svg width="10" height="10" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg">
44
+ <path d="M1.95261 0.335011C1.50592 -0.11167 0.781703 -0.11167 0.335011 0.335011C-0.11167 0.781703 -0.11167 1.50592 0.335011 1.95261L2.95767 4.57524L0.335011 7.19789C-0.11167 7.64454 -0.11167 8.3688 0.335011 8.81546C0.781703 9.26212 1.50592 9.26212 1.95261 8.81546L4.57524 6.19282L7.19789 8.81546C7.64454 9.26212 8.3688 9.26212 8.81546 8.81546C9.26212 8.3688 9.26212 7.64454 8.81546 7.19789L6.19282 4.57524L8.81546 1.95261C9.26212 1.50592 9.26212 0.781703 8.81546 0.335011C8.3688 -0.11167 7.64454 -0.11167 7.19789 0.335011L4.57524 2.95767L1.95261 0.335011Z" fill="currentColor"/>
45
+ </svg>
46
+ `;function je({source:e,className:t}){return p.jsx("span",{"aria-hidden":"true",className:te("mint-svg-asset mint-inline-block mint-shrink-0",t),dangerouslySetInnerHTML:{__html:e}})}function Mu({open:e,onClick:t}){return p.jsx("button",{type:"button","aria-label":e?"Close assistant":"Open assistant",onClick:t,className:"mint-flex mint-h-12 mint-w-12 mint-items-center mint-justify-center mint-self-end mint-rounded-full mint-border-0 mint-bg-primary-light mint-p-0 mint-text-grey-800 mint-shadow-widget mint-transition-transform hover:mint-scale-105",children:e?p.jsx(je,{source:cr,className:"mint-h-4 mint-w-4"}):p.jsx(Z,{icon:"solar:chat-round-dots-bold",width:22})})}const bs=`<svg width="14" height="9" viewBox="0 0 14 9" fill="none" xmlns="http://www.w3.org/2000/svg">
47
+ <path d="M8.67742 0.814748L12.3467 4.48402L8.67742 8.15329M4.48397 8.15329L0.814697 4.48402L4.48397 0.814749" stroke="currentColor" stroke-width="1.6295" stroke-linecap="round" stroke-linejoin="round"/>
48
+ </svg>
49
+ `;function Xt(e="tmp"){return`${e}_${Math.random().toString(36).slice(2)}${Date.now().toString(36)}`}function Au(e){const t=e.timestamp??e.createdAt??new Date().toISOString();return{...e,createdAt:t instanceof Date?t.toISOString():String(t),status:"sent"}}function xs(){const e=St(),{context:t}=Ue(),{messages:n,draft:r,conversationId:i}=ft(c=>c.chatUi),[s,{isLoading:o}]=xc(),a=T.useCallback(async c=>{const u=(c??r).trim();if(!u||o)return;const l={id:Xt("user"),role:"user",content:u,createdAt:new Date().toISOString(),status:"sending"};e(rt(l)),e(nr(""));try{const y=await s({conversationId:i,message:u,context:t}).unwrap();i||e(wc(y.conversationId)),e(rt(Au(y.reply)))}catch{e(rt({id:Xt("err"),role:"system",content:"Failed to send. Please try again.",createdAt:new Date().toISOString(),status:"error"}))}},[r,o,e,s,i,t]);return{messages:n,draft:r,isLoading:o,send:a}}const vs=`<svg width="25" height="25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
50
+ <path d="M2.64672 11.1835C4.49248 10.3977 6.17077 9.26593 7.59099 7.84916C9.56882 5.86738 10.9799 3.3921 11.6775 0.680538C11.7081 0.560106 11.778 0.453311 11.8761 0.377031C11.9742 0.300751 12.0949 0.259338 12.2192 0.259338C12.3434 0.259338 12.4641 0.300751 12.5622 0.377031C12.6603 0.453311 12.7302 0.560106 12.7608 0.680538C13.4599 3.39175 14.8712 5.86675 16.8484 7.84916C18.2688 9.26576 19.947 10.3975 21.7927 11.1835C22.5149 11.4946 23.2571 11.7446 24.0171 11.9368C24.1382 11.9666 24.2459 12.0361 24.3229 12.1343C24.3999 12.2325 24.4417 12.3537 24.4417 12.4784C24.4417 12.6032 24.3999 12.7244 24.3229 12.8226C24.2459 12.9208 24.1382 12.9903 24.0171 13.0201C23.2571 13.2112 22.5171 13.4612 21.7927 13.7723C19.9469 14.558 18.2686 15.6898 16.8484 17.1066C14.8701 19.0886 13.4586 21.5643 12.7608 24.2763C12.731 24.3975 12.6615 24.5052 12.5633 24.5822C12.4651 24.6592 12.3439 24.701 12.2192 24.701C12.0944 24.701 11.9732 24.6592 11.875 24.5822C11.7768 24.5052 11.7073 24.3975 11.6775 24.2763C11.4864 23.5153 11.2364 22.7753 10.9253 22.0509C10.1396 20.2051 9.00779 18.5268 7.59099 17.1066C5.60883 15.1287 3.13317 13.7176 0.421247 13.0201C0.300816 12.9895 0.194021 12.9196 0.117743 12.8215C0.0414619 12.7234 4.76837e-05 12.6027 4.76837e-05 12.4784C4.76837e-05 12.3542 0.0414619 12.2335 0.117743 12.1354C0.194021 12.0373 0.300816 11.9674 0.421247 11.9368C1.18196 11.7454 1.92616 11.4935 2.64672 11.1835Z" fill="currentColor"/>
51
+ <path d="M1.32299 21.3266C1.78379 21.1304 2.20277 20.8479 2.55733 20.4942C3.05109 19.9994 3.40336 19.3815 3.57752 18.7045C3.58517 18.6745 3.60261 18.6478 3.6271 18.6287C3.65159 18.6097 3.68173 18.5994 3.71275 18.5994C3.74377 18.5994 3.77391 18.6097 3.79839 18.6287C3.82288 18.6478 3.84033 18.6745 3.84797 18.7045C4.0225 19.3814 4.37483 19.9993 4.86844 20.4942C5.22304 20.8478 5.64201 21.1304 6.10278 21.3266C6.28308 21.4042 6.46836 21.4667 6.65809 21.5146C6.68834 21.5221 6.71523 21.5394 6.73445 21.5639C6.75367 21.5885 6.76411 21.6187 6.76411 21.6499C6.76411 21.681 6.75367 21.7113 6.73445 21.7358C6.71523 21.7603 6.68834 21.7777 6.65809 21.7851C6.46836 21.8328 6.28363 21.8952 6.10278 21.9729C5.64199 22.169 5.223 22.4516 4.86844 22.8053C4.37455 23.3001 4.02218 23.9181 3.84797 24.5952C3.84054 24.6255 3.82318 24.6523 3.79866 24.6716C3.77415 24.6908 3.7439 24.7012 3.71275 24.7012C3.6816 24.7012 3.65135 24.6908 3.62683 24.6716C3.60232 24.6523 3.58496 24.6255 3.57752 24.5952C3.52982 24.4052 3.46741 24.2205 3.38974 24.0396C3.19359 23.5788 2.91103 23.1598 2.55733 22.8053C2.06248 22.3115 1.44443 21.9592 0.767403 21.7851C0.737337 21.7774 0.710676 21.76 0.691632 21.7355C0.672589 21.711 0.66225 21.6809 0.66225 21.6499C0.66225 21.6188 0.672589 21.5887 0.691632 21.5642C0.710676 21.5397 0.737337 21.5223 0.767403 21.5146C0.957315 21.4669 1.1431 21.404 1.32299 21.3266Z" fill="currentColor"/>
52
+ <path d="M19.1215 2.95604C19.5735 2.74047 19.9801 2.44036 20.3193 2.07191C20.7916 1.55662 21.1173 0.924249 21.2625 0.240516C21.2688 0.210152 21.2851 0.182773 21.3088 0.162706C21.3325 0.142639 21.3621 0.131029 21.3931 0.12971C21.4241 0.128391 21.4547 0.13744 21.4799 0.155425C21.5052 0.17341 21.5238 0.199305 21.5327 0.229019C21.7358 0.897842 22.1141 1.50019 22.6283 1.97367C22.9976 2.31193 23.4282 2.57641 23.8969 2.75286C24.0804 2.82279 24.2681 2.87727 24.4597 2.91715C24.4903 2.92329 24.5179 2.93949 24.5381 2.96316C24.5584 2.98684 24.5701 3.01662 24.5714 3.04774C24.5727 3.07886 24.5636 3.10953 24.5454 3.13484C24.5272 3.16015 24.5011 3.17863 24.4712 3.18735C24.2837 3.24308 24.1018 3.31328 23.9244 3.39857C23.4724 3.61414 23.0658 3.91425 22.7266 4.2827C22.2541 4.79805 21.9284 5.43052 21.7831 6.11438C21.777 6.14492 21.7608 6.17252 21.7371 6.19277C21.7134 6.21301 21.6836 6.22473 21.6525 6.22605C21.6214 6.22738 21.5907 6.21823 21.5654 6.20007C21.5401 6.18191 21.5216 6.15579 21.5129 6.12588C21.4572 5.93807 21.3869 5.75616 21.3017 5.57878C21.0861 5.12673 20.786 4.72013 20.4175 4.38094C19.9021 3.90864 19.2697 3.58296 18.5859 3.43775C18.5555 3.4314 18.5281 3.4151 18.508 3.39144C18.488 3.36779 18.4764 3.33812 18.4751 3.30712C18.4737 3.27613 18.4828 3.24558 18.5008 3.2203C18.5188 3.19503 18.5446 3.17647 18.5744 3.16755C18.7621 3.11174 18.945 3.04101 19.1215 2.95604Z" fill="currentColor"/>
53
+ </svg>
54
+ `;function ws({onSend:e,disabled:t}){const n=St(),r=ft(o=>o.chatUi.draft),i=T.useRef(null),s=o=>{o.key==="Enter"&&!o.shiftKey&&(o.preventDefault(),e())};return p.jsx("div",{className:"mint-px-5 mint-pb-5",children:p.jsxs("div",{className:"mint-flex mint-h-12 mint-items-center mint-gap-3 mint-rounded-lg mint-border mint-border-grey-200 mint-bg-white mint-px-3 mint-shadow-composer",children:[p.jsx(je,{source:vs,className:"mint-h-[20px] mint-w-[20px] mint-text-assistant-action"}),p.jsx("textarea",{ref:i,rows:1,value:r,placeholder:"Ask the AI",onChange:o=>n(nr(o.target.value)),onKeyDown:s,className:"mint-scroll mint-h-5 mint-max-h-20 mint-flex-1 mint-resize-none mint-border-0 mint-bg-transparent mint-p-0 mint-text-xs mint-leading-5 mint-text-grey-800 mint-outline-none placeholder:mint-text-grey-600"}),p.jsx("button",{type:"button","aria-label":"Send message",disabled:t||!r.trim(),onClick:e,className:"mint-flex mint-h-7 mint-w-7 mint-shrink-0 mint-items-center mint-justify-center mint-rounded-md mint-border-0 mint-bg-assistant-action mint-p-0 mint-text-primary-contrast mint-transition-transform hover:mint-scale-105 disabled:mint-opacity-40 disabled:hover:mint-scale-100",children:p.jsx(Z,{icon:"solar:plain-2-bold",width:17})})]})})}const Pu=`<svg width="13" height="14" viewBox="0 0 13 14" fill="none" xmlns="http://www.w3.org/2000/svg">
55
+ <path d="M4.55012 1.53112C5.27634 1.09946 5.63936 0.883636 6.0381 0.883636C6.43683 0.883636 6.79986 1.09946 7.52605 1.53112L9.70463 2.82608C10.4308 3.25774 10.7939 3.47357 10.9933 3.82906C11.1926 4.18455 11.1926 4.61621 11.1926 5.47953V8.06944C11.1926 8.93274 11.1926 9.36439 10.9933 9.71991C10.7939 10.0754 10.4308 10.2912 9.70463 10.7229L7.52605 12.0179C6.79986 12.4495 6.43683 12.6653 6.0381 12.6653C5.63936 12.6653 5.27634 12.4495 4.55012 12.0179L2.37158 10.7229C1.6454 10.2912 1.28231 10.0754 1.08296 9.71991C0.883606 9.36439 0.883606 8.93274 0.883606 8.06944V5.47953C0.883606 4.61621 0.883606 4.18455 1.08296 3.82906C1.28231 3.47357 1.6454 3.25774 2.37158 2.82608L4.55012 1.53112Z" stroke="currentColor" stroke-opacity="0.9" stroke-width="1.76725"/>
56
+ </svg>
57
+ `,Du=`<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
58
+ <path d="M13.9908 5.89076H10.8422L13.1573 1.8408C13.2219 1.72876 13.256 1.60164 13.2559 1.47226C13.2558 1.34288 13.2217 1.2158 13.1569 1.10382C13.0921 0.991833 12.9989 0.8989 12.8868 0.834375C12.7746 0.769851 12.6475 0.736013 12.5181 0.736269H7.36361C7.22677 0.736205 7.09262 0.774272 6.97621 0.846199C6.8598 0.918126 6.76574 1.02107 6.70457 1.14347L3.02279 8.50703C2.96668 8.61932 2.9402 8.7441 2.94588 8.8695C2.95156 8.9949 2.98921 9.11677 3.05524 9.22353C3.12127 9.33029 3.2135 9.41839 3.32317 9.47948C3.43284 9.54056 3.5563 9.5726 3.68183 9.57254H7.1103L5.18547 15.9884C5.13663 16.1506 5.1452 16.3247 5.20973 16.4813C5.27427 16.6379 5.39083 16.7675 5.53976 16.8482C5.68869 16.9289 5.86089 16.9557 6.02733 16.9243C6.19377 16.8928 6.34428 16.8049 6.45347 16.6754L14.5534 7.1028C14.6441 6.99557 14.7023 6.86462 14.7211 6.72541C14.7398 6.58619 14.7184 6.44452 14.6592 6.3171C14.6001 6.18968 14.5057 6.08184 14.3873 6.0063C14.2689 5.93076 14.1313 5.89067 13.9908 5.89076ZM7.61176 13.0253L8.80539 9.04899C8.83861 8.93895 8.84561 8.82267 8.82582 8.70944C8.80604 8.59622 8.76003 8.48919 8.69146 8.39694C8.6229 8.30469 8.53369 8.22977 8.43098 8.17817C8.32827 8.12658 8.21491 8.09975 8.09996 8.09983H4.87325L7.81868 2.20898H11.2486L8.93352 6.25894C8.86883 6.37098 8.8348 6.4981 8.83487 6.62748C8.83493 6.75686 8.86908 6.88394 8.93388 6.99592C8.99868 7.10791 9.09185 7.20084 9.20399 7.26536C9.31613 7.32989 9.4433 7.36373 9.57268 7.36347H12.4032L7.61176 13.0253Z" fill="currentColor" fill-opacity="0.9"/>
59
+ </svg>
60
+ `,Ru=`<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
61
+ <path d="M8.83631 1.47263C8.83631 1.47263 13.9908 5.23937 13.9908 10.0823C13.9908 11.5094 13.4477 12.878 12.4811 13.8871C11.5144 14.8962 10.2034 15.4629 8.83639 15.4629C7.46934 15.4629 6.1582 14.8965 5.19154 13.8874C4.22489 12.8783 3.68182 11.5094 3.68182 10.0823C3.68182 5.23937 8.83631 1.47263 8.83631 1.47263Z" stroke="currentColor" stroke-opacity="0.9" stroke-width="1.76725" stroke-linecap="round" stroke-linejoin="round"/>
62
+ </svg>
63
+ `;function Tu({message:e}){const t=e.role==="user";return e.role==="system"?p.jsx("div",{className:"mint-flex mint-justify-center mint-py-1",children:p.jsx("span",{className:"mint-rounded-full mint-bg-error/10 mint-px-3 mint-py-1 mint-text-xs mint-text-error",children:e.content})}):p.jsx("div",{className:te("mint-flex mint-w-full",t?"mint-justify-end":"mint-justify-start"),children:p.jsx("div",{className:te("mint-max-w-[78%] mint-whitespace-pre-wrap mint-break-words mint-rounded-2xl mint-px-4 mint-py-3 mint-text-sm mint-leading-relaxed",t?"mint-rounded-tr-sm mint-bg-grey-100 mint-text-grey-800":"mint-rounded-tl-sm mint-bg-primary-lighter/40 mint-text-grey-800",e.status==="sending"&&"mint-opacity-60"),children:e.content})})}const Vu=[{label:"Organization Carbon",icon:Pu},{label:"Organization Energy",icon:Du},{label:"Water Footprint",icon:Ru}];function Lu({messages:e,isLoading:t}){const{welcomeMessage:n}=Ue(),r=T.useRef(null);return T.useEffect(()=>{var i;(i=r.current)==null||i.scrollIntoView({behavior:"smooth"})},[e.length,t]),p.jsxs("div",{className:"mint-scroll mint-flex mint-flex-1 mint-flex-col mint-gap-5 mint-overflow-y-auto mint-px-6 mint-py-5",children:[e.length===0&&p.jsxs("div",{className:"mint-flex mint-flex-1 mint-flex-col mint-items-center mint-justify-center mint-px-1",children:[p.jsx("h3",{className:"mint-m-0 mint-text-center mint-text-[24px] mint-font-bold mint-leading-7 mint-text-grey-900",children:n}),p.jsx("div",{className:"mint-mt-4 mint-flex mint-w-fit mint-max-w-full mint-flex-wrap mint-items-center mint-justify-center mint-gap-3",children:Vu.map(i=>p.jsxs("button",{type:"button",className:"mint-inline-flex mint-max-w-full mint-items-center mint-justify-center mint-gap-0.5 mint-whitespace-nowrap mint-rounded-[7px] mint-border-[0.125px] mint-border-solid mint-border-assistant-accent mint-bg-assistant-accent/5 mint-px-2.5 mint-py-1 mint-text-[7px] mint-font-normal mint-leading-none mint-text-grey-900",children:[p.jsx(je,{source:i.icon,className:"mint-h-3 mint-w-3"}),i.label]},i.label))})]}),e.map(i=>p.jsx(Tu,{message:i},i.id)),t&&p.jsx("div",{className:"mint-flex mint-justify-start",children:p.jsxs("div",{className:"mint-flex mint-gap-1 mint-rounded-2xl mint-rounded-tl-sm mint-bg-primary-lighter/40 mint-px-4 mint-py-3",children:[p.jsx("span",{className:"mint-h-2 mint-w-2 mint-animate-bounce mint-rounded-full mint-bg-grey-500 [animation-delay:-0.3s]"}),p.jsx("span",{className:"mint-h-2 mint-w-2 mint-animate-bounce mint-rounded-full mint-bg-grey-500 [animation-delay:-0.15s]"}),p.jsx("span",{className:"mint-h-2 mint-w-2 mint-animate-bounce mint-rounded-full mint-bg-grey-500"})]})}),p.jsx("div",{ref:r})]})}function Fu(){const e=St(),{title:t,enableExpandMode:n,formContent:r,renderForm:i}=Ue(),{messages:s,isLoading:o,send:a}=xs(),c=n||!!(i||r);return p.jsx("div",{className:"mint-ai-shell",children:p.jsxs("div",{className:"mint-ai-panel mint-flex mint-flex-col mint-overflow-hidden mint-rounded-xl mint-bg-white",children:[p.jsxs("div",{className:"mint-mx-2 mint-flex mint-h-[72px] mint-shrink-0 mint-items-center mint-justify-between mint-gap-3 mint-px-3 mint-py-2",children:[p.jsxs("div",{className:"mint-min-w-0",children:[p.jsx("h2",{className:"mint-m-0 mint-truncate mint-text-[22px] mint-font-bold mint-leading-7 mint-text-grey-900",children:t}),p.jsx("p",{className:"mint-m-0 mint-mt-2 mint-text-xs mint-leading-4 mint-text-grey-500",children:"AI assisted disclosure and operational data capture"})]}),p.jsxs("div",{className:"mint-flex mint-shrink-0 mint-items-center mint-gap-2",children:[c&&p.jsx("button",{type:"button","aria-label":"Open expand mode",onClick:()=>e(rs(!0)),className:"mint-flex mint-h-7 mint-w-7 mint-shrink-0 mint-items-center mint-justify-center mint-rounded-full mint-border-0 mint-bg-assistant-action mint-p-0 mint-text-grey-800 mint-transition-transform hover:mint-scale-105",children:p.jsx(je,{source:bs,className:"mint-h-2.5 mint-w-3"})}),p.jsx("button",{type:"button","aria-label":"Close assistant",onClick:()=>e(tr(!1)),className:"mint-flex mint-h-7 mint-w-7 mint-shrink-0 mint-items-center mint-justify-center mint-rounded-full mint-border-0 mint-bg-assistant-action mint-p-0 mint-text-grey-800 mint-transition-transform hover:mint-scale-105",children:p.jsx(je,{source:cr,className:"mint-h-2 mint-w-2 mint-translate-y-[2px]"})})]})]}),p.jsx("div",{className:"mint-mx-2 mint-h-px mint-shrink-0 mint-bg-assistant-divider"}),p.jsx(Lu,{messages:s,isLoading:o}),p.jsx(ws,{onSend:()=>a(),disabled:o})]})})}const Qu=["I found the Energy Consumption...","Explain sustainability data","We consumed 18,400 kWh electri..."],zu={initials:"HW",name:"Henry Williams",email:"henrywilliams@company.com",avatarUrl:""},$u={intro:"I found the Energy Consumption form. Expand to review fields and submit evidence. Matched form Energy Consumption Confidence 94% - 5 fields",fields:{emissionType:{label:"Emission Type",value:"Purchased electricity",options:["Purchased electricity","Facility level refrigerant leakage","Stationary combustion"]},factorSource:{label:"Emission Factor Source",value:"DEFRA",options:["DEFRA","IPCC"],helper:"Only IPCC / DEFRA (no Custom)."},month:{label:"Month",value:"February",options:["January","February","March","April"]},consumption:{label:"Consumption",value:18400},unit:{label:"Unit",value:"kWh",options:["kWh","MWh"],helper:"Electricity usage from the uploaded utility bill."},notes:{label:"AI Notes",value:"Matched because the user mentioned electricity usage, a facility, and a reporting month. Review evidence before submit."}}},qu=[{id:"expanded-demo-user-mapped",role:"user",content:"I mapped this to Scope 2 purchased electricity and filled the matching fields.",createdAt:"2026-06-24T00:01:00.000Z",status:"sent"},{id:"expanded-demo-user-confirm",role:"user",content:"Please confirm the reporting period and upload or reference the utility bill.",createdAt:"2026-06-24T00:02:00.000Z",status:"sent"}],Uu="Demo response: I kept the same temporary Energy Consumption preview values. Submit Entry will only show a frontend demo success message.";function Es({user:e,size:t="sm"}){const n=te("mint-flex mint-shrink-0 mint-items-center mint-justify-center mint-overflow-hidden mint-rounded-full mint-bg-grey-200 mint-font-bold mint-text-grey-700",t==="md"?"mint-h-9 mint-w-9 mint-text-xs":"mint-h-8 mint-w-8 mint-text-xs");return e.avatarUrl?p.jsx("img",{src:e.avatarUrl,alt:e.name,className:te(n,"mint-object-cover")}):p.jsx("div",{className:n,children:e.initials})}function Wu({user:e}){return p.jsxs("aside",{className:"mint-flex mint-w-[230px] mint-shrink-0 mint-flex-col mint-rounded-xl mint-border mint-border-grey-200 mint-bg-white mint-p-4 mint-shadow-sm",children:[p.jsx("h1",{className:"mint-m-0 mint-text-[28px] mint-font-extrabold mint-leading-9 mint-text-grey-900",children:"MINT AI"}),p.jsxs("div",{className:"mint-mt-6 mint-flex mint-h-9 mint-items-center mint-gap-2 mint-rounded-lg mint-border mint-border-grey-200 mint-bg-white mint-px-3 mint-shadow-sm",children:[p.jsx(Z,{icon:"solar:magnifer-linear",width:17,className:"mint-text-grey-500"}),p.jsx("span",{className:"mint-flex-1 mint-text-xs mint-text-grey-500",children:"Search"}),p.jsx(je,{source:vs,className:"mint-h-4 mint-w-4 mint-text-assistant-action"})]}),p.jsxs("button",{type:"button",className:"mint-mt-4 mint-flex mint-items-center mint-gap-2 mint-border-0 mint-bg-transparent mint-px-2 mint-py-1 mint-text-xs mint-font-semibold mint-text-grey-800",children:[p.jsx(Z,{icon:"solar:history-linear",width:17}),"History"]}),p.jsxs("div",{className:"mint-mt-4 mint-flex mint-flex-1 mint-flex-col mint-gap-1",children:[p.jsxs("div",{className:"mint-flex mint-items-center mint-gap-1 mint-px-2 mint-py-1 mint-text-xs mint-font-semibold mint-text-grey-700",children:["Recents",p.jsx(Z,{icon:"mingcute:down-line",width:13,className:"mint-text-grey-500"})]}),Qu.map((t,n)=>p.jsx("button",{type:"button",className:te("mint-truncate mint-rounded mint-border-0 mint-bg-transparent mint-px-2 mint-py-1 mint-text-left mint-text-xs mint-text-grey-600",n===0&&"mint-bg-grey-200 mint-text-grey-700"),children:t},t))]}),p.jsxs("div",{className:"mint-flex mint-items-center mint-gap-2 mint-rounded-md mint-border mint-border-grey-200 mint-p-2",children:[p.jsx(Es,{user:e}),p.jsxs("div",{className:"mint-min-w-0",children:[p.jsx("p",{className:"mint-m-0 mint-truncate mint-text-[10px] mint-font-semibold mint-leading-3 mint-text-grey-900",children:e.name}),e.email&&p.jsx("p",{className:"mint-m-0 mint-truncate mint-text-[9px] mint-leading-3 mint-text-grey-500",children:e.email})]})]})]})}function Fe({children:e}){return p.jsx("label",{className:"mint-text-[7px] mint-font-semibold mint-leading-3 mint-text-grey-800",children:e})}function Pt({value:e,options:t}){return p.jsxs("div",{className:"mint-relative",children:[p.jsx("select",{defaultValue:e,className:"mint-h-6 mint-w-full mint-appearance-none mint-rounded mint-border mint-border-grey-200 mint-bg-white mint-px-2 mint-pr-5 mint-text-[7px] mint-text-grey-800 mint-outline-none",children:t.map(n=>p.jsx("option",{value:n,children:n},n))}),p.jsx(Z,{icon:"mingcute:down-line",width:10,className:"mint-pointer-events-none mint-absolute mint-right-2 mint-top-1/2 mint--translate-y-1/2 mint-text-grey-500"})]})}function Hu(){const[e,t]=T.useState(!1),{fields:n,intro:r}=$u;return p.jsxs("div",{className:"mint-w-[370px] mint-max-w-full mint-rounded-md mint-bg-primary-lighter/40 mint-p-3",children:[p.jsx("p",{className:"mint-m-0 mint-text-[10px] mint-leading-4 mint-text-grey-900",children:r}),p.jsxs("div",{className:"mint-mt-3 mint-rounded-md mint-border mint-border-grey-100 mint-bg-white mint-p-3 mint-shadow-sm",children:[p.jsxs("div",{className:"mint-grid mint-grid-cols-2 mint-gap-x-3 mint-gap-y-3",children:[p.jsxs("div",{className:"mint-flex mint-flex-col mint-gap-1",children:[p.jsx(Fe,{children:n.emissionType.label}),p.jsx(Pt,{value:n.emissionType.value,options:n.emissionType.options})]}),p.jsxs("div",{className:"mint-flex mint-flex-col mint-gap-1",children:[p.jsx(Fe,{children:n.factorSource.label}),p.jsx(Pt,{value:n.factorSource.value,options:n.factorSource.options}),p.jsx("p",{className:"mint-m-0 mint-text-[6px] mint-leading-3 mint-text-grey-500",children:n.factorSource.helper})]}),p.jsxs("div",{className:"mint-flex mint-flex-col mint-gap-1",children:[p.jsx(Fe,{children:n.month.label}),p.jsx(Pt,{value:n.month.value,options:n.month.options})]}),p.jsxs("div",{className:"mint-flex mint-flex-col mint-gap-1",children:[p.jsx(Fe,{children:n.unit.label}),p.jsx(Pt,{value:n.unit.value,options:n.unit.options}),p.jsx("p",{className:"mint-m-0 mint-text-[6px] mint-leading-3 mint-text-grey-500",children:n.unit.helper})]}),p.jsxs("div",{className:"mint-flex mint-flex-col mint-gap-1",children:[p.jsx(Fe,{children:n.consumption.label}),p.jsx("input",{type:"number",defaultValue:n.consumption.value,className:"mint-h-6 mint-w-full mint-rounded mint-border mint-border-grey-200 mint-bg-white mint-px-2 mint-text-[7px] mint-text-grey-800 mint-outline-none"})]})]}),p.jsxs("div",{className:"mint-mt-3 mint-flex mint-flex-col mint-gap-1",children:[p.jsx(Fe,{children:n.notes.label}),p.jsx("textarea",{rows:2,defaultValue:n.notes.value,className:"mint-scroll mint-w-full mint-resize-none mint-rounded mint-border mint-border-primary-light mint-bg-primary-lighter/40 mint-px-2 mint-py-1.5 mint-text-[7px] mint-leading-3 mint-text-grey-800 mint-outline-none"})]}),e&&p.jsx("div",{className:"mint-mt-3 mint-rounded mint-border mint-border-primary-light mint-bg-primary-lighter/40 mint-px-2 mint-py-1.5 mint-text-[7px] mint-font-semibold mint-text-primary-dark",children:"Demo success: entry submitted."}),p.jsxs("div",{className:"mint-mt-3 mint-flex mint-items-center mint-justify-end mint-gap-2",children:[p.jsx("button",{type:"button",className:"mint-rounded mint-border mint-border-grey-300 mint-bg-white mint-px-2 mint-py-1 mint-text-[7px] mint-font-semibold mint-text-grey-700 mint-transition-colors hover:mint-bg-grey-100",children:"Save Draft"}),p.jsx("button",{type:"button",onClick:()=>t(!0),className:"mint-rounded mint-border-0 mint-bg-primary-dark mint-px-2 mint-py-1 mint-text-[7px] mint-font-semibold mint-text-primary-contrast mint-transition-colors hover:mint-bg-primary-darker",children:"Submit Entry"})]})]})]})}function Bu({message:e,user:t}){const n=e.role==="user";return p.jsxs("div",{className:te("mint-flex mint-w-full mint-items-start mint-gap-3",n?"mint-justify-end":"mint-justify-start"),children:[n&&p.jsx(Es,{user:t,size:"md"}),p.jsx("div",{className:te("mint-max-w-[520px] mint-whitespace-pre-wrap mint-break-words mint-rounded-md mint-px-5 mint-py-3 mint-text-xs mint-leading-5 mint-text-grey-800",n?"mint-bg-grey-100":"mint-bg-primary-lighter/40"),children:e.content})]})}function Ku(){const e=St(),{title:t}=Ue(),{messages:n,draft:r}=ft(a=>a.chatUi),i=zu,s=[...qu,...n],o=()=>{const a=r.trim();a&&(e(rt({id:Xt("user"),role:"user",content:a,createdAt:new Date().toISOString(),status:"sent"})),e(nr("")),e(rt({id:Xt("assistant"),role:"assistant",content:Uu,createdAt:new Date().toISOString(),status:"sent"})))};return p.jsxs("div",{className:"mint-flex mint-h-[min(720px,calc(100vh-112px))] mint-w-[min(1100px,calc(100vw-32px))] mint-gap-3 mint-rounded-2xl mint-bg-assistant-shell mint-p-3",children:[p.jsx(Wu,{user:i}),p.jsxs("section",{className:"mint-relative mint-flex mint-min-w-0 mint-flex-1 mint-flex-col mint-overflow-hidden mint-rounded-xl mint-border mint-border-grey-200 mint-bg-white mint-shadow-sm",children:[p.jsxs("div",{className:"mint-flex mint-h-[82px] mint-shrink-0 mint-items-center mint-justify-between mint-gap-3 mint-px-6 mint-py-3",children:[p.jsxs("div",{className:"mint-min-w-0",children:[p.jsxs("h2",{className:"mint-m-0 mint-truncate mint-text-[22px] mint-font-bold mint-leading-7 mint-text-grey-900",children:[t," Expanded mode"]}),p.jsx("p",{className:"mint-m-0 mint-mt-2 mint-text-xs mint-leading-4 mint-text-grey-500",children:"AI conversation with live form filling"})]}),p.jsxs("div",{className:"mint-flex mint-items-center mint-gap-2",children:[p.jsx("button",{type:"button","aria-label":"Back to normal mode",onClick:()=>e(rs(!1)),className:"mint-flex mint-h-8 mint-w-8 mint-shrink-0 mint-items-center mint-justify-center mint-rounded-full mint-border-0 mint-bg-assistant-action mint-p-0 mint-text-grey-800 mint-transition-transform hover:mint-scale-105",children:p.jsx(je,{source:bs,className:"mint-h-3 mint-w-4"})}),p.jsx("button",{type:"button","aria-label":"Close assistant",onClick:()=>e(tr(!1)),className:"mint-flex mint-h-8 mint-w-8 mint-shrink-0 mint-items-center mint-justify-center mint-rounded-full mint-border-0 mint-bg-assistant-action mint-p-0 mint-text-grey-800 mint-transition-transform hover:mint-scale-105",children:p.jsx(je,{source:cr,className:"mint-h-2.5 mint-w-2.5"})})]})]}),p.jsx("div",{className:"mint-mx-6 mint-h-px mint-shrink-0 mint-bg-assistant-divider"}),p.jsxs("div",{className:"mint-scroll mint-flex mint-flex-1 mint-flex-col mint-gap-5 mint-overflow-y-auto mint-px-[66px] mint-pb-28 mint-pt-3",children:[p.jsx("div",{className:"mint-flex mint-justify-start",children:p.jsx(Hu,{})}),p.jsx("div",{className:"mint-min-h-3"}),s.map(a=>p.jsx(Bu,{message:a,user:i},a.id))]}),p.jsx("div",{className:"mint-absolute mint-bottom-0 mint-left-[66px] mint-right-[66px]",children:p.jsx(ws,{onSend:o})})]})]})}const Gu={"bottom-right":"mint-bottom-4 mint-right-4 mint-items-end","bottom-left":"mint-bottom-4 mint-left-4 mint-items-start","top-right":"mint-top-4 mint-right-4 mint-items-end","top-left":"mint-top-4 mint-left-4 mint-items-start"},Yu={"bottom-right":"mint-items-end mint-justify-start","bottom-left":"mint-items-start mint-justify-start","top-right":"mint-items-end mint-justify-start","top-left":"mint-items-start mint-justify-start"};function Xu(){const e=St(),{placement:t,defaultOpen:n}=Ue(),r=ft(s=>s.chatUi.open),i=ft(s=>s.chatUi.expanded);return T.useEffect(()=>{n&&e(tr(!0))},[n,e]),p.jsxs("div",{className:te("mint-fixed mint-z-widget mint-flex mint-gap-3",i?`mint-inset-0 mint-flex-col mint-bg-black/20 mint-p-4 ${Yu[t]}`:`mint-flex-col ${Gu[t]}`),children:[r&&(i?p.jsx(Ku,{}):p.jsx(Fu,{})),p.jsx("div",{className:i?"mint-absolute mint-bottom-4 mint-right-4":void 0,children:p.jsx(Mu,{open:r,onClick:()=>e(vc())})})]})}function Zu({children:e,...t}){return p.jsxs(Nc,{config:t,children:[p.jsx(Xu,{}),e]})}const Ss="ESM Sustainability AI",Ns="AI assisted disclosure and operational data capture",Ju="ESM Sustainability AI Expanded mode",el="AI conversation with live form filling",tl=[{label:"Organization Carbon",icon:"solar:earth-linear"},{label:"Organization Energy",icon:"solar:bolt-bold"},{label:"Water Footprint",icon:"solar:waterdrop-linear"}],nl=[{id:"t1",role:"assistant",content:"I found the Energy Consumption form. Expand to review fields and submit evidence. Matched form Energy Consumption Confidence 94% • 5 fields"},{id:"t2",role:"user",content:"I mapped this to Scope 2 purchased electricity and filled the matching fields."}];function Zt({icon:e,label:t,onClick:n,className:r}){return p.jsx("button",{type:"button","aria-label":t,onClick:n,className:te("mint-flex mint-h-10 mint-w-10 mint-shrink-0 mint-items-center mint-justify-center","mint-rounded-full mint-border-0 mint-bg-primary-light mint-p-0 mint-text-grey-800","mint-transition-transform hover:mint-scale-105",r),children:p.jsx(Z,{icon:e,width:18})})}function Cs({title:e,subtitle:t,large:n,onClose:r}){return p.jsxs("div",{className:"mint-flex mint-items-start mint-justify-between mint-gap-3 mint-border-b mint-border-grey-200 mint-px-6 mint-py-5",children:[p.jsxs("div",{className:"mint-min-w-0",children:[p.jsx("h2",{className:te("mint-truncate mint-font-bold mint-text-grey-900",n?"mint-text-3xl":"mint-text-2xl"),children:e}),p.jsx("p",{className:"mint-mt-1 mint-text-sm mint-text-grey-500",children:t})]}),p.jsxs("div",{className:"mint-flex mint-items-center mint-gap-2",children:[p.jsx(Zt,{icon:"mingcute:code-line",label:"Toggle code view"}),p.jsx(Zt,{icon:"mingcute:close-line",label:"Close",onClick:r})]})]})}function _s(){return p.jsx("span",{className:"mint-flex mint-h-12 mint-w-12 mint-shrink-0 mint-items-center mint-justify-center mint-rounded-full mint-bg-gradient-to-br mint-from-primary-light mint-to-primary mint-text-lg mint-font-semibold mint-text-primary-contrast",children:"M"})}function rl(){return p.jsx("span",{className:"mint-flex mint-h-12 mint-w-12 mint-shrink-0 mint-items-center mint-justify-center mint-overflow-hidden mint-rounded-full mint-bg-grey-300 mint-text-sm mint-font-semibold mint-text-grey-700",children:"HW"})}function ur({leading:e="attach",compact:t}){return t?p.jsxs("div",{className:"mint-flex mint-h-11 mint-items-center mint-gap-2 mint-rounded-lg mint-border mint-border-grey-200 mint-bg-white mint-px-3 mint-shadow-widget",children:[p.jsx(Z,{icon:"solar:magic-stick-bold",width:18,className:"mint-shrink-0 mint-text-primary-light"}),p.jsx("span",{className:"mint-flex-1 mint-text-xs mint-text-grey-500",children:"Ask the AI"}),p.jsx("button",{type:"button","aria-label":"Send",className:"mint-flex mint-h-7 mint-w-7 mint-items-center mint-justify-center mint-rounded-md mint-border-0 mint-bg-primary-light mint-p-0 mint-text-primary-contrast mint-shadow-sm mint-transition-transform hover:mint-scale-105",children:p.jsx(Z,{icon:"solar:plain-2-bold",width:17})})]}):p.jsxs("div",{className:"mint-rounded-2xl mint-border mint-border-grey-300 mint-bg-white mint-px-5 mint-py-4 mint-shadow-sm",children:[p.jsxs("div",{className:"mint-flex mint-items-center mint-gap-2 mint-text-lg mint-text-grey-500",children:[p.jsx(Z,{icon:"solar:magic-stick-bold",width:20,className:"mint-text-primary-light"}),p.jsx("span",{children:"Ask the AI"})]}),p.jsxs("div",{className:"mint-mt-4 mint-flex mint-items-end mint-justify-between",children:[p.jsx("button",{type:"button","aria-label":e==="attach"?"Attach file":"Add",className:"mint-flex mint-h-11 mint-w-11 mint-items-center mint-justify-center mint-rounded-full mint-border mint-border-primary-light mint-bg-transparent mint-p-0 mint-text-primary mint-transition-colors hover:mint-bg-primary-lighter",children:p.jsx(Z,{icon:e==="attach"?"solar:paperclip-linear":"mingcute:add-line",width:20})}),p.jsx("button",{type:"button","aria-label":"Send",className:"mint-flex mint-h-11 mint-w-11 mint-items-center mint-justify-center mint-rounded-xl mint-border-0 mint-bg-primary-light mint-p-0 mint-text-primary-contrast mint-shadow-sm mint-transition-transform hover:mint-scale-105",children:p.jsx(Z,{icon:"solar:arrow-up-linear",width:22})})]})]})}function js({onClose:e}){return p.jsxs("div",{className:"mint-flex mint-h-[640px] mint-max-h-[85vh] mint-w-[420px] mint-max-w-[calc(100vw-32px)] mint-flex-col mint-overflow-hidden mint-rounded-2xl mint-bg-white mint-shadow-widget",children:[p.jsx(Cs,{title:Ss,subtitle:Ns,onClose:e}),p.jsxs("div",{className:"mint-flex mint-flex-1 mint-flex-col mint-items-center mint-justify-center mint-px-6",children:[p.jsx("h3",{className:"mint-text-center mint-text-3xl mint-font-bold mint-text-grey-900",children:"What can I help with?"}),p.jsx("div",{className:"mint-mt-6 mint-flex mint-flex-wrap mint-justify-center mint-gap-3",children:tl.map(t=>p.jsxs("button",{type:"button",className:"mint-flex mint-items-center mint-gap-2 mint-rounded-full mint-border mint-border-grey-300 mint-bg-white mint-px-4 mint-py-2 mint-text-sm mint-font-medium mint-text-grey-700 mint-transition-colors hover:mint-border-primary hover:mint-text-primary",children:[p.jsx(Z,{icon:t.icon,width:16,className:"mint-text-grey-600"}),t.label]},t.label))})]}),p.jsx("div",{className:"mint-px-5 mint-pb-5",children:p.jsx(ur,{leading:"attach"})})]})}function il({role:e,children:t}){const n=e==="user";return p.jsxs("div",{className:te("mint-flex mint-items-start mint-gap-3",n&&"mint-flex-row-reverse"),children:[n?p.jsx(rl,{}):p.jsx(_s,{}),p.jsx("div",{className:te("mint-max-w-[78%] mint-rounded-2xl mint-px-4 mint-py-3 mint-text-sm mint-leading-relaxed",n?"mint-rounded-tr-sm mint-bg-grey-100 mint-text-grey-800":"mint-rounded-tl-sm mint-bg-primary-lighter/40 mint-text-grey-800"),children:t})]})}function Os({onClose:e}){return p.jsxs("div",{className:"mint-flex mint-h-[640px] mint-max-h-[85vh] mint-w-[420px] mint-max-w-[calc(100vw-32px)] mint-flex-col mint-overflow-hidden mint-rounded-2xl mint-bg-white mint-shadow-widget",children:[p.jsx(Cs,{title:Ss,subtitle:Ns,onClose:e}),p.jsxs("div",{className:"mint-scroll mint-flex mint-flex-1 mint-flex-col mint-gap-5 mint-overflow-y-auto mint-px-5 mint-py-5",children:[nl.map(t=>p.jsx(il,{role:t.role,children:t.content},t.id)),p.jsxs("div",{className:"mint-flex mint-items-start mint-gap-3",children:[p.jsx(_s,{}),p.jsxs("div",{className:"mint-max-w-[78%] mint-rounded-2xl mint-rounded-tl-sm mint-bg-primary-lighter/40 mint-px-4 mint-py-3",children:[p.jsx("p",{className:"mint-text-sm mint-font-semibold mint-text-grey-900",children:"AI conversation with live form filling"}),p.jsx("p",{className:"mint-mt-1 mint-text-sm mint-text-grey-700",children:"Expand to open the AI conversation and live form filling experience."}),p.jsxs("button",{type:"button",className:"mint-mt-3 mint-flex mint-items-center mint-gap-1.5 mint-rounded-lg mint-bg-gradient-to-br mint-from-primary-light mint-to-primary mint-px-3 mint-py-2 mint-text-xs mint-font-semibold mint-text-primary-contrast mint-transition-transform hover:mint-scale-105",children:[p.jsx(Z,{icon:"mingcute:code-line",width:14}),"Open Expand mode"]})]})]})]}),p.jsx("div",{className:"mint-px-5 mint-pb-5",children:p.jsx(ur,{leading:"attach"})})]})}function sl(){return p.jsxs("aside",{className:"mint-flex mint-w-[226px] mint-shrink-0 mint-flex-col mint-gap-5 mint-rounded-xl mint-border mint-border-grey-200 mint-bg-white mint-p-4 mint-shadow-sm",children:[p.jsx("h1",{className:"mint-m-0 mint-text-[28px] mint-font-extrabold mint-leading-9 mint-text-grey-900",children:"MINT AI"}),p.jsxs("div",{className:"mint-flex mint-h-8 mint-items-center mint-gap-2 mint-rounded-lg mint-border mint-border-grey-200 mint-bg-white mint-px-3 mint-shadow-sm",children:[p.jsx(Z,{icon:"solar:magnifer-linear",width:17,className:"mint-text-grey-500"}),p.jsx("span",{className:"mint-flex-1 mint-text-xs mint-text-grey-500",children:"Search"})]}),p.jsxs("button",{type:"button",className:"mint-flex mint-items-center mint-gap-2 mint-border-0 mint-bg-transparent mint-px-2 mint-text-xs mint-font-semibold mint-text-grey-800",children:[p.jsx(Z,{icon:"solar:history-linear",width:17}),"History"]}),p.jsx("div",{className:"mint-flex mint-flex-1 mint-flex-col mint-gap-1",children:p.jsxs("div",{className:"mint-flex mint-items-center mint-gap-1 mint-px-2 mint-py-1 mint-text-xs mint-font-semibold mint-text-grey-700",children:["Recents",p.jsx(Z,{icon:"mingcute:down-line",width:13,className:"mint-text-grey-500"})]})})]})}function Is({onCollapse:e,onClose:t}){return p.jsxs("div",{className:"mint-flex mint-h-[min(92vh,614px)] mint-w-[min(1080px,calc(100vw-32px))] mint-gap-3 mint-rounded-2xl mint-bg-assistant-shell mint-p-2",children:[p.jsx(sl,{}),p.jsxs("section",{className:"mint-relative mint-flex mint-flex-1 mint-flex-col mint-overflow-hidden mint-rounded-xl mint-border mint-border-grey-200 mint-bg-white mint-shadow-sm",children:[p.jsxs("div",{className:"mint-flex mint-items-start mint-justify-between mint-gap-3 mint-px-6 mint-py-3",children:[p.jsxs("div",{className:"mint-min-w-0",children:[p.jsx("h2",{className:"mint-m-0 mint-truncate mint-text-[22px] mint-font-bold mint-leading-7 mint-text-grey-900",children:Ju}),p.jsx("p",{className:"mint-m-0 mint-mt-1 mint-text-xs mint-leading-4 mint-text-grey-500",children:el})]}),p.jsxs("div",{className:"mint-flex mint-items-center mint-gap-2",children:[p.jsx(Zt,{icon:"mingcute:code-line",label:"Back to normal mode",onClick:e,className:"mint-h-8 mint-w-8"}),p.jsx(Zt,{icon:"mingcute:close-line",label:"Close",onClick:t,className:"mint-h-8 mint-w-8"})]})]}),p.jsx("div",{className:"mint-mx-6 mint-h-px mint-shrink-0 mint-bg-grey-300"}),p.jsx("div",{className:"mint-scroll mint-flex mint-flex-1 mint-flex-col mint-overflow-y-auto mint-px-[66px] mint-pb-28 mint-pt-3"}),p.jsx("div",{className:"mint-absolute mint-bottom-8 mint-left-[66px] mint-right-[66px]",children:p.jsx(ur,{leading:"add",compact:!0})})]})]})}const ol=[{id:"empty",label:"Empty"},{id:"conversation",label:"Conversation"},{id:"expanded",label:"Expand mode"}];function al({initial:e="empty"}){const[t,n]=T.useState(e);return p.jsxs("div",{className:"mint-ai-root mint-flex mint-min-h-screen mint-flex-col mint-items-center mint-gap-6 mint-bg-grey-200 mint-p-6",children:[p.jsx("div",{className:"mint-flex mint-gap-1 mint-rounded-full mint-bg-white mint-p-1 mint-shadow-sm",children:ol.map(r=>p.jsx("button",{type:"button",onClick:()=>n(r.id),className:te("mint-rounded-full mint-px-4 mint-py-2 mint-text-sm mint-font-semibold mint-transition-colors",t===r.id?"mint-bg-primary mint-text-primary-contrast":"mint-text-grey-600 hover:mint-bg-grey-100"),children:r.label},r.id))}),p.jsxs("div",{className:"mint-flex mint-w-full mint-flex-1 mint-items-center mint-justify-center",children:[t==="empty"&&p.jsx(js,{}),t==="conversation"&&p.jsx(Os,{}),t==="expanded"&&p.jsx(Is,{})]}),p.jsx("button",{type:"button","aria-label":"Close assistant",className:"mint-fixed mint-bottom-6 mint-right-6 mint-flex mint-h-14 mint-w-14 mint-items-center mint-justify-center mint-rounded-full mint-bg-primary-light mint-text-grey-800 mint-shadow-widget mint-transition-transform hover:mint-scale-105",children:p.jsx(Z,{icon:"mingcute:close-line",width:24})})]})}exports.MintAIAssistant=Zu;exports.SampleConversationPanel=Os;exports.SampleEmptyPanel=js;exports.SampleExpandedMode=Is;exports.SampleShowcase=al;exports.useChat=xs;exports.useConfig=Ue;