diff --git a/server/db.lua b/server/db.lua index e6deb0f..1e8eaf4 100644 --- a/server/db.lua +++ b/server/db.lua @@ -271,8 +271,8 @@ function db.getOfficers() return framework.getOfficers() end -function db.searchCharacters() - return framework.getCharacters() +function db.searchCharacters(search) + return utils.dbSearch(framework.getCharacters, search) end -- Reports diff --git a/server/framework/qb_core.lua b/server/framework/qb_core.lua index 63e92cc..d8a41b0 100644 --- a/server/framework/qb_core.lua +++ b/server/framework/qb_core.lua @@ -575,8 +575,22 @@ local selectCharacters = [[ players ]] -function qb.getCharacters() - local queryResult = MySQL.rawExecute.await(selectCharacters) +local selectCharactersFilter = [[ + WHERE + players.citizenid LIKE ? + OR CONCAT( + JSON_UNQUOTE(JSON_EXTRACT(players.charinfo, '$.firstname')), + ' ', + JSON_UNQUOTE(JSON_EXTRACT(players.charinfo, '$.lastname')) + ) LIKE ? +]] + +function qb.getCharacters(parameters, filter) + local searchInput = parameters[1] + local params = { "%" .. searchInput .. "%", "%" .. searchInput .. "%" } + local query = filter and selectCharactersFilter or selectCharacters + + local queryResult = MySQL.rawExecute.await(query, params) local characters = {} for _, v in pairs(queryResult) do diff --git a/server/framework/qbx_core.lua b/server/framework/qbx_core.lua index e78353c..5e56113 100644 --- a/server/framework/qbx_core.lua +++ b/server/framework/qbx_core.lua @@ -584,8 +584,24 @@ local selectCharacters = [[ players ]] -function qbx.getCharacters() - local queryResult = MySQL.rawExecute.await(selectCharacters) +local selectCharactersFilter = selectCharacters .. [[ + WHERE + players.citizenid LIKE ? + OR CONCAT( + JSON_UNQUOTE(JSON_EXTRACT(players.charinfo, '$.firstname')), + ' ', + JSON_UNQUOTE(JSON_EXTRACT(players.charinfo, '$.lastname')) + ) LIKE ? + GROUP BY + players.citizenid +]] + +function qbx.getCharacters(parameters, filter) + local searchInput = parameters[1] + local params = { "%" .. searchInput .. "%", "%" .. searchInput .. "%" } + local query = filter and selectCharactersFilter or selectCharacters + + local queryResult = MySQL.rawExecute.await(query, params) local characters = {} for _, v in pairs(queryResult) do diff --git a/server/main.lua b/server/main.lua index 4e57324..a1dd9e3 100644 --- a/server/main.lua +++ b/server/main.lua @@ -132,8 +132,8 @@ utils.registerCallback('mdt:removeCriminal', function(source, data) return db.removeCriminal(data.id, data.criminalId) end) -utils.registerCallback('mdt:getCriminalProfiles', function(source) - return db.searchCharacters() +utils.registerCallback('mdt:getCriminalProfiles', function(source, search) + return db.searchCharacters(search) end) utils.registerCallback('mdt:saveCriminal', function(source, data) diff --git a/web/build/assets/index-50c93c57.js b/web/build/assets/index-7a83f83b.js similarity index 83% rename from web/build/assets/index-50c93c57.js rename to web/build/assets/index-7a83f83b.js index 371cb52..3bd9fde 100644 --- a/web/build/assets/index-50c93c57.js +++ b/web/build/assets/index-7a83f83b.js @@ -1,4 +1,4 @@ -function xW(e,t){for(var n=0;nr[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var hS=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ta(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function SW(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var CL={exports:{}},o0={},kL={exports:{}},Qe={};/** +function xW(e,t){for(var n=0;nr[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var hS=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ta(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function SW(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var CR={exports:{}},o0={},kR={exports:{}},Qe={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ function xW(e,t){for(var n=0;n"u")return aU;var t=lU(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},uU=AL(),dU=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),` + */var AW=_,BW=Symbol.for("react.element"),FW=Symbol.for("react.fragment"),VW=Object.prototype.hasOwnProperty,HW=AW.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,WW={key:!0,ref:!0,__self:!0,__source:!0};function DR(e,t,n){var r,o={},i=null,s=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)VW.call(t,r)&&!WW.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:BW,type:e,key:i,ref:s,props:o,_owner:HW.current}}o0.Fragment=FW;o0.jsx=DR;o0.jsxs=DR;CR.exports=o0;var p=CR.exports,ki=function(){return ki=Object.assign||function(t){for(var n,r=1,o=arguments.length;r"u")return aU;var t=lU(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},uU=AR(),dU=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),` .`.concat(ZW,` { overflow: hidden `).concat(r,`; padding-right: `).concat(a,"px ").concat(r,`; @@ -32,36 +32,36 @@ function xW(e,t){for(var n=0;na)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},gU=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},vU=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},FL=function(e,t){return e==="v"?pU(t):mU(t)},VL=function(e,t){return e==="v"?gU(t):vU(t)},yU=function(e,t){return e==="h"&&t==="rtl"?-1:1},_U=function(e,t,n,r,o){var i=yU(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,c=t.contains(a),u=!1,f=s>0,h=0,m=0;do{var v=VL(e,a),y=v[0],w=v[1],P=v[2],b=w-P-i*y;(y||b)&&FL(e,a)&&(h+=b,m+=y),a=a.parentNode}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));return(f&&(o&&h===0||!o&&s>h)||!f&&(o&&m===0||!o&&-s>m))&&(u=!0),u},Eh=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},dk=function(e){return[e.deltaX,e.deltaY]},fk=function(e){return e&&"current"in e?e.current:e},wU=function(e,t){return e[0]===t[0]&&e[1]===t[1]},bU=function(e){return` +`)},fU=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,i=_.useMemo(function(){return cU(o)},[o]);return _.createElement(uU,{styles:dU(i,!t,o,n?"":"!important")})},nb=!1;if(typeof window<"u")try{var kh=Object.defineProperty({},"passive",{get:function(){return nb=!0,!0}});window.addEventListener("test",kh,kh),window.removeEventListener("test",kh,kh)}catch{nb=!1}var sc=nb?{passive:!1}:!1,hU=function(e){return e.tagName==="TEXTAREA"},BR=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!hU(e)&&n[t]==="visible")},pU=function(e){return BR(e,"overflowY")},mU=function(e){return BR(e,"overflowX")},uk=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=FR(e,r);if(o){var i=VR(e,r),s=i[1],a=i[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},gU=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},vU=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},FR=function(e,t){return e==="v"?pU(t):mU(t)},VR=function(e,t){return e==="v"?gU(t):vU(t)},yU=function(e,t){return e==="h"&&t==="rtl"?-1:1},_U=function(e,t,n,r,o){var i=yU(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,c=t.contains(a),u=!1,f=s>0,h=0,m=0;do{var v=VR(e,a),y=v[0],w=v[1],P=v[2],b=w-P-i*y;(y||b)&&FR(e,a)&&(h+=b,m+=y),a=a.parentNode}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));return(f&&(o&&h===0||!o&&s>h)||!f&&(o&&m===0||!o&&-s>m))&&(u=!0),u},Eh=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},dk=function(e){return[e.deltaX,e.deltaY]},fk=function(e){return e&&"current"in e?e.current:e},wU=function(e,t){return e[0]===t[0]&&e[1]===t[1]},bU=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},xU=0,ac=[];function SU(e){var t=_.useRef([]),n=_.useRef([0,0]),r=_.useRef(),o=_.useState(xU++)[0],i=_.useState(AL)[0],s=_.useRef(e);_.useEffect(function(){s.current=e},[e]),_.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var w=UW([e.lockRef.current],(e.shards||[]).map(fk),!0).filter(Boolean);return w.forEach(function(P){return P.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),w.forEach(function(P){return P.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=_.useCallback(function(w,P){if("touches"in w&&w.touches.length===2)return!s.current.allowPinchZoom;var b=Eh(w),S=n.current,O="deltaX"in w?w.deltaX:S[0]-b[0],E="deltaY"in w?w.deltaY:S[1]-b[1],$,N=w.target,I=Math.abs(O)>Math.abs(E)?"h":"v";if("touches"in w&&I==="h"&&N.type==="range")return!1;var R=uk(I,N);if(!R)return!0;if(R?$=I:($=I==="v"?"h":"v",R=uk(I,N)),!R)return!1;if(!r.current&&"changedTouches"in w&&(O||E)&&(r.current=$),!$)return!0;var B=r.current||$;return _U(B,P,w,B==="h"?O:E,!0)},[]),c=_.useCallback(function(w){var P=w;if(!(!ac.length||ac[ac.length-1]!==i)){var b="deltaY"in P?dk(P):Eh(P),S=t.current.filter(function($){return $.name===P.type&&$.target===P.target&&wU($.delta,b)})[0];if(S&&S.should){P.cancelable&&P.preventDefault();return}if(!S){var O=(s.current.shards||[]).map(fk).filter(Boolean).filter(function($){return $.contains(P.target)}),E=O.length>0?a(P,O[0]):!s.current.noIsolation;E&&P.cancelable&&P.preventDefault()}}},[]),u=_.useCallback(function(w,P,b,S){var O={name:w,delta:P,target:b,should:S};t.current.push(O),setTimeout(function(){t.current=t.current.filter(function(E){return E!==O})},1)},[]),f=_.useCallback(function(w){n.current=Eh(w),r.current=void 0},[]),h=_.useCallback(function(w){u(w.type,dk(w),w.target,a(w,e.lockRef.current))},[]),m=_.useCallback(function(w){u(w.type,Eh(w),w.target,a(w,e.lockRef.current))},[]);_.useEffect(function(){return ac.push(i),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:m}),document.addEventListener("wheel",c,sc),document.addEventListener("touchmove",c,sc),document.addEventListener("touchstart",f,sc),function(){ac=ac.filter(function(w){return w!==i}),document.removeEventListener("wheel",c,sc),document.removeEventListener("touchmove",c,sc),document.removeEventListener("touchstart",f,sc)}},[]);var v=e.removeScrollBar,y=e.inert;return _.createElement(_.Fragment,null,y?_.createElement(i,{styles:bU(o)}):null,v?_.createElement(fU,{gapMode:e.gapMode}):null)}const PU=eU(zL,SU);var HL=_.forwardRef(function(e,t){return _.createElement(i0,ki({},e,{ref:t,sideCar:PU}))});HL.classNames=i0.classNames;const OU=HL;function bm(e,t){let n=e;for(;(n=n.parentElement)&&!n.matches(t););return n}function CU(e,t,n){for(let r=e-1;r>=0;r-=1)if(!t[r].disabled)return r;if(n){for(let r=t.length-1;r>-1;r-=1)if(!t[r].disabled)return r}return e}function kU(e,t,n){for(let r=e+1;r{var c;n?.(a);const u=Array.from(((c=bm(a.currentTarget,e))==null?void 0:c.querySelectorAll(t))||[]).filter(w=>EU(a.currentTarget,w,e)),f=u.findIndex(w=>a.currentTarget===w),h=kU(f,u,r),m=CU(f,u,r),v=i==="rtl"?m:h,y=i==="rtl"?h:m;switch(a.key){case"ArrowRight":{s==="horizontal"&&(a.stopPropagation(),a.preventDefault(),u[v].focus(),o&&u[v].click());break}case"ArrowLeft":{s==="horizontal"&&(a.stopPropagation(),a.preventDefault(),u[y].focus(),o&&u[y].click());break}case"ArrowUp":{s==="vertical"&&(a.stopPropagation(),a.preventDefault(),u[m].focus(),o&&u[m].click());break}case"ArrowDown":{s==="vertical"&&(a.stopPropagation(),a.preventDefault(),u[h].focus(),o&&u[h].click());break}case"Home":{a.stopPropagation(),a.preventDefault(),!u[0].disabled&&u[0].focus();break}case"End":{a.stopPropagation(),a.preventDefault();const w=u.length-1;!u[w].disabled&&u[w].focus();break}}}}function MU(e,t,n){var r;return n?Array.from(((r=bm(n,t))==null?void 0:r.querySelectorAll(e))||[]).findIndex(o=>o===n):null}function Cu(e){const t=_.createContext(null);return[({children:o,value:i})=>k.createElement(t.Provider,{value:i},o),()=>{const o=_.useContext(t);if(o===null)throw new Error(e);return o}]}function yS(e){return Array.isArray(e)?e:[e]}const NU=()=>{};function TU(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||NU:n=>{var r;n.key==="Escape"&&(e(n),(r=t.onTrigger)==null||r.call(t))}}function ls(e,t){return n=>{e?.(n),t?.(n)}}function IU(e){return Object.keys(e)}function DU(){const[e,t]=_.useState(-1);return[e,{setHovered:t,resetHovered:()=>t(-1)}]}function WL({data:e}){const t=[],n=[],r=e.reduce((o,i,s)=>(i.group?o[i.group]?o[i.group].push(s):o[i.group]=[s]:n.push(s),o),{});return Object.keys(r).forEach(o=>{t.push(...r[o].map(i=>e[i]))}),t.push(...n.map(o=>e[o])),t}function jU(e,t){window.dispatchEvent(new CustomEvent(e,{detail:t}))}const LU=typeof window<"u"?_.useLayoutEffect:_.useEffect;function RU(e){function t(r){const o=Object.keys(r).reduce((i,s)=>(i[`${e}:${s}`]=a=>r[s](a.detail),i),{});LU(()=>(Object.keys(o).forEach(i=>{window.removeEventListener(i,o[i]),window.addEventListener(i,o[i])}),()=>Object.keys(o).forEach(i=>{window.removeEventListener(i,o[i])})),[o])}function n(r){return(...o)=>jU(`${e}:${String(r)}`,o[0])}return[t,n]}function zf(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==k.Fragment:!1}function UL(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t({fontFamily:e.fontFamily||"sans-serif"})}var FU=Object.defineProperty,hk=Object.getOwnPropertySymbols,VU=Object.prototype.hasOwnProperty,HU=Object.prototype.propertyIsEnumerable,pk=(e,t,n)=>t in e?FU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mk=(e,t)=>{for(var n in t||(t={}))VU.call(t,n)&&pk(e,n,t[n]);if(hk)for(var n of hk(t))HU.call(t,n)&&pk(e,n,t[n]);return e};function WU(e){return t=>({WebkitTapHighlightColor:"transparent",[t||"&:focus"]:mk({},e.focusRing==="always"||e.focusRing==="auto"?e.focusRingStyles.styles(e):e.focusRingStyles.resetStyles(e)),[t?t.replace(":focus",":focus:not(:focus-visible)"):"&:focus:not(:focus-visible)"]:mk({},e.focusRing==="auto"||e.focusRing==="never"?e.focusRingStyles.resetStyles(e):null)})}function Af(e){return t=>typeof e.primaryShade=="number"?e.primaryShade:e.primaryShade[t||e.colorScheme]}function wS(e){const t=Af(e);return(n,r,o=!0,i=!0)=>{if(typeof n=="string"&&n.includes(".")){const[a,c]=n.split("."),u=parseInt(c,10);if(a in e.colors&&u>=0&&u<10)return e.colors[a][typeof r=="number"&&!i?r:u]}const s=typeof r=="number"?r:t();return n in e.colors?e.colors[n][s]:o?e.colors[e.primaryColor][s]:n}}function ZL(e){let t="";for(let n=1;n{const o={from:r?.from||e.defaultGradient.from,to:r?.to||e.defaultGradient.to,deg:r?.deg||e.defaultGradient.deg};return`linear-gradient(${o.deg}deg, ${t(o.from,n(),!1)} 0%, ${t(o.to,n(),!1)} 100%)`}}function YL(e){return t=>{if(typeof t=="number")return`${t/16}${e}`;if(typeof t=="string"){const n=t.replace("px","");if(!Number.isNaN(Number(n)))return`${Number(n)/16}${e}`}return t}}const M=YL("rem"),Oa=YL("em");function re({size:e,sizes:t,units:n}){return e in t?t[e]:typeof e=="number"?n==="em"?Oa(e):M(e):e||t.md}function Bo(e){return typeof e=="number"?e:typeof e=="string"&&e.includes("rem")?Number(e.replace("rem",""))*16:typeof e=="string"&&e.includes("em")?Number(e.replace("em",""))*16:Number(e)}function GU(e){return t=>`@media (min-width: ${Oa(Bo(re({size:t,sizes:e.breakpoints})))})`}function YU(e){return t=>`@media (max-width: ${Oa(Bo(re({size:t,sizes:e.breakpoints}))-1)})`}function KU(e){return/^#?([0-9A-F]{3}){1,2}$/i.test(e)}function qU(e){let t=e.replace("#","");if(t.length===3){const s=t.split("");t=[s[0],s[0],s[1],s[1],s[2],s[2]].join("")}const n=parseInt(t,16),r=n>>16&255,o=n>>8&255,i=n&255;return{r,g:o,b:i,a:1}}function JU(e){const[t,n,r,o]=e.replace(/[^0-9,.]/g,"").split(",").map(Number);return{r:t,g:n,b:r,a:o||1}}function bS(e){return KU(e)?qU(e):e.startsWith("rgb")?JU(e):{r:0,g:0,b:0,a:1}}function vc(e,t){if(typeof e!="string"||t>1||t<0)return"rgba(0, 0, 0, 1)";if(e.startsWith("var(--"))return e;const{r:n,g:r,b:o}=bS(e);return`rgba(${n}, ${r}, ${o}, ${t})`}function QU(e=0){return{position:"absolute",top:M(e),right:M(e),left:M(e),bottom:M(e)}}function XU(e,t){if(typeof e=="string"&&e.startsWith("var(--"))return e;const{r:n,g:r,b:o,a:i}=bS(e),s=1-t,a=c=>Math.round(c*s);return`rgba(${a(n)}, ${a(r)}, ${a(o)}, ${i})`}function eZ(e,t){if(typeof e=="string"&&e.startsWith("var(--"))return e;const{r:n,g:r,b:o,a:i}=bS(e),s=a=>Math.round(a+(255-a)*t);return`rgba(${s(n)}, ${s(r)}, ${s(o)}, ${i})`}function tZ(e){return t=>{if(typeof t=="number")return M(t);const n=typeof e.defaultRadius=="number"?e.defaultRadius:e.radius[e.defaultRadius]||e.defaultRadius;return e.radius[t]||t||n}}function nZ(e,t){if(typeof e=="string"&&e.includes(".")){const[n,r]=e.split("."),o=parseInt(r,10);if(n in t.colors&&o>=0&&o<10)return{isSplittedColor:!0,key:n,shade:o}}return{isSplittedColor:!1}}function rZ(e){const t=wS(e),n=Af(e),r=GL(e);return({variant:o,color:i,gradient:s,primaryFallback:a})=>{const c=nZ(i,e);switch(o){case"light":return{border:"transparent",background:vc(t(i,e.colorScheme==="dark"?8:0,a,!1),e.colorScheme==="dark"?.2:1),color:i==="dark"?e.colorScheme==="dark"?e.colors.dark[0]:e.colors.dark[9]:t(i,e.colorScheme==="dark"?2:n("light")),hover:vc(t(i,e.colorScheme==="dark"?7:1,a,!1),e.colorScheme==="dark"?.25:.65)};case"subtle":return{border:"transparent",background:"transparent",color:i==="dark"?e.colorScheme==="dark"?e.colors.dark[0]:e.colors.dark[9]:t(i,e.colorScheme==="dark"?2:n("light")),hover:vc(t(i,e.colorScheme==="dark"?8:0,a,!1),e.colorScheme==="dark"?.2:1)};case"outline":return{border:t(i,e.colorScheme==="dark"?5:n("light")),background:"transparent",color:t(i,e.colorScheme==="dark"?5:n("light")),hover:e.colorScheme==="dark"?vc(t(i,5,a,!1),.05):vc(t(i,0,a,!1),.35)};case"default":return{border:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4],background:e.colorScheme==="dark"?e.colors.dark[6]:e.white,color:e.colorScheme==="dark"?e.white:e.black,hover:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[0]};case"white":return{border:"transparent",background:e.white,color:t(i,n()),hover:null};case"transparent":return{border:"transparent",color:i==="dark"?e.colorScheme==="dark"?e.colors.dark[0]:e.colors.dark[9]:t(i,e.colorScheme==="dark"?2:n("light")),background:"transparent",hover:null};case"gradient":return{background:r(s),color:e.white,border:"transparent",hover:null};default:{const u=n(),f=c.isSplittedColor?c.shade:u,h=c.isSplittedColor?c.key:i;return{border:"transparent",background:t(h,f,a),color:e.white,hover:t(h,f===9?8:f+1)}}}}}function oZ(e){return t=>{const n=Af(e)(t);return e.colors[e.primaryColor][n]}}function iZ(e){return{"@media (hover: hover)":{"&:hover":e},"@media (hover: none)":{"&:active":e}}}function sZ(e){return()=>({userSelect:"none",color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]})}function aZ(e){return()=>e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6]}const pn={fontStyles:BU,themeColor:wS,focusStyles:WU,linearGradient:UU,radialGradient:ZU,smallerThan:YU,largerThan:GU,rgba:vc,cover:QU,darken:XU,lighten:eZ,radius:tZ,variant:rZ,primaryShade:Af,hover:iZ,gradient:GL,primaryColor:oZ,placeholderStyles:sZ,dimmed:aZ};var lZ=Object.defineProperty,cZ=Object.defineProperties,uZ=Object.getOwnPropertyDescriptors,gk=Object.getOwnPropertySymbols,dZ=Object.prototype.hasOwnProperty,fZ=Object.prototype.propertyIsEnumerable,vk=(e,t,n)=>t in e?lZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hZ=(e,t)=>{for(var n in t||(t={}))dZ.call(t,n)&&vk(e,n,t[n]);if(gk)for(var n of gk(t))fZ.call(t,n)&&vk(e,n,t[n]);return e},pZ=(e,t)=>cZ(e,uZ(t));function KL(e){return pZ(hZ({},e),{fn:{fontStyles:pn.fontStyles(e),themeColor:pn.themeColor(e),focusStyles:pn.focusStyles(e),largerThan:pn.largerThan(e),smallerThan:pn.smallerThan(e),radialGradient:pn.radialGradient,linearGradient:pn.linearGradient,gradient:pn.gradient(e),rgba:pn.rgba,cover:pn.cover,lighten:pn.lighten,darken:pn.darken,primaryShade:pn.primaryShade(e),radius:pn.radius(e),variant:pn.variant(e),hover:pn.hover,primaryColor:pn.primaryColor(e),placeholderStyles:pn.placeholderStyles(e),dimmed:pn.dimmed(e)}})}const mZ={dir:"ltr",primaryShade:{light:6,dark:8},focusRing:"auto",loader:"oval",colorScheme:"light",white:"#fff",black:"#000",defaultRadius:"sm",transitionTimingFunction:"ease",colors:AU,lineHeight:1.55,fontFamily:"-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",fontFamilyMonospace:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace",primaryColor:"blue",respectReducedMotion:!0,cursorType:"default",defaultGradient:{from:"indigo",to:"cyan",deg:45},shadows:{xs:"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), 0 0.0625rem 0.125rem rgba(0, 0, 0, 0.1)",sm:"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 0.625rem 0.9375rem -0.3125rem, rgba(0, 0, 0, 0.04) 0 0.4375rem 0.4375rem -0.3125rem",md:"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 1.25rem 1.5625rem -0.3125rem, rgba(0, 0, 0, 0.04) 0 0.625rem 0.625rem -0.3125rem",lg:"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 1.75rem 1.4375rem -0.4375rem, rgba(0, 0, 0, 0.04) 0 0.75rem 0.75rem -0.4375rem",xl:"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 2.25rem 1.75rem -0.4375rem, rgba(0, 0, 0, 0.04) 0 1.0625rem 1.0625rem -0.4375rem"},fontSizes:{xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem"},radius:{xs:"0.125rem",sm:"0.25rem",md:"0.5rem",lg:"1rem",xl:"2rem"},spacing:{xs:"0.625rem",sm:"0.75rem",md:"1rem",lg:"1.25rem",xl:"1.5rem"},breakpoints:{xs:"36em",sm:"48em",md:"62em",lg:"75em",xl:"88em"},headings:{fontFamily:"-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",fontWeight:700,sizes:{h1:{fontSize:"2.125rem",lineHeight:1.3,fontWeight:void 0},h2:{fontSize:"1.625rem",lineHeight:1.35,fontWeight:void 0},h3:{fontSize:"1.375rem",lineHeight:1.4,fontWeight:void 0},h4:{fontSize:"1.125rem",lineHeight:1.45,fontWeight:void 0},h5:{fontSize:"1rem",lineHeight:1.5,fontWeight:void 0},h6:{fontSize:"0.875rem",lineHeight:1.5,fontWeight:void 0}}},other:{},components:{},activeStyles:{transform:"translateY(0.0625rem)"},datesLocale:"en",globalStyles:void 0,focusRingStyles:{styles:e=>({outlineOffset:"0.125rem",outline:`0.125rem solid ${e.colors[e.primaryColor][e.colorScheme==="dark"?7:5]}`}),resetStyles:()=>({outline:"none"}),inputStyles:e=>({outline:"none",borderColor:e.colors[e.primaryColor][typeof e.primaryShade=="object"?e.primaryShade[e.colorScheme]:e.primaryShade]})}},s0=KL(mZ);function gZ(e){if(e.sheet)return e.sheet;for(var t=0;t0?zn(ku,--Ur):0,tu--,cn===10&&(tu=1,l0--),cn}function mo(){return cn=Ur2||Xd(cn)>3?"":" "}function $Z(e,t){for(;--t&&mo()&&!(cn<48||cn>102||cn>57&&cn<65||cn>70&&cn<97););return Bf(e,zp()+(t<6&&Di()==32&&mo()==32))}function ob(e){for(;mo();)switch(cn){case e:return Ur;case 34:case 39:e!==34&&e!==39&&ob(cn);break;case 40:e===41&&ob(e);break;case 92:mo();break}return Ur}function MZ(e,t){for(;mo()&&e+cn!==47+10;)if(e+cn===42+42&&Di()===47)break;return"/*"+Bf(t,Ur-1)+"*"+a0(e===47?e:mo())}function NZ(e){for(;!Xd(Di());)mo();return Bf(e,Ur)}function TZ(e){return t5(Bp("",null,null,null,[""],e=e5(e),0,[0],e))}function Bp(e,t,n,r,o,i,s,a,c){for(var u=0,f=0,h=s,m=0,v=0,y=0,w=1,P=1,b=1,S=0,O="",E=o,$=i,N=r,I=O;P;)switch(y=S,S=mo()){case 40:if(y!=108&&zn(I,h-1)==58){rb(I+=ft(Ap(S),"&","&\f"),"&\f")!=-1&&(b=-1);break}case 34:case 39:case 91:I+=Ap(S);break;case 9:case 10:case 13:case 32:I+=EZ(y);break;case 92:I+=$Z(zp()-1,7);continue;case 47:switch(Di()){case 42:case 47:$h(IZ(MZ(mo(),zp()),t,n),c);break;default:I+="/"}break;case 123*w:a[u++]=Oi(I)*b;case 125*w:case 59:case 0:switch(S){case 0:case 125:P=0;case 59+f:b==-1&&(I=ft(I,/\f/g,"")),v>0&&Oi(I)-h&&$h(v>32?_k(I+";",r,n,h-1):_k(ft(I," ","")+";",r,n,h-2),c);break;case 59:I+=";";default:if($h(N=yk(I,t,n,u,f,o,a,O,E=[],$=[],h),i),S===123)if(f===0)Bp(I,t,N,N,E,i,h,a,$);else switch(m===99&&zn(I,3)===110?100:m){case 100:case 108:case 109:case 115:Bp(e,N,N,r&&$h(yk(e,N,N,0,0,o,a,O,o,E=[],h),$),o,$,h,a,r?E:$);break;default:Bp(I,N,N,N,[""],$,0,a,$)}}u=f=v=0,w=b=1,O=I="",h=s;break;case 58:h=1+Oi(I),v=y;default:if(w<1){if(S==123)--w;else if(S==125&&w++==0&&kZ()==125)continue}switch(I+=a0(S),S*w){case 38:b=f>0?1:(I+="\f",-1);break;case 44:a[u++]=(Oi(I)-1)*b,b=1;break;case 64:Di()===45&&(I+=Ap(mo())),m=Di(),f=h=Oi(O=I+=NZ(zp())),S++;break;case 45:y===45&&Oi(I)==2&&(w=0)}}return i}function yk(e,t,n,r,o,i,s,a,c,u,f){for(var h=o-1,m=o===0?i:[""],v=PS(m),y=0,w=0,P=0;y0?m[b]+" "+S:ft(S,/&\f/g,m[b])))&&(c[P++]=O);return c0(e,t,n,o===0?xS:a,c,u,f)}function IZ(e,t,n){return c0(e,t,n,qL,a0(CZ()),Qd(e,2,-2),0)}function _k(e,t,n,r){return c0(e,t,n,SS,Qd(e,0,r),Qd(e,r+1,-1),r)}function Fc(e,t){for(var n="",r=PS(e),o=0;o6)switch(zn(e,t+1)){case 109:if(zn(e,t+4)!==45)break;case 102:return ft(e,/(.+:)(.+)-([^]+)/,"$1"+dt+"$2-$3$1"+xm+(zn(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~rb(e,"stretch")?n5(ft(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(zn(e,t+1)!==115)break;case 6444:switch(zn(e,Oi(e)-3-(~rb(e,"!important")&&10))){case 107:return ft(e,":",":"+dt)+e;case 101:return ft(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+dt+(zn(e,14)===45?"inline-":"")+"box$3$1"+dt+"$2$3$1"+er+"$2box$3")+e}break;case 5936:switch(zn(e,t+11)){case 114:return dt+e+er+ft(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return dt+e+er+ft(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return dt+e+er+ft(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return dt+e+er+e+e}return e}var HZ=function(t,n,r,o){if(t.length>-1&&!t.return)switch(t.type){case SS:t.return=n5(t.value,t.length);break;case JL:return Fc([Ju(t,{value:ft(t.value,"@","@"+dt)})],o);case xS:if(t.length)return OZ(t.props,function(i){switch(PZ(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Fc([Ju(t,{props:[ft(i,/:(read-\w+)/,":"+xm+"$1")]})],o);case"::placeholder":return Fc([Ju(t,{props:[ft(i,/:(plac\w+)/,":"+dt+"input-$1")]}),Ju(t,{props:[ft(i,/:(plac\w+)/,":"+xm+"$1")]}),Ju(t,{props:[ft(i,/:(plac\w+)/,er+"input-$1")]})],o)}return""})}},WZ=[HZ],r5=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(w){var P=w.getAttribute("data-emotion");P.indexOf(" ")!==-1&&(document.head.appendChild(w),w.setAttribute("data-s",""))})}var o=t.stylisPlugins||WZ,i={},s,a=[];s=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(w){for(var P=w.getAttribute("data-emotion").split(" "),b=1;bMath.abs(E)?"h":"v";if("touches"in w&&I==="h"&&N.type==="range")return!1;var R=uk(I,N);if(!R)return!0;if(R?$=I:($=I==="v"?"h":"v",R=uk(I,N)),!R)return!1;if(!r.current&&"changedTouches"in w&&(O||E)&&(r.current=$),!$)return!0;var B=r.current||$;return _U(B,P,w,B==="h"?O:E,!0)},[]),c=_.useCallback(function(w){var P=w;if(!(!ac.length||ac[ac.length-1]!==i)){var b="deltaY"in P?dk(P):Eh(P),S=t.current.filter(function($){return $.name===P.type&&$.target===P.target&&wU($.delta,b)})[0];if(S&&S.should){P.cancelable&&P.preventDefault();return}if(!S){var O=(s.current.shards||[]).map(fk).filter(Boolean).filter(function($){return $.contains(P.target)}),E=O.length>0?a(P,O[0]):!s.current.noIsolation;E&&P.cancelable&&P.preventDefault()}}},[]),u=_.useCallback(function(w,P,b,S){var O={name:w,delta:P,target:b,should:S};t.current.push(O),setTimeout(function(){t.current=t.current.filter(function(E){return E!==O})},1)},[]),f=_.useCallback(function(w){n.current=Eh(w),r.current=void 0},[]),h=_.useCallback(function(w){u(w.type,dk(w),w.target,a(w,e.lockRef.current))},[]),m=_.useCallback(function(w){u(w.type,Eh(w),w.target,a(w,e.lockRef.current))},[]);_.useEffect(function(){return ac.push(i),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:m}),document.addEventListener("wheel",c,sc),document.addEventListener("touchmove",c,sc),document.addEventListener("touchstart",f,sc),function(){ac=ac.filter(function(w){return w!==i}),document.removeEventListener("wheel",c,sc),document.removeEventListener("touchmove",c,sc),document.removeEventListener("touchstart",f,sc)}},[]);var v=e.removeScrollBar,y=e.inert;return _.createElement(_.Fragment,null,y?_.createElement(i,{styles:bU(o)}):null,v?_.createElement(fU,{gapMode:e.gapMode}):null)}const PU=eU(zR,SU);var HR=_.forwardRef(function(e,t){return _.createElement(i0,ki({},e,{ref:t,sideCar:PU}))});HR.classNames=i0.classNames;const OU=HR;function bm(e,t){let n=e;for(;(n=n.parentElement)&&!n.matches(t););return n}function CU(e,t,n){for(let r=e-1;r>=0;r-=1)if(!t[r].disabled)return r;if(n){for(let r=t.length-1;r>-1;r-=1)if(!t[r].disabled)return r}return e}function kU(e,t,n){for(let r=e+1;r{var c;n?.(a);const u=Array.from(((c=bm(a.currentTarget,e))==null?void 0:c.querySelectorAll(t))||[]).filter(w=>EU(a.currentTarget,w,e)),f=u.findIndex(w=>a.currentTarget===w),h=kU(f,u,r),m=CU(f,u,r),v=i==="rtl"?m:h,y=i==="rtl"?h:m;switch(a.key){case"ArrowRight":{s==="horizontal"&&(a.stopPropagation(),a.preventDefault(),u[v].focus(),o&&u[v].click());break}case"ArrowLeft":{s==="horizontal"&&(a.stopPropagation(),a.preventDefault(),u[y].focus(),o&&u[y].click());break}case"ArrowUp":{s==="vertical"&&(a.stopPropagation(),a.preventDefault(),u[m].focus(),o&&u[m].click());break}case"ArrowDown":{s==="vertical"&&(a.stopPropagation(),a.preventDefault(),u[h].focus(),o&&u[h].click());break}case"Home":{a.stopPropagation(),a.preventDefault(),!u[0].disabled&&u[0].focus();break}case"End":{a.stopPropagation(),a.preventDefault();const w=u.length-1;!u[w].disabled&&u[w].focus();break}}}}function MU(e,t,n){var r;return n?Array.from(((r=bm(n,t))==null?void 0:r.querySelectorAll(e))||[]).findIndex(o=>o===n):null}function Cu(e){const t=_.createContext(null);return[({children:o,value:i})=>k.createElement(t.Provider,{value:i},o),()=>{const o=_.useContext(t);if(o===null)throw new Error(e);return o}]}function yS(e){return Array.isArray(e)?e:[e]}const NU=()=>{};function TU(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||NU:n=>{var r;n.key==="Escape"&&(e(n),(r=t.onTrigger)==null||r.call(t))}}function ls(e,t){return n=>{e?.(n),t?.(n)}}function IU(e){return Object.keys(e)}function jU(){const[e,t]=_.useState(-1);return[e,{setHovered:t,resetHovered:()=>t(-1)}]}function WR({data:e}){const t=[],n=[],r=e.reduce((o,i,s)=>(i.group?o[i.group]?o[i.group].push(s):o[i.group]=[s]:n.push(s),o),{});return Object.keys(r).forEach(o=>{t.push(...r[o].map(i=>e[i]))}),t.push(...n.map(o=>e[o])),t}function DU(e,t){window.dispatchEvent(new CustomEvent(e,{detail:t}))}const RU=typeof window<"u"?_.useLayoutEffect:_.useEffect;function LU(e){function t(r){const o=Object.keys(r).reduce((i,s)=>(i[`${e}:${s}`]=a=>r[s](a.detail),i),{});RU(()=>(Object.keys(o).forEach(i=>{window.removeEventListener(i,o[i]),window.addEventListener(i,o[i])}),()=>Object.keys(o).forEach(i=>{window.removeEventListener(i,o[i])})),[o])}function n(r){return(...o)=>DU(`${e}:${String(r)}`,o[0])}return[t,n]}function zf(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==k.Fragment:!1}function UR(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t({fontFamily:e.fontFamily||"sans-serif"})}var FU=Object.defineProperty,hk=Object.getOwnPropertySymbols,VU=Object.prototype.hasOwnProperty,HU=Object.prototype.propertyIsEnumerable,pk=(e,t,n)=>t in e?FU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mk=(e,t)=>{for(var n in t||(t={}))VU.call(t,n)&&pk(e,n,t[n]);if(hk)for(var n of hk(t))HU.call(t,n)&&pk(e,n,t[n]);return e};function WU(e){return t=>({WebkitTapHighlightColor:"transparent",[t||"&:focus"]:mk({},e.focusRing==="always"||e.focusRing==="auto"?e.focusRingStyles.styles(e):e.focusRingStyles.resetStyles(e)),[t?t.replace(":focus",":focus:not(:focus-visible)"):"&:focus:not(:focus-visible)"]:mk({},e.focusRing==="auto"||e.focusRing==="never"?e.focusRingStyles.resetStyles(e):null)})}function Af(e){return t=>typeof e.primaryShade=="number"?e.primaryShade:e.primaryShade[t||e.colorScheme]}function wS(e){const t=Af(e);return(n,r,o=!0,i=!0)=>{if(typeof n=="string"&&n.includes(".")){const[a,c]=n.split("."),u=parseInt(c,10);if(a in e.colors&&u>=0&&u<10)return e.colors[a][typeof r=="number"&&!i?r:u]}const s=typeof r=="number"?r:t();return n in e.colors?e.colors[n][s]:o?e.colors[e.primaryColor][s]:n}}function ZR(e){let t="";for(let n=1;n{const o={from:r?.from||e.defaultGradient.from,to:r?.to||e.defaultGradient.to,deg:r?.deg||e.defaultGradient.deg};return`linear-gradient(${o.deg}deg, ${t(o.from,n(),!1)} 0%, ${t(o.to,n(),!1)} 100%)`}}function YR(e){return t=>{if(typeof t=="number")return`${t/16}${e}`;if(typeof t=="string"){const n=t.replace("px","");if(!Number.isNaN(Number(n)))return`${Number(n)/16}${e}`}return t}}const M=YR("rem"),Oa=YR("em");function re({size:e,sizes:t,units:n}){return e in t?t[e]:typeof e=="number"?n==="em"?Oa(e):M(e):e||t.md}function Bo(e){return typeof e=="number"?e:typeof e=="string"&&e.includes("rem")?Number(e.replace("rem",""))*16:typeof e=="string"&&e.includes("em")?Number(e.replace("em",""))*16:Number(e)}function GU(e){return t=>`@media (min-width: ${Oa(Bo(re({size:t,sizes:e.breakpoints})))})`}function YU(e){return t=>`@media (max-width: ${Oa(Bo(re({size:t,sizes:e.breakpoints}))-1)})`}function KU(e){return/^#?([0-9A-F]{3}){1,2}$/i.test(e)}function qU(e){let t=e.replace("#","");if(t.length===3){const s=t.split("");t=[s[0],s[0],s[1],s[1],s[2],s[2]].join("")}const n=parseInt(t,16),r=n>>16&255,o=n>>8&255,i=n&255;return{r,g:o,b:i,a:1}}function JU(e){const[t,n,r,o]=e.replace(/[^0-9,.]/g,"").split(",").map(Number);return{r:t,g:n,b:r,a:o||1}}function bS(e){return KU(e)?qU(e):e.startsWith("rgb")?JU(e):{r:0,g:0,b:0,a:1}}function vc(e,t){if(typeof e!="string"||t>1||t<0)return"rgba(0, 0, 0, 1)";if(e.startsWith("var(--"))return e;const{r:n,g:r,b:o}=bS(e);return`rgba(${n}, ${r}, ${o}, ${t})`}function QU(e=0){return{position:"absolute",top:M(e),right:M(e),left:M(e),bottom:M(e)}}function XU(e,t){if(typeof e=="string"&&e.startsWith("var(--"))return e;const{r:n,g:r,b:o,a:i}=bS(e),s=1-t,a=c=>Math.round(c*s);return`rgba(${a(n)}, ${a(r)}, ${a(o)}, ${i})`}function eZ(e,t){if(typeof e=="string"&&e.startsWith("var(--"))return e;const{r:n,g:r,b:o,a:i}=bS(e),s=a=>Math.round(a+(255-a)*t);return`rgba(${s(n)}, ${s(r)}, ${s(o)}, ${i})`}function tZ(e){return t=>{if(typeof t=="number")return M(t);const n=typeof e.defaultRadius=="number"?e.defaultRadius:e.radius[e.defaultRadius]||e.defaultRadius;return e.radius[t]||t||n}}function nZ(e,t){if(typeof e=="string"&&e.includes(".")){const[n,r]=e.split("."),o=parseInt(r,10);if(n in t.colors&&o>=0&&o<10)return{isSplittedColor:!0,key:n,shade:o}}return{isSplittedColor:!1}}function rZ(e){const t=wS(e),n=Af(e),r=GR(e);return({variant:o,color:i,gradient:s,primaryFallback:a})=>{const c=nZ(i,e);switch(o){case"light":return{border:"transparent",background:vc(t(i,e.colorScheme==="dark"?8:0,a,!1),e.colorScheme==="dark"?.2:1),color:i==="dark"?e.colorScheme==="dark"?e.colors.dark[0]:e.colors.dark[9]:t(i,e.colorScheme==="dark"?2:n("light")),hover:vc(t(i,e.colorScheme==="dark"?7:1,a,!1),e.colorScheme==="dark"?.25:.65)};case"subtle":return{border:"transparent",background:"transparent",color:i==="dark"?e.colorScheme==="dark"?e.colors.dark[0]:e.colors.dark[9]:t(i,e.colorScheme==="dark"?2:n("light")),hover:vc(t(i,e.colorScheme==="dark"?8:0,a,!1),e.colorScheme==="dark"?.2:1)};case"outline":return{border:t(i,e.colorScheme==="dark"?5:n("light")),background:"transparent",color:t(i,e.colorScheme==="dark"?5:n("light")),hover:e.colorScheme==="dark"?vc(t(i,5,a,!1),.05):vc(t(i,0,a,!1),.35)};case"default":return{border:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4],background:e.colorScheme==="dark"?e.colors.dark[6]:e.white,color:e.colorScheme==="dark"?e.white:e.black,hover:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[0]};case"white":return{border:"transparent",background:e.white,color:t(i,n()),hover:null};case"transparent":return{border:"transparent",color:i==="dark"?e.colorScheme==="dark"?e.colors.dark[0]:e.colors.dark[9]:t(i,e.colorScheme==="dark"?2:n("light")),background:"transparent",hover:null};case"gradient":return{background:r(s),color:e.white,border:"transparent",hover:null};default:{const u=n(),f=c.isSplittedColor?c.shade:u,h=c.isSplittedColor?c.key:i;return{border:"transparent",background:t(h,f,a),color:e.white,hover:t(h,f===9?8:f+1)}}}}}function oZ(e){return t=>{const n=Af(e)(t);return e.colors[e.primaryColor][n]}}function iZ(e){return{"@media (hover: hover)":{"&:hover":e},"@media (hover: none)":{"&:active":e}}}function sZ(e){return()=>({userSelect:"none",color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]})}function aZ(e){return()=>e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6]}const pn={fontStyles:BU,themeColor:wS,focusStyles:WU,linearGradient:UU,radialGradient:ZU,smallerThan:YU,largerThan:GU,rgba:vc,cover:QU,darken:XU,lighten:eZ,radius:tZ,variant:rZ,primaryShade:Af,hover:iZ,gradient:GR,primaryColor:oZ,placeholderStyles:sZ,dimmed:aZ};var lZ=Object.defineProperty,cZ=Object.defineProperties,uZ=Object.getOwnPropertyDescriptors,gk=Object.getOwnPropertySymbols,dZ=Object.prototype.hasOwnProperty,fZ=Object.prototype.propertyIsEnumerable,vk=(e,t,n)=>t in e?lZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hZ=(e,t)=>{for(var n in t||(t={}))dZ.call(t,n)&&vk(e,n,t[n]);if(gk)for(var n of gk(t))fZ.call(t,n)&&vk(e,n,t[n]);return e},pZ=(e,t)=>cZ(e,uZ(t));function KR(e){return pZ(hZ({},e),{fn:{fontStyles:pn.fontStyles(e),themeColor:pn.themeColor(e),focusStyles:pn.focusStyles(e),largerThan:pn.largerThan(e),smallerThan:pn.smallerThan(e),radialGradient:pn.radialGradient,linearGradient:pn.linearGradient,gradient:pn.gradient(e),rgba:pn.rgba,cover:pn.cover,lighten:pn.lighten,darken:pn.darken,primaryShade:pn.primaryShade(e),radius:pn.radius(e),variant:pn.variant(e),hover:pn.hover,primaryColor:pn.primaryColor(e),placeholderStyles:pn.placeholderStyles(e),dimmed:pn.dimmed(e)}})}const mZ={dir:"ltr",primaryShade:{light:6,dark:8},focusRing:"auto",loader:"oval",colorScheme:"light",white:"#fff",black:"#000",defaultRadius:"sm",transitionTimingFunction:"ease",colors:AU,lineHeight:1.55,fontFamily:"-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",fontFamilyMonospace:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace",primaryColor:"blue",respectReducedMotion:!0,cursorType:"default",defaultGradient:{from:"indigo",to:"cyan",deg:45},shadows:{xs:"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), 0 0.0625rem 0.125rem rgba(0, 0, 0, 0.1)",sm:"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 0.625rem 0.9375rem -0.3125rem, rgba(0, 0, 0, 0.04) 0 0.4375rem 0.4375rem -0.3125rem",md:"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 1.25rem 1.5625rem -0.3125rem, rgba(0, 0, 0, 0.04) 0 0.625rem 0.625rem -0.3125rem",lg:"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 1.75rem 1.4375rem -0.4375rem, rgba(0, 0, 0, 0.04) 0 0.75rem 0.75rem -0.4375rem",xl:"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 2.25rem 1.75rem -0.4375rem, rgba(0, 0, 0, 0.04) 0 1.0625rem 1.0625rem -0.4375rem"},fontSizes:{xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem"},radius:{xs:"0.125rem",sm:"0.25rem",md:"0.5rem",lg:"1rem",xl:"2rem"},spacing:{xs:"0.625rem",sm:"0.75rem",md:"1rem",lg:"1.25rem",xl:"1.5rem"},breakpoints:{xs:"36em",sm:"48em",md:"62em",lg:"75em",xl:"88em"},headings:{fontFamily:"-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",fontWeight:700,sizes:{h1:{fontSize:"2.125rem",lineHeight:1.3,fontWeight:void 0},h2:{fontSize:"1.625rem",lineHeight:1.35,fontWeight:void 0},h3:{fontSize:"1.375rem",lineHeight:1.4,fontWeight:void 0},h4:{fontSize:"1.125rem",lineHeight:1.45,fontWeight:void 0},h5:{fontSize:"1rem",lineHeight:1.5,fontWeight:void 0},h6:{fontSize:"0.875rem",lineHeight:1.5,fontWeight:void 0}}},other:{},components:{},activeStyles:{transform:"translateY(0.0625rem)"},datesLocale:"en",globalStyles:void 0,focusRingStyles:{styles:e=>({outlineOffset:"0.125rem",outline:`0.125rem solid ${e.colors[e.primaryColor][e.colorScheme==="dark"?7:5]}`}),resetStyles:()=>({outline:"none"}),inputStyles:e=>({outline:"none",borderColor:e.colors[e.primaryColor][typeof e.primaryShade=="object"?e.primaryShade[e.colorScheme]:e.primaryShade]})}},s0=KR(mZ);function gZ(e){if(e.sheet)return e.sheet;for(var t=0;t0?zn(ku,--Ur):0,tu--,cn===10&&(tu=1,l0--),cn}function mo(){return cn=Ur2||Xd(cn)>3?"":" "}function $Z(e,t){for(;--t&&mo()&&!(cn<48||cn>102||cn>57&&cn<65||cn>70&&cn<97););return Bf(e,zp()+(t<6&&ji()==32&&mo()==32))}function ob(e){for(;mo();)switch(cn){case e:return Ur;case 34:case 39:e!==34&&e!==39&&ob(cn);break;case 40:e===41&&ob(e);break;case 92:mo();break}return Ur}function MZ(e,t){for(;mo()&&e+cn!==47+10;)if(e+cn===42+42&&ji()===47)break;return"/*"+Bf(t,Ur-1)+"*"+a0(e===47?e:mo())}function NZ(e){for(;!Xd(ji());)mo();return Bf(e,Ur)}function TZ(e){return tL(Bp("",null,null,null,[""],e=eL(e),0,[0],e))}function Bp(e,t,n,r,o,i,s,a,c){for(var u=0,f=0,h=s,m=0,v=0,y=0,w=1,P=1,b=1,S=0,O="",E=o,$=i,N=r,I=O;P;)switch(y=S,S=mo()){case 40:if(y!=108&&zn(I,h-1)==58){rb(I+=ft(Ap(S),"&","&\f"),"&\f")!=-1&&(b=-1);break}case 34:case 39:case 91:I+=Ap(S);break;case 9:case 10:case 13:case 32:I+=EZ(y);break;case 92:I+=$Z(zp()-1,7);continue;case 47:switch(ji()){case 42:case 47:$h(IZ(MZ(mo(),zp()),t,n),c);break;default:I+="/"}break;case 123*w:a[u++]=Oi(I)*b;case 125*w:case 59:case 0:switch(S){case 0:case 125:P=0;case 59+f:b==-1&&(I=ft(I,/\f/g,"")),v>0&&Oi(I)-h&&$h(v>32?_k(I+";",r,n,h-1):_k(ft(I," ","")+";",r,n,h-2),c);break;case 59:I+=";";default:if($h(N=yk(I,t,n,u,f,o,a,O,E=[],$=[],h),i),S===123)if(f===0)Bp(I,t,N,N,E,i,h,a,$);else switch(m===99&&zn(I,3)===110?100:m){case 100:case 108:case 109:case 115:Bp(e,N,N,r&&$h(yk(e,N,N,0,0,o,a,O,o,E=[],h),$),o,$,h,a,r?E:$);break;default:Bp(I,N,N,N,[""],$,0,a,$)}}u=f=v=0,w=b=1,O=I="",h=s;break;case 58:h=1+Oi(I),v=y;default:if(w<1){if(S==123)--w;else if(S==125&&w++==0&&kZ()==125)continue}switch(I+=a0(S),S*w){case 38:b=f>0?1:(I+="\f",-1);break;case 44:a[u++]=(Oi(I)-1)*b,b=1;break;case 64:ji()===45&&(I+=Ap(mo())),m=ji(),f=h=Oi(O=I+=NZ(zp())),S++;break;case 45:y===45&&Oi(I)==2&&(w=0)}}return i}function yk(e,t,n,r,o,i,s,a,c,u,f){for(var h=o-1,m=o===0?i:[""],v=PS(m),y=0,w=0,P=0;y0?m[b]+" "+S:ft(S,/&\f/g,m[b])))&&(c[P++]=O);return c0(e,t,n,o===0?xS:a,c,u,f)}function IZ(e,t,n){return c0(e,t,n,qR,a0(CZ()),Qd(e,2,-2),0)}function _k(e,t,n,r){return c0(e,t,n,SS,Qd(e,0,r),Qd(e,r+1,-1),r)}function Fc(e,t){for(var n="",r=PS(e),o=0;o6)switch(zn(e,t+1)){case 109:if(zn(e,t+4)!==45)break;case 102:return ft(e,/(.+:)(.+)-([^]+)/,"$1"+dt+"$2-$3$1"+xm+(zn(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~rb(e,"stretch")?nL(ft(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(zn(e,t+1)!==115)break;case 6444:switch(zn(e,Oi(e)-3-(~rb(e,"!important")&&10))){case 107:return ft(e,":",":"+dt)+e;case 101:return ft(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+dt+(zn(e,14)===45?"inline-":"")+"box$3$1"+dt+"$2$3$1"+er+"$2box$3")+e}break;case 5936:switch(zn(e,t+11)){case 114:return dt+e+er+ft(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return dt+e+er+ft(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return dt+e+er+ft(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return dt+e+er+e+e}return e}var HZ=function(t,n,r,o){if(t.length>-1&&!t.return)switch(t.type){case SS:t.return=nL(t.value,t.length);break;case JR:return Fc([Ju(t,{value:ft(t.value,"@","@"+dt)})],o);case xS:if(t.length)return OZ(t.props,function(i){switch(PZ(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Fc([Ju(t,{props:[ft(i,/:(read-\w+)/,":"+xm+"$1")]})],o);case"::placeholder":return Fc([Ju(t,{props:[ft(i,/:(plac\w+)/,":"+dt+"input-$1")]}),Ju(t,{props:[ft(i,/:(plac\w+)/,":"+xm+"$1")]}),Ju(t,{props:[ft(i,/:(plac\w+)/,er+"input-$1")]})],o)}return""})}},WZ=[HZ],rL=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(w){var P=w.getAttribute("data-emotion");P.indexOf(" ")!==-1&&(document.head.appendChild(w),w.setAttribute("data-s",""))})}var o=t.stylisPlugins||WZ,i={},s,a=[];s=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(w){for(var P=w.getAttribute("data-emotion").split(" "),b=1;b=4;++r,o-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var rG={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},oG=/[A-Z]|^ms/g,iG=/_EMO_([^_]+?)_([^]*?)_EMO_/g,c5=function(t){return t.charCodeAt(1)===45},xk=function(t){return t!=null&&typeof t!="boolean"},c_=RZ(function(e){return c5(e)?e:e.replace(oG,"-$&").toLowerCase()}),Sk=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(iG,function(r,o,i){return Ci={name:o,styles:i,next:Ci},o})}return rG[t]!==1&&!c5(t)&&typeof n=="number"&&n!==0?n+"px":n};function ef(e,t,n){if(n==null)return"";if(n.__emotion_styles!==void 0)return n;switch(typeof n){case"boolean":return"";case"object":{if(n.anim===1)return Ci={name:n.name,styles:n.styles,next:Ci},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)Ci={name:r.name,styles:r.styles,next:Ci},r=r.next;var o=n.styles+";";return o}return sG(e,t,n)}case"function":{if(e!==void 0){var i=Ci,s=n(e);return Ci=i,ef(e,t,s)}break}}if(t==null)return n;var a=t[n];return a!==void 0?a:n}function sG(e,t,n){var r="";if(Array.isArray(n))for(var o=0;ot in e?hG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yG=(e,t)=>{for(var n in t||(t={}))gG.call(t,n)&&kk(e,n,t[n]);if(Ck)for(var n of Ck(t))vG.call(t,n)&&kk(e,n,t[n]);return e},_G=(e,t)=>pG(e,mG(t));function wG({theme:e}){return k.createElement(Ff,{styles:{"*, *::before, *::after":{boxSizing:"border-box"},html:{colorScheme:e.colorScheme==="dark"?"dark":"light"},body:_G(yG({},e.fn.fontStyles()),{backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,lineHeight:e.lineHeight,fontSize:e.fontSizes.md,WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"})}})}function Qu(e,t,n,r=M){Object.keys(t).forEach(o=>{e[`--mantine-${n}-${o}`]=r(t[o])})}function bG({theme:e}){const t={"--mantine-color-white":e.white,"--mantine-color-black":e.black,"--mantine-transition-timing-function":e.transitionTimingFunction,"--mantine-line-height":`${e.lineHeight}`,"--mantine-font-family":e.fontFamily,"--mantine-font-family-monospace":e.fontFamilyMonospace,"--mantine-font-family-headings":e.headings.fontFamily,"--mantine-heading-font-weight":`${e.headings.fontWeight}`};Qu(t,e.shadows,"shadow"),Qu(t,e.fontSizes,"font-size"),Qu(t,e.radius,"radius"),Qu(t,e.spacing,"spacing"),Qu(t,e.breakpoints,"breakpoints",Oa),Object.keys(e.colors).forEach(r=>{e.colors[r].forEach((o,i)=>{t[`--mantine-color-${r}-${i}`]=o})});const n=e.headings.sizes;return Object.keys(n).forEach(r=>{t[`--mantine-${r}-font-size`]=n[r].fontSize,t[`--mantine-${r}-line-height`]=`${n[r].lineHeight}`}),k.createElement(Ff,{styles:{":root":t}})}var xG=Object.defineProperty,SG=Object.defineProperties,PG=Object.getOwnPropertyDescriptors,Ek=Object.getOwnPropertySymbols,OG=Object.prototype.hasOwnProperty,CG=Object.prototype.propertyIsEnumerable,$k=(e,t,n)=>t in e?xG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pi=(e,t)=>{for(var n in t||(t={}))OG.call(t,n)&&$k(e,n,t[n]);if(Ek)for(var n of Ek(t))CG.call(t,n)&&$k(e,n,t[n]);return e},u_=(e,t)=>SG(e,PG(t));function kG(e,t){var n;if(!t)return e;const r=Object.keys(e).reduce((o,i)=>{if(i==="headings"&&t.headings){const s=t.headings.sizes?Object.keys(e.headings.sizes).reduce((a,c)=>(a[c]=pi(pi({},e.headings.sizes[c]),t.headings.sizes[c]),a),{}):e.headings.sizes;return u_(pi({},o),{headings:u_(pi(pi({},e.headings),t.headings),{sizes:s})})}if(i==="breakpoints"&&t.breakpoints){const s=pi(pi({},e.breakpoints),t.breakpoints);return u_(pi({},o),{breakpoints:Object.fromEntries(Object.entries(s).sort((a,c)=>Bo(a[1])-Bo(c[1])))})}return o[i]=typeof t[i]=="object"?pi(pi({},e[i]),t[i]):typeof t[i]=="number"||typeof t[i]=="boolean"||typeof t[i]=="function"?t[i]:t[i]||e[i],o},{});if(t?.fontFamily&&!((n=t?.headings)!=null&&n.fontFamily)&&(r.headings.fontFamily=t.fontFamily),!(r.primaryColor in r.colors))throw new Error("MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color");return r}function EG(e,t){return KL(kG(e,t))}function f5(e){return Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&(t[n]=e[n]),t),{})}const $G={html:{fontFamily:"sans-serif",lineHeight:"1.15",textSizeAdjust:"100%"},body:{margin:0},"article, aside, footer, header, nav, section, figcaption, figure, main":{display:"block"},h1:{fontSize:"2em"},hr:{boxSizing:"content-box",height:0,overflow:"visible"},pre:{fontFamily:"monospace, monospace",fontSize:"1em"},a:{background:"transparent",textDecorationSkip:"objects"},"a:active, a:hover":{outlineWidth:0},"abbr[title]":{borderBottom:"none",textDecoration:"underline"},"b, strong":{fontWeight:"bolder"},"code, kbp, samp":{fontFamily:"monospace, monospace",fontSize:"1em"},dfn:{fontStyle:"italic"},mark:{backgroundColor:"#ff0",color:"#000"},small:{fontSize:"80%"},"sub, sup":{fontSize:"75%",lineHeight:0,position:"relative",verticalAlign:"baseline"},sup:{top:"-0.5em"},sub:{bottom:"-0.25em"},"audio, video":{display:"inline-block"},"audio:not([controls])":{display:"none",height:0},img:{borderStyle:"none",verticalAlign:"middle"},"svg:not(:root)":{overflow:"hidden"},"button, input, optgroup, select, textarea":{fontFamily:"sans-serif",fontSize:"100%",lineHeight:"1.15",margin:0},"button, input":{overflow:"visible"},"button, select":{textTransform:"none"},"button, [type=reset], [type=submit]":{WebkitAppearance:"button"},"button::-moz-focus-inner, [type=button]::-moz-focus-inner, [type=reset]::-moz-focus-inner, [type=submit]::-moz-focus-inner":{borderStyle:"none",padding:0},"button:-moz-focusring, [type=button]:-moz-focusring, [type=reset]:-moz-focusring, [type=submit]:-moz-focusring":{outline:`${M(1)} dotted ButtonText`},legend:{boxSizing:"border-box",color:"inherit",display:"table",maxWidth:"100%",padding:0,whiteSpace:"normal"},progress:{display:"inline-block",verticalAlign:"baseline"},textarea:{overflow:"auto"},"[type=checkbox], [type=radio]":{boxSizing:"border-box",padding:0},"[type=number]::-webkit-inner-spin-button, [type=number]::-webkit-outer-spin-button":{height:"auto"},"[type=search]":{appearance:"none"},"[type=search]::-webkit-search-cancel-button, [type=search]::-webkit-search-decoration":{appearance:"none"},"::-webkit-file-upload-button":{appearance:"button",font:"inherit"},"details, menu":{display:"block"},summary:{display:"list-item"},canvas:{display:"inline-block"},template:{display:"none"}};function MG(){return k.createElement(Ff,{styles:$G})}var NG=Object.defineProperty,Mk=Object.getOwnPropertySymbols,TG=Object.prototype.hasOwnProperty,IG=Object.prototype.propertyIsEnumerable,Nk=(e,t,n)=>t in e?NG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Md=(e,t)=>{for(var n in t||(t={}))TG.call(t,n)&&Nk(e,n,t[n]);if(Mk)for(var n of Mk(t))IG.call(t,n)&&Nk(e,n,t[n]);return e};const Sm=_.createContext({theme:s0});function ar(){var e;return((e=_.useContext(Sm))==null?void 0:e.theme)||s0}function DG(e){const t=ar(),n=r=>{var o,i,s,a;return{styles:((o=t.components[r])==null?void 0:o.styles)||{},classNames:((i=t.components[r])==null?void 0:i.classNames)||{},variants:(s=t.components[r])==null?void 0:s.variants,sizes:(a=t.components[r])==null?void 0:a.sizes}};return Array.isArray(e)?e.map(n):[n(e)]}function h5(){var e;return(e=_.useContext(Sm))==null?void 0:e.emotionCache}function ae(e,t,n){var r;const o=ar(),i=(r=o.components[e])==null?void 0:r.defaultProps,s=typeof i=="function"?i(o):i;return Md(Md(Md({},t),s),f5(n))}function p5({theme:e,emotionCache:t,withNormalizeCSS:n=!1,withGlobalStyles:r=!1,withCSSVariables:o=!1,inherit:i=!1,children:s}){const a=_.useContext(Sm),c=EG(s0,i?Md(Md({},a.theme),e):e);return k.createElement(dG,{theme:c},k.createElement(Sm.Provider,{value:{theme:c,emotionCache:t}},n&&k.createElement(MG,null),r&&k.createElement(wG,{theme:c}),o&&k.createElement(bG,{theme:c}),typeof c.globalStyles=="function"&&k.createElement(Ff,{styles:c.globalStyles(c)}),s))}p5.displayName="@mantine/core/MantineProvider";const jG={app:100,modal:200,popover:300,overlay:400,max:9999};function ci(e){return jG[e]}function LG(e,t){const n=_.useRef();return(!n.current||t.length!==n.current.prevDeps.length||n.current.prevDeps.map((r,o)=>r===t[o]).indexOf(!1)>=0)&&(n.current={v:e(),prevDeps:[...t]}),n.current.v}const RG=r5({key:"mantine",prepend:!0});function zG(){return h5()||RG}var AG=Object.defineProperty,Tk=Object.getOwnPropertySymbols,BG=Object.prototype.hasOwnProperty,FG=Object.prototype.propertyIsEnumerable,Ik=(e,t,n)=>t in e?AG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,VG=(e,t)=>{for(var n in t||(t={}))BG.call(t,n)&&Ik(e,n,t[n]);if(Tk)for(var n of Tk(t))FG.call(t,n)&&Ik(e,n,t[n]);return e};const d_="ref";function HG(e){let t;if(e.length!==1)return{args:e,ref:t};const[n]=e;if(!(n instanceof Object))return{args:e,ref:t};if(!(d_ in n))return{args:e,ref:t};t=n[d_];const r=VG({},n);return delete r[d_],{args:[r],ref:t}}const{cssFactory:WG}=(()=>{function e(n,r,o){const i=[],s=eG(n,i,o);return i.length<2?o:s+r(i)}function t(n){const{cache:r}=n,o=(...s)=>{const{ref:a,args:c}=HG(s),u=ES(c,r.registered);return l5(r,u,!1),`${r.key}-${u.name}${a===void 0?"":` ${a}`}`};return{css:o,cx:(...s)=>e(r.registered,o,_S(s))}}return{cssFactory:t}})();function m5(){const e=zG();return LG(()=>WG({cache:e}),[e])}function UG({cx:e,classes:t,context:n,classNames:r,name:o,cache:i}){const s=n.reduce((a,c)=>(Object.keys(c.classNames).forEach(u=>{typeof a[u]!="string"?a[u]=`${c.classNames[u]}`:a[u]=`${a[u]} ${c.classNames[u]}`}),a),{});return Object.keys(t).reduce((a,c)=>(a[c]=e(t[c],s[c],r!=null&&r[c],Array.isArray(o)?o.filter(Boolean).map(u=>`${i?.key||"mantine"}-${u}-${c}`).join(" "):o?`${i?.key||"mantine"}-${o}-${c}`:null),a),{})}var ZG=Object.defineProperty,Dk=Object.getOwnPropertySymbols,GG=Object.prototype.hasOwnProperty,YG=Object.prototype.propertyIsEnumerable,jk=(e,t,n)=>t in e?ZG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,f_=(e,t)=>{for(var n in t||(t={}))GG.call(t,n)&&jk(e,n,t[n]);if(Dk)for(var n of Dk(t))YG.call(t,n)&&jk(e,n,t[n]);return e};function sb(e,t){return t&&Object.keys(t).forEach(n=>{e[n]?e[n]=f_(f_({},e[n]),t[n]):e[n]=f_({},t[n])}),e}function Lk(e,t,n,r){const o=i=>typeof i=="function"?i(t,n||{},r):i||{};return Array.isArray(e)?e.map(i=>o(i.styles)).reduce((i,s)=>sb(i,s),{}):o(e)}function KG({ctx:e,theme:t,params:n,variant:r,size:o}){return e.reduce((i,s)=>(s.variants&&r in s.variants&&sb(i,s.variants[r](t,n,{variant:r,size:o})),s.sizes&&o in s.sizes&&sb(i,s.sizes[o](t,n,{variant:r,size:o})),i),{})}function ue(e){const t=typeof e=="function"?e:()=>e;function n(r,o){const i=ar(),s=DG(o?.name),a=h5(),c={variant:o?.variant,size:o?.size},{css:u,cx:f}=m5(),h=t(i,r,c),m=Lk(o?.styles,i,r,c),v=Lk(s,i,r,c),y=KG({ctx:s,theme:i,params:r,variant:o?.variant,size:o?.size}),w=Object.fromEntries(Object.keys(h).map(P=>{const b=f({[u(h[P])]:!o?.unstyled},u(y[P]),u(v[P]),u(m[P]));return[P,b]}));return{classes:UG({cx:f,classes:w,context:s,classNames:o?.classNames,name:o?.name,cache:a}),cx:f,theme:i}}return n}function Br(e){return`___ref-${e||""}`}function qG({styles:e}){const t=ar();return k.createElement(Ff,{styles:d5(typeof e=="function"?e(t):e)})}var JG=Object.defineProperty,QG=Object.defineProperties,XG=Object.getOwnPropertyDescriptors,Rk=Object.getOwnPropertySymbols,eY=Object.prototype.hasOwnProperty,tY=Object.prototype.propertyIsEnumerable,zk=(e,t,n)=>t in e?JG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Xu=(e,t)=>{for(var n in t||(t={}))eY.call(t,n)&&zk(e,n,t[n]);if(Rk)for(var n of Rk(t))tY.call(t,n)&&zk(e,n,t[n]);return e},ed=(e,t)=>QG(e,XG(t));const td={in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${M(10)})`},transitionProperty:"transform, opacity"},Mh={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:"opacity"},scale:{in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:"scale(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-y":{in:{opacity:1,transform:"scaleY(1)"},out:{opacity:0,transform:"scaleY(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-x":{in:{opacity:1,transform:"scaleX(1)"},out:{opacity:0,transform:"scaleX(0)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"skew-up":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:`translateY(-${M(20)}) skew(-10deg, -5deg)`},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"skew-down":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:`translateY(${M(20)}) skew(-10deg, -5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-left":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${M(20)}) rotate(-5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${M(20)}) rotate(5deg)`},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-100%)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(100%)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"slide-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(100%)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"slide-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-100%)"},common:{transformOrigin:"right"},transitionProperty:"transform, opacity"},pop:ed(Xu({},td),{common:{transformOrigin:"center center"}}),"pop-bottom-left":ed(Xu({},td),{common:{transformOrigin:"bottom left"}}),"pop-bottom-right":ed(Xu({},td),{common:{transformOrigin:"bottom right"}}),"pop-top-left":ed(Xu({},td),{common:{transformOrigin:"top left"}}),"pop-top-right":ed(Xu({},td),{common:{transformOrigin:"top right"}})},Ak=["mousedown","touchstart"];function nY(e,t,n){const r=_.useRef();return _.useEffect(()=>{const o=i=>{const{target:s}=i??{};if(Array.isArray(n)){const a=s?.hasAttribute("data-ignore-outside-clicks")||!document.body.contains(s)&&s.tagName!=="HTML";n.every(u=>!!u&&!i.composedPath().includes(u))&&!a&&e()}else r.current&&!r.current.contains(s)&&e()};return(t||Ak).forEach(i=>document.addEventListener(i,o)),()=>{(t||Ak).forEach(i=>document.removeEventListener(i,o))}},[r,e,n]),r}function rY(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function oY(e,t){return typeof t=="boolean"?t:typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function iY(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,o]=_.useState(n?t:oY(e,t)),i=_.useRef();return _.useEffect(()=>{if("matchMedia"in window)return i.current=window.matchMedia(e),o(i.current.matches),rY(i.current,s=>o(s.matches))},[e]),r}function ca(e,t,n){return Math.min(Math.max(e,t),n)}const $S=typeof document<"u"?_.useLayoutEffect:_.useEffect;function Hn(e,t){const n=_.useRef(!1);_.useEffect(()=>()=>{n.current=!1},[]),_.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function g5({opened:e,shouldReturnFocus:t=!0}){const n=_.useRef(),r=()=>{var o;n.current&&"focus"in n.current&&typeof n.current.focus=="function"&&((o=n.current)==null||o.focus({preventScroll:!0}))};return Hn(()=>{let o=-1;const i=s=>{s.key==="Tab"&&window.clearTimeout(o)};return document.addEventListener("keydown",i),e?n.current=document.activeElement:t&&(o=window.setTimeout(r,10)),()=>{window.clearTimeout(o),document.removeEventListener("keydown",i)}},[e,t]),r}const sY=/input|select|textarea|button|object/,v5="a, input, select, textarea, button, object, [tabindex]";function aY(e){return e.style.display==="none"}function lY(e){if(e.getAttribute("aria-hidden")||e.getAttribute("hidden")||e.getAttribute("type")==="hidden")return!1;let n=e;for(;n&&!(n===document.body||n.nodeType===11);){if(aY(n))return!1;n=n.parentNode}return!0}function y5(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function ab(e){const t=e.nodeName.toLowerCase(),n=!Number.isNaN(y5(e));return(sY.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&lY(e)}function _5(e){const t=y5(e);return(Number.isNaN(t)||t>=0)&&ab(e)}function cY(e){return Array.from(e.querySelectorAll(v5)).filter(_5)}function uY(e,t){const n=cY(e);if(!n.length){t.preventDefault();return}const r=n[t.shiftKey?0:n.length-1],o=e.getRootNode();if(!(r===o.activeElement||e===o.activeElement))return;t.preventDefault();const s=n[t.shiftKey?n.length-1:0];s&&s.focus()}function Vc(){return`mantine-${Math.random().toString(36).slice(2,11)}`}function dY(e,t="body > :not(script)"){const n=Vc(),r=Array.from(document.querySelectorAll(t)).map(o=>{var i;if((i=o?.shadowRoot)!=null&&i.contains(e)||o.contains(e))return;const s=o.getAttribute("aria-hidden"),a=o.getAttribute("data-hidden"),c=o.getAttribute("data-focus-id");return o.setAttribute("data-focus-id",n),s===null||s==="false"?o.setAttribute("aria-hidden","true"):!a&&!c&&o.setAttribute("data-hidden",s),{node:o,ariaHidden:a||null}});return()=>{r.forEach(o=>{!o||n!==o.node.getAttribute("data-focus-id")||(o.ariaHidden===null?o.node.removeAttribute("aria-hidden"):o.node.setAttribute("aria-hidden",o.ariaHidden),o.node.removeAttribute("data-focus-id"),o.node.removeAttribute("data-hidden"))})}}function fY(e=!0){const t=_.useRef(),n=_.useRef(null),r=i=>{let s=i.querySelector("[data-autofocus]");if(!s){const a=Array.from(i.querySelectorAll(v5));s=a.find(_5)||a.find(ab)||null,!s&&ab(i)&&(s=i)}s&&s.focus({preventScroll:!0})},o=_.useCallback(i=>{if(e){if(i===null){n.current&&(n.current(),n.current=null);return}n.current=dY(i),t.current!==i&&(i?(setTimeout(()=>{i.getRootNode()&&r(i)}),t.current=i):t.current=null)}},[e]);return _.useEffect(()=>{if(!e)return;t.current&&setTimeout(()=>r(t.current));const i=s=>{s.key==="Tab"&&t.current&&uY(t.current,s)};return document.addEventListener("keydown",i),()=>{document.removeEventListener("keydown",i),n.current&&n.current()}},[e]),o}const hY=k["useId".toString()]||(()=>{});function pY(){const e=hY();return e?`mantine-${e.replace(/:/g,"")}`:""}function Ia(e){const t=pY(),[n,r]=_.useState(t);return $S(()=>{r(Vc())},[]),typeof e=="string"?e:typeof window>"u"?t:n}function Pm(e,t,n){_.useEffect(()=>(window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)),[e,t])}function w5(e,t){typeof e=="function"?e(t):typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function mY(...e){return t=>{e.forEach(n=>w5(n,t))}}function Ps(...e){return _.useCallback(mY(...e),e)}const b5=e=>({x:ca(e.x,0,1),y:ca(e.y,0,1)});function x5(e,t,n="ltr"){const r=_.useRef(),o=_.useRef(!1),i=_.useRef(!1),s=_.useRef(0),[a,c]=_.useState(!1);return _.useEffect(()=>{o.current=!0},[]),_.useEffect(()=>{const u=({x:S,y:O})=>{cancelAnimationFrame(s.current),s.current=requestAnimationFrame(()=>{if(o.current&&r.current){r.current.style.userSelect="none";const E=r.current.getBoundingClientRect();if(E.width&&E.height){const $=ca((S-E.left)/E.width,0,1);e({x:n==="ltr"?$:1-$,y:ca((O-E.top)/E.height,0,1)})}}})},f=()=>{document.addEventListener("mousemove",w),document.addEventListener("mouseup",v),document.addEventListener("touchmove",b),document.addEventListener("touchend",v)},h=()=>{document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",v),document.removeEventListener("touchmove",b),document.removeEventListener("touchend",v)},m=()=>{!i.current&&o.current&&(i.current=!0,typeof t?.onScrubStart=="function"&&t.onScrubStart(),c(!0),f())},v=()=>{i.current&&o.current&&(i.current=!1,c(!1),h(),setTimeout(()=>{typeof t?.onScrubEnd=="function"&&t.onScrubEnd()},0))},y=S=>{m(),S.preventDefault(),w(S)},w=S=>u({x:S.clientX,y:S.clientY}),P=S=>{S.cancelable&&S.preventDefault(),m(),b(S)},b=S=>{S.cancelable&&S.preventDefault(),u({x:S.changedTouches[0].clientX,y:S.changedTouches[0].clientY})};return r.current.addEventListener("mousedown",y),r.current.addEventListener("touchstart",P,{passive:!1}),()=>{r.current&&(r.current.removeEventListener("mousedown",y),r.current.removeEventListener("touchstart",P))}},[n,e]),{ref:r,active:a}}function _o({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){const[o,i]=_.useState(t!==void 0?t:n),s=a=>{i(a),r?.(a)};return e!==void 0?[e,r,!0]:[o,s,!1]}function MS(e,t){return iY("(prefers-reduced-motion: reduce)",e,t)}const gY=e=>e<.5?2*e*e:-1+(4-2*e)*e,vY=({axis:e,target:t,parent:n,alignment:r,offset:o,isList:i})=>{if(!t||!n&&typeof document>"u")return 0;const s=!!n,c=(n||document.body).getBoundingClientRect(),u=t.getBoundingClientRect(),f=h=>u[h]-c[h];if(e==="y"){const h=f("top");if(h===0)return 0;if(r==="start"){const v=h-o;return v<=u.height*(i?0:1)||!i?v:0}const m=s?c.height:window.innerHeight;if(r==="end"){const v=h+o-m+u.height;return v>=-u.height*(i?0:1)||!i?v:0}return r==="center"?h-m/2+u.height/2:0}if(e==="x"){const h=f("left");if(h===0)return 0;if(r==="start"){const v=h-o;return v<=u.width||!i?v:0}const m=s?c.width:window.innerWidth;if(r==="end"){const v=h+o-m+u.width;return v>=-u.width||!i?v:0}return r==="center"?h-m/2+u.width/2:0}return 0},yY=({axis:e,parent:t})=>{if(!t&&typeof document>"u")return 0;const n=e==="y"?"scrollTop":"scrollLeft";if(t)return t[n];const{body:r,documentElement:o}=document;return r[n]+o[n]},_Y=({axis:e,parent:t,distance:n})=>{if(!t&&typeof document>"u")return;const r=e==="y"?"scrollTop":"scrollLeft";if(t)t[r]=n;else{const{body:o,documentElement:i}=document;o[r]=n,i[r]=n}};function S5({duration:e=1250,axis:t="y",onScrollFinish:n,easing:r=gY,offset:o=0,cancelable:i=!0,isList:s=!1}={}){const a=_.useRef(0),c=_.useRef(0),u=_.useRef(!1),f=_.useRef(null),h=_.useRef(null),m=MS(),v=()=>{a.current&&cancelAnimationFrame(a.current)},y=_.useCallback(({alignment:P="start"}={})=>{var b;u.current=!1,a.current&&v();const S=(b=yY({parent:f.current,axis:t}))!=null?b:0,O=vY({parent:f.current,target:h.current,axis:t,alignment:P,offset:o,isList:s})-(f.current?0:S);function E(){c.current===0&&(c.current=performance.now());const N=performance.now()-c.current,I=m||e===0?1:N/e,R=S+O*r(I);_Y({parent:f.current,axis:t,distance:R}),!u.current&&I<1?a.current=requestAnimationFrame(E):(typeof n=="function"&&n(),c.current=0,a.current=0,v())}E()},[t,e,r,s,o,n,m]),w=()=>{i&&(u.current=!0)};return Pm("wheel",w,{passive:!0}),Pm("touchmove",w,{passive:!0}),_.useEffect(()=>v,[]),{scrollableRef:f,targetRef:h,scrollIntoView:y,cancel:v}}function wY(e){const[t,n]=_.useState(null),r=_.useRef();return{ref:_.useCallback(i=>{if(r.current&&(r.current.disconnect(),r.current=null),i===null){n(null);return}r.current=new IntersectionObserver(([s])=>{n(s)},e),r.current.observe(i)},[e?.rootMargin,e?.root,e?.threshold]),entry:t}}function Bk(){if(typeof window>"u")return"undetermined";const{userAgent:e}=window.navigator,t=/(Macintosh)|(MacIntel)|(MacPPC)|(Mac68K)/i,n=/(Win32)|(Win64)|(Windows)|(WinCE)/i,r=/(iPhone)|(iPad)|(iPod)/i;return t.test(e)?"macos":r.test(e)?"ios":n.test(e)?"windows":/Android/i.test(e)?"android":/Linux/i.test(e)?"linux":"undetermined"}function bY(e={getValueInEffect:!0}){const[t,n]=_.useState(e.getValueInEffect?"undetermined":Bk());return $S(()=>{e.getValueInEffect&&n(Bk)},[]),t}function xY(e){return t=>{if(!t)e(t);else if(typeof t=="function")e(t);else if(typeof t=="object"&&"nativeEvent"in t){const{currentTarget:n}=t;n.type==="checkbox"?e(n.checked):e(n.value)}else e(t)}}function SY(e){const[t,n]=_.useState(e);return[t,xY(n)]}function NS(e=!1,t){const{onOpen:n,onClose:r}=t||{},[o,i]=_.useState(e),s=_.useCallback(()=>{i(u=>u||(n?.(),!0))},[n]),a=_.useCallback(()=>{i(u=>u&&(r?.(),!1))},[r]),c=_.useCallback(()=>{o?a():s()},[a,s,o]);return[o,{open:s,close:a,toggle:c}]}function PY(e,t,n={autoInvoke:!1}){const r=_.useRef(null),o=_.useRef(null),i=_.useCallback((...a)=>{o.current||(o.current=window.setTimeout(()=>{r.current(a),o.current=null},t))},[t]),s=_.useCallback(()=>{o.current&&(window.clearTimeout(o.current),o.current=null)},[]);return _.useEffect(()=>{r.current=e},[e]),_.useEffect(()=>(n.autoInvoke&&i(),s),[s,t,n.autoInvoke,i]),{start:i,clear:s}}var Fk=Object.getOwnPropertySymbols,OY=Object.prototype.hasOwnProperty,CY=Object.prototype.propertyIsEnumerable,kY=(e,t)=>{var n={};for(var r in e)OY.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Fk)for(var r of Fk(e))t.indexOf(r)<0&&CY.call(e,r)&&(n[r]=e[r]);return n};function Bl(e){const t=e,{m:n,mx:r,my:o,mt:i,mb:s,ml:a,mr:c,p:u,px:f,py:h,pt:m,pb:v,pl:y,pr:w,bg:P,c:b,opacity:S,ff:O,fz:E,fw:$,lts:N,ta:I,lh:R,fs:B,tt:z,td:G,w:Q,miw:X,maw:V,h:H,mih:Z,mah:Y,bgsz:D,bgp:W,bgr:F,bga:K,pos:ee,top:fe,left:ie,bottom:J,right:ne,inset:le,display:_e}=t,Ne=kY(t,["m","mx","my","mt","mb","ml","mr","p","px","py","pt","pb","pl","pr","bg","c","opacity","ff","fz","fw","lts","ta","lh","fs","tt","td","w","miw","maw","h","mih","mah","bgsz","bgp","bgr","bga","pos","top","left","bottom","right","inset","display"]);return{systemStyles:f5({m:n,mx:r,my:o,mt:i,mb:s,ml:a,mr:c,p:u,px:f,py:h,pt:m,pb:v,pl:y,pr:w,bg:P,c:b,opacity:S,ff:O,fz:E,fw:$,lts:N,ta:I,lh:R,fs:B,tt:z,td:G,w:Q,miw:X,maw:V,h:H,mih:Z,mah:Y,bgsz:D,bgp:W,bgr:F,bga:K,pos:ee,top:fe,left:ie,bottom:J,right:ne,inset:le,display:_e}),rest:Ne}}function EY(e,t){const n=Object.keys(e).filter(r=>r!=="base").sort((r,o)=>Bo(re({size:r,sizes:t.breakpoints}))-Bo(re({size:o,sizes:t.breakpoints})));return"base"in e?["base",...n]:n}function $Y({value:e,theme:t,getValue:n,property:r}){if(e==null)return;if(typeof e=="object")return EY(e,t).reduce((s,a)=>{if(a==="base"&&e.base!==void 0){const u=n(e.base,t);return Array.isArray(r)?(r.forEach(f=>{s[f]=u}),s):(s[r]=u,s)}const c=n(e[a],t);return Array.isArray(r)?(s[t.fn.largerThan(a)]={},r.forEach(u=>{s[t.fn.largerThan(a)][u]=c}),s):(s[t.fn.largerThan(a)]={[r]:c},s)},{});const o=n(e,t);return Array.isArray(r)?r.reduce((i,s)=>(i[s]=o,i),{}):{[r]:o}}function MY(e,t){return e==="dimmed"?t.colorScheme==="dark"?t.colors.dark[2]:t.colors.gray[6]:t.fn.variant({variant:"filled",color:e,primaryFallback:!1}).background}function NY(e){return M(e)}function TY(e){return e}function IY(e,t){return re({size:e,sizes:t.fontSizes})}const DY=["-xs","-sm","-md","-lg","-xl"];function jY(e,t){return DY.includes(e)?`calc(${re({size:e.replace("-",""),sizes:t.spacing})} * -1)`:re({size:e,sizes:t.spacing})}const LY={identity:TY,color:MY,size:NY,fontSize:IY,spacing:jY},RY={m:{type:"spacing",property:"margin"},mt:{type:"spacing",property:"marginTop"},mb:{type:"spacing",property:"marginBottom"},ml:{type:"spacing",property:"marginLeft"},mr:{type:"spacing",property:"marginRight"},mx:{type:"spacing",property:["marginRight","marginLeft"]},my:{type:"spacing",property:["marginTop","marginBottom"]},p:{type:"spacing",property:"padding"},pt:{type:"spacing",property:"paddingTop"},pb:{type:"spacing",property:"paddingBottom"},pl:{type:"spacing",property:"paddingLeft"},pr:{type:"spacing",property:"paddingRight"},px:{type:"spacing",property:["paddingRight","paddingLeft"]},py:{type:"spacing",property:["paddingTop","paddingBottom"]},bg:{type:"color",property:"background"},c:{type:"color",property:"color"},opacity:{type:"identity",property:"opacity"},ff:{type:"identity",property:"fontFamily"},fz:{type:"fontSize",property:"fontSize"},fw:{type:"identity",property:"fontWeight"},lts:{type:"size",property:"letterSpacing"},ta:{type:"identity",property:"textAlign"},lh:{type:"identity",property:"lineHeight"},fs:{type:"identity",property:"fontStyle"},tt:{type:"identity",property:"textTransform"},td:{type:"identity",property:"textDecoration"},w:{type:"spacing",property:"width"},miw:{type:"spacing",property:"minWidth"},maw:{type:"spacing",property:"maxWidth"},h:{type:"spacing",property:"height"},mih:{type:"spacing",property:"minHeight"},mah:{type:"spacing",property:"maxHeight"},bgsz:{type:"size",property:"backgroundSize"},bgp:{type:"identity",property:"backgroundPosition"},bgr:{type:"identity",property:"backgroundRepeat"},bga:{type:"identity",property:"backgroundAttachment"},pos:{type:"identity",property:"position"},top:{type:"identity",property:"top"},left:{type:"size",property:"left"},bottom:{type:"size",property:"bottom"},right:{type:"size",property:"right"},inset:{type:"size",property:"inset"},display:{type:"identity",property:"display"}};var zY=Object.defineProperty,Vk=Object.getOwnPropertySymbols,AY=Object.prototype.hasOwnProperty,BY=Object.prototype.propertyIsEnumerable,Hk=(e,t,n)=>t in e?zY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Wk=(e,t)=>{for(var n in t||(t={}))AY.call(t,n)&&Hk(e,n,t[n]);if(Vk)for(var n of Vk(t))BY.call(t,n)&&Hk(e,n,t[n]);return e};function Uk(e,t,n=RY){return Object.keys(n).reduce((o,i)=>(i in e&&e[i]!==void 0&&o.push($Y({value:e[i],getValue:LY[n[i].type],property:n[i].property,theme:t})),o),[]).reduce((o,i)=>(Object.keys(i).forEach(s=>{typeof i[s]=="object"&&i[s]!==null&&s in o?o[s]=Wk(Wk({},o[s]),i[s]):o[s]=i[s]}),o),{})}function Zk(e,t){return typeof e=="function"?e(t):e}function FY(e,t,n){const r=ar(),{css:o,cx:i}=m5();return Array.isArray(e)?i(n,o(Uk(t,r)),e.map(s=>o(Zk(s,r)))):i(n,o(Zk(e,r)),o(Uk(t,r)))}var VY=Object.defineProperty,Om=Object.getOwnPropertySymbols,P5=Object.prototype.hasOwnProperty,O5=Object.prototype.propertyIsEnumerable,Gk=(e,t,n)=>t in e?VY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,HY=(e,t)=>{for(var n in t||(t={}))P5.call(t,n)&&Gk(e,n,t[n]);if(Om)for(var n of Om(t))O5.call(t,n)&&Gk(e,n,t[n]);return e},WY=(e,t)=>{var n={};for(var r in e)P5.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Om)for(var r of Om(e))t.indexOf(r)<0&&O5.call(e,r)&&(n[r]=e[r]);return n};const C5=_.forwardRef((e,t)=>{var n=e,{className:r,component:o,style:i,sx:s}=n,a=WY(n,["className","component","style","sx"]);const{systemStyles:c,rest:u}=Bl(a),f=o||"div";return k.createElement(f,HY({ref:t,className:FY(s,c,r),style:i},u))});C5.displayName="@mantine/core/Box";const Pe=C5;var UY=Object.defineProperty,ZY=Object.defineProperties,GY=Object.getOwnPropertyDescriptors,Yk=Object.getOwnPropertySymbols,YY=Object.prototype.hasOwnProperty,KY=Object.prototype.propertyIsEnumerable,Kk=(e,t,n)=>t in e?UY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qk=(e,t)=>{for(var n in t||(t={}))YY.call(t,n)&&Kk(e,n,t[n]);if(Yk)for(var n of Yk(t))KY.call(t,n)&&Kk(e,n,t[n]);return e},qY=(e,t)=>ZY(e,GY(t)),JY=ue(e=>({root:qY(qk(qk({},e.fn.focusStyles()),e.fn.fontStyles()),{cursor:"pointer",border:0,padding:0,appearance:"none",fontSize:e.fontSizes.md,backgroundColor:"transparent",textAlign:"left",color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,textDecoration:"none",boxSizing:"border-box"})}));const QY=JY;var XY=Object.defineProperty,Cm=Object.getOwnPropertySymbols,k5=Object.prototype.hasOwnProperty,E5=Object.prototype.propertyIsEnumerable,Jk=(e,t,n)=>t in e?XY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,eK=(e,t)=>{for(var n in t||(t={}))k5.call(t,n)&&Jk(e,n,t[n]);if(Cm)for(var n of Cm(t))E5.call(t,n)&&Jk(e,n,t[n]);return e},tK=(e,t)=>{var n={};for(var r in e)k5.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Cm)for(var r of Cm(e))t.indexOf(r)<0&&E5.call(e,r)&&(n[r]=e[r]);return n};const $5=_.forwardRef((e,t)=>{const n=ae("UnstyledButton",{},e),{className:r,component:o="button",unstyled:i,variant:s}=n,a=tK(n,["className","component","unstyled","variant"]),{classes:c,cx:u}=QY(null,{name:"UnstyledButton",unstyled:i,variant:s});return k.createElement(Pe,eK({component:o,ref:t,className:u(c.root,r),type:o==="button"?"button":void 0},a))});$5.displayName="@mantine/core/UnstyledButton";const ds=$5;var M5={exports:{}},xo={},N5={exports:{}},T5={};/** + */var Tn=typeof Symbol=="function"&&Symbol.for,OS=Tn?Symbol.for("react.element"):60103,CS=Tn?Symbol.for("react.portal"):60106,u0=Tn?Symbol.for("react.fragment"):60107,d0=Tn?Symbol.for("react.strict_mode"):60108,f0=Tn?Symbol.for("react.profiler"):60114,h0=Tn?Symbol.for("react.provider"):60109,p0=Tn?Symbol.for("react.context"):60110,kS=Tn?Symbol.for("react.async_mode"):60111,m0=Tn?Symbol.for("react.concurrent_mode"):60111,g0=Tn?Symbol.for("react.forward_ref"):60112,v0=Tn?Symbol.for("react.suspense"):60113,UZ=Tn?Symbol.for("react.suspense_list"):60120,y0=Tn?Symbol.for("react.memo"):60115,_0=Tn?Symbol.for("react.lazy"):60116,ZZ=Tn?Symbol.for("react.block"):60121,GZ=Tn?Symbol.for("react.fundamental"):60117,YZ=Tn?Symbol.for("react.responder"):60118,KZ=Tn?Symbol.for("react.scope"):60119;function bo(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case OS:switch(e=e.type,e){case kS:case m0:case u0:case f0:case d0:case v0:return e;default:switch(e=e&&e.$$typeof,e){case p0:case g0:case _0:case y0:case h0:return e;default:return t}}case CS:return t}}}function iL(e){return bo(e)===m0}_t.AsyncMode=kS;_t.ConcurrentMode=m0;_t.ContextConsumer=p0;_t.ContextProvider=h0;_t.Element=OS;_t.ForwardRef=g0;_t.Fragment=u0;_t.Lazy=_0;_t.Memo=y0;_t.Portal=CS;_t.Profiler=f0;_t.StrictMode=d0;_t.Suspense=v0;_t.isAsyncMode=function(e){return iL(e)||bo(e)===kS};_t.isConcurrentMode=iL;_t.isContextConsumer=function(e){return bo(e)===p0};_t.isContextProvider=function(e){return bo(e)===h0};_t.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===OS};_t.isForwardRef=function(e){return bo(e)===g0};_t.isFragment=function(e){return bo(e)===u0};_t.isLazy=function(e){return bo(e)===_0};_t.isMemo=function(e){return bo(e)===y0};_t.isPortal=function(e){return bo(e)===CS};_t.isProfiler=function(e){return bo(e)===f0};_t.isStrictMode=function(e){return bo(e)===d0};_t.isSuspense=function(e){return bo(e)===v0};_t.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===u0||e===m0||e===f0||e===d0||e===v0||e===UZ||typeof e=="object"&&e!==null&&(e.$$typeof===_0||e.$$typeof===y0||e.$$typeof===h0||e.$$typeof===p0||e.$$typeof===g0||e.$$typeof===GZ||e.$$typeof===YZ||e.$$typeof===KZ||e.$$typeof===ZZ)};_t.typeOf=bo;oL.exports=_t;var qZ=oL.exports,sL=qZ,JZ={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},QZ={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},aL={};aL[sL.ForwardRef]=JZ;aL[sL.Memo]=QZ;var XZ=!0;function eG(e,t,n){var r="";return n.split(" ").forEach(function(o){e[o]!==void 0?t.push(e[o]+";"):r+=o+" "}),r}var tG=function(t,n,r){var o=t.key+"-"+n.name;(r===!1||XZ===!1)&&t.registered[o]===void 0&&(t.registered[o]=n.styles)},lL=function(t,n,r){tG(t,n,r);var o=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var i=n;do t.insert(n===i?"."+o:"",i,t.sheet,!0),i=i.next;while(i!==void 0)}};function nG(e){for(var t=0,n,r=0,o=e.length;o>=4;++r,o-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var rG={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},oG=/[A-Z]|^ms/g,iG=/_EMO_([^_]+?)_([^]*?)_EMO_/g,cL=function(t){return t.charCodeAt(1)===45},xk=function(t){return t!=null&&typeof t!="boolean"},c_=LZ(function(e){return cL(e)?e:e.replace(oG,"-$&").toLowerCase()}),Sk=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(iG,function(r,o,i){return Ci={name:o,styles:i,next:Ci},o})}return rG[t]!==1&&!cL(t)&&typeof n=="number"&&n!==0?n+"px":n};function ef(e,t,n){if(n==null)return"";if(n.__emotion_styles!==void 0)return n;switch(typeof n){case"boolean":return"";case"object":{if(n.anim===1)return Ci={name:n.name,styles:n.styles,next:Ci},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)Ci={name:r.name,styles:r.styles,next:Ci},r=r.next;var o=n.styles+";";return o}return sG(e,t,n)}case"function":{if(e!==void 0){var i=Ci,s=n(e);return Ci=i,ef(e,t,s)}break}}if(t==null)return n;var a=t[n];return a!==void 0?a:n}function sG(e,t,n){var r="";if(Array.isArray(n))for(var o=0;ot in e?hG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yG=(e,t)=>{for(var n in t||(t={}))gG.call(t,n)&&kk(e,n,t[n]);if(Ck)for(var n of Ck(t))vG.call(t,n)&&kk(e,n,t[n]);return e},_G=(e,t)=>pG(e,mG(t));function wG({theme:e}){return k.createElement(Ff,{styles:{"*, *::before, *::after":{boxSizing:"border-box"},html:{colorScheme:e.colorScheme==="dark"?"dark":"light"},body:_G(yG({},e.fn.fontStyles()),{backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,lineHeight:e.lineHeight,fontSize:e.fontSizes.md,WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"})}})}function Qu(e,t,n,r=M){Object.keys(t).forEach(o=>{e[`--mantine-${n}-${o}`]=r(t[o])})}function bG({theme:e}){const t={"--mantine-color-white":e.white,"--mantine-color-black":e.black,"--mantine-transition-timing-function":e.transitionTimingFunction,"--mantine-line-height":`${e.lineHeight}`,"--mantine-font-family":e.fontFamily,"--mantine-font-family-monospace":e.fontFamilyMonospace,"--mantine-font-family-headings":e.headings.fontFamily,"--mantine-heading-font-weight":`${e.headings.fontWeight}`};Qu(t,e.shadows,"shadow"),Qu(t,e.fontSizes,"font-size"),Qu(t,e.radius,"radius"),Qu(t,e.spacing,"spacing"),Qu(t,e.breakpoints,"breakpoints",Oa),Object.keys(e.colors).forEach(r=>{e.colors[r].forEach((o,i)=>{t[`--mantine-color-${r}-${i}`]=o})});const n=e.headings.sizes;return Object.keys(n).forEach(r=>{t[`--mantine-${r}-font-size`]=n[r].fontSize,t[`--mantine-${r}-line-height`]=`${n[r].lineHeight}`}),k.createElement(Ff,{styles:{":root":t}})}var xG=Object.defineProperty,SG=Object.defineProperties,PG=Object.getOwnPropertyDescriptors,Ek=Object.getOwnPropertySymbols,OG=Object.prototype.hasOwnProperty,CG=Object.prototype.propertyIsEnumerable,$k=(e,t,n)=>t in e?xG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pi=(e,t)=>{for(var n in t||(t={}))OG.call(t,n)&&$k(e,n,t[n]);if(Ek)for(var n of Ek(t))CG.call(t,n)&&$k(e,n,t[n]);return e},u_=(e,t)=>SG(e,PG(t));function kG(e,t){var n;if(!t)return e;const r=Object.keys(e).reduce((o,i)=>{if(i==="headings"&&t.headings){const s=t.headings.sizes?Object.keys(e.headings.sizes).reduce((a,c)=>(a[c]=pi(pi({},e.headings.sizes[c]),t.headings.sizes[c]),a),{}):e.headings.sizes;return u_(pi({},o),{headings:u_(pi(pi({},e.headings),t.headings),{sizes:s})})}if(i==="breakpoints"&&t.breakpoints){const s=pi(pi({},e.breakpoints),t.breakpoints);return u_(pi({},o),{breakpoints:Object.fromEntries(Object.entries(s).sort((a,c)=>Bo(a[1])-Bo(c[1])))})}return o[i]=typeof t[i]=="object"?pi(pi({},e[i]),t[i]):typeof t[i]=="number"||typeof t[i]=="boolean"||typeof t[i]=="function"?t[i]:t[i]||e[i],o},{});if(t?.fontFamily&&!((n=t?.headings)!=null&&n.fontFamily)&&(r.headings.fontFamily=t.fontFamily),!(r.primaryColor in r.colors))throw new Error("MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color");return r}function EG(e,t){return KR(kG(e,t))}function fL(e){return Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&(t[n]=e[n]),t),{})}const $G={html:{fontFamily:"sans-serif",lineHeight:"1.15",textSizeAdjust:"100%"},body:{margin:0},"article, aside, footer, header, nav, section, figcaption, figure, main":{display:"block"},h1:{fontSize:"2em"},hr:{boxSizing:"content-box",height:0,overflow:"visible"},pre:{fontFamily:"monospace, monospace",fontSize:"1em"},a:{background:"transparent",textDecorationSkip:"objects"},"a:active, a:hover":{outlineWidth:0},"abbr[title]":{borderBottom:"none",textDecoration:"underline"},"b, strong":{fontWeight:"bolder"},"code, kbp, samp":{fontFamily:"monospace, monospace",fontSize:"1em"},dfn:{fontStyle:"italic"},mark:{backgroundColor:"#ff0",color:"#000"},small:{fontSize:"80%"},"sub, sup":{fontSize:"75%",lineHeight:0,position:"relative",verticalAlign:"baseline"},sup:{top:"-0.5em"},sub:{bottom:"-0.25em"},"audio, video":{display:"inline-block"},"audio:not([controls])":{display:"none",height:0},img:{borderStyle:"none",verticalAlign:"middle"},"svg:not(:root)":{overflow:"hidden"},"button, input, optgroup, select, textarea":{fontFamily:"sans-serif",fontSize:"100%",lineHeight:"1.15",margin:0},"button, input":{overflow:"visible"},"button, select":{textTransform:"none"},"button, [type=reset], [type=submit]":{WebkitAppearance:"button"},"button::-moz-focus-inner, [type=button]::-moz-focus-inner, [type=reset]::-moz-focus-inner, [type=submit]::-moz-focus-inner":{borderStyle:"none",padding:0},"button:-moz-focusring, [type=button]:-moz-focusring, [type=reset]:-moz-focusring, [type=submit]:-moz-focusring":{outline:`${M(1)} dotted ButtonText`},legend:{boxSizing:"border-box",color:"inherit",display:"table",maxWidth:"100%",padding:0,whiteSpace:"normal"},progress:{display:"inline-block",verticalAlign:"baseline"},textarea:{overflow:"auto"},"[type=checkbox], [type=radio]":{boxSizing:"border-box",padding:0},"[type=number]::-webkit-inner-spin-button, [type=number]::-webkit-outer-spin-button":{height:"auto"},"[type=search]":{appearance:"none"},"[type=search]::-webkit-search-cancel-button, [type=search]::-webkit-search-decoration":{appearance:"none"},"::-webkit-file-upload-button":{appearance:"button",font:"inherit"},"details, menu":{display:"block"},summary:{display:"list-item"},canvas:{display:"inline-block"},template:{display:"none"}};function MG(){return k.createElement(Ff,{styles:$G})}var NG=Object.defineProperty,Mk=Object.getOwnPropertySymbols,TG=Object.prototype.hasOwnProperty,IG=Object.prototype.propertyIsEnumerable,Nk=(e,t,n)=>t in e?NG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Md=(e,t)=>{for(var n in t||(t={}))TG.call(t,n)&&Nk(e,n,t[n]);if(Mk)for(var n of Mk(t))IG.call(t,n)&&Nk(e,n,t[n]);return e};const Sm=_.createContext({theme:s0});function ar(){var e;return((e=_.useContext(Sm))==null?void 0:e.theme)||s0}function jG(e){const t=ar(),n=r=>{var o,i,s,a;return{styles:((o=t.components[r])==null?void 0:o.styles)||{},classNames:((i=t.components[r])==null?void 0:i.classNames)||{},variants:(s=t.components[r])==null?void 0:s.variants,sizes:(a=t.components[r])==null?void 0:a.sizes}};return Array.isArray(e)?e.map(n):[n(e)]}function hL(){var e;return(e=_.useContext(Sm))==null?void 0:e.emotionCache}function ae(e,t,n){var r;const o=ar(),i=(r=o.components[e])==null?void 0:r.defaultProps,s=typeof i=="function"?i(o):i;return Md(Md(Md({},t),s),fL(n))}function pL({theme:e,emotionCache:t,withNormalizeCSS:n=!1,withGlobalStyles:r=!1,withCSSVariables:o=!1,inherit:i=!1,children:s}){const a=_.useContext(Sm),c=EG(s0,i?Md(Md({},a.theme),e):e);return k.createElement(dG,{theme:c},k.createElement(Sm.Provider,{value:{theme:c,emotionCache:t}},n&&k.createElement(MG,null),r&&k.createElement(wG,{theme:c}),o&&k.createElement(bG,{theme:c}),typeof c.globalStyles=="function"&&k.createElement(Ff,{styles:c.globalStyles(c)}),s))}pL.displayName="@mantine/core/MantineProvider";const DG={app:100,modal:200,popover:300,overlay:400,max:9999};function ci(e){return DG[e]}function RG(e,t){const n=_.useRef();return(!n.current||t.length!==n.current.prevDeps.length||n.current.prevDeps.map((r,o)=>r===t[o]).indexOf(!1)>=0)&&(n.current={v:e(),prevDeps:[...t]}),n.current.v}const LG=rL({key:"mantine",prepend:!0});function zG(){return hL()||LG}var AG=Object.defineProperty,Tk=Object.getOwnPropertySymbols,BG=Object.prototype.hasOwnProperty,FG=Object.prototype.propertyIsEnumerable,Ik=(e,t,n)=>t in e?AG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,VG=(e,t)=>{for(var n in t||(t={}))BG.call(t,n)&&Ik(e,n,t[n]);if(Tk)for(var n of Tk(t))FG.call(t,n)&&Ik(e,n,t[n]);return e};const d_="ref";function HG(e){let t;if(e.length!==1)return{args:e,ref:t};const[n]=e;if(!(n instanceof Object))return{args:e,ref:t};if(!(d_ in n))return{args:e,ref:t};t=n[d_];const r=VG({},n);return delete r[d_],{args:[r],ref:t}}const{cssFactory:WG}=(()=>{function e(n,r,o){const i=[],s=eG(n,i,o);return i.length<2?o:s+r(i)}function t(n){const{cache:r}=n,o=(...s)=>{const{ref:a,args:c}=HG(s),u=ES(c,r.registered);return lL(r,u,!1),`${r.key}-${u.name}${a===void 0?"":` ${a}`}`};return{css:o,cx:(...s)=>e(r.registered,o,_S(s))}}return{cssFactory:t}})();function mL(){const e=zG();return RG(()=>WG({cache:e}),[e])}function UG({cx:e,classes:t,context:n,classNames:r,name:o,cache:i}){const s=n.reduce((a,c)=>(Object.keys(c.classNames).forEach(u=>{typeof a[u]!="string"?a[u]=`${c.classNames[u]}`:a[u]=`${a[u]} ${c.classNames[u]}`}),a),{});return Object.keys(t).reduce((a,c)=>(a[c]=e(t[c],s[c],r!=null&&r[c],Array.isArray(o)?o.filter(Boolean).map(u=>`${i?.key||"mantine"}-${u}-${c}`).join(" "):o?`${i?.key||"mantine"}-${o}-${c}`:null),a),{})}var ZG=Object.defineProperty,jk=Object.getOwnPropertySymbols,GG=Object.prototype.hasOwnProperty,YG=Object.prototype.propertyIsEnumerable,Dk=(e,t,n)=>t in e?ZG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,f_=(e,t)=>{for(var n in t||(t={}))GG.call(t,n)&&Dk(e,n,t[n]);if(jk)for(var n of jk(t))YG.call(t,n)&&Dk(e,n,t[n]);return e};function sb(e,t){return t&&Object.keys(t).forEach(n=>{e[n]?e[n]=f_(f_({},e[n]),t[n]):e[n]=f_({},t[n])}),e}function Rk(e,t,n,r){const o=i=>typeof i=="function"?i(t,n||{},r):i||{};return Array.isArray(e)?e.map(i=>o(i.styles)).reduce((i,s)=>sb(i,s),{}):o(e)}function KG({ctx:e,theme:t,params:n,variant:r,size:o}){return e.reduce((i,s)=>(s.variants&&r in s.variants&&sb(i,s.variants[r](t,n,{variant:r,size:o})),s.sizes&&o in s.sizes&&sb(i,s.sizes[o](t,n,{variant:r,size:o})),i),{})}function ue(e){const t=typeof e=="function"?e:()=>e;function n(r,o){const i=ar(),s=jG(o?.name),a=hL(),c={variant:o?.variant,size:o?.size},{css:u,cx:f}=mL(),h=t(i,r,c),m=Rk(o?.styles,i,r,c),v=Rk(s,i,r,c),y=KG({ctx:s,theme:i,params:r,variant:o?.variant,size:o?.size}),w=Object.fromEntries(Object.keys(h).map(P=>{const b=f({[u(h[P])]:!o?.unstyled},u(y[P]),u(v[P]),u(m[P]));return[P,b]}));return{classes:UG({cx:f,classes:w,context:s,classNames:o?.classNames,name:o?.name,cache:a}),cx:f,theme:i}}return n}function Br(e){return`___ref-${e||""}`}function qG({styles:e}){const t=ar();return k.createElement(Ff,{styles:dL(typeof e=="function"?e(t):e)})}var JG=Object.defineProperty,QG=Object.defineProperties,XG=Object.getOwnPropertyDescriptors,Lk=Object.getOwnPropertySymbols,eY=Object.prototype.hasOwnProperty,tY=Object.prototype.propertyIsEnumerable,zk=(e,t,n)=>t in e?JG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Xu=(e,t)=>{for(var n in t||(t={}))eY.call(t,n)&&zk(e,n,t[n]);if(Lk)for(var n of Lk(t))tY.call(t,n)&&zk(e,n,t[n]);return e},ed=(e,t)=>QG(e,XG(t));const td={in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${M(10)})`},transitionProperty:"transform, opacity"},Mh={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:"opacity"},scale:{in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:"scale(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-y":{in:{opacity:1,transform:"scaleY(1)"},out:{opacity:0,transform:"scaleY(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-x":{in:{opacity:1,transform:"scaleX(1)"},out:{opacity:0,transform:"scaleX(0)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"skew-up":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:`translateY(-${M(20)}) skew(-10deg, -5deg)`},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"skew-down":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:`translateY(${M(20)}) skew(-10deg, -5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-left":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${M(20)}) rotate(-5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${M(20)}) rotate(5deg)`},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-100%)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(100%)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"slide-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(100%)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"slide-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-100%)"},common:{transformOrigin:"right"},transitionProperty:"transform, opacity"},pop:ed(Xu({},td),{common:{transformOrigin:"center center"}}),"pop-bottom-left":ed(Xu({},td),{common:{transformOrigin:"bottom left"}}),"pop-bottom-right":ed(Xu({},td),{common:{transformOrigin:"bottom right"}}),"pop-top-left":ed(Xu({},td),{common:{transformOrigin:"top left"}}),"pop-top-right":ed(Xu({},td),{common:{transformOrigin:"top right"}})},Ak=["mousedown","touchstart"];function nY(e,t,n){const r=_.useRef();return _.useEffect(()=>{const o=i=>{const{target:s}=i??{};if(Array.isArray(n)){const a=s?.hasAttribute("data-ignore-outside-clicks")||!document.body.contains(s)&&s.tagName!=="HTML";n.every(u=>!!u&&!i.composedPath().includes(u))&&!a&&e()}else r.current&&!r.current.contains(s)&&e()};return(t||Ak).forEach(i=>document.addEventListener(i,o)),()=>{(t||Ak).forEach(i=>document.removeEventListener(i,o))}},[r,e,n]),r}function rY(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function oY(e,t){return typeof t=="boolean"?t:typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function iY(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,o]=_.useState(n?t:oY(e,t)),i=_.useRef();return _.useEffect(()=>{if("matchMedia"in window)return i.current=window.matchMedia(e),o(i.current.matches),rY(i.current,s=>o(s.matches))},[e]),r}function ca(e,t,n){return Math.min(Math.max(e,t),n)}const $S=typeof document<"u"?_.useLayoutEffect:_.useEffect;function Hn(e,t){const n=_.useRef(!1);_.useEffect(()=>()=>{n.current=!1},[]),_.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function gL({opened:e,shouldReturnFocus:t=!0}){const n=_.useRef(),r=()=>{var o;n.current&&"focus"in n.current&&typeof n.current.focus=="function"&&((o=n.current)==null||o.focus({preventScroll:!0}))};return Hn(()=>{let o=-1;const i=s=>{s.key==="Tab"&&window.clearTimeout(o)};return document.addEventListener("keydown",i),e?n.current=document.activeElement:t&&(o=window.setTimeout(r,10)),()=>{window.clearTimeout(o),document.removeEventListener("keydown",i)}},[e,t]),r}const sY=/input|select|textarea|button|object/,vL="a, input, select, textarea, button, object, [tabindex]";function aY(e){return e.style.display==="none"}function lY(e){if(e.getAttribute("aria-hidden")||e.getAttribute("hidden")||e.getAttribute("type")==="hidden")return!1;let n=e;for(;n&&!(n===document.body||n.nodeType===11);){if(aY(n))return!1;n=n.parentNode}return!0}function yL(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function ab(e){const t=e.nodeName.toLowerCase(),n=!Number.isNaN(yL(e));return(sY.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&lY(e)}function _L(e){const t=yL(e);return(Number.isNaN(t)||t>=0)&&ab(e)}function cY(e){return Array.from(e.querySelectorAll(vL)).filter(_L)}function uY(e,t){const n=cY(e);if(!n.length){t.preventDefault();return}const r=n[t.shiftKey?0:n.length-1],o=e.getRootNode();if(!(r===o.activeElement||e===o.activeElement))return;t.preventDefault();const s=n[t.shiftKey?n.length-1:0];s&&s.focus()}function Vc(){return`mantine-${Math.random().toString(36).slice(2,11)}`}function dY(e,t="body > :not(script)"){const n=Vc(),r=Array.from(document.querySelectorAll(t)).map(o=>{var i;if((i=o?.shadowRoot)!=null&&i.contains(e)||o.contains(e))return;const s=o.getAttribute("aria-hidden"),a=o.getAttribute("data-hidden"),c=o.getAttribute("data-focus-id");return o.setAttribute("data-focus-id",n),s===null||s==="false"?o.setAttribute("aria-hidden","true"):!a&&!c&&o.setAttribute("data-hidden",s),{node:o,ariaHidden:a||null}});return()=>{r.forEach(o=>{!o||n!==o.node.getAttribute("data-focus-id")||(o.ariaHidden===null?o.node.removeAttribute("aria-hidden"):o.node.setAttribute("aria-hidden",o.ariaHidden),o.node.removeAttribute("data-focus-id"),o.node.removeAttribute("data-hidden"))})}}function fY(e=!0){const t=_.useRef(),n=_.useRef(null),r=i=>{let s=i.querySelector("[data-autofocus]");if(!s){const a=Array.from(i.querySelectorAll(vL));s=a.find(_L)||a.find(ab)||null,!s&&ab(i)&&(s=i)}s&&s.focus({preventScroll:!0})},o=_.useCallback(i=>{if(e){if(i===null){n.current&&(n.current(),n.current=null);return}n.current=dY(i),t.current!==i&&(i?(setTimeout(()=>{i.getRootNode()&&r(i)}),t.current=i):t.current=null)}},[e]);return _.useEffect(()=>{if(!e)return;t.current&&setTimeout(()=>r(t.current));const i=s=>{s.key==="Tab"&&t.current&&uY(t.current,s)};return document.addEventListener("keydown",i),()=>{document.removeEventListener("keydown",i),n.current&&n.current()}},[e]),o}const hY=k["useId".toString()]||(()=>{});function pY(){const e=hY();return e?`mantine-${e.replace(/:/g,"")}`:""}function Ia(e){const t=pY(),[n,r]=_.useState(t);return $S(()=>{r(Vc())},[]),typeof e=="string"?e:typeof window>"u"?t:n}function Pm(e,t,n){_.useEffect(()=>(window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)),[e,t])}function wL(e,t){typeof e=="function"?e(t):typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function mY(...e){return t=>{e.forEach(n=>wL(n,t))}}function Ps(...e){return _.useCallback(mY(...e),e)}const bL=e=>({x:ca(e.x,0,1),y:ca(e.y,0,1)});function xL(e,t,n="ltr"){const r=_.useRef(),o=_.useRef(!1),i=_.useRef(!1),s=_.useRef(0),[a,c]=_.useState(!1);return _.useEffect(()=>{o.current=!0},[]),_.useEffect(()=>{const u=({x:S,y:O})=>{cancelAnimationFrame(s.current),s.current=requestAnimationFrame(()=>{if(o.current&&r.current){r.current.style.userSelect="none";const E=r.current.getBoundingClientRect();if(E.width&&E.height){const $=ca((S-E.left)/E.width,0,1);e({x:n==="ltr"?$:1-$,y:ca((O-E.top)/E.height,0,1)})}}})},f=()=>{document.addEventListener("mousemove",w),document.addEventListener("mouseup",v),document.addEventListener("touchmove",b),document.addEventListener("touchend",v)},h=()=>{document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",v),document.removeEventListener("touchmove",b),document.removeEventListener("touchend",v)},m=()=>{!i.current&&o.current&&(i.current=!0,typeof t?.onScrubStart=="function"&&t.onScrubStart(),c(!0),f())},v=()=>{i.current&&o.current&&(i.current=!1,c(!1),h(),setTimeout(()=>{typeof t?.onScrubEnd=="function"&&t.onScrubEnd()},0))},y=S=>{m(),S.preventDefault(),w(S)},w=S=>u({x:S.clientX,y:S.clientY}),P=S=>{S.cancelable&&S.preventDefault(),m(),b(S)},b=S=>{S.cancelable&&S.preventDefault(),u({x:S.changedTouches[0].clientX,y:S.changedTouches[0].clientY})};return r.current.addEventListener("mousedown",y),r.current.addEventListener("touchstart",P,{passive:!1}),()=>{r.current&&(r.current.removeEventListener("mousedown",y),r.current.removeEventListener("touchstart",P))}},[n,e]),{ref:r,active:a}}function _o({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){const[o,i]=_.useState(t!==void 0?t:n),s=a=>{i(a),r?.(a)};return e!==void 0?[e,r,!0]:[o,s,!1]}function MS(e,t){return iY("(prefers-reduced-motion: reduce)",e,t)}const gY=e=>e<.5?2*e*e:-1+(4-2*e)*e,vY=({axis:e,target:t,parent:n,alignment:r,offset:o,isList:i})=>{if(!t||!n&&typeof document>"u")return 0;const s=!!n,c=(n||document.body).getBoundingClientRect(),u=t.getBoundingClientRect(),f=h=>u[h]-c[h];if(e==="y"){const h=f("top");if(h===0)return 0;if(r==="start"){const v=h-o;return v<=u.height*(i?0:1)||!i?v:0}const m=s?c.height:window.innerHeight;if(r==="end"){const v=h+o-m+u.height;return v>=-u.height*(i?0:1)||!i?v:0}return r==="center"?h-m/2+u.height/2:0}if(e==="x"){const h=f("left");if(h===0)return 0;if(r==="start"){const v=h-o;return v<=u.width||!i?v:0}const m=s?c.width:window.innerWidth;if(r==="end"){const v=h+o-m+u.width;return v>=-u.width||!i?v:0}return r==="center"?h-m/2+u.width/2:0}return 0},yY=({axis:e,parent:t})=>{if(!t&&typeof document>"u")return 0;const n=e==="y"?"scrollTop":"scrollLeft";if(t)return t[n];const{body:r,documentElement:o}=document;return r[n]+o[n]},_Y=({axis:e,parent:t,distance:n})=>{if(!t&&typeof document>"u")return;const r=e==="y"?"scrollTop":"scrollLeft";if(t)t[r]=n;else{const{body:o,documentElement:i}=document;o[r]=n,i[r]=n}};function SL({duration:e=1250,axis:t="y",onScrollFinish:n,easing:r=gY,offset:o=0,cancelable:i=!0,isList:s=!1}={}){const a=_.useRef(0),c=_.useRef(0),u=_.useRef(!1),f=_.useRef(null),h=_.useRef(null),m=MS(),v=()=>{a.current&&cancelAnimationFrame(a.current)},y=_.useCallback(({alignment:P="start"}={})=>{var b;u.current=!1,a.current&&v();const S=(b=yY({parent:f.current,axis:t}))!=null?b:0,O=vY({parent:f.current,target:h.current,axis:t,alignment:P,offset:o,isList:s})-(f.current?0:S);function E(){c.current===0&&(c.current=performance.now());const N=performance.now()-c.current,I=m||e===0?1:N/e,R=S+O*r(I);_Y({parent:f.current,axis:t,distance:R}),!u.current&&I<1?a.current=requestAnimationFrame(E):(typeof n=="function"&&n(),c.current=0,a.current=0,v())}E()},[t,e,r,s,o,n,m]),w=()=>{i&&(u.current=!0)};return Pm("wheel",w,{passive:!0}),Pm("touchmove",w,{passive:!0}),_.useEffect(()=>v,[]),{scrollableRef:f,targetRef:h,scrollIntoView:y,cancel:v}}function wY(e){const[t,n]=_.useState(null),r=_.useRef();return{ref:_.useCallback(i=>{if(r.current&&(r.current.disconnect(),r.current=null),i===null){n(null);return}r.current=new IntersectionObserver(([s])=>{n(s)},e),r.current.observe(i)},[e?.rootMargin,e?.root,e?.threshold]),entry:t}}function Bk(){if(typeof window>"u")return"undetermined";const{userAgent:e}=window.navigator,t=/(Macintosh)|(MacIntel)|(MacPPC)|(Mac68K)/i,n=/(Win32)|(Win64)|(Windows)|(WinCE)/i,r=/(iPhone)|(iPad)|(iPod)/i;return t.test(e)?"macos":r.test(e)?"ios":n.test(e)?"windows":/Android/i.test(e)?"android":/Linux/i.test(e)?"linux":"undetermined"}function bY(e={getValueInEffect:!0}){const[t,n]=_.useState(e.getValueInEffect?"undetermined":Bk());return $S(()=>{e.getValueInEffect&&n(Bk)},[]),t}function xY(e){return t=>{if(!t)e(t);else if(typeof t=="function")e(t);else if(typeof t=="object"&&"nativeEvent"in t){const{currentTarget:n}=t;n.type==="checkbox"?e(n.checked):e(n.value)}else e(t)}}function SY(e){const[t,n]=_.useState(e);return[t,xY(n)]}function NS(e=!1,t){const{onOpen:n,onClose:r}=t||{},[o,i]=_.useState(e),s=_.useCallback(()=>{i(u=>u||(n?.(),!0))},[n]),a=_.useCallback(()=>{i(u=>u&&(r?.(),!1))},[r]),c=_.useCallback(()=>{o?a():s()},[a,s,o]);return[o,{open:s,close:a,toggle:c}]}function PY(e,t,n={autoInvoke:!1}){const r=_.useRef(null),o=_.useRef(null),i=_.useCallback((...a)=>{o.current||(o.current=window.setTimeout(()=>{r.current(a),o.current=null},t))},[t]),s=_.useCallback(()=>{o.current&&(window.clearTimeout(o.current),o.current=null)},[]);return _.useEffect(()=>{r.current=e},[e]),_.useEffect(()=>(n.autoInvoke&&i(),s),[s,t,n.autoInvoke,i]),{start:i,clear:s}}var Fk=Object.getOwnPropertySymbols,OY=Object.prototype.hasOwnProperty,CY=Object.prototype.propertyIsEnumerable,kY=(e,t)=>{var n={};for(var r in e)OY.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Fk)for(var r of Fk(e))t.indexOf(r)<0&&CY.call(e,r)&&(n[r]=e[r]);return n};function Bl(e){const t=e,{m:n,mx:r,my:o,mt:i,mb:s,ml:a,mr:c,p:u,px:f,py:h,pt:m,pb:v,pl:y,pr:w,bg:P,c:b,opacity:S,ff:O,fz:E,fw:$,lts:N,ta:I,lh:R,fs:B,tt:z,td:G,w:Q,miw:X,maw:V,h:H,mih:Z,mah:Y,bgsz:j,bgp:W,bgr:F,bga:K,pos:ee,top:fe,left:ie,bottom:J,right:ne,inset:le,display:_e}=t,Ne=kY(t,["m","mx","my","mt","mb","ml","mr","p","px","py","pt","pb","pl","pr","bg","c","opacity","ff","fz","fw","lts","ta","lh","fs","tt","td","w","miw","maw","h","mih","mah","bgsz","bgp","bgr","bga","pos","top","left","bottom","right","inset","display"]);return{systemStyles:fL({m:n,mx:r,my:o,mt:i,mb:s,ml:a,mr:c,p:u,px:f,py:h,pt:m,pb:v,pl:y,pr:w,bg:P,c:b,opacity:S,ff:O,fz:E,fw:$,lts:N,ta:I,lh:R,fs:B,tt:z,td:G,w:Q,miw:X,maw:V,h:H,mih:Z,mah:Y,bgsz:j,bgp:W,bgr:F,bga:K,pos:ee,top:fe,left:ie,bottom:J,right:ne,inset:le,display:_e}),rest:Ne}}function EY(e,t){const n=Object.keys(e).filter(r=>r!=="base").sort((r,o)=>Bo(re({size:r,sizes:t.breakpoints}))-Bo(re({size:o,sizes:t.breakpoints})));return"base"in e?["base",...n]:n}function $Y({value:e,theme:t,getValue:n,property:r}){if(e==null)return;if(typeof e=="object")return EY(e,t).reduce((s,a)=>{if(a==="base"&&e.base!==void 0){const u=n(e.base,t);return Array.isArray(r)?(r.forEach(f=>{s[f]=u}),s):(s[r]=u,s)}const c=n(e[a],t);return Array.isArray(r)?(s[t.fn.largerThan(a)]={},r.forEach(u=>{s[t.fn.largerThan(a)][u]=c}),s):(s[t.fn.largerThan(a)]={[r]:c},s)},{});const o=n(e,t);return Array.isArray(r)?r.reduce((i,s)=>(i[s]=o,i),{}):{[r]:o}}function MY(e,t){return e==="dimmed"?t.colorScheme==="dark"?t.colors.dark[2]:t.colors.gray[6]:t.fn.variant({variant:"filled",color:e,primaryFallback:!1}).background}function NY(e){return M(e)}function TY(e){return e}function IY(e,t){return re({size:e,sizes:t.fontSizes})}const jY=["-xs","-sm","-md","-lg","-xl"];function DY(e,t){return jY.includes(e)?`calc(${re({size:e.replace("-",""),sizes:t.spacing})} * -1)`:re({size:e,sizes:t.spacing})}const RY={identity:TY,color:MY,size:NY,fontSize:IY,spacing:DY},LY={m:{type:"spacing",property:"margin"},mt:{type:"spacing",property:"marginTop"},mb:{type:"spacing",property:"marginBottom"},ml:{type:"spacing",property:"marginLeft"},mr:{type:"spacing",property:"marginRight"},mx:{type:"spacing",property:["marginRight","marginLeft"]},my:{type:"spacing",property:["marginTop","marginBottom"]},p:{type:"spacing",property:"padding"},pt:{type:"spacing",property:"paddingTop"},pb:{type:"spacing",property:"paddingBottom"},pl:{type:"spacing",property:"paddingLeft"},pr:{type:"spacing",property:"paddingRight"},px:{type:"spacing",property:["paddingRight","paddingLeft"]},py:{type:"spacing",property:["paddingTop","paddingBottom"]},bg:{type:"color",property:"background"},c:{type:"color",property:"color"},opacity:{type:"identity",property:"opacity"},ff:{type:"identity",property:"fontFamily"},fz:{type:"fontSize",property:"fontSize"},fw:{type:"identity",property:"fontWeight"},lts:{type:"size",property:"letterSpacing"},ta:{type:"identity",property:"textAlign"},lh:{type:"identity",property:"lineHeight"},fs:{type:"identity",property:"fontStyle"},tt:{type:"identity",property:"textTransform"},td:{type:"identity",property:"textDecoration"},w:{type:"spacing",property:"width"},miw:{type:"spacing",property:"minWidth"},maw:{type:"spacing",property:"maxWidth"},h:{type:"spacing",property:"height"},mih:{type:"spacing",property:"minHeight"},mah:{type:"spacing",property:"maxHeight"},bgsz:{type:"size",property:"backgroundSize"},bgp:{type:"identity",property:"backgroundPosition"},bgr:{type:"identity",property:"backgroundRepeat"},bga:{type:"identity",property:"backgroundAttachment"},pos:{type:"identity",property:"position"},top:{type:"identity",property:"top"},left:{type:"size",property:"left"},bottom:{type:"size",property:"bottom"},right:{type:"size",property:"right"},inset:{type:"size",property:"inset"},display:{type:"identity",property:"display"}};var zY=Object.defineProperty,Vk=Object.getOwnPropertySymbols,AY=Object.prototype.hasOwnProperty,BY=Object.prototype.propertyIsEnumerable,Hk=(e,t,n)=>t in e?zY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Wk=(e,t)=>{for(var n in t||(t={}))AY.call(t,n)&&Hk(e,n,t[n]);if(Vk)for(var n of Vk(t))BY.call(t,n)&&Hk(e,n,t[n]);return e};function Uk(e,t,n=LY){return Object.keys(n).reduce((o,i)=>(i in e&&e[i]!==void 0&&o.push($Y({value:e[i],getValue:RY[n[i].type],property:n[i].property,theme:t})),o),[]).reduce((o,i)=>(Object.keys(i).forEach(s=>{typeof i[s]=="object"&&i[s]!==null&&s in o?o[s]=Wk(Wk({},o[s]),i[s]):o[s]=i[s]}),o),{})}function Zk(e,t){return typeof e=="function"?e(t):e}function FY(e,t,n){const r=ar(),{css:o,cx:i}=mL();return Array.isArray(e)?i(n,o(Uk(t,r)),e.map(s=>o(Zk(s,r)))):i(n,o(Zk(e,r)),o(Uk(t,r)))}var VY=Object.defineProperty,Om=Object.getOwnPropertySymbols,PL=Object.prototype.hasOwnProperty,OL=Object.prototype.propertyIsEnumerable,Gk=(e,t,n)=>t in e?VY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,HY=(e,t)=>{for(var n in t||(t={}))PL.call(t,n)&&Gk(e,n,t[n]);if(Om)for(var n of Om(t))OL.call(t,n)&&Gk(e,n,t[n]);return e},WY=(e,t)=>{var n={};for(var r in e)PL.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Om)for(var r of Om(e))t.indexOf(r)<0&&OL.call(e,r)&&(n[r]=e[r]);return n};const CL=_.forwardRef((e,t)=>{var n=e,{className:r,component:o,style:i,sx:s}=n,a=WY(n,["className","component","style","sx"]);const{systemStyles:c,rest:u}=Bl(a),f=o||"div";return k.createElement(f,HY({ref:t,className:FY(s,c,r),style:i},u))});CL.displayName="@mantine/core/Box";const Pe=CL;var UY=Object.defineProperty,ZY=Object.defineProperties,GY=Object.getOwnPropertyDescriptors,Yk=Object.getOwnPropertySymbols,YY=Object.prototype.hasOwnProperty,KY=Object.prototype.propertyIsEnumerable,Kk=(e,t,n)=>t in e?UY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qk=(e,t)=>{for(var n in t||(t={}))YY.call(t,n)&&Kk(e,n,t[n]);if(Yk)for(var n of Yk(t))KY.call(t,n)&&Kk(e,n,t[n]);return e},qY=(e,t)=>ZY(e,GY(t)),JY=ue(e=>({root:qY(qk(qk({},e.fn.focusStyles()),e.fn.fontStyles()),{cursor:"pointer",border:0,padding:0,appearance:"none",fontSize:e.fontSizes.md,backgroundColor:"transparent",textAlign:"left",color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,textDecoration:"none",boxSizing:"border-box"})}));const QY=JY;var XY=Object.defineProperty,Cm=Object.getOwnPropertySymbols,kL=Object.prototype.hasOwnProperty,EL=Object.prototype.propertyIsEnumerable,Jk=(e,t,n)=>t in e?XY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,eK=(e,t)=>{for(var n in t||(t={}))kL.call(t,n)&&Jk(e,n,t[n]);if(Cm)for(var n of Cm(t))EL.call(t,n)&&Jk(e,n,t[n]);return e},tK=(e,t)=>{var n={};for(var r in e)kL.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Cm)for(var r of Cm(e))t.indexOf(r)<0&&EL.call(e,r)&&(n[r]=e[r]);return n};const $L=_.forwardRef((e,t)=>{const n=ae("UnstyledButton",{},e),{className:r,component:o="button",unstyled:i,variant:s}=n,a=tK(n,["className","component","unstyled","variant"]),{classes:c,cx:u}=QY(null,{name:"UnstyledButton",unstyled:i,variant:s});return k.createElement(Pe,eK({component:o,ref:t,className:u(c.root,r),type:o==="button"?"button":void 0},a))});$L.displayName="@mantine/core/UnstyledButton";const ds=$L;var ML={exports:{}},xo={},NL={exports:{}},TL={};/** * @license React * scheduler.production.min.js * @@ -69,7 +69,7 @@ function xW(e,t){for(var n=0;n>>1,ee=D[K];if(0>>1;Ko(J,F))neo(le,J)?(D[K]=le,D[ne]=F,K=ne):(D[K]=J,D[ie]=F,K=ie);else if(neo(le,F))D[K]=le,D[ne]=F,K=ne;else break e}}return W}function o(D,W){var F=D.sortIndex-W.sortIndex;return F!==0?F:D.id-W.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var c=[],u=[],f=1,h=null,m=3,v=!1,y=!1,w=!1,P=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function O(D){for(var W=n(u);W!==null;){if(W.callback===null)r(u);else if(W.startTime<=D)r(u),W.sortIndex=W.expirationTime,t(c,W);else break;W=n(u)}}function E(D){if(w=!1,O(D),!y)if(n(c)!==null)y=!0,Z($);else{var W=n(u);W!==null&&Y(E,W.startTime-D)}}function $(D,W){y=!1,w&&(w=!1,b(R),R=-1),v=!0;var F=m;try{for(O(W),h=n(c);h!==null&&(!(h.expirationTime>W)||D&&!G());){var K=h.callback;if(typeof K=="function"){h.callback=null,m=h.priorityLevel;var ee=K(h.expirationTime<=W);W=e.unstable_now(),typeof ee=="function"?h.callback=ee:h===n(c)&&r(c),O(W)}else r(c);h=n(c)}if(h!==null)var fe=!0;else{var ie=n(u);ie!==null&&Y(E,ie.startTime-W),fe=!1}return fe}finally{h=null,m=F,v=!1}}var N=!1,I=null,R=-1,B=5,z=-1;function G(){return!(e.unstable_now()-zD||125K?(D.sortIndex=F,t(u,D),n(c)===null&&D===n(u)&&(w?(b(R),R=-1):w=!0,Y(E,F-K))):(D.sortIndex=ee,t(c,D),y||v||(y=!0,Z($))),D},e.unstable_shouldYield=G,e.unstable_wrapCallback=function(D){var W=m;return function(){var F=m;m=W;try{return D.apply(this,arguments)}finally{m=F}}}})(T5);N5.exports=T5;var nK=N5.exports;/** + */(function(e){function t(j,W){var F=j.length;j.push(W);e:for(;0>>1,ee=j[K];if(0>>1;Ko(J,F))neo(le,J)?(j[K]=le,j[ne]=F,K=ne):(j[K]=J,j[ie]=F,K=ie);else if(neo(le,F))j[K]=le,j[ne]=F,K=ne;else break e}}return W}function o(j,W){var F=j.sortIndex-W.sortIndex;return F!==0?F:j.id-W.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var c=[],u=[],f=1,h=null,m=3,v=!1,y=!1,w=!1,P=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function O(j){for(var W=n(u);W!==null;){if(W.callback===null)r(u);else if(W.startTime<=j)r(u),W.sortIndex=W.expirationTime,t(c,W);else break;W=n(u)}}function E(j){if(w=!1,O(j),!y)if(n(c)!==null)y=!0,Z($);else{var W=n(u);W!==null&&Y(E,W.startTime-j)}}function $(j,W){y=!1,w&&(w=!1,b(R),R=-1),v=!0;var F=m;try{for(O(W),h=n(c);h!==null&&(!(h.expirationTime>W)||j&&!G());){var K=h.callback;if(typeof K=="function"){h.callback=null,m=h.priorityLevel;var ee=K(h.expirationTime<=W);W=e.unstable_now(),typeof ee=="function"?h.callback=ee:h===n(c)&&r(c),O(W)}else r(c);h=n(c)}if(h!==null)var fe=!0;else{var ie=n(u);ie!==null&&Y(E,ie.startTime-W),fe=!1}return fe}finally{h=null,m=F,v=!1}}var N=!1,I=null,R=-1,B=5,z=-1;function G(){return!(e.unstable_now()-zj||125K?(j.sortIndex=F,t(u,j),n(c)===null&&j===n(u)&&(w?(b(R),R=-1):w=!0,Y(E,F-K))):(j.sortIndex=ee,t(c,j),y||v||(y=!0,Z($))),j},e.unstable_shouldYield=G,e.unstable_wrapCallback=function(j){var W=m;return function(){var F=m;m=W;try{return j.apply(this,arguments)}finally{m=F}}}})(TL);NL.exports=TL;var nK=NL.exports;/** * @license React * react-dom.production.min.js * @@ -77,14 +77,14 @@ function xW(e,t){for(var n=0;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),lb=Object.prototype.hasOwnProperty,rK=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Qk={},Xk={};function oK(e){return lb.call(Xk,e)?!0:lb.call(Qk,e)?!1:rK.test(e)?Xk[e]=!0:(Qk[e]=!0,!1)}function iK(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function sK(e,t,n,r){if(t===null||typeof t>"u"||iK(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Or(e,t,n,r,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var Un={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Un[e]=new Or(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Un[t]=new Or(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Un[e]=new Or(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Un[e]=new Or(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Un[e]=new Or(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Un[e]=new Or(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Un[e]=new Or(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Un[e]=new Or(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Un[e]=new Or(e,5,!1,e.toLowerCase(),null,!1,!1)});var TS=/[\-:]([a-z])/g;function IS(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(TS,IS);Un[t]=new Or(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(TS,IS);Un[t]=new Or(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(TS,IS);Un[t]=new Or(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Un[e]=new Or(e,1,!1,e.toLowerCase(),null,!1,!1)});Un.xlinkHref=new Or("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Un[e]=new Or(e,1,!1,e.toLowerCase(),null,!0,!0)});function DS(e,t,n,r){var o=Un.hasOwnProperty(t)?Un[t]:null;(o!==null?o.type!==0:r||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),lb=Object.prototype.hasOwnProperty,rK=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Qk={},Xk={};function oK(e){return lb.call(Xk,e)?!0:lb.call(Qk,e)?!1:rK.test(e)?Xk[e]=!0:(Qk[e]=!0,!1)}function iK(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function sK(e,t,n,r){if(t===null||typeof t>"u"||iK(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Or(e,t,n,r,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var Un={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Un[e]=new Or(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Un[t]=new Or(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Un[e]=new Or(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Un[e]=new Or(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Un[e]=new Or(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Un[e]=new Or(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Un[e]=new Or(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Un[e]=new Or(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Un[e]=new Or(e,5,!1,e.toLowerCase(),null,!1,!1)});var TS=/[\-:]([a-z])/g;function IS(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(TS,IS);Un[t]=new Or(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(TS,IS);Un[t]=new Or(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(TS,IS);Un[t]=new Or(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Un[e]=new Or(e,1,!1,e.toLowerCase(),null,!1,!1)});Un.xlinkHref=new Or("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Un[e]=new Or(e,1,!1,e.toLowerCase(),null,!0,!0)});function jS(e,t,n,r){var o=Un.hasOwnProperty(t)?Un[t]:null;(o!==null?o.type!==0:r||!(2a||o[s]!==i[a]){var c=` -`+o[s].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}while(1<=s&&0<=a);break}}}finally{p_=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?yd(e):""}function aK(e){switch(e.tag){case 5:return yd(e.type);case 16:return yd("Lazy");case 13:return yd("Suspense");case 19:return yd("SuspenseList");case 0:case 2:case 15:return e=m_(e.type,!1),e;case 11:return e=m_(e.type.render,!1),e;case 1:return e=m_(e.type,!0),e;default:return""}}function fb(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Sc:return"Fragment";case xc:return"Portal";case cb:return"Profiler";case jS:return"StrictMode";case ub:return"Suspense";case db:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case L5:return(e.displayName||"Context")+".Consumer";case j5:return(e._context.displayName||"Context")+".Provider";case LS:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case RS:return t=e.displayName||null,t!==null?t:fb(e.type)||"Memo";case Zs:t=e._payload,e=e._init;try{return fb(e(t))}catch{}}return null}function lK(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return fb(t);case 8:return t===jS?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Ca(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function z5(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function cK(e){var t=z5(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Th(e){e._valueTracker||(e._valueTracker=cK(e))}function A5(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=z5(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function km(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function hb(e,t){var n=t.checked;return Ut({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function t2(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Ca(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function B5(e,t){t=t.checked,t!=null&&DS(e,"checked",t,!1)}function pb(e,t){B5(e,t);var n=Ca(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?mb(e,t.type,n):t.hasOwnProperty("defaultValue")&&mb(e,t.type,Ca(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function n2(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function mb(e,t,n){(t!=="number"||km(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var _d=Array.isArray;function Hc(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=Ih.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function nf(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Nd={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},uK=["Webkit","ms","Moz","O"];Object.keys(Nd).forEach(function(e){uK.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Nd[t]=Nd[e]})});function W5(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Nd.hasOwnProperty(e)&&Nd[e]?(""+t).trim():t+"px"}function U5(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=W5(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var dK=Ut({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function yb(e,t){if(t){if(dK[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ce(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ce(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ce(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ce(62))}}function _b(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var wb=null;function zS(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var bb=null,Wc=null,Uc=null;function i2(e){if(e=Wf(e)){if(typeof bb!="function")throw Error(ce(280));var t=e.stateNode;t&&(t=P0(t),bb(e.stateNode,e.type,t))}}function Z5(e){Wc?Uc?Uc.push(e):Uc=[e]:Wc=e}function G5(){if(Wc){var e=Wc,t=Uc;if(Uc=Wc=null,i2(e),t)for(e=0;e>>=0,e===0?32:31-(xK(e)/SK|0)|0}var Dh=64,jh=4194304;function wd(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Nm(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~o;a!==0?r=wd(a):(i&=s,i!==0&&(r=wd(i)))}else s=n&~o,s!==0?r=wd(s):i!==0&&(r=wd(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Vf(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ti(t),e[t]=n}function kK(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Id),p2=String.fromCharCode(32),m2=!1;function hR(e,t){switch(e){case"keyup":return tq.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function pR(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Pc=!1;function rq(e,t){switch(e){case"compositionend":return pR(t);case"keypress":return t.which!==32?null:(m2=!0,p2);case"textInput":return e=t.data,e===p2&&m2?null:e;default:return null}}function oq(e,t){if(Pc)return e==="compositionend"||!ZS&&hR(e,t)?(e=dR(),Vp=HS=ea=null,Pc=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=_2(n)}}function yR(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?yR(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function _R(){for(var e=window,t=km();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=km(e.document)}return t}function GS(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function hq(e){var t=_R(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&yR(n.ownerDocument.documentElement,n)){if(r!==null&&GS(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=w2(n,i);var s=w2(n,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Oc=null,kb=null,jd=null,Eb=!1;function b2(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Eb||Oc==null||Oc!==km(r)||(r=Oc,"selectionStart"in r&&GS(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),jd&&cf(jd,r)||(jd=r,r=Dm(kb,"onSelect"),0Ec||(e.current=Db[Ec],Db[Ec]=null,Ec--)}function Ct(e,t){Ec++,Db[Ec]=e.current,e.current=t}var ka={},ir=ja(ka),Fr=ja(!1),$l=ka;function ru(e,t){var n=e.type.contextTypes;if(!n)return ka;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Vr(e){return e=e.childContextTypes,e!=null}function Lm(){jt(Fr),jt(ir)}function E2(e,t,n){if(ir.current!==ka)throw Error(ce(168));Ct(ir,t),Ct(Fr,n)}function ER(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(ce(108,lK(e)||"Unknown",o));return Ut({},n,r)}function Rm(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ka,$l=ir.current,Ct(ir,e),Ct(Fr,Fr.current),!0}function $2(e,t,n){var r=e.stateNode;if(!r)throw Error(ce(169));n?(e=ER(e,t,$l),r.__reactInternalMemoizedMergedChildContext=e,jt(Fr),jt(ir),Ct(ir,e)):jt(Fr),Ct(Fr,n)}var is=null,O0=!1,$_=!1;function $R(e){is===null?is=[e]:is.push(e)}function Oq(e){O0=!0,$R(e)}function La(){if(!$_&&is!==null){$_=!0;var e=0,t=yt;try{var n=is;for(yt=1;e>=s,o-=s,cs=1<<32-ti(t)+o|n<R?(B=I,I=null):B=I.sibling;var z=m(b,I,O[R],E);if(z===null){I===null&&(I=B);break}e&&I&&z.alternate===null&&t(b,I),S=i(z,S,R),N===null?$=z:N.sibling=z,N=z,I=B}if(R===O.length)return n(b,I),Rt&&tl(b,R),$;if(I===null){for(;RR?(B=I,I=null):B=I.sibling;var G=m(b,I,z.value,E);if(G===null){I===null&&(I=B);break}e&&I&&G.alternate===null&&t(b,I),S=i(G,S,R),N===null?$=G:N.sibling=G,N=G,I=B}if(z.done)return n(b,I),Rt&&tl(b,R),$;if(I===null){for(;!z.done;R++,z=O.next())z=h(b,z.value,E),z!==null&&(S=i(z,S,R),N===null?$=z:N.sibling=z,N=z);return Rt&&tl(b,R),$}for(I=r(b,I);!z.done;R++,z=O.next())z=v(I,b,R,z.value,E),z!==null&&(e&&z.alternate!==null&&I.delete(z.key===null?R:z.key),S=i(z,S,R),N===null?$=z:N.sibling=z,N=z);return e&&I.forEach(function(Q){return t(b,Q)}),Rt&&tl(b,R),$}function P(b,S,O,E){if(typeof O=="object"&&O!==null&&O.type===Sc&&O.key===null&&(O=O.props.children),typeof O=="object"&&O!==null){switch(O.$$typeof){case Nh:e:{for(var $=O.key,N=S;N!==null;){if(N.key===$){if($=O.type,$===Sc){if(N.tag===7){n(b,N.sibling),S=o(N,O.props.children),S.return=b,b=S;break e}}else if(N.elementType===$||typeof $=="object"&&$!==null&&$.$$typeof===Zs&&L2($)===N.type){n(b,N.sibling),S=o(N,O.props),S.ref=ad(b,N,O),S.return=b,b=S;break e}n(b,N);break}else t(b,N);N=N.sibling}O.type===Sc?(S=xl(O.props.children,b.mode,E,O.key),S.return=b,b=S):(E=qp(O.type,O.key,O.props,null,b.mode,E),E.ref=ad(b,S,O),E.return=b,b=E)}return s(b);case xc:e:{for(N=O.key;S!==null;){if(S.key===N)if(S.tag===4&&S.stateNode.containerInfo===O.containerInfo&&S.stateNode.implementation===O.implementation){n(b,S.sibling),S=o(S,O.children||[]),S.return=b,b=S;break e}else{n(b,S);break}else t(b,S);S=S.sibling}S=R_(O,b.mode,E),S.return=b,b=S}return s(b);case Zs:return N=O._init,P(b,S,N(O._payload),E)}if(_d(O))return y(b,S,O,E);if(nd(O))return w(b,S,O,E);Vh(b,O)}return typeof O=="string"&&O!==""||typeof O=="number"?(O=""+O,S!==null&&S.tag===6?(n(b,S.sibling),S=o(S,O),S.return=b,b=S):(n(b,S),S=L_(O,b.mode,E),S.return=b,b=S),s(b)):n(b,S)}return P}var iu=RR(!0),zR=RR(!1),Uf={},Li=ja(Uf),hf=ja(Uf),pf=ja(Uf);function pl(e){if(e===Uf)throw Error(ce(174));return e}function nP(e,t){switch(Ct(pf,t),Ct(hf,e),Ct(Li,Uf),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:vb(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=vb(t,e)}jt(Li),Ct(Li,t)}function su(){jt(Li),jt(hf),jt(pf)}function AR(e){pl(pf.current);var t=pl(Li.current),n=vb(t,e.type);t!==n&&(Ct(hf,e),Ct(Li,n))}function rP(e){hf.current===e&&(jt(Li),jt(hf))}var Ht=ja(0);function Hm(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var M_=[];function oP(){for(var e=0;en?n:4,e(!0);var r=N_.transition;N_.transition={};try{e(!1),t()}finally{yt=n,N_.transition=r}}function t3(){return Vo().memoizedState}function $q(e,t,n){var r=ga(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},n3(e))r3(t,n);else if(n=IR(e,t,n,r),n!==null){var o=_r();ni(n,e,r,o),o3(n,t,r)}}function Mq(e,t,n){var r=ga(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(n3(e))r3(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,a=i(s,n);if(o.hasEagerState=!0,o.eagerState=a,oi(a,s)){var c=t.interleaved;c===null?(o.next=o,eP(t)):(o.next=c.next,c.next=o),t.interleaved=o;return}}catch{}finally{}n=IR(e,t,o,r),n!==null&&(o=_r(),ni(n,e,r,o),o3(n,t,r))}}function n3(e){var t=e.alternate;return e===Wt||t!==null&&t===Wt}function r3(e,t){Ld=Wm=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function o3(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,BS(e,n)}}var Um={readContext:Fo,useCallback:Jn,useContext:Jn,useEffect:Jn,useImperativeHandle:Jn,useInsertionEffect:Jn,useLayoutEffect:Jn,useMemo:Jn,useReducer:Jn,useRef:Jn,useState:Jn,useDebugValue:Jn,useDeferredValue:Jn,useTransition:Jn,useMutableSource:Jn,useSyncExternalStore:Jn,useId:Jn,unstable_isNewReconciler:!1},Nq={readContext:Fo,useCallback:function(e,t){return _i().memoizedState=[e,t===void 0?null:t],e},useContext:Fo,useEffect:z2,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Zp(4194308,4,qR.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Zp(4194308,4,e,t)},useInsertionEffect:function(e,t){return Zp(4,2,e,t)},useMemo:function(e,t){var n=_i();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=_i();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=$q.bind(null,Wt,e),[r.memoizedState,e]},useRef:function(e){var t=_i();return e={current:e},t.memoizedState=e},useState:R2,useDebugValue:cP,useDeferredValue:function(e){return _i().memoizedState=e},useTransition:function(){var e=R2(!1),t=e[0];return e=Eq.bind(null,e[1]),_i().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Wt,o=_i();if(Rt){if(n===void 0)throw Error(ce(407));n=n()}else{if(n=t(),kn===null)throw Error(ce(349));Nl&30||VR(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,z2(WR.bind(null,r,i,e),[e]),r.flags|=2048,vf(9,HR.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=_i(),t=kn.identifierPrefix;if(Rt){var n=us,r=cs;n=(r&~(1<<32-ti(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=mf++,0")&&(c=c.replace("",e.displayName)),c}while(1<=s&&0<=a);break}}}finally{p_=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?yd(e):""}function aK(e){switch(e.tag){case 5:return yd(e.type);case 16:return yd("Lazy");case 13:return yd("Suspense");case 19:return yd("SuspenseList");case 0:case 2:case 15:return e=m_(e.type,!1),e;case 11:return e=m_(e.type.render,!1),e;case 1:return e=m_(e.type,!0),e;default:return""}}function fb(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Sc:return"Fragment";case xc:return"Portal";case cb:return"Profiler";case DS:return"StrictMode";case ub:return"Suspense";case db:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case RL:return(e.displayName||"Context")+".Consumer";case DL:return(e._context.displayName||"Context")+".Provider";case RS:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case LS:return t=e.displayName||null,t!==null?t:fb(e.type)||"Memo";case Zs:t=e._payload,e=e._init;try{return fb(e(t))}catch{}}return null}function lK(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return fb(t);case 8:return t===DS?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Ca(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function zL(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function cK(e){var t=zL(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Th(e){e._valueTracker||(e._valueTracker=cK(e))}function AL(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=zL(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function km(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function hb(e,t){var n=t.checked;return Ut({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function t2(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Ca(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function BL(e,t){t=t.checked,t!=null&&jS(e,"checked",t,!1)}function pb(e,t){BL(e,t);var n=Ca(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?mb(e,t.type,n):t.hasOwnProperty("defaultValue")&&mb(e,t.type,Ca(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function n2(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function mb(e,t,n){(t!=="number"||km(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var _d=Array.isArray;function Hc(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=Ih.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function nf(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Nd={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},uK=["Webkit","ms","Moz","O"];Object.keys(Nd).forEach(function(e){uK.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Nd[t]=Nd[e]})});function WL(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Nd.hasOwnProperty(e)&&Nd[e]?(""+t).trim():t+"px"}function UL(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=WL(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var dK=Ut({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function yb(e,t){if(t){if(dK[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ce(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ce(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ce(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ce(62))}}function _b(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var wb=null;function zS(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var bb=null,Wc=null,Uc=null;function i2(e){if(e=Wf(e)){if(typeof bb!="function")throw Error(ce(280));var t=e.stateNode;t&&(t=P0(t),bb(e.stateNode,e.type,t))}}function ZL(e){Wc?Uc?Uc.push(e):Uc=[e]:Wc=e}function GL(){if(Wc){var e=Wc,t=Uc;if(Uc=Wc=null,i2(e),t)for(e=0;e>>=0,e===0?32:31-(xK(e)/SK|0)|0}var jh=64,Dh=4194304;function wd(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Nm(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~o;a!==0?r=wd(a):(i&=s,i!==0&&(r=wd(i)))}else s=n&~o,s!==0?r=wd(s):i!==0&&(r=wd(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Vf(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ti(t),e[t]=n}function kK(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Id),p2=String.fromCharCode(32),m2=!1;function h5(e,t){switch(e){case"keyup":return tq.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function p5(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Pc=!1;function rq(e,t){switch(e){case"compositionend":return p5(t);case"keypress":return t.which!==32?null:(m2=!0,p2);case"textInput":return e=t.data,e===p2&&m2?null:e;default:return null}}function oq(e,t){if(Pc)return e==="compositionend"||!ZS&&h5(e,t)?(e=d5(),Vp=HS=ea=null,Pc=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=_2(n)}}function y5(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?y5(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function _5(){for(var e=window,t=km();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=km(e.document)}return t}function GS(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function hq(e){var t=_5(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&y5(n.ownerDocument.documentElement,n)){if(r!==null&&GS(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=w2(n,i);var s=w2(n,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Oc=null,kb=null,Dd=null,Eb=!1;function b2(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Eb||Oc==null||Oc!==km(r)||(r=Oc,"selectionStart"in r&&GS(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Dd&&cf(Dd,r)||(Dd=r,r=jm(kb,"onSelect"),0Ec||(e.current=jb[Ec],jb[Ec]=null,Ec--)}function Ct(e,t){Ec++,jb[Ec]=e.current,e.current=t}var ka={},ir=Da(ka),Fr=Da(!1),$l=ka;function ru(e,t){var n=e.type.contextTypes;if(!n)return ka;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Vr(e){return e=e.childContextTypes,e!=null}function Rm(){Dt(Fr),Dt(ir)}function E2(e,t,n){if(ir.current!==ka)throw Error(ce(168));Ct(ir,t),Ct(Fr,n)}function E5(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(ce(108,lK(e)||"Unknown",o));return Ut({},n,r)}function Lm(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ka,$l=ir.current,Ct(ir,e),Ct(Fr,Fr.current),!0}function $2(e,t,n){var r=e.stateNode;if(!r)throw Error(ce(169));n?(e=E5(e,t,$l),r.__reactInternalMemoizedMergedChildContext=e,Dt(Fr),Dt(ir),Ct(ir,e)):Dt(Fr),Ct(Fr,n)}var is=null,O0=!1,$_=!1;function $5(e){is===null?is=[e]:is.push(e)}function Oq(e){O0=!0,$5(e)}function Ra(){if(!$_&&is!==null){$_=!0;var e=0,t=yt;try{var n=is;for(yt=1;e>=s,o-=s,cs=1<<32-ti(t)+o|n<R?(B=I,I=null):B=I.sibling;var z=m(b,I,O[R],E);if(z===null){I===null&&(I=B);break}e&&I&&z.alternate===null&&t(b,I),S=i(z,S,R),N===null?$=z:N.sibling=z,N=z,I=B}if(R===O.length)return n(b,I),Lt&&tl(b,R),$;if(I===null){for(;RR?(B=I,I=null):B=I.sibling;var G=m(b,I,z.value,E);if(G===null){I===null&&(I=B);break}e&&I&&G.alternate===null&&t(b,I),S=i(G,S,R),N===null?$=G:N.sibling=G,N=G,I=B}if(z.done)return n(b,I),Lt&&tl(b,R),$;if(I===null){for(;!z.done;R++,z=O.next())z=h(b,z.value,E),z!==null&&(S=i(z,S,R),N===null?$=z:N.sibling=z,N=z);return Lt&&tl(b,R),$}for(I=r(b,I);!z.done;R++,z=O.next())z=v(I,b,R,z.value,E),z!==null&&(e&&z.alternate!==null&&I.delete(z.key===null?R:z.key),S=i(z,S,R),N===null?$=z:N.sibling=z,N=z);return e&&I.forEach(function(Q){return t(b,Q)}),Lt&&tl(b,R),$}function P(b,S,O,E){if(typeof O=="object"&&O!==null&&O.type===Sc&&O.key===null&&(O=O.props.children),typeof O=="object"&&O!==null){switch(O.$$typeof){case Nh:e:{for(var $=O.key,N=S;N!==null;){if(N.key===$){if($=O.type,$===Sc){if(N.tag===7){n(b,N.sibling),S=o(N,O.props.children),S.return=b,b=S;break e}}else if(N.elementType===$||typeof $=="object"&&$!==null&&$.$$typeof===Zs&&R2($)===N.type){n(b,N.sibling),S=o(N,O.props),S.ref=ad(b,N,O),S.return=b,b=S;break e}n(b,N);break}else t(b,N);N=N.sibling}O.type===Sc?(S=xl(O.props.children,b.mode,E,O.key),S.return=b,b=S):(E=qp(O.type,O.key,O.props,null,b.mode,E),E.ref=ad(b,S,O),E.return=b,b=E)}return s(b);case xc:e:{for(N=O.key;S!==null;){if(S.key===N)if(S.tag===4&&S.stateNode.containerInfo===O.containerInfo&&S.stateNode.implementation===O.implementation){n(b,S.sibling),S=o(S,O.children||[]),S.return=b,b=S;break e}else{n(b,S);break}else t(b,S);S=S.sibling}S=L_(O,b.mode,E),S.return=b,b=S}return s(b);case Zs:return N=O._init,P(b,S,N(O._payload),E)}if(_d(O))return y(b,S,O,E);if(nd(O))return w(b,S,O,E);Vh(b,O)}return typeof O=="string"&&O!==""||typeof O=="number"?(O=""+O,S!==null&&S.tag===6?(n(b,S.sibling),S=o(S,O),S.return=b,b=S):(n(b,S),S=R_(O,b.mode,E),S.return=b,b=S),s(b)):n(b,S)}return P}var iu=L5(!0),z5=L5(!1),Uf={},Ri=Da(Uf),hf=Da(Uf),pf=Da(Uf);function pl(e){if(e===Uf)throw Error(ce(174));return e}function nP(e,t){switch(Ct(pf,t),Ct(hf,e),Ct(Ri,Uf),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:vb(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=vb(t,e)}Dt(Ri),Ct(Ri,t)}function su(){Dt(Ri),Dt(hf),Dt(pf)}function A5(e){pl(pf.current);var t=pl(Ri.current),n=vb(t,e.type);t!==n&&(Ct(hf,e),Ct(Ri,n))}function rP(e){hf.current===e&&(Dt(Ri),Dt(hf))}var Ht=Da(0);function Hm(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var M_=[];function oP(){for(var e=0;en?n:4,e(!0);var r=N_.transition;N_.transition={};try{e(!1),t()}finally{yt=n,N_.transition=r}}function t3(){return Vo().memoizedState}function $q(e,t,n){var r=ga(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},n3(e))r3(t,n);else if(n=I5(e,t,n,r),n!==null){var o=_r();ni(n,e,r,o),o3(n,t,r)}}function Mq(e,t,n){var r=ga(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(n3(e))r3(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,a=i(s,n);if(o.hasEagerState=!0,o.eagerState=a,oi(a,s)){var c=t.interleaved;c===null?(o.next=o,eP(t)):(o.next=c.next,c.next=o),t.interleaved=o;return}}catch{}finally{}n=I5(e,t,o,r),n!==null&&(o=_r(),ni(n,e,r,o),o3(n,t,r))}}function n3(e){var t=e.alternate;return e===Wt||t!==null&&t===Wt}function r3(e,t){Rd=Wm=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function o3(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,BS(e,n)}}var Um={readContext:Fo,useCallback:Jn,useContext:Jn,useEffect:Jn,useImperativeHandle:Jn,useInsertionEffect:Jn,useLayoutEffect:Jn,useMemo:Jn,useReducer:Jn,useRef:Jn,useState:Jn,useDebugValue:Jn,useDeferredValue:Jn,useTransition:Jn,useMutableSource:Jn,useSyncExternalStore:Jn,useId:Jn,unstable_isNewReconciler:!1},Nq={readContext:Fo,useCallback:function(e,t){return _i().memoizedState=[e,t===void 0?null:t],e},useContext:Fo,useEffect:z2,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Zp(4194308,4,q5.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Zp(4194308,4,e,t)},useInsertionEffect:function(e,t){return Zp(4,2,e,t)},useMemo:function(e,t){var n=_i();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=_i();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=$q.bind(null,Wt,e),[r.memoizedState,e]},useRef:function(e){var t=_i();return e={current:e},t.memoizedState=e},useState:L2,useDebugValue:cP,useDeferredValue:function(e){return _i().memoizedState=e},useTransition:function(){var e=L2(!1),t=e[0];return e=Eq.bind(null,e[1]),_i().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Wt,o=_i();if(Lt){if(n===void 0)throw Error(ce(407));n=n()}else{if(n=t(),kn===null)throw Error(ce(349));Nl&30||V5(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,z2(W5.bind(null,r,i,e),[e]),r.flags|=2048,vf(9,H5.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=_i(),t=kn.identifierPrefix;if(Lt){var n=us,r=cs;n=(r&~(1<<32-ti(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=mf++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Ei]=t,e[ff]=r,h3(e,t,!1,!1),t.stateNode=e;e:{switch(s=_b(n,r),n){case"dialog":Nt("cancel",e),Nt("close",e),o=r;break;case"iframe":case"object":case"embed":Nt("load",e),o=r;break;case"video":case"audio":for(o=0;olu&&(t.flags|=128,r=!0,ld(i,!1),t.lanes=4194304)}else{if(!r)if(e=Hm(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ld(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!Rt)return Qn(t),null}else 2*Xt()-i.renderingStartTime>lu&&n!==1073741824&&(t.flags|=128,r=!0,ld(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Xt(),t.sibling=null,n=Ht.current,Ct(Ht,r?n&1|2:n&1),t):(Qn(t),null);case 22:case 23:return mP(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ao&1073741824&&(Qn(t),t.subtreeFlags&6&&(t.flags|=8192)):Qn(t),null;case 24:return null;case 25:return null}throw Error(ce(156,t.tag))}function Aq(e,t){switch(KS(t),t.tag){case 1:return Vr(t.type)&&Lm(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return su(),jt(Fr),jt(ir),oP(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return rP(t),null;case 13:if(jt(Ht),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ce(340));ou()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return jt(Ht),null;case 4:return su(),null;case 10:return XS(t.type._context),null;case 22:case 23:return mP(),null;case 24:return null;default:return null}}var Wh=!1,nr=!1,Bq=typeof WeakSet=="function"?WeakSet:Set,xe=null;function Tc(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Yt(e,t,r)}else n.current=null}function Zb(e,t,n){try{n()}catch(r){Yt(e,t,r)}}var G2=!1;function Fq(e,t){if($b=Tm,e=_R(),GS(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,a=-1,c=-1,u=0,f=0,h=e,m=null;t:for(;;){for(var v;h!==n||o!==0&&h.nodeType!==3||(a=s+o),h!==i||r!==0&&h.nodeType!==3||(c=s+r),h.nodeType===3&&(s+=h.nodeValue.length),(v=h.firstChild)!==null;)m=h,h=v;for(;;){if(h===e)break t;if(m===n&&++u===o&&(a=s),m===i&&++f===r&&(c=s),(v=h.nextSibling)!==null)break;h=m,m=h.parentNode}h=v}n=a===-1||c===-1?null:{start:a,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Mb={focusedElem:e,selectionRange:n},Tm=!1,xe=t;xe!==null;)if(t=xe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,xe=e;else for(;xe!==null;){t=xe;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var w=y.memoizedProps,P=y.memoizedState,b=t.stateNode,S=b.getSnapshotBeforeUpdate(t.elementType===t.type?w:Ko(t.type,w),P);b.__reactInternalSnapshotBeforeUpdate=S}break;case 3:var O=t.stateNode.containerInfo;O.nodeType===1?O.textContent="":O.nodeType===9&&O.documentElement&&O.removeChild(O.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ce(163))}}catch(E){Yt(t,t.return,E)}if(e=t.sibling,e!==null){e.return=t.return,xe=e;break}xe=t.return}return y=G2,G2=!1,y}function Rd(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&Zb(t,n,i)}o=o.next}while(o!==r)}}function E0(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Gb(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function g3(e){var t=e.alternate;t!==null&&(e.alternate=null,g3(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ei],delete t[ff],delete t[Ib],delete t[Sq],delete t[Pq])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function v3(e){return e.tag===5||e.tag===3||e.tag===4}function Y2(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||v3(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Yb(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=jm));else if(r!==4&&(e=e.child,e!==null))for(Yb(e,t,n),e=e.sibling;e!==null;)Yb(e,t,n),e=e.sibling}function Kb(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Kb(e,t,n),e=e.sibling;e!==null;)Kb(e,t,n),e=e.sibling}var jn=null,qo=!1;function js(e,t,n){for(n=n.child;n!==null;)y3(e,t,n),n=n.sibling}function y3(e,t,n){if(ji&&typeof ji.onCommitFiberUnmount=="function")try{ji.onCommitFiberUnmount(w0,n)}catch{}switch(n.tag){case 5:nr||Tc(n,t);case 6:var r=jn,o=qo;jn=null,js(e,t,n),jn=r,qo=o,jn!==null&&(qo?(e=jn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):jn.removeChild(n.stateNode));break;case 18:jn!==null&&(qo?(e=jn,n=n.stateNode,e.nodeType===8?E_(e.parentNode,n):e.nodeType===1&&E_(e,n),af(e)):E_(jn,n.stateNode));break;case 4:r=jn,o=qo,jn=n.stateNode.containerInfo,qo=!0,js(e,t,n),jn=r,qo=o;break;case 0:case 11:case 14:case 15:if(!nr&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&Zb(n,t,s),o=o.next}while(o!==r)}js(e,t,n);break;case 1:if(!nr&&(Tc(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Yt(n,t,a)}js(e,t,n);break;case 21:js(e,t,n);break;case 22:n.mode&1?(nr=(r=nr)||n.memoizedState!==null,js(e,t,n),nr=r):js(e,t,n);break;default:js(e,t,n)}}function K2(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Bq),t.forEach(function(r){var o=qq.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function Go(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=s),r&=~i}if(r=o,r=Xt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Hq(r/1960))-r,10e?16:e,ta===null)var r=!1;else{if(e=ta,ta=null,Ym=0,ot&6)throw Error(ce(331));var o=ot;for(ot|=4,xe=e.current;xe!==null;){var i=xe,s=i.child;if(xe.flags&16){var a=i.deletions;if(a!==null){for(var c=0;cXt()-hP?bl(e,0):fP|=n),Hr(e,t)}function C3(e,t){t===0&&(e.mode&1?(t=jh,jh<<=1,!(jh&130023424)&&(jh=4194304)):t=1);var n=_r();e=vs(e,t),e!==null&&(Vf(e,t,n),Hr(e,n))}function Kq(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),C3(e,n)}function qq(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(ce(314))}r!==null&&r.delete(t),C3(e,n)}var k3;k3=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Fr.current)Ar=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ar=!1,Rq(e,t,n);Ar=!!(e.flags&131072)}else Ar=!1,Rt&&t.flags&1048576&&MR(t,Am,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Gp(e,t),e=t.pendingProps;var o=ru(t,ir.current);Gc(t,n),o=sP(null,t,r,e,o,n);var i=aP();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Vr(r)?(i=!0,Rm(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,tP(t),o.updater=C0,t.stateNode=o,o._reactInternals=t,Ab(t,r,e,n),t=Vb(null,t,r,!0,i,n)):(t.tag=0,Rt&&i&&YS(t),mr(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Gp(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=Qq(r),e=Ko(r,e),o){case 0:t=Fb(null,t,r,e,n);break e;case 1:t=W2(null,t,r,e,n);break e;case 11:t=V2(null,t,r,e,n);break e;case 14:t=H2(null,t,r,Ko(r.type,e),n);break e}throw Error(ce(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Ko(r,o),Fb(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Ko(r,o),W2(e,t,r,o,n);case 3:e:{if(u3(t),e===null)throw Error(ce(387));r=t.pendingProps,i=t.memoizedState,o=i.element,DR(e,t),Vm(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=au(Error(ce(423)),t),t=U2(e,t,r,n,o);break e}else if(r!==o){o=au(Error(ce(424)),t),t=U2(e,t,r,n,o);break e}else for(po=ha(t.stateNode.containerInfo.firstChild),go=t,Rt=!0,Jo=null,n=zR(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ou(),r===o){t=ys(e,t,n);break e}mr(e,t,r,n)}t=t.child}return t;case 5:return AR(t),e===null&&Lb(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,Nb(r,o)?s=null:i!==null&&Nb(r,i)&&(t.flags|=32),c3(e,t),mr(e,t,s,n),t.child;case 6:return e===null&&Lb(t),null;case 13:return d3(e,t,n);case 4:return nP(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=iu(t,null,r,n):mr(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Ko(r,o),V2(e,t,r,o,n);case 7:return mr(e,t,t.pendingProps,n),t.child;case 8:return mr(e,t,t.pendingProps.children,n),t.child;case 12:return mr(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,Ct(Bm,r._currentValue),r._currentValue=s,i!==null)if(oi(i.value,s)){if(i.children===o.children&&!Fr.current){t=ys(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){s=i.child;for(var c=a.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=fs(-1,n&-n),c.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var f=u.pending;f===null?c.next=c:(c.next=f.next,f.next=c),u.pending=c}}i.lanes|=n,c=i.alternate,c!==null&&(c.lanes|=n),Rb(i.return,n,t),a.lanes|=n;break}c=c.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(ce(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Rb(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}mr(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Gc(t,n),o=Fo(o),r=r(o),t.flags|=1,mr(e,t,r,n),t.child;case 14:return r=t.type,o=Ko(r,t.pendingProps),o=Ko(r.type,o),H2(e,t,r,o,n);case 15:return a3(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Ko(r,o),Gp(e,t),t.tag=1,Vr(r)?(e=!0,Rm(t)):e=!1,Gc(t,n),LR(t,r,o),Ab(t,r,o,n),Vb(null,t,r,!0,e,n);case 19:return f3(e,t,n);case 22:return l3(e,t,n)}throw Error(ce(156,t.tag))};function E3(e,t){return eR(e,t)}function Jq(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function jo(e,t,n,r){return new Jq(e,t,n,r)}function vP(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Qq(e){if(typeof e=="function")return vP(e)?1:0;if(e!=null){if(e=e.$$typeof,e===LS)return 11;if(e===RS)return 14}return 2}function va(e,t){var n=e.alternate;return n===null?(n=jo(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function qp(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")vP(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Sc:return xl(n.children,o,i,t);case jS:s=8,o|=8;break;case cb:return e=jo(12,n,t,o|2),e.elementType=cb,e.lanes=i,e;case ub:return e=jo(13,n,t,o),e.elementType=ub,e.lanes=i,e;case db:return e=jo(19,n,t,o),e.elementType=db,e.lanes=i,e;case R5:return M0(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case j5:s=10;break e;case L5:s=9;break e;case LS:s=11;break e;case RS:s=14;break e;case Zs:s=16,r=null;break e}throw Error(ce(130,e==null?e:typeof e,""))}return t=jo(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function xl(e,t,n,r){return e=jo(7,e,r,t),e.lanes=n,e}function M0(e,t,n,r){return e=jo(22,e,r,t),e.elementType=R5,e.lanes=n,e.stateNode={isHidden:!1},e}function L_(e,t,n){return e=jo(6,e,null,t),e.lanes=n,e}function R_(e,t,n){return t=jo(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Xq(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=v_(0),this.expirationTimes=v_(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=v_(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function yP(e,t,n,r,o,i,s,a,c){return e=new Xq(e,t,n,a,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=jo(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},tP(i),e}function eJ(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(T3)}catch(e){console.error(e)}}T3(),M5.exports=xo;var Cs=M5.exports;const iJ=Ta(Cs);var sJ=Object.defineProperty,Jm=Object.getOwnPropertySymbols,I3=Object.prototype.hasOwnProperty,D3=Object.prototype.propertyIsEnumerable,rE=(e,t,n)=>t in e?sJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,oE=(e,t)=>{for(var n in t||(t={}))I3.call(t,n)&&rE(e,n,t[n]);if(Jm)for(var n of Jm(t))D3.call(t,n)&&rE(e,n,t[n]);return e},aJ=(e,t)=>{var n={};for(var r in e)I3.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Jm)for(var r of Jm(e))t.indexOf(r)<0&&D3.call(e,r)&&(n[r]=e[r]);return n};function lJ(e){const t=e,{style:n}=t,r=aJ(t,["style"]);return k.createElement("svg",oE({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:oE({width:M(16),height:M(16)},n)},r),k.createElement("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}var cJ=Object.defineProperty,uJ=Object.defineProperties,dJ=Object.getOwnPropertyDescriptors,iE=Object.getOwnPropertySymbols,fJ=Object.prototype.hasOwnProperty,hJ=Object.prototype.propertyIsEnumerable,sE=(e,t,n)=>t in e?cJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ex=(e,t)=>{for(var n in t||(t={}))fJ.call(t,n)&&sE(e,n,t[n]);if(iE)for(var n of iE(t))hJ.call(t,n)&&sE(e,n,t[n]);return e},aE=(e,t)=>uJ(e,dJ(t));const pJ=["subtle","filled","outline","light","default","transparent","gradient"],Gh={xs:M(18),sm:M(22),md:M(28),lg:M(34),xl:M(44)};function mJ({variant:e,theme:t,color:n,gradient:r}){const o=t.fn.variant({color:n,variant:e,gradient:r});return e==="gradient"?{border:0,backgroundImage:o.background,color:o.color,"&:hover":t.fn.hover({backgroundSize:"200%"})}:pJ.includes(e)?ex({border:`${M(1)} solid ${o.border}`,backgroundColor:o.background,color:o.color},t.fn.hover({backgroundColor:o.hover})):null}var gJ=ue((e,{radius:t,color:n,gradient:r},{variant:o,size:i})=>({root:aE(ex({position:"relative",borderRadius:e.fn.radius(t),padding:0,lineHeight:1,display:"flex",alignItems:"center",justifyContent:"center",height:re({size:i,sizes:Gh}),minHeight:re({size:i,sizes:Gh}),width:re({size:i,sizes:Gh}),minWidth:re({size:i,sizes:Gh})},mJ({variant:o,theme:e,color:n,gradient:r})),{"&:active":e.activeStyles,"& [data-action-icon-loader]":{maxWidth:"70%"},"&:disabled, &[data-disabled]":{color:e.colors.gray[e.colorScheme==="dark"?6:4],cursor:"not-allowed",backgroundColor:o==="transparent"?void 0:e.fn.themeColor("gray",e.colorScheme==="dark"?8:1),borderColor:o==="transparent"?void 0:e.fn.themeColor("gray",e.colorScheme==="dark"?8:1),backgroundImage:"none",pointerEvents:"none","&:active":{transform:"none"}},"&[data-loading]":{pointerEvents:"none","&::before":aE(ex({content:'""'},e.fn.cover(M(-1))),{backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.colors.dark[7],.5):"rgba(255, 255, 255, .5)",borderRadius:e.fn.radius(t),cursor:"not-allowed"})}})}));const vJ=gJ;var yJ=Object.defineProperty,Qm=Object.getOwnPropertySymbols,j3=Object.prototype.hasOwnProperty,L3=Object.prototype.propertyIsEnumerable,lE=(e,t,n)=>t in e?yJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,cE=(e,t)=>{for(var n in t||(t={}))j3.call(t,n)&&lE(e,n,t[n]);if(Qm)for(var n of Qm(t))L3.call(t,n)&&lE(e,n,t[n]);return e},uE=(e,t)=>{var n={};for(var r in e)j3.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Qm)for(var r of Qm(e))t.indexOf(r)<0&&L3.call(e,r)&&(n[r]=e[r]);return n};function _J(e){var t=e,{size:n,color:r}=t,o=uE(t,["size","color"]);const i=o,{style:s}=i,a=uE(i,["style"]);return k.createElement("svg",cE({viewBox:"0 0 135 140",xmlns:"http://www.w3.org/2000/svg",fill:r,style:cE({width:n},s)},a),k.createElement("rect",{y:"10",width:"15",height:"120",rx:"6"},k.createElement("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),k.createElement("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),k.createElement("rect",{x:"30",y:"10",width:"15",height:"120",rx:"6"},k.createElement("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),k.createElement("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),k.createElement("rect",{x:"60",width:"15",height:"140",rx:"6"},k.createElement("animate",{attributeName:"height",begin:"0s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),k.createElement("animate",{attributeName:"y",begin:"0s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),k.createElement("rect",{x:"90",y:"10",width:"15",height:"120",rx:"6"},k.createElement("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),k.createElement("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),k.createElement("rect",{x:"120",y:"10",width:"15",height:"120",rx:"6"},k.createElement("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),k.createElement("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})))}var wJ=Object.defineProperty,Xm=Object.getOwnPropertySymbols,R3=Object.prototype.hasOwnProperty,z3=Object.prototype.propertyIsEnumerable,dE=(e,t,n)=>t in e?wJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fE=(e,t)=>{for(var n in t||(t={}))R3.call(t,n)&&dE(e,n,t[n]);if(Xm)for(var n of Xm(t))z3.call(t,n)&&dE(e,n,t[n]);return e},hE=(e,t)=>{var n={};for(var r in e)R3.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Xm)for(var r of Xm(e))t.indexOf(r)<0&&z3.call(e,r)&&(n[r]=e[r]);return n};function bJ(e){var t=e,{size:n,color:r}=t,o=hE(t,["size","color"]);const i=o,{style:s}=i,a=hE(i,["style"]);return k.createElement("svg",fE({viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",stroke:r,style:fE({width:n,height:n},s)},a),k.createElement("g",{fill:"none",fillRule:"evenodd"},k.createElement("g",{transform:"translate(2.5 2.5)",strokeWidth:"5"},k.createElement("circle",{strokeOpacity:".5",cx:"16",cy:"16",r:"16"}),k.createElement("path",{d:"M32 16c0-9.94-8.06-16-16-16"},k.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 16 16",to:"360 16 16",dur:"1s",repeatCount:"indefinite"})))))}var xJ=Object.defineProperty,eg=Object.getOwnPropertySymbols,A3=Object.prototype.hasOwnProperty,B3=Object.prototype.propertyIsEnumerable,pE=(e,t,n)=>t in e?xJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mE=(e,t)=>{for(var n in t||(t={}))A3.call(t,n)&&pE(e,n,t[n]);if(eg)for(var n of eg(t))B3.call(t,n)&&pE(e,n,t[n]);return e},gE=(e,t)=>{var n={};for(var r in e)A3.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&eg)for(var r of eg(e))t.indexOf(r)<0&&B3.call(e,r)&&(n[r]=e[r]);return n};function SJ(e){var t=e,{size:n,color:r}=t,o=gE(t,["size","color"]);const i=o,{style:s}=i,a=gE(i,["style"]);return k.createElement("svg",mE({viewBox:"0 0 120 30",xmlns:"http://www.w3.org/2000/svg",fill:r,style:mE({width:n},s)},a),k.createElement("circle",{cx:"15",cy:"15",r:"15"},k.createElement("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),k.createElement("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})),k.createElement("circle",{cx:"60",cy:"15",r:"9",fillOpacity:"0.3"},k.createElement("animate",{attributeName:"r",from:"9",to:"9",begin:"0s",dur:"0.8s",values:"9;15;9",calcMode:"linear",repeatCount:"indefinite"}),k.createElement("animate",{attributeName:"fill-opacity",from:"0.5",to:"0.5",begin:"0s",dur:"0.8s",values:".5;1;.5",calcMode:"linear",repeatCount:"indefinite"})),k.createElement("circle",{cx:"105",cy:"15",r:"15"},k.createElement("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),k.createElement("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})))}var PJ=Object.defineProperty,tg=Object.getOwnPropertySymbols,F3=Object.prototype.hasOwnProperty,V3=Object.prototype.propertyIsEnumerable,vE=(e,t,n)=>t in e?PJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,OJ=(e,t)=>{for(var n in t||(t={}))F3.call(t,n)&&vE(e,n,t[n]);if(tg)for(var n of tg(t))V3.call(t,n)&&vE(e,n,t[n]);return e},CJ=(e,t)=>{var n={};for(var r in e)F3.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&tg)for(var r of tg(e))t.indexOf(r)<0&&V3.call(e,r)&&(n[r]=e[r]);return n};const z_={bars:_J,oval:bJ,dots:SJ},kJ={xs:M(18),sm:M(22),md:M(36),lg:M(44),xl:M(58)},EJ={size:"md"};function en(e){const t=ae("Loader",EJ,e),{size:n,color:r,variant:o}=t,i=CJ(t,["size","color","variant"]),s=ar(),a=o in z_?o:s.loader;return k.createElement(Pe,OJ({role:"presentation",component:z_[a]||z_.bars,size:re({size:n,sizes:kJ}),color:s.fn.variant({variant:"filled",primaryFallback:!1,color:r||s.primaryColor}).background},i))}en.displayName="@mantine/core/Loader";var $J=Object.defineProperty,ng=Object.getOwnPropertySymbols,H3=Object.prototype.hasOwnProperty,W3=Object.prototype.propertyIsEnumerable,yE=(e,t,n)=>t in e?$J(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_E=(e,t)=>{for(var n in t||(t={}))H3.call(t,n)&&yE(e,n,t[n]);if(ng)for(var n of ng(t))W3.call(t,n)&&yE(e,n,t[n]);return e},MJ=(e,t)=>{var n={};for(var r in e)H3.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ng)for(var r of ng(e))t.indexOf(r)<0&&W3.call(e,r)&&(n[r]=e[r]);return n};const NJ={color:"gray",size:"md",variant:"subtle"},U3=_.forwardRef((e,t)=>{const n=ae("ActionIcon",NJ,e),{className:r,color:o,children:i,radius:s,size:a,variant:c,gradient:u,disabled:f,loaderProps:h,loading:m,unstyled:v,__staticSelector:y}=n,w=MJ(n,["className","color","children","radius","size","variant","gradient","disabled","loaderProps","loading","unstyled","__staticSelector"]),{classes:P,cx:b,theme:S}=vJ({radius:s,color:o,gradient:u},{name:["ActionIcon",y],unstyled:v,size:a,variant:c}),O=k.createElement(en,_E({color:S.fn.variant({color:o,variant:c}).color,size:"100%","data-action-icon-loader":!0},h));return k.createElement(ds,_E({className:b(P.root,r),ref:t,disabled:f,"data-disabled":f||void 0,"data-loading":m||void 0,unstyled:v},w),m?O:i)});U3.displayName="@mantine/core/ActionIcon";const Xe=U3;var TJ=Object.defineProperty,IJ=Object.defineProperties,DJ=Object.getOwnPropertyDescriptors,rg=Object.getOwnPropertySymbols,Z3=Object.prototype.hasOwnProperty,G3=Object.prototype.propertyIsEnumerable,wE=(e,t,n)=>t in e?TJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,jJ=(e,t)=>{for(var n in t||(t={}))Z3.call(t,n)&&wE(e,n,t[n]);if(rg)for(var n of rg(t))G3.call(t,n)&&wE(e,n,t[n]);return e},LJ=(e,t)=>IJ(e,DJ(t)),RJ=(e,t)=>{var n={};for(var r in e)Z3.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&rg)for(var r of rg(e))t.indexOf(r)<0&&G3.call(e,r)&&(n[r]=e[r]);return n};function Y3(e){const t=ae("Portal",{},e),{children:n,target:r,className:o,innerRef:i}=t,s=RJ(t,["children","target","className","innerRef"]),a=ar(),[c,u]=_.useState(!1),f=_.useRef();return $S(()=>(u(!0),f.current=r?typeof r=="string"?document.querySelector(r):r:document.createElement("div"),r||document.body.appendChild(f.current),()=>{!r&&document.body.removeChild(f.current)}),[r]),c?Cs.createPortal(k.createElement("div",LJ(jJ({className:o,dir:a.dir},s),{ref:i}),n),f.current):null}Y3.displayName="@mantine/core/Portal";var zJ=Object.defineProperty,og=Object.getOwnPropertySymbols,K3=Object.prototype.hasOwnProperty,q3=Object.prototype.propertyIsEnumerable,bE=(e,t,n)=>t in e?zJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,AJ=(e,t)=>{for(var n in t||(t={}))K3.call(t,n)&&bE(e,n,t[n]);if(og)for(var n of og(t))q3.call(t,n)&&bE(e,n,t[n]);return e},BJ=(e,t)=>{var n={};for(var r in e)K3.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&og)for(var r of og(e))t.indexOf(r)<0&&q3.call(e,r)&&(n[r]=e[r]);return n};function Zf(e){var t=e,{withinPortal:n=!0,children:r}=t,o=BJ(t,["withinPortal","children"]);return n?k.createElement(Y3,AJ({},o),r):k.createElement(k.Fragment,null,r)}Zf.displayName="@mantine/core/OptionalPortal";var FJ=Object.defineProperty,ig=Object.getOwnPropertySymbols,J3=Object.prototype.hasOwnProperty,Q3=Object.prototype.propertyIsEnumerable,xE=(e,t,n)=>t in e?FJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,SE=(e,t)=>{for(var n in t||(t={}))J3.call(t,n)&&xE(e,n,t[n]);if(ig)for(var n of ig(t))Q3.call(t,n)&&xE(e,n,t[n]);return e},VJ=(e,t)=>{var n={};for(var r in e)J3.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ig)for(var r of ig(e))t.indexOf(r)<0&&Q3.call(e,r)&&(n[r]=e[r]);return n};function X3(e){const t=e,{width:n,height:r,style:o}=t,i=VJ(t,["width","height","style"]);return k.createElement("svg",SE({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:SE({width:n,height:r},o)},i),k.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}X3.displayName="@mantine/core/CloseIcon";var HJ=Object.defineProperty,sg=Object.getOwnPropertySymbols,ez=Object.prototype.hasOwnProperty,tz=Object.prototype.propertyIsEnumerable,PE=(e,t,n)=>t in e?HJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,WJ=(e,t)=>{for(var n in t||(t={}))ez.call(t,n)&&PE(e,n,t[n]);if(sg)for(var n of sg(t))tz.call(t,n)&&PE(e,n,t[n]);return e},UJ=(e,t)=>{var n={};for(var r in e)ez.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&sg)for(var r of sg(e))t.indexOf(r)<0&&tz.call(e,r)&&(n[r]=e[r]);return n};const ZJ={xs:M(12),sm:M(16),md:M(20),lg:M(28),xl:M(34)},GJ={size:"sm"},nz=_.forwardRef((e,t)=>{const n=ae("CloseButton",GJ,e),{iconSize:r,size:o,children:i}=n,s=UJ(n,["iconSize","size","children"]),a=M(r||ZJ[o]);return k.createElement(Xe,WJ({ref:t,__staticSelector:"CloseButton",size:o},s),i||k.createElement(X3,{width:a,height:a}))});nz.displayName="@mantine/core/CloseButton";const j0=nz;var YJ=Object.defineProperty,KJ=Object.defineProperties,qJ=Object.getOwnPropertyDescriptors,OE=Object.getOwnPropertySymbols,JJ=Object.prototype.hasOwnProperty,QJ=Object.prototype.propertyIsEnumerable,CE=(e,t,n)=>t in e?YJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Yh=(e,t)=>{for(var n in t||(t={}))JJ.call(t,n)&&CE(e,n,t[n]);if(OE)for(var n of OE(t))QJ.call(t,n)&&CE(e,n,t[n]);return e},XJ=(e,t)=>KJ(e,qJ(t));function eQ({underline:e,strikethrough:t}){const n=[];return e&&n.push("underline"),t&&n.push("line-through"),n.length>0?n.join(" "):"none"}function tQ({theme:e,color:t}){return t==="dimmed"?e.fn.dimmed():typeof t=="string"&&(t in e.colors||t.split(".")[0]in e.colors)?e.fn.variant({variant:"filled",color:t}).background:t||"inherit"}function nQ(e){return typeof e=="number"?{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:e,WebkitBoxOrient:"vertical"}:null}function rQ({theme:e,truncate:t}){return t==="start"?{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",direction:e.dir==="ltr"?"rtl":"ltr",textAlign:e.dir==="ltr"?"right":"left"}:t?{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}:null}var oQ=ue((e,{color:t,lineClamp:n,truncate:r,inline:o,inherit:i,underline:s,gradient:a,weight:c,transform:u,align:f,strikethrough:h,italic:m},{size:v})=>{const y=e.fn.variant({variant:"gradient",gradient:a});return{root:XJ(Yh(Yh(Yh(Yh({},e.fn.fontStyles()),e.fn.focusStyles()),nQ(n)),rQ({theme:e,truncate:r})),{color:tQ({color:t,theme:e}),fontFamily:i?"inherit":e.fontFamily,fontSize:i||v===void 0?"inherit":re({size:v,sizes:e.fontSizes}),lineHeight:i?"inherit":o?1:e.lineHeight,textDecoration:eQ({underline:s,strikethrough:h}),WebkitTapHighlightColor:"transparent",fontWeight:i?"inherit":c,textTransform:u,textAlign:f,fontStyle:m?"italic":void 0}),gradient:{backgroundImage:y.background,WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"}}});const iQ=oQ;var sQ=Object.defineProperty,ag=Object.getOwnPropertySymbols,rz=Object.prototype.hasOwnProperty,oz=Object.prototype.propertyIsEnumerable,kE=(e,t,n)=>t in e?sQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,aQ=(e,t)=>{for(var n in t||(t={}))rz.call(t,n)&&kE(e,n,t[n]);if(ag)for(var n of ag(t))oz.call(t,n)&&kE(e,n,t[n]);return e},lQ=(e,t)=>{var n={};for(var r in e)rz.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ag)for(var r of ag(e))t.indexOf(r)<0&&oz.call(e,r)&&(n[r]=e[r]);return n};const cQ={variant:"text"},iz=_.forwardRef((e,t)=>{const n=ae("Text",cQ,e),{className:r,size:o,weight:i,transform:s,color:a,align:c,variant:u,lineClamp:f,truncate:h,gradient:m,inline:v,inherit:y,underline:w,strikethrough:P,italic:b,classNames:S,styles:O,unstyled:E,span:$,__staticSelector:N}=n,I=lQ(n,["className","size","weight","transform","color","align","variant","lineClamp","truncate","gradient","inline","inherit","underline","strikethrough","italic","classNames","styles","unstyled","span","__staticSelector"]),{classes:R,cx:B}=iQ({color:a,lineClamp:f,truncate:h,inline:v,inherit:y,underline:w,strikethrough:P,italic:b,weight:i,transform:s,align:c,gradient:m},{unstyled:E,name:N||"Text",variant:u,size:o});return k.createElement(Pe,aQ({ref:t,className:B(R.root,{[R.gradient]:u==="gradient"},r),component:$?"span":"div"},I))});iz.displayName="@mantine/core/Text";const U=iz,sz=_.createContext({zIndex:1e3,fixed:!1,layout:"default"});sz.Provider;function uQ(){return _.useContext(sz)}function az(e,t){if(!e)return[];const n=Object.keys(e).filter(r=>r!=="base").map(r=>[re({size:r,sizes:t.breakpoints,units:"em"}),e[r]]);return n.sort((r,o)=>Bo(r[0])-Bo(o[0])),n}var dQ=Object.defineProperty,fQ=Object.defineProperties,hQ=Object.getOwnPropertyDescriptors,EE=Object.getOwnPropertySymbols,pQ=Object.prototype.hasOwnProperty,mQ=Object.prototype.propertyIsEnumerable,$E=(e,t,n)=>t in e?dQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Kh=(e,t)=>{for(var n in t||(t={}))pQ.call(t,n)&&$E(e,n,t[n]);if(EE)for(var n of EE(t))mQ.call(t,n)&&$E(e,n,t[n]);return e},ME=(e,t)=>fQ(e,hQ(t)),gQ=ue((e,{height:t,width:n,fixed:r,position:o,hiddenBreakpoint:i,zIndex:s,section:a,withBorder:c,layout:u})=>{const f=typeof n=="object"&&n!==null?az(n,e).reduce((m,[v,y])=>(m[`@media (min-width: ${Oa(v)})`]={width:M(y),minWidth:M(y)},m),{}):null,h=c?{[a==="navbar"?"borderRight":"borderLeft"]:`${M(1)} solid ${e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[2]}`}:{};return{root:ME(Kh(Kh(ME(Kh(Kh({},e.fn.fontStyles()),o),{top:u==="alt"?0:o?.top||"var(--mantine-header-height)",bottom:0,zIndex:s,height:t?M(t):u==="alt"?"auto":"calc(100vh - var(--mantine-header-height, 0rem) - var(--mantine-footer-height, 0rem))",width:n?.base?M(n?.base):"100%",position:r?"fixed":"static",boxSizing:"border-box",display:"flex",flexDirection:"column",backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white}),h),f),{"&[data-hidden]":{[`@media (max-width: ${Oa(Bo(re({size:i,sizes:e.breakpoints}))-1)})`]:{display:"none"}}})}});const vQ=gQ;var yQ=Object.defineProperty,lg=Object.getOwnPropertySymbols,lz=Object.prototype.hasOwnProperty,cz=Object.prototype.propertyIsEnumerable,NE=(e,t,n)=>t in e?yQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,TE=(e,t)=>{for(var n in t||(t={}))lz.call(t,n)&&NE(e,n,t[n]);if(lg)for(var n of lg(t))cz.call(t,n)&&NE(e,n,t[n]);return e},_Q=(e,t)=>{var n={};for(var r in e)lz.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&lg)for(var r of lg(e))t.indexOf(r)<0&&cz.call(e,r)&&(n[r]=e[r]);return n};const uz=_.forwardRef((e,t)=>{var n=e,{width:r,height:o,fixed:i=!1,position:s,zIndex:a,hiddenBreakpoint:c="md",hidden:u=!1,withBorder:f=!0,className:h,classNames:m,styles:v,children:y,section:w,__staticSelector:P,unstyled:b,variant:S}=n,O=_Q(n,["width","height","fixed","position","zIndex","hiddenBreakpoint","hidden","withBorder","className","classNames","styles","children","section","__staticSelector","unstyled","variant"]);const E=uQ(),{classes:$,cx:N,theme:I}=vQ({width:r,height:o,fixed:E.fixed||i,position:s,hiddenBreakpoint:c,zIndex:a||E.zIndex||ci("app"),section:w,withBorder:f,layout:E.layout},{classNames:m,styles:v,name:P,unstyled:b,variant:S}),R=az(r,I).reduce((B,[z,G])=>(B[`@media (min-width: ${Oa(z)})`]={[`--mantine-${w}-width`]:M(G)},B),{});return k.createElement(Pe,TE({component:w==="navbar"?"nav":"aside",ref:t,"data-hidden":u||void 0,className:N($.root,h)},O),y,k.createElement(qG,{styles:()=>({":root":TE({[`--mantine-${w}-width`]:r?.base?M(r.base):"0rem"},R)})}))});uz.displayName="@mantine/core/HorizontalSection";var wQ=Object.defineProperty,cg=Object.getOwnPropertySymbols,dz=Object.prototype.hasOwnProperty,fz=Object.prototype.propertyIsEnumerable,IE=(e,t,n)=>t in e?wQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,bQ=(e,t)=>{for(var n in t||(t={}))dz.call(t,n)&&IE(e,n,t[n]);if(cg)for(var n of cg(t))fz.call(t,n)&&IE(e,n,t[n]);return e},xQ=(e,t)=>{var n={};for(var r in e)dz.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&cg)for(var r of cg(e))t.indexOf(r)<0&&fz.call(e,r)&&(n[r]=e[r]);return n};const hz=_.forwardRef((e,t)=>{var n=e,{children:r,grow:o=!1,sx:i}=n,s=xQ(n,["children","grow","sx"]);return k.createElement(Pe,bQ({ref:t,sx:[{flex:o?1:0,boxSizing:"border-box"},...yS(i)]},s),r)});hz.displayName="@mantine/core/Section";const SQ=hz;var PQ=Object.defineProperty,DE=Object.getOwnPropertySymbols,OQ=Object.prototype.hasOwnProperty,CQ=Object.prototype.propertyIsEnumerable,jE=(e,t,n)=>t in e?PQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,kQ=(e,t)=>{for(var n in t||(t={}))OQ.call(t,n)&&jE(e,n,t[n]);if(DE)for(var n of DE(t))CQ.call(t,n)&&jE(e,n,t[n]);return e};const EQ={fixed:!1,position:{top:0,left:0},hiddenBreakpoint:"md",hidden:!1},ug=_.forwardRef((e,t)=>{const n=ae("Navbar",EQ,e);return k.createElement(uz,kQ({section:"navbar",__staticSelector:"Navbar",ref:t},n))});ug.Section=SQ;ug.displayName="@mantine/core/Navbar";const qh={xs:M(1),sm:M(2),md:M(3),lg:M(4),xl:M(5)};function Jh(e,t){const n=e.fn.variant({variant:"outline",color:t}).border;return typeof t=="string"&&(t in e.colors||t.split(".")[0]in e.colors)?n:t===void 0?e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]:t}var $Q=ue((e,{color:t},{size:n,variant:r})=>({root:{},withLabel:{borderTop:"0 !important"},left:{"&::before":{display:"none"}},right:{"&::after":{display:"none"}},label:{display:"flex",alignItems:"center","&::before":{content:'""',flex:1,height:M(1),borderTop:`${re({size:n,sizes:qh})} ${r} ${Jh(e,t)}`,marginRight:e.spacing.xs},"&::after":{content:'""',flex:1,borderTop:`${re({size:n,sizes:qh})} ${r} ${Jh(e,t)}`,marginLeft:e.spacing.xs}},labelDefaultStyles:{color:t==="dark"?e.colors.dark[1]:e.fn.themeColor(t,e.colorScheme==="dark"?5:e.fn.primaryShade(),!1)},horizontal:{border:0,borderTopWidth:M(re({size:n,sizes:qh})),borderTopColor:Jh(e,t),borderTopStyle:r,margin:0},vertical:{border:0,alignSelf:"stretch",height:"auto",borderLeftWidth:M(re({size:n,sizes:qh})),borderLeftColor:Jh(e,t),borderLeftStyle:r}}));const MQ=$Q;var NQ=Object.defineProperty,TQ=Object.defineProperties,IQ=Object.getOwnPropertyDescriptors,dg=Object.getOwnPropertySymbols,pz=Object.prototype.hasOwnProperty,mz=Object.prototype.propertyIsEnumerable,LE=(e,t,n)=>t in e?NQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,RE=(e,t)=>{for(var n in t||(t={}))pz.call(t,n)&&LE(e,n,t[n]);if(dg)for(var n of dg(t))mz.call(t,n)&&LE(e,n,t[n]);return e},DQ=(e,t)=>TQ(e,IQ(t)),jQ=(e,t)=>{var n={};for(var r in e)pz.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&dg)for(var r of dg(e))t.indexOf(r)<0&&mz.call(e,r)&&(n[r]=e[r]);return n};const LQ={orientation:"horizontal",size:"xs",labelPosition:"left",variant:"solid"},Ye=_.forwardRef((e,t)=>{const n=ae("Divider",LQ,e),{className:r,color:o,orientation:i,size:s,label:a,labelPosition:c,labelProps:u,variant:f,styles:h,classNames:m,unstyled:v}=n,y=jQ(n,["className","color","orientation","size","label","labelPosition","labelProps","variant","styles","classNames","unstyled"]),{classes:w,cx:P}=MQ({color:o},{classNames:m,styles:h,unstyled:v,name:"Divider",variant:f,size:s}),b=i==="vertical",S=i==="horizontal",O=!!a&&S,E=!u?.color;return k.createElement(Pe,RE({ref:t,className:P(w.root,{[w.vertical]:b,[w.horizontal]:S,[w.withLabel]:O},r),role:"separator"},y),O&&k.createElement(U,DQ(RE({},u),{size:u?.size||"xs",mt:M(2),className:P(w.label,w[c],{[w.labelDefaultStyles]:E})}),a))});Ye.displayName="@mantine/core/Divider";var RQ=Object.defineProperty,zQ=Object.defineProperties,AQ=Object.getOwnPropertyDescriptors,zE=Object.getOwnPropertySymbols,BQ=Object.prototype.hasOwnProperty,FQ=Object.prototype.propertyIsEnumerable,AE=(e,t,n)=>t in e?RQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,BE=(e,t)=>{for(var n in t||(t={}))BQ.call(t,n)&&AE(e,n,t[n]);if(zE)for(var n of zE(t))FQ.call(t,n)&&AE(e,n,t[n]);return e},VQ=(e,t)=>zQ(e,AQ(t)),HQ=ue((e,t,{size:n})=>({item:VQ(BE({},e.fn.fontStyles()),{boxSizing:"border-box",wordBreak:"break-all",textAlign:"left",width:"100%",padding:`calc(${re({size:n,sizes:e.spacing})} / 1.5) ${re({size:n,sizes:e.spacing})}`,cursor:"pointer",fontSize:re({size:n,sizes:e.fontSizes}),color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,borderRadius:e.fn.radius(),"&[data-hovered]":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[1]},"&[data-selected]":BE({backgroundColor:e.fn.variant({variant:"filled"}).background,color:e.fn.variant({variant:"filled"}).color},e.fn.hover({backgroundColor:e.fn.variant({variant:"filled"}).hover})),"&[data-disabled]":{cursor:"default",color:e.colors.dark[2]}}),nothingFound:{boxSizing:"border-box",color:e.colors.gray[6],paddingTop:`calc(${re({size:n,sizes:e.spacing})} / 2)`,paddingBottom:`calc(${re({size:n,sizes:e.spacing})} / 2)`,textAlign:"center"},separator:{boxSizing:"border-box",textAlign:"left",width:"100%",padding:`calc(${re({size:n,sizes:e.spacing})} / 1.5) ${re({size:n,sizes:e.spacing})}`},separatorLabel:{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]}}));const WQ=HQ;var UQ=Object.defineProperty,FE=Object.getOwnPropertySymbols,ZQ=Object.prototype.hasOwnProperty,GQ=Object.prototype.propertyIsEnumerable,VE=(e,t,n)=>t in e?UQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,YQ=(e,t)=>{for(var n in t||(t={}))ZQ.call(t,n)&&VE(e,n,t[n]);if(FE)for(var n of FE(t))GQ.call(t,n)&&VE(e,n,t[n]);return e};function xP({data:e,hovered:t,classNames:n,styles:r,isItemSelected:o,uuid:i,__staticSelector:s,onItemHover:a,onItemSelect:c,itemsRefs:u,itemComponent:f,size:h,nothingFound:m,creatable:v,createLabel:y,unstyled:w,variant:P}){const{classes:b}=WQ(null,{classNames:n,styles:r,unstyled:w,name:s,variant:P,size:h}),S=[],O=[];let E=null;const $=(I,R)=>{const B=typeof o=="function"?o(I.value):!1;return k.createElement(f,YQ({key:I.value,className:b.item,"data-disabled":I.disabled||void 0,"data-hovered":!I.disabled&&t===R||void 0,"data-selected":!I.disabled&&B||void 0,selected:B,onMouseEnter:()=>a(R),id:`${i}-${R}`,role:"option",tabIndex:-1,"aria-selected":t===R,ref:z=>{u&&u.current&&(u.current[I.value]=z)},onMouseDown:I.disabled?null:z=>{z.preventDefault(),c(I)},disabled:I.disabled,variant:P},I))};let N=null;if(e.forEach((I,R)=>{I.creatable?E=R:I.group?(N!==I.group&&(N=I.group,O.push(k.createElement("div",{className:b.separator,key:`__mantine-divider-${R}`},k.createElement(Ye,{classNames:{label:b.separatorLabel},label:I.group})))),O.push($(I,R))):S.push($(I,R))}),v){const I=e[E];S.push(k.createElement("div",{key:Vc(),className:b.item,"data-hovered":t===E||void 0,onMouseEnter:()=>a(E),onMouseDown:R=>{R.preventDefault(),c(I)},tabIndex:-1,ref:R=>{u&&u.current&&(u.current[I.value]=R)}},y))}return O.length>0&&S.length>0&&S.unshift(k.createElement("div",{className:b.separator,key:"empty-group-separator"},k.createElement(Ye,null))),O.length>0||S.length>0?k.createElement(k.Fragment,null,O,S):k.createElement(U,{size:h,unstyled:w,className:b.nothingFound},m)}xP.displayName="@mantine/core/SelectItems";var KQ=Object.defineProperty,fg=Object.getOwnPropertySymbols,gz=Object.prototype.hasOwnProperty,vz=Object.prototype.propertyIsEnumerable,HE=(e,t,n)=>t in e?KQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qQ=(e,t)=>{for(var n in t||(t={}))gz.call(t,n)&&HE(e,n,t[n]);if(fg)for(var n of fg(t))vz.call(t,n)&&HE(e,n,t[n]);return e},JQ=(e,t)=>{var n={};for(var r in e)gz.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&fg)for(var r of fg(e))t.indexOf(r)<0&&vz.call(e,r)&&(n[r]=e[r]);return n};const SP=_.forwardRef((e,t)=>{var n=e,{label:r,value:o}=n,i=JQ(n,["label","value"]);return k.createElement("div",qQ({ref:t},i),r||o)});SP.displayName="@mantine/core/DefaultItem";function QQ(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function yz(...e){return t=>e.forEach(n=>QQ(n,t))}function Hl(...e){return _.useCallback(yz(...e),e)}const _z=_.forwardRef((e,t)=>{const{children:n,...r}=e,o=_.Children.toArray(n),i=o.find(eX);if(i){const s=i.props.children,a=o.map(c=>c===i?_.Children.count(s)>1?_.Children.only(null):_.isValidElement(s)?s.props.children:null:c);return _.createElement(tx,Dt({},r,{ref:t}),_.isValidElement(s)?_.cloneElement(s,void 0,a):null)}return _.createElement(tx,Dt({},r,{ref:t}),n)});_z.displayName="Slot";const tx=_.forwardRef((e,t)=>{const{children:n,...r}=e;return _.isValidElement(n)?_.cloneElement(n,{...tX(r,n.props),ref:yz(t,n.ref)}):_.Children.count(n)>1?_.Children.only(null):null});tx.displayName="SlotClone";const XQ=({children:e})=>_.createElement(_.Fragment,null,e);function eX(e){return _.isValidElement(e)&&e.type===XQ}function tX(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const nX=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],Gf=nX.reduce((e,t)=>{const n=_.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?_z:t;return _.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),_.createElement(a,Dt({},s,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),nx=globalThis?.document?_.useLayoutEffect:()=>{};function rX(e,t){return _.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const Yf=e=>{const{present:t,children:n}=e,r=oX(t),o=typeof n=="function"?n({present:r.isPresent}):_.Children.only(n),i=Hl(r.ref,o.ref);return typeof n=="function"||r.isPresent?_.cloneElement(o,{ref:i}):null};Yf.displayName="Presence";function oX(e){const[t,n]=_.useState(),r=_.useRef({}),o=_.useRef(e),i=_.useRef("none"),s=e?"mounted":"unmounted",[a,c]=rX(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const u=Qh(r.current);i.current=a==="mounted"?u:"none"},[a]),nx(()=>{const u=r.current,f=o.current;if(f!==e){const m=i.current,v=Qh(u);e?c("MOUNT"):v==="none"||u?.display==="none"?c("UNMOUNT"):c(f&&m!==v?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),nx(()=>{if(t){const u=h=>{const v=Qh(r.current).includes(h.animationName);h.target===t&&v&&Cs.flushSync(()=>c("ANIMATION_END"))},f=h=>{h.target===t&&(i.current=Qh(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:_.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function Qh(e){return e?.animationName||"none"}function iX(e,t=[]){let n=[];function r(i,s){const a=_.createContext(s),c=n.length;n=[...n,s];function u(h){const{scope:m,children:v,...y}=h,w=m?.[e][c]||a,P=_.useMemo(()=>y,Object.values(y));return _.createElement(w.Provider,{value:P},v)}function f(h,m){const v=m?.[e][c]||a,y=_.useContext(v);if(y)return y;if(s!==void 0)return s;throw new Error(`\`${h}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,f]}const o=()=>{const i=n.map(s=>_.createContext(s));return function(a){const c=a?.[e]||i;return _.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return o.scopeName=e,[r,sX(o,...t)]}function sX(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:c,scopeName:u})=>{const h=c(i)[`__scope${u}`];return{...a,...h}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function ol(e){const t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}const aX=_.createContext(void 0);function lX(e){const t=_.useContext(aX);return e||t||"ltr"}function cX(e,[t,n]){return Math.min(n,Math.max(t,e))}function Sl(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function uX(e,t){return _.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const wz="ScrollArea",[bz,uje]=iX(wz),[dX,Wo]=bz(wz),fX=_.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:i=600,...s}=e,[a,c]=_.useState(null),[u,f]=_.useState(null),[h,m]=_.useState(null),[v,y]=_.useState(null),[w,P]=_.useState(null),[b,S]=_.useState(0),[O,E]=_.useState(0),[$,N]=_.useState(!1),[I,R]=_.useState(!1),B=Hl(t,G=>c(G)),z=lX(o);return _.createElement(dX,{scope:n,type:r,dir:z,scrollHideDelay:i,scrollArea:a,viewport:u,onViewportChange:f,content:h,onContentChange:m,scrollbarX:v,onScrollbarXChange:y,scrollbarXEnabled:$,onScrollbarXEnabledChange:N,scrollbarY:w,onScrollbarYChange:P,scrollbarYEnabled:I,onScrollbarYEnabledChange:R,onCornerWidthChange:S,onCornerHeightChange:E},_.createElement(Gf.div,Dt({dir:z},s,{ref:B,style:{position:"relative","--radix-scroll-area-corner-width":b+"px","--radix-scroll-area-corner-height":O+"px",...e.style}})))}),hX="ScrollAreaViewport",pX=_.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,...o}=e,i=Wo(hX,n),s=_.useRef(null),a=Hl(t,s,i.onViewportChange);return _.createElement(_.Fragment,null,_.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"}}),_.createElement(Gf.div,Dt({"data-radix-scroll-area-viewport":""},o,{ref:a,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style}}),_.createElement("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"}},r)))}),ks="ScrollAreaScrollbar",mX=_.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Wo(ks,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:s}=o,a=e.orientation==="horizontal";return _.useEffect(()=>(a?i(!0):s(!0),()=>{a?i(!1):s(!1)}),[a,i,s]),o.type==="hover"?_.createElement(gX,Dt({},r,{ref:t,forceMount:n})):o.type==="scroll"?_.createElement(vX,Dt({},r,{ref:t,forceMount:n})):o.type==="auto"?_.createElement(xz,Dt({},r,{ref:t,forceMount:n})):o.type==="always"?_.createElement(PP,Dt({},r,{ref:t})):null}),gX=_.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Wo(ks,e.__scopeScrollArea),[i,s]=_.useState(!1);return _.useEffect(()=>{const a=o.scrollArea;let c=0;if(a){const u=()=>{window.clearTimeout(c),s(!0)},f=()=>{c=window.setTimeout(()=>s(!1),o.scrollHideDelay)};return a.addEventListener("pointerenter",u),a.addEventListener("pointerleave",f),()=>{window.clearTimeout(c),a.removeEventListener("pointerenter",u),a.removeEventListener("pointerleave",f)}}},[o.scrollArea,o.scrollHideDelay]),_.createElement(Yf,{present:n||i},_.createElement(xz,Dt({"data-state":i?"visible":"hidden"},r,{ref:t})))}),vX=_.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Wo(ks,e.__scopeScrollArea),i=e.orientation==="horizontal",s=R0(()=>c("SCROLL_END"),100),[a,c]=uX("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return _.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>c("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,o.scrollHideDelay,c]),_.useEffect(()=>{const u=o.viewport,f=i?"scrollLeft":"scrollTop";if(u){let h=u[f];const m=()=>{const v=u[f];h!==v&&(c("SCROLL"),s()),h=v};return u.addEventListener("scroll",m),()=>u.removeEventListener("scroll",m)}},[o.viewport,i,c,s]),_.createElement(Yf,{present:n||a!=="hidden"},_.createElement(PP,Dt({"data-state":a==="hidden"?"hidden":"visible"},r,{ref:t,onPointerEnter:Sl(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:Sl(e.onPointerLeave,()=>c("POINTER_LEAVE"))})))}),xz=_.forwardRef((e,t)=>{const n=Wo(ks,e.__scopeScrollArea),{forceMount:r,...o}=e,[i,s]=_.useState(!1),a=e.orientation==="horizontal",c=R0(()=>{if(n.viewport){const u=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=e,o=Wo(ks,e.__scopeScrollArea),i=_.useRef(null),s=_.useRef(0),[a,c]=_.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=Cz(a.viewport,a.content),f={...r,sizes:a,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:m=>i.current=m,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:m=>s.current=m};function h(m,v){return OX(m,s.current,a,v)}return n==="horizontal"?_.createElement(yX,Dt({},f,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const m=o.viewport.scrollLeft,v=WE(m,a,o.dir);i.current.style.transform=`translate3d(${v}px, 0, 0)`}},onWheelScroll:m=>{o.viewport&&(o.viewport.scrollLeft=m)},onDragScroll:m=>{o.viewport&&(o.viewport.scrollLeft=h(m,o.dir))}})):n==="vertical"?_.createElement(_X,Dt({},f,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const m=o.viewport.scrollTop,v=WE(m,a);i.current.style.transform=`translate3d(0, ${v}px, 0)`}},onWheelScroll:m=>{o.viewport&&(o.viewport.scrollTop=m)},onDragScroll:m=>{o.viewport&&(o.viewport.scrollTop=h(m))}})):null}),yX=_.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=Wo(ks,e.__scopeScrollArea),[s,a]=_.useState(),c=_.useRef(null),u=Hl(t,c,i.onScrollbarXChange);return _.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),_.createElement(Pz,Dt({"data-orientation":"horizontal"},o,{ref:u,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":L0(n)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.x),onDragScroll:f=>e.onDragScroll(f.x),onWheelScroll:(f,h)=>{if(i.viewport){const m=i.viewport.scrollLeft+f.deltaX;e.onWheelScroll(m),Ez(m,h)&&f.preventDefault()}},onResize:()=>{c.current&&i.viewport&&s&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:hg(s.paddingLeft),paddingEnd:hg(s.paddingRight)}})}}))}),_X=_.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=Wo(ks,e.__scopeScrollArea),[s,a]=_.useState(),c=_.useRef(null),u=Hl(t,c,i.onScrollbarYChange);return _.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),_.createElement(Pz,Dt({"data-orientation":"vertical"},o,{ref:u,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":L0(n)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.y),onDragScroll:f=>e.onDragScroll(f.y),onWheelScroll:(f,h)=>{if(i.viewport){const m=i.viewport.scrollTop+f.deltaY;e.onWheelScroll(m),Ez(m,h)&&f.preventDefault()}},onResize:()=>{c.current&&i.viewport&&s&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:hg(s.paddingTop),paddingEnd:hg(s.paddingBottom)}})}}))}),[wX,Sz]=bz(ks),Pz=_.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:i,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:f,onResize:h,...m}=e,v=Wo(ks,n),[y,w]=_.useState(null),P=Hl(t,B=>w(B)),b=_.useRef(null),S=_.useRef(""),O=v.viewport,E=r.content-r.viewport,$=ol(f),N=ol(c),I=R0(h,10);function R(B){if(b.current){const z=B.clientX-b.current.left,G=B.clientY-b.current.top;u({x:z,y:G})}}return _.useEffect(()=>{const B=z=>{const G=z.target;y?.contains(G)&&$(z,E)};return document.addEventListener("wheel",B,{passive:!1}),()=>document.removeEventListener("wheel",B,{passive:!1})},[O,y,E,$]),_.useEffect(N,[r,N]),cu(y,I),cu(v.content,I),_.createElement(wX,{scope:n,scrollbar:y,hasThumb:o,onThumbChange:ol(i),onThumbPointerUp:ol(s),onThumbPositionChange:N,onThumbPointerDown:ol(a)},_.createElement(Gf.div,Dt({},m,{ref:P,style:{position:"absolute",...m.style},onPointerDown:Sl(e.onPointerDown,B=>{B.button===0&&(B.target.setPointerCapture(B.pointerId),b.current=y.getBoundingClientRect(),S.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",R(B))}),onPointerMove:Sl(e.onPointerMove,R),onPointerUp:Sl(e.onPointerUp,B=>{const z=B.target;z.hasPointerCapture(B.pointerId)&&z.releasePointerCapture(B.pointerId),document.body.style.webkitUserSelect=S.current,b.current=null})})))}),rx="ScrollAreaThumb",bX=_.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Sz(rx,e.__scopeScrollArea);return _.createElement(Yf,{present:n||o.hasThumb},_.createElement(xX,Dt({ref:t},r)))}),xX=_.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,i=Wo(rx,n),s=Sz(rx,n),{onThumbPositionChange:a}=s,c=Hl(t,h=>s.onThumbChange(h)),u=_.useRef(),f=R0(()=>{u.current&&(u.current(),u.current=void 0)},100);return _.useEffect(()=>{const h=i.viewport;if(h){const m=()=>{if(f(),!u.current){const v=CX(h,a);u.current=v,a()}};return a(),h.addEventListener("scroll",m),()=>h.removeEventListener("scroll",m)}},[i.viewport,f,a]),_.createElement(Gf.div,Dt({"data-state":s.hasThumb?"visible":"hidden"},o,{ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Sl(e.onPointerDownCapture,h=>{const v=h.target.getBoundingClientRect(),y=h.clientX-v.left,w=h.clientY-v.top;s.onThumbPointerDown({x:y,y:w})}),onPointerUp:Sl(e.onPointerUp,s.onThumbPointerUp)}))}),Oz="ScrollAreaCorner",SX=_.forwardRef((e,t)=>{const n=Wo(Oz,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?_.createElement(PX,Dt({},e,{ref:t})):null}),PX=_.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=Wo(Oz,n),[i,s]=_.useState(0),[a,c]=_.useState(0),u=!!(i&&a);return cu(o.scrollbarX,()=>{var f;const h=((f=o.scrollbarX)===null||f===void 0?void 0:f.offsetHeight)||0;o.onCornerHeightChange(h),c(h)}),cu(o.scrollbarY,()=>{var f;const h=((f=o.scrollbarY)===null||f===void 0?void 0:f.offsetWidth)||0;o.onCornerWidthChange(h),s(h)}),u?_.createElement(Gf.div,Dt({},r,{ref:t,style:{width:i,height:a,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}})):null});function hg(e){return e?parseInt(e,10):0}function Cz(e,t){const n=e/t;return isNaN(n)?0:n}function L0(e){const t=Cz(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function OX(e,t,n,r="ltr"){const o=L0(n),i=o/2,s=t||i,a=o-s,c=n.scrollbar.paddingStart+s,u=n.scrollbar.size-n.scrollbar.paddingEnd-a,f=n.content-n.viewport,h=r==="ltr"?[0,f]:[f*-1,0];return kz([c,u],h)(e)}function WE(e,t,n="ltr"){const r=L0(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,s=t.content-t.viewport,a=i-r,c=n==="ltr"?[0,s]:[s*-1,0],u=cX(e,c);return kz([0,s],[0,a])(u)}function kz(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Ez(e,t){return e>0&&e{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const i={left:e.scrollLeft,top:e.scrollTop},s=n.left!==i.left,a=n.top!==i.top;(s||a)&&t(),n=i,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function R0(e,t){const n=ol(e),r=_.useRef(0);return _.useEffect(()=>()=>window.clearTimeout(r.current),[]),_.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function cu(e,t){const n=ol(t);nx(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}const kX=fX,EX=pX,UE=mX,ZE=bX,$X=SX;var MX=ue((e,{scrollbarSize:t,offsetScrollbars:n,scrollbarHovered:r,hidden:o})=>({root:{overflow:"hidden"},viewport:{width:"100%",height:"100%",paddingRight:n?M(t):void 0,paddingBottom:n?M(t):void 0},scrollbar:{display:o?"none":"flex",userSelect:"none",touchAction:"none",boxSizing:"border-box",padding:`calc(${M(t)} / 5)`,transition:"background-color 150ms ease, opacity 150ms ease","&:hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[8]:e.colors.gray[0],[`& .${Br("thumb")}`]:{backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.white,.5):e.fn.rgba(e.black,.5)}},'&[data-orientation="vertical"]':{width:M(t)},'&[data-orientation="horizontal"]':{flexDirection:"column",height:M(t)},'&[data-state="hidden"]':{display:"none",opacity:0}},thumb:{ref:Br("thumb"),flex:1,backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.white,.4):e.fn.rgba(e.black,.4),borderRadius:M(t),position:"relative",transition:"background-color 150ms ease",display:o?"none":void 0,overflow:"hidden","&::before":{content:'""',position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"100%",height:"100%",minWidth:M(44),minHeight:M(44)}},corner:{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[0],transition:"opacity 150ms ease",opacity:r?1:0,display:o?"none":void 0}}));const NX=MX;var TX=Object.defineProperty,IX=Object.defineProperties,DX=Object.getOwnPropertyDescriptors,pg=Object.getOwnPropertySymbols,$z=Object.prototype.hasOwnProperty,Mz=Object.prototype.propertyIsEnumerable,GE=(e,t,n)=>t in e?TX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ox=(e,t)=>{for(var n in t||(t={}))$z.call(t,n)&&GE(e,n,t[n]);if(pg)for(var n of pg(t))Mz.call(t,n)&&GE(e,n,t[n]);return e},Nz=(e,t)=>IX(e,DX(t)),Tz=(e,t)=>{var n={};for(var r in e)$z.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&pg)for(var r of pg(e))t.indexOf(r)<0&&Mz.call(e,r)&&(n[r]=e[r]);return n};const Iz={scrollbarSize:12,scrollHideDelay:1e3,type:"hover",offsetScrollbars:!1},z0=_.forwardRef((e,t)=>{const n=ae("ScrollArea",Iz,e),{children:r,className:o,classNames:i,styles:s,scrollbarSize:a,scrollHideDelay:c,type:u,dir:f,offsetScrollbars:h,viewportRef:m,onScrollPositionChange:v,unstyled:y,variant:w,viewportProps:P}=n,b=Tz(n,["children","className","classNames","styles","scrollbarSize","scrollHideDelay","type","dir","offsetScrollbars","viewportRef","onScrollPositionChange","unstyled","variant","viewportProps"]),[S,O]=_.useState(!1),E=ar(),{classes:$,cx:N}=NX({scrollbarSize:a,offsetScrollbars:h,scrollbarHovered:S,hidden:u==="never"},{name:"ScrollArea",classNames:i,styles:s,unstyled:y,variant:w});return k.createElement(kX,{type:u==="never"?"always":u,scrollHideDelay:c,dir:f||E.dir,ref:t,asChild:!0},k.createElement(Pe,ox({className:N($.root,o)},b),k.createElement(EX,Nz(ox({},P),{className:$.viewport,ref:m,onScroll:typeof v=="function"?({currentTarget:I})=>v({x:I.scrollLeft,y:I.scrollTop}):void 0}),r),k.createElement(UE,{orientation:"horizontal",className:$.scrollbar,forceMount:!0,onMouseEnter:()=>O(!0),onMouseLeave:()=>O(!1)},k.createElement(ZE,{className:$.thumb})),k.createElement(UE,{orientation:"vertical",className:$.scrollbar,forceMount:!0,onMouseEnter:()=>O(!0),onMouseLeave:()=>O(!1)},k.createElement(ZE,{className:$.thumb})),k.createElement($X,{className:$.corner})))}),Dz=_.forwardRef((e,t)=>{const n=ae("ScrollAreaAutosize",Iz,e),{children:r,classNames:o,styles:i,scrollbarSize:s,scrollHideDelay:a,type:c,dir:u,offsetScrollbars:f,viewportRef:h,onScrollPositionChange:m,unstyled:v,sx:y,variant:w,viewportProps:P}=n,b=Tz(n,["children","classNames","styles","scrollbarSize","scrollHideDelay","type","dir","offsetScrollbars","viewportRef","onScrollPositionChange","unstyled","sx","variant","viewportProps"]);return k.createElement(Pe,Nz(ox({},b),{ref:t,sx:[{display:"flex"},...yS(y)]}),k.createElement(Pe,{sx:{display:"flex",flexDirection:"column",flex:1}},k.createElement(z0,{classNames:o,styles:i,scrollHideDelay:a,scrollbarSize:s,type:c,dir:u,offsetScrollbars:f,viewportRef:h,onScrollPositionChange:m,unstyled:v,variant:w,viewportProps:P},r)))});Dz.displayName="@mantine/core/ScrollAreaAutosize";z0.displayName="@mantine/core/ScrollArea";z0.Autosize=Dz;const At=z0;var jX=Object.defineProperty,LX=Object.defineProperties,RX=Object.getOwnPropertyDescriptors,mg=Object.getOwnPropertySymbols,jz=Object.prototype.hasOwnProperty,Lz=Object.prototype.propertyIsEnumerable,YE=(e,t,n)=>t in e?jX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,KE=(e,t)=>{for(var n in t||(t={}))jz.call(t,n)&&YE(e,n,t[n]);if(mg)for(var n of mg(t))Lz.call(t,n)&&YE(e,n,t[n]);return e},zX=(e,t)=>LX(e,RX(t)),AX=(e,t)=>{var n={};for(var r in e)jz.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&mg)for(var r of mg(e))t.indexOf(r)<0&&Lz.call(e,r)&&(n[r]=e[r]);return n};const A0=_.forwardRef((e,t)=>{var n=e,{style:r}=n,o=AX(n,["style"]);return k.createElement(At,zX(KE({},o),{style:KE({width:"100%"},r),viewportProps:{tabIndex:-1},viewportRef:t}),o.children)});A0.displayName="@mantine/core/SelectScrollArea";var BX=ue(()=>({dropdown:{},itemsWrapper:{padding:M(4),display:"flex",width:"100%",boxSizing:"border-box"}}));const FX=BX,ii=Math.min,rr=Math.max,gg=Math.round,Xh=Math.floor,Ea=e=>({x:e,y:e}),VX={left:"right",right:"left",bottom:"top",top:"bottom"},HX={start:"end",end:"start"};function ix(e,t,n){return rr(e,ii(t,n))}function _s(e,t){return typeof e=="function"?e(t):e}function si(e){return e.split("-")[0]}function Mu(e){return e.split("-")[1]}function OP(e){return e==="x"?"y":"x"}function CP(e){return e==="y"?"height":"width"}function Wl(e){return["top","bottom"].includes(si(e))?"y":"x"}function kP(e){return OP(Wl(e))}function WX(e,t,n){n===void 0&&(n=!1);const r=Mu(e),o=kP(e),i=CP(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=vg(s)),[s,vg(s)]}function UX(e){const t=vg(e);return[sx(e),t,sx(t)]}function sx(e){return e.replace(/start|end/g,t=>HX[t])}function ZX(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}function GX(e,t,n,r){const o=Mu(e);let i=ZX(si(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(sx)))),i}function vg(e){return e.replace(/left|right|bottom|top/g,t=>VX[t])}function YX(e){return{top:0,right:0,bottom:0,left:0,...e}}function EP(e){return typeof e!="number"?YX(e):{top:e,right:e,bottom:e,left:e}}function uu(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function qE(e,t,n){let{reference:r,floating:o}=e;const i=Wl(t),s=kP(t),a=CP(s),c=si(t),u=i==="y",f=r.x+r.width/2-o.width/2,h=r.y+r.height/2-o.height/2,m=r[a]/2-o[a]/2;let v;switch(c){case"top":v={x:f,y:r.y-o.height};break;case"bottom":v={x:f,y:r.y+r.height};break;case"right":v={x:r.x+r.width,y:h};break;case"left":v={x:r.x-o.width,y:h};break;default:v={x:r.x,y:r.y}}switch(Mu(t)){case"start":v[s]-=m*(n&&u?-1:1);break;case"end":v[s]+=m*(n&&u?-1:1);break}return v}const KX=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:h}=qE(u,r,c),m=r,v={},y=0;for(let w=0;w({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:c}=t,{element:u,padding:f=0}=_s(e,t)||{};if(u==null)return{};const h=EP(f),m={x:n,y:r},v=kP(o),y=CP(v),w=await s.getDimensions(u),P=v==="y",b=P?"top":"left",S=P?"bottom":"right",O=P?"clientHeight":"clientWidth",E=i.reference[y]+i.reference[v]-m[v]-i.floating[y],$=m[v]-i.reference[v],N=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let I=N?N[O]:0;(!I||!await(s.isElement==null?void 0:s.isElement(N)))&&(I=a.floating[O]||i.floating[y]);const R=E/2-$/2,B=I/2-w[y]/2-1,z=ii(h[b],B),G=ii(h[S],B),Q=z,X=I-w[y]-G,V=I/2-w[y]/2+R,H=ix(Q,V,X),Z=!c.arrow&&Mu(o)!=null&&V!=H&&i.reference[y]/2-(VQ<=0)){var B,z;const Q=(((B=i.flip)==null?void 0:B.index)||0)+1,X=$[Q];if(X)return{data:{index:Q,overflows:R},reset:{placement:X}};let V=(z=R.filter(H=>H.overflows[0]<=0).sort((H,Z)=>H.overflows[1]-Z.overflows[1])[0])==null?void 0:z.placement;if(!V)switch(v){case"bestFit":{var G;const H=(G=R.map(Z=>[Z.placement,Z.overflows.filter(Y=>Y>0).reduce((Y,D)=>Y+D,0)]).sort((Z,Y)=>Z[1]-Y[1])[0])==null?void 0:G[0];H&&(V=H);break}case"initialPlacement":V=a;break}if(o!==V)return{reset:{placement:V}}}return{}}}};function zz(e){const t=ii(...e.map(i=>i.left)),n=ii(...e.map(i=>i.top)),r=rr(...e.map(i=>i.right)),o=rr(...e.map(i=>i.bottom));return{x:t,y:n,width:r-t,height:o-n}}function qX(e){const t=e.slice().sort((o,i)=>o.y-i.y),n=[];let r=null;for(let o=0;or.height/2?n.push([i]):n[n.length-1].push(i),r=i}return n.map(o=>uu(zz(o)))}const Az=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:o,platform:i,strategy:s}=t,{padding:a=2,x:c,y:u}=_s(e,t),f=Array.from(await(i.getClientRects==null?void 0:i.getClientRects(r.reference))||[]),h=qX(f),m=uu(zz(f)),v=EP(a);function y(){if(h.length===2&&h[0].left>h[1].right&&c!=null&&u!=null)return h.find(P=>c>P.left-v.left&&cP.top-v.top&&u=2){if(Wl(n)==="y"){const z=h[0],G=h[h.length-1],Q=si(n)==="top",X=z.top,V=G.bottom,H=Q?z.left:G.left,Z=Q?z.right:G.right,Y=Z-H,D=V-X;return{top:X,bottom:V,left:H,right:Z,width:Y,height:D,x:H,y:X}}const P=si(n)==="left",b=rr(...h.map(z=>z.right)),S=ii(...h.map(z=>z.left)),O=h.filter(z=>P?z.left===S:z.right===b),E=O[0].top,$=O[O.length-1].bottom,N=S,I=b,R=I-N,B=$-E;return{top:E,bottom:$,left:N,right:I,width:R,height:B,x:N,y:E}}return m}const w=await i.getElementRects({reference:{getBoundingClientRect:y},floating:r.floating,strategy:s});return o.reference.x!==w.reference.x||o.reference.y!==w.reference.y||o.reference.width!==w.reference.width||o.reference.height!==w.reference.height?{reset:{rects:w}}:{}}}};async function JX(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=si(n),a=Mu(n),c=Wl(n)==="y",u=["left","top"].includes(s)?-1:1,f=i&&c?-1:1,h=_s(t,e);let{mainAxis:m,crossAxis:v,alignmentAxis:y}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...h};return a&&typeof y=="number"&&(v=a==="end"?y*-1:y),c?{x:v*f,y:m*u}:{x:m*u,y:v*f}}const Bz=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await JX(t,e);return{x:n+o.x,y:r+o.y,data:o}}}},MP=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:P=>{let{x:b,y:S}=P;return{x:b,y:S}}},...c}=_s(e,t),u={x:n,y:r},f=await $P(t,c),h=Wl(si(o)),m=OP(h);let v=u[m],y=u[h];if(i){const P=m==="y"?"top":"left",b=m==="y"?"bottom":"right",S=v+f[P],O=v-f[b];v=ix(S,v,O)}if(s){const P=h==="y"?"top":"left",b=h==="y"?"bottom":"right",S=y+f[P],O=y-f[b];y=ix(S,y,O)}const w=a.fn({...t,[m]:v,[h]:y});return{...w,data:{x:w.x-n,y:w.y-r}}}}},QX=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:c=!0,crossAxis:u=!0}=_s(e,t),f={x:n,y:r},h=Wl(o),m=OP(h);let v=f[m],y=f[h];const w=_s(a,t),P=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(c){const O=m==="y"?"height":"width",E=i.reference[m]-i.floating[O]+P.mainAxis,$=i.reference[m]+i.reference[O]-P.mainAxis;v$&&(v=$)}if(u){var b,S;const O=m==="y"?"width":"height",E=["top","left"].includes(si(o)),$=i.reference[h]-i.floating[O]+(E&&((b=s.offset)==null?void 0:b[h])||0)+(E?0:P.crossAxis),N=i.reference[h]+i.reference[O]+(E?0:((S=s.offset)==null?void 0:S[h])||0)-(E?P.crossAxis:0);y<$?y=$:y>N&&(y=N)}return{[m]:v,[h]:y}}}},XX=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:s=()=>{},...a}=_s(e,t),c=await $P(t,a),u=si(n),f=Mu(n),h=Wl(n)==="y",{width:m,height:v}=r.floating;let y,w;u==="top"||u==="bottom"?(y=u,w=f===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(w=u,y=f==="end"?"top":"bottom");const P=v-c[y],b=m-c[w],S=!t.middlewareData.shift;let O=P,E=b;if(h){const N=m-c.left-c.right;E=f||S?ii(b,N):N}else{const N=v-c.top-c.bottom;O=f||S?ii(P,N):N}if(S&&!f){const N=rr(c.left,0),I=rr(c.right,0),R=rr(c.top,0),B=rr(c.bottom,0);h?E=m-2*(N!==0||I!==0?N+I:rr(c.left,c.right)):O=v-2*(R!==0||B!==0?R+B:rr(c.top,c.bottom))}await s({...t,availableWidth:E,availableHeight:O});const $=await o.getDimensions(i.floating);return m!==$.width||v!==$.height?{reset:{rects:!0}}:{}}}};function $a(e){return Fz(e)?(e.nodeName||"").toLowerCase():"#document"}function vo(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Es(e){var t;return(t=(Fz(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Fz(e){return e instanceof Node||e instanceof vo(e).Node}function ws(e){return e instanceof Element||e instanceof vo(e).Element}function Ri(e){return e instanceof HTMLElement||e instanceof vo(e).HTMLElement}function QE(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof vo(e).ShadowRoot}function Kf(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ho(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function eee(e){return["table","td","th"].includes($a(e))}function NP(e){const t=TP(),n=Ho(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function tee(e){let t=du(e);for(;Ri(t)&&!B0(t);){if(NP(t))return t;t=du(t)}return null}function TP(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function B0(e){return["html","body","#document"].includes($a(e))}function Ho(e){return vo(e).getComputedStyle(e)}function F0(e){return ws(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function du(e){if($a(e)==="html")return e;const t=e.assignedSlot||e.parentNode||QE(e)&&e.host||Es(e);return QE(t)?t.host:t}function Vz(e){const t=du(e);return B0(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ri(t)&&Kf(t)?t:Vz(t)}function hs(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Vz(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=vo(o);return i?t.concat(s,s.visualViewport||[],Kf(o)?o:[],s.frameElement&&n?hs(s.frameElement):[]):t.concat(o,hs(o,[],n))}function Hz(e){const t=Ho(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ri(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=gg(n)!==i||gg(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function IP(e){return ws(e)?e:e.contextElement}function Kc(e){const t=IP(e);if(!Ri(t))return Ea(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Hz(t);let s=(i?gg(n.width):n.width)/r,a=(i?gg(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const nee=Ea(0);function Wz(e){const t=vo(e);return!TP()||!t.visualViewport?nee:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ree(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==vo(e)?!1:t}function Dl(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=IP(e);let s=Ea(1);t&&(r?ws(r)&&(s=Kc(r)):s=Kc(e));const a=ree(i,n,r)?Wz(i):Ea(0);let c=(o.left+a.x)/s.x,u=(o.top+a.y)/s.y,f=o.width/s.x,h=o.height/s.y;if(i){const m=vo(i),v=r&&ws(r)?vo(r):r;let y=m.frameElement;for(;y&&r&&v!==m;){const w=Kc(y),P=y.getBoundingClientRect(),b=Ho(y),S=P.left+(y.clientLeft+parseFloat(b.paddingLeft))*w.x,O=P.top+(y.clientTop+parseFloat(b.paddingTop))*w.y;c*=w.x,u*=w.y,f*=w.x,h*=w.y,c+=S,u+=O,y=vo(y).frameElement}}return uu({width:f,height:h,x:c,y:u})}function oee(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=Ri(n),i=Es(n);if(n===i)return t;let s={scrollLeft:0,scrollTop:0},a=Ea(1);const c=Ea(0);if((o||!o&&r!=="fixed")&&(($a(n)!=="body"||Kf(i))&&(s=F0(n)),Ri(n))){const u=Dl(n);a=Kc(n),c.x=u.x+n.clientLeft,c.y=u.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-s.scrollLeft*a.x+c.x,y:t.y*a.y-s.scrollTop*a.y+c.y}}function iee(e){return Array.from(e.getClientRects())}function Uz(e){return Dl(Es(e)).left+F0(e).scrollLeft}function see(e){const t=Es(e),n=F0(e),r=e.ownerDocument.body,o=rr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=rr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Uz(e);const a=-n.scrollTop;return Ho(r).direction==="rtl"&&(s+=rr(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function aee(e,t){const n=vo(e),r=Es(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,c=0;if(o){i=o.width,s=o.height;const u=TP();(!u||u&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}return{width:i,height:s,x:a,y:c}}function lee(e,t){const n=Dl(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Ri(e)?Kc(e):Ea(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,c=o*i.x,u=r*i.y;return{width:s,height:a,x:c,y:u}}function XE(e,t,n){let r;if(t==="viewport")r=aee(e,n);else if(t==="document")r=see(Es(e));else if(ws(t))r=lee(t,n);else{const o=Wz(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return uu(r)}function Zz(e,t){const n=du(e);return n===t||!ws(n)||B0(n)?!1:Ho(n).position==="fixed"||Zz(n,t)}function cee(e,t){const n=t.get(e);if(n)return n;let r=hs(e,[],!1).filter(a=>ws(a)&&$a(a)!=="body"),o=null;const i=Ho(e).position==="fixed";let s=i?du(e):e;for(;ws(s)&&!B0(s);){const a=Ho(s),c=NP(s);!c&&a.position==="fixed"&&(o=null),(i?!c&&!o:!c&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Kf(s)&&!c&&Zz(e,s))?r=r.filter(f=>f!==s):o=a,s=du(s)}return t.set(e,r),r}function uee(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?cee(t,this._c):[].concat(n),r],a=s[0],c=s.reduce((u,f)=>{const h=XE(t,f,o);return u.top=rr(h.top,u.top),u.right=ii(h.right,u.right),u.bottom=ii(h.bottom,u.bottom),u.left=rr(h.left,u.left),u},XE(t,a,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function dee(e){return Hz(e)}function fee(e,t,n){const r=Ri(t),o=Es(t),i=n==="fixed",s=Dl(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const c=Ea(0);if(r||!r&&!i)if(($a(t)!=="body"||Kf(o))&&(a=F0(t)),r){const u=Dl(t,!0,i,t);c.x=u.x+t.clientLeft,c.y=u.y+t.clientTop}else o&&(c.x=Uz(o));return{x:s.left+a.scrollLeft-c.x,y:s.top+a.scrollTop-c.y,width:s.width,height:s.height}}function e$(e,t){return!Ri(e)||Ho(e).position==="fixed"?null:t?t(e):e.offsetParent}function Gz(e,t){const n=vo(e);if(!Ri(e))return n;let r=e$(e,t);for(;r&&eee(r)&&Ho(r).position==="static";)r=e$(r,t);return r&&($a(r)==="html"||$a(r)==="body"&&Ho(r).position==="static"&&!NP(r))?n:r||tee(e)||n}const hee=async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||Gz,i=this.getDimensions;return{reference:fee(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}};function pee(e){return Ho(e).direction==="rtl"}const mee={convertOffsetParentRelativeRectToViewportRelativeRect:oee,getDocumentElement:Es,getClippingRect:uee,getOffsetParent:Gz,getElementRects:hee,getClientRects:iee,getDimensions:dee,getScale:Kc,isElement:ws,isRTL:pee};function gee(e,t){let n=null,r;const o=Es(e);function i(){clearTimeout(r),n&&n.disconnect(),n=null}function s(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),i();const{left:u,top:f,width:h,height:m}=e.getBoundingClientRect();if(a||t(),!h||!m)return;const v=Xh(f),y=Xh(o.clientWidth-(u+h)),w=Xh(o.clientHeight-(f+m)),P=Xh(u),S={rootMargin:-v+"px "+-y+"px "+-w+"px "+-P+"px",threshold:rr(0,ii(1,c))||1};let O=!0;function E($){const N=$[0].intersectionRatio;if(N!==c){if(!O)return s();N?s(!1,N):r=setTimeout(()=>{s(!1,1e-7)},100)}O=!1}try{n=new IntersectionObserver(E,{...S,root:o.ownerDocument})}catch{n=new IntersectionObserver(E,S)}n.observe(e)}return s(!0),i}function vee(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=IP(e),f=o||i?[...u?hs(u):[],...hs(t)]:[];f.forEach(b=>{o&&b.addEventListener("scroll",n,{passive:!0}),i&&b.addEventListener("resize",n)});const h=u&&a?gee(u,n):null;let m=-1,v=null;s&&(v=new ResizeObserver(b=>{let[S]=b;S&&S.target===u&&v&&(v.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{v&&v.observe(t)})),n()}),u&&!c&&v.observe(u),v.observe(t));let y,w=c?Dl(e):null;c&&P();function P(){const b=Dl(e);w&&(b.x!==w.x||b.y!==w.y||b.width!==w.width||b.height!==w.height)&&n(),w=b,y=requestAnimationFrame(P)}return n(),()=>{f.forEach(b=>{o&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),h&&h(),v&&v.disconnect(),v=null,c&&cancelAnimationFrame(y)}}const yee=(e,t,n)=>{const r=new Map,o={platform:mee,...n},i={...o.platform,_c:r};return KX(e,t,{...o,platform:i})},Yz=e=>{const{element:t,padding:n}=e;function r(o){return Object.prototype.hasOwnProperty.call(o,"current")}return{name:"arrow",options:e,fn(o){return r(t)?t.current!=null?JE({element:t.current,padding:n}).fn(o):{}:t?JE({element:t,padding:n}).fn(o):{}}}};var Jp=typeof document<"u"?_.useLayoutEffect:_.useEffect;function yg(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!yg(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!yg(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function t$(e){const t=_.useRef(e);return Jp(()=>{t.current=e}),t}function _ee(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,whileElementsMounted:i,open:s}=e,[a,c]=_.useState({x:null,y:null,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[u,f]=_.useState(r);yg(u,r)||f(r);const h=_.useRef(null),m=_.useRef(null),v=_.useRef(a),y=t$(i),w=t$(o),[P,b]=_.useState(null),[S,O]=_.useState(null),E=_.useCallback(z=>{h.current!==z&&(h.current=z,b(z))},[]),$=_.useCallback(z=>{m.current!==z&&(m.current=z,O(z))},[]),N=_.useCallback(()=>{if(!h.current||!m.current)return;const z={placement:t,strategy:n,middleware:u};w.current&&(z.platform=w.current),yee(h.current,m.current,z).then(G=>{const Q={...G,isPositioned:!0};I.current&&!yg(v.current,Q)&&(v.current=Q,Cs.flushSync(()=>{c(Q)}))})},[u,t,n,w]);Jp(()=>{s===!1&&v.current.isPositioned&&(v.current.isPositioned=!1,c(z=>({...z,isPositioned:!1})))},[s]);const I=_.useRef(!1);Jp(()=>(I.current=!0,()=>{I.current=!1}),[]),Jp(()=>{if(P&&S){if(y.current)return y.current(P,S,N);N()}},[P,S,N,y]);const R=_.useMemo(()=>({reference:h,floating:m,setReference:E,setFloating:$}),[E,$]),B=_.useMemo(()=>({reference:P,floating:S}),[P,S]);return _.useMemo(()=>({...a,update:N,refs:R,elements:B,reference:E,floating:$}),[a,N,R,B,E,$])}var fu=typeof document<"u"?_.useLayoutEffect:_.useEffect;let A_=!1,wee=0;const n$=()=>"floating-ui-"+wee++;function bee(){const[e,t]=_.useState(()=>A_?n$():void 0);return fu(()=>{e==null&&t(n$())},[]),_.useEffect(()=>{A_||(A_=!0)},[]),e}const xee=Jd["useId".toString()],r$=xee||bee;function See(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){e.set(t,(e.get(t)||[]).filter(r=>r!==n))}}}const Pee=_.createContext(null),Oee=_.createContext(null),Kz=()=>{var e;return((e=_.useContext(Pee))==null?void 0:e.id)||null},DP=()=>_.useContext(Oee);function na(e){return e?.ownerDocument||document}function Cee(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function kee(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function jP(e){return na(e).defaultView||window}function Ni(e){return e?e instanceof jP(e).Element:!1}function qz(e){return e?e instanceof jP(e).HTMLElement:!1}function Eee(e){if(typeof ShadowRoot>"u")return!1;const t=jP(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function $ee(e){if(e.mozInputSource===0&&e.isTrusted)return!0;const t=/Android/i;return(t.test(Cee())||t.test(kee()))&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Mee(e){return e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType!=="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0}function Jz(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function o$(e){const t=_.useRef(e);return fu(()=>{t.current=e}),t}const i$="data-floating-ui-safe-polygon";function Qp(e,t,n){return n&&!Jz(n)?0:typeof e=="number"?e:e?.[t]}const Nee=function(e,t){let{enabled:n=!0,delay:r=0,handleClose:o=null,mouseOnly:i=!1,restMs:s=0,move:a=!0}=t===void 0?{}:t;const{open:c,onOpenChange:u,dataRef:f,events:h,elements:{domReference:m,floating:v},refs:y}=e,w=DP(),P=Kz(),b=o$(o),S=o$(r),O=_.useRef(),E=_.useRef(),$=_.useRef(),N=_.useRef(),I=_.useRef(!0),R=_.useRef(!1),B=_.useRef(()=>{}),z=_.useCallback(()=>{var V;const H=(V=f.current.openEvent)==null?void 0:V.type;return H?.includes("mouse")&&H!=="mousedown"},[f]);_.useEffect(()=>{if(!n)return;function V(){clearTimeout(E.current),clearTimeout(N.current),I.current=!0}return h.on("dismiss",V),()=>{h.off("dismiss",V)}},[n,h]),_.useEffect(()=>{if(!n||!b.current||!c)return;function V(){z()&&u(!1)}const H=na(v).documentElement;return H.addEventListener("mouseleave",V),()=>{H.removeEventListener("mouseleave",V)}},[v,c,u,n,b,f,z]);const G=_.useCallback(function(V){V===void 0&&(V=!0);const H=Qp(S.current,"close",O.current);H&&!$.current?(clearTimeout(E.current),E.current=setTimeout(()=>u(!1),H)):V&&(clearTimeout(E.current),u(!1))},[S,u]),Q=_.useCallback(()=>{B.current(),$.current=void 0},[]),X=_.useCallback(()=>{if(R.current){const V=na(y.floating.current).body;V.style.pointerEvents="",V.removeAttribute(i$),R.current=!1}},[y]);return _.useEffect(()=>{if(!n)return;function V(){return f.current.openEvent?["click","mousedown"].includes(f.current.openEvent.type):!1}function H(D){if(clearTimeout(E.current),I.current=!1,i&&!Jz(O.current)||s>0&&Qp(S.current,"open")===0)return;f.current.openEvent=D;const W=Qp(S.current,"open",O.current);W?E.current=setTimeout(()=>{u(!0)},W):u(!0)}function Z(D){if(V())return;B.current();const W=na(v);if(clearTimeout(N.current),b.current){c||clearTimeout(E.current),$.current=b.current({...e,tree:w,x:D.clientX,y:D.clientY,onClose(){X(),Q(),G()}});const F=$.current;W.addEventListener("mousemove",F),B.current=()=>{W.removeEventListener("mousemove",F)};return}G()}function Y(D){V()||b.current==null||b.current({...e,tree:w,x:D.clientX,y:D.clientY,onClose(){X(),Q(),G()}})(D)}if(Ni(m)){const D=m;return c&&D.addEventListener("mouseleave",Y),v?.addEventListener("mouseleave",Y),a&&D.addEventListener("mousemove",H,{once:!0}),D.addEventListener("mouseenter",H),D.addEventListener("mouseleave",Z),()=>{c&&D.removeEventListener("mouseleave",Y),v?.removeEventListener("mouseleave",Y),a&&D.removeEventListener("mousemove",H),D.removeEventListener("mouseenter",H),D.removeEventListener("mouseleave",Z)}}},[m,v,n,e,i,s,a,G,Q,X,u,c,w,S,b,f]),fu(()=>{var V;if(n&&c&&(V=b.current)!=null&&V.__options.blockPointerEvents&&z()){const Y=na(v).body;if(Y.setAttribute(i$,""),Y.style.pointerEvents="none",R.current=!0,Ni(m)&&v){var H,Z;const D=m,W=w==null||(H=w.nodesRef.current.find(F=>F.id===P))==null||(Z=H.context)==null?void 0:Z.elements.floating;return W&&(W.style.pointerEvents=""),D.style.pointerEvents="auto",v.style.pointerEvents="auto",()=>{D.style.pointerEvents="",v.style.pointerEvents=""}}}},[n,c,P,v,m,w,b,f,z]),fu(()=>{c||(O.current=void 0,Q(),X())},[c,Q,X]),_.useEffect(()=>()=>{Q(),clearTimeout(E.current),clearTimeout(N.current),X()},[n,Q,X]),_.useMemo(()=>{if(!n)return{};function V(H){O.current=H.pointerType}return{reference:{onPointerDown:V,onPointerEnter:V,onMouseMove(){c||s===0||(clearTimeout(N.current),N.current=setTimeout(()=>{I.current||u(!0)},s))}},floating:{onMouseEnter(){clearTimeout(E.current)},onMouseLeave(){h.emit("dismiss",{type:"mouseLeave",data:{returnFocus:!1}}),G(!1)}}}},[h,n,s,c,u,G])},Qz=_.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:()=>{},setState:()=>{},isInstantPhase:!1}),Xz=()=>_.useContext(Qz),Tee=e=>{let{children:t,delay:n,timeoutMs:r=0}=e;const[o,i]=_.useReducer((c,u)=>({...c,...u}),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),s=_.useRef(null),a=_.useCallback(c=>{i({currentId:c})},[]);return fu(()=>{o.currentId?s.current===null?s.current=o.currentId:i({isInstantPhase:!0}):(i({isInstantPhase:!1}),s.current=null)},[o.currentId]),_.createElement(Qz.Provider,{value:_.useMemo(()=>({...o,setState:i,setCurrentId:a}),[o,i,a])},t)},Iee=(e,t)=>{let{open:n,onOpenChange:r}=e,{id:o}=t;const{currentId:i,setCurrentId:s,initialDelay:a,setState:c,timeoutMs:u}=Xz();_.useEffect(()=>{i&&(c({delay:{open:1,close:Qp(a,"close")}}),i!==o&&r(!1))},[o,r,c,i,a]),_.useEffect(()=>{function f(){r(!1),c({delay:a,currentId:null})}if(!n&&i===o)if(u){const h=window.setTimeout(f,u);return()=>{clearTimeout(h)}}else f()},[n,c,i,o,r,a,u]),_.useEffect(()=>{n&&s(o)},[n,s,o])};function Dee(e){let t=e.activeElement;for(;((n=t)==null||(r=n.shadowRoot)==null?void 0:r.activeElement)!=null;){var n,r;t=t.shadowRoot.activeElement}return t}function s$(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Eee(n)){let r=t;do{if(r&&e===r)return!0;r=r.parentNode||r.host}while(r)}return!1}function B_(e,t){let n=e.filter(o=>{var i;return o.parentId===t&&((i=o.context)==null?void 0:i.open)})||[],r=n;for(;r.length;)r=e.filter(o=>{var i;return(i=r)==null?void 0:i.some(s=>{var a;return o.parentId===s.id&&((a=o.context)==null?void 0:a.open)})})||[],n=n.concat(r);return n}function jee(e){return"composedPath"in e?e.composedPath()[0]:e.target}const Lee=Jd["useInsertionEffect".toString()],Ree=Lee||(e=>e());function eA(e){const t=_.useRef(()=>{});return Ree(()=>{t.current=e}),_.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o!1),$=typeof m=="function"?E:m,N=_.useRef(!1),{escapeKeyBubbles:I,outsidePressBubbles:R}=Bee(b);return _.useEffect(()=>{if(!n||!f)return;u.current.__escapeKeyBubbles=I,u.current.__outsidePressBubbles=R;function B(V){if(V.key==="Escape"){const H=S?B_(S.nodesRef.current,i):[];if(H.length>0){let Z=!0;if(H.forEach(Y=>{var D;if((D=Y.context)!=null&&D.open&&!Y.context.dataRef.current.__escapeKeyBubbles){Z=!1;return}}),!Z)return}o.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),r(!1)}}function z(V){const H=N.current;if(N.current=!1,H||typeof $=="function"&&!$(V))return;const Z=jee(V);if(qz(Z)&&c){const W=c.ownerDocument.defaultView||window,F=Z.scrollWidth>Z.clientWidth,K=Z.scrollHeight>Z.clientHeight;let ee=K&&V.offsetX>Z.clientWidth;if(K&&W.getComputedStyle(Z).direction==="rtl"&&(ee=V.offsetX<=Z.offsetWidth-Z.clientWidth),ee||F&&V.offsetY>Z.clientHeight)return}const Y=S&&B_(S.nodesRef.current,i).some(W=>{var F;return Xp(V,(F=W.context)==null?void 0:F.elements.floating)});if(Xp(V,c)||Xp(V,a)||Y)return;const D=S?B_(S.nodesRef.current,i):[];if(D.length>0){let W=!0;if(D.forEach(F=>{var K;if((K=F.context)!=null&&K.open&&!F.context.dataRef.current.__outsidePressBubbles){W=!1;return}}),!W)return}o.emit("dismiss",{type:"outsidePress",data:{returnFocus:O?{preventScroll:!0}:$ee(V)||Mee(V)}}),r(!1)}function G(){r(!1)}const Q=na(c);h&&Q.addEventListener("keydown",B),$&&Q.addEventListener(v,z);let X=[];return P&&(Ni(a)&&(X=hs(a)),Ni(c)&&(X=X.concat(hs(c))),!Ni(s)&&s&&s.contextElement&&(X=X.concat(hs(s.contextElement)))),X=X.filter(V=>{var H;return V!==((H=Q.defaultView)==null?void 0:H.visualViewport)}),X.forEach(V=>{V.addEventListener("scroll",G,{passive:!0})}),()=>{h&&Q.removeEventListener("keydown",B),$&&Q.removeEventListener(v,z),X.forEach(V=>{V.removeEventListener("scroll",G)})}},[u,c,a,s,h,$,v,o,S,i,n,r,P,f,I,R,O]),_.useEffect(()=>{N.current=!1},[$,v]),_.useMemo(()=>f?{reference:{[zee[w]]:()=>{y&&(o.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),r(!1))}},floating:{[Aee[v]]:()=>{N.current=!0}}}:{},[f,o,y,v,w,r])},Vee=function(e,t){let{open:n,onOpenChange:r,dataRef:o,events:i,refs:s,elements:{floating:a,domReference:c}}=e,{enabled:u=!0,keyboardOnly:f=!0}=t===void 0?{}:t;const h=_.useRef(""),m=_.useRef(!1),v=_.useRef();return _.useEffect(()=>{if(!u)return;const w=na(a).defaultView||window;function P(){!n&&qz(c)&&c===Dee(na(c))&&(m.current=!0)}return w.addEventListener("blur",P),()=>{w.removeEventListener("blur",P)}},[a,c,n,u]),_.useEffect(()=>{if(!u)return;function y(w){(w.type==="referencePress"||w.type==="escapeKey")&&(m.current=!0)}return i.on("dismiss",y),()=>{i.off("dismiss",y)}},[i,u]),_.useEffect(()=>()=>{clearTimeout(v.current)},[]),_.useMemo(()=>u?{reference:{onPointerDown(y){let{pointerType:w}=y;h.current=w,m.current=!!(w&&f)},onMouseLeave(){m.current=!1},onFocus(y){var w;m.current||y.type==="focus"&&((w=o.current.openEvent)==null?void 0:w.type)==="mousedown"&&o.current.openEvent&&Xp(o.current.openEvent,c)||(o.current.openEvent=y.nativeEvent,r(!0))},onBlur(y){m.current=!1;const w=y.relatedTarget,P=Ni(w)&&w.hasAttribute("data-floating-ui-focus-guard")&&w.getAttribute("data-type")==="outside";v.current=setTimeout(()=>{s$(s.floating.current,w)||s$(c,w)||P||r(!1)})}}}:{},[u,f,c,s,o,r])},Hee=function(e,t){let{open:n}=e,{enabled:r=!0,role:o="dialog"}=t===void 0?{}:t;const i=r$(),s=r$();return _.useMemo(()=>{const a={id:i,role:o};return r?o==="tooltip"?{reference:{"aria-describedby":n?i:void 0},floating:a}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":o==="alertdialog"?"dialog":o,"aria-controls":n?i:void 0,...o==="listbox"&&{role:"combobox"},...o==="menu"&&{id:s}},floating:{...a,...o==="menu"&&{"aria-labelledby":s}}}:{}},[r,o,n,i,s])};function LP(e){e===void 0&&(e={});const{open:t=!1,onOpenChange:n,nodeId:r}=e,o=_ee(e),i=DP(),s=_.useRef(null),a=_.useRef({}),c=_.useState(()=>See())[0],[u,f]=_.useState(null),h=_.useCallback(b=>{const S=Ni(b)?{getBoundingClientRect:()=>b.getBoundingClientRect(),contextElement:b}:b;o.refs.setReference(S)},[o.refs]),m=_.useCallback(b=>{(Ni(b)||b===null)&&(s.current=b,f(b)),(Ni(o.refs.reference.current)||o.refs.reference.current===null||b!==null&&!Ni(b))&&o.refs.setReference(b)},[o.refs]),v=_.useMemo(()=>({...o.refs,setReference:m,setPositionReference:h,domReference:s}),[o.refs,m,h]),y=_.useMemo(()=>({...o.elements,domReference:u}),[o.elements,u]),w=eA(n),P=_.useMemo(()=>({...o,refs:v,elements:y,dataRef:a,nodeId:r,events:c,open:t,onOpenChange:w}),[o,r,c,t,w,v,y]);return fu(()=>{const b=i?.nodesRef.current.find(S=>S.id===r);b&&(b.context=P)}),_.useMemo(()=>({...o,context:P,refs:v,reference:m,positionReference:h}),[o,v,P,m,h])}function F_(e,t,n){const r=new Map;return{...n==="floating"&&{tabIndex:-1},...e,...t.map(o=>o?o[n]:null).concat(e).reduce((o,i)=>(i&&Object.entries(i).forEach(s=>{let[a,c]=s;if(a.indexOf("on")===0){if(r.has(a)||r.set(a,[]),typeof c=="function"){var u;(u=r.get(a))==null||u.push(c),o[a]=function(){for(var f,h=arguments.length,m=new Array(h),v=0;vy(...m))}}}else o[a]=c}),o),{})}}const Wee=function(e){e===void 0&&(e=[]);const t=e,n=_.useCallback(i=>F_(i,e,"reference"),t),r=_.useCallback(i=>F_(i,e,"floating"),t),o=_.useCallback(i=>F_(i,e,"item"),e.map(i=>i?.item));return _.useMemo(()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:o}),[n,r,o])};function tA({opened:e,floating:t,position:n,positionDependencies:r}){const[o,i]=_.useState(0);_.useEffect(()=>{if(t.refs.reference.current&&t.refs.floating.current)return vee(t.refs.reference.current,t.refs.floating.current,t.update)},[t.refs.reference.current,t.refs.floating.current,e,o,n]),Hn(()=>{t.update()},r),Hn(()=>{i(s=>s+1)},[e])}function Uee(e){const t=[Bz(e.offset)];return e.middlewares.shift&&t.push(MP({limiter:QX()})),e.middlewares.flip&&t.push(Rz()),e.middlewares.inline&&t.push(Az()),t.push(Yz({element:e.arrowRef,padding:e.arrowOffset})),t}function Zee(e){const[t,n]=_o({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),r=()=>{var s;(s=e.onClose)==null||s.call(e),n(!1)},o=()=>{var s,a;t?((s=e.onClose)==null||s.call(e),n(!1)):((a=e.onOpen)==null||a.call(e),n(!0))},i=LP({placement:e.position,middleware:[...Uee(e),...e.width==="target"?[XX({apply({rects:s}){var a,c;Object.assign((c=(a=i.refs.floating.current)==null?void 0:a.style)!=null?c:{},{width:`${s.reference.width}px`})}})]:[]]});return tA({opened:e.opened,position:e.position,positionDependencies:e.positionDependencies,floating:i}),Hn(()=>{var s;(s=e.onPositionChange)==null||s.call(e,i.placement)},[i.placement]),Hn(()=>{var s,a;e.opened?(a=e.onOpen)==null||a.call(e):(s=e.onClose)==null||s.call(e)},[e.opened]),{floating:i,controlled:typeof e.opened=="boolean",opened:t,onClose:r,onToggle:o}}const nA={context:"Popover component was not found in the tree",children:"Popover.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported"},[Gee,rA]=Cu(nA.context);var Yee=Object.defineProperty,Kee=Object.defineProperties,qee=Object.getOwnPropertyDescriptors,_g=Object.getOwnPropertySymbols,oA=Object.prototype.hasOwnProperty,iA=Object.prototype.propertyIsEnumerable,a$=(e,t,n)=>t in e?Yee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ep=(e,t)=>{for(var n in t||(t={}))oA.call(t,n)&&a$(e,n,t[n]);if(_g)for(var n of _g(t))iA.call(t,n)&&a$(e,n,t[n]);return e},Jee=(e,t)=>Kee(e,qee(t)),Qee=(e,t)=>{var n={};for(var r in e)oA.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&_g)for(var r of _g(e))t.indexOf(r)<0&&iA.call(e,r)&&(n[r]=e[r]);return n};const Xee={refProp:"ref",popupType:"dialog",shouldOverrideDefaultTargetId:!0},sA=_.forwardRef((e,t)=>{const n=ae("PopoverTarget",Xee,e),{children:r,refProp:o,popupType:i,shouldOverrideDefaultTargetId:s}=n,a=Qee(n,["children","refProp","popupType","shouldOverrideDefaultTargetId"]);if(!zf(r))throw new Error(nA.children);const c=a,u=rA(),f=Ps(u.reference,r.ref,t),h=u.withRoles?{"aria-haspopup":i,"aria-expanded":u.opened,"aria-controls":u.getDropdownId(),id:s?u.getTargetId():r.props.id}:{};return _.cloneElement(r,ep(Jee(ep(ep(ep({},c),h),u.targetProps),{className:_S(u.targetProps.className,c.className,r.props.className),[o]:f}),u.controlled?null:{onClick:u.onToggle}))});sA.displayName="@mantine/core/PopoverTarget";var ete=ue((e,{radius:t,shadow:n})=>({dropdown:{position:"absolute",backgroundColor:e.white,background:e.colorScheme==="dark"?e.colors.dark[6]:e.white,border:`${M(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]}`,padding:`${e.spacing.sm} ${e.spacing.md}`,boxShadow:e.shadows[n]||n||"none",borderRadius:e.fn.radius(t),"&:focus":{outline:0}},arrow:{backgroundColor:"inherit",border:`${M(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]}`,zIndex:1}}));const tte=ete;var nte=Object.defineProperty,l$=Object.getOwnPropertySymbols,rte=Object.prototype.hasOwnProperty,ote=Object.prototype.propertyIsEnumerable,c$=(e,t,n)=>t in e?nte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,cc=(e,t)=>{for(var n in t||(t={}))rte.call(t,n)&&c$(e,n,t[n]);if(l$)for(var n of l$(t))ote.call(t,n)&&c$(e,n,t[n]);return e};const u$={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function ite({transition:e,state:t,duration:n,timingFunction:r}){const o={transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e=="string"?e in Mh?cc(cc(cc({transitionProperty:Mh[e].transitionProperty},o),Mh[e].common),Mh[e][u$[t]]):null:cc(cc(cc({transitionProperty:e.transitionProperty},o),e.common),e[u$[t]])}function ste({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:o,onExit:i,onEntered:s,onExited:a}){const c=ar(),u=MS(),f=c.respectReducedMotion?u:!1,[h,m]=_.useState(f?0:e),[v,y]=_.useState(r?"entered":"exited"),w=_.useRef(-1),P=b=>{const S=b?o:i,O=b?s:a;y(b?"pre-entering":"pre-exiting"),window.clearTimeout(w.current);const E=f?0:b?e:t;if(m(E),E===0)typeof S=="function"&&S(),typeof O=="function"&&O(),y(b?"entered":"exited");else{const $=window.setTimeout(()=>{typeof S=="function"&&S(),y(b?"entering":"exiting")},10);w.current=window.setTimeout(()=>{window.clearTimeout($),typeof O=="function"&&O(),y(b?"entered":"exited")},E)}};return Hn(()=>{P(r)},[r]),_.useEffect(()=>()=>window.clearTimeout(w.current),[]),{transitionDuration:h,transitionStatus:v,transitionTimingFunction:n||c.transitionTimingFunction}}function $s({keepMounted:e,transition:t,duration:n=250,exitDuration:r=n,mounted:o,children:i,timingFunction:s,onExit:a,onEntered:c,onEnter:u,onExited:f}){const{transitionDuration:h,transitionStatus:m,transitionTimingFunction:v}=ste({mounted:o,exitDuration:r,duration:n,timingFunction:s,onExit:a,onEntered:c,onEnter:u,onExited:f});return h===0?o?k.createElement(k.Fragment,null,i({})):e?i({display:"none"}):null:m==="exited"?e?i({display:"none"}):null:k.createElement(k.Fragment,null,i(ite({transition:t,duration:h,state:m,timingFunction:v})))}$s.displayName="@mantine/core/Transition";function RP({children:e,active:t=!0,refProp:n="ref"}){const r=fY(t),o=Ps(r,e?.ref);return zf(e)?_.cloneElement(e,{[n]:o}):e}RP.displayName="@mantine/core/FocusTrap";var ate=Object.defineProperty,lte=Object.defineProperties,cte=Object.getOwnPropertyDescriptors,d$=Object.getOwnPropertySymbols,ute=Object.prototype.hasOwnProperty,dte=Object.prototype.propertyIsEnumerable,f$=(e,t,n)=>t in e?ate(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ls=(e,t)=>{for(var n in t||(t={}))ute.call(t,n)&&f$(e,n,t[n]);if(d$)for(var n of d$(t))dte.call(t,n)&&f$(e,n,t[n]);return e},tp=(e,t)=>lte(e,cte(t));function h$(e,t,n,r){return e==="center"||r==="center"?{top:t}:e==="end"?{bottom:n}:e==="start"?{top:n}:{}}function p$(e,t,n,r,o){return e==="center"||r==="center"?{left:t}:e==="end"?{[o==="ltr"?"right":"left"]:n}:e==="start"?{[o==="ltr"?"left":"right"]:n}:{}}const fte={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function hte({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,arrowX:i,arrowY:s,dir:a}){const[c,u="center"]=e.split("-"),f={width:M(t),height:M(t),transform:"rotate(45deg)",position:"absolute",[fte[c]]:M(r)},h=M(-t/2);return c==="left"?tp(Ls(Ls({},f),h$(u,s,n,o)),{right:h,borderLeftColor:"transparent",borderBottomColor:"transparent"}):c==="right"?tp(Ls(Ls({},f),h$(u,s,n,o)),{left:h,borderRightColor:"transparent",borderTopColor:"transparent"}):c==="top"?tp(Ls(Ls({},f),p$(u,i,n,o,a)),{bottom:h,borderTopColor:"transparent",borderLeftColor:"transparent"}):c==="bottom"?tp(Ls(Ls({},f),p$(u,i,n,o,a)),{top:h,borderBottomColor:"transparent",borderRightColor:"transparent"}):{}}var pte=Object.defineProperty,mte=Object.defineProperties,gte=Object.getOwnPropertyDescriptors,wg=Object.getOwnPropertySymbols,aA=Object.prototype.hasOwnProperty,lA=Object.prototype.propertyIsEnumerable,m$=(e,t,n)=>t in e?pte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vte=(e,t)=>{for(var n in t||(t={}))aA.call(t,n)&&m$(e,n,t[n]);if(wg)for(var n of wg(t))lA.call(t,n)&&m$(e,n,t[n]);return e},yte=(e,t)=>mte(e,gte(t)),_te=(e,t)=>{var n={};for(var r in e)aA.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&wg)for(var r of wg(e))t.indexOf(r)<0&&lA.call(e,r)&&(n[r]=e[r]);return n};const zP=_.forwardRef((e,t)=>{var n=e,{position:r,arrowSize:o,arrowOffset:i,arrowRadius:s,arrowPosition:a,visible:c,arrowX:u,arrowY:f}=n,h=_te(n,["position","arrowSize","arrowOffset","arrowRadius","arrowPosition","visible","arrowX","arrowY"]);const m=ar();return c?k.createElement("div",yte(vte({},h),{ref:t,style:hte({position:r,arrowSize:o,arrowOffset:i,arrowRadius:s,arrowPosition:a,dir:m.dir,arrowX:u,arrowY:f})})):null});zP.displayName="@mantine/core/FloatingArrow";var wte=Object.defineProperty,bte=Object.defineProperties,xte=Object.getOwnPropertyDescriptors,bg=Object.getOwnPropertySymbols,cA=Object.prototype.hasOwnProperty,uA=Object.prototype.propertyIsEnumerable,g$=(e,t,n)=>t in e?wte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,uc=(e,t)=>{for(var n in t||(t={}))cA.call(t,n)&&g$(e,n,t[n]);if(bg)for(var n of bg(t))uA.call(t,n)&&g$(e,n,t[n]);return e},np=(e,t)=>bte(e,xte(t)),Ste=(e,t)=>{var n={};for(var r in e)cA.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&bg)for(var r of bg(e))t.indexOf(r)<0&&uA.call(e,r)&&(n[r]=e[r]);return n};const Pte={};function dA(e){var t;const n=ae("PopoverDropdown",Pte,e),{style:r,className:o,children:i,onKeyDownCapture:s}=n,a=Ste(n,["style","className","children","onKeyDownCapture"]),c=rA(),{classes:u,cx:f}=tte({radius:c.radius,shadow:c.shadow},{name:c.__staticSelector,classNames:c.classNames,styles:c.styles,unstyled:c.unstyled,variant:c.variant}),h=g5({opened:c.opened,shouldReturnFocus:c.returnFocus}),m=c.withRoles?{"aria-labelledby":c.getTargetId(),id:c.getDropdownId(),role:"dialog"}:{};return c.disabled?null:k.createElement(Zf,np(uc({},c.portalProps),{withinPortal:c.withinPortal}),k.createElement($s,np(uc({mounted:c.opened},c.transitionProps),{transition:c.transitionProps.transition||"fade",duration:(t=c.transitionProps.duration)!=null?t:150,keepMounted:c.keepMounted,exitDuration:typeof c.transitionProps.exitDuration=="number"?c.transitionProps.exitDuration:c.transitionProps.duration}),v=>{var y,w;return k.createElement(RP,{active:c.trapFocus},k.createElement(Pe,uc(np(uc({},m),{tabIndex:-1,ref:c.floating,style:np(uc(uc({},r),v),{zIndex:c.zIndex,top:(y=c.y)!=null?y:0,left:(w=c.x)!=null?w:0,width:c.width==="target"?void 0:M(c.width)}),className:f(u.dropdown,o),onKeyDownCapture:TU(c.onClose,{active:c.closeOnEscape,onTrigger:h,onKeyDown:s}),"data-position":c.placement}),a),i,k.createElement(zP,{ref:c.arrowRef,arrowX:c.arrowX,arrowY:c.arrowY,visible:c.withArrow,position:c.placement,arrowSize:c.arrowSize,arrowRadius:c.arrowRadius,arrowOffset:c.arrowOffset,arrowPosition:c.arrowPosition,className:u.arrow})))}))}dA.displayName="@mantine/core/PopoverDropdown";function fA(e,t){if(e==="rtl"&&(t.includes("right")||t.includes("left"))){const[n,r]=t.split("-"),o=n==="right"?"left":"right";return r===void 0?o:`${o}-${r}`}return t}var v$=Object.getOwnPropertySymbols,Ote=Object.prototype.hasOwnProperty,Cte=Object.prototype.propertyIsEnumerable,kte=(e,t)=>{var n={};for(var r in e)Ote.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&v$)for(var r of v$(e))t.indexOf(r)<0&&Cte.call(e,r)&&(n[r]=e[r]);return n};const Ete={position:"bottom",offset:8,positionDependencies:[],transitionProps:{transition:"fade",duration:150},middlewares:{flip:!0,shift:!0,inline:!1},arrowSize:7,arrowOffset:5,arrowRadius:0,arrowPosition:"side",closeOnClickOutside:!0,withinPortal:!1,closeOnEscape:!0,trapFocus:!1,withRoles:!0,returnFocus:!1,clickOutsideEvents:["mousedown","touchstart"],zIndex:ci("popover"),__staticSelector:"Popover",width:"max-content"};function En(e){var t,n,r,o,i,s;const a=_.useRef(null),c=ae("Popover",Ete,e),{children:u,position:f,offset:h,onPositionChange:m,positionDependencies:v,opened:y,transitionProps:w,width:P,middlewares:b,withArrow:S,arrowSize:O,arrowOffset:E,arrowRadius:$,arrowPosition:N,unstyled:I,classNames:R,styles:B,closeOnClickOutside:z,withinPortal:G,portalProps:Q,closeOnEscape:X,clickOutsideEvents:V,trapFocus:H,onClose:Z,onOpen:Y,onChange:D,zIndex:W,radius:F,shadow:K,id:ee,defaultOpened:fe,__staticSelector:ie,withRoles:J,disabled:ne,returnFocus:le,variant:_e,keepMounted:Ne}=c,we=kte(c,["children","position","offset","onPositionChange","positionDependencies","opened","transitionProps","width","middlewares","withArrow","arrowSize","arrowOffset","arrowRadius","arrowPosition","unstyled","classNames","styles","closeOnClickOutside","withinPortal","portalProps","closeOnEscape","clickOutsideEvents","trapFocus","onClose","onOpen","onChange","zIndex","radius","shadow","id","defaultOpened","__staticSelector","withRoles","disabled","returnFocus","variant","keepMounted"]),[He,Te]=_.useState(null),[De,st]=_.useState(null),bt=Ia(ee),wn=ar(),ht=Zee({middlewares:b,width:P,position:fA(wn.dir,f),offset:typeof h=="number"?h+(S?O/2:0):h,arrowRef:a,arrowOffset:E,onPositionChange:m,positionDependencies:v,opened:y,defaultOpened:fe,onChange:D,onOpen:Y,onClose:Z});nY(()=>ht.opened&&z&&ht.onClose(),V,[He,De]);const In=_.useCallback(lt=>{Te(lt),ht.floating.reference(lt)},[ht.floating.reference]),Er=_.useCallback(lt=>{st(lt),ht.floating.floating(lt)},[ht.floating.floating]);return k.createElement(Gee,{value:{returnFocus:le,disabled:ne,controlled:ht.controlled,reference:In,floating:Er,x:ht.floating.x,y:ht.floating.y,arrowX:(r=(n=(t=ht.floating)==null?void 0:t.middlewareData)==null?void 0:n.arrow)==null?void 0:r.x,arrowY:(s=(i=(o=ht.floating)==null?void 0:o.middlewareData)==null?void 0:i.arrow)==null?void 0:s.y,opened:ht.opened,arrowRef:a,transitionProps:w,width:P,withArrow:S,arrowSize:O,arrowOffset:E,arrowRadius:$,arrowPosition:N,placement:ht.floating.placement,trapFocus:H,withinPortal:G,portalProps:Q,zIndex:W,radius:F,shadow:K,closeOnEscape:X,onClose:ht.onClose,onToggle:ht.onToggle,getTargetId:()=>`${bt}-target`,getDropdownId:()=>`${bt}-dropdown`,withRoles:J,targetProps:we,__staticSelector:ie,classNames:R,styles:B,unstyled:I,variant:_e,keepMounted:Ne}},u)}En.Target=sA;En.Dropdown=dA;En.displayName="@mantine/core/Popover";var $te=Object.defineProperty,xg=Object.getOwnPropertySymbols,hA=Object.prototype.hasOwnProperty,pA=Object.prototype.propertyIsEnumerable,y$=(e,t,n)=>t in e?$te(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mte=(e,t)=>{for(var n in t||(t={}))hA.call(t,n)&&y$(e,n,t[n]);if(xg)for(var n of xg(t))pA.call(t,n)&&y$(e,n,t[n]);return e},Nte=(e,t)=>{var n={};for(var r in e)hA.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&xg)for(var r of xg(e))t.indexOf(r)<0&&pA.call(e,r)&&(n[r]=e[r]);return n};function Tte(e){var t=e,{children:n,component:r="div",maxHeight:o=220,direction:i="column",id:s,innerRef:a,__staticSelector:c,styles:u,classNames:f,unstyled:h}=t,m=Nte(t,["children","component","maxHeight","direction","id","innerRef","__staticSelector","styles","classNames","unstyled"]);const{classes:v}=FX(null,{name:c,styles:u,classNames:f,unstyled:h});return k.createElement(En.Dropdown,Mte({p:0,onMouseDown:y=>y.preventDefault()},m),k.createElement("div",{style:{maxHeight:M(o),display:"flex"}},k.createElement(Pe,{component:r||"div",id:`${s}-items`,"aria-labelledby":`${s}-label`,role:"listbox",onMouseDown:y=>y.preventDefault(),style:{flex:1,overflowY:r!==A0?"auto":void 0},"data-combobox-popover":!0,tabIndex:-1,ref:a},k.createElement("div",{className:v.itemsWrapper,style:{flexDirection:i}},n))))}function ya({opened:e,transitionProps:t={transition:"fade",duration:0},shadow:n,withinPortal:r,portalProps:o,children:i,__staticSelector:s,onDirectionChange:a,switchDirectionOnFlip:c,zIndex:u,dropdownPosition:f,positionDependencies:h=[],classNames:m,styles:v,unstyled:y,readOnly:w,variant:P}){return k.createElement(En,{unstyled:y,classNames:m,styles:v,width:"target",withRoles:!1,opened:e,middlewares:{flip:f==="flip",shift:!1},position:f==="flip"?"bottom":f,positionDependencies:h,zIndex:u,__staticSelector:s,withinPortal:r,portalProps:o,transitionProps:t,shadow:n,disabled:w,onPositionChange:b=>c&&a?.(b==="top"?"column-reverse":"column"),variant:P},i)}ya.Target=En.Target;ya.Dropdown=Tte;var Ite=Object.defineProperty,Dte=Object.defineProperties,jte=Object.getOwnPropertyDescriptors,Sg=Object.getOwnPropertySymbols,mA=Object.prototype.hasOwnProperty,gA=Object.prototype.propertyIsEnumerable,_$=(e,t,n)=>t in e?Ite(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,rp=(e,t)=>{for(var n in t||(t={}))mA.call(t,n)&&_$(e,n,t[n]);if(Sg)for(var n of Sg(t))gA.call(t,n)&&_$(e,n,t[n]);return e},Lte=(e,t)=>Dte(e,jte(t)),Rte=(e,t)=>{var n={};for(var r in e)mA.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Sg)for(var r of Sg(e))t.indexOf(r)<0&&gA.call(e,r)&&(n[r]=e[r]);return n};function AP(e,t,n){const r=ae(e,t,n),{label:o,description:i,error:s,required:a,classNames:c,styles:u,className:f,unstyled:h,__staticSelector:m,sx:v,errorProps:y,labelProps:w,descriptionProps:P,wrapperProps:b,id:S,size:O,style:E,inputContainer:$,inputWrapperOrder:N,withAsterisk:I,variant:R}=r,B=Rte(r,["label","description","error","required","classNames","styles","className","unstyled","__staticSelector","sx","errorProps","labelProps","descriptionProps","wrapperProps","id","size","style","inputContainer","inputWrapperOrder","withAsterisk","variant"]),z=Ia(S),{systemStyles:G,rest:Q}=Bl(B),X=rp({label:o,description:i,error:s,required:a,classNames:c,className:f,__staticSelector:m,sx:v,errorProps:y,labelProps:w,descriptionProps:P,unstyled:h,styles:u,id:z,size:O,style:E,inputContainer:$,inputWrapperOrder:N,withAsterisk:I,variant:R},b);return Lte(rp({},Q),{classNames:c,styles:u,unstyled:h,wrapperProps:rp(rp({},X),G),inputProps:{required:a,classNames:c,styles:u,unstyled:h,id:z,size:O,__staticSelector:m,error:s,variant:R}})}var zte=ue((e,t,{size:n})=>({label:{display:"inline-block",fontSize:re({size:n,sizes:e.fontSizes}),fontWeight:500,color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[9],wordBreak:"break-word",cursor:"default",WebkitTapHighlightColor:"transparent"},required:{color:e.fn.variant({variant:"filled",color:"red"}).background}}));const Ate=zte;var Bte=Object.defineProperty,Pg=Object.getOwnPropertySymbols,vA=Object.prototype.hasOwnProperty,yA=Object.prototype.propertyIsEnumerable,w$=(e,t,n)=>t in e?Bte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Fte=(e,t)=>{for(var n in t||(t={}))vA.call(t,n)&&w$(e,n,t[n]);if(Pg)for(var n of Pg(t))yA.call(t,n)&&w$(e,n,t[n]);return e},Vte=(e,t)=>{var n={};for(var r in e)vA.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Pg)for(var r of Pg(e))t.indexOf(r)<0&&yA.call(e,r)&&(n[r]=e[r]);return n};const Hte={labelElement:"label",size:"sm"},BP=_.forwardRef((e,t)=>{const n=ae("InputLabel",Hte,e),{labelElement:r,children:o,required:i,size:s,classNames:a,styles:c,unstyled:u,className:f,htmlFor:h,__staticSelector:m,variant:v,onMouseDown:y}=n,w=Vte(n,["labelElement","children","required","size","classNames","styles","unstyled","className","htmlFor","__staticSelector","variant","onMouseDown"]),{classes:P,cx:b}=Ate(null,{name:["InputWrapper",m],classNames:a,styles:c,unstyled:u,variant:v,size:s});return k.createElement(Pe,Fte({component:r,ref:t,className:b(P.label,f),htmlFor:r==="label"?h:void 0,onMouseDown:S=>{y?.(S),!S.defaultPrevented&&S.detail>1&&S.preventDefault()}},w),o,i&&k.createElement("span",{className:P.required,"aria-hidden":!0}," *"))});BP.displayName="@mantine/core/InputLabel";var Wte=ue((e,t,{size:n})=>({error:{wordBreak:"break-word",color:e.fn.variant({variant:"filled",color:"red"}).background,fontSize:`calc(${re({size:n,sizes:e.fontSizes})} - ${M(2)})`,lineHeight:1.2,display:"block"}}));const Ute=Wte;var Zte=Object.defineProperty,Og=Object.getOwnPropertySymbols,_A=Object.prototype.hasOwnProperty,wA=Object.prototype.propertyIsEnumerable,b$=(e,t,n)=>t in e?Zte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Gte=(e,t)=>{for(var n in t||(t={}))_A.call(t,n)&&b$(e,n,t[n]);if(Og)for(var n of Og(t))wA.call(t,n)&&b$(e,n,t[n]);return e},Yte=(e,t)=>{var n={};for(var r in e)_A.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Og)for(var r of Og(e))t.indexOf(r)<0&&wA.call(e,r)&&(n[r]=e[r]);return n};const Kte={size:"sm"},FP=_.forwardRef((e,t)=>{const n=ae("InputError",Kte,e),{children:r,className:o,classNames:i,styles:s,unstyled:a,size:c,__staticSelector:u,variant:f}=n,h=Yte(n,["children","className","classNames","styles","unstyled","size","__staticSelector","variant"]),{classes:m,cx:v}=Ute(null,{name:["InputWrapper",u],classNames:i,styles:s,unstyled:a,variant:f,size:c});return k.createElement(U,Gte({className:v(m.error,o),ref:t},h),r)});FP.displayName="@mantine/core/InputError";var qte=ue((e,t,{size:n})=>({description:{wordBreak:"break-word",color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],fontSize:`calc(${re({size:n,sizes:e.fontSizes})} - ${M(2)})`,lineHeight:1.2,display:"block"}}));const Jte=qte;var Qte=Object.defineProperty,Cg=Object.getOwnPropertySymbols,bA=Object.prototype.hasOwnProperty,xA=Object.prototype.propertyIsEnumerable,x$=(e,t,n)=>t in e?Qte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Xte=(e,t)=>{for(var n in t||(t={}))bA.call(t,n)&&x$(e,n,t[n]);if(Cg)for(var n of Cg(t))xA.call(t,n)&&x$(e,n,t[n]);return e},ene=(e,t)=>{var n={};for(var r in e)bA.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Cg)for(var r of Cg(e))t.indexOf(r)<0&&xA.call(e,r)&&(n[r]=e[r]);return n};const tne={size:"sm"},VP=_.forwardRef((e,t)=>{const n=ae("InputDescription",tne,e),{children:r,className:o,classNames:i,styles:s,unstyled:a,size:c,__staticSelector:u,variant:f}=n,h=ene(n,["children","className","classNames","styles","unstyled","size","__staticSelector","variant"]),{classes:m,cx:v}=Jte(null,{name:["InputWrapper",u],classNames:i,styles:s,unstyled:a,variant:f,size:c});return k.createElement(U,Xte({color:"dimmed",className:v(m.description,o),ref:t,unstyled:a},h),r)});VP.displayName="@mantine/core/InputDescription";const SA=_.createContext({offsetBottom:!1,offsetTop:!1,describedBy:void 0}),nne=SA.Provider,rne=()=>_.useContext(SA);function one(e,{hasDescription:t,hasError:n}){const r=e.findIndex(c=>c==="input"),o=e[r-1],i=e[r+1];return{offsetBottom:t&&i==="description"||n&&i==="error",offsetTop:t&&o==="description"||n&&o==="error"}}var ine=Object.defineProperty,sne=Object.defineProperties,ane=Object.getOwnPropertyDescriptors,S$=Object.getOwnPropertySymbols,lne=Object.prototype.hasOwnProperty,cne=Object.prototype.propertyIsEnumerable,P$=(e,t,n)=>t in e?ine(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,une=(e,t)=>{for(var n in t||(t={}))lne.call(t,n)&&P$(e,n,t[n]);if(S$)for(var n of S$(t))cne.call(t,n)&&P$(e,n,t[n]);return e},dne=(e,t)=>sne(e,ane(t)),fne=ue(e=>({root:dne(une({},e.fn.fontStyles()),{lineHeight:e.lineHeight})}));const hne=fne;var pne=Object.defineProperty,mne=Object.defineProperties,gne=Object.getOwnPropertyDescriptors,kg=Object.getOwnPropertySymbols,PA=Object.prototype.hasOwnProperty,OA=Object.prototype.propertyIsEnumerable,O$=(e,t,n)=>t in e?pne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Rs=(e,t)=>{for(var n in t||(t={}))PA.call(t,n)&&O$(e,n,t[n]);if(kg)for(var n of kg(t))OA.call(t,n)&&O$(e,n,t[n]);return e},C$=(e,t)=>mne(e,gne(t)),vne=(e,t)=>{var n={};for(var r in e)PA.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&kg)for(var r of kg(e))t.indexOf(r)<0&&OA.call(e,r)&&(n[r]=e[r]);return n};const yne={labelElement:"label",size:"sm",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},CA=_.forwardRef((e,t)=>{const n=ae("InputWrapper",yne,e),{className:r,label:o,children:i,required:s,id:a,error:c,description:u,labelElement:f,labelProps:h,descriptionProps:m,errorProps:v,classNames:y,styles:w,size:P,inputContainer:b,__staticSelector:S,unstyled:O,inputWrapperOrder:E,withAsterisk:$,variant:N}=n,I=vne(n,["className","label","children","required","id","error","description","labelElement","labelProps","descriptionProps","errorProps","classNames","styles","size","inputContainer","__staticSelector","unstyled","inputWrapperOrder","withAsterisk","variant"]),{classes:R,cx:B}=hne(null,{classNames:y,styles:w,name:["InputWrapper",S],unstyled:O,variant:N,size:P}),z={classNames:y,styles:w,unstyled:O,size:P,variant:N,__staticSelector:S},G=typeof $=="boolean"?$:s,Q=a?`${a}-error`:v?.id,X=a?`${a}-description`:m?.id,H=`${!!c&&typeof c!="boolean"?Q:""} ${u?X:""}`,Z=H.trim().length>0?H.trim():void 0,Y=o&&k.createElement(BP,Rs(Rs({key:"label",labelElement:f,id:a?`${a}-label`:void 0,htmlFor:a,required:G},z),h),o),D=u&&k.createElement(VP,C$(Rs(Rs({key:"description"},m),z),{size:m?.size||z.size,id:m?.id||X}),u),W=k.createElement(_.Fragment,{key:"input"},b(i)),F=typeof c!="boolean"&&c&&k.createElement(FP,C$(Rs(Rs({},v),z),{size:v?.size||z.size,key:"error",id:v?.id||Q}),c),K=E.map(ee=>{switch(ee){case"label":return Y;case"input":return W;case"description":return D;case"error":return F;default:return null}});return k.createElement(nne,{value:Rs({describedBy:Z},one(E,{hasDescription:!!D,hasError:!!F}))},k.createElement(Pe,Rs({className:B(R.root,r),ref:t},I),K))});CA.displayName="@mantine/core/InputWrapper";var _ne=Object.defineProperty,Eg=Object.getOwnPropertySymbols,kA=Object.prototype.hasOwnProperty,EA=Object.prototype.propertyIsEnumerable,k$=(e,t,n)=>t in e?_ne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wne=(e,t)=>{for(var n in t||(t={}))kA.call(t,n)&&k$(e,n,t[n]);if(Eg)for(var n of Eg(t))EA.call(t,n)&&k$(e,n,t[n]);return e},bne=(e,t)=>{var n={};for(var r in e)kA.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Eg)for(var r of Eg(e))t.indexOf(r)<0&&EA.call(e,r)&&(n[r]=e[r]);return n};const xne={},$A=_.forwardRef((e,t)=>{const n=ae("InputPlaceholder",xne,e),{sx:r}=n,o=bne(n,["sx"]);return k.createElement(Pe,wne({component:"span",sx:[i=>i.fn.placeholderStyles(),...yS(r)],ref:t},o))});$A.displayName="@mantine/core/InputPlaceholder";var Sne=Object.defineProperty,Pne=Object.defineProperties,One=Object.getOwnPropertyDescriptors,E$=Object.getOwnPropertySymbols,Cne=Object.prototype.hasOwnProperty,kne=Object.prototype.propertyIsEnumerable,$$=(e,t,n)=>t in e?Sne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,op=(e,t)=>{for(var n in t||(t={}))Cne.call(t,n)&&$$(e,n,t[n]);if(E$)for(var n of E$(t))kne.call(t,n)&&$$(e,n,t[n]);return e},V_=(e,t)=>Pne(e,One(t));const Rn={xs:M(30),sm:M(36),md:M(42),lg:M(50),xl:M(60)},Ene=["default","filled","unstyled"];function $ne({theme:e,variant:t}){return Ene.includes(t)?t==="default"?{border:`${M(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`,backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white,transition:"border-color 100ms ease","&:focus, &:focus-within":e.focusRingStyles.inputStyles(e)}:t==="filled"?{border:`${M(1)} solid transparent`,backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1],"&:focus, &:focus-within":e.focusRingStyles.inputStyles(e)}:{borderWidth:0,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,backgroundColor:"transparent",minHeight:M(28),outline:0,"&:focus, &:focus-within":{outline:"none",borderColor:"transparent"},"&:disabled":{backgroundColor:"transparent","&:focus, &:focus-within":{outline:"none",borderColor:"transparent"}}}:null}var Mne=ue((e,{multiline:t,radius:n,invalid:r,rightSectionWidth:o,withRightSection:i,iconWidth:s,offsetBottom:a,offsetTop:c,pointer:u},{variant:f,size:h})=>{const m=e.fn.variant({variant:"filled",color:"red"}).background,v=f==="default"||f==="filled"?{minHeight:re({size:h,sizes:Rn}),paddingLeft:`calc(${re({size:h,sizes:Rn})} / 3)`,paddingRight:i?o||re({size:h,sizes:Rn}):`calc(${re({size:h,sizes:Rn})} / 3)`,borderRadius:e.fn.radius(n)}:f==="unstyled"&&i?{paddingRight:o||re({size:h,sizes:Rn})}:null;return{wrapper:{position:"relative",marginTop:c?`calc(${e.spacing.xs} / 2)`:void 0,marginBottom:a?`calc(${e.spacing.xs} / 2)`:void 0,"&:has(input:disabled)":{"& .mantine-Input-rightSection":{display:"none"}}},input:V_(op(op(V_(op({},e.fn.fontStyles()),{height:t?f==="unstyled"?void 0:"auto":re({size:h,sizes:Rn}),WebkitTapHighlightColor:"transparent",lineHeight:t?e.lineHeight:`calc(${re({size:h,sizes:Rn})} - ${M(2)})`,appearance:"none",resize:"none",boxSizing:"border-box",fontSize:re({size:h,sizes:e.fontSizes}),width:"100%",color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,display:"block",textAlign:"left",cursor:u?"pointer":void 0}),$ne({theme:e,variant:f})),v),{"&:disabled, &[data-disabled]":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[1],color:e.colors.dark[2],opacity:.6,cursor:"not-allowed",pointerEvents:"none","&::placeholder":{color:e.colors.dark[2]}},"&[data-invalid]":{color:m,borderColor:m,"&::placeholder":{opacity:1,color:m}},"&[data-with-icon]":{paddingLeft:typeof s=="number"?M(s):re({size:h,sizes:Rn})},"&::placeholder":V_(op({},e.fn.placeholderStyles()),{opacity:1}),"&::-webkit-inner-spin-button, &::-webkit-outer-spin-button, &::-webkit-search-decoration, &::-webkit-search-cancel-button, &::-webkit-search-results-button, &::-webkit-search-results-decoration":{appearance:"none"},"&[type=number]":{MozAppearance:"textfield"}}),icon:{pointerEvents:"none",position:"absolute",zIndex:1,left:0,top:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",width:s?M(s):re({size:h,sizes:Rn}),color:r?e.colors.red[e.colorScheme==="dark"?6:7]:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[5]},rightSection:{position:"absolute",top:0,bottom:0,right:0,display:"flex",alignItems:"center",justifyContent:"center",width:o||re({size:h,sizes:Rn})}}});const Nne=Mne;var Tne=Object.defineProperty,Ine=Object.defineProperties,Dne=Object.getOwnPropertyDescriptors,$g=Object.getOwnPropertySymbols,MA=Object.prototype.hasOwnProperty,NA=Object.prototype.propertyIsEnumerable,M$=(e,t,n)=>t in e?Tne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ip=(e,t)=>{for(var n in t||(t={}))MA.call(t,n)&&M$(e,n,t[n]);if($g)for(var n of $g(t))NA.call(t,n)&&M$(e,n,t[n]);return e},N$=(e,t)=>Ine(e,Dne(t)),jne=(e,t)=>{var n={};for(var r in e)MA.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&$g)for(var r of $g(e))t.indexOf(r)<0&&NA.call(e,r)&&(n[r]=e[r]);return n};const Lne={size:"sm",variant:"default"},Ul=_.forwardRef((e,t)=>{const n=ae("Input",Lne,e),{className:r,error:o,required:i,disabled:s,variant:a,icon:c,style:u,rightSectionWidth:f,iconWidth:h,rightSection:m,rightSectionProps:v,radius:y,size:w,wrapperProps:P,classNames:b,styles:S,__staticSelector:O,multiline:E,sx:$,unstyled:N,pointer:I}=n,R=jne(n,["className","error","required","disabled","variant","icon","style","rightSectionWidth","iconWidth","rightSection","rightSectionProps","radius","size","wrapperProps","classNames","styles","__staticSelector","multiline","sx","unstyled","pointer"]),{offsetBottom:B,offsetTop:z,describedBy:G}=rne(),{classes:Q,cx:X}=Nne({radius:y,multiline:E,invalid:!!o,rightSectionWidth:f?M(f):void 0,iconWidth:h,withRightSection:!!m,offsetBottom:B,offsetTop:z,pointer:I},{classNames:b,styles:S,name:["Input",O],unstyled:N,variant:a,size:w}),{systemStyles:V,rest:H}=Bl(R);return k.createElement(Pe,ip(ip({className:X(Q.wrapper,r),sx:$,style:u},V),P),c&&k.createElement("div",{className:Q.icon},c),k.createElement(Pe,N$(ip({component:"input"},H),{ref:t,required:i,"aria-invalid":!!o,"aria-describedby":G,disabled:s,"data-disabled":s||void 0,"data-with-icon":!!c||void 0,"data-invalid":!!o||void 0,className:Q.input})),m&&k.createElement("div",N$(ip({},v),{className:Q.rightSection}),m))});Ul.displayName="@mantine/core/Input";Ul.Wrapper=CA;Ul.Label=BP;Ul.Description=VP;Ul.Error=FP;Ul.Placeholder=$A;const et=Ul;var Rne=Object.defineProperty,Mg=Object.getOwnPropertySymbols,TA=Object.prototype.hasOwnProperty,IA=Object.prototype.propertyIsEnumerable,T$=(e,t,n)=>t in e?Rne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zne=(e,t)=>{for(var n in t||(t={}))TA.call(t,n)&&T$(e,n,t[n]);if(Mg)for(var n of Mg(t))IA.call(t,n)&&T$(e,n,t[n]);return e},Ane=(e,t)=>{var n={};for(var r in e)TA.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Mg)for(var r of Mg(e))t.indexOf(r)<0&&IA.call(e,r)&&(n[r]=e[r]);return n};function Bne(e){const t=e,{style:n}=t,r=Ane(t,["style"]);return k.createElement("svg",zne({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:n},r),k.createElement("path",{d:"M0.877014 7.49988C0.877014 3.84219 3.84216 0.877045 7.49985 0.877045C11.1575 0.877045 14.1227 3.84219 14.1227 7.49988C14.1227 11.1575 11.1575 14.1227 7.49985 14.1227C3.84216 14.1227 0.877014 11.1575 0.877014 7.49988ZM7.49985 1.82704C4.36683 1.82704 1.82701 4.36686 1.82701 7.49988C1.82701 8.97196 2.38774 10.3131 3.30727 11.3213C4.19074 9.94119 5.73818 9.02499 7.50023 9.02499C9.26206 9.02499 10.8093 9.94097 11.6929 11.3208C12.6121 10.3127 13.1727 8.97172 13.1727 7.49988C13.1727 4.36686 10.6328 1.82704 7.49985 1.82704ZM10.9818 11.9787C10.2839 10.7795 8.9857 9.97499 7.50023 9.97499C6.01458 9.97499 4.71624 10.7797 4.01845 11.9791C4.97952 12.7272 6.18765 13.1727 7.49985 13.1727C8.81227 13.1727 10.0206 12.727 10.9818 11.9787ZM5.14999 6.50487C5.14999 5.207 6.20212 4.15487 7.49999 4.15487C8.79786 4.15487 9.84999 5.207 9.84999 6.50487C9.84999 7.80274 8.79786 8.85487 7.49999 8.85487C6.20212 8.85487 5.14999 7.80274 5.14999 6.50487ZM7.49999 5.10487C6.72679 5.10487 6.09999 5.73167 6.09999 6.50487C6.09999 7.27807 6.72679 7.90487 7.49999 7.90487C8.27319 7.90487 8.89999 7.27807 8.89999 6.50487C8.89999 5.73167 8.27319 5.10487 7.49999 5.10487Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}var Fne=Object.defineProperty,Vne=Object.defineProperties,Hne=Object.getOwnPropertyDescriptors,I$=Object.getOwnPropertySymbols,Wne=Object.prototype.hasOwnProperty,Une=Object.prototype.propertyIsEnumerable,D$=(e,t,n)=>t in e?Fne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Zne=(e,t)=>{for(var n in t||(t={}))Wne.call(t,n)&&D$(e,n,t[n]);if(I$)for(var n of I$(t))Une.call(t,n)&&D$(e,n,t[n]);return e},Gne=(e,t)=>Vne(e,Hne(t));const DA=_.createContext(null);function Yne({spacing:e,children:t}){return k.createElement(DA.Provider,{value:{spacing:e}},t)}function Kne(){const e=_.useContext(DA);return e?Gne(Zne({},e),{withinGroup:!0}):{spacing:null,withinGroup:!1}}var qne=ue((e,{spacing:t})=>({root:{display:"flex",paddingLeft:re({size:t,sizes:e.spacing})}}));const Jne=qne;var Qne=Object.defineProperty,Ng=Object.getOwnPropertySymbols,jA=Object.prototype.hasOwnProperty,LA=Object.prototype.propertyIsEnumerable,j$=(e,t,n)=>t in e?Qne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Xne=(e,t)=>{for(var n in t||(t={}))jA.call(t,n)&&j$(e,n,t[n]);if(Ng)for(var n of Ng(t))LA.call(t,n)&&j$(e,n,t[n]);return e},ere=(e,t)=>{var n={};for(var r in e)jA.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ng)for(var r of Ng(e))t.indexOf(r)<0&&LA.call(e,r)&&(n[r]=e[r]);return n};const tre={},RA=_.forwardRef((e,t)=>{const n=ae("AvatarGroup",tre,e),{children:r,spacing:o="sm",unstyled:i,className:s,variant:a}=n,c=ere(n,["children","spacing","unstyled","className","variant"]),{classes:u,cx:f}=Jne({spacing:o},{name:"AvatarGroup",unstyled:i,variant:a});return k.createElement(Yne,{spacing:o},k.createElement(Pe,Xne({ref:t,className:f(u.root,s)},c),r))});RA.displayName="@mantine/core/AvatarGroup";var nre=Object.defineProperty,rre=Object.defineProperties,ore=Object.getOwnPropertyDescriptors,L$=Object.getOwnPropertySymbols,ire=Object.prototype.hasOwnProperty,sre=Object.prototype.propertyIsEnumerable,R$=(e,t,n)=>t in e?nre(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ud=(e,t)=>{for(var n in t||(t={}))ire.call(t,n)&&R$(e,n,t[n]);if(L$)for(var n of L$(t))sre.call(t,n)&&R$(e,n,t[n]);return e},z$=(e,t)=>rre(e,ore(t));const are=["filled","light","gradient","outline"],sp={xs:M(16),sm:M(26),md:M(38),lg:M(56),xl:M(84)};function lre({withinGroup:e,spacing:t,theme:n}){return e?{marginLeft:`calc(${re({size:t,sizes:n.spacing})} * -1)`,backgroundColor:`${n.colorScheme==="dark"?n.colors.dark[7]:n.white}`,border:`${M(2)} solid ${n.colorScheme==="dark"?n.colors.dark[7]:n.white}`}:null}function cre({theme:e,variant:t,color:n,gradient:r}){const o=e.fn.variant({variant:t,color:n,gradient:r});return are.includes(t)?{placeholder:{color:o.color,backgroundColor:o.background,backgroundImage:t==="gradient"?o.background:void 0,border:`${M(t==="gradient"?0:1)} solid ${o.border}`},placeholderIcon:{color:o.color}}:{}}var ure=ue((e,{radius:t,withinGroup:n,spacing:r,color:o,gradient:i},{variant:s,size:a})=>{const c=cre({theme:e,color:o,gradient:i,variant:s});return{root:ud(z$(ud({},e.fn.focusStyles()),{WebkitTapHighlightColor:"transparent",boxSizing:"border-box",position:"relative",display:"block",userSelect:"none",overflow:"hidden",borderRadius:e.fn.radius(t),textDecoration:"none",border:0,backgroundColor:"transparent",padding:0,width:re({size:a,sizes:sp}),minWidth:re({size:a,sizes:sp}),height:re({size:a,sizes:sp})}),lre({withinGroup:n,spacing:r,theme:e})),image:{objectFit:"cover",width:"100%",height:"100%",display:"block"},placeholder:ud(z$(ud({},e.fn.fontStyles()),{fontWeight:700,display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",userSelect:"none",borderRadius:e.fn.radius(t),fontSize:`calc(${re({size:a,sizes:sp})} / 2.5)`}),c.placeholder),placeholderIcon:ud({width:"70%",height:"70%"},c.placeholderIcon)}});const dre=ure;var fre=Object.defineProperty,hre=Object.defineProperties,pre=Object.getOwnPropertyDescriptors,Tg=Object.getOwnPropertySymbols,zA=Object.prototype.hasOwnProperty,AA=Object.prototype.propertyIsEnumerable,A$=(e,t,n)=>t in e?fre(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,B$=(e,t)=>{for(var n in t||(t={}))zA.call(t,n)&&A$(e,n,t[n]);if(Tg)for(var n of Tg(t))AA.call(t,n)&&A$(e,n,t[n]);return e},mre=(e,t)=>hre(e,pre(t)),gre=(e,t)=>{var n={};for(var r in e)zA.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Tg)for(var r of Tg(e))t.indexOf(r)<0&&AA.call(e,r)&&(n[r]=e[r]);return n};const vre={size:"md",color:"gray",variant:"light"},HP=_.forwardRef((e,t)=>{const n=ae("Avatar",vre,e),{className:r,size:o,src:i,alt:s,radius:a,children:c,color:u,variant:f,gradient:h,classNames:m,styles:v,imageProps:y,unstyled:w}=n,P=gre(n,["className","size","src","alt","radius","children","color","variant","gradient","classNames","styles","imageProps","unstyled"]),b=Kne(),[S,O]=_.useState(!i),{classes:E,cx:$}=dre({color:u,radius:a,withinGroup:b.withinGroup,spacing:b.spacing,gradient:h},{classNames:m,styles:v,unstyled:w,name:"Avatar",variant:f,size:o});return _.useEffect(()=>{O(!i)},[i]),k.createElement(Pe,B$({component:"div",className:$(E.root,r),ref:t},P),S?k.createElement("div",{className:E.placeholder,title:s},c||k.createElement(Bne,{className:E.placeholderIcon})):k.createElement("img",mre(B$({},y),{className:E.image,src:i,alt:s,onError:()=>O(!0)})))});HP.displayName="@mantine/core/Avatar";HP.Group=RA;const WP=HP;var yre=Object.defineProperty,_re=Object.defineProperties,wre=Object.getOwnPropertyDescriptors,F$=Object.getOwnPropertySymbols,bre=Object.prototype.hasOwnProperty,xre=Object.prototype.propertyIsEnumerable,V$=(e,t,n)=>t in e?yre(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,H_=(e,t)=>{for(var n in t||(t={}))bre.call(t,n)&&V$(e,n,t[n]);if(F$)for(var n of F$(t))xre.call(t,n)&&V$(e,n,t[n]);return e},Sre=(e,t)=>_re(e,wre(t));const Pre=["light","filled","outline","dot","gradient"],W_={xs:{fontSize:M(9),height:M(16)},sm:{fontSize:M(10),height:M(18)},md:{fontSize:M(11),height:M(20)},lg:{fontSize:M(13),height:M(26)},xl:{fontSize:M(16),height:M(32)}},Ore={xs:M(4),sm:M(4),md:M(6),lg:M(8),xl:M(10)};function Cre({theme:e,variant:t,color:n,size:r,gradient:o}){if(!Pre.includes(t))return null;if(t==="dot"){const s=re({size:r,sizes:Ore});return{backgroundColor:"transparent",color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],border:`${M(1)} solid ${e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[3]}`,paddingLeft:`calc(${re({size:r,sizes:e.spacing})} / 1.5 - ${s} / 2)`,"&::before":{content:'""',display:"block",width:s,height:s,borderRadius:s,backgroundColor:e.fn.themeColor(n,e.colorScheme==="dark"?4:e.fn.primaryShade("light"),!0),marginRight:s}}}const i=e.fn.variant({color:n,variant:t,gradient:o});return{background:i.background,color:i.color,border:`${M(t==="gradient"?0:1)} solid ${i.border}`}}var kre=ue((e,{color:t,radius:n,gradient:r,fullWidth:o},{variant:i,size:s})=>{const{fontSize:a,height:c}=s in W_?W_[s]:W_.md;return{leftSection:{marginRight:`calc(${e.spacing.xs} / 2)`},rightSection:{marginLeft:`calc(${e.spacing.xs} / 2)`},inner:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},root:H_(Sre(H_(H_({},e.fn.focusStyles()),e.fn.fontStyles()),{fontSize:a,height:c,WebkitTapHighlightColor:"transparent",lineHeight:`calc(${c} - ${M(2)})`,textDecoration:"none",padding:`0 calc(${re({size:s,sizes:e.spacing})} / 1.5)`,boxSizing:"border-box",display:o?"flex":"inline-flex",alignItems:"center",justifyContent:"center",width:o?"100%":"auto",textTransform:"uppercase",borderRadius:e.fn.radius(n),fontWeight:700,letterSpacing:M(.25),cursor:"inherit",textOverflow:"ellipsis",overflow:"hidden"}),Cre({theme:e,variant:i,color:t,size:s,gradient:r}))}});const Ere=kre;var $re=Object.defineProperty,Ig=Object.getOwnPropertySymbols,BA=Object.prototype.hasOwnProperty,FA=Object.prototype.propertyIsEnumerable,H$=(e,t,n)=>t in e?$re(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mre=(e,t)=>{for(var n in t||(t={}))BA.call(t,n)&&H$(e,n,t[n]);if(Ig)for(var n of Ig(t))FA.call(t,n)&&H$(e,n,t[n]);return e},Nre=(e,t)=>{var n={};for(var r in e)BA.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ig)for(var r of Ig(e))t.indexOf(r)<0&&FA.call(e,r)&&(n[r]=e[r]);return n};const Tre={variant:"light",size:"md",radius:"xl"},VA=_.forwardRef((e,t)=>{const n=ae("Badge",Tre,e),{className:r,color:o,variant:i,fullWidth:s,children:a,size:c,leftSection:u,rightSection:f,radius:h,gradient:m,classNames:v,styles:y,unstyled:w}=n,P=Nre(n,["className","color","variant","fullWidth","children","size","leftSection","rightSection","radius","gradient","classNames","styles","unstyled"]),{classes:b,cx:S}=Ere({fullWidth:s,color:o,radius:h,gradient:m},{classNames:v,styles:y,name:"Badge",unstyled:w,variant:i,size:c});return k.createElement(Pe,Mre({className:S(b.root,r),ref:t},P),u&&k.createElement("span",{className:b.leftSection},u),k.createElement("span",{className:b.inner},a),f&&k.createElement("span",{className:b.rightSection},f))});VA.displayName="@mantine/core/Badge";const mt=VA;var Ire=ue((e,{orientation:t,buttonBorderWidth:n})=>({root:{display:"flex",flexDirection:t==="vertical"?"column":"row","& [data-button]":{"&:first-of-type:not(:last-of-type)":{borderBottomRightRadius:0,[t==="vertical"?"borderBottomLeftRadius":"borderTopRightRadius"]:0,[t==="vertical"?"borderBottomWidth":"borderRightWidth"]:`calc(${M(n)} / 2)`},"&:last-of-type:not(:first-of-type)":{borderTopLeftRadius:0,[t==="vertical"?"borderTopRightRadius":"borderBottomLeftRadius"]:0,[t==="vertical"?"borderTopWidth":"borderLeftWidth"]:`calc(${M(n)} / 2)`},"&:not(:first-of-type):not(:last-of-type)":{borderRadius:0,[t==="vertical"?"borderTopWidth":"borderLeftWidth"]:`calc(${M(n)} / 2)`,[t==="vertical"?"borderBottomWidth":"borderRightWidth"]:`calc(${M(n)} / 2)`},"& + [data-button]":{[t==="vertical"?"marginTop":"marginLeft"]:`calc(${n} * -1)`,"@media (min-resolution: 192dpi)":{[t==="vertical"?"marginTop":"marginLeft"]:0}}}}}));const Dre=Ire;var jre=Object.defineProperty,Dg=Object.getOwnPropertySymbols,HA=Object.prototype.hasOwnProperty,WA=Object.prototype.propertyIsEnumerable,W$=(e,t,n)=>t in e?jre(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Lre=(e,t)=>{for(var n in t||(t={}))HA.call(t,n)&&W$(e,n,t[n]);if(Dg)for(var n of Dg(t))WA.call(t,n)&&W$(e,n,t[n]);return e},Rre=(e,t)=>{var n={};for(var r in e)HA.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Dg)for(var r of Dg(e))t.indexOf(r)<0&&WA.call(e,r)&&(n[r]=e[r]);return n};const zre={orientation:"horizontal",buttonBorderWidth:1},UA=_.forwardRef((e,t)=>{const n=ae("ButtonGroup",zre,e),{className:r,orientation:o,buttonBorderWidth:i,unstyled:s}=n,a=Rre(n,["className","orientation","buttonBorderWidth","unstyled"]),{classes:c,cx:u}=Dre({orientation:o,buttonBorderWidth:i},{name:"ButtonGroup",unstyled:s});return k.createElement(Pe,Lre({className:u(c.root,r),ref:t},a))});UA.displayName="@mantine/core/ButtonGroup";var Are=Object.defineProperty,Bre=Object.defineProperties,Fre=Object.getOwnPropertyDescriptors,U$=Object.getOwnPropertySymbols,Vre=Object.prototype.hasOwnProperty,Hre=Object.prototype.propertyIsEnumerable,Z$=(e,t,n)=>t in e?Are(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ss=(e,t)=>{for(var n in t||(t={}))Vre.call(t,n)&&Z$(e,n,t[n]);if(U$)for(var n of U$(t))Hre.call(t,n)&&Z$(e,n,t[n]);return e},em=(e,t)=>Bre(e,Fre(t));const Wre=["filled","outline","light","white","default","subtle","gradient"],ax={xs:{height:Rn.xs,paddingLeft:M(14),paddingRight:M(14)},sm:{height:Rn.sm,paddingLeft:M(18),paddingRight:M(18)},md:{height:Rn.md,paddingLeft:M(22),paddingRight:M(22)},lg:{height:Rn.lg,paddingLeft:M(26),paddingRight:M(26)},xl:{height:Rn.xl,paddingLeft:M(32),paddingRight:M(32)},"compact-xs":{height:M(22),paddingLeft:M(7),paddingRight:M(7)},"compact-sm":{height:M(26),paddingLeft:M(8),paddingRight:M(8)},"compact-md":{height:M(30),paddingLeft:M(10),paddingRight:M(10)},"compact-lg":{height:M(34),paddingLeft:M(12),paddingRight:M(12)},"compact-xl":{height:M(40),paddingLeft:M(14),paddingRight:M(14)}};function Ure({compact:e,size:t,withLeftIcon:n,withRightIcon:r}){if(e)return ax[`compact-${t}`];const o=ax[t];return o?em(ss({},o),{paddingLeft:n?`calc(${o.paddingLeft} / 1.5)`:o.paddingLeft,paddingRight:r?`calc(${o.paddingRight} / 1.5)`:o.paddingRight}):{}}const Zre=e=>({display:e?"block":"inline-block",width:e?"100%":"auto"});function Gre({variant:e,theme:t,color:n,gradient:r}){if(!Wre.includes(e))return null;const o=t.fn.variant({color:n,variant:e,gradient:r});return e==="gradient"?ss({border:0,backgroundImage:o.background,color:o.color},t.fn.hover({backgroundSize:"200%"})):ss({border:`${M(1)} solid ${o.border}`,backgroundColor:o.background,color:o.color},t.fn.hover({backgroundColor:o.hover}))}var Yre=ue((e,{radius:t,fullWidth:n,compact:r,withLeftIcon:o,withRightIcon:i,color:s,gradient:a},{variant:c,size:u})=>({root:em(ss(em(ss(ss(ss(ss({},Ure({compact:r,size:u,withLeftIcon:o,withRightIcon:i})),e.fn.fontStyles()),e.fn.focusStyles()),Zre(n)),{borderRadius:e.fn.radius(t),fontWeight:600,position:"relative",lineHeight:1,fontSize:re({size:u,sizes:e.fontSizes}),userSelect:"none",cursor:"pointer"}),Gre({variant:c,theme:e,color:s,gradient:a})),{"&:active":e.activeStyles,"&:disabled, &[data-disabled]":{borderColor:"transparent",backgroundColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2],color:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[5],cursor:"not-allowed",backgroundImage:"none",pointerEvents:"none","&:active":{transform:"none"}},"&[data-loading]":{pointerEvents:"none","&::before":em(ss({content:'""'},e.fn.cover(M(-1))),{backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.colors.dark[7],.5):"rgba(255, 255, 255, .5)",borderRadius:e.fn.radius(t),cursor:"not-allowed"})}}),icon:{display:"flex",alignItems:"center"},leftIcon:{marginRight:e.spacing.xs},rightIcon:{marginLeft:e.spacing.xs},centerLoader:{position:"absolute",left:"50%",transform:"translateX(-50%)",opacity:.5},inner:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",overflow:"visible"},label:{whiteSpace:"nowrap",height:"100%",overflow:"hidden",display:"flex",alignItems:"center"}}));const Kre=Yre;var qre=Object.defineProperty,jg=Object.getOwnPropertySymbols,ZA=Object.prototype.hasOwnProperty,GA=Object.prototype.propertyIsEnumerable,G$=(e,t,n)=>t in e?qre(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Y$=(e,t)=>{for(var n in t||(t={}))ZA.call(t,n)&&G$(e,n,t[n]);if(jg)for(var n of jg(t))GA.call(t,n)&&G$(e,n,t[n]);return e},Jre=(e,t)=>{var n={};for(var r in e)ZA.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&jg)for(var r of jg(e))t.indexOf(r)<0&&GA.call(e,r)&&(n[r]=e[r]);return n};const Qre={size:"sm",type:"button",variant:"filled",loaderPosition:"left"},UP=_.forwardRef((e,t)=>{const n=ae("Button",Qre,e),{className:r,size:o,color:i,type:s,disabled:a,children:c,leftIcon:u,rightIcon:f,fullWidth:h,variant:m,radius:v,uppercase:y,compact:w,loading:P,loaderPosition:b,loaderProps:S,gradient:O,classNames:E,styles:$,unstyled:N}=n,I=Jre(n,["className","size","color","type","disabled","children","leftIcon","rightIcon","fullWidth","variant","radius","uppercase","compact","loading","loaderPosition","loaderProps","gradient","classNames","styles","unstyled"]),{classes:R,cx:B,theme:z}=Kre({radius:v,color:i,fullWidth:h,compact:w,gradient:O,withLeftIcon:!!u,withRightIcon:!!f},{name:"Button",unstyled:N,classNames:E,styles:$,variant:m,size:o}),G=z.fn.variant({color:i,variant:m}),Q=k.createElement(en,Y$({color:G.color,size:`calc(${re({size:o,sizes:ax}).height} / 2)`},S));return k.createElement(ds,Y$({className:B(R.root,r),type:s,disabled:a,"data-button":!0,"data-disabled":a||void 0,"data-loading":P||void 0,ref:t,unstyled:N},I),k.createElement("div",{className:R.inner},(u||P&&b==="left")&&k.createElement("span",{className:B(R.icon,R.leftIcon)},P&&b==="left"?Q:u),P&&b==="center"&&k.createElement("span",{className:R.centerLoader},Q),k.createElement("span",{className:R.label,style:{textTransform:y?"uppercase":void 0}},c),(f||P&&b==="right")&&k.createElement("span",{className:B(R.icon,R.rightIcon)},P&&b==="right"?Q:f)))});UP.displayName="@mantine/core/Button";UP.Group=UA;const at=UP;var Xre=ue((e,{radius:t,shadow:n})=>({root:{outline:0,WebkitTapHighlightColor:"transparent",display:"block",textDecoration:"none",color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white,boxSizing:"border-box",borderRadius:e.fn.radius(t),boxShadow:e.shadows[n]||n||"none","&[data-with-border]":{border:`${M(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`}}}));const eoe=Xre;var toe=Object.defineProperty,Lg=Object.getOwnPropertySymbols,YA=Object.prototype.hasOwnProperty,KA=Object.prototype.propertyIsEnumerable,K$=(e,t,n)=>t in e?toe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,noe=(e,t)=>{for(var n in t||(t={}))YA.call(t,n)&&K$(e,n,t[n]);if(Lg)for(var n of Lg(t))KA.call(t,n)&&K$(e,n,t[n]);return e},roe=(e,t)=>{var n={};for(var r in e)YA.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Lg)for(var r of Lg(e))t.indexOf(r)<0&&KA.call(e,r)&&(n[r]=e[r]);return n};const ooe={},qA=_.forwardRef((e,t)=>{const n=ae("Paper",ooe,e),{className:r,children:o,radius:i,withBorder:s,shadow:a,unstyled:c,variant:u}=n,f=roe(n,["className","children","radius","withBorder","shadow","unstyled","variant"]),{classes:h,cx:m}=eoe({radius:i,shadow:a},{name:"Paper",unstyled:c,variant:u});return k.createElement(Pe,noe({className:m(h.root,r),"data-with-border":s||void 0,ref:t},f),o)});qA.displayName="@mantine/core/Paper";const ioe=qA;var soe=ue((e,{inline:t})=>({root:{display:t?"inline-flex":"flex",alignItems:"center",justifyContent:"center"}}));const aoe=soe;var loe=Object.defineProperty,Rg=Object.getOwnPropertySymbols,JA=Object.prototype.hasOwnProperty,QA=Object.prototype.propertyIsEnumerable,q$=(e,t,n)=>t in e?loe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,coe=(e,t)=>{for(var n in t||(t={}))JA.call(t,n)&&q$(e,n,t[n]);if(Rg)for(var n of Rg(t))QA.call(t,n)&&q$(e,n,t[n]);return e},uoe=(e,t)=>{var n={};for(var r in e)JA.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Rg)for(var r of Rg(e))t.indexOf(r)<0&&QA.call(e,r)&&(n[r]=e[r]);return n};const XA=_.forwardRef((e,t)=>{const n=ae("Center",{},e),{inline:r,className:o,unstyled:i,variant:s}=n,a=uoe(n,["inline","className","unstyled","variant"]),{classes:c,cx:u}=aoe({inline:r},{name:"Center",unstyled:i,variant:s});return k.createElement(Pe,coe({ref:t,className:u(c.root,o)},a))});XA.displayName="@mantine/core/Center";const Zr=XA,e4=_.createContext(null),doe=e4.Provider,foe=()=>_.useContext(e4);var hoe=Object.defineProperty,zg=Object.getOwnPropertySymbols,t4=Object.prototype.hasOwnProperty,n4=Object.prototype.propertyIsEnumerable,J$=(e,t,n)=>t in e?hoe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Q$=(e,t)=>{for(var n in t||(t={}))t4.call(t,n)&&J$(e,n,t[n]);if(zg)for(var n of zg(t))n4.call(t,n)&&J$(e,n,t[n]);return e},poe=(e,t)=>{var n={};for(var r in e)t4.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&zg)for(var r of zg(e))t.indexOf(r)<0&&n4.call(e,r)&&(n[r]=e[r]);return n};const moe={size:"sm"},r4=_.forwardRef((e,t)=>{const n=ae("CheckboxGroup",moe,e),{children:r,value:o,defaultValue:i,onChange:s,size:a,wrapperProps:c}=n,u=poe(n,["children","value","defaultValue","onChange","size","wrapperProps"]),[f,h]=_o({value:o,defaultValue:i,finalValue:[],onChange:s}),m=v=>{const y=v.currentTarget.value;h(f.includes(y)?f.filter(w=>w!==y):[...f,y])};return k.createElement(doe,{value:{value:f,onChange:m,size:a}},k.createElement(et.Wrapper,Q$(Q$({labelElement:"div",size:a,__staticSelector:"CheckboxGroup",ref:t},c),u),r))});r4.displayName="@mantine/core/CheckboxGroup";var goe=Object.defineProperty,Ag=Object.getOwnPropertySymbols,o4=Object.prototype.hasOwnProperty,i4=Object.prototype.propertyIsEnumerable,X$=(e,t,n)=>t in e?goe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Bg=(e,t)=>{for(var n in t||(t={}))o4.call(t,n)&&X$(e,n,t[n]);if(Ag)for(var n of Ag(t))i4.call(t,n)&&X$(e,n,t[n]);return e},s4=(e,t)=>{var n={};for(var r in e)o4.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ag)for(var r of Ag(e))t.indexOf(r)<0&&i4.call(e,r)&&(n[r]=e[r]);return n};function voe(e){const t=e,{width:n,height:r,style:o}=t,i=s4(t,["width","height","style"]);return k.createElement("svg",Bg({viewBox:"0 0 10 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:Bg({width:n,height:r},o)},i),k.createElement("path",{d:"M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}function yoe(e){var t=e,{indeterminate:n}=t,r=s4(t,["indeterminate"]);return n?k.createElement("svg",Bg({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 6"},r),k.createElement("rect",{width:"32",height:"6",fill:"currentColor",rx:"3"})):k.createElement(voe,Bg({},r))}var _oe=Object.defineProperty,woe=Object.defineProperties,boe=Object.getOwnPropertyDescriptors,eM=Object.getOwnPropertySymbols,xoe=Object.prototype.hasOwnProperty,Soe=Object.prototype.propertyIsEnumerable,tM=(e,t,n)=>t in e?_oe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nM=(e,t)=>{for(var n in t||(t={}))xoe.call(t,n)&&tM(e,n,t[n]);if(eM)for(var n of eM(t))Soe.call(t,n)&&tM(e,n,t[n]);return e},rM=(e,t)=>woe(e,boe(t));const Poe={xs:M(16),sm:M(20),md:M(24),lg:M(30),xl:M(36)};var Ooe=ue((e,{radius:t,color:n,transitionDuration:r,labelPosition:o,error:i,indeterminate:s},{size:a})=>{const c=re({size:a,sizes:Poe}),u=e.fn.variant({variant:"filled",color:n});return{icon:rM(nM({},e.fn.cover()),{ref:Br("icon"),color:s?"inherit":e.white,transform:s?"none":`translateY(${M(5)}) scale(0.5)`,opacity:s?1:0,transitionProperty:"opacity, transform",transitionTimingFunction:"ease",transitionDuration:`${r}ms`,pointerEvents:"none",width:"60%",position:"absolute",zIndex:1,margin:"auto","@media (prefers-reduced-motion)":{transitionDuration:e.respectReducedMotion?"0ms":void 0}}),inner:{position:"relative",width:c,height:c,order:o==="left"?2:1},input:rM(nM({},e.fn.focusStyles()),{appearance:"none",backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white,border:`${M(1)} solid ${i?e.fn.variant({variant:"filled",color:"red"}).background:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`,width:c,height:c,borderRadius:e.fn.radius(t),padding:0,display:"block",margin:0,transition:`border-color ${r}ms ease, background-color ${r}ms ease`,cursor:e.cursorType,"&:checked":{backgroundColor:u.background,borderColor:u.background,[`& + .${Br("icon")}`]:{opacity:1,color:e.white,transform:"translateY(0) scale(1)"}},"&:disabled":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2],borderColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[3],cursor:"not-allowed",pointerEvents:"none",[`& + .${Br("icon")}`]:{color:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[5]}}})}});const Coe=Ooe;var koe=Object.defineProperty,Eoe=Object.defineProperties,$oe=Object.getOwnPropertyDescriptors,oM=Object.getOwnPropertySymbols,Moe=Object.prototype.hasOwnProperty,Noe=Object.prototype.propertyIsEnumerable,iM=(e,t,n)=>t in e?koe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Toe=(e,t)=>{for(var n in t||(t={}))Moe.call(t,n)&&iM(e,n,t[n]);if(oM)for(var n of oM(t))Noe.call(t,n)&&iM(e,n,t[n]);return e},Ioe=(e,t)=>Eoe(e,$oe(t));const U_={xs:M(16),sm:M(20),md:M(24),lg:M(30),xl:M(36)};var Doe=ue((e,{labelPosition:t},{size:n})=>({root:{},body:{display:"flex","&:has(input:disabled) label":{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]}},labelWrapper:Ioe(Toe({},e.fn.fontStyles()),{display:"inline-flex",flexDirection:"column",WebkitTapHighlightColor:"transparent",fontSize:n in U_?re({size:n,sizes:e.fontSizes}):void 0,lineHeight:n in U_?re({size:n,sizes:U_}):void 0,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,cursor:e.cursorType,order:t==="left"?1:2}),description:{marginTop:`calc(${e.spacing.xs} / 2)`,[t==="left"?"paddingRight":"paddingLeft"]:e.spacing.sm},error:{marginTop:`calc(${e.spacing.xs} / 2)`,[t==="left"?"paddingRight":"paddingLeft"]:e.spacing.sm},label:{cursor:e.cursorType,[t==="left"?"paddingRight":"paddingLeft"]:e.spacing.sm,"&:disabled, &[data-disabled]":{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]}}}));const joe=Doe;var Loe=Object.defineProperty,Fg=Object.getOwnPropertySymbols,a4=Object.prototype.hasOwnProperty,l4=Object.prototype.propertyIsEnumerable,sM=(e,t,n)=>t in e?Loe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Roe=(e,t)=>{for(var n in t||(t={}))a4.call(t,n)&&sM(e,n,t[n]);if(Fg)for(var n of Fg(t))l4.call(t,n)&&sM(e,n,t[n]);return e},zoe=(e,t)=>{var n={};for(var r in e)a4.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Fg)for(var r of Fg(e))t.indexOf(r)<0&&l4.call(e,r)&&(n[r]=e[r]);return n};const ZP=_.forwardRef((e,t)=>{var n=e,{__staticSelector:r,className:o,classNames:i,styles:s,unstyled:a,children:c,label:u,description:f,id:h,disabled:m,error:v,size:y,labelPosition:w,variant:P}=n,b=zoe(n,["__staticSelector","className","classNames","styles","unstyled","children","label","description","id","disabled","error","size","labelPosition","variant"]);const{classes:S,cx:O}=joe({labelPosition:w},{name:r,styles:s,classNames:i,unstyled:a,variant:P,size:y});return k.createElement(Pe,Roe({className:O(S.root,o),ref:t},b),k.createElement("div",{className:O(S.body)},c,k.createElement("div",{className:S.labelWrapper},u!=null&&k.createElement("label",{className:S.label,"data-disabled":m||void 0,htmlFor:h},u),f&&k.createElement(et.Description,{className:S.description},f),v&&v!=="boolean"&&k.createElement(et.Error,{className:S.error},v))))});ZP.displayName="@mantine/core/InlineInput";var Aoe=Object.defineProperty,Vg=Object.getOwnPropertySymbols,c4=Object.prototype.hasOwnProperty,u4=Object.prototype.propertyIsEnumerable,aM=(e,t,n)=>t in e?Aoe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ap=(e,t)=>{for(var n in t||(t={}))c4.call(t,n)&&aM(e,n,t[n]);if(Vg)for(var n of Vg(t))u4.call(t,n)&&aM(e,n,t[n]);return e},Boe=(e,t)=>{var n={};for(var r in e)c4.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Vg)for(var r of Vg(e))t.indexOf(r)<0&&u4.call(e,r)&&(n[r]=e[r]);return n};const Foe={size:"sm",transitionDuration:100,icon:yoe,labelPosition:"right"},vr=_.forwardRef((e,t)=>{const n=ae("Checkbox",Foe,e),{className:r,style:o,sx:i,checked:s,disabled:a,color:c,label:u,indeterminate:f,id:h,size:m,radius:v,wrapperProps:y,children:w,classNames:P,styles:b,transitionDuration:S,icon:O,unstyled:E,labelPosition:$,description:N,error:I,variant:R}=n,B=Boe(n,["className","style","sx","checked","disabled","color","label","indeterminate","id","size","radius","wrapperProps","children","classNames","styles","transitionDuration","icon","unstyled","labelPosition","description","error","variant"]),z=foe(),G=Ia(h),{systemStyles:Q,rest:X}=Bl(B),{classes:V}=Coe({radius:v,color:c,transitionDuration:S,labelPosition:$,error:!!I,indeterminate:f},{name:"Checkbox",classNames:P,styles:b,unstyled:E,variant:R,size:z?.size||m}),H=z?{checked:z.value.includes(X.value),onChange:z.onChange}:{};return k.createElement(ZP,ap(ap({className:r,sx:i,style:o,id:G,size:z?.size||m,labelPosition:$,label:u,description:N,error:I,disabled:a,__staticSelector:"Checkbox",classNames:P,styles:b,unstyled:E,"data-checked":H.checked||void 0,variant:R},Q),y),k.createElement("div",{className:V.inner},k.createElement("input",ap(ap({id:G,ref:t,type:"checkbox",className:V.input,checked:s,disabled:a},X),H)),k.createElement(O,{indeterminate:f,className:V.icon})))});vr.displayName="@mantine/core/Checkbox";vr.Group=r4;var Voe=Object.defineProperty,Hoe=Object.defineProperties,Woe=Object.getOwnPropertyDescriptors,lM=Object.getOwnPropertySymbols,Uoe=Object.prototype.hasOwnProperty,Zoe=Object.prototype.propertyIsEnumerable,cM=(e,t,n)=>t in e?Voe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,uM=(e,t)=>{for(var n in t||(t={}))Uoe.call(t,n)&&cM(e,n,t[n]);if(lM)for(var n of lM(t))Zoe.call(t,n)&&cM(e,n,t[n]);return e},dM=(e,t)=>Hoe(e,Woe(t)),Goe=ue((e,{radius:t},{size:n})=>{const r=e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3];return{root:dM(uM({},e.fn.focusStyles()),{width:M(n),height:M(n),WebkitTapHighlightColor:"transparent",border:0,borderRadius:e.fn.radius(t),appearance:"none",WebkitAppearance:"none",padding:0,position:"relative",overflow:"hidden"}),overlay:dM(uM({},e.fn.cover()),{position:"absolute",borderRadius:e.fn.radius(t)}),children:{display:"inline-flex",justifyContent:"center",alignItems:"center"},shadowOverlay:{boxShadow:`rgba(0, 0, 0, .1) 0 0 0 ${M(1)} inset, rgb(0, 0, 0, .15) 0 0 ${M(4)} inset`,zIndex:1},alphaOverlay:{backgroundImage:`linear-gradient(45deg, ${r} 25%, transparent 25%), linear-gradient(-45deg, ${r} 25%, transparent 25%), linear-gradient(45deg, transparent 75%, ${r} 75%), linear-gradient(-45deg, ${e.colorScheme==="dark"?e.colors.dark[7]:e.white} 75%, ${r} 75%)`,backgroundSize:`${M(8)} ${M(8)}`,backgroundPosition:`0 0, 0 ${M(4)}, ${M(4)} -${M(4)}, -${M(4)} 0`}}});const Yoe=Goe;var Koe=Object.defineProperty,Hg=Object.getOwnPropertySymbols,d4=Object.prototype.hasOwnProperty,f4=Object.prototype.propertyIsEnumerable,fM=(e,t,n)=>t in e?Koe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qoe=(e,t)=>{for(var n in t||(t={}))d4.call(t,n)&&fM(e,n,t[n]);if(Hg)for(var n of Hg(t))f4.call(t,n)&&fM(e,n,t[n]);return e},Joe=(e,t)=>{var n={};for(var r in e)d4.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Hg)for(var r of Hg(e))t.indexOf(r)<0&&f4.call(e,r)&&(n[r]=e[r]);return n};const Qoe={size:M(25),radius:M(25),withShadow:!0},h4=_.forwardRef((e,t)=>{const n=ae("ColorSwatch",Qoe,e),{color:r,size:o,radius:i,className:s,children:a,classNames:c,styles:u,unstyled:f,withShadow:h,variant:m}=n,v=Joe(n,["color","size","radius","className","children","classNames","styles","unstyled","withShadow","variant"]),{classes:y,cx:w}=Yoe({radius:i},{classNames:c,styles:u,unstyled:f,name:"ColorSwatch",size:o,variant:m});return k.createElement(Pe,qoe({className:w(y.root,s),ref:t},v),k.createElement("div",{className:w(y.alphaOverlay,y.overlay)}),h&&k.createElement("div",{className:w(y.shadowOverlay,y.overlay)}),k.createElement("div",{className:y.overlay,style:{backgroundColor:r}}),k.createElement("div",{className:w(y.children,y.overlay)},a))});h4.displayName="@mantine/core/ColorSwatch";const _f=h4,$i={xs:M(8),sm:M(12),md:M(16),lg:M(20),xl:M(22)};var Xoe=ue((e,t,{size:n})=>{const r=re({size:n,sizes:$i});return{thumb:{overflow:"hidden",boxSizing:"border-box",position:"absolute",boxShadow:`0 0 ${M(1)} rgba(0, 0, 0, .6)`,border:`${M(2)} solid ${e.white}`,backgroundColor:"transparent",width:r,height:r,borderRadius:r}}});const eie=Xoe;var tie=Object.defineProperty,hM=Object.getOwnPropertySymbols,nie=Object.prototype.hasOwnProperty,rie=Object.prototype.propertyIsEnumerable,pM=(e,t,n)=>t in e?tie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,oie=(e,t)=>{for(var n in t||(t={}))nie.call(t,n)&&pM(e,n,t[n]);if(hM)for(var n of hM(t))rie.call(t,n)&&pM(e,n,t[n]);return e};function GP({position:e,className:t,styles:n,classNames:r,style:o,size:i,__staticSelector:s,unstyled:a,variant:c}){const{classes:u,cx:f}=eie(null,{classNames:r,styles:n,name:s,unstyled:a,size:i,variant:c});return k.createElement("div",{className:f(u.thumb,t),style:oie({left:`calc(${e.x*100}% - ${$i[i]} / 2)`,top:`calc(${e.y*100}% - ${$i[i]} / 2)`},o)})}GP.displayName="@mantine/core/Thumb";var iie=Object.defineProperty,mM=Object.getOwnPropertySymbols,sie=Object.prototype.hasOwnProperty,aie=Object.prototype.propertyIsEnumerable,gM=(e,t,n)=>t in e?iie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vM=(e,t)=>{for(var n in t||(t={}))sie.call(t,n)&&gM(e,n,t[n]);if(mM)for(var n of mM(t))aie.call(t,n)&&gM(e,n,t[n]);return e},lie=ue((e,t,{size:n})=>({sliderThumb:{ref:Br("sliderThumb")},slider:{position:"relative",height:`calc(${re({size:n,sizes:$i})} + ${M(2)})`,boxSizing:"border-box",marginLeft:`calc(${re({size:n,sizes:$i})} / 2)`,marginRight:`calc(${re({size:n,sizes:$i})} / 2)`,outline:0,[`&:focus .${Br("sliderThumb")}`]:vM({},e.focusRing==="always"||e.focusRing==="auto"?e.focusRingStyles.styles(e):e.focusRingStyles.resetStyles(e)),[`&:focus:not(:focus-visible) .${Br("sliderThumb")}`]:vM({},e.focusRing==="auto"||e.focusRing==="never"?e.focusRingStyles.resetStyles(e):null)},sliderOverlay:{position:"absolute",boxSizing:"border-box",top:0,bottom:0,left:`calc(${re({size:n,sizes:$i})} * -1 / 2 - ${M(1)})`,right:`calc(${re({size:n,sizes:$i})} * -1 / 2 - ${M(1)})`,borderRadius:1e3}}));const cie=lie;var uie=Object.defineProperty,die=Object.defineProperties,fie=Object.getOwnPropertyDescriptors,Wg=Object.getOwnPropertySymbols,p4=Object.prototype.hasOwnProperty,m4=Object.prototype.propertyIsEnumerable,yM=(e,t,n)=>t in e?uie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hie=(e,t)=>{for(var n in t||(t={}))p4.call(t,n)&&yM(e,n,t[n]);if(Wg)for(var n of Wg(t))m4.call(t,n)&&yM(e,n,t[n]);return e},pie=(e,t)=>die(e,fie(t)),mie=(e,t)=>{var n={};for(var r in e)p4.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Wg)for(var r of Wg(e))t.indexOf(r)<0&&m4.call(e,r)&&(n[r]=e[r]);return n};const YP=_.forwardRef((e,t)=>{var n=e,{value:r,onChange:o,onChangeEnd:i,maxValue:s,round:a,size:c="md",thumbColor:u="transparent",__staticSelector:f="ColorSlider",focusable:h=!0,overlays:m,classNames:v,styles:y,className:w,unstyled:P,variant:b}=n,S=mie(n,["value","onChange","onChangeEnd","maxValue","round","size","thumbColor","__staticSelector","focusable","overlays","classNames","styles","className","unstyled","variant"]);const{classes:O,cx:E}=cie(null,{classNames:v,styles:y,name:f,unstyled:P,variant:b,size:c}),[$,N]=_.useState({y:0,x:r/s}),I=_.useRef($),R=X=>a?Math.round(X*s):X*s,{ref:B}=x5(({x:X,y:V})=>{I.current={x:X,y:V},o(R(X))},{onScrubEnd:()=>{const{x:X}=I.current;i(R(X))}});Hn(()=>{N({y:0,x:r/s})},[r]);const z=(X,V)=>{X.preventDefault();const H=b5(V);o(R(H.x)),i(R(H.x))},G=X=>{switch(X.key){case"ArrowRight":{z(X,{x:$.x+.05,y:$.y});break}case"ArrowLeft":{z(X,{x:$.x-.05,y:$.y});break}}},Q=m.map((X,V)=>k.createElement("div",{className:O.sliderOverlay,style:X,key:V}));return k.createElement(Pe,pie(hie({},S),{ref:Ps(B,t),className:E(O.slider,w),role:"slider","aria-valuenow":r,"aria-valuemax":s,"aria-valuemin":0,tabIndex:h?0:-1,onKeyDown:G}),Q,k.createElement(GP,{__staticSelector:f,classNames:v,styles:y,position:$,style:{top:M(1),backgroundColor:u},className:O.sliderThumb,size:c}))});YP.displayName="@mantine/core/ColorSlider";var gie=Object.defineProperty,vie=Object.defineProperties,yie=Object.getOwnPropertyDescriptors,Ug=Object.getOwnPropertySymbols,g4=Object.prototype.hasOwnProperty,v4=Object.prototype.propertyIsEnumerable,_M=(e,t,n)=>t in e?gie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_ie=(e,t)=>{for(var n in t||(t={}))g4.call(t,n)&&_M(e,n,t[n]);if(Ug)for(var n of Ug(t))v4.call(t,n)&&_M(e,n,t[n]);return e},wie=(e,t)=>vie(e,yie(t)),bie=(e,t)=>{var n={};for(var r in e)g4.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ug)for(var r of Ug(e))t.indexOf(r)<0&&v4.call(e,r)&&(n[r]=e[r]);return n};const xie={},y4=_.forwardRef((e,t)=>{const n=ae("HueSlider",xie,e),{value:r,onChange:o,onChangeEnd:i,__staticSelector:s}=n,a=bie(n,["value","onChange","onChangeEnd","__staticSelector"]);return k.createElement(YP,wie(_ie({},a),{ref:t,value:r,onChange:o,onChangeEnd:i,maxValue:360,thumbColor:`hsl(${r}, 100%, 50%)`,round:!0,__staticSelector:s||"HueSlider",overlays:[{backgroundImage:"linear-gradient(to right,hsl(0,100%,50%),hsl(60,100%,50%),hsl(120,100%,50%),hsl(170,100%,50%),hsl(240,100%,50%),hsl(300,100%,50%),hsl(360,100%,50%))"},{boxShadow:`rgba(0, 0, 0, .1) 0 0 0 ${M(1)} inset, rgb(0, 0, 0, .15) 0 0 ${M(4)} inset`}]}))});y4.displayName="@mantine/core/HueSlider";var Sie=Object.defineProperty,Pie=Object.defineProperties,Oie=Object.getOwnPropertyDescriptors,wM=Object.getOwnPropertySymbols,Cie=Object.prototype.hasOwnProperty,kie=Object.prototype.propertyIsEnumerable,bM=(e,t,n)=>t in e?Sie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xM=(e,t)=>{for(var n in t||(t={}))Cie.call(t,n)&&bM(e,n,t[n]);if(wM)for(var n of wM(t))kie.call(t,n)&&bM(e,n,t[n]);return e},SM=(e,t)=>Pie(e,Oie(t));function Lo(e,t=0,n=10**t){return Math.round(n*e)/n}function Eie({h:e,s:t,l:n,a:r}){const o=t*((n<50?n:100-n)/100);return{h:e,s:o>0?2*o/(n+o)*100:0,v:n+o,a:r}}const $ie={grad:360/400,turn:360,rad:360/(Math.PI*2)};function Mie(e,t="deg"){return Number(e)*($ie[t]||1)}const Nie=/hsla?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i;function PM(e){const t=Nie.exec(e);return t?Eie({h:Mie(t[1],t[2]),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)}):{h:0,s:0,v:0,a:1}}function lx({r:e,g:t,b:n,a:r}){const o=Math.max(e,t,n),i=o-Math.min(e,t,n),s=i?o===e?(t-n)/i:o===t?2+(n-e)/i:4+(e-t)/i:0;return{h:Lo(60*(s<0?s+6:s),3),s:Lo(o?i/o*100:0,3),v:Lo(o/255*100,3),a:r}}function cx(e){const t=e[0]==="#"?e.slice(1):e;return t.length===3?lx({r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:1}):lx({r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16),a:1})}function Tie(e){const t=e[0]==="#"?e.slice(1):e,n=s=>Lo(parseInt(s,16)/255,3);if(t.length===4){const s=t.slice(0,3),a=n(t[3]+t[3]);return SM(xM({},cx(s)),{a})}const r=t.slice(0,6),o=n(t.slice(6,8));return SM(xM({},cx(r)),{a:o})}const Iie=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i;function OM(e){const t=Iie.exec(e);return t?lx({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):{h:0,s:0,v:0,a:1}}const _4={hex:/^#?([0-9A-F]{3}){1,2}$/i,hexa:/^#?([0-9A-F]{4}){1,2}$/i,rgb:/^rgb\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/i,rgba:/^rgba\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/i,hsl:/hsl\(\s*(\d+)\s*,\s*(\d+(?:\.\d+)?%)\s*,\s*(\d+(?:\.\d+)?%)\)/i,hsla:/^hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*(\d*(?:\.\d+)?)\)$/i},Die={hex:cx,hexa:Tie,rgb:OM,rgba:OM,hsl:PM,hsla:PM};function jie(e){for(const[,t]of Object.entries(_4))if(t.test(e))return!0;return!1}function lp(e){if(typeof e!="string")return{h:0,s:0,v:0,a:1};if(e==="transparent")return{h:0,s:0,v:0,a:0};const t=e.trim();for(const[n,r]of Object.entries(_4))if(r.test(t))return Die[n](t);return{h:0,s:0,v:0,a:1}}var Lie=Object.defineProperty,Rie=Object.defineProperties,zie=Object.getOwnPropertyDescriptors,Zg=Object.getOwnPropertySymbols,w4=Object.prototype.hasOwnProperty,b4=Object.prototype.propertyIsEnumerable,CM=(e,t,n)=>t in e?Lie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Aie=(e,t)=>{for(var n in t||(t={}))w4.call(t,n)&&CM(e,n,t[n]);if(Zg)for(var n of Zg(t))b4.call(t,n)&&CM(e,n,t[n]);return e},Bie=(e,t)=>Rie(e,zie(t)),Fie=(e,t)=>{var n={};for(var r in e)w4.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Zg)for(var r of Zg(e))t.indexOf(r)<0&&b4.call(e,r)&&(n[r]=e[r]);return n};const Vie={},x4=_.forwardRef((e,t)=>{const n=ae("AlphaSlider",Vie,e),{value:r,onChange:o,onChangeEnd:i,color:s,__staticSelector:a}=n,c=Fie(n,["value","onChange","onChangeEnd","color","__staticSelector"]),u=ar(),f=u.colorScheme==="dark"?u.colors.dark[4]:u.colors.gray[3];return k.createElement(YP,Bie(Aie({},c),{ref:t,value:r,onChange:h=>o(Lo(h,2)),onChangeEnd:h=>i(Lo(h,2)),maxValue:1,round:!1,__staticSelector:a||"AlphaSlider",overlays:[{backgroundImage:`linear-gradient(45deg, ${f} 25%, transparent 25%), linear-gradient(-45deg, ${f} 25%, transparent 25%), linear-gradient(45deg, transparent 75%, ${f} 75%), linear-gradient(-45deg, ${u.colorScheme==="dark"?u.colors.dark[7]:u.white} 75%, ${f} 75%)`,backgroundSize:`${M(8)} ${M(8)}`,backgroundPosition:`0 0, 0 ${M(4)}, ${M(4)} -${M(4)}, -${M(4)} 0`},{backgroundImage:`linear-gradient(90deg, transparent, ${s})`},{boxShadow:`rgba(0, 0, 0, .1) 0 0 0 ${M(1)} inset, rgb(0, 0, 0, .15) 0 0 ${M(4)} inset`}]}))});x4.displayName="@mantine/core/AlphaSlider";var Hie=Object.defineProperty,kM=Object.getOwnPropertySymbols,Wie=Object.prototype.hasOwnProperty,Uie=Object.prototype.propertyIsEnumerable,EM=(e,t,n)=>t in e?Hie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Z_=(e,t)=>{for(var n in t||(t={}))Wie.call(t,n)&&EM(e,n,t[n]);if(kM)for(var n of kM(t))Uie.call(t,n)&&EM(e,n,t[n]);return e};const Zie={xs:M(100),sm:M(110),md:M(120),lg:M(140),xl:M(160)};var Gie=ue((e,t,{size:n})=>({saturationThumb:{ref:Br("saturationThumb")},saturation:{boxSizing:"border-box",position:"relative",height:re({size:n,sizes:Zie}),borderRadius:e.radius.sm,margin:`calc(${re({size:n,sizes:$i})} / 2)`,WebkitTapHighlightColor:"transparent",[`&:focus .${Br("saturationThumb")}`]:Z_({},e.focusRing==="always"||e.focusRing==="auto"?e.focusRingStyles.styles(e):e.focusRingStyles.resetStyles(e)),[`&:focus:not(:focus-visible) .${Br("saturationThumb")}`]:Z_({},e.focusRing==="auto"||e.focusRing==="never"?e.focusRingStyles.resetStyles(e):null)},saturationOverlay:Z_({boxSizing:"border-box",borderRadius:e.radius.sm},e.fn.cover(`calc(${re({size:n,sizes:$i})} * -1 / 2 - ${M(1)})`))}));const Yie=Gie;function S4({h:e,s:t,v:n,a:r}){const o=e/360*6,i=t/100,s=n/100,a=Math.floor(o),c=s*(1-i),u=s*(1-(o-a)*i),f=s*(1-(1-o+a)*i),h=a%6;return{r:Lo([s,u,c,c,f,s][h]*255),g:Lo([f,s,s,u,c,c][h]*255),b:Lo([c,c,f,s,s,u][h]*255),a:Lo(r,2)}}function $M(e,t){const{r:n,g:r,b:o,a:i}=S4(e);return t?`rgba(${n}, ${r}, ${o}, ${Lo(i,2)})`:`rgb(${n}, ${r}, ${o})`}function MM({h:e,s:t,v:n,a:r},o){const i=(200-t)*n/100,s={h:Math.round(e),s:Math.round(i>0&&i<200?t*n/100/(i<=100?i:200-i)*100:0),l:Math.round(i/2)};return o?`hsla(${s.h}, ${s.s}%, ${s.l}%, ${Lo(r,2)})`:`hsl(${s.h}, ${s.s}%, ${s.l}%)`}function tm(e){const t=e.toString(16);return t.length<2?`0${t}`:t}function P4(e){const{r:t,g:n,b:r}=S4(e);return`#${tm(t)}${tm(n)}${tm(r)}`}function Kie(e){const t=Math.round(e.a*255);return`${P4(e)}${tm(t)}`}const G_={hex:P4,hexa:e=>Kie(e),rgb:e=>$M(e,!1),rgba:e=>$M(e,!0),hsl:e=>MM(e,!1),hsla:e=>MM(e,!0)};function Vs(e,t){return t?e in G_?G_[e](t):G_.hex(t):"#000000"}function O4({value:e,onChange:t,onChangeEnd:n,focusable:r=!0,__staticSelector:o="saturation",size:i,color:s,saturationLabel:a,classNames:c,styles:u,unstyled:f,variant:h}){const{classes:m}=Yie(null,{classNames:c,styles:u,name:o,unstyled:f,variant:h,size:i}),[v,y]=_.useState({x:e.s/100,y:1-e.v/100}),w=_.useRef(v),{ref:P}=x5(({x:O,y:E})=>{w.current={x:O,y:E},t({s:Math.round(O*100),v:Math.round((1-E)*100)})},{onScrubEnd:()=>{const{x:O,y:E}=w.current;n({s:Math.round(O*100),v:Math.round((1-E)*100)})}});_.useEffect(()=>{y({x:e.s/100,y:1-e.v/100})},[e.s,e.v]);const b=(O,E)=>{O.preventDefault();const $=b5(E);t({s:Math.round($.x*100),v:Math.round((1-$.y)*100)}),n({s:Math.round($.x*100),v:Math.round((1-$.y)*100)})},S=O=>{switch(O.key){case"ArrowUp":{b(O,{y:v.y-.05,x:v.x});break}case"ArrowDown":{b(O,{y:v.y+.05,x:v.x});break}case"ArrowRight":{b(O,{x:v.x+.05,y:v.y});break}case"ArrowLeft":{b(O,{x:v.x-.05,y:v.y});break}}};return k.createElement("div",{className:m.saturation,ref:P,role:"slider","aria-label":a,"aria-valuenow":v.x,"aria-valuetext":Vs("rgba",e),tabIndex:r?0:-1,onKeyDown:S},k.createElement("div",{className:m.saturationOverlay,style:{backgroundColor:`hsl(${e.h}, 100%, 50%)`}}),k.createElement("div",{className:m.saturationOverlay,style:{backgroundImage:"linear-gradient(90deg, #fff, transparent)"}}),k.createElement("div",{className:m.saturationOverlay,style:{backgroundImage:"linear-gradient(0deg, #000, transparent)"}}),k.createElement(GP,{__staticSelector:o,classNames:c,styles:u,position:v,className:m.saturationThumb,style:{backgroundColor:s},size:i}))}O4.displayName="@mantine/core/Saturation";var qie=ue((e,{swatchesPerRow:t})=>({swatch:{width:`calc(${100/t}% - ${M(4)})`,height:0,paddingBottom:`calc(${100/t}% - ${M(4)})`,margin:M(2),boxSizing:"content-box"},swatches:{boxSizing:"border-box",marginLeft:M(-2),marginRight:M(-2),display:"flex",flexWrap:"wrap"}}));const Jie=qie;var Qie=Object.defineProperty,Gg=Object.getOwnPropertySymbols,C4=Object.prototype.hasOwnProperty,k4=Object.prototype.propertyIsEnumerable,NM=(e,t,n)=>t in e?Qie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Xie=(e,t)=>{for(var n in t||(t={}))C4.call(t,n)&&NM(e,n,t[n]);if(Gg)for(var n of Gg(t))k4.call(t,n)&&NM(e,n,t[n]);return e},ese=(e,t)=>{var n={};for(var r in e)C4.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Gg)for(var r of Gg(e))t.indexOf(r)<0&&k4.call(e,r)&&(n[r]=e[r]);return n};function E4(e){var t=e,{data:n,swatchesPerRow:r=10,focusable:o=!0,classNames:i,styles:s,__staticSelector:a="color-picker",unstyled:c,setValue:u,onChangeEnd:f,variant:h,size:m}=t,v=ese(t,["data","swatchesPerRow","focusable","classNames","styles","__staticSelector","unstyled","setValue","onChangeEnd","variant","size"]);const{classes:y}=Jie({swatchesPerRow:r},{classNames:i,styles:s,name:a,unstyled:c,variant:h,size:m}),w=n.map((P,b)=>k.createElement(_f,{className:y.swatch,component:"button",type:"button",color:P,key:b,radius:"sm",onClick:()=>{u(P),f?.(P)},style:{cursor:"pointer"},"aria-label":P,tabIndex:o?0:-1}));return k.createElement("div",Xie({className:y.swatches},v),w)}E4.displayName="@mantine/core/Swatches";const tse={xs:M(180),sm:M(200),md:M(240),lg:M(280),xl:M(320)};var nse=ue((e,{fullWidth:t},{size:n})=>({preview:{},wrapper:{boxSizing:"border-box",width:t?"100%":re({size:n,sizes:tse}),padding:M(1)},body:{display:"flex",boxSizing:"border-box",paddingTop:`calc(${re({size:n,sizes:e.spacing})} / 2)`},sliders:{flex:1,boxSizing:"border-box","&:not(:only-child)":{marginRight:e.spacing.xs}},slider:{boxSizing:"border-box","& + &":{marginTop:M(5)}},swatch:{cursor:"pointer"}}));const rse=nse;var ose=Object.defineProperty,ise=Object.defineProperties,sse=Object.getOwnPropertyDescriptors,Yg=Object.getOwnPropertySymbols,$4=Object.prototype.hasOwnProperty,M4=Object.prototype.propertyIsEnumerable,TM=(e,t,n)=>t in e?ose(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dc=(e,t)=>{for(var n in t||(t={}))$4.call(t,n)&&TM(e,n,t[n]);if(Yg)for(var n of Yg(t))M4.call(t,n)&&TM(e,n,t[n]);return e},Y_=(e,t)=>ise(e,sse(t)),ase=(e,t)=>{var n={};for(var r in e)$4.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Yg)for(var r of Yg(e))t.indexOf(r)<0&&M4.call(e,r)&&(n[r]=e[r]);return n};const lse={xs:26,sm:34,md:42,lg:50,xl:54},cse={swatchesPerRow:10,size:"sm",withPicker:!0,focusable:!0,__staticSelector:"ColorPicker"},N4=_.forwardRef((e,t)=>{const n=ae("ColorPicker",cse,e),{value:r,defaultValue:o,onChange:i,onChangeEnd:s,format:a,swatches:c,swatchesPerRow:u,size:f,withPicker:h,fullWidth:m,focusable:v,__staticSelector:y,saturationLabel:w,hueLabel:P,alphaLabel:b,className:S,styles:O,classNames:E,unstyled:$,onColorSwatchClick:N,variant:I}=n,R=ase(n,["value","defaultValue","onChange","onChangeEnd","format","swatches","swatchesPerRow","size","withPicker","fullWidth","focusable","__staticSelector","saturationLabel","hueLabel","alphaLabel","className","styles","classNames","unstyled","onColorSwatchClick","variant"]),{classes:B,cx:z}=rse({fullWidth:m},{classNames:E,styles:O,name:y,unstyled:$,variant:I,size:f}),G=_.useRef(a),Q=_.useRef(null),X=_.useRef(!0),V=a==="hexa"||a==="rgba"||a==="hsla",[H,Z,Y]=_o({value:r,defaultValue:o,finalValue:"#FFFFFF",onChange:i}),[D,W]=_.useState(lp(H)),F=K=>{X.current=!1,W(ee=>{const fe=dc(dc({},ee),K);return Q.current=Vs(G.current,fe),fe}),Z(Q.current),setTimeout(()=>{X.current=!0},0)};return Hn(()=>{jie(r)&&X.current&&(W(lp(r)),X.current=!0)},[r]),Hn(()=>{G.current=a,Z(Vs(a,D))},[a]),k.createElement(Pe,dc({className:z(B.wrapper,S),ref:t},R),h&&k.createElement(k.Fragment,null,k.createElement(O4,{value:D,onChange:F,onChangeEnd:({s:K,v:ee})=>s?.(Vs(G.current,Y_(dc({},D),{s:K,v:ee}))),color:H,styles:O,classNames:E,size:f,focusable:v,saturationLabel:w,__staticSelector:y}),k.createElement("div",{className:B.body},k.createElement("div",{className:B.sliders},k.createElement(y4,{value:D.h,onChange:K=>F({h:K}),onChangeEnd:K=>s?.(Vs(G.current,Y_(dc({},D),{h:K}))),size:f,styles:O,classNames:E,focusable:v,"aria-label":P,__staticSelector:y}),V&&k.createElement(x4,{value:D.a,onChange:K=>F({a:K}),onChangeEnd:K=>{s?.(Vs(G.current,Y_(dc({},D),{a:K})))},size:f,color:Vs("hex",D),style:{marginTop:M(6)},styles:O,classNames:E,focusable:v,"aria-label":b,__staticSelector:y})),V&&k.createElement(_f,{color:H,radius:"sm",size:re({size:f,sizes:lse}),className:B.preview}))),Array.isArray(c)&&k.createElement(E4,{data:c,style:{marginTop:M(5)},swatchesPerRow:u,focusable:v,classNames:E,styles:O,__staticSelector:y,setValue:Z,onChangeEnd:K=>{const ee=Vs(a,lp(K));N?.(ee),s?.(ee),Y||W(lp(K))}}))});N4.displayName="@mantine/core/ColorPicker";const[use,dse]=Cu("Drawer component was not found in tree"),IM={xs:M(320),sm:M(380),md:M(440),lg:M(620),xl:M(780)};var fse=ue((e,{position:t},{size:n})=>({header:{zIndex:1e3},content:{flex:t==="right"||t==="left"?`0 0 ${re({size:n,sizes:IM})}`:"0 0 100%",maxWidth:"100%",maxHeight:"100%",height:t==="right"||t==="left"?"100%":re({size:n,sizes:IM}),borderRadius:0,overflowY:"auto"},inner:{display:"flex",justifyContent:t==="right"?"flex-end":"flex-start",alignItems:t==="bottom"?"flex-end":"flex-start"}}));const hse=fse,[pse,Nu]=Cu("ModalBase component was not found in tree");var mse=ue(()=>({close:{marginLeft:"auto",marginRight:0}}));const gse=mse;var vse=Object.defineProperty,Kg=Object.getOwnPropertySymbols,T4=Object.prototype.hasOwnProperty,I4=Object.prototype.propertyIsEnumerable,DM=(e,t,n)=>t in e?vse(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yse=(e,t)=>{for(var n in t||(t={}))T4.call(t,n)&&DM(e,n,t[n]);if(Kg)for(var n of Kg(t))I4.call(t,n)&&DM(e,n,t[n]);return e},_se=(e,t)=>{var n={};for(var r in e)T4.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Kg)for(var r of Kg(e))t.indexOf(r)<0&&I4.call(e,r)&&(n[r]=e[r]);return n};const wse={size:"sm"},bse=_.forwardRef((e,t)=>{const n=Nu(),r=ae(`${n.__staticSelector}CloseButton`,wse,e),{className:o}=r,i=_se(r,["className"]),{classes:s,cx:a}=gse(null,n.stylesApi);return k.createElement(j0,yse({className:a(s.close,o),ref:t,onClick:n.onClose},i))});var xse=ue(()=>({overlay:{}}));const Sse=xse;var Pse=Object.defineProperty,Ose=Object.defineProperties,Cse=Object.getOwnPropertyDescriptors,jM=Object.getOwnPropertySymbols,kse=Object.prototype.hasOwnProperty,Ese=Object.prototype.propertyIsEnumerable,LM=(e,t,n)=>t in e?Pse(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$se=(e,t)=>{for(var n in t||(t={}))kse.call(t,n)&&LM(e,n,t[n]);if(jM)for(var n of jM(t))Ese.call(t,n)&&LM(e,n,t[n]);return e},Mse=(e,t)=>Ose(e,Cse(t)),Nse=ue((e,{color:t,opacity:n,blur:r,radius:o,gradient:i,fixed:s,zIndex:a})=>({root:Mse($se({},e.fn.cover(0)),{position:s?"fixed":"absolute",backgroundColor:i?void 0:e.fn.rgba(t,n),backgroundImage:i,backdropFilter:r?`blur(${M(r)})`:void 0,borderRadius:e.fn.radius(o),zIndex:a,"&[data-center]":{display:"flex",alignItems:"center",justifyContent:"center"}})}));const Tse=Nse;var Ise=Object.defineProperty,qg=Object.getOwnPropertySymbols,D4=Object.prototype.hasOwnProperty,j4=Object.prototype.propertyIsEnumerable,RM=(e,t,n)=>t in e?Ise(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Dse=(e,t)=>{for(var n in t||(t={}))D4.call(t,n)&&RM(e,n,t[n]);if(qg)for(var n of qg(t))j4.call(t,n)&&RM(e,n,t[n]);return e},jse=(e,t)=>{var n={};for(var r in e)D4.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&qg)for(var r of qg(e))t.indexOf(r)<0&&j4.call(e,r)&&(n[r]=e[r]);return n};const Lse={opacity:.6,color:"#000",zIndex:ci("modal"),radius:0},L4=_.forwardRef((e,t)=>{const n=ae("Overlay",Lse,e),{variant:r,opacity:o,color:i,blur:s,gradient:a,zIndex:c,radius:u,children:f,className:h,classNames:m,styles:v,unstyled:y,center:w,fixed:P}=n,b=jse(n,["variant","opacity","color","blur","gradient","zIndex","radius","children","className","classNames","styles","unstyled","center","fixed"]),{classes:S,cx:O}=Tse({color:i,opacity:o,blur:s,radius:u,gradient:a,fixed:P,zIndex:c},{name:"Overlay",classNames:m,styles:v,unstyled:y,variant:r});return k.createElement(Pe,Dse({ref:t,className:O(S.root,h),"data-center":w||void 0},b),f)});L4.displayName="@mantine/core/Overlay";const R4=L4;var Rse=Object.defineProperty,zse=Object.defineProperties,Ase=Object.getOwnPropertyDescriptors,Jg=Object.getOwnPropertySymbols,z4=Object.prototype.hasOwnProperty,A4=Object.prototype.propertyIsEnumerable,zM=(e,t,n)=>t in e?Rse(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dd=(e,t)=>{for(var n in t||(t={}))z4.call(t,n)&&zM(e,n,t[n]);if(Jg)for(var n of Jg(t))A4.call(t,n)&&zM(e,n,t[n]);return e},Bse=(e,t)=>zse(e,Ase(t)),Fse=(e,t)=>{var n={};for(var r in e)z4.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Jg)for(var r of Jg(e))t.indexOf(r)<0&&A4.call(e,r)&&(n[r]=e[r]);return n};const Vse={},Hse=_.forwardRef((e,t)=>{const n=Nu(),r=ae(`${n.__staticSelector}Overlay`,Vse,e),{onClick:o,transitionProps:i,style:s,className:a}=r,c=Fse(r,["onClick","transitionProps","style","className"]),{classes:u,cx:f}=Sse(null,n.stylesApi),h=m=>{o?.(m),n.closeOnClickOutside&&n.onClose()};return k.createElement($s,Bse(dd(dd({mounted:n.opened},n.transitionProps),i),{transition:"fade"}),m=>k.createElement(R4,dd({ref:t,onClick:h,fixed:!0,style:dd(dd({},s),m),className:f(u.overlay,a),zIndex:n.zIndex},c)))});var Wse=ue((e,{zIndex:t})=>({inner:{position:"fixed",width:"100%",top:0,bottom:0,maxHeight:"100%",zIndex:t,pointerEvents:"none"},content:{pointerEvents:"all"}}));const Use=Wse;var Zse=Object.defineProperty,Qg=Object.getOwnPropertySymbols,B4=Object.prototype.hasOwnProperty,F4=Object.prototype.propertyIsEnumerable,AM=(e,t,n)=>t in e?Zse(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fd=(e,t)=>{for(var n in t||(t={}))B4.call(t,n)&&AM(e,n,t[n]);if(Qg)for(var n of Qg(t))F4.call(t,n)&&AM(e,n,t[n]);return e},Gse=(e,t)=>{var n={};for(var r in e)B4.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Qg)for(var r of Qg(e))t.indexOf(r)<0&&F4.call(e,r)&&(n[r]=e[r]);return n};const Yse={},Kse=_.forwardRef((e,t)=>{const n=Nu(),r=ae(`${n.__staticSelector}Content`,Yse,e),{className:o,transitionProps:i,style:s,onKeyDown:a}=r,c=Gse(r,["className","transitionProps","style","onKeyDown"]),{classes:u,cx:f}=Use({zIndex:n.zIndex},n.stylesApi),h=m=>{var v;((v=m.target)==null?void 0:v.getAttribute("data-mantine-stop-propagation"))!=="true"&&m.key==="Escape"&&n.closeOnEscape&&n.onClose(),a?.(m)};return k.createElement($s,fd(fd({mounted:n.opened,transition:"pop"},n.transitionProps),i),m=>k.createElement("div",{className:f(u.inner)},k.createElement(RP,{active:n.opened&&n.trapFocus},k.createElement(ioe,fd({component:"section",role:"dialog",tabIndex:-1,"aria-modal":!0,"aria-describedby":n.bodyMounted?n.getBodyId():void 0,"aria-labelledby":n.titleMounted?n.getTitleId():void 0,onKeyDown:h,ref:t,className:f(u.content,o),style:fd(fd({},s),m),shadow:n.shadow},c),c.children))))});var qse=ue((e,{padding:t})=>{const n=re({size:t,sizes:e.spacing});return{header:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:n,paddingRight:`calc(${n} - ${M(5)})`,position:"sticky",top:0,backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white,zIndex:1e3}}});const Jse=qse;var Qse=Object.defineProperty,Xg=Object.getOwnPropertySymbols,V4=Object.prototype.hasOwnProperty,H4=Object.prototype.propertyIsEnumerable,BM=(e,t,n)=>t in e?Qse(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Xse=(e,t)=>{for(var n in t||(t={}))V4.call(t,n)&&BM(e,n,t[n]);if(Xg)for(var n of Xg(t))H4.call(t,n)&&BM(e,n,t[n]);return e},eae=(e,t)=>{var n={};for(var r in e)V4.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Xg)for(var r of Xg(e))t.indexOf(r)<0&&H4.call(e,r)&&(n[r]=e[r]);return n};const tae={},nae=_.forwardRef((e,t)=>{const n=Nu(),r=ae(`${n.__staticSelector}Header`,tae,e),{className:o}=r,i=eae(r,["className"]),{classes:s,cx:a}=Jse({padding:n.padding},n.stylesApi);return k.createElement(Pe,Xse({ref:t,className:a(s.header,o)},i))});var rae=ue(e=>({title:{lineHeight:1,padding:0,margin:0,fontWeight:400,fontSize:e.fontSizes.md}}));const oae=rae;var iae=Object.defineProperty,ev=Object.getOwnPropertySymbols,W4=Object.prototype.hasOwnProperty,U4=Object.prototype.propertyIsEnumerable,FM=(e,t,n)=>t in e?iae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,sae=(e,t)=>{for(var n in t||(t={}))W4.call(t,n)&&FM(e,n,t[n]);if(ev)for(var n of ev(t))U4.call(t,n)&&FM(e,n,t[n]);return e},aae=(e,t)=>{var n={};for(var r in e)W4.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ev)for(var r of ev(e))t.indexOf(r)<0&&U4.call(e,r)&&(n[r]=e[r]);return n};const lae={},cae=_.forwardRef((e,t)=>{const n=Nu(),r=ae(`${n.__staticSelector}Title`,lae,e),{className:o}=r,i=aae(r,["className"]),{classes:s,cx:a}=oae(null,n.stylesApi);return _.useEffect(()=>(n.setTitleMounted(!0),()=>n.setTitleMounted(!1)),[]),k.createElement(Pe,sae({component:"h2",id:n.getTitleId(),className:a(s.title,o),ref:t},i))});var uae=ue((e,{padding:t})=>({body:{padding:re({size:t,sizes:e.spacing}),"&:not(:only-child)":{paddingTop:0}}}));const dae=uae;var fae=Object.defineProperty,tv=Object.getOwnPropertySymbols,Z4=Object.prototype.hasOwnProperty,G4=Object.prototype.propertyIsEnumerable,VM=(e,t,n)=>t in e?fae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hae=(e,t)=>{for(var n in t||(t={}))Z4.call(t,n)&&VM(e,n,t[n]);if(tv)for(var n of tv(t))G4.call(t,n)&&VM(e,n,t[n]);return e},pae=(e,t)=>{var n={};for(var r in e)Z4.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&tv)for(var r of tv(e))t.indexOf(r)<0&&G4.call(e,r)&&(n[r]=e[r]);return n};const mae={},gae=_.forwardRef((e,t)=>{const n=Nu(),r=ae(`${n.__staticSelector}Body`,mae,e),{className:o}=r,i=pae(r,["className"]),{classes:s,cx:a}=dae({padding:n.padding},n.stylesApi);return _.useEffect(()=>(n.setBodyMounted(!0),()=>n.setBodyMounted(!1)),[]),k.createElement(Pe,hae({id:n.getBodyId(),className:a(s.body,o),ref:t},i))});function vae({children:e}){return k.createElement(k.Fragment,null,e)}function yae({opened:e,transitionDuration:t}){const[n,r]=_.useState(e),o=_.useRef(),s=MS()?0:t;return _.useEffect(()=>(e?(r(!0),window.clearTimeout(o.current)):s===0?r(!1):o.current=window.setTimeout(()=>r(!1),s),()=>window.clearTimeout(o.current)),[e,s]),n}var _ae=ue(()=>({root:{}}));const wae=_ae;var bae=Object.defineProperty,xae=Object.defineProperties,Sae=Object.getOwnPropertyDescriptors,nv=Object.getOwnPropertySymbols,Y4=Object.prototype.hasOwnProperty,K4=Object.prototype.propertyIsEnumerable,HM=(e,t,n)=>t in e?bae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,K_=(e,t)=>{for(var n in t||(t={}))Y4.call(t,n)&&HM(e,n,t[n]);if(nv)for(var n of nv(t))K4.call(t,n)&&HM(e,n,t[n]);return e},WM=(e,t)=>xae(e,Sae(t)),Pae=(e,t)=>{var n={};for(var r in e)Y4.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&nv)for(var r of nv(e))t.indexOf(r)<0&&K4.call(e,r)&&(n[r]=e[r]);return n};const qf={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:ci("modal"),padding:"md",size:"md",shadow:"xl"};function tt(e){const t=ae("ModalBase",qf,e),{opened:n,onClose:r,children:o,closeOnClickOutside:i,__staticSelector:s,transitionProps:a,withinPortal:c,portalProps:u,keepMounted:f,target:h,zIndex:m,lockScroll:v,trapFocus:y,closeOnEscape:w,returnFocus:P,padding:b,shadow:S,id:O,size:E,variant:$,classNames:N,unstyled:I,styles:R,className:B}=t,z=Pae(t,["opened","onClose","children","closeOnClickOutside","__staticSelector","transitionProps","withinPortal","portalProps","keepMounted","target","zIndex","lockScroll","trapFocus","closeOnEscape","returnFocus","padding","shadow","id","size","variant","classNames","unstyled","styles","className"]),{classes:G,cx:Q}=wae(null,{name:s,classNames:N,styles:R,unstyled:I,variant:$,size:E}),X=Ia(O),[V,H]=_.useState(!1),[Z,Y]=_.useState(!1),D=typeof a?.duration=="number"?a?.duration:200,W=yae({opened:n,transitionDuration:D});return Pm("keydown",F=>{!y&&F.key==="Escape"&&w&&r()}),g5({opened:n,shouldReturnFocus:y&&P}),k.createElement(Zf,WM(K_({},u),{withinPortal:c,target:h}),k.createElement(pse,{value:{__staticSelector:s,opened:n,onClose:r,closeOnClickOutside:i,transitionProps:WM(K_({},a),{duration:D,keepMounted:f}),zIndex:m,padding:b,id:X,getTitleId:()=>`${X}-title`,getBodyId:()=>`${X}-body`,titleMounted:V,bodyMounted:Z,setTitleMounted:H,setBodyMounted:Y,trapFocus:y,closeOnEscape:w,shadow:S,stylesApi:{name:s,size:E,variant:$,classNames:N,styles:R,unstyled:I}}},k.createElement(OU,{enabled:W&&v},k.createElement(Pe,K_({className:Q(G.root,B)},z),o))))}tt.CloseButton=bse;tt.Overlay=Hse;tt.Content=Kse;tt.Header=nae;tt.Title=cae;tt.Body=gae;tt.NativeScrollArea=vae;var Oae=Object.defineProperty,Cae=Object.defineProperties,kae=Object.getOwnPropertyDescriptors,rv=Object.getOwnPropertySymbols,q4=Object.prototype.hasOwnProperty,J4=Object.prototype.propertyIsEnumerable,UM=(e,t,n)=>t in e?Oae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nm=(e,t)=>{for(var n in t||(t={}))q4.call(t,n)&&UM(e,n,t[n]);if(rv)for(var n of rv(t))J4.call(t,n)&&UM(e,n,t[n]);return e},Q4=(e,t)=>Cae(e,kae(t)),Eae=(e,t)=>{var n={};for(var r in e)q4.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&rv)for(var r of rv(e))t.indexOf(r)<0&&J4.call(e,r)&&(n[r]=e[r]);return n};const $ae={top:"slide-down",bottom:"slide-up",left:"slide-right",right:"slide-left"},Mae={top:"slide-down",bottom:"slide-up",right:"slide-right",left:"slide-left"},Nae=Q4(nm({},qf),{position:"left"});function X4(e){const t=ae("DrawerRoot",Nae,e),{classNames:n,variant:r,size:o,scrollAreaComponent:i,position:s,transitionProps:a}=t,c=Eae(t,["classNames","variant","size","scrollAreaComponent","position","transitionProps"]),{classes:u,cx:f,theme:h}=hse({position:s},{name:"Drawer",variant:r,size:o}),m=(h.dir==="rtl"?Mae:$ae)[s];return k.createElement(use,{value:{scrollAreaComponent:i}},k.createElement(tt,nm({__staticSelector:"Drawer",size:o,variant:r,transitionProps:nm({transition:m,duration:200},a),classNames:Q4(nm({},n),{content:f(u.content,n?.content),inner:f(u.inner,n?.inner)})},c)))}var Tae=Object.defineProperty,ov=Object.getOwnPropertySymbols,e6=Object.prototype.hasOwnProperty,t6=Object.prototype.propertyIsEnumerable,ZM=(e,t,n)=>t in e?Tae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Iae=(e,t)=>{for(var n in t||(t={}))e6.call(t,n)&&ZM(e,n,t[n]);if(ov)for(var n of ov(t))t6.call(t,n)&&ZM(e,n,t[n]);return e},Dae=(e,t)=>{var n={};for(var r in e)e6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ov)for(var r of ov(e))t.indexOf(r)<0&&t6.call(e,r)&&(n[r]=e[r]);return n};const jae={shadow:"xl"},n6=_.forwardRef((e,t)=>{const n=ae("ModalContent",jae,e),{children:r,scrollAreaComponent:o}=n,i=Dae(n,["children","scrollAreaComponent"]),s=dse(),a=o||s.scrollAreaComponent||tt.NativeScrollArea;return k.createElement(tt.Content,Iae({ref:t,radius:0},i),k.createElement(a,{style:{height:"100vh"}},r))});var Lae=Object.defineProperty,Rae=Object.defineProperties,zae=Object.getOwnPropertyDescriptors,iv=Object.getOwnPropertySymbols,r6=Object.prototype.hasOwnProperty,o6=Object.prototype.propertyIsEnumerable,GM=(e,t,n)=>t in e?Lae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,rm=(e,t)=>{for(var n in t||(t={}))r6.call(t,n)&&GM(e,n,t[n]);if(iv)for(var n of iv(t))o6.call(t,n)&&GM(e,n,t[n]);return e},Aae=(e,t)=>Rae(e,zae(t)),Bae=(e,t)=>{var n={};for(var r in e)r6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&iv)for(var r of iv(e))t.indexOf(r)<0&&o6.call(e,r)&&(n[r]=e[r]);return n};const Fae=Aae(rm({},qf),{withOverlay:!0,withCloseButton:!0});function Ms(e){const t=ae("Drawer",Fae,e),{title:n,withOverlay:r,overlayProps:o,withCloseButton:i,closeButtonProps:s,children:a}=t,c=Bae(t,["title","withOverlay","overlayProps","withCloseButton","closeButtonProps","children"]),u=!!n||i;return k.createElement(X4,rm({},c),r&&k.createElement(tt.Overlay,rm({},o)),k.createElement(n6,null,u&&k.createElement(tt.Header,null,n&&k.createElement(tt.Title,null,n),i&&k.createElement(tt.CloseButton,rm({},s))),k.createElement(tt.Body,null,a)))}Ms.Root=X4;Ms.CloseButton=tt.CloseButton;Ms.Overlay=tt.Overlay;Ms.Content=n6;Ms.Header=tt.Header;Ms.Title=tt.Title;Ms.Body=tt.Body;Ms.NativeScrollArea=tt.NativeScrollArea;function Vae(e){return _.Children.toArray(e).filter(Boolean)}const Hae={left:"flex-start",center:"center",right:"flex-end",apart:"space-between"};var Wae=ue((e,{spacing:t,position:n,noWrap:r,grow:o,align:i,count:s})=>({root:{boxSizing:"border-box",display:"flex",flexDirection:"row",alignItems:i||"center",flexWrap:r?"nowrap":"wrap",justifyContent:Hae[n],gap:re({size:t,sizes:e.spacing}),"& > *":{boxSizing:"border-box",maxWidth:o?`calc(${100/s}% - (${M(re({size:t,sizes:e.spacing}))} - ${re({size:t,sizes:e.spacing})} / ${s}))`:void 0,flexGrow:o?1:0}}}));const Uae=Wae;var Zae=Object.defineProperty,sv=Object.getOwnPropertySymbols,i6=Object.prototype.hasOwnProperty,s6=Object.prototype.propertyIsEnumerable,YM=(e,t,n)=>t in e?Zae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Gae=(e,t)=>{for(var n in t||(t={}))i6.call(t,n)&&YM(e,n,t[n]);if(sv)for(var n of sv(t))s6.call(t,n)&&YM(e,n,t[n]);return e},Yae=(e,t)=>{var n={};for(var r in e)i6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&sv)for(var r of sv(e))t.indexOf(r)<0&&s6.call(e,r)&&(n[r]=e[r]);return n};const Kae={position:"left",spacing:"md"},nt=_.forwardRef((e,t)=>{const n=ae("Group",Kae,e),{className:r,position:o,align:i,children:s,noWrap:a,grow:c,spacing:u,unstyled:f,variant:h}=n,m=Yae(n,["className","position","align","children","noWrap","grow","spacing","unstyled","variant"]),v=Vae(s),{classes:y,cx:w}=Uae({align:i,grow:c,noWrap:a,spacing:u,position:o,count:v.length},{unstyled:f,name:"Group",variant:h});return k.createElement(Pe,Gae({className:w(y.root,r),ref:t},m),v)});nt.displayName="@mantine/core/Group";function qae({open:e,close:t,openDelay:n,closeDelay:r}){const o=_.useRef(-1),i=_.useRef(-1),s=()=>{window.clearTimeout(o.current),window.clearTimeout(i.current)},a=()=>{s(),n===0?e():o.current=window.setTimeout(e,n)},c=()=>{s(),r===0?t():i.current=window.setTimeout(t,r)};return _.useEffect(()=>s,[]),{openDropdown:a,closeDropdown:c}}var Jae=Object.defineProperty,av=Object.getOwnPropertySymbols,a6=Object.prototype.hasOwnProperty,l6=Object.prototype.propertyIsEnumerable,KM=(e,t,n)=>t in e?Jae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qM=(e,t)=>{for(var n in t||(t={}))a6.call(t,n)&&KM(e,n,t[n]);if(av)for(var n of av(t))l6.call(t,n)&&KM(e,n,t[n]);return e},Qae=(e,t)=>{var n={};for(var r in e)a6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&av)for(var r of av(e))t.indexOf(r)<0&&l6.call(e,r)&&(n[r]=e[r]);return n};function Xae(e){const t=e,{width:n,height:r,style:o}=t,i=Qae(t,["width","height","style"]);return k.createElement("svg",qM({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:qM({width:n,height:r},o)},i),k.createElement("path",{d:"M2.5 1H12.5C13.3284 1 14 1.67157 14 2.5V12.5C14 13.3284 13.3284 14 12.5 14H2.5C1.67157 14 1 13.3284 1 12.5V2.5C1 1.67157 1.67157 1 2.5 1ZM2.5 2C2.22386 2 2 2.22386 2 2.5V8.3636L3.6818 6.6818C3.76809 6.59551 3.88572 6.54797 4.00774 6.55007C4.12975 6.55216 4.24568 6.60372 4.32895 6.69293L7.87355 10.4901L10.6818 7.6818C10.8575 7.50607 11.1425 7.50607 11.3182 7.6818L13 9.3636V2.5C13 2.22386 12.7761 2 12.5 2H2.5ZM2 12.5V9.6364L3.98887 7.64753L7.5311 11.4421L8.94113 13H2.5C2.22386 13 2 12.7761 2 12.5ZM12.5 13H10.155L8.48336 11.153L11 8.6364L13 10.6364V12.5C13 12.7761 12.7761 13 12.5 13ZM6.64922 5.5C6.64922 5.03013 7.03013 4.64922 7.5 4.64922C7.96987 4.64922 8.35078 5.03013 8.35078 5.5C8.35078 5.96987 7.96987 6.35078 7.5 6.35078C7.03013 6.35078 6.64922 5.96987 6.64922 5.5ZM7.5 3.74922C6.53307 3.74922 5.74922 4.53307 5.74922 5.5C5.74922 6.46693 6.53307 7.25078 7.5 7.25078C8.46693 7.25078 9.25078 6.46693 9.25078 5.5C9.25078 4.53307 8.46693 3.74922 7.5 3.74922Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}var ele=Object.defineProperty,tle=Object.defineProperties,nle=Object.getOwnPropertyDescriptors,JM=Object.getOwnPropertySymbols,rle=Object.prototype.hasOwnProperty,ole=Object.prototype.propertyIsEnumerable,QM=(e,t,n)=>t in e?ele(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,XM=(e,t)=>{for(var n in t||(t={}))rle.call(t,n)&&QM(e,n,t[n]);if(JM)for(var n of JM(t))ole.call(t,n)&&QM(e,n,t[n]);return e},eN=(e,t)=>tle(e,nle(t)),ile=ue((e,{radius:t})=>({root:{},imageWrapper:{position:"relative"},figure:{margin:0},image:eN(XM({},e.fn.fontStyles()),{display:"block",width:"100%",height:"100%",border:0,borderRadius:e.fn.radius(t)}),caption:{color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[7],marginTop:e.spacing.xs},placeholder:eN(XM({},e.fn.cover()),{display:"flex",alignItems:"center",justifyContent:"center",color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],backgroundColor:e.colorScheme==="dark"?e.colors.dark[8]:e.colors.gray[0],borderRadius:e.fn.radius(t)})}));const sle=ile;var ale=Object.defineProperty,lle=Object.defineProperties,cle=Object.getOwnPropertyDescriptors,lv=Object.getOwnPropertySymbols,c6=Object.prototype.hasOwnProperty,u6=Object.prototype.propertyIsEnumerable,tN=(e,t,n)=>t in e?ale(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hd=(e,t)=>{for(var n in t||(t={}))c6.call(t,n)&&tN(e,n,t[n]);if(lv)for(var n of lv(t))u6.call(t,n)&&tN(e,n,t[n]);return e},ule=(e,t)=>lle(e,cle(t)),dle=(e,t)=>{var n={};for(var r in e)c6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&lv)for(var r of lv(e))t.indexOf(r)<0&&u6.call(e,r)&&(n[r]=e[r]);return n};const fle={fit:"cover",width:"100%",height:"auto",radius:0},ai=_.forwardRef((e,t)=>{const n=ae("Image",fle,e),{className:r,alt:o,src:i,fit:s,width:a,height:c,radius:u,imageProps:f,withPlaceholder:h,placeholder:m,imageRef:v,classNames:y,styles:w,caption:P,unstyled:b,style:S,variant:O}=n,E=dle(n,["className","alt","src","fit","width","height","radius","imageProps","withPlaceholder","placeholder","imageRef","classNames","styles","caption","unstyled","style","variant"]),{classes:$,cx:N}=sle({radius:u},{classNames:y,styles:w,unstyled:b,name:"Image",variant:O}),[I,R]=_.useState(!i),B=h&&I;return Hn(()=>{R(!i)},[i]),k.createElement(Pe,hd({className:N($.root,r),style:hd({width:M(a)},S),ref:t},E),k.createElement("figure",{className:$.figure},k.createElement("div",{className:$.imageWrapper},k.createElement("img",ule(hd({src:i,alt:o,ref:v},f),{className:N($.image,f?.className),onError:z=>{R(!0),typeof f?.onError=="function"&&f.onError(z)},style:hd(hd({objectFit:s,width:M(a),height:M(c)},B&&{overflow:"hidden"}),f?.style)})),B&&k.createElement("div",{className:$.placeholder,title:o},m||k.createElement("div",null,k.createElement(Xae,{width:M(40),height:M(40)})))),!!P&&k.createElement(U,{component:"figcaption",size:"sm",align:"center",className:$.caption},P)))});ai.displayName="@mantine/core/Image";var hle=Object.defineProperty,ple=Object.defineProperties,mle=Object.getOwnPropertyDescriptors,nN=Object.getOwnPropertySymbols,gle=Object.prototype.hasOwnProperty,vle=Object.prototype.propertyIsEnumerable,rN=(e,t,n)=>t in e?hle(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,oN=(e,t)=>{for(var n in t||(t={}))gle.call(t,n)&&rN(e,n,t[n]);if(nN)for(var n of nN(t))vle.call(t,n)&&rN(e,n,t[n]);return e},iN=(e,t)=>ple(e,mle(t));const yle=e=>fG({from:{boxShadow:`0 0 ${M(.5)} 0 ${e}`,opacity:.6},to:{boxShadow:`0 0 ${M(.5)} ${M(4.4)} ${e}`,opacity:0}});function sN(e,t=0){const n={},[r,o]=e.split("-");let i="",s="";return r==="top"&&(n.top=t,s="-50%"),r==="middle"&&(n.top="50%",s="-50%"),r==="bottom"&&(n.bottom=t,s="50%"),o==="start"&&(n.left=t,i="-50%"),o==="center"&&(n.left="50%",i="-50%"),o==="end"&&(n.right=t,i="50%"),n.transform=`translate(${i}, ${s})`,n}var _le=ue((e,{radius:t,color:n,position:r,offset:o,inline:i,withBorder:s,withLabel:a,zIndex:c},{size:u})=>{const{background:f}=e.fn.variant({variant:"filled",primaryFallback:!1,color:n||e.primaryColor}),h=M(u);return{root:{position:"relative",display:i?"inline-block":"block"},indicator:iN(oN({},sN(r,o)),{zIndex:c,position:"absolute",[a?"minWidth":"width"]:h,height:h,display:"flex",justifyContent:"center",alignItems:"center",fontSize:e.fontSizes.xs,paddingLeft:a?`calc(${e.spacing.xs} / 2)`:0,paddingRight:a?`calc(${e.spacing.xs} / 2)`:0,borderRadius:e.fn.radius(t),backgroundColor:e.fn.variant({variant:"filled",primaryFallback:!1,color:n||e.primaryColor}).background,border:s?`${M(2)} solid ${e.colorScheme==="dark"?e.colors.dark[7]:e.white}`:void 0,color:e.white,whiteSpace:"nowrap"}),processing:{animation:`${yle(f)} 1000ms linear infinite`},common:iN(oN({},sN(r,o)),{position:"absolute",[a?"minWidth":"width"]:h,height:h,borderRadius:e.fn.radius(t)})}});const wle=_le;var ble=Object.defineProperty,cv=Object.getOwnPropertySymbols,d6=Object.prototype.hasOwnProperty,f6=Object.prototype.propertyIsEnumerable,aN=(e,t,n)=>t in e?ble(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xle=(e,t)=>{for(var n in t||(t={}))d6.call(t,n)&&aN(e,n,t[n]);if(cv)for(var n of cv(t))f6.call(t,n)&&aN(e,n,t[n]);return e},Sle=(e,t)=>{var n={};for(var r in e)d6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&cv)for(var r of cv(e))t.indexOf(r)<0&&f6.call(e,r)&&(n[r]=e[r]);return n};const Ple={position:"top-end",offset:0,inline:!1,withBorder:!1,disabled:!1,processing:!1,size:10,radius:1e3,zIndex:ci("app")},h6=_.forwardRef((e,t)=>{const n=ae("Indicator",Ple,e),{children:r,position:o,offset:i,size:s,radius:a,inline:c,withBorder:u,className:f,color:h,styles:m,label:v,classNames:y,disabled:w,zIndex:P,unstyled:b,processing:S,variant:O}=n,E=Sle(n,["children","position","offset","size","radius","inline","withBorder","className","color","styles","label","classNames","disabled","zIndex","unstyled","processing","variant"]),{classes:$,cx:N}=wle({position:o,offset:i,radius:a,inline:c,color:h,withBorder:u,zIndex:P,withLabel:!!v},{name:"Indicator",classNames:y,styles:m,unstyled:b,variant:O,size:s});return k.createElement(Pe,xle({ref:t,className:N($.root,f)},E),!w&&k.createElement(k.Fragment,null,k.createElement("div",{className:N($.indicator,$.common)},v),S&&k.createElement("div",{className:N($.processing,$.common)})),r)});h6.displayName="@mantine/core/Indicator";function Ole(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var Cle=_.useLayoutEffect,kle=function(t){var n=_.useRef(t);return Cle(function(){n.current=t}),n},lN=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},Ele=function(t,n){var r=_.useRef();return _.useCallback(function(o){t.current=o,r.current&&lN(r.current,null),r.current=n,n&&lN(n,o)},[n])},cN={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},uN=function(t){Object.keys(cN).forEach(function(n){t.style.setProperty(n,cN[n],"important")})},ro=null,$le=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function Mle(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),ro||(ro=document.createElement("textarea"),ro.setAttribute("tabindex","-1"),ro.setAttribute("aria-hidden","true"),uN(ro)),ro.parentNode===null&&document.body.appendChild(ro);var o=e.paddingSize,i=e.borderSize,s=e.sizingStyle,a=s.boxSizing;Object.keys(s).forEach(function(m){var v=m;ro.style[v]=s[v]}),uN(ro),ro.value=t;var c=$le(ro,e);ro.value="x";var u=ro.scrollHeight-o,f=u*n;a==="border-box"&&(f=f+o+i),c=Math.max(f,c);var h=u*r;return a==="border-box"&&(h=h+o+i),c=Math.min(h,c),[c,u]}var dN=function(){},Nle=function(t,n){return t.reduce(function(r,o){return r[o]=n[o],r},{})},Tle=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak"],Ile=!!document.documentElement.currentStyle,Dle=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=Nle(Tle,n),o=r.boxSizing;if(o==="")return null;Ile&&o==="border-box"&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px");var i=parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),s=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:i,borderSize:s}},jle=function(t){var n=kle(t);_.useLayoutEffect(function(){var r=function(i){n.current(i)};return window.addEventListener("resize",r),function(){window.removeEventListener("resize",r)}},[])},Lle=function(t,n){var r=t.cacheMeasurements,o=t.maxRows,i=t.minRows,s=t.onChange,a=s===void 0?dN:s,c=t.onHeightChange,u=c===void 0?dN:c,f=Ole(t,["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"]),h=f.value!==void 0,m=_.useRef(null),v=Ele(m,n),y=_.useRef(0),w=_.useRef(),P=function(){var O=m.current,E=r&&w.current?w.current:Dle(O);if(E){w.current=E;var $=Mle(E,O.value||O.placeholder||"x",i,o),N=$[0],I=$[1];y.current!==N&&(y.current=N,O.style.setProperty("height",N+"px","important"),u(N,{rowHeight:I}))}},b=function(O){h||P(),a(O)};return _.useLayoutEffect(P),jle(P),_.createElement("textarea",Dt({},f,{onChange:b,ref:v}))},Rle=_.forwardRef(Lle);const zle=Rle;var Ale=ue(e=>({input:{paddingTop:e.spacing.xs,paddingBottom:e.spacing.xs}}));const Ble=Ale;var Fle=Object.defineProperty,Vle=Object.defineProperties,Hle=Object.getOwnPropertyDescriptors,uv=Object.getOwnPropertySymbols,p6=Object.prototype.hasOwnProperty,m6=Object.prototype.propertyIsEnumerable,fN=(e,t,n)=>t in e?Fle(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fc=(e,t)=>{for(var n in t||(t={}))p6.call(t,n)&&fN(e,n,t[n]);if(uv)for(var n of uv(t))m6.call(t,n)&&fN(e,n,t[n]);return e},q_=(e,t)=>Vle(e,Hle(t)),Wle=(e,t)=>{var n={};for(var r in e)p6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&uv)for(var r of uv(e))t.indexOf(r)<0&&m6.call(e,r)&&(n[r]=e[r]);return n};const Ule={autosize:!1,size:"sm",__staticSelector:"Textarea"},g6=_.forwardRef((e,t)=>{const n=ae("Textarea",Ule,e),{autosize:r,maxRows:o,minRows:i,label:s,error:a,description:c,id:u,className:f,required:h,style:m,wrapperProps:v,classNames:y,styles:w,size:P,__staticSelector:b,sx:S,errorProps:O,descriptionProps:E,labelProps:$,inputWrapperOrder:N,inputContainer:I,unstyled:R,withAsterisk:B,variant:z}=n,G=Wle(n,["autosize","maxRows","minRows","label","error","description","id","className","required","style","wrapperProps","classNames","styles","size","__staticSelector","sx","errorProps","descriptionProps","labelProps","inputWrapperOrder","inputContainer","unstyled","withAsterisk","variant"]),Q=Ia(u),{classes:X,cx:V}=Ble(),{systemStyles:H,rest:Z}=Bl(G),Y=fc({required:h,ref:t,error:a,id:Q,classNames:q_(fc({},y),{input:V(X.input,y?.input)}),styles:w,__staticSelector:b,size:P,multiline:!0,unstyled:R,variant:z},Z);return k.createElement(et.Wrapper,fc(fc({label:s,error:a,id:Q,description:c,required:h,style:m,className:f,classNames:y,styles:w,size:P,__staticSelector:b,sx:S,errorProps:O,labelProps:$,descriptionProps:E,inputContainer:I,inputWrapperOrder:N,unstyled:R,withAsterisk:B,variant:z},H),v),r?k.createElement(et,q_(fc({},Y),{component:zle,maxRows:o,minRows:i})):k.createElement(et,q_(fc({},Y),{component:"textarea",rows:i})))});g6.displayName="@mantine/core/Textarea";var Zle=Object.defineProperty,Gle=Object.defineProperties,Yle=Object.getOwnPropertyDescriptors,hN=Object.getOwnPropertySymbols,Kle=Object.prototype.hasOwnProperty,qle=Object.prototype.propertyIsEnumerable,pN=(e,t,n)=>t in e?Zle(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Jle=(e,t)=>{for(var n in t||(t={}))Kle.call(t,n)&&pN(e,n,t[n]);if(hN)for(var n of hN(t))qle.call(t,n)&&pN(e,n,t[n]);return e},Qle=(e,t)=>Gle(e,Yle(t)),Xle=ue(e=>({root:Qle(Jle({},e.fn.cover()),{display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"})}));const ece=Xle;var tce=Object.defineProperty,nce=Object.defineProperties,rce=Object.getOwnPropertyDescriptors,dv=Object.getOwnPropertySymbols,v6=Object.prototype.hasOwnProperty,y6=Object.prototype.propertyIsEnumerable,mN=(e,t,n)=>t in e?tce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,cp=(e,t)=>{for(var n in t||(t={}))v6.call(t,n)&&mN(e,n,t[n]);if(dv)for(var n of dv(t))y6.call(t,n)&&mN(e,n,t[n]);return e},oce=(e,t)=>nce(e,rce(t)),ice=(e,t)=>{var n={};for(var r in e)v6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&dv)for(var r of dv(e))t.indexOf(r)<0&&y6.call(e,r)&&(n[r]=e[r]);return n};const sce={overlayOpacity:.75,transitionDuration:0,radius:0,zIndex:ci("overlay")},V0=_.forwardRef((e,t)=>{const n=ae("LoadingOverlay",sce,e),{className:r,visible:o,loaderProps:i,overlayOpacity:s,overlayColor:a,transitionDuration:c,exitTransitionDuration:u,zIndex:f,style:h,loader:m,radius:v,overlayBlur:y,unstyled:w,variant:P,keepMounted:b}=n,S=ice(n,["className","visible","loaderProps","overlayOpacity","overlayColor","transitionDuration","exitTransitionDuration","zIndex","style","loader","radius","overlayBlur","unstyled","variant","keepMounted"]),{classes:O,cx:E,theme:$}=ece(null,{name:"LoadingOverlay",unstyled:w,variant:P}),N=`calc(${f} + 1)`;return k.createElement($s,{keepMounted:b,duration:c,exitDuration:u,mounted:o,transition:"fade"},I=>k.createElement(Pe,cp({className:E(O.root,r),style:oce(cp(cp({},I),h),{zIndex:f}),ref:t},S),m?k.createElement("div",{style:{zIndex:N}},m):k.createElement(en,cp({style:{zIndex:N}},i)),k.createElement(R4,{opacity:s,zIndex:f,radius:v,blur:y,unstyled:w,color:a||($.colorScheme==="dark"?$.colors.dark[5]:$.white)})))});V0.displayName="@mantine/core/LoadingOverlay";const _6={context:"Menu component was not found in the tree",children:"Menu.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported"},[ace,Jf]=Cu(_6.context);var lce=ue(e=>({divider:{marginTop:M(4),marginBottom:M(4),borderTop:`${M(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]}`}}));const cce=lce;var uce=Object.defineProperty,fv=Object.getOwnPropertySymbols,w6=Object.prototype.hasOwnProperty,b6=Object.prototype.propertyIsEnumerable,gN=(e,t,n)=>t in e?uce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dce=(e,t)=>{for(var n in t||(t={}))w6.call(t,n)&&gN(e,n,t[n]);if(fv)for(var n of fv(t))b6.call(t,n)&&gN(e,n,t[n]);return e},fce=(e,t)=>{var n={};for(var r in e)w6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&fv)for(var r of fv(e))t.indexOf(r)<0&&b6.call(e,r)&&(n[r]=e[r]);return n};const hce={},x6=_.forwardRef((e,t)=>{const n=ae("MenuDivider",hce,e),{children:r,className:o}=n,i=fce(n,["children","className"]),{classNames:s,styles:a,unstyled:c,variant:u}=Jf(),{classes:f,cx:h}=cce(null,{name:"Menu",classNames:s,styles:a,unstyled:c,variant:u});return k.createElement(Pe,dce({className:h(f.divider,o),ref:t},i))});x6.displayName="@mantine/core/MenuDivider";var pce=Object.defineProperty,hv=Object.getOwnPropertySymbols,S6=Object.prototype.hasOwnProperty,P6=Object.prototype.propertyIsEnumerable,vN=(e,t,n)=>t in e?pce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mce=(e,t)=>{for(var n in t||(t={}))S6.call(t,n)&&vN(e,n,t[n]);if(hv)for(var n of hv(t))P6.call(t,n)&&vN(e,n,t[n]);return e},gce=(e,t)=>{var n={};for(var r in e)S6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&hv)for(var r of hv(e))t.indexOf(r)<0&&P6.call(e,r)&&(n[r]=e[r]);return n};const vce={};function O6(e){const t=ae("MenuDropdown",vce,e),{children:n,onMouseEnter:r,onMouseLeave:o}=t,i=gce(t,["children","onMouseEnter","onMouseLeave"]),s=_.useRef(),a=Jf(),c=h=>{var m;(h.key==="ArrowUp"||h.key==="ArrowDown")&&(h.preventDefault(),(m=s.current.querySelectorAll("[data-menu-item]:not(:disabled)")[0])==null||m.focus())},u=ls(r,()=>a.trigger==="hover"&&a.openDropdown()),f=ls(o,()=>a.trigger==="hover"&&a.closeDropdown());return k.createElement(En.Dropdown,mce({onMouseEnter:u,onMouseLeave:f,role:"menu","aria-orientation":"vertical"},i),k.createElement("div",{tabIndex:-1,"data-menu-dropdown":!0,"data-autofocus":!0,onKeyDown:c,ref:s,style:{outline:0}},n))}O6.displayName="@mantine/core/MenuDropdown";var yce=Object.defineProperty,_ce=Object.defineProperties,wce=Object.getOwnPropertyDescriptors,yN=Object.getOwnPropertySymbols,bce=Object.prototype.hasOwnProperty,xce=Object.prototype.propertyIsEnumerable,_N=(e,t,n)=>t in e?yce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Sce=(e,t)=>{for(var n in t||(t={}))bce.call(t,n)&&_N(e,n,t[n]);if(yN)for(var n of yN(t))xce.call(t,n)&&_N(e,n,t[n]);return e},Pce=(e,t)=>_ce(e,wce(t)),Oce=ue((e,{color:t,radius:n})=>({item:Pce(Sce({},e.fn.fontStyles()),{WebkitTapHighlightColor:"transparent",fontSize:e.fontSizes.sm,border:0,backgroundColor:"transparent",outline:0,width:"100%",textAlign:"left",textDecoration:"none",boxSizing:"border-box",padding:`${e.spacing.xs} ${e.spacing.sm}`,cursor:"pointer",borderRadius:e.fn.radius(n),color:t?e.fn.variant({variant:"filled",primaryFallback:!1,color:t}).background:e.colorScheme==="dark"?e.colors.dark[0]:e.black,display:"flex",alignItems:"center","&:disabled":{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5],pointerEvents:"none",userSelect:"none"},"&[data-hovered]":{backgroundColor:t?e.fn.variant({variant:"light",color:t}).background:e.colorScheme==="dark"?e.fn.rgba(e.colors.dark[3],.35):e.colors.gray[1]}}),itemLabel:{flex:1},itemIcon:{display:"flex",justifyContent:"center",alignItems:"center",marginRight:e.spacing.xs},itemRightSection:{}}));const Cce=Oce;var kce=Object.defineProperty,Ece=Object.defineProperties,$ce=Object.getOwnPropertyDescriptors,pv=Object.getOwnPropertySymbols,C6=Object.prototype.hasOwnProperty,k6=Object.prototype.propertyIsEnumerable,wN=(e,t,n)=>t in e?kce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mce=(e,t)=>{for(var n in t||(t={}))C6.call(t,n)&&wN(e,n,t[n]);if(pv)for(var n of pv(t))k6.call(t,n)&&wN(e,n,t[n]);return e},Nce=(e,t)=>Ece(e,$ce(t)),Tce=(e,t)=>{var n={};for(var r in e)C6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&pv)for(var r of pv(e))t.indexOf(r)<0&&k6.call(e,r)&&(n[r]=e[r]);return n};const Ice={},E6=_.forwardRef((e,t)=>{const n=ae("MenuItem",Ice,e),{children:r,className:o,color:i,closeMenuOnClick:s,icon:a,rightSection:c}=n,u=Tce(n,["children","className","color","closeMenuOnClick","icon","rightSection"]),f=Jf(),{classes:h,cx:m,theme:v}=Cce({radius:f.radius,color:i},{name:"Menu",classNames:f.classNames,styles:f.styles,unstyled:f.unstyled,variant:f.variant}),y=_.useRef(),w=f.getItemIndex(y.current),P=u,b=ls(P.onMouseLeave,()=>f.setHovered(-1)),S=ls(P.onMouseEnter,()=>f.setHovered(f.getItemIndex(y.current))),O=ls(P.onClick,()=>{typeof s=="boolean"?s&&f.closeDropdownImmediately():f.closeOnItemClick&&f.closeDropdownImmediately()}),E=ls(P.onFocus,()=>f.setHovered(f.getItemIndex(y.current)));return k.createElement(Pe,Nce(Mce({component:"button",type:"button"},u),{tabIndex:-1,onFocus:E,className:m(h.item,o),ref:Ps(y,t),role:"menuitem","data-menu-item":!0,"data-hovered":f.hovered===w?!0:void 0,onMouseEnter:S,onMouseLeave:b,onClick:O,onKeyDown:$U({siblingSelector:"[data-menu-item]",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:f.loop,dir:v.dir,orientation:"vertical",onKeyDown:P.onKeydown})}),a&&k.createElement("div",{className:h.itemIcon},a),r&&k.createElement("div",{className:h.itemLabel},r),c&&k.createElement("div",{className:h.itemRightSection},c))});E6.displayName="@mantine/core/MenuItem";const Dce=E6;var jce=ue(e=>({label:{color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],fontWeight:500,fontSize:e.fontSizes.xs,padding:`calc(${e.spacing.xs} / 2) ${e.spacing.sm}`,cursor:"default"}}));const Lce=jce;var Rce=Object.defineProperty,mv=Object.getOwnPropertySymbols,$6=Object.prototype.hasOwnProperty,M6=Object.prototype.propertyIsEnumerable,bN=(e,t,n)=>t in e?Rce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zce=(e,t)=>{for(var n in t||(t={}))$6.call(t,n)&&bN(e,n,t[n]);if(mv)for(var n of mv(t))M6.call(t,n)&&bN(e,n,t[n]);return e},Ace=(e,t)=>{var n={};for(var r in e)$6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&mv)for(var r of mv(e))t.indexOf(r)<0&&M6.call(e,r)&&(n[r]=e[r]);return n};const Bce={},N6=_.forwardRef((e,t)=>{const n=ae("MenuLabel",Bce,e),{children:r,className:o}=n,i=Ace(n,["children","className"]),{classNames:s,styles:a,unstyled:c,variant:u}=Jf(),{classes:f,cx:h}=Lce(null,{name:"Menu",classNames:s,styles:a,unstyled:c,variant:u});return k.createElement(U,zce({className:h(f.label,o),ref:t},i),r)});N6.displayName="@mantine/core/MenuLabel";var Fce=Object.defineProperty,gv=Object.getOwnPropertySymbols,T6=Object.prototype.hasOwnProperty,I6=Object.prototype.propertyIsEnumerable,xN=(e,t,n)=>t in e?Fce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Vce=(e,t)=>{for(var n in t||(t={}))T6.call(t,n)&&xN(e,n,t[n]);if(gv)for(var n of gv(t))I6.call(t,n)&&xN(e,n,t[n]);return e},Hce=(e,t)=>{var n={};for(var r in e)T6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&gv)for(var r of gv(e))t.indexOf(r)<0&&I6.call(e,r)&&(n[r]=e[r]);return n};const Wce={refProp:"ref"},D6=_.forwardRef((e,t)=>{const n=ae("MenuTarget",Wce,e),{children:r,refProp:o}=n,i=Hce(n,["children","refProp"]);if(!zf(r))throw new Error(_6.children);const s=Jf(),a=ls(r.props.onClick,()=>s.trigger==="click"&&s.toggleDropdown()),c=ls(r.props.onMouseEnter,()=>s.trigger==="hover"&&s.openDropdown()),u=ls(r.props.onMouseLeave,()=>s.trigger==="hover"&&s.closeDropdown());return k.createElement(En.Target,Vce({refProp:o,popupType:"menu",ref:t},i),_.cloneElement(r,{onClick:a,onMouseEnter:c,onMouseLeave:u,"data-expanded":s.opened?!0:void 0}))});D6.displayName="@mantine/core/MenuTarget";var Uce=ue({dropdown:{padding:M(4)}});const Zce=Uce;var Gce=Object.defineProperty,Yce=Object.defineProperties,Kce=Object.getOwnPropertyDescriptors,vv=Object.getOwnPropertySymbols,j6=Object.prototype.hasOwnProperty,L6=Object.prototype.propertyIsEnumerable,SN=(e,t,n)=>t in e?Gce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,PN=(e,t)=>{for(var n in t||(t={}))j6.call(t,n)&&SN(e,n,t[n]);if(vv)for(var n of vv(t))L6.call(t,n)&&SN(e,n,t[n]);return e},ON=(e,t)=>Yce(e,Kce(t)),qce=(e,t)=>{var n={};for(var r in e)j6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&vv)for(var r of vv(e))t.indexOf(r)<0&&L6.call(e,r)&&(n[r]=e[r]);return n};const Jce={closeOnItemClick:!0,loop:!0,trigger:"click",openDelay:0,closeDelay:100};function Tt(e){const t=ae("Menu",Jce,e),{children:n,onOpen:r,onClose:o,opened:i,defaultOpened:s,onChange:a,closeOnItemClick:c,loop:u,closeOnEscape:f,trigger:h,openDelay:m,closeDelay:v,classNames:y,styles:w,unstyled:P,radius:b,variant:S}=t,O=qce(t,["children","onOpen","onClose","opened","defaultOpened","onChange","closeOnItemClick","loop","closeOnEscape","trigger","openDelay","closeDelay","classNames","styles","unstyled","radius","variant"]),{classes:E,cx:$}=Zce(),[N,{setHovered:I,resetHovered:R}]=DU(),[B,z]=_o({value:i,defaultValue:s,finalValue:!1,onChange:a}),G=()=>{z(!1),B&&o?.()},Q=()=>{z(!0),!B&&r?.()},X=()=>B?G():Q(),{openDropdown:V,closeDropdown:H}=qae({open:Q,close:G,closeDelay:v,openDelay:m}),Z=Y=>MU("[data-menu-item]","[data-menu-dropdown]",Y);return Hn(()=>{R()},[B]),k.createElement(ace,{value:{opened:B,toggleDropdown:X,getItemIndex:Z,hovered:N,setHovered:I,closeOnItemClick:c,closeDropdown:h==="click"?G:H,openDropdown:h==="click"?Q:V,closeDropdownImmediately:G,loop:u,trigger:h,radius:b,classNames:y,styles:w,unstyled:P,variant:S}},k.createElement(En,ON(PN({},O),{radius:b,opened:B,onChange:X,defaultOpened:s,trapFocus:h==="click",closeOnEscape:f&&h==="click",__staticSelector:"Menu",classNames:ON(PN({},y),{dropdown:$(E.dropdown,y?.dropdown)}),styles:w,unstyled:P,variant:S}),n))}Tt.displayName="@mantine/core/Menu";Tt.Item=Dce;Tt.Label=N6;Tt.Dropdown=O6;Tt.Target=D6;Tt.Divider=x6;const[Qce,Xce]=Cu("Modal component was not found in tree"),eue={xs:M(320),sm:M(380),md:M(440),lg:M(620),xl:M(780)};var tue=ue((e,{yOffset:t,xOffset:n,centered:r,fullScreen:o},{size:i})=>({content:{flex:o?"0 0 100%":`0 0 ${re({size:i,sizes:eue})}`,maxWidth:"100%",maxHeight:o?void 0:`calc(100dvh - (${M(t)} * 2))`,height:o?"100vh":void 0,borderRadius:o?0:void 0,overflowY:"auto"},inner:{paddingTop:o?0:t,paddingBottom:o?0:t,paddingLeft:o?0:n,paddingRight:o?0:n,display:"flex",justifyContent:"center",alignItems:r?"center":"flex-start"}}));const nue=tue;var rue=Object.defineProperty,oue=Object.defineProperties,iue=Object.getOwnPropertyDescriptors,yv=Object.getOwnPropertySymbols,R6=Object.prototype.hasOwnProperty,z6=Object.prototype.propertyIsEnumerable,CN=(e,t,n)=>t in e?rue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ux=(e,t)=>{for(var n in t||(t={}))R6.call(t,n)&&CN(e,n,t[n]);if(yv)for(var n of yv(t))z6.call(t,n)&&CN(e,n,t[n]);return e},A6=(e,t)=>oue(e,iue(t)),sue=(e,t)=>{var n={};for(var r in e)R6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&yv)for(var r of yv(e))t.indexOf(r)<0&&z6.call(e,r)&&(n[r]=e[r]);return n};const aue=A6(ux({},qf),{yOffset:"5dvh",xOffset:"5vw"});function B6(e){const t=ae("ModalRoot",aue,e),{classNames:n,variant:r,size:o,yOffset:i,xOffset:s,scrollAreaComponent:a,radius:c,centered:u,fullScreen:f}=t,h=sue(t,["classNames","variant","size","yOffset","xOffset","scrollAreaComponent","radius","centered","fullScreen"]),{classes:m,cx:v}=nue({yOffset:i,xOffset:s,centered:u,fullScreen:f},{name:"Modal",variant:r,size:o});return k.createElement(Qce,{value:{yOffset:i,scrollAreaComponent:a,radius:c}},k.createElement(tt,ux({__staticSelector:"Modal",size:o,variant:r,classNames:A6(ux({},n),{content:v(m.content,n?.content),inner:v(m.inner,n?.inner)})},h)))}var lue=Object.defineProperty,_v=Object.getOwnPropertySymbols,F6=Object.prototype.hasOwnProperty,V6=Object.prototype.propertyIsEnumerable,kN=(e,t,n)=>t in e?lue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,cue=(e,t)=>{for(var n in t||(t={}))F6.call(t,n)&&kN(e,n,t[n]);if(_v)for(var n of _v(t))V6.call(t,n)&&kN(e,n,t[n]);return e},uue=(e,t)=>{var n={};for(var r in e)F6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&_v)for(var r of _v(e))t.indexOf(r)<0&&V6.call(e,r)&&(n[r]=e[r]);return n};const due={shadow:"xl"},H6=_.forwardRef((e,t)=>{const n=ae("ModalContent",due,e),{children:r,scrollAreaComponent:o}=n,i=uue(n,["children","scrollAreaComponent"]),s=Xce(),a=o||s.scrollAreaComponent||tt.NativeScrollArea;return k.createElement(tt.Content,cue({ref:t,radius:s.radius},i),k.createElement(a,{style:{maxHeight:`calc(100dvh - (${M(s.yOffset)} * 2))`}},r))});var fue=Object.defineProperty,hue=Object.defineProperties,pue=Object.getOwnPropertyDescriptors,wv=Object.getOwnPropertySymbols,W6=Object.prototype.hasOwnProperty,U6=Object.prototype.propertyIsEnumerable,EN=(e,t,n)=>t in e?fue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,om=(e,t)=>{for(var n in t||(t={}))W6.call(t,n)&&EN(e,n,t[n]);if(wv)for(var n of wv(t))U6.call(t,n)&&EN(e,n,t[n]);return e},mue=(e,t)=>hue(e,pue(t)),gue=(e,t)=>{var n={};for(var r in e)W6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&wv)for(var r of wv(e))t.indexOf(r)<0&&U6.call(e,r)&&(n[r]=e[r]);return n};const vue=mue(om({},qf),{transitionProps:{duration:200,transition:"pop"},withOverlay:!0,withCloseButton:!0});function Bi(e){const t=ae("Modal",vue,e),{title:n,withOverlay:r,overlayProps:o,withCloseButton:i,closeButtonProps:s,children:a}=t,c=gue(t,["title","withOverlay","overlayProps","withCloseButton","closeButtonProps","children"]),u=!!n||i;return k.createElement(B6,om({},c),r&&k.createElement(tt.Overlay,om({},o)),k.createElement(H6,null,u&&k.createElement(tt.Header,null,n&&k.createElement(tt.Title,null,n),i&&k.createElement(tt.CloseButton,om({},s))),k.createElement(tt.Body,null,a)))}Bi.Root=B6;Bi.CloseButton=tt.CloseButton;Bi.Overlay=tt.Overlay;Bi.Content=H6;Bi.Header=tt.Header;Bi.Title=tt.Title;Bi.Body=tt.Body;Bi.NativeScrollArea=tt.NativeScrollArea;const Z6={xs:M(16),sm:M(22),md:M(26),lg:M(30),xl:M(36)},yue={xs:M(10),sm:M(12),md:M(14),lg:M(16),xl:M(18)};var _ue=ue((e,{disabled:t,radius:n,readOnly:r},{size:o,variant:i})=>({defaultValue:{display:"flex",alignItems:"center",backgroundColor:t?e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[3]:e.colorScheme==="dark"?e.colors.dark[7]:i==="filled"?e.white:e.colors.gray[1],color:t?e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[7]:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],height:re({size:o,sizes:Z6}),paddingLeft:`calc(${re({size:o,sizes:e.spacing})} / 1.5)`,paddingRight:t||r?re({size:o,sizes:e.spacing}):0,fontWeight:500,fontSize:re({size:o,sizes:yue}),borderRadius:re({size:n,sizes:e.radius}),cursor:t?"not-allowed":"default",userSelect:"none",maxWidth:`calc(100% - ${M(10)})`},defaultValueRemove:{color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],marginLeft:`calc(${re({size:o,sizes:e.spacing})} / 6)`},defaultValueLabel:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}));const wue=_ue;var bue=Object.defineProperty,bv=Object.getOwnPropertySymbols,G6=Object.prototype.hasOwnProperty,Y6=Object.prototype.propertyIsEnumerable,$N=(e,t,n)=>t in e?bue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xue=(e,t)=>{for(var n in t||(t={}))G6.call(t,n)&&$N(e,n,t[n]);if(bv)for(var n of bv(t))Y6.call(t,n)&&$N(e,n,t[n]);return e},Sue=(e,t)=>{var n={};for(var r in e)G6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&bv)for(var r of bv(e))t.indexOf(r)<0&&Y6.call(e,r)&&(n[r]=e[r]);return n};const Pue={xs:16,sm:22,md:24,lg:26,xl:30};function K6(e){var t=e,{label:n,classNames:r,styles:o,className:i,onRemove:s,disabled:a,readOnly:c,size:u,radius:f="sm",variant:h,unstyled:m}=t,v=Sue(t,["label","classNames","styles","className","onRemove","disabled","readOnly","size","radius","variant","unstyled"]);const{classes:y,cx:w}=wue({disabled:a,readOnly:c,radius:f},{name:"MultiSelect",classNames:r,styles:o,unstyled:m,size:u,variant:h});return k.createElement("div",xue({className:w(y.defaultValue,i)},v),k.createElement("span",{className:y.defaultValueLabel},n),!a&&!c&&k.createElement(j0,{"aria-hidden":!0,onMouseDown:s,size:Pue[u],radius:2,color:"blue",variant:"transparent",iconSize:"70%",className:y.defaultValueRemove,tabIndex:-1,unstyled:m}))}K6.displayName="@mantine/core/MultiSelect/DefaultValue";function Oue({data:e,searchable:t,limit:n,searchValue:r,filter:o,value:i,disableSelectedItemFiltering:s}){if(!t&&i.length===0)return e;if(!t){const c=[];for(let u=0;uf===e[u].value&&!e[u].disabled))&&c.push(e[u]);return c}const a=[];for(let c=0;cu===e[c].value&&!e[c].disabled),e[c])&&a.push(e[c]),!(a.length>=n));c+=1);return a}var Cue=Object.defineProperty,xv=Object.getOwnPropertySymbols,q6=Object.prototype.hasOwnProperty,J6=Object.prototype.propertyIsEnumerable,MN=(e,t,n)=>t in e?Cue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,NN=(e,t)=>{for(var n in t||(t={}))q6.call(t,n)&&MN(e,n,t[n]);if(xv)for(var n of xv(t))J6.call(t,n)&&MN(e,n,t[n]);return e},kue=(e,t)=>{var n={};for(var r in e)q6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&xv)for(var r of xv(e))t.indexOf(r)<0&&J6.call(e,r)&&(n[r]=e[r]);return n};const Eue={xs:M(14),sm:M(18),md:M(20),lg:M(24),xl:M(28)};function $ue(e){var t=e,{size:n,error:r,style:o}=t,i=kue(t,["size","error","style"]);const s=ar(),a=re({size:n,sizes:Eue});return k.createElement("svg",NN({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:NN({color:r?s.colors.red[6]:s.colors.gray[6],width:a,height:a},o),"data-chevron":!0},i),k.createElement("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}var Mue=Object.defineProperty,Nue=Object.defineProperties,Tue=Object.getOwnPropertyDescriptors,TN=Object.getOwnPropertySymbols,Iue=Object.prototype.hasOwnProperty,Due=Object.prototype.propertyIsEnumerable,IN=(e,t,n)=>t in e?Mue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,jue=(e,t)=>{for(var n in t||(t={}))Iue.call(t,n)&&IN(e,n,t[n]);if(TN)for(var n of TN(t))Due.call(t,n)&&IN(e,n,t[n]);return e},Lue=(e,t)=>Nue(e,Tue(t));function Q6({shouldClear:e,clearButtonProps:t,onClear:n,size:r,error:o}){return e?k.createElement(j0,Lue(jue({},t),{variant:"transparent",onClick:n,size:r,onMouseDown:i=>i.preventDefault()})):k.createElement($ue,{error:o,size:r})}Q6.displayName="@mantine/core/SelectRightSection";var Rue=Object.defineProperty,zue=Object.defineProperties,Aue=Object.getOwnPropertyDescriptors,Sv=Object.getOwnPropertySymbols,X6=Object.prototype.hasOwnProperty,e8=Object.prototype.propertyIsEnumerable,DN=(e,t,n)=>t in e?Rue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,J_=(e,t)=>{for(var n in t||(t={}))X6.call(t,n)&&DN(e,n,t[n]);if(Sv)for(var n of Sv(t))e8.call(t,n)&&DN(e,n,t[n]);return e},jN=(e,t)=>zue(e,Aue(t)),Bue=(e,t)=>{var n={};for(var r in e)X6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Sv)for(var r of Sv(e))t.indexOf(r)<0&&e8.call(e,r)&&(n[r]=e[r]);return n};function t8(e){var t=e,{styles:n,rightSection:r,rightSectionWidth:o,theme:i}=t,s=Bue(t,["styles","rightSection","rightSectionWidth","theme"]);if(r)return{rightSection:r,rightSectionWidth:o,styles:n};const a=typeof n=="function"?n(i):n;return{rightSection:!s.readOnly&&!(s.disabled&&s.shouldClear)&&k.createElement(Q6,J_({},s)),styles:jN(J_({},a),{rightSection:jN(J_({},a?.rightSection),{pointerEvents:s.shouldClear?void 0:"none"})})}}var Fue=Object.defineProperty,Vue=Object.defineProperties,Hue=Object.getOwnPropertyDescriptors,LN=Object.getOwnPropertySymbols,Wue=Object.prototype.hasOwnProperty,Uue=Object.prototype.propertyIsEnumerable,RN=(e,t,n)=>t in e?Fue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Zue=(e,t)=>{for(var n in t||(t={}))Wue.call(t,n)&&RN(e,n,t[n]);if(LN)for(var n of LN(t))Uue.call(t,n)&&RN(e,n,t[n]);return e},Gue=(e,t)=>Vue(e,Hue(t)),Yue=ue((e,{invalid:t},{size:n})=>({wrapper:{position:"relative","&:has(input:disabled)":{cursor:"not-allowed",pointerEvents:"none","& .mantine-MultiSelect-input":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[1],color:e.colors.dark[2],opacity:.6,"&::placeholder":{color:e.colors.dark[2]}},"& .mantine-MultiSelect-defaultValue":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[3],color:e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[7]}}},values:{minHeight:`calc(${re({size:n,sizes:Rn})} - ${M(2)})`,display:"flex",alignItems:"center",flexWrap:"wrap",marginLeft:`calc(-${e.spacing.xs} / 2)`,boxSizing:"border-box","&[data-clearable]":{marginRight:re({size:n,sizes:Rn})}},value:{margin:`calc(${e.spacing.xs} / 2 - ${M(2)}) calc(${e.spacing.xs} / 2)`},searchInput:Gue(Zue({},e.fn.fontStyles()),{flex:1,minWidth:M(60),backgroundColor:"transparent",border:0,outline:0,fontSize:re({size:n,sizes:e.fontSizes}),padding:0,marginLeft:`calc(${e.spacing.xs} / 2)`,appearance:"none",color:"inherit",maxHeight:re({size:n,sizes:Z6}),"&::placeholder":{opacity:1,color:t?e.colors.red[e.fn.primaryShade()]:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]},"&:disabled":{cursor:"not-allowed",pointerEvents:"none"}}),searchInputEmpty:{width:"100%"},searchInputInputHidden:{flex:0,width:0,minWidth:0,margin:0,overflow:"hidden"},searchInputPointer:{cursor:"pointer","&:disabled":{cursor:"not-allowed",pointerEvents:"none"}},input:{cursor:"pointer","&:disabled":{cursor:"not-allowed",pointerEvents:"none"}}}));const Kue=Yue;var que=Object.defineProperty,Jue=Object.defineProperties,Que=Object.getOwnPropertyDescriptors,Pv=Object.getOwnPropertySymbols,n8=Object.prototype.hasOwnProperty,r8=Object.prototype.propertyIsEnumerable,zN=(e,t,n)=>t in e?que(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hc=(e,t)=>{for(var n in t||(t={}))n8.call(t,n)&&zN(e,n,t[n]);if(Pv)for(var n of Pv(t))r8.call(t,n)&&zN(e,n,t[n]);return e},AN=(e,t)=>Jue(e,Que(t)),Xue=(e,t)=>{var n={};for(var r in e)n8.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Pv)for(var r of Pv(e))t.indexOf(r)<0&&r8.call(e,r)&&(n[r]=e[r]);return n};function ede(e,t,n){return t?!1:n.label.toLowerCase().trim().includes(e.toLowerCase().trim())}function tde(e,t){return!!e&&!t.some(n=>n.value.toLowerCase()===e.toLowerCase())}function BN(e,t){if(!Array.isArray(e))return;if(t.length===0)return[];const n=t.map(r=>typeof r=="object"?r.value:r);return e.filter(r=>n.includes(r))}const nde={size:"sm",valueComponent:K6,itemComponent:SP,transitionProps:{transition:"fade",duration:0},maxDropdownHeight:220,shadow:"sm",searchable:!1,filter:ede,limit:1/0,clearSearchOnChange:!0,clearable:!1,clearSearchOnBlur:!1,disabled:!1,initiallyOpened:!1,creatable:!1,shouldCreate:tde,switchDirectionOnFlip:!1,zIndex:ci("popover"),selectOnBlur:!1,positionDependencies:[],dropdownPosition:"flip"},KP=_.forwardRef((e,t)=>{const n=ae("MultiSelect",nde,e),{className:r,style:o,required:i,label:s,description:a,size:c,error:u,classNames:f,styles:h,wrapperProps:m,value:v,defaultValue:y,data:w,onChange:P,valueComponent:b,itemComponent:S,id:O,transitionProps:E,maxDropdownHeight:$,shadow:N,nothingFound:I,onFocus:R,onBlur:B,searchable:z,placeholder:G,filter:Q,limit:X,clearSearchOnChange:V,clearable:H,clearSearchOnBlur:Z,variant:Y,onSearchChange:D,searchValue:W,disabled:F,initiallyOpened:K,radius:ee,icon:fe,rightSection:ie,rightSectionWidth:J,creatable:ne,getCreateLabel:le,shouldCreate:_e,onCreate:Ne,sx:we,dropdownComponent:He,onDropdownClose:Te,onDropdownOpen:De,maxSelectedValues:st,withinPortal:bt,portalProps:wn,switchDirectionOnFlip:ht,zIndex:In,selectOnBlur:Er,name:lt,dropdownPosition:Yn,errorProps:Jt,labelProps:pt,descriptionProps:Po,form:Jr,positionDependencies:cr,onKeyDown:Qr,unstyled:Bt,inputContainer:Xr,inputWrapperOrder:hn,readOnly:bn,withAsterisk:$r,clearButtonProps:gt,hoverOnSearchChange:be,disableSelectedItemFiltering:Le}=n,eo=Xue(n,["className","style","required","label","description","size","error","classNames","styles","wrapperProps","value","defaultValue","data","onChange","valueComponent","itemComponent","id","transitionProps","maxDropdownHeight","shadow","nothingFound","onFocus","onBlur","searchable","placeholder","filter","limit","clearSearchOnChange","clearable","clearSearchOnBlur","variant","onSearchChange","searchValue","disabled","initiallyOpened","radius","icon","rightSection","rightSectionWidth","creatable","getCreateLabel","shouldCreate","onCreate","sx","dropdownComponent","onDropdownClose","onDropdownOpen","maxSelectedValues","withinPortal","portalProps","switchDirectionOnFlip","zIndex","selectOnBlur","name","dropdownPosition","errorProps","labelProps","descriptionProps","form","positionDependencies","onKeyDown","unstyled","inputContainer","inputWrapperOrder","readOnly","withAsterisk","clearButtonProps","hoverOnSearchChange","disableSelectedItemFiltering"]),{classes:Lt,cx:Zt,theme:Mr}=Kue({invalid:!!u},{name:"MultiSelect",classNames:f,styles:h,unstyled:Bt,size:c,variant:Y}),{systemStyles:xt,rest:nn}=Bl(eo),Kn=_.useRef(),Ha=_.useRef({}),qn=Ia(O),[xn,Ft]=_.useState(K),[Gt,to]=_.useState(-1),[Oo,ur]=_.useState("column"),[dr,Ui]=_o({value:W,defaultValue:"",finalValue:void 0,onChange:D}),[Ts,fr]=_.useState(!1),{scrollIntoView:Oe,targetRef:Wa,scrollableRef:Ql}=S5({duration:0,offset:5,cancelable:!1,isList:!0}),Ua=ne&&typeof le=="function";let Se=null;const ct=w.map(Ie=>typeof Ie=="string"?{label:Ie,value:Ie}:Ie),rn=WL({data:ct}),[ze,Zi]=_o({value:BN(v,w),defaultValue:BN(y,w),finalValue:[],onChange:P}),no=_.useRef(!!st&&st{if(!bn){const vt=ze.filter(Sn=>Sn!==Ie);Zi(vt),st&&vt.length{Ui(Ie.currentTarget.value),!F&&!no.current&&z&&Ft(!0)},N1=Ie=>{typeof R=="function"&&R(Ie),!F&&!no.current&&z&&Ft(!0)},on=Oue({data:rn,searchable:z,searchValue:dr,limit:X,filter:Q,value:ze,disableSelectedItemFiltering:Le});Ua&&_e(dr,rn)&&(Se=le(dr),on.push({label:dr,value:dr,creatable:!0}));const Gi=Math.min(Gt,on.length-1),Za=(Ie,vt,Sn)=>{let Fe=Ie;for(;Sn(Fe);)if(Fe=vt(Fe),!on[Fe].disabled)return Fe;return Ie};Hn(()=>{to(be&&dr?0:-1)},[dr,be]),Hn(()=>{!F&&ze.length>w.length&&Ft(!1),st&&ze.length=st&&(no.current=!0,Ft(!1))},[ze]);const Xl=Ie=>{if(!bn)if(V&&Ui(""),ze.includes(Ie.value))ch(Ie.value);else{if(Ie.creatable&&typeof Ne=="function"){const vt=Ne(Ie.value);typeof vt<"u"&&vt!==null&&Zi(typeof vt=="string"?[...ze,vt]:[...ze,vt.value])}else Zi([...ze,Ie.value]);ze.length===st-1&&(no.current=!0,Ft(!1)),on.length===1&&Ft(!1)}},T1=Ie=>{typeof B=="function"&&B(Ie),Er&&on[Gi]&&xn&&Xl(on[Gi]),Z&&Ui(""),Ft(!1)},I1=Ie=>{if(Ts||(Qr?.(Ie),bn)||Ie.key!=="Backspace"&&st&&no.current)return;const vt=Oo==="column",Sn=()=>{to(ut=>{var Nr;const Co=Za(ut,Tr=>Tr+1,Tr=>Tr{to(ut=>{var Nr;const Co=Za(ut,Tr=>Tr-1,Tr=>Tr>0);return xn&&(Wa.current=Ha.current[(Nr=on[Co])==null?void 0:Nr.value],Oe({alignment:vt?"start":"end"})),Co})};switch(Ie.key){case"ArrowUp":{Ie.preventDefault(),Ft(!0),vt?Fe():Sn();break}case"ArrowDown":{Ie.preventDefault(),Ft(!0),vt?Sn():Fe();break}case"Enter":{Ie.preventDefault(),on[Gi]&&xn?Xl(on[Gi]):Ft(!0);break}case" ":{z||(Ie.preventDefault(),on[Gi]&&xn?Xl(on[Gi]):Ft(!0));break}case"Backspace":{ze.length>0&&dr.length===0&&(Zi(ze.slice(0,-1)),Ft(!0),st&&(no.current=!1));break}case"Home":{if(!z){Ie.preventDefault(),xn||Ft(!0);const ut=on.findIndex(Nr=>!Nr.disabled);to(ut),Oe({alignment:vt?"end":"start"})}break}case"End":{if(!z){Ie.preventDefault(),xn||Ft(!0);const ut=on.map(Nr=>!!Nr.disabled).lastIndexOf(!1);to(ut),Oe({alignment:vt?"end":"start"})}break}case"Escape":Ft(!1)}},D1=ze.map(Ie=>{let vt=rn.find(Sn=>Sn.value===Ie&&!Sn.disabled);return!vt&&Ua&&(vt={value:Ie,label:Ie}),vt}).filter(Ie=>!!Ie).map((Ie,vt)=>k.createElement(b,AN(hc({},Ie),{variant:Y,disabled:F,className:Lt.value,readOnly:bn,onRemove:Sn=>{Sn.preventDefault(),Sn.stopPropagation(),ch(Ie.value)},key:Ie.value,size:c,styles:h,classNames:f,radius:ee,index:vt}))),j1=Ie=>ze.includes(Ie),Bu=()=>{var Ie;Ui(""),Zi([]),(Ie=Kn.current)==null||Ie.focus(),st&&(no.current=!1)},ui=!bn&&(on.length>0?xn:xn&&!!I);return Hn(()=>{const Ie=ui?De:Te;typeof Ie=="function"&&Ie()},[ui]),k.createElement(et.Wrapper,hc(hc({required:i,id:qn,label:s,error:u,description:a,size:c,className:r,style:o,classNames:f,styles:h,__staticSelector:"MultiSelect",sx:we,errorProps:Jt,descriptionProps:Po,labelProps:pt,inputContainer:Xr,inputWrapperOrder:hn,unstyled:Bt,withAsterisk:$r,variant:Y},xt),m),k.createElement(ya,{opened:ui,transitionProps:E,shadow:"sm",withinPortal:bt,portalProps:wn,__staticSelector:"MultiSelect",onDirectionChange:ur,switchDirectionOnFlip:ht,zIndex:In,dropdownPosition:Yn,positionDependencies:[...cr,dr],classNames:f,styles:h,unstyled:Bt,variant:Y},k.createElement(ya.Target,null,k.createElement("div",{className:Lt.wrapper,role:"combobox","aria-haspopup":"listbox","aria-owns":xn&&ui?`${qn}-items`:null,"aria-controls":qn,"aria-expanded":xn,onMouseLeave:()=>to(-1),tabIndex:-1},k.createElement("input",{type:"hidden",name:lt,value:ze.join(","),form:Jr,disabled:F}),k.createElement(et,hc({__staticSelector:"MultiSelect",style:{overflow:"hidden"},component:"div",multiline:!0,size:c,variant:Y,disabled:F,error:u,required:i,radius:ee,icon:fe,unstyled:Bt,onMouseDown:Ie=>{var vt;Ie.preventDefault(),!F&&!no.current&&Ft(!xn),(vt=Kn.current)==null||vt.focus()},classNames:AN(hc({},f),{input:Zt({[Lt.input]:!z},f?.input)})},t8({theme:Mr,rightSection:ie,rightSectionWidth:J,styles:h,size:c,shouldClear:H&&ze.length>0,onClear:Bu,error:u,disabled:F,clearButtonProps:gt,readOnly:bn})),k.createElement("div",{className:Lt.values,"data-clearable":H||void 0},D1,k.createElement("input",hc({ref:Ps(t,Kn),type:"search",id:qn,className:Zt(Lt.searchInput,{[Lt.searchInputPointer]:!z,[Lt.searchInputInputHidden]:!xn&&ze.length>0||!z&&ze.length>0,[Lt.searchInputEmpty]:ze.length===0}),onKeyDown:I1,value:dr,onChange:M1,onFocus:N1,onBlur:T1,readOnly:!z||no.current||bn,placeholder:ze.length===0?G:void 0,disabled:F,"data-mantine-stop-propagation":xn,autoComplete:"off",onCompositionStart:()=>fr(!0),onCompositionEnd:()=>fr(!1)},nn)))))),k.createElement(ya.Dropdown,{component:He||A0,maxHeight:$,direction:Oo,id:qn,innerRef:Ql,__staticSelector:"MultiSelect",classNames:f,styles:h},k.createElement(xP,{data:on,hovered:Gi,classNames:f,styles:h,uuid:qn,__staticSelector:"MultiSelect",onItemHover:to,onItemSelect:Xl,itemsRefs:Ha,itemComponent:S,size:c,nothingFound:I,isItemSelected:j1,creatable:ne&&!!Se,createLabel:Se,unstyled:Bt,variant:Y}))))});KP.displayName="@mantine/core/MultiSelect";const rde=(e,t,n)=>Number.isInteger(e)&&e>=0&&t===0?"numeric":!Number.isInteger(e)&&e>=0&&t!==0?"decimal":Number.isInteger(e)&&e<0&&t===0||!Number.isInteger(e)&&e<0&&t!==0?n==="ios"?"text":"decimal":"numeric";function FN({direction:e,size:t}){return k.createElement("svg",{style:{width:M(t),height:M(t),transform:e==="up"?"rotate(180deg)":void 0},viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},k.createElement("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}const o8={xs:M(20),sm:M(24),md:M(30),lg:M(34),xl:M(36)};var ode=ue((e,{radius:t},{size:n})=>({rightSection:{display:"flex",flexDirection:"column",height:`calc(100% - ${M(2)})`,margin:M(1),overflow:"hidden",borderTopRightRadius:e.fn.radius(t),borderBottomRightRadius:e.fn.radius(t)},control:{margin:0,position:"relative",flex:"0 0 50%",display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",width:re({size:n,sizes:o8}),padding:0,WebkitTapHighlightColor:"transparent",borderBottom:`${M(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`,borderLeft:`${M(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`,borderTop:0,borderRight:0,backgroundColor:"transparent",marginRight:M(1),color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,"&:not(:disabled):hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[0]},"&:disabled":{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[4]}},controlUp:{},controlDown:{borderBottom:0}}));const ide=ode;var sde=Object.defineProperty,ade=Object.defineProperties,lde=Object.getOwnPropertyDescriptors,Ov=Object.getOwnPropertySymbols,i8=Object.prototype.hasOwnProperty,s8=Object.prototype.propertyIsEnumerable,VN=(e,t,n)=>t in e?sde(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Q_=(e,t)=>{for(var n in t||(t={}))i8.call(t,n)&&VN(e,n,t[n]);if(Ov)for(var n of Ov(t))s8.call(t,n)&&VN(e,n,t[n]);return e},cde=(e,t)=>ade(e,lde(t)),ude=(e,t)=>{var n={};for(var r in e)i8.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ov)for(var r of Ov(e))t.indexOf(r)<0&&s8.call(e,r)&&(n[r]=e[r]);return n};const dde={type:"text",size:"sm",__staticSelector:"TextInput"},_n=_.forwardRef((e,t)=>{const n=AP("TextInput",dde,e),{inputProps:r,wrapperProps:o}=n,i=ude(n,["inputProps","wrapperProps"]);return k.createElement(et.Wrapper,Q_({},o),k.createElement(et,cde(Q_(Q_({},r),i),{ref:t})))});_n.displayName="@mantine/core/TextInput";var fde=Object.defineProperty,hde=Object.defineProperties,pde=Object.getOwnPropertyDescriptors,Cv=Object.getOwnPropertySymbols,a8=Object.prototype.hasOwnProperty,l8=Object.prototype.propertyIsEnumerable,HN=(e,t,n)=>t in e?fde(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mde=(e,t)=>{for(var n in t||(t={}))a8.call(t,n)&&HN(e,n,t[n]);if(Cv)for(var n of Cv(t))l8.call(t,n)&&HN(e,n,t[n]);return e},gde=(e,t)=>hde(e,pde(t)),vde=(e,t)=>{var n={};for(var r in e)a8.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Cv)for(var r of Cv(e))t.indexOf(r)<0&&l8.call(e,r)&&(n[r]=e[r]);return n};const yde=e=>e||"",_de=e=>{if(e==="-")return e;let t=e;t[0]==="."&&(t=`0${e}`);const n=parseFloat(t);return Number.isNaN(n)?"":e},WN={xs:M(10),sm:M(14),md:M(16),lg:M(18),xl:M(20)},wde={step:1,hideControls:!1,size:"sm",precision:0,noClampOnBlur:!1,removeTrailingZeros:!1,decimalSeparator:".",formatter:yde,parser:_de,type:"text"},_a=_.forwardRef((e,t)=>{const n=ae("NumberInput",wde,e),{readOnly:r,disabled:o,value:i,onChange:s,decimalSeparator:a,thousandsSeparator:c,min:u,max:f,startValue:h,step:m,stepHoldInterval:v,stepHoldDelay:y,onFocus:w,onBlur:P,onKeyDown:b,onKeyUp:S,hideControls:O,radius:E,variant:$,precision:N,removeTrailingZeros:I,defaultValue:R,noClampOnBlur:B,handlersRef:z,classNames:G,styles:Q,size:X,rightSection:V,rightSectionWidth:H,formatter:Z,parser:Y,inputMode:D,unstyled:W,type:F}=n,K=vde(n,["readOnly","disabled","value","onChange","decimalSeparator","thousandsSeparator","min","max","startValue","step","stepHoldInterval","stepHoldDelay","onFocus","onBlur","onKeyDown","onKeyUp","hideControls","radius","variant","precision","removeTrailingZeros","defaultValue","noClampOnBlur","handlersRef","classNames","styles","size","rightSection","rightSectionWidth","formatter","parser","inputMode","unstyled","type"]),{classes:ee,cx:fe}=ide({radius:E},{classNames:G,styles:Q,unstyled:W,name:"NumberInput",variant:$,size:X}),ie=be=>{if(be==="")return"";let Le=be.toFixed(N);return I&&N>0&&(Le=Le.replace(new RegExp(`[0]{0,${N}}$`),""),Le.endsWith(".")&&(Le=Le.slice(0,-1))),Le},J=be=>{let Le=be;return a&&(Le=Le.replace(".",a)),Z(Le)},ne=be=>{let Le=be;return a&&(Le=Le.replaceAll(c,"").replace(a,".")),Y(Le)},le=be=>J(ie(be)),[_e,Ne]=_.useState(typeof i=="number"?i:typeof R=="number"?R:""),[we,He]=_.useState(()=>le(_e)),Te=_.useRef(),[De,st]=_.useState(!1),bt=(be,Le)=>{if(!De||Le){const eo=le(be);eo!==we&&He(eo)}be!==_e&&Ne(be)},wn=typeof u=="number"?u:-1/0,ht=typeof f=="number"?f:1/0,In=_.useRef();In.current=()=>{var be;let Le;_e===""?Le=(be=h??u)!=null?be:0:Le=parseFloat(ie(ca(_e+m,wn,ht))),bt(Le,!0),s?.(Le)};const Er=_.useRef();Er.current=()=>{var be;let Le;_e===""?Le=(be=h??u)!=null?be:0:Le=parseFloat(ie(ca(_e-m,wn,ht))),bt(Le,!0),s?.(Le)},w5(z,{increment:In.current,decrement:Er.current}),_.useEffect(()=>{De||bt(i===void 0?_e:i,!0)},[i,De]);const lt=y!==void 0&&v!==void 0,Yn=_.useRef(null),Jt=_.useRef(0),pt=()=>{Yn.current&&window.clearTimeout(Yn.current),Yn.current=null,Jt.current=0},Po=be=>{be?In.current():Er.current(),Jt.current+=1},Jr=be=>{if(Po(be),lt){const Le=typeof v=="number"?v:v(Jt.current);Yn.current=window.setTimeout(()=>Jr(be),Le)}},cr=(be,Le)=>{be.preventDefault(),Te.current.focus(),Po(Le),lt&&(Yn.current=window.setTimeout(()=>Jr(Le),y))};_.useEffect(()=>(pt(),pt),[]);const Qr=k.createElement("div",{className:ee.rightSection},k.createElement("button",{type:"button",tabIndex:-1,"aria-hidden":!0,disabled:_e>=f,className:fe(ee.control,ee.controlUp),onPointerDown:be=>{cr(be,!0)},onPointerUp:pt,onPointerLeave:pt},k.createElement(FN,{size:re({size:X,sizes:WN}),direction:"up"})),k.createElement("button",{type:"button",tabIndex:-1,"aria-hidden":!0,disabled:_e<=u,className:fe(ee.control,ee.controlDown),onPointerDown:be=>{cr(be,!1)},onPointerUp:pt,onPointerLeave:pt},k.createElement(FN,{size:re({size:X,sizes:WN}),direction:"down"}))),Bt=be=>{let Le=be;(Le[0]===`${a}`||Le[0]===".")&&(Le=`0${Le}`);const eo=parseFloat(ie(parseFloat(ne(Le)))),Lt=B?eo:ca(eo,wn,ht),Zt=Number.isNaN(Lt)?"":Lt,Mr=_e!==Zt;He(be),bt(Zt),Mr&&s?.(Zt)},Xr=be=>{be.nativeEvent.isComposing||Bt(be.target.value)},hn=be=>{st(!0),w?.(be)},bn=be=>{st(!1),P?.(be)},$r=be=>{if(typeof b=="function"&&b(be),be.repeat&<&&(be.key==="ArrowUp"||be.key==="ArrowDown")){be.preventDefault();return}r||(be.key==="ArrowUp"?cr(be,!0):be.key==="ArrowDown"&&cr(be,!1))},gt=be=>{typeof S=="function"&&S(be),(be.key==="ArrowUp"||be.key==="ArrowDown")&&pt()};return k.createElement(_n,gde(mde({},K),{type:F,variant:$,value:we,disabled:o,readOnly:r,ref:Ps(Te,t),onChange:Xr,onFocus:hn,onBlur:bn,onKeyDown:$r,onKeyUp:gt,rightSection:V||(o||r||O||$==="unstyled"?null:Qr),rightSectionWidth:H??`calc(${re({size:X,sizes:o8})} + ${M(1)})`,radius:E,max:f,min:u,step:m,size:X,styles:Q,classNames:G,inputMode:D||rde(m,N,bY()),__staticSelector:"NumberInput",unstyled:W}))});_a.displayName="@mantine/core/NumberInput";const c8=_.createContext(!1),bde=c8.Provider,xde=()=>_.useContext(c8);function u8({children:e,openDelay:t=0,closeDelay:n=0}){return k.createElement(bde,{value:!0},k.createElement(Tee,{delay:{open:t,close:n}},e))}u8.displayName="@mantine/core/TooltipGroup";var Sde=Object.defineProperty,Pde=Object.defineProperties,Ode=Object.getOwnPropertyDescriptors,UN=Object.getOwnPropertySymbols,Cde=Object.prototype.hasOwnProperty,kde=Object.prototype.propertyIsEnumerable,ZN=(e,t,n)=>t in e?Sde(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,GN=(e,t)=>{for(var n in t||(t={}))Cde.call(t,n)&&ZN(e,n,t[n]);if(UN)for(var n of UN(t))kde.call(t,n)&&ZN(e,n,t[n]);return e},Ede=(e,t)=>Pde(e,Ode(t));function $de(e,t){if(!t)return{backgroundColor:e.colorScheme==="dark"?e.colors.gray[2]:e.colors.gray[9],color:e.colorScheme==="dark"?e.black:e.white};const n=e.fn.variant({variant:"filled",color:t,primaryFallback:!1});return{backgroundColor:n.background,color:n.color}}var Mde=ue((e,{color:t,radius:n,width:r,multiline:o})=>({tooltip:Ede(GN(GN({},e.fn.fontStyles()),$de(e,t)),{lineHeight:e.lineHeight,fontSize:e.fontSizes.sm,borderRadius:e.fn.radius(n),padding:`calc(${e.spacing.xs} / 2) ${e.spacing.xs}`,position:"absolute",whiteSpace:o?"unset":"nowrap",pointerEvents:"none",width:r}),arrow:{backgroundColor:"inherit",border:0,zIndex:1}}));const d8=Mde,f8={children:"Tooltip component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported"};function Nde({offset:e,position:t}){const[n,r]=_.useState(!1),o=_.useRef(),{x:i,y:s,reference:a,floating:c,refs:u,update:f,placement:h}=LP({placement:t,middleware:[MP({crossAxis:!0,padding:5,rootBoundary:"document"})]}),m=h.includes("right")?e:t.includes("left")?e*-1:0,v=h.includes("bottom")?e:t.includes("top")?e*-1:0,y=_.useCallback(({clientX:w,clientY:P})=>{a({getBoundingClientRect(){return{width:0,height:0,x:w,y:P,left:w+m,top:P+v,right:w,bottom:P}}})},[a]);return _.useEffect(()=>{if(u.floating.current){const w=o.current;w.addEventListener("mousemove",y);const P=hs(u.floating.current);return P.forEach(b=>{b.addEventListener("scroll",f)}),()=>{w.removeEventListener("mousemove",y),P.forEach(b=>{b.removeEventListener("scroll",f)})}}},[a,u.floating.current,f,y,n]),{handleMouseMove:y,x:i,y:s,opened:n,setOpened:r,boundaryRef:o,floating:c}}var Tde=Object.defineProperty,Ide=Object.defineProperties,Dde=Object.getOwnPropertyDescriptors,kv=Object.getOwnPropertySymbols,h8=Object.prototype.hasOwnProperty,p8=Object.prototype.propertyIsEnumerable,YN=(e,t,n)=>t in e?Tde(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,up=(e,t)=>{for(var n in t||(t={}))h8.call(t,n)&&YN(e,n,t[n]);if(kv)for(var n of kv(t))p8.call(t,n)&&YN(e,n,t[n]);return e},dp=(e,t)=>Ide(e,Dde(t)),jde=(e,t)=>{var n={};for(var r in e)h8.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&kv)for(var r of kv(e))t.indexOf(r)<0&&p8.call(e,r)&&(n[r]=e[r]);return n};const Lde={refProp:"ref",withinPortal:!0,offset:10,position:"right",zIndex:ci("popover")};function m8(e){var t;const n=ae("TooltipFloating",Lde,e),{children:r,refProp:o,withinPortal:i,portalProps:s,style:a,className:c,classNames:u,styles:f,unstyled:h,radius:m,color:v,label:y,offset:w,position:P,multiline:b,width:S,zIndex:O,disabled:E,variant:$}=n,N=jde(n,["children","refProp","withinPortal","portalProps","style","className","classNames","styles","unstyled","radius","color","label","offset","position","multiline","width","zIndex","disabled","variant"]),{handleMouseMove:I,x:R,y:B,opened:z,boundaryRef:G,floating:Q,setOpened:X}=Nde({offset:w,position:P}),{classes:V,cx:H}=d8({radius:m,color:v,multiline:b,width:S},{name:"TooltipFloating",classNames:u,styles:f,unstyled:h,variant:$});if(!zf(r))throw new Error(f8.children);const Z=Ps(G,r.ref),Y=W=>{var F,K;(K=(F=r.props).onMouseEnter)==null||K.call(F,W),I(W),X(!0)},D=W=>{var F,K;(K=(F=r.props).onMouseLeave)==null||K.call(F,W),X(!1)};return k.createElement(k.Fragment,null,k.createElement(Zf,dp(up({},s),{withinPortal:i}),k.createElement(Pe,dp(up({},N),{ref:Q,className:H(V.tooltip,c),style:dp(up({},a),{zIndex:O,display:!E&&z?"block":"none",top:B??"",left:(t=Math.round(R))!=null?t:""})}),y)),_.cloneElement(r,dp(up({},r.props),{[o]:Z,onMouseEnter:Y,onMouseLeave:D})))}m8.displayName="@mantine/core/TooltipFloating";function Rde(e){const[t,n]=_.useState(!1),o=typeof e.opened=="boolean"?e.opened:t,i=xde(),s=Ia(),{delay:a,currentId:c,setCurrentId:u}=Xz(),f=_.useCallback(R=>{n(R),R&&u(s)},[u,s]),{x:h,y:m,reference:v,floating:y,context:w,refs:P,update:b,placement:S,middlewareData:{arrow:{x:O,y:E}={}}}=LP({placement:e.position,open:o,onOpenChange:f,middleware:[Bz(e.offset),MP({padding:8}),Rz(),Yz({element:e.arrowRef,padding:e.arrowOffset}),...e.inline?[Az()]:[]]}),{getReferenceProps:$,getFloatingProps:N}=Wee([Nee(w,{enabled:e.events.hover,delay:i?a:{open:e.openDelay,close:e.closeDelay},mouseOnly:!e.events.touch}),Vee(w,{enabled:e.events.focus,keyboardOnly:!0}),Hee(w,{role:"tooltip"}),Fee(w,{enabled:typeof e.opened===void 0}),Iee(w,{id:s})]);return tA({opened:o,position:e.position,positionDependencies:e.positionDependencies,floating:{refs:P,update:b}}),Hn(()=>{var R;(R=e.onPositionChange)==null||R.call(e,S)},[S]),{x:h,y:m,arrowX:O,arrowY:E,reference:v,floating:y,getFloatingProps:N,getReferenceProps:$,isGroupPhase:o&&c&&c!==s,opened:o,placement:S}}var zde=Object.defineProperty,Ade=Object.defineProperties,Bde=Object.getOwnPropertyDescriptors,Ev=Object.getOwnPropertySymbols,g8=Object.prototype.hasOwnProperty,v8=Object.prototype.propertyIsEnumerable,KN=(e,t,n)=>t in e?zde(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Qa=(e,t)=>{for(var n in t||(t={}))g8.call(t,n)&&KN(e,n,t[n]);if(Ev)for(var n of Ev(t))v8.call(t,n)&&KN(e,n,t[n]);return e},X_=(e,t)=>Ade(e,Bde(t)),Fde=(e,t)=>{var n={};for(var r in e)g8.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ev)for(var r of Ev(e))t.indexOf(r)<0&&v8.call(e,r)&&(n[r]=e[r]);return n};const Vde={position:"top",refProp:"ref",withinPortal:!1,inline:!1,arrowSize:4,arrowOffset:5,arrowRadius:0,arrowPosition:"side",offset:5,transitionProps:{duration:100,transition:"fade"},width:"auto",events:{hover:!0,focus:!1,touch:!1},zIndex:ci("popover"),positionDependencies:[]},H0=_.forwardRef((e,t)=>{var n;const r=_.useRef(null),o=ae("Tooltip",Vde,e),{children:i,position:s,refProp:a,label:c,openDelay:u,closeDelay:f,onPositionChange:h,opened:m,withinPortal:v,portalProps:y,radius:w,color:P,classNames:b,styles:S,unstyled:O,style:E,className:$,withArrow:N,arrowSize:I,arrowOffset:R,arrowRadius:B,arrowPosition:z,offset:G,transitionProps:Q,multiline:X,width:V,events:H,zIndex:Z,disabled:Y,positionDependencies:D,onClick:W,onMouseEnter:F,onMouseLeave:K,inline:ee,variant:fe,keepMounted:ie}=o,J=Fde(o,["children","position","refProp","label","openDelay","closeDelay","onPositionChange","opened","withinPortal","portalProps","radius","color","classNames","styles","unstyled","style","className","withArrow","arrowSize","arrowOffset","arrowRadius","arrowPosition","offset","transitionProps","multiline","width","events","zIndex","disabled","positionDependencies","onClick","onMouseEnter","onMouseLeave","inline","variant","keepMounted"]),{classes:ne,cx:le,theme:_e}=d8({radius:w,color:P,width:V,multiline:X},{name:"Tooltip",classNames:b,styles:S,unstyled:O,variant:fe}),Ne=Rde({position:fA(_e.dir,s),closeDelay:f,openDelay:u,onPositionChange:h,opened:m,events:H,arrowRef:r,arrowOffset:R,offset:G+(N?I/2:0),positionDependencies:[...D,i],inline:ee});if(!zf(i))throw new Error(f8.children);const we=Ps(Ne.reference,i.ref,t);return k.createElement(k.Fragment,null,k.createElement(Zf,X_(Qa({},y),{withinPortal:v}),k.createElement($s,X_(Qa({keepMounted:ie,mounted:!Y&&Ne.opened},Q),{transition:Q.transition||"fade",duration:Ne.isGroupPhase?10:(n=Q.duration)!=null?n:100}),He=>{var Te,De;return k.createElement(Pe,Qa(Qa({},J),Ne.getFloatingProps({ref:Ne.floating,className:ne.tooltip,style:X_(Qa(Qa({},E),He),{zIndex:Z,top:(Te=Ne.y)!=null?Te:0,left:(De=Ne.x)!=null?De:0})})),c,k.createElement(zP,{ref:r,arrowX:Ne.arrowX,arrowY:Ne.arrowY,visible:N,position:Ne.placement,arrowSize:I,arrowOffset:R,arrowRadius:B,arrowPosition:z,className:ne.arrow}))})),_.cloneElement(i,Ne.getReferenceProps(Qa({onClick:W,onMouseEnter:F,onMouseLeave:K,onMouseMove:e.onMouseMove,onPointerDown:e.onPointerDown,onPointerEnter:e.onPointerEnter,[a]:we,className:le($,i.props.className)},i.props))))});H0.Group=u8;H0.Floating=m8;H0.displayName="@mantine/core/Tooltip";const zt=H0;function Hde({data:e,searchable:t,limit:n,searchValue:r,filter:o,value:i,filterDataOnExactSearchMatch:s}){if(!t)return e;const a=i!=null&&e.find(u=>u.value===i)||null;if(a&&!s&&a?.label===r){if(n){if(n>=e.length)return e;const u=e.indexOf(a),f=u+n,h=f-e.length;return h>0?e.slice(u-h):e.slice(u,f)}return e}const c=[];for(let u=0;u=n));u+=1);return c}var Wde=ue(()=>({input:{"&:not(:disabled)":{cursor:"pointer","&::selection":{backgroundColor:"transparent"}}}}));const Ude=Wde;var Zde=Object.defineProperty,Gde=Object.defineProperties,Yde=Object.getOwnPropertyDescriptors,$v=Object.getOwnPropertySymbols,y8=Object.prototype.hasOwnProperty,_8=Object.prototype.propertyIsEnumerable,qN=(e,t,n)=>t in e?Zde(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pd=(e,t)=>{for(var n in t||(t={}))y8.call(t,n)&&qN(e,n,t[n]);if($v)for(var n of $v(t))_8.call(t,n)&&qN(e,n,t[n]);return e},ew=(e,t)=>Gde(e,Yde(t)),Kde=(e,t)=>{var n={};for(var r in e)y8.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&$v)for(var r of $v(e))t.indexOf(r)<0&&_8.call(e,r)&&(n[r]=e[r]);return n};function qde(e,t){return t.label.toLowerCase().trim().includes(e.toLowerCase().trim())}function Jde(e,t){return!!e&&!t.some(n=>n.label.toLowerCase()===e.toLowerCase())}const Qde={required:!1,size:"sm",shadow:"sm",itemComponent:SP,transitionProps:{transition:"fade",duration:0},initiallyOpened:!1,filter:qde,maxDropdownHeight:220,searchable:!1,clearable:!1,limit:1/0,disabled:!1,creatable:!1,shouldCreate:Jde,selectOnBlur:!1,switchDirectionOnFlip:!1,filterDataOnExactSearchMatch:!1,zIndex:ci("popover"),positionDependencies:[],dropdownPosition:"flip"},jl=_.forwardRef((e,t)=>{const n=AP("Select",Qde,e),{inputProps:r,wrapperProps:o,shadow:i,data:s,value:a,defaultValue:c,onChange:u,itemComponent:f,onKeyDown:h,onBlur:m,onFocus:v,transitionProps:y,initiallyOpened:w,unstyled:P,classNames:b,styles:S,filter:O,maxDropdownHeight:E,searchable:$,clearable:N,nothingFound:I,limit:R,disabled:B,onSearchChange:z,searchValue:G,rightSection:Q,rightSectionWidth:X,creatable:V,getCreateLabel:H,shouldCreate:Z,selectOnBlur:Y,onCreate:D,dropdownComponent:W,onDropdownClose:F,onDropdownOpen:K,withinPortal:ee,portalProps:fe,switchDirectionOnFlip:ie,zIndex:J,name:ne,dropdownPosition:le,allowDeselect:_e,placeholder:Ne,filterDataOnExactSearchMatch:we,form:He,positionDependencies:Te,readOnly:De,clearButtonProps:st,hoverOnSearchChange:bt}=n,wn=Kde(n,["inputProps","wrapperProps","shadow","data","value","defaultValue","onChange","itemComponent","onKeyDown","onBlur","onFocus","transitionProps","initiallyOpened","unstyled","classNames","styles","filter","maxDropdownHeight","searchable","clearable","nothingFound","limit","disabled","onSearchChange","searchValue","rightSection","rightSectionWidth","creatable","getCreateLabel","shouldCreate","selectOnBlur","onCreate","dropdownComponent","onDropdownClose","onDropdownOpen","withinPortal","portalProps","switchDirectionOnFlip","zIndex","name","dropdownPosition","allowDeselect","placeholder","filterDataOnExactSearchMatch","form","positionDependencies","readOnly","clearButtonProps","hoverOnSearchChange"]),{classes:ht,cx:In,theme:Er}=Ude(),[lt,Yn]=_.useState(w),[Jt,pt]=_.useState(-1),Po=_.useRef(),Jr=_.useRef({}),[cr,Qr]=_.useState("column"),Bt=cr==="column",{scrollIntoView:Xr,targetRef:hn,scrollableRef:bn}=S5({duration:0,offset:5,cancelable:!1,isList:!0}),$r=_e===void 0?N:_e,gt=Se=>{if(lt!==Se){Yn(Se);const ct=Se?K:F;typeof ct=="function"&&ct()}},be=V&&typeof H=="function";let Le=null;const eo=s.map(Se=>typeof Se=="string"?{label:Se,value:Se}:Se),Lt=WL({data:eo}),[Zt,Mr,xt]=_o({value:a,defaultValue:c,finalValue:null,onChange:u}),nn=Lt.find(Se=>Se.value===Zt),[Kn,Ha]=_o({value:G,defaultValue:nn?.label||"",finalValue:void 0,onChange:z}),qn=Se=>{Ha(Se),$&&typeof z=="function"&&z(Se)},xn=()=>{var Se;De||(Mr(null),xt||qn(""),(Se=Po.current)==null||Se.focus())};_.useEffect(()=>{const Se=Lt.find(ct=>ct.value===Zt);Se?qn(Se.label):(!be||!Zt)&&qn("")},[Zt]),_.useEffect(()=>{nn&&(!$||!lt)&&qn(nn.label)},[nn?.label]);const Ft=Se=>{if(!De)if($r&&nn?.value===Se.value)Mr(null),gt(!1);else{if(Se.creatable&&typeof D=="function"){const ct=D(Se.value);typeof ct<"u"&&ct!==null&&Mr(typeof ct=="string"?ct:ct.value)}else Mr(Se.value);xt||qn(Se.label),pt(-1),gt(!1),Po.current.focus()}},Gt=Hde({data:Lt,searchable:$,limit:R,searchValue:Kn,filter:O,filterDataOnExactSearchMatch:we,value:Zt});be&&Z(Kn,Gt)&&(Le=H(Kn),Gt.push({label:Kn,value:Kn,creatable:!0}));const to=(Se,ct,rn)=>{let ze=Se;for(;rn(ze);)if(ze=ct(ze),!Gt[ze].disabled)return ze;return Se};Hn(()=>{pt(bt&&Kn?0:-1)},[Kn,bt]);const Oo=Zt?Gt.findIndex(Se=>Se.value===Zt):0,ur=!De&&(Gt.length>0?lt:lt&&!!I),dr=()=>{pt(Se=>{var ct;const rn=to(Se,ze=>ze-1,ze=>ze>0);return hn.current=Jr.current[(ct=Gt[rn])==null?void 0:ct.value],ur&&Xr({alignment:Bt?"start":"end"}),rn})},Ui=()=>{pt(Se=>{var ct;const rn=to(Se,ze=>ze+1,ze=>zewindow.setTimeout(()=>{var Se;hn.current=Jr.current[(Se=Gt[Oo])==null?void 0:Se.value],Xr({alignment:Bt?"end":"start"})},50);Hn(()=>{ur&&Ts()},[ur]);const fr=Se=>{switch(typeof h=="function"&&h(Se),Se.key){case"ArrowUp":{Se.preventDefault(),lt?Bt?dr():Ui():(pt(Oo),gt(!0),Ts());break}case"ArrowDown":{Se.preventDefault(),lt?Bt?Ui():dr():(pt(Oo),gt(!0),Ts());break}case"Home":{if(!$){Se.preventDefault(),lt||gt(!0);const ct=Gt.findIndex(rn=>!rn.disabled);pt(ct),ur&&Xr({alignment:Bt?"end":"start"})}break}case"End":{if(!$){Se.preventDefault(),lt||gt(!0);const ct=Gt.map(rn=>!!rn.disabled).lastIndexOf(!1);pt(ct),ur&&Xr({alignment:Bt?"end":"start"})}break}case"Escape":{Se.preventDefault(),gt(!1),pt(-1);break}case" ":{$||(Se.preventDefault(),Gt[Jt]&<?Ft(Gt[Jt]):(gt(!0),pt(Oo),Ts()));break}case"Enter":$||Se.preventDefault(),Gt[Jt]&<&&(Se.preventDefault(),Ft(Gt[Jt]))}},Oe=Se=>{typeof m=="function"&&m(Se);const ct=Lt.find(rn=>rn.value===Zt);Y&&Gt[Jt]&<&&Ft(Gt[Jt]),qn(ct?.label||""),gt(!1)},Wa=Se=>{typeof v=="function"&&v(Se),$&>(!0)},Ql=Se=>{De||(qn(Se.currentTarget.value),N&&Se.currentTarget.value===""&&Mr(null),pt(-1),gt(!0))},Ua=()=>{De||(gt(!lt),Zt&&!lt&&pt(Oo))};return k.createElement(et.Wrapper,ew(pd({},o),{__staticSelector:"Select"}),k.createElement(ya,{opened:ur,transitionProps:y,shadow:i,withinPortal:ee,portalProps:fe,__staticSelector:"Select",onDirectionChange:Qr,switchDirectionOnFlip:ie,zIndex:J,dropdownPosition:le,positionDependencies:[...Te,Kn],classNames:b,styles:S,unstyled:P,variant:r.variant},k.createElement(ya.Target,null,k.createElement("div",{role:"combobox","aria-haspopup":"listbox","aria-owns":ur?`${r.id}-items`:null,"aria-controls":r.id,"aria-expanded":ur,onMouseLeave:()=>pt(-1),tabIndex:-1},k.createElement("input",{type:"hidden",name:ne,value:Zt||"",form:He,disabled:B}),k.createElement(et,pd(ew(pd(pd({autoComplete:"off",type:"search"},r),wn),{ref:Ps(t,Po),onKeyDown:fr,__staticSelector:"Select",value:Kn,placeholder:Ne,onChange:Ql,"aria-autocomplete":"list","aria-controls":ur?`${r.id}-items`:null,"aria-activedescendant":Jt>=0?`${r.id}-${Jt}`:null,onMouseDown:Ua,onBlur:Oe,onFocus:Wa,readOnly:!$||De,disabled:B,"data-mantine-stop-propagation":ur,name:null,classNames:ew(pd({},b),{input:In({[ht.input]:!$},b?.input)})}),t8({theme:Er,rightSection:Q,rightSectionWidth:X,styles:S,size:r.size,shouldClear:N&&!!nn,onClear:xn,error:o.error,clearButtonProps:st,disabled:B,readOnly:De}))))),k.createElement(ya.Dropdown,{component:W||A0,maxHeight:E,direction:cr,id:r.id,innerRef:bn,__staticSelector:"Select",classNames:b,styles:S},k.createElement(xP,{data:Gt,hovered:Jt,classNames:b,styles:S,isItemSelected:Se=>Se===Zt,uuid:r.id,__staticSelector:"Select",onItemHover:pt,onItemSelect:Ft,itemsRefs:Jr,itemComponent:f,size:r.size,nothingFound:I,creatable:be&&!!Le,createLabel:Le,"aria-label":o.label,unstyled:P,variant:r.variant}))))});jl.displayName="@mantine/core/Select";function Xde(e,t){if(t.length===0)return t;const n="maxWidth"in t[0]?"maxWidth":"minWidth",r=[...t].sort((o,i)=>Bo(re({size:i[n],sizes:e.breakpoints}))-Bo(re({size:o[n],sizes:e.breakpoints})));return n==="minWidth"?r.reverse():r}var efe=Object.defineProperty,JN=Object.getOwnPropertySymbols,tfe=Object.prototype.hasOwnProperty,nfe=Object.prototype.propertyIsEnumerable,QN=(e,t,n)=>t in e?efe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,rfe=(e,t)=>{for(var n in t||(t={}))tfe.call(t,n)&&QN(e,n,t[n]);if(JN)for(var n of JN(t))nfe.call(t,n)&&QN(e,n,t[n]);return e},ofe=ue((e,{spacing:t,breakpoints:n,cols:r,verticalSpacing:o})=>{const i=o!=null,s=Xde(e,n).reduce((a,c)=>{var u,f;const h="maxWidth"in c?"max-width":"min-width",m=re({size:h==="max-width"?c.maxWidth:c.minWidth,sizes:e.breakpoints,units:"em"}),v=Bo(m)-(h==="max-width"?1:0);return a[`@media (${h}: ${Oa(v)})`]={gridTemplateColumns:`repeat(${c.cols}, minmax(0, 1fr))`,gap:`${re({size:(u=c.verticalSpacing)!=null?u:i?o:t,sizes:e.spacing})} ${re({size:(f=c.spacing)!=null?f:t,sizes:e.spacing})}`},a},{});return{root:rfe({boxSizing:"border-box",display:"grid",gridTemplateColumns:`repeat(${r}, minmax(0, 1fr))`,gap:`${re({size:i?o:t,sizes:e.spacing})} ${re({size:t,sizes:e.spacing})}`},s)}});const ife=ofe;var sfe=Object.defineProperty,Mv=Object.getOwnPropertySymbols,w8=Object.prototype.hasOwnProperty,b8=Object.prototype.propertyIsEnumerable,XN=(e,t,n)=>t in e?sfe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,afe=(e,t)=>{for(var n in t||(t={}))w8.call(t,n)&&XN(e,n,t[n]);if(Mv)for(var n of Mv(t))b8.call(t,n)&&XN(e,n,t[n]);return e},lfe=(e,t)=>{var n={};for(var r in e)w8.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Mv)for(var r of Mv(e))t.indexOf(r)<0&&b8.call(e,r)&&(n[r]=e[r]);return n};const cfe={breakpoints:[],cols:1,spacing:"md"},qP=_.forwardRef((e,t)=>{const n=ae("SimpleGrid",cfe,e),{className:r,breakpoints:o,cols:i,spacing:s,verticalSpacing:a,children:c,unstyled:u,variant:f}=n,h=lfe(n,["className","breakpoints","cols","spacing","verticalSpacing","children","unstyled","variant"]),{classes:m,cx:v}=ife({breakpoints:o,cols:i,spacing:s,verticalSpacing:a},{name:"SimpleGrid",unstyled:u,variant:f});return k.createElement(Pe,afe({className:v(m.root,r),ref:t},h),c)});qP.displayName="@mantine/core/SimpleGrid";var ufe=ue((e,{spacing:t,align:n,justify:r})=>({root:{display:"flex",flexDirection:"column",alignItems:n,justifyContent:r,gap:re({size:t,sizes:e.spacing})}}));const dfe=ufe;var ffe=Object.defineProperty,Nv=Object.getOwnPropertySymbols,x8=Object.prototype.hasOwnProperty,S8=Object.prototype.propertyIsEnumerable,eT=(e,t,n)=>t in e?ffe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hfe=(e,t)=>{for(var n in t||(t={}))x8.call(t,n)&&eT(e,n,t[n]);if(Nv)for(var n of Nv(t))S8.call(t,n)&&eT(e,n,t[n]);return e},pfe=(e,t)=>{var n={};for(var r in e)x8.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Nv)for(var r of Nv(e))t.indexOf(r)<0&&S8.call(e,r)&&(n[r]=e[r]);return n};const mfe={spacing:"md",align:"stretch",justify:"flex-start"},Je=_.forwardRef((e,t)=>{const n=ae("Stack",mfe,e),{spacing:r,className:o,align:i,justify:s,unstyled:a,variant:c}=n,u=pfe(n,["spacing","className","align","justify","unstyled","variant"]),{classes:f,cx:h}=dfe({spacing:r,align:i,justify:s},{name:"Stack",unstyled:a,variant:c});return k.createElement(Pe,hfe({className:h(f.root,o),ref:t},u))});Je.displayName="@mantine/core/Stack";const P8=_.createContext(null),gfe=P8.Provider,vfe=()=>_.useContext(P8);var yfe=Object.defineProperty,Tv=Object.getOwnPropertySymbols,O8=Object.prototype.hasOwnProperty,C8=Object.prototype.propertyIsEnumerable,tT=(e,t,n)=>t in e?yfe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nT=(e,t)=>{for(var n in t||(t={}))O8.call(t,n)&&tT(e,n,t[n]);if(Tv)for(var n of Tv(t))C8.call(t,n)&&tT(e,n,t[n]);return e},_fe=(e,t)=>{var n={};for(var r in e)O8.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Tv)for(var r of Tv(e))t.indexOf(r)<0&&C8.call(e,r)&&(n[r]=e[r]);return n};const wfe={size:"sm"},k8=_.forwardRef((e,t)=>{const n=ae("SwitchGroup",wfe,e),{children:r,value:o,defaultValue:i,onChange:s,size:a,wrapperProps:c}=n,u=_fe(n,["children","value","defaultValue","onChange","size","wrapperProps"]),[f,h]=_o({value:o,defaultValue:i,finalValue:[],onChange:s}),m=v=>{const y=v.currentTarget.value;h(f.includes(y)?f.filter(w=>w!==y):[...f,y])};return k.createElement(gfe,{value:{value:f,onChange:m,size:a}},k.createElement(et.Wrapper,nT(nT({labelElement:"div",size:a,__staticSelector:"SwitchGroup",ref:t},c),u),r))});k8.displayName="@mantine/core/SwitchGroup";var bfe=Object.defineProperty,xfe=Object.defineProperties,Sfe=Object.getOwnPropertyDescriptors,rT=Object.getOwnPropertySymbols,Pfe=Object.prototype.hasOwnProperty,Ofe=Object.prototype.propertyIsEnumerable,oT=(e,t,n)=>t in e?bfe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Cfe=(e,t)=>{for(var n in t||(t={}))Pfe.call(t,n)&&oT(e,n,t[n]);if(rT)for(var n of rT(t))Ofe.call(t,n)&&oT(e,n,t[n]);return e},kfe=(e,t)=>xfe(e,Sfe(t));const Efe={xs:M(16),sm:M(20),md:M(24),lg:M(30),xl:M(36)},$fe={xs:M(32),sm:M(38),md:M(46),lg:M(56),xl:M(72)},Mfe={xs:M(12),sm:M(14),md:M(18),lg:M(22),xl:M(28)},Nfe={xs:M(5),sm:M(6),md:M(7),lg:M(9),xl:M(11)},Tfe={xs:M(4),sm:M(5),md:M(6),lg:M(8),xl:M(10)};var Ife=ue((e,{radius:t,color:n,labelPosition:r,error:o},{size:i})=>{const s=re({size:i,sizes:Mfe}),a=re({size:t,sizes:e.radius}),c=e.fn.variant({variant:"filled",color:n}),u=re({size:i,sizes:$fe}),f=M(i==="xs"?1:2),h=e.fn.variant({variant:"filled",color:"red"}).background;return{root:{position:"relative"},input:{height:0,width:0,overflow:"hidden",whiteSpace:"nowrap",padding:0,WebkitClipPath:"inset(50%)",clipPath:"inset(50%)",position:"absolute"},track:kfe(Cfe({},e.fn.focusStyles("input:focus + &")),{cursor:e.cursorType,overflow:"hidden",WebkitTapHighlightColor:"transparent",position:"relative",borderRadius:a,backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[2],border:`${M(1)} solid ${o?h:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`,height:re({size:i,sizes:Efe}),minWidth:u,margin:0,transitionProperty:"background-color, border-color",transitionTimingFunction:e.transitionTimingFunction,transitionDuration:"150ms",boxSizing:"border-box",appearance:"none",display:"flex",alignItems:"center",fontSize:re({size:i,sizes:Nfe}),fontWeight:600,order:r==="left"?2:1,userSelect:"none",zIndex:0,lineHeight:0,color:e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[6],transition:`color 150ms ${e.transitionTimingFunction}`,"input:checked + &":{backgroundColor:c.background,borderColor:c.background,color:e.white,transition:`color 150ms ${e.transitionTimingFunction}`},"input:disabled + &":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2],borderColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2],cursor:"not-allowed",pointerEvents:"none"}}),thumb:{position:"absolute",zIndex:1,borderRadius:a,boxSizing:"border-box",display:"flex",backgroundColor:e.white,height:s,width:s,border:`${M(1)} solid ${e.colorScheme==="dark"?e.white:e.colors.gray[3]}`,left:f,transition:`left 150ms ${e.transitionTimingFunction}`,"& > *":{margin:"auto"},"@media (prefers-reduced-motion)":{transitionDuration:e.respectReducedMotion?"0ms":""},"input:checked + * > &":{left:`calc(100% - ${s} - ${f})`,borderColor:e.white},"input:disabled + * > &":{borderColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2],backgroundColor:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[0]}},trackLabel:{height:"100%",display:"grid",placeContent:"center",minWidth:`calc(${u} - ${s})`,paddingInline:re({size:i,sizes:Tfe}),marginLeft:`calc(${s} + ${f})`,transition:`margin 150ms ${e.transitionTimingFunction}`,"input:checked + * > &":{marginLeft:0,marginRight:`calc(${s} + ${f})`}}}});const Dfe=Ife;var jfe=Object.defineProperty,Lfe=Object.defineProperties,Rfe=Object.getOwnPropertyDescriptors,Iv=Object.getOwnPropertySymbols,E8=Object.prototype.hasOwnProperty,$8=Object.prototype.propertyIsEnumerable,iT=(e,t,n)=>t in e?jfe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,tw=(e,t)=>{for(var n in t||(t={}))E8.call(t,n)&&iT(e,n,t[n]);if(Iv)for(var n of Iv(t))$8.call(t,n)&&iT(e,n,t[n]);return e},zfe=(e,t)=>Lfe(e,Rfe(t)),Afe=(e,t)=>{var n={};for(var r in e)E8.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Iv)for(var r of Iv(e))t.indexOf(r)<0&&$8.call(e,r)&&(n[r]=e[r]);return n};const Bfe={offLabel:"",onLabel:"",size:"sm",radius:"xl",error:!1},Bd=_.forwardRef((e,t)=>{var n;const r=ae("Switch",Bfe,e),{className:o,color:i,label:s,offLabel:a,onLabel:c,id:u,style:f,size:h,radius:m,wrapperProps:v,children:y,unstyled:w,styles:P,classNames:b,thumbIcon:S,sx:O,checked:E,defaultChecked:$,onChange:N,labelPosition:I,description:R,error:B,disabled:z,variant:G}=r,Q=Afe(r,["className","color","label","offLabel","onLabel","id","style","size","radius","wrapperProps","children","unstyled","styles","classNames","thumbIcon","sx","checked","defaultChecked","onChange","labelPosition","description","error","disabled","variant"]),X=vfe(),V=X?.size||h,{classes:H,cx:Z}=Dfe({color:i,radius:m,labelPosition:I,error:!!B},{name:"Switch",classNames:b,styles:P,unstyled:w,size:V,variant:G}),{systemStyles:Y,rest:D}=Bl(Q),W=Ia(u),F=X?{checked:X.value.includes(D.value),onChange:X.onChange}:{},[K,ee]=_o({value:(n=F.checked)!=null?n:E,defaultValue:$,finalValue:!1});return k.createElement(ZP,tw(tw({className:Z(o,H.root),sx:O,style:f,id:W,size:X?.size||h,labelPosition:I,label:s,description:R,error:B,disabled:z,__staticSelector:"Switch",classNames:b,styles:P,unstyled:w,"data-checked":F.checked||void 0,variant:G},Y),v),k.createElement("input",zfe(tw({},D),{disabled:z,checked:K,onChange:fe=>{X?F.onChange(fe):N?.(fe),ee(fe.currentTarget.checked)},id:W,ref:t,type:"checkbox",className:H.input})),k.createElement("label",{htmlFor:W,className:H.track},k.createElement("div",{className:H.thumb},S),k.createElement("div",{className:H.trackLabel},K?c:a)))});Bd.displayName="@mantine/core/Switch";Bd.Group=k8;var Ffe=Object.defineProperty,Vfe=Object.defineProperties,Hfe=Object.getOwnPropertyDescriptors,sT=Object.getOwnPropertySymbols,Wfe=Object.prototype.hasOwnProperty,Ufe=Object.prototype.propertyIsEnumerable,aT=(e,t,n)=>t in e?Ffe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Zfe=(e,t)=>{for(var n in t||(t={}))Wfe.call(t,n)&&aT(e,n,t[n]);if(sT)for(var n of sT(t))Ufe.call(t,n)&&aT(e,n,t[n]);return e},Gfe=(e,t)=>Vfe(e,Hfe(t)),Yfe=ue((e,{captionSide:t,horizontalSpacing:n,verticalSpacing:r,fontSize:o,withBorder:i,withColumnBorders:s})=>{const a=`${M(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`;return{root:Gfe(Zfe({},e.fn.fontStyles()),{width:"100%",borderCollapse:"collapse",captionSide:t,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,lineHeight:e.lineHeight,border:i?a:void 0,"& > caption":{marginTop:t==="top"?0:e.spacing.xs,marginBottom:t==="bottom"?0:e.spacing.xs,fontSize:e.fontSizes.sm,color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6]},"& > thead > tr > th, & > tfoot > tr > th, & > tbody > tr > th":{textAlign:"left",fontWeight:"bold",color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],fontSize:re({size:o,sizes:e.fontSizes}),padding:`${re({size:r,sizes:e.spacing})} ${re({size:n,sizes:e.spacing})}`},"& > thead > tr > th":{borderBottom:a},"& > tfoot > tr > th, & > tbody > tr > th":{borderTop:a},"& > tbody > tr > td":{padding:`${re({size:r,sizes:e.spacing})} ${re({size:n,sizes:e.spacing})}`,borderTop:a,fontSize:re({size:o,sizes:e.fontSizes})},"& > tbody > tr:first-of-type > td, & > tbody > tr:first-of-type > th":{borderTop:"none"},"& > thead > tr > th, & > tbody > tr > td":{borderRight:s?a:"none","&:last-of-type":{borderRight:"none",borderLeft:s?a:"none"}},"& > tbody > tr > th":{borderRight:s?a:"none"},"&[data-striped] > tbody > tr:nth-of-type(odd)":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[0]},"&[data-hover] > tbody > tr":e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1]})})}});const Kfe=Yfe;var qfe=Object.defineProperty,Jfe=Object.defineProperties,Qfe=Object.getOwnPropertyDescriptors,Dv=Object.getOwnPropertySymbols,M8=Object.prototype.hasOwnProperty,N8=Object.prototype.propertyIsEnumerable,lT=(e,t,n)=>t in e?qfe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Xfe=(e,t)=>{for(var n in t||(t={}))M8.call(t,n)&&lT(e,n,t[n]);if(Dv)for(var n of Dv(t))N8.call(t,n)&&lT(e,n,t[n]);return e},ehe=(e,t)=>Jfe(e,Qfe(t)),the=(e,t)=>{var n={};for(var r in e)M8.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Dv)for(var r of Dv(e))t.indexOf(r)<0&&N8.call(e,r)&&(n[r]=e[r]);return n};const nhe={striped:!1,highlightOnHover:!1,captionSide:"top",horizontalSpacing:"xs",fontSize:"sm",verticalSpacing:7,withBorder:!1,withColumnBorders:!1},JP=_.forwardRef((e,t)=>{const n=ae("Table",nhe,e),{className:r,children:o,striped:i,highlightOnHover:s,captionSide:a,horizontalSpacing:c,verticalSpacing:u,fontSize:f,unstyled:h,withBorder:m,withColumnBorders:v,variant:y}=n,w=the(n,["className","children","striped","highlightOnHover","captionSide","horizontalSpacing","verticalSpacing","fontSize","unstyled","withBorder","withColumnBorders","variant"]),{classes:P,cx:b}=Kfe({captionSide:a,verticalSpacing:u,horizontalSpacing:c,fontSize:f,withBorder:m,withColumnBorders:v},{unstyled:h,name:"Table",variant:y});return k.createElement(Pe,ehe(Xfe({},w),{component:"table",ref:t,className:b(P.root,r),"data-striped":i||void 0,"data-hover":s||void 0}),o)});JP.displayName="@mantine/core/Table";var rhe=Object.defineProperty,ohe=Object.defineProperties,ihe=Object.getOwnPropertyDescriptors,cT=Object.getOwnPropertySymbols,she=Object.prototype.hasOwnProperty,ahe=Object.prototype.propertyIsEnumerable,uT=(e,t,n)=>t in e?rhe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dT=(e,t)=>{for(var n in t||(t={}))she.call(t,n)&&uT(e,n,t[n]);if(cT)for(var n of cT(t))ahe.call(t,n)&&uT(e,n,t[n]);return e},lhe=(e,t)=>ohe(e,ihe(t));const che={xs:M(16),sm:M(20),md:M(26),lg:M(32),xl:M(40)},uhe=["filled","light","gradient","outline","default"];function dhe({theme:e,variant:t,color:n,gradient:r}){if(!uhe.includes(t))return null;const o=e.fn.variant({variant:t,color:n||e.primaryColor,gradient:r,primaryFallback:!1});return{backgroundColor:o.background,color:o.color,backgroundImage:t==="gradient"?o.background:void 0,border:`${M(t==="gradient"?0:1)} solid ${o.border}`}}var fhe=ue((e,{color:t,radius:n,gradient:r},{variant:o,size:i})=>{const s=re({size:i,sizes:che});return{root:dT(lhe(dT({},e.fn.fontStyles()),{display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",width:s,height:s,minWidth:s,minHeight:s,borderRadius:e.fn.radius(n)}),dhe({theme:e,variant:o,gradient:r,color:t}))}});const hhe=fhe;var phe=Object.defineProperty,jv=Object.getOwnPropertySymbols,T8=Object.prototype.hasOwnProperty,I8=Object.prototype.propertyIsEnumerable,fT=(e,t,n)=>t in e?phe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mhe=(e,t)=>{for(var n in t||(t={}))T8.call(t,n)&&fT(e,n,t[n]);if(jv)for(var n of jv(t))I8.call(t,n)&&fT(e,n,t[n]);return e},ghe=(e,t)=>{var n={};for(var r in e)T8.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&jv)for(var r of jv(e))t.indexOf(r)<0&&I8.call(e,r)&&(n[r]=e[r]);return n};const vhe={size:"md",variant:"filled"},dx=_.forwardRef((e,t)=>{const n=ae("ThemeIcon",vhe,e),{className:r,size:o,radius:i,variant:s,color:a,children:c,gradient:u,unstyled:f}=n,h=ghe(n,["className","size","radius","variant","color","children","gradient","unstyled"]),{classes:m,cx:v}=hhe({variant:s,radius:i,color:a,gradient:u},{name:"ThemeIcon",unstyled:f,variant:s,size:o});return k.createElement(Pe,mhe({className:v(m.root,r),ref:t},h),c)});dx.displayName="@mantine/core/ThemeIcon";var yhe=Object.defineProperty,_he=Object.defineProperties,whe=Object.getOwnPropertyDescriptors,hT=Object.getOwnPropertySymbols,bhe=Object.prototype.hasOwnProperty,xhe=Object.prototype.propertyIsEnumerable,pT=(e,t,n)=>t in e?yhe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,She=(e,t)=>{for(var n in t||(t={}))bhe.call(t,n)&&pT(e,n,t[n]);if(hT)for(var n of hT(t))xhe.call(t,n)&&pT(e,n,t[n]);return e},Phe=(e,t)=>_he(e,whe(t));function Ohe(e,t,n){return typeof e<"u"?e in n.headings.sizes?n.headings.sizes[e].fontSize:M(e):n.headings.sizes[t].fontSize}function Che(e,t,n){return typeof e<"u"&&e in n.headings.sizes?n.headings.sizes[e].lineHeight:n.headings.sizes[t].lineHeight}var khe=ue((e,{element:t,weight:n,inline:r},{size:o})=>({root:Phe(She({},e.fn.fontStyles()),{fontFamily:e.headings.fontFamily,fontWeight:n||e.headings.sizes[t].fontWeight||e.headings.fontWeight,fontSize:Ohe(o,t,e),lineHeight:r?1:Che(o,t,e),margin:0})}));const Ehe=khe;var $he=Object.defineProperty,Lv=Object.getOwnPropertySymbols,D8=Object.prototype.hasOwnProperty,j8=Object.prototype.propertyIsEnumerable,mT=(e,t,n)=>t in e?$he(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mhe=(e,t)=>{for(var n in t||(t={}))D8.call(t,n)&&mT(e,n,t[n]);if(Lv)for(var n of Lv(t))j8.call(t,n)&&mT(e,n,t[n]);return e},Nhe=(e,t)=>{var n={};for(var r in e)D8.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Lv)for(var r of Lv(e))t.indexOf(r)<0&&j8.call(e,r)&&(n[r]=e[r]);return n};const The={order:1},L8=_.forwardRef((e,t)=>{const n=ae("Title",The,e),{className:r,order:o,children:i,unstyled:s,size:a,weight:c,inline:u,variant:f}=n,h=Nhe(n,["className","order","children","unstyled","size","weight","inline","variant"]),{classes:m,cx:v}=Ehe({element:`h${o}`,weight:c,inline:u},{name:"Title",unstyled:s,variant:f,size:a});return[1,2,3,4,5,6].includes(o)?k.createElement(U,Mhe({variant:f,component:`h${o}`,ref:t,className:v(m.root,r)},h),i):null});L8.displayName="@mantine/core/Title";var Ihe=Object.defineProperty,Dhe=Object.defineProperties,jhe=Object.getOwnPropertyDescriptors,gT=Object.getOwnPropertySymbols,Lhe=Object.prototype.hasOwnProperty,Rhe=Object.prototype.propertyIsEnumerable,vT=(e,t,n)=>t in e?Ihe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fp=(e,t)=>{for(var n in t||(t={}))Lhe.call(t,n)&&vT(e,n,t[n]);if(gT)for(var n of gT(t))Rhe.call(t,n)&&vT(e,n,t[n]);return e},hp=(e,t)=>Dhe(e,jhe(t)),zhe=ue(e=>{const t=IU(e.headings.sizes).reduce((n,r)=>{const o=e.headings.sizes[r];return n[`& ${r}`]=hp(fp({fontFamily:e.headings.fontFamily,fontWeight:o.fontWeight||e.headings.fontWeight,marginTop:typeof o.lineHeight=="number"?`calc(${e.spacing.xl} * ${o.lineHeight})`:e.spacing.xl,marginBottom:e.spacing.sm},o),{[e.fn.smallerThan("sm")]:{fontSize:`calc(${M(o.fontSize)} / 1.3)`}}),n},{});return{root:hp(fp(hp(fp({},e.fn.fontStyles()),{color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,lineHeight:e.lineHeight,fontSize:e.fontSizes.md,[e.fn.smallerThan("sm")]:{fontSize:e.fontSizes.sm}}),t),{"& img":{maxWidth:"100%",marginBottom:e.spacing.xs},"& p":{marginTop:0,marginBottom:e.spacing.lg},"& mark":{backgroundColor:e.fn.themeColor("yellow",e.colorScheme==="dark"?5:2),color:e.colorScheme==="dark"?e.colors.dark[9]:"inherit"},"& hr":{marginTop:e.spacing.md,marginBottom:e.spacing.sm,borderBottom:0,borderLeft:0,borderRight:0,borderTop:`${M(1)} dashed ${e.colors.gray[e.colorScheme==="dark"?4:6]}`},"& a":hp(fp({},e.fn.focusStyles()),{color:e.colors[e.primaryColor][e.colorScheme==="dark"?4:6],textDecoration:"none","&:hover":{textDecoration:"underline"}}),"& pre":{padding:e.spacing.xs,lineHeight:e.lineHeight,margin:0,marginTop:e.spacing.md,marginBottom:e.spacing.md,overflowX:"auto",fontFamily:e.fontFamilyMonospace,fontSize:e.fontSizes.sm,borderRadius:e.radius.sm,backgroundColor:e.colorScheme==="dark"?e.colors.dark[8]:e.colors.gray[0],"& code":{backgroundColor:"transparent",padding:0,borderRadius:0,color:"inherit",border:0}},"& code":{lineHeight:e.lineHeight,padding:`${M(1)} ${M(5)}`,borderRadius:e.radius.sm,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,backgroundColor:e.colorScheme==="dark"?e.colors.dark[9]:e.colors.gray[0],fontFamily:e.fontFamilyMonospace,fontSize:e.fontSizes.xs,border:`${M(1)} solid ${e.colorScheme==="dark"?e.colors.dark[9]:e.colors.gray[3]}`},"& ul, & ol":{marginBottom:e.spacing.md,paddingLeft:38,"& li":{marginTop:e.spacing.xs}},"& table":{width:"100%",borderCollapse:"collapse",captionSide:"bottom",marginBottom:e.spacing.md,"& caption":{marginTop:e.spacing.xs,fontSize:e.fontSizes.sm,color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6]},"& th":{textAlign:"left",fontWeight:"bold",color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],fontSize:14,padding:`${M(7)} ${M(10)}`},"& thead th":{borderBottom:`${M(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`},"& tfoot th":{borderTop:`${M(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`},"& td":{padding:`${M(7)} ${M(10)}`,borderBottom:`${M(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`,fontSize:14},"& tr:last-of-type td":{borderBottom:"none"}},"& blockquote":{fontSize:e.fontSizes.lg,lineHeight:e.lineHeight,margin:`${e.spacing.md} 0`,borderTopRightRadius:e.radius.sm,borderBottomRightRadius:e.radius.sm,padding:`${e.spacing.md} ${e.spacing.lg}`,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,borderLeft:`${M(6)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`,"& cite":{display:"block",fontSize:e.fontSizes.sm,marginTop:e.spacing.xs,color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],overflow:"hidden",textOverflow:"ellipsis"}}})}});const Ahe=zhe;var Bhe=Object.defineProperty,Rv=Object.getOwnPropertySymbols,R8=Object.prototype.hasOwnProperty,z8=Object.prototype.propertyIsEnumerable,yT=(e,t,n)=>t in e?Bhe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Fhe=(e,t)=>{for(var n in t||(t={}))R8.call(t,n)&&yT(e,n,t[n]);if(Rv)for(var n of Rv(t))z8.call(t,n)&&yT(e,n,t[n]);return e},Vhe=(e,t)=>{var n={};for(var r in e)R8.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Rv)for(var r of Rv(e))t.indexOf(r)<0&&z8.call(e,r)&&(n[r]=e[r]);return n};const A8=_.forwardRef((e,t)=>{const n=ae("TypographyStylesProvider",{},e),{className:r,unstyled:o,variant:i}=n,s=Vhe(n,["className","unstyled","variant"]),{classes:a,cx:c}=Ahe(null,{name:"TypographyStylesProvider",unstyled:o,variant:i});return k.createElement(Pe,Fhe({className:c(a.root,r),ref:t},s))});A8.displayName="@mantine/core/TypographyStylesProvider";var fx={},_T=Cs;fx.createRoot=_T.createRoot,fx.hydrateRoot=_T.hydrateRoot;/** +`+i.stack}return{value:e,source:t,stack:o,digest:null}}function j_(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Bb(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var jq=typeof WeakMap=="function"?WeakMap:Map;function i3(e,t,n){n=fs(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Gm||(Gm=!0,qb=r),Bb(e,t)},n}function s3(e,t,n){n=fs(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){Bb(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Bb(e,t),typeof r!="function"&&(ma===null?ma=new Set([this]):ma.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function A2(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new jq;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=Yq.bind(null,e,t,n),t.then(e,e))}function B2(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function F2(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=fs(-1,1),t.tag=2,pa(n,t,1))),n.lanes|=1),e)}var Dq=Os.ReactCurrentOwner,Ar=!1;function mr(e,t,n,r){t.child=e===null?z5(t,null,n,r):iu(t,e.child,n,r)}function V2(e,t,n,r,o){n=n.render;var i=t.ref;return Gc(t,o),r=sP(e,t,n,r,i,o),n=aP(),e!==null&&!Ar?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,ys(e,t,o)):(Lt&&n&&YS(t),t.flags|=1,mr(e,t,r,o),t.child)}function H2(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!vP(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,a3(e,t,i,r,o)):(e=qp(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&o)){var s=i.memoizedProps;if(n=n.compare,n=n!==null?n:cf,n(s,r)&&e.ref===t.ref)return ys(e,t,o)}return t.flags|=1,e=va(i,r),e.ref=t.ref,e.return=t,t.child=e}function a3(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(cf(i,r)&&e.ref===t.ref)if(Ar=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(Ar=!0);else return t.lanes=e.lanes,ys(e,t,o)}return Fb(e,t,n,r,o)}function l3(e,t,n){var r=t.pendingProps,o=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ct(Ic,ao),ao|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ct(Ic,ao),ao|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,Ct(Ic,ao),ao|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,Ct(Ic,ao),ao|=r;return mr(e,t,o,n),t.child}function c3(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Fb(e,t,n,r,o){var i=Vr(n)?$l:ir.current;return i=ru(t,i),Gc(t,o),n=sP(e,t,n,r,i,o),r=aP(),e!==null&&!Ar?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,ys(e,t,o)):(Lt&&r&&YS(t),t.flags|=1,mr(e,t,n,o),t.child)}function W2(e,t,n,r,o){if(Vr(n)){var i=!0;Lm(t)}else i=!1;if(Gc(t,o),t.stateNode===null)Gp(e,t),R5(t,n,r),Ab(t,n,r,o),r=!0;else if(e===null){var s=t.stateNode,a=t.memoizedProps;s.props=a;var c=s.context,u=n.contextType;typeof u=="object"&&u!==null?u=Fo(u):(u=Vr(n)?$l:ir.current,u=ru(t,u));var f=n.getDerivedStateFromProps,h=typeof f=="function"||typeof s.getSnapshotBeforeUpdate=="function";h||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==r||c!==u)&&D2(t,s,r,u),Gs=!1;var m=t.memoizedState;s.state=m,Vm(t,r,s,o),c=t.memoizedState,a!==r||m!==c||Fr.current||Gs?(typeof f=="function"&&(zb(t,n,f,r),c=t.memoizedState),(a=Gs||j2(t,n,a,r,m,c,u))?(h||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),s.props=r,s.state=c,s.context=u,r=a):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,j5(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:Ko(t.type,a),s.props=u,h=t.pendingProps,m=s.context,c=n.contextType,typeof c=="object"&&c!==null?c=Fo(c):(c=Vr(n)?$l:ir.current,c=ru(t,c));var v=n.getDerivedStateFromProps;(f=typeof v=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==h||m!==c)&&D2(t,s,r,c),Gs=!1,m=t.memoizedState,s.state=m,Vm(t,r,s,o);var y=t.memoizedState;a!==h||m!==y||Fr.current||Gs?(typeof v=="function"&&(zb(t,n,v,r),y=t.memoizedState),(u=Gs||j2(t,n,u,r,m,y,c)||!1)?(f||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,y,c),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,y,c)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=y),s.props=r,s.state=y,s.context=c,r=u):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),r=!1)}return Vb(e,t,n,r,i,o)}function Vb(e,t,n,r,o,i){c3(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&$2(t,n,!1),ys(e,t,i);r=t.stateNode,Dq.current=t;var a=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=iu(t,e.child,null,i),t.child=iu(t,null,a,i)):mr(e,t,a,i),t.memoizedState=r.state,o&&$2(t,n,!0),t.child}function u3(e){var t=e.stateNode;t.pendingContext?E2(e,t.pendingContext,t.pendingContext!==t.context):t.context&&E2(e,t.context,!1),nP(e,t.containerInfo)}function U2(e,t,n,r,o){return ou(),qS(o),t.flags|=256,mr(e,t,n,r),t.child}var Hb={dehydrated:null,treeContext:null,retryLane:0};function Wb(e){return{baseLanes:e,cachePool:null,transitions:null}}function d3(e,t,n){var r=t.pendingProps,o=Ht.current,i=!1,s=(t.flags&128)!==0,a;if((a=s)||(a=e!==null&&e.memoizedState===null?!1:(o&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),Ct(Ht,o&1),e===null)return Rb(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=r.children,e=r.fallback,i?(r=t.mode,i=t.child,s={mode:"hidden",children:s},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=s):i=M0(s,r,0,null),e=xl(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Wb(n),t.memoizedState=Hb,e):uP(t,s));if(o=e.memoizedState,o!==null&&(a=o.dehydrated,a!==null))return Rq(e,t,s,r,a,o,n);if(i){i=r.fallback,s=t.mode,o=e.child,a=o.sibling;var c={mode:"hidden",children:r.children};return!(s&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=va(o,c),r.subtreeFlags=o.subtreeFlags&14680064),a!==null?i=va(a,i):(i=xl(i,s,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,s=e.child.memoizedState,s=s===null?Wb(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=Hb,r}return i=e.child,e=i.sibling,r=va(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function uP(e,t){return t=M0({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Hh(e,t,n,r){return r!==null&&qS(r),iu(t,e.child,null,n),e=uP(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Rq(e,t,n,r,o,i,s){if(n)return t.flags&256?(t.flags&=-257,r=j_(Error(ce(422))),Hh(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=M0({mode:"visible",children:r.children},o,0,null),i=xl(i,o,s,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&iu(t,e.child,null,s),t.child.memoizedState=Wb(s),t.memoizedState=Hb,i);if(!(t.mode&1))return Hh(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(ce(419)),r=j_(i,r,void 0),Hh(e,t,s,r)}if(a=(s&e.childLanes)!==0,Ar||a){if(r=kn,r!==null){switch(s&-s){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(r.suspendedLanes|s)?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,vs(e,o),ni(r,e,o,-1))}return gP(),r=j_(Error(ce(421))),Hh(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=Kq.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,po=ha(o.nextSibling),go=t,Lt=!0,Jo=null,e!==null&&(Io[jo++]=cs,Io[jo++]=us,Io[jo++]=Ml,cs=e.id,us=e.overflow,Ml=t),t=uP(t,r.children),t.flags|=4096,t)}function Z2(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Lb(e.return,t,n)}function D_(e,t,n,r,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function f3(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(mr(e,t,r.children,n),r=Ht.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Z2(e,n,t);else if(e.tag===19)Z2(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Ct(Ht,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&Hm(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),D_(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Hm(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}D_(t,!0,n,null,i);break;case"together":D_(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Gp(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ys(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Tl|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(ce(153));if(t.child!==null){for(e=t.child,n=va(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=va(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Lq(e,t,n){switch(t.tag){case 3:u3(t),ou();break;case 5:A5(t);break;case 1:Vr(t.type)&&Lm(t);break;case 4:nP(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;Ct(Bm,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Ct(Ht,Ht.current&1),t.flags|=128,null):n&t.child.childLanes?d3(e,t,n):(Ct(Ht,Ht.current&1),e=ys(e,t,n),e!==null?e.sibling:null);Ct(Ht,Ht.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return f3(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Ct(Ht,Ht.current),r)break;return null;case 22:case 23:return t.lanes=0,l3(e,t,n)}return ys(e,t,n)}var h3,Ub,p3,m3;h3=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Ub=function(){};p3=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,pl(Ri.current);var i=null;switch(n){case"input":o=hb(e,o),r=hb(e,r),i=[];break;case"select":o=Ut({},o,{value:void 0}),r=Ut({},r,{value:void 0}),i=[];break;case"textarea":o=gb(e,o),r=gb(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Dm)}yb(n,r);var s;n=null;for(u in o)if(!r.hasOwnProperty(u)&&o.hasOwnProperty(u)&&o[u]!=null)if(u==="style"){var a=o[u];for(s in a)a.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(tf.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var c=r[u];if(a=o?.[u],r.hasOwnProperty(u)&&c!==a&&(c!=null||a!=null))if(u==="style")if(a){for(s in a)!a.hasOwnProperty(s)||c&&c.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in c)c.hasOwnProperty(s)&&a[s]!==c[s]&&(n||(n={}),n[s]=c[s])}else n||(i||(i=[]),i.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,a=a?a.__html:void 0,c!=null&&a!==c&&(i=i||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(tf.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&Nt("scroll",e),i||a===c||(i=[])):(i=i||[]).push(u,c))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};m3=function(e,t,n,r){n!==r&&(t.flags|=4)};function ld(e,t){if(!Lt)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Qn(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function zq(e,t,n){var r=t.pendingProps;switch(KS(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Qn(t),null;case 1:return Vr(t.type)&&Rm(),Qn(t),null;case 3:return r=t.stateNode,su(),Dt(Fr),Dt(ir),oP(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Fh(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Jo!==null&&(Xb(Jo),Jo=null))),Ub(e,t),Qn(t),null;case 5:rP(t);var o=pl(pf.current);if(n=t.type,e!==null&&t.stateNode!=null)p3(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(ce(166));return Qn(t),null}if(e=pl(Ri.current),Fh(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Ei]=t,r[ff]=i,e=(t.mode&1)!==0,n){case"dialog":Nt("cancel",r),Nt("close",r);break;case"iframe":case"object":case"embed":Nt("load",r);break;case"video":case"audio":for(o=0;o<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Ei]=t,e[ff]=r,h3(e,t,!1,!1),t.stateNode=e;e:{switch(s=_b(n,r),n){case"dialog":Nt("cancel",e),Nt("close",e),o=r;break;case"iframe":case"object":case"embed":Nt("load",e),o=r;break;case"video":case"audio":for(o=0;olu&&(t.flags|=128,r=!0,ld(i,!1),t.lanes=4194304)}else{if(!r)if(e=Hm(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ld(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!Lt)return Qn(t),null}else 2*Xt()-i.renderingStartTime>lu&&n!==1073741824&&(t.flags|=128,r=!0,ld(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Xt(),t.sibling=null,n=Ht.current,Ct(Ht,r?n&1|2:n&1),t):(Qn(t),null);case 22:case 23:return mP(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ao&1073741824&&(Qn(t),t.subtreeFlags&6&&(t.flags|=8192)):Qn(t),null;case 24:return null;case 25:return null}throw Error(ce(156,t.tag))}function Aq(e,t){switch(KS(t),t.tag){case 1:return Vr(t.type)&&Rm(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return su(),Dt(Fr),Dt(ir),oP(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return rP(t),null;case 13:if(Dt(Ht),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ce(340));ou()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Dt(Ht),null;case 4:return su(),null;case 10:return XS(t.type._context),null;case 22:case 23:return mP(),null;case 24:return null;default:return null}}var Wh=!1,nr=!1,Bq=typeof WeakSet=="function"?WeakSet:Set,xe=null;function Tc(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Yt(e,t,r)}else n.current=null}function Zb(e,t,n){try{n()}catch(r){Yt(e,t,r)}}var G2=!1;function Fq(e,t){if($b=Tm,e=_5(),GS(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,a=-1,c=-1,u=0,f=0,h=e,m=null;t:for(;;){for(var v;h!==n||o!==0&&h.nodeType!==3||(a=s+o),h!==i||r!==0&&h.nodeType!==3||(c=s+r),h.nodeType===3&&(s+=h.nodeValue.length),(v=h.firstChild)!==null;)m=h,h=v;for(;;){if(h===e)break t;if(m===n&&++u===o&&(a=s),m===i&&++f===r&&(c=s),(v=h.nextSibling)!==null)break;h=m,m=h.parentNode}h=v}n=a===-1||c===-1?null:{start:a,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Mb={focusedElem:e,selectionRange:n},Tm=!1,xe=t;xe!==null;)if(t=xe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,xe=e;else for(;xe!==null;){t=xe;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var w=y.memoizedProps,P=y.memoizedState,b=t.stateNode,S=b.getSnapshotBeforeUpdate(t.elementType===t.type?w:Ko(t.type,w),P);b.__reactInternalSnapshotBeforeUpdate=S}break;case 3:var O=t.stateNode.containerInfo;O.nodeType===1?O.textContent="":O.nodeType===9&&O.documentElement&&O.removeChild(O.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ce(163))}}catch(E){Yt(t,t.return,E)}if(e=t.sibling,e!==null){e.return=t.return,xe=e;break}xe=t.return}return y=G2,G2=!1,y}function Ld(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&Zb(t,n,i)}o=o.next}while(o!==r)}}function E0(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Gb(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function g3(e){var t=e.alternate;t!==null&&(e.alternate=null,g3(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ei],delete t[ff],delete t[Ib],delete t[Sq],delete t[Pq])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function v3(e){return e.tag===5||e.tag===3||e.tag===4}function Y2(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||v3(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Yb(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Dm));else if(r!==4&&(e=e.child,e!==null))for(Yb(e,t,n),e=e.sibling;e!==null;)Yb(e,t,n),e=e.sibling}function Kb(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Kb(e,t,n),e=e.sibling;e!==null;)Kb(e,t,n),e=e.sibling}var Dn=null,qo=!1;function Ds(e,t,n){for(n=n.child;n!==null;)y3(e,t,n),n=n.sibling}function y3(e,t,n){if(Di&&typeof Di.onCommitFiberUnmount=="function")try{Di.onCommitFiberUnmount(w0,n)}catch{}switch(n.tag){case 5:nr||Tc(n,t);case 6:var r=Dn,o=qo;Dn=null,Ds(e,t,n),Dn=r,qo=o,Dn!==null&&(qo?(e=Dn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Dn.removeChild(n.stateNode));break;case 18:Dn!==null&&(qo?(e=Dn,n=n.stateNode,e.nodeType===8?E_(e.parentNode,n):e.nodeType===1&&E_(e,n),af(e)):E_(Dn,n.stateNode));break;case 4:r=Dn,o=qo,Dn=n.stateNode.containerInfo,qo=!0,Ds(e,t,n),Dn=r,qo=o;break;case 0:case 11:case 14:case 15:if(!nr&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&Zb(n,t,s),o=o.next}while(o!==r)}Ds(e,t,n);break;case 1:if(!nr&&(Tc(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Yt(n,t,a)}Ds(e,t,n);break;case 21:Ds(e,t,n);break;case 22:n.mode&1?(nr=(r=nr)||n.memoizedState!==null,Ds(e,t,n),nr=r):Ds(e,t,n);break;default:Ds(e,t,n)}}function K2(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Bq),t.forEach(function(r){var o=qq.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function Go(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=s),r&=~i}if(r=o,r=Xt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Hq(r/1960))-r,10e?16:e,ta===null)var r=!1;else{if(e=ta,ta=null,Ym=0,ot&6)throw Error(ce(331));var o=ot;for(ot|=4,xe=e.current;xe!==null;){var i=xe,s=i.child;if(xe.flags&16){var a=i.deletions;if(a!==null){for(var c=0;cXt()-hP?bl(e,0):fP|=n),Hr(e,t)}function C3(e,t){t===0&&(e.mode&1?(t=Dh,Dh<<=1,!(Dh&130023424)&&(Dh=4194304)):t=1);var n=_r();e=vs(e,t),e!==null&&(Vf(e,t,n),Hr(e,n))}function Kq(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),C3(e,n)}function qq(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(ce(314))}r!==null&&r.delete(t),C3(e,n)}var k3;k3=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Fr.current)Ar=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ar=!1,Lq(e,t,n);Ar=!!(e.flags&131072)}else Ar=!1,Lt&&t.flags&1048576&&M5(t,Am,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Gp(e,t),e=t.pendingProps;var o=ru(t,ir.current);Gc(t,n),o=sP(null,t,r,e,o,n);var i=aP();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Vr(r)?(i=!0,Lm(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,tP(t),o.updater=C0,t.stateNode=o,o._reactInternals=t,Ab(t,r,e,n),t=Vb(null,t,r,!0,i,n)):(t.tag=0,Lt&&i&&YS(t),mr(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Gp(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=Qq(r),e=Ko(r,e),o){case 0:t=Fb(null,t,r,e,n);break e;case 1:t=W2(null,t,r,e,n);break e;case 11:t=V2(null,t,r,e,n);break e;case 14:t=H2(null,t,r,Ko(r.type,e),n);break e}throw Error(ce(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Ko(r,o),Fb(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Ko(r,o),W2(e,t,r,o,n);case 3:e:{if(u3(t),e===null)throw Error(ce(387));r=t.pendingProps,i=t.memoizedState,o=i.element,j5(e,t),Vm(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=au(Error(ce(423)),t),t=U2(e,t,r,n,o);break e}else if(r!==o){o=au(Error(ce(424)),t),t=U2(e,t,r,n,o);break e}else for(po=ha(t.stateNode.containerInfo.firstChild),go=t,Lt=!0,Jo=null,n=z5(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ou(),r===o){t=ys(e,t,n);break e}mr(e,t,r,n)}t=t.child}return t;case 5:return A5(t),e===null&&Rb(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,Nb(r,o)?s=null:i!==null&&Nb(r,i)&&(t.flags|=32),c3(e,t),mr(e,t,s,n),t.child;case 6:return e===null&&Rb(t),null;case 13:return d3(e,t,n);case 4:return nP(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=iu(t,null,r,n):mr(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Ko(r,o),V2(e,t,r,o,n);case 7:return mr(e,t,t.pendingProps,n),t.child;case 8:return mr(e,t,t.pendingProps.children,n),t.child;case 12:return mr(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,Ct(Bm,r._currentValue),r._currentValue=s,i!==null)if(oi(i.value,s)){if(i.children===o.children&&!Fr.current){t=ys(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){s=i.child;for(var c=a.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=fs(-1,n&-n),c.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var f=u.pending;f===null?c.next=c:(c.next=f.next,f.next=c),u.pending=c}}i.lanes|=n,c=i.alternate,c!==null&&(c.lanes|=n),Lb(i.return,n,t),a.lanes|=n;break}c=c.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(ce(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Lb(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}mr(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Gc(t,n),o=Fo(o),r=r(o),t.flags|=1,mr(e,t,r,n),t.child;case 14:return r=t.type,o=Ko(r,t.pendingProps),o=Ko(r.type,o),H2(e,t,r,o,n);case 15:return a3(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Ko(r,o),Gp(e,t),t.tag=1,Vr(r)?(e=!0,Lm(t)):e=!1,Gc(t,n),R5(t,r,o),Ab(t,r,o,n),Vb(null,t,r,!0,e,n);case 19:return f3(e,t,n);case 22:return l3(e,t,n)}throw Error(ce(156,t.tag))};function E3(e,t){return e5(e,t)}function Jq(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Do(e,t,n,r){return new Jq(e,t,n,r)}function vP(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Qq(e){if(typeof e=="function")return vP(e)?1:0;if(e!=null){if(e=e.$$typeof,e===RS)return 11;if(e===LS)return 14}return 2}function va(e,t){var n=e.alternate;return n===null?(n=Do(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function qp(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")vP(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Sc:return xl(n.children,o,i,t);case DS:s=8,o|=8;break;case cb:return e=Do(12,n,t,o|2),e.elementType=cb,e.lanes=i,e;case ub:return e=Do(13,n,t,o),e.elementType=ub,e.lanes=i,e;case db:return e=Do(19,n,t,o),e.elementType=db,e.lanes=i,e;case LL:return M0(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case DL:s=10;break e;case RL:s=9;break e;case RS:s=11;break e;case LS:s=14;break e;case Zs:s=16,r=null;break e}throw Error(ce(130,e==null?e:typeof e,""))}return t=Do(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function xl(e,t,n,r){return e=Do(7,e,r,t),e.lanes=n,e}function M0(e,t,n,r){return e=Do(22,e,r,t),e.elementType=LL,e.lanes=n,e.stateNode={isHidden:!1},e}function R_(e,t,n){return e=Do(6,e,null,t),e.lanes=n,e}function L_(e,t,n){return t=Do(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Xq(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=v_(0),this.expirationTimes=v_(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=v_(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function yP(e,t,n,r,o,i,s,a,c){return e=new Xq(e,t,n,a,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Do(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},tP(i),e}function eJ(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(T3)}catch(e){console.error(e)}}T3(),ML.exports=xo;var Cs=ML.exports;const iJ=Ta(Cs);var sJ=Object.defineProperty,Jm=Object.getOwnPropertySymbols,I3=Object.prototype.hasOwnProperty,j3=Object.prototype.propertyIsEnumerable,rE=(e,t,n)=>t in e?sJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,oE=(e,t)=>{for(var n in t||(t={}))I3.call(t,n)&&rE(e,n,t[n]);if(Jm)for(var n of Jm(t))j3.call(t,n)&&rE(e,n,t[n]);return e},aJ=(e,t)=>{var n={};for(var r in e)I3.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Jm)for(var r of Jm(e))t.indexOf(r)<0&&j3.call(e,r)&&(n[r]=e[r]);return n};function lJ(e){const t=e,{style:n}=t,r=aJ(t,["style"]);return k.createElement("svg",oE({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:oE({width:M(16),height:M(16)},n)},r),k.createElement("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}var cJ=Object.defineProperty,uJ=Object.defineProperties,dJ=Object.getOwnPropertyDescriptors,iE=Object.getOwnPropertySymbols,fJ=Object.prototype.hasOwnProperty,hJ=Object.prototype.propertyIsEnumerable,sE=(e,t,n)=>t in e?cJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ex=(e,t)=>{for(var n in t||(t={}))fJ.call(t,n)&&sE(e,n,t[n]);if(iE)for(var n of iE(t))hJ.call(t,n)&&sE(e,n,t[n]);return e},aE=(e,t)=>uJ(e,dJ(t));const pJ=["subtle","filled","outline","light","default","transparent","gradient"],Gh={xs:M(18),sm:M(22),md:M(28),lg:M(34),xl:M(44)};function mJ({variant:e,theme:t,color:n,gradient:r}){const o=t.fn.variant({color:n,variant:e,gradient:r});return e==="gradient"?{border:0,backgroundImage:o.background,color:o.color,"&:hover":t.fn.hover({backgroundSize:"200%"})}:pJ.includes(e)?ex({border:`${M(1)} solid ${o.border}`,backgroundColor:o.background,color:o.color},t.fn.hover({backgroundColor:o.hover})):null}var gJ=ue((e,{radius:t,color:n,gradient:r},{variant:o,size:i})=>({root:aE(ex({position:"relative",borderRadius:e.fn.radius(t),padding:0,lineHeight:1,display:"flex",alignItems:"center",justifyContent:"center",height:re({size:i,sizes:Gh}),minHeight:re({size:i,sizes:Gh}),width:re({size:i,sizes:Gh}),minWidth:re({size:i,sizes:Gh})},mJ({variant:o,theme:e,color:n,gradient:r})),{"&:active":e.activeStyles,"& [data-action-icon-loader]":{maxWidth:"70%"},"&:disabled, &[data-disabled]":{color:e.colors.gray[e.colorScheme==="dark"?6:4],cursor:"not-allowed",backgroundColor:o==="transparent"?void 0:e.fn.themeColor("gray",e.colorScheme==="dark"?8:1),borderColor:o==="transparent"?void 0:e.fn.themeColor("gray",e.colorScheme==="dark"?8:1),backgroundImage:"none",pointerEvents:"none","&:active":{transform:"none"}},"&[data-loading]":{pointerEvents:"none","&::before":aE(ex({content:'""'},e.fn.cover(M(-1))),{backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.colors.dark[7],.5):"rgba(255, 255, 255, .5)",borderRadius:e.fn.radius(t),cursor:"not-allowed"})}})}));const vJ=gJ;var yJ=Object.defineProperty,Qm=Object.getOwnPropertySymbols,D3=Object.prototype.hasOwnProperty,R3=Object.prototype.propertyIsEnumerable,lE=(e,t,n)=>t in e?yJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,cE=(e,t)=>{for(var n in t||(t={}))D3.call(t,n)&&lE(e,n,t[n]);if(Qm)for(var n of Qm(t))R3.call(t,n)&&lE(e,n,t[n]);return e},uE=(e,t)=>{var n={};for(var r in e)D3.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Qm)for(var r of Qm(e))t.indexOf(r)<0&&R3.call(e,r)&&(n[r]=e[r]);return n};function _J(e){var t=e,{size:n,color:r}=t,o=uE(t,["size","color"]);const i=o,{style:s}=i,a=uE(i,["style"]);return k.createElement("svg",cE({viewBox:"0 0 135 140",xmlns:"http://www.w3.org/2000/svg",fill:r,style:cE({width:n},s)},a),k.createElement("rect",{y:"10",width:"15",height:"120",rx:"6"},k.createElement("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),k.createElement("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),k.createElement("rect",{x:"30",y:"10",width:"15",height:"120",rx:"6"},k.createElement("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),k.createElement("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),k.createElement("rect",{x:"60",width:"15",height:"140",rx:"6"},k.createElement("animate",{attributeName:"height",begin:"0s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),k.createElement("animate",{attributeName:"y",begin:"0s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),k.createElement("rect",{x:"90",y:"10",width:"15",height:"120",rx:"6"},k.createElement("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),k.createElement("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),k.createElement("rect",{x:"120",y:"10",width:"15",height:"120",rx:"6"},k.createElement("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),k.createElement("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})))}var wJ=Object.defineProperty,Xm=Object.getOwnPropertySymbols,L3=Object.prototype.hasOwnProperty,z3=Object.prototype.propertyIsEnumerable,dE=(e,t,n)=>t in e?wJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fE=(e,t)=>{for(var n in t||(t={}))L3.call(t,n)&&dE(e,n,t[n]);if(Xm)for(var n of Xm(t))z3.call(t,n)&&dE(e,n,t[n]);return e},hE=(e,t)=>{var n={};for(var r in e)L3.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Xm)for(var r of Xm(e))t.indexOf(r)<0&&z3.call(e,r)&&(n[r]=e[r]);return n};function bJ(e){var t=e,{size:n,color:r}=t,o=hE(t,["size","color"]);const i=o,{style:s}=i,a=hE(i,["style"]);return k.createElement("svg",fE({viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",stroke:r,style:fE({width:n,height:n},s)},a),k.createElement("g",{fill:"none",fillRule:"evenodd"},k.createElement("g",{transform:"translate(2.5 2.5)",strokeWidth:"5"},k.createElement("circle",{strokeOpacity:".5",cx:"16",cy:"16",r:"16"}),k.createElement("path",{d:"M32 16c0-9.94-8.06-16-16-16"},k.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 16 16",to:"360 16 16",dur:"1s",repeatCount:"indefinite"})))))}var xJ=Object.defineProperty,eg=Object.getOwnPropertySymbols,A3=Object.prototype.hasOwnProperty,B3=Object.prototype.propertyIsEnumerable,pE=(e,t,n)=>t in e?xJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mE=(e,t)=>{for(var n in t||(t={}))A3.call(t,n)&&pE(e,n,t[n]);if(eg)for(var n of eg(t))B3.call(t,n)&&pE(e,n,t[n]);return e},gE=(e,t)=>{var n={};for(var r in e)A3.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&eg)for(var r of eg(e))t.indexOf(r)<0&&B3.call(e,r)&&(n[r]=e[r]);return n};function SJ(e){var t=e,{size:n,color:r}=t,o=gE(t,["size","color"]);const i=o,{style:s}=i,a=gE(i,["style"]);return k.createElement("svg",mE({viewBox:"0 0 120 30",xmlns:"http://www.w3.org/2000/svg",fill:r,style:mE({width:n},s)},a),k.createElement("circle",{cx:"15",cy:"15",r:"15"},k.createElement("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),k.createElement("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})),k.createElement("circle",{cx:"60",cy:"15",r:"9",fillOpacity:"0.3"},k.createElement("animate",{attributeName:"r",from:"9",to:"9",begin:"0s",dur:"0.8s",values:"9;15;9",calcMode:"linear",repeatCount:"indefinite"}),k.createElement("animate",{attributeName:"fill-opacity",from:"0.5",to:"0.5",begin:"0s",dur:"0.8s",values:".5;1;.5",calcMode:"linear",repeatCount:"indefinite"})),k.createElement("circle",{cx:"105",cy:"15",r:"15"},k.createElement("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),k.createElement("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})))}var PJ=Object.defineProperty,tg=Object.getOwnPropertySymbols,F3=Object.prototype.hasOwnProperty,V3=Object.prototype.propertyIsEnumerable,vE=(e,t,n)=>t in e?PJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,OJ=(e,t)=>{for(var n in t||(t={}))F3.call(t,n)&&vE(e,n,t[n]);if(tg)for(var n of tg(t))V3.call(t,n)&&vE(e,n,t[n]);return e},CJ=(e,t)=>{var n={};for(var r in e)F3.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&tg)for(var r of tg(e))t.indexOf(r)<0&&V3.call(e,r)&&(n[r]=e[r]);return n};const z_={bars:_J,oval:bJ,dots:SJ},kJ={xs:M(18),sm:M(22),md:M(36),lg:M(44),xl:M(58)},EJ={size:"md"};function en(e){const t=ae("Loader",EJ,e),{size:n,color:r,variant:o}=t,i=CJ(t,["size","color","variant"]),s=ar(),a=o in z_?o:s.loader;return k.createElement(Pe,OJ({role:"presentation",component:z_[a]||z_.bars,size:re({size:n,sizes:kJ}),color:s.fn.variant({variant:"filled",primaryFallback:!1,color:r||s.primaryColor}).background},i))}en.displayName="@mantine/core/Loader";var $J=Object.defineProperty,ng=Object.getOwnPropertySymbols,H3=Object.prototype.hasOwnProperty,W3=Object.prototype.propertyIsEnumerable,yE=(e,t,n)=>t in e?$J(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_E=(e,t)=>{for(var n in t||(t={}))H3.call(t,n)&&yE(e,n,t[n]);if(ng)for(var n of ng(t))W3.call(t,n)&&yE(e,n,t[n]);return e},MJ=(e,t)=>{var n={};for(var r in e)H3.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ng)for(var r of ng(e))t.indexOf(r)<0&&W3.call(e,r)&&(n[r]=e[r]);return n};const NJ={color:"gray",size:"md",variant:"subtle"},U3=_.forwardRef((e,t)=>{const n=ae("ActionIcon",NJ,e),{className:r,color:o,children:i,radius:s,size:a,variant:c,gradient:u,disabled:f,loaderProps:h,loading:m,unstyled:v,__staticSelector:y}=n,w=MJ(n,["className","color","children","radius","size","variant","gradient","disabled","loaderProps","loading","unstyled","__staticSelector"]),{classes:P,cx:b,theme:S}=vJ({radius:s,color:o,gradient:u},{name:["ActionIcon",y],unstyled:v,size:a,variant:c}),O=k.createElement(en,_E({color:S.fn.variant({color:o,variant:c}).color,size:"100%","data-action-icon-loader":!0},h));return k.createElement(ds,_E({className:b(P.root,r),ref:t,disabled:f,"data-disabled":f||void 0,"data-loading":m||void 0,unstyled:v},w),m?O:i)});U3.displayName="@mantine/core/ActionIcon";const Xe=U3;var TJ=Object.defineProperty,IJ=Object.defineProperties,jJ=Object.getOwnPropertyDescriptors,rg=Object.getOwnPropertySymbols,Z3=Object.prototype.hasOwnProperty,G3=Object.prototype.propertyIsEnumerable,wE=(e,t,n)=>t in e?TJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,DJ=(e,t)=>{for(var n in t||(t={}))Z3.call(t,n)&&wE(e,n,t[n]);if(rg)for(var n of rg(t))G3.call(t,n)&&wE(e,n,t[n]);return e},RJ=(e,t)=>IJ(e,jJ(t)),LJ=(e,t)=>{var n={};for(var r in e)Z3.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&rg)for(var r of rg(e))t.indexOf(r)<0&&G3.call(e,r)&&(n[r]=e[r]);return n};function Y3(e){const t=ae("Portal",{},e),{children:n,target:r,className:o,innerRef:i}=t,s=LJ(t,["children","target","className","innerRef"]),a=ar(),[c,u]=_.useState(!1),f=_.useRef();return $S(()=>(u(!0),f.current=r?typeof r=="string"?document.querySelector(r):r:document.createElement("div"),r||document.body.appendChild(f.current),()=>{!r&&document.body.removeChild(f.current)}),[r]),c?Cs.createPortal(k.createElement("div",RJ(DJ({className:o,dir:a.dir},s),{ref:i}),n),f.current):null}Y3.displayName="@mantine/core/Portal";var zJ=Object.defineProperty,og=Object.getOwnPropertySymbols,K3=Object.prototype.hasOwnProperty,q3=Object.prototype.propertyIsEnumerable,bE=(e,t,n)=>t in e?zJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,AJ=(e,t)=>{for(var n in t||(t={}))K3.call(t,n)&&bE(e,n,t[n]);if(og)for(var n of og(t))q3.call(t,n)&&bE(e,n,t[n]);return e},BJ=(e,t)=>{var n={};for(var r in e)K3.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&og)for(var r of og(e))t.indexOf(r)<0&&q3.call(e,r)&&(n[r]=e[r]);return n};function Zf(e){var t=e,{withinPortal:n=!0,children:r}=t,o=BJ(t,["withinPortal","children"]);return n?k.createElement(Y3,AJ({},o),r):k.createElement(k.Fragment,null,r)}Zf.displayName="@mantine/core/OptionalPortal";var FJ=Object.defineProperty,ig=Object.getOwnPropertySymbols,J3=Object.prototype.hasOwnProperty,Q3=Object.prototype.propertyIsEnumerable,xE=(e,t,n)=>t in e?FJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,SE=(e,t)=>{for(var n in t||(t={}))J3.call(t,n)&&xE(e,n,t[n]);if(ig)for(var n of ig(t))Q3.call(t,n)&&xE(e,n,t[n]);return e},VJ=(e,t)=>{var n={};for(var r in e)J3.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ig)for(var r of ig(e))t.indexOf(r)<0&&Q3.call(e,r)&&(n[r]=e[r]);return n};function X3(e){const t=e,{width:n,height:r,style:o}=t,i=VJ(t,["width","height","style"]);return k.createElement("svg",SE({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:SE({width:n,height:r},o)},i),k.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}X3.displayName="@mantine/core/CloseIcon";var HJ=Object.defineProperty,sg=Object.getOwnPropertySymbols,ez=Object.prototype.hasOwnProperty,tz=Object.prototype.propertyIsEnumerable,PE=(e,t,n)=>t in e?HJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,WJ=(e,t)=>{for(var n in t||(t={}))ez.call(t,n)&&PE(e,n,t[n]);if(sg)for(var n of sg(t))tz.call(t,n)&&PE(e,n,t[n]);return e},UJ=(e,t)=>{var n={};for(var r in e)ez.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&sg)for(var r of sg(e))t.indexOf(r)<0&&tz.call(e,r)&&(n[r]=e[r]);return n};const ZJ={xs:M(12),sm:M(16),md:M(20),lg:M(28),xl:M(34)},GJ={size:"sm"},nz=_.forwardRef((e,t)=>{const n=ae("CloseButton",GJ,e),{iconSize:r,size:o,children:i}=n,s=UJ(n,["iconSize","size","children"]),a=M(r||ZJ[o]);return k.createElement(Xe,WJ({ref:t,__staticSelector:"CloseButton",size:o},s),i||k.createElement(X3,{width:a,height:a}))});nz.displayName="@mantine/core/CloseButton";const D0=nz;var YJ=Object.defineProperty,KJ=Object.defineProperties,qJ=Object.getOwnPropertyDescriptors,OE=Object.getOwnPropertySymbols,JJ=Object.prototype.hasOwnProperty,QJ=Object.prototype.propertyIsEnumerable,CE=(e,t,n)=>t in e?YJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Yh=(e,t)=>{for(var n in t||(t={}))JJ.call(t,n)&&CE(e,n,t[n]);if(OE)for(var n of OE(t))QJ.call(t,n)&&CE(e,n,t[n]);return e},XJ=(e,t)=>KJ(e,qJ(t));function eQ({underline:e,strikethrough:t}){const n=[];return e&&n.push("underline"),t&&n.push("line-through"),n.length>0?n.join(" "):"none"}function tQ({theme:e,color:t}){return t==="dimmed"?e.fn.dimmed():typeof t=="string"&&(t in e.colors||t.split(".")[0]in e.colors)?e.fn.variant({variant:"filled",color:t}).background:t||"inherit"}function nQ(e){return typeof e=="number"?{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:e,WebkitBoxOrient:"vertical"}:null}function rQ({theme:e,truncate:t}){return t==="start"?{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",direction:e.dir==="ltr"?"rtl":"ltr",textAlign:e.dir==="ltr"?"right":"left"}:t?{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}:null}var oQ=ue((e,{color:t,lineClamp:n,truncate:r,inline:o,inherit:i,underline:s,gradient:a,weight:c,transform:u,align:f,strikethrough:h,italic:m},{size:v})=>{const y=e.fn.variant({variant:"gradient",gradient:a});return{root:XJ(Yh(Yh(Yh(Yh({},e.fn.fontStyles()),e.fn.focusStyles()),nQ(n)),rQ({theme:e,truncate:r})),{color:tQ({color:t,theme:e}),fontFamily:i?"inherit":e.fontFamily,fontSize:i||v===void 0?"inherit":re({size:v,sizes:e.fontSizes}),lineHeight:i?"inherit":o?1:e.lineHeight,textDecoration:eQ({underline:s,strikethrough:h}),WebkitTapHighlightColor:"transparent",fontWeight:i?"inherit":c,textTransform:u,textAlign:f,fontStyle:m?"italic":void 0}),gradient:{backgroundImage:y.background,WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"}}});const iQ=oQ;var sQ=Object.defineProperty,ag=Object.getOwnPropertySymbols,rz=Object.prototype.hasOwnProperty,oz=Object.prototype.propertyIsEnumerable,kE=(e,t,n)=>t in e?sQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,aQ=(e,t)=>{for(var n in t||(t={}))rz.call(t,n)&&kE(e,n,t[n]);if(ag)for(var n of ag(t))oz.call(t,n)&&kE(e,n,t[n]);return e},lQ=(e,t)=>{var n={};for(var r in e)rz.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ag)for(var r of ag(e))t.indexOf(r)<0&&oz.call(e,r)&&(n[r]=e[r]);return n};const cQ={variant:"text"},iz=_.forwardRef((e,t)=>{const n=ae("Text",cQ,e),{className:r,size:o,weight:i,transform:s,color:a,align:c,variant:u,lineClamp:f,truncate:h,gradient:m,inline:v,inherit:y,underline:w,strikethrough:P,italic:b,classNames:S,styles:O,unstyled:E,span:$,__staticSelector:N}=n,I=lQ(n,["className","size","weight","transform","color","align","variant","lineClamp","truncate","gradient","inline","inherit","underline","strikethrough","italic","classNames","styles","unstyled","span","__staticSelector"]),{classes:R,cx:B}=iQ({color:a,lineClamp:f,truncate:h,inline:v,inherit:y,underline:w,strikethrough:P,italic:b,weight:i,transform:s,align:c,gradient:m},{unstyled:E,name:N||"Text",variant:u,size:o});return k.createElement(Pe,aQ({ref:t,className:B(R.root,{[R.gradient]:u==="gradient"},r),component:$?"span":"div"},I))});iz.displayName="@mantine/core/Text";const U=iz,sz=_.createContext({zIndex:1e3,fixed:!1,layout:"default"});sz.Provider;function uQ(){return _.useContext(sz)}function az(e,t){if(!e)return[];const n=Object.keys(e).filter(r=>r!=="base").map(r=>[re({size:r,sizes:t.breakpoints,units:"em"}),e[r]]);return n.sort((r,o)=>Bo(r[0])-Bo(o[0])),n}var dQ=Object.defineProperty,fQ=Object.defineProperties,hQ=Object.getOwnPropertyDescriptors,EE=Object.getOwnPropertySymbols,pQ=Object.prototype.hasOwnProperty,mQ=Object.prototype.propertyIsEnumerable,$E=(e,t,n)=>t in e?dQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Kh=(e,t)=>{for(var n in t||(t={}))pQ.call(t,n)&&$E(e,n,t[n]);if(EE)for(var n of EE(t))mQ.call(t,n)&&$E(e,n,t[n]);return e},ME=(e,t)=>fQ(e,hQ(t)),gQ=ue((e,{height:t,width:n,fixed:r,position:o,hiddenBreakpoint:i,zIndex:s,section:a,withBorder:c,layout:u})=>{const f=typeof n=="object"&&n!==null?az(n,e).reduce((m,[v,y])=>(m[`@media (min-width: ${Oa(v)})`]={width:M(y),minWidth:M(y)},m),{}):null,h=c?{[a==="navbar"?"borderRight":"borderLeft"]:`${M(1)} solid ${e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[2]}`}:{};return{root:ME(Kh(Kh(ME(Kh(Kh({},e.fn.fontStyles()),o),{top:u==="alt"?0:o?.top||"var(--mantine-header-height)",bottom:0,zIndex:s,height:t?M(t):u==="alt"?"auto":"calc(100vh - var(--mantine-header-height, 0rem) - var(--mantine-footer-height, 0rem))",width:n?.base?M(n?.base):"100%",position:r?"fixed":"static",boxSizing:"border-box",display:"flex",flexDirection:"column",backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white}),h),f),{"&[data-hidden]":{[`@media (max-width: ${Oa(Bo(re({size:i,sizes:e.breakpoints}))-1)})`]:{display:"none"}}})}});const vQ=gQ;var yQ=Object.defineProperty,lg=Object.getOwnPropertySymbols,lz=Object.prototype.hasOwnProperty,cz=Object.prototype.propertyIsEnumerable,NE=(e,t,n)=>t in e?yQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,TE=(e,t)=>{for(var n in t||(t={}))lz.call(t,n)&&NE(e,n,t[n]);if(lg)for(var n of lg(t))cz.call(t,n)&&NE(e,n,t[n]);return e},_Q=(e,t)=>{var n={};for(var r in e)lz.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&lg)for(var r of lg(e))t.indexOf(r)<0&&cz.call(e,r)&&(n[r]=e[r]);return n};const uz=_.forwardRef((e,t)=>{var n=e,{width:r,height:o,fixed:i=!1,position:s,zIndex:a,hiddenBreakpoint:c="md",hidden:u=!1,withBorder:f=!0,className:h,classNames:m,styles:v,children:y,section:w,__staticSelector:P,unstyled:b,variant:S}=n,O=_Q(n,["width","height","fixed","position","zIndex","hiddenBreakpoint","hidden","withBorder","className","classNames","styles","children","section","__staticSelector","unstyled","variant"]);const E=uQ(),{classes:$,cx:N,theme:I}=vQ({width:r,height:o,fixed:E.fixed||i,position:s,hiddenBreakpoint:c,zIndex:a||E.zIndex||ci("app"),section:w,withBorder:f,layout:E.layout},{classNames:m,styles:v,name:P,unstyled:b,variant:S}),R=az(r,I).reduce((B,[z,G])=>(B[`@media (min-width: ${Oa(z)})`]={[`--mantine-${w}-width`]:M(G)},B),{});return k.createElement(Pe,TE({component:w==="navbar"?"nav":"aside",ref:t,"data-hidden":u||void 0,className:N($.root,h)},O),y,k.createElement(qG,{styles:()=>({":root":TE({[`--mantine-${w}-width`]:r?.base?M(r.base):"0rem"},R)})}))});uz.displayName="@mantine/core/HorizontalSection";var wQ=Object.defineProperty,cg=Object.getOwnPropertySymbols,dz=Object.prototype.hasOwnProperty,fz=Object.prototype.propertyIsEnumerable,IE=(e,t,n)=>t in e?wQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,bQ=(e,t)=>{for(var n in t||(t={}))dz.call(t,n)&&IE(e,n,t[n]);if(cg)for(var n of cg(t))fz.call(t,n)&&IE(e,n,t[n]);return e},xQ=(e,t)=>{var n={};for(var r in e)dz.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&cg)for(var r of cg(e))t.indexOf(r)<0&&fz.call(e,r)&&(n[r]=e[r]);return n};const hz=_.forwardRef((e,t)=>{var n=e,{children:r,grow:o=!1,sx:i}=n,s=xQ(n,["children","grow","sx"]);return k.createElement(Pe,bQ({ref:t,sx:[{flex:o?1:0,boxSizing:"border-box"},...yS(i)]},s),r)});hz.displayName="@mantine/core/Section";const SQ=hz;var PQ=Object.defineProperty,jE=Object.getOwnPropertySymbols,OQ=Object.prototype.hasOwnProperty,CQ=Object.prototype.propertyIsEnumerable,DE=(e,t,n)=>t in e?PQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,kQ=(e,t)=>{for(var n in t||(t={}))OQ.call(t,n)&&DE(e,n,t[n]);if(jE)for(var n of jE(t))CQ.call(t,n)&&DE(e,n,t[n]);return e};const EQ={fixed:!1,position:{top:0,left:0},hiddenBreakpoint:"md",hidden:!1},ug=_.forwardRef((e,t)=>{const n=ae("Navbar",EQ,e);return k.createElement(uz,kQ({section:"navbar",__staticSelector:"Navbar",ref:t},n))});ug.Section=SQ;ug.displayName="@mantine/core/Navbar";const qh={xs:M(1),sm:M(2),md:M(3),lg:M(4),xl:M(5)};function Jh(e,t){const n=e.fn.variant({variant:"outline",color:t}).border;return typeof t=="string"&&(t in e.colors||t.split(".")[0]in e.colors)?n:t===void 0?e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]:t}var $Q=ue((e,{color:t},{size:n,variant:r})=>({root:{},withLabel:{borderTop:"0 !important"},left:{"&::before":{display:"none"}},right:{"&::after":{display:"none"}},label:{display:"flex",alignItems:"center","&::before":{content:'""',flex:1,height:M(1),borderTop:`${re({size:n,sizes:qh})} ${r} ${Jh(e,t)}`,marginRight:e.spacing.xs},"&::after":{content:'""',flex:1,borderTop:`${re({size:n,sizes:qh})} ${r} ${Jh(e,t)}`,marginLeft:e.spacing.xs}},labelDefaultStyles:{color:t==="dark"?e.colors.dark[1]:e.fn.themeColor(t,e.colorScheme==="dark"?5:e.fn.primaryShade(),!1)},horizontal:{border:0,borderTopWidth:M(re({size:n,sizes:qh})),borderTopColor:Jh(e,t),borderTopStyle:r,margin:0},vertical:{border:0,alignSelf:"stretch",height:"auto",borderLeftWidth:M(re({size:n,sizes:qh})),borderLeftColor:Jh(e,t),borderLeftStyle:r}}));const MQ=$Q;var NQ=Object.defineProperty,TQ=Object.defineProperties,IQ=Object.getOwnPropertyDescriptors,dg=Object.getOwnPropertySymbols,pz=Object.prototype.hasOwnProperty,mz=Object.prototype.propertyIsEnumerable,RE=(e,t,n)=>t in e?NQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,LE=(e,t)=>{for(var n in t||(t={}))pz.call(t,n)&&RE(e,n,t[n]);if(dg)for(var n of dg(t))mz.call(t,n)&&RE(e,n,t[n]);return e},jQ=(e,t)=>TQ(e,IQ(t)),DQ=(e,t)=>{var n={};for(var r in e)pz.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&dg)for(var r of dg(e))t.indexOf(r)<0&&mz.call(e,r)&&(n[r]=e[r]);return n};const RQ={orientation:"horizontal",size:"xs",labelPosition:"left",variant:"solid"},Ye=_.forwardRef((e,t)=>{const n=ae("Divider",RQ,e),{className:r,color:o,orientation:i,size:s,label:a,labelPosition:c,labelProps:u,variant:f,styles:h,classNames:m,unstyled:v}=n,y=DQ(n,["className","color","orientation","size","label","labelPosition","labelProps","variant","styles","classNames","unstyled"]),{classes:w,cx:P}=MQ({color:o},{classNames:m,styles:h,unstyled:v,name:"Divider",variant:f,size:s}),b=i==="vertical",S=i==="horizontal",O=!!a&&S,E=!u?.color;return k.createElement(Pe,LE({ref:t,className:P(w.root,{[w.vertical]:b,[w.horizontal]:S,[w.withLabel]:O},r),role:"separator"},y),O&&k.createElement(U,jQ(LE({},u),{size:u?.size||"xs",mt:M(2),className:P(w.label,w[c],{[w.labelDefaultStyles]:E})}),a))});Ye.displayName="@mantine/core/Divider";var LQ=Object.defineProperty,zQ=Object.defineProperties,AQ=Object.getOwnPropertyDescriptors,zE=Object.getOwnPropertySymbols,BQ=Object.prototype.hasOwnProperty,FQ=Object.prototype.propertyIsEnumerable,AE=(e,t,n)=>t in e?LQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,BE=(e,t)=>{for(var n in t||(t={}))BQ.call(t,n)&&AE(e,n,t[n]);if(zE)for(var n of zE(t))FQ.call(t,n)&&AE(e,n,t[n]);return e},VQ=(e,t)=>zQ(e,AQ(t)),HQ=ue((e,t,{size:n})=>({item:VQ(BE({},e.fn.fontStyles()),{boxSizing:"border-box",wordBreak:"break-all",textAlign:"left",width:"100%",padding:`calc(${re({size:n,sizes:e.spacing})} / 1.5) ${re({size:n,sizes:e.spacing})}`,cursor:"pointer",fontSize:re({size:n,sizes:e.fontSizes}),color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,borderRadius:e.fn.radius(),"&[data-hovered]":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[1]},"&[data-selected]":BE({backgroundColor:e.fn.variant({variant:"filled"}).background,color:e.fn.variant({variant:"filled"}).color},e.fn.hover({backgroundColor:e.fn.variant({variant:"filled"}).hover})),"&[data-disabled]":{cursor:"default",color:e.colors.dark[2]}}),nothingFound:{boxSizing:"border-box",color:e.colors.gray[6],paddingTop:`calc(${re({size:n,sizes:e.spacing})} / 2)`,paddingBottom:`calc(${re({size:n,sizes:e.spacing})} / 2)`,textAlign:"center"},separator:{boxSizing:"border-box",textAlign:"left",width:"100%",padding:`calc(${re({size:n,sizes:e.spacing})} / 1.5) ${re({size:n,sizes:e.spacing})}`},separatorLabel:{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]}}));const WQ=HQ;var UQ=Object.defineProperty,FE=Object.getOwnPropertySymbols,ZQ=Object.prototype.hasOwnProperty,GQ=Object.prototype.propertyIsEnumerable,VE=(e,t,n)=>t in e?UQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,YQ=(e,t)=>{for(var n in t||(t={}))ZQ.call(t,n)&&VE(e,n,t[n]);if(FE)for(var n of FE(t))GQ.call(t,n)&&VE(e,n,t[n]);return e};function xP({data:e,hovered:t,classNames:n,styles:r,isItemSelected:o,uuid:i,__staticSelector:s,onItemHover:a,onItemSelect:c,itemsRefs:u,itemComponent:f,size:h,nothingFound:m,creatable:v,createLabel:y,unstyled:w,variant:P}){const{classes:b}=WQ(null,{classNames:n,styles:r,unstyled:w,name:s,variant:P,size:h}),S=[],O=[];let E=null;const $=(I,R)=>{const B=typeof o=="function"?o(I.value):!1;return k.createElement(f,YQ({key:I.value,className:b.item,"data-disabled":I.disabled||void 0,"data-hovered":!I.disabled&&t===R||void 0,"data-selected":!I.disabled&&B||void 0,selected:B,onMouseEnter:()=>a(R),id:`${i}-${R}`,role:"option",tabIndex:-1,"aria-selected":t===R,ref:z=>{u&&u.current&&(u.current[I.value]=z)},onMouseDown:I.disabled?null:z=>{z.preventDefault(),c(I)},disabled:I.disabled,variant:P},I))};let N=null;if(e.forEach((I,R)=>{I.creatable?E=R:I.group?(N!==I.group&&(N=I.group,O.push(k.createElement("div",{className:b.separator,key:`__mantine-divider-${R}`},k.createElement(Ye,{classNames:{label:b.separatorLabel},label:I.group})))),O.push($(I,R))):S.push($(I,R))}),v){const I=e[E];S.push(k.createElement("div",{key:Vc(),className:b.item,"data-hovered":t===E||void 0,onMouseEnter:()=>a(E),onMouseDown:R=>{R.preventDefault(),c(I)},tabIndex:-1,ref:R=>{u&&u.current&&(u.current[I.value]=R)}},y))}return O.length>0&&S.length>0&&S.unshift(k.createElement("div",{className:b.separator,key:"empty-group-separator"},k.createElement(Ye,null))),O.length>0||S.length>0?k.createElement(k.Fragment,null,O,S):k.createElement(U,{size:h,unstyled:w,className:b.nothingFound},m)}xP.displayName="@mantine/core/SelectItems";var KQ=Object.defineProperty,fg=Object.getOwnPropertySymbols,gz=Object.prototype.hasOwnProperty,vz=Object.prototype.propertyIsEnumerable,HE=(e,t,n)=>t in e?KQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qQ=(e,t)=>{for(var n in t||(t={}))gz.call(t,n)&&HE(e,n,t[n]);if(fg)for(var n of fg(t))vz.call(t,n)&&HE(e,n,t[n]);return e},JQ=(e,t)=>{var n={};for(var r in e)gz.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&fg)for(var r of fg(e))t.indexOf(r)<0&&vz.call(e,r)&&(n[r]=e[r]);return n};const SP=_.forwardRef((e,t)=>{var n=e,{label:r,value:o}=n,i=JQ(n,["label","value"]);return k.createElement("div",qQ({ref:t},i),r||o)});SP.displayName="@mantine/core/DefaultItem";function QQ(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function yz(...e){return t=>e.forEach(n=>QQ(n,t))}function Hl(...e){return _.useCallback(yz(...e),e)}const _z=_.forwardRef((e,t)=>{const{children:n,...r}=e,o=_.Children.toArray(n),i=o.find(eX);if(i){const s=i.props.children,a=o.map(c=>c===i?_.Children.count(s)>1?_.Children.only(null):_.isValidElement(s)?s.props.children:null:c);return _.createElement(tx,jt({},r,{ref:t}),_.isValidElement(s)?_.cloneElement(s,void 0,a):null)}return _.createElement(tx,jt({},r,{ref:t}),n)});_z.displayName="Slot";const tx=_.forwardRef((e,t)=>{const{children:n,...r}=e;return _.isValidElement(n)?_.cloneElement(n,{...tX(r,n.props),ref:yz(t,n.ref)}):_.Children.count(n)>1?_.Children.only(null):null});tx.displayName="SlotClone";const XQ=({children:e})=>_.createElement(_.Fragment,null,e);function eX(e){return _.isValidElement(e)&&e.type===XQ}function tX(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const nX=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],Gf=nX.reduce((e,t)=>{const n=_.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?_z:t;return _.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),_.createElement(a,jt({},s,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),nx=globalThis?.document?_.useLayoutEffect:()=>{};function rX(e,t){return _.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const Yf=e=>{const{present:t,children:n}=e,r=oX(t),o=typeof n=="function"?n({present:r.isPresent}):_.Children.only(n),i=Hl(r.ref,o.ref);return typeof n=="function"||r.isPresent?_.cloneElement(o,{ref:i}):null};Yf.displayName="Presence";function oX(e){const[t,n]=_.useState(),r=_.useRef({}),o=_.useRef(e),i=_.useRef("none"),s=e?"mounted":"unmounted",[a,c]=rX(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const u=Qh(r.current);i.current=a==="mounted"?u:"none"},[a]),nx(()=>{const u=r.current,f=o.current;if(f!==e){const m=i.current,v=Qh(u);e?c("MOUNT"):v==="none"||u?.display==="none"?c("UNMOUNT"):c(f&&m!==v?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),nx(()=>{if(t){const u=h=>{const v=Qh(r.current).includes(h.animationName);h.target===t&&v&&Cs.flushSync(()=>c("ANIMATION_END"))},f=h=>{h.target===t&&(i.current=Qh(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:_.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function Qh(e){return e?.animationName||"none"}function iX(e,t=[]){let n=[];function r(i,s){const a=_.createContext(s),c=n.length;n=[...n,s];function u(h){const{scope:m,children:v,...y}=h,w=m?.[e][c]||a,P=_.useMemo(()=>y,Object.values(y));return _.createElement(w.Provider,{value:P},v)}function f(h,m){const v=m?.[e][c]||a,y=_.useContext(v);if(y)return y;if(s!==void 0)return s;throw new Error(`\`${h}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,f]}const o=()=>{const i=n.map(s=>_.createContext(s));return function(a){const c=a?.[e]||i;return _.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return o.scopeName=e,[r,sX(o,...t)]}function sX(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:c,scopeName:u})=>{const h=c(i)[`__scope${u}`];return{...a,...h}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function ol(e){const t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}const aX=_.createContext(void 0);function lX(e){const t=_.useContext(aX);return e||t||"ltr"}function cX(e,[t,n]){return Math.min(n,Math.max(t,e))}function Sl(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function uX(e,t){return _.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const wz="ScrollArea",[bz,cDe]=iX(wz),[dX,Wo]=bz(wz),fX=_.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:i=600,...s}=e,[a,c]=_.useState(null),[u,f]=_.useState(null),[h,m]=_.useState(null),[v,y]=_.useState(null),[w,P]=_.useState(null),[b,S]=_.useState(0),[O,E]=_.useState(0),[$,N]=_.useState(!1),[I,R]=_.useState(!1),B=Hl(t,G=>c(G)),z=lX(o);return _.createElement(dX,{scope:n,type:r,dir:z,scrollHideDelay:i,scrollArea:a,viewport:u,onViewportChange:f,content:h,onContentChange:m,scrollbarX:v,onScrollbarXChange:y,scrollbarXEnabled:$,onScrollbarXEnabledChange:N,scrollbarY:w,onScrollbarYChange:P,scrollbarYEnabled:I,onScrollbarYEnabledChange:R,onCornerWidthChange:S,onCornerHeightChange:E},_.createElement(Gf.div,jt({dir:z},s,{ref:B,style:{position:"relative","--radix-scroll-area-corner-width":b+"px","--radix-scroll-area-corner-height":O+"px",...e.style}})))}),hX="ScrollAreaViewport",pX=_.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,...o}=e,i=Wo(hX,n),s=_.useRef(null),a=Hl(t,s,i.onViewportChange);return _.createElement(_.Fragment,null,_.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"}}),_.createElement(Gf.div,jt({"data-radix-scroll-area-viewport":""},o,{ref:a,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style}}),_.createElement("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"}},r)))}),ks="ScrollAreaScrollbar",mX=_.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Wo(ks,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:s}=o,a=e.orientation==="horizontal";return _.useEffect(()=>(a?i(!0):s(!0),()=>{a?i(!1):s(!1)}),[a,i,s]),o.type==="hover"?_.createElement(gX,jt({},r,{ref:t,forceMount:n})):o.type==="scroll"?_.createElement(vX,jt({},r,{ref:t,forceMount:n})):o.type==="auto"?_.createElement(xz,jt({},r,{ref:t,forceMount:n})):o.type==="always"?_.createElement(PP,jt({},r,{ref:t})):null}),gX=_.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Wo(ks,e.__scopeScrollArea),[i,s]=_.useState(!1);return _.useEffect(()=>{const a=o.scrollArea;let c=0;if(a){const u=()=>{window.clearTimeout(c),s(!0)},f=()=>{c=window.setTimeout(()=>s(!1),o.scrollHideDelay)};return a.addEventListener("pointerenter",u),a.addEventListener("pointerleave",f),()=>{window.clearTimeout(c),a.removeEventListener("pointerenter",u),a.removeEventListener("pointerleave",f)}}},[o.scrollArea,o.scrollHideDelay]),_.createElement(Yf,{present:n||i},_.createElement(xz,jt({"data-state":i?"visible":"hidden"},r,{ref:t})))}),vX=_.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Wo(ks,e.__scopeScrollArea),i=e.orientation==="horizontal",s=L0(()=>c("SCROLL_END"),100),[a,c]=uX("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return _.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>c("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,o.scrollHideDelay,c]),_.useEffect(()=>{const u=o.viewport,f=i?"scrollLeft":"scrollTop";if(u){let h=u[f];const m=()=>{const v=u[f];h!==v&&(c("SCROLL"),s()),h=v};return u.addEventListener("scroll",m),()=>u.removeEventListener("scroll",m)}},[o.viewport,i,c,s]),_.createElement(Yf,{present:n||a!=="hidden"},_.createElement(PP,jt({"data-state":a==="hidden"?"hidden":"visible"},r,{ref:t,onPointerEnter:Sl(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:Sl(e.onPointerLeave,()=>c("POINTER_LEAVE"))})))}),xz=_.forwardRef((e,t)=>{const n=Wo(ks,e.__scopeScrollArea),{forceMount:r,...o}=e,[i,s]=_.useState(!1),a=e.orientation==="horizontal",c=L0(()=>{if(n.viewport){const u=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=e,o=Wo(ks,e.__scopeScrollArea),i=_.useRef(null),s=_.useRef(0),[a,c]=_.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=Cz(a.viewport,a.content),f={...r,sizes:a,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:m=>i.current=m,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:m=>s.current=m};function h(m,v){return OX(m,s.current,a,v)}return n==="horizontal"?_.createElement(yX,jt({},f,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const m=o.viewport.scrollLeft,v=WE(m,a,o.dir);i.current.style.transform=`translate3d(${v}px, 0, 0)`}},onWheelScroll:m=>{o.viewport&&(o.viewport.scrollLeft=m)},onDragScroll:m=>{o.viewport&&(o.viewport.scrollLeft=h(m,o.dir))}})):n==="vertical"?_.createElement(_X,jt({},f,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const m=o.viewport.scrollTop,v=WE(m,a);i.current.style.transform=`translate3d(0, ${v}px, 0)`}},onWheelScroll:m=>{o.viewport&&(o.viewport.scrollTop=m)},onDragScroll:m=>{o.viewport&&(o.viewport.scrollTop=h(m))}})):null}),yX=_.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=Wo(ks,e.__scopeScrollArea),[s,a]=_.useState(),c=_.useRef(null),u=Hl(t,c,i.onScrollbarXChange);return _.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),_.createElement(Pz,jt({"data-orientation":"horizontal"},o,{ref:u,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":R0(n)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.x),onDragScroll:f=>e.onDragScroll(f.x),onWheelScroll:(f,h)=>{if(i.viewport){const m=i.viewport.scrollLeft+f.deltaX;e.onWheelScroll(m),Ez(m,h)&&f.preventDefault()}},onResize:()=>{c.current&&i.viewport&&s&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:hg(s.paddingLeft),paddingEnd:hg(s.paddingRight)}})}}))}),_X=_.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=Wo(ks,e.__scopeScrollArea),[s,a]=_.useState(),c=_.useRef(null),u=Hl(t,c,i.onScrollbarYChange);return _.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),_.createElement(Pz,jt({"data-orientation":"vertical"},o,{ref:u,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":R0(n)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.y),onDragScroll:f=>e.onDragScroll(f.y),onWheelScroll:(f,h)=>{if(i.viewport){const m=i.viewport.scrollTop+f.deltaY;e.onWheelScroll(m),Ez(m,h)&&f.preventDefault()}},onResize:()=>{c.current&&i.viewport&&s&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:hg(s.paddingTop),paddingEnd:hg(s.paddingBottom)}})}}))}),[wX,Sz]=bz(ks),Pz=_.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:i,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:f,onResize:h,...m}=e,v=Wo(ks,n),[y,w]=_.useState(null),P=Hl(t,B=>w(B)),b=_.useRef(null),S=_.useRef(""),O=v.viewport,E=r.content-r.viewport,$=ol(f),N=ol(c),I=L0(h,10);function R(B){if(b.current){const z=B.clientX-b.current.left,G=B.clientY-b.current.top;u({x:z,y:G})}}return _.useEffect(()=>{const B=z=>{const G=z.target;y?.contains(G)&&$(z,E)};return document.addEventListener("wheel",B,{passive:!1}),()=>document.removeEventListener("wheel",B,{passive:!1})},[O,y,E,$]),_.useEffect(N,[r,N]),cu(y,I),cu(v.content,I),_.createElement(wX,{scope:n,scrollbar:y,hasThumb:o,onThumbChange:ol(i),onThumbPointerUp:ol(s),onThumbPositionChange:N,onThumbPointerDown:ol(a)},_.createElement(Gf.div,jt({},m,{ref:P,style:{position:"absolute",...m.style},onPointerDown:Sl(e.onPointerDown,B=>{B.button===0&&(B.target.setPointerCapture(B.pointerId),b.current=y.getBoundingClientRect(),S.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",R(B))}),onPointerMove:Sl(e.onPointerMove,R),onPointerUp:Sl(e.onPointerUp,B=>{const z=B.target;z.hasPointerCapture(B.pointerId)&&z.releasePointerCapture(B.pointerId),document.body.style.webkitUserSelect=S.current,b.current=null})})))}),rx="ScrollAreaThumb",bX=_.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Sz(rx,e.__scopeScrollArea);return _.createElement(Yf,{present:n||o.hasThumb},_.createElement(xX,jt({ref:t},r)))}),xX=_.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,i=Wo(rx,n),s=Sz(rx,n),{onThumbPositionChange:a}=s,c=Hl(t,h=>s.onThumbChange(h)),u=_.useRef(),f=L0(()=>{u.current&&(u.current(),u.current=void 0)},100);return _.useEffect(()=>{const h=i.viewport;if(h){const m=()=>{if(f(),!u.current){const v=CX(h,a);u.current=v,a()}};return a(),h.addEventListener("scroll",m),()=>h.removeEventListener("scroll",m)}},[i.viewport,f,a]),_.createElement(Gf.div,jt({"data-state":s.hasThumb?"visible":"hidden"},o,{ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Sl(e.onPointerDownCapture,h=>{const v=h.target.getBoundingClientRect(),y=h.clientX-v.left,w=h.clientY-v.top;s.onThumbPointerDown({x:y,y:w})}),onPointerUp:Sl(e.onPointerUp,s.onThumbPointerUp)}))}),Oz="ScrollAreaCorner",SX=_.forwardRef((e,t)=>{const n=Wo(Oz,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?_.createElement(PX,jt({},e,{ref:t})):null}),PX=_.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=Wo(Oz,n),[i,s]=_.useState(0),[a,c]=_.useState(0),u=!!(i&&a);return cu(o.scrollbarX,()=>{var f;const h=((f=o.scrollbarX)===null||f===void 0?void 0:f.offsetHeight)||0;o.onCornerHeightChange(h),c(h)}),cu(o.scrollbarY,()=>{var f;const h=((f=o.scrollbarY)===null||f===void 0?void 0:f.offsetWidth)||0;o.onCornerWidthChange(h),s(h)}),u?_.createElement(Gf.div,jt({},r,{ref:t,style:{width:i,height:a,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}})):null});function hg(e){return e?parseInt(e,10):0}function Cz(e,t){const n=e/t;return isNaN(n)?0:n}function R0(e){const t=Cz(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function OX(e,t,n,r="ltr"){const o=R0(n),i=o/2,s=t||i,a=o-s,c=n.scrollbar.paddingStart+s,u=n.scrollbar.size-n.scrollbar.paddingEnd-a,f=n.content-n.viewport,h=r==="ltr"?[0,f]:[f*-1,0];return kz([c,u],h)(e)}function WE(e,t,n="ltr"){const r=R0(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,s=t.content-t.viewport,a=i-r,c=n==="ltr"?[0,s]:[s*-1,0],u=cX(e,c);return kz([0,s],[0,a])(u)}function kz(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Ez(e,t){return e>0&&e{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const i={left:e.scrollLeft,top:e.scrollTop},s=n.left!==i.left,a=n.top!==i.top;(s||a)&&t(),n=i,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function L0(e,t){const n=ol(e),r=_.useRef(0);return _.useEffect(()=>()=>window.clearTimeout(r.current),[]),_.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function cu(e,t){const n=ol(t);nx(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}const kX=fX,EX=pX,UE=mX,ZE=bX,$X=SX;var MX=ue((e,{scrollbarSize:t,offsetScrollbars:n,scrollbarHovered:r,hidden:o})=>({root:{overflow:"hidden"},viewport:{width:"100%",height:"100%",paddingRight:n?M(t):void 0,paddingBottom:n?M(t):void 0},scrollbar:{display:o?"none":"flex",userSelect:"none",touchAction:"none",boxSizing:"border-box",padding:`calc(${M(t)} / 5)`,transition:"background-color 150ms ease, opacity 150ms ease","&:hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[8]:e.colors.gray[0],[`& .${Br("thumb")}`]:{backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.white,.5):e.fn.rgba(e.black,.5)}},'&[data-orientation="vertical"]':{width:M(t)},'&[data-orientation="horizontal"]':{flexDirection:"column",height:M(t)},'&[data-state="hidden"]':{display:"none",opacity:0}},thumb:{ref:Br("thumb"),flex:1,backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.white,.4):e.fn.rgba(e.black,.4),borderRadius:M(t),position:"relative",transition:"background-color 150ms ease",display:o?"none":void 0,overflow:"hidden","&::before":{content:'""',position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"100%",height:"100%",minWidth:M(44),minHeight:M(44)}},corner:{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[0],transition:"opacity 150ms ease",opacity:r?1:0,display:o?"none":void 0}}));const NX=MX;var TX=Object.defineProperty,IX=Object.defineProperties,jX=Object.getOwnPropertyDescriptors,pg=Object.getOwnPropertySymbols,$z=Object.prototype.hasOwnProperty,Mz=Object.prototype.propertyIsEnumerable,GE=(e,t,n)=>t in e?TX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ox=(e,t)=>{for(var n in t||(t={}))$z.call(t,n)&&GE(e,n,t[n]);if(pg)for(var n of pg(t))Mz.call(t,n)&&GE(e,n,t[n]);return e},Nz=(e,t)=>IX(e,jX(t)),Tz=(e,t)=>{var n={};for(var r in e)$z.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&pg)for(var r of pg(e))t.indexOf(r)<0&&Mz.call(e,r)&&(n[r]=e[r]);return n};const Iz={scrollbarSize:12,scrollHideDelay:1e3,type:"hover",offsetScrollbars:!1},z0=_.forwardRef((e,t)=>{const n=ae("ScrollArea",Iz,e),{children:r,className:o,classNames:i,styles:s,scrollbarSize:a,scrollHideDelay:c,type:u,dir:f,offsetScrollbars:h,viewportRef:m,onScrollPositionChange:v,unstyled:y,variant:w,viewportProps:P}=n,b=Tz(n,["children","className","classNames","styles","scrollbarSize","scrollHideDelay","type","dir","offsetScrollbars","viewportRef","onScrollPositionChange","unstyled","variant","viewportProps"]),[S,O]=_.useState(!1),E=ar(),{classes:$,cx:N}=NX({scrollbarSize:a,offsetScrollbars:h,scrollbarHovered:S,hidden:u==="never"},{name:"ScrollArea",classNames:i,styles:s,unstyled:y,variant:w});return k.createElement(kX,{type:u==="never"?"always":u,scrollHideDelay:c,dir:f||E.dir,ref:t,asChild:!0},k.createElement(Pe,ox({className:N($.root,o)},b),k.createElement(EX,Nz(ox({},P),{className:$.viewport,ref:m,onScroll:typeof v=="function"?({currentTarget:I})=>v({x:I.scrollLeft,y:I.scrollTop}):void 0}),r),k.createElement(UE,{orientation:"horizontal",className:$.scrollbar,forceMount:!0,onMouseEnter:()=>O(!0),onMouseLeave:()=>O(!1)},k.createElement(ZE,{className:$.thumb})),k.createElement(UE,{orientation:"vertical",className:$.scrollbar,forceMount:!0,onMouseEnter:()=>O(!0),onMouseLeave:()=>O(!1)},k.createElement(ZE,{className:$.thumb})),k.createElement($X,{className:$.corner})))}),jz=_.forwardRef((e,t)=>{const n=ae("ScrollAreaAutosize",Iz,e),{children:r,classNames:o,styles:i,scrollbarSize:s,scrollHideDelay:a,type:c,dir:u,offsetScrollbars:f,viewportRef:h,onScrollPositionChange:m,unstyled:v,sx:y,variant:w,viewportProps:P}=n,b=Tz(n,["children","classNames","styles","scrollbarSize","scrollHideDelay","type","dir","offsetScrollbars","viewportRef","onScrollPositionChange","unstyled","sx","variant","viewportProps"]);return k.createElement(Pe,Nz(ox({},b),{ref:t,sx:[{display:"flex"},...yS(y)]}),k.createElement(Pe,{sx:{display:"flex",flexDirection:"column",flex:1}},k.createElement(z0,{classNames:o,styles:i,scrollHideDelay:a,scrollbarSize:s,type:c,dir:u,offsetScrollbars:f,viewportRef:h,onScrollPositionChange:m,unstyled:v,variant:w,viewportProps:P},r)))});jz.displayName="@mantine/core/ScrollAreaAutosize";z0.displayName="@mantine/core/ScrollArea";z0.Autosize=jz;const At=z0;var DX=Object.defineProperty,RX=Object.defineProperties,LX=Object.getOwnPropertyDescriptors,mg=Object.getOwnPropertySymbols,Dz=Object.prototype.hasOwnProperty,Rz=Object.prototype.propertyIsEnumerable,YE=(e,t,n)=>t in e?DX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,KE=(e,t)=>{for(var n in t||(t={}))Dz.call(t,n)&&YE(e,n,t[n]);if(mg)for(var n of mg(t))Rz.call(t,n)&&YE(e,n,t[n]);return e},zX=(e,t)=>RX(e,LX(t)),AX=(e,t)=>{var n={};for(var r in e)Dz.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&mg)for(var r of mg(e))t.indexOf(r)<0&&Rz.call(e,r)&&(n[r]=e[r]);return n};const A0=_.forwardRef((e,t)=>{var n=e,{style:r}=n,o=AX(n,["style"]);return k.createElement(At,zX(KE({},o),{style:KE({width:"100%"},r),viewportProps:{tabIndex:-1},viewportRef:t}),o.children)});A0.displayName="@mantine/core/SelectScrollArea";var BX=ue(()=>({dropdown:{},itemsWrapper:{padding:M(4),display:"flex",width:"100%",boxSizing:"border-box"}}));const FX=BX,ii=Math.min,rr=Math.max,gg=Math.round,Xh=Math.floor,Ea=e=>({x:e,y:e}),VX={left:"right",right:"left",bottom:"top",top:"bottom"},HX={start:"end",end:"start"};function ix(e,t,n){return rr(e,ii(t,n))}function _s(e,t){return typeof e=="function"?e(t):e}function si(e){return e.split("-")[0]}function Mu(e){return e.split("-")[1]}function OP(e){return e==="x"?"y":"x"}function CP(e){return e==="y"?"height":"width"}function Wl(e){return["top","bottom"].includes(si(e))?"y":"x"}function kP(e){return OP(Wl(e))}function WX(e,t,n){n===void 0&&(n=!1);const r=Mu(e),o=kP(e),i=CP(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=vg(s)),[s,vg(s)]}function UX(e){const t=vg(e);return[sx(e),t,sx(t)]}function sx(e){return e.replace(/start|end/g,t=>HX[t])}function ZX(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}function GX(e,t,n,r){const o=Mu(e);let i=ZX(si(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(sx)))),i}function vg(e){return e.replace(/left|right|bottom|top/g,t=>VX[t])}function YX(e){return{top:0,right:0,bottom:0,left:0,...e}}function EP(e){return typeof e!="number"?YX(e):{top:e,right:e,bottom:e,left:e}}function uu(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function qE(e,t,n){let{reference:r,floating:o}=e;const i=Wl(t),s=kP(t),a=CP(s),c=si(t),u=i==="y",f=r.x+r.width/2-o.width/2,h=r.y+r.height/2-o.height/2,m=r[a]/2-o[a]/2;let v;switch(c){case"top":v={x:f,y:r.y-o.height};break;case"bottom":v={x:f,y:r.y+r.height};break;case"right":v={x:r.x+r.width,y:h};break;case"left":v={x:r.x-o.width,y:h};break;default:v={x:r.x,y:r.y}}switch(Mu(t)){case"start":v[s]-=m*(n&&u?-1:1);break;case"end":v[s]+=m*(n&&u?-1:1);break}return v}const KX=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:h}=qE(u,r,c),m=r,v={},y=0;for(let w=0;w({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:c}=t,{element:u,padding:f=0}=_s(e,t)||{};if(u==null)return{};const h=EP(f),m={x:n,y:r},v=kP(o),y=CP(v),w=await s.getDimensions(u),P=v==="y",b=P?"top":"left",S=P?"bottom":"right",O=P?"clientHeight":"clientWidth",E=i.reference[y]+i.reference[v]-m[v]-i.floating[y],$=m[v]-i.reference[v],N=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let I=N?N[O]:0;(!I||!await(s.isElement==null?void 0:s.isElement(N)))&&(I=a.floating[O]||i.floating[y]);const R=E/2-$/2,B=I/2-w[y]/2-1,z=ii(h[b],B),G=ii(h[S],B),Q=z,X=I-w[y]-G,V=I/2-w[y]/2+R,H=ix(Q,V,X),Z=!c.arrow&&Mu(o)!=null&&V!=H&&i.reference[y]/2-(VQ<=0)){var B,z;const Q=(((B=i.flip)==null?void 0:B.index)||0)+1,X=$[Q];if(X)return{data:{index:Q,overflows:R},reset:{placement:X}};let V=(z=R.filter(H=>H.overflows[0]<=0).sort((H,Z)=>H.overflows[1]-Z.overflows[1])[0])==null?void 0:z.placement;if(!V)switch(v){case"bestFit":{var G;const H=(G=R.map(Z=>[Z.placement,Z.overflows.filter(Y=>Y>0).reduce((Y,j)=>Y+j,0)]).sort((Z,Y)=>Z[1]-Y[1])[0])==null?void 0:G[0];H&&(V=H);break}case"initialPlacement":V=a;break}if(o!==V)return{reset:{placement:V}}}return{}}}};function zz(e){const t=ii(...e.map(i=>i.left)),n=ii(...e.map(i=>i.top)),r=rr(...e.map(i=>i.right)),o=rr(...e.map(i=>i.bottom));return{x:t,y:n,width:r-t,height:o-n}}function qX(e){const t=e.slice().sort((o,i)=>o.y-i.y),n=[];let r=null;for(let o=0;or.height/2?n.push([i]):n[n.length-1].push(i),r=i}return n.map(o=>uu(zz(o)))}const Az=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:o,platform:i,strategy:s}=t,{padding:a=2,x:c,y:u}=_s(e,t),f=Array.from(await(i.getClientRects==null?void 0:i.getClientRects(r.reference))||[]),h=qX(f),m=uu(zz(f)),v=EP(a);function y(){if(h.length===2&&h[0].left>h[1].right&&c!=null&&u!=null)return h.find(P=>c>P.left-v.left&&cP.top-v.top&&u=2){if(Wl(n)==="y"){const z=h[0],G=h[h.length-1],Q=si(n)==="top",X=z.top,V=G.bottom,H=Q?z.left:G.left,Z=Q?z.right:G.right,Y=Z-H,j=V-X;return{top:X,bottom:V,left:H,right:Z,width:Y,height:j,x:H,y:X}}const P=si(n)==="left",b=rr(...h.map(z=>z.right)),S=ii(...h.map(z=>z.left)),O=h.filter(z=>P?z.left===S:z.right===b),E=O[0].top,$=O[O.length-1].bottom,N=S,I=b,R=I-N,B=$-E;return{top:E,bottom:$,left:N,right:I,width:R,height:B,x:N,y:E}}return m}const w=await i.getElementRects({reference:{getBoundingClientRect:y},floating:r.floating,strategy:s});return o.reference.x!==w.reference.x||o.reference.y!==w.reference.y||o.reference.width!==w.reference.width||o.reference.height!==w.reference.height?{reset:{rects:w}}:{}}}};async function JX(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=si(n),a=Mu(n),c=Wl(n)==="y",u=["left","top"].includes(s)?-1:1,f=i&&c?-1:1,h=_s(t,e);let{mainAxis:m,crossAxis:v,alignmentAxis:y}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...h};return a&&typeof y=="number"&&(v=a==="end"?y*-1:y),c?{x:v*f,y:m*u}:{x:m*u,y:v*f}}const Bz=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await JX(t,e);return{x:n+o.x,y:r+o.y,data:o}}}},MP=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:P=>{let{x:b,y:S}=P;return{x:b,y:S}}},...c}=_s(e,t),u={x:n,y:r},f=await $P(t,c),h=Wl(si(o)),m=OP(h);let v=u[m],y=u[h];if(i){const P=m==="y"?"top":"left",b=m==="y"?"bottom":"right",S=v+f[P],O=v-f[b];v=ix(S,v,O)}if(s){const P=h==="y"?"top":"left",b=h==="y"?"bottom":"right",S=y+f[P],O=y-f[b];y=ix(S,y,O)}const w=a.fn({...t,[m]:v,[h]:y});return{...w,data:{x:w.x-n,y:w.y-r}}}}},QX=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:c=!0,crossAxis:u=!0}=_s(e,t),f={x:n,y:r},h=Wl(o),m=OP(h);let v=f[m],y=f[h];const w=_s(a,t),P=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(c){const O=m==="y"?"height":"width",E=i.reference[m]-i.floating[O]+P.mainAxis,$=i.reference[m]+i.reference[O]-P.mainAxis;v$&&(v=$)}if(u){var b,S;const O=m==="y"?"width":"height",E=["top","left"].includes(si(o)),$=i.reference[h]-i.floating[O]+(E&&((b=s.offset)==null?void 0:b[h])||0)+(E?0:P.crossAxis),N=i.reference[h]+i.reference[O]+(E?0:((S=s.offset)==null?void 0:S[h])||0)-(E?P.crossAxis:0);y<$?y=$:y>N&&(y=N)}return{[m]:v,[h]:y}}}},XX=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:s=()=>{},...a}=_s(e,t),c=await $P(t,a),u=si(n),f=Mu(n),h=Wl(n)==="y",{width:m,height:v}=r.floating;let y,w;u==="top"||u==="bottom"?(y=u,w=f===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(w=u,y=f==="end"?"top":"bottom");const P=v-c[y],b=m-c[w],S=!t.middlewareData.shift;let O=P,E=b;if(h){const N=m-c.left-c.right;E=f||S?ii(b,N):N}else{const N=v-c.top-c.bottom;O=f||S?ii(P,N):N}if(S&&!f){const N=rr(c.left,0),I=rr(c.right,0),R=rr(c.top,0),B=rr(c.bottom,0);h?E=m-2*(N!==0||I!==0?N+I:rr(c.left,c.right)):O=v-2*(R!==0||B!==0?R+B:rr(c.top,c.bottom))}await s({...t,availableWidth:E,availableHeight:O});const $=await o.getDimensions(i.floating);return m!==$.width||v!==$.height?{reset:{rects:!0}}:{}}}};function $a(e){return Fz(e)?(e.nodeName||"").toLowerCase():"#document"}function vo(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Es(e){var t;return(t=(Fz(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Fz(e){return e instanceof Node||e instanceof vo(e).Node}function ws(e){return e instanceof Element||e instanceof vo(e).Element}function Li(e){return e instanceof HTMLElement||e instanceof vo(e).HTMLElement}function QE(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof vo(e).ShadowRoot}function Kf(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ho(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function eee(e){return["table","td","th"].includes($a(e))}function NP(e){const t=TP(),n=Ho(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function tee(e){let t=du(e);for(;Li(t)&&!B0(t);){if(NP(t))return t;t=du(t)}return null}function TP(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function B0(e){return["html","body","#document"].includes($a(e))}function Ho(e){return vo(e).getComputedStyle(e)}function F0(e){return ws(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function du(e){if($a(e)==="html")return e;const t=e.assignedSlot||e.parentNode||QE(e)&&e.host||Es(e);return QE(t)?t.host:t}function Vz(e){const t=du(e);return B0(t)?e.ownerDocument?e.ownerDocument.body:e.body:Li(t)&&Kf(t)?t:Vz(t)}function hs(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Vz(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=vo(o);return i?t.concat(s,s.visualViewport||[],Kf(o)?o:[],s.frameElement&&n?hs(s.frameElement):[]):t.concat(o,hs(o,[],n))}function Hz(e){const t=Ho(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Li(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=gg(n)!==i||gg(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function IP(e){return ws(e)?e:e.contextElement}function Kc(e){const t=IP(e);if(!Li(t))return Ea(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Hz(t);let s=(i?gg(n.width):n.width)/r,a=(i?gg(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const nee=Ea(0);function Wz(e){const t=vo(e);return!TP()||!t.visualViewport?nee:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ree(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==vo(e)?!1:t}function jl(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=IP(e);let s=Ea(1);t&&(r?ws(r)&&(s=Kc(r)):s=Kc(e));const a=ree(i,n,r)?Wz(i):Ea(0);let c=(o.left+a.x)/s.x,u=(o.top+a.y)/s.y,f=o.width/s.x,h=o.height/s.y;if(i){const m=vo(i),v=r&&ws(r)?vo(r):r;let y=m.frameElement;for(;y&&r&&v!==m;){const w=Kc(y),P=y.getBoundingClientRect(),b=Ho(y),S=P.left+(y.clientLeft+parseFloat(b.paddingLeft))*w.x,O=P.top+(y.clientTop+parseFloat(b.paddingTop))*w.y;c*=w.x,u*=w.y,f*=w.x,h*=w.y,c+=S,u+=O,y=vo(y).frameElement}}return uu({width:f,height:h,x:c,y:u})}function oee(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=Li(n),i=Es(n);if(n===i)return t;let s={scrollLeft:0,scrollTop:0},a=Ea(1);const c=Ea(0);if((o||!o&&r!=="fixed")&&(($a(n)!=="body"||Kf(i))&&(s=F0(n)),Li(n))){const u=jl(n);a=Kc(n),c.x=u.x+n.clientLeft,c.y=u.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-s.scrollLeft*a.x+c.x,y:t.y*a.y-s.scrollTop*a.y+c.y}}function iee(e){return Array.from(e.getClientRects())}function Uz(e){return jl(Es(e)).left+F0(e).scrollLeft}function see(e){const t=Es(e),n=F0(e),r=e.ownerDocument.body,o=rr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=rr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Uz(e);const a=-n.scrollTop;return Ho(r).direction==="rtl"&&(s+=rr(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function aee(e,t){const n=vo(e),r=Es(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,c=0;if(o){i=o.width,s=o.height;const u=TP();(!u||u&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}return{width:i,height:s,x:a,y:c}}function lee(e,t){const n=jl(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Li(e)?Kc(e):Ea(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,c=o*i.x,u=r*i.y;return{width:s,height:a,x:c,y:u}}function XE(e,t,n){let r;if(t==="viewport")r=aee(e,n);else if(t==="document")r=see(Es(e));else if(ws(t))r=lee(t,n);else{const o=Wz(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return uu(r)}function Zz(e,t){const n=du(e);return n===t||!ws(n)||B0(n)?!1:Ho(n).position==="fixed"||Zz(n,t)}function cee(e,t){const n=t.get(e);if(n)return n;let r=hs(e,[],!1).filter(a=>ws(a)&&$a(a)!=="body"),o=null;const i=Ho(e).position==="fixed";let s=i?du(e):e;for(;ws(s)&&!B0(s);){const a=Ho(s),c=NP(s);!c&&a.position==="fixed"&&(o=null),(i?!c&&!o:!c&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Kf(s)&&!c&&Zz(e,s))?r=r.filter(f=>f!==s):o=a,s=du(s)}return t.set(e,r),r}function uee(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?cee(t,this._c):[].concat(n),r],a=s[0],c=s.reduce((u,f)=>{const h=XE(t,f,o);return u.top=rr(h.top,u.top),u.right=ii(h.right,u.right),u.bottom=ii(h.bottom,u.bottom),u.left=rr(h.left,u.left),u},XE(t,a,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function dee(e){return Hz(e)}function fee(e,t,n){const r=Li(t),o=Es(t),i=n==="fixed",s=jl(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const c=Ea(0);if(r||!r&&!i)if(($a(t)!=="body"||Kf(o))&&(a=F0(t)),r){const u=jl(t,!0,i,t);c.x=u.x+t.clientLeft,c.y=u.y+t.clientTop}else o&&(c.x=Uz(o));return{x:s.left+a.scrollLeft-c.x,y:s.top+a.scrollTop-c.y,width:s.width,height:s.height}}function e$(e,t){return!Li(e)||Ho(e).position==="fixed"?null:t?t(e):e.offsetParent}function Gz(e,t){const n=vo(e);if(!Li(e))return n;let r=e$(e,t);for(;r&&eee(r)&&Ho(r).position==="static";)r=e$(r,t);return r&&($a(r)==="html"||$a(r)==="body"&&Ho(r).position==="static"&&!NP(r))?n:r||tee(e)||n}const hee=async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||Gz,i=this.getDimensions;return{reference:fee(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}};function pee(e){return Ho(e).direction==="rtl"}const mee={convertOffsetParentRelativeRectToViewportRelativeRect:oee,getDocumentElement:Es,getClippingRect:uee,getOffsetParent:Gz,getElementRects:hee,getClientRects:iee,getDimensions:dee,getScale:Kc,isElement:ws,isRTL:pee};function gee(e,t){let n=null,r;const o=Es(e);function i(){clearTimeout(r),n&&n.disconnect(),n=null}function s(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),i();const{left:u,top:f,width:h,height:m}=e.getBoundingClientRect();if(a||t(),!h||!m)return;const v=Xh(f),y=Xh(o.clientWidth-(u+h)),w=Xh(o.clientHeight-(f+m)),P=Xh(u),S={rootMargin:-v+"px "+-y+"px "+-w+"px "+-P+"px",threshold:rr(0,ii(1,c))||1};let O=!0;function E($){const N=$[0].intersectionRatio;if(N!==c){if(!O)return s();N?s(!1,N):r=setTimeout(()=>{s(!1,1e-7)},100)}O=!1}try{n=new IntersectionObserver(E,{...S,root:o.ownerDocument})}catch{n=new IntersectionObserver(E,S)}n.observe(e)}return s(!0),i}function vee(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=IP(e),f=o||i?[...u?hs(u):[],...hs(t)]:[];f.forEach(b=>{o&&b.addEventListener("scroll",n,{passive:!0}),i&&b.addEventListener("resize",n)});const h=u&&a?gee(u,n):null;let m=-1,v=null;s&&(v=new ResizeObserver(b=>{let[S]=b;S&&S.target===u&&v&&(v.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{v&&v.observe(t)})),n()}),u&&!c&&v.observe(u),v.observe(t));let y,w=c?jl(e):null;c&&P();function P(){const b=jl(e);w&&(b.x!==w.x||b.y!==w.y||b.width!==w.width||b.height!==w.height)&&n(),w=b,y=requestAnimationFrame(P)}return n(),()=>{f.forEach(b=>{o&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),h&&h(),v&&v.disconnect(),v=null,c&&cancelAnimationFrame(y)}}const yee=(e,t,n)=>{const r=new Map,o={platform:mee,...n},i={...o.platform,_c:r};return KX(e,t,{...o,platform:i})},Yz=e=>{const{element:t,padding:n}=e;function r(o){return Object.prototype.hasOwnProperty.call(o,"current")}return{name:"arrow",options:e,fn(o){return r(t)?t.current!=null?JE({element:t.current,padding:n}).fn(o):{}:t?JE({element:t,padding:n}).fn(o):{}}}};var Jp=typeof document<"u"?_.useLayoutEffect:_.useEffect;function yg(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!yg(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!yg(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function t$(e){const t=_.useRef(e);return Jp(()=>{t.current=e}),t}function _ee(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,whileElementsMounted:i,open:s}=e,[a,c]=_.useState({x:null,y:null,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[u,f]=_.useState(r);yg(u,r)||f(r);const h=_.useRef(null),m=_.useRef(null),v=_.useRef(a),y=t$(i),w=t$(o),[P,b]=_.useState(null),[S,O]=_.useState(null),E=_.useCallback(z=>{h.current!==z&&(h.current=z,b(z))},[]),$=_.useCallback(z=>{m.current!==z&&(m.current=z,O(z))},[]),N=_.useCallback(()=>{if(!h.current||!m.current)return;const z={placement:t,strategy:n,middleware:u};w.current&&(z.platform=w.current),yee(h.current,m.current,z).then(G=>{const Q={...G,isPositioned:!0};I.current&&!yg(v.current,Q)&&(v.current=Q,Cs.flushSync(()=>{c(Q)}))})},[u,t,n,w]);Jp(()=>{s===!1&&v.current.isPositioned&&(v.current.isPositioned=!1,c(z=>({...z,isPositioned:!1})))},[s]);const I=_.useRef(!1);Jp(()=>(I.current=!0,()=>{I.current=!1}),[]),Jp(()=>{if(P&&S){if(y.current)return y.current(P,S,N);N()}},[P,S,N,y]);const R=_.useMemo(()=>({reference:h,floating:m,setReference:E,setFloating:$}),[E,$]),B=_.useMemo(()=>({reference:P,floating:S}),[P,S]);return _.useMemo(()=>({...a,update:N,refs:R,elements:B,reference:E,floating:$}),[a,N,R,B,E,$])}var fu=typeof document<"u"?_.useLayoutEffect:_.useEffect;let A_=!1,wee=0;const n$=()=>"floating-ui-"+wee++;function bee(){const[e,t]=_.useState(()=>A_?n$():void 0);return fu(()=>{e==null&&t(n$())},[]),_.useEffect(()=>{A_||(A_=!0)},[]),e}const xee=Jd["useId".toString()],r$=xee||bee;function See(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){e.set(t,(e.get(t)||[]).filter(r=>r!==n))}}}const Pee=_.createContext(null),Oee=_.createContext(null),Kz=()=>{var e;return((e=_.useContext(Pee))==null?void 0:e.id)||null},jP=()=>_.useContext(Oee);function na(e){return e?.ownerDocument||document}function Cee(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function kee(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function DP(e){return na(e).defaultView||window}function Ni(e){return e?e instanceof DP(e).Element:!1}function qz(e){return e?e instanceof DP(e).HTMLElement:!1}function Eee(e){if(typeof ShadowRoot>"u")return!1;const t=DP(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function $ee(e){if(e.mozInputSource===0&&e.isTrusted)return!0;const t=/Android/i;return(t.test(Cee())||t.test(kee()))&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Mee(e){return e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType!=="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0}function Jz(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function o$(e){const t=_.useRef(e);return fu(()=>{t.current=e}),t}const i$="data-floating-ui-safe-polygon";function Qp(e,t,n){return n&&!Jz(n)?0:typeof e=="number"?e:e?.[t]}const Nee=function(e,t){let{enabled:n=!0,delay:r=0,handleClose:o=null,mouseOnly:i=!1,restMs:s=0,move:a=!0}=t===void 0?{}:t;const{open:c,onOpenChange:u,dataRef:f,events:h,elements:{domReference:m,floating:v},refs:y}=e,w=jP(),P=Kz(),b=o$(o),S=o$(r),O=_.useRef(),E=_.useRef(),$=_.useRef(),N=_.useRef(),I=_.useRef(!0),R=_.useRef(!1),B=_.useRef(()=>{}),z=_.useCallback(()=>{var V;const H=(V=f.current.openEvent)==null?void 0:V.type;return H?.includes("mouse")&&H!=="mousedown"},[f]);_.useEffect(()=>{if(!n)return;function V(){clearTimeout(E.current),clearTimeout(N.current),I.current=!0}return h.on("dismiss",V),()=>{h.off("dismiss",V)}},[n,h]),_.useEffect(()=>{if(!n||!b.current||!c)return;function V(){z()&&u(!1)}const H=na(v).documentElement;return H.addEventListener("mouseleave",V),()=>{H.removeEventListener("mouseleave",V)}},[v,c,u,n,b,f,z]);const G=_.useCallback(function(V){V===void 0&&(V=!0);const H=Qp(S.current,"close",O.current);H&&!$.current?(clearTimeout(E.current),E.current=setTimeout(()=>u(!1),H)):V&&(clearTimeout(E.current),u(!1))},[S,u]),Q=_.useCallback(()=>{B.current(),$.current=void 0},[]),X=_.useCallback(()=>{if(R.current){const V=na(y.floating.current).body;V.style.pointerEvents="",V.removeAttribute(i$),R.current=!1}},[y]);return _.useEffect(()=>{if(!n)return;function V(){return f.current.openEvent?["click","mousedown"].includes(f.current.openEvent.type):!1}function H(j){if(clearTimeout(E.current),I.current=!1,i&&!Jz(O.current)||s>0&&Qp(S.current,"open")===0)return;f.current.openEvent=j;const W=Qp(S.current,"open",O.current);W?E.current=setTimeout(()=>{u(!0)},W):u(!0)}function Z(j){if(V())return;B.current();const W=na(v);if(clearTimeout(N.current),b.current){c||clearTimeout(E.current),$.current=b.current({...e,tree:w,x:j.clientX,y:j.clientY,onClose(){X(),Q(),G()}});const F=$.current;W.addEventListener("mousemove",F),B.current=()=>{W.removeEventListener("mousemove",F)};return}G()}function Y(j){V()||b.current==null||b.current({...e,tree:w,x:j.clientX,y:j.clientY,onClose(){X(),Q(),G()}})(j)}if(Ni(m)){const j=m;return c&&j.addEventListener("mouseleave",Y),v?.addEventListener("mouseleave",Y),a&&j.addEventListener("mousemove",H,{once:!0}),j.addEventListener("mouseenter",H),j.addEventListener("mouseleave",Z),()=>{c&&j.removeEventListener("mouseleave",Y),v?.removeEventListener("mouseleave",Y),a&&j.removeEventListener("mousemove",H),j.removeEventListener("mouseenter",H),j.removeEventListener("mouseleave",Z)}}},[m,v,n,e,i,s,a,G,Q,X,u,c,w,S,b,f]),fu(()=>{var V;if(n&&c&&(V=b.current)!=null&&V.__options.blockPointerEvents&&z()){const Y=na(v).body;if(Y.setAttribute(i$,""),Y.style.pointerEvents="none",R.current=!0,Ni(m)&&v){var H,Z;const j=m,W=w==null||(H=w.nodesRef.current.find(F=>F.id===P))==null||(Z=H.context)==null?void 0:Z.elements.floating;return W&&(W.style.pointerEvents=""),j.style.pointerEvents="auto",v.style.pointerEvents="auto",()=>{j.style.pointerEvents="",v.style.pointerEvents=""}}}},[n,c,P,v,m,w,b,f,z]),fu(()=>{c||(O.current=void 0,Q(),X())},[c,Q,X]),_.useEffect(()=>()=>{Q(),clearTimeout(E.current),clearTimeout(N.current),X()},[n,Q,X]),_.useMemo(()=>{if(!n)return{};function V(H){O.current=H.pointerType}return{reference:{onPointerDown:V,onPointerEnter:V,onMouseMove(){c||s===0||(clearTimeout(N.current),N.current=setTimeout(()=>{I.current||u(!0)},s))}},floating:{onMouseEnter(){clearTimeout(E.current)},onMouseLeave(){h.emit("dismiss",{type:"mouseLeave",data:{returnFocus:!1}}),G(!1)}}}},[h,n,s,c,u,G])},Qz=_.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:()=>{},setState:()=>{},isInstantPhase:!1}),Xz=()=>_.useContext(Qz),Tee=e=>{let{children:t,delay:n,timeoutMs:r=0}=e;const[o,i]=_.useReducer((c,u)=>({...c,...u}),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),s=_.useRef(null),a=_.useCallback(c=>{i({currentId:c})},[]);return fu(()=>{o.currentId?s.current===null?s.current=o.currentId:i({isInstantPhase:!0}):(i({isInstantPhase:!1}),s.current=null)},[o.currentId]),_.createElement(Qz.Provider,{value:_.useMemo(()=>({...o,setState:i,setCurrentId:a}),[o,i,a])},t)},Iee=(e,t)=>{let{open:n,onOpenChange:r}=e,{id:o}=t;const{currentId:i,setCurrentId:s,initialDelay:a,setState:c,timeoutMs:u}=Xz();_.useEffect(()=>{i&&(c({delay:{open:1,close:Qp(a,"close")}}),i!==o&&r(!1))},[o,r,c,i,a]),_.useEffect(()=>{function f(){r(!1),c({delay:a,currentId:null})}if(!n&&i===o)if(u){const h=window.setTimeout(f,u);return()=>{clearTimeout(h)}}else f()},[n,c,i,o,r,a,u]),_.useEffect(()=>{n&&s(o)},[n,s,o])};function jee(e){let t=e.activeElement;for(;((n=t)==null||(r=n.shadowRoot)==null?void 0:r.activeElement)!=null;){var n,r;t=t.shadowRoot.activeElement}return t}function s$(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Eee(n)){let r=t;do{if(r&&e===r)return!0;r=r.parentNode||r.host}while(r)}return!1}function B_(e,t){let n=e.filter(o=>{var i;return o.parentId===t&&((i=o.context)==null?void 0:i.open)})||[],r=n;for(;r.length;)r=e.filter(o=>{var i;return(i=r)==null?void 0:i.some(s=>{var a;return o.parentId===s.id&&((a=o.context)==null?void 0:a.open)})})||[],n=n.concat(r);return n}function Dee(e){return"composedPath"in e?e.composedPath()[0]:e.target}const Ree=Jd["useInsertionEffect".toString()],Lee=Ree||(e=>e());function eA(e){const t=_.useRef(()=>{});return Lee(()=>{t.current=e}),_.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o!1),$=typeof m=="function"?E:m,N=_.useRef(!1),{escapeKeyBubbles:I,outsidePressBubbles:R}=Bee(b);return _.useEffect(()=>{if(!n||!f)return;u.current.__escapeKeyBubbles=I,u.current.__outsidePressBubbles=R;function B(V){if(V.key==="Escape"){const H=S?B_(S.nodesRef.current,i):[];if(H.length>0){let Z=!0;if(H.forEach(Y=>{var j;if((j=Y.context)!=null&&j.open&&!Y.context.dataRef.current.__escapeKeyBubbles){Z=!1;return}}),!Z)return}o.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),r(!1)}}function z(V){const H=N.current;if(N.current=!1,H||typeof $=="function"&&!$(V))return;const Z=Dee(V);if(qz(Z)&&c){const W=c.ownerDocument.defaultView||window,F=Z.scrollWidth>Z.clientWidth,K=Z.scrollHeight>Z.clientHeight;let ee=K&&V.offsetX>Z.clientWidth;if(K&&W.getComputedStyle(Z).direction==="rtl"&&(ee=V.offsetX<=Z.offsetWidth-Z.clientWidth),ee||F&&V.offsetY>Z.clientHeight)return}const Y=S&&B_(S.nodesRef.current,i).some(W=>{var F;return Xp(V,(F=W.context)==null?void 0:F.elements.floating)});if(Xp(V,c)||Xp(V,a)||Y)return;const j=S?B_(S.nodesRef.current,i):[];if(j.length>0){let W=!0;if(j.forEach(F=>{var K;if((K=F.context)!=null&&K.open&&!F.context.dataRef.current.__outsidePressBubbles){W=!1;return}}),!W)return}o.emit("dismiss",{type:"outsidePress",data:{returnFocus:O?{preventScroll:!0}:$ee(V)||Mee(V)}}),r(!1)}function G(){r(!1)}const Q=na(c);h&&Q.addEventListener("keydown",B),$&&Q.addEventListener(v,z);let X=[];return P&&(Ni(a)&&(X=hs(a)),Ni(c)&&(X=X.concat(hs(c))),!Ni(s)&&s&&s.contextElement&&(X=X.concat(hs(s.contextElement)))),X=X.filter(V=>{var H;return V!==((H=Q.defaultView)==null?void 0:H.visualViewport)}),X.forEach(V=>{V.addEventListener("scroll",G,{passive:!0})}),()=>{h&&Q.removeEventListener("keydown",B),$&&Q.removeEventListener(v,z),X.forEach(V=>{V.removeEventListener("scroll",G)})}},[u,c,a,s,h,$,v,o,S,i,n,r,P,f,I,R,O]),_.useEffect(()=>{N.current=!1},[$,v]),_.useMemo(()=>f?{reference:{[zee[w]]:()=>{y&&(o.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),r(!1))}},floating:{[Aee[v]]:()=>{N.current=!0}}}:{},[f,o,y,v,w,r])},Vee=function(e,t){let{open:n,onOpenChange:r,dataRef:o,events:i,refs:s,elements:{floating:a,domReference:c}}=e,{enabled:u=!0,keyboardOnly:f=!0}=t===void 0?{}:t;const h=_.useRef(""),m=_.useRef(!1),v=_.useRef();return _.useEffect(()=>{if(!u)return;const w=na(a).defaultView||window;function P(){!n&&qz(c)&&c===jee(na(c))&&(m.current=!0)}return w.addEventListener("blur",P),()=>{w.removeEventListener("blur",P)}},[a,c,n,u]),_.useEffect(()=>{if(!u)return;function y(w){(w.type==="referencePress"||w.type==="escapeKey")&&(m.current=!0)}return i.on("dismiss",y),()=>{i.off("dismiss",y)}},[i,u]),_.useEffect(()=>()=>{clearTimeout(v.current)},[]),_.useMemo(()=>u?{reference:{onPointerDown(y){let{pointerType:w}=y;h.current=w,m.current=!!(w&&f)},onMouseLeave(){m.current=!1},onFocus(y){var w;m.current||y.type==="focus"&&((w=o.current.openEvent)==null?void 0:w.type)==="mousedown"&&o.current.openEvent&&Xp(o.current.openEvent,c)||(o.current.openEvent=y.nativeEvent,r(!0))},onBlur(y){m.current=!1;const w=y.relatedTarget,P=Ni(w)&&w.hasAttribute("data-floating-ui-focus-guard")&&w.getAttribute("data-type")==="outside";v.current=setTimeout(()=>{s$(s.floating.current,w)||s$(c,w)||P||r(!1)})}}}:{},[u,f,c,s,o,r])},Hee=function(e,t){let{open:n}=e,{enabled:r=!0,role:o="dialog"}=t===void 0?{}:t;const i=r$(),s=r$();return _.useMemo(()=>{const a={id:i,role:o};return r?o==="tooltip"?{reference:{"aria-describedby":n?i:void 0},floating:a}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":o==="alertdialog"?"dialog":o,"aria-controls":n?i:void 0,...o==="listbox"&&{role:"combobox"},...o==="menu"&&{id:s}},floating:{...a,...o==="menu"&&{"aria-labelledby":s}}}:{}},[r,o,n,i,s])};function RP(e){e===void 0&&(e={});const{open:t=!1,onOpenChange:n,nodeId:r}=e,o=_ee(e),i=jP(),s=_.useRef(null),a=_.useRef({}),c=_.useState(()=>See())[0],[u,f]=_.useState(null),h=_.useCallback(b=>{const S=Ni(b)?{getBoundingClientRect:()=>b.getBoundingClientRect(),contextElement:b}:b;o.refs.setReference(S)},[o.refs]),m=_.useCallback(b=>{(Ni(b)||b===null)&&(s.current=b,f(b)),(Ni(o.refs.reference.current)||o.refs.reference.current===null||b!==null&&!Ni(b))&&o.refs.setReference(b)},[o.refs]),v=_.useMemo(()=>({...o.refs,setReference:m,setPositionReference:h,domReference:s}),[o.refs,m,h]),y=_.useMemo(()=>({...o.elements,domReference:u}),[o.elements,u]),w=eA(n),P=_.useMemo(()=>({...o,refs:v,elements:y,dataRef:a,nodeId:r,events:c,open:t,onOpenChange:w}),[o,r,c,t,w,v,y]);return fu(()=>{const b=i?.nodesRef.current.find(S=>S.id===r);b&&(b.context=P)}),_.useMemo(()=>({...o,context:P,refs:v,reference:m,positionReference:h}),[o,v,P,m,h])}function F_(e,t,n){const r=new Map;return{...n==="floating"&&{tabIndex:-1},...e,...t.map(o=>o?o[n]:null).concat(e).reduce((o,i)=>(i&&Object.entries(i).forEach(s=>{let[a,c]=s;if(a.indexOf("on")===0){if(r.has(a)||r.set(a,[]),typeof c=="function"){var u;(u=r.get(a))==null||u.push(c),o[a]=function(){for(var f,h=arguments.length,m=new Array(h),v=0;vy(...m))}}}else o[a]=c}),o),{})}}const Wee=function(e){e===void 0&&(e=[]);const t=e,n=_.useCallback(i=>F_(i,e,"reference"),t),r=_.useCallback(i=>F_(i,e,"floating"),t),o=_.useCallback(i=>F_(i,e,"item"),e.map(i=>i?.item));return _.useMemo(()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:o}),[n,r,o])};function tA({opened:e,floating:t,position:n,positionDependencies:r}){const[o,i]=_.useState(0);_.useEffect(()=>{if(t.refs.reference.current&&t.refs.floating.current)return vee(t.refs.reference.current,t.refs.floating.current,t.update)},[t.refs.reference.current,t.refs.floating.current,e,o,n]),Hn(()=>{t.update()},r),Hn(()=>{i(s=>s+1)},[e])}function Uee(e){const t=[Bz(e.offset)];return e.middlewares.shift&&t.push(MP({limiter:QX()})),e.middlewares.flip&&t.push(Lz()),e.middlewares.inline&&t.push(Az()),t.push(Yz({element:e.arrowRef,padding:e.arrowOffset})),t}function Zee(e){const[t,n]=_o({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),r=()=>{var s;(s=e.onClose)==null||s.call(e),n(!1)},o=()=>{var s,a;t?((s=e.onClose)==null||s.call(e),n(!1)):((a=e.onOpen)==null||a.call(e),n(!0))},i=RP({placement:e.position,middleware:[...Uee(e),...e.width==="target"?[XX({apply({rects:s}){var a,c;Object.assign((c=(a=i.refs.floating.current)==null?void 0:a.style)!=null?c:{},{width:`${s.reference.width}px`})}})]:[]]});return tA({opened:e.opened,position:e.position,positionDependencies:e.positionDependencies,floating:i}),Hn(()=>{var s;(s=e.onPositionChange)==null||s.call(e,i.placement)},[i.placement]),Hn(()=>{var s,a;e.opened?(a=e.onOpen)==null||a.call(e):(s=e.onClose)==null||s.call(e)},[e.opened]),{floating:i,controlled:typeof e.opened=="boolean",opened:t,onClose:r,onToggle:o}}const nA={context:"Popover component was not found in the tree",children:"Popover.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported"},[Gee,rA]=Cu(nA.context);var Yee=Object.defineProperty,Kee=Object.defineProperties,qee=Object.getOwnPropertyDescriptors,_g=Object.getOwnPropertySymbols,oA=Object.prototype.hasOwnProperty,iA=Object.prototype.propertyIsEnumerable,a$=(e,t,n)=>t in e?Yee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ep=(e,t)=>{for(var n in t||(t={}))oA.call(t,n)&&a$(e,n,t[n]);if(_g)for(var n of _g(t))iA.call(t,n)&&a$(e,n,t[n]);return e},Jee=(e,t)=>Kee(e,qee(t)),Qee=(e,t)=>{var n={};for(var r in e)oA.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&_g)for(var r of _g(e))t.indexOf(r)<0&&iA.call(e,r)&&(n[r]=e[r]);return n};const Xee={refProp:"ref",popupType:"dialog",shouldOverrideDefaultTargetId:!0},sA=_.forwardRef((e,t)=>{const n=ae("PopoverTarget",Xee,e),{children:r,refProp:o,popupType:i,shouldOverrideDefaultTargetId:s}=n,a=Qee(n,["children","refProp","popupType","shouldOverrideDefaultTargetId"]);if(!zf(r))throw new Error(nA.children);const c=a,u=rA(),f=Ps(u.reference,r.ref,t),h=u.withRoles?{"aria-haspopup":i,"aria-expanded":u.opened,"aria-controls":u.getDropdownId(),id:s?u.getTargetId():r.props.id}:{};return _.cloneElement(r,ep(Jee(ep(ep(ep({},c),h),u.targetProps),{className:_S(u.targetProps.className,c.className,r.props.className),[o]:f}),u.controlled?null:{onClick:u.onToggle}))});sA.displayName="@mantine/core/PopoverTarget";var ete=ue((e,{radius:t,shadow:n})=>({dropdown:{position:"absolute",backgroundColor:e.white,background:e.colorScheme==="dark"?e.colors.dark[6]:e.white,border:`${M(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]}`,padding:`${e.spacing.sm} ${e.spacing.md}`,boxShadow:e.shadows[n]||n||"none",borderRadius:e.fn.radius(t),"&:focus":{outline:0}},arrow:{backgroundColor:"inherit",border:`${M(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]}`,zIndex:1}}));const tte=ete;var nte=Object.defineProperty,l$=Object.getOwnPropertySymbols,rte=Object.prototype.hasOwnProperty,ote=Object.prototype.propertyIsEnumerable,c$=(e,t,n)=>t in e?nte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,cc=(e,t)=>{for(var n in t||(t={}))rte.call(t,n)&&c$(e,n,t[n]);if(l$)for(var n of l$(t))ote.call(t,n)&&c$(e,n,t[n]);return e};const u$={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function ite({transition:e,state:t,duration:n,timingFunction:r}){const o={transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e=="string"?e in Mh?cc(cc(cc({transitionProperty:Mh[e].transitionProperty},o),Mh[e].common),Mh[e][u$[t]]):null:cc(cc(cc({transitionProperty:e.transitionProperty},o),e.common),e[u$[t]])}function ste({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:o,onExit:i,onEntered:s,onExited:a}){const c=ar(),u=MS(),f=c.respectReducedMotion?u:!1,[h,m]=_.useState(f?0:e),[v,y]=_.useState(r?"entered":"exited"),w=_.useRef(-1),P=b=>{const S=b?o:i,O=b?s:a;y(b?"pre-entering":"pre-exiting"),window.clearTimeout(w.current);const E=f?0:b?e:t;if(m(E),E===0)typeof S=="function"&&S(),typeof O=="function"&&O(),y(b?"entered":"exited");else{const $=window.setTimeout(()=>{typeof S=="function"&&S(),y(b?"entering":"exiting")},10);w.current=window.setTimeout(()=>{window.clearTimeout($),typeof O=="function"&&O(),y(b?"entered":"exited")},E)}};return Hn(()=>{P(r)},[r]),_.useEffect(()=>()=>window.clearTimeout(w.current),[]),{transitionDuration:h,transitionStatus:v,transitionTimingFunction:n||c.transitionTimingFunction}}function $s({keepMounted:e,transition:t,duration:n=250,exitDuration:r=n,mounted:o,children:i,timingFunction:s,onExit:a,onEntered:c,onEnter:u,onExited:f}){const{transitionDuration:h,transitionStatus:m,transitionTimingFunction:v}=ste({mounted:o,exitDuration:r,duration:n,timingFunction:s,onExit:a,onEntered:c,onEnter:u,onExited:f});return h===0?o?k.createElement(k.Fragment,null,i({})):e?i({display:"none"}):null:m==="exited"?e?i({display:"none"}):null:k.createElement(k.Fragment,null,i(ite({transition:t,duration:h,state:m,timingFunction:v})))}$s.displayName="@mantine/core/Transition";function LP({children:e,active:t=!0,refProp:n="ref"}){const r=fY(t),o=Ps(r,e?.ref);return zf(e)?_.cloneElement(e,{[n]:o}):e}LP.displayName="@mantine/core/FocusTrap";var ate=Object.defineProperty,lte=Object.defineProperties,cte=Object.getOwnPropertyDescriptors,d$=Object.getOwnPropertySymbols,ute=Object.prototype.hasOwnProperty,dte=Object.prototype.propertyIsEnumerable,f$=(e,t,n)=>t in e?ate(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Rs=(e,t)=>{for(var n in t||(t={}))ute.call(t,n)&&f$(e,n,t[n]);if(d$)for(var n of d$(t))dte.call(t,n)&&f$(e,n,t[n]);return e},tp=(e,t)=>lte(e,cte(t));function h$(e,t,n,r){return e==="center"||r==="center"?{top:t}:e==="end"?{bottom:n}:e==="start"?{top:n}:{}}function p$(e,t,n,r,o){return e==="center"||r==="center"?{left:t}:e==="end"?{[o==="ltr"?"right":"left"]:n}:e==="start"?{[o==="ltr"?"left":"right"]:n}:{}}const fte={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function hte({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,arrowX:i,arrowY:s,dir:a}){const[c,u="center"]=e.split("-"),f={width:M(t),height:M(t),transform:"rotate(45deg)",position:"absolute",[fte[c]]:M(r)},h=M(-t/2);return c==="left"?tp(Rs(Rs({},f),h$(u,s,n,o)),{right:h,borderLeftColor:"transparent",borderBottomColor:"transparent"}):c==="right"?tp(Rs(Rs({},f),h$(u,s,n,o)),{left:h,borderRightColor:"transparent",borderTopColor:"transparent"}):c==="top"?tp(Rs(Rs({},f),p$(u,i,n,o,a)),{bottom:h,borderTopColor:"transparent",borderLeftColor:"transparent"}):c==="bottom"?tp(Rs(Rs({},f),p$(u,i,n,o,a)),{top:h,borderBottomColor:"transparent",borderRightColor:"transparent"}):{}}var pte=Object.defineProperty,mte=Object.defineProperties,gte=Object.getOwnPropertyDescriptors,wg=Object.getOwnPropertySymbols,aA=Object.prototype.hasOwnProperty,lA=Object.prototype.propertyIsEnumerable,m$=(e,t,n)=>t in e?pte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vte=(e,t)=>{for(var n in t||(t={}))aA.call(t,n)&&m$(e,n,t[n]);if(wg)for(var n of wg(t))lA.call(t,n)&&m$(e,n,t[n]);return e},yte=(e,t)=>mte(e,gte(t)),_te=(e,t)=>{var n={};for(var r in e)aA.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&wg)for(var r of wg(e))t.indexOf(r)<0&&lA.call(e,r)&&(n[r]=e[r]);return n};const zP=_.forwardRef((e,t)=>{var n=e,{position:r,arrowSize:o,arrowOffset:i,arrowRadius:s,arrowPosition:a,visible:c,arrowX:u,arrowY:f}=n,h=_te(n,["position","arrowSize","arrowOffset","arrowRadius","arrowPosition","visible","arrowX","arrowY"]);const m=ar();return c?k.createElement("div",yte(vte({},h),{ref:t,style:hte({position:r,arrowSize:o,arrowOffset:i,arrowRadius:s,arrowPosition:a,dir:m.dir,arrowX:u,arrowY:f})})):null});zP.displayName="@mantine/core/FloatingArrow";var wte=Object.defineProperty,bte=Object.defineProperties,xte=Object.getOwnPropertyDescriptors,bg=Object.getOwnPropertySymbols,cA=Object.prototype.hasOwnProperty,uA=Object.prototype.propertyIsEnumerable,g$=(e,t,n)=>t in e?wte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,uc=(e,t)=>{for(var n in t||(t={}))cA.call(t,n)&&g$(e,n,t[n]);if(bg)for(var n of bg(t))uA.call(t,n)&&g$(e,n,t[n]);return e},np=(e,t)=>bte(e,xte(t)),Ste=(e,t)=>{var n={};for(var r in e)cA.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&bg)for(var r of bg(e))t.indexOf(r)<0&&uA.call(e,r)&&(n[r]=e[r]);return n};const Pte={};function dA(e){var t;const n=ae("PopoverDropdown",Pte,e),{style:r,className:o,children:i,onKeyDownCapture:s}=n,a=Ste(n,["style","className","children","onKeyDownCapture"]),c=rA(),{classes:u,cx:f}=tte({radius:c.radius,shadow:c.shadow},{name:c.__staticSelector,classNames:c.classNames,styles:c.styles,unstyled:c.unstyled,variant:c.variant}),h=gL({opened:c.opened,shouldReturnFocus:c.returnFocus}),m=c.withRoles?{"aria-labelledby":c.getTargetId(),id:c.getDropdownId(),role:"dialog"}:{};return c.disabled?null:k.createElement(Zf,np(uc({},c.portalProps),{withinPortal:c.withinPortal}),k.createElement($s,np(uc({mounted:c.opened},c.transitionProps),{transition:c.transitionProps.transition||"fade",duration:(t=c.transitionProps.duration)!=null?t:150,keepMounted:c.keepMounted,exitDuration:typeof c.transitionProps.exitDuration=="number"?c.transitionProps.exitDuration:c.transitionProps.duration}),v=>{var y,w;return k.createElement(LP,{active:c.trapFocus},k.createElement(Pe,uc(np(uc({},m),{tabIndex:-1,ref:c.floating,style:np(uc(uc({},r),v),{zIndex:c.zIndex,top:(y=c.y)!=null?y:0,left:(w=c.x)!=null?w:0,width:c.width==="target"?void 0:M(c.width)}),className:f(u.dropdown,o),onKeyDownCapture:TU(c.onClose,{active:c.closeOnEscape,onTrigger:h,onKeyDown:s}),"data-position":c.placement}),a),i,k.createElement(zP,{ref:c.arrowRef,arrowX:c.arrowX,arrowY:c.arrowY,visible:c.withArrow,position:c.placement,arrowSize:c.arrowSize,arrowRadius:c.arrowRadius,arrowOffset:c.arrowOffset,arrowPosition:c.arrowPosition,className:u.arrow})))}))}dA.displayName="@mantine/core/PopoverDropdown";function fA(e,t){if(e==="rtl"&&(t.includes("right")||t.includes("left"))){const[n,r]=t.split("-"),o=n==="right"?"left":"right";return r===void 0?o:`${o}-${r}`}return t}var v$=Object.getOwnPropertySymbols,Ote=Object.prototype.hasOwnProperty,Cte=Object.prototype.propertyIsEnumerable,kte=(e,t)=>{var n={};for(var r in e)Ote.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&v$)for(var r of v$(e))t.indexOf(r)<0&&Cte.call(e,r)&&(n[r]=e[r]);return n};const Ete={position:"bottom",offset:8,positionDependencies:[],transitionProps:{transition:"fade",duration:150},middlewares:{flip:!0,shift:!0,inline:!1},arrowSize:7,arrowOffset:5,arrowRadius:0,arrowPosition:"side",closeOnClickOutside:!0,withinPortal:!1,closeOnEscape:!0,trapFocus:!1,withRoles:!0,returnFocus:!1,clickOutsideEvents:["mousedown","touchstart"],zIndex:ci("popover"),__staticSelector:"Popover",width:"max-content"};function En(e){var t,n,r,o,i,s;const a=_.useRef(null),c=ae("Popover",Ete,e),{children:u,position:f,offset:h,onPositionChange:m,positionDependencies:v,opened:y,transitionProps:w,width:P,middlewares:b,withArrow:S,arrowSize:O,arrowOffset:E,arrowRadius:$,arrowPosition:N,unstyled:I,classNames:R,styles:B,closeOnClickOutside:z,withinPortal:G,portalProps:Q,closeOnEscape:X,clickOutsideEvents:V,trapFocus:H,onClose:Z,onOpen:Y,onChange:j,zIndex:W,radius:F,shadow:K,id:ee,defaultOpened:fe,__staticSelector:ie,withRoles:J,disabled:ne,returnFocus:le,variant:_e,keepMounted:Ne}=c,we=kte(c,["children","position","offset","onPositionChange","positionDependencies","opened","transitionProps","width","middlewares","withArrow","arrowSize","arrowOffset","arrowRadius","arrowPosition","unstyled","classNames","styles","closeOnClickOutside","withinPortal","portalProps","closeOnEscape","clickOutsideEvents","trapFocus","onClose","onOpen","onChange","zIndex","radius","shadow","id","defaultOpened","__staticSelector","withRoles","disabled","returnFocus","variant","keepMounted"]),[He,Te]=_.useState(null),[je,st]=_.useState(null),bt=Ia(ee),wn=ar(),ht=Zee({middlewares:b,width:P,position:fA(wn.dir,f),offset:typeof h=="number"?h+(S?O/2:0):h,arrowRef:a,arrowOffset:E,onPositionChange:m,positionDependencies:v,opened:y,defaultOpened:fe,onChange:j,onOpen:Y,onClose:Z});nY(()=>ht.opened&&z&&ht.onClose(),V,[He,je]);const In=_.useCallback(lt=>{Te(lt),ht.floating.reference(lt)},[ht.floating.reference]),Er=_.useCallback(lt=>{st(lt),ht.floating.floating(lt)},[ht.floating.floating]);return k.createElement(Gee,{value:{returnFocus:le,disabled:ne,controlled:ht.controlled,reference:In,floating:Er,x:ht.floating.x,y:ht.floating.y,arrowX:(r=(n=(t=ht.floating)==null?void 0:t.middlewareData)==null?void 0:n.arrow)==null?void 0:r.x,arrowY:(s=(i=(o=ht.floating)==null?void 0:o.middlewareData)==null?void 0:i.arrow)==null?void 0:s.y,opened:ht.opened,arrowRef:a,transitionProps:w,width:P,withArrow:S,arrowSize:O,arrowOffset:E,arrowRadius:$,arrowPosition:N,placement:ht.floating.placement,trapFocus:H,withinPortal:G,portalProps:Q,zIndex:W,radius:F,shadow:K,closeOnEscape:X,onClose:ht.onClose,onToggle:ht.onToggle,getTargetId:()=>`${bt}-target`,getDropdownId:()=>`${bt}-dropdown`,withRoles:J,targetProps:we,__staticSelector:ie,classNames:R,styles:B,unstyled:I,variant:_e,keepMounted:Ne}},u)}En.Target=sA;En.Dropdown=dA;En.displayName="@mantine/core/Popover";var $te=Object.defineProperty,xg=Object.getOwnPropertySymbols,hA=Object.prototype.hasOwnProperty,pA=Object.prototype.propertyIsEnumerable,y$=(e,t,n)=>t in e?$te(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mte=(e,t)=>{for(var n in t||(t={}))hA.call(t,n)&&y$(e,n,t[n]);if(xg)for(var n of xg(t))pA.call(t,n)&&y$(e,n,t[n]);return e},Nte=(e,t)=>{var n={};for(var r in e)hA.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&xg)for(var r of xg(e))t.indexOf(r)<0&&pA.call(e,r)&&(n[r]=e[r]);return n};function Tte(e){var t=e,{children:n,component:r="div",maxHeight:o=220,direction:i="column",id:s,innerRef:a,__staticSelector:c,styles:u,classNames:f,unstyled:h}=t,m=Nte(t,["children","component","maxHeight","direction","id","innerRef","__staticSelector","styles","classNames","unstyled"]);const{classes:v}=FX(null,{name:c,styles:u,classNames:f,unstyled:h});return k.createElement(En.Dropdown,Mte({p:0,onMouseDown:y=>y.preventDefault()},m),k.createElement("div",{style:{maxHeight:M(o),display:"flex"}},k.createElement(Pe,{component:r||"div",id:`${s}-items`,"aria-labelledby":`${s}-label`,role:"listbox",onMouseDown:y=>y.preventDefault(),style:{flex:1,overflowY:r!==A0?"auto":void 0},"data-combobox-popover":!0,tabIndex:-1,ref:a},k.createElement("div",{className:v.itemsWrapper,style:{flexDirection:i}},n))))}function ya({opened:e,transitionProps:t={transition:"fade",duration:0},shadow:n,withinPortal:r,portalProps:o,children:i,__staticSelector:s,onDirectionChange:a,switchDirectionOnFlip:c,zIndex:u,dropdownPosition:f,positionDependencies:h=[],classNames:m,styles:v,unstyled:y,readOnly:w,variant:P}){return k.createElement(En,{unstyled:y,classNames:m,styles:v,width:"target",withRoles:!1,opened:e,middlewares:{flip:f==="flip",shift:!1},position:f==="flip"?"bottom":f,positionDependencies:h,zIndex:u,__staticSelector:s,withinPortal:r,portalProps:o,transitionProps:t,shadow:n,disabled:w,onPositionChange:b=>c&&a?.(b==="top"?"column-reverse":"column"),variant:P},i)}ya.Target=En.Target;ya.Dropdown=Tte;var Ite=Object.defineProperty,jte=Object.defineProperties,Dte=Object.getOwnPropertyDescriptors,Sg=Object.getOwnPropertySymbols,mA=Object.prototype.hasOwnProperty,gA=Object.prototype.propertyIsEnumerable,_$=(e,t,n)=>t in e?Ite(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,rp=(e,t)=>{for(var n in t||(t={}))mA.call(t,n)&&_$(e,n,t[n]);if(Sg)for(var n of Sg(t))gA.call(t,n)&&_$(e,n,t[n]);return e},Rte=(e,t)=>jte(e,Dte(t)),Lte=(e,t)=>{var n={};for(var r in e)mA.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Sg)for(var r of Sg(e))t.indexOf(r)<0&&gA.call(e,r)&&(n[r]=e[r]);return n};function AP(e,t,n){const r=ae(e,t,n),{label:o,description:i,error:s,required:a,classNames:c,styles:u,className:f,unstyled:h,__staticSelector:m,sx:v,errorProps:y,labelProps:w,descriptionProps:P,wrapperProps:b,id:S,size:O,style:E,inputContainer:$,inputWrapperOrder:N,withAsterisk:I,variant:R}=r,B=Lte(r,["label","description","error","required","classNames","styles","className","unstyled","__staticSelector","sx","errorProps","labelProps","descriptionProps","wrapperProps","id","size","style","inputContainer","inputWrapperOrder","withAsterisk","variant"]),z=Ia(S),{systemStyles:G,rest:Q}=Bl(B),X=rp({label:o,description:i,error:s,required:a,classNames:c,className:f,__staticSelector:m,sx:v,errorProps:y,labelProps:w,descriptionProps:P,unstyled:h,styles:u,id:z,size:O,style:E,inputContainer:$,inputWrapperOrder:N,withAsterisk:I,variant:R},b);return Rte(rp({},Q),{classNames:c,styles:u,unstyled:h,wrapperProps:rp(rp({},X),G),inputProps:{required:a,classNames:c,styles:u,unstyled:h,id:z,size:O,__staticSelector:m,error:s,variant:R}})}var zte=ue((e,t,{size:n})=>({label:{display:"inline-block",fontSize:re({size:n,sizes:e.fontSizes}),fontWeight:500,color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[9],wordBreak:"break-word",cursor:"default",WebkitTapHighlightColor:"transparent"},required:{color:e.fn.variant({variant:"filled",color:"red"}).background}}));const Ate=zte;var Bte=Object.defineProperty,Pg=Object.getOwnPropertySymbols,vA=Object.prototype.hasOwnProperty,yA=Object.prototype.propertyIsEnumerable,w$=(e,t,n)=>t in e?Bte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Fte=(e,t)=>{for(var n in t||(t={}))vA.call(t,n)&&w$(e,n,t[n]);if(Pg)for(var n of Pg(t))yA.call(t,n)&&w$(e,n,t[n]);return e},Vte=(e,t)=>{var n={};for(var r in e)vA.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Pg)for(var r of Pg(e))t.indexOf(r)<0&&yA.call(e,r)&&(n[r]=e[r]);return n};const Hte={labelElement:"label",size:"sm"},BP=_.forwardRef((e,t)=>{const n=ae("InputLabel",Hte,e),{labelElement:r,children:o,required:i,size:s,classNames:a,styles:c,unstyled:u,className:f,htmlFor:h,__staticSelector:m,variant:v,onMouseDown:y}=n,w=Vte(n,["labelElement","children","required","size","classNames","styles","unstyled","className","htmlFor","__staticSelector","variant","onMouseDown"]),{classes:P,cx:b}=Ate(null,{name:["InputWrapper",m],classNames:a,styles:c,unstyled:u,variant:v,size:s});return k.createElement(Pe,Fte({component:r,ref:t,className:b(P.label,f),htmlFor:r==="label"?h:void 0,onMouseDown:S=>{y?.(S),!S.defaultPrevented&&S.detail>1&&S.preventDefault()}},w),o,i&&k.createElement("span",{className:P.required,"aria-hidden":!0}," *"))});BP.displayName="@mantine/core/InputLabel";var Wte=ue((e,t,{size:n})=>({error:{wordBreak:"break-word",color:e.fn.variant({variant:"filled",color:"red"}).background,fontSize:`calc(${re({size:n,sizes:e.fontSizes})} - ${M(2)})`,lineHeight:1.2,display:"block"}}));const Ute=Wte;var Zte=Object.defineProperty,Og=Object.getOwnPropertySymbols,_A=Object.prototype.hasOwnProperty,wA=Object.prototype.propertyIsEnumerable,b$=(e,t,n)=>t in e?Zte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Gte=(e,t)=>{for(var n in t||(t={}))_A.call(t,n)&&b$(e,n,t[n]);if(Og)for(var n of Og(t))wA.call(t,n)&&b$(e,n,t[n]);return e},Yte=(e,t)=>{var n={};for(var r in e)_A.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Og)for(var r of Og(e))t.indexOf(r)<0&&wA.call(e,r)&&(n[r]=e[r]);return n};const Kte={size:"sm"},FP=_.forwardRef((e,t)=>{const n=ae("InputError",Kte,e),{children:r,className:o,classNames:i,styles:s,unstyled:a,size:c,__staticSelector:u,variant:f}=n,h=Yte(n,["children","className","classNames","styles","unstyled","size","__staticSelector","variant"]),{classes:m,cx:v}=Ute(null,{name:["InputWrapper",u],classNames:i,styles:s,unstyled:a,variant:f,size:c});return k.createElement(U,Gte({className:v(m.error,o),ref:t},h),r)});FP.displayName="@mantine/core/InputError";var qte=ue((e,t,{size:n})=>({description:{wordBreak:"break-word",color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],fontSize:`calc(${re({size:n,sizes:e.fontSizes})} - ${M(2)})`,lineHeight:1.2,display:"block"}}));const Jte=qte;var Qte=Object.defineProperty,Cg=Object.getOwnPropertySymbols,bA=Object.prototype.hasOwnProperty,xA=Object.prototype.propertyIsEnumerable,x$=(e,t,n)=>t in e?Qte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Xte=(e,t)=>{for(var n in t||(t={}))bA.call(t,n)&&x$(e,n,t[n]);if(Cg)for(var n of Cg(t))xA.call(t,n)&&x$(e,n,t[n]);return e},ene=(e,t)=>{var n={};for(var r in e)bA.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Cg)for(var r of Cg(e))t.indexOf(r)<0&&xA.call(e,r)&&(n[r]=e[r]);return n};const tne={size:"sm"},VP=_.forwardRef((e,t)=>{const n=ae("InputDescription",tne,e),{children:r,className:o,classNames:i,styles:s,unstyled:a,size:c,__staticSelector:u,variant:f}=n,h=ene(n,["children","className","classNames","styles","unstyled","size","__staticSelector","variant"]),{classes:m,cx:v}=Jte(null,{name:["InputWrapper",u],classNames:i,styles:s,unstyled:a,variant:f,size:c});return k.createElement(U,Xte({color:"dimmed",className:v(m.description,o),ref:t,unstyled:a},h),r)});VP.displayName="@mantine/core/InputDescription";const SA=_.createContext({offsetBottom:!1,offsetTop:!1,describedBy:void 0}),nne=SA.Provider,rne=()=>_.useContext(SA);function one(e,{hasDescription:t,hasError:n}){const r=e.findIndex(c=>c==="input"),o=e[r-1],i=e[r+1];return{offsetBottom:t&&i==="description"||n&&i==="error",offsetTop:t&&o==="description"||n&&o==="error"}}var ine=Object.defineProperty,sne=Object.defineProperties,ane=Object.getOwnPropertyDescriptors,S$=Object.getOwnPropertySymbols,lne=Object.prototype.hasOwnProperty,cne=Object.prototype.propertyIsEnumerable,P$=(e,t,n)=>t in e?ine(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,une=(e,t)=>{for(var n in t||(t={}))lne.call(t,n)&&P$(e,n,t[n]);if(S$)for(var n of S$(t))cne.call(t,n)&&P$(e,n,t[n]);return e},dne=(e,t)=>sne(e,ane(t)),fne=ue(e=>({root:dne(une({},e.fn.fontStyles()),{lineHeight:e.lineHeight})}));const hne=fne;var pne=Object.defineProperty,mne=Object.defineProperties,gne=Object.getOwnPropertyDescriptors,kg=Object.getOwnPropertySymbols,PA=Object.prototype.hasOwnProperty,OA=Object.prototype.propertyIsEnumerable,O$=(e,t,n)=>t in e?pne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ls=(e,t)=>{for(var n in t||(t={}))PA.call(t,n)&&O$(e,n,t[n]);if(kg)for(var n of kg(t))OA.call(t,n)&&O$(e,n,t[n]);return e},C$=(e,t)=>mne(e,gne(t)),vne=(e,t)=>{var n={};for(var r in e)PA.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&kg)for(var r of kg(e))t.indexOf(r)<0&&OA.call(e,r)&&(n[r]=e[r]);return n};const yne={labelElement:"label",size:"sm",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},CA=_.forwardRef((e,t)=>{const n=ae("InputWrapper",yne,e),{className:r,label:o,children:i,required:s,id:a,error:c,description:u,labelElement:f,labelProps:h,descriptionProps:m,errorProps:v,classNames:y,styles:w,size:P,inputContainer:b,__staticSelector:S,unstyled:O,inputWrapperOrder:E,withAsterisk:$,variant:N}=n,I=vne(n,["className","label","children","required","id","error","description","labelElement","labelProps","descriptionProps","errorProps","classNames","styles","size","inputContainer","__staticSelector","unstyled","inputWrapperOrder","withAsterisk","variant"]),{classes:R,cx:B}=hne(null,{classNames:y,styles:w,name:["InputWrapper",S],unstyled:O,variant:N,size:P}),z={classNames:y,styles:w,unstyled:O,size:P,variant:N,__staticSelector:S},G=typeof $=="boolean"?$:s,Q=a?`${a}-error`:v?.id,X=a?`${a}-description`:m?.id,H=`${!!c&&typeof c!="boolean"?Q:""} ${u?X:""}`,Z=H.trim().length>0?H.trim():void 0,Y=o&&k.createElement(BP,Ls(Ls({key:"label",labelElement:f,id:a?`${a}-label`:void 0,htmlFor:a,required:G},z),h),o),j=u&&k.createElement(VP,C$(Ls(Ls({key:"description"},m),z),{size:m?.size||z.size,id:m?.id||X}),u),W=k.createElement(_.Fragment,{key:"input"},b(i)),F=typeof c!="boolean"&&c&&k.createElement(FP,C$(Ls(Ls({},v),z),{size:v?.size||z.size,key:"error",id:v?.id||Q}),c),K=E.map(ee=>{switch(ee){case"label":return Y;case"input":return W;case"description":return j;case"error":return F;default:return null}});return k.createElement(nne,{value:Ls({describedBy:Z},one(E,{hasDescription:!!j,hasError:!!F}))},k.createElement(Pe,Ls({className:B(R.root,r),ref:t},I),K))});CA.displayName="@mantine/core/InputWrapper";var _ne=Object.defineProperty,Eg=Object.getOwnPropertySymbols,kA=Object.prototype.hasOwnProperty,EA=Object.prototype.propertyIsEnumerable,k$=(e,t,n)=>t in e?_ne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wne=(e,t)=>{for(var n in t||(t={}))kA.call(t,n)&&k$(e,n,t[n]);if(Eg)for(var n of Eg(t))EA.call(t,n)&&k$(e,n,t[n]);return e},bne=(e,t)=>{var n={};for(var r in e)kA.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Eg)for(var r of Eg(e))t.indexOf(r)<0&&EA.call(e,r)&&(n[r]=e[r]);return n};const xne={},$A=_.forwardRef((e,t)=>{const n=ae("InputPlaceholder",xne,e),{sx:r}=n,o=bne(n,["sx"]);return k.createElement(Pe,wne({component:"span",sx:[i=>i.fn.placeholderStyles(),...yS(r)],ref:t},o))});$A.displayName="@mantine/core/InputPlaceholder";var Sne=Object.defineProperty,Pne=Object.defineProperties,One=Object.getOwnPropertyDescriptors,E$=Object.getOwnPropertySymbols,Cne=Object.prototype.hasOwnProperty,kne=Object.prototype.propertyIsEnumerable,$$=(e,t,n)=>t in e?Sne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,op=(e,t)=>{for(var n in t||(t={}))Cne.call(t,n)&&$$(e,n,t[n]);if(E$)for(var n of E$(t))kne.call(t,n)&&$$(e,n,t[n]);return e},V_=(e,t)=>Pne(e,One(t));const Ln={xs:M(30),sm:M(36),md:M(42),lg:M(50),xl:M(60)},Ene=["default","filled","unstyled"];function $ne({theme:e,variant:t}){return Ene.includes(t)?t==="default"?{border:`${M(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`,backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white,transition:"border-color 100ms ease","&:focus, &:focus-within":e.focusRingStyles.inputStyles(e)}:t==="filled"?{border:`${M(1)} solid transparent`,backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1],"&:focus, &:focus-within":e.focusRingStyles.inputStyles(e)}:{borderWidth:0,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,backgroundColor:"transparent",minHeight:M(28),outline:0,"&:focus, &:focus-within":{outline:"none",borderColor:"transparent"},"&:disabled":{backgroundColor:"transparent","&:focus, &:focus-within":{outline:"none",borderColor:"transparent"}}}:null}var Mne=ue((e,{multiline:t,radius:n,invalid:r,rightSectionWidth:o,withRightSection:i,iconWidth:s,offsetBottom:a,offsetTop:c,pointer:u},{variant:f,size:h})=>{const m=e.fn.variant({variant:"filled",color:"red"}).background,v=f==="default"||f==="filled"?{minHeight:re({size:h,sizes:Ln}),paddingLeft:`calc(${re({size:h,sizes:Ln})} / 3)`,paddingRight:i?o||re({size:h,sizes:Ln}):`calc(${re({size:h,sizes:Ln})} / 3)`,borderRadius:e.fn.radius(n)}:f==="unstyled"&&i?{paddingRight:o||re({size:h,sizes:Ln})}:null;return{wrapper:{position:"relative",marginTop:c?`calc(${e.spacing.xs} / 2)`:void 0,marginBottom:a?`calc(${e.spacing.xs} / 2)`:void 0,"&:has(input:disabled)":{"& .mantine-Input-rightSection":{display:"none"}}},input:V_(op(op(V_(op({},e.fn.fontStyles()),{height:t?f==="unstyled"?void 0:"auto":re({size:h,sizes:Ln}),WebkitTapHighlightColor:"transparent",lineHeight:t?e.lineHeight:`calc(${re({size:h,sizes:Ln})} - ${M(2)})`,appearance:"none",resize:"none",boxSizing:"border-box",fontSize:re({size:h,sizes:e.fontSizes}),width:"100%",color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,display:"block",textAlign:"left",cursor:u?"pointer":void 0}),$ne({theme:e,variant:f})),v),{"&:disabled, &[data-disabled]":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[1],color:e.colors.dark[2],opacity:.6,cursor:"not-allowed",pointerEvents:"none","&::placeholder":{color:e.colors.dark[2]}},"&[data-invalid]":{color:m,borderColor:m,"&::placeholder":{opacity:1,color:m}},"&[data-with-icon]":{paddingLeft:typeof s=="number"?M(s):re({size:h,sizes:Ln})},"&::placeholder":V_(op({},e.fn.placeholderStyles()),{opacity:1}),"&::-webkit-inner-spin-button, &::-webkit-outer-spin-button, &::-webkit-search-decoration, &::-webkit-search-cancel-button, &::-webkit-search-results-button, &::-webkit-search-results-decoration":{appearance:"none"},"&[type=number]":{MozAppearance:"textfield"}}),icon:{pointerEvents:"none",position:"absolute",zIndex:1,left:0,top:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",width:s?M(s):re({size:h,sizes:Ln}),color:r?e.colors.red[e.colorScheme==="dark"?6:7]:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[5]},rightSection:{position:"absolute",top:0,bottom:0,right:0,display:"flex",alignItems:"center",justifyContent:"center",width:o||re({size:h,sizes:Ln})}}});const Nne=Mne;var Tne=Object.defineProperty,Ine=Object.defineProperties,jne=Object.getOwnPropertyDescriptors,$g=Object.getOwnPropertySymbols,MA=Object.prototype.hasOwnProperty,NA=Object.prototype.propertyIsEnumerable,M$=(e,t,n)=>t in e?Tne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ip=(e,t)=>{for(var n in t||(t={}))MA.call(t,n)&&M$(e,n,t[n]);if($g)for(var n of $g(t))NA.call(t,n)&&M$(e,n,t[n]);return e},N$=(e,t)=>Ine(e,jne(t)),Dne=(e,t)=>{var n={};for(var r in e)MA.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&$g)for(var r of $g(e))t.indexOf(r)<0&&NA.call(e,r)&&(n[r]=e[r]);return n};const Rne={size:"sm",variant:"default"},Ul=_.forwardRef((e,t)=>{const n=ae("Input",Rne,e),{className:r,error:o,required:i,disabled:s,variant:a,icon:c,style:u,rightSectionWidth:f,iconWidth:h,rightSection:m,rightSectionProps:v,radius:y,size:w,wrapperProps:P,classNames:b,styles:S,__staticSelector:O,multiline:E,sx:$,unstyled:N,pointer:I}=n,R=Dne(n,["className","error","required","disabled","variant","icon","style","rightSectionWidth","iconWidth","rightSection","rightSectionProps","radius","size","wrapperProps","classNames","styles","__staticSelector","multiline","sx","unstyled","pointer"]),{offsetBottom:B,offsetTop:z,describedBy:G}=rne(),{classes:Q,cx:X}=Nne({radius:y,multiline:E,invalid:!!o,rightSectionWidth:f?M(f):void 0,iconWidth:h,withRightSection:!!m,offsetBottom:B,offsetTop:z,pointer:I},{classNames:b,styles:S,name:["Input",O],unstyled:N,variant:a,size:w}),{systemStyles:V,rest:H}=Bl(R);return k.createElement(Pe,ip(ip({className:X(Q.wrapper,r),sx:$,style:u},V),P),c&&k.createElement("div",{className:Q.icon},c),k.createElement(Pe,N$(ip({component:"input"},H),{ref:t,required:i,"aria-invalid":!!o,"aria-describedby":G,disabled:s,"data-disabled":s||void 0,"data-with-icon":!!c||void 0,"data-invalid":!!o||void 0,className:Q.input})),m&&k.createElement("div",N$(ip({},v),{className:Q.rightSection}),m))});Ul.displayName="@mantine/core/Input";Ul.Wrapper=CA;Ul.Label=BP;Ul.Description=VP;Ul.Error=FP;Ul.Placeholder=$A;const et=Ul;var Lne=Object.defineProperty,Mg=Object.getOwnPropertySymbols,TA=Object.prototype.hasOwnProperty,IA=Object.prototype.propertyIsEnumerable,T$=(e,t,n)=>t in e?Lne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zne=(e,t)=>{for(var n in t||(t={}))TA.call(t,n)&&T$(e,n,t[n]);if(Mg)for(var n of Mg(t))IA.call(t,n)&&T$(e,n,t[n]);return e},Ane=(e,t)=>{var n={};for(var r in e)TA.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Mg)for(var r of Mg(e))t.indexOf(r)<0&&IA.call(e,r)&&(n[r]=e[r]);return n};function Bne(e){const t=e,{style:n}=t,r=Ane(t,["style"]);return k.createElement("svg",zne({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:n},r),k.createElement("path",{d:"M0.877014 7.49988C0.877014 3.84219 3.84216 0.877045 7.49985 0.877045C11.1575 0.877045 14.1227 3.84219 14.1227 7.49988C14.1227 11.1575 11.1575 14.1227 7.49985 14.1227C3.84216 14.1227 0.877014 11.1575 0.877014 7.49988ZM7.49985 1.82704C4.36683 1.82704 1.82701 4.36686 1.82701 7.49988C1.82701 8.97196 2.38774 10.3131 3.30727 11.3213C4.19074 9.94119 5.73818 9.02499 7.50023 9.02499C9.26206 9.02499 10.8093 9.94097 11.6929 11.3208C12.6121 10.3127 13.1727 8.97172 13.1727 7.49988C13.1727 4.36686 10.6328 1.82704 7.49985 1.82704ZM10.9818 11.9787C10.2839 10.7795 8.9857 9.97499 7.50023 9.97499C6.01458 9.97499 4.71624 10.7797 4.01845 11.9791C4.97952 12.7272 6.18765 13.1727 7.49985 13.1727C8.81227 13.1727 10.0206 12.727 10.9818 11.9787ZM5.14999 6.50487C5.14999 5.207 6.20212 4.15487 7.49999 4.15487C8.79786 4.15487 9.84999 5.207 9.84999 6.50487C9.84999 7.80274 8.79786 8.85487 7.49999 8.85487C6.20212 8.85487 5.14999 7.80274 5.14999 6.50487ZM7.49999 5.10487C6.72679 5.10487 6.09999 5.73167 6.09999 6.50487C6.09999 7.27807 6.72679 7.90487 7.49999 7.90487C8.27319 7.90487 8.89999 7.27807 8.89999 6.50487C8.89999 5.73167 8.27319 5.10487 7.49999 5.10487Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}var Fne=Object.defineProperty,Vne=Object.defineProperties,Hne=Object.getOwnPropertyDescriptors,I$=Object.getOwnPropertySymbols,Wne=Object.prototype.hasOwnProperty,Une=Object.prototype.propertyIsEnumerable,j$=(e,t,n)=>t in e?Fne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Zne=(e,t)=>{for(var n in t||(t={}))Wne.call(t,n)&&j$(e,n,t[n]);if(I$)for(var n of I$(t))Une.call(t,n)&&j$(e,n,t[n]);return e},Gne=(e,t)=>Vne(e,Hne(t));const jA=_.createContext(null);function Yne({spacing:e,children:t}){return k.createElement(jA.Provider,{value:{spacing:e}},t)}function Kne(){const e=_.useContext(jA);return e?Gne(Zne({},e),{withinGroup:!0}):{spacing:null,withinGroup:!1}}var qne=ue((e,{spacing:t})=>({root:{display:"flex",paddingLeft:re({size:t,sizes:e.spacing})}}));const Jne=qne;var Qne=Object.defineProperty,Ng=Object.getOwnPropertySymbols,DA=Object.prototype.hasOwnProperty,RA=Object.prototype.propertyIsEnumerable,D$=(e,t,n)=>t in e?Qne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Xne=(e,t)=>{for(var n in t||(t={}))DA.call(t,n)&&D$(e,n,t[n]);if(Ng)for(var n of Ng(t))RA.call(t,n)&&D$(e,n,t[n]);return e},ere=(e,t)=>{var n={};for(var r in e)DA.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ng)for(var r of Ng(e))t.indexOf(r)<0&&RA.call(e,r)&&(n[r]=e[r]);return n};const tre={},LA=_.forwardRef((e,t)=>{const n=ae("AvatarGroup",tre,e),{children:r,spacing:o="sm",unstyled:i,className:s,variant:a}=n,c=ere(n,["children","spacing","unstyled","className","variant"]),{classes:u,cx:f}=Jne({spacing:o},{name:"AvatarGroup",unstyled:i,variant:a});return k.createElement(Yne,{spacing:o},k.createElement(Pe,Xne({ref:t,className:f(u.root,s)},c),r))});LA.displayName="@mantine/core/AvatarGroup";var nre=Object.defineProperty,rre=Object.defineProperties,ore=Object.getOwnPropertyDescriptors,R$=Object.getOwnPropertySymbols,ire=Object.prototype.hasOwnProperty,sre=Object.prototype.propertyIsEnumerable,L$=(e,t,n)=>t in e?nre(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ud=(e,t)=>{for(var n in t||(t={}))ire.call(t,n)&&L$(e,n,t[n]);if(R$)for(var n of R$(t))sre.call(t,n)&&L$(e,n,t[n]);return e},z$=(e,t)=>rre(e,ore(t));const are=["filled","light","gradient","outline"],sp={xs:M(16),sm:M(26),md:M(38),lg:M(56),xl:M(84)};function lre({withinGroup:e,spacing:t,theme:n}){return e?{marginLeft:`calc(${re({size:t,sizes:n.spacing})} * -1)`,backgroundColor:`${n.colorScheme==="dark"?n.colors.dark[7]:n.white}`,border:`${M(2)} solid ${n.colorScheme==="dark"?n.colors.dark[7]:n.white}`}:null}function cre({theme:e,variant:t,color:n,gradient:r}){const o=e.fn.variant({variant:t,color:n,gradient:r});return are.includes(t)?{placeholder:{color:o.color,backgroundColor:o.background,backgroundImage:t==="gradient"?o.background:void 0,border:`${M(t==="gradient"?0:1)} solid ${o.border}`},placeholderIcon:{color:o.color}}:{}}var ure=ue((e,{radius:t,withinGroup:n,spacing:r,color:o,gradient:i},{variant:s,size:a})=>{const c=cre({theme:e,color:o,gradient:i,variant:s});return{root:ud(z$(ud({},e.fn.focusStyles()),{WebkitTapHighlightColor:"transparent",boxSizing:"border-box",position:"relative",display:"block",userSelect:"none",overflow:"hidden",borderRadius:e.fn.radius(t),textDecoration:"none",border:0,backgroundColor:"transparent",padding:0,width:re({size:a,sizes:sp}),minWidth:re({size:a,sizes:sp}),height:re({size:a,sizes:sp})}),lre({withinGroup:n,spacing:r,theme:e})),image:{objectFit:"cover",width:"100%",height:"100%",display:"block"},placeholder:ud(z$(ud({},e.fn.fontStyles()),{fontWeight:700,display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",userSelect:"none",borderRadius:e.fn.radius(t),fontSize:`calc(${re({size:a,sizes:sp})} / 2.5)`}),c.placeholder),placeholderIcon:ud({width:"70%",height:"70%"},c.placeholderIcon)}});const dre=ure;var fre=Object.defineProperty,hre=Object.defineProperties,pre=Object.getOwnPropertyDescriptors,Tg=Object.getOwnPropertySymbols,zA=Object.prototype.hasOwnProperty,AA=Object.prototype.propertyIsEnumerable,A$=(e,t,n)=>t in e?fre(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,B$=(e,t)=>{for(var n in t||(t={}))zA.call(t,n)&&A$(e,n,t[n]);if(Tg)for(var n of Tg(t))AA.call(t,n)&&A$(e,n,t[n]);return e},mre=(e,t)=>hre(e,pre(t)),gre=(e,t)=>{var n={};for(var r in e)zA.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Tg)for(var r of Tg(e))t.indexOf(r)<0&&AA.call(e,r)&&(n[r]=e[r]);return n};const vre={size:"md",color:"gray",variant:"light"},HP=_.forwardRef((e,t)=>{const n=ae("Avatar",vre,e),{className:r,size:o,src:i,alt:s,radius:a,children:c,color:u,variant:f,gradient:h,classNames:m,styles:v,imageProps:y,unstyled:w}=n,P=gre(n,["className","size","src","alt","radius","children","color","variant","gradient","classNames","styles","imageProps","unstyled"]),b=Kne(),[S,O]=_.useState(!i),{classes:E,cx:$}=dre({color:u,radius:a,withinGroup:b.withinGroup,spacing:b.spacing,gradient:h},{classNames:m,styles:v,unstyled:w,name:"Avatar",variant:f,size:o});return _.useEffect(()=>{O(!i)},[i]),k.createElement(Pe,B$({component:"div",className:$(E.root,r),ref:t},P),S?k.createElement("div",{className:E.placeholder,title:s},c||k.createElement(Bne,{className:E.placeholderIcon})):k.createElement("img",mre(B$({},y),{className:E.image,src:i,alt:s,onError:()=>O(!0)})))});HP.displayName="@mantine/core/Avatar";HP.Group=LA;const WP=HP;var yre=Object.defineProperty,_re=Object.defineProperties,wre=Object.getOwnPropertyDescriptors,F$=Object.getOwnPropertySymbols,bre=Object.prototype.hasOwnProperty,xre=Object.prototype.propertyIsEnumerable,V$=(e,t,n)=>t in e?yre(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,H_=(e,t)=>{for(var n in t||(t={}))bre.call(t,n)&&V$(e,n,t[n]);if(F$)for(var n of F$(t))xre.call(t,n)&&V$(e,n,t[n]);return e},Sre=(e,t)=>_re(e,wre(t));const Pre=["light","filled","outline","dot","gradient"],W_={xs:{fontSize:M(9),height:M(16)},sm:{fontSize:M(10),height:M(18)},md:{fontSize:M(11),height:M(20)},lg:{fontSize:M(13),height:M(26)},xl:{fontSize:M(16),height:M(32)}},Ore={xs:M(4),sm:M(4),md:M(6),lg:M(8),xl:M(10)};function Cre({theme:e,variant:t,color:n,size:r,gradient:o}){if(!Pre.includes(t))return null;if(t==="dot"){const s=re({size:r,sizes:Ore});return{backgroundColor:"transparent",color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],border:`${M(1)} solid ${e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[3]}`,paddingLeft:`calc(${re({size:r,sizes:e.spacing})} / 1.5 - ${s} / 2)`,"&::before":{content:'""',display:"block",width:s,height:s,borderRadius:s,backgroundColor:e.fn.themeColor(n,e.colorScheme==="dark"?4:e.fn.primaryShade("light"),!0),marginRight:s}}}const i=e.fn.variant({color:n,variant:t,gradient:o});return{background:i.background,color:i.color,border:`${M(t==="gradient"?0:1)} solid ${i.border}`}}var kre=ue((e,{color:t,radius:n,gradient:r,fullWidth:o},{variant:i,size:s})=>{const{fontSize:a,height:c}=s in W_?W_[s]:W_.md;return{leftSection:{marginRight:`calc(${e.spacing.xs} / 2)`},rightSection:{marginLeft:`calc(${e.spacing.xs} / 2)`},inner:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},root:H_(Sre(H_(H_({},e.fn.focusStyles()),e.fn.fontStyles()),{fontSize:a,height:c,WebkitTapHighlightColor:"transparent",lineHeight:`calc(${c} - ${M(2)})`,textDecoration:"none",padding:`0 calc(${re({size:s,sizes:e.spacing})} / 1.5)`,boxSizing:"border-box",display:o?"flex":"inline-flex",alignItems:"center",justifyContent:"center",width:o?"100%":"auto",textTransform:"uppercase",borderRadius:e.fn.radius(n),fontWeight:700,letterSpacing:M(.25),cursor:"inherit",textOverflow:"ellipsis",overflow:"hidden"}),Cre({theme:e,variant:i,color:t,size:s,gradient:r}))}});const Ere=kre;var $re=Object.defineProperty,Ig=Object.getOwnPropertySymbols,BA=Object.prototype.hasOwnProperty,FA=Object.prototype.propertyIsEnumerable,H$=(e,t,n)=>t in e?$re(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mre=(e,t)=>{for(var n in t||(t={}))BA.call(t,n)&&H$(e,n,t[n]);if(Ig)for(var n of Ig(t))FA.call(t,n)&&H$(e,n,t[n]);return e},Nre=(e,t)=>{var n={};for(var r in e)BA.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ig)for(var r of Ig(e))t.indexOf(r)<0&&FA.call(e,r)&&(n[r]=e[r]);return n};const Tre={variant:"light",size:"md",radius:"xl"},VA=_.forwardRef((e,t)=>{const n=ae("Badge",Tre,e),{className:r,color:o,variant:i,fullWidth:s,children:a,size:c,leftSection:u,rightSection:f,radius:h,gradient:m,classNames:v,styles:y,unstyled:w}=n,P=Nre(n,["className","color","variant","fullWidth","children","size","leftSection","rightSection","radius","gradient","classNames","styles","unstyled"]),{classes:b,cx:S}=Ere({fullWidth:s,color:o,radius:h,gradient:m},{classNames:v,styles:y,name:"Badge",unstyled:w,variant:i,size:c});return k.createElement(Pe,Mre({className:S(b.root,r),ref:t},P),u&&k.createElement("span",{className:b.leftSection},u),k.createElement("span",{className:b.inner},a),f&&k.createElement("span",{className:b.rightSection},f))});VA.displayName="@mantine/core/Badge";const mt=VA;var Ire=ue((e,{orientation:t,buttonBorderWidth:n})=>({root:{display:"flex",flexDirection:t==="vertical"?"column":"row","& [data-button]":{"&:first-of-type:not(:last-of-type)":{borderBottomRightRadius:0,[t==="vertical"?"borderBottomLeftRadius":"borderTopRightRadius"]:0,[t==="vertical"?"borderBottomWidth":"borderRightWidth"]:`calc(${M(n)} / 2)`},"&:last-of-type:not(:first-of-type)":{borderTopLeftRadius:0,[t==="vertical"?"borderTopRightRadius":"borderBottomLeftRadius"]:0,[t==="vertical"?"borderTopWidth":"borderLeftWidth"]:`calc(${M(n)} / 2)`},"&:not(:first-of-type):not(:last-of-type)":{borderRadius:0,[t==="vertical"?"borderTopWidth":"borderLeftWidth"]:`calc(${M(n)} / 2)`,[t==="vertical"?"borderBottomWidth":"borderRightWidth"]:`calc(${M(n)} / 2)`},"& + [data-button]":{[t==="vertical"?"marginTop":"marginLeft"]:`calc(${n} * -1)`,"@media (min-resolution: 192dpi)":{[t==="vertical"?"marginTop":"marginLeft"]:0}}}}}));const jre=Ire;var Dre=Object.defineProperty,jg=Object.getOwnPropertySymbols,HA=Object.prototype.hasOwnProperty,WA=Object.prototype.propertyIsEnumerable,W$=(e,t,n)=>t in e?Dre(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Rre=(e,t)=>{for(var n in t||(t={}))HA.call(t,n)&&W$(e,n,t[n]);if(jg)for(var n of jg(t))WA.call(t,n)&&W$(e,n,t[n]);return e},Lre=(e,t)=>{var n={};for(var r in e)HA.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&jg)for(var r of jg(e))t.indexOf(r)<0&&WA.call(e,r)&&(n[r]=e[r]);return n};const zre={orientation:"horizontal",buttonBorderWidth:1},UA=_.forwardRef((e,t)=>{const n=ae("ButtonGroup",zre,e),{className:r,orientation:o,buttonBorderWidth:i,unstyled:s}=n,a=Lre(n,["className","orientation","buttonBorderWidth","unstyled"]),{classes:c,cx:u}=jre({orientation:o,buttonBorderWidth:i},{name:"ButtonGroup",unstyled:s});return k.createElement(Pe,Rre({className:u(c.root,r),ref:t},a))});UA.displayName="@mantine/core/ButtonGroup";var Are=Object.defineProperty,Bre=Object.defineProperties,Fre=Object.getOwnPropertyDescriptors,U$=Object.getOwnPropertySymbols,Vre=Object.prototype.hasOwnProperty,Hre=Object.prototype.propertyIsEnumerable,Z$=(e,t,n)=>t in e?Are(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ss=(e,t)=>{for(var n in t||(t={}))Vre.call(t,n)&&Z$(e,n,t[n]);if(U$)for(var n of U$(t))Hre.call(t,n)&&Z$(e,n,t[n]);return e},em=(e,t)=>Bre(e,Fre(t));const Wre=["filled","outline","light","white","default","subtle","gradient"],ax={xs:{height:Ln.xs,paddingLeft:M(14),paddingRight:M(14)},sm:{height:Ln.sm,paddingLeft:M(18),paddingRight:M(18)},md:{height:Ln.md,paddingLeft:M(22),paddingRight:M(22)},lg:{height:Ln.lg,paddingLeft:M(26),paddingRight:M(26)},xl:{height:Ln.xl,paddingLeft:M(32),paddingRight:M(32)},"compact-xs":{height:M(22),paddingLeft:M(7),paddingRight:M(7)},"compact-sm":{height:M(26),paddingLeft:M(8),paddingRight:M(8)},"compact-md":{height:M(30),paddingLeft:M(10),paddingRight:M(10)},"compact-lg":{height:M(34),paddingLeft:M(12),paddingRight:M(12)},"compact-xl":{height:M(40),paddingLeft:M(14),paddingRight:M(14)}};function Ure({compact:e,size:t,withLeftIcon:n,withRightIcon:r}){if(e)return ax[`compact-${t}`];const o=ax[t];return o?em(ss({},o),{paddingLeft:n?`calc(${o.paddingLeft} / 1.5)`:o.paddingLeft,paddingRight:r?`calc(${o.paddingRight} / 1.5)`:o.paddingRight}):{}}const Zre=e=>({display:e?"block":"inline-block",width:e?"100%":"auto"});function Gre({variant:e,theme:t,color:n,gradient:r}){if(!Wre.includes(e))return null;const o=t.fn.variant({color:n,variant:e,gradient:r});return e==="gradient"?ss({border:0,backgroundImage:o.background,color:o.color},t.fn.hover({backgroundSize:"200%"})):ss({border:`${M(1)} solid ${o.border}`,backgroundColor:o.background,color:o.color},t.fn.hover({backgroundColor:o.hover}))}var Yre=ue((e,{radius:t,fullWidth:n,compact:r,withLeftIcon:o,withRightIcon:i,color:s,gradient:a},{variant:c,size:u})=>({root:em(ss(em(ss(ss(ss(ss({},Ure({compact:r,size:u,withLeftIcon:o,withRightIcon:i})),e.fn.fontStyles()),e.fn.focusStyles()),Zre(n)),{borderRadius:e.fn.radius(t),fontWeight:600,position:"relative",lineHeight:1,fontSize:re({size:u,sizes:e.fontSizes}),userSelect:"none",cursor:"pointer"}),Gre({variant:c,theme:e,color:s,gradient:a})),{"&:active":e.activeStyles,"&:disabled, &[data-disabled]":{borderColor:"transparent",backgroundColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2],color:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[5],cursor:"not-allowed",backgroundImage:"none",pointerEvents:"none","&:active":{transform:"none"}},"&[data-loading]":{pointerEvents:"none","&::before":em(ss({content:'""'},e.fn.cover(M(-1))),{backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.colors.dark[7],.5):"rgba(255, 255, 255, .5)",borderRadius:e.fn.radius(t),cursor:"not-allowed"})}}),icon:{display:"flex",alignItems:"center"},leftIcon:{marginRight:e.spacing.xs},rightIcon:{marginLeft:e.spacing.xs},centerLoader:{position:"absolute",left:"50%",transform:"translateX(-50%)",opacity:.5},inner:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",overflow:"visible"},label:{whiteSpace:"nowrap",height:"100%",overflow:"hidden",display:"flex",alignItems:"center"}}));const Kre=Yre;var qre=Object.defineProperty,Dg=Object.getOwnPropertySymbols,ZA=Object.prototype.hasOwnProperty,GA=Object.prototype.propertyIsEnumerable,G$=(e,t,n)=>t in e?qre(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Y$=(e,t)=>{for(var n in t||(t={}))ZA.call(t,n)&&G$(e,n,t[n]);if(Dg)for(var n of Dg(t))GA.call(t,n)&&G$(e,n,t[n]);return e},Jre=(e,t)=>{var n={};for(var r in e)ZA.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Dg)for(var r of Dg(e))t.indexOf(r)<0&&GA.call(e,r)&&(n[r]=e[r]);return n};const Qre={size:"sm",type:"button",variant:"filled",loaderPosition:"left"},UP=_.forwardRef((e,t)=>{const n=ae("Button",Qre,e),{className:r,size:o,color:i,type:s,disabled:a,children:c,leftIcon:u,rightIcon:f,fullWidth:h,variant:m,radius:v,uppercase:y,compact:w,loading:P,loaderPosition:b,loaderProps:S,gradient:O,classNames:E,styles:$,unstyled:N}=n,I=Jre(n,["className","size","color","type","disabled","children","leftIcon","rightIcon","fullWidth","variant","radius","uppercase","compact","loading","loaderPosition","loaderProps","gradient","classNames","styles","unstyled"]),{classes:R,cx:B,theme:z}=Kre({radius:v,color:i,fullWidth:h,compact:w,gradient:O,withLeftIcon:!!u,withRightIcon:!!f},{name:"Button",unstyled:N,classNames:E,styles:$,variant:m,size:o}),G=z.fn.variant({color:i,variant:m}),Q=k.createElement(en,Y$({color:G.color,size:`calc(${re({size:o,sizes:ax}).height} / 2)`},S));return k.createElement(ds,Y$({className:B(R.root,r),type:s,disabled:a,"data-button":!0,"data-disabled":a||void 0,"data-loading":P||void 0,ref:t,unstyled:N},I),k.createElement("div",{className:R.inner},(u||P&&b==="left")&&k.createElement("span",{className:B(R.icon,R.leftIcon)},P&&b==="left"?Q:u),P&&b==="center"&&k.createElement("span",{className:R.centerLoader},Q),k.createElement("span",{className:R.label,style:{textTransform:y?"uppercase":void 0}},c),(f||P&&b==="right")&&k.createElement("span",{className:B(R.icon,R.rightIcon)},P&&b==="right"?Q:f)))});UP.displayName="@mantine/core/Button";UP.Group=UA;const at=UP;var Xre=ue((e,{radius:t,shadow:n})=>({root:{outline:0,WebkitTapHighlightColor:"transparent",display:"block",textDecoration:"none",color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white,boxSizing:"border-box",borderRadius:e.fn.radius(t),boxShadow:e.shadows[n]||n||"none","&[data-with-border]":{border:`${M(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`}}}));const eoe=Xre;var toe=Object.defineProperty,Rg=Object.getOwnPropertySymbols,YA=Object.prototype.hasOwnProperty,KA=Object.prototype.propertyIsEnumerable,K$=(e,t,n)=>t in e?toe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,noe=(e,t)=>{for(var n in t||(t={}))YA.call(t,n)&&K$(e,n,t[n]);if(Rg)for(var n of Rg(t))KA.call(t,n)&&K$(e,n,t[n]);return e},roe=(e,t)=>{var n={};for(var r in e)YA.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Rg)for(var r of Rg(e))t.indexOf(r)<0&&KA.call(e,r)&&(n[r]=e[r]);return n};const ooe={},qA=_.forwardRef((e,t)=>{const n=ae("Paper",ooe,e),{className:r,children:o,radius:i,withBorder:s,shadow:a,unstyled:c,variant:u}=n,f=roe(n,["className","children","radius","withBorder","shadow","unstyled","variant"]),{classes:h,cx:m}=eoe({radius:i,shadow:a},{name:"Paper",unstyled:c,variant:u});return k.createElement(Pe,noe({className:m(h.root,r),"data-with-border":s||void 0,ref:t},f),o)});qA.displayName="@mantine/core/Paper";const ioe=qA;var soe=ue((e,{inline:t})=>({root:{display:t?"inline-flex":"flex",alignItems:"center",justifyContent:"center"}}));const aoe=soe;var loe=Object.defineProperty,Lg=Object.getOwnPropertySymbols,JA=Object.prototype.hasOwnProperty,QA=Object.prototype.propertyIsEnumerable,q$=(e,t,n)=>t in e?loe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,coe=(e,t)=>{for(var n in t||(t={}))JA.call(t,n)&&q$(e,n,t[n]);if(Lg)for(var n of Lg(t))QA.call(t,n)&&q$(e,n,t[n]);return e},uoe=(e,t)=>{var n={};for(var r in e)JA.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Lg)for(var r of Lg(e))t.indexOf(r)<0&&QA.call(e,r)&&(n[r]=e[r]);return n};const XA=_.forwardRef((e,t)=>{const n=ae("Center",{},e),{inline:r,className:o,unstyled:i,variant:s}=n,a=uoe(n,["inline","className","unstyled","variant"]),{classes:c,cx:u}=aoe({inline:r},{name:"Center",unstyled:i,variant:s});return k.createElement(Pe,coe({ref:t,className:u(c.root,o)},a))});XA.displayName="@mantine/core/Center";const Zr=XA,e4=_.createContext(null),doe=e4.Provider,foe=()=>_.useContext(e4);var hoe=Object.defineProperty,zg=Object.getOwnPropertySymbols,t4=Object.prototype.hasOwnProperty,n4=Object.prototype.propertyIsEnumerable,J$=(e,t,n)=>t in e?hoe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Q$=(e,t)=>{for(var n in t||(t={}))t4.call(t,n)&&J$(e,n,t[n]);if(zg)for(var n of zg(t))n4.call(t,n)&&J$(e,n,t[n]);return e},poe=(e,t)=>{var n={};for(var r in e)t4.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&zg)for(var r of zg(e))t.indexOf(r)<0&&n4.call(e,r)&&(n[r]=e[r]);return n};const moe={size:"sm"},r4=_.forwardRef((e,t)=>{const n=ae("CheckboxGroup",moe,e),{children:r,value:o,defaultValue:i,onChange:s,size:a,wrapperProps:c}=n,u=poe(n,["children","value","defaultValue","onChange","size","wrapperProps"]),[f,h]=_o({value:o,defaultValue:i,finalValue:[],onChange:s}),m=v=>{const y=v.currentTarget.value;h(f.includes(y)?f.filter(w=>w!==y):[...f,y])};return k.createElement(doe,{value:{value:f,onChange:m,size:a}},k.createElement(et.Wrapper,Q$(Q$({labelElement:"div",size:a,__staticSelector:"CheckboxGroup",ref:t},c),u),r))});r4.displayName="@mantine/core/CheckboxGroup";var goe=Object.defineProperty,Ag=Object.getOwnPropertySymbols,o4=Object.prototype.hasOwnProperty,i4=Object.prototype.propertyIsEnumerable,X$=(e,t,n)=>t in e?goe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Bg=(e,t)=>{for(var n in t||(t={}))o4.call(t,n)&&X$(e,n,t[n]);if(Ag)for(var n of Ag(t))i4.call(t,n)&&X$(e,n,t[n]);return e},s4=(e,t)=>{var n={};for(var r in e)o4.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ag)for(var r of Ag(e))t.indexOf(r)<0&&i4.call(e,r)&&(n[r]=e[r]);return n};function voe(e){const t=e,{width:n,height:r,style:o}=t,i=s4(t,["width","height","style"]);return k.createElement("svg",Bg({viewBox:"0 0 10 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:Bg({width:n,height:r},o)},i),k.createElement("path",{d:"M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}function yoe(e){var t=e,{indeterminate:n}=t,r=s4(t,["indeterminate"]);return n?k.createElement("svg",Bg({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 6"},r),k.createElement("rect",{width:"32",height:"6",fill:"currentColor",rx:"3"})):k.createElement(voe,Bg({},r))}var _oe=Object.defineProperty,woe=Object.defineProperties,boe=Object.getOwnPropertyDescriptors,eM=Object.getOwnPropertySymbols,xoe=Object.prototype.hasOwnProperty,Soe=Object.prototype.propertyIsEnumerable,tM=(e,t,n)=>t in e?_oe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nM=(e,t)=>{for(var n in t||(t={}))xoe.call(t,n)&&tM(e,n,t[n]);if(eM)for(var n of eM(t))Soe.call(t,n)&&tM(e,n,t[n]);return e},rM=(e,t)=>woe(e,boe(t));const Poe={xs:M(16),sm:M(20),md:M(24),lg:M(30),xl:M(36)};var Ooe=ue((e,{radius:t,color:n,transitionDuration:r,labelPosition:o,error:i,indeterminate:s},{size:a})=>{const c=re({size:a,sizes:Poe}),u=e.fn.variant({variant:"filled",color:n});return{icon:rM(nM({},e.fn.cover()),{ref:Br("icon"),color:s?"inherit":e.white,transform:s?"none":`translateY(${M(5)}) scale(0.5)`,opacity:s?1:0,transitionProperty:"opacity, transform",transitionTimingFunction:"ease",transitionDuration:`${r}ms`,pointerEvents:"none",width:"60%",position:"absolute",zIndex:1,margin:"auto","@media (prefers-reduced-motion)":{transitionDuration:e.respectReducedMotion?"0ms":void 0}}),inner:{position:"relative",width:c,height:c,order:o==="left"?2:1},input:rM(nM({},e.fn.focusStyles()),{appearance:"none",backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white,border:`${M(1)} solid ${i?e.fn.variant({variant:"filled",color:"red"}).background:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`,width:c,height:c,borderRadius:e.fn.radius(t),padding:0,display:"block",margin:0,transition:`border-color ${r}ms ease, background-color ${r}ms ease`,cursor:e.cursorType,"&:checked":{backgroundColor:u.background,borderColor:u.background,[`& + .${Br("icon")}`]:{opacity:1,color:e.white,transform:"translateY(0) scale(1)"}},"&:disabled":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2],borderColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[3],cursor:"not-allowed",pointerEvents:"none",[`& + .${Br("icon")}`]:{color:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[5]}}})}});const Coe=Ooe;var koe=Object.defineProperty,Eoe=Object.defineProperties,$oe=Object.getOwnPropertyDescriptors,oM=Object.getOwnPropertySymbols,Moe=Object.prototype.hasOwnProperty,Noe=Object.prototype.propertyIsEnumerable,iM=(e,t,n)=>t in e?koe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Toe=(e,t)=>{for(var n in t||(t={}))Moe.call(t,n)&&iM(e,n,t[n]);if(oM)for(var n of oM(t))Noe.call(t,n)&&iM(e,n,t[n]);return e},Ioe=(e,t)=>Eoe(e,$oe(t));const U_={xs:M(16),sm:M(20),md:M(24),lg:M(30),xl:M(36)};var joe=ue((e,{labelPosition:t},{size:n})=>({root:{},body:{display:"flex","&:has(input:disabled) label":{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]}},labelWrapper:Ioe(Toe({},e.fn.fontStyles()),{display:"inline-flex",flexDirection:"column",WebkitTapHighlightColor:"transparent",fontSize:n in U_?re({size:n,sizes:e.fontSizes}):void 0,lineHeight:n in U_?re({size:n,sizes:U_}):void 0,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,cursor:e.cursorType,order:t==="left"?1:2}),description:{marginTop:`calc(${e.spacing.xs} / 2)`,[t==="left"?"paddingRight":"paddingLeft"]:e.spacing.sm},error:{marginTop:`calc(${e.spacing.xs} / 2)`,[t==="left"?"paddingRight":"paddingLeft"]:e.spacing.sm},label:{cursor:e.cursorType,[t==="left"?"paddingRight":"paddingLeft"]:e.spacing.sm,"&:disabled, &[data-disabled]":{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]}}}));const Doe=joe;var Roe=Object.defineProperty,Fg=Object.getOwnPropertySymbols,a4=Object.prototype.hasOwnProperty,l4=Object.prototype.propertyIsEnumerable,sM=(e,t,n)=>t in e?Roe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Loe=(e,t)=>{for(var n in t||(t={}))a4.call(t,n)&&sM(e,n,t[n]);if(Fg)for(var n of Fg(t))l4.call(t,n)&&sM(e,n,t[n]);return e},zoe=(e,t)=>{var n={};for(var r in e)a4.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Fg)for(var r of Fg(e))t.indexOf(r)<0&&l4.call(e,r)&&(n[r]=e[r]);return n};const ZP=_.forwardRef((e,t)=>{var n=e,{__staticSelector:r,className:o,classNames:i,styles:s,unstyled:a,children:c,label:u,description:f,id:h,disabled:m,error:v,size:y,labelPosition:w,variant:P}=n,b=zoe(n,["__staticSelector","className","classNames","styles","unstyled","children","label","description","id","disabled","error","size","labelPosition","variant"]);const{classes:S,cx:O}=Doe({labelPosition:w},{name:r,styles:s,classNames:i,unstyled:a,variant:P,size:y});return k.createElement(Pe,Loe({className:O(S.root,o),ref:t},b),k.createElement("div",{className:O(S.body)},c,k.createElement("div",{className:S.labelWrapper},u!=null&&k.createElement("label",{className:S.label,"data-disabled":m||void 0,htmlFor:h},u),f&&k.createElement(et.Description,{className:S.description},f),v&&v!=="boolean"&&k.createElement(et.Error,{className:S.error},v))))});ZP.displayName="@mantine/core/InlineInput";var Aoe=Object.defineProperty,Vg=Object.getOwnPropertySymbols,c4=Object.prototype.hasOwnProperty,u4=Object.prototype.propertyIsEnumerable,aM=(e,t,n)=>t in e?Aoe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ap=(e,t)=>{for(var n in t||(t={}))c4.call(t,n)&&aM(e,n,t[n]);if(Vg)for(var n of Vg(t))u4.call(t,n)&&aM(e,n,t[n]);return e},Boe=(e,t)=>{var n={};for(var r in e)c4.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Vg)for(var r of Vg(e))t.indexOf(r)<0&&u4.call(e,r)&&(n[r]=e[r]);return n};const Foe={size:"sm",transitionDuration:100,icon:yoe,labelPosition:"right"},vr=_.forwardRef((e,t)=>{const n=ae("Checkbox",Foe,e),{className:r,style:o,sx:i,checked:s,disabled:a,color:c,label:u,indeterminate:f,id:h,size:m,radius:v,wrapperProps:y,children:w,classNames:P,styles:b,transitionDuration:S,icon:O,unstyled:E,labelPosition:$,description:N,error:I,variant:R}=n,B=Boe(n,["className","style","sx","checked","disabled","color","label","indeterminate","id","size","radius","wrapperProps","children","classNames","styles","transitionDuration","icon","unstyled","labelPosition","description","error","variant"]),z=foe(),G=Ia(h),{systemStyles:Q,rest:X}=Bl(B),{classes:V}=Coe({radius:v,color:c,transitionDuration:S,labelPosition:$,error:!!I,indeterminate:f},{name:"Checkbox",classNames:P,styles:b,unstyled:E,variant:R,size:z?.size||m}),H=z?{checked:z.value.includes(X.value),onChange:z.onChange}:{};return k.createElement(ZP,ap(ap({className:r,sx:i,style:o,id:G,size:z?.size||m,labelPosition:$,label:u,description:N,error:I,disabled:a,__staticSelector:"Checkbox",classNames:P,styles:b,unstyled:E,"data-checked":H.checked||void 0,variant:R},Q),y),k.createElement("div",{className:V.inner},k.createElement("input",ap(ap({id:G,ref:t,type:"checkbox",className:V.input,checked:s,disabled:a},X),H)),k.createElement(O,{indeterminate:f,className:V.icon})))});vr.displayName="@mantine/core/Checkbox";vr.Group=r4;var Voe=Object.defineProperty,Hoe=Object.defineProperties,Woe=Object.getOwnPropertyDescriptors,lM=Object.getOwnPropertySymbols,Uoe=Object.prototype.hasOwnProperty,Zoe=Object.prototype.propertyIsEnumerable,cM=(e,t,n)=>t in e?Voe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,uM=(e,t)=>{for(var n in t||(t={}))Uoe.call(t,n)&&cM(e,n,t[n]);if(lM)for(var n of lM(t))Zoe.call(t,n)&&cM(e,n,t[n]);return e},dM=(e,t)=>Hoe(e,Woe(t)),Goe=ue((e,{radius:t},{size:n})=>{const r=e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3];return{root:dM(uM({},e.fn.focusStyles()),{width:M(n),height:M(n),WebkitTapHighlightColor:"transparent",border:0,borderRadius:e.fn.radius(t),appearance:"none",WebkitAppearance:"none",padding:0,position:"relative",overflow:"hidden"}),overlay:dM(uM({},e.fn.cover()),{position:"absolute",borderRadius:e.fn.radius(t)}),children:{display:"inline-flex",justifyContent:"center",alignItems:"center"},shadowOverlay:{boxShadow:`rgba(0, 0, 0, .1) 0 0 0 ${M(1)} inset, rgb(0, 0, 0, .15) 0 0 ${M(4)} inset`,zIndex:1},alphaOverlay:{backgroundImage:`linear-gradient(45deg, ${r} 25%, transparent 25%), linear-gradient(-45deg, ${r} 25%, transparent 25%), linear-gradient(45deg, transparent 75%, ${r} 75%), linear-gradient(-45deg, ${e.colorScheme==="dark"?e.colors.dark[7]:e.white} 75%, ${r} 75%)`,backgroundSize:`${M(8)} ${M(8)}`,backgroundPosition:`0 0, 0 ${M(4)}, ${M(4)} -${M(4)}, -${M(4)} 0`}}});const Yoe=Goe;var Koe=Object.defineProperty,Hg=Object.getOwnPropertySymbols,d4=Object.prototype.hasOwnProperty,f4=Object.prototype.propertyIsEnumerable,fM=(e,t,n)=>t in e?Koe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qoe=(e,t)=>{for(var n in t||(t={}))d4.call(t,n)&&fM(e,n,t[n]);if(Hg)for(var n of Hg(t))f4.call(t,n)&&fM(e,n,t[n]);return e},Joe=(e,t)=>{var n={};for(var r in e)d4.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Hg)for(var r of Hg(e))t.indexOf(r)<0&&f4.call(e,r)&&(n[r]=e[r]);return n};const Qoe={size:M(25),radius:M(25),withShadow:!0},h4=_.forwardRef((e,t)=>{const n=ae("ColorSwatch",Qoe,e),{color:r,size:o,radius:i,className:s,children:a,classNames:c,styles:u,unstyled:f,withShadow:h,variant:m}=n,v=Joe(n,["color","size","radius","className","children","classNames","styles","unstyled","withShadow","variant"]),{classes:y,cx:w}=Yoe({radius:i},{classNames:c,styles:u,unstyled:f,name:"ColorSwatch",size:o,variant:m});return k.createElement(Pe,qoe({className:w(y.root,s),ref:t},v),k.createElement("div",{className:w(y.alphaOverlay,y.overlay)}),h&&k.createElement("div",{className:w(y.shadowOverlay,y.overlay)}),k.createElement("div",{className:y.overlay,style:{backgroundColor:r}}),k.createElement("div",{className:w(y.children,y.overlay)},a))});h4.displayName="@mantine/core/ColorSwatch";const _f=h4,$i={xs:M(8),sm:M(12),md:M(16),lg:M(20),xl:M(22)};var Xoe=ue((e,t,{size:n})=>{const r=re({size:n,sizes:$i});return{thumb:{overflow:"hidden",boxSizing:"border-box",position:"absolute",boxShadow:`0 0 ${M(1)} rgba(0, 0, 0, .6)`,border:`${M(2)} solid ${e.white}`,backgroundColor:"transparent",width:r,height:r,borderRadius:r}}});const eie=Xoe;var tie=Object.defineProperty,hM=Object.getOwnPropertySymbols,nie=Object.prototype.hasOwnProperty,rie=Object.prototype.propertyIsEnumerable,pM=(e,t,n)=>t in e?tie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,oie=(e,t)=>{for(var n in t||(t={}))nie.call(t,n)&&pM(e,n,t[n]);if(hM)for(var n of hM(t))rie.call(t,n)&&pM(e,n,t[n]);return e};function GP({position:e,className:t,styles:n,classNames:r,style:o,size:i,__staticSelector:s,unstyled:a,variant:c}){const{classes:u,cx:f}=eie(null,{classNames:r,styles:n,name:s,unstyled:a,size:i,variant:c});return k.createElement("div",{className:f(u.thumb,t),style:oie({left:`calc(${e.x*100}% - ${$i[i]} / 2)`,top:`calc(${e.y*100}% - ${$i[i]} / 2)`},o)})}GP.displayName="@mantine/core/Thumb";var iie=Object.defineProperty,mM=Object.getOwnPropertySymbols,sie=Object.prototype.hasOwnProperty,aie=Object.prototype.propertyIsEnumerable,gM=(e,t,n)=>t in e?iie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vM=(e,t)=>{for(var n in t||(t={}))sie.call(t,n)&&gM(e,n,t[n]);if(mM)for(var n of mM(t))aie.call(t,n)&&gM(e,n,t[n]);return e},lie=ue((e,t,{size:n})=>({sliderThumb:{ref:Br("sliderThumb")},slider:{position:"relative",height:`calc(${re({size:n,sizes:$i})} + ${M(2)})`,boxSizing:"border-box",marginLeft:`calc(${re({size:n,sizes:$i})} / 2)`,marginRight:`calc(${re({size:n,sizes:$i})} / 2)`,outline:0,[`&:focus .${Br("sliderThumb")}`]:vM({},e.focusRing==="always"||e.focusRing==="auto"?e.focusRingStyles.styles(e):e.focusRingStyles.resetStyles(e)),[`&:focus:not(:focus-visible) .${Br("sliderThumb")}`]:vM({},e.focusRing==="auto"||e.focusRing==="never"?e.focusRingStyles.resetStyles(e):null)},sliderOverlay:{position:"absolute",boxSizing:"border-box",top:0,bottom:0,left:`calc(${re({size:n,sizes:$i})} * -1 / 2 - ${M(1)})`,right:`calc(${re({size:n,sizes:$i})} * -1 / 2 - ${M(1)})`,borderRadius:1e3}}));const cie=lie;var uie=Object.defineProperty,die=Object.defineProperties,fie=Object.getOwnPropertyDescriptors,Wg=Object.getOwnPropertySymbols,p4=Object.prototype.hasOwnProperty,m4=Object.prototype.propertyIsEnumerable,yM=(e,t,n)=>t in e?uie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hie=(e,t)=>{for(var n in t||(t={}))p4.call(t,n)&&yM(e,n,t[n]);if(Wg)for(var n of Wg(t))m4.call(t,n)&&yM(e,n,t[n]);return e},pie=(e,t)=>die(e,fie(t)),mie=(e,t)=>{var n={};for(var r in e)p4.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Wg)for(var r of Wg(e))t.indexOf(r)<0&&m4.call(e,r)&&(n[r]=e[r]);return n};const YP=_.forwardRef((e,t)=>{var n=e,{value:r,onChange:o,onChangeEnd:i,maxValue:s,round:a,size:c="md",thumbColor:u="transparent",__staticSelector:f="ColorSlider",focusable:h=!0,overlays:m,classNames:v,styles:y,className:w,unstyled:P,variant:b}=n,S=mie(n,["value","onChange","onChangeEnd","maxValue","round","size","thumbColor","__staticSelector","focusable","overlays","classNames","styles","className","unstyled","variant"]);const{classes:O,cx:E}=cie(null,{classNames:v,styles:y,name:f,unstyled:P,variant:b,size:c}),[$,N]=_.useState({y:0,x:r/s}),I=_.useRef($),R=X=>a?Math.round(X*s):X*s,{ref:B}=xL(({x:X,y:V})=>{I.current={x:X,y:V},o(R(X))},{onScrubEnd:()=>{const{x:X}=I.current;i(R(X))}});Hn(()=>{N({y:0,x:r/s})},[r]);const z=(X,V)=>{X.preventDefault();const H=bL(V);o(R(H.x)),i(R(H.x))},G=X=>{switch(X.key){case"ArrowRight":{z(X,{x:$.x+.05,y:$.y});break}case"ArrowLeft":{z(X,{x:$.x-.05,y:$.y});break}}},Q=m.map((X,V)=>k.createElement("div",{className:O.sliderOverlay,style:X,key:V}));return k.createElement(Pe,pie(hie({},S),{ref:Ps(B,t),className:E(O.slider,w),role:"slider","aria-valuenow":r,"aria-valuemax":s,"aria-valuemin":0,tabIndex:h?0:-1,onKeyDown:G}),Q,k.createElement(GP,{__staticSelector:f,classNames:v,styles:y,position:$,style:{top:M(1),backgroundColor:u},className:O.sliderThumb,size:c}))});YP.displayName="@mantine/core/ColorSlider";var gie=Object.defineProperty,vie=Object.defineProperties,yie=Object.getOwnPropertyDescriptors,Ug=Object.getOwnPropertySymbols,g4=Object.prototype.hasOwnProperty,v4=Object.prototype.propertyIsEnumerable,_M=(e,t,n)=>t in e?gie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_ie=(e,t)=>{for(var n in t||(t={}))g4.call(t,n)&&_M(e,n,t[n]);if(Ug)for(var n of Ug(t))v4.call(t,n)&&_M(e,n,t[n]);return e},wie=(e,t)=>vie(e,yie(t)),bie=(e,t)=>{var n={};for(var r in e)g4.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ug)for(var r of Ug(e))t.indexOf(r)<0&&v4.call(e,r)&&(n[r]=e[r]);return n};const xie={},y4=_.forwardRef((e,t)=>{const n=ae("HueSlider",xie,e),{value:r,onChange:o,onChangeEnd:i,__staticSelector:s}=n,a=bie(n,["value","onChange","onChangeEnd","__staticSelector"]);return k.createElement(YP,wie(_ie({},a),{ref:t,value:r,onChange:o,onChangeEnd:i,maxValue:360,thumbColor:`hsl(${r}, 100%, 50%)`,round:!0,__staticSelector:s||"HueSlider",overlays:[{backgroundImage:"linear-gradient(to right,hsl(0,100%,50%),hsl(60,100%,50%),hsl(120,100%,50%),hsl(170,100%,50%),hsl(240,100%,50%),hsl(300,100%,50%),hsl(360,100%,50%))"},{boxShadow:`rgba(0, 0, 0, .1) 0 0 0 ${M(1)} inset, rgb(0, 0, 0, .15) 0 0 ${M(4)} inset`}]}))});y4.displayName="@mantine/core/HueSlider";var Sie=Object.defineProperty,Pie=Object.defineProperties,Oie=Object.getOwnPropertyDescriptors,wM=Object.getOwnPropertySymbols,Cie=Object.prototype.hasOwnProperty,kie=Object.prototype.propertyIsEnumerable,bM=(e,t,n)=>t in e?Sie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xM=(e,t)=>{for(var n in t||(t={}))Cie.call(t,n)&&bM(e,n,t[n]);if(wM)for(var n of wM(t))kie.call(t,n)&&bM(e,n,t[n]);return e},SM=(e,t)=>Pie(e,Oie(t));function Ro(e,t=0,n=10**t){return Math.round(n*e)/n}function Eie({h:e,s:t,l:n,a:r}){const o=t*((n<50?n:100-n)/100);return{h:e,s:o>0?2*o/(n+o)*100:0,v:n+o,a:r}}const $ie={grad:360/400,turn:360,rad:360/(Math.PI*2)};function Mie(e,t="deg"){return Number(e)*($ie[t]||1)}const Nie=/hsla?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i;function PM(e){const t=Nie.exec(e);return t?Eie({h:Mie(t[1],t[2]),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)}):{h:0,s:0,v:0,a:1}}function lx({r:e,g:t,b:n,a:r}){const o=Math.max(e,t,n),i=o-Math.min(e,t,n),s=i?o===e?(t-n)/i:o===t?2+(n-e)/i:4+(e-t)/i:0;return{h:Ro(60*(s<0?s+6:s),3),s:Ro(o?i/o*100:0,3),v:Ro(o/255*100,3),a:r}}function cx(e){const t=e[0]==="#"?e.slice(1):e;return t.length===3?lx({r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:1}):lx({r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16),a:1})}function Tie(e){const t=e[0]==="#"?e.slice(1):e,n=s=>Ro(parseInt(s,16)/255,3);if(t.length===4){const s=t.slice(0,3),a=n(t[3]+t[3]);return SM(xM({},cx(s)),{a})}const r=t.slice(0,6),o=n(t.slice(6,8));return SM(xM({},cx(r)),{a:o})}const Iie=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i;function OM(e){const t=Iie.exec(e);return t?lx({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):{h:0,s:0,v:0,a:1}}const _4={hex:/^#?([0-9A-F]{3}){1,2}$/i,hexa:/^#?([0-9A-F]{4}){1,2}$/i,rgb:/^rgb\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/i,rgba:/^rgba\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/i,hsl:/hsl\(\s*(\d+)\s*,\s*(\d+(?:\.\d+)?%)\s*,\s*(\d+(?:\.\d+)?%)\)/i,hsla:/^hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*(\d*(?:\.\d+)?)\)$/i},jie={hex:cx,hexa:Tie,rgb:OM,rgba:OM,hsl:PM,hsla:PM};function Die(e){for(const[,t]of Object.entries(_4))if(t.test(e))return!0;return!1}function lp(e){if(typeof e!="string")return{h:0,s:0,v:0,a:1};if(e==="transparent")return{h:0,s:0,v:0,a:0};const t=e.trim();for(const[n,r]of Object.entries(_4))if(r.test(t))return jie[n](t);return{h:0,s:0,v:0,a:1}}var Rie=Object.defineProperty,Lie=Object.defineProperties,zie=Object.getOwnPropertyDescriptors,Zg=Object.getOwnPropertySymbols,w4=Object.prototype.hasOwnProperty,b4=Object.prototype.propertyIsEnumerable,CM=(e,t,n)=>t in e?Rie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Aie=(e,t)=>{for(var n in t||(t={}))w4.call(t,n)&&CM(e,n,t[n]);if(Zg)for(var n of Zg(t))b4.call(t,n)&&CM(e,n,t[n]);return e},Bie=(e,t)=>Lie(e,zie(t)),Fie=(e,t)=>{var n={};for(var r in e)w4.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Zg)for(var r of Zg(e))t.indexOf(r)<0&&b4.call(e,r)&&(n[r]=e[r]);return n};const Vie={},x4=_.forwardRef((e,t)=>{const n=ae("AlphaSlider",Vie,e),{value:r,onChange:o,onChangeEnd:i,color:s,__staticSelector:a}=n,c=Fie(n,["value","onChange","onChangeEnd","color","__staticSelector"]),u=ar(),f=u.colorScheme==="dark"?u.colors.dark[4]:u.colors.gray[3];return k.createElement(YP,Bie(Aie({},c),{ref:t,value:r,onChange:h=>o(Ro(h,2)),onChangeEnd:h=>i(Ro(h,2)),maxValue:1,round:!1,__staticSelector:a||"AlphaSlider",overlays:[{backgroundImage:`linear-gradient(45deg, ${f} 25%, transparent 25%), linear-gradient(-45deg, ${f} 25%, transparent 25%), linear-gradient(45deg, transparent 75%, ${f} 75%), linear-gradient(-45deg, ${u.colorScheme==="dark"?u.colors.dark[7]:u.white} 75%, ${f} 75%)`,backgroundSize:`${M(8)} ${M(8)}`,backgroundPosition:`0 0, 0 ${M(4)}, ${M(4)} -${M(4)}, -${M(4)} 0`},{backgroundImage:`linear-gradient(90deg, transparent, ${s})`},{boxShadow:`rgba(0, 0, 0, .1) 0 0 0 ${M(1)} inset, rgb(0, 0, 0, .15) 0 0 ${M(4)} inset`}]}))});x4.displayName="@mantine/core/AlphaSlider";var Hie=Object.defineProperty,kM=Object.getOwnPropertySymbols,Wie=Object.prototype.hasOwnProperty,Uie=Object.prototype.propertyIsEnumerable,EM=(e,t,n)=>t in e?Hie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Z_=(e,t)=>{for(var n in t||(t={}))Wie.call(t,n)&&EM(e,n,t[n]);if(kM)for(var n of kM(t))Uie.call(t,n)&&EM(e,n,t[n]);return e};const Zie={xs:M(100),sm:M(110),md:M(120),lg:M(140),xl:M(160)};var Gie=ue((e,t,{size:n})=>({saturationThumb:{ref:Br("saturationThumb")},saturation:{boxSizing:"border-box",position:"relative",height:re({size:n,sizes:Zie}),borderRadius:e.radius.sm,margin:`calc(${re({size:n,sizes:$i})} / 2)`,WebkitTapHighlightColor:"transparent",[`&:focus .${Br("saturationThumb")}`]:Z_({},e.focusRing==="always"||e.focusRing==="auto"?e.focusRingStyles.styles(e):e.focusRingStyles.resetStyles(e)),[`&:focus:not(:focus-visible) .${Br("saturationThumb")}`]:Z_({},e.focusRing==="auto"||e.focusRing==="never"?e.focusRingStyles.resetStyles(e):null)},saturationOverlay:Z_({boxSizing:"border-box",borderRadius:e.radius.sm},e.fn.cover(`calc(${re({size:n,sizes:$i})} * -1 / 2 - ${M(1)})`))}));const Yie=Gie;function S4({h:e,s:t,v:n,a:r}){const o=e/360*6,i=t/100,s=n/100,a=Math.floor(o),c=s*(1-i),u=s*(1-(o-a)*i),f=s*(1-(1-o+a)*i),h=a%6;return{r:Ro([s,u,c,c,f,s][h]*255),g:Ro([f,s,s,u,c,c][h]*255),b:Ro([c,c,f,s,s,u][h]*255),a:Ro(r,2)}}function $M(e,t){const{r:n,g:r,b:o,a:i}=S4(e);return t?`rgba(${n}, ${r}, ${o}, ${Ro(i,2)})`:`rgb(${n}, ${r}, ${o})`}function MM({h:e,s:t,v:n,a:r},o){const i=(200-t)*n/100,s={h:Math.round(e),s:Math.round(i>0&&i<200?t*n/100/(i<=100?i:200-i)*100:0),l:Math.round(i/2)};return o?`hsla(${s.h}, ${s.s}%, ${s.l}%, ${Ro(r,2)})`:`hsl(${s.h}, ${s.s}%, ${s.l}%)`}function tm(e){const t=e.toString(16);return t.length<2?`0${t}`:t}function P4(e){const{r:t,g:n,b:r}=S4(e);return`#${tm(t)}${tm(n)}${tm(r)}`}function Kie(e){const t=Math.round(e.a*255);return`${P4(e)}${tm(t)}`}const G_={hex:P4,hexa:e=>Kie(e),rgb:e=>$M(e,!1),rgba:e=>$M(e,!0),hsl:e=>MM(e,!1),hsla:e=>MM(e,!0)};function Vs(e,t){return t?e in G_?G_[e](t):G_.hex(t):"#000000"}function O4({value:e,onChange:t,onChangeEnd:n,focusable:r=!0,__staticSelector:o="saturation",size:i,color:s,saturationLabel:a,classNames:c,styles:u,unstyled:f,variant:h}){const{classes:m}=Yie(null,{classNames:c,styles:u,name:o,unstyled:f,variant:h,size:i}),[v,y]=_.useState({x:e.s/100,y:1-e.v/100}),w=_.useRef(v),{ref:P}=xL(({x:O,y:E})=>{w.current={x:O,y:E},t({s:Math.round(O*100),v:Math.round((1-E)*100)})},{onScrubEnd:()=>{const{x:O,y:E}=w.current;n({s:Math.round(O*100),v:Math.round((1-E)*100)})}});_.useEffect(()=>{y({x:e.s/100,y:1-e.v/100})},[e.s,e.v]);const b=(O,E)=>{O.preventDefault();const $=bL(E);t({s:Math.round($.x*100),v:Math.round((1-$.y)*100)}),n({s:Math.round($.x*100),v:Math.round((1-$.y)*100)})},S=O=>{switch(O.key){case"ArrowUp":{b(O,{y:v.y-.05,x:v.x});break}case"ArrowDown":{b(O,{y:v.y+.05,x:v.x});break}case"ArrowRight":{b(O,{x:v.x+.05,y:v.y});break}case"ArrowLeft":{b(O,{x:v.x-.05,y:v.y});break}}};return k.createElement("div",{className:m.saturation,ref:P,role:"slider","aria-label":a,"aria-valuenow":v.x,"aria-valuetext":Vs("rgba",e),tabIndex:r?0:-1,onKeyDown:S},k.createElement("div",{className:m.saturationOverlay,style:{backgroundColor:`hsl(${e.h}, 100%, 50%)`}}),k.createElement("div",{className:m.saturationOverlay,style:{backgroundImage:"linear-gradient(90deg, #fff, transparent)"}}),k.createElement("div",{className:m.saturationOverlay,style:{backgroundImage:"linear-gradient(0deg, #000, transparent)"}}),k.createElement(GP,{__staticSelector:o,classNames:c,styles:u,position:v,className:m.saturationThumb,style:{backgroundColor:s},size:i}))}O4.displayName="@mantine/core/Saturation";var qie=ue((e,{swatchesPerRow:t})=>({swatch:{width:`calc(${100/t}% - ${M(4)})`,height:0,paddingBottom:`calc(${100/t}% - ${M(4)})`,margin:M(2),boxSizing:"content-box"},swatches:{boxSizing:"border-box",marginLeft:M(-2),marginRight:M(-2),display:"flex",flexWrap:"wrap"}}));const Jie=qie;var Qie=Object.defineProperty,Gg=Object.getOwnPropertySymbols,C4=Object.prototype.hasOwnProperty,k4=Object.prototype.propertyIsEnumerable,NM=(e,t,n)=>t in e?Qie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Xie=(e,t)=>{for(var n in t||(t={}))C4.call(t,n)&&NM(e,n,t[n]);if(Gg)for(var n of Gg(t))k4.call(t,n)&&NM(e,n,t[n]);return e},ese=(e,t)=>{var n={};for(var r in e)C4.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Gg)for(var r of Gg(e))t.indexOf(r)<0&&k4.call(e,r)&&(n[r]=e[r]);return n};function E4(e){var t=e,{data:n,swatchesPerRow:r=10,focusable:o=!0,classNames:i,styles:s,__staticSelector:a="color-picker",unstyled:c,setValue:u,onChangeEnd:f,variant:h,size:m}=t,v=ese(t,["data","swatchesPerRow","focusable","classNames","styles","__staticSelector","unstyled","setValue","onChangeEnd","variant","size"]);const{classes:y}=Jie({swatchesPerRow:r},{classNames:i,styles:s,name:a,unstyled:c,variant:h,size:m}),w=n.map((P,b)=>k.createElement(_f,{className:y.swatch,component:"button",type:"button",color:P,key:b,radius:"sm",onClick:()=>{u(P),f?.(P)},style:{cursor:"pointer"},"aria-label":P,tabIndex:o?0:-1}));return k.createElement("div",Xie({className:y.swatches},v),w)}E4.displayName="@mantine/core/Swatches";const tse={xs:M(180),sm:M(200),md:M(240),lg:M(280),xl:M(320)};var nse=ue((e,{fullWidth:t},{size:n})=>({preview:{},wrapper:{boxSizing:"border-box",width:t?"100%":re({size:n,sizes:tse}),padding:M(1)},body:{display:"flex",boxSizing:"border-box",paddingTop:`calc(${re({size:n,sizes:e.spacing})} / 2)`},sliders:{flex:1,boxSizing:"border-box","&:not(:only-child)":{marginRight:e.spacing.xs}},slider:{boxSizing:"border-box","& + &":{marginTop:M(5)}},swatch:{cursor:"pointer"}}));const rse=nse;var ose=Object.defineProperty,ise=Object.defineProperties,sse=Object.getOwnPropertyDescriptors,Yg=Object.getOwnPropertySymbols,$4=Object.prototype.hasOwnProperty,M4=Object.prototype.propertyIsEnumerable,TM=(e,t,n)=>t in e?ose(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dc=(e,t)=>{for(var n in t||(t={}))$4.call(t,n)&&TM(e,n,t[n]);if(Yg)for(var n of Yg(t))M4.call(t,n)&&TM(e,n,t[n]);return e},Y_=(e,t)=>ise(e,sse(t)),ase=(e,t)=>{var n={};for(var r in e)$4.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Yg)for(var r of Yg(e))t.indexOf(r)<0&&M4.call(e,r)&&(n[r]=e[r]);return n};const lse={xs:26,sm:34,md:42,lg:50,xl:54},cse={swatchesPerRow:10,size:"sm",withPicker:!0,focusable:!0,__staticSelector:"ColorPicker"},N4=_.forwardRef((e,t)=>{const n=ae("ColorPicker",cse,e),{value:r,defaultValue:o,onChange:i,onChangeEnd:s,format:a,swatches:c,swatchesPerRow:u,size:f,withPicker:h,fullWidth:m,focusable:v,__staticSelector:y,saturationLabel:w,hueLabel:P,alphaLabel:b,className:S,styles:O,classNames:E,unstyled:$,onColorSwatchClick:N,variant:I}=n,R=ase(n,["value","defaultValue","onChange","onChangeEnd","format","swatches","swatchesPerRow","size","withPicker","fullWidth","focusable","__staticSelector","saturationLabel","hueLabel","alphaLabel","className","styles","classNames","unstyled","onColorSwatchClick","variant"]),{classes:B,cx:z}=rse({fullWidth:m},{classNames:E,styles:O,name:y,unstyled:$,variant:I,size:f}),G=_.useRef(a),Q=_.useRef(null),X=_.useRef(!0),V=a==="hexa"||a==="rgba"||a==="hsla",[H,Z,Y]=_o({value:r,defaultValue:o,finalValue:"#FFFFFF",onChange:i}),[j,W]=_.useState(lp(H)),F=K=>{X.current=!1,W(ee=>{const fe=dc(dc({},ee),K);return Q.current=Vs(G.current,fe),fe}),Z(Q.current),setTimeout(()=>{X.current=!0},0)};return Hn(()=>{Die(r)&&X.current&&(W(lp(r)),X.current=!0)},[r]),Hn(()=>{G.current=a,Z(Vs(a,j))},[a]),k.createElement(Pe,dc({className:z(B.wrapper,S),ref:t},R),h&&k.createElement(k.Fragment,null,k.createElement(O4,{value:j,onChange:F,onChangeEnd:({s:K,v:ee})=>s?.(Vs(G.current,Y_(dc({},j),{s:K,v:ee}))),color:H,styles:O,classNames:E,size:f,focusable:v,saturationLabel:w,__staticSelector:y}),k.createElement("div",{className:B.body},k.createElement("div",{className:B.sliders},k.createElement(y4,{value:j.h,onChange:K=>F({h:K}),onChangeEnd:K=>s?.(Vs(G.current,Y_(dc({},j),{h:K}))),size:f,styles:O,classNames:E,focusable:v,"aria-label":P,__staticSelector:y}),V&&k.createElement(x4,{value:j.a,onChange:K=>F({a:K}),onChangeEnd:K=>{s?.(Vs(G.current,Y_(dc({},j),{a:K})))},size:f,color:Vs("hex",j),style:{marginTop:M(6)},styles:O,classNames:E,focusable:v,"aria-label":b,__staticSelector:y})),V&&k.createElement(_f,{color:H,radius:"sm",size:re({size:f,sizes:lse}),className:B.preview}))),Array.isArray(c)&&k.createElement(E4,{data:c,style:{marginTop:M(5)},swatchesPerRow:u,focusable:v,classNames:E,styles:O,__staticSelector:y,setValue:Z,onChangeEnd:K=>{const ee=Vs(a,lp(K));N?.(ee),s?.(ee),Y||W(lp(K))}}))});N4.displayName="@mantine/core/ColorPicker";const[use,dse]=Cu("Drawer component was not found in tree"),IM={xs:M(320),sm:M(380),md:M(440),lg:M(620),xl:M(780)};var fse=ue((e,{position:t},{size:n})=>({header:{zIndex:1e3},content:{flex:t==="right"||t==="left"?`0 0 ${re({size:n,sizes:IM})}`:"0 0 100%",maxWidth:"100%",maxHeight:"100%",height:t==="right"||t==="left"?"100%":re({size:n,sizes:IM}),borderRadius:0,overflowY:"auto"},inner:{display:"flex",justifyContent:t==="right"?"flex-end":"flex-start",alignItems:t==="bottom"?"flex-end":"flex-start"}}));const hse=fse,[pse,Nu]=Cu("ModalBase component was not found in tree");var mse=ue(()=>({close:{marginLeft:"auto",marginRight:0}}));const gse=mse;var vse=Object.defineProperty,Kg=Object.getOwnPropertySymbols,T4=Object.prototype.hasOwnProperty,I4=Object.prototype.propertyIsEnumerable,jM=(e,t,n)=>t in e?vse(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yse=(e,t)=>{for(var n in t||(t={}))T4.call(t,n)&&jM(e,n,t[n]);if(Kg)for(var n of Kg(t))I4.call(t,n)&&jM(e,n,t[n]);return e},_se=(e,t)=>{var n={};for(var r in e)T4.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Kg)for(var r of Kg(e))t.indexOf(r)<0&&I4.call(e,r)&&(n[r]=e[r]);return n};const wse={size:"sm"},bse=_.forwardRef((e,t)=>{const n=Nu(),r=ae(`${n.__staticSelector}CloseButton`,wse,e),{className:o}=r,i=_se(r,["className"]),{classes:s,cx:a}=gse(null,n.stylesApi);return k.createElement(D0,yse({className:a(s.close,o),ref:t,onClick:n.onClose},i))});var xse=ue(()=>({overlay:{}}));const Sse=xse;var Pse=Object.defineProperty,Ose=Object.defineProperties,Cse=Object.getOwnPropertyDescriptors,DM=Object.getOwnPropertySymbols,kse=Object.prototype.hasOwnProperty,Ese=Object.prototype.propertyIsEnumerable,RM=(e,t,n)=>t in e?Pse(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$se=(e,t)=>{for(var n in t||(t={}))kse.call(t,n)&&RM(e,n,t[n]);if(DM)for(var n of DM(t))Ese.call(t,n)&&RM(e,n,t[n]);return e},Mse=(e,t)=>Ose(e,Cse(t)),Nse=ue((e,{color:t,opacity:n,blur:r,radius:o,gradient:i,fixed:s,zIndex:a})=>({root:Mse($se({},e.fn.cover(0)),{position:s?"fixed":"absolute",backgroundColor:i?void 0:e.fn.rgba(t,n),backgroundImage:i,backdropFilter:r?`blur(${M(r)})`:void 0,borderRadius:e.fn.radius(o),zIndex:a,"&[data-center]":{display:"flex",alignItems:"center",justifyContent:"center"}})}));const Tse=Nse;var Ise=Object.defineProperty,qg=Object.getOwnPropertySymbols,j4=Object.prototype.hasOwnProperty,D4=Object.prototype.propertyIsEnumerable,LM=(e,t,n)=>t in e?Ise(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,jse=(e,t)=>{for(var n in t||(t={}))j4.call(t,n)&&LM(e,n,t[n]);if(qg)for(var n of qg(t))D4.call(t,n)&&LM(e,n,t[n]);return e},Dse=(e,t)=>{var n={};for(var r in e)j4.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&qg)for(var r of qg(e))t.indexOf(r)<0&&D4.call(e,r)&&(n[r]=e[r]);return n};const Rse={opacity:.6,color:"#000",zIndex:ci("modal"),radius:0},R4=_.forwardRef((e,t)=>{const n=ae("Overlay",Rse,e),{variant:r,opacity:o,color:i,blur:s,gradient:a,zIndex:c,radius:u,children:f,className:h,classNames:m,styles:v,unstyled:y,center:w,fixed:P}=n,b=Dse(n,["variant","opacity","color","blur","gradient","zIndex","radius","children","className","classNames","styles","unstyled","center","fixed"]),{classes:S,cx:O}=Tse({color:i,opacity:o,blur:s,radius:u,gradient:a,fixed:P,zIndex:c},{name:"Overlay",classNames:m,styles:v,unstyled:y,variant:r});return k.createElement(Pe,jse({ref:t,className:O(S.root,h),"data-center":w||void 0},b),f)});R4.displayName="@mantine/core/Overlay";const L4=R4;var Lse=Object.defineProperty,zse=Object.defineProperties,Ase=Object.getOwnPropertyDescriptors,Jg=Object.getOwnPropertySymbols,z4=Object.prototype.hasOwnProperty,A4=Object.prototype.propertyIsEnumerable,zM=(e,t,n)=>t in e?Lse(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dd=(e,t)=>{for(var n in t||(t={}))z4.call(t,n)&&zM(e,n,t[n]);if(Jg)for(var n of Jg(t))A4.call(t,n)&&zM(e,n,t[n]);return e},Bse=(e,t)=>zse(e,Ase(t)),Fse=(e,t)=>{var n={};for(var r in e)z4.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Jg)for(var r of Jg(e))t.indexOf(r)<0&&A4.call(e,r)&&(n[r]=e[r]);return n};const Vse={},Hse=_.forwardRef((e,t)=>{const n=Nu(),r=ae(`${n.__staticSelector}Overlay`,Vse,e),{onClick:o,transitionProps:i,style:s,className:a}=r,c=Fse(r,["onClick","transitionProps","style","className"]),{classes:u,cx:f}=Sse(null,n.stylesApi),h=m=>{o?.(m),n.closeOnClickOutside&&n.onClose()};return k.createElement($s,Bse(dd(dd({mounted:n.opened},n.transitionProps),i),{transition:"fade"}),m=>k.createElement(L4,dd({ref:t,onClick:h,fixed:!0,style:dd(dd({},s),m),className:f(u.overlay,a),zIndex:n.zIndex},c)))});var Wse=ue((e,{zIndex:t})=>({inner:{position:"fixed",width:"100%",top:0,bottom:0,maxHeight:"100%",zIndex:t,pointerEvents:"none"},content:{pointerEvents:"all"}}));const Use=Wse;var Zse=Object.defineProperty,Qg=Object.getOwnPropertySymbols,B4=Object.prototype.hasOwnProperty,F4=Object.prototype.propertyIsEnumerable,AM=(e,t,n)=>t in e?Zse(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fd=(e,t)=>{for(var n in t||(t={}))B4.call(t,n)&&AM(e,n,t[n]);if(Qg)for(var n of Qg(t))F4.call(t,n)&&AM(e,n,t[n]);return e},Gse=(e,t)=>{var n={};for(var r in e)B4.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Qg)for(var r of Qg(e))t.indexOf(r)<0&&F4.call(e,r)&&(n[r]=e[r]);return n};const Yse={},Kse=_.forwardRef((e,t)=>{const n=Nu(),r=ae(`${n.__staticSelector}Content`,Yse,e),{className:o,transitionProps:i,style:s,onKeyDown:a}=r,c=Gse(r,["className","transitionProps","style","onKeyDown"]),{classes:u,cx:f}=Use({zIndex:n.zIndex},n.stylesApi),h=m=>{var v;((v=m.target)==null?void 0:v.getAttribute("data-mantine-stop-propagation"))!=="true"&&m.key==="Escape"&&n.closeOnEscape&&n.onClose(),a?.(m)};return k.createElement($s,fd(fd({mounted:n.opened,transition:"pop"},n.transitionProps),i),m=>k.createElement("div",{className:f(u.inner)},k.createElement(LP,{active:n.opened&&n.trapFocus},k.createElement(ioe,fd({component:"section",role:"dialog",tabIndex:-1,"aria-modal":!0,"aria-describedby":n.bodyMounted?n.getBodyId():void 0,"aria-labelledby":n.titleMounted?n.getTitleId():void 0,onKeyDown:h,ref:t,className:f(u.content,o),style:fd(fd({},s),m),shadow:n.shadow},c),c.children))))});var qse=ue((e,{padding:t})=>{const n=re({size:t,sizes:e.spacing});return{header:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:n,paddingRight:`calc(${n} - ${M(5)})`,position:"sticky",top:0,backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white,zIndex:1e3}}});const Jse=qse;var Qse=Object.defineProperty,Xg=Object.getOwnPropertySymbols,V4=Object.prototype.hasOwnProperty,H4=Object.prototype.propertyIsEnumerable,BM=(e,t,n)=>t in e?Qse(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Xse=(e,t)=>{for(var n in t||(t={}))V4.call(t,n)&&BM(e,n,t[n]);if(Xg)for(var n of Xg(t))H4.call(t,n)&&BM(e,n,t[n]);return e},eae=(e,t)=>{var n={};for(var r in e)V4.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Xg)for(var r of Xg(e))t.indexOf(r)<0&&H4.call(e,r)&&(n[r]=e[r]);return n};const tae={},nae=_.forwardRef((e,t)=>{const n=Nu(),r=ae(`${n.__staticSelector}Header`,tae,e),{className:o}=r,i=eae(r,["className"]),{classes:s,cx:a}=Jse({padding:n.padding},n.stylesApi);return k.createElement(Pe,Xse({ref:t,className:a(s.header,o)},i))});var rae=ue(e=>({title:{lineHeight:1,padding:0,margin:0,fontWeight:400,fontSize:e.fontSizes.md}}));const oae=rae;var iae=Object.defineProperty,ev=Object.getOwnPropertySymbols,W4=Object.prototype.hasOwnProperty,U4=Object.prototype.propertyIsEnumerable,FM=(e,t,n)=>t in e?iae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,sae=(e,t)=>{for(var n in t||(t={}))W4.call(t,n)&&FM(e,n,t[n]);if(ev)for(var n of ev(t))U4.call(t,n)&&FM(e,n,t[n]);return e},aae=(e,t)=>{var n={};for(var r in e)W4.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ev)for(var r of ev(e))t.indexOf(r)<0&&U4.call(e,r)&&(n[r]=e[r]);return n};const lae={},cae=_.forwardRef((e,t)=>{const n=Nu(),r=ae(`${n.__staticSelector}Title`,lae,e),{className:o}=r,i=aae(r,["className"]),{classes:s,cx:a}=oae(null,n.stylesApi);return _.useEffect(()=>(n.setTitleMounted(!0),()=>n.setTitleMounted(!1)),[]),k.createElement(Pe,sae({component:"h2",id:n.getTitleId(),className:a(s.title,o),ref:t},i))});var uae=ue((e,{padding:t})=>({body:{padding:re({size:t,sizes:e.spacing}),"&:not(:only-child)":{paddingTop:0}}}));const dae=uae;var fae=Object.defineProperty,tv=Object.getOwnPropertySymbols,Z4=Object.prototype.hasOwnProperty,G4=Object.prototype.propertyIsEnumerable,VM=(e,t,n)=>t in e?fae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hae=(e,t)=>{for(var n in t||(t={}))Z4.call(t,n)&&VM(e,n,t[n]);if(tv)for(var n of tv(t))G4.call(t,n)&&VM(e,n,t[n]);return e},pae=(e,t)=>{var n={};for(var r in e)Z4.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&tv)for(var r of tv(e))t.indexOf(r)<0&&G4.call(e,r)&&(n[r]=e[r]);return n};const mae={},gae=_.forwardRef((e,t)=>{const n=Nu(),r=ae(`${n.__staticSelector}Body`,mae,e),{className:o}=r,i=pae(r,["className"]),{classes:s,cx:a}=dae({padding:n.padding},n.stylesApi);return _.useEffect(()=>(n.setBodyMounted(!0),()=>n.setBodyMounted(!1)),[]),k.createElement(Pe,hae({id:n.getBodyId(),className:a(s.body,o),ref:t},i))});function vae({children:e}){return k.createElement(k.Fragment,null,e)}function yae({opened:e,transitionDuration:t}){const[n,r]=_.useState(e),o=_.useRef(),s=MS()?0:t;return _.useEffect(()=>(e?(r(!0),window.clearTimeout(o.current)):s===0?r(!1):o.current=window.setTimeout(()=>r(!1),s),()=>window.clearTimeout(o.current)),[e,s]),n}var _ae=ue(()=>({root:{}}));const wae=_ae;var bae=Object.defineProperty,xae=Object.defineProperties,Sae=Object.getOwnPropertyDescriptors,nv=Object.getOwnPropertySymbols,Y4=Object.prototype.hasOwnProperty,K4=Object.prototype.propertyIsEnumerable,HM=(e,t,n)=>t in e?bae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,K_=(e,t)=>{for(var n in t||(t={}))Y4.call(t,n)&&HM(e,n,t[n]);if(nv)for(var n of nv(t))K4.call(t,n)&&HM(e,n,t[n]);return e},WM=(e,t)=>xae(e,Sae(t)),Pae=(e,t)=>{var n={};for(var r in e)Y4.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&nv)for(var r of nv(e))t.indexOf(r)<0&&K4.call(e,r)&&(n[r]=e[r]);return n};const qf={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:ci("modal"),padding:"md",size:"md",shadow:"xl"};function tt(e){const t=ae("ModalBase",qf,e),{opened:n,onClose:r,children:o,closeOnClickOutside:i,__staticSelector:s,transitionProps:a,withinPortal:c,portalProps:u,keepMounted:f,target:h,zIndex:m,lockScroll:v,trapFocus:y,closeOnEscape:w,returnFocus:P,padding:b,shadow:S,id:O,size:E,variant:$,classNames:N,unstyled:I,styles:R,className:B}=t,z=Pae(t,["opened","onClose","children","closeOnClickOutside","__staticSelector","transitionProps","withinPortal","portalProps","keepMounted","target","zIndex","lockScroll","trapFocus","closeOnEscape","returnFocus","padding","shadow","id","size","variant","classNames","unstyled","styles","className"]),{classes:G,cx:Q}=wae(null,{name:s,classNames:N,styles:R,unstyled:I,variant:$,size:E}),X=Ia(O),[V,H]=_.useState(!1),[Z,Y]=_.useState(!1),j=typeof a?.duration=="number"?a?.duration:200,W=yae({opened:n,transitionDuration:j});return Pm("keydown",F=>{!y&&F.key==="Escape"&&w&&r()}),gL({opened:n,shouldReturnFocus:y&&P}),k.createElement(Zf,WM(K_({},u),{withinPortal:c,target:h}),k.createElement(pse,{value:{__staticSelector:s,opened:n,onClose:r,closeOnClickOutside:i,transitionProps:WM(K_({},a),{duration:j,keepMounted:f}),zIndex:m,padding:b,id:X,getTitleId:()=>`${X}-title`,getBodyId:()=>`${X}-body`,titleMounted:V,bodyMounted:Z,setTitleMounted:H,setBodyMounted:Y,trapFocus:y,closeOnEscape:w,shadow:S,stylesApi:{name:s,size:E,variant:$,classNames:N,styles:R,unstyled:I}}},k.createElement(OU,{enabled:W&&v},k.createElement(Pe,K_({className:Q(G.root,B)},z),o))))}tt.CloseButton=bse;tt.Overlay=Hse;tt.Content=Kse;tt.Header=nae;tt.Title=cae;tt.Body=gae;tt.NativeScrollArea=vae;var Oae=Object.defineProperty,Cae=Object.defineProperties,kae=Object.getOwnPropertyDescriptors,rv=Object.getOwnPropertySymbols,q4=Object.prototype.hasOwnProperty,J4=Object.prototype.propertyIsEnumerable,UM=(e,t,n)=>t in e?Oae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nm=(e,t)=>{for(var n in t||(t={}))q4.call(t,n)&&UM(e,n,t[n]);if(rv)for(var n of rv(t))J4.call(t,n)&&UM(e,n,t[n]);return e},Q4=(e,t)=>Cae(e,kae(t)),Eae=(e,t)=>{var n={};for(var r in e)q4.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&rv)for(var r of rv(e))t.indexOf(r)<0&&J4.call(e,r)&&(n[r]=e[r]);return n};const $ae={top:"slide-down",bottom:"slide-up",left:"slide-right",right:"slide-left"},Mae={top:"slide-down",bottom:"slide-up",right:"slide-right",left:"slide-left"},Nae=Q4(nm({},qf),{position:"left"});function X4(e){const t=ae("DrawerRoot",Nae,e),{classNames:n,variant:r,size:o,scrollAreaComponent:i,position:s,transitionProps:a}=t,c=Eae(t,["classNames","variant","size","scrollAreaComponent","position","transitionProps"]),{classes:u,cx:f,theme:h}=hse({position:s},{name:"Drawer",variant:r,size:o}),m=(h.dir==="rtl"?Mae:$ae)[s];return k.createElement(use,{value:{scrollAreaComponent:i}},k.createElement(tt,nm({__staticSelector:"Drawer",size:o,variant:r,transitionProps:nm({transition:m,duration:200},a),classNames:Q4(nm({},n),{content:f(u.content,n?.content),inner:f(u.inner,n?.inner)})},c)))}var Tae=Object.defineProperty,ov=Object.getOwnPropertySymbols,e6=Object.prototype.hasOwnProperty,t6=Object.prototype.propertyIsEnumerable,ZM=(e,t,n)=>t in e?Tae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Iae=(e,t)=>{for(var n in t||(t={}))e6.call(t,n)&&ZM(e,n,t[n]);if(ov)for(var n of ov(t))t6.call(t,n)&&ZM(e,n,t[n]);return e},jae=(e,t)=>{var n={};for(var r in e)e6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ov)for(var r of ov(e))t.indexOf(r)<0&&t6.call(e,r)&&(n[r]=e[r]);return n};const Dae={shadow:"xl"},n6=_.forwardRef((e,t)=>{const n=ae("ModalContent",Dae,e),{children:r,scrollAreaComponent:o}=n,i=jae(n,["children","scrollAreaComponent"]),s=dse(),a=o||s.scrollAreaComponent||tt.NativeScrollArea;return k.createElement(tt.Content,Iae({ref:t,radius:0},i),k.createElement(a,{style:{height:"100vh"}},r))});var Rae=Object.defineProperty,Lae=Object.defineProperties,zae=Object.getOwnPropertyDescriptors,iv=Object.getOwnPropertySymbols,r6=Object.prototype.hasOwnProperty,o6=Object.prototype.propertyIsEnumerable,GM=(e,t,n)=>t in e?Rae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,rm=(e,t)=>{for(var n in t||(t={}))r6.call(t,n)&&GM(e,n,t[n]);if(iv)for(var n of iv(t))o6.call(t,n)&&GM(e,n,t[n]);return e},Aae=(e,t)=>Lae(e,zae(t)),Bae=(e,t)=>{var n={};for(var r in e)r6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&iv)for(var r of iv(e))t.indexOf(r)<0&&o6.call(e,r)&&(n[r]=e[r]);return n};const Fae=Aae(rm({},qf),{withOverlay:!0,withCloseButton:!0});function Ms(e){const t=ae("Drawer",Fae,e),{title:n,withOverlay:r,overlayProps:o,withCloseButton:i,closeButtonProps:s,children:a}=t,c=Bae(t,["title","withOverlay","overlayProps","withCloseButton","closeButtonProps","children"]),u=!!n||i;return k.createElement(X4,rm({},c),r&&k.createElement(tt.Overlay,rm({},o)),k.createElement(n6,null,u&&k.createElement(tt.Header,null,n&&k.createElement(tt.Title,null,n),i&&k.createElement(tt.CloseButton,rm({},s))),k.createElement(tt.Body,null,a)))}Ms.Root=X4;Ms.CloseButton=tt.CloseButton;Ms.Overlay=tt.Overlay;Ms.Content=n6;Ms.Header=tt.Header;Ms.Title=tt.Title;Ms.Body=tt.Body;Ms.NativeScrollArea=tt.NativeScrollArea;function Vae(e){return _.Children.toArray(e).filter(Boolean)}const Hae={left:"flex-start",center:"center",right:"flex-end",apart:"space-between"};var Wae=ue((e,{spacing:t,position:n,noWrap:r,grow:o,align:i,count:s})=>({root:{boxSizing:"border-box",display:"flex",flexDirection:"row",alignItems:i||"center",flexWrap:r?"nowrap":"wrap",justifyContent:Hae[n],gap:re({size:t,sizes:e.spacing}),"& > *":{boxSizing:"border-box",maxWidth:o?`calc(${100/s}% - (${M(re({size:t,sizes:e.spacing}))} - ${re({size:t,sizes:e.spacing})} / ${s}))`:void 0,flexGrow:o?1:0}}}));const Uae=Wae;var Zae=Object.defineProperty,sv=Object.getOwnPropertySymbols,i6=Object.prototype.hasOwnProperty,s6=Object.prototype.propertyIsEnumerable,YM=(e,t,n)=>t in e?Zae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Gae=(e,t)=>{for(var n in t||(t={}))i6.call(t,n)&&YM(e,n,t[n]);if(sv)for(var n of sv(t))s6.call(t,n)&&YM(e,n,t[n]);return e},Yae=(e,t)=>{var n={};for(var r in e)i6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&sv)for(var r of sv(e))t.indexOf(r)<0&&s6.call(e,r)&&(n[r]=e[r]);return n};const Kae={position:"left",spacing:"md"},nt=_.forwardRef((e,t)=>{const n=ae("Group",Kae,e),{className:r,position:o,align:i,children:s,noWrap:a,grow:c,spacing:u,unstyled:f,variant:h}=n,m=Yae(n,["className","position","align","children","noWrap","grow","spacing","unstyled","variant"]),v=Vae(s),{classes:y,cx:w}=Uae({align:i,grow:c,noWrap:a,spacing:u,position:o,count:v.length},{unstyled:f,name:"Group",variant:h});return k.createElement(Pe,Gae({className:w(y.root,r),ref:t},m),v)});nt.displayName="@mantine/core/Group";function qae({open:e,close:t,openDelay:n,closeDelay:r}){const o=_.useRef(-1),i=_.useRef(-1),s=()=>{window.clearTimeout(o.current),window.clearTimeout(i.current)},a=()=>{s(),n===0?e():o.current=window.setTimeout(e,n)},c=()=>{s(),r===0?t():i.current=window.setTimeout(t,r)};return _.useEffect(()=>s,[]),{openDropdown:a,closeDropdown:c}}var Jae=Object.defineProperty,av=Object.getOwnPropertySymbols,a6=Object.prototype.hasOwnProperty,l6=Object.prototype.propertyIsEnumerable,KM=(e,t,n)=>t in e?Jae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qM=(e,t)=>{for(var n in t||(t={}))a6.call(t,n)&&KM(e,n,t[n]);if(av)for(var n of av(t))l6.call(t,n)&&KM(e,n,t[n]);return e},Qae=(e,t)=>{var n={};for(var r in e)a6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&av)for(var r of av(e))t.indexOf(r)<0&&l6.call(e,r)&&(n[r]=e[r]);return n};function Xae(e){const t=e,{width:n,height:r,style:o}=t,i=Qae(t,["width","height","style"]);return k.createElement("svg",qM({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:qM({width:n,height:r},o)},i),k.createElement("path",{d:"M2.5 1H12.5C13.3284 1 14 1.67157 14 2.5V12.5C14 13.3284 13.3284 14 12.5 14H2.5C1.67157 14 1 13.3284 1 12.5V2.5C1 1.67157 1.67157 1 2.5 1ZM2.5 2C2.22386 2 2 2.22386 2 2.5V8.3636L3.6818 6.6818C3.76809 6.59551 3.88572 6.54797 4.00774 6.55007C4.12975 6.55216 4.24568 6.60372 4.32895 6.69293L7.87355 10.4901L10.6818 7.6818C10.8575 7.50607 11.1425 7.50607 11.3182 7.6818L13 9.3636V2.5C13 2.22386 12.7761 2 12.5 2H2.5ZM2 12.5V9.6364L3.98887 7.64753L7.5311 11.4421L8.94113 13H2.5C2.22386 13 2 12.7761 2 12.5ZM12.5 13H10.155L8.48336 11.153L11 8.6364L13 10.6364V12.5C13 12.7761 12.7761 13 12.5 13ZM6.64922 5.5C6.64922 5.03013 7.03013 4.64922 7.5 4.64922C7.96987 4.64922 8.35078 5.03013 8.35078 5.5C8.35078 5.96987 7.96987 6.35078 7.5 6.35078C7.03013 6.35078 6.64922 5.96987 6.64922 5.5ZM7.5 3.74922C6.53307 3.74922 5.74922 4.53307 5.74922 5.5C5.74922 6.46693 6.53307 7.25078 7.5 7.25078C8.46693 7.25078 9.25078 6.46693 9.25078 5.5C9.25078 4.53307 8.46693 3.74922 7.5 3.74922Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}var ele=Object.defineProperty,tle=Object.defineProperties,nle=Object.getOwnPropertyDescriptors,JM=Object.getOwnPropertySymbols,rle=Object.prototype.hasOwnProperty,ole=Object.prototype.propertyIsEnumerable,QM=(e,t,n)=>t in e?ele(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,XM=(e,t)=>{for(var n in t||(t={}))rle.call(t,n)&&QM(e,n,t[n]);if(JM)for(var n of JM(t))ole.call(t,n)&&QM(e,n,t[n]);return e},eN=(e,t)=>tle(e,nle(t)),ile=ue((e,{radius:t})=>({root:{},imageWrapper:{position:"relative"},figure:{margin:0},image:eN(XM({},e.fn.fontStyles()),{display:"block",width:"100%",height:"100%",border:0,borderRadius:e.fn.radius(t)}),caption:{color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[7],marginTop:e.spacing.xs},placeholder:eN(XM({},e.fn.cover()),{display:"flex",alignItems:"center",justifyContent:"center",color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],backgroundColor:e.colorScheme==="dark"?e.colors.dark[8]:e.colors.gray[0],borderRadius:e.fn.radius(t)})}));const sle=ile;var ale=Object.defineProperty,lle=Object.defineProperties,cle=Object.getOwnPropertyDescriptors,lv=Object.getOwnPropertySymbols,c6=Object.prototype.hasOwnProperty,u6=Object.prototype.propertyIsEnumerable,tN=(e,t,n)=>t in e?ale(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hd=(e,t)=>{for(var n in t||(t={}))c6.call(t,n)&&tN(e,n,t[n]);if(lv)for(var n of lv(t))u6.call(t,n)&&tN(e,n,t[n]);return e},ule=(e,t)=>lle(e,cle(t)),dle=(e,t)=>{var n={};for(var r in e)c6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&lv)for(var r of lv(e))t.indexOf(r)<0&&u6.call(e,r)&&(n[r]=e[r]);return n};const fle={fit:"cover",width:"100%",height:"auto",radius:0},ai=_.forwardRef((e,t)=>{const n=ae("Image",fle,e),{className:r,alt:o,src:i,fit:s,width:a,height:c,radius:u,imageProps:f,withPlaceholder:h,placeholder:m,imageRef:v,classNames:y,styles:w,caption:P,unstyled:b,style:S,variant:O}=n,E=dle(n,["className","alt","src","fit","width","height","radius","imageProps","withPlaceholder","placeholder","imageRef","classNames","styles","caption","unstyled","style","variant"]),{classes:$,cx:N}=sle({radius:u},{classNames:y,styles:w,unstyled:b,name:"Image",variant:O}),[I,R]=_.useState(!i),B=h&&I;return Hn(()=>{R(!i)},[i]),k.createElement(Pe,hd({className:N($.root,r),style:hd({width:M(a)},S),ref:t},E),k.createElement("figure",{className:$.figure},k.createElement("div",{className:$.imageWrapper},k.createElement("img",ule(hd({src:i,alt:o,ref:v},f),{className:N($.image,f?.className),onError:z=>{R(!0),typeof f?.onError=="function"&&f.onError(z)},style:hd(hd({objectFit:s,width:M(a),height:M(c)},B&&{overflow:"hidden"}),f?.style)})),B&&k.createElement("div",{className:$.placeholder,title:o},m||k.createElement("div",null,k.createElement(Xae,{width:M(40),height:M(40)})))),!!P&&k.createElement(U,{component:"figcaption",size:"sm",align:"center",className:$.caption},P)))});ai.displayName="@mantine/core/Image";var hle=Object.defineProperty,ple=Object.defineProperties,mle=Object.getOwnPropertyDescriptors,nN=Object.getOwnPropertySymbols,gle=Object.prototype.hasOwnProperty,vle=Object.prototype.propertyIsEnumerable,rN=(e,t,n)=>t in e?hle(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,oN=(e,t)=>{for(var n in t||(t={}))gle.call(t,n)&&rN(e,n,t[n]);if(nN)for(var n of nN(t))vle.call(t,n)&&rN(e,n,t[n]);return e},iN=(e,t)=>ple(e,mle(t));const yle=e=>fG({from:{boxShadow:`0 0 ${M(.5)} 0 ${e}`,opacity:.6},to:{boxShadow:`0 0 ${M(.5)} ${M(4.4)} ${e}`,opacity:0}});function sN(e,t=0){const n={},[r,o]=e.split("-");let i="",s="";return r==="top"&&(n.top=t,s="-50%"),r==="middle"&&(n.top="50%",s="-50%"),r==="bottom"&&(n.bottom=t,s="50%"),o==="start"&&(n.left=t,i="-50%"),o==="center"&&(n.left="50%",i="-50%"),o==="end"&&(n.right=t,i="50%"),n.transform=`translate(${i}, ${s})`,n}var _le=ue((e,{radius:t,color:n,position:r,offset:o,inline:i,withBorder:s,withLabel:a,zIndex:c},{size:u})=>{const{background:f}=e.fn.variant({variant:"filled",primaryFallback:!1,color:n||e.primaryColor}),h=M(u);return{root:{position:"relative",display:i?"inline-block":"block"},indicator:iN(oN({},sN(r,o)),{zIndex:c,position:"absolute",[a?"minWidth":"width"]:h,height:h,display:"flex",justifyContent:"center",alignItems:"center",fontSize:e.fontSizes.xs,paddingLeft:a?`calc(${e.spacing.xs} / 2)`:0,paddingRight:a?`calc(${e.spacing.xs} / 2)`:0,borderRadius:e.fn.radius(t),backgroundColor:e.fn.variant({variant:"filled",primaryFallback:!1,color:n||e.primaryColor}).background,border:s?`${M(2)} solid ${e.colorScheme==="dark"?e.colors.dark[7]:e.white}`:void 0,color:e.white,whiteSpace:"nowrap"}),processing:{animation:`${yle(f)} 1000ms linear infinite`},common:iN(oN({},sN(r,o)),{position:"absolute",[a?"minWidth":"width"]:h,height:h,borderRadius:e.fn.radius(t)})}});const wle=_le;var ble=Object.defineProperty,cv=Object.getOwnPropertySymbols,d6=Object.prototype.hasOwnProperty,f6=Object.prototype.propertyIsEnumerable,aN=(e,t,n)=>t in e?ble(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xle=(e,t)=>{for(var n in t||(t={}))d6.call(t,n)&&aN(e,n,t[n]);if(cv)for(var n of cv(t))f6.call(t,n)&&aN(e,n,t[n]);return e},Sle=(e,t)=>{var n={};for(var r in e)d6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&cv)for(var r of cv(e))t.indexOf(r)<0&&f6.call(e,r)&&(n[r]=e[r]);return n};const Ple={position:"top-end",offset:0,inline:!1,withBorder:!1,disabled:!1,processing:!1,size:10,radius:1e3,zIndex:ci("app")},h6=_.forwardRef((e,t)=>{const n=ae("Indicator",Ple,e),{children:r,position:o,offset:i,size:s,radius:a,inline:c,withBorder:u,className:f,color:h,styles:m,label:v,classNames:y,disabled:w,zIndex:P,unstyled:b,processing:S,variant:O}=n,E=Sle(n,["children","position","offset","size","radius","inline","withBorder","className","color","styles","label","classNames","disabled","zIndex","unstyled","processing","variant"]),{classes:$,cx:N}=wle({position:o,offset:i,radius:a,inline:c,color:h,withBorder:u,zIndex:P,withLabel:!!v},{name:"Indicator",classNames:y,styles:m,unstyled:b,variant:O,size:s});return k.createElement(Pe,xle({ref:t,className:N($.root,f)},E),!w&&k.createElement(k.Fragment,null,k.createElement("div",{className:N($.indicator,$.common)},v),S&&k.createElement("div",{className:N($.processing,$.common)})),r)});h6.displayName="@mantine/core/Indicator";function Ole(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var Cle=_.useLayoutEffect,kle=function(t){var n=_.useRef(t);return Cle(function(){n.current=t}),n},lN=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},Ele=function(t,n){var r=_.useRef();return _.useCallback(function(o){t.current=o,r.current&&lN(r.current,null),r.current=n,n&&lN(n,o)},[n])},cN={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},uN=function(t){Object.keys(cN).forEach(function(n){t.style.setProperty(n,cN[n],"important")})},ro=null,$le=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function Mle(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),ro||(ro=document.createElement("textarea"),ro.setAttribute("tabindex","-1"),ro.setAttribute("aria-hidden","true"),uN(ro)),ro.parentNode===null&&document.body.appendChild(ro);var o=e.paddingSize,i=e.borderSize,s=e.sizingStyle,a=s.boxSizing;Object.keys(s).forEach(function(m){var v=m;ro.style[v]=s[v]}),uN(ro),ro.value=t;var c=$le(ro,e);ro.value="x";var u=ro.scrollHeight-o,f=u*n;a==="border-box"&&(f=f+o+i),c=Math.max(f,c);var h=u*r;return a==="border-box"&&(h=h+o+i),c=Math.min(h,c),[c,u]}var dN=function(){},Nle=function(t,n){return t.reduce(function(r,o){return r[o]=n[o],r},{})},Tle=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak"],Ile=!!document.documentElement.currentStyle,jle=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=Nle(Tle,n),o=r.boxSizing;if(o==="")return null;Ile&&o==="border-box"&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px");var i=parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),s=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:i,borderSize:s}},Dle=function(t){var n=kle(t);_.useLayoutEffect(function(){var r=function(i){n.current(i)};return window.addEventListener("resize",r),function(){window.removeEventListener("resize",r)}},[])},Rle=function(t,n){var r=t.cacheMeasurements,o=t.maxRows,i=t.minRows,s=t.onChange,a=s===void 0?dN:s,c=t.onHeightChange,u=c===void 0?dN:c,f=Ole(t,["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"]),h=f.value!==void 0,m=_.useRef(null),v=Ele(m,n),y=_.useRef(0),w=_.useRef(),P=function(){var O=m.current,E=r&&w.current?w.current:jle(O);if(E){w.current=E;var $=Mle(E,O.value||O.placeholder||"x",i,o),N=$[0],I=$[1];y.current!==N&&(y.current=N,O.style.setProperty("height",N+"px","important"),u(N,{rowHeight:I}))}},b=function(O){h||P(),a(O)};return _.useLayoutEffect(P),Dle(P),_.createElement("textarea",jt({},f,{onChange:b,ref:v}))},Lle=_.forwardRef(Rle);const zle=Lle;var Ale=ue(e=>({input:{paddingTop:e.spacing.xs,paddingBottom:e.spacing.xs}}));const Ble=Ale;var Fle=Object.defineProperty,Vle=Object.defineProperties,Hle=Object.getOwnPropertyDescriptors,uv=Object.getOwnPropertySymbols,p6=Object.prototype.hasOwnProperty,m6=Object.prototype.propertyIsEnumerable,fN=(e,t,n)=>t in e?Fle(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fc=(e,t)=>{for(var n in t||(t={}))p6.call(t,n)&&fN(e,n,t[n]);if(uv)for(var n of uv(t))m6.call(t,n)&&fN(e,n,t[n]);return e},q_=(e,t)=>Vle(e,Hle(t)),Wle=(e,t)=>{var n={};for(var r in e)p6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&uv)for(var r of uv(e))t.indexOf(r)<0&&m6.call(e,r)&&(n[r]=e[r]);return n};const Ule={autosize:!1,size:"sm",__staticSelector:"Textarea"},g6=_.forwardRef((e,t)=>{const n=ae("Textarea",Ule,e),{autosize:r,maxRows:o,minRows:i,label:s,error:a,description:c,id:u,className:f,required:h,style:m,wrapperProps:v,classNames:y,styles:w,size:P,__staticSelector:b,sx:S,errorProps:O,descriptionProps:E,labelProps:$,inputWrapperOrder:N,inputContainer:I,unstyled:R,withAsterisk:B,variant:z}=n,G=Wle(n,["autosize","maxRows","minRows","label","error","description","id","className","required","style","wrapperProps","classNames","styles","size","__staticSelector","sx","errorProps","descriptionProps","labelProps","inputWrapperOrder","inputContainer","unstyled","withAsterisk","variant"]),Q=Ia(u),{classes:X,cx:V}=Ble(),{systemStyles:H,rest:Z}=Bl(G),Y=fc({required:h,ref:t,error:a,id:Q,classNames:q_(fc({},y),{input:V(X.input,y?.input)}),styles:w,__staticSelector:b,size:P,multiline:!0,unstyled:R,variant:z},Z);return k.createElement(et.Wrapper,fc(fc({label:s,error:a,id:Q,description:c,required:h,style:m,className:f,classNames:y,styles:w,size:P,__staticSelector:b,sx:S,errorProps:O,labelProps:$,descriptionProps:E,inputContainer:I,inputWrapperOrder:N,unstyled:R,withAsterisk:B,variant:z},H),v),r?k.createElement(et,q_(fc({},Y),{component:zle,maxRows:o,minRows:i})):k.createElement(et,q_(fc({},Y),{component:"textarea",rows:i})))});g6.displayName="@mantine/core/Textarea";var Zle=Object.defineProperty,Gle=Object.defineProperties,Yle=Object.getOwnPropertyDescriptors,hN=Object.getOwnPropertySymbols,Kle=Object.prototype.hasOwnProperty,qle=Object.prototype.propertyIsEnumerable,pN=(e,t,n)=>t in e?Zle(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Jle=(e,t)=>{for(var n in t||(t={}))Kle.call(t,n)&&pN(e,n,t[n]);if(hN)for(var n of hN(t))qle.call(t,n)&&pN(e,n,t[n]);return e},Qle=(e,t)=>Gle(e,Yle(t)),Xle=ue(e=>({root:Qle(Jle({},e.fn.cover()),{display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"})}));const ece=Xle;var tce=Object.defineProperty,nce=Object.defineProperties,rce=Object.getOwnPropertyDescriptors,dv=Object.getOwnPropertySymbols,v6=Object.prototype.hasOwnProperty,y6=Object.prototype.propertyIsEnumerable,mN=(e,t,n)=>t in e?tce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,cp=(e,t)=>{for(var n in t||(t={}))v6.call(t,n)&&mN(e,n,t[n]);if(dv)for(var n of dv(t))y6.call(t,n)&&mN(e,n,t[n]);return e},oce=(e,t)=>nce(e,rce(t)),ice=(e,t)=>{var n={};for(var r in e)v6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&dv)for(var r of dv(e))t.indexOf(r)<0&&y6.call(e,r)&&(n[r]=e[r]);return n};const sce={overlayOpacity:.75,transitionDuration:0,radius:0,zIndex:ci("overlay")},V0=_.forwardRef((e,t)=>{const n=ae("LoadingOverlay",sce,e),{className:r,visible:o,loaderProps:i,overlayOpacity:s,overlayColor:a,transitionDuration:c,exitTransitionDuration:u,zIndex:f,style:h,loader:m,radius:v,overlayBlur:y,unstyled:w,variant:P,keepMounted:b}=n,S=ice(n,["className","visible","loaderProps","overlayOpacity","overlayColor","transitionDuration","exitTransitionDuration","zIndex","style","loader","radius","overlayBlur","unstyled","variant","keepMounted"]),{classes:O,cx:E,theme:$}=ece(null,{name:"LoadingOverlay",unstyled:w,variant:P}),N=`calc(${f} + 1)`;return k.createElement($s,{keepMounted:b,duration:c,exitDuration:u,mounted:o,transition:"fade"},I=>k.createElement(Pe,cp({className:E(O.root,r),style:oce(cp(cp({},I),h),{zIndex:f}),ref:t},S),m?k.createElement("div",{style:{zIndex:N}},m):k.createElement(en,cp({style:{zIndex:N}},i)),k.createElement(L4,{opacity:s,zIndex:f,radius:v,blur:y,unstyled:w,color:a||($.colorScheme==="dark"?$.colors.dark[5]:$.white)})))});V0.displayName="@mantine/core/LoadingOverlay";const _6={context:"Menu component was not found in the tree",children:"Menu.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported"},[ace,Jf]=Cu(_6.context);var lce=ue(e=>({divider:{marginTop:M(4),marginBottom:M(4),borderTop:`${M(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]}`}}));const cce=lce;var uce=Object.defineProperty,fv=Object.getOwnPropertySymbols,w6=Object.prototype.hasOwnProperty,b6=Object.prototype.propertyIsEnumerable,gN=(e,t,n)=>t in e?uce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dce=(e,t)=>{for(var n in t||(t={}))w6.call(t,n)&&gN(e,n,t[n]);if(fv)for(var n of fv(t))b6.call(t,n)&&gN(e,n,t[n]);return e},fce=(e,t)=>{var n={};for(var r in e)w6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&fv)for(var r of fv(e))t.indexOf(r)<0&&b6.call(e,r)&&(n[r]=e[r]);return n};const hce={},x6=_.forwardRef((e,t)=>{const n=ae("MenuDivider",hce,e),{children:r,className:o}=n,i=fce(n,["children","className"]),{classNames:s,styles:a,unstyled:c,variant:u}=Jf(),{classes:f,cx:h}=cce(null,{name:"Menu",classNames:s,styles:a,unstyled:c,variant:u});return k.createElement(Pe,dce({className:h(f.divider,o),ref:t},i))});x6.displayName="@mantine/core/MenuDivider";var pce=Object.defineProperty,hv=Object.getOwnPropertySymbols,S6=Object.prototype.hasOwnProperty,P6=Object.prototype.propertyIsEnumerable,vN=(e,t,n)=>t in e?pce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mce=(e,t)=>{for(var n in t||(t={}))S6.call(t,n)&&vN(e,n,t[n]);if(hv)for(var n of hv(t))P6.call(t,n)&&vN(e,n,t[n]);return e},gce=(e,t)=>{var n={};for(var r in e)S6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&hv)for(var r of hv(e))t.indexOf(r)<0&&P6.call(e,r)&&(n[r]=e[r]);return n};const vce={};function O6(e){const t=ae("MenuDropdown",vce,e),{children:n,onMouseEnter:r,onMouseLeave:o}=t,i=gce(t,["children","onMouseEnter","onMouseLeave"]),s=_.useRef(),a=Jf(),c=h=>{var m;(h.key==="ArrowUp"||h.key==="ArrowDown")&&(h.preventDefault(),(m=s.current.querySelectorAll("[data-menu-item]:not(:disabled)")[0])==null||m.focus())},u=ls(r,()=>a.trigger==="hover"&&a.openDropdown()),f=ls(o,()=>a.trigger==="hover"&&a.closeDropdown());return k.createElement(En.Dropdown,mce({onMouseEnter:u,onMouseLeave:f,role:"menu","aria-orientation":"vertical"},i),k.createElement("div",{tabIndex:-1,"data-menu-dropdown":!0,"data-autofocus":!0,onKeyDown:c,ref:s,style:{outline:0}},n))}O6.displayName="@mantine/core/MenuDropdown";var yce=Object.defineProperty,_ce=Object.defineProperties,wce=Object.getOwnPropertyDescriptors,yN=Object.getOwnPropertySymbols,bce=Object.prototype.hasOwnProperty,xce=Object.prototype.propertyIsEnumerable,_N=(e,t,n)=>t in e?yce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Sce=(e,t)=>{for(var n in t||(t={}))bce.call(t,n)&&_N(e,n,t[n]);if(yN)for(var n of yN(t))xce.call(t,n)&&_N(e,n,t[n]);return e},Pce=(e,t)=>_ce(e,wce(t)),Oce=ue((e,{color:t,radius:n})=>({item:Pce(Sce({},e.fn.fontStyles()),{WebkitTapHighlightColor:"transparent",fontSize:e.fontSizes.sm,border:0,backgroundColor:"transparent",outline:0,width:"100%",textAlign:"left",textDecoration:"none",boxSizing:"border-box",padding:`${e.spacing.xs} ${e.spacing.sm}`,cursor:"pointer",borderRadius:e.fn.radius(n),color:t?e.fn.variant({variant:"filled",primaryFallback:!1,color:t}).background:e.colorScheme==="dark"?e.colors.dark[0]:e.black,display:"flex",alignItems:"center","&:disabled":{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5],pointerEvents:"none",userSelect:"none"},"&[data-hovered]":{backgroundColor:t?e.fn.variant({variant:"light",color:t}).background:e.colorScheme==="dark"?e.fn.rgba(e.colors.dark[3],.35):e.colors.gray[1]}}),itemLabel:{flex:1},itemIcon:{display:"flex",justifyContent:"center",alignItems:"center",marginRight:e.spacing.xs},itemRightSection:{}}));const Cce=Oce;var kce=Object.defineProperty,Ece=Object.defineProperties,$ce=Object.getOwnPropertyDescriptors,pv=Object.getOwnPropertySymbols,C6=Object.prototype.hasOwnProperty,k6=Object.prototype.propertyIsEnumerable,wN=(e,t,n)=>t in e?kce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mce=(e,t)=>{for(var n in t||(t={}))C6.call(t,n)&&wN(e,n,t[n]);if(pv)for(var n of pv(t))k6.call(t,n)&&wN(e,n,t[n]);return e},Nce=(e,t)=>Ece(e,$ce(t)),Tce=(e,t)=>{var n={};for(var r in e)C6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&pv)for(var r of pv(e))t.indexOf(r)<0&&k6.call(e,r)&&(n[r]=e[r]);return n};const Ice={},E6=_.forwardRef((e,t)=>{const n=ae("MenuItem",Ice,e),{children:r,className:o,color:i,closeMenuOnClick:s,icon:a,rightSection:c}=n,u=Tce(n,["children","className","color","closeMenuOnClick","icon","rightSection"]),f=Jf(),{classes:h,cx:m,theme:v}=Cce({radius:f.radius,color:i},{name:"Menu",classNames:f.classNames,styles:f.styles,unstyled:f.unstyled,variant:f.variant}),y=_.useRef(),w=f.getItemIndex(y.current),P=u,b=ls(P.onMouseLeave,()=>f.setHovered(-1)),S=ls(P.onMouseEnter,()=>f.setHovered(f.getItemIndex(y.current))),O=ls(P.onClick,()=>{typeof s=="boolean"?s&&f.closeDropdownImmediately():f.closeOnItemClick&&f.closeDropdownImmediately()}),E=ls(P.onFocus,()=>f.setHovered(f.getItemIndex(y.current)));return k.createElement(Pe,Nce(Mce({component:"button",type:"button"},u),{tabIndex:-1,onFocus:E,className:m(h.item,o),ref:Ps(y,t),role:"menuitem","data-menu-item":!0,"data-hovered":f.hovered===w?!0:void 0,onMouseEnter:S,onMouseLeave:b,onClick:O,onKeyDown:$U({siblingSelector:"[data-menu-item]",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:f.loop,dir:v.dir,orientation:"vertical",onKeyDown:P.onKeydown})}),a&&k.createElement("div",{className:h.itemIcon},a),r&&k.createElement("div",{className:h.itemLabel},r),c&&k.createElement("div",{className:h.itemRightSection},c))});E6.displayName="@mantine/core/MenuItem";const jce=E6;var Dce=ue(e=>({label:{color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],fontWeight:500,fontSize:e.fontSizes.xs,padding:`calc(${e.spacing.xs} / 2) ${e.spacing.sm}`,cursor:"default"}}));const Rce=Dce;var Lce=Object.defineProperty,mv=Object.getOwnPropertySymbols,$6=Object.prototype.hasOwnProperty,M6=Object.prototype.propertyIsEnumerable,bN=(e,t,n)=>t in e?Lce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zce=(e,t)=>{for(var n in t||(t={}))$6.call(t,n)&&bN(e,n,t[n]);if(mv)for(var n of mv(t))M6.call(t,n)&&bN(e,n,t[n]);return e},Ace=(e,t)=>{var n={};for(var r in e)$6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&mv)for(var r of mv(e))t.indexOf(r)<0&&M6.call(e,r)&&(n[r]=e[r]);return n};const Bce={},N6=_.forwardRef((e,t)=>{const n=ae("MenuLabel",Bce,e),{children:r,className:o}=n,i=Ace(n,["children","className"]),{classNames:s,styles:a,unstyled:c,variant:u}=Jf(),{classes:f,cx:h}=Rce(null,{name:"Menu",classNames:s,styles:a,unstyled:c,variant:u});return k.createElement(U,zce({className:h(f.label,o),ref:t},i),r)});N6.displayName="@mantine/core/MenuLabel";var Fce=Object.defineProperty,gv=Object.getOwnPropertySymbols,T6=Object.prototype.hasOwnProperty,I6=Object.prototype.propertyIsEnumerable,xN=(e,t,n)=>t in e?Fce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Vce=(e,t)=>{for(var n in t||(t={}))T6.call(t,n)&&xN(e,n,t[n]);if(gv)for(var n of gv(t))I6.call(t,n)&&xN(e,n,t[n]);return e},Hce=(e,t)=>{var n={};for(var r in e)T6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&gv)for(var r of gv(e))t.indexOf(r)<0&&I6.call(e,r)&&(n[r]=e[r]);return n};const Wce={refProp:"ref"},j6=_.forwardRef((e,t)=>{const n=ae("MenuTarget",Wce,e),{children:r,refProp:o}=n,i=Hce(n,["children","refProp"]);if(!zf(r))throw new Error(_6.children);const s=Jf(),a=ls(r.props.onClick,()=>s.trigger==="click"&&s.toggleDropdown()),c=ls(r.props.onMouseEnter,()=>s.trigger==="hover"&&s.openDropdown()),u=ls(r.props.onMouseLeave,()=>s.trigger==="hover"&&s.closeDropdown());return k.createElement(En.Target,Vce({refProp:o,popupType:"menu",ref:t},i),_.cloneElement(r,{onClick:a,onMouseEnter:c,onMouseLeave:u,"data-expanded":s.opened?!0:void 0}))});j6.displayName="@mantine/core/MenuTarget";var Uce=ue({dropdown:{padding:M(4)}});const Zce=Uce;var Gce=Object.defineProperty,Yce=Object.defineProperties,Kce=Object.getOwnPropertyDescriptors,vv=Object.getOwnPropertySymbols,D6=Object.prototype.hasOwnProperty,R6=Object.prototype.propertyIsEnumerable,SN=(e,t,n)=>t in e?Gce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,PN=(e,t)=>{for(var n in t||(t={}))D6.call(t,n)&&SN(e,n,t[n]);if(vv)for(var n of vv(t))R6.call(t,n)&&SN(e,n,t[n]);return e},ON=(e,t)=>Yce(e,Kce(t)),qce=(e,t)=>{var n={};for(var r in e)D6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&vv)for(var r of vv(e))t.indexOf(r)<0&&R6.call(e,r)&&(n[r]=e[r]);return n};const Jce={closeOnItemClick:!0,loop:!0,trigger:"click",openDelay:0,closeDelay:100};function Tt(e){const t=ae("Menu",Jce,e),{children:n,onOpen:r,onClose:o,opened:i,defaultOpened:s,onChange:a,closeOnItemClick:c,loop:u,closeOnEscape:f,trigger:h,openDelay:m,closeDelay:v,classNames:y,styles:w,unstyled:P,radius:b,variant:S}=t,O=qce(t,["children","onOpen","onClose","opened","defaultOpened","onChange","closeOnItemClick","loop","closeOnEscape","trigger","openDelay","closeDelay","classNames","styles","unstyled","radius","variant"]),{classes:E,cx:$}=Zce(),[N,{setHovered:I,resetHovered:R}]=jU(),[B,z]=_o({value:i,defaultValue:s,finalValue:!1,onChange:a}),G=()=>{z(!1),B&&o?.()},Q=()=>{z(!0),!B&&r?.()},X=()=>B?G():Q(),{openDropdown:V,closeDropdown:H}=qae({open:Q,close:G,closeDelay:v,openDelay:m}),Z=Y=>MU("[data-menu-item]","[data-menu-dropdown]",Y);return Hn(()=>{R()},[B]),k.createElement(ace,{value:{opened:B,toggleDropdown:X,getItemIndex:Z,hovered:N,setHovered:I,closeOnItemClick:c,closeDropdown:h==="click"?G:H,openDropdown:h==="click"?Q:V,closeDropdownImmediately:G,loop:u,trigger:h,radius:b,classNames:y,styles:w,unstyled:P,variant:S}},k.createElement(En,ON(PN({},O),{radius:b,opened:B,onChange:X,defaultOpened:s,trapFocus:h==="click",closeOnEscape:f&&h==="click",__staticSelector:"Menu",classNames:ON(PN({},y),{dropdown:$(E.dropdown,y?.dropdown)}),styles:w,unstyled:P,variant:S}),n))}Tt.displayName="@mantine/core/Menu";Tt.Item=jce;Tt.Label=N6;Tt.Dropdown=O6;Tt.Target=j6;Tt.Divider=x6;const[Qce,Xce]=Cu("Modal component was not found in tree"),eue={xs:M(320),sm:M(380),md:M(440),lg:M(620),xl:M(780)};var tue=ue((e,{yOffset:t,xOffset:n,centered:r,fullScreen:o},{size:i})=>({content:{flex:o?"0 0 100%":`0 0 ${re({size:i,sizes:eue})}`,maxWidth:"100%",maxHeight:o?void 0:`calc(100dvh - (${M(t)} * 2))`,height:o?"100vh":void 0,borderRadius:o?0:void 0,overflowY:"auto"},inner:{paddingTop:o?0:t,paddingBottom:o?0:t,paddingLeft:o?0:n,paddingRight:o?0:n,display:"flex",justifyContent:"center",alignItems:r?"center":"flex-start"}}));const nue=tue;var rue=Object.defineProperty,oue=Object.defineProperties,iue=Object.getOwnPropertyDescriptors,yv=Object.getOwnPropertySymbols,L6=Object.prototype.hasOwnProperty,z6=Object.prototype.propertyIsEnumerable,CN=(e,t,n)=>t in e?rue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ux=(e,t)=>{for(var n in t||(t={}))L6.call(t,n)&&CN(e,n,t[n]);if(yv)for(var n of yv(t))z6.call(t,n)&&CN(e,n,t[n]);return e},A6=(e,t)=>oue(e,iue(t)),sue=(e,t)=>{var n={};for(var r in e)L6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&yv)for(var r of yv(e))t.indexOf(r)<0&&z6.call(e,r)&&(n[r]=e[r]);return n};const aue=A6(ux({},qf),{yOffset:"5dvh",xOffset:"5vw"});function B6(e){const t=ae("ModalRoot",aue,e),{classNames:n,variant:r,size:o,yOffset:i,xOffset:s,scrollAreaComponent:a,radius:c,centered:u,fullScreen:f}=t,h=sue(t,["classNames","variant","size","yOffset","xOffset","scrollAreaComponent","radius","centered","fullScreen"]),{classes:m,cx:v}=nue({yOffset:i,xOffset:s,centered:u,fullScreen:f},{name:"Modal",variant:r,size:o});return k.createElement(Qce,{value:{yOffset:i,scrollAreaComponent:a,radius:c}},k.createElement(tt,ux({__staticSelector:"Modal",size:o,variant:r,classNames:A6(ux({},n),{content:v(m.content,n?.content),inner:v(m.inner,n?.inner)})},h)))}var lue=Object.defineProperty,_v=Object.getOwnPropertySymbols,F6=Object.prototype.hasOwnProperty,V6=Object.prototype.propertyIsEnumerable,kN=(e,t,n)=>t in e?lue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,cue=(e,t)=>{for(var n in t||(t={}))F6.call(t,n)&&kN(e,n,t[n]);if(_v)for(var n of _v(t))V6.call(t,n)&&kN(e,n,t[n]);return e},uue=(e,t)=>{var n={};for(var r in e)F6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&_v)for(var r of _v(e))t.indexOf(r)<0&&V6.call(e,r)&&(n[r]=e[r]);return n};const due={shadow:"xl"},H6=_.forwardRef((e,t)=>{const n=ae("ModalContent",due,e),{children:r,scrollAreaComponent:o}=n,i=uue(n,["children","scrollAreaComponent"]),s=Xce(),a=o||s.scrollAreaComponent||tt.NativeScrollArea;return k.createElement(tt.Content,cue({ref:t,radius:s.radius},i),k.createElement(a,{style:{maxHeight:`calc(100dvh - (${M(s.yOffset)} * 2))`}},r))});var fue=Object.defineProperty,hue=Object.defineProperties,pue=Object.getOwnPropertyDescriptors,wv=Object.getOwnPropertySymbols,W6=Object.prototype.hasOwnProperty,U6=Object.prototype.propertyIsEnumerable,EN=(e,t,n)=>t in e?fue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,om=(e,t)=>{for(var n in t||(t={}))W6.call(t,n)&&EN(e,n,t[n]);if(wv)for(var n of wv(t))U6.call(t,n)&&EN(e,n,t[n]);return e},mue=(e,t)=>hue(e,pue(t)),gue=(e,t)=>{var n={};for(var r in e)W6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&wv)for(var r of wv(e))t.indexOf(r)<0&&U6.call(e,r)&&(n[r]=e[r]);return n};const vue=mue(om({},qf),{transitionProps:{duration:200,transition:"pop"},withOverlay:!0,withCloseButton:!0});function Bi(e){const t=ae("Modal",vue,e),{title:n,withOverlay:r,overlayProps:o,withCloseButton:i,closeButtonProps:s,children:a}=t,c=gue(t,["title","withOverlay","overlayProps","withCloseButton","closeButtonProps","children"]),u=!!n||i;return k.createElement(B6,om({},c),r&&k.createElement(tt.Overlay,om({},o)),k.createElement(H6,null,u&&k.createElement(tt.Header,null,n&&k.createElement(tt.Title,null,n),i&&k.createElement(tt.CloseButton,om({},s))),k.createElement(tt.Body,null,a)))}Bi.Root=B6;Bi.CloseButton=tt.CloseButton;Bi.Overlay=tt.Overlay;Bi.Content=H6;Bi.Header=tt.Header;Bi.Title=tt.Title;Bi.Body=tt.Body;Bi.NativeScrollArea=tt.NativeScrollArea;const Z6={xs:M(16),sm:M(22),md:M(26),lg:M(30),xl:M(36)},yue={xs:M(10),sm:M(12),md:M(14),lg:M(16),xl:M(18)};var _ue=ue((e,{disabled:t,radius:n,readOnly:r},{size:o,variant:i})=>({defaultValue:{display:"flex",alignItems:"center",backgroundColor:t?e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[3]:e.colorScheme==="dark"?e.colors.dark[7]:i==="filled"?e.white:e.colors.gray[1],color:t?e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[7]:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],height:re({size:o,sizes:Z6}),paddingLeft:`calc(${re({size:o,sizes:e.spacing})} / 1.5)`,paddingRight:t||r?re({size:o,sizes:e.spacing}):0,fontWeight:500,fontSize:re({size:o,sizes:yue}),borderRadius:re({size:n,sizes:e.radius}),cursor:t?"not-allowed":"default",userSelect:"none",maxWidth:`calc(100% - ${M(10)})`},defaultValueRemove:{color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],marginLeft:`calc(${re({size:o,sizes:e.spacing})} / 6)`},defaultValueLabel:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}));const wue=_ue;var bue=Object.defineProperty,bv=Object.getOwnPropertySymbols,G6=Object.prototype.hasOwnProperty,Y6=Object.prototype.propertyIsEnumerable,$N=(e,t,n)=>t in e?bue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xue=(e,t)=>{for(var n in t||(t={}))G6.call(t,n)&&$N(e,n,t[n]);if(bv)for(var n of bv(t))Y6.call(t,n)&&$N(e,n,t[n]);return e},Sue=(e,t)=>{var n={};for(var r in e)G6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&bv)for(var r of bv(e))t.indexOf(r)<0&&Y6.call(e,r)&&(n[r]=e[r]);return n};const Pue={xs:16,sm:22,md:24,lg:26,xl:30};function K6(e){var t=e,{label:n,classNames:r,styles:o,className:i,onRemove:s,disabled:a,readOnly:c,size:u,radius:f="sm",variant:h,unstyled:m}=t,v=Sue(t,["label","classNames","styles","className","onRemove","disabled","readOnly","size","radius","variant","unstyled"]);const{classes:y,cx:w}=wue({disabled:a,readOnly:c,radius:f},{name:"MultiSelect",classNames:r,styles:o,unstyled:m,size:u,variant:h});return k.createElement("div",xue({className:w(y.defaultValue,i)},v),k.createElement("span",{className:y.defaultValueLabel},n),!a&&!c&&k.createElement(D0,{"aria-hidden":!0,onMouseDown:s,size:Pue[u],radius:2,color:"blue",variant:"transparent",iconSize:"70%",className:y.defaultValueRemove,tabIndex:-1,unstyled:m}))}K6.displayName="@mantine/core/MultiSelect/DefaultValue";function Oue({data:e,searchable:t,limit:n,searchValue:r,filter:o,value:i,disableSelectedItemFiltering:s}){if(!t&&i.length===0)return e;if(!t){const c=[];for(let u=0;uf===e[u].value&&!e[u].disabled))&&c.push(e[u]);return c}const a=[];for(let c=0;cu===e[c].value&&!e[c].disabled),e[c])&&a.push(e[c]),!(a.length>=n));c+=1);return a}var Cue=Object.defineProperty,xv=Object.getOwnPropertySymbols,q6=Object.prototype.hasOwnProperty,J6=Object.prototype.propertyIsEnumerable,MN=(e,t,n)=>t in e?Cue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,NN=(e,t)=>{for(var n in t||(t={}))q6.call(t,n)&&MN(e,n,t[n]);if(xv)for(var n of xv(t))J6.call(t,n)&&MN(e,n,t[n]);return e},kue=(e,t)=>{var n={};for(var r in e)q6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&xv)for(var r of xv(e))t.indexOf(r)<0&&J6.call(e,r)&&(n[r]=e[r]);return n};const Eue={xs:M(14),sm:M(18),md:M(20),lg:M(24),xl:M(28)};function $ue(e){var t=e,{size:n,error:r,style:o}=t,i=kue(t,["size","error","style"]);const s=ar(),a=re({size:n,sizes:Eue});return k.createElement("svg",NN({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:NN({color:r?s.colors.red[6]:s.colors.gray[6],width:a,height:a},o),"data-chevron":!0},i),k.createElement("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}var Mue=Object.defineProperty,Nue=Object.defineProperties,Tue=Object.getOwnPropertyDescriptors,TN=Object.getOwnPropertySymbols,Iue=Object.prototype.hasOwnProperty,jue=Object.prototype.propertyIsEnumerable,IN=(e,t,n)=>t in e?Mue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Due=(e,t)=>{for(var n in t||(t={}))Iue.call(t,n)&&IN(e,n,t[n]);if(TN)for(var n of TN(t))jue.call(t,n)&&IN(e,n,t[n]);return e},Rue=(e,t)=>Nue(e,Tue(t));function Q6({shouldClear:e,clearButtonProps:t,onClear:n,size:r,error:o}){return e?k.createElement(D0,Rue(Due({},t),{variant:"transparent",onClick:n,size:r,onMouseDown:i=>i.preventDefault()})):k.createElement($ue,{error:o,size:r})}Q6.displayName="@mantine/core/SelectRightSection";var Lue=Object.defineProperty,zue=Object.defineProperties,Aue=Object.getOwnPropertyDescriptors,Sv=Object.getOwnPropertySymbols,X6=Object.prototype.hasOwnProperty,e8=Object.prototype.propertyIsEnumerable,jN=(e,t,n)=>t in e?Lue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,J_=(e,t)=>{for(var n in t||(t={}))X6.call(t,n)&&jN(e,n,t[n]);if(Sv)for(var n of Sv(t))e8.call(t,n)&&jN(e,n,t[n]);return e},DN=(e,t)=>zue(e,Aue(t)),Bue=(e,t)=>{var n={};for(var r in e)X6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Sv)for(var r of Sv(e))t.indexOf(r)<0&&e8.call(e,r)&&(n[r]=e[r]);return n};function t8(e){var t=e,{styles:n,rightSection:r,rightSectionWidth:o,theme:i}=t,s=Bue(t,["styles","rightSection","rightSectionWidth","theme"]);if(r)return{rightSection:r,rightSectionWidth:o,styles:n};const a=typeof n=="function"?n(i):n;return{rightSection:!s.readOnly&&!(s.disabled&&s.shouldClear)&&k.createElement(Q6,J_({},s)),styles:DN(J_({},a),{rightSection:DN(J_({},a?.rightSection),{pointerEvents:s.shouldClear?void 0:"none"})})}}var Fue=Object.defineProperty,Vue=Object.defineProperties,Hue=Object.getOwnPropertyDescriptors,RN=Object.getOwnPropertySymbols,Wue=Object.prototype.hasOwnProperty,Uue=Object.prototype.propertyIsEnumerable,LN=(e,t,n)=>t in e?Fue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Zue=(e,t)=>{for(var n in t||(t={}))Wue.call(t,n)&&LN(e,n,t[n]);if(RN)for(var n of RN(t))Uue.call(t,n)&&LN(e,n,t[n]);return e},Gue=(e,t)=>Vue(e,Hue(t)),Yue=ue((e,{invalid:t},{size:n})=>({wrapper:{position:"relative","&:has(input:disabled)":{cursor:"not-allowed",pointerEvents:"none","& .mantine-MultiSelect-input":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[1],color:e.colors.dark[2],opacity:.6,"&::placeholder":{color:e.colors.dark[2]}},"& .mantine-MultiSelect-defaultValue":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[3],color:e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[7]}}},values:{minHeight:`calc(${re({size:n,sizes:Ln})} - ${M(2)})`,display:"flex",alignItems:"center",flexWrap:"wrap",marginLeft:`calc(-${e.spacing.xs} / 2)`,boxSizing:"border-box","&[data-clearable]":{marginRight:re({size:n,sizes:Ln})}},value:{margin:`calc(${e.spacing.xs} / 2 - ${M(2)}) calc(${e.spacing.xs} / 2)`},searchInput:Gue(Zue({},e.fn.fontStyles()),{flex:1,minWidth:M(60),backgroundColor:"transparent",border:0,outline:0,fontSize:re({size:n,sizes:e.fontSizes}),padding:0,marginLeft:`calc(${e.spacing.xs} / 2)`,appearance:"none",color:"inherit",maxHeight:re({size:n,sizes:Z6}),"&::placeholder":{opacity:1,color:t?e.colors.red[e.fn.primaryShade()]:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]},"&:disabled":{cursor:"not-allowed",pointerEvents:"none"}}),searchInputEmpty:{width:"100%"},searchInputInputHidden:{flex:0,width:0,minWidth:0,margin:0,overflow:"hidden"},searchInputPointer:{cursor:"pointer","&:disabled":{cursor:"not-allowed",pointerEvents:"none"}},input:{cursor:"pointer","&:disabled":{cursor:"not-allowed",pointerEvents:"none"}}}));const Kue=Yue;var que=Object.defineProperty,Jue=Object.defineProperties,Que=Object.getOwnPropertyDescriptors,Pv=Object.getOwnPropertySymbols,n8=Object.prototype.hasOwnProperty,r8=Object.prototype.propertyIsEnumerable,zN=(e,t,n)=>t in e?que(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hc=(e,t)=>{for(var n in t||(t={}))n8.call(t,n)&&zN(e,n,t[n]);if(Pv)for(var n of Pv(t))r8.call(t,n)&&zN(e,n,t[n]);return e},AN=(e,t)=>Jue(e,Que(t)),Xue=(e,t)=>{var n={};for(var r in e)n8.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Pv)for(var r of Pv(e))t.indexOf(r)<0&&r8.call(e,r)&&(n[r]=e[r]);return n};function ede(e,t,n){return t?!1:n.label.toLowerCase().trim().includes(e.toLowerCase().trim())}function tde(e,t){return!!e&&!t.some(n=>n.value.toLowerCase()===e.toLowerCase())}function BN(e,t){if(!Array.isArray(e))return;if(t.length===0)return[];const n=t.map(r=>typeof r=="object"?r.value:r);return e.filter(r=>n.includes(r))}const nde={size:"sm",valueComponent:K6,itemComponent:SP,transitionProps:{transition:"fade",duration:0},maxDropdownHeight:220,shadow:"sm",searchable:!1,filter:ede,limit:1/0,clearSearchOnChange:!0,clearable:!1,clearSearchOnBlur:!1,disabled:!1,initiallyOpened:!1,creatable:!1,shouldCreate:tde,switchDirectionOnFlip:!1,zIndex:ci("popover"),selectOnBlur:!1,positionDependencies:[],dropdownPosition:"flip"},KP=_.forwardRef((e,t)=>{const n=ae("MultiSelect",nde,e),{className:r,style:o,required:i,label:s,description:a,size:c,error:u,classNames:f,styles:h,wrapperProps:m,value:v,defaultValue:y,data:w,onChange:P,valueComponent:b,itemComponent:S,id:O,transitionProps:E,maxDropdownHeight:$,shadow:N,nothingFound:I,onFocus:R,onBlur:B,searchable:z,placeholder:G,filter:Q,limit:X,clearSearchOnChange:V,clearable:H,clearSearchOnBlur:Z,variant:Y,onSearchChange:j,searchValue:W,disabled:F,initiallyOpened:K,radius:ee,icon:fe,rightSection:ie,rightSectionWidth:J,creatable:ne,getCreateLabel:le,shouldCreate:_e,onCreate:Ne,sx:we,dropdownComponent:He,onDropdownClose:Te,onDropdownOpen:je,maxSelectedValues:st,withinPortal:bt,portalProps:wn,switchDirectionOnFlip:ht,zIndex:In,selectOnBlur:Er,name:lt,dropdownPosition:Yn,errorProps:Jt,labelProps:pt,descriptionProps:Po,form:Jr,positionDependencies:cr,onKeyDown:Qr,unstyled:Bt,inputContainer:Xr,inputWrapperOrder:hn,readOnly:bn,withAsterisk:$r,clearButtonProps:gt,hoverOnSearchChange:be,disableSelectedItemFiltering:Re}=n,eo=Xue(n,["className","style","required","label","description","size","error","classNames","styles","wrapperProps","value","defaultValue","data","onChange","valueComponent","itemComponent","id","transitionProps","maxDropdownHeight","shadow","nothingFound","onFocus","onBlur","searchable","placeholder","filter","limit","clearSearchOnChange","clearable","clearSearchOnBlur","variant","onSearchChange","searchValue","disabled","initiallyOpened","radius","icon","rightSection","rightSectionWidth","creatable","getCreateLabel","shouldCreate","onCreate","sx","dropdownComponent","onDropdownClose","onDropdownOpen","maxSelectedValues","withinPortal","portalProps","switchDirectionOnFlip","zIndex","selectOnBlur","name","dropdownPosition","errorProps","labelProps","descriptionProps","form","positionDependencies","onKeyDown","unstyled","inputContainer","inputWrapperOrder","readOnly","withAsterisk","clearButtonProps","hoverOnSearchChange","disableSelectedItemFiltering"]),{classes:Rt,cx:Zt,theme:Mr}=Kue({invalid:!!u},{name:"MultiSelect",classNames:f,styles:h,unstyled:Bt,size:c,variant:Y}),{systemStyles:xt,rest:nn}=Bl(eo),Kn=_.useRef(),Ha=_.useRef({}),qn=Ia(O),[xn,Ft]=_.useState(K),[Gt,to]=_.useState(-1),[Oo,ur]=_.useState("column"),[dr,Ui]=_o({value:W,defaultValue:"",finalValue:void 0,onChange:j}),[Ts,fr]=_.useState(!1),{scrollIntoView:Oe,targetRef:Wa,scrollableRef:Ql}=SL({duration:0,offset:5,cancelable:!1,isList:!0}),Ua=ne&&typeof le=="function";let Se=null;const ct=w.map(Ie=>typeof Ie=="string"?{label:Ie,value:Ie}:Ie),rn=WR({data:ct}),[ze,Zi]=_o({value:BN(v,w),defaultValue:BN(y,w),finalValue:[],onChange:P}),no=_.useRef(!!st&&st{if(!bn){const vt=ze.filter(Sn=>Sn!==Ie);Zi(vt),st&&vt.length{Ui(Ie.currentTarget.value),!F&&!no.current&&z&&Ft(!0)},N1=Ie=>{typeof R=="function"&&R(Ie),!F&&!no.current&&z&&Ft(!0)},on=Oue({data:rn,searchable:z,searchValue:dr,limit:X,filter:Q,value:ze,disableSelectedItemFiltering:Re});Ua&&_e(dr,rn)&&(Se=le(dr),on.push({label:dr,value:dr,creatable:!0}));const Gi=Math.min(Gt,on.length-1),Za=(Ie,vt,Sn)=>{let Fe=Ie;for(;Sn(Fe);)if(Fe=vt(Fe),!on[Fe].disabled)return Fe;return Ie};Hn(()=>{to(be&&dr?0:-1)},[dr,be]),Hn(()=>{!F&&ze.length>w.length&&Ft(!1),st&&ze.length=st&&(no.current=!0,Ft(!1))},[ze]);const Xl=Ie=>{if(!bn)if(V&&Ui(""),ze.includes(Ie.value))ch(Ie.value);else{if(Ie.creatable&&typeof Ne=="function"){const vt=Ne(Ie.value);typeof vt<"u"&&vt!==null&&Zi(typeof vt=="string"?[...ze,vt]:[...ze,vt.value])}else Zi([...ze,Ie.value]);ze.length===st-1&&(no.current=!0,Ft(!1)),on.length===1&&Ft(!1)}},T1=Ie=>{typeof B=="function"&&B(Ie),Er&&on[Gi]&&xn&&Xl(on[Gi]),Z&&Ui(""),Ft(!1)},I1=Ie=>{if(Ts||(Qr?.(Ie),bn)||Ie.key!=="Backspace"&&st&&no.current)return;const vt=Oo==="column",Sn=()=>{to(ut=>{var Nr;const Co=Za(ut,Tr=>Tr+1,Tr=>Tr{to(ut=>{var Nr;const Co=Za(ut,Tr=>Tr-1,Tr=>Tr>0);return xn&&(Wa.current=Ha.current[(Nr=on[Co])==null?void 0:Nr.value],Oe({alignment:vt?"start":"end"})),Co})};switch(Ie.key){case"ArrowUp":{Ie.preventDefault(),Ft(!0),vt?Fe():Sn();break}case"ArrowDown":{Ie.preventDefault(),Ft(!0),vt?Sn():Fe();break}case"Enter":{Ie.preventDefault(),on[Gi]&&xn?Xl(on[Gi]):Ft(!0);break}case" ":{z||(Ie.preventDefault(),on[Gi]&&xn?Xl(on[Gi]):Ft(!0));break}case"Backspace":{ze.length>0&&dr.length===0&&(Zi(ze.slice(0,-1)),Ft(!0),st&&(no.current=!1));break}case"Home":{if(!z){Ie.preventDefault(),xn||Ft(!0);const ut=on.findIndex(Nr=>!Nr.disabled);to(ut),Oe({alignment:vt?"end":"start"})}break}case"End":{if(!z){Ie.preventDefault(),xn||Ft(!0);const ut=on.map(Nr=>!!Nr.disabled).lastIndexOf(!1);to(ut),Oe({alignment:vt?"end":"start"})}break}case"Escape":Ft(!1)}},j1=ze.map(Ie=>{let vt=rn.find(Sn=>Sn.value===Ie&&!Sn.disabled);return!vt&&Ua&&(vt={value:Ie,label:Ie}),vt}).filter(Ie=>!!Ie).map((Ie,vt)=>k.createElement(b,AN(hc({},Ie),{variant:Y,disabled:F,className:Rt.value,readOnly:bn,onRemove:Sn=>{Sn.preventDefault(),Sn.stopPropagation(),ch(Ie.value)},key:Ie.value,size:c,styles:h,classNames:f,radius:ee,index:vt}))),D1=Ie=>ze.includes(Ie),Bu=()=>{var Ie;Ui(""),Zi([]),(Ie=Kn.current)==null||Ie.focus(),st&&(no.current=!1)},ui=!bn&&(on.length>0?xn:xn&&!!I);return Hn(()=>{const Ie=ui?je:Te;typeof Ie=="function"&&Ie()},[ui]),k.createElement(et.Wrapper,hc(hc({required:i,id:qn,label:s,error:u,description:a,size:c,className:r,style:o,classNames:f,styles:h,__staticSelector:"MultiSelect",sx:we,errorProps:Jt,descriptionProps:Po,labelProps:pt,inputContainer:Xr,inputWrapperOrder:hn,unstyled:Bt,withAsterisk:$r,variant:Y},xt),m),k.createElement(ya,{opened:ui,transitionProps:E,shadow:"sm",withinPortal:bt,portalProps:wn,__staticSelector:"MultiSelect",onDirectionChange:ur,switchDirectionOnFlip:ht,zIndex:In,dropdownPosition:Yn,positionDependencies:[...cr,dr],classNames:f,styles:h,unstyled:Bt,variant:Y},k.createElement(ya.Target,null,k.createElement("div",{className:Rt.wrapper,role:"combobox","aria-haspopup":"listbox","aria-owns":xn&&ui?`${qn}-items`:null,"aria-controls":qn,"aria-expanded":xn,onMouseLeave:()=>to(-1),tabIndex:-1},k.createElement("input",{type:"hidden",name:lt,value:ze.join(","),form:Jr,disabled:F}),k.createElement(et,hc({__staticSelector:"MultiSelect",style:{overflow:"hidden"},component:"div",multiline:!0,size:c,variant:Y,disabled:F,error:u,required:i,radius:ee,icon:fe,unstyled:Bt,onMouseDown:Ie=>{var vt;Ie.preventDefault(),!F&&!no.current&&Ft(!xn),(vt=Kn.current)==null||vt.focus()},classNames:AN(hc({},f),{input:Zt({[Rt.input]:!z},f?.input)})},t8({theme:Mr,rightSection:ie,rightSectionWidth:J,styles:h,size:c,shouldClear:H&&ze.length>0,onClear:Bu,error:u,disabled:F,clearButtonProps:gt,readOnly:bn})),k.createElement("div",{className:Rt.values,"data-clearable":H||void 0},j1,k.createElement("input",hc({ref:Ps(t,Kn),type:"search",id:qn,className:Zt(Rt.searchInput,{[Rt.searchInputPointer]:!z,[Rt.searchInputInputHidden]:!xn&&ze.length>0||!z&&ze.length>0,[Rt.searchInputEmpty]:ze.length===0}),onKeyDown:I1,value:dr,onChange:M1,onFocus:N1,onBlur:T1,readOnly:!z||no.current||bn,placeholder:ze.length===0?G:void 0,disabled:F,"data-mantine-stop-propagation":xn,autoComplete:"off",onCompositionStart:()=>fr(!0),onCompositionEnd:()=>fr(!1)},nn)))))),k.createElement(ya.Dropdown,{component:He||A0,maxHeight:$,direction:Oo,id:qn,innerRef:Ql,__staticSelector:"MultiSelect",classNames:f,styles:h},k.createElement(xP,{data:on,hovered:Gi,classNames:f,styles:h,uuid:qn,__staticSelector:"MultiSelect",onItemHover:to,onItemSelect:Xl,itemsRefs:Ha,itemComponent:S,size:c,nothingFound:I,isItemSelected:D1,creatable:ne&&!!Se,createLabel:Se,unstyled:Bt,variant:Y}))))});KP.displayName="@mantine/core/MultiSelect";const rde=(e,t,n)=>Number.isInteger(e)&&e>=0&&t===0?"numeric":!Number.isInteger(e)&&e>=0&&t!==0?"decimal":Number.isInteger(e)&&e<0&&t===0||!Number.isInteger(e)&&e<0&&t!==0?n==="ios"?"text":"decimal":"numeric";function FN({direction:e,size:t}){return k.createElement("svg",{style:{width:M(t),height:M(t),transform:e==="up"?"rotate(180deg)":void 0},viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},k.createElement("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}const o8={xs:M(20),sm:M(24),md:M(30),lg:M(34),xl:M(36)};var ode=ue((e,{radius:t},{size:n})=>({rightSection:{display:"flex",flexDirection:"column",height:`calc(100% - ${M(2)})`,margin:M(1),overflow:"hidden",borderTopRightRadius:e.fn.radius(t),borderBottomRightRadius:e.fn.radius(t)},control:{margin:0,position:"relative",flex:"0 0 50%",display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",width:re({size:n,sizes:o8}),padding:0,WebkitTapHighlightColor:"transparent",borderBottom:`${M(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`,borderLeft:`${M(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`,borderTop:0,borderRight:0,backgroundColor:"transparent",marginRight:M(1),color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,"&:not(:disabled):hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[0]},"&:disabled":{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[4]}},controlUp:{},controlDown:{borderBottom:0}}));const ide=ode;var sde=Object.defineProperty,ade=Object.defineProperties,lde=Object.getOwnPropertyDescriptors,Ov=Object.getOwnPropertySymbols,i8=Object.prototype.hasOwnProperty,s8=Object.prototype.propertyIsEnumerable,VN=(e,t,n)=>t in e?sde(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Q_=(e,t)=>{for(var n in t||(t={}))i8.call(t,n)&&VN(e,n,t[n]);if(Ov)for(var n of Ov(t))s8.call(t,n)&&VN(e,n,t[n]);return e},cde=(e,t)=>ade(e,lde(t)),ude=(e,t)=>{var n={};for(var r in e)i8.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ov)for(var r of Ov(e))t.indexOf(r)<0&&s8.call(e,r)&&(n[r]=e[r]);return n};const dde={type:"text",size:"sm",__staticSelector:"TextInput"},_n=_.forwardRef((e,t)=>{const n=AP("TextInput",dde,e),{inputProps:r,wrapperProps:o}=n,i=ude(n,["inputProps","wrapperProps"]);return k.createElement(et.Wrapper,Q_({},o),k.createElement(et,cde(Q_(Q_({},r),i),{ref:t})))});_n.displayName="@mantine/core/TextInput";var fde=Object.defineProperty,hde=Object.defineProperties,pde=Object.getOwnPropertyDescriptors,Cv=Object.getOwnPropertySymbols,a8=Object.prototype.hasOwnProperty,l8=Object.prototype.propertyIsEnumerable,HN=(e,t,n)=>t in e?fde(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mde=(e,t)=>{for(var n in t||(t={}))a8.call(t,n)&&HN(e,n,t[n]);if(Cv)for(var n of Cv(t))l8.call(t,n)&&HN(e,n,t[n]);return e},gde=(e,t)=>hde(e,pde(t)),vde=(e,t)=>{var n={};for(var r in e)a8.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Cv)for(var r of Cv(e))t.indexOf(r)<0&&l8.call(e,r)&&(n[r]=e[r]);return n};const yde=e=>e||"",_de=e=>{if(e==="-")return e;let t=e;t[0]==="."&&(t=`0${e}`);const n=parseFloat(t);return Number.isNaN(n)?"":e},WN={xs:M(10),sm:M(14),md:M(16),lg:M(18),xl:M(20)},wde={step:1,hideControls:!1,size:"sm",precision:0,noClampOnBlur:!1,removeTrailingZeros:!1,decimalSeparator:".",formatter:yde,parser:_de,type:"text"},_a=_.forwardRef((e,t)=>{const n=ae("NumberInput",wde,e),{readOnly:r,disabled:o,value:i,onChange:s,decimalSeparator:a,thousandsSeparator:c,min:u,max:f,startValue:h,step:m,stepHoldInterval:v,stepHoldDelay:y,onFocus:w,onBlur:P,onKeyDown:b,onKeyUp:S,hideControls:O,radius:E,variant:$,precision:N,removeTrailingZeros:I,defaultValue:R,noClampOnBlur:B,handlersRef:z,classNames:G,styles:Q,size:X,rightSection:V,rightSectionWidth:H,formatter:Z,parser:Y,inputMode:j,unstyled:W,type:F}=n,K=vde(n,["readOnly","disabled","value","onChange","decimalSeparator","thousandsSeparator","min","max","startValue","step","stepHoldInterval","stepHoldDelay","onFocus","onBlur","onKeyDown","onKeyUp","hideControls","radius","variant","precision","removeTrailingZeros","defaultValue","noClampOnBlur","handlersRef","classNames","styles","size","rightSection","rightSectionWidth","formatter","parser","inputMode","unstyled","type"]),{classes:ee,cx:fe}=ide({radius:E},{classNames:G,styles:Q,unstyled:W,name:"NumberInput",variant:$,size:X}),ie=be=>{if(be==="")return"";let Re=be.toFixed(N);return I&&N>0&&(Re=Re.replace(new RegExp(`[0]{0,${N}}$`),""),Re.endsWith(".")&&(Re=Re.slice(0,-1))),Re},J=be=>{let Re=be;return a&&(Re=Re.replace(".",a)),Z(Re)},ne=be=>{let Re=be;return a&&(Re=Re.replaceAll(c,"").replace(a,".")),Y(Re)},le=be=>J(ie(be)),[_e,Ne]=_.useState(typeof i=="number"?i:typeof R=="number"?R:""),[we,He]=_.useState(()=>le(_e)),Te=_.useRef(),[je,st]=_.useState(!1),bt=(be,Re)=>{if(!je||Re){const eo=le(be);eo!==we&&He(eo)}be!==_e&&Ne(be)},wn=typeof u=="number"?u:-1/0,ht=typeof f=="number"?f:1/0,In=_.useRef();In.current=()=>{var be;let Re;_e===""?Re=(be=h??u)!=null?be:0:Re=parseFloat(ie(ca(_e+m,wn,ht))),bt(Re,!0),s?.(Re)};const Er=_.useRef();Er.current=()=>{var be;let Re;_e===""?Re=(be=h??u)!=null?be:0:Re=parseFloat(ie(ca(_e-m,wn,ht))),bt(Re,!0),s?.(Re)},wL(z,{increment:In.current,decrement:Er.current}),_.useEffect(()=>{je||bt(i===void 0?_e:i,!0)},[i,je]);const lt=y!==void 0&&v!==void 0,Yn=_.useRef(null),Jt=_.useRef(0),pt=()=>{Yn.current&&window.clearTimeout(Yn.current),Yn.current=null,Jt.current=0},Po=be=>{be?In.current():Er.current(),Jt.current+=1},Jr=be=>{if(Po(be),lt){const Re=typeof v=="number"?v:v(Jt.current);Yn.current=window.setTimeout(()=>Jr(be),Re)}},cr=(be,Re)=>{be.preventDefault(),Te.current.focus(),Po(Re),lt&&(Yn.current=window.setTimeout(()=>Jr(Re),y))};_.useEffect(()=>(pt(),pt),[]);const Qr=k.createElement("div",{className:ee.rightSection},k.createElement("button",{type:"button",tabIndex:-1,"aria-hidden":!0,disabled:_e>=f,className:fe(ee.control,ee.controlUp),onPointerDown:be=>{cr(be,!0)},onPointerUp:pt,onPointerLeave:pt},k.createElement(FN,{size:re({size:X,sizes:WN}),direction:"up"})),k.createElement("button",{type:"button",tabIndex:-1,"aria-hidden":!0,disabled:_e<=u,className:fe(ee.control,ee.controlDown),onPointerDown:be=>{cr(be,!1)},onPointerUp:pt,onPointerLeave:pt},k.createElement(FN,{size:re({size:X,sizes:WN}),direction:"down"}))),Bt=be=>{let Re=be;(Re[0]===`${a}`||Re[0]===".")&&(Re=`0${Re}`);const eo=parseFloat(ie(parseFloat(ne(Re)))),Rt=B?eo:ca(eo,wn,ht),Zt=Number.isNaN(Rt)?"":Rt,Mr=_e!==Zt;He(be),bt(Zt),Mr&&s?.(Zt)},Xr=be=>{be.nativeEvent.isComposing||Bt(be.target.value)},hn=be=>{st(!0),w?.(be)},bn=be=>{st(!1),P?.(be)},$r=be=>{if(typeof b=="function"&&b(be),be.repeat&<&&(be.key==="ArrowUp"||be.key==="ArrowDown")){be.preventDefault();return}r||(be.key==="ArrowUp"?cr(be,!0):be.key==="ArrowDown"&&cr(be,!1))},gt=be=>{typeof S=="function"&&S(be),(be.key==="ArrowUp"||be.key==="ArrowDown")&&pt()};return k.createElement(_n,gde(mde({},K),{type:F,variant:$,value:we,disabled:o,readOnly:r,ref:Ps(Te,t),onChange:Xr,onFocus:hn,onBlur:bn,onKeyDown:$r,onKeyUp:gt,rightSection:V||(o||r||O||$==="unstyled"?null:Qr),rightSectionWidth:H??`calc(${re({size:X,sizes:o8})} + ${M(1)})`,radius:E,max:f,min:u,step:m,size:X,styles:Q,classNames:G,inputMode:j||rde(m,N,bY()),__staticSelector:"NumberInput",unstyled:W}))});_a.displayName="@mantine/core/NumberInput";const c8=_.createContext(!1),bde=c8.Provider,xde=()=>_.useContext(c8);function u8({children:e,openDelay:t=0,closeDelay:n=0}){return k.createElement(bde,{value:!0},k.createElement(Tee,{delay:{open:t,close:n}},e))}u8.displayName="@mantine/core/TooltipGroup";var Sde=Object.defineProperty,Pde=Object.defineProperties,Ode=Object.getOwnPropertyDescriptors,UN=Object.getOwnPropertySymbols,Cde=Object.prototype.hasOwnProperty,kde=Object.prototype.propertyIsEnumerable,ZN=(e,t,n)=>t in e?Sde(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,GN=(e,t)=>{for(var n in t||(t={}))Cde.call(t,n)&&ZN(e,n,t[n]);if(UN)for(var n of UN(t))kde.call(t,n)&&ZN(e,n,t[n]);return e},Ede=(e,t)=>Pde(e,Ode(t));function $de(e,t){if(!t)return{backgroundColor:e.colorScheme==="dark"?e.colors.gray[2]:e.colors.gray[9],color:e.colorScheme==="dark"?e.black:e.white};const n=e.fn.variant({variant:"filled",color:t,primaryFallback:!1});return{backgroundColor:n.background,color:n.color}}var Mde=ue((e,{color:t,radius:n,width:r,multiline:o})=>({tooltip:Ede(GN(GN({},e.fn.fontStyles()),$de(e,t)),{lineHeight:e.lineHeight,fontSize:e.fontSizes.sm,borderRadius:e.fn.radius(n),padding:`calc(${e.spacing.xs} / 2) ${e.spacing.xs}`,position:"absolute",whiteSpace:o?"unset":"nowrap",pointerEvents:"none",width:r}),arrow:{backgroundColor:"inherit",border:0,zIndex:1}}));const d8=Mde,f8={children:"Tooltip component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported"};function Nde({offset:e,position:t}){const[n,r]=_.useState(!1),o=_.useRef(),{x:i,y:s,reference:a,floating:c,refs:u,update:f,placement:h}=RP({placement:t,middleware:[MP({crossAxis:!0,padding:5,rootBoundary:"document"})]}),m=h.includes("right")?e:t.includes("left")?e*-1:0,v=h.includes("bottom")?e:t.includes("top")?e*-1:0,y=_.useCallback(({clientX:w,clientY:P})=>{a({getBoundingClientRect(){return{width:0,height:0,x:w,y:P,left:w+m,top:P+v,right:w,bottom:P}}})},[a]);return _.useEffect(()=>{if(u.floating.current){const w=o.current;w.addEventListener("mousemove",y);const P=hs(u.floating.current);return P.forEach(b=>{b.addEventListener("scroll",f)}),()=>{w.removeEventListener("mousemove",y),P.forEach(b=>{b.removeEventListener("scroll",f)})}}},[a,u.floating.current,f,y,n]),{handleMouseMove:y,x:i,y:s,opened:n,setOpened:r,boundaryRef:o,floating:c}}var Tde=Object.defineProperty,Ide=Object.defineProperties,jde=Object.getOwnPropertyDescriptors,kv=Object.getOwnPropertySymbols,h8=Object.prototype.hasOwnProperty,p8=Object.prototype.propertyIsEnumerable,YN=(e,t,n)=>t in e?Tde(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,up=(e,t)=>{for(var n in t||(t={}))h8.call(t,n)&&YN(e,n,t[n]);if(kv)for(var n of kv(t))p8.call(t,n)&&YN(e,n,t[n]);return e},dp=(e,t)=>Ide(e,jde(t)),Dde=(e,t)=>{var n={};for(var r in e)h8.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&kv)for(var r of kv(e))t.indexOf(r)<0&&p8.call(e,r)&&(n[r]=e[r]);return n};const Rde={refProp:"ref",withinPortal:!0,offset:10,position:"right",zIndex:ci("popover")};function m8(e){var t;const n=ae("TooltipFloating",Rde,e),{children:r,refProp:o,withinPortal:i,portalProps:s,style:a,className:c,classNames:u,styles:f,unstyled:h,radius:m,color:v,label:y,offset:w,position:P,multiline:b,width:S,zIndex:O,disabled:E,variant:$}=n,N=Dde(n,["children","refProp","withinPortal","portalProps","style","className","classNames","styles","unstyled","radius","color","label","offset","position","multiline","width","zIndex","disabled","variant"]),{handleMouseMove:I,x:R,y:B,opened:z,boundaryRef:G,floating:Q,setOpened:X}=Nde({offset:w,position:P}),{classes:V,cx:H}=d8({radius:m,color:v,multiline:b,width:S},{name:"TooltipFloating",classNames:u,styles:f,unstyled:h,variant:$});if(!zf(r))throw new Error(f8.children);const Z=Ps(G,r.ref),Y=W=>{var F,K;(K=(F=r.props).onMouseEnter)==null||K.call(F,W),I(W),X(!0)},j=W=>{var F,K;(K=(F=r.props).onMouseLeave)==null||K.call(F,W),X(!1)};return k.createElement(k.Fragment,null,k.createElement(Zf,dp(up({},s),{withinPortal:i}),k.createElement(Pe,dp(up({},N),{ref:Q,className:H(V.tooltip,c),style:dp(up({},a),{zIndex:O,display:!E&&z?"block":"none",top:B??"",left:(t=Math.round(R))!=null?t:""})}),y)),_.cloneElement(r,dp(up({},r.props),{[o]:Z,onMouseEnter:Y,onMouseLeave:j})))}m8.displayName="@mantine/core/TooltipFloating";function Lde(e){const[t,n]=_.useState(!1),o=typeof e.opened=="boolean"?e.opened:t,i=xde(),s=Ia(),{delay:a,currentId:c,setCurrentId:u}=Xz(),f=_.useCallback(R=>{n(R),R&&u(s)},[u,s]),{x:h,y:m,reference:v,floating:y,context:w,refs:P,update:b,placement:S,middlewareData:{arrow:{x:O,y:E}={}}}=RP({placement:e.position,open:o,onOpenChange:f,middleware:[Bz(e.offset),MP({padding:8}),Lz(),Yz({element:e.arrowRef,padding:e.arrowOffset}),...e.inline?[Az()]:[]]}),{getReferenceProps:$,getFloatingProps:N}=Wee([Nee(w,{enabled:e.events.hover,delay:i?a:{open:e.openDelay,close:e.closeDelay},mouseOnly:!e.events.touch}),Vee(w,{enabled:e.events.focus,keyboardOnly:!0}),Hee(w,{role:"tooltip"}),Fee(w,{enabled:typeof e.opened===void 0}),Iee(w,{id:s})]);return tA({opened:o,position:e.position,positionDependencies:e.positionDependencies,floating:{refs:P,update:b}}),Hn(()=>{var R;(R=e.onPositionChange)==null||R.call(e,S)},[S]),{x:h,y:m,arrowX:O,arrowY:E,reference:v,floating:y,getFloatingProps:N,getReferenceProps:$,isGroupPhase:o&&c&&c!==s,opened:o,placement:S}}var zde=Object.defineProperty,Ade=Object.defineProperties,Bde=Object.getOwnPropertyDescriptors,Ev=Object.getOwnPropertySymbols,g8=Object.prototype.hasOwnProperty,v8=Object.prototype.propertyIsEnumerable,KN=(e,t,n)=>t in e?zde(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Qa=(e,t)=>{for(var n in t||(t={}))g8.call(t,n)&&KN(e,n,t[n]);if(Ev)for(var n of Ev(t))v8.call(t,n)&&KN(e,n,t[n]);return e},X_=(e,t)=>Ade(e,Bde(t)),Fde=(e,t)=>{var n={};for(var r in e)g8.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ev)for(var r of Ev(e))t.indexOf(r)<0&&v8.call(e,r)&&(n[r]=e[r]);return n};const Vde={position:"top",refProp:"ref",withinPortal:!1,inline:!1,arrowSize:4,arrowOffset:5,arrowRadius:0,arrowPosition:"side",offset:5,transitionProps:{duration:100,transition:"fade"},width:"auto",events:{hover:!0,focus:!1,touch:!1},zIndex:ci("popover"),positionDependencies:[]},H0=_.forwardRef((e,t)=>{var n;const r=_.useRef(null),o=ae("Tooltip",Vde,e),{children:i,position:s,refProp:a,label:c,openDelay:u,closeDelay:f,onPositionChange:h,opened:m,withinPortal:v,portalProps:y,radius:w,color:P,classNames:b,styles:S,unstyled:O,style:E,className:$,withArrow:N,arrowSize:I,arrowOffset:R,arrowRadius:B,arrowPosition:z,offset:G,transitionProps:Q,multiline:X,width:V,events:H,zIndex:Z,disabled:Y,positionDependencies:j,onClick:W,onMouseEnter:F,onMouseLeave:K,inline:ee,variant:fe,keepMounted:ie}=o,J=Fde(o,["children","position","refProp","label","openDelay","closeDelay","onPositionChange","opened","withinPortal","portalProps","radius","color","classNames","styles","unstyled","style","className","withArrow","arrowSize","arrowOffset","arrowRadius","arrowPosition","offset","transitionProps","multiline","width","events","zIndex","disabled","positionDependencies","onClick","onMouseEnter","onMouseLeave","inline","variant","keepMounted"]),{classes:ne,cx:le,theme:_e}=d8({radius:w,color:P,width:V,multiline:X},{name:"Tooltip",classNames:b,styles:S,unstyled:O,variant:fe}),Ne=Lde({position:fA(_e.dir,s),closeDelay:f,openDelay:u,onPositionChange:h,opened:m,events:H,arrowRef:r,arrowOffset:R,offset:G+(N?I/2:0),positionDependencies:[...j,i],inline:ee});if(!zf(i))throw new Error(f8.children);const we=Ps(Ne.reference,i.ref,t);return k.createElement(k.Fragment,null,k.createElement(Zf,X_(Qa({},y),{withinPortal:v}),k.createElement($s,X_(Qa({keepMounted:ie,mounted:!Y&&Ne.opened},Q),{transition:Q.transition||"fade",duration:Ne.isGroupPhase?10:(n=Q.duration)!=null?n:100}),He=>{var Te,je;return k.createElement(Pe,Qa(Qa({},J),Ne.getFloatingProps({ref:Ne.floating,className:ne.tooltip,style:X_(Qa(Qa({},E),He),{zIndex:Z,top:(Te=Ne.y)!=null?Te:0,left:(je=Ne.x)!=null?je:0})})),c,k.createElement(zP,{ref:r,arrowX:Ne.arrowX,arrowY:Ne.arrowY,visible:N,position:Ne.placement,arrowSize:I,arrowOffset:R,arrowRadius:B,arrowPosition:z,className:ne.arrow}))})),_.cloneElement(i,Ne.getReferenceProps(Qa({onClick:W,onMouseEnter:F,onMouseLeave:K,onMouseMove:e.onMouseMove,onPointerDown:e.onPointerDown,onPointerEnter:e.onPointerEnter,[a]:we,className:le($,i.props.className)},i.props))))});H0.Group=u8;H0.Floating=m8;H0.displayName="@mantine/core/Tooltip";const zt=H0;function Hde({data:e,searchable:t,limit:n,searchValue:r,filter:o,value:i,filterDataOnExactSearchMatch:s}){if(!t)return e;const a=i!=null&&e.find(u=>u.value===i)||null;if(a&&!s&&a?.label===r){if(n){if(n>=e.length)return e;const u=e.indexOf(a),f=u+n,h=f-e.length;return h>0?e.slice(u-h):e.slice(u,f)}return e}const c=[];for(let u=0;u=n));u+=1);return c}var Wde=ue(()=>({input:{"&:not(:disabled)":{cursor:"pointer","&::selection":{backgroundColor:"transparent"}}}}));const Ude=Wde;var Zde=Object.defineProperty,Gde=Object.defineProperties,Yde=Object.getOwnPropertyDescriptors,$v=Object.getOwnPropertySymbols,y8=Object.prototype.hasOwnProperty,_8=Object.prototype.propertyIsEnumerable,qN=(e,t,n)=>t in e?Zde(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pd=(e,t)=>{for(var n in t||(t={}))y8.call(t,n)&&qN(e,n,t[n]);if($v)for(var n of $v(t))_8.call(t,n)&&qN(e,n,t[n]);return e},ew=(e,t)=>Gde(e,Yde(t)),Kde=(e,t)=>{var n={};for(var r in e)y8.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&$v)for(var r of $v(e))t.indexOf(r)<0&&_8.call(e,r)&&(n[r]=e[r]);return n};function qde(e,t){return t.label.toLowerCase().trim().includes(e.toLowerCase().trim())}function Jde(e,t){return!!e&&!t.some(n=>n.label.toLowerCase()===e.toLowerCase())}const Qde={required:!1,size:"sm",shadow:"sm",itemComponent:SP,transitionProps:{transition:"fade",duration:0},initiallyOpened:!1,filter:qde,maxDropdownHeight:220,searchable:!1,clearable:!1,limit:1/0,disabled:!1,creatable:!1,shouldCreate:Jde,selectOnBlur:!1,switchDirectionOnFlip:!1,filterDataOnExactSearchMatch:!1,zIndex:ci("popover"),positionDependencies:[],dropdownPosition:"flip"},Dl=_.forwardRef((e,t)=>{const n=AP("Select",Qde,e),{inputProps:r,wrapperProps:o,shadow:i,data:s,value:a,defaultValue:c,onChange:u,itemComponent:f,onKeyDown:h,onBlur:m,onFocus:v,transitionProps:y,initiallyOpened:w,unstyled:P,classNames:b,styles:S,filter:O,maxDropdownHeight:E,searchable:$,clearable:N,nothingFound:I,limit:R,disabled:B,onSearchChange:z,searchValue:G,rightSection:Q,rightSectionWidth:X,creatable:V,getCreateLabel:H,shouldCreate:Z,selectOnBlur:Y,onCreate:j,dropdownComponent:W,onDropdownClose:F,onDropdownOpen:K,withinPortal:ee,portalProps:fe,switchDirectionOnFlip:ie,zIndex:J,name:ne,dropdownPosition:le,allowDeselect:_e,placeholder:Ne,filterDataOnExactSearchMatch:we,form:He,positionDependencies:Te,readOnly:je,clearButtonProps:st,hoverOnSearchChange:bt}=n,wn=Kde(n,["inputProps","wrapperProps","shadow","data","value","defaultValue","onChange","itemComponent","onKeyDown","onBlur","onFocus","transitionProps","initiallyOpened","unstyled","classNames","styles","filter","maxDropdownHeight","searchable","clearable","nothingFound","limit","disabled","onSearchChange","searchValue","rightSection","rightSectionWidth","creatable","getCreateLabel","shouldCreate","selectOnBlur","onCreate","dropdownComponent","onDropdownClose","onDropdownOpen","withinPortal","portalProps","switchDirectionOnFlip","zIndex","name","dropdownPosition","allowDeselect","placeholder","filterDataOnExactSearchMatch","form","positionDependencies","readOnly","clearButtonProps","hoverOnSearchChange"]),{classes:ht,cx:In,theme:Er}=Ude(),[lt,Yn]=_.useState(w),[Jt,pt]=_.useState(-1),Po=_.useRef(),Jr=_.useRef({}),[cr,Qr]=_.useState("column"),Bt=cr==="column",{scrollIntoView:Xr,targetRef:hn,scrollableRef:bn}=SL({duration:0,offset:5,cancelable:!1,isList:!0}),$r=_e===void 0?N:_e,gt=Se=>{if(lt!==Se){Yn(Se);const ct=Se?K:F;typeof ct=="function"&&ct()}},be=V&&typeof H=="function";let Re=null;const eo=s.map(Se=>typeof Se=="string"?{label:Se,value:Se}:Se),Rt=WR({data:eo}),[Zt,Mr,xt]=_o({value:a,defaultValue:c,finalValue:null,onChange:u}),nn=Rt.find(Se=>Se.value===Zt),[Kn,Ha]=_o({value:G,defaultValue:nn?.label||"",finalValue:void 0,onChange:z}),qn=Se=>{Ha(Se),$&&typeof z=="function"&&z(Se)},xn=()=>{var Se;je||(Mr(null),xt||qn(""),(Se=Po.current)==null||Se.focus())};_.useEffect(()=>{const Se=Rt.find(ct=>ct.value===Zt);Se?qn(Se.label):(!be||!Zt)&&qn("")},[Zt]),_.useEffect(()=>{nn&&(!$||!lt)&&qn(nn.label)},[nn?.label]);const Ft=Se=>{if(!je)if($r&&nn?.value===Se.value)Mr(null),gt(!1);else{if(Se.creatable&&typeof j=="function"){const ct=j(Se.value);typeof ct<"u"&&ct!==null&&Mr(typeof ct=="string"?ct:ct.value)}else Mr(Se.value);xt||qn(Se.label),pt(-1),gt(!1),Po.current.focus()}},Gt=Hde({data:Rt,searchable:$,limit:R,searchValue:Kn,filter:O,filterDataOnExactSearchMatch:we,value:Zt});be&&Z(Kn,Gt)&&(Re=H(Kn),Gt.push({label:Kn,value:Kn,creatable:!0}));const to=(Se,ct,rn)=>{let ze=Se;for(;rn(ze);)if(ze=ct(ze),!Gt[ze].disabled)return ze;return Se};Hn(()=>{pt(bt&&Kn?0:-1)},[Kn,bt]);const Oo=Zt?Gt.findIndex(Se=>Se.value===Zt):0,ur=!je&&(Gt.length>0?lt:lt&&!!I),dr=()=>{pt(Se=>{var ct;const rn=to(Se,ze=>ze-1,ze=>ze>0);return hn.current=Jr.current[(ct=Gt[rn])==null?void 0:ct.value],ur&&Xr({alignment:Bt?"start":"end"}),rn})},Ui=()=>{pt(Se=>{var ct;const rn=to(Se,ze=>ze+1,ze=>zewindow.setTimeout(()=>{var Se;hn.current=Jr.current[(Se=Gt[Oo])==null?void 0:Se.value],Xr({alignment:Bt?"end":"start"})},50);Hn(()=>{ur&&Ts()},[ur]);const fr=Se=>{switch(typeof h=="function"&&h(Se),Se.key){case"ArrowUp":{Se.preventDefault(),lt?Bt?dr():Ui():(pt(Oo),gt(!0),Ts());break}case"ArrowDown":{Se.preventDefault(),lt?Bt?Ui():dr():(pt(Oo),gt(!0),Ts());break}case"Home":{if(!$){Se.preventDefault(),lt||gt(!0);const ct=Gt.findIndex(rn=>!rn.disabled);pt(ct),ur&&Xr({alignment:Bt?"end":"start"})}break}case"End":{if(!$){Se.preventDefault(),lt||gt(!0);const ct=Gt.map(rn=>!!rn.disabled).lastIndexOf(!1);pt(ct),ur&&Xr({alignment:Bt?"end":"start"})}break}case"Escape":{Se.preventDefault(),gt(!1),pt(-1);break}case" ":{$||(Se.preventDefault(),Gt[Jt]&<?Ft(Gt[Jt]):(gt(!0),pt(Oo),Ts()));break}case"Enter":$||Se.preventDefault(),Gt[Jt]&<&&(Se.preventDefault(),Ft(Gt[Jt]))}},Oe=Se=>{typeof m=="function"&&m(Se);const ct=Rt.find(rn=>rn.value===Zt);Y&&Gt[Jt]&<&&Ft(Gt[Jt]),qn(ct?.label||""),gt(!1)},Wa=Se=>{typeof v=="function"&&v(Se),$&>(!0)},Ql=Se=>{je||(qn(Se.currentTarget.value),N&&Se.currentTarget.value===""&&Mr(null),pt(-1),gt(!0))},Ua=()=>{je||(gt(!lt),Zt&&!lt&&pt(Oo))};return k.createElement(et.Wrapper,ew(pd({},o),{__staticSelector:"Select"}),k.createElement(ya,{opened:ur,transitionProps:y,shadow:i,withinPortal:ee,portalProps:fe,__staticSelector:"Select",onDirectionChange:Qr,switchDirectionOnFlip:ie,zIndex:J,dropdownPosition:le,positionDependencies:[...Te,Kn],classNames:b,styles:S,unstyled:P,variant:r.variant},k.createElement(ya.Target,null,k.createElement("div",{role:"combobox","aria-haspopup":"listbox","aria-owns":ur?`${r.id}-items`:null,"aria-controls":r.id,"aria-expanded":ur,onMouseLeave:()=>pt(-1),tabIndex:-1},k.createElement("input",{type:"hidden",name:ne,value:Zt||"",form:He,disabled:B}),k.createElement(et,pd(ew(pd(pd({autoComplete:"off",type:"search"},r),wn),{ref:Ps(t,Po),onKeyDown:fr,__staticSelector:"Select",value:Kn,placeholder:Ne,onChange:Ql,"aria-autocomplete":"list","aria-controls":ur?`${r.id}-items`:null,"aria-activedescendant":Jt>=0?`${r.id}-${Jt}`:null,onMouseDown:Ua,onBlur:Oe,onFocus:Wa,readOnly:!$||je,disabled:B,"data-mantine-stop-propagation":ur,name:null,classNames:ew(pd({},b),{input:In({[ht.input]:!$},b?.input)})}),t8({theme:Er,rightSection:Q,rightSectionWidth:X,styles:S,size:r.size,shouldClear:N&&!!nn,onClear:xn,error:o.error,clearButtonProps:st,disabled:B,readOnly:je}))))),k.createElement(ya.Dropdown,{component:W||A0,maxHeight:E,direction:cr,id:r.id,innerRef:bn,__staticSelector:"Select",classNames:b,styles:S},k.createElement(xP,{data:Gt,hovered:Jt,classNames:b,styles:S,isItemSelected:Se=>Se===Zt,uuid:r.id,__staticSelector:"Select",onItemHover:pt,onItemSelect:Ft,itemsRefs:Jr,itemComponent:f,size:r.size,nothingFound:I,creatable:be&&!!Re,createLabel:Re,"aria-label":o.label,unstyled:P,variant:r.variant}))))});Dl.displayName="@mantine/core/Select";function Xde(e,t){if(t.length===0)return t;const n="maxWidth"in t[0]?"maxWidth":"minWidth",r=[...t].sort((o,i)=>Bo(re({size:i[n],sizes:e.breakpoints}))-Bo(re({size:o[n],sizes:e.breakpoints})));return n==="minWidth"?r.reverse():r}var efe=Object.defineProperty,JN=Object.getOwnPropertySymbols,tfe=Object.prototype.hasOwnProperty,nfe=Object.prototype.propertyIsEnumerable,QN=(e,t,n)=>t in e?efe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,rfe=(e,t)=>{for(var n in t||(t={}))tfe.call(t,n)&&QN(e,n,t[n]);if(JN)for(var n of JN(t))nfe.call(t,n)&&QN(e,n,t[n]);return e},ofe=ue((e,{spacing:t,breakpoints:n,cols:r,verticalSpacing:o})=>{const i=o!=null,s=Xde(e,n).reduce((a,c)=>{var u,f;const h="maxWidth"in c?"max-width":"min-width",m=re({size:h==="max-width"?c.maxWidth:c.minWidth,sizes:e.breakpoints,units:"em"}),v=Bo(m)-(h==="max-width"?1:0);return a[`@media (${h}: ${Oa(v)})`]={gridTemplateColumns:`repeat(${c.cols}, minmax(0, 1fr))`,gap:`${re({size:(u=c.verticalSpacing)!=null?u:i?o:t,sizes:e.spacing})} ${re({size:(f=c.spacing)!=null?f:t,sizes:e.spacing})}`},a},{});return{root:rfe({boxSizing:"border-box",display:"grid",gridTemplateColumns:`repeat(${r}, minmax(0, 1fr))`,gap:`${re({size:i?o:t,sizes:e.spacing})} ${re({size:t,sizes:e.spacing})}`},s)}});const ife=ofe;var sfe=Object.defineProperty,Mv=Object.getOwnPropertySymbols,w8=Object.prototype.hasOwnProperty,b8=Object.prototype.propertyIsEnumerable,XN=(e,t,n)=>t in e?sfe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,afe=(e,t)=>{for(var n in t||(t={}))w8.call(t,n)&&XN(e,n,t[n]);if(Mv)for(var n of Mv(t))b8.call(t,n)&&XN(e,n,t[n]);return e},lfe=(e,t)=>{var n={};for(var r in e)w8.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Mv)for(var r of Mv(e))t.indexOf(r)<0&&b8.call(e,r)&&(n[r]=e[r]);return n};const cfe={breakpoints:[],cols:1,spacing:"md"},qP=_.forwardRef((e,t)=>{const n=ae("SimpleGrid",cfe,e),{className:r,breakpoints:o,cols:i,spacing:s,verticalSpacing:a,children:c,unstyled:u,variant:f}=n,h=lfe(n,["className","breakpoints","cols","spacing","verticalSpacing","children","unstyled","variant"]),{classes:m,cx:v}=ife({breakpoints:o,cols:i,spacing:s,verticalSpacing:a},{name:"SimpleGrid",unstyled:u,variant:f});return k.createElement(Pe,afe({className:v(m.root,r),ref:t},h),c)});qP.displayName="@mantine/core/SimpleGrid";var ufe=ue((e,{spacing:t,align:n,justify:r})=>({root:{display:"flex",flexDirection:"column",alignItems:n,justifyContent:r,gap:re({size:t,sizes:e.spacing})}}));const dfe=ufe;var ffe=Object.defineProperty,Nv=Object.getOwnPropertySymbols,x8=Object.prototype.hasOwnProperty,S8=Object.prototype.propertyIsEnumerable,eT=(e,t,n)=>t in e?ffe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hfe=(e,t)=>{for(var n in t||(t={}))x8.call(t,n)&&eT(e,n,t[n]);if(Nv)for(var n of Nv(t))S8.call(t,n)&&eT(e,n,t[n]);return e},pfe=(e,t)=>{var n={};for(var r in e)x8.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Nv)for(var r of Nv(e))t.indexOf(r)<0&&S8.call(e,r)&&(n[r]=e[r]);return n};const mfe={spacing:"md",align:"stretch",justify:"flex-start"},Je=_.forwardRef((e,t)=>{const n=ae("Stack",mfe,e),{spacing:r,className:o,align:i,justify:s,unstyled:a,variant:c}=n,u=pfe(n,["spacing","className","align","justify","unstyled","variant"]),{classes:f,cx:h}=dfe({spacing:r,align:i,justify:s},{name:"Stack",unstyled:a,variant:c});return k.createElement(Pe,hfe({className:h(f.root,o),ref:t},u))});Je.displayName="@mantine/core/Stack";const P8=_.createContext(null),gfe=P8.Provider,vfe=()=>_.useContext(P8);var yfe=Object.defineProperty,Tv=Object.getOwnPropertySymbols,O8=Object.prototype.hasOwnProperty,C8=Object.prototype.propertyIsEnumerable,tT=(e,t,n)=>t in e?yfe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nT=(e,t)=>{for(var n in t||(t={}))O8.call(t,n)&&tT(e,n,t[n]);if(Tv)for(var n of Tv(t))C8.call(t,n)&&tT(e,n,t[n]);return e},_fe=(e,t)=>{var n={};for(var r in e)O8.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Tv)for(var r of Tv(e))t.indexOf(r)<0&&C8.call(e,r)&&(n[r]=e[r]);return n};const wfe={size:"sm"},k8=_.forwardRef((e,t)=>{const n=ae("SwitchGroup",wfe,e),{children:r,value:o,defaultValue:i,onChange:s,size:a,wrapperProps:c}=n,u=_fe(n,["children","value","defaultValue","onChange","size","wrapperProps"]),[f,h]=_o({value:o,defaultValue:i,finalValue:[],onChange:s}),m=v=>{const y=v.currentTarget.value;h(f.includes(y)?f.filter(w=>w!==y):[...f,y])};return k.createElement(gfe,{value:{value:f,onChange:m,size:a}},k.createElement(et.Wrapper,nT(nT({labelElement:"div",size:a,__staticSelector:"SwitchGroup",ref:t},c),u),r))});k8.displayName="@mantine/core/SwitchGroup";var bfe=Object.defineProperty,xfe=Object.defineProperties,Sfe=Object.getOwnPropertyDescriptors,rT=Object.getOwnPropertySymbols,Pfe=Object.prototype.hasOwnProperty,Ofe=Object.prototype.propertyIsEnumerable,oT=(e,t,n)=>t in e?bfe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Cfe=(e,t)=>{for(var n in t||(t={}))Pfe.call(t,n)&&oT(e,n,t[n]);if(rT)for(var n of rT(t))Ofe.call(t,n)&&oT(e,n,t[n]);return e},kfe=(e,t)=>xfe(e,Sfe(t));const Efe={xs:M(16),sm:M(20),md:M(24),lg:M(30),xl:M(36)},$fe={xs:M(32),sm:M(38),md:M(46),lg:M(56),xl:M(72)},Mfe={xs:M(12),sm:M(14),md:M(18),lg:M(22),xl:M(28)},Nfe={xs:M(5),sm:M(6),md:M(7),lg:M(9),xl:M(11)},Tfe={xs:M(4),sm:M(5),md:M(6),lg:M(8),xl:M(10)};var Ife=ue((e,{radius:t,color:n,labelPosition:r,error:o},{size:i})=>{const s=re({size:i,sizes:Mfe}),a=re({size:t,sizes:e.radius}),c=e.fn.variant({variant:"filled",color:n}),u=re({size:i,sizes:$fe}),f=M(i==="xs"?1:2),h=e.fn.variant({variant:"filled",color:"red"}).background;return{root:{position:"relative"},input:{height:0,width:0,overflow:"hidden",whiteSpace:"nowrap",padding:0,WebkitClipPath:"inset(50%)",clipPath:"inset(50%)",position:"absolute"},track:kfe(Cfe({},e.fn.focusStyles("input:focus + &")),{cursor:e.cursorType,overflow:"hidden",WebkitTapHighlightColor:"transparent",position:"relative",borderRadius:a,backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[2],border:`${M(1)} solid ${o?h:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`,height:re({size:i,sizes:Efe}),minWidth:u,margin:0,transitionProperty:"background-color, border-color",transitionTimingFunction:e.transitionTimingFunction,transitionDuration:"150ms",boxSizing:"border-box",appearance:"none",display:"flex",alignItems:"center",fontSize:re({size:i,sizes:Nfe}),fontWeight:600,order:r==="left"?2:1,userSelect:"none",zIndex:0,lineHeight:0,color:e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[6],transition:`color 150ms ${e.transitionTimingFunction}`,"input:checked + &":{backgroundColor:c.background,borderColor:c.background,color:e.white,transition:`color 150ms ${e.transitionTimingFunction}`},"input:disabled + &":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2],borderColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2],cursor:"not-allowed",pointerEvents:"none"}}),thumb:{position:"absolute",zIndex:1,borderRadius:a,boxSizing:"border-box",display:"flex",backgroundColor:e.white,height:s,width:s,border:`${M(1)} solid ${e.colorScheme==="dark"?e.white:e.colors.gray[3]}`,left:f,transition:`left 150ms ${e.transitionTimingFunction}`,"& > *":{margin:"auto"},"@media (prefers-reduced-motion)":{transitionDuration:e.respectReducedMotion?"0ms":""},"input:checked + * > &":{left:`calc(100% - ${s} - ${f})`,borderColor:e.white},"input:disabled + * > &":{borderColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2],backgroundColor:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[0]}},trackLabel:{height:"100%",display:"grid",placeContent:"center",minWidth:`calc(${u} - ${s})`,paddingInline:re({size:i,sizes:Tfe}),marginLeft:`calc(${s} + ${f})`,transition:`margin 150ms ${e.transitionTimingFunction}`,"input:checked + * > &":{marginLeft:0,marginRight:`calc(${s} + ${f})`}}}});const jfe=Ife;var Dfe=Object.defineProperty,Rfe=Object.defineProperties,Lfe=Object.getOwnPropertyDescriptors,Iv=Object.getOwnPropertySymbols,E8=Object.prototype.hasOwnProperty,$8=Object.prototype.propertyIsEnumerable,iT=(e,t,n)=>t in e?Dfe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,tw=(e,t)=>{for(var n in t||(t={}))E8.call(t,n)&&iT(e,n,t[n]);if(Iv)for(var n of Iv(t))$8.call(t,n)&&iT(e,n,t[n]);return e},zfe=(e,t)=>Rfe(e,Lfe(t)),Afe=(e,t)=>{var n={};for(var r in e)E8.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Iv)for(var r of Iv(e))t.indexOf(r)<0&&$8.call(e,r)&&(n[r]=e[r]);return n};const Bfe={offLabel:"",onLabel:"",size:"sm",radius:"xl",error:!1},Bd=_.forwardRef((e,t)=>{var n;const r=ae("Switch",Bfe,e),{className:o,color:i,label:s,offLabel:a,onLabel:c,id:u,style:f,size:h,radius:m,wrapperProps:v,children:y,unstyled:w,styles:P,classNames:b,thumbIcon:S,sx:O,checked:E,defaultChecked:$,onChange:N,labelPosition:I,description:R,error:B,disabled:z,variant:G}=r,Q=Afe(r,["className","color","label","offLabel","onLabel","id","style","size","radius","wrapperProps","children","unstyled","styles","classNames","thumbIcon","sx","checked","defaultChecked","onChange","labelPosition","description","error","disabled","variant"]),X=vfe(),V=X?.size||h,{classes:H,cx:Z}=jfe({color:i,radius:m,labelPosition:I,error:!!B},{name:"Switch",classNames:b,styles:P,unstyled:w,size:V,variant:G}),{systemStyles:Y,rest:j}=Bl(Q),W=Ia(u),F=X?{checked:X.value.includes(j.value),onChange:X.onChange}:{},[K,ee]=_o({value:(n=F.checked)!=null?n:E,defaultValue:$,finalValue:!1});return k.createElement(ZP,tw(tw({className:Z(o,H.root),sx:O,style:f,id:W,size:X?.size||h,labelPosition:I,label:s,description:R,error:B,disabled:z,__staticSelector:"Switch",classNames:b,styles:P,unstyled:w,"data-checked":F.checked||void 0,variant:G},Y),v),k.createElement("input",zfe(tw({},j),{disabled:z,checked:K,onChange:fe=>{X?F.onChange(fe):N?.(fe),ee(fe.currentTarget.checked)},id:W,ref:t,type:"checkbox",className:H.input})),k.createElement("label",{htmlFor:W,className:H.track},k.createElement("div",{className:H.thumb},S),k.createElement("div",{className:H.trackLabel},K?c:a)))});Bd.displayName="@mantine/core/Switch";Bd.Group=k8;var Ffe=Object.defineProperty,Vfe=Object.defineProperties,Hfe=Object.getOwnPropertyDescriptors,sT=Object.getOwnPropertySymbols,Wfe=Object.prototype.hasOwnProperty,Ufe=Object.prototype.propertyIsEnumerable,aT=(e,t,n)=>t in e?Ffe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Zfe=(e,t)=>{for(var n in t||(t={}))Wfe.call(t,n)&&aT(e,n,t[n]);if(sT)for(var n of sT(t))Ufe.call(t,n)&&aT(e,n,t[n]);return e},Gfe=(e,t)=>Vfe(e,Hfe(t)),Yfe=ue((e,{captionSide:t,horizontalSpacing:n,verticalSpacing:r,fontSize:o,withBorder:i,withColumnBorders:s})=>{const a=`${M(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`;return{root:Gfe(Zfe({},e.fn.fontStyles()),{width:"100%",borderCollapse:"collapse",captionSide:t,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,lineHeight:e.lineHeight,border:i?a:void 0,"& > caption":{marginTop:t==="top"?0:e.spacing.xs,marginBottom:t==="bottom"?0:e.spacing.xs,fontSize:e.fontSizes.sm,color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6]},"& > thead > tr > th, & > tfoot > tr > th, & > tbody > tr > th":{textAlign:"left",fontWeight:"bold",color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],fontSize:re({size:o,sizes:e.fontSizes}),padding:`${re({size:r,sizes:e.spacing})} ${re({size:n,sizes:e.spacing})}`},"& > thead > tr > th":{borderBottom:a},"& > tfoot > tr > th, & > tbody > tr > th":{borderTop:a},"& > tbody > tr > td":{padding:`${re({size:r,sizes:e.spacing})} ${re({size:n,sizes:e.spacing})}`,borderTop:a,fontSize:re({size:o,sizes:e.fontSizes})},"& > tbody > tr:first-of-type > td, & > tbody > tr:first-of-type > th":{borderTop:"none"},"& > thead > tr > th, & > tbody > tr > td":{borderRight:s?a:"none","&:last-of-type":{borderRight:"none",borderLeft:s?a:"none"}},"& > tbody > tr > th":{borderRight:s?a:"none"},"&[data-striped] > tbody > tr:nth-of-type(odd)":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[0]},"&[data-hover] > tbody > tr":e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1]})})}});const Kfe=Yfe;var qfe=Object.defineProperty,Jfe=Object.defineProperties,Qfe=Object.getOwnPropertyDescriptors,jv=Object.getOwnPropertySymbols,M8=Object.prototype.hasOwnProperty,N8=Object.prototype.propertyIsEnumerable,lT=(e,t,n)=>t in e?qfe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Xfe=(e,t)=>{for(var n in t||(t={}))M8.call(t,n)&&lT(e,n,t[n]);if(jv)for(var n of jv(t))N8.call(t,n)&&lT(e,n,t[n]);return e},ehe=(e,t)=>Jfe(e,Qfe(t)),the=(e,t)=>{var n={};for(var r in e)M8.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&jv)for(var r of jv(e))t.indexOf(r)<0&&N8.call(e,r)&&(n[r]=e[r]);return n};const nhe={striped:!1,highlightOnHover:!1,captionSide:"top",horizontalSpacing:"xs",fontSize:"sm",verticalSpacing:7,withBorder:!1,withColumnBorders:!1},JP=_.forwardRef((e,t)=>{const n=ae("Table",nhe,e),{className:r,children:o,striped:i,highlightOnHover:s,captionSide:a,horizontalSpacing:c,verticalSpacing:u,fontSize:f,unstyled:h,withBorder:m,withColumnBorders:v,variant:y}=n,w=the(n,["className","children","striped","highlightOnHover","captionSide","horizontalSpacing","verticalSpacing","fontSize","unstyled","withBorder","withColumnBorders","variant"]),{classes:P,cx:b}=Kfe({captionSide:a,verticalSpacing:u,horizontalSpacing:c,fontSize:f,withBorder:m,withColumnBorders:v},{unstyled:h,name:"Table",variant:y});return k.createElement(Pe,ehe(Xfe({},w),{component:"table",ref:t,className:b(P.root,r),"data-striped":i||void 0,"data-hover":s||void 0}),o)});JP.displayName="@mantine/core/Table";var rhe=Object.defineProperty,ohe=Object.defineProperties,ihe=Object.getOwnPropertyDescriptors,cT=Object.getOwnPropertySymbols,she=Object.prototype.hasOwnProperty,ahe=Object.prototype.propertyIsEnumerable,uT=(e,t,n)=>t in e?rhe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dT=(e,t)=>{for(var n in t||(t={}))she.call(t,n)&&uT(e,n,t[n]);if(cT)for(var n of cT(t))ahe.call(t,n)&&uT(e,n,t[n]);return e},lhe=(e,t)=>ohe(e,ihe(t));const che={xs:M(16),sm:M(20),md:M(26),lg:M(32),xl:M(40)},uhe=["filled","light","gradient","outline","default"];function dhe({theme:e,variant:t,color:n,gradient:r}){if(!uhe.includes(t))return null;const o=e.fn.variant({variant:t,color:n||e.primaryColor,gradient:r,primaryFallback:!1});return{backgroundColor:o.background,color:o.color,backgroundImage:t==="gradient"?o.background:void 0,border:`${M(t==="gradient"?0:1)} solid ${o.border}`}}var fhe=ue((e,{color:t,radius:n,gradient:r},{variant:o,size:i})=>{const s=re({size:i,sizes:che});return{root:dT(lhe(dT({},e.fn.fontStyles()),{display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",width:s,height:s,minWidth:s,minHeight:s,borderRadius:e.fn.radius(n)}),dhe({theme:e,variant:o,gradient:r,color:t}))}});const hhe=fhe;var phe=Object.defineProperty,Dv=Object.getOwnPropertySymbols,T8=Object.prototype.hasOwnProperty,I8=Object.prototype.propertyIsEnumerable,fT=(e,t,n)=>t in e?phe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mhe=(e,t)=>{for(var n in t||(t={}))T8.call(t,n)&&fT(e,n,t[n]);if(Dv)for(var n of Dv(t))I8.call(t,n)&&fT(e,n,t[n]);return e},ghe=(e,t)=>{var n={};for(var r in e)T8.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Dv)for(var r of Dv(e))t.indexOf(r)<0&&I8.call(e,r)&&(n[r]=e[r]);return n};const vhe={size:"md",variant:"filled"},dx=_.forwardRef((e,t)=>{const n=ae("ThemeIcon",vhe,e),{className:r,size:o,radius:i,variant:s,color:a,children:c,gradient:u,unstyled:f}=n,h=ghe(n,["className","size","radius","variant","color","children","gradient","unstyled"]),{classes:m,cx:v}=hhe({variant:s,radius:i,color:a,gradient:u},{name:"ThemeIcon",unstyled:f,variant:s,size:o});return k.createElement(Pe,mhe({className:v(m.root,r),ref:t},h),c)});dx.displayName="@mantine/core/ThemeIcon";var yhe=Object.defineProperty,_he=Object.defineProperties,whe=Object.getOwnPropertyDescriptors,hT=Object.getOwnPropertySymbols,bhe=Object.prototype.hasOwnProperty,xhe=Object.prototype.propertyIsEnumerable,pT=(e,t,n)=>t in e?yhe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,She=(e,t)=>{for(var n in t||(t={}))bhe.call(t,n)&&pT(e,n,t[n]);if(hT)for(var n of hT(t))xhe.call(t,n)&&pT(e,n,t[n]);return e},Phe=(e,t)=>_he(e,whe(t));function Ohe(e,t,n){return typeof e<"u"?e in n.headings.sizes?n.headings.sizes[e].fontSize:M(e):n.headings.sizes[t].fontSize}function Che(e,t,n){return typeof e<"u"&&e in n.headings.sizes?n.headings.sizes[e].lineHeight:n.headings.sizes[t].lineHeight}var khe=ue((e,{element:t,weight:n,inline:r},{size:o})=>({root:Phe(She({},e.fn.fontStyles()),{fontFamily:e.headings.fontFamily,fontWeight:n||e.headings.sizes[t].fontWeight||e.headings.fontWeight,fontSize:Ohe(o,t,e),lineHeight:r?1:Che(o,t,e),margin:0})}));const Ehe=khe;var $he=Object.defineProperty,Rv=Object.getOwnPropertySymbols,j8=Object.prototype.hasOwnProperty,D8=Object.prototype.propertyIsEnumerable,mT=(e,t,n)=>t in e?$he(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mhe=(e,t)=>{for(var n in t||(t={}))j8.call(t,n)&&mT(e,n,t[n]);if(Rv)for(var n of Rv(t))D8.call(t,n)&&mT(e,n,t[n]);return e},Nhe=(e,t)=>{var n={};for(var r in e)j8.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Rv)for(var r of Rv(e))t.indexOf(r)<0&&D8.call(e,r)&&(n[r]=e[r]);return n};const The={order:1},R8=_.forwardRef((e,t)=>{const n=ae("Title",The,e),{className:r,order:o,children:i,unstyled:s,size:a,weight:c,inline:u,variant:f}=n,h=Nhe(n,["className","order","children","unstyled","size","weight","inline","variant"]),{classes:m,cx:v}=Ehe({element:`h${o}`,weight:c,inline:u},{name:"Title",unstyled:s,variant:f,size:a});return[1,2,3,4,5,6].includes(o)?k.createElement(U,Mhe({variant:f,component:`h${o}`,ref:t,className:v(m.root,r)},h),i):null});R8.displayName="@mantine/core/Title";var Ihe=Object.defineProperty,jhe=Object.defineProperties,Dhe=Object.getOwnPropertyDescriptors,gT=Object.getOwnPropertySymbols,Rhe=Object.prototype.hasOwnProperty,Lhe=Object.prototype.propertyIsEnumerable,vT=(e,t,n)=>t in e?Ihe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fp=(e,t)=>{for(var n in t||(t={}))Rhe.call(t,n)&&vT(e,n,t[n]);if(gT)for(var n of gT(t))Lhe.call(t,n)&&vT(e,n,t[n]);return e},hp=(e,t)=>jhe(e,Dhe(t)),zhe=ue(e=>{const t=IU(e.headings.sizes).reduce((n,r)=>{const o=e.headings.sizes[r];return n[`& ${r}`]=hp(fp({fontFamily:e.headings.fontFamily,fontWeight:o.fontWeight||e.headings.fontWeight,marginTop:typeof o.lineHeight=="number"?`calc(${e.spacing.xl} * ${o.lineHeight})`:e.spacing.xl,marginBottom:e.spacing.sm},o),{[e.fn.smallerThan("sm")]:{fontSize:`calc(${M(o.fontSize)} / 1.3)`}}),n},{});return{root:hp(fp(hp(fp({},e.fn.fontStyles()),{color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,lineHeight:e.lineHeight,fontSize:e.fontSizes.md,[e.fn.smallerThan("sm")]:{fontSize:e.fontSizes.sm}}),t),{"& img":{maxWidth:"100%",marginBottom:e.spacing.xs},"& p":{marginTop:0,marginBottom:e.spacing.lg},"& mark":{backgroundColor:e.fn.themeColor("yellow",e.colorScheme==="dark"?5:2),color:e.colorScheme==="dark"?e.colors.dark[9]:"inherit"},"& hr":{marginTop:e.spacing.md,marginBottom:e.spacing.sm,borderBottom:0,borderLeft:0,borderRight:0,borderTop:`${M(1)} dashed ${e.colors.gray[e.colorScheme==="dark"?4:6]}`},"& a":hp(fp({},e.fn.focusStyles()),{color:e.colors[e.primaryColor][e.colorScheme==="dark"?4:6],textDecoration:"none","&:hover":{textDecoration:"underline"}}),"& pre":{padding:e.spacing.xs,lineHeight:e.lineHeight,margin:0,marginTop:e.spacing.md,marginBottom:e.spacing.md,overflowX:"auto",fontFamily:e.fontFamilyMonospace,fontSize:e.fontSizes.sm,borderRadius:e.radius.sm,backgroundColor:e.colorScheme==="dark"?e.colors.dark[8]:e.colors.gray[0],"& code":{backgroundColor:"transparent",padding:0,borderRadius:0,color:"inherit",border:0}},"& code":{lineHeight:e.lineHeight,padding:`${M(1)} ${M(5)}`,borderRadius:e.radius.sm,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,backgroundColor:e.colorScheme==="dark"?e.colors.dark[9]:e.colors.gray[0],fontFamily:e.fontFamilyMonospace,fontSize:e.fontSizes.xs,border:`${M(1)} solid ${e.colorScheme==="dark"?e.colors.dark[9]:e.colors.gray[3]}`},"& ul, & ol":{marginBottom:e.spacing.md,paddingLeft:38,"& li":{marginTop:e.spacing.xs}},"& table":{width:"100%",borderCollapse:"collapse",captionSide:"bottom",marginBottom:e.spacing.md,"& caption":{marginTop:e.spacing.xs,fontSize:e.fontSizes.sm,color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6]},"& th":{textAlign:"left",fontWeight:"bold",color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],fontSize:14,padding:`${M(7)} ${M(10)}`},"& thead th":{borderBottom:`${M(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`},"& tfoot th":{borderTop:`${M(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`},"& td":{padding:`${M(7)} ${M(10)}`,borderBottom:`${M(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`,fontSize:14},"& tr:last-of-type td":{borderBottom:"none"}},"& blockquote":{fontSize:e.fontSizes.lg,lineHeight:e.lineHeight,margin:`${e.spacing.md} 0`,borderTopRightRadius:e.radius.sm,borderBottomRightRadius:e.radius.sm,padding:`${e.spacing.md} ${e.spacing.lg}`,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,borderLeft:`${M(6)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`,"& cite":{display:"block",fontSize:e.fontSizes.sm,marginTop:e.spacing.xs,color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],overflow:"hidden",textOverflow:"ellipsis"}}})}});const Ahe=zhe;var Bhe=Object.defineProperty,Lv=Object.getOwnPropertySymbols,L8=Object.prototype.hasOwnProperty,z8=Object.prototype.propertyIsEnumerable,yT=(e,t,n)=>t in e?Bhe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Fhe=(e,t)=>{for(var n in t||(t={}))L8.call(t,n)&&yT(e,n,t[n]);if(Lv)for(var n of Lv(t))z8.call(t,n)&&yT(e,n,t[n]);return e},Vhe=(e,t)=>{var n={};for(var r in e)L8.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Lv)for(var r of Lv(e))t.indexOf(r)<0&&z8.call(e,r)&&(n[r]=e[r]);return n};const A8=_.forwardRef((e,t)=>{const n=ae("TypographyStylesProvider",{},e),{className:r,unstyled:o,variant:i}=n,s=Vhe(n,["className","unstyled","variant"]),{classes:a,cx:c}=Ahe(null,{name:"TypographyStylesProvider",unstyled:o,variant:i});return k.createElement(Pe,Fhe({className:c(a.root,r),ref:t},s))});A8.displayName="@mantine/core/TypographyStylesProvider";var fx={},_T=Cs;fx.createRoot=_T.createRoot,fx.hydrateRoot=_T.hydrateRoot;/** * @remix-run/router v1.9.0 * * Copyright (c) Remix Software Inc. @@ -111,7 +111,7 @@ Error generating stack: `+i.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Fv(){return Fv=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[o]=e[o]);return n}function Mpe(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Npe(e,t){return e.button===0&&(!t||t==="_self")&&!Mpe(e)}const Tpe=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"],Ipe=["aria-current","caseSensitive","className","end","style","to","children"],Dpe="startTransition",PT=Jd[Dpe];function jpe(e){let{basename:t,children:n,future:r,window:o}=e,i=_.useRef();i.current==null&&(i.current=Hhe({window:o,v5Compat:!0}));let s=i.current,[a,c]=_.useState({action:s.action,location:s.location}),{v7_startTransition:u}=r||{},f=_.useCallback(h=>{u&&PT?PT(()=>c(h)):c(h)},[c,u]);return _.useLayoutEffect(()=>s.listen(f),[s,f]),_.createElement(Epe,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:s})}const Lpe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Rpe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,zpe=_.forwardRef(function(t,n){let{onClick:r,relative:o,reloadDocument:i,replace:s,state:a,target:c,to:u,preventScrollReset:f}=t,h=q8(t,Tpe),{basename:m}=_.useContext(Gl),v,y=!1;if(typeof u=="string"&&Rpe.test(u)&&(v=u,Lpe))try{let S=new URL(window.location.href),O=u.startsWith("//")?new URL(S.protocol+u):new URL(u),E=QP(O.pathname,m);O.origin===S.origin&&E!=null?u=E+O.search+O.hash:y=!0}catch{}let w=ppe(u,{relative:o}),P=Bpe(u,{replace:s,state:a,target:c,preventScrollReset:f,relative:o});function b(S){r&&r(S),S.defaultPrevented||P(S)}return _.createElement("a",Fv({},h,{href:v||w,onClick:y||i?r:b,ref:n,target:c}))}),Ape=_.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:o=!1,className:i="",end:s=!1,style:a,to:c,children:u}=t,f=q8(t,Ipe),h=eO(c,{relative:f.relative}),m=Tu(),v=_.useContext(U8),{navigator:y}=_.useContext(Gl),w=y.encodeLocation?y.encodeLocation(h).pathname:h.pathname,P=m.pathname,b=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;o||(P=P.toLowerCase(),b=b?b.toLowerCase():null,w=w.toLowerCase());let S=P===w||!s&&P.startsWith(w)&&P.charAt(w.length)==="/",O=b!=null&&(b===w||!s&&b.startsWith(w)&&b.charAt(w.length)==="/"),E=S?r:void 0,$;typeof i=="function"?$=i({isActive:S,isPending:O}):$=[i,S?"active":null,O?"pending":null].filter(Boolean).join(" ");let N=typeof a=="function"?a({isActive:S,isPending:O}):a;return _.createElement(zpe,Fv({},f,{"aria-current":E,className:$,ref:n,style:N,to:c}),typeof u=="function"?u({isActive:S,isPending:O}):u)});var OT;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher"})(OT||(OT={}));var CT;(function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(CT||(CT={}));function Bpe(e,t){let{target:n,replace:r,state:o,preventScrollReset:i,relative:s}=t===void 0?{}:t,a=Kl(),c=Tu(),u=eO(e,{relative:s});return _.useCallback(f=>{if(Npe(f,n)){f.preventDefault();let h=r!==void 0?r:zv(c)===zv(u);a(e,{replace:h,state:o,preventScrollReset:i,relative:s})}},[c,a,u,r,o,n,e,i,s])}/** + */function Fv(){return Fv=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[o]=e[o]);return n}function Mpe(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Npe(e,t){return e.button===0&&(!t||t==="_self")&&!Mpe(e)}const Tpe=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"],Ipe=["aria-current","caseSensitive","className","end","style","to","children"],jpe="startTransition",PT=Jd[jpe];function Dpe(e){let{basename:t,children:n,future:r,window:o}=e,i=_.useRef();i.current==null&&(i.current=Hhe({window:o,v5Compat:!0}));let s=i.current,[a,c]=_.useState({action:s.action,location:s.location}),{v7_startTransition:u}=r||{},f=_.useCallback(h=>{u&&PT?PT(()=>c(h)):c(h)},[c,u]);return _.useLayoutEffect(()=>s.listen(f),[s,f]),_.createElement(Epe,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:s})}const Rpe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Lpe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,zpe=_.forwardRef(function(t,n){let{onClick:r,relative:o,reloadDocument:i,replace:s,state:a,target:c,to:u,preventScrollReset:f}=t,h=q8(t,Tpe),{basename:m}=_.useContext(Gl),v,y=!1;if(typeof u=="string"&&Lpe.test(u)&&(v=u,Rpe))try{let S=new URL(window.location.href),O=u.startsWith("//")?new URL(S.protocol+u):new URL(u),E=QP(O.pathname,m);O.origin===S.origin&&E!=null?u=E+O.search+O.hash:y=!0}catch{}let w=ppe(u,{relative:o}),P=Bpe(u,{replace:s,state:a,target:c,preventScrollReset:f,relative:o});function b(S){r&&r(S),S.defaultPrevented||P(S)}return _.createElement("a",Fv({},h,{href:v||w,onClick:y||i?r:b,ref:n,target:c}))}),Ape=_.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:o=!1,className:i="",end:s=!1,style:a,to:c,children:u}=t,f=q8(t,Ipe),h=eO(c,{relative:f.relative}),m=Tu(),v=_.useContext(U8),{navigator:y}=_.useContext(Gl),w=y.encodeLocation?y.encodeLocation(h).pathname:h.pathname,P=m.pathname,b=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;o||(P=P.toLowerCase(),b=b?b.toLowerCase():null,w=w.toLowerCase());let S=P===w||!s&&P.startsWith(w)&&P.charAt(w.length)==="/",O=b!=null&&(b===w||!s&&b.startsWith(w)&&b.charAt(w.length)==="/"),E=S?r:void 0,$;typeof i=="function"?$=i({isActive:S,isPending:O}):$=[i,S?"active":null,O?"pending":null].filter(Boolean).join(" ");let N=typeof a=="function"?a({isActive:S,isPending:O}):a;return _.createElement(zpe,Fv({},f,{"aria-current":E,className:$,ref:n,style:N,to:c}),typeof u=="function"?u({isActive:S,isPending:O}):u)});var OT;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher"})(OT||(OT={}));var CT;(function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(CT||(CT={}));function Bpe(e,t){let{target:n,replace:r,state:o,preventScrollReset:i,relative:s}=t===void 0?{}:t,a=Kl(),c=Tu(),u=eO(e,{relative:s});return _.useCallback(f=>{if(Npe(f,n)){f.preventDefault();let h=r!==void 0?r:zv(c)===zv(u);a(e,{replace:h,state:o,preventScrollReset:i,relative:s})}},[c,a,u,r,o,n,e,i,s])}/** * @license @tabler/icons-react v3.12.0 - MIT * * This source code is licensed under the MIT license. @@ -451,7 +451,7 @@ Error generating stack: `+i.message+` * * This source code is licensed under the MIT license. * See the LICENSE file in the root directory of this source tree. - */var Ra=pe("outline","search","IconSearch",[["path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0",key:"svg-0"}],["path",{d:"M21 21l-6 -6",key:"svg-1"}]]);/** + */var La=pe("outline","search","IconSearch",[["path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0",key:"svg-0"}],["path",{d:"M21 21l-6 -6",key:"svg-1"}]]);/** * @license @tabler/icons-react v3.12.0 - MIT * * This source code is licensed under the MIT license. @@ -481,12 +481,12 @@ Error generating stack: `+i.message+` * * This source code is licensed under the MIT license. * See the LICENSE file in the root directory of this source tree. - */var Dme=pe("outline","superscript","IconSuperscript",[["path",{d:"M5 7l8 10m-8 0l8 -10",key:"svg-0"}],["path",{d:"M21 11h-4l3.5 -4a1.73 1.73 0 0 0 -3.5 -2",key:"svg-1"}]]);/** + */var jme=pe("outline","superscript","IconSuperscript",[["path",{d:"M5 7l8 10m-8 0l8 -10",key:"svg-0"}],["path",{d:"M21 11h-4l3.5 -4a1.73 1.73 0 0 0 -3.5 -2",key:"svg-1"}]]);/** * @license @tabler/icons-react v3.12.0 - MIT * * This source code is licensed under the MIT license. * See the LICENSE file in the root directory of this source tree. - */var jme=pe("outline","tools","IconTools",[["path",{d:"M3 21h4l13 -13a1.5 1.5 0 0 0 -4 -4l-13 13v4",key:"svg-0"}],["path",{d:"M14.5 5.5l4 4",key:"svg-1"}],["path",{d:"M12 8l-5 -5l-4 4l5 5",key:"svg-2"}],["path",{d:"M7 8l-1.5 1.5",key:"svg-3"}],["path",{d:"M16 12l5 5l-4 4l-5 -5",key:"svg-4"}],["path",{d:"M16 17l-1.5 1.5",key:"svg-5"}]]);/** + */var Dme=pe("outline","tools","IconTools",[["path",{d:"M3 21h4l13 -13a1.5 1.5 0 0 0 -4 -4l-13 13v4",key:"svg-0"}],["path",{d:"M14.5 5.5l4 4",key:"svg-1"}],["path",{d:"M12 8l-5 -5l-4 4l5 5",key:"svg-2"}],["path",{d:"M7 8l-1.5 1.5",key:"svg-3"}],["path",{d:"M16 12l5 5l-4 4l-5 -5",key:"svg-4"}],["path",{d:"M16 17l-1.5 1.5",key:"svg-5"}]]);/** * @license @tabler/icons-react v3.12.0 - MIT * * This source code is licensed under the MIT license. @@ -496,7 +496,7 @@ Error generating stack: `+i.message+` * * This source code is licensed under the MIT license. * See the LICENSE file in the root directory of this source tree. - */var Lme=pe("outline","underline","IconUnderline",[["path",{d:"M7 5v5a5 5 0 0 0 10 0v-5",key:"svg-0"}],["path",{d:"M5 19h14",key:"svg-1"}]]);/** + */var Rme=pe("outline","underline","IconUnderline",[["path",{d:"M7 5v5a5 5 0 0 0 10 0v-5",key:"svg-0"}],["path",{d:"M5 19h14",key:"svg-1"}]]);/** * @license @tabler/icons-react v3.12.0 - MIT * * This source code is licensed under the MIT license. @@ -506,7 +506,7 @@ Error generating stack: `+i.message+` * * This source code is licensed under the MIT license. * See the LICENSE file in the root directory of this source tree. - */var Rme=pe("outline","user-exclamation","IconUserExclamation",[["path",{d:"M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0",key:"svg-0"}],["path",{d:"M6 21v-2a4 4 0 0 1 4 -4h4c.348 0 .686 .045 1.008 .128",key:"svg-1"}],["path",{d:"M19 16v3",key:"svg-2"}],["path",{d:"M19 22v.01",key:"svg-3"}]]);/** + */var Lme=pe("outline","user-exclamation","IconUserExclamation",[["path",{d:"M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0",key:"svg-0"}],["path",{d:"M6 21v-2a4 4 0 0 1 4 -4h4c.348 0 .686 .045 1.008 .128",key:"svg-1"}],["path",{d:"M19 16v3",key:"svg-2"}],["path",{d:"M19 22v.01",key:"svg-3"}]]);/** * @license @tabler/icons-react v3.12.0 - MIT * * This source code is licensed under the MIT license. @@ -577,18 +577,18 @@ Error generating stack: `+i.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var J0=_,tge=ege;function nge(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var rge=typeof Object.is=="function"?Object.is:nge,oge=tge.useSyncExternalStore,ige=J0.useRef,sge=J0.useEffect,age=J0.useMemo,lge=J0.useDebugValue;u7.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=ige(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=age(function(){function c(v){if(!u){if(u=!0,f=v,v=r(v),o!==void 0&&s.hasValue){var y=s.value;if(o(y,v))return h=y}return h=v}if(y=h,rge(f,v))return y;var w=r(v);return o!==void 0&&o(y,w)?y:(f=v,h=w)}var u=!1,f,h,m=n===void 0?null:n;return[function(){return c(t())},m===null?void 0:function(){return c(m())}]},[t,n,r,o]);var a=oge(e,i[0],i[1]);return sge(function(){s.hasValue=!0,s.value=a},[a]),lge(a),a};c7.exports=u7;var cge=c7.exports;const uge=Ta(cge),{useSyncExternalStoreWithSelector:dge}=uge;function fge(e,t=e.getState,n){const r=dge(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return _.useDebugValue(r),r}const ET=e=>{const t=typeof e=="function"?Wme(e):e,n=(r,o)=>fge(t,r,o);return Object.assign(n,t),n},tn=e=>e?ET(e):ET,it=()=>!window.invokeNative,hge=()=>{},h7=tn(e=>({showApp:!!it(),setVisibility:t=>e({showApp:t}),show:()=>e({showApp:!0}),hide:()=>e({showApp:!1}),toggle:()=>e(t=>({showApp:!t.showApp}))})),pge={citizenid:"1993201",firstname:"Bubble",lastname:"Test",role:"Chief",grade:4,image:"https://i.imgur.com/P4uYdfu.jpeg",callSign:103,unit:1},Gr=tn(e=>({personalData:it()?pge:{citizenid:"",firstname:"",lastname:"",role:"",image:"",callSign:0,grade:0},setPersonalData:t=>e(n=>({personalData:typeof t=="function"?t(n.personalData):{...n.personalData,...t}}))}));async function me(e,t,n){if(it())return n?(await new Promise(a=>setTimeout(a,n.delay)),n.data):await new Promise(a=>a);const r={method:"post",headers:{"Content-Type":"application/json; charset=UTF-8"},body:JSON.stringify(t)},o=window.GetParentResourceName?window.GetParentResourceName():"nui-frame-app";return await(await fetch(`https://${o}/${e}`,r)).json()}function mge(e,t=500){const[n,r]=_.useState(e),[o,i]=_.useState(!1);return _.useEffect(()=>{i(!0);const s=setTimeout(()=>{r(e),i(!1)},t);return()=>{clearTimeout(s)}},[e,t]),{debouncedValue:n,isDebouncing:o}}var eh=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},gu=typeof window>"u"||"Deno"in globalThis;function No(){}function gge(e,t){return typeof e=="function"?e(t):e}function gx(e){return typeof e=="number"&&e>=0&&e!==1/0}function p7(e,t){return Math.max(e+(t||0)-Date.now(),0)}function qc(e,t){return typeof e=="function"?e(t):e}function Qo(e,t){return typeof e=="function"?e(t):e}function $T(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==uO(s,t.options))return!1}else if(!xf(t.queryKey,s))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||i&&!i(t))}function MT(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(bf(t.options.mutationKey)!==bf(i))return!1}else if(!xf(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function uO(e,t){return(t?.queryKeyHashFn||bf)(e)}function bf(e){return JSON.stringify(e,(t,n)=>yx(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function xf(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!xf(e[n],t[n])):!1}function m7(e,t){if(e===t)return e;const n=NT(e)&&NT(t);if(n||yx(e)&&yx(t)){const r=n?e:Object.keys(e),o=r.length,i=n?t:Object.keys(t),s=i.length,a=n?[]:{};let c=0;for(let u=0;u{setTimeout(t,e)})}function _x(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?m7(e,t):t}function yge(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function _ge(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var g7=Symbol();function v7(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===g7?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var wge=class extends eh{#e;#t;#r;constructor(){super(),this.#r=e=>{if(!gu&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},dO=new wge,bge=class extends eh{#e=!0;#t;#r;constructor(){super(),this.#r=e=>{if(!gu&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},Vv=new bge;function xge(e){return Math.min(1e3*2**e,3e4)}function y7(e){return(e??"online")==="online"?Vv.isOnline():!0}var _7=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function ow(e){return e instanceof _7}function w7(e){let t=!1,n=0,r=!1,o,i,s;const a=new Promise((b,S)=>{i=b,s=S}),c=b=>{r||(y(new _7(b)),e.abort?.())},u=()=>{t=!0},f=()=>{t=!1},h=()=>dO.isFocused()&&(e.networkMode==="always"||Vv.isOnline())&&e.canRun(),m=()=>y7(e.networkMode)&&e.canRun(),v=b=>{r||(r=!0,e.onSuccess?.(b),o?.(),i(b))},y=b=>{r||(r=!0,e.onError?.(b),o?.(),s(b))},w=()=>new Promise(b=>{o=S=>{(r||h())&&b(S)},e.onPause?.()}).then(()=>{o=void 0,r||e.onContinue?.()}),P=()=>{if(r)return;let b;const S=n===0?e.initialPromise:void 0;try{b=S??e.fn()}catch(O){b=Promise.reject(O)}Promise.resolve(b).then(v).catch(O=>{if(r)return;const E=e.retry??(gu?0:3),$=e.retryDelay??xge,N=typeof $=="function"?$(n,O):$,I=E===!0||typeof E=="number"&&nh()?void 0:w()).then(()=>{t?y(O):P()})})};return{promise:a,cancel:c,continue:()=>(o?.(),a),cancelRetry:u,continueRetry:f,canStart:m,start:()=>(m()?P():w().then(P),a)}}function Sge(){let e=[],t=0,n=m=>{m()},r=m=>{m()},o=m=>setTimeout(m,0);const i=m=>{o=m},s=m=>{let v;t++;try{v=m()}finally{t--,t||u()}return v},a=m=>{t?e.push(m):o(()=>{n(m)})},c=m=>(...v)=>{a(()=>{m(...v)})},u=()=>{const m=e;e=[],m.length&&o(()=>{r(()=>{m.forEach(v=>{n(v)})})})};return{batch:s,batchCalls:c,schedule:a,setNotifyFunction:m=>{n=m},setBatchNotifyFunction:m=>{r=m},setScheduler:i}}var An=Sge(),b7=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),gx(this.gcTime)&&(this.#e=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(gu?1/0:5*60*1e3))}clearGcTimeout(){this.#e&&(clearTimeout(this.#e),this.#e=void 0)}},Pge=class extends b7{#e;#t;#r;#n;#s;#i;constructor(e){super(),this.#i=!1,this.#s=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.cache,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=Oge(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#n?.promise}setOptions(e){this.options={...this.#s,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,t){const n=_x(this.state.data,e,this.options);return this.#o({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#o({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#n?.promise;return this.#n?.cancel(e),t?t.then(No).catch(No):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>Qo(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!p7(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#n?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#n?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#n&&(this.#i?this.#n.cancel({revert:!0}):this.#n.cancelRetry()),this.scheduleGc()),this.#r.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#o({type:"invalidate"})}fetch(e,t){if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#n)return this.#n.continueRetry(),this.#n.promise}if(e&&this.setOptions(e),!this.options.queryFn){const a=this.observers.find(c=>c.options.queryFn);a&&this.setOptions(a.options)}const n=new AbortController,r=a=>{Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(this.#i=!0,n.signal)})},o=()=>{const a=v7(this.options,t),c={queryKey:this.queryKey,meta:this.meta};return r(c),this.#i=!1,this.options.persister?this.options.persister(a,c,this):a(c)},i={fetchOptions:t,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:o};r(i),this.options.behavior?.onFetch(i,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==i.fetchOptions?.meta)&&this.#o({type:"fetch",meta:i.fetchOptions?.meta});const s=a=>{ow(a)&&a.silent||this.#o({type:"error",error:a}),ow(a)||(this.#r.config.onError?.(a,this),this.#r.config.onSettled?.(this.state.data,a,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.#n=w7({initialPromise:t?.initialPromise,fn:i.fetchFn,abort:n.abort.bind(n),onSuccess:a=>{if(a===void 0){s(new Error(`${this.queryHash} data is undefined`));return}this.setData(a),this.#r.config.onSuccess?.(a,this),this.#r.config.onSettled?.(a,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:s,onFail:(a,c)=>{this.#o({type:"failed",failureCount:a,error:c})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0}),this.#n.start()}#o(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...x7(n.data,this.options),fetchMeta:e.meta??null};case"success":return{...n,data:e.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const r=e.error;return ow(r)&&r.revert&&this.#t?{...this.#t,fetchStatus:"idle"}:{...n,error:r,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),An.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:e})})}};function x7(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:y7(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Oge(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Cge=class extends eh{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,o=t.queryHash??uO(r,t);let i=this.get(o);return i||(i=new Pge({cache:this,queryKey:r,queryHash:o,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(i)),i}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){An.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>$T(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>$T(e,n)):t}notify(e){An.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){An.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){An.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},kge=class extends b7{#e;#t;#r;constructor(e){super(),this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#e=[],this.state=e.state||Ege(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#e.includes(e)||(this.#e.push(e),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(t=>t!==e),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#t.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){this.#r=w7({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(r,o)=>{this.#n({type:"failed",failureCount:r,error:o})},onPause:()=>{this.#n({type:"pause"})},onContinue:()=>{this.#n({type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});const t=this.state.status==="pending",n=!this.#r.canStart();try{if(!t){this.#n({type:"pending",variables:e,isPaused:n}),await this.#t.config.onMutate?.(e,this);const o=await this.options.onMutate?.(e);o!==this.state.context&&this.#n({type:"pending",context:o,variables:e,isPaused:n})}const r=await this.#r.start();return await this.#t.config.onSuccess?.(r,e,this.state.context,this),await this.options.onSuccess?.(r,e,this.state.context),await this.#t.config.onSettled?.(r,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(r,null,e,this.state.context),this.#n({type:"success",data:r}),r}catch(r){try{throw await this.#t.config.onError?.(r,e,this.state.context,this),await this.options.onError?.(r,e,this.state.context),await this.#t.config.onSettled?.(void 0,r,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,r,e,this.state.context),r}finally{this.#n({type:"error",error:r})}}finally{this.#t.runNext(this)}}#n(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),An.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function Ege(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var $ge=class extends eh{constructor(e={}){super(),this.config=e,this.#e=new Map,this.#t=Date.now()}#e;#t;build(e,t,n){const r=new kge({mutationCache:this,mutationId:++this.#t,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){const t=pp(e),n=this.#e.get(t)??[];n.push(e),this.#e.set(t,n),this.notify({type:"added",mutation:e})}remove(e){const t=pp(e);if(this.#e.has(t)){const n=this.#e.get(t)?.filter(r=>r!==e);n&&(n.length===0?this.#e.delete(t):this.#e.set(t,n))}this.notify({type:"removed",mutation:e})}canRun(e){const t=this.#e.get(pp(e))?.find(n=>n.state.status==="pending");return!t||t===e}runNext(e){return this.#e.get(pp(e))?.find(n=>n!==e&&n.state.isPaused)?.continue()??Promise.resolve()}clear(){An.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}getAll(){return[...this.#e.values()].flat()}find(e){const t={exact:!0,...e};return this.getAll().find(n=>MT(t,n))}findAll(e={}){return this.getAll().filter(t=>MT(e,t))}notify(e){An.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return An.batch(()=>Promise.all(e.map(t=>t.continue().catch(No))))}};function pp(e){return e.options.scope?.id??String(e.mutationId)}function wx(e){return{onFetch:(t,n)=>{const r=async()=>{const o=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,s=t.state.data?.pages||[],a=t.state.data?.pageParams||[],c={pages:[],pageParams:[]};let u=!1;const f=y=>{Object.defineProperty(y,"signal",{enumerable:!0,get:()=>(t.signal.aborted?u=!0:t.signal.addEventListener("abort",()=>{u=!0}),t.signal)})},h=v7(t.options,t.fetchOptions),m=async(y,w,P)=>{if(u)return Promise.reject();if(w==null&&y.pages.length)return Promise.resolve(y);const b={queryKey:t.queryKey,pageParam:w,direction:P?"backward":"forward",meta:t.options.meta};f(b);const S=await h(b),{maxPages:O}=t.options,E=P?_ge:yge;return{pages:E(y.pages,S,O),pageParams:E(y.pageParams,w,O)}};let v;if(i&&s.length){const y=i==="backward",w=y?S7:bx,P={pages:s,pageParams:a},b=w(o,P);v=await m(P,b,y)}else{v=await m(c,a[0]??o.initialPageParam);const y=e??s.length;for(let w=1;wt.options.persister?.(r,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=r}}}function bx(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function S7(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function Mge(e,t){return t?bx(e,t)!=null:!1}function Nge(e,t){return!t||!e.getPreviousPageParam?!1:S7(e,t)!=null}var Tge=class{#e;#t;#r;#n;#s;#i;#o;#a;constructor(e={}){this.#e=e.queryCache||new Cge,this.#t=e.mutationCache||new $ge,this.#r=e.defaultOptions||{},this.#n=new Map,this.#s=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#o=dO.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#a=Vv.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#o?.(),this.#o=void 0,this.#a?.(),this.#a=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);if(t===void 0)return this.fetchQuery(e);{const n=this.defaultQueryOptions(e),r=this.#e.build(this,n);return e.revalidateIfStale&&r.isStaleByTime(qc(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(t)}}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,s=gge(t,i);if(s!==void 0)return this.#e.build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return An.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;An.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e,r={type:"active",...e};return An.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=An.batch(()=>this.#e.findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(No).catch(No)}invalidateQueries(e={},t={}){return An.batch(()=>{if(this.#e.findAll(e).forEach(r=>{r.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:t?.cancelRefetch??!0},r=An.batch(()=>this.#e.findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(No)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(No)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(qc(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(No).catch(No)}fetchInfiniteQuery(e){return e.behavior=wx(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(No).catch(No)}resumePausedMutations(){return Vv.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#r}setDefaultOptions(e){this.#r=e}setQueryDefaults(e,t){this.#n.set(bf(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#n.values()];let n={};return t.forEach(r=>{xf(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){this.#s.set(bf(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#s.values()];let n={};return t.forEach(r=>{xf(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#r.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=uO(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.enabled!==!0&&t.queryFn===g7&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#r.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Ige=class extends eh{constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#r=void 0;#n=void 0;#s;#i;#o;#a;#f;#h;#c;#u;#l;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),IT(this.#t,this.options)?this.#d():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return xx(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return xx(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#_(),this.#w(),this.#t.removeObserver(this)}setOptions(e,t){const n=this.options,r=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Qo(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#b(),this.#t.setOptions(this.options),n._defaulted&&!vx(this.options,n)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const o=this.hasListeners();o&&DT(this.#t,r,this.options,n)&&this.#d(),this.updateResult(t),o&&(this.#t!==r||Qo(this.options.enabled,this.#t)!==Qo(n.enabled,this.#t)||qc(this.options.staleTime,this.#t)!==qc(n.staleTime,this.#t))&&this.#m();const i=this.#g();o&&(this.#t!==r||Qo(this.options.enabled,this.#t)!==Qo(n.enabled,this.#t)||i!==this.#l)&&this.#v(i)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return jge(this,n)&&(this.#n=n,this.#i=this.options,this.#s=this.#t.state),n}getCurrentResult(){return this.#n}trackResult(e,t){const n={};return Object.keys(e).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(r),t?.(r),e[r])})}),n}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.isFetchingOptimistic=!0,n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#n))}#d(e){this.#b();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(No)),t}#m(){this.#_();const e=qc(this.options.staleTime,this.#t);if(gu||this.#n.isStale||!gx(e))return;const n=p7(this.#n.dataUpdatedAt,e)+1;this.#c=setTimeout(()=>{this.#n.isStale||this.updateResult()},n)}#g(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#w(),this.#l=e,!(gu||Qo(this.options.enabled,this.#t)===!1||!gx(this.#l)||this.#l===0)&&(this.#u=setInterval(()=>{(this.options.refetchIntervalInBackground||dO.isFocused())&&this.#d()},this.#l))}#y(){this.#m(),this.#v(this.#g())}#_(){this.#c&&(clearTimeout(this.#c),this.#c=void 0)}#w(){this.#u&&(clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#t,r=this.options,o=this.#n,i=this.#s,s=this.#i,c=e!==n?e.state:this.#r,{state:u}=e;let f={...u},h=!1,m;if(t._optimisticResults){const N=this.hasListeners(),I=!N&&IT(e,t),R=N&&DT(e,n,t,r);(I||R)&&(f={...f,...x7(u.data,e.options)}),t._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:v,errorUpdatedAt:y,status:w}=f;if(t.select&&f.data!==void 0)if(o&&f.data===i?.data&&t.select===this.#a)m=this.#f;else try{this.#a=t.select,m=t.select(f.data),m=_x(o?.data,m,t),this.#f=m,this.#o=null}catch(N){this.#o=N}else m=f.data;if(t.placeholderData!==void 0&&m===void 0&&w==="pending"){let N;if(o?.isPlaceholderData&&t.placeholderData===s?.placeholderData)N=o.data;else if(N=typeof t.placeholderData=="function"?t.placeholderData(this.#h?.state.data,this.#h):t.placeholderData,t.select&&N!==void 0)try{N=t.select(N),this.#o=null}catch(I){this.#o=I}N!==void 0&&(w="success",m=_x(o?.data,N,t),h=!0)}this.#o&&(v=this.#o,m=this.#f,y=Date.now(),w="error");const P=f.fetchStatus==="fetching",b=w==="pending",S=w==="error",O=b&&P,E=m!==void 0;return{status:w,fetchStatus:f.fetchStatus,isPending:b,isSuccess:w==="success",isError:S,isInitialLoading:O,isLoading:O,data:m,dataUpdatedAt:f.dataUpdatedAt,error:v,errorUpdatedAt:y,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>c.dataUpdateCount||f.errorUpdateCount>c.errorUpdateCount,isFetching:P,isRefetching:P&&!b,isLoadingError:S&&!E,isPaused:f.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:S&&E,isStale:fO(e,t),refetch:this.refetch}}updateResult(e){const t=this.#n,n=this.createResult(this.#t,this.options);if(this.#s=this.#t.state,this.#i=this.options,this.#s.data!==void 0&&(this.#h=this.#t),vx(n,t))return;this.#n=n;const r={},o=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,s=typeof i=="function"?i():i;if(s==="all"||!s&&!this.#p.size)return!0;const a=new Set(s??this.#p);return this.options.throwOnError&&a.add("error"),Object.keys(this.#n).some(c=>{const u=c;return this.#n[u]!==t[u]&&a.has(u)})};e?.listeners!==!1&&o()&&(r.listeners=!0),this.#x({...r,...e})}#b(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#r=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#x(e){An.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#n)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function Dge(e,t){return Qo(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function IT(e,t){return Dge(e,t)||e.state.data!==void 0&&xx(e,t,t.refetchOnMount)}function xx(e,t,n){if(Qo(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&fO(e,t)}return!1}function DT(e,t,n,r){return(e!==t||Qo(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&fO(e,n)}function fO(e,t){return Qo(t.enabled,e)!==!1&&e.isStaleByTime(qc(t.staleTime,e))}function jge(e,t){return!vx(e.getCurrentResult(),t)}var Lge=class extends Ige{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e,t){super.setOptions({...e,behavior:wx()},t)}getOptimisticResult(e){return e.behavior=wx(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:n}=e,r=super.createResult(e,t),{isFetching:o,isRefetching:i,isError:s,isRefetchError:a}=r,c=n.fetchMeta?.fetchMore?.direction,u=s&&c==="forward",f=o&&c==="forward",h=s&&c==="backward",m=o&&c==="backward";return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Mge(t,n.data),hasPreviousPage:Nge(t,n.data),isFetchNextPageError:u,isFetchingNextPage:f,isFetchPreviousPageError:h,isFetchingPreviousPage:m,isRefetchError:a&&!u&&!h,isRefetching:i&&!f&&!m}}},P7=_.createContext(void 0),Rge=e=>{const t=_.useContext(P7);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},zge=({client:e,children:t})=>(_.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),p.jsx(P7.Provider,{value:e,children:t})),O7=_.createContext(!1),Age=()=>_.useContext(O7);O7.Provider;function Bge(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Fge=_.createContext(Bge()),Vge=()=>_.useContext(Fge);function Hge(e,t){return typeof e=="function"?e(...t):!!e}var Wge=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},Uge=e=>{_.useEffect(()=>{e.clearReset()},[e])},Zge=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&Hge(n,[e.error,r]),Gge=e=>{e.suspense&&(typeof e.staleTime!="number"&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},Yge=(e,t)=>e?.suspense&&t.isPending,Kge=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function qge(e,t,n){const r=Rge(n),o=Age(),i=Vge(),s=r.defaultQueryOptions(e);r.getDefaultOptions().queries?._experimental_beforeQuery?.(s),s._optimisticResults=o?"isRestoring":"optimistic",Gge(s),Wge(s,i),Uge(i);const[a]=_.useState(()=>new t(r,s)),c=a.getOptimisticResult(s);if(_.useSyncExternalStore(_.useCallback(u=>{const f=o?()=>{}:a.subscribe(An.batchCalls(u));return a.updateResult(),f},[a,o]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),_.useEffect(()=>{a.setOptions(s,{listeners:!1})},[s,a]),Yge(s,c))throw Kge(s,a,i);if(Zge({result:c,errorResetBoundary:i,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw c.error;return r.getDefaultOptions().queries?._experimental_afterQuery?.(s,c),s.notifyOnChangeProps?c:a.trackResult(c)}function Jge(e,t){return qge(e,Lge,t)}const hO=[];for(let e=0;e<25;e++)hO[e]={firstname:"Firstname",lastname:`Lastname ${e+1}`,dob:Date.now(),citizenid:e.toString()};const pO={firstname:"John",lastname:"Doe",citizenid:"BUB193Z4A",dob:Date.now(),phoneNumber:"123456789",notes:"

",vehicles:["Sultan Custom (88ZOH526)","Sultan Custom (07NCV529)","Sultan Custom (07NCV545)","Sultan Custom (07NCV521)"],relatedReports:[{title:"Report title",id:1,author:"Some One",date:"13/03/2023"},{title:"Report title",id:2,author:"Some One",date:"13/03/2023"},{title:"Report title",id:3,author:"Some One",date:"13/03/2023"},{title:"Report title",id:4,author:"Some One",date:"13/03/2023"}],relatedIncidents:[{title:"Incident 1",author:"Someone nice",date:"13/03/2023",id:1}]},Qge=[{id:"vehicles",title:"Vehicles",icon:"car"}],Xge=async(e,t)=>it()?{hasMore:!0,profiles:hO.slice((e-1)*10,e*10)}:await me("getProfiles",{page:e,search:t},{data:{hasMore:!1,profiles:[]}});function eve(e){const{debouncedValue:t,isDebouncing:n}=mge(e);return{...Jge({queryKey:["profiles",t],queryFn:async({queryKey:o,pageParam:i=1})=>await Xge(i,o[1]),initialPageParam:1,getNextPageParam:(o,i)=>{if(o.hasMore)return i.length+1}}),isDebouncing:n}}const bs=tn(e=>({profileCards:[],selectedProfile:null,isProfileWanted:!1,getProfiles:async()=>it()?{profiles:hO}:await me("getAllProfiles"),setSelectedProfile:t=>{it()&&e({selectedProfile:pO,profileCards:Qge}),e({selectedProfile:t})},setProfileCards:t=>e({profileCards:t}),setIsProfileWanted:t=>{e({isProfileWanted:t})}})),tve={"OFFENSES AGAINST PERSONS":[{label:"Speeding",description:"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aperiam, doloribus eveniet facere ipsam, ipsum minus modi molestiae nesciunt odio saepe sapiente sed sint voluptatibus voluptatum!",type:"infraction",time:0,fine:2500,points:4},{label:"Loitering",description:"Standing go brrr",type:"misdemeanor",time:90,fine:25e3,points:0},{label:"Something else 1",description:"Standing go brrr",type:"misdemeanor",time:90,fine:25e3,points:0},{label:"Something else 2",description:"Standing go brrr",type:"misdemeanor",time:90,fine:25e3,points:0},{label:"Something else 3",description:"Standing go brrr",type:"misdemeanor",time:90,fine:25e3,points:0}],"OFFENSES AGAINST PROPERTY":[{label:"Robbery of a financial institution",description:"Bank robbery go brrr",type:"felony",time:30,fine:3e3,points:0},{label:"Something else 2 in OFFENSES AGAINST",description:"Standing go brrr",type:"felony",time:90,fine:25e3,points:0},{label:"Something else 3 in OFFENSES AGAINST",description:"Standing go brrr",type:"felony",time:90,fine:25e3,points:0},{label:"Something else 4 in OFFENSES AGAINST",description:"Standing go brrr",type:"felony",time:90,fine:25e3,points:0}]},th=tn(e=>({charges:it()?tve:{},setCharges:t=>{e(n=>({charges:typeof t=="function"?t(n.charges):t}))}})),jT=[{firstname:"John",lastname:"Doe",callsign:"1A-01",citizenid:"ABCD1234",playerId:1,position:[0,0,0],unitId:1},{firstname:"Jenna",lastname:"Doe",callsign:"1A-02",citizenid:"ABCD1235",playerId:2,position:[0,0,0]}],mO=tn(e=>({officers:it()?jT:[],activeOfficers:it()?jT:[],getOfficers:async()=>{try{const t=await me("getOfficers");return e({officers:t}),{officers:t}}catch(t){return console.error("Failed to fetch officers:",t),{officers:[]}}},getActiveOfficers:async()=>{try{const t=await me("getActiveOfficers"),n=Object.values(t);return e({activeOfficers:n}),{activeOfficers:n}}catch(t){return console.error("Failed to fetch active officers:",t),{activeOfficers:[]}}},setOfficers:t=>e({officers:t}),addOfficer:t=>e(n=>({officers:[...n.officers,t]})),removeOfficer:t=>e(n=>({officers:n.officers.filter(r=>r.citizenid!==t)}))})),nh=tn(e=>({config:{isDispatchEnabled:!0},setConfig:t=>e({config:t})})),nve=ue(e=>({link:{...e.fn.focusStyles(),display:"flex",alignItems:"center",textDecoration:"none",fontSize:e.fontSizes.xs,color:e.colors.gray[2],padding:`${e.spacing.xs} ${e.spacing.xs}`,fontWeight:500,"&:hover":{borderRadius:e.radius.sm,background:"linear-gradient(90deg, rgba(51,124,255,0.5) 0%, rgba(187,187,187,0) 100%)",color:e.colorScheme==="dark"?e.white:e.black,[`& .${Br("icon")}`]:{color:e.colorScheme==="dark"?e.white:e.black}}},linkIcon:{ref:Br("icon"),color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],marginRight:e.spacing.sm},linkActive:{"&, &:hover":{borderRadius:e.radius.sm,background:"linear-gradient(90deg, rgba(51,124,255,0.5) 0%, rgba(187,187,187,0) 100%)",[`& .${Br("icon")}`]:{color:"white"}}},chevron:{transition:"transform 200ms ease"}})),rve=[{link:"",label:"Dashboard",icon:vme}],ove=[{link:"profiles",label:"Profiles",icon:cO},{link:"incidents",label:"Incidents",icon:sO},{link:"reports",label:"Reports",icon:rO},{link:"vehicles",label:"Vehicles",icon:Ns},{link:"dispatch",label:"Dispatch",icon:hu}],ive=[{label:"Roster",link:"roster",icon:Ame},{label:"Charges",link:"charges",icon:lme}],sve=()=>{const{config:e}=nh(),{classes:t,cx:n,theme:r}=nve(),[o,i]=_.useState(""),{firstname:s,lastname:a,callSign:c,role:u}=Gr(m=>m.personalData),f=Tu(),h=m=>m.map(v=>v.link==="dispatch"&&!e.isDispatchEnabled?null:p.jsxs(Ape,{to:`/${v.link}`,onClick:()=>i(v.link),className:n(t.link,{[t.linkActive]:o===v.link}),children:[p.jsx(v.icon,{className:t.linkIcon,stroke:1.5}),p.jsx("span",{children:v.label})]},v.link));return _.useEffect(()=>{i(f.pathname.split("/")[1])},[f]),p.jsxs(ug,{p:"xs",style:{backgroundColor:"#242527",borderTopLeftRadius:5,borderBottomLeftRadius:5,maxWidth:300,height:"100%"},children:[p.jsxs(ug.Section,{children:[p.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:p.jsx(ai,{radius:"md",width:150,height:150,fit:"contain",src:Hme,alt:"LSPD Logo"})}),p.jsx(Ye,{my:"sm"}),p.jsxs(At,{h:632,scrollbarSize:2,children:[p.jsx(U,{size:"xs",weight:500,color:"dimmed",style:{margin:8},children:"Home"}),h(rve),p.jsx(U,{size:"xs",weight:500,color:"dimmed",style:{margin:8},children:"Pages"}),h(ove),p.jsx(U,{size:"xs",weight:500,color:"dimmed",style:{margin:8},children:"Staff"}),h(ive)]})]}),p.jsx(Pe,{sx:{paddingTop:5,borderTop:`${M(1)} solid ${r.colorScheme==="dark"?r.colors.dark[4]:r.colors.gray[2]}`},children:p.jsx("div",{style:{display:"block",width:"100%",color:"#e9ecef",padding:"0.625rem"},children:p.jsx(nt,{children:p.jsxs(Pe,{sx:{flex:1},children:[p.jsxs(U,{size:"sm",weight:500,children:[s," ",a]}),p.jsxs(U,{color:"dimmed",size:"xs",children:[u," | ",c]})]})})})})]})};var C7={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(hS,function(){var n=1e3,r=6e4,o=36e5,i="millisecond",s="second",a="minute",c="hour",u="day",f="week",h="month",m="quarter",v="year",y="date",w="Invalid Date",P=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,b=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,S={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(V){var H=["th","st","nd","rd"],Z=V%100;return"["+V+(H[(Z-20)%10]||H[Z]||H[0])+"]"}},O=function(V,H,Z){var Y=String(V);return!Y||Y.length>=H?V:""+Array(H+1-Y.length).join(Z)+V},E={s:O,z:function(V){var H=-V.utcOffset(),Z=Math.abs(H),Y=Math.floor(Z/60),D=Z%60;return(H<=0?"+":"-")+O(Y,2,"0")+":"+O(D,2,"0")},m:function V(H,Z){if(H.date()1)return V(F[0])}else{var K=H.name;N[K]=H,D=K}return!Y&&D&&($=D),D||!Y&&$},z=function(V,H){if(R(V))return V.clone();var Z=typeof H=="object"?H:{};return Z.date=V,Z.args=arguments,new Q(Z)},G=E;G.l=B,G.i=R,G.w=function(V,H){return z(V,{locale:H.$L,utc:H.$u,x:H.$x,$offset:H.$offset})};var Q=function(){function V(Z){this.$L=B(Z.locale,null,!0),this.parse(Z),this.$x=this.$x||Z.x||{},this[I]=!0}var H=V.prototype;return H.parse=function(Z){this.$d=function(Y){var D=Y.date,W=Y.utc;if(D===null)return new Date(NaN);if(G.u(D))return new Date;if(D instanceof Date)return new Date(D);if(typeof D=="string"&&!/Z$/i.test(D)){var F=D.match(P);if(F){var K=F[2]-1||0,ee=(F[7]||"0").substring(0,3);return W?new Date(Date.UTC(F[1],K,F[3]||1,F[4]||0,F[5]||0,F[6]||0,ee)):new Date(F[1],K,F[3]||1,F[4]||0,F[5]||0,F[6]||0,ee)}}return new Date(D)}(Z),this.init()},H.init=function(){var Z=this.$d;this.$y=Z.getFullYear(),this.$M=Z.getMonth(),this.$D=Z.getDate(),this.$W=Z.getDay(),this.$H=Z.getHours(),this.$m=Z.getMinutes(),this.$s=Z.getSeconds(),this.$ms=Z.getMilliseconds()},H.$utils=function(){return G},H.isValid=function(){return this.$d.toString()!==w},H.isSame=function(Z,Y){var D=z(Z);return this.startOf(Y)<=D&&D<=this.endOf(Y)},H.isAfter=function(Z,Y){return z(Z)0,N<=$.r||!$.r){N<=1&&E>0&&($=S[E-1]);var I=b[$.l];v&&(N=v(""+N)),w=typeof I=="string"?I.replace("%d",N):I(N,f,$.l,P);break}}if(f)return w;var R=P?b.future:b.past;return typeof R=="function"?R(w):R.replace("%s",w)},i.to=function(u,f){return a(u,f,this,!0)},i.from=function(u,f){return a(u,f,this)};var c=function(u){return u.$u?o.utc():o()};i.toNow=function(u){return this.to(c(this),u)},i.fromNow=function(u){return this.from(c(this),u)}}})})(k7);var lve=k7.exports;const E7=Ta(lve);const LT={title:"Debug Incident title",id:0,description:"

This is a incident description

",officersInvolved:[{firstname:"Callum",lastname:"Graham",callsign:188,citizenid:"132142",playerId:1,position:[0,0,0]},{firstname:"Jacob",lastname:"Gray",callsign:273,citizenid:"152312",playerId:1,position:[0,0,0]},{firstname:"Edward",lastname:"Atkinson",callsign:125,citizenid:"948213",playerId:1,position:[0,0,0]}],evidence:[],criminals:[{firstname:"Archie",lastname:"Moss",dob:Date.now(),issueWarrant:!1,processed:!1,pleadedGuilty:!1,citizenid:"0",charges:[],penalty:{time:0,fine:0,reduction:null,points:0}}]},Yr=tn(e=>({incident:LT,isIncidentActive:!1,setActiveIncident:t=>{it()&&e({incident:LT}),e({incident:t})},updateIncidentField:(t,n)=>{e(r=>({incident:{...r.incident,[t]:n}}))},setIncidentActive:t=>{e({isIncidentActive:t})},setDescription:t=>{e(n=>({incident:{...n.incident,description:t}}))},setCriminals:t=>{e(n=>({incident:{...n.incident,criminals:typeof t=="function"?t(n.incident.criminals):t}}))},setCriminal:(t,n)=>{e(r=>{const o=r.incident.criminals.map(i=>i.citizenid===t?typeof n=="function"?n(i):{...i,...n}:i);return{incident:{...r.incident,criminals:o}}})},setOfficersInvolved:t=>{e(n=>({incident:{...n.incident,officersInvolved:typeof t=="function"?t(n.incident.officersInvolved):t}}))},setEvidence:t=>{e(n=>({incident:{...n.incident,evidence:typeof t=="function"?t(n.incident.evidence):t}}))}})),cve=[{type:"created",category:"profiles",firstname:"Bubble",lastname:"Test",date:"string",activityid:1,citizenid:"BUB193Z4A"},{type:"updated",category:"profiles",firstname:"Bubble",lastname:"Test",date:"string",activityid:1,citizenid:"BUB193Z4A"},{type:"deleted",category:"profiles",firstname:"Bubble",lastname:"Test",date:"string",activityid:1,citizenid:"BUB193Z4A"},{type:"created",category:"incidents",firstname:"Bubble",lastname:"Test",date:"string",activityid:1,citizenid:"BUB193Z4A"},{type:"created",category:"profiles",firstname:"Bubble",lastname:"Test",date:"string",activityid:1,citizenid:"BUB193Z4A"},{type:"created",category:"profiles",firstname:"Bubble",lastname:"Test",date:"string",activityid:1,citizenid:"BUB193Z4A"},{type:"created",category:"profiles",firstname:"Bubble",lastname:"Test",date:"string",activityid:1,citizenid:"BUB193Z4A"},{type:"created",category:"profiles",firstname:"Bubble",lastname:"Test",date:"string",activityid:1,citizenid:"BUB193Z4A"}],uve=tn(e=>({recentActivity:it()?cve:[],getRecentActivity:async()=>{try{const t=await me("getRecentActivity");return e({recentActivity:t}),{recentActivity:t}}catch(t){return console.error("Failed to fetch recent activities:",t),{recentActivity:[]}}},setRecentActivities:t=>e({recentActivity:t})})),dve="Configuration",fve="Logout",hve="Welcome back, %s %s",pve="Active Officers",mve="Callsign",gve="Attached Unit",vve="Active Warrants",yve="Expires in",_ve="No warrants found",wve="Recent Activity",bve="Type",xve="Category",Sve="Done by",Pve="Time ago",Ove="Dispatch",Cve="Responding Units",kve="No recent calls found",Eve="Announcements",$ve="Create announcement",Mve="All Announcements",Nve="No announcements found",Tve="Create",Ive="View all",Dve="Profiles",jve="Search...",Lve="DOB",Rve="Citizen ID",zve="No profiles found",Ave="No profile selected",Bve="Edit Citizen",Fve="No %s registered",Vve="Related reports",Hve="No related reports",Wve="Related incidents",Uve="No related incidents",Zve="Remove Charge",Gve="No incident selected",Yve="Add Criminal",Kve="Unlink",qve="Officers involved",Jve="Add officer",Qve="Remove officer",Xve="Are you sure you want to remove %s %s (%s) from involved officers?",eye="Confirm",tye="Cancel",nye="Evidence",rye="Add evidence",oye="Incidents",iye="Create incident",sye="Remove evidence",aye="Are you sure you want to remove %s from evidence?",lye="month(s)",cye="Remove criminal",uye="Remove %s %s? Removing them will also remove the charges from their profile.",dye="Go to profile",fye="Save criminal",hye="Edit charges",pye="Issue warrant",mye="Suspect hasn't been processed and charged",gye="Warrant expiration date",vye="Reduction",yye="No reduction",_ye="Time",wye="Fine",bye="Pleaded guilty",xye="Processed",Sye="Current Charges",Pye="All Charges",Oye="point(s)",Cye="Add Charge",kye="Incident title",Eye="Incident title is required",$ye="No officers found",Mye="Image label is required",Nye="Image URL is required",Tye="Image label",Iye="Image URL",Dye="Take picture",jye="No report selected",Lye="Citizens involved",Rye="Add citizen",zye="Are you sure you want to remove %s %s from involved citizens",Aye="Images",Bye="Add image",Fye="Reports",Vye="Create report",Hye="Report title",Wye="Report title is required",Uye="No citizens found",Zye="Units",Gye="Manage members",Yye="Leave Unit",Kye="Create unit",qye="Unit officers",Jye="Set officers assigned to this unit",Qye="Unit vehicle type",Xye="Active Calls",e0e="Responding units (%s)",t0e="Find on map",n0e="Set waypoint",r0e="Detach from call",o0e="Respond",i0e="Manage roster",s0e="Roster",a0e="members",l0e="Members",c0e="Hire officer",u0e="Today",d0e="Yesterday",f0e="Set callsign",h0e="Set rank",p0e="Set roles",m0e="Fire officer",g0e="Are you sure you want to fire %s %s?",v0e="Officer",y0e="APU",_0e="AIR",w0e="MC",b0e="K9",x0e="FTO",S0e="Last active",P0e="Role",O0e="Rank",C0e="Callsign already in use",k0e="The citizen with this citizen id is already hired",E0e="Citizen ID of the citizen you want to hire",$0e="Callsign of the new officer you want to hire",M0e="Create Charge",N0e="Charge Label",T0e="Charge Description",I0e="Charge Category",D0e="Charge Fine",j0e="Charge Jailtime",L0e="Charge Points",R0e="Charge Type",z0e="Delete charge",A0e="Are you sure you want to delete %s",B0e="Edit Charge",F0e="Edit",V0e="Delete Incident",H0e="Are you sure you want to delete %s",W0e="Change picture",U0e="Image",Z0e="Image URL to use as the profile image",G0e="Vehicles",Y0e="No vehicle selected",K0e="Vehicle Information",q0e="Save vehicle",J0e="Known information",Q0e="Wanted",X0e="MARK UNWANTED",e1e="MARK WANTED",t1e="Select items",n1e="Create BOLO",r1e="Plate",o1e="Reason",i1e="BOLO expiration date",s1e="Delete BOLO",a1e="Are you sure you want to delete the BOLO for: %s",l1e="Image URL to use as the vehicle image",c1e="BOLO",u1e="BOLOS",d1e="BOLO expires at:",f1e="Expires at:",h1e="No bolos found",p1e="Go to vehicle",m1e="You are already responding or not a part of a unit",g1e="You responded to the recent call",v1e={configuration:dve,logout:fve,welcome_back:hve,active_officers:pve,callsign:mve,attached_unit:gve,active_warrants:vve,expires_in:yve,no_warrants_found:_ve,recent_activity:wve,type:bve,category:xve,done_by:Sve,time_ago:Pve,dispatch:Ove,responding_units:Cve,no_recent_calls_found:kve,announcements:Eve,create_announcement:$ve,all_announcements:Mve,no_announcements_found:Nve,create:Tve,view_all:Ive,profiles:Dve,search:jve,dob:Lve,citizen_id:Rve,no_profiles_found:zve,no_profile_selected:Ave,edit_citizen:Bve,no_cardid_registered:Fve,related_reports:Vve,no_related_reports:Hve,related_incidents:Wve,no_related_incidents:Uve,remove_charge:Zve,no_incident_selected:Gve,add_criminal:Yve,unlink:Kve,officers_involved:qve,add_officer:Jve,remove_officer:Qve,remove_officer_confirm:Xve,confirm:eye,cancel:tye,evidence:nye,add_evidence:rye,incidents:oye,create_incident:iye,remove_evidence:sye,remove_evidence_confirm:aye,months:lye,remove_criminal:cye,remove_criminal_confirm:uye,go_to_profile:dye,save_criminal:fye,edit_charges:hye,issue_warrant:pye,issue_warrant_description:mye,warrant_expiration_date:gye,reduction:vye,no_reduction:yye,time:_ye,fine:wye,pleaded_guilty:bye,processed:xye,current_charges:Sye,all_charges:Pye,points:Oye,add_charge:Cye,incident_title:kye,incident_title_required:Eye,no_officers_found:$ye,image_label_required:Mye,image_url_required:Nye,image_label:Tye,image_url:Iye,take_picture:Dye,no_report_selected:jye,citizens_involved:Lye,add_citizen:Rye,remove_citizen_confirm:zye,images:Aye,add_image:Bye,reports:Fye,create_report:Vye,report_title:Hye,report_title_required:Wye,no_citizens_found:Uye,units:Zye,manage_members:Gye,leave_unit:Yye,create_unit:Kye,unit_officers:qye,unit_officers_description:Jye,unit_vehicle_type:Qye,active_calls:Xye,respond_units_amount:e0e,find_on_map:t0e,set_waypoint:n0e,detach_from_call:r0e,respond:o0e,manage_roster:i0e,roster:s0e,members:a0e,members_capitalized:l0e,hire_officer:c0e,today:u0e,yesterday:d0e,set_callsign:f0e,set_rank:h0e,set_roles:p0e,fire_officer:m0e,fire_officer_description:g0e,officer:v0e,apu:y0e,air:_0e,mc:w0e,k9:b0e,fto:x0e,last_active:S0e,role:P0e,rank:O0e,callsign_in_use:C0e,citizen_id_already_hired:k0e,citizen_id_you_want_to_hire:E0e,callsign_you_want_to_hire:$0e,create_charge:M0e,charge_label:N0e,charge_description:T0e,charge_category:I0e,charge_fine:D0e,charge_jailtime:j0e,charge_points:L0e,charge_type:R0e,delete_charge:z0e,delete_charge_confirm:A0e,edit_charge:B0e,edit:F0e,delete_incident:V0e,delete_incident_confirm:H0e,change_picture:W0e,image:U0e,avatar_description:Z0e,vehicles:G0e,no_vehicle_selected:Y0e,vehicle_information:K0e,save_vehicle:q0e,known_information:J0e,wanted:Q0e,mark_unwanted:X0e,mark_wanted:e1e,select_items:t1e,create_bolo:n1e,plate:r1e,reason:o1e,bolo_expiration_date:i1e,delete_bolo:s1e,delete_bolo_confirm:a1e,avatar_description_vehicle:l1e,bolo:c1e,bolos:u1e,bolo_expires_at:d1e,expires_at:f1e,no_bolos_found:h1e,goto_vehicle:p1e,already_responding_or_part_of_unit:m1e,responded_to_recent_call:g1e};var $7={},Q0={},M7={},X0={};Object.defineProperty(X0,"__esModule",{value:!0});X0.boolean=void 0;const y1e=function(e){switch(Object.prototype.toString.call(e)){case"[object String]":return["true","t","yes","y","on","1"].includes(e.trim().toLowerCase());case"[object Number]":return e.valueOf()===1;case"[object Boolean]":return e.valueOf();default:return!1}};X0.boolean=y1e;var e1={};Object.defineProperty(e1,"__esModule",{value:!0});e1.isBooleanable=void 0;const _1e=function(e){switch(Object.prototype.toString.call(e)){case"[object String]":return["true","t","yes","y","on","1","false","f","no","n","off","0"].includes(e.trim().toLowerCase());case"[object Number]":return[0,1].includes(e.valueOf());case"[object Boolean]":return!0;default:return!1}};e1.isBooleanable=_1e;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isBooleanable=e.boolean=void 0;const t=X0;Object.defineProperty(e,"boolean",{enumerable:!0,get:function(){return t.boolean}});const n=e1;Object.defineProperty(e,"isBooleanable",{enumerable:!0,get:function(){return n.isBooleanable}})})(M7);var t1={};Object.defineProperty(t1,"__esModule",{value:!0});t1.tokenize=void 0;const w1e=/(?:%(?([+0-]|-\+))?(?\d+)?(?\d+\$)?(?\.\d+)?(?[%BCESb-iosux]))|(\\%)/g,b1e=e=>{let t;const n=[];let r=0,o=0,i=null;for(;(t=w1e.exec(e))!==null;){t.index>o&&(i={literal:e.slice(o,t.index),type:"literal"},n.push(i));const s=t[0];o=t.index+s.length,s==="\\%"||s==="%%"?i&&i.type==="literal"?i.literal+="%":(i={literal:"%",type:"literal"},n.push(i)):t.groups&&(i={conversion:t.groups.conversion,flag:t.groups.flag||null,placeholder:s,position:t.groups.position?Number.parseInt(t.groups.position,10)-1:r++,precision:t.groups.precision?Number.parseInt(t.groups.precision.slice(1),10):null,type:"placeholder",width:t.groups.width?Number.parseInt(t.groups.width,10):null},n.push(i))}return o<=e.length-1&&(i&&i.type==="literal"?i.literal+=e.slice(o):n.push({literal:e.slice(o),type:"literal"})),n};t1.tokenize=b1e;Object.defineProperty(Q0,"__esModule",{value:!0});Q0.createPrintf=void 0;const RT=M7,x1e=t1,S1e=(e,t)=>t.placeholder,P1e=e=>{var t;const n=(i,s,a)=>a==="-"?i.padEnd(s," "):a==="-+"?((Number(i)>=0?"+":"")+i).padEnd(s," "):a==="+"?((Number(i)>=0?"+":"")+i).padStart(s," "):a==="0"?i.padStart(s,"0"):i.padStart(s," "),r=(t=e?.formatUnboundExpression)!==null&&t!==void 0?t:S1e,o={};return(i,...s)=>{let a=o[i];a||(a=o[i]=x1e.tokenize(i));let c="";for(const u of a)if(u.type==="literal")c+=u.literal;else{let f=s[u.position];if(f===void 0)c+=r(i,u,s);else if(u.conversion==="b")c+=RT.boolean(f)?"true":"false";else if(u.conversion==="B")c+=RT.boolean(f)?"TRUE":"FALSE";else if(u.conversion==="c")c+=f;else if(u.conversion==="C")c+=String(f).toUpperCase();else if(u.conversion==="i"||u.conversion==="d")f=String(Math.trunc(f)),u.width!==null&&(f=n(f,u.width,u.flag)),c+=f;else if(u.conversion==="e")c+=Number(f).toExponential();else if(u.conversion==="E")c+=Number(f).toExponential().toUpperCase();else if(u.conversion==="f")u.precision!==null&&(f=Number(f).toFixed(u.precision)),u.width!==null&&(f=n(String(f),u.width,u.flag)),c+=f;else if(u.conversion==="o")c+=(Number.parseInt(String(f),10)>>>0).toString(8);else if(u.conversion==="s")u.width!==null&&(f=n(String(f),u.width,u.flag)),c+=f;else if(u.conversion==="S")u.width!==null&&(f=n(String(f),u.width,u.flag)),c+=String(f).toUpperCase();else if(u.conversion==="u")c+=Number.parseInt(String(f),10)>>>0;else if(u.conversion==="x")f=(Number.parseInt(String(f),10)>>>0).toString(16),u.width!==null&&(f=n(String(f),u.width,u.flag)),c+=f;else throw new Error("Unknown format specifier.")}return c}};Q0.createPrintf=P1e;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.printf=e.createPrintf=void 0;const t=Q0;Object.defineProperty(e,"createPrintf",{enumerable:!0,get:function(){return t.createPrintf}}),e.printf=t.createPrintf()})($7);const j={};String.prototype.format=function(...e){return $7.printf(this,...e)};function O1e(e){for(const t in j)j[t]=t;for(const[t,n]of Object.entries(e))j[t]=n}if(it())for(const[e,t]of Object.entries(v1e))j[e]=t;he.extend(E7);const C1e=()=>{const e=bs(u=>u.setSelectedProfile),{setActiveIncident:t,setIncidentActive:n}=Yr(),{getRecentActivity:r,recentActivity:o}=uve(),i=Kl(),s=u=>{const f=he(u).fromNow();return a(f)},a=u=>u.charAt(0).toUpperCase()+u.slice(1);_.useEffect(()=>{r()},[]);const c=o.map((u,f)=>p.jsxs("tr",{children:[p.jsx("td",{children:p.jsx(mt,{color:u.type==="created"?"green":u.type==="updated"?"yellow":"red",radius:"sm",children:a(u.type)})}),p.jsx("td",{children:p.jsx(U,{children:a(u.category)})}),p.jsx("td",{children:p.jsxs(U,{children:[u.firstname," ",u.lastname]})}),p.jsx("td",{children:p.jsx(U,{children:s(u.date)})}),p.jsx("td",{children:u.type!=="deleted"&&p.jsx(nt,{spacing:0,position:"right",children:p.jsx(zt,{label:"View",color:"gray",position:"bottom",withArrow:!0,children:p.jsx(Xe,{onClick:async()=>{if(u.category==="profiles"){const h=await me("getProfile",u.citizenid,{data:{...pO}});e(h)}else if(u.category==="incidents"){const h=await me("getIncident",u.activityid,{data:{id:1,officersInvolved:[],evidence:[],title:"Funny title",description:"

",criminals:[]}});t(h),n(!0)}i(`/${u.category}`)},children:p.jsx(sme,{size:"1.1rem",stroke:1.5,color:"white"})})})})})]},f));return p.jsxs("div",{className:"recent-activity-content",children:[p.jsx(U,{style:{fontSize:18,color:"white"},weight:500,children:j.recent_activity}),p.jsx(At,{className:"recent-activity",children:p.jsxs(JP,{verticalSpacing:"sm",children:[p.jsx("thead",{className:"table-header",children:p.jsxs("tr",{children:[p.jsx("th",{children:j.type}),p.jsx("th",{children:j.category}),p.jsx("th",{children:j.done_by}),p.jsx("th",{children:j.time_ago}),p.jsx("th",{})]})}),p.jsx("tbody",{children:c})]})})]})},gO=_.createContext(null);gO.displayName="@mantine/modals/ModalsContext";function k1e(){const e=_.useContext(gO);if(!e)throw new Error("[@mantine/modals] useModals hook was called outside of context, wrap your app with ModalsProvider component");return e}var E1e=Object.defineProperty,$1e=Object.defineProperties,M1e=Object.getOwnPropertyDescriptors,zT=Object.getOwnPropertySymbols,N1e=Object.prototype.hasOwnProperty,T1e=Object.prototype.propertyIsEnumerable,AT=(e,t,n)=>t in e?E1e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,iw=(e,t)=>{for(var n in t||(t={}))N1e.call(t,n)&&AT(e,n,t[n]);if(zT)for(var n of zT(t))T1e.call(t,n)&&AT(e,n,t[n]);return e},BT=(e,t)=>$1e(e,M1e(t));function I1e({id:e,cancelProps:t,confirmProps:n,labels:r={cancel:"",confirm:""},closeOnConfirm:o=!0,closeOnCancel:i=!0,groupProps:s,onCancel:a,onConfirm:c,children:u}){const{cancel:f,confirm:h}=r,m=k1e(),v=w=>{typeof t?.onClick=="function"&&t?.onClick(w),typeof a=="function"&&a(),i&&m.closeModal(e)},y=w=>{typeof n?.onClick=="function"&&n?.onClick(w),typeof c=="function"&&c(),o&&m.closeModal(e)};return k.createElement(k.Fragment,null,u&&k.createElement(Pe,{mb:"md"},u),k.createElement(nt,iw({position:"right"},s),k.createElement(at,BT(iw({variant:"default"},t),{onClick:v}),t?.children||f),k.createElement(at,BT(iw({},n),{onClick:y}),n?.children||h)))}function FT(e,t){var n,r,o,i;t&&e.type==="confirm"&&((r=(n=e.props).onCancel)==null||r.call(n)),(i=(o=e.props).onClose)==null||i.call(o)}function D1e(e,t){switch(t.type){case"OPEN":return{current:t.modal,modals:[...e.modals,t.modal]};case"CLOSE":{const n=e.modals.find(o=>o.id===t.modalId);if(!n)return e;FT(n,t.canceled);const r=e.modals.filter(o=>o.id!==t.modalId);return{current:r[r.length-1]||e.current,modals:r}}case"CLOSE_ALL":return e.modals.length?(e.modals.concat().reverse().forEach(n=>{FT(n,t.canceled)}),{current:e.current,modals:[]}):e;default:return e}}const[j1e,rh]=RU("mantine-modals"),L1e=rh("openModal"),R1e=rh("closeModal"),z1e=rh("closeAllModals"),A1e=rh("openConfirmModal"),B1e=e=>rh("openContextModal")(e),ke={open:L1e,close:R1e,closeAll:z1e,openConfirmModal:A1e,openContextModal:B1e};var F1e=Object.defineProperty,V1e=Object.defineProperties,H1e=Object.getOwnPropertyDescriptors,Hv=Object.getOwnPropertySymbols,N7=Object.prototype.hasOwnProperty,T7=Object.prototype.propertyIsEnumerable,VT=(e,t,n)=>t in e?F1e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,im=(e,t)=>{for(var n in t||(t={}))N7.call(t,n)&&VT(e,n,t[n]);if(Hv)for(var n of Hv(t))T7.call(t,n)&&VT(e,n,t[n]);return e},HT=(e,t)=>V1e(e,H1e(t)),rl=(e,t)=>{var n={};for(var r in e)N7.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Hv)for(var r of Hv(e))t.indexOf(r)<0&&T7.call(e,r)&&(n[r]=e[r]);return n};function W1e(e){if(!e)return{confirmProps:{},modalProps:{}};const t=e,{id:n,children:r,onCancel:o,onConfirm:i,closeOnConfirm:s,closeOnCancel:a,cancelProps:c,confirmProps:u,groupProps:f,labels:h}=t,m=rl(t,["id","children","onCancel","onConfirm","closeOnConfirm","closeOnCancel","cancelProps","confirmProps","groupProps","labels"]);return{confirmProps:{id:n,children:r,onCancel:o,onConfirm:i,closeOnConfirm:s,closeOnCancel:a,cancelProps:c,confirmProps:u,groupProps:f,labels:h},modalProps:im({id:n},m)}}function U1e({children:e,modalProps:t,labels:n,modals:r}){const[o,i]=_.useReducer(D1e,{modals:[],current:null}),s=_.useRef(o);s.current=o;const a=_.useCallback(P=>{i({type:"CLOSE_ALL",canceled:P})},[s,i]),c=_.useCallback(P=>{var b=P,{modalId:S}=b,O=rl(b,["modalId"]);const E=S||Vc();return i({type:"OPEN",modal:{id:E,type:"content",props:O}}),E},[i]),u=_.useCallback(P=>{var b=P,{modalId:S}=b,O=rl(b,["modalId"]);const E=S||Vc();return i({type:"OPEN",modal:{id:E,type:"confirm",props:O}}),E},[i]),f=_.useCallback((P,b)=>{var S=b,{modalId:O}=S,E=rl(S,["modalId"]);const $=O||Vc();return i({type:"OPEN",modal:{id:$,type:"context",props:E,ctx:P}}),$},[i]),h=_.useCallback((P,b)=>{i({type:"CLOSE",modalId:P,canceled:b})},[s,i]);j1e({openModal:c,openConfirmModal:u,openContextModal:P=>{var b=P,{modal:S}=b,O=rl(b,["modal"]);return f(S,O)},closeModal:h,closeContextModal:h,closeAllModals:a});const m={modals:o.modals,openModal:c,openConfirmModal:u,openContextModal:f,closeModal:h,closeContextModal:h,closeAll:a},v=()=>{const P=s.current.current;switch(P?.type){case"context":{const b=P.props,{innerProps:S}=b,O=rl(b,["innerProps"]),E=r[P.ctx];return{modalProps:O,content:k.createElement(E,{innerProps:S,context:m,id:P.id})}}case"confirm":{const{modalProps:b,confirmProps:S}=W1e(P.props);return{modalProps:b,content:k.createElement(I1e,HT(im({},S),{id:P.id,labels:P.props.labels||n}))}}case"content":{const b=P.props,{children:S}=b;return{modalProps:rl(b,["children"]),content:k.createElement(k.Fragment,null,S)}}default:return{modalProps:{},content:null}}},{modalProps:y,content:w}=v();return k.createElement(gO.Provider,{value:m},k.createElement(Bi,HT(im(im({zIndex:ci("modal")+1},t),y),{opened:o.modals.length>0,onClose:()=>h(o.current.id)}),w),e)}const[Z1e,za]=Cu("RichTextEditor was not found in tree");function Ln(e){this.content=e}Ln.prototype={constructor:Ln,find:function(e){for(var t=0;t>1}};Ln.from=function(e){if(e instanceof Ln)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Ln(t)};function I7(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let o=e.child(r),i=t.child(r);if(o==i){n+=o.nodeSize;continue}if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(let s=0;o.text[s]==i.text[s];s++)n++;return n}if(o.content.size||i.content.size){let s=I7(o.content,i.content,n+1);if(s!=null)return s}n+=o.nodeSize}}function D7(e,t,n,r){for(let o=e.childCount,i=t.childCount;;){if(o==0||i==0)return o==i?null:{a:n,b:r};let s=e.child(--o),a=t.child(--i),c=s.nodeSize;if(s==a){n-=c,r-=c;continue}if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let u=0,f=Math.min(s.text.length,a.text.length);for(;ut&&r(c,o+a,i||null,s)!==!1&&c.content.size){let f=a+1;c.nodesBetween(Math.max(0,t-f),Math.min(c.content.size,n-f),r,o+f)}a=u}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,r,o){let i="",s=!0;return this.nodesBetween(t,n,(a,c)=>{a.isText?(i+=a.text.slice(Math.max(t,c)-c,n-c),s=!r):a.isLeaf?(o?i+=typeof o=="function"?o(a):o:a.type.spec.leafText&&(i+=a.type.spec.leafText(a)),s=!r):!s&&a.isBlock&&(i+=r,s=!0)},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,o=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(o[o.length-1]=n.withText(n.text+r.text),i=1);it)for(let i=0,s=0;st&&((sn)&&(a.isText?a=a.cut(Math.max(0,t-s),Math.min(a.text.length,n-s)):a=a.cut(Math.max(0,t-s-1),Math.min(a.content.size,n-s-1))),r.push(a),o+=a.nodeSize),s=c}return new se(r,o)}cutByIndex(t,n){return t==n?se.empty:t==0&&n==this.content.length?this:new se(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let o=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return o[t]=n,new se(o,i)}addToStart(t){return new se([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new se(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;nthis.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let r=0,o=0;;r++){let i=this.child(r),s=o+i.nodeSize;if(s>=t)return s==t||n>0?mp(r+1,s):mp(r,o);o=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return se.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new se(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return se.empty;let n,r=0;for(let o=0;othis.type.rank&&(n||(n=t.slice(0,o)),n.push(this),r=!0),n&&n.push(i)}}return n||(n=t.slice()),r||n.push(this),n}removeFromSet(t){for(let n=0;nr.type.rank-o.type.rank),n}};wt.none=[];class Uv extends Error{}class ye{constructor(t,n,r){this.content=t,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=L7(this.content,t+this.openStart,n);return r&&new ye(r,this.openStart,this.openEnd)}removeBetween(t,n){return new ye(j7(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return ye.empty;let r=n.openStart||0,o=n.openEnd||0;if(typeof r!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new ye(se.fromJSON(t,n.content),r,o)}static maxOpen(t,n=!0){let r=0,o=0;for(let i=t.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=t.lastChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.lastChild)o++;return new ye(t,r,o)}}ye.empty=new ye(se.empty,0,0);function j7(e,t,n){let{index:r,offset:o}=e.findIndex(t),i=e.maybeChild(r),{index:s,offset:a}=e.findIndex(n);if(o==t||i.isText){if(a!=n&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(r,i.copy(j7(i.content,t-o-1,n-o-1)))}function L7(e,t,n,r){let{index:o,offset:i}=e.findIndex(t),s=e.maybeChild(o);if(i==t||s.isText)return r&&!r.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let a=L7(s.content,t-i-1,n);return a&&e.replaceChild(o,s.copy(a))}function G1e(e,t,n){if(n.openStart>e.depth)throw new Uv("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Uv("Inconsistent open depths");return R7(e,t,n,0)}function R7(e,t,n,r){let o=e.index(r),i=e.node(r);if(o==t.index(r)&&r=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Fd(e,t,n,r){let o=(t||e).node(n),i=0,s=t?t.index(n):o.childCount;e&&(i=e.index(n),e.depth>n?i++:e.textOffset&&(Pl(e.nodeAfter,r),i++));for(let a=i;ao&&Px(e,t,o+1),s=r.depth>o&&Px(n,r,o+1),a=[];return Fd(null,e,o,a),i&&s&&t.index(o)==n.index(o)?(z7(i,s),Pl(Ol(i,A7(e,t,n,r,o+1)),a)):(i&&Pl(Ol(i,Zv(e,t,o+1)),a),Fd(t,n,o,a),s&&Pl(Ol(s,Zv(n,r,o+1)),a)),Fd(r,null,o,a),new se(a)}function Zv(e,t,n){let r=[];if(Fd(null,e,n,r),e.depth>n){let o=Px(e,t,n+1);Pl(Ol(o,Zv(e,t,n+1)),r)}return Fd(t,null,n,r),new se(r)}function Y1e(e,t){let n=t.depth-e.openStart,o=t.node(n).copy(e.content);for(let i=n-1;i>=0;i--)o=t.node(i).copy(se.from(o));return{start:o.resolveNoCache(e.openStart+n),end:o.resolveNoCache(o.content.size-e.openEnd-n)}}class Sf{constructor(t,n,r){this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let r=this.pos-this.path[this.path.length-1],o=t.child(n);return r?t.child(n).cut(r):o}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let r=this.path[n*3],o=n==0?0:this.path[n*3-1]+1;for(let i=0;i0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos=0;r--)if(t.pos<=this.end(r)&&(!n||n(this.node(r))))return new Gv(this,t,r);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let r=[],o=0,i=n;for(let s=t;;){let{index:a,offset:c}=s.content.findIndex(i),u=i-c;if(r.push(s,a,o+c),!u||(s=s.child(a),s.isText))break;i=u-1,o+=c+1}return new Sf(n,r,i)}static resolveCached(t,n){for(let o=0;ot&&this.nodesBetween(t,n,i=>(r.isInSet(i.marks)&&(o=!0),!o)),o}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),B7(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,r=se.empty,o=0,i=r.childCount){let s=this.contentMatchAt(t).matchFragment(r,o,i),a=s&&s.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let c=o;cn.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,r)}let o=se.fromJSON(t,n.content);return t.nodeType(n.type).create(n.attrs,o,r)}};Cl.prototype.text=void 0;class Yv extends Cl{constructor(t,n,r,o){if(super(t,n,null,o),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):B7(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new Yv(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new Yv(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function B7(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class Ll{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new J1e(t,n);if(r.next==null)return Ll.empty;let o=F7(r);r.next&&r.err("Unexpected trailing text");let i=o_e(r_e(o));return i_e(i,r),i}matchType(t){for(let n=0;nu.createAndFill()));for(let u=0;u=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(r){t.push(r);for(let o=0;o{let i=o+(r.validEnd?"*":" ")+" ";for(let s=0;s"+t.indexOf(r.next[s].next);return i}).join(` -`)}}Ll.empty=new Ll(!0);class J1e{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function F7(e){let t=[];do t.push(Q1e(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function Q1e(e){let t=[];do t.push(X1e(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function X1e(e){let t=n_e(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=e_e(e,t);else break;return t}function WT(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function e_e(e,t){let n=WT(e),r=n;return e.eat(",")&&(e.next!="}"?r=WT(e):r=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function t_e(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let o=[];for(let i in n){let s=n[i];s.groups.indexOf(t)>-1&&o.push(s)}return o.length==0&&e.err("No node type or group '"+t+"' found"),o}function n_e(e){if(e.eat("(")){let t=F7(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=t_e(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function r_e(e){let t=[[]];return o(i(e,0),n()),t;function n(){return t.push([])-1}function r(s,a,c){let u={term:c,to:a};return t[s].push(u),u}function o(s,a){s.forEach(c=>c.to=a)}function i(s,a){if(s.type=="choice")return s.exprs.reduce((c,u)=>c.concat(i(u,a)),[]);if(s.type=="seq")for(let c=0;;c++){let u=i(s.exprs[c],a);if(c==s.exprs.length-1)return u;o(u,a=n())}else if(s.type=="star"){let c=n();return r(a,c),o(i(s.expr,c),c),[r(c)]}else if(s.type=="plus"){let c=n();return o(i(s.expr,a),c),o(i(s.expr,c),c),[r(c)]}else{if(s.type=="opt")return[r(a)].concat(i(s.expr,a));if(s.type=="range"){let c=a;for(let u=0;u{e[s].forEach(({term:a,to:c})=>{if(!a)return;let u;for(let f=0;f{u||o.push([a,u=[]]),u.indexOf(f)==-1&&u.push(f)})})});let i=t[r.join(",")]=new Ll(r.indexOf(e.length-1)>-1);for(let s=0;s-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;nr[i]=new Z7(i,n,s));let o=n.spec.topNode||"doc";if(!r[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class s_e{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class n1{constructor(t,n,r,o){this.name=t,this.rank=n,this.schema=r,this.spec=o,this.attrs=U7(o.attrs),this.excluded=null;let i=H7(this.attrs);this.instance=i?new wt(this,i):null}create(t=null){return!t&&this.instance?this.instance:new wt(this,W7(this.attrs,t))}static compile(t,n){let r=Object.create(null),o=0;return t.forEach((i,s)=>r[i]=new n1(i,o++,n,s)),r}removeFromSet(t){for(var n=0;n-1}}class a_e{constructor(t){this.cached=Object.create(null);let n=this.spec={};for(let o in t)n[o]=t[o];n.nodes=Ln.from(t.nodes),n.marks=Ln.from(t.marks||{}),this.nodes=ZT.compile(this.spec.nodes,this),this.marks=n1.compile(this.spec.marks,this);let r=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let i=this.nodes[o],s=i.spec.content||"",a=i.spec.marks;i.contentMatch=r[s]||(r[s]=Ll.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.markSet=a=="_"?null:a?GT(this,a.split(" ")):a==""||!i.inlineContent?[]:null}for(let o in this.marks){let i=this.marks[o],s=i.spec.excludes;i.excluded=s==null?[i]:s==""?[]:GT(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,r,o){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof ZT){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,r,o)}text(t,n){let r=this.nodes.text;return new Yv(r,r.defaultAttrs,t,wt.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeFromJSON(t){return Cl.fromJSON(this,t)}markFromJSON(t){return wt.fromJSON(this,t)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function GT(e,t){let n=[];for(let r=0;r-1)&&n.push(s=c)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class vu{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[],n.forEach(r=>{r.tag?this.tags.push(r):r.style&&this.styles.push(r)}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let o=t.nodes[r.node];return o.contentMatch.matchType(o)})}parse(t,n={}){let r=new KT(this,n,!1);return r.addAll(t,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new KT(this,n,!0);return r.addAll(t,n.from,n.to),ye.maxOpen(r.finish())}matchTag(t,n,r){for(let o=r?this.tags.indexOf(r)+1:0;ot.length&&(a.charCodeAt(t.length)!=61||a.slice(t.length+1)!=n))){if(s.getAttrs){let c=s.getAttrs(n);if(c===!1)continue;s.attrs=c||void 0}return s}}}static schemaRules(t){let n=[];function r(o){let i=o.priority==null?50:o.priority,s=0;for(;s{r(s=qT(s)),s.mark||s.ignore||s.clearMark||(s.mark=o)})}for(let o in t.nodes){let i=t.nodes[o].spec.parseDOM;i&&i.forEach(s=>{r(s=qT(s)),s.node||s.ignore||s.mark||(s.node=o)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new vu(t,vu.schemaRules(t)))}}const G7={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},l_e={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Y7={ol:!0,ul:!0},Kv=1,qv=2,Vd=4;function YT(e,t,n){return t!=null?(t?Kv:0)|(t==="full"?qv:0):e&&e.whitespace=="pre"?Kv|qv:n&~Vd}class gp{constructor(t,n,r,o,i,s,a){this.type=t,this.attrs=n,this.marks=r,this.pendingMarks=o,this.solid=i,this.options=a,this.content=[],this.activeMarks=wt.none,this.stashMarks=[],this.match=s||(a&Vd?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(se.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,o;return(o=r.findWrapping(t.type))?(this.match=r,o):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&Kv)){let r=this.content[this.content.length-1],o;if(r&&r.isText&&(o=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-o[0].length))}}let n=se.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(se.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}popFromStashMark(t){for(let n=this.stashMarks.length-1;n>=0;n--)if(t.eq(this.stashMarks[n]))return this.stashMarks.splice(n,1)[0]}applyPending(t){for(let n=0,r=this.pendingMarks;n{const t=typeof e=="function"?Wme(e):e,n=(r,o)=>fge(t,r,o);return Object.assign(n,t),n},tn=e=>e?ET(e):ET,it=()=>!window.invokeNative,hge=()=>{},h7=tn(e=>({showApp:!!it(),setVisibility:t=>e({showApp:t}),show:()=>e({showApp:!0}),hide:()=>e({showApp:!1}),toggle:()=>e(t=>({showApp:!t.showApp}))})),pge={citizenid:"1993201",firstname:"Bubble",lastname:"Test",role:"Chief",grade:4,image:"https://i.imgur.com/P4uYdfu.jpeg",callSign:103,unit:1},Gr=tn(e=>({personalData:it()?pge:{citizenid:"",firstname:"",lastname:"",role:"",image:"",callSign:0,grade:0},setPersonalData:t=>e(n=>({personalData:typeof t=="function"?t(n.personalData):{...n.personalData,...t}}))}));async function me(e,t,n){if(it())return n?(await new Promise(a=>setTimeout(a,n.delay)),n.data):await new Promise(a=>a);const r={method:"post",headers:{"Content-Type":"application/json; charset=UTF-8"},body:JSON.stringify(t)},o=window.GetParentResourceName?window.GetParentResourceName():"nui-frame-app";return await(await fetch(`https://${o}/${e}`,r)).json()}function mge(e,t=500){const[n,r]=_.useState(e),[o,i]=_.useState(!1);return _.useEffect(()=>{i(!0);const s=setTimeout(()=>{r(e),i(!1)},t);return()=>{clearTimeout(s)}},[e,t]),{debouncedValue:n,isDebouncing:o}}var eh=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},gu=typeof window>"u"||"Deno"in globalThis;function No(){}function gge(e,t){return typeof e=="function"?e(t):e}function gx(e){return typeof e=="number"&&e>=0&&e!==1/0}function p7(e,t){return Math.max(e+(t||0)-Date.now(),0)}function qc(e,t){return typeof e=="function"?e(t):e}function Qo(e,t){return typeof e=="function"?e(t):e}function $T(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==uO(s,t.options))return!1}else if(!xf(t.queryKey,s))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||i&&!i(t))}function MT(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(bf(t.options.mutationKey)!==bf(i))return!1}else if(!xf(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function uO(e,t){return(t?.queryKeyHashFn||bf)(e)}function bf(e){return JSON.stringify(e,(t,n)=>yx(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function xf(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!xf(e[n],t[n])):!1}function m7(e,t){if(e===t)return e;const n=NT(e)&&NT(t);if(n||yx(e)&&yx(t)){const r=n?e:Object.keys(e),o=r.length,i=n?t:Object.keys(t),s=i.length,a=n?[]:{};let c=0;for(let u=0;u{setTimeout(t,e)})}function _x(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?m7(e,t):t}function yge(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function _ge(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var g7=Symbol();function v7(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===g7?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var wge=class extends eh{#e;#t;#r;constructor(){super(),this.#r=e=>{if(!gu&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},dO=new wge,bge=class extends eh{#e=!0;#t;#r;constructor(){super(),this.#r=e=>{if(!gu&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},Vv=new bge;function xge(e){return Math.min(1e3*2**e,3e4)}function y7(e){return(e??"online")==="online"?Vv.isOnline():!0}var _7=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function ow(e){return e instanceof _7}function w7(e){let t=!1,n=0,r=!1,o,i,s;const a=new Promise((b,S)=>{i=b,s=S}),c=b=>{r||(y(new _7(b)),e.abort?.())},u=()=>{t=!0},f=()=>{t=!1},h=()=>dO.isFocused()&&(e.networkMode==="always"||Vv.isOnline())&&e.canRun(),m=()=>y7(e.networkMode)&&e.canRun(),v=b=>{r||(r=!0,e.onSuccess?.(b),o?.(),i(b))},y=b=>{r||(r=!0,e.onError?.(b),o?.(),s(b))},w=()=>new Promise(b=>{o=S=>{(r||h())&&b(S)},e.onPause?.()}).then(()=>{o=void 0,r||e.onContinue?.()}),P=()=>{if(r)return;let b;const S=n===0?e.initialPromise:void 0;try{b=S??e.fn()}catch(O){b=Promise.reject(O)}Promise.resolve(b).then(v).catch(O=>{if(r)return;const E=e.retry??(gu?0:3),$=e.retryDelay??xge,N=typeof $=="function"?$(n,O):$,I=E===!0||typeof E=="number"&&nh()?void 0:w()).then(()=>{t?y(O):P()})})};return{promise:a,cancel:c,continue:()=>(o?.(),a),cancelRetry:u,continueRetry:f,canStart:m,start:()=>(m()?P():w().then(P),a)}}function Sge(){let e=[],t=0,n=m=>{m()},r=m=>{m()},o=m=>setTimeout(m,0);const i=m=>{o=m},s=m=>{let v;t++;try{v=m()}finally{t--,t||u()}return v},a=m=>{t?e.push(m):o(()=>{n(m)})},c=m=>(...v)=>{a(()=>{m(...v)})},u=()=>{const m=e;e=[],m.length&&o(()=>{r(()=>{m.forEach(v=>{n(v)})})})};return{batch:s,batchCalls:c,schedule:a,setNotifyFunction:m=>{n=m},setBatchNotifyFunction:m=>{r=m},setScheduler:i}}var An=Sge(),b7=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),gx(this.gcTime)&&(this.#e=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(gu?1/0:5*60*1e3))}clearGcTimeout(){this.#e&&(clearTimeout(this.#e),this.#e=void 0)}},Pge=class extends b7{#e;#t;#r;#n;#s;#i;constructor(e){super(),this.#i=!1,this.#s=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.cache,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=Oge(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#n?.promise}setOptions(e){this.options={...this.#s,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,t){const n=_x(this.state.data,e,this.options);return this.#o({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#o({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#n?.promise;return this.#n?.cancel(e),t?t.then(No).catch(No):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>Qo(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!p7(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#n?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#n?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#n&&(this.#i?this.#n.cancel({revert:!0}):this.#n.cancelRetry()),this.scheduleGc()),this.#r.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#o({type:"invalidate"})}fetch(e,t){if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#n)return this.#n.continueRetry(),this.#n.promise}if(e&&this.setOptions(e),!this.options.queryFn){const a=this.observers.find(c=>c.options.queryFn);a&&this.setOptions(a.options)}const n=new AbortController,r=a=>{Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(this.#i=!0,n.signal)})},o=()=>{const a=v7(this.options,t),c={queryKey:this.queryKey,meta:this.meta};return r(c),this.#i=!1,this.options.persister?this.options.persister(a,c,this):a(c)},i={fetchOptions:t,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:o};r(i),this.options.behavior?.onFetch(i,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==i.fetchOptions?.meta)&&this.#o({type:"fetch",meta:i.fetchOptions?.meta});const s=a=>{ow(a)&&a.silent||this.#o({type:"error",error:a}),ow(a)||(this.#r.config.onError?.(a,this),this.#r.config.onSettled?.(this.state.data,a,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.#n=w7({initialPromise:t?.initialPromise,fn:i.fetchFn,abort:n.abort.bind(n),onSuccess:a=>{if(a===void 0){s(new Error(`${this.queryHash} data is undefined`));return}this.setData(a),this.#r.config.onSuccess?.(a,this),this.#r.config.onSettled?.(a,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:s,onFail:(a,c)=>{this.#o({type:"failed",failureCount:a,error:c})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0}),this.#n.start()}#o(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...x7(n.data,this.options),fetchMeta:e.meta??null};case"success":return{...n,data:e.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const r=e.error;return ow(r)&&r.revert&&this.#t?{...this.#t,fetchStatus:"idle"}:{...n,error:r,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),An.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:e})})}};function x7(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:y7(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Oge(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Cge=class extends eh{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,o=t.queryHash??uO(r,t);let i=this.get(o);return i||(i=new Pge({cache:this,queryKey:r,queryHash:o,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(i)),i}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){An.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>$T(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>$T(e,n)):t}notify(e){An.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){An.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){An.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},kge=class extends b7{#e;#t;#r;constructor(e){super(),this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#e=[],this.state=e.state||Ege(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#e.includes(e)||(this.#e.push(e),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(t=>t!==e),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#t.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){this.#r=w7({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(r,o)=>{this.#n({type:"failed",failureCount:r,error:o})},onPause:()=>{this.#n({type:"pause"})},onContinue:()=>{this.#n({type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});const t=this.state.status==="pending",n=!this.#r.canStart();try{if(!t){this.#n({type:"pending",variables:e,isPaused:n}),await this.#t.config.onMutate?.(e,this);const o=await this.options.onMutate?.(e);o!==this.state.context&&this.#n({type:"pending",context:o,variables:e,isPaused:n})}const r=await this.#r.start();return await this.#t.config.onSuccess?.(r,e,this.state.context,this),await this.options.onSuccess?.(r,e,this.state.context),await this.#t.config.onSettled?.(r,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(r,null,e,this.state.context),this.#n({type:"success",data:r}),r}catch(r){try{throw await this.#t.config.onError?.(r,e,this.state.context,this),await this.options.onError?.(r,e,this.state.context),await this.#t.config.onSettled?.(void 0,r,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,r,e,this.state.context),r}finally{this.#n({type:"error",error:r})}}finally{this.#t.runNext(this)}}#n(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),An.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function Ege(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var $ge=class extends eh{constructor(e={}){super(),this.config=e,this.#e=new Map,this.#t=Date.now()}#e;#t;build(e,t,n){const r=new kge({mutationCache:this,mutationId:++this.#t,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){const t=pp(e),n=this.#e.get(t)??[];n.push(e),this.#e.set(t,n),this.notify({type:"added",mutation:e})}remove(e){const t=pp(e);if(this.#e.has(t)){const n=this.#e.get(t)?.filter(r=>r!==e);n&&(n.length===0?this.#e.delete(t):this.#e.set(t,n))}this.notify({type:"removed",mutation:e})}canRun(e){const t=this.#e.get(pp(e))?.find(n=>n.state.status==="pending");return!t||t===e}runNext(e){return this.#e.get(pp(e))?.find(n=>n!==e&&n.state.isPaused)?.continue()??Promise.resolve()}clear(){An.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}getAll(){return[...this.#e.values()].flat()}find(e){const t={exact:!0,...e};return this.getAll().find(n=>MT(t,n))}findAll(e={}){return this.getAll().filter(t=>MT(e,t))}notify(e){An.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return An.batch(()=>Promise.all(e.map(t=>t.continue().catch(No))))}};function pp(e){return e.options.scope?.id??String(e.mutationId)}function wx(e){return{onFetch:(t,n)=>{const r=async()=>{const o=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,s=t.state.data?.pages||[],a=t.state.data?.pageParams||[],c={pages:[],pageParams:[]};let u=!1;const f=y=>{Object.defineProperty(y,"signal",{enumerable:!0,get:()=>(t.signal.aborted?u=!0:t.signal.addEventListener("abort",()=>{u=!0}),t.signal)})},h=v7(t.options,t.fetchOptions),m=async(y,w,P)=>{if(u)return Promise.reject();if(w==null&&y.pages.length)return Promise.resolve(y);const b={queryKey:t.queryKey,pageParam:w,direction:P?"backward":"forward",meta:t.options.meta};f(b);const S=await h(b),{maxPages:O}=t.options,E=P?_ge:yge;return{pages:E(y.pages,S,O),pageParams:E(y.pageParams,w,O)}};let v;if(i&&s.length){const y=i==="backward",w=y?S7:bx,P={pages:s,pageParams:a},b=w(o,P);v=await m(P,b,y)}else{v=await m(c,a[0]??o.initialPageParam);const y=e??s.length;for(let w=1;wt.options.persister?.(r,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=r}}}function bx(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function S7(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function Mge(e,t){return t?bx(e,t)!=null:!1}function Nge(e,t){return!t||!e.getPreviousPageParam?!1:S7(e,t)!=null}var Tge=class{#e;#t;#r;#n;#s;#i;#o;#a;constructor(e={}){this.#e=e.queryCache||new Cge,this.#t=e.mutationCache||new $ge,this.#r=e.defaultOptions||{},this.#n=new Map,this.#s=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#o=dO.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#a=Vv.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#o?.(),this.#o=void 0,this.#a?.(),this.#a=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);if(t===void 0)return this.fetchQuery(e);{const n=this.defaultQueryOptions(e),r=this.#e.build(this,n);return e.revalidateIfStale&&r.isStaleByTime(qc(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(t)}}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,s=gge(t,i);if(s!==void 0)return this.#e.build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return An.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;An.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e,r={type:"active",...e};return An.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=An.batch(()=>this.#e.findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(No).catch(No)}invalidateQueries(e={},t={}){return An.batch(()=>{if(this.#e.findAll(e).forEach(r=>{r.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:t?.cancelRefetch??!0},r=An.batch(()=>this.#e.findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(No)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(No)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(qc(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(No).catch(No)}fetchInfiniteQuery(e){return e.behavior=wx(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(No).catch(No)}resumePausedMutations(){return Vv.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#r}setDefaultOptions(e){this.#r=e}setQueryDefaults(e,t){this.#n.set(bf(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#n.values()];let n={};return t.forEach(r=>{xf(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){this.#s.set(bf(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#s.values()];let n={};return t.forEach(r=>{xf(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#r.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=uO(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.enabled!==!0&&t.queryFn===g7&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#r.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Ige=class extends eh{constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#r=void 0;#n=void 0;#s;#i;#o;#a;#f;#h;#c;#u;#l;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),IT(this.#t,this.options)?this.#d():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return xx(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return xx(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#_(),this.#w(),this.#t.removeObserver(this)}setOptions(e,t){const n=this.options,r=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Qo(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#b(),this.#t.setOptions(this.options),n._defaulted&&!vx(this.options,n)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const o=this.hasListeners();o&&jT(this.#t,r,this.options,n)&&this.#d(),this.updateResult(t),o&&(this.#t!==r||Qo(this.options.enabled,this.#t)!==Qo(n.enabled,this.#t)||qc(this.options.staleTime,this.#t)!==qc(n.staleTime,this.#t))&&this.#m();const i=this.#g();o&&(this.#t!==r||Qo(this.options.enabled,this.#t)!==Qo(n.enabled,this.#t)||i!==this.#l)&&this.#v(i)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Dge(this,n)&&(this.#n=n,this.#i=this.options,this.#s=this.#t.state),n}getCurrentResult(){return this.#n}trackResult(e,t){const n={};return Object.keys(e).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(r),t?.(r),e[r])})}),n}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.isFetchingOptimistic=!0,n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#n))}#d(e){this.#b();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(No)),t}#m(){this.#_();const e=qc(this.options.staleTime,this.#t);if(gu||this.#n.isStale||!gx(e))return;const n=p7(this.#n.dataUpdatedAt,e)+1;this.#c=setTimeout(()=>{this.#n.isStale||this.updateResult()},n)}#g(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#w(),this.#l=e,!(gu||Qo(this.options.enabled,this.#t)===!1||!gx(this.#l)||this.#l===0)&&(this.#u=setInterval(()=>{(this.options.refetchIntervalInBackground||dO.isFocused())&&this.#d()},this.#l))}#y(){this.#m(),this.#v(this.#g())}#_(){this.#c&&(clearTimeout(this.#c),this.#c=void 0)}#w(){this.#u&&(clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#t,r=this.options,o=this.#n,i=this.#s,s=this.#i,c=e!==n?e.state:this.#r,{state:u}=e;let f={...u},h=!1,m;if(t._optimisticResults){const N=this.hasListeners(),I=!N&&IT(e,t),R=N&&jT(e,n,t,r);(I||R)&&(f={...f,...x7(u.data,e.options)}),t._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:v,errorUpdatedAt:y,status:w}=f;if(t.select&&f.data!==void 0)if(o&&f.data===i?.data&&t.select===this.#a)m=this.#f;else try{this.#a=t.select,m=t.select(f.data),m=_x(o?.data,m,t),this.#f=m,this.#o=null}catch(N){this.#o=N}else m=f.data;if(t.placeholderData!==void 0&&m===void 0&&w==="pending"){let N;if(o?.isPlaceholderData&&t.placeholderData===s?.placeholderData)N=o.data;else if(N=typeof t.placeholderData=="function"?t.placeholderData(this.#h?.state.data,this.#h):t.placeholderData,t.select&&N!==void 0)try{N=t.select(N),this.#o=null}catch(I){this.#o=I}N!==void 0&&(w="success",m=_x(o?.data,N,t),h=!0)}this.#o&&(v=this.#o,m=this.#f,y=Date.now(),w="error");const P=f.fetchStatus==="fetching",b=w==="pending",S=w==="error",O=b&&P,E=m!==void 0;return{status:w,fetchStatus:f.fetchStatus,isPending:b,isSuccess:w==="success",isError:S,isInitialLoading:O,isLoading:O,data:m,dataUpdatedAt:f.dataUpdatedAt,error:v,errorUpdatedAt:y,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>c.dataUpdateCount||f.errorUpdateCount>c.errorUpdateCount,isFetching:P,isRefetching:P&&!b,isLoadingError:S&&!E,isPaused:f.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:S&&E,isStale:fO(e,t),refetch:this.refetch}}updateResult(e){const t=this.#n,n=this.createResult(this.#t,this.options);if(this.#s=this.#t.state,this.#i=this.options,this.#s.data!==void 0&&(this.#h=this.#t),vx(n,t))return;this.#n=n;const r={},o=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,s=typeof i=="function"?i():i;if(s==="all"||!s&&!this.#p.size)return!0;const a=new Set(s??this.#p);return this.options.throwOnError&&a.add("error"),Object.keys(this.#n).some(c=>{const u=c;return this.#n[u]!==t[u]&&a.has(u)})};e?.listeners!==!1&&o()&&(r.listeners=!0),this.#x({...r,...e})}#b(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#r=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#x(e){An.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#n)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function jge(e,t){return Qo(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function IT(e,t){return jge(e,t)||e.state.data!==void 0&&xx(e,t,t.refetchOnMount)}function xx(e,t,n){if(Qo(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&fO(e,t)}return!1}function jT(e,t,n,r){return(e!==t||Qo(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&fO(e,n)}function fO(e,t){return Qo(t.enabled,e)!==!1&&e.isStaleByTime(qc(t.staleTime,e))}function Dge(e,t){return!vx(e.getCurrentResult(),t)}var Rge=class extends Ige{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e,t){super.setOptions({...e,behavior:wx()},t)}getOptimisticResult(e){return e.behavior=wx(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:n}=e,r=super.createResult(e,t),{isFetching:o,isRefetching:i,isError:s,isRefetchError:a}=r,c=n.fetchMeta?.fetchMore?.direction,u=s&&c==="forward",f=o&&c==="forward",h=s&&c==="backward",m=o&&c==="backward";return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Mge(t,n.data),hasPreviousPage:Nge(t,n.data),isFetchNextPageError:u,isFetchingNextPage:f,isFetchPreviousPageError:h,isFetchingPreviousPage:m,isRefetchError:a&&!u&&!h,isRefetching:i&&!f&&!m}}},P7=_.createContext(void 0),Lge=e=>{const t=_.useContext(P7);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},zge=({client:e,children:t})=>(_.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),p.jsx(P7.Provider,{value:e,children:t})),O7=_.createContext(!1),Age=()=>_.useContext(O7);O7.Provider;function Bge(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Fge=_.createContext(Bge()),Vge=()=>_.useContext(Fge);function Hge(e,t){return typeof e=="function"?e(...t):!!e}var Wge=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},Uge=e=>{_.useEffect(()=>{e.clearReset()},[e])},Zge=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&Hge(n,[e.error,r]),Gge=e=>{e.suspense&&(typeof e.staleTime!="number"&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},Yge=(e,t)=>e?.suspense&&t.isPending,Kge=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function qge(e,t,n){const r=Lge(n),o=Age(),i=Vge(),s=r.defaultQueryOptions(e);r.getDefaultOptions().queries?._experimental_beforeQuery?.(s),s._optimisticResults=o?"isRestoring":"optimistic",Gge(s),Wge(s,i),Uge(i);const[a]=_.useState(()=>new t(r,s)),c=a.getOptimisticResult(s);if(_.useSyncExternalStore(_.useCallback(u=>{const f=o?()=>{}:a.subscribe(An.batchCalls(u));return a.updateResult(),f},[a,o]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),_.useEffect(()=>{a.setOptions(s,{listeners:!1})},[s,a]),Yge(s,c))throw Kge(s,a,i);if(Zge({result:c,errorResetBoundary:i,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw c.error;return r.getDefaultOptions().queries?._experimental_afterQuery?.(s,c),s.notifyOnChangeProps?c:a.trackResult(c)}function Jge(e,t){return qge(e,Rge,t)}const hO=[];for(let e=0;e<25;e++)hO[e]={firstname:"Firstname",lastname:`Lastname ${e+1}`,dob:Date.now(),citizenid:e.toString()};const pO={firstname:"John",lastname:"Doe",citizenid:"BUB193Z4A",dob:Date.now(),phoneNumber:"123456789",notes:"

",vehicles:["Sultan Custom (88ZOH526)","Sultan Custom (07NCV529)","Sultan Custom (07NCV545)","Sultan Custom (07NCV521)"],relatedReports:[{title:"Report title",id:1,author:"Some One",date:"13/03/2023"},{title:"Report title",id:2,author:"Some One",date:"13/03/2023"},{title:"Report title",id:3,author:"Some One",date:"13/03/2023"},{title:"Report title",id:4,author:"Some One",date:"13/03/2023"}],relatedIncidents:[{title:"Incident 1",author:"Someone nice",date:"13/03/2023",id:1}]},Qge=[{id:"vehicles",title:"Vehicles",icon:"car"}],Xge=async(e,t)=>it()?{hasMore:!0,profiles:hO.slice((e-1)*10,e*10)}:await me("getProfiles",{page:e,search:t},{data:{hasMore:!1,profiles:[]}});function eve(e){const{debouncedValue:t,isDebouncing:n}=mge(e);return{...Jge({queryKey:["profiles",t],queryFn:async({queryKey:o,pageParam:i=1})=>await Xge(i,o[1]),initialPageParam:1,getNextPageParam:(o,i)=>{if(o.hasMore)return i.length+1}}),isDebouncing:n}}const bs=tn(e=>({profileCards:[],selectedProfile:null,isProfileWanted:!1,getProfiles:async()=>it()?{profiles:hO}:await me("getAllProfiles"),setSelectedProfile:t=>{it()&&e({selectedProfile:pO,profileCards:Qge}),e({selectedProfile:t})},setProfileCards:t=>e({profileCards:t}),setIsProfileWanted:t=>{e({isProfileWanted:t})}})),tve={"OFFENSES AGAINST PERSONS":[{label:"Speeding",description:"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aperiam, doloribus eveniet facere ipsam, ipsum minus modi molestiae nesciunt odio saepe sapiente sed sint voluptatibus voluptatum!",type:"infraction",time:0,fine:2500,points:4},{label:"Loitering",description:"Standing go brrr",type:"misdemeanor",time:90,fine:25e3,points:0},{label:"Something else 1",description:"Standing go brrr",type:"misdemeanor",time:90,fine:25e3,points:0},{label:"Something else 2",description:"Standing go brrr",type:"misdemeanor",time:90,fine:25e3,points:0},{label:"Something else 3",description:"Standing go brrr",type:"misdemeanor",time:90,fine:25e3,points:0}],"OFFENSES AGAINST PROPERTY":[{label:"Robbery of a financial institution",description:"Bank robbery go brrr",type:"felony",time:30,fine:3e3,points:0},{label:"Something else 2 in OFFENSES AGAINST",description:"Standing go brrr",type:"felony",time:90,fine:25e3,points:0},{label:"Something else 3 in OFFENSES AGAINST",description:"Standing go brrr",type:"felony",time:90,fine:25e3,points:0},{label:"Something else 4 in OFFENSES AGAINST",description:"Standing go brrr",type:"felony",time:90,fine:25e3,points:0}]},th=tn(e=>({charges:it()?tve:{},setCharges:t=>{e(n=>({charges:typeof t=="function"?t(n.charges):t}))}})),DT=[{firstname:"John",lastname:"Doe",callsign:"1A-01",citizenid:"ABCD1234",playerId:1,position:[0,0,0],unitId:1},{firstname:"Jenna",lastname:"Doe",callsign:"1A-02",citizenid:"ABCD1235",playerId:2,position:[0,0,0]}],mO=tn(e=>({officers:it()?DT:[],activeOfficers:it()?DT:[],getOfficers:async()=>{try{const t=await me("getOfficers");return e({officers:t}),{officers:t}}catch(t){return console.error("Failed to fetch officers:",t),{officers:[]}}},getActiveOfficers:async()=>{try{const t=await me("getActiveOfficers"),n=Object.values(t);return e({activeOfficers:n}),{activeOfficers:n}}catch(t){return console.error("Failed to fetch active officers:",t),{activeOfficers:[]}}},setOfficers:t=>e({officers:t}),addOfficer:t=>e(n=>({officers:[...n.officers,t]})),removeOfficer:t=>e(n=>({officers:n.officers.filter(r=>r.citizenid!==t)}))})),nh=tn(e=>({config:{isDispatchEnabled:!0},setConfig:t=>e({config:t})})),nve=ue(e=>({link:{...e.fn.focusStyles(),display:"flex",alignItems:"center",textDecoration:"none",fontSize:e.fontSizes.xs,color:e.colors.gray[2],padding:`${e.spacing.xs} ${e.spacing.xs}`,fontWeight:500,"&:hover":{borderRadius:e.radius.sm,background:"linear-gradient(90deg, rgba(51,124,255,0.5) 0%, rgba(187,187,187,0) 100%)",color:e.colorScheme==="dark"?e.white:e.black,[`& .${Br("icon")}`]:{color:e.colorScheme==="dark"?e.white:e.black}}},linkIcon:{ref:Br("icon"),color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],marginRight:e.spacing.sm},linkActive:{"&, &:hover":{borderRadius:e.radius.sm,background:"linear-gradient(90deg, rgba(51,124,255,0.5) 0%, rgba(187,187,187,0) 100%)",[`& .${Br("icon")}`]:{color:"white"}}},chevron:{transition:"transform 200ms ease"}})),rve=[{link:"",label:"Dashboard",icon:vme}],ove=[{link:"profiles",label:"Profiles",icon:cO},{link:"incidents",label:"Incidents",icon:sO},{link:"reports",label:"Reports",icon:rO},{link:"vehicles",label:"Vehicles",icon:Ns},{link:"dispatch",label:"Dispatch",icon:hu}],ive=[{label:"Roster",link:"roster",icon:Ame},{label:"Charges",link:"charges",icon:lme}],sve=()=>{const{config:e}=nh(),{classes:t,cx:n,theme:r}=nve(),[o,i]=_.useState(""),{firstname:s,lastname:a,callSign:c,role:u}=Gr(m=>m.personalData),f=Tu(),h=m=>m.map(v=>v.link==="dispatch"&&!e.isDispatchEnabled?null:p.jsxs(Ape,{to:`/${v.link}`,onClick:()=>i(v.link),className:n(t.link,{[t.linkActive]:o===v.link}),children:[p.jsx(v.icon,{className:t.linkIcon,stroke:1.5}),p.jsx("span",{children:v.label})]},v.link));return _.useEffect(()=>{i(f.pathname.split("/")[1])},[f]),p.jsxs(ug,{p:"xs",style:{backgroundColor:"#242527",borderTopLeftRadius:5,borderBottomLeftRadius:5,maxWidth:300,height:"100%"},children:[p.jsxs(ug.Section,{children:[p.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:p.jsx(ai,{radius:"md",width:150,height:150,fit:"contain",src:Hme,alt:"LSPD Logo"})}),p.jsx(Ye,{my:"sm"}),p.jsxs(At,{h:632,scrollbarSize:2,children:[p.jsx(U,{size:"xs",weight:500,color:"dimmed",style:{margin:8},children:"Home"}),h(rve),p.jsx(U,{size:"xs",weight:500,color:"dimmed",style:{margin:8},children:"Pages"}),h(ove),p.jsx(U,{size:"xs",weight:500,color:"dimmed",style:{margin:8},children:"Staff"}),h(ive)]})]}),p.jsx(Pe,{sx:{paddingTop:5,borderTop:`${M(1)} solid ${r.colorScheme==="dark"?r.colors.dark[4]:r.colors.gray[2]}`},children:p.jsx("div",{style:{display:"block",width:"100%",color:"#e9ecef",padding:"0.625rem"},children:p.jsx(nt,{children:p.jsxs(Pe,{sx:{flex:1},children:[p.jsxs(U,{size:"sm",weight:500,children:[s," ",a]}),p.jsxs(U,{color:"dimmed",size:"xs",children:[u," | ",c]})]})})})})]})};var C7={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(hS,function(){var n=1e3,r=6e4,o=36e5,i="millisecond",s="second",a="minute",c="hour",u="day",f="week",h="month",m="quarter",v="year",y="date",w="Invalid Date",P=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,b=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,S={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(V){var H=["th","st","nd","rd"],Z=V%100;return"["+V+(H[(Z-20)%10]||H[Z]||H[0])+"]"}},O=function(V,H,Z){var Y=String(V);return!Y||Y.length>=H?V:""+Array(H+1-Y.length).join(Z)+V},E={s:O,z:function(V){var H=-V.utcOffset(),Z=Math.abs(H),Y=Math.floor(Z/60),j=Z%60;return(H<=0?"+":"-")+O(Y,2,"0")+":"+O(j,2,"0")},m:function V(H,Z){if(H.date()1)return V(F[0])}else{var K=H.name;N[K]=H,j=K}return!Y&&j&&($=j),j||!Y&&$},z=function(V,H){if(R(V))return V.clone();var Z=typeof H=="object"?H:{};return Z.date=V,Z.args=arguments,new Q(Z)},G=E;G.l=B,G.i=R,G.w=function(V,H){return z(V,{locale:H.$L,utc:H.$u,x:H.$x,$offset:H.$offset})};var Q=function(){function V(Z){this.$L=B(Z.locale,null,!0),this.parse(Z),this.$x=this.$x||Z.x||{},this[I]=!0}var H=V.prototype;return H.parse=function(Z){this.$d=function(Y){var j=Y.date,W=Y.utc;if(j===null)return new Date(NaN);if(G.u(j))return new Date;if(j instanceof Date)return new Date(j);if(typeof j=="string"&&!/Z$/i.test(j)){var F=j.match(P);if(F){var K=F[2]-1||0,ee=(F[7]||"0").substring(0,3);return W?new Date(Date.UTC(F[1],K,F[3]||1,F[4]||0,F[5]||0,F[6]||0,ee)):new Date(F[1],K,F[3]||1,F[4]||0,F[5]||0,F[6]||0,ee)}}return new Date(j)}(Z),this.init()},H.init=function(){var Z=this.$d;this.$y=Z.getFullYear(),this.$M=Z.getMonth(),this.$D=Z.getDate(),this.$W=Z.getDay(),this.$H=Z.getHours(),this.$m=Z.getMinutes(),this.$s=Z.getSeconds(),this.$ms=Z.getMilliseconds()},H.$utils=function(){return G},H.isValid=function(){return this.$d.toString()!==w},H.isSame=function(Z,Y){var j=z(Z);return this.startOf(Y)<=j&&j<=this.endOf(Y)},H.isAfter=function(Z,Y){return z(Z)0,N<=$.r||!$.r){N<=1&&E>0&&($=S[E-1]);var I=b[$.l];v&&(N=v(""+N)),w=typeof I=="string"?I.replace("%d",N):I(N,f,$.l,P);break}}if(f)return w;var R=P?b.future:b.past;return typeof R=="function"?R(w):R.replace("%s",w)},i.to=function(u,f){return a(u,f,this,!0)},i.from=function(u,f){return a(u,f,this)};var c=function(u){return u.$u?o.utc():o()};i.toNow=function(u){return this.to(c(this),u)},i.fromNow=function(u){return this.from(c(this),u)}}})})(k7);var lve=k7.exports;const E7=Ta(lve);const RT={title:"Debug Incident title",id:0,description:"

This is a incident description

",officersInvolved:[{firstname:"Callum",lastname:"Graham",callsign:188,citizenid:"132142",playerId:1,position:[0,0,0]},{firstname:"Jacob",lastname:"Gray",callsign:273,citizenid:"152312",playerId:1,position:[0,0,0]},{firstname:"Edward",lastname:"Atkinson",callsign:125,citizenid:"948213",playerId:1,position:[0,0,0]}],evidence:[],criminals:[{firstname:"Archie",lastname:"Moss",dob:Date.now(),issueWarrant:!1,processed:!1,pleadedGuilty:!1,citizenid:"0",charges:[],penalty:{time:0,fine:0,reduction:null,points:0}}]},Yr=tn(e=>({incident:RT,isIncidentActive:!1,setActiveIncident:t=>{it()&&e({incident:RT}),e({incident:t})},updateIncidentField:(t,n)=>{e(r=>({incident:{...r.incident,[t]:n}}))},setIncidentActive:t=>{e({isIncidentActive:t})},setDescription:t=>{e(n=>({incident:{...n.incident,description:t}}))},setCriminals:t=>{e(n=>({incident:{...n.incident,criminals:typeof t=="function"?t(n.incident.criminals):t}}))},setCriminal:(t,n)=>{e(r=>{const o=r.incident.criminals.map(i=>i.citizenid===t?typeof n=="function"?n(i):{...i,...n}:i);return{incident:{...r.incident,criminals:o}}})},setOfficersInvolved:t=>{e(n=>({incident:{...n.incident,officersInvolved:typeof t=="function"?t(n.incident.officersInvolved):t}}))},setEvidence:t=>{e(n=>({incident:{...n.incident,evidence:typeof t=="function"?t(n.incident.evidence):t}}))}})),cve=[{type:"created",category:"profiles",firstname:"Bubble",lastname:"Test",date:"string",activityid:1,citizenid:"BUB193Z4A"},{type:"updated",category:"profiles",firstname:"Bubble",lastname:"Test",date:"string",activityid:1,citizenid:"BUB193Z4A"},{type:"deleted",category:"profiles",firstname:"Bubble",lastname:"Test",date:"string",activityid:1,citizenid:"BUB193Z4A"},{type:"created",category:"incidents",firstname:"Bubble",lastname:"Test",date:"string",activityid:1,citizenid:"BUB193Z4A"},{type:"created",category:"profiles",firstname:"Bubble",lastname:"Test",date:"string",activityid:1,citizenid:"BUB193Z4A"},{type:"created",category:"profiles",firstname:"Bubble",lastname:"Test",date:"string",activityid:1,citizenid:"BUB193Z4A"},{type:"created",category:"profiles",firstname:"Bubble",lastname:"Test",date:"string",activityid:1,citizenid:"BUB193Z4A"},{type:"created",category:"profiles",firstname:"Bubble",lastname:"Test",date:"string",activityid:1,citizenid:"BUB193Z4A"}],uve=tn(e=>({recentActivity:it()?cve:[],getRecentActivity:async()=>{try{const t=await me("getRecentActivity");return e({recentActivity:t}),{recentActivity:t}}catch(t){return console.error("Failed to fetch recent activities:",t),{recentActivity:[]}}},setRecentActivities:t=>e({recentActivity:t})})),dve="Configuration",fve="Logout",hve="Welcome back, %s %s",pve="Active Officers",mve="Callsign",gve="Attached Unit",vve="Active Warrants",yve="Expires in",_ve="No warrants found",wve="Recent Activity",bve="Type",xve="Category",Sve="Done by",Pve="Time ago",Ove="Dispatch",Cve="Responding Units",kve="No recent calls found",Eve="Announcements",$ve="Create announcement",Mve="All Announcements",Nve="No announcements found",Tve="Create",Ive="View all",jve="Profiles",Dve="Search...",Rve="DOB",Lve="Citizen ID",zve="No profiles found",Ave="No profile selected",Bve="Edit Citizen",Fve="No %s registered",Vve="Related reports",Hve="No related reports",Wve="Related incidents",Uve="No related incidents",Zve="Remove Charge",Gve="No incident selected",Yve="Add Criminal",Kve="Unlink",qve="Officers involved",Jve="Add officer",Qve="Remove officer",Xve="Are you sure you want to remove %s %s (%s) from involved officers?",eye="Confirm",tye="Cancel",nye="Evidence",rye="Add evidence",oye="Incidents",iye="Create incident",sye="Remove evidence",aye="Are you sure you want to remove %s from evidence?",lye="month(s)",cye="Remove criminal",uye="Remove %s %s? Removing them will also remove the charges from their profile.",dye="Go to profile",fye="Save criminal",hye="Edit charges",pye="Issue warrant",mye="Suspect hasn't been processed and charged",gye="Warrant expiration date",vye="Reduction",yye="No reduction",_ye="Time",wye="Fine",bye="Pleaded guilty",xye="Processed",Sye="Current Charges",Pye="All Charges",Oye="point(s)",Cye="Add Charge",kye="Incident title",Eye="Incident title is required",$ye="No officers found",Mye="Image label is required",Nye="Image URL is required",Tye="Image label",Iye="Image URL",jye="Take picture",Dye="No report selected",Rye="Citizens involved",Lye="Add citizen",zye="Are you sure you want to remove %s %s from involved citizens",Aye="Images",Bye="Add image",Fye="Reports",Vye="Create report",Hye="Report title",Wye="Report title is required",Uye="No citizens found",Zye="Units",Gye="Manage members",Yye="Leave Unit",Kye="Create unit",qye="Unit officers",Jye="Set officers assigned to this unit",Qye="Unit vehicle type",Xye="Active Calls",e0e="Responding units (%s)",t0e="Find on map",n0e="Set waypoint",r0e="Detach from call",o0e="Respond",i0e="Manage roster",s0e="Roster",a0e="members",l0e="Members",c0e="Hire officer",u0e="Today",d0e="Yesterday",f0e="Set callsign",h0e="Set rank",p0e="Set roles",m0e="Fire officer",g0e="Are you sure you want to fire %s %s?",v0e="Officer",y0e="APU",_0e="AIR",w0e="MC",b0e="K9",x0e="FTO",S0e="Last active",P0e="Role",O0e="Rank",C0e="Callsign already in use",k0e="The citizen with this citizen id is already hired",E0e="Citizen ID of the citizen you want to hire",$0e="Callsign of the new officer you want to hire",M0e="Create Charge",N0e="Charge Label",T0e="Charge Description",I0e="Charge Category",j0e="Charge Fine",D0e="Charge Jailtime",R0e="Charge Points",L0e="Charge Type",z0e="Delete charge",A0e="Are you sure you want to delete %s",B0e="Edit Charge",F0e="Edit",V0e="Delete Incident",H0e="Are you sure you want to delete %s",W0e="Change picture",U0e="Image",Z0e="Image URL to use as the profile image",G0e="Vehicles",Y0e="No vehicle selected",K0e="Vehicle Information",q0e="Save vehicle",J0e="Known information",Q0e="Wanted",X0e="MARK UNWANTED",e1e="MARK WANTED",t1e="Select items",n1e="Create BOLO",r1e="Plate",o1e="Reason",i1e="BOLO expiration date",s1e="Delete BOLO",a1e="Are you sure you want to delete the BOLO for: %s",l1e="Image URL to use as the vehicle image",c1e="BOLO",u1e="BOLOS",d1e="BOLO expires at:",f1e="Expires at:",h1e="No bolos found",p1e="Go to vehicle",m1e="You are already responding or not a part of a unit",g1e="You responded to the recent call",v1e={configuration:dve,logout:fve,welcome_back:hve,active_officers:pve,callsign:mve,attached_unit:gve,active_warrants:vve,expires_in:yve,no_warrants_found:_ve,recent_activity:wve,type:bve,category:xve,done_by:Sve,time_ago:Pve,dispatch:Ove,responding_units:Cve,no_recent_calls_found:kve,announcements:Eve,create_announcement:$ve,all_announcements:Mve,no_announcements_found:Nve,create:Tve,view_all:Ive,profiles:jve,search:Dve,dob:Rve,citizen_id:Lve,no_profiles_found:zve,no_profile_selected:Ave,edit_citizen:Bve,no_cardid_registered:Fve,related_reports:Vve,no_related_reports:Hve,related_incidents:Wve,no_related_incidents:Uve,remove_charge:Zve,no_incident_selected:Gve,add_criminal:Yve,unlink:Kve,officers_involved:qve,add_officer:Jve,remove_officer:Qve,remove_officer_confirm:Xve,confirm:eye,cancel:tye,evidence:nye,add_evidence:rye,incidents:oye,create_incident:iye,remove_evidence:sye,remove_evidence_confirm:aye,months:lye,remove_criminal:cye,remove_criminal_confirm:uye,go_to_profile:dye,save_criminal:fye,edit_charges:hye,issue_warrant:pye,issue_warrant_description:mye,warrant_expiration_date:gye,reduction:vye,no_reduction:yye,time:_ye,fine:wye,pleaded_guilty:bye,processed:xye,current_charges:Sye,all_charges:Pye,points:Oye,add_charge:Cye,incident_title:kye,incident_title_required:Eye,no_officers_found:$ye,image_label_required:Mye,image_url_required:Nye,image_label:Tye,image_url:Iye,take_picture:jye,no_report_selected:Dye,citizens_involved:Rye,add_citizen:Lye,remove_citizen_confirm:zye,images:Aye,add_image:Bye,reports:Fye,create_report:Vye,report_title:Hye,report_title_required:Wye,no_citizens_found:Uye,units:Zye,manage_members:Gye,leave_unit:Yye,create_unit:Kye,unit_officers:qye,unit_officers_description:Jye,unit_vehicle_type:Qye,active_calls:Xye,respond_units_amount:e0e,find_on_map:t0e,set_waypoint:n0e,detach_from_call:r0e,respond:o0e,manage_roster:i0e,roster:s0e,members:a0e,members_capitalized:l0e,hire_officer:c0e,today:u0e,yesterday:d0e,set_callsign:f0e,set_rank:h0e,set_roles:p0e,fire_officer:m0e,fire_officer_description:g0e,officer:v0e,apu:y0e,air:_0e,mc:w0e,k9:b0e,fto:x0e,last_active:S0e,role:P0e,rank:O0e,callsign_in_use:C0e,citizen_id_already_hired:k0e,citizen_id_you_want_to_hire:E0e,callsign_you_want_to_hire:$0e,create_charge:M0e,charge_label:N0e,charge_description:T0e,charge_category:I0e,charge_fine:j0e,charge_jailtime:D0e,charge_points:R0e,charge_type:L0e,delete_charge:z0e,delete_charge_confirm:A0e,edit_charge:B0e,edit:F0e,delete_incident:V0e,delete_incident_confirm:H0e,change_picture:W0e,image:U0e,avatar_description:Z0e,vehicles:G0e,no_vehicle_selected:Y0e,vehicle_information:K0e,save_vehicle:q0e,known_information:J0e,wanted:Q0e,mark_unwanted:X0e,mark_wanted:e1e,select_items:t1e,create_bolo:n1e,plate:r1e,reason:o1e,bolo_expiration_date:i1e,delete_bolo:s1e,delete_bolo_confirm:a1e,avatar_description_vehicle:l1e,bolo:c1e,bolos:u1e,bolo_expires_at:d1e,expires_at:f1e,no_bolos_found:h1e,goto_vehicle:p1e,already_responding_or_part_of_unit:m1e,responded_to_recent_call:g1e};var $7={},Q0={},M7={},X0={};Object.defineProperty(X0,"__esModule",{value:!0});X0.boolean=void 0;const y1e=function(e){switch(Object.prototype.toString.call(e)){case"[object String]":return["true","t","yes","y","on","1"].includes(e.trim().toLowerCase());case"[object Number]":return e.valueOf()===1;case"[object Boolean]":return e.valueOf();default:return!1}};X0.boolean=y1e;var e1={};Object.defineProperty(e1,"__esModule",{value:!0});e1.isBooleanable=void 0;const _1e=function(e){switch(Object.prototype.toString.call(e)){case"[object String]":return["true","t","yes","y","on","1","false","f","no","n","off","0"].includes(e.trim().toLowerCase());case"[object Number]":return[0,1].includes(e.valueOf());case"[object Boolean]":return!0;default:return!1}};e1.isBooleanable=_1e;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isBooleanable=e.boolean=void 0;const t=X0;Object.defineProperty(e,"boolean",{enumerable:!0,get:function(){return t.boolean}});const n=e1;Object.defineProperty(e,"isBooleanable",{enumerable:!0,get:function(){return n.isBooleanable}})})(M7);var t1={};Object.defineProperty(t1,"__esModule",{value:!0});t1.tokenize=void 0;const w1e=/(?:%(?([+0-]|-\+))?(?\d+)?(?\d+\$)?(?\.\d+)?(?[%BCESb-iosux]))|(\\%)/g,b1e=e=>{let t;const n=[];let r=0,o=0,i=null;for(;(t=w1e.exec(e))!==null;){t.index>o&&(i={literal:e.slice(o,t.index),type:"literal"},n.push(i));const s=t[0];o=t.index+s.length,s==="\\%"||s==="%%"?i&&i.type==="literal"?i.literal+="%":(i={literal:"%",type:"literal"},n.push(i)):t.groups&&(i={conversion:t.groups.conversion,flag:t.groups.flag||null,placeholder:s,position:t.groups.position?Number.parseInt(t.groups.position,10)-1:r++,precision:t.groups.precision?Number.parseInt(t.groups.precision.slice(1),10):null,type:"placeholder",width:t.groups.width?Number.parseInt(t.groups.width,10):null},n.push(i))}return o<=e.length-1&&(i&&i.type==="literal"?i.literal+=e.slice(o):n.push({literal:e.slice(o),type:"literal"})),n};t1.tokenize=b1e;Object.defineProperty(Q0,"__esModule",{value:!0});Q0.createPrintf=void 0;const LT=M7,x1e=t1,S1e=(e,t)=>t.placeholder,P1e=e=>{var t;const n=(i,s,a)=>a==="-"?i.padEnd(s," "):a==="-+"?((Number(i)>=0?"+":"")+i).padEnd(s," "):a==="+"?((Number(i)>=0?"+":"")+i).padStart(s," "):a==="0"?i.padStart(s,"0"):i.padStart(s," "),r=(t=e?.formatUnboundExpression)!==null&&t!==void 0?t:S1e,o={};return(i,...s)=>{let a=o[i];a||(a=o[i]=x1e.tokenize(i));let c="";for(const u of a)if(u.type==="literal")c+=u.literal;else{let f=s[u.position];if(f===void 0)c+=r(i,u,s);else if(u.conversion==="b")c+=LT.boolean(f)?"true":"false";else if(u.conversion==="B")c+=LT.boolean(f)?"TRUE":"FALSE";else if(u.conversion==="c")c+=f;else if(u.conversion==="C")c+=String(f).toUpperCase();else if(u.conversion==="i"||u.conversion==="d")f=String(Math.trunc(f)),u.width!==null&&(f=n(f,u.width,u.flag)),c+=f;else if(u.conversion==="e")c+=Number(f).toExponential();else if(u.conversion==="E")c+=Number(f).toExponential().toUpperCase();else if(u.conversion==="f")u.precision!==null&&(f=Number(f).toFixed(u.precision)),u.width!==null&&(f=n(String(f),u.width,u.flag)),c+=f;else if(u.conversion==="o")c+=(Number.parseInt(String(f),10)>>>0).toString(8);else if(u.conversion==="s")u.width!==null&&(f=n(String(f),u.width,u.flag)),c+=f;else if(u.conversion==="S")u.width!==null&&(f=n(String(f),u.width,u.flag)),c+=String(f).toUpperCase();else if(u.conversion==="u")c+=Number.parseInt(String(f),10)>>>0;else if(u.conversion==="x")f=(Number.parseInt(String(f),10)>>>0).toString(16),u.width!==null&&(f=n(String(f),u.width,u.flag)),c+=f;else throw new Error("Unknown format specifier.")}return c}};Q0.createPrintf=P1e;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.printf=e.createPrintf=void 0;const t=Q0;Object.defineProperty(e,"createPrintf",{enumerable:!0,get:function(){return t.createPrintf}}),e.printf=t.createPrintf()})($7);const D={};String.prototype.format=function(...e){return $7.printf(this,...e)};function O1e(e){for(const t in D)D[t]=t;for(const[t,n]of Object.entries(e))D[t]=n}if(it())for(const[e,t]of Object.entries(v1e))D[e]=t;he.extend(E7);const C1e=()=>{const e=bs(u=>u.setSelectedProfile),{setActiveIncident:t,setIncidentActive:n}=Yr(),{getRecentActivity:r,recentActivity:o}=uve(),i=Kl(),s=u=>{const f=he(u).fromNow();return a(f)},a=u=>u.charAt(0).toUpperCase()+u.slice(1);_.useEffect(()=>{r()},[]);const c=o.map((u,f)=>p.jsxs("tr",{children:[p.jsx("td",{children:p.jsx(mt,{color:u.type==="created"?"green":u.type==="updated"?"yellow":"red",radius:"sm",children:a(u.type)})}),p.jsx("td",{children:p.jsx(U,{children:a(u.category)})}),p.jsx("td",{children:p.jsxs(U,{children:[u.firstname," ",u.lastname]})}),p.jsx("td",{children:p.jsx(U,{children:s(u.date)})}),p.jsx("td",{children:u.type!=="deleted"&&p.jsx(nt,{spacing:0,position:"right",children:p.jsx(zt,{label:"View",color:"gray",position:"bottom",withArrow:!0,children:p.jsx(Xe,{onClick:async()=>{if(u.category==="profiles"){const h=await me("getProfile",u.citizenid,{data:{...pO}});e(h)}else if(u.category==="incidents"){const h=await me("getIncident",u.activityid,{data:{id:1,officersInvolved:[],evidence:[],title:"Funny title",description:"

",criminals:[]}});t(h),n(!0)}i(`/${u.category}`)},children:p.jsx(sme,{size:"1.1rem",stroke:1.5,color:"white"})})})})})]},f));return p.jsxs("div",{className:"recent-activity-content",children:[p.jsx(U,{style:{fontSize:18,color:"white"},weight:500,children:D.recent_activity}),p.jsx(At,{className:"recent-activity",children:p.jsxs(JP,{verticalSpacing:"sm",children:[p.jsx("thead",{className:"table-header",children:p.jsxs("tr",{children:[p.jsx("th",{children:D.type}),p.jsx("th",{children:D.category}),p.jsx("th",{children:D.done_by}),p.jsx("th",{children:D.time_ago}),p.jsx("th",{})]})}),p.jsx("tbody",{children:c})]})})]})},gO=_.createContext(null);gO.displayName="@mantine/modals/ModalsContext";function k1e(){const e=_.useContext(gO);if(!e)throw new Error("[@mantine/modals] useModals hook was called outside of context, wrap your app with ModalsProvider component");return e}var E1e=Object.defineProperty,$1e=Object.defineProperties,M1e=Object.getOwnPropertyDescriptors,zT=Object.getOwnPropertySymbols,N1e=Object.prototype.hasOwnProperty,T1e=Object.prototype.propertyIsEnumerable,AT=(e,t,n)=>t in e?E1e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,iw=(e,t)=>{for(var n in t||(t={}))N1e.call(t,n)&&AT(e,n,t[n]);if(zT)for(var n of zT(t))T1e.call(t,n)&&AT(e,n,t[n]);return e},BT=(e,t)=>$1e(e,M1e(t));function I1e({id:e,cancelProps:t,confirmProps:n,labels:r={cancel:"",confirm:""},closeOnConfirm:o=!0,closeOnCancel:i=!0,groupProps:s,onCancel:a,onConfirm:c,children:u}){const{cancel:f,confirm:h}=r,m=k1e(),v=w=>{typeof t?.onClick=="function"&&t?.onClick(w),typeof a=="function"&&a(),i&&m.closeModal(e)},y=w=>{typeof n?.onClick=="function"&&n?.onClick(w),typeof c=="function"&&c(),o&&m.closeModal(e)};return k.createElement(k.Fragment,null,u&&k.createElement(Pe,{mb:"md"},u),k.createElement(nt,iw({position:"right"},s),k.createElement(at,BT(iw({variant:"default"},t),{onClick:v}),t?.children||f),k.createElement(at,BT(iw({},n),{onClick:y}),n?.children||h)))}function FT(e,t){var n,r,o,i;t&&e.type==="confirm"&&((r=(n=e.props).onCancel)==null||r.call(n)),(i=(o=e.props).onClose)==null||i.call(o)}function j1e(e,t){switch(t.type){case"OPEN":return{current:t.modal,modals:[...e.modals,t.modal]};case"CLOSE":{const n=e.modals.find(o=>o.id===t.modalId);if(!n)return e;FT(n,t.canceled);const r=e.modals.filter(o=>o.id!==t.modalId);return{current:r[r.length-1]||e.current,modals:r}}case"CLOSE_ALL":return e.modals.length?(e.modals.concat().reverse().forEach(n=>{FT(n,t.canceled)}),{current:e.current,modals:[]}):e;default:return e}}const[D1e,rh]=LU("mantine-modals"),R1e=rh("openModal"),L1e=rh("closeModal"),z1e=rh("closeAllModals"),A1e=rh("openConfirmModal"),B1e=e=>rh("openContextModal")(e),ke={open:R1e,close:L1e,closeAll:z1e,openConfirmModal:A1e,openContextModal:B1e};var F1e=Object.defineProperty,V1e=Object.defineProperties,H1e=Object.getOwnPropertyDescriptors,Hv=Object.getOwnPropertySymbols,N7=Object.prototype.hasOwnProperty,T7=Object.prototype.propertyIsEnumerable,VT=(e,t,n)=>t in e?F1e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,im=(e,t)=>{for(var n in t||(t={}))N7.call(t,n)&&VT(e,n,t[n]);if(Hv)for(var n of Hv(t))T7.call(t,n)&&VT(e,n,t[n]);return e},HT=(e,t)=>V1e(e,H1e(t)),rl=(e,t)=>{var n={};for(var r in e)N7.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Hv)for(var r of Hv(e))t.indexOf(r)<0&&T7.call(e,r)&&(n[r]=e[r]);return n};function W1e(e){if(!e)return{confirmProps:{},modalProps:{}};const t=e,{id:n,children:r,onCancel:o,onConfirm:i,closeOnConfirm:s,closeOnCancel:a,cancelProps:c,confirmProps:u,groupProps:f,labels:h}=t,m=rl(t,["id","children","onCancel","onConfirm","closeOnConfirm","closeOnCancel","cancelProps","confirmProps","groupProps","labels"]);return{confirmProps:{id:n,children:r,onCancel:o,onConfirm:i,closeOnConfirm:s,closeOnCancel:a,cancelProps:c,confirmProps:u,groupProps:f,labels:h},modalProps:im({id:n},m)}}function U1e({children:e,modalProps:t,labels:n,modals:r}){const[o,i]=_.useReducer(j1e,{modals:[],current:null}),s=_.useRef(o);s.current=o;const a=_.useCallback(P=>{i({type:"CLOSE_ALL",canceled:P})},[s,i]),c=_.useCallback(P=>{var b=P,{modalId:S}=b,O=rl(b,["modalId"]);const E=S||Vc();return i({type:"OPEN",modal:{id:E,type:"content",props:O}}),E},[i]),u=_.useCallback(P=>{var b=P,{modalId:S}=b,O=rl(b,["modalId"]);const E=S||Vc();return i({type:"OPEN",modal:{id:E,type:"confirm",props:O}}),E},[i]),f=_.useCallback((P,b)=>{var S=b,{modalId:O}=S,E=rl(S,["modalId"]);const $=O||Vc();return i({type:"OPEN",modal:{id:$,type:"context",props:E,ctx:P}}),$},[i]),h=_.useCallback((P,b)=>{i({type:"CLOSE",modalId:P,canceled:b})},[s,i]);D1e({openModal:c,openConfirmModal:u,openContextModal:P=>{var b=P,{modal:S}=b,O=rl(b,["modal"]);return f(S,O)},closeModal:h,closeContextModal:h,closeAllModals:a});const m={modals:o.modals,openModal:c,openConfirmModal:u,openContextModal:f,closeModal:h,closeContextModal:h,closeAll:a},v=()=>{const P=s.current.current;switch(P?.type){case"context":{const b=P.props,{innerProps:S}=b,O=rl(b,["innerProps"]),E=r[P.ctx];return{modalProps:O,content:k.createElement(E,{innerProps:S,context:m,id:P.id})}}case"confirm":{const{modalProps:b,confirmProps:S}=W1e(P.props);return{modalProps:b,content:k.createElement(I1e,HT(im({},S),{id:P.id,labels:P.props.labels||n}))}}case"content":{const b=P.props,{children:S}=b;return{modalProps:rl(b,["children"]),content:k.createElement(k.Fragment,null,S)}}default:return{modalProps:{},content:null}}},{modalProps:y,content:w}=v();return k.createElement(gO.Provider,{value:m},k.createElement(Bi,HT(im(im({zIndex:ci("modal")+1},t),y),{opened:o.modals.length>0,onClose:()=>h(o.current.id)}),w),e)}const[Z1e,za]=Cu("RichTextEditor was not found in tree");function Rn(e){this.content=e}Rn.prototype={constructor:Rn,find:function(e){for(var t=0;t>1}};Rn.from=function(e){if(e instanceof Rn)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Rn(t)};function I7(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let o=e.child(r),i=t.child(r);if(o==i){n+=o.nodeSize;continue}if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(let s=0;o.text[s]==i.text[s];s++)n++;return n}if(o.content.size||i.content.size){let s=I7(o.content,i.content,n+1);if(s!=null)return s}n+=o.nodeSize}}function j7(e,t,n,r){for(let o=e.childCount,i=t.childCount;;){if(o==0||i==0)return o==i?null:{a:n,b:r};let s=e.child(--o),a=t.child(--i),c=s.nodeSize;if(s==a){n-=c,r-=c;continue}if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let u=0,f=Math.min(s.text.length,a.text.length);for(;ut&&r(c,o+a,i||null,s)!==!1&&c.content.size){let f=a+1;c.nodesBetween(Math.max(0,t-f),Math.min(c.content.size,n-f),r,o+f)}a=u}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,r,o){let i="",s=!0;return this.nodesBetween(t,n,(a,c)=>{a.isText?(i+=a.text.slice(Math.max(t,c)-c,n-c),s=!r):a.isLeaf?(o?i+=typeof o=="function"?o(a):o:a.type.spec.leafText&&(i+=a.type.spec.leafText(a)),s=!r):!s&&a.isBlock&&(i+=r,s=!0)},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,o=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(o[o.length-1]=n.withText(n.text+r.text),i=1);it)for(let i=0,s=0;st&&((sn)&&(a.isText?a=a.cut(Math.max(0,t-s),Math.min(a.text.length,n-s)):a=a.cut(Math.max(0,t-s-1),Math.min(a.content.size,n-s-1))),r.push(a),o+=a.nodeSize),s=c}return new se(r,o)}cutByIndex(t,n){return t==n?se.empty:t==0&&n==this.content.length?this:new se(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let o=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return o[t]=n,new se(o,i)}addToStart(t){return new se([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new se(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;nthis.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let r=0,o=0;;r++){let i=this.child(r),s=o+i.nodeSize;if(s>=t)return s==t||n>0?mp(r+1,s):mp(r,o);o=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return se.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new se(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return se.empty;let n,r=0;for(let o=0;othis.type.rank&&(n||(n=t.slice(0,o)),n.push(this),r=!0),n&&n.push(i)}}return n||(n=t.slice()),r||n.push(this),n}removeFromSet(t){for(let n=0;nr.type.rank-o.type.rank),n}};wt.none=[];class Uv extends Error{}class ye{constructor(t,n,r){this.content=t,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=R7(this.content,t+this.openStart,n);return r&&new ye(r,this.openStart,this.openEnd)}removeBetween(t,n){return new ye(D7(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return ye.empty;let r=n.openStart||0,o=n.openEnd||0;if(typeof r!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new ye(se.fromJSON(t,n.content),r,o)}static maxOpen(t,n=!0){let r=0,o=0;for(let i=t.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=t.lastChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.lastChild)o++;return new ye(t,r,o)}}ye.empty=new ye(se.empty,0,0);function D7(e,t,n){let{index:r,offset:o}=e.findIndex(t),i=e.maybeChild(r),{index:s,offset:a}=e.findIndex(n);if(o==t||i.isText){if(a!=n&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(r,i.copy(D7(i.content,t-o-1,n-o-1)))}function R7(e,t,n,r){let{index:o,offset:i}=e.findIndex(t),s=e.maybeChild(o);if(i==t||s.isText)return r&&!r.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let a=R7(s.content,t-i-1,n);return a&&e.replaceChild(o,s.copy(a))}function G1e(e,t,n){if(n.openStart>e.depth)throw new Uv("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Uv("Inconsistent open depths");return L7(e,t,n,0)}function L7(e,t,n,r){let o=e.index(r),i=e.node(r);if(o==t.index(r)&&r=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Fd(e,t,n,r){let o=(t||e).node(n),i=0,s=t?t.index(n):o.childCount;e&&(i=e.index(n),e.depth>n?i++:e.textOffset&&(Pl(e.nodeAfter,r),i++));for(let a=i;ao&&Px(e,t,o+1),s=r.depth>o&&Px(n,r,o+1),a=[];return Fd(null,e,o,a),i&&s&&t.index(o)==n.index(o)?(z7(i,s),Pl(Ol(i,A7(e,t,n,r,o+1)),a)):(i&&Pl(Ol(i,Zv(e,t,o+1)),a),Fd(t,n,o,a),s&&Pl(Ol(s,Zv(n,r,o+1)),a)),Fd(r,null,o,a),new se(a)}function Zv(e,t,n){let r=[];if(Fd(null,e,n,r),e.depth>n){let o=Px(e,t,n+1);Pl(Ol(o,Zv(e,t,n+1)),r)}return Fd(t,null,n,r),new se(r)}function Y1e(e,t){let n=t.depth-e.openStart,o=t.node(n).copy(e.content);for(let i=n-1;i>=0;i--)o=t.node(i).copy(se.from(o));return{start:o.resolveNoCache(e.openStart+n),end:o.resolveNoCache(o.content.size-e.openEnd-n)}}class Sf{constructor(t,n,r){this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let r=this.pos-this.path[this.path.length-1],o=t.child(n);return r?t.child(n).cut(r):o}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let r=this.path[n*3],o=n==0?0:this.path[n*3-1]+1;for(let i=0;i0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos=0;r--)if(t.pos<=this.end(r)&&(!n||n(this.node(r))))return new Gv(this,t,r);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let r=[],o=0,i=n;for(let s=t;;){let{index:a,offset:c}=s.content.findIndex(i),u=i-c;if(r.push(s,a,o+c),!u||(s=s.child(a),s.isText))break;i=u-1,o+=c+1}return new Sf(n,r,i)}static resolveCached(t,n){for(let o=0;ot&&this.nodesBetween(t,n,i=>(r.isInSet(i.marks)&&(o=!0),!o)),o}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),B7(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,r=se.empty,o=0,i=r.childCount){let s=this.contentMatchAt(t).matchFragment(r,o,i),a=s&&s.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let c=o;cn.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,r)}let o=se.fromJSON(t,n.content);return t.nodeType(n.type).create(n.attrs,o,r)}};Cl.prototype.text=void 0;class Yv extends Cl{constructor(t,n,r,o){if(super(t,n,null,o),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):B7(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new Yv(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new Yv(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function B7(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class Rl{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new J1e(t,n);if(r.next==null)return Rl.empty;let o=F7(r);r.next&&r.err("Unexpected trailing text");let i=o_e(r_e(o));return i_e(i,r),i}matchType(t){for(let n=0;nu.createAndFill()));for(let u=0;u=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(r){t.push(r);for(let o=0;o{let i=o+(r.validEnd?"*":" ")+" ";for(let s=0;s"+t.indexOf(r.next[s].next);return i}).join(` +`)}}Rl.empty=new Rl(!0);class J1e{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function F7(e){let t=[];do t.push(Q1e(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function Q1e(e){let t=[];do t.push(X1e(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function X1e(e){let t=n_e(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=e_e(e,t);else break;return t}function WT(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function e_e(e,t){let n=WT(e),r=n;return e.eat(",")&&(e.next!="}"?r=WT(e):r=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function t_e(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let o=[];for(let i in n){let s=n[i];s.groups.indexOf(t)>-1&&o.push(s)}return o.length==0&&e.err("No node type or group '"+t+"' found"),o}function n_e(e){if(e.eat("(")){let t=F7(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=t_e(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function r_e(e){let t=[[]];return o(i(e,0),n()),t;function n(){return t.push([])-1}function r(s,a,c){let u={term:c,to:a};return t[s].push(u),u}function o(s,a){s.forEach(c=>c.to=a)}function i(s,a){if(s.type=="choice")return s.exprs.reduce((c,u)=>c.concat(i(u,a)),[]);if(s.type=="seq")for(let c=0;;c++){let u=i(s.exprs[c],a);if(c==s.exprs.length-1)return u;o(u,a=n())}else if(s.type=="star"){let c=n();return r(a,c),o(i(s.expr,c),c),[r(c)]}else if(s.type=="plus"){let c=n();return o(i(s.expr,a),c),o(i(s.expr,c),c),[r(c)]}else{if(s.type=="opt")return[r(a)].concat(i(s.expr,a));if(s.type=="range"){let c=a;for(let u=0;u{e[s].forEach(({term:a,to:c})=>{if(!a)return;let u;for(let f=0;f{u||o.push([a,u=[]]),u.indexOf(f)==-1&&u.push(f)})})});let i=t[r.join(",")]=new Rl(r.indexOf(e.length-1)>-1);for(let s=0;s-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;nr[i]=new Z7(i,n,s));let o=n.spec.topNode||"doc";if(!r[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class s_e{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class n1{constructor(t,n,r,o){this.name=t,this.rank=n,this.schema=r,this.spec=o,this.attrs=U7(o.attrs),this.excluded=null;let i=H7(this.attrs);this.instance=i?new wt(this,i):null}create(t=null){return!t&&this.instance?this.instance:new wt(this,W7(this.attrs,t))}static compile(t,n){let r=Object.create(null),o=0;return t.forEach((i,s)=>r[i]=new n1(i,o++,n,s)),r}removeFromSet(t){for(var n=0;n-1}}class a_e{constructor(t){this.cached=Object.create(null);let n=this.spec={};for(let o in t)n[o]=t[o];n.nodes=Rn.from(t.nodes),n.marks=Rn.from(t.marks||{}),this.nodes=ZT.compile(this.spec.nodes,this),this.marks=n1.compile(this.spec.marks,this);let r=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let i=this.nodes[o],s=i.spec.content||"",a=i.spec.marks;i.contentMatch=r[s]||(r[s]=Rl.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.markSet=a=="_"?null:a?GT(this,a.split(" ")):a==""||!i.inlineContent?[]:null}for(let o in this.marks){let i=this.marks[o],s=i.spec.excludes;i.excluded=s==null?[i]:s==""?[]:GT(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,r,o){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof ZT){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,r,o)}text(t,n){let r=this.nodes.text;return new Yv(r,r.defaultAttrs,t,wt.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeFromJSON(t){return Cl.fromJSON(this,t)}markFromJSON(t){return wt.fromJSON(this,t)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function GT(e,t){let n=[];for(let r=0;r-1)&&n.push(s=c)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class vu{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[],n.forEach(r=>{r.tag?this.tags.push(r):r.style&&this.styles.push(r)}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let o=t.nodes[r.node];return o.contentMatch.matchType(o)})}parse(t,n={}){let r=new KT(this,n,!1);return r.addAll(t,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new KT(this,n,!0);return r.addAll(t,n.from,n.to),ye.maxOpen(r.finish())}matchTag(t,n,r){for(let o=r?this.tags.indexOf(r)+1:0;ot.length&&(a.charCodeAt(t.length)!=61||a.slice(t.length+1)!=n))){if(s.getAttrs){let c=s.getAttrs(n);if(c===!1)continue;s.attrs=c||void 0}return s}}}static schemaRules(t){let n=[];function r(o){let i=o.priority==null?50:o.priority,s=0;for(;s{r(s=qT(s)),s.mark||s.ignore||s.clearMark||(s.mark=o)})}for(let o in t.nodes){let i=t.nodes[o].spec.parseDOM;i&&i.forEach(s=>{r(s=qT(s)),s.node||s.ignore||s.mark||(s.node=o)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new vu(t,vu.schemaRules(t)))}}const G7={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},l_e={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Y7={ol:!0,ul:!0},Kv=1,qv=2,Vd=4;function YT(e,t,n){return t!=null?(t?Kv:0)|(t==="full"?qv:0):e&&e.whitespace=="pre"?Kv|qv:n&~Vd}class gp{constructor(t,n,r,o,i,s,a){this.type=t,this.attrs=n,this.marks=r,this.pendingMarks=o,this.solid=i,this.options=a,this.content=[],this.activeMarks=wt.none,this.stashMarks=[],this.match=s||(a&Vd?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(se.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,o;return(o=r.findWrapping(t.type))?(this.match=r,o):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&Kv)){let r=this.content[this.content.length-1],o;if(r&&r.isText&&(o=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-o[0].length))}}let n=se.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(se.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}popFromStashMark(t){for(let n=this.stashMarks.length-1;n>=0;n--)if(t.eq(this.stashMarks[n]))return this.stashMarks.splice(n,1)[0]}applyPending(t){for(let n=0,r=this.pendingMarks;nthis.addAll(t)),s&&this.sync(a),this.needsBlock=c}else this.withStyleRules(t,()=>{this.addElementByRule(t,i,i.consuming===!1?o:void 0)})}leafFallback(t){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(` -`))}ignoreFallback(t){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(t){let n=wt.none,r=wt.none;for(let o=0;o{s.clearMark(a)&&(r=a.addToSet(r))}):n=this.parser.schema.marks[s.mark].create(s.attrs).addToSet(n),s.consuming===!1)i=s;else break}return[n,r]}addElementByRule(t,n,r){let o,i,s;n.node?(i=this.parser.schema.nodes[n.node],i.isLeaf?this.insertNode(i.create(n.attrs))||this.leafFallback(t):o=this.enter(i,n.attrs||null,n.preserveWhitespace)):(s=this.parser.schema.marks[n.mark].create(n.attrs),this.addPendingMark(s));let a=this.top;if(i&&i.isLeaf)this.findInside(t);else if(r)this.addElement(t,r);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(c=>this.insertNode(c));else{let c=t;typeof n.contentElement=="string"?c=t.querySelector(n.contentElement):typeof n.contentElement=="function"?c=n.contentElement(t):n.contentElement&&(c=n.contentElement),this.findAround(t,c,!0),this.addAll(c)}o&&this.sync(a)&&this.open--,s&&this.removePendingMark(s,a)}addAll(t,n,r){let o=n||0;for(let i=n?t.childNodes[n]:t.firstChild,s=r==null?null:t.childNodes[r];i!=s;i=i.nextSibling,++o)this.findAtPoint(t,o),this.addDOM(i);this.findAtPoint(t,o)}findPlace(t){let n,r;for(let o=this.open;o>=0;o--){let i=this.nodes[o],s=i.findWrapping(t);if(s&&(!n||n.length>s.length)&&(n=s,r=i,!s.length)||i.solid)break}if(!n)return!1;this.sync(r);for(let o=0;othis.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(t){for(let n=this.open;n>=0;n--)if(this.nodes[n]==t)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let o=r.length-1;o>=0;o--)t+=r[o].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let r=0;r-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),r=this.options.context,o=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1),s=(a,c)=>{for(;a>=0;a--){let u=n[a];if(u==""){if(a==n.length-1||a==0)continue;for(;c>=i;c--)if(s(a-1,c))return!0;return!1}else{let f=c>0||c==0&&o?this.nodes[c].type:r&&c>=i?r.node(c-i).type:null;if(!f||f.name!=u&&f.groups.indexOf(u)==-1)return!1;c--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(t){let n=h_e(t,this.top.pendingMarks);n&&this.top.stashMarks.push(n),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)}removePendingMark(t,n){for(let r=this.open;r>=0;r--){let o=this.nodes[r];if(o.pendingMarks.lastIndexOf(t)>-1)o.pendingMarks=t.removeFromSet(o.pendingMarks);else{o.activeMarks=t.removeFromSet(o.activeMarks);let s=o.popFromStashMark(t);s&&o.type&&o.type.allowsMarkType(s.type)&&(o.activeMarks=s.addToSet(o.activeMarks))}if(o==n)break}}}function c_e(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&Y7.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):r=="li"?n=t:r&&(n=null)}}function u_e(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function d_e(e){let t=/\s*([\w-]+)\s*:\s*([^;]+)/g,n,r=[];for(;n=t.exec(e);)r.push(n[1],n[2].trim());return r}function qT(e){let t={};for(let n in e)t[n]=e[n];return t}function f_e(e,t){let n=t.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(e))continue;let i=[],s=a=>{i.push(a);for(let c=0;c{if(i.length||s.marks.length){let a=0,c=0;for(;a=0;o--){let i=this.serializeMark(t.marks[o],t.isInline,n);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(t,n,r={}){let o=this.marks[t.type.name];return o&&Ti.renderSpec(cw(r),o(t,n))}static renderSpec(t,n,r=null){if(typeof n=="string")return{dom:t.createTextNode(n)};if(n.nodeType!=null)return{dom:n};if(n.dom&&n.dom.nodeType!=null)return n;let o=n[0],i=o.indexOf(" ");i>0&&(r=o.slice(0,i),o=o.slice(i+1));let s,a=r?t.createElementNS(r,o):t.createElement(o),c=n[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let f in c)if(c[f]!=null){let h=f.indexOf(" ");h>0?a.setAttributeNS(f.slice(0,h),f.slice(h+1),c[f]):a.setAttribute(f,c[f])}}for(let f=u;fu)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:m,contentDOM:v}=Ti.renderSpec(t,h,r);if(a.appendChild(m),v){if(s)throw new RangeError("Multiple content holes");s=v}}}return{dom:a,contentDOM:s}}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new Ti(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=JT(t.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(t){return JT(t.marks)}}function JT(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function cw(e){return e.document||window.document}const K7=65535,q7=Math.pow(2,16);function p_e(e,t){return e+t*q7}function QT(e){return e&K7}function m_e(e){return(e-(e&K7))/q7}const J7=1,Q7=2,sm=4,X7=8;class Cx{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&X7)>0}get deletedBefore(){return(this.delInfo&(J7|sm))>0}get deletedAfter(){return(this.delInfo&(Q7|sm))>0}get deletedAcross(){return(this.delInfo&sm)>0}}class ho{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&ho.empty)return ho.empty}recover(t){let n=0,r=QT(t);if(!this.inverted)for(let o=0;ot)break;let u=this.ranges[a+i],f=this.ranges[a+s],h=c+u;if(t<=h){let m=u?t==c?-1:t==h?1:n:n,v=c+o+(m<0?0:f);if(r)return v;let y=t==(n<0?c:h)?null:p_e(a/3,t-c),w=t==c?Q7:t==h?J7:sm;return(n<0?t!=c:t!=h)&&(w|=X7),new Cx(v,w,y)}o+=f-u}return r?t+o:new Cx(t+o,0,null)}touches(t,n){let r=0,o=QT(n),i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;at)break;let u=this.ranges[a+i],f=c+u;if(t<=f&&a==o*3)return!0;r+=this.ranges[a+s]-u}return!1}forEach(t){let n=this.inverted?2:1,r=this.inverted?1:2;for(let o=0,i=0;o=0;n--){let o=t.getMirror(n);this.appendMap(t.maps[n].invert(),o!=null&&o>n?r-o-1:void 0)}}invert(){let t=new Jc;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let r=this.from;ri&&c!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),o),n.openStart,n.openEnd);return dn.fromReplace(t,this.from,this.to,i)}invert(){return new Ii(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new oa(n.pos,r.pos,this.mark)}merge(t){return t instanceof oa&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new oa(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new oa(n.from,n.to,t.markFromJSON(n.mark))}}lr.jsonID("addMark",oa);class Ii extends lr{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=new ye(vO(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),t),n.openStart,n.openEnd);return dn.fromReplace(t,this.from,this.to,r)}invert(){return new oa(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Ii(n.pos,r.pos,this.mark)}merge(t){return t instanceof Ii&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Ii(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Ii(n.from,n.to,t.markFromJSON(n.mark))}}lr.jsonID("removeMark",Ii);class ia extends lr{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return dn.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return dn.fromReplace(t,this.pos,this.pos+1,new ye(se.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let o=0;or.pos?null:new $n(n.pos,r.pos,o,i,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new $n(n.from,n.to,n.gapFrom,n.gapTo,ye.fromJSON(t,n.slice),n.insert,!!n.structure)}}lr.jsonID("replaceAround",$n);function kx(e,t,n){let r=e.resolve(t),o=n-t,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let s=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}}return!1}function g_e(e,t,n,r){let o=[],i=[],s,a;e.doc.nodesBetween(t,n,(c,u,f)=>{if(!c.isInline)return;let h=c.marks;if(!r.isInSet(h)&&f.type.allowsMarkType(r.type)){let m=Math.max(u,t),v=Math.min(u+c.nodeSize,n),y=r.addToSet(h);for(let w=0;we.step(c)),i.forEach(c=>e.step(c))}function v_e(e,t,n,r){let o=[],i=0;e.doc.nodesBetween(t,n,(s,a)=>{if(!s.isInline)return;i++;let c=null;if(r instanceof n1){let u=s.marks,f;for(;f=r.isInSet(u);)(c||(c=[])).push(f),u=f.removeFromSet(u)}else r?r.isInSet(s.marks)&&(c=[r]):c=s.marks;if(c&&c.length){let u=Math.min(a+s.nodeSize,n);for(let f=0;fe.step(new Ii(s.from,s.to,s.style)))}function y_e(e,t,n,r=n.contentMatch){let o=e.doc.nodeAt(t),i=[],s=t+1;for(let a=0;a=0;a--)e.step(i[a])}function __e(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Du(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let r=e.depth;;--r){let o=e.$from.node(r),i=e.$from.index(r),s=e.$to.indexAfter(r);if(rn;y--)w||r.index(y)>0?(w=!0,f=se.from(r.node(y).copy(f)),h++):c--;let m=se.empty,v=0;for(let y=i,w=!1;y>n;y--)w||o.after(y+1)=0;s--){if(r.size){let a=n[s].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=se.from(n[s].type.create(n[s].attrs,r))}let o=t.start,i=t.end;e.step(new $n(o,i,o,i,new ye(r,0,0),n.length,!0))}function P_e(e,t,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=e.steps.length;e.doc.nodesBetween(t,n,(s,a)=>{if(s.isTextblock&&!s.hasMarkup(r,o)&&O_e(e.doc,e.mapping.slice(i).map(a),r)){e.clearIncompatible(e.mapping.slice(i).map(a,1),r);let c=e.mapping.slice(i),u=c.map(a,1),f=c.map(a+s.nodeSize,1);return e.step(new $n(u,f,u+1,f-1,new ye(se.from(r.create(o,null,s.marks)),0,0),1,!0)),!1}})}function O_e(e,t,n){let r=e.resolve(t),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}function C_e(e,t,n,r,o){let i=e.doc.nodeAt(t);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return e.replaceWith(t,t+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new $n(t,t+i.nodeSize,t+1,t+i.nodeSize-1,new ye(se.from(s),0,0),1,!0))}function Qc(e,t,n=1,r){let o=e.resolve(t),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let u=o.depth-1,f=n-2;u>i;u--,f--){let h=o.node(u),m=o.index(u);if(h.type.spec.isolating)return!1;let v=h.content.cutByIndex(m,h.childCount),y=r&&r[f+1];y&&(v=v.replaceChild(0,y.type.create(y.attrs)));let w=r&&r[f]||h;if(!h.canReplace(m+1,h.childCount)||!w.type.validContent(v))return!1}let a=o.indexAfter(i),c=r&&r[0];return o.node(i).canReplaceWith(a,a,c?c.type:o.node(i+1).type)}function k_e(e,t,n=1,r){let o=e.doc.resolve(t),i=se.empty,s=se.empty;for(let a=o.depth,c=o.depth-n,u=n-1;a>c;a--,u--){i=se.from(o.node(a).copy(i));let f=r&&r[u];s=se.from(f?f.type.create(f.attrs,s):o.node(a).copy(s))}e.step(new Bn(t,t,new ye(i.append(s),n,n),!0))}function Aa(e,t){let n=e.resolve(t),r=n.index();return eB(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function eB(e,t){return!!(e&&t&&!e.isLeaf&&e.canAppend(t))}function r1(e,t,n=-1){let r=e.resolve(t);for(let o=r.depth;;o--){let i,s,a=r.index(o);if(o==r.depth?(i=r.nodeBefore,s=r.nodeAfter):n>0?(i=r.node(o+1),a++,s=r.node(o).maybeChild(a)):(i=r.node(o).maybeChild(a-1),s=r.node(o+1)),i&&!i.isTextblock&&eB(i,s)&&r.node(o).canReplace(a,a+1))return t;if(o==0)break;t=n<0?r.before(o):r.after(o)}}function E_e(e,t,n){let r=new Bn(t-n,t+n,ye.empty,!0);e.step(r)}function $_e(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let o=r.depth-1;o>=0;o--){let i=r.index(o);if(r.node(o).canReplaceWith(i,i,n))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let i=r.indexAfter(o);if(r.node(o).canReplaceWith(i,i,n))return r.after(o+1);if(i=0;s--){let a=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,c=r.index(s)+(a>0?1:0),u=r.node(s),f=!1;if(i==1)f=u.canReplace(c,c,o);else{let h=u.contentMatchAt(c).findWrapping(o.firstChild.type);f=h&&u.canReplaceWith(c,c,h[0])}if(f)return a==0?r.pos:a<0?r.before(s+1):r.after(s+1)}return null}function _O(e,t,n=t,r=ye.empty){if(t==n&&!r.size)return null;let o=e.resolve(t),i=e.resolve(n);return nB(o,i,r)?new Bn(t,n,r):new M_e(o,i,r).fit()}function nB(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class M_e{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=se.empty;for(let o=0;o<=t.depth;o++){let i=t.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(t.indexAfter(o))})}for(let o=t.depth;o>0;o--)this.placed=se.from(t.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(t<0?this.$to:r.doc.resolve(t));if(!o)return null;let i=this.placed,s=r.depth,a=o.depth;for(;s&&a&&i.childCount==1;)i=i.firstChild.content,s--,a--;let c=new ye(i,s,a);return t>-1?new $n(r.pos,t,this.$to.pos,this.$to.end(),c,n):c.size||r.pos!=this.$to.pos?new Bn(r.pos,o.pos,c):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,o=this.unplaced.openEnd;r1&&(o=0),i.type.spec.isolating&&o<=r){t=r;break}n=i.content}for(let n=1;n<=2;n++)for(let r=n==1?t:this.unplaced.openStart;r>=0;r--){let o,i=null;r?(i=dw(this.unplaced.content,r-1).firstChild,o=i.content):o=this.unplaced.content;let s=o.firstChild;for(let a=this.depth;a>=0;a--){let{type:c,match:u}=this.frontier[a],f,h=null;if(n==1&&(s?u.matchType(s.type)||(h=u.fillBefore(se.from(s),!1)):i&&c.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:a,parent:i,inject:h};if(n==2&&s&&(f=u.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:i,wrap:f};if(i&&u.matchType(i.type))break}}}openMore(){let{content:t,openStart:n,openEnd:r}=this.unplaced,o=dw(t,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new ye(t,n+1,Math.max(r,o.size+n>=t.size-r?n+1:0)),!0)}dropNode(){let{content:t,openStart:n,openEnd:r}=this.unplaced,o=dw(t,n);if(o.childCount<=1&&n>0){let i=t.size-n<=n+o.size;this.unplaced=new ye(xd(t,n-1,1),n-1,i?n-1:r)}else this.unplaced=new ye(xd(t,n,1),n,r)}placeNodes({sliceDepth:t,frontierDepth:n,parent:r,inject:o,wrap:i}){for(;this.depth>n;)this.closeFrontierNode();if(i)for(let w=0;w1||c==0||w.content.size)&&(h=P,f.push(rB(w.mark(m.allowedMarks(w.marks)),u==1?c:0,u==a.childCount?v:-1)))}let y=u==a.childCount;y||(v=-1),this.placed=Sd(this.placed,n,se.from(f)),this.frontier[n].match=h,y&&v<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let w=0,P=a;w1&&o==this.$to.end(--r);)++o;return o}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:r,type:o}=this.frontier[n],i=n=0;a--){let{match:c,type:u}=this.frontier[a],f=fw(t,a,u,c,!0);if(!f||f.childCount)continue e}return{depth:n,fit:s,move:i?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Sd(this.placed,n.depth,n.fit)),t=n.move;for(let r=n.depth+1;r<=t.depth;r++){let o=t.node(r),i=o.type.contentMatch.fillBefore(o.content,!0,t.index(r));this.openFrontierNode(o.type,o.attrs,i)}return t}openFrontierNode(t,n=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(t),this.placed=Sd(this.placed,this.depth,se.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(se.empty,!0);n.childCount&&(this.placed=Sd(this.placed,this.frontier.length,n))}}function xd(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(xd(e.firstChild.content,t-1,n)))}function Sd(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Sd(e.lastChild.content,t-1,n)))}function dw(e,t){for(let n=0;n1&&(r=r.replaceChild(0,rB(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(se.empty,!0)))),e.copy(r)}function fw(e,t,n,r,o){let i=e.node(t),s=o?e.indexAfter(t):e.index(t);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,s);return a&&!N_e(n,i.content,s)?a:null}function N_e(e,t,n){for(let r=n;r0;m--,v--){let y=o.node(m).type.spec;if(y.defining||y.definingAsContext||y.isolating)break;s.indexOf(m)>-1?a=m:o.before(m)==v&&s.splice(1,0,-m)}let c=s.indexOf(a),u=[],f=r.openStart;for(let m=r.content,v=0;;v++){let y=m.firstChild;if(u.push(y),v==r.openStart)break;m=y.content}for(let m=f-1;m>=0;m--){let v=u[m],y=T_e(v.type);if(y&&!v.sameMarkup(o.node(Math.abs(a)-1)))f=m;else if(y||!v.type.isTextblock)break}for(let m=r.openStart;m>=0;m--){let v=(m+f+1)%(r.openStart+1),y=u[v];if(y)for(let w=0;w=0&&(e.replace(t,n,r),!(e.steps.length>h));m--){let v=s[m];v<0||(t=o.before(v),n=i.after(v))}}function oB(e,t,n,r,o){if(tr){let i=o.contentMatchAt(0),s=i.fillBefore(e).append(e);e=s.append(i.matchFragment(s).fillBefore(se.empty,!0))}return e}function D_e(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let o=$_e(e.doc,t,r.type);o!=null&&(t=n=o)}e.replaceRange(t,n,new ye(se.from(r),0,0))}function j_e(e,t,n){let r=e.doc.resolve(t),o=e.doc.resolve(n),i=iB(r,o);for(let s=0;s0&&(c||r.node(a-1).canReplace(r.index(a-1),o.indexAfter(a-1))))return e.delete(r.before(a),o.after(a))}for(let s=1;s<=r.depth&&s<=o.depth;s++)if(t-r.start(s)==r.depth-s&&n>r.end(s)&&o.end(s)-n!=o.depth-s)return e.delete(r.before(s),n);e.delete(t,n)}function iB(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let o=r;o>=0;o--){let i=e.start(o);if(it.pos+(t.depth-o)||e.node(o).type.spec.isolating||t.node(o).type.spec.isolating)break;(i==t.start(o)||o==e.depth&&o==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&o&&t.start(o-1)==i-1)&&n.push(o)}return n}class Xc extends lr{constructor(t,n,r){super(),this.pos=t,this.attr=n,this.value=r}apply(t){let n=t.nodeAt(this.pos);if(!n)return dn.fail("No node at attribute step's position");let r=Object.create(null);for(let i in n.attrs)r[i]=n.attrs[i];r[this.attr]=this.value;let o=n.type.create(r,null,n.marks);return dn.fromReplace(t,this.pos,this.pos+1,new ye(se.from(o),0,n.isLeaf?0:1))}getMap(){return ho.empty}invert(t){return new Xc(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Xc(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Xc(n.pos,n.attr,n.value)}}lr.jsonID("attr",Xc);class Pf extends lr{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let o in t.attrs)n[o]=t.attrs[o];n[this.attr]=this.value;let r=t.type.create(n,t.content,t.marks);return dn.ok(r)}getMap(){return ho.empty}invert(t){return new Pf(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Pf(n.attr,n.value)}}lr.jsonID("docAttr",Pf);let _u=class extends Error{};_u=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};_u.prototype=Object.create(Error.prototype);_u.prototype.constructor=_u;_u.prototype.name="TransformError";class sB{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new Jc}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new _u(n.failed);return this}maybeStep(t){let n=t.apply(this.doc);return n.failed||this.addStep(t,n.doc),n}get docChanged(){return this.steps.length>0}addStep(t,n){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=n}replace(t,n=t,r=ye.empty){let o=_O(this.doc,t,n,r);return o&&this.step(o),this}replaceWith(t,n,r){return this.replace(t,n,new ye(se.from(r),0,0))}delete(t,n){return this.replace(t,n,ye.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,r){return I_e(this,t,n,r),this}replaceRangeWith(t,n,r){return D_e(this,t,n,r),this}deleteRange(t,n){return j_e(this,t,n),this}lift(t,n){return w_e(this,t,n),this}join(t,n=1){return E_e(this,t,n),this}wrap(t,n){return S_e(this,t,n),this}setBlockType(t,n=t,r,o=null){return P_e(this,t,n,r,o),this}setNodeMarkup(t,n,r=null,o){return C_e(this,t,n,r,o),this}setNodeAttribute(t,n,r){return this.step(new Xc(t,n,r)),this}setDocAttribute(t,n){return this.step(new Pf(t,n)),this}addNodeMark(t,n){return this.step(new ia(t,n)),this}removeNodeMark(t,n){if(!(n instanceof wt)){let r=this.doc.nodeAt(t);if(!r)throw new RangeError("No node at position "+t);if(n=n.isInSet(r.marks),!n)return this}return this.step(new yu(t,n)),this}split(t,n=1,r){return k_e(this,t,n,r),this}addMark(t,n,r){return g_e(this,t,n,r),this}removeMark(t,n,r){return v_e(this,t,n,r),this}clearIncompatible(t,n,r){return y_e(this,t,n,r),this}}const hw=Object.create(null);class Ze{constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new L_e(t.min(n),t.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let n=0;n=0;i--){let s=n<0?yc(t.node(0),t.node(i),t.before(i+1),t.index(i),n,r):yc(t.node(0),t.node(i),t.after(i+1),t.index(i)+1,n,r);if(s)return s}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new ri(t.node(0))}static atStart(t){return yc(t,t,0,0,1)||new ri(t)}static atEnd(t){return yc(t,t,t.content.size,t.childCount,-1)||new ri(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=hw[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in hw)throw new RangeError("Duplicate use of selection JSON ID "+t);return hw[t]=n,n.prototype.jsonID=t,n}getBookmark(){return Ve.between(this.$anchor,this.$head).getBookmark()}}Ze.prototype.visible=!0;class L_e{constructor(t,n){this.$from=t,this.$to=n}}let eI=!1;function tI(e){!eI&&!e.parent.inlineContent&&(eI=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class Ve extends Ze{constructor(t,n=t){tI(t),tI(n),super(t,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return Ze.near(r);let o=t.resolve(n.map(this.anchor));return new Ve(o.parent.inlineContent?o:r,r)}replace(t,n=ye.empty){if(super.replace(t,n),n==ye.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof Ve&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new o1(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Ve(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){let o=t.resolve(n);return new this(o,r==n?o:t.resolve(r))}static between(t,n,r){let o=t.pos-n.pos;if((!r||o)&&(r=o>=0?1:-1),!n.parent.inlineContent){let i=Ze.findFrom(n,r,!0)||Ze.findFrom(n,-r,!0);if(i)n=i.$head;else return Ze.near(n,r)}return t.parent.inlineContent||(o==0?t=n:(t=(Ze.findFrom(t,-r,!0)||Ze.findFrom(t,r,!0)).$anchor,t.pos0?0:1);o>0?s=0;s+=o){let a=t.child(s);if(a.isAtom){if(!i&&je.isSelectable(a))return je.create(e,n-(o<0?a.nodeSize:0))}else{let c=yc(e,a,n+o,o<0?a.childCount:0,o,i);if(c)return c}n+=a.nodeSize*o}return null}function nI(e,t,n){let r=e.steps.length-1;if(r{s==null&&(s=f)}),e.setSelection(Ze.near(e.doc.resolve(s),n))}const rI=1,vp=2,oI=4;class z_e extends sB{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(t){return this.storedMarks=t,this.updated|=vp,this}ensureMarks(t){return wt.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&vp)>0}addStep(t,n){super.addStep(t,n),this.updated=this.updated&~vp,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,n=!0){let r=this.selection;return n&&(t=t.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||wt.none))),r.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,n,r){let o=this.doc.type.schema;if(n==null)return t?this.replaceSelectionWith(o.text(t),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!t)return this.deleteRange(n,r);let i=this.storedMarks;if(!i){let s=this.doc.resolve(n);i=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,o.text(t,i)),this.selection.empty||this.setSelection(Ze.near(this.selection.$to)),this}}setMeta(t,n){return this.meta[typeof t=="string"?t:t.key]=n,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=oI,this}get scrolledIntoView(){return(this.updated&oI)>0}}function iI(e,t){return!t||!e?e:e.bind(t)}class Pd{constructor(t,n,r){this.name=t,this.init=iI(n.init,r),this.apply=iI(n.apply,r)}}const A_e=[new Pd("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Pd("selection",{init(e,t){return e.selection||Ze.atStart(t.doc)},apply(e){return e.selection}}),new Pd("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new Pd("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class pw{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=A_e.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Pd(r.key,r.spec.state,r))})}}class Dc{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,n=-1){for(let r=0;rr.toJSON())),t&&typeof t=="object")for(let r in t){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=t[r],i=o.spec.state;i&&i.toJSON&&(n[r]=i.toJSON.call(o,this[o.key]))}return n}static fromJSON(t,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let o=new pw(t.schema,t.plugins),i=new Dc(o);return o.fields.forEach(s=>{if(s.name=="doc")i.doc=Cl.fromJSON(t.schema,n.doc);else if(s.name=="selection")i.selection=Ze.fromJSON(i.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(i.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let a in r){let c=r[a],u=c.spec.state;if(c.key==s.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){i[s.name]=u.fromJSON.call(c,t,n[a],i);return}}i[s.name]=s.init(t,i)}}),i}}function aB(e,t,n){for(let r in e){let o=e[r];o instanceof Function?o=o.bind(t):r=="handleDOMEvents"&&(o=aB(o,t,{})),n[r]=o}return n}class Kr{constructor(t){this.spec=t,this.props={},t.props&&aB(t.props,this,this.props),this.key=t.key?t.key.key:lB("plugin")}getState(t){return t[this.key]}}const mw=Object.create(null);function lB(e){return e in mw?e+"$"+ ++mw[e]:(mw[e]=0,e+"$")}class Fi{constructor(t="key"){this.key=lB(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const gr=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},Of=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t};let sI=null;const rs=function(e,t,n){let r=sI||(sI=document.createRange());return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},Rl=function(e,t,n,r){return n&&(aI(e,t,n,r,-1)||aI(e,t,n,r,1))},B_e=/^(img|br|input|textarea|hr)$/i;function aI(e,t,n,r,o){for(;;){if(e==n&&t==r)return!0;if(t==(o<0?0:Mi(e))){let i=e.parentNode;if(!i||i.nodeType!=1||bO(e)||B_e.test(e.nodeName)||e.contentEditable=="false")return!1;t=gr(e)+(o<0?0:1),e=i}else if(e.nodeType==1){if(e=e.childNodes[t+(o<0?-1:0)],e.contentEditable=="false")return!1;t=o<0?Mi(e):0}else return!1}}function Mi(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function F_e(e,t,n){for(let r=t==0,o=t==Mi(e);r||o;){if(e==n)return!0;let i=gr(e);if(e=e.parentNode,!e)return!1;r=r&&i==0,o=o&&i==Mi(e)}}function bO(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const i1=function(e){return e.focusNode&&Rl(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function il(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function V_e(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function H_e(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:r.offset}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:r.startOffset}}}const zi=typeof navigator<"u"?navigator:null,lI=typeof document<"u"?document:null,Ba=zi&&zi.userAgent||"",Ex=/Edge\/(\d+)/.exec(Ba),cB=/MSIE \d/.exec(Ba),$x=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ba),Wr=!!(cB||$x||Ex),ba=cB?document.documentMode:$x?+$x[1]:Ex?+Ex[1]:0,li=!Wr&&/gecko\/(\d+)/i.test(Ba);li&&+(/Firefox\/(\d+)/.exec(Ba)||[0,0])[1];const Mx=!Wr&&/Chrome\/(\d+)/.exec(Ba),or=!!Mx,W_e=Mx?+Mx[1]:0,wr=!Wr&&!!zi&&/Apple Computer/.test(zi.vendor),wu=wr&&(/Mobile\/\w+/.test(Ba)||!!zi&&zi.maxTouchPoints>2),To=wu||(zi?/Mac/.test(zi.platform):!1),U_e=zi?/Win/.test(zi.platform):!1,Xo=/Android \d/.test(Ba),oh=!!lI&&"webkitFontSmoothing"in lI.documentElement.style,Z_e=oh?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function G_e(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Qi(e,t){return typeof e=="number"?e:e[t]}function Y_e(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function cI(e,t,n){let r=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument;for(let s=n||e.dom;s;s=Of(s)){if(s.nodeType!=1)continue;let a=s,c=a==i.body,u=c?G_e(i):Y_e(a),f=0,h=0;if(t.topu.bottom-Qi(r,"bottom")&&(h=t.bottom-t.top>u.bottom-u.top?t.top+Qi(o,"top")-u.top:t.bottom-u.bottom+Qi(o,"bottom")),t.leftu.right-Qi(r,"right")&&(f=t.right-u.right+Qi(o,"right")),f||h)if(c)i.defaultView.scrollBy(f,h);else{let m=a.scrollLeft,v=a.scrollTop;h&&(a.scrollTop+=h),f&&(a.scrollLeft+=f);let y=a.scrollLeft-m,w=a.scrollTop-v;t={left:t.left-y,top:t.top-w,right:t.right-y,bottom:t.bottom-w}}if(c||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function K_e(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,o;for(let i=(t.left+t.right)/2,s=n+1;s=n-20){r=a,o=c.top;break}}return{refDOM:r,refTop:o,stack:uB(e.dom)}}function uB(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=Of(r));return t}function q_e({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;dB(n,r==0?0:r-t)}function dB(e,t){for(let n=0;n=a){s=Math.max(y.bottom,s),a=Math.min(y.top,a);let w=y.left>t.left?y.left-t.left:y.right=(y.left+y.right)/2?1:0));continue}}else y.top>t.top&&!c&&y.left<=t.left&&y.right>=t.left&&(c=f,u={left:Math.max(y.left,Math.min(y.right,t.left)),top:y.top});!n&&(t.left>=y.right&&t.top>=y.top||t.left>=y.left&&t.top>=y.bottom)&&(i=h+1)}}return!n&&c&&(n=c,o=u,r=0),n&&n.nodeType==3?Q_e(n,o):!n||r&&n.nodeType==1?{node:e,offset:i}:fB(n,o)}function Q_e(e,t){let n=e.nodeValue.length,r=document.createRange();for(let o=0;o=(i.left+i.right)/2?1:0)}}return{node:e,offset:0}}function xO(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function X_e(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left(s.left+s.right)/2?1:-1}return e.docView.posFromDOM(r,o,i)}function twe(e,t,n,r){let o=-1;for(let i=t,s=!1;i!=e.dom;){let a=e.docView.nearestDesc(i,!0);if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent&&!s||!a.contentDOM)){let c=a.dom.getBoundingClientRect();if(a.node.isBlock&&a.parent&&!s&&(s=!0,c.left>r.left||c.top>r.top?o=a.posBefore:(c.right-1?o:e.docView.posFromDOM(t,n,-1)}function hB(e,t,n){let r=e.childNodes.length;if(r&&n.topt.top&&o++}let u;oh&&o&&r.nodeType==1&&(u=r.childNodes[o-1]).nodeType==1&&u.contentEditable=="false"&&u.getBoundingClientRect().top>=t.top&&o--,r==e.dom&&o==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?a=e.state.doc.content.size:(o==0||r.nodeType!=1||r.childNodes[o-1].nodeName!="BR")&&(a=twe(e,r,o,t))}a==null&&(a=ewe(e,s,t));let c=e.docView.nearestDesc(s,!0);return{pos:a,inside:c?c.posAtStart-c.border:-1}}function uI(e){return e.top=0&&o==r.nodeValue.length?(c--,f=1):n<0?c--:u++,md(Hs(rs(r,c,u),f),f<0)}if(!e.state.doc.resolve(t-(i||0)).parent.inlineContent){if(i==null&&o&&(n<0||o==Mi(r))){let c=r.childNodes[o-1];if(c.nodeType==1)return gw(c.getBoundingClientRect(),!1)}if(i==null&&o=0)}if(i==null&&o&&(n<0||o==Mi(r))){let c=r.childNodes[o-1],u=c.nodeType==3?rs(c,Mi(c)-(s?0:1)):c.nodeType==1&&(c.nodeName!="BR"||!c.nextSibling)?c:null;if(u)return md(Hs(u,1),!1)}if(i==null&&o=0)}function md(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function gw(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function mB(e,t,n){let r=e.state,o=e.root.activeElement;r!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),o!=e.dom&&o&&o.focus()}}function owe(e,t,n){let r=t.selection,o=n=="up"?r.$from:r.$to;return mB(e,t,()=>{let{node:i}=e.docView.domFromPos(o.pos,n=="up"?-1:1);for(;;){let a=e.docView.nearestDesc(i,!0);if(!a)break;if(a.node.isBlock){i=a.contentDOM||a.dom;break}i=a.dom.parentNode}let s=pB(e,o.pos,1);for(let a=i.firstChild;a;a=a.nextSibling){let c;if(a.nodeType==1)c=a.getClientRects();else if(a.nodeType==3)c=rs(a,0,a.nodeValue.length).getClientRects();else continue;for(let u=0;uf.top+1&&(n=="up"?s.top-f.top>(f.bottom-s.top)*2:f.bottom-s.bottom>(s.bottom-f.top)*2))return!1}}return!0})}const iwe=/[\u0590-\u08ac]/;function swe(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,s=o==r.parent.content.size,a=e.domSelection();return!iwe.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?i:s:mB(e,t,()=>{let{focusNode:c,focusOffset:u,anchorNode:f,anchorOffset:h}=e.domSelectionRange(),m=a.caretBidiLevel;a.modify("move",n,"character");let v=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:y,focusOffset:w}=e.domSelectionRange(),P=y&&!v.contains(y.nodeType==1?y:y.parentNode)||c==y&&u==w;try{a.collapse(f,h),c&&(c!=f||u!=h)&&a.extend&&a.extend(c,u)}catch{}return m!=null&&(a.caretBidiLevel=m),P})}let dI=null,fI=null,hI=!1;function awe(e,t,n){return dI==t&&fI==n?hI:(dI=t,fI=n,hI=n=="up"||n=="down"?owe(e,t,n):swe(e,t,n))}const Ao=0,pI=1,ml=2,Ai=3;class ih{constructor(t,n,r,o){this.parent=t,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=Ao,r.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,n,r){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let n=0;ngr(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=t.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let i=t;;i=i.parentNode){if(i==this.dom){o=!1;break}if(i.previousSibling)break}if(o==null&&n==t.childNodes.length)for(let i=t;;i=i.parentNode){if(i==this.dom){o=!0;break}if(i.nextSibling)break}}return o??r>0?this.posAtEnd:this.posAtStart}nearestDesc(t,n=!1){for(let r=!0,o=t;o;o=o.parentNode){let i=this.getDesc(o),s;if(i&&(!n||i.node))if(r&&(s=i.nodeDOM)&&!(s.nodeType==1?s.contains(t.nodeType==1?t:t.parentNode):s==t))r=!1;else return i}}getDesc(t){let n=t.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(t,n,r){for(let o=t;o;o=o.parentNode){let i=this.getDesc(o);if(i)return i.localPosFromDOM(t,n,r)}return-1}descAt(t){for(let n=0,r=0;nt||s instanceof vB){o=t-i;break}i=a}if(o)return this.children[r].domFromPos(o-this.children[r].border,n);for(let i;r&&!(i=this.children[r-1]).size&&i instanceof gB&&i.side>=0;r--);if(n<=0){let i,s=!0;for(;i=r?this.children[r-1]:null,!(!i||i.dom.parentNode==this.contentDOM);r--,s=!1);return i&&n&&s&&!i.border&&!i.domAtom?i.domFromPos(i.size,n):{node:this.contentDOM,offset:i?gr(i.dom)+1:0}}else{let i,s=!0;for(;i=r=f&&n<=u-c.border&&c.node&&c.contentDOM&&this.contentDOM.contains(c.contentDOM))return c.parseRange(t,n,f);t=s;for(let h=a;h>0;h--){let m=this.children[h-1];if(m.size&&m.dom.parentNode==this.contentDOM&&!m.emptyChildAt(1)){o=gr(m.dom)+1;break}t-=m.size}o==-1&&(o=0)}if(o>-1&&(u>n||a==this.children.length-1)){n=u;for(let f=a+1;fv&&sn){let v=a;a=c,c=v}let m=document.createRange();m.setEnd(c.node,c.offset),m.setStart(a.node,a.offset),u.removeAllRanges(),u.addRange(m)}}ignoreMutation(t){return!this.contentDOM&&t.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,n){for(let r=0,o=0;o=r:tr){let a=r+i.border,c=s-i.border;if(t>=a&&n<=c){this.dirty=t==r||n==s?ml:pI,t==a&&n==c&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=Ai:i.markDirty(t-a,n-a);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?ml:Ai}r=s}this.dirty=ml}markParentsDirty(){let t=1;for(let n=this.parent;n;n=n.parent,t++){let r=t==1?ml:pI;n.dirty{if(!i)return o;if(i.parent)return i.parent.posBeforeChild(i)})),!n.type.spec.raw){if(s.nodeType!=1){let a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(t,[],s,null),this.widget=n,this.widget=n,i=this}matchesWidget(t){return this.dirty==Ao&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let n=this.widget.spec.stopEvent;return n?n(t):!1}ignoreMutation(t){return t.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class lwe extends ih{constructor(t,n,r,o){super(t,[],n,null),this.textDOM=r,this.text=o}get size(){return this.text.length}localPosFromDOM(t,n){return t!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return t.type==="characterData"&&t.target.nodeValue==t.oldValue}}class zl extends ih{constructor(t,n,r,o){super(t,[],r,o),this.mark=n}static create(t,n,r,o){let i=o.nodeViews[n.type.name],s=i&&i(n,o,r);return(!s||!s.dom)&&(s=Ti.renderSpec(document,n.type.spec.toDOM(n,r))),new zl(t,n,s.dom,s.contentDOM||s.dom)}parseRule(){return this.dirty&Ai||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return this.dirty!=Ai&&this.mark.eq(t)}markDirty(t,n){if(super.markDirty(t,n),this.dirty!=Ao){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty0&&(i=Ix(i,0,t,r));for(let a=0;a{if(!c)return s;if(c.parent)return c.parent.posBeforeChild(c)},r,o),f=u&&u.dom,h=u&&u.contentDOM;if(n.isText){if(!f)f=document.createTextNode(n.text);else if(f.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else f||({dom:f,contentDOM:h}=Ti.renderSpec(document,n.type.spec.toDOM(n)));!h&&!n.isText&&f.nodeName!="BR"&&(f.hasAttribute("contenteditable")||(f.contentEditable="false"),n.type.spec.draggable&&(f.draggable=!0));let m=f;return f=wB(f,r,n),u?c=new cwe(t,n,r,o,f,h||null,m,u,i,s+1):n.isText?new s1(t,n,r,o,f,m,i):new xa(t,n,r,o,f,h||null,m,i,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(t.preserveWhitespace="full"),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){t.contentElement=r.dom.parentNode;break}}t.contentElement||(t.getContent=()=>se.empty)}return t}matchesNode(t,n,r){return this.dirty==Ao&&t.eq(this.node)&&Tx(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,n){let r=this.node.inlineContent,o=n,i=t.composing?this.localCompositionInfo(t,n):null,s=i&&i.pos>-1?i:null,a=i&&i.pos<0,c=new dwe(this,s&&s.node,t);pwe(this.node,this.innerDeco,(u,f,h)=>{u.spec.marks?c.syncToMarks(u.spec.marks,r,t):u.type.side>=0&&!h&&c.syncToMarks(f==this.node.childCount?wt.none:this.node.child(f).marks,r,t),c.placeWidget(u,t,o)},(u,f,h,m)=>{c.syncToMarks(u.marks,r,t);let v;c.findNodeMatch(u,f,h,m)||a&&t.state.selection.from>o&&t.state.selection.to-1&&c.updateNodeAt(u,f,h,v,t)||c.updateNextNode(u,f,h,t,m,o)||c.addNode(u,f,h,t,o),o+=u.nodeSize}),c.syncToMarks([],r,t),this.node.isTextblock&&c.addTextblockHacks(),c.destroyRest(),(c.changed||this.dirty==ml)&&(s&&this.protectLocalComposition(t,s),yB(this.contentDOM,this.children,t),wu&&mwe(this.dom))}localCompositionInfo(t,n){let{from:r,to:o}=t.state.selection;if(!(t.state.selection instanceof Ve)||rn+this.node.content.size)return null;let i=t.domSelectionRange(),s=gwe(i.focusNode,i.focusOffset);if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let a=s.nodeValue,c=vwe(this.node.content,a,r-n,o-n);return c<0?null:{node:s,pos:c,text:a}}else return{node:s,pos:-1,text:""}}protectLocalComposition(t,{node:n,pos:r,text:o}){if(this.getDesc(n))return;let i=n;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let s=new lwe(this,i,n,o);t.input.compositionNodes.push(s),this.children=Ix(this.children,r,r+o.length,t,s)}update(t,n,r,o){return this.dirty==Ai||!t.sameMarkup(this.node)?!1:(this.updateInner(t,n,r,o),!0)}updateInner(t,n,r,o){this.updateOuterDeco(n),this.node=t,this.innerDeco=r,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=Ao}updateOuterDeco(t){if(Tx(t,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=_B(this.dom,this.nodeDOM,Nx(this.outerDeco,this.node,n),Nx(t,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function mI(e,t,n,r,o){wB(r,t,e);let i=new xa(void 0,e,t,n,r,r,r,o,0);return i.contentDOM&&i.updateChildren(o,0),i}class s1 extends xa{constructor(t,n,r,o,i,s,a){super(t,n,r,o,i,null,s,a,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,n,r,o){return this.dirty==Ai||this.dirty!=Ao&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Ao||t.text!=this.node.text)&&t.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=t.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=t,this.dirty=Ao,!0)}inParent(){let t=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,n,r){return t==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(t,n,r)}ignoreMutation(t){return t.type!="characterData"&&t.type!="selection"}slice(t,n,r){let o=this.node.cut(t,n),i=document.createTextNode(o.text);return new s1(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)}markDirty(t,n){super.markDirty(t,n),this.dom!=this.nodeDOM&&(t==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Ai)}get domAtom(){return!1}}class vB extends ih{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==Ao&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class cwe extends xa{constructor(t,n,r,o,i,s,a,c,u,f){super(t,n,r,o,i,s,a,u,f),this.spec=c}update(t,n,r,o){if(this.dirty==Ai)return!1;if(this.spec.update){let i=this.spec.update(t,n,r);return i&&this.updateInner(t,n,r,o),i}else return!this.contentDOM&&!t.isLeaf?!1:super.update(t,n,r,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,n,r,o){this.spec.setSelection?this.spec.setSelection(t,n,r):super.setSelection(t,n,r,o)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return this.spec.stopEvent?this.spec.stopEvent(t):!1}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function yB(e,t,n){let r=e.firstChild,o=!1;for(let i=0;i>1,s=Math.min(i,t.length);for(;o-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let c=zl.create(this.top,t[i],n,r);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,i++}}findNodeMatch(t,n,r,o){let i=-1,s;if(o>=this.preMatch.index&&(s=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&s.matchesNode(t,n,r))i=this.top.children.indexOf(s,this.index);else for(let a=this.index,c=Math.min(this.top.children.length,a+5);a0;){let a;for(;;)if(r){let u=n.children[r-1];if(u instanceof zl)n=u,r=u.children.length;else{a=u,r--;break}}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let c=a.node;if(c){if(c!=e.child(o-1))break;--o,i.set(a,o),s.push(a)}}return{index:o,matched:i,matches:s.reverse()}}function hwe(e,t){return e.type.side-t.type.side}function pwe(e,t,n,r){let o=t.locals(e),i=0;if(o.length==0){for(let u=0;ui;)a.push(o[s++]);let y=i+m.nodeSize;if(m.isText){let P=y;s!P.inline):a.slice();r(m,w,t.forChild(i,m),v),i=y}}function mwe(e){if(e.nodeName=="UL"||e.nodeName=="OL"){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}function gwe(e,t){for(;;){if(e.nodeType==3)return e;if(e.nodeType==1&&t>0){if(e.childNodes.length>t&&e.childNodes[t].nodeType==3)return e.childNodes[t];e=e.childNodes[t-1],t=Mi(e)}else if(e.nodeType==1&&t=n){if(i>=r&&c.slice(r-t.length-a,r-a)==t)return r-t.length;let u=a=0&&u+t.length+a>=n)return a+u;if(n==r&&c.length>=r+t.length-a&&c.slice(r-a,r-a+t.length)==t)return r}}return-1}function Ix(e,t,n,r,o){let i=[];for(let s=0,a=0;s=n||f<=t?i.push(c):(un&&i.push(c.slice(n-u,c.size,r)))}return i}function SO(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let o=e.docView.nearestDesc(n.focusNode),i=o&&o.size==0,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a=r.resolve(s),c,u;if(i1(n)){for(c=a;o&&!o.node;)o=o.parent;let f=o.node;if(o&&f.isAtom&&je.isSelectable(f)&&o.parent&&!(f.isInline&&F_e(n.focusNode,n.focusOffset,o.dom))){let h=o.posBefore;u=new je(s==h?a:r.resolve(h))}}else{let f=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(f<0)return null;c=r.resolve(f)}if(!u){let f=t=="pointer"||e.state.selection.head{(n.anchorNode!=r||n.anchorOffset!=o)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!bB(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function _we(e){let t=e.domSelection(),n=document.createRange(),r=e.cursorWrapper.dom,o=r.nodeName=="IMG";o?n.setEnd(r.parentNode,gr(r)+1):n.setEnd(r,0),n.collapse(!1),t.removeAllRanges(),t.addRange(n),!o&&!e.state.selection.visible&&Wr&&ba<=11&&(r.disabled=!0,r.disabled=!1)}function xB(e,t){if(t instanceof je){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(wI(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else wI(e)}function wI(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function PO(e,t,n,r){return e.someProp("createSelectionBetween",o=>o(e,t,n))||Ve.between(t,n,r)}function bI(e){return e.editable&&!e.hasFocus()?!1:SB(e)}function SB(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function wwe(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return Rl(t.node,t.offset,n.anchorNode,n.anchorOffset)}function Dx(e,t){let{$anchor:n,$head:r}=e.selection,o=t>0?n.max(r):n.min(r),i=o.parent.inlineContent?o.depth?e.doc.resolve(t>0?o.after():o.before()):null:o;return i&&Ze.findFrom(i,t)}function sl(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function xI(e,t,n){let r=e.state.selection;if(r instanceof Ve){if(!r.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"forward":"backward")){let o=Dx(e.state,t);return o&&o instanceof je?sl(e,o):!1}else if(!(To&&n.indexOf("m")>-1)){let o=r.$head,i=o.textOffset?null:t<0?o.nodeBefore:o.nodeAfter,s;if(!i||i.isText)return!1;let a=t<0?o.pos-i.nodeSize:o.pos;return i.isAtom||(s=e.docView.descAt(a))&&!s.contentDOM?je.isSelectable(i)?sl(e,new je(t<0?e.state.doc.resolve(o.pos-i.nodeSize):o)):oh?sl(e,new Ve(e.state.doc.resolve(t<0?a:a+i.nodeSize))):!1:!1}}else{if(r instanceof je&&r.node.isInline)return sl(e,new Ve(t>0?r.$to:r.$from));{let o=Dx(e.state,t);return o?sl(e,o):!1}}}function Jv(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Wd(e,t){if(e.contentEditable=="false")return!0;let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!="BR")}function mc(e,t){return t<0?bwe(e):xwe(e)}function bwe(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o,i,s=!1;for(li&&n.nodeType==1&&r0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(Wd(a,-1))o=n,i=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(PB(n))break;{let a=n.previousSibling;for(;a&&Wd(a,-1);)o=n.parentNode,i=gr(a),a=a.previousSibling;if(a)n=a,r=Jv(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}s?jx(e,n,r):o&&jx(e,o,i)}function xwe(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o=Jv(n),i,s;for(;;)if(r{e.state==o&&ps(e)},50)}function SI(e,t){let n=e.state.doc.resolve(t);if(!(or||U_e)&&n.parent.inlineContent){let o=e.coordsAtPos(t);if(t>n.start()){let i=e.coordsAtPos(t-1),s=(i.top+i.bottom)/2;if(s>o.top&&s1)return i.lefto.top&&s1)return i.left>o.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function PI(e,t,n){let r=e.state.selection;if(r instanceof Ve&&!r.empty||n.indexOf("s")>-1||To&&n.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let s=Dx(e.state,t);if(s&&s instanceof je)return sl(e,s)}if(!o.parent.inlineContent){let s=t<0?o:i,a=r instanceof ri?Ze.near(s,t):Ze.findFrom(s,t);return a?sl(e,a):!1}return!1}function OI(e,t){if(!(e.state.selection instanceof Ve))return!0;let{$head:n,$anchor:r,empty:o}=e.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let i=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let s=e.state.tr;return t<0?s.delete(n.pos-i.nodeSize,n.pos):s.delete(n.pos,n.pos+i.nodeSize),e.dispatch(s),!0}return!1}function CI(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Owe(e){if(!wr||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let r=t.firstChild;CI(e,r,"true"),setTimeout(()=>CI(e,r,"false"),20)}return!1}function Cwe(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function kwe(e,t){let n=t.keyCode,r=Cwe(t);if(n==8||To&&n==72&&r=="c")return OI(e,-1)||mc(e,-1);if(n==46&&!t.shiftKey||To&&n==68&&r=="c")return OI(e,1)||mc(e,1);if(n==13||n==27)return!0;if(n==37||To&&n==66&&r=="c"){let o=n==37?SI(e,e.state.selection.from)=="ltr"?-1:1:-1;return xI(e,o,r)||mc(e,o)}else if(n==39||To&&n==70&&r=="c"){let o=n==39?SI(e,e.state.selection.from)=="ltr"?1:-1:1;return xI(e,o,r)||mc(e,o)}else{if(n==38||To&&n==80&&r=="c")return PI(e,-1,r)||mc(e,-1);if(n==40||To&&n==78&&r=="c")return Owe(e)||PI(e,1,r)||mc(e,1);if(r==(To?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function OB(e,t){e.someProp("transformCopied",v=>{t=v(t,e)});let n=[],{content:r,openStart:o,openEnd:i}=t;for(;o>1&&i>1&&r.childCount==1&&r.firstChild.childCount==1;){o--,i--;let v=r.firstChild;n.push(v.type.name,v.attrs!=v.type.defaultAttrs?v.attrs:null),r=v.content}let s=e.someProp("clipboardSerializer")||Ti.fromSchema(e.state.schema),a=NB(),c=a.createElement("div");c.appendChild(s.serializeFragment(r,{document:a}));let u=c.firstChild,f,h=0;for(;u&&u.nodeType==1&&(f=MB[u.nodeName.toLowerCase()]);){for(let v=f.length-1;v>=0;v--){let y=a.createElement(f[v]);for(;c.firstChild;)y.appendChild(c.firstChild);c.appendChild(y),h++}u=c.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${o} ${i}${h?` -${h}`:""} ${JSON.stringify(n)}`);let m=e.someProp("clipboardTextSerializer",v=>v(t,e))||t.content.textBetween(0,t.content.size,` +`))}ignoreFallback(t){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(t){let n=wt.none,r=wt.none;for(let o=0;o{s.clearMark(a)&&(r=a.addToSet(r))}):n=this.parser.schema.marks[s.mark].create(s.attrs).addToSet(n),s.consuming===!1)i=s;else break}return[n,r]}addElementByRule(t,n,r){let o,i,s;n.node?(i=this.parser.schema.nodes[n.node],i.isLeaf?this.insertNode(i.create(n.attrs))||this.leafFallback(t):o=this.enter(i,n.attrs||null,n.preserveWhitespace)):(s=this.parser.schema.marks[n.mark].create(n.attrs),this.addPendingMark(s));let a=this.top;if(i&&i.isLeaf)this.findInside(t);else if(r)this.addElement(t,r);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(c=>this.insertNode(c));else{let c=t;typeof n.contentElement=="string"?c=t.querySelector(n.contentElement):typeof n.contentElement=="function"?c=n.contentElement(t):n.contentElement&&(c=n.contentElement),this.findAround(t,c,!0),this.addAll(c)}o&&this.sync(a)&&this.open--,s&&this.removePendingMark(s,a)}addAll(t,n,r){let o=n||0;for(let i=n?t.childNodes[n]:t.firstChild,s=r==null?null:t.childNodes[r];i!=s;i=i.nextSibling,++o)this.findAtPoint(t,o),this.addDOM(i);this.findAtPoint(t,o)}findPlace(t){let n,r;for(let o=this.open;o>=0;o--){let i=this.nodes[o],s=i.findWrapping(t);if(s&&(!n||n.length>s.length)&&(n=s,r=i,!s.length)||i.solid)break}if(!n)return!1;this.sync(r);for(let o=0;othis.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(t){for(let n=this.open;n>=0;n--)if(this.nodes[n]==t)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let o=r.length-1;o>=0;o--)t+=r[o].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let r=0;r-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),r=this.options.context,o=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1),s=(a,c)=>{for(;a>=0;a--){let u=n[a];if(u==""){if(a==n.length-1||a==0)continue;for(;c>=i;c--)if(s(a-1,c))return!0;return!1}else{let f=c>0||c==0&&o?this.nodes[c].type:r&&c>=i?r.node(c-i).type:null;if(!f||f.name!=u&&f.groups.indexOf(u)==-1)return!1;c--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(t){let n=h_e(t,this.top.pendingMarks);n&&this.top.stashMarks.push(n),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)}removePendingMark(t,n){for(let r=this.open;r>=0;r--){let o=this.nodes[r];if(o.pendingMarks.lastIndexOf(t)>-1)o.pendingMarks=t.removeFromSet(o.pendingMarks);else{o.activeMarks=t.removeFromSet(o.activeMarks);let s=o.popFromStashMark(t);s&&o.type&&o.type.allowsMarkType(s.type)&&(o.activeMarks=s.addToSet(o.activeMarks))}if(o==n)break}}}function c_e(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&Y7.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):r=="li"?n=t:r&&(n=null)}}function u_e(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function d_e(e){let t=/\s*([\w-]+)\s*:\s*([^;]+)/g,n,r=[];for(;n=t.exec(e);)r.push(n[1],n[2].trim());return r}function qT(e){let t={};for(let n in e)t[n]=e[n];return t}function f_e(e,t){let n=t.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(e))continue;let i=[],s=a=>{i.push(a);for(let c=0;c{if(i.length||s.marks.length){let a=0,c=0;for(;a=0;o--){let i=this.serializeMark(t.marks[o],t.isInline,n);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(t,n,r={}){let o=this.marks[t.type.name];return o&&Ti.renderSpec(cw(r),o(t,n))}static renderSpec(t,n,r=null){if(typeof n=="string")return{dom:t.createTextNode(n)};if(n.nodeType!=null)return{dom:n};if(n.dom&&n.dom.nodeType!=null)return n;let o=n[0],i=o.indexOf(" ");i>0&&(r=o.slice(0,i),o=o.slice(i+1));let s,a=r?t.createElementNS(r,o):t.createElement(o),c=n[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let f in c)if(c[f]!=null){let h=f.indexOf(" ");h>0?a.setAttributeNS(f.slice(0,h),f.slice(h+1),c[f]):a.setAttribute(f,c[f])}}for(let f=u;fu)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:m,contentDOM:v}=Ti.renderSpec(t,h,r);if(a.appendChild(m),v){if(s)throw new RangeError("Multiple content holes");s=v}}}return{dom:a,contentDOM:s}}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new Ti(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=JT(t.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(t){return JT(t.marks)}}function JT(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function cw(e){return e.document||window.document}const K7=65535,q7=Math.pow(2,16);function p_e(e,t){return e+t*q7}function QT(e){return e&K7}function m_e(e){return(e-(e&K7))/q7}const J7=1,Q7=2,sm=4,X7=8;class Cx{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&X7)>0}get deletedBefore(){return(this.delInfo&(J7|sm))>0}get deletedAfter(){return(this.delInfo&(Q7|sm))>0}get deletedAcross(){return(this.delInfo&sm)>0}}class ho{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&ho.empty)return ho.empty}recover(t){let n=0,r=QT(t);if(!this.inverted)for(let o=0;ot)break;let u=this.ranges[a+i],f=this.ranges[a+s],h=c+u;if(t<=h){let m=u?t==c?-1:t==h?1:n:n,v=c+o+(m<0?0:f);if(r)return v;let y=t==(n<0?c:h)?null:p_e(a/3,t-c),w=t==c?Q7:t==h?J7:sm;return(n<0?t!=c:t!=h)&&(w|=X7),new Cx(v,w,y)}o+=f-u}return r?t+o:new Cx(t+o,0,null)}touches(t,n){let r=0,o=QT(n),i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;at)break;let u=this.ranges[a+i],f=c+u;if(t<=f&&a==o*3)return!0;r+=this.ranges[a+s]-u}return!1}forEach(t){let n=this.inverted?2:1,r=this.inverted?1:2;for(let o=0,i=0;o=0;n--){let o=t.getMirror(n);this.appendMap(t.maps[n].invert(),o!=null&&o>n?r-o-1:void 0)}}invert(){let t=new Jc;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let r=this.from;ri&&c!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),o),n.openStart,n.openEnd);return dn.fromReplace(t,this.from,this.to,i)}invert(){return new Ii(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new oa(n.pos,r.pos,this.mark)}merge(t){return t instanceof oa&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new oa(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new oa(n.from,n.to,t.markFromJSON(n.mark))}}lr.jsonID("addMark",oa);class Ii extends lr{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=new ye(vO(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),t),n.openStart,n.openEnd);return dn.fromReplace(t,this.from,this.to,r)}invert(){return new oa(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Ii(n.pos,r.pos,this.mark)}merge(t){return t instanceof Ii&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Ii(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Ii(n.from,n.to,t.markFromJSON(n.mark))}}lr.jsonID("removeMark",Ii);class ia extends lr{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return dn.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return dn.fromReplace(t,this.pos,this.pos+1,new ye(se.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let o=0;or.pos?null:new $n(n.pos,r.pos,o,i,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new $n(n.from,n.to,n.gapFrom,n.gapTo,ye.fromJSON(t,n.slice),n.insert,!!n.structure)}}lr.jsonID("replaceAround",$n);function kx(e,t,n){let r=e.resolve(t),o=n-t,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let s=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}}return!1}function g_e(e,t,n,r){let o=[],i=[],s,a;e.doc.nodesBetween(t,n,(c,u,f)=>{if(!c.isInline)return;let h=c.marks;if(!r.isInSet(h)&&f.type.allowsMarkType(r.type)){let m=Math.max(u,t),v=Math.min(u+c.nodeSize,n),y=r.addToSet(h);for(let w=0;we.step(c)),i.forEach(c=>e.step(c))}function v_e(e,t,n,r){let o=[],i=0;e.doc.nodesBetween(t,n,(s,a)=>{if(!s.isInline)return;i++;let c=null;if(r instanceof n1){let u=s.marks,f;for(;f=r.isInSet(u);)(c||(c=[])).push(f),u=f.removeFromSet(u)}else r?r.isInSet(s.marks)&&(c=[r]):c=s.marks;if(c&&c.length){let u=Math.min(a+s.nodeSize,n);for(let f=0;fe.step(new Ii(s.from,s.to,s.style)))}function y_e(e,t,n,r=n.contentMatch){let o=e.doc.nodeAt(t),i=[],s=t+1;for(let a=0;a=0;a--)e.step(i[a])}function __e(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function ju(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let r=e.depth;;--r){let o=e.$from.node(r),i=e.$from.index(r),s=e.$to.indexAfter(r);if(rn;y--)w||r.index(y)>0?(w=!0,f=se.from(r.node(y).copy(f)),h++):c--;let m=se.empty,v=0;for(let y=i,w=!1;y>n;y--)w||o.after(y+1)=0;s--){if(r.size){let a=n[s].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=se.from(n[s].type.create(n[s].attrs,r))}let o=t.start,i=t.end;e.step(new $n(o,i,o,i,new ye(r,0,0),n.length,!0))}function P_e(e,t,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=e.steps.length;e.doc.nodesBetween(t,n,(s,a)=>{if(s.isTextblock&&!s.hasMarkup(r,o)&&O_e(e.doc,e.mapping.slice(i).map(a),r)){e.clearIncompatible(e.mapping.slice(i).map(a,1),r);let c=e.mapping.slice(i),u=c.map(a,1),f=c.map(a+s.nodeSize,1);return e.step(new $n(u,f,u+1,f-1,new ye(se.from(r.create(o,null,s.marks)),0,0),1,!0)),!1}})}function O_e(e,t,n){let r=e.resolve(t),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}function C_e(e,t,n,r,o){let i=e.doc.nodeAt(t);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return e.replaceWith(t,t+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new $n(t,t+i.nodeSize,t+1,t+i.nodeSize-1,new ye(se.from(s),0,0),1,!0))}function Qc(e,t,n=1,r){let o=e.resolve(t),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let u=o.depth-1,f=n-2;u>i;u--,f--){let h=o.node(u),m=o.index(u);if(h.type.spec.isolating)return!1;let v=h.content.cutByIndex(m,h.childCount),y=r&&r[f+1];y&&(v=v.replaceChild(0,y.type.create(y.attrs)));let w=r&&r[f]||h;if(!h.canReplace(m+1,h.childCount)||!w.type.validContent(v))return!1}let a=o.indexAfter(i),c=r&&r[0];return o.node(i).canReplaceWith(a,a,c?c.type:o.node(i+1).type)}function k_e(e,t,n=1,r){let o=e.doc.resolve(t),i=se.empty,s=se.empty;for(let a=o.depth,c=o.depth-n,u=n-1;a>c;a--,u--){i=se.from(o.node(a).copy(i));let f=r&&r[u];s=se.from(f?f.type.create(f.attrs,s):o.node(a).copy(s))}e.step(new Bn(t,t,new ye(i.append(s),n,n),!0))}function Aa(e,t){let n=e.resolve(t),r=n.index();return eB(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function eB(e,t){return!!(e&&t&&!e.isLeaf&&e.canAppend(t))}function r1(e,t,n=-1){let r=e.resolve(t);for(let o=r.depth;;o--){let i,s,a=r.index(o);if(o==r.depth?(i=r.nodeBefore,s=r.nodeAfter):n>0?(i=r.node(o+1),a++,s=r.node(o).maybeChild(a)):(i=r.node(o).maybeChild(a-1),s=r.node(o+1)),i&&!i.isTextblock&&eB(i,s)&&r.node(o).canReplace(a,a+1))return t;if(o==0)break;t=n<0?r.before(o):r.after(o)}}function E_e(e,t,n){let r=new Bn(t-n,t+n,ye.empty,!0);e.step(r)}function $_e(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let o=r.depth-1;o>=0;o--){let i=r.index(o);if(r.node(o).canReplaceWith(i,i,n))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let i=r.indexAfter(o);if(r.node(o).canReplaceWith(i,i,n))return r.after(o+1);if(i=0;s--){let a=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,c=r.index(s)+(a>0?1:0),u=r.node(s),f=!1;if(i==1)f=u.canReplace(c,c,o);else{let h=u.contentMatchAt(c).findWrapping(o.firstChild.type);f=h&&u.canReplaceWith(c,c,h[0])}if(f)return a==0?r.pos:a<0?r.before(s+1):r.after(s+1)}return null}function _O(e,t,n=t,r=ye.empty){if(t==n&&!r.size)return null;let o=e.resolve(t),i=e.resolve(n);return nB(o,i,r)?new Bn(t,n,r):new M_e(o,i,r).fit()}function nB(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class M_e{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=se.empty;for(let o=0;o<=t.depth;o++){let i=t.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(t.indexAfter(o))})}for(let o=t.depth;o>0;o--)this.placed=se.from(t.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(t<0?this.$to:r.doc.resolve(t));if(!o)return null;let i=this.placed,s=r.depth,a=o.depth;for(;s&&a&&i.childCount==1;)i=i.firstChild.content,s--,a--;let c=new ye(i,s,a);return t>-1?new $n(r.pos,t,this.$to.pos,this.$to.end(),c,n):c.size||r.pos!=this.$to.pos?new Bn(r.pos,o.pos,c):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,o=this.unplaced.openEnd;r1&&(o=0),i.type.spec.isolating&&o<=r){t=r;break}n=i.content}for(let n=1;n<=2;n++)for(let r=n==1?t:this.unplaced.openStart;r>=0;r--){let o,i=null;r?(i=dw(this.unplaced.content,r-1).firstChild,o=i.content):o=this.unplaced.content;let s=o.firstChild;for(let a=this.depth;a>=0;a--){let{type:c,match:u}=this.frontier[a],f,h=null;if(n==1&&(s?u.matchType(s.type)||(h=u.fillBefore(se.from(s),!1)):i&&c.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:a,parent:i,inject:h};if(n==2&&s&&(f=u.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:i,wrap:f};if(i&&u.matchType(i.type))break}}}openMore(){let{content:t,openStart:n,openEnd:r}=this.unplaced,o=dw(t,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new ye(t,n+1,Math.max(r,o.size+n>=t.size-r?n+1:0)),!0)}dropNode(){let{content:t,openStart:n,openEnd:r}=this.unplaced,o=dw(t,n);if(o.childCount<=1&&n>0){let i=t.size-n<=n+o.size;this.unplaced=new ye(xd(t,n-1,1),n-1,i?n-1:r)}else this.unplaced=new ye(xd(t,n,1),n,r)}placeNodes({sliceDepth:t,frontierDepth:n,parent:r,inject:o,wrap:i}){for(;this.depth>n;)this.closeFrontierNode();if(i)for(let w=0;w1||c==0||w.content.size)&&(h=P,f.push(rB(w.mark(m.allowedMarks(w.marks)),u==1?c:0,u==a.childCount?v:-1)))}let y=u==a.childCount;y||(v=-1),this.placed=Sd(this.placed,n,se.from(f)),this.frontier[n].match=h,y&&v<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let w=0,P=a;w1&&o==this.$to.end(--r);)++o;return o}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:r,type:o}=this.frontier[n],i=n=0;a--){let{match:c,type:u}=this.frontier[a],f=fw(t,a,u,c,!0);if(!f||f.childCount)continue e}return{depth:n,fit:s,move:i?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Sd(this.placed,n.depth,n.fit)),t=n.move;for(let r=n.depth+1;r<=t.depth;r++){let o=t.node(r),i=o.type.contentMatch.fillBefore(o.content,!0,t.index(r));this.openFrontierNode(o.type,o.attrs,i)}return t}openFrontierNode(t,n=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(t),this.placed=Sd(this.placed,this.depth,se.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(se.empty,!0);n.childCount&&(this.placed=Sd(this.placed,this.frontier.length,n))}}function xd(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(xd(e.firstChild.content,t-1,n)))}function Sd(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Sd(e.lastChild.content,t-1,n)))}function dw(e,t){for(let n=0;n1&&(r=r.replaceChild(0,rB(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(se.empty,!0)))),e.copy(r)}function fw(e,t,n,r,o){let i=e.node(t),s=o?e.indexAfter(t):e.index(t);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,s);return a&&!N_e(n,i.content,s)?a:null}function N_e(e,t,n){for(let r=n;r0;m--,v--){let y=o.node(m).type.spec;if(y.defining||y.definingAsContext||y.isolating)break;s.indexOf(m)>-1?a=m:o.before(m)==v&&s.splice(1,0,-m)}let c=s.indexOf(a),u=[],f=r.openStart;for(let m=r.content,v=0;;v++){let y=m.firstChild;if(u.push(y),v==r.openStart)break;m=y.content}for(let m=f-1;m>=0;m--){let v=u[m],y=T_e(v.type);if(y&&!v.sameMarkup(o.node(Math.abs(a)-1)))f=m;else if(y||!v.type.isTextblock)break}for(let m=r.openStart;m>=0;m--){let v=(m+f+1)%(r.openStart+1),y=u[v];if(y)for(let w=0;w=0&&(e.replace(t,n,r),!(e.steps.length>h));m--){let v=s[m];v<0||(t=o.before(v),n=i.after(v))}}function oB(e,t,n,r,o){if(tr){let i=o.contentMatchAt(0),s=i.fillBefore(e).append(e);e=s.append(i.matchFragment(s).fillBefore(se.empty,!0))}return e}function j_e(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let o=$_e(e.doc,t,r.type);o!=null&&(t=n=o)}e.replaceRange(t,n,new ye(se.from(r),0,0))}function D_e(e,t,n){let r=e.doc.resolve(t),o=e.doc.resolve(n),i=iB(r,o);for(let s=0;s0&&(c||r.node(a-1).canReplace(r.index(a-1),o.indexAfter(a-1))))return e.delete(r.before(a),o.after(a))}for(let s=1;s<=r.depth&&s<=o.depth;s++)if(t-r.start(s)==r.depth-s&&n>r.end(s)&&o.end(s)-n!=o.depth-s)return e.delete(r.before(s),n);e.delete(t,n)}function iB(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let o=r;o>=0;o--){let i=e.start(o);if(it.pos+(t.depth-o)||e.node(o).type.spec.isolating||t.node(o).type.spec.isolating)break;(i==t.start(o)||o==e.depth&&o==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&o&&t.start(o-1)==i-1)&&n.push(o)}return n}class Xc extends lr{constructor(t,n,r){super(),this.pos=t,this.attr=n,this.value=r}apply(t){let n=t.nodeAt(this.pos);if(!n)return dn.fail("No node at attribute step's position");let r=Object.create(null);for(let i in n.attrs)r[i]=n.attrs[i];r[this.attr]=this.value;let o=n.type.create(r,null,n.marks);return dn.fromReplace(t,this.pos,this.pos+1,new ye(se.from(o),0,n.isLeaf?0:1))}getMap(){return ho.empty}invert(t){return new Xc(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Xc(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Xc(n.pos,n.attr,n.value)}}lr.jsonID("attr",Xc);class Pf extends lr{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let o in t.attrs)n[o]=t.attrs[o];n[this.attr]=this.value;let r=t.type.create(n,t.content,t.marks);return dn.ok(r)}getMap(){return ho.empty}invert(t){return new Pf(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Pf(n.attr,n.value)}}lr.jsonID("docAttr",Pf);let _u=class extends Error{};_u=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};_u.prototype=Object.create(Error.prototype);_u.prototype.constructor=_u;_u.prototype.name="TransformError";class sB{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new Jc}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new _u(n.failed);return this}maybeStep(t){let n=t.apply(this.doc);return n.failed||this.addStep(t,n.doc),n}get docChanged(){return this.steps.length>0}addStep(t,n){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=n}replace(t,n=t,r=ye.empty){let o=_O(this.doc,t,n,r);return o&&this.step(o),this}replaceWith(t,n,r){return this.replace(t,n,new ye(se.from(r),0,0))}delete(t,n){return this.replace(t,n,ye.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,r){return I_e(this,t,n,r),this}replaceRangeWith(t,n,r){return j_e(this,t,n,r),this}deleteRange(t,n){return D_e(this,t,n),this}lift(t,n){return w_e(this,t,n),this}join(t,n=1){return E_e(this,t,n),this}wrap(t,n){return S_e(this,t,n),this}setBlockType(t,n=t,r,o=null){return P_e(this,t,n,r,o),this}setNodeMarkup(t,n,r=null,o){return C_e(this,t,n,r,o),this}setNodeAttribute(t,n,r){return this.step(new Xc(t,n,r)),this}setDocAttribute(t,n){return this.step(new Pf(t,n)),this}addNodeMark(t,n){return this.step(new ia(t,n)),this}removeNodeMark(t,n){if(!(n instanceof wt)){let r=this.doc.nodeAt(t);if(!r)throw new RangeError("No node at position "+t);if(n=n.isInSet(r.marks),!n)return this}return this.step(new yu(t,n)),this}split(t,n=1,r){return k_e(this,t,n,r),this}addMark(t,n,r){return g_e(this,t,n,r),this}removeMark(t,n,r){return v_e(this,t,n,r),this}clearIncompatible(t,n,r){return y_e(this,t,n,r),this}}const hw=Object.create(null);class Ze{constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new R_e(t.min(n),t.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let n=0;n=0;i--){let s=n<0?yc(t.node(0),t.node(i),t.before(i+1),t.index(i),n,r):yc(t.node(0),t.node(i),t.after(i+1),t.index(i)+1,n,r);if(s)return s}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new ri(t.node(0))}static atStart(t){return yc(t,t,0,0,1)||new ri(t)}static atEnd(t){return yc(t,t,t.content.size,t.childCount,-1)||new ri(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=hw[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in hw)throw new RangeError("Duplicate use of selection JSON ID "+t);return hw[t]=n,n.prototype.jsonID=t,n}getBookmark(){return Ve.between(this.$anchor,this.$head).getBookmark()}}Ze.prototype.visible=!0;class R_e{constructor(t,n){this.$from=t,this.$to=n}}let eI=!1;function tI(e){!eI&&!e.parent.inlineContent&&(eI=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class Ve extends Ze{constructor(t,n=t){tI(t),tI(n),super(t,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return Ze.near(r);let o=t.resolve(n.map(this.anchor));return new Ve(o.parent.inlineContent?o:r,r)}replace(t,n=ye.empty){if(super.replace(t,n),n==ye.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof Ve&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new o1(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Ve(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){let o=t.resolve(n);return new this(o,r==n?o:t.resolve(r))}static between(t,n,r){let o=t.pos-n.pos;if((!r||o)&&(r=o>=0?1:-1),!n.parent.inlineContent){let i=Ze.findFrom(n,r,!0)||Ze.findFrom(n,-r,!0);if(i)n=i.$head;else return Ze.near(n,r)}return t.parent.inlineContent||(o==0?t=n:(t=(Ze.findFrom(t,-r,!0)||Ze.findFrom(t,r,!0)).$anchor,t.pos0?0:1);o>0?s=0;s+=o){let a=t.child(s);if(a.isAtom){if(!i&&De.isSelectable(a))return De.create(e,n-(o<0?a.nodeSize:0))}else{let c=yc(e,a,n+o,o<0?a.childCount:0,o,i);if(c)return c}n+=a.nodeSize*o}return null}function nI(e,t,n){let r=e.steps.length-1;if(r{s==null&&(s=f)}),e.setSelection(Ze.near(e.doc.resolve(s),n))}const rI=1,vp=2,oI=4;class z_e extends sB{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(t){return this.storedMarks=t,this.updated|=vp,this}ensureMarks(t){return wt.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&vp)>0}addStep(t,n){super.addStep(t,n),this.updated=this.updated&~vp,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,n=!0){let r=this.selection;return n&&(t=t.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||wt.none))),r.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,n,r){let o=this.doc.type.schema;if(n==null)return t?this.replaceSelectionWith(o.text(t),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!t)return this.deleteRange(n,r);let i=this.storedMarks;if(!i){let s=this.doc.resolve(n);i=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,o.text(t,i)),this.selection.empty||this.setSelection(Ze.near(this.selection.$to)),this}}setMeta(t,n){return this.meta[typeof t=="string"?t:t.key]=n,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=oI,this}get scrolledIntoView(){return(this.updated&oI)>0}}function iI(e,t){return!t||!e?e:e.bind(t)}class Pd{constructor(t,n,r){this.name=t,this.init=iI(n.init,r),this.apply=iI(n.apply,r)}}const A_e=[new Pd("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Pd("selection",{init(e,t){return e.selection||Ze.atStart(t.doc)},apply(e){return e.selection}}),new Pd("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new Pd("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class pw{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=A_e.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Pd(r.key,r.spec.state,r))})}}class jc{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,n=-1){for(let r=0;rr.toJSON())),t&&typeof t=="object")for(let r in t){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=t[r],i=o.spec.state;i&&i.toJSON&&(n[r]=i.toJSON.call(o,this[o.key]))}return n}static fromJSON(t,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let o=new pw(t.schema,t.plugins),i=new jc(o);return o.fields.forEach(s=>{if(s.name=="doc")i.doc=Cl.fromJSON(t.schema,n.doc);else if(s.name=="selection")i.selection=Ze.fromJSON(i.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(i.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let a in r){let c=r[a],u=c.spec.state;if(c.key==s.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){i[s.name]=u.fromJSON.call(c,t,n[a],i);return}}i[s.name]=s.init(t,i)}}),i}}function aB(e,t,n){for(let r in e){let o=e[r];o instanceof Function?o=o.bind(t):r=="handleDOMEvents"&&(o=aB(o,t,{})),n[r]=o}return n}class Kr{constructor(t){this.spec=t,this.props={},t.props&&aB(t.props,this,this.props),this.key=t.key?t.key.key:lB("plugin")}getState(t){return t[this.key]}}const mw=Object.create(null);function lB(e){return e in mw?e+"$"+ ++mw[e]:(mw[e]=0,e+"$")}class Fi{constructor(t="key"){this.key=lB(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const gr=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},Of=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t};let sI=null;const rs=function(e,t,n){let r=sI||(sI=document.createRange());return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},Ll=function(e,t,n,r){return n&&(aI(e,t,n,r,-1)||aI(e,t,n,r,1))},B_e=/^(img|br|input|textarea|hr)$/i;function aI(e,t,n,r,o){for(;;){if(e==n&&t==r)return!0;if(t==(o<0?0:Mi(e))){let i=e.parentNode;if(!i||i.nodeType!=1||bO(e)||B_e.test(e.nodeName)||e.contentEditable=="false")return!1;t=gr(e)+(o<0?0:1),e=i}else if(e.nodeType==1){if(e=e.childNodes[t+(o<0?-1:0)],e.contentEditable=="false")return!1;t=o<0?Mi(e):0}else return!1}}function Mi(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function F_e(e,t,n){for(let r=t==0,o=t==Mi(e);r||o;){if(e==n)return!0;let i=gr(e);if(e=e.parentNode,!e)return!1;r=r&&i==0,o=o&&i==Mi(e)}}function bO(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const i1=function(e){return e.focusNode&&Ll(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function il(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function V_e(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function H_e(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:r.offset}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:r.startOffset}}}const zi=typeof navigator<"u"?navigator:null,lI=typeof document<"u"?document:null,Ba=zi&&zi.userAgent||"",Ex=/Edge\/(\d+)/.exec(Ba),cB=/MSIE \d/.exec(Ba),$x=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ba),Wr=!!(cB||$x||Ex),ba=cB?document.documentMode:$x?+$x[1]:Ex?+Ex[1]:0,li=!Wr&&/gecko\/(\d+)/i.test(Ba);li&&+(/Firefox\/(\d+)/.exec(Ba)||[0,0])[1];const Mx=!Wr&&/Chrome\/(\d+)/.exec(Ba),or=!!Mx,W_e=Mx?+Mx[1]:0,wr=!Wr&&!!zi&&/Apple Computer/.test(zi.vendor),wu=wr&&(/Mobile\/\w+/.test(Ba)||!!zi&&zi.maxTouchPoints>2),To=wu||(zi?/Mac/.test(zi.platform):!1),U_e=zi?/Win/.test(zi.platform):!1,Xo=/Android \d/.test(Ba),oh=!!lI&&"webkitFontSmoothing"in lI.documentElement.style,Z_e=oh?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function G_e(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Qi(e,t){return typeof e=="number"?e:e[t]}function Y_e(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function cI(e,t,n){let r=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument;for(let s=n||e.dom;s;s=Of(s)){if(s.nodeType!=1)continue;let a=s,c=a==i.body,u=c?G_e(i):Y_e(a),f=0,h=0;if(t.topu.bottom-Qi(r,"bottom")&&(h=t.bottom-t.top>u.bottom-u.top?t.top+Qi(o,"top")-u.top:t.bottom-u.bottom+Qi(o,"bottom")),t.leftu.right-Qi(r,"right")&&(f=t.right-u.right+Qi(o,"right")),f||h)if(c)i.defaultView.scrollBy(f,h);else{let m=a.scrollLeft,v=a.scrollTop;h&&(a.scrollTop+=h),f&&(a.scrollLeft+=f);let y=a.scrollLeft-m,w=a.scrollTop-v;t={left:t.left-y,top:t.top-w,right:t.right-y,bottom:t.bottom-w}}if(c||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function K_e(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,o;for(let i=(t.left+t.right)/2,s=n+1;s=n-20){r=a,o=c.top;break}}return{refDOM:r,refTop:o,stack:uB(e.dom)}}function uB(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=Of(r));return t}function q_e({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;dB(n,r==0?0:r-t)}function dB(e,t){for(let n=0;n=a){s=Math.max(y.bottom,s),a=Math.min(y.top,a);let w=y.left>t.left?y.left-t.left:y.right=(y.left+y.right)/2?1:0));continue}}else y.top>t.top&&!c&&y.left<=t.left&&y.right>=t.left&&(c=f,u={left:Math.max(y.left,Math.min(y.right,t.left)),top:y.top});!n&&(t.left>=y.right&&t.top>=y.top||t.left>=y.left&&t.top>=y.bottom)&&(i=h+1)}}return!n&&c&&(n=c,o=u,r=0),n&&n.nodeType==3?Q_e(n,o):!n||r&&n.nodeType==1?{node:e,offset:i}:fB(n,o)}function Q_e(e,t){let n=e.nodeValue.length,r=document.createRange();for(let o=0;o=(i.left+i.right)/2?1:0)}}return{node:e,offset:0}}function xO(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function X_e(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left(s.left+s.right)/2?1:-1}return e.docView.posFromDOM(r,o,i)}function twe(e,t,n,r){let o=-1;for(let i=t,s=!1;i!=e.dom;){let a=e.docView.nearestDesc(i,!0);if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent&&!s||!a.contentDOM)){let c=a.dom.getBoundingClientRect();if(a.node.isBlock&&a.parent&&!s&&(s=!0,c.left>r.left||c.top>r.top?o=a.posBefore:(c.right-1?o:e.docView.posFromDOM(t,n,-1)}function hB(e,t,n){let r=e.childNodes.length;if(r&&n.topt.top&&o++}let u;oh&&o&&r.nodeType==1&&(u=r.childNodes[o-1]).nodeType==1&&u.contentEditable=="false"&&u.getBoundingClientRect().top>=t.top&&o--,r==e.dom&&o==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?a=e.state.doc.content.size:(o==0||r.nodeType!=1||r.childNodes[o-1].nodeName!="BR")&&(a=twe(e,r,o,t))}a==null&&(a=ewe(e,s,t));let c=e.docView.nearestDesc(s,!0);return{pos:a,inside:c?c.posAtStart-c.border:-1}}function uI(e){return e.top=0&&o==r.nodeValue.length?(c--,f=1):n<0?c--:u++,md(Hs(rs(r,c,u),f),f<0)}if(!e.state.doc.resolve(t-(i||0)).parent.inlineContent){if(i==null&&o&&(n<0||o==Mi(r))){let c=r.childNodes[o-1];if(c.nodeType==1)return gw(c.getBoundingClientRect(),!1)}if(i==null&&o=0)}if(i==null&&o&&(n<0||o==Mi(r))){let c=r.childNodes[o-1],u=c.nodeType==3?rs(c,Mi(c)-(s?0:1)):c.nodeType==1&&(c.nodeName!="BR"||!c.nextSibling)?c:null;if(u)return md(Hs(u,1),!1)}if(i==null&&o=0)}function md(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function gw(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function mB(e,t,n){let r=e.state,o=e.root.activeElement;r!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),o!=e.dom&&o&&o.focus()}}function owe(e,t,n){let r=t.selection,o=n=="up"?r.$from:r.$to;return mB(e,t,()=>{let{node:i}=e.docView.domFromPos(o.pos,n=="up"?-1:1);for(;;){let a=e.docView.nearestDesc(i,!0);if(!a)break;if(a.node.isBlock){i=a.contentDOM||a.dom;break}i=a.dom.parentNode}let s=pB(e,o.pos,1);for(let a=i.firstChild;a;a=a.nextSibling){let c;if(a.nodeType==1)c=a.getClientRects();else if(a.nodeType==3)c=rs(a,0,a.nodeValue.length).getClientRects();else continue;for(let u=0;uf.top+1&&(n=="up"?s.top-f.top>(f.bottom-s.top)*2:f.bottom-s.bottom>(s.bottom-f.top)*2))return!1}}return!0})}const iwe=/[\u0590-\u08ac]/;function swe(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,s=o==r.parent.content.size,a=e.domSelection();return!iwe.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?i:s:mB(e,t,()=>{let{focusNode:c,focusOffset:u,anchorNode:f,anchorOffset:h}=e.domSelectionRange(),m=a.caretBidiLevel;a.modify("move",n,"character");let v=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:y,focusOffset:w}=e.domSelectionRange(),P=y&&!v.contains(y.nodeType==1?y:y.parentNode)||c==y&&u==w;try{a.collapse(f,h),c&&(c!=f||u!=h)&&a.extend&&a.extend(c,u)}catch{}return m!=null&&(a.caretBidiLevel=m),P})}let dI=null,fI=null,hI=!1;function awe(e,t,n){return dI==t&&fI==n?hI:(dI=t,fI=n,hI=n=="up"||n=="down"?owe(e,t,n):swe(e,t,n))}const Ao=0,pI=1,ml=2,Ai=3;class ih{constructor(t,n,r,o){this.parent=t,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=Ao,r.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,n,r){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let n=0;ngr(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=t.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let i=t;;i=i.parentNode){if(i==this.dom){o=!1;break}if(i.previousSibling)break}if(o==null&&n==t.childNodes.length)for(let i=t;;i=i.parentNode){if(i==this.dom){o=!0;break}if(i.nextSibling)break}}return o??r>0?this.posAtEnd:this.posAtStart}nearestDesc(t,n=!1){for(let r=!0,o=t;o;o=o.parentNode){let i=this.getDesc(o),s;if(i&&(!n||i.node))if(r&&(s=i.nodeDOM)&&!(s.nodeType==1?s.contains(t.nodeType==1?t:t.parentNode):s==t))r=!1;else return i}}getDesc(t){let n=t.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(t,n,r){for(let o=t;o;o=o.parentNode){let i=this.getDesc(o);if(i)return i.localPosFromDOM(t,n,r)}return-1}descAt(t){for(let n=0,r=0;nt||s instanceof vB){o=t-i;break}i=a}if(o)return this.children[r].domFromPos(o-this.children[r].border,n);for(let i;r&&!(i=this.children[r-1]).size&&i instanceof gB&&i.side>=0;r--);if(n<=0){let i,s=!0;for(;i=r?this.children[r-1]:null,!(!i||i.dom.parentNode==this.contentDOM);r--,s=!1);return i&&n&&s&&!i.border&&!i.domAtom?i.domFromPos(i.size,n):{node:this.contentDOM,offset:i?gr(i.dom)+1:0}}else{let i,s=!0;for(;i=r=f&&n<=u-c.border&&c.node&&c.contentDOM&&this.contentDOM.contains(c.contentDOM))return c.parseRange(t,n,f);t=s;for(let h=a;h>0;h--){let m=this.children[h-1];if(m.size&&m.dom.parentNode==this.contentDOM&&!m.emptyChildAt(1)){o=gr(m.dom)+1;break}t-=m.size}o==-1&&(o=0)}if(o>-1&&(u>n||a==this.children.length-1)){n=u;for(let f=a+1;fv&&sn){let v=a;a=c,c=v}let m=document.createRange();m.setEnd(c.node,c.offset),m.setStart(a.node,a.offset),u.removeAllRanges(),u.addRange(m)}}ignoreMutation(t){return!this.contentDOM&&t.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,n){for(let r=0,o=0;o=r:tr){let a=r+i.border,c=s-i.border;if(t>=a&&n<=c){this.dirty=t==r||n==s?ml:pI,t==a&&n==c&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=Ai:i.markDirty(t-a,n-a);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?ml:Ai}r=s}this.dirty=ml}markParentsDirty(){let t=1;for(let n=this.parent;n;n=n.parent,t++){let r=t==1?ml:pI;n.dirty{if(!i)return o;if(i.parent)return i.parent.posBeforeChild(i)})),!n.type.spec.raw){if(s.nodeType!=1){let a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(t,[],s,null),this.widget=n,this.widget=n,i=this}matchesWidget(t){return this.dirty==Ao&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let n=this.widget.spec.stopEvent;return n?n(t):!1}ignoreMutation(t){return t.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class lwe extends ih{constructor(t,n,r,o){super(t,[],n,null),this.textDOM=r,this.text=o}get size(){return this.text.length}localPosFromDOM(t,n){return t!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return t.type==="characterData"&&t.target.nodeValue==t.oldValue}}class zl extends ih{constructor(t,n,r,o){super(t,[],r,o),this.mark=n}static create(t,n,r,o){let i=o.nodeViews[n.type.name],s=i&&i(n,o,r);return(!s||!s.dom)&&(s=Ti.renderSpec(document,n.type.spec.toDOM(n,r))),new zl(t,n,s.dom,s.contentDOM||s.dom)}parseRule(){return this.dirty&Ai||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return this.dirty!=Ai&&this.mark.eq(t)}markDirty(t,n){if(super.markDirty(t,n),this.dirty!=Ao){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty0&&(i=Ix(i,0,t,r));for(let a=0;a{if(!c)return s;if(c.parent)return c.parent.posBeforeChild(c)},r,o),f=u&&u.dom,h=u&&u.contentDOM;if(n.isText){if(!f)f=document.createTextNode(n.text);else if(f.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else f||({dom:f,contentDOM:h}=Ti.renderSpec(document,n.type.spec.toDOM(n)));!h&&!n.isText&&f.nodeName!="BR"&&(f.hasAttribute("contenteditable")||(f.contentEditable="false"),n.type.spec.draggable&&(f.draggable=!0));let m=f;return f=wB(f,r,n),u?c=new cwe(t,n,r,o,f,h||null,m,u,i,s+1):n.isText?new s1(t,n,r,o,f,m,i):new xa(t,n,r,o,f,h||null,m,i,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(t.preserveWhitespace="full"),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){t.contentElement=r.dom.parentNode;break}}t.contentElement||(t.getContent=()=>se.empty)}return t}matchesNode(t,n,r){return this.dirty==Ao&&t.eq(this.node)&&Tx(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,n){let r=this.node.inlineContent,o=n,i=t.composing?this.localCompositionInfo(t,n):null,s=i&&i.pos>-1?i:null,a=i&&i.pos<0,c=new dwe(this,s&&s.node,t);pwe(this.node,this.innerDeco,(u,f,h)=>{u.spec.marks?c.syncToMarks(u.spec.marks,r,t):u.type.side>=0&&!h&&c.syncToMarks(f==this.node.childCount?wt.none:this.node.child(f).marks,r,t),c.placeWidget(u,t,o)},(u,f,h,m)=>{c.syncToMarks(u.marks,r,t);let v;c.findNodeMatch(u,f,h,m)||a&&t.state.selection.from>o&&t.state.selection.to-1&&c.updateNodeAt(u,f,h,v,t)||c.updateNextNode(u,f,h,t,m,o)||c.addNode(u,f,h,t,o),o+=u.nodeSize}),c.syncToMarks([],r,t),this.node.isTextblock&&c.addTextblockHacks(),c.destroyRest(),(c.changed||this.dirty==ml)&&(s&&this.protectLocalComposition(t,s),yB(this.contentDOM,this.children,t),wu&&mwe(this.dom))}localCompositionInfo(t,n){let{from:r,to:o}=t.state.selection;if(!(t.state.selection instanceof Ve)||rn+this.node.content.size)return null;let i=t.domSelectionRange(),s=gwe(i.focusNode,i.focusOffset);if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let a=s.nodeValue,c=vwe(this.node.content,a,r-n,o-n);return c<0?null:{node:s,pos:c,text:a}}else return{node:s,pos:-1,text:""}}protectLocalComposition(t,{node:n,pos:r,text:o}){if(this.getDesc(n))return;let i=n;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let s=new lwe(this,i,n,o);t.input.compositionNodes.push(s),this.children=Ix(this.children,r,r+o.length,t,s)}update(t,n,r,o){return this.dirty==Ai||!t.sameMarkup(this.node)?!1:(this.updateInner(t,n,r,o),!0)}updateInner(t,n,r,o){this.updateOuterDeco(n),this.node=t,this.innerDeco=r,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=Ao}updateOuterDeco(t){if(Tx(t,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=_B(this.dom,this.nodeDOM,Nx(this.outerDeco,this.node,n),Nx(t,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function mI(e,t,n,r,o){wB(r,t,e);let i=new xa(void 0,e,t,n,r,r,r,o,0);return i.contentDOM&&i.updateChildren(o,0),i}class s1 extends xa{constructor(t,n,r,o,i,s,a){super(t,n,r,o,i,null,s,a,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,n,r,o){return this.dirty==Ai||this.dirty!=Ao&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Ao||t.text!=this.node.text)&&t.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=t.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=t,this.dirty=Ao,!0)}inParent(){let t=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,n,r){return t==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(t,n,r)}ignoreMutation(t){return t.type!="characterData"&&t.type!="selection"}slice(t,n,r){let o=this.node.cut(t,n),i=document.createTextNode(o.text);return new s1(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)}markDirty(t,n){super.markDirty(t,n),this.dom!=this.nodeDOM&&(t==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Ai)}get domAtom(){return!1}}class vB extends ih{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==Ao&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class cwe extends xa{constructor(t,n,r,o,i,s,a,c,u,f){super(t,n,r,o,i,s,a,u,f),this.spec=c}update(t,n,r,o){if(this.dirty==Ai)return!1;if(this.spec.update){let i=this.spec.update(t,n,r);return i&&this.updateInner(t,n,r,o),i}else return!this.contentDOM&&!t.isLeaf?!1:super.update(t,n,r,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,n,r,o){this.spec.setSelection?this.spec.setSelection(t,n,r):super.setSelection(t,n,r,o)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return this.spec.stopEvent?this.spec.stopEvent(t):!1}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function yB(e,t,n){let r=e.firstChild,o=!1;for(let i=0;i>1,s=Math.min(i,t.length);for(;o-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let c=zl.create(this.top,t[i],n,r);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,i++}}findNodeMatch(t,n,r,o){let i=-1,s;if(o>=this.preMatch.index&&(s=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&s.matchesNode(t,n,r))i=this.top.children.indexOf(s,this.index);else for(let a=this.index,c=Math.min(this.top.children.length,a+5);a0;){let a;for(;;)if(r){let u=n.children[r-1];if(u instanceof zl)n=u,r=u.children.length;else{a=u,r--;break}}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let c=a.node;if(c){if(c!=e.child(o-1))break;--o,i.set(a,o),s.push(a)}}return{index:o,matched:i,matches:s.reverse()}}function hwe(e,t){return e.type.side-t.type.side}function pwe(e,t,n,r){let o=t.locals(e),i=0;if(o.length==0){for(let u=0;ui;)a.push(o[s++]);let y=i+m.nodeSize;if(m.isText){let P=y;s!P.inline):a.slice();r(m,w,t.forChild(i,m),v),i=y}}function mwe(e){if(e.nodeName=="UL"||e.nodeName=="OL"){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}function gwe(e,t){for(;;){if(e.nodeType==3)return e;if(e.nodeType==1&&t>0){if(e.childNodes.length>t&&e.childNodes[t].nodeType==3)return e.childNodes[t];e=e.childNodes[t-1],t=Mi(e)}else if(e.nodeType==1&&t=n){if(i>=r&&c.slice(r-t.length-a,r-a)==t)return r-t.length;let u=a=0&&u+t.length+a>=n)return a+u;if(n==r&&c.length>=r+t.length-a&&c.slice(r-a,r-a+t.length)==t)return r}}return-1}function Ix(e,t,n,r,o){let i=[];for(let s=0,a=0;s=n||f<=t?i.push(c):(un&&i.push(c.slice(n-u,c.size,r)))}return i}function SO(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let o=e.docView.nearestDesc(n.focusNode),i=o&&o.size==0,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a=r.resolve(s),c,u;if(i1(n)){for(c=a;o&&!o.node;)o=o.parent;let f=o.node;if(o&&f.isAtom&&De.isSelectable(f)&&o.parent&&!(f.isInline&&F_e(n.focusNode,n.focusOffset,o.dom))){let h=o.posBefore;u=new De(s==h?a:r.resolve(h))}}else{let f=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(f<0)return null;c=r.resolve(f)}if(!u){let f=t=="pointer"||e.state.selection.head{(n.anchorNode!=r||n.anchorOffset!=o)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!bB(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function _we(e){let t=e.domSelection(),n=document.createRange(),r=e.cursorWrapper.dom,o=r.nodeName=="IMG";o?n.setEnd(r.parentNode,gr(r)+1):n.setEnd(r,0),n.collapse(!1),t.removeAllRanges(),t.addRange(n),!o&&!e.state.selection.visible&&Wr&&ba<=11&&(r.disabled=!0,r.disabled=!1)}function xB(e,t){if(t instanceof De){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(wI(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else wI(e)}function wI(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function PO(e,t,n,r){return e.someProp("createSelectionBetween",o=>o(e,t,n))||Ve.between(t,n,r)}function bI(e){return e.editable&&!e.hasFocus()?!1:SB(e)}function SB(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function wwe(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return Ll(t.node,t.offset,n.anchorNode,n.anchorOffset)}function jx(e,t){let{$anchor:n,$head:r}=e.selection,o=t>0?n.max(r):n.min(r),i=o.parent.inlineContent?o.depth?e.doc.resolve(t>0?o.after():o.before()):null:o;return i&&Ze.findFrom(i,t)}function sl(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function xI(e,t,n){let r=e.state.selection;if(r instanceof Ve){if(!r.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"forward":"backward")){let o=jx(e.state,t);return o&&o instanceof De?sl(e,o):!1}else if(!(To&&n.indexOf("m")>-1)){let o=r.$head,i=o.textOffset?null:t<0?o.nodeBefore:o.nodeAfter,s;if(!i||i.isText)return!1;let a=t<0?o.pos-i.nodeSize:o.pos;return i.isAtom||(s=e.docView.descAt(a))&&!s.contentDOM?De.isSelectable(i)?sl(e,new De(t<0?e.state.doc.resolve(o.pos-i.nodeSize):o)):oh?sl(e,new Ve(e.state.doc.resolve(t<0?a:a+i.nodeSize))):!1:!1}}else{if(r instanceof De&&r.node.isInline)return sl(e,new Ve(t>0?r.$to:r.$from));{let o=jx(e.state,t);return o?sl(e,o):!1}}}function Jv(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Wd(e,t){if(e.contentEditable=="false")return!0;let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!="BR")}function mc(e,t){return t<0?bwe(e):xwe(e)}function bwe(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o,i,s=!1;for(li&&n.nodeType==1&&r0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(Wd(a,-1))o=n,i=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(PB(n))break;{let a=n.previousSibling;for(;a&&Wd(a,-1);)o=n.parentNode,i=gr(a),a=a.previousSibling;if(a)n=a,r=Jv(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}s?Dx(e,n,r):o&&Dx(e,o,i)}function xwe(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o=Jv(n),i,s;for(;;)if(r{e.state==o&&ps(e)},50)}function SI(e,t){let n=e.state.doc.resolve(t);if(!(or||U_e)&&n.parent.inlineContent){let o=e.coordsAtPos(t);if(t>n.start()){let i=e.coordsAtPos(t-1),s=(i.top+i.bottom)/2;if(s>o.top&&s1)return i.lefto.top&&s1)return i.left>o.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function PI(e,t,n){let r=e.state.selection;if(r instanceof Ve&&!r.empty||n.indexOf("s")>-1||To&&n.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let s=jx(e.state,t);if(s&&s instanceof De)return sl(e,s)}if(!o.parent.inlineContent){let s=t<0?o:i,a=r instanceof ri?Ze.near(s,t):Ze.findFrom(s,t);return a?sl(e,a):!1}return!1}function OI(e,t){if(!(e.state.selection instanceof Ve))return!0;let{$head:n,$anchor:r,empty:o}=e.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let i=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let s=e.state.tr;return t<0?s.delete(n.pos-i.nodeSize,n.pos):s.delete(n.pos,n.pos+i.nodeSize),e.dispatch(s),!0}return!1}function CI(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Owe(e){if(!wr||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let r=t.firstChild;CI(e,r,"true"),setTimeout(()=>CI(e,r,"false"),20)}return!1}function Cwe(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function kwe(e,t){let n=t.keyCode,r=Cwe(t);if(n==8||To&&n==72&&r=="c")return OI(e,-1)||mc(e,-1);if(n==46&&!t.shiftKey||To&&n==68&&r=="c")return OI(e,1)||mc(e,1);if(n==13||n==27)return!0;if(n==37||To&&n==66&&r=="c"){let o=n==37?SI(e,e.state.selection.from)=="ltr"?-1:1:-1;return xI(e,o,r)||mc(e,o)}else if(n==39||To&&n==70&&r=="c"){let o=n==39?SI(e,e.state.selection.from)=="ltr"?1:-1:1;return xI(e,o,r)||mc(e,o)}else{if(n==38||To&&n==80&&r=="c")return PI(e,-1,r)||mc(e,-1);if(n==40||To&&n==78&&r=="c")return Owe(e)||PI(e,1,r)||mc(e,1);if(r==(To?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function OB(e,t){e.someProp("transformCopied",v=>{t=v(t,e)});let n=[],{content:r,openStart:o,openEnd:i}=t;for(;o>1&&i>1&&r.childCount==1&&r.firstChild.childCount==1;){o--,i--;let v=r.firstChild;n.push(v.type.name,v.attrs!=v.type.defaultAttrs?v.attrs:null),r=v.content}let s=e.someProp("clipboardSerializer")||Ti.fromSchema(e.state.schema),a=NB(),c=a.createElement("div");c.appendChild(s.serializeFragment(r,{document:a}));let u=c.firstChild,f,h=0;for(;u&&u.nodeType==1&&(f=MB[u.nodeName.toLowerCase()]);){for(let v=f.length-1;v>=0;v--){let y=a.createElement(f[v]);for(;c.firstChild;)y.appendChild(c.firstChild);c.appendChild(y),h++}u=c.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${o} ${i}${h?` -${h}`:""} ${JSON.stringify(n)}`);let m=e.someProp("clipboardTextSerializer",v=>v(t,e))||t.content.textBetween(0,t.content.size,` `);return{dom:c,text:m}}function CB(e,t,n,r,o){let i=o.parent.type.spec.code,s,a;if(!n&&!t)return null;let c=t&&(r||i||!n);if(c){if(e.someProp("transformPastedText",m=>{t=m(t,i||r,e)}),i)return t?new ye(se.from(e.state.schema.text(t.replace(/\r\n?/g,` -`))),0,0):ye.empty;let h=e.someProp("clipboardTextParser",m=>m(t,o,r,e));if(h)a=h;else{let m=o.marks(),{schema:v}=e.state,y=Ti.fromSchema(v);s=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(w=>{let P=s.appendChild(document.createElement("p"));w&&P.appendChild(y.serializeNode(v.text(w,m)))})}}else e.someProp("transformPastedHTML",h=>{n=h(n,e)}),s=Mwe(n),oh&&Nwe(s);let u=s&&s.querySelector("[data-pm-slice]"),f=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(f&&f[3])for(let h=+f[3];h>0;h--){let m=s.firstChild;for(;m&&m.nodeType!=1;)m=m.nextSibling;if(!m)break;s=m}if(a||(a=(e.someProp("clipboardParser")||e.someProp("domParser")||vu.fromSchema(e.state.schema)).parseSlice(s,{preserveWhitespace:!!(c||f),context:o,ruleFromNode(m){return m.nodeName=="BR"&&!m.nextSibling&&m.parentNode&&!Ewe.test(m.parentNode.nodeName)?{ignore:!0}:null}})),f)a=Twe(kI(a,+f[1],+f[2]),f[4]);else if(a=ye.maxOpen($we(a.content,o),!0),a.openStart||a.openEnd){let h=0,m=0;for(let v=a.content.firstChild;h{a=h(a,e)}),a}const Ewe=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function $we(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let o=t.node(n).contentMatchAt(t.index(n)),i,s=[];if(e.forEach(a=>{if(!s)return;let c=o.findWrapping(a.type),u;if(!c)return s=null;if(u=s.length&&i.length&&EB(c,i,a,s[s.length-1],0))s[s.length-1]=u;else{s.length&&(s[s.length-1]=$B(s[s.length-1],i.length));let f=kB(a,c);s.push(f),o=o.matchType(f.type),i=c}}),s)return se.from(s)}return e}function kB(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,se.from(e));return e}function EB(e,t,n,r,o){if(o1&&(i=0),o=n&&(a=t<0?s.contentMatchAt(0).fillBefore(a,i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(se.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function kI(e,t,n){return t]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=NB().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e),o;if((o=r&&MB[r[1].toLowerCase()])&&(e=o.map(i=>"<"+i+">").join("")+e+o.map(i=>"").reverse().join("")),n.innerHTML=e,o)for(let i=0;i=0;a-=2){let c=n.nodes[r[a]];if(!c||c.hasRequiredAttrs())break;o=se.from(c.create(r[a+1],o)),i++,s++}return new ye(o,i,s)}const br={},xr={},Iwe={touchstart:!0,touchmove:!0};class Dwe{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function jwe(e){for(let t in br){let n=br[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=r=>{Rwe(e,r)&&!OO(e,r)&&(e.editable||!(r.type in xr))&&n(e,r)},Iwe[t]?{passive:!0}:void 0)}wr&&e.dom.addEventListener("input",()=>null),Rx(e)}function sa(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function Lwe(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function Rx(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=r=>OO(e,r))})}function OO(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function Rwe(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function zwe(e,t){!OO(e,t)&&br[t.type]&&(e.editable||!(t.type in xr))&&br[t.type](e,t)}xr.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!IB(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Xo&&or&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),wu&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();e.input.lastIOSEnter=r,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==r&&(e.someProp("handleKeyDown",o=>o(e,il(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",r=>r(e,n))||kwe(e,n)?n.preventDefault():sa(e,"key")};xr.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)};xr.keypress=(e,t)=>{let n=t;if(IB(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||To&&n.metaKey)return;if(e.someProp("handleKeyPress",o=>o(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof Ve)||!r.$from.sameParent(r.$to)){let o=String.fromCharCode(n.charCode);!/[\r\n]/.test(o)&&!e.someProp("handleTextInput",i=>i(e,r.$from.pos,r.$to.pos,o))&&e.dispatch(e.state.tr.insertText(o).scrollIntoView()),n.preventDefault()}};function a1(e){return{left:e.clientX,top:e.clientY}}function Awe(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function CO(e,t,n,r,o){if(r==-1)return!1;let i=e.state.doc.resolve(r);for(let s=i.depth+1;s>0;s--)if(e.someProp(t,a=>s>i.depth?a(e,n,i.nodeAfter,i.before(s),o,!0):a(e,n,i.node(s),i.before(s),o,!1)))return!0;return!1}function eu(e,t,n){e.focused||e.focus();let r=e.state.tr.setSelection(t);n=="pointer"&&r.setMeta("pointer",!0),e.dispatch(r)}function Bwe(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&je.isSelectable(r)?(eu(e,new je(n),"pointer"),!0):!1}function Fwe(e,t){if(t==-1)return!1;let n=e.state.selection,r,o;n instanceof je&&(r=n.node);let i=e.state.doc.resolve(t);for(let s=i.depth+1;s>0;s--){let a=s>i.depth?i.nodeAfter:i.node(s);if(je.isSelectable(a)){r&&n.$from.depth>0&&s>=n.$from.depth&&i.before(n.$from.depth+1)==n.$from.pos?o=i.before(n.$from.depth):o=i.before(s);break}}return o!=null?(eu(e,je.create(e.state.doc,o),"pointer"),!0):!1}function Vwe(e,t,n,r,o){return CO(e,"handleClickOn",t,n,r)||e.someProp("handleClick",i=>i(e,t,r))||(o?Fwe(e,n):Bwe(e,n))}function Hwe(e,t,n,r){return CO(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",o=>o(e,t,r))}function Wwe(e,t,n,r){return CO(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",o=>o(e,t,r))||Uwe(e,n,r)}function Uwe(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(eu(e,Ve.create(r,0,r.content.size),"pointer"),!0):!1;let o=r.resolve(t);for(let i=o.depth+1;i>0;i--){let s=i>o.depth?o.nodeAfter:o.node(i),a=o.before(i);if(s.inlineContent)eu(e,Ve.create(r,a+1,a+1+s.content.size),"pointer");else if(je.isSelectable(s))eu(e,je.create(r,a),"pointer");else continue;return!0}}function kO(e){return Qv(e)}const TB=To?"metaKey":"ctrlKey";br.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=kO(e),o=Date.now(),i="singleClick";o-e.input.lastClick.time<500&&Awe(n,e.input.lastClick)&&!n[TB]&&(e.input.lastClick.type=="singleClick"?i="doubleClick":e.input.lastClick.type=="doubleClick"&&(i="tripleClick")),e.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i};let s=e.posAtCoords(a1(n));s&&(i=="singleClick"?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new Zwe(e,s,n,!!r)):(i=="doubleClick"?Hwe:Wwe)(e,s.pos,s.inside,n)?n.preventDefault():sa(e,"pointer"))};class Zwe{constructor(t,n,r,o){this.view=t,this.pos=n,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!r[TB],this.allowDefault=r.shiftKey;let i,s;if(n.inside>-1)i=t.state.doc.nodeAt(n.inside),s=n.inside;else{let f=t.state.doc.resolve(n.pos);i=f.parent,s=f.depth?f.before():0}const a=o?null:r.target,c=a?t.docView.nearestDesc(a,!0):null;this.target=c?c.dom:null;let{selection:u}=t.state;(r.button==0&&i.type.spec.draggable&&i.type.spec.selectable!==!1||u instanceof je&&u.from<=s&&u.to>s)&&(this.mightDrag={node:i,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&li&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),sa(t,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>ps(this.view)),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(a1(t))),this.updateAllowDefault(t),this.allowDefault||!n?sa(this.view,"pointer"):Vwe(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||wr&&this.mightDrag&&!this.mightDrag.node.isAtom||or&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(eu(this.view,Ze.near(this.view.state.doc.resolve(n.pos)),"pointer"),t.preventDefault()):sa(this.view,"pointer")}move(t){this.updateAllowDefault(t),sa(this.view,"pointer"),t.buttons==0&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}br.touchstart=e=>{e.input.lastTouch=Date.now(),kO(e),sa(e,"pointer")};br.touchmove=e=>{e.input.lastTouch=Date.now(),sa(e,"pointer")};br.contextmenu=e=>kO(e);function IB(e,t){return e.composing?!0:wr&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const Gwe=Xo?5e3:-1;xr.compositionstart=xr.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))e.markCursor=e.state.storedMarks||n.marks(),Qv(e,!0),e.markCursor=null;else if(Qv(e),li&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=e.domSelectionRange();for(let o=r.focusNode,i=r.focusOffset;o&&o.nodeType==1&&i!=0;){let s=i<0?o.lastChild:o.childNodes[i-1];if(!s)break;if(s.nodeType==3){e.domSelection().collapse(s,s.nodeValue.length);break}else o=s,i=-1}}e.input.composing=!0}DB(e,Gwe)};xr.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,DB(e,20))};function DB(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Qv(e),t))}function jB(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Ywe());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Ywe(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function Qv(e,t=!1){if(!(Xo&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),jB(e),t||e.docView&&e.docView.dirty){let n=SO(e);return n&&!n.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(n)):e.updateState(e.state),!0}return!1}}function Kwe(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}const bu=Wr&&ba<15||wu&&Z_e<604;br.copy=xr.cut=(e,t)=>{let n=t,r=e.state.selection,o=n.type=="cut";if(r.empty)return;let i=bu?null:n.clipboardData,s=r.content(),{dom:a,text:c}=OB(e,s);i?(n.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",c)):Kwe(e,a),o&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function qwe(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function Jwe(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let o=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Cf(e,r.value,null,o,t):Cf(e,r.textContent,r.innerHTML,o,t)},50)}function Cf(e,t,n,r,o){let i=CB(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",c=>c(e,o,i||ye.empty)))return!0;if(!i)return!1;let s=qwe(i),a=s?e.state.tr.replaceSelectionWith(s,r):e.state.tr.replaceSelection(i);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}xr.paste=(e,t)=>{let n=t;if(e.composing&&!Xo)return;let r=bu?null:n.clipboardData,o=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&Cf(e,r.getData("text/plain"),r.getData("text/html"),o,n)?n.preventDefault():Jwe(e,n)};class Qwe{constructor(t,n){this.slice=t,this.move=n}}const LB=To?"altKey":"ctrlKey";br.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o=e.state.selection,i=o.empty?null:e.posAtCoords(a1(n));if(!(i&&i.pos>=o.from&&i.pos<=(o instanceof je?o.to-1:o.to))){if(r&&r.mightDrag)e.dispatch(e.state.tr.setSelection(je.create(e.state.doc,r.mightDrag.pos)));else if(n.target&&n.target.nodeType==1){let u=e.docView.nearestDesc(n.target,!0);u&&u.node.type.spec.draggable&&u!=e.docView&&e.dispatch(e.state.tr.setSelection(je.create(e.state.doc,u.posBefore)))}}let s=e.state.selection.content(),{dom:a,text:c}=OB(e,s);n.dataTransfer.clearData(),n.dataTransfer.setData(bu?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",bu||n.dataTransfer.setData("text/plain",c),e.dragging=new Qwe(s,!n[LB])};br.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)};xr.dragover=xr.dragenter=(e,t)=>t.preventDefault();xr.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let o=e.posAtCoords(a1(n));if(!o)return;let i=e.state.doc.resolve(o.pos),s=r&&r.slice;s?e.someProp("transformPasted",y=>{s=y(s,e)}):s=CB(e,n.dataTransfer.getData(bu?"Text":"text/plain"),bu?null:n.dataTransfer.getData("text/html"),!1,i);let a=!!(r&&!n[LB]);if(e.someProp("handleDrop",y=>y(e,n,s||ye.empty,a))){n.preventDefault();return}if(!s)return;n.preventDefault();let c=s?tB(e.state.doc,i.pos,s):i.pos;c==null&&(c=i.pos);let u=e.state.tr;a&&u.deleteSelection();let f=u.mapping.map(c),h=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,m=u.doc;if(h?u.replaceRangeWith(f,f,s.content.firstChild):u.replaceRange(f,f,s),u.doc.eq(m))return;let v=u.doc.resolve(f);if(h&&je.isSelectable(s.content.firstChild)&&v.nodeAfter&&v.nodeAfter.sameMarkup(s.content.firstChild))u.setSelection(new je(v));else{let y=u.mapping.map(c);u.mapping.maps[u.mapping.maps.length-1].forEach((w,P,b,S)=>y=S),u.setSelection(PO(e,v,u.doc.resolve(y)))}e.focus(),e.dispatch(u.setMeta("uiEvent","drop"))};br.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&ps(e)},20))};br.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)};br.beforeinput=(e,t)=>{if(or&&Xo&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:r}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=r||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",i=>i(e,il(8,"Backspace")))))return;let{$cursor:o}=e.state.selection;o&&o.pos>0&&e.dispatch(e.state.tr.delete(o.pos-1,o.pos).scrollIntoView())},50)}};for(let e in xr)br[e]=xr[e];function kf(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class Xv{constructor(t,n){this.toDOM=t,this.spec=n||kl,this.side=this.spec.side||0}map(t,n,r,o){let{pos:i,deleted:s}=t.mapResult(n.from+o,this.side<0?-1:1);return s?null:new Ro(i-r,i-r,this)}valid(){return!0}eq(t){return this==t||t instanceof Xv&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&kf(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class Sa{constructor(t,n){this.attrs=t,this.spec=n||kl}map(t,n,r,o){let i=t.map(n.from+o,this.spec.inclusiveStart?-1:1)-r,s=t.map(n.to+o,this.spec.inclusiveEnd?1:-1)-r;return i>=s?null:new Ro(i,s,this)}valid(t,n){return n.from=t&&(!i||i(a.spec))&&r.push(a.copy(a.from+o,a.to+o))}for(let s=0;st){let a=this.children[s]+1;this.children[s+2].findInner(t-a,n-a,r,o+a,i)}}map(t,n,r){return this==tr||t.maps.length==0?this:this.mapInner(t,n,0,0,r||kl)}mapInner(t,n,r,o,i){let s;for(let a=0;a{let u=c+r,f;if(f=zB(n,a,u)){for(o||(o=this.children.slice());ia&&h.to=t){this.children[a]==t&&(r=this.children[a+2]);break}let i=t+1,s=i+n.content.size;for(let a=0;ai&&c.type instanceof Sa){let u=Math.max(i,c.from)-i,f=Math.min(s,c.to)-i;uo.map(t,n,kl));return Qs.from(r)}forChild(t,n){if(n.isLeaf)return vn.empty;let r=[];for(let o=0;on instanceof vn)?t:t.reduce((n,r)=>n.concat(r instanceof vn?r:r.members),[]))}}}function Xwe(e,t,n,r,o,i,s){let a=e.slice();for(let u=0,f=i;u{let P=w-y-(v-m);for(let b=0;bS+f-h)continue;let O=a[b]+f-h;v>=O?a[b+1]=m<=O?-2:-1:y>=o&&P&&(a[b]+=P,a[b+1]+=P)}h+=P}),f=n.maps[u].map(f,-1)}let c=!1;for(let u=0;u=r.content.size){c=!0;continue}let m=n.map(e[u+1]+i,-1),v=m-o,{index:y,offset:w}=r.content.findIndex(h),P=r.maybeChild(y);if(P&&w==h&&w+P.nodeSize==v){let b=a[u+2].mapInner(n,P,f+1,e[u]+i+1,s);b!=tr?(a[u]=h,a[u+1]=v,a[u+2]=b):(a[u+1]=-2,c=!0)}else c=!0}if(c){let u=ebe(a,e,t,n,o,i,s),f=ey(u,r,0,s);t=f.local;for(let h=0;hn&&s.to{let u=zB(e,a,c+n);if(u){i=!0;let f=ey(u,a,n+c+1,r);f!=tr&&o.push(c,c+a.nodeSize,f)}});let s=RB(i?AB(e):e,-n).sort(El);for(let a=0;a0;)t++;e.splice(t,0,n)}function yw(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=tr&&t.push(r)}),e.cursorWrapper&&t.push(vn.create(e.state.doc,[e.cursorWrapper.deco])),Qs.from(t)}const tbe={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},nbe=Wr&&ba<=11;class rbe{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class obe{constructor(t,n){this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new rbe,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let o=0;oo.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():this.flush()}),nbe&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,tbe)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let n=0;nthis.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(bI(this.view)){if(this.suppressingSelectionUpdates)return ps(this.view);if(Wr&&ba<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&Rl(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let n=new Set,r;for(let i=t.focusNode;i;i=Of(i))n.add(i);for(let i=t.anchorNode;i;i=Of(i))if(n.has(i)){r=i;break}let o=r&&this.view.docView.nearestDesc(r);if(o&&o.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=t.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&bI(t)&&!this.ignoreSelectionChange(r),i=-1,s=-1,a=!1,c=[];if(t.editable)for(let f=0;f1){let f=c.filter(h=>h.nodeName=="BR");if(f.length==2){let h=f[0],m=f[1];h.parentNode&&h.parentNode.parentNode==m.parentNode?m.remove():h.remove()}}let u=null;i<0&&o&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)-1||o)&&(i>-1&&(t.docView.markDirty(i,s),ibe(t)),this.handleDOMChange(i,s,a,c),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(r)||ps(t),this.currentSelection.set(r))}registerMutation(t,n){if(n.indexOf(t.target)>-1)return null;let r=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(r==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!r||r.ignoreMutation(t))return null;if(t.type=="childList"){for(let f=0;fo;P--){let b=r.childNodes[P-1],S=b.pmViewDesc;if(b.nodeName=="BR"&&!S){i=P;break}if(!S||S.size)break}let h=e.state.doc,m=e.someProp("domParser")||vu.fromSchema(e.state.schema),v=h.resolve(s),y=null,w=m.parse(r,{topNode:v.parent,topMatch:v.parent.contentMatchAt(v.index()),topOpen:!0,from:o,to:i,preserveWhitespace:v.parent.type.whitespace=="pre"?"full":!0,findPositions:u,ruleFromNode:lbe,context:v});if(u&&u[0].pos!=null){let P=u[0].pos,b=u[1]&&u[1].pos;b==null&&(b=P),y={anchor:P+s,head:b+s}}return{doc:w,sel:y,from:s,to:a}}function lbe(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName=="BR"&&e.parentNode){if(wr&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(e.parentNode.lastChild==e||wr&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}const cbe=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function ube(e,t,n,r,o){let i=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let B=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,z=SO(e,B);if(z&&!e.state.selection.eq(z)){if(or&&Xo&&e.input.lastKeyCode===13&&Date.now()-100Q(e,il(13,"Enter"))))return;let G=e.state.tr.setSelection(z);B=="pointer"?G.setMeta("pointer",!0):B=="key"&&G.scrollIntoView(),i&&G.setMeta("composition",i),e.dispatch(G)}return}let s=e.state.doc.resolve(t),a=s.sharedDepth(n);t=s.before(a+1),n=e.state.doc.resolve(n).after(a+1);let c=e.state.selection,u=abe(e,t,n),f=e.state.doc,h=f.slice(u.from,u.to),m,v;e.input.lastKeyCode===8&&Date.now()-100Date.now()-225||Xo)&&o.some(B=>B.nodeType==1&&!cbe.test(B.nodeName))&&(!y||y.endA>=y.endB)&&e.someProp("handleKeyDown",B=>B(e,il(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!y)if(r&&c instanceof Ve&&!c.empty&&c.$head.sameParent(c.$anchor)&&!e.composing&&!(u.sel&&u.sel.anchor!=u.sel.head))y={start:c.from,endA:c.to,endB:c.to};else{if(u.sel){let B=TI(e,e.state.doc,u.sel);if(B&&!B.eq(e.state.selection)){let z=e.state.tr.setSelection(B);i&&z.setMeta("composition",i),e.dispatch(z)}}return}if(or&&e.cursorWrapper&&u.sel&&u.sel.anchor==e.cursorWrapper.deco.from&&u.sel.head==u.sel.anchor){let B=y.endB-y.start;u.sel={anchor:u.sel.anchor+B,head:u.sel.anchor+B}}e.input.domChangeCount++,e.state.selection.frome.state.selection.from&&y.start<=e.state.selection.from+2&&e.state.selection.from>=u.from?y.start=e.state.selection.from:y.endA=e.state.selection.to-2&&e.state.selection.to<=u.to&&(y.endB+=e.state.selection.to-y.endA,y.endA=e.state.selection.to)),Wr&&ba<=11&&y.endB==y.start+1&&y.endA==y.start&&y.start>u.from&&u.doc.textBetween(y.start-u.from-1,y.start-u.from+1)=="  "&&(y.start--,y.endA--,y.endB--);let w=u.doc.resolveNoCache(y.start-u.from),P=u.doc.resolveNoCache(y.endB-u.from),b=f.resolve(y.start),S=w.sameParent(P)&&w.parent.inlineContent&&b.end()>=y.endA,O;if((wu&&e.input.lastIOSEnter>Date.now()-225&&(!S||o.some(B=>B.nodeName=="DIV"||B.nodeName=="P"))||!S&&w.posB(e,il(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>y.start&&fbe(f,y.start,y.endA,w,P)&&e.someProp("handleKeyDown",B=>B(e,il(8,"Backspace")))){Xo&&or&&e.domObserver.suppressSelectionUpdates();return}or&&Xo&&y.endB==y.start&&(e.input.lastAndroidDelete=Date.now()),Xo&&!S&&w.start()!=P.start()&&P.parentOffset==0&&w.depth==P.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==y.endA&&(y.endB-=2,P=u.doc.resolveNoCache(y.endB-u.from),setTimeout(()=>{e.someProp("handleKeyDown",function(B){return B(e,il(13,"Enter"))})},20));let E=y.start,$=y.endA,N,I,R;if(S){if(w.pos==P.pos)Wr&&ba<=11&&w.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>ps(e),20)),N=e.state.tr.delete(E,$),I=f.resolve(y.start).marksAcross(f.resolve(y.endA));else if(y.endA==y.endB&&(R=dbe(w.parent.content.cut(w.parentOffset,P.parentOffset),b.parent.content.cut(b.parentOffset,y.endA-b.start()))))N=e.state.tr,R.type=="add"?N.addMark(E,$,R.mark):N.removeMark(E,$,R.mark);else if(w.parent.child(w.index()).isText&&w.index()==P.index()-(P.textOffset?0:1)){let B=w.parent.textBetween(w.parentOffset,P.parentOffset);if(e.someProp("handleTextInput",z=>z(e,E,$,B)))return;N=e.state.tr.insertText(B,E,$)}}if(N||(N=e.state.tr.replace(E,$,u.doc.slice(y.start-u.from,y.endB-u.from))),u.sel){let B=TI(e,N.doc,u.sel);B&&!(or&&Xo&&e.composing&&B.empty&&(y.start!=y.endB||e.input.lastAndroidDeletet.content.size?null:PO(e,t.resolve(n.anchor),t.resolve(n.head))}function dbe(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,o=n,i=r,s,a,c;for(let f=0;ff.mark(a.addToSet(f.marks));else if(o.length==0&&i.length==1)a=i[0],s="remove",c=f=>f.mark(a.removeFromSet(f.marks));else return null;let u=[];for(let f=0;fn||_w(s,!0,!1)0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,o++,t=!1;if(n){let i=e.node(r).maybeChild(e.indexAfter(r));for(;i&&!i.isLeaf;)i=i.firstChild,o++}return o}function hbe(e,t,n,r,o){let i=e.findDiffStart(t,n);if(i==null)return null;let{a:s,b:a}=e.findDiffEnd(t,n+e.size,n+t.size);if(o=="end"){let c=Math.max(0,i-Math.min(s,a));r-=s+c-i}if(s=s?i-r:0;i-=c,a=i+(a-s),s=i}else if(a=a?i-r:0;i-=c,s=i+(s-a),a=i}return{start:i,endA:s,endB:a}}class pbe{constructor(t,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Dwe,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(RI),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):typeof t=="function"?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=jI(this),DI(this),this.nodeViews=LI(this),this.docView=mI(this.state.doc,II(this),yw(this),this.dom,this),this.domObserver=new obe(this,(r,o,i,s)=>ube(this,r,o,i,s)),this.domObserver.start(),jwe(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let n in t)this._props[n]=t[n];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&Rx(this);let n=this._props;this._props=t,t.plugins&&(t.plugins.forEach(RI),this.directPlugins=t.plugins),this.updateStateInner(t.state,n)}setProps(t){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in t)n[r]=t[r];this.update(n)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,n){let r=this.state,o=!1,i=!1;t.storedMarks&&this.composing&&(jB(this),i=!0),this.state=t;let s=r.plugins!=t.plugins||this._props.plugins!=n.plugins;if(s||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let m=LI(this);gbe(m,this.nodeViews)&&(this.nodeViews=m,o=!0)}(s||n.handleDOMEvents!=this._props.handleDOMEvents)&&Rx(this),this.editable=jI(this),DI(this);let a=yw(this),c=II(this),u=r.plugins!=t.plugins&&!r.doc.eq(t.doc)?"reset":t.scrollToSelection>r.scrollToSelection?"to selection":"preserve",f=o||!this.docView.matchesNode(t.doc,c,a);(f||!t.selection.eq(r.selection))&&(i=!0);let h=u=="preserve"&&i&&this.dom.style.overflowAnchor==null&&K_e(this);if(i){this.domObserver.stop();let m=f&&(Wr||or)&&!this.composing&&!r.selection.empty&&!t.selection.empty&&mbe(r.selection,t.selection);if(f){let v=or?this.trackWrites=this.domSelectionRange().focusNode:null;(o||!this.docView.update(t.doc,c,a,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=mI(t.doc,c,a,this.dom,this)),v&&!this.trackWrites&&(m=!0)}m||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&wwe(this))?ps(this,m):(xB(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():h&&q_e(h)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof je){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&cI(this,n.getBoundingClientRect(),t)}else cI(this,this.coordsAtPos(this.state.selection.head,1),t)}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(!t||t.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;nn.ownerDocument.getSelection()),this._root=n}return t||document}updateRoot(){this._root=null}posAtCoords(t){return nwe(this,t)}coordsAtPos(t,n=1){return pB(this,t,n)}domAtPos(t,n=0){return this.docView.domFromPos(t,n)}nodeDOM(t){let n=this.docView.descAt(t);return n?n.nodeDOM:null}posAtDOM(t,n,r=-1){let o=this.docView.posFromDOM(t,n,r);if(o==null)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(t,n){return awe(this,n||this.state,t)}pasteHTML(t,n){return Cf(this,"",t,!1,n||new ClipboardEvent("paste"))}pasteText(t,n){return Cf(this,t,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(Lwe(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],yw(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent(t){return zwe(this,t)}dispatch(t){let n=this._props.dispatchTransaction;n?n.call(this,t):this.updateState(this.state.apply(t))}domSelectionRange(){return wr&&this.root.nodeType===11&&V_e(this.dom.ownerDocument)==this.dom?sbe(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function II(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(e.state)),n)for(let r in n)r=="class"?t.class+=" "+n[r]:r=="style"?t.style=(t.style?t.style+";":"")+n[r]:!t[r]&&r!="contenteditable"&&r!="nodeName"&&(t[r]=String(n[r]))}),t.translate||(t.translate="no"),[Ro.node(0,e.state.doc.content.size,t)]}function DI(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:Ro.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function jI(e){return!e.someProp("editable",t=>t(e.state)===!1)}function mbe(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function LI(e){let t=Object.create(null);function n(r){for(let o in r)Object.prototype.hasOwnProperty.call(t,o)||(t[o]=r[o])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function gbe(e,t){let n=0,r=0;for(let o in e){if(e[o]!=t[o])return!0;n++}for(let o in t)r++;return n!=r}function RI(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Ma={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},ty={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},vbe=typeof navigator<"u"&&/Mac/.test(navigator.platform),ybe=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Fn=0;Fn<10;Fn++)Ma[48+Fn]=Ma[96+Fn]=String(Fn);for(var Fn=1;Fn<=24;Fn++)Ma[Fn+111]="F"+Fn;for(var Fn=65;Fn<=90;Fn++)Ma[Fn]=String.fromCharCode(Fn+32),ty[Fn]=String.fromCharCode(Fn);for(var ww in Ma)ty.hasOwnProperty(ww)||(ty[ww]=Ma[ww]);function _be(e){var t=vbe&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||ybe&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?ty:Ma)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const wbe=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function bbe(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let r,o,i,s;for(let a=0;a127)&&(i=Ma[r.keyCode])&&i!=o){let a=t[bw(i,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}const Pbe=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function Obe(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const Cbe=(e,t,n)=>{let r=Obe(e,n);if(!r)return!1;let o=FB(r);if(!o){let s=r.blockRange(),a=s&&Du(s);return a==null?!1:(t&&t(e.tr.lift(s,a).scrollIntoView()),!0)}let i=o.nodeBefore;if(!i.type.spec.isolating&&WB(e,o,t))return!0;if(r.parent.content.size==0&&(xu(i,"end")||je.isSelectable(i))){let s=_O(e.doc,r.before(),r.after(),ye.empty);if(s&&s.slice.size{let{$head:r,empty:o}=e.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;i=FB(r)}let s=i&&i.nodeBefore;return!s||!je.isSelectable(s)?!1:(t&&t(e.tr.setSelection(je.create(e.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)};function FB(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function Ebe(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset{let r=Ebe(e,n);if(!r)return!1;let o=VB(r);if(!o)return!1;let i=o.nodeAfter;if(WB(e,o,t))return!0;if(r.parent.content.size==0&&(xu(i,"start")||je.isSelectable(i))){let s=_O(e.doc,r.before(),r.after(),ye.empty);if(s&&s.slice.size{let{$head:r,empty:o}=e.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset=0;t--){let n=e.node(t);if(e.index(t)+1{let n=e.selection,r=n instanceof je,o;if(r){if(n.node.isTextblock||!Aa(e.doc,n.from))return!1;o=n.from}else if(o=r1(e.doc,n.from,-1),o==null)return!1;if(t){let i=e.tr.join(o);r&&i.setSelection(je.create(i.doc,o-e.doc.resolve(o).nodeBefore.nodeSize)),t(i.scrollIntoView())}return!0},Tbe=(e,t)=>{let n=e.selection,r;if(n instanceof je){if(n.node.isTextblock||!Aa(e.doc,n.to))return!1;r=n.to}else if(r=r1(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},Ibe=(e,t)=>{let{$from:n,$to:r}=e.selection,o=n.blockRange(r),i=o&&Du(o);return i==null?!1:(t&&t(e.tr.lift(o,i).scrollIntoView()),!0)},Dbe=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(` -`).scrollIntoView()),!0)};function HB(e){for(let t=0;t{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),i=n.indexAfter(-1),s=HB(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(t){let a=n.after(),c=e.tr.replaceWith(a,a,s.createAndFill());c.setSelection(Ze.near(c.doc.resolve(a),1)),t(c.scrollIntoView())}return!0},Lbe=(e,t)=>{let n=e.selection,{$from:r,$to:o}=n;if(n instanceof ri||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=HB(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(t){let s=(!r.parentOffset&&o.index(){let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if(Qc(e.doc,i))return t&&t(e.tr.split(i).scrollIntoView()),!0}let r=n.blockRange(),o=r&&Du(r);return o==null?!1:(t&&t(e.tr.lift(r,o).scrollIntoView()),!0)},zbe=(e,t)=>{let{$from:n,to:r}=e.selection,o,i=n.sharedDepth(r);return i==0?!1:(o=n.before(i),t&&t(e.tr.setSelection(je.create(e.doc,o))),!0)};function Abe(e,t,n){let r=t.nodeBefore,o=t.nodeAfter,i=t.index();return!r||!o||!r.type.compatibleContent(o.type)?!1:!r.content.size&&t.parent.canReplace(i-1,i)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(i,i+1)||!(o.isTextblock||Aa(e.doc,t.pos))?!1:(n&&n(e.tr.clearIncompatible(t.pos,r.type,r.contentMatchAt(r.childCount)).join(t.pos).scrollIntoView()),!0)}function WB(e,t,n){let r=t.nodeBefore,o=t.nodeAfter,i,s;if(r.type.spec.isolating||o.type.spec.isolating)return!1;if(Abe(e,t,n))return!0;let a=t.parent.canReplace(t.index(),t.index()+1);if(a&&(i=(s=r.contentMatchAt(r.childCount)).findWrapping(o.type))&&s.matchType(i[0]||o.type).validEnd){if(n){let h=t.pos+o.nodeSize,m=se.empty;for(let w=i.length-1;w>=0;w--)m=se.from(i[w].create(null,m));m=se.from(r.copy(m));let v=e.tr.step(new $n(t.pos-1,h,t.pos,h,new ye(m,1,0),i.length,!0)),y=h+2*i.length;Aa(v.doc,y)&&v.join(y),n(v.scrollIntoView())}return!0}let c=Ze.findFrom(t,1),u=c&&c.$from.blockRange(c.$to),f=u&&Du(u);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(u,f).scrollIntoView()),!0;if(a&&xu(o,"start",!0)&&xu(r,"end")){let h=r,m=[];for(;m.push(h),!h.isTextblock;)h=h.lastChild;let v=o,y=1;for(;!v.isTextblock;v=v.firstChild)y++;if(h.canReplace(h.childCount,h.childCount,v.content)){if(n){let w=se.empty;for(let b=m.length-1;b>=0;b--)w=se.from(m[b].copy(w));let P=e.tr.step(new $n(t.pos-m.length,t.pos+o.nodeSize,t.pos+y,t.pos+o.nodeSize-y,new ye(w,m.length,0),0,!0));n(P.scrollIntoView())}return!0}}return!1}function UB(e){return function(t,n){let r=t.selection,o=e<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return o.node(i).isTextblock?(n&&n(t.tr.setSelection(Ve.create(t.doc,e<0?o.start(i):o.end(i)))),!0):!1}}const Bbe=UB(-1),Fbe=UB(1);function Vbe(e,t=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),a=s&&yO(s,e,t);return a?(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0):!1}}function zI(e,t=null){return function(n,r){let o=!1;for(let i=0;i{if(o)return!1;if(!(!c.isTextblock||c.hasMarkup(e,t)))if(c.type==e)o=!0;else{let f=n.doc.resolve(u),h=f.index();o=f.parent.canReplaceWith(h,h+1,e)}})}if(!o)return!1;if(r){let i=n.tr;for(let s=0;s=2&&o.node(s.depth-1).type.compatibleContent(e)&&s.startIndex==0){if(o.index(s.depth-1)==0)return!1;let f=n.doc.resolve(s.start-2);c=new Gv(f,f,s.depth),s.endIndex=0;f--)i=se.from(n[f].type.create(n[f].attrs,i));e.step(new $n(t.start-(r?2:0),t.end,t.start,t.end,new ye(i,0,0),n.length,!0));let s=0;for(let f=0;fs.childCount>0&&s.firstChild.type==e);return i?n?r.node(i.depth-1).type==e?Zbe(t,n,e,i):Gbe(t,n,i):!0:!1}}function Zbe(e,t,n,r){let o=e.tr,i=r.end,s=r.$to.end(r.depth);iw;y--)v-=o.child(y).nodeSize,r.delete(v-1,v+1);let i=r.doc.resolve(n.start),s=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,c=n.endIndex==o.childCount,u=i.node(-1),f=i.index(-1);if(!u.canReplace(f+(a?0:1),f+1,s.content.append(c?se.empty:se.from(o))))return!1;let h=i.pos,m=h+s.nodeSize;return r.step(new $n(h-(a?1:0),m+(c?1:0),h+1,m-1,new ye((a?se.empty:se.from(o.copy(se.empty))).append(c?se.empty:se.from(o.copy(se.empty))),a?0:1,c?0:1),a?0:1)),t(r.scrollIntoView()),!0}function Ybe(e){return function(t,n){let{$from:r,$to:o}=t.selection,i=r.blockRange(o,u=>u.childCount>0&&u.firstChild.type==e);if(!i)return!1;let s=i.startIndex;if(s==0)return!1;let a=i.parent,c=a.child(s-1);if(c.type!=e)return!1;if(n){let u=c.lastChild&&c.lastChild.type==a.type,f=se.from(u?e.create():null),h=new ye(se.from(e.create(null,se.from(a.type.create(null,f)))),u?3:1,0),m=i.start,v=i.end;n(t.tr.step(new $n(m-(u?3:1),v,m,v,h,1,!0)).scrollIntoView())}return!0}}function l1(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:o}=n,{storedMarks:i}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),filterTransaction:t.filterTransaction,plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return i},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,i=n.storedMarks,n}}}class c1{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:n,state:r}=this,{view:o}=n,{tr:i}=r,s=this.buildProps(i);return Object.fromEntries(Object.entries(t).map(([a,c])=>[a,(...f)=>{const h=c(...f)(s);return!i.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(i),h}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,n=!0){const{rawCommands:r,editor:o,state:i}=this,{view:s}=o,a=[],c=!!t,u=t||i.tr,f=()=>(!c&&n&&!u.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(u),a.every(m=>m===!0)),h={...Object.fromEntries(Object.entries(r).map(([m,v])=>[m,(...w)=>{const P=this.buildProps(u,n),b=v(...w)(P);return a.push(b),h}])),run:f};return h}createCan(t){const{rawCommands:n,state:r}=this,o=!1,i=t||r.tr,s=this.buildProps(i,o);return{...Object.fromEntries(Object.entries(n).map(([c,u])=>[c,(...f)=>u(...f)({...s,dispatch:void 0})])),chain:()=>this.createChain(i,o)}}buildProps(t,n=!0){const{rawCommands:r,editor:o,state:i}=this,{view:s}=o,a={tr:t,editor:o,view:s,state:l1({state:i,transaction:t}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(t,n),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(r).map(([c,u])=>[c,(...f)=>u(...f)(a)]))}};return a}}class Kbe{constructor(){this.callbacks={}}on(t,n){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(n),this}emit(t,...n){const r=this.callbacks[t];return r&&r.forEach(o=>o.apply(this,n)),this}off(t,n){const r=this.callbacks[t];return r&&(n?this.callbacks[t]=r.filter(o=>o!==n):delete this.callbacks[t]),this}removeAllListeners(){this.callbacks={}}}function Ce(e,t,n){return e.config[t]===void 0&&e.parent?Ce(e.parent,t,n):typeof e.config[t]=="function"?e.config[t].bind({...n,parent:e.parent?Ce(e.parent,t,n):null}):e.config[t]}function u1(e){const t=e.filter(o=>o.type==="extension"),n=e.filter(o=>o.type==="node"),r=e.filter(o=>o.type==="mark");return{baseExtensions:t,nodeExtensions:n,markExtensions:r}}function ZB(e){const t=[],{nodeExtensions:n,markExtensions:r}=u1(e),o=[...n,...r],i={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage},c=Ce(s,"addGlobalAttributes",a);if(!c)return;c().forEach(f=>{f.types.forEach(h=>{Object.entries(f.attributes).forEach(([m,v])=>{t.push({type:h,name:m,attribute:{...i,...v}})})})})}),o.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage},c=Ce(s,"addAttributes",a);if(!c)return;const u=c();Object.entries(u).forEach(([f,h])=>{const m={...i,...h};typeof m?.default=="function"&&(m.default=m.default()),m?.isRequired&&m?.default===void 0&&delete m.default,t.push({type:s.name,name:f,attribute:m})})}),t}function Nn(e,t){if(typeof e=="string"){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}function kt(...e){return e.filter(t=>!!t).reduce((t,n)=>{const r={...t};return Object.entries(n).forEach(([o,i])=>{if(!r[o]){r[o]=i;return}if(o==="class"){const a=i?i.split(" "):[],c=r[o]?r[o].split(" "):[],u=a.filter(f=>!c.includes(f));r[o]=[...c,...u].join(" ")}else o==="style"?r[o]=[r[o],i].join("; "):r[o]=i}),r},{})}function zx(e,t){return t.filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(e.attrs)||{}:{[n.name]:e.attrs[n.name]}).reduce((n,r)=>kt(n,r),{})}function GB(e){return typeof e=="function"}function Ue(e,t=void 0,...n){return GB(e)?t?e.bind(t)(...n):e(...n):e}function qbe(e={}){return Object.keys(e).length===0&&e.constructor===Object}function Jbe(e){return typeof e!="string"?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e==="true"?!0:e==="false"?!1:e}function AI(e,t){return e.style?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;const o=t.reduce((i,s)=>{const a=s.attribute.parseHTML?s.attribute.parseHTML(n):Jbe(n.getAttribute(s.name));return a==null?i:{...i,[s.name]:a}},{});return{...r,...o}}}}function BI(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>t==="attrs"&&qbe(n)?!1:n!=null))}function Qbe(e,t){var n;const r=ZB(e),{nodeExtensions:o,markExtensions:i}=u1(e),s=(n=o.find(u=>Ce(u,"topNode")))===null||n===void 0?void 0:n.name,a=Object.fromEntries(o.map(u=>{const f=r.filter(b=>b.type===u.name),h={name:u.name,options:u.options,storage:u.storage,editor:t},m=e.reduce((b,S)=>{const O=Ce(S,"extendNodeSchema",h);return{...b,...O?O(u):{}}},{}),v=BI({...m,content:Ue(Ce(u,"content",h)),marks:Ue(Ce(u,"marks",h)),group:Ue(Ce(u,"group",h)),inline:Ue(Ce(u,"inline",h)),atom:Ue(Ce(u,"atom",h)),selectable:Ue(Ce(u,"selectable",h)),draggable:Ue(Ce(u,"draggable",h)),code:Ue(Ce(u,"code",h)),defining:Ue(Ce(u,"defining",h)),isolating:Ue(Ce(u,"isolating",h)),attrs:Object.fromEntries(f.map(b=>{var S;return[b.name,{default:(S=b?.attribute)===null||S===void 0?void 0:S.default}]}))}),y=Ue(Ce(u,"parseHTML",h));y&&(v.parseDOM=y.map(b=>AI(b,f)));const w=Ce(u,"renderHTML",h);w&&(v.toDOM=b=>w({node:b,HTMLAttributes:zx(b,f)}));const P=Ce(u,"renderText",h);return P&&(v.toText=P),[u.name,v]})),c=Object.fromEntries(i.map(u=>{const f=r.filter(P=>P.type===u.name),h={name:u.name,options:u.options,storage:u.storage,editor:t},m=e.reduce((P,b)=>{const S=Ce(b,"extendMarkSchema",h);return{...P,...S?S(u):{}}},{}),v=BI({...m,inclusive:Ue(Ce(u,"inclusive",h)),excludes:Ue(Ce(u,"excludes",h)),group:Ue(Ce(u,"group",h)),spanning:Ue(Ce(u,"spanning",h)),code:Ue(Ce(u,"code",h)),attrs:Object.fromEntries(f.map(P=>{var b;return[P.name,{default:(b=P?.attribute)===null||b===void 0?void 0:b.default}]}))}),y=Ue(Ce(u,"parseHTML",h));y&&(v.parseDOM=y.map(P=>AI(P,f)));const w=Ce(u,"renderHTML",h);return w&&(v.toDOM=P=>w({mark:P,HTMLAttributes:zx(P,f)})),[u.name,v]}));return new a_e({topNode:s,nodes:a,marks:c})}function xw(e,t){return t.nodes[e]||t.marks[e]||null}function FI(e,t){return Array.isArray(t)?t.some(n=>(typeof n=="string"?n:n.name)===e.name):t}const Xbe=(e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(o,i,s,a)=>{var c,u;const f=((u=(c=o.type.spec).toText)===null||u===void 0?void 0:u.call(c,{node:o,pos:i,parent:s,index:a}))||o.textContent||"%leaf%";n+=f.slice(0,Math.max(0,r-i))}),n};function MO(e){return Object.prototype.toString.call(e)==="[object RegExp]"}class d1{constructor(t){this.find=t.find,this.handler=t.handler}}const exe=(e,t)=>{if(MO(t))return t.exec(e);const n=t(e);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function Sw(e){var t;const{editor:n,from:r,to:o,text:i,rules:s,plugin:a}=e,{view:c}=n;if(c.composing)return!1;const u=c.state.doc.resolve(r);if(u.parent.type.spec.code||!((t=u.nodeBefore||u.nodeAfter)===null||t===void 0)&&t.marks.find(m=>m.type.spec.code))return!1;let f=!1;const h=Xbe(u)+i;return s.forEach(m=>{if(f)return;const v=exe(h,m.find);if(!v)return;const y=c.state.tr,w=l1({state:c.state,transaction:y}),P={from:r-(v[0].length-i.length),to:o},{commands:b,chain:S,can:O}=new c1({editor:n,state:w});m.handler({state:w,range:P,match:v,commands:b,chain:S,can:O})===null||!y.steps.length||(y.setMeta(a,{transform:y,from:r,to:o,text:i}),c.dispatch(y),f=!0)}),f}function txe(e){const{editor:t,rules:n}=e,r=new Kr({state:{init(){return null},apply(o,i){const s=o.getMeta(r);return s||(o.selectionSet||o.docChanged?null:i)}},props:{handleTextInput(o,i,s,a){return Sw({editor:t,from:i,to:s,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:o=>(setTimeout(()=>{const{$cursor:i}=o.state.selection;i&&Sw({editor:t,from:i.pos,to:i.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(o,i){if(i.key!=="Enter")return!1;const{$cursor:s}=o.state.selection;return s?Sw({editor:t,from:s.pos,to:s.pos,text:` -`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function nxe(e){return typeof e=="number"}class rxe{constructor(t){this.find=t.find,this.handler=t.handler}}const oxe=(e,t)=>{if(MO(t))return[...e.matchAll(t)];const n=t(e);return n?n.map(r=>{const o=[r.text];return o.index=r.index,o.input=e,o.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(r.replaceWith)),o}):[]};function ixe(e){const{editor:t,state:n,from:r,to:o,rule:i,pasteEvent:s,dropEvent:a}=e,{commands:c,chain:u,can:f}=new c1({editor:t,state:n}),h=[];return n.doc.nodesBetween(r,o,(v,y)=>{if(!v.isTextblock||v.type.spec.code)return;const w=Math.max(r,y),P=Math.min(o,y+v.content.size),b=v.textBetween(w-y,P-y,void 0,"");oxe(b,i.find).forEach(O=>{if(O.index===void 0)return;const E=w+O.index+1,$=E+O[0].length,N={from:n.tr.mapping.map(E),to:n.tr.mapping.map($)},I=i.handler({state:n,range:N,match:O,commands:c,chain:u,can:f,pasteEvent:s,dropEvent:a});h.push(I)})}),h.every(v=>v!==null)}function sxe(e){const{editor:t,rules:n}=e;let r=null,o=!1,i=!1,s=new ClipboardEvent("paste"),a=new DragEvent("drop");return n.map(u=>new Kr({view(f){const h=m=>{var v;r=!((v=f.dom.parentElement)===null||v===void 0)&&v.contains(m.target)?f.dom.parentElement:null};return window.addEventListener("dragstart",h),{destroy(){window.removeEventListener("dragstart",h)}}},props:{handleDOMEvents:{drop:(f,h)=>(i=r===f.dom.parentElement,a=h,!1),paste:(f,h)=>{var m;const v=(m=h.clipboardData)===null||m===void 0?void 0:m.getData("text/html");return s=h,o=!!v?.includes("data-pm-slice"),!1}}},appendTransaction:(f,h,m)=>{const v=f[0],y=v.getMeta("uiEvent")==="paste"&&!o,w=v.getMeta("uiEvent")==="drop"&&!i;if(!y&&!w)return;const P=h.doc.content.findDiffStart(m.doc.content),b=h.doc.content.findDiffEnd(m.doc.content);if(!nxe(P)||!b||P===b.b)return;const S=m.tr,O=l1({state:m,transaction:S});if(!(!ixe({editor:t,state:O,from:Math.max(P-1,0),to:b.b-1,rule:u,pasteEvent:s,dropEvent:a})||!S.steps.length))return a=new DragEvent("drop"),s=new ClipboardEvent("paste"),S}}))}function axe(e){const t=e.filter((n,r)=>e.indexOf(n)!==r);return[...new Set(t)]}class jc{constructor(t,n){this.splittableMarks=[],this.editor=n,this.extensions=jc.resolve(t),this.schema=Qbe(this.extensions,n),this.extensions.forEach(r=>{var o;this.editor.extensionStorage[r.name]=r.storage;const i={name:r.name,options:r.options,storage:r.storage,editor:this.editor,type:xw(r.name,this.schema)};r.type==="mark"&&(!((o=Ue(Ce(r,"keepOnSplit",i)))!==null&&o!==void 0)||o)&&this.splittableMarks.push(r.name);const s=Ce(r,"onBeforeCreate",i);s&&this.editor.on("beforeCreate",s);const a=Ce(r,"onCreate",i);a&&this.editor.on("create",a);const c=Ce(r,"onUpdate",i);c&&this.editor.on("update",c);const u=Ce(r,"onSelectionUpdate",i);u&&this.editor.on("selectionUpdate",u);const f=Ce(r,"onTransaction",i);f&&this.editor.on("transaction",f);const h=Ce(r,"onFocus",i);h&&this.editor.on("focus",h);const m=Ce(r,"onBlur",i);m&&this.editor.on("blur",m);const v=Ce(r,"onDestroy",i);v&&this.editor.on("destroy",v)})}static resolve(t){const n=jc.sort(jc.flatten(t)),r=axe(n.map(o=>o.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(o=>`'${o}'`).join(", ")}]. This can lead to issues.`),n}static flatten(t){return t.map(n=>{const r={name:n.name,options:n.options,storage:n.storage},o=Ce(n,"addExtensions",r);return o?[n,...this.flatten(o())]:n}).flat(10)}static sort(t){return t.sort((r,o)=>{const i=Ce(r,"priority")||100,s=Ce(o,"priority")||100;return i>s?-1:i{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:xw(n.name,this.schema)},o=Ce(n,"addCommands",r);return o?{...t,...o()}:t},{})}get plugins(){const{editor:t}=this,n=jc.sort([...this.extensions].reverse()),r=[],o=[],i=n.map(s=>{const a={name:s.name,options:s.options,storage:s.storage,editor:t,type:xw(s.name,this.schema)},c=[],u=Ce(s,"addKeyboardShortcuts",a);let f={};if(s.type==="mark"&&s.config.exitable&&(f.ArrowRight=()=>sr.handleExit({editor:t,mark:s})),u){const w=Object.fromEntries(Object.entries(u()).map(([P,b])=>[P,()=>b({editor:t})]));f={...f,...w}}const h=Sbe(f);c.push(h);const m=Ce(s,"addInputRules",a);FI(s,t.options.enableInputRules)&&m&&r.push(...m());const v=Ce(s,"addPasteRules",a);FI(s,t.options.enablePasteRules)&&v&&o.push(...v());const y=Ce(s,"addProseMirrorPlugins",a);if(y){const w=y();c.push(...w)}return c}).flat();return[txe({editor:t,rules:r}),...sxe({editor:t,rules:o}),...i]}get attributes(){return ZB(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:n}=u1(this.extensions);return Object.fromEntries(n.filter(r=>!!Ce(r,"addNodeView")).map(r=>{const o=this.attributes.filter(c=>c.type===r.name),i={name:r.name,options:r.options,storage:r.storage,editor:t,type:Nn(r.name,this.schema)},s=Ce(r,"addNodeView",i);if(!s)return[];const a=(c,u,f,h)=>{const m=zx(c,o);return s()({editor:t,node:c,getPos:f,decorations:h,HTMLAttributes:m,extension:r})};return[r.name,a]}))}}function lxe(e){return Object.prototype.toString.call(e).slice(8,-1)}function Pw(e){return lxe(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function f1(e,t){const n={...e};return Pw(e)&&Pw(t)&&Object.keys(t).forEach(r=>{Pw(t[r])?r in e?n[r]=f1(e[r],t[r]):Object.assign(n,{[r]:t[r]}):Object.assign(n,{[r]:t[r]})}),n}class Sr{constructor(t={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Ue(Ce(this,"addOptions",{name:this.name}))),this.storage=Ue(Ce(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new Sr(t)}configure(t={}){const n=this.extend();return n.options=f1(this.options,t),n.storage=Ue(Ce(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){const n=new Sr(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Ue(Ce(n,"addOptions",{name:n.name})),n.storage=Ue(Ce(n,"addStorage",{name:n.name,options:n.options})),n}}function YB(e,t,n){const{from:r,to:o}=t,{blockSeparator:i=` +`))),0,0):ye.empty;let h=e.someProp("clipboardTextParser",m=>m(t,o,r,e));if(h)a=h;else{let m=o.marks(),{schema:v}=e.state,y=Ti.fromSchema(v);s=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(w=>{let P=s.appendChild(document.createElement("p"));w&&P.appendChild(y.serializeNode(v.text(w,m)))})}}else e.someProp("transformPastedHTML",h=>{n=h(n,e)}),s=Mwe(n),oh&&Nwe(s);let u=s&&s.querySelector("[data-pm-slice]"),f=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(f&&f[3])for(let h=+f[3];h>0;h--){let m=s.firstChild;for(;m&&m.nodeType!=1;)m=m.nextSibling;if(!m)break;s=m}if(a||(a=(e.someProp("clipboardParser")||e.someProp("domParser")||vu.fromSchema(e.state.schema)).parseSlice(s,{preserveWhitespace:!!(c||f),context:o,ruleFromNode(m){return m.nodeName=="BR"&&!m.nextSibling&&m.parentNode&&!Ewe.test(m.parentNode.nodeName)?{ignore:!0}:null}})),f)a=Twe(kI(a,+f[1],+f[2]),f[4]);else if(a=ye.maxOpen($we(a.content,o),!0),a.openStart||a.openEnd){let h=0,m=0;for(let v=a.content.firstChild;h{a=h(a,e)}),a}const Ewe=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function $we(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let o=t.node(n).contentMatchAt(t.index(n)),i,s=[];if(e.forEach(a=>{if(!s)return;let c=o.findWrapping(a.type),u;if(!c)return s=null;if(u=s.length&&i.length&&EB(c,i,a,s[s.length-1],0))s[s.length-1]=u;else{s.length&&(s[s.length-1]=$B(s[s.length-1],i.length));let f=kB(a,c);s.push(f),o=o.matchType(f.type),i=c}}),s)return se.from(s)}return e}function kB(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,se.from(e));return e}function EB(e,t,n,r,o){if(o1&&(i=0),o=n&&(a=t<0?s.contentMatchAt(0).fillBefore(a,i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(se.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function kI(e,t,n){return t]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=NB().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e),o;if((o=r&&MB[r[1].toLowerCase()])&&(e=o.map(i=>"<"+i+">").join("")+e+o.map(i=>"").reverse().join("")),n.innerHTML=e,o)for(let i=0;i=0;a-=2){let c=n.nodes[r[a]];if(!c||c.hasRequiredAttrs())break;o=se.from(c.create(r[a+1],o)),i++,s++}return new ye(o,i,s)}const br={},xr={},Iwe={touchstart:!0,touchmove:!0};class jwe{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function Dwe(e){for(let t in br){let n=br[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=r=>{Lwe(e,r)&&!OO(e,r)&&(e.editable||!(r.type in xr))&&n(e,r)},Iwe[t]?{passive:!0}:void 0)}wr&&e.dom.addEventListener("input",()=>null),Lx(e)}function sa(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function Rwe(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function Lx(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=r=>OO(e,r))})}function OO(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function Lwe(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function zwe(e,t){!OO(e,t)&&br[t.type]&&(e.editable||!(t.type in xr))&&br[t.type](e,t)}xr.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!IB(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Xo&&or&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),wu&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();e.input.lastIOSEnter=r,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==r&&(e.someProp("handleKeyDown",o=>o(e,il(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",r=>r(e,n))||kwe(e,n)?n.preventDefault():sa(e,"key")};xr.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)};xr.keypress=(e,t)=>{let n=t;if(IB(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||To&&n.metaKey)return;if(e.someProp("handleKeyPress",o=>o(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof Ve)||!r.$from.sameParent(r.$to)){let o=String.fromCharCode(n.charCode);!/[\r\n]/.test(o)&&!e.someProp("handleTextInput",i=>i(e,r.$from.pos,r.$to.pos,o))&&e.dispatch(e.state.tr.insertText(o).scrollIntoView()),n.preventDefault()}};function a1(e){return{left:e.clientX,top:e.clientY}}function Awe(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function CO(e,t,n,r,o){if(r==-1)return!1;let i=e.state.doc.resolve(r);for(let s=i.depth+1;s>0;s--)if(e.someProp(t,a=>s>i.depth?a(e,n,i.nodeAfter,i.before(s),o,!0):a(e,n,i.node(s),i.before(s),o,!1)))return!0;return!1}function eu(e,t,n){e.focused||e.focus();let r=e.state.tr.setSelection(t);n=="pointer"&&r.setMeta("pointer",!0),e.dispatch(r)}function Bwe(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&De.isSelectable(r)?(eu(e,new De(n),"pointer"),!0):!1}function Fwe(e,t){if(t==-1)return!1;let n=e.state.selection,r,o;n instanceof De&&(r=n.node);let i=e.state.doc.resolve(t);for(let s=i.depth+1;s>0;s--){let a=s>i.depth?i.nodeAfter:i.node(s);if(De.isSelectable(a)){r&&n.$from.depth>0&&s>=n.$from.depth&&i.before(n.$from.depth+1)==n.$from.pos?o=i.before(n.$from.depth):o=i.before(s);break}}return o!=null?(eu(e,De.create(e.state.doc,o),"pointer"),!0):!1}function Vwe(e,t,n,r,o){return CO(e,"handleClickOn",t,n,r)||e.someProp("handleClick",i=>i(e,t,r))||(o?Fwe(e,n):Bwe(e,n))}function Hwe(e,t,n,r){return CO(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",o=>o(e,t,r))}function Wwe(e,t,n,r){return CO(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",o=>o(e,t,r))||Uwe(e,n,r)}function Uwe(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(eu(e,Ve.create(r,0,r.content.size),"pointer"),!0):!1;let o=r.resolve(t);for(let i=o.depth+1;i>0;i--){let s=i>o.depth?o.nodeAfter:o.node(i),a=o.before(i);if(s.inlineContent)eu(e,Ve.create(r,a+1,a+1+s.content.size),"pointer");else if(De.isSelectable(s))eu(e,De.create(r,a),"pointer");else continue;return!0}}function kO(e){return Qv(e)}const TB=To?"metaKey":"ctrlKey";br.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=kO(e),o=Date.now(),i="singleClick";o-e.input.lastClick.time<500&&Awe(n,e.input.lastClick)&&!n[TB]&&(e.input.lastClick.type=="singleClick"?i="doubleClick":e.input.lastClick.type=="doubleClick"&&(i="tripleClick")),e.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i};let s=e.posAtCoords(a1(n));s&&(i=="singleClick"?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new Zwe(e,s,n,!!r)):(i=="doubleClick"?Hwe:Wwe)(e,s.pos,s.inside,n)?n.preventDefault():sa(e,"pointer"))};class Zwe{constructor(t,n,r,o){this.view=t,this.pos=n,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!r[TB],this.allowDefault=r.shiftKey;let i,s;if(n.inside>-1)i=t.state.doc.nodeAt(n.inside),s=n.inside;else{let f=t.state.doc.resolve(n.pos);i=f.parent,s=f.depth?f.before():0}const a=o?null:r.target,c=a?t.docView.nearestDesc(a,!0):null;this.target=c?c.dom:null;let{selection:u}=t.state;(r.button==0&&i.type.spec.draggable&&i.type.spec.selectable!==!1||u instanceof De&&u.from<=s&&u.to>s)&&(this.mightDrag={node:i,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&li&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),sa(t,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>ps(this.view)),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(a1(t))),this.updateAllowDefault(t),this.allowDefault||!n?sa(this.view,"pointer"):Vwe(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||wr&&this.mightDrag&&!this.mightDrag.node.isAtom||or&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(eu(this.view,Ze.near(this.view.state.doc.resolve(n.pos)),"pointer"),t.preventDefault()):sa(this.view,"pointer")}move(t){this.updateAllowDefault(t),sa(this.view,"pointer"),t.buttons==0&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}br.touchstart=e=>{e.input.lastTouch=Date.now(),kO(e),sa(e,"pointer")};br.touchmove=e=>{e.input.lastTouch=Date.now(),sa(e,"pointer")};br.contextmenu=e=>kO(e);function IB(e,t){return e.composing?!0:wr&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const Gwe=Xo?5e3:-1;xr.compositionstart=xr.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))e.markCursor=e.state.storedMarks||n.marks(),Qv(e,!0),e.markCursor=null;else if(Qv(e),li&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=e.domSelectionRange();for(let o=r.focusNode,i=r.focusOffset;o&&o.nodeType==1&&i!=0;){let s=i<0?o.lastChild:o.childNodes[i-1];if(!s)break;if(s.nodeType==3){e.domSelection().collapse(s,s.nodeValue.length);break}else o=s,i=-1}}e.input.composing=!0}jB(e,Gwe)};xr.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,jB(e,20))};function jB(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Qv(e),t))}function DB(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Ywe());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Ywe(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function Qv(e,t=!1){if(!(Xo&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),DB(e),t||e.docView&&e.docView.dirty){let n=SO(e);return n&&!n.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(n)):e.updateState(e.state),!0}return!1}}function Kwe(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}const bu=Wr&&ba<15||wu&&Z_e<604;br.copy=xr.cut=(e,t)=>{let n=t,r=e.state.selection,o=n.type=="cut";if(r.empty)return;let i=bu?null:n.clipboardData,s=r.content(),{dom:a,text:c}=OB(e,s);i?(n.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",c)):Kwe(e,a),o&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function qwe(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function Jwe(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let o=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Cf(e,r.value,null,o,t):Cf(e,r.textContent,r.innerHTML,o,t)},50)}function Cf(e,t,n,r,o){let i=CB(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",c=>c(e,o,i||ye.empty)))return!0;if(!i)return!1;let s=qwe(i),a=s?e.state.tr.replaceSelectionWith(s,r):e.state.tr.replaceSelection(i);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}xr.paste=(e,t)=>{let n=t;if(e.composing&&!Xo)return;let r=bu?null:n.clipboardData,o=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&Cf(e,r.getData("text/plain"),r.getData("text/html"),o,n)?n.preventDefault():Jwe(e,n)};class Qwe{constructor(t,n){this.slice=t,this.move=n}}const RB=To?"altKey":"ctrlKey";br.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o=e.state.selection,i=o.empty?null:e.posAtCoords(a1(n));if(!(i&&i.pos>=o.from&&i.pos<=(o instanceof De?o.to-1:o.to))){if(r&&r.mightDrag)e.dispatch(e.state.tr.setSelection(De.create(e.state.doc,r.mightDrag.pos)));else if(n.target&&n.target.nodeType==1){let u=e.docView.nearestDesc(n.target,!0);u&&u.node.type.spec.draggable&&u!=e.docView&&e.dispatch(e.state.tr.setSelection(De.create(e.state.doc,u.posBefore)))}}let s=e.state.selection.content(),{dom:a,text:c}=OB(e,s);n.dataTransfer.clearData(),n.dataTransfer.setData(bu?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",bu||n.dataTransfer.setData("text/plain",c),e.dragging=new Qwe(s,!n[RB])};br.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)};xr.dragover=xr.dragenter=(e,t)=>t.preventDefault();xr.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let o=e.posAtCoords(a1(n));if(!o)return;let i=e.state.doc.resolve(o.pos),s=r&&r.slice;s?e.someProp("transformPasted",y=>{s=y(s,e)}):s=CB(e,n.dataTransfer.getData(bu?"Text":"text/plain"),bu?null:n.dataTransfer.getData("text/html"),!1,i);let a=!!(r&&!n[RB]);if(e.someProp("handleDrop",y=>y(e,n,s||ye.empty,a))){n.preventDefault();return}if(!s)return;n.preventDefault();let c=s?tB(e.state.doc,i.pos,s):i.pos;c==null&&(c=i.pos);let u=e.state.tr;a&&u.deleteSelection();let f=u.mapping.map(c),h=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,m=u.doc;if(h?u.replaceRangeWith(f,f,s.content.firstChild):u.replaceRange(f,f,s),u.doc.eq(m))return;let v=u.doc.resolve(f);if(h&&De.isSelectable(s.content.firstChild)&&v.nodeAfter&&v.nodeAfter.sameMarkup(s.content.firstChild))u.setSelection(new De(v));else{let y=u.mapping.map(c);u.mapping.maps[u.mapping.maps.length-1].forEach((w,P,b,S)=>y=S),u.setSelection(PO(e,v,u.doc.resolve(y)))}e.focus(),e.dispatch(u.setMeta("uiEvent","drop"))};br.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&ps(e)},20))};br.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)};br.beforeinput=(e,t)=>{if(or&&Xo&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:r}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=r||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",i=>i(e,il(8,"Backspace")))))return;let{$cursor:o}=e.state.selection;o&&o.pos>0&&e.dispatch(e.state.tr.delete(o.pos-1,o.pos).scrollIntoView())},50)}};for(let e in xr)br[e]=xr[e];function kf(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class Xv{constructor(t,n){this.toDOM=t,this.spec=n||kl,this.side=this.spec.side||0}map(t,n,r,o){let{pos:i,deleted:s}=t.mapResult(n.from+o,this.side<0?-1:1);return s?null:new Lo(i-r,i-r,this)}valid(){return!0}eq(t){return this==t||t instanceof Xv&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&kf(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class Sa{constructor(t,n){this.attrs=t,this.spec=n||kl}map(t,n,r,o){let i=t.map(n.from+o,this.spec.inclusiveStart?-1:1)-r,s=t.map(n.to+o,this.spec.inclusiveEnd?1:-1)-r;return i>=s?null:new Lo(i,s,this)}valid(t,n){return n.from=t&&(!i||i(a.spec))&&r.push(a.copy(a.from+o,a.to+o))}for(let s=0;st){let a=this.children[s]+1;this.children[s+2].findInner(t-a,n-a,r,o+a,i)}}map(t,n,r){return this==tr||t.maps.length==0?this:this.mapInner(t,n,0,0,r||kl)}mapInner(t,n,r,o,i){let s;for(let a=0;a{let u=c+r,f;if(f=zB(n,a,u)){for(o||(o=this.children.slice());ia&&h.to=t){this.children[a]==t&&(r=this.children[a+2]);break}let i=t+1,s=i+n.content.size;for(let a=0;ai&&c.type instanceof Sa){let u=Math.max(i,c.from)-i,f=Math.min(s,c.to)-i;uo.map(t,n,kl));return Qs.from(r)}forChild(t,n){if(n.isLeaf)return vn.empty;let r=[];for(let o=0;on instanceof vn)?t:t.reduce((n,r)=>n.concat(r instanceof vn?r:r.members),[]))}}}function Xwe(e,t,n,r,o,i,s){let a=e.slice();for(let u=0,f=i;u{let P=w-y-(v-m);for(let b=0;bS+f-h)continue;let O=a[b]+f-h;v>=O?a[b+1]=m<=O?-2:-1:y>=o&&P&&(a[b]+=P,a[b+1]+=P)}h+=P}),f=n.maps[u].map(f,-1)}let c=!1;for(let u=0;u=r.content.size){c=!0;continue}let m=n.map(e[u+1]+i,-1),v=m-o,{index:y,offset:w}=r.content.findIndex(h),P=r.maybeChild(y);if(P&&w==h&&w+P.nodeSize==v){let b=a[u+2].mapInner(n,P,f+1,e[u]+i+1,s);b!=tr?(a[u]=h,a[u+1]=v,a[u+2]=b):(a[u+1]=-2,c=!0)}else c=!0}if(c){let u=ebe(a,e,t,n,o,i,s),f=ey(u,r,0,s);t=f.local;for(let h=0;hn&&s.to{let u=zB(e,a,c+n);if(u){i=!0;let f=ey(u,a,n+c+1,r);f!=tr&&o.push(c,c+a.nodeSize,f)}});let s=LB(i?AB(e):e,-n).sort(El);for(let a=0;a0;)t++;e.splice(t,0,n)}function yw(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=tr&&t.push(r)}),e.cursorWrapper&&t.push(vn.create(e.state.doc,[e.cursorWrapper.deco])),Qs.from(t)}const tbe={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},nbe=Wr&&ba<=11;class rbe{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class obe{constructor(t,n){this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new rbe,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let o=0;oo.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():this.flush()}),nbe&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,tbe)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let n=0;nthis.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(bI(this.view)){if(this.suppressingSelectionUpdates)return ps(this.view);if(Wr&&ba<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&Ll(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let n=new Set,r;for(let i=t.focusNode;i;i=Of(i))n.add(i);for(let i=t.anchorNode;i;i=Of(i))if(n.has(i)){r=i;break}let o=r&&this.view.docView.nearestDesc(r);if(o&&o.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=t.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&bI(t)&&!this.ignoreSelectionChange(r),i=-1,s=-1,a=!1,c=[];if(t.editable)for(let f=0;f1){let f=c.filter(h=>h.nodeName=="BR");if(f.length==2){let h=f[0],m=f[1];h.parentNode&&h.parentNode.parentNode==m.parentNode?m.remove():h.remove()}}let u=null;i<0&&o&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)-1||o)&&(i>-1&&(t.docView.markDirty(i,s),ibe(t)),this.handleDOMChange(i,s,a,c),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(r)||ps(t),this.currentSelection.set(r))}registerMutation(t,n){if(n.indexOf(t.target)>-1)return null;let r=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(r==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!r||r.ignoreMutation(t))return null;if(t.type=="childList"){for(let f=0;fo;P--){let b=r.childNodes[P-1],S=b.pmViewDesc;if(b.nodeName=="BR"&&!S){i=P;break}if(!S||S.size)break}let h=e.state.doc,m=e.someProp("domParser")||vu.fromSchema(e.state.schema),v=h.resolve(s),y=null,w=m.parse(r,{topNode:v.parent,topMatch:v.parent.contentMatchAt(v.index()),topOpen:!0,from:o,to:i,preserveWhitespace:v.parent.type.whitespace=="pre"?"full":!0,findPositions:u,ruleFromNode:lbe,context:v});if(u&&u[0].pos!=null){let P=u[0].pos,b=u[1]&&u[1].pos;b==null&&(b=P),y={anchor:P+s,head:b+s}}return{doc:w,sel:y,from:s,to:a}}function lbe(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName=="BR"&&e.parentNode){if(wr&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(e.parentNode.lastChild==e||wr&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}const cbe=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function ube(e,t,n,r,o){let i=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let B=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,z=SO(e,B);if(z&&!e.state.selection.eq(z)){if(or&&Xo&&e.input.lastKeyCode===13&&Date.now()-100Q(e,il(13,"Enter"))))return;let G=e.state.tr.setSelection(z);B=="pointer"?G.setMeta("pointer",!0):B=="key"&&G.scrollIntoView(),i&&G.setMeta("composition",i),e.dispatch(G)}return}let s=e.state.doc.resolve(t),a=s.sharedDepth(n);t=s.before(a+1),n=e.state.doc.resolve(n).after(a+1);let c=e.state.selection,u=abe(e,t,n),f=e.state.doc,h=f.slice(u.from,u.to),m,v;e.input.lastKeyCode===8&&Date.now()-100Date.now()-225||Xo)&&o.some(B=>B.nodeType==1&&!cbe.test(B.nodeName))&&(!y||y.endA>=y.endB)&&e.someProp("handleKeyDown",B=>B(e,il(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!y)if(r&&c instanceof Ve&&!c.empty&&c.$head.sameParent(c.$anchor)&&!e.composing&&!(u.sel&&u.sel.anchor!=u.sel.head))y={start:c.from,endA:c.to,endB:c.to};else{if(u.sel){let B=TI(e,e.state.doc,u.sel);if(B&&!B.eq(e.state.selection)){let z=e.state.tr.setSelection(B);i&&z.setMeta("composition",i),e.dispatch(z)}}return}if(or&&e.cursorWrapper&&u.sel&&u.sel.anchor==e.cursorWrapper.deco.from&&u.sel.head==u.sel.anchor){let B=y.endB-y.start;u.sel={anchor:u.sel.anchor+B,head:u.sel.anchor+B}}e.input.domChangeCount++,e.state.selection.frome.state.selection.from&&y.start<=e.state.selection.from+2&&e.state.selection.from>=u.from?y.start=e.state.selection.from:y.endA=e.state.selection.to-2&&e.state.selection.to<=u.to&&(y.endB+=e.state.selection.to-y.endA,y.endA=e.state.selection.to)),Wr&&ba<=11&&y.endB==y.start+1&&y.endA==y.start&&y.start>u.from&&u.doc.textBetween(y.start-u.from-1,y.start-u.from+1)=="  "&&(y.start--,y.endA--,y.endB--);let w=u.doc.resolveNoCache(y.start-u.from),P=u.doc.resolveNoCache(y.endB-u.from),b=f.resolve(y.start),S=w.sameParent(P)&&w.parent.inlineContent&&b.end()>=y.endA,O;if((wu&&e.input.lastIOSEnter>Date.now()-225&&(!S||o.some(B=>B.nodeName=="DIV"||B.nodeName=="P"))||!S&&w.posB(e,il(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>y.start&&fbe(f,y.start,y.endA,w,P)&&e.someProp("handleKeyDown",B=>B(e,il(8,"Backspace")))){Xo&&or&&e.domObserver.suppressSelectionUpdates();return}or&&Xo&&y.endB==y.start&&(e.input.lastAndroidDelete=Date.now()),Xo&&!S&&w.start()!=P.start()&&P.parentOffset==0&&w.depth==P.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==y.endA&&(y.endB-=2,P=u.doc.resolveNoCache(y.endB-u.from),setTimeout(()=>{e.someProp("handleKeyDown",function(B){return B(e,il(13,"Enter"))})},20));let E=y.start,$=y.endA,N,I,R;if(S){if(w.pos==P.pos)Wr&&ba<=11&&w.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>ps(e),20)),N=e.state.tr.delete(E,$),I=f.resolve(y.start).marksAcross(f.resolve(y.endA));else if(y.endA==y.endB&&(R=dbe(w.parent.content.cut(w.parentOffset,P.parentOffset),b.parent.content.cut(b.parentOffset,y.endA-b.start()))))N=e.state.tr,R.type=="add"?N.addMark(E,$,R.mark):N.removeMark(E,$,R.mark);else if(w.parent.child(w.index()).isText&&w.index()==P.index()-(P.textOffset?0:1)){let B=w.parent.textBetween(w.parentOffset,P.parentOffset);if(e.someProp("handleTextInput",z=>z(e,E,$,B)))return;N=e.state.tr.insertText(B,E,$)}}if(N||(N=e.state.tr.replace(E,$,u.doc.slice(y.start-u.from,y.endB-u.from))),u.sel){let B=TI(e,N.doc,u.sel);B&&!(or&&Xo&&e.composing&&B.empty&&(y.start!=y.endB||e.input.lastAndroidDeletet.content.size?null:PO(e,t.resolve(n.anchor),t.resolve(n.head))}function dbe(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,o=n,i=r,s,a,c;for(let f=0;ff.mark(a.addToSet(f.marks));else if(o.length==0&&i.length==1)a=i[0],s="remove",c=f=>f.mark(a.removeFromSet(f.marks));else return null;let u=[];for(let f=0;fn||_w(s,!0,!1)0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,o++,t=!1;if(n){let i=e.node(r).maybeChild(e.indexAfter(r));for(;i&&!i.isLeaf;)i=i.firstChild,o++}return o}function hbe(e,t,n,r,o){let i=e.findDiffStart(t,n);if(i==null)return null;let{a:s,b:a}=e.findDiffEnd(t,n+e.size,n+t.size);if(o=="end"){let c=Math.max(0,i-Math.min(s,a));r-=s+c-i}if(s=s?i-r:0;i-=c,a=i+(a-s),s=i}else if(a=a?i-r:0;i-=c,s=i+(s-a),a=i}return{start:i,endA:s,endB:a}}class pbe{constructor(t,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new jwe,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(LI),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):typeof t=="function"?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=DI(this),jI(this),this.nodeViews=RI(this),this.docView=mI(this.state.doc,II(this),yw(this),this.dom,this),this.domObserver=new obe(this,(r,o,i,s)=>ube(this,r,o,i,s)),this.domObserver.start(),Dwe(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let n in t)this._props[n]=t[n];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&Lx(this);let n=this._props;this._props=t,t.plugins&&(t.plugins.forEach(LI),this.directPlugins=t.plugins),this.updateStateInner(t.state,n)}setProps(t){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in t)n[r]=t[r];this.update(n)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,n){let r=this.state,o=!1,i=!1;t.storedMarks&&this.composing&&(DB(this),i=!0),this.state=t;let s=r.plugins!=t.plugins||this._props.plugins!=n.plugins;if(s||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let m=RI(this);gbe(m,this.nodeViews)&&(this.nodeViews=m,o=!0)}(s||n.handleDOMEvents!=this._props.handleDOMEvents)&&Lx(this),this.editable=DI(this),jI(this);let a=yw(this),c=II(this),u=r.plugins!=t.plugins&&!r.doc.eq(t.doc)?"reset":t.scrollToSelection>r.scrollToSelection?"to selection":"preserve",f=o||!this.docView.matchesNode(t.doc,c,a);(f||!t.selection.eq(r.selection))&&(i=!0);let h=u=="preserve"&&i&&this.dom.style.overflowAnchor==null&&K_e(this);if(i){this.domObserver.stop();let m=f&&(Wr||or)&&!this.composing&&!r.selection.empty&&!t.selection.empty&&mbe(r.selection,t.selection);if(f){let v=or?this.trackWrites=this.domSelectionRange().focusNode:null;(o||!this.docView.update(t.doc,c,a,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=mI(t.doc,c,a,this.dom,this)),v&&!this.trackWrites&&(m=!0)}m||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&wwe(this))?ps(this,m):(xB(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():h&&q_e(h)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof De){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&cI(this,n.getBoundingClientRect(),t)}else cI(this,this.coordsAtPos(this.state.selection.head,1),t)}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(!t||t.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;nn.ownerDocument.getSelection()),this._root=n}return t||document}updateRoot(){this._root=null}posAtCoords(t){return nwe(this,t)}coordsAtPos(t,n=1){return pB(this,t,n)}domAtPos(t,n=0){return this.docView.domFromPos(t,n)}nodeDOM(t){let n=this.docView.descAt(t);return n?n.nodeDOM:null}posAtDOM(t,n,r=-1){let o=this.docView.posFromDOM(t,n,r);if(o==null)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(t,n){return awe(this,n||this.state,t)}pasteHTML(t,n){return Cf(this,"",t,!1,n||new ClipboardEvent("paste"))}pasteText(t,n){return Cf(this,t,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(Rwe(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],yw(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent(t){return zwe(this,t)}dispatch(t){let n=this._props.dispatchTransaction;n?n.call(this,t):this.updateState(this.state.apply(t))}domSelectionRange(){return wr&&this.root.nodeType===11&&V_e(this.dom.ownerDocument)==this.dom?sbe(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function II(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(e.state)),n)for(let r in n)r=="class"?t.class+=" "+n[r]:r=="style"?t.style=(t.style?t.style+";":"")+n[r]:!t[r]&&r!="contenteditable"&&r!="nodeName"&&(t[r]=String(n[r]))}),t.translate||(t.translate="no"),[Lo.node(0,e.state.doc.content.size,t)]}function jI(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:Lo.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function DI(e){return!e.someProp("editable",t=>t(e.state)===!1)}function mbe(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function RI(e){let t=Object.create(null);function n(r){for(let o in r)Object.prototype.hasOwnProperty.call(t,o)||(t[o]=r[o])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function gbe(e,t){let n=0,r=0;for(let o in e){if(e[o]!=t[o])return!0;n++}for(let o in t)r++;return n!=r}function LI(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Ma={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},ty={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},vbe=typeof navigator<"u"&&/Mac/.test(navigator.platform),ybe=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Fn=0;Fn<10;Fn++)Ma[48+Fn]=Ma[96+Fn]=String(Fn);for(var Fn=1;Fn<=24;Fn++)Ma[Fn+111]="F"+Fn;for(var Fn=65;Fn<=90;Fn++)Ma[Fn]=String.fromCharCode(Fn+32),ty[Fn]=String.fromCharCode(Fn);for(var ww in Ma)ty.hasOwnProperty(ww)||(ty[ww]=Ma[ww]);function _be(e){var t=vbe&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||ybe&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?ty:Ma)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const wbe=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function bbe(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let r,o,i,s;for(let a=0;a127)&&(i=Ma[r.keyCode])&&i!=o){let a=t[bw(i,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}const Pbe=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function Obe(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const Cbe=(e,t,n)=>{let r=Obe(e,n);if(!r)return!1;let o=FB(r);if(!o){let s=r.blockRange(),a=s&&ju(s);return a==null?!1:(t&&t(e.tr.lift(s,a).scrollIntoView()),!0)}let i=o.nodeBefore;if(!i.type.spec.isolating&&WB(e,o,t))return!0;if(r.parent.content.size==0&&(xu(i,"end")||De.isSelectable(i))){let s=_O(e.doc,r.before(),r.after(),ye.empty);if(s&&s.slice.size{let{$head:r,empty:o}=e.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;i=FB(r)}let s=i&&i.nodeBefore;return!s||!De.isSelectable(s)?!1:(t&&t(e.tr.setSelection(De.create(e.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)};function FB(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function Ebe(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset{let r=Ebe(e,n);if(!r)return!1;let o=VB(r);if(!o)return!1;let i=o.nodeAfter;if(WB(e,o,t))return!0;if(r.parent.content.size==0&&(xu(i,"start")||De.isSelectable(i))){let s=_O(e.doc,r.before(),r.after(),ye.empty);if(s&&s.slice.size{let{$head:r,empty:o}=e.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset=0;t--){let n=e.node(t);if(e.index(t)+1{let n=e.selection,r=n instanceof De,o;if(r){if(n.node.isTextblock||!Aa(e.doc,n.from))return!1;o=n.from}else if(o=r1(e.doc,n.from,-1),o==null)return!1;if(t){let i=e.tr.join(o);r&&i.setSelection(De.create(i.doc,o-e.doc.resolve(o).nodeBefore.nodeSize)),t(i.scrollIntoView())}return!0},Tbe=(e,t)=>{let n=e.selection,r;if(n instanceof De){if(n.node.isTextblock||!Aa(e.doc,n.to))return!1;r=n.to}else if(r=r1(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},Ibe=(e,t)=>{let{$from:n,$to:r}=e.selection,o=n.blockRange(r),i=o&&ju(o);return i==null?!1:(t&&t(e.tr.lift(o,i).scrollIntoView()),!0)},jbe=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(` +`).scrollIntoView()),!0)};function HB(e){for(let t=0;t{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),i=n.indexAfter(-1),s=HB(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(t){let a=n.after(),c=e.tr.replaceWith(a,a,s.createAndFill());c.setSelection(Ze.near(c.doc.resolve(a),1)),t(c.scrollIntoView())}return!0},Rbe=(e,t)=>{let n=e.selection,{$from:r,$to:o}=n;if(n instanceof ri||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=HB(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(t){let s=(!r.parentOffset&&o.index(){let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if(Qc(e.doc,i))return t&&t(e.tr.split(i).scrollIntoView()),!0}let r=n.blockRange(),o=r&&ju(r);return o==null?!1:(t&&t(e.tr.lift(r,o).scrollIntoView()),!0)},zbe=(e,t)=>{let{$from:n,to:r}=e.selection,o,i=n.sharedDepth(r);return i==0?!1:(o=n.before(i),t&&t(e.tr.setSelection(De.create(e.doc,o))),!0)};function Abe(e,t,n){let r=t.nodeBefore,o=t.nodeAfter,i=t.index();return!r||!o||!r.type.compatibleContent(o.type)?!1:!r.content.size&&t.parent.canReplace(i-1,i)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(i,i+1)||!(o.isTextblock||Aa(e.doc,t.pos))?!1:(n&&n(e.tr.clearIncompatible(t.pos,r.type,r.contentMatchAt(r.childCount)).join(t.pos).scrollIntoView()),!0)}function WB(e,t,n){let r=t.nodeBefore,o=t.nodeAfter,i,s;if(r.type.spec.isolating||o.type.spec.isolating)return!1;if(Abe(e,t,n))return!0;let a=t.parent.canReplace(t.index(),t.index()+1);if(a&&(i=(s=r.contentMatchAt(r.childCount)).findWrapping(o.type))&&s.matchType(i[0]||o.type).validEnd){if(n){let h=t.pos+o.nodeSize,m=se.empty;for(let w=i.length-1;w>=0;w--)m=se.from(i[w].create(null,m));m=se.from(r.copy(m));let v=e.tr.step(new $n(t.pos-1,h,t.pos,h,new ye(m,1,0),i.length,!0)),y=h+2*i.length;Aa(v.doc,y)&&v.join(y),n(v.scrollIntoView())}return!0}let c=Ze.findFrom(t,1),u=c&&c.$from.blockRange(c.$to),f=u&&ju(u);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(u,f).scrollIntoView()),!0;if(a&&xu(o,"start",!0)&&xu(r,"end")){let h=r,m=[];for(;m.push(h),!h.isTextblock;)h=h.lastChild;let v=o,y=1;for(;!v.isTextblock;v=v.firstChild)y++;if(h.canReplace(h.childCount,h.childCount,v.content)){if(n){let w=se.empty;for(let b=m.length-1;b>=0;b--)w=se.from(m[b].copy(w));let P=e.tr.step(new $n(t.pos-m.length,t.pos+o.nodeSize,t.pos+y,t.pos+o.nodeSize-y,new ye(w,m.length,0),0,!0));n(P.scrollIntoView())}return!0}}return!1}function UB(e){return function(t,n){let r=t.selection,o=e<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return o.node(i).isTextblock?(n&&n(t.tr.setSelection(Ve.create(t.doc,e<0?o.start(i):o.end(i)))),!0):!1}}const Bbe=UB(-1),Fbe=UB(1);function Vbe(e,t=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),a=s&&yO(s,e,t);return a?(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0):!1}}function zI(e,t=null){return function(n,r){let o=!1;for(let i=0;i{if(o)return!1;if(!(!c.isTextblock||c.hasMarkup(e,t)))if(c.type==e)o=!0;else{let f=n.doc.resolve(u),h=f.index();o=f.parent.canReplaceWith(h,h+1,e)}})}if(!o)return!1;if(r){let i=n.tr;for(let s=0;s=2&&o.node(s.depth-1).type.compatibleContent(e)&&s.startIndex==0){if(o.index(s.depth-1)==0)return!1;let f=n.doc.resolve(s.start-2);c=new Gv(f,f,s.depth),s.endIndex=0;f--)i=se.from(n[f].type.create(n[f].attrs,i));e.step(new $n(t.start-(r?2:0),t.end,t.start,t.end,new ye(i,0,0),n.length,!0));let s=0;for(let f=0;fs.childCount>0&&s.firstChild.type==e);return i?n?r.node(i.depth-1).type==e?Zbe(t,n,e,i):Gbe(t,n,i):!0:!1}}function Zbe(e,t,n,r){let o=e.tr,i=r.end,s=r.$to.end(r.depth);iw;y--)v-=o.child(y).nodeSize,r.delete(v-1,v+1);let i=r.doc.resolve(n.start),s=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,c=n.endIndex==o.childCount,u=i.node(-1),f=i.index(-1);if(!u.canReplace(f+(a?0:1),f+1,s.content.append(c?se.empty:se.from(o))))return!1;let h=i.pos,m=h+s.nodeSize;return r.step(new $n(h-(a?1:0),m+(c?1:0),h+1,m-1,new ye((a?se.empty:se.from(o.copy(se.empty))).append(c?se.empty:se.from(o.copy(se.empty))),a?0:1,c?0:1),a?0:1)),t(r.scrollIntoView()),!0}function Ybe(e){return function(t,n){let{$from:r,$to:o}=t.selection,i=r.blockRange(o,u=>u.childCount>0&&u.firstChild.type==e);if(!i)return!1;let s=i.startIndex;if(s==0)return!1;let a=i.parent,c=a.child(s-1);if(c.type!=e)return!1;if(n){let u=c.lastChild&&c.lastChild.type==a.type,f=se.from(u?e.create():null),h=new ye(se.from(e.create(null,se.from(a.type.create(null,f)))),u?3:1,0),m=i.start,v=i.end;n(t.tr.step(new $n(m-(u?3:1),v,m,v,h,1,!0)).scrollIntoView())}return!0}}function l1(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:o}=n,{storedMarks:i}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),filterTransaction:t.filterTransaction,plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return i},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,i=n.storedMarks,n}}}class c1{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:n,state:r}=this,{view:o}=n,{tr:i}=r,s=this.buildProps(i);return Object.fromEntries(Object.entries(t).map(([a,c])=>[a,(...f)=>{const h=c(...f)(s);return!i.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(i),h}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,n=!0){const{rawCommands:r,editor:o,state:i}=this,{view:s}=o,a=[],c=!!t,u=t||i.tr,f=()=>(!c&&n&&!u.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(u),a.every(m=>m===!0)),h={...Object.fromEntries(Object.entries(r).map(([m,v])=>[m,(...w)=>{const P=this.buildProps(u,n),b=v(...w)(P);return a.push(b),h}])),run:f};return h}createCan(t){const{rawCommands:n,state:r}=this,o=!1,i=t||r.tr,s=this.buildProps(i,o);return{...Object.fromEntries(Object.entries(n).map(([c,u])=>[c,(...f)=>u(...f)({...s,dispatch:void 0})])),chain:()=>this.createChain(i,o)}}buildProps(t,n=!0){const{rawCommands:r,editor:o,state:i}=this,{view:s}=o,a={tr:t,editor:o,view:s,state:l1({state:i,transaction:t}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(t,n),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(r).map(([c,u])=>[c,(...f)=>u(...f)(a)]))}};return a}}class Kbe{constructor(){this.callbacks={}}on(t,n){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(n),this}emit(t,...n){const r=this.callbacks[t];return r&&r.forEach(o=>o.apply(this,n)),this}off(t,n){const r=this.callbacks[t];return r&&(n?this.callbacks[t]=r.filter(o=>o!==n):delete this.callbacks[t]),this}removeAllListeners(){this.callbacks={}}}function Ce(e,t,n){return e.config[t]===void 0&&e.parent?Ce(e.parent,t,n):typeof e.config[t]=="function"?e.config[t].bind({...n,parent:e.parent?Ce(e.parent,t,n):null}):e.config[t]}function u1(e){const t=e.filter(o=>o.type==="extension"),n=e.filter(o=>o.type==="node"),r=e.filter(o=>o.type==="mark");return{baseExtensions:t,nodeExtensions:n,markExtensions:r}}function ZB(e){const t=[],{nodeExtensions:n,markExtensions:r}=u1(e),o=[...n,...r],i={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage},c=Ce(s,"addGlobalAttributes",a);if(!c)return;c().forEach(f=>{f.types.forEach(h=>{Object.entries(f.attributes).forEach(([m,v])=>{t.push({type:h,name:m,attribute:{...i,...v}})})})})}),o.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage},c=Ce(s,"addAttributes",a);if(!c)return;const u=c();Object.entries(u).forEach(([f,h])=>{const m={...i,...h};typeof m?.default=="function"&&(m.default=m.default()),m?.isRequired&&m?.default===void 0&&delete m.default,t.push({type:s.name,name:f,attribute:m})})}),t}function Nn(e,t){if(typeof e=="string"){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}function kt(...e){return e.filter(t=>!!t).reduce((t,n)=>{const r={...t};return Object.entries(n).forEach(([o,i])=>{if(!r[o]){r[o]=i;return}if(o==="class"){const a=i?i.split(" "):[],c=r[o]?r[o].split(" "):[],u=a.filter(f=>!c.includes(f));r[o]=[...c,...u].join(" ")}else o==="style"?r[o]=[r[o],i].join("; "):r[o]=i}),r},{})}function zx(e,t){return t.filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(e.attrs)||{}:{[n.name]:e.attrs[n.name]}).reduce((n,r)=>kt(n,r),{})}function GB(e){return typeof e=="function"}function Ue(e,t=void 0,...n){return GB(e)?t?e.bind(t)(...n):e(...n):e}function qbe(e={}){return Object.keys(e).length===0&&e.constructor===Object}function Jbe(e){return typeof e!="string"?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e==="true"?!0:e==="false"?!1:e}function AI(e,t){return e.style?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;const o=t.reduce((i,s)=>{const a=s.attribute.parseHTML?s.attribute.parseHTML(n):Jbe(n.getAttribute(s.name));return a==null?i:{...i,[s.name]:a}},{});return{...r,...o}}}}function BI(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>t==="attrs"&&qbe(n)?!1:n!=null))}function Qbe(e,t){var n;const r=ZB(e),{nodeExtensions:o,markExtensions:i}=u1(e),s=(n=o.find(u=>Ce(u,"topNode")))===null||n===void 0?void 0:n.name,a=Object.fromEntries(o.map(u=>{const f=r.filter(b=>b.type===u.name),h={name:u.name,options:u.options,storage:u.storage,editor:t},m=e.reduce((b,S)=>{const O=Ce(S,"extendNodeSchema",h);return{...b,...O?O(u):{}}},{}),v=BI({...m,content:Ue(Ce(u,"content",h)),marks:Ue(Ce(u,"marks",h)),group:Ue(Ce(u,"group",h)),inline:Ue(Ce(u,"inline",h)),atom:Ue(Ce(u,"atom",h)),selectable:Ue(Ce(u,"selectable",h)),draggable:Ue(Ce(u,"draggable",h)),code:Ue(Ce(u,"code",h)),defining:Ue(Ce(u,"defining",h)),isolating:Ue(Ce(u,"isolating",h)),attrs:Object.fromEntries(f.map(b=>{var S;return[b.name,{default:(S=b?.attribute)===null||S===void 0?void 0:S.default}]}))}),y=Ue(Ce(u,"parseHTML",h));y&&(v.parseDOM=y.map(b=>AI(b,f)));const w=Ce(u,"renderHTML",h);w&&(v.toDOM=b=>w({node:b,HTMLAttributes:zx(b,f)}));const P=Ce(u,"renderText",h);return P&&(v.toText=P),[u.name,v]})),c=Object.fromEntries(i.map(u=>{const f=r.filter(P=>P.type===u.name),h={name:u.name,options:u.options,storage:u.storage,editor:t},m=e.reduce((P,b)=>{const S=Ce(b,"extendMarkSchema",h);return{...P,...S?S(u):{}}},{}),v=BI({...m,inclusive:Ue(Ce(u,"inclusive",h)),excludes:Ue(Ce(u,"excludes",h)),group:Ue(Ce(u,"group",h)),spanning:Ue(Ce(u,"spanning",h)),code:Ue(Ce(u,"code",h)),attrs:Object.fromEntries(f.map(P=>{var b;return[P.name,{default:(b=P?.attribute)===null||b===void 0?void 0:b.default}]}))}),y=Ue(Ce(u,"parseHTML",h));y&&(v.parseDOM=y.map(P=>AI(P,f)));const w=Ce(u,"renderHTML",h);return w&&(v.toDOM=P=>w({mark:P,HTMLAttributes:zx(P,f)})),[u.name,v]}));return new a_e({topNode:s,nodes:a,marks:c})}function xw(e,t){return t.nodes[e]||t.marks[e]||null}function FI(e,t){return Array.isArray(t)?t.some(n=>(typeof n=="string"?n:n.name)===e.name):t}const Xbe=(e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(o,i,s,a)=>{var c,u;const f=((u=(c=o.type.spec).toText)===null||u===void 0?void 0:u.call(c,{node:o,pos:i,parent:s,index:a}))||o.textContent||"%leaf%";n+=f.slice(0,Math.max(0,r-i))}),n};function MO(e){return Object.prototype.toString.call(e)==="[object RegExp]"}class d1{constructor(t){this.find=t.find,this.handler=t.handler}}const exe=(e,t)=>{if(MO(t))return t.exec(e);const n=t(e);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function Sw(e){var t;const{editor:n,from:r,to:o,text:i,rules:s,plugin:a}=e,{view:c}=n;if(c.composing)return!1;const u=c.state.doc.resolve(r);if(u.parent.type.spec.code||!((t=u.nodeBefore||u.nodeAfter)===null||t===void 0)&&t.marks.find(m=>m.type.spec.code))return!1;let f=!1;const h=Xbe(u)+i;return s.forEach(m=>{if(f)return;const v=exe(h,m.find);if(!v)return;const y=c.state.tr,w=l1({state:c.state,transaction:y}),P={from:r-(v[0].length-i.length),to:o},{commands:b,chain:S,can:O}=new c1({editor:n,state:w});m.handler({state:w,range:P,match:v,commands:b,chain:S,can:O})===null||!y.steps.length||(y.setMeta(a,{transform:y,from:r,to:o,text:i}),c.dispatch(y),f=!0)}),f}function txe(e){const{editor:t,rules:n}=e,r=new Kr({state:{init(){return null},apply(o,i){const s=o.getMeta(r);return s||(o.selectionSet||o.docChanged?null:i)}},props:{handleTextInput(o,i,s,a){return Sw({editor:t,from:i,to:s,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:o=>(setTimeout(()=>{const{$cursor:i}=o.state.selection;i&&Sw({editor:t,from:i.pos,to:i.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(o,i){if(i.key!=="Enter")return!1;const{$cursor:s}=o.state.selection;return s?Sw({editor:t,from:s.pos,to:s.pos,text:` +`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function nxe(e){return typeof e=="number"}class rxe{constructor(t){this.find=t.find,this.handler=t.handler}}const oxe=(e,t)=>{if(MO(t))return[...e.matchAll(t)];const n=t(e);return n?n.map(r=>{const o=[r.text];return o.index=r.index,o.input=e,o.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(r.replaceWith)),o}):[]};function ixe(e){const{editor:t,state:n,from:r,to:o,rule:i,pasteEvent:s,dropEvent:a}=e,{commands:c,chain:u,can:f}=new c1({editor:t,state:n}),h=[];return n.doc.nodesBetween(r,o,(v,y)=>{if(!v.isTextblock||v.type.spec.code)return;const w=Math.max(r,y),P=Math.min(o,y+v.content.size),b=v.textBetween(w-y,P-y,void 0,"");oxe(b,i.find).forEach(O=>{if(O.index===void 0)return;const E=w+O.index+1,$=E+O[0].length,N={from:n.tr.mapping.map(E),to:n.tr.mapping.map($)},I=i.handler({state:n,range:N,match:O,commands:c,chain:u,can:f,pasteEvent:s,dropEvent:a});h.push(I)})}),h.every(v=>v!==null)}function sxe(e){const{editor:t,rules:n}=e;let r=null,o=!1,i=!1,s=new ClipboardEvent("paste"),a=new DragEvent("drop");return n.map(u=>new Kr({view(f){const h=m=>{var v;r=!((v=f.dom.parentElement)===null||v===void 0)&&v.contains(m.target)?f.dom.parentElement:null};return window.addEventListener("dragstart",h),{destroy(){window.removeEventListener("dragstart",h)}}},props:{handleDOMEvents:{drop:(f,h)=>(i=r===f.dom.parentElement,a=h,!1),paste:(f,h)=>{var m;const v=(m=h.clipboardData)===null||m===void 0?void 0:m.getData("text/html");return s=h,o=!!v?.includes("data-pm-slice"),!1}}},appendTransaction:(f,h,m)=>{const v=f[0],y=v.getMeta("uiEvent")==="paste"&&!o,w=v.getMeta("uiEvent")==="drop"&&!i;if(!y&&!w)return;const P=h.doc.content.findDiffStart(m.doc.content),b=h.doc.content.findDiffEnd(m.doc.content);if(!nxe(P)||!b||P===b.b)return;const S=m.tr,O=l1({state:m,transaction:S});if(!(!ixe({editor:t,state:O,from:Math.max(P-1,0),to:b.b-1,rule:u,pasteEvent:s,dropEvent:a})||!S.steps.length))return a=new DragEvent("drop"),s=new ClipboardEvent("paste"),S}}))}function axe(e){const t=e.filter((n,r)=>e.indexOf(n)!==r);return[...new Set(t)]}class Dc{constructor(t,n){this.splittableMarks=[],this.editor=n,this.extensions=Dc.resolve(t),this.schema=Qbe(this.extensions,n),this.extensions.forEach(r=>{var o;this.editor.extensionStorage[r.name]=r.storage;const i={name:r.name,options:r.options,storage:r.storage,editor:this.editor,type:xw(r.name,this.schema)};r.type==="mark"&&(!((o=Ue(Ce(r,"keepOnSplit",i)))!==null&&o!==void 0)||o)&&this.splittableMarks.push(r.name);const s=Ce(r,"onBeforeCreate",i);s&&this.editor.on("beforeCreate",s);const a=Ce(r,"onCreate",i);a&&this.editor.on("create",a);const c=Ce(r,"onUpdate",i);c&&this.editor.on("update",c);const u=Ce(r,"onSelectionUpdate",i);u&&this.editor.on("selectionUpdate",u);const f=Ce(r,"onTransaction",i);f&&this.editor.on("transaction",f);const h=Ce(r,"onFocus",i);h&&this.editor.on("focus",h);const m=Ce(r,"onBlur",i);m&&this.editor.on("blur",m);const v=Ce(r,"onDestroy",i);v&&this.editor.on("destroy",v)})}static resolve(t){const n=Dc.sort(Dc.flatten(t)),r=axe(n.map(o=>o.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(o=>`'${o}'`).join(", ")}]. This can lead to issues.`),n}static flatten(t){return t.map(n=>{const r={name:n.name,options:n.options,storage:n.storage},o=Ce(n,"addExtensions",r);return o?[n,...this.flatten(o())]:n}).flat(10)}static sort(t){return t.sort((r,o)=>{const i=Ce(r,"priority")||100,s=Ce(o,"priority")||100;return i>s?-1:i{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:xw(n.name,this.schema)},o=Ce(n,"addCommands",r);return o?{...t,...o()}:t},{})}get plugins(){const{editor:t}=this,n=Dc.sort([...this.extensions].reverse()),r=[],o=[],i=n.map(s=>{const a={name:s.name,options:s.options,storage:s.storage,editor:t,type:xw(s.name,this.schema)},c=[],u=Ce(s,"addKeyboardShortcuts",a);let f={};if(s.type==="mark"&&s.config.exitable&&(f.ArrowRight=()=>sr.handleExit({editor:t,mark:s})),u){const w=Object.fromEntries(Object.entries(u()).map(([P,b])=>[P,()=>b({editor:t})]));f={...f,...w}}const h=Sbe(f);c.push(h);const m=Ce(s,"addInputRules",a);FI(s,t.options.enableInputRules)&&m&&r.push(...m());const v=Ce(s,"addPasteRules",a);FI(s,t.options.enablePasteRules)&&v&&o.push(...v());const y=Ce(s,"addProseMirrorPlugins",a);if(y){const w=y();c.push(...w)}return c}).flat();return[txe({editor:t,rules:r}),...sxe({editor:t,rules:o}),...i]}get attributes(){return ZB(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:n}=u1(this.extensions);return Object.fromEntries(n.filter(r=>!!Ce(r,"addNodeView")).map(r=>{const o=this.attributes.filter(c=>c.type===r.name),i={name:r.name,options:r.options,storage:r.storage,editor:t,type:Nn(r.name,this.schema)},s=Ce(r,"addNodeView",i);if(!s)return[];const a=(c,u,f,h)=>{const m=zx(c,o);return s()({editor:t,node:c,getPos:f,decorations:h,HTMLAttributes:m,extension:r})};return[r.name,a]}))}}function lxe(e){return Object.prototype.toString.call(e).slice(8,-1)}function Pw(e){return lxe(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function f1(e,t){const n={...e};return Pw(e)&&Pw(t)&&Object.keys(t).forEach(r=>{Pw(t[r])?r in e?n[r]=f1(e[r],t[r]):Object.assign(n,{[r]:t[r]}):Object.assign(n,{[r]:t[r]})}),n}class Sr{constructor(t={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Ue(Ce(this,"addOptions",{name:this.name}))),this.storage=Ue(Ce(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new Sr(t)}configure(t={}){const n=this.extend();return n.options=f1(this.options,t),n.storage=Ue(Ce(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){const n=new Sr(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Ue(Ce(n,"addOptions",{name:n.name})),n.storage=Ue(Ce(n,"addStorage",{name:n.name,options:n.options})),n}}function YB(e,t,n){const{from:r,to:o}=t,{blockSeparator:i=` -`,textSerializers:s={}}=n||{};let a="",c=!0;return e.nodesBetween(r,o,(u,f,h,m)=>{var v;const y=s?.[u.type.name];y?(u.isBlock&&!c&&(a+=i,c=!0),h&&(a+=y({node:u,pos:f,parent:h,index:m,range:t}))):u.isText?(a+=(v=u?.text)===null||v===void 0?void 0:v.slice(Math.max(r,f)-f,o-f),c=!1):u.isBlock&&!c&&(a+=i,c=!0)}),a}function KB(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}const cxe=Sr.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new Kr({key:new Fi("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:o}=t,{ranges:i}=o,s=Math.min(...i.map(f=>f.$from.pos)),a=Math.max(...i.map(f=>f.$to.pos)),c=KB(n);return YB(r,{from:s,to:a},{textSerializers:c})}}})]}}),uxe=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window?.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),dxe=(e=!1)=>({commands:t})=>t.setContent("",e),fxe=()=>({state:e,tr:t,dispatch:n})=>{const{selection:r}=t,{ranges:o}=r;return n&&o.forEach(({$from:i,$to:s})=>{e.doc.nodesBetween(i.pos,s.pos,(a,c)=>{if(a.type.isText)return;const{doc:u,mapping:f}=t,h=u.resolve(f.map(c)),m=u.resolve(f.map(c+a.nodeSize)),v=h.blockRange(m);if(!v)return;const y=Du(v);if(a.type.isTextblock){const{defaultType:w}=h.parent.contentMatchAt(h.index());t.setNodeMarkup(v.start,w)}(y||y===0)&&t.lift(v,y)})}),!0},hxe=e=>t=>e(t),pxe=()=>({state:e,dispatch:t})=>Lbe(e,t),mxe=(e,t)=>({editor:n,tr:r})=>{const{state:o}=n,i=o.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);const s=r.mapping.map(t);return r.insert(s,i.content),r.setSelection(new Ve(r.doc.resolve(s-1))),!0},gxe=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;const o=e.selection.$anchor;for(let i=o.depth;i>0;i-=1)if(o.node(i).type===r.type){if(t){const a=o.before(i),c=o.after(i);e.delete(a,c).scrollIntoView()}return!0}return!1},vxe=e=>({tr:t,state:n,dispatch:r})=>{const o=Nn(e,n.schema),i=t.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===o){if(r){const c=i.before(s),u=i.after(s);t.delete(c,u).scrollIntoView()}return!0}return!1},yxe=e=>({tr:t,dispatch:n})=>{const{from:r,to:o}=e;return n&&t.delete(r,o),!0},_xe=()=>({state:e,dispatch:t})=>Pbe(e,t),wxe=()=>({commands:e})=>e.keyboardShortcut("Enter"),bxe=()=>({state:e,dispatch:t})=>jbe(e,t);function ny(e,t,n={strict:!0}){const r=Object.keys(t);return r.length?r.every(o=>n.strict?t[o]===e[o]:MO(t[o])?t[o].test(e[o]):t[o]===e[o]):!0}function Ax(e,t,n={}){return e.find(r=>r.type===t&&ny(r.attrs,n))}function xxe(e,t,n={}){return!!Ax(e,t,n)}function NO(e,t,n={}){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if(e.parentOffset===r.offset&&r.offset!==0&&(r=e.parent.childBefore(e.parentOffset)),!r.node)return;const o=Ax([...r.node.marks],t,n);if(!o)return;let i=r.index,s=e.start()+r.offset,a=i+1,c=s+r.node.nodeSize;for(Ax([...r.node.marks],t,n);i>0&&o.isInSet(e.parent.child(i-1).marks);)i-=1,s-=e.parent.child(i).nodeSize;for(;a({tr:n,state:r,dispatch:o})=>{const i=Fa(e,r.schema),{doc:s,selection:a}=n,{$from:c,from:u,to:f}=a;if(o){const h=NO(c,i,t);if(h&&h.from<=u&&h.to>=f){const m=Ve.create(s,h.from,h.to);n.setSelection(m)}}return!0},Pxe=e=>t=>{const n=typeof e=="function"?e(t):e;for(let r=0;r({editor:n,view:r,tr:o,dispatch:i})=>{t={scrollIntoView:!0,...t};const s=()=>{TO()&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t?.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&e===null||e===!1)return!0;if(i&&e===null&&!qB(n.state.selection))return s(),!0;const a=JB(o.doc,e)||n.state.selection,c=n.state.selection.eq(a);return i&&(c||o.setSelection(a),c&&o.storedMarks&&o.setStoredMarks(o.storedMarks),s()),!0},Cxe=(e,t)=>n=>e.every((r,o)=>t(r,{...n,index:o})),kxe=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t);function VI(e){const t=`${e}`;return new window.DOMParser().parseFromString(t,"text/html").body}function ry(e,t,n){if(n={slice:!0,parseOptions:{},...n},typeof e=="object"&&e!==null)try{return Array.isArray(e)&&e.length>0?se.fromArray(e.map(r=>t.nodeFromJSON(r))):t.nodeFromJSON(e)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",r),ry("",t,n)}if(typeof e=="string"){const r=vu.fromSchema(t);return n.slice?r.parseSlice(VI(e),n.parseOptions).content:r.parse(VI(e),n.parseOptions)}return ry("",t,n)}function Exe(e,t,n){const r=e.steps.length-1;if(r{s===0&&(s=f)}),e.setSelection(Ze.near(e.doc.resolve(s),n))}const $xe=e=>e.toString().startsWith("<"),Mxe=(e,t,n)=>({tr:r,dispatch:o,editor:i})=>{if(o){n={parseOptions:{},updateSelection:!0,...n};const s=ry(t,i.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if(s.toString()==="<>")return!0;let{from:a,to:c}=typeof e=="number"?{from:e,to:e}:{from:e.from,to:e.to},u=!0,f=!0;if(($xe(s)?s:[s]).forEach(m=>{m.check(),u=u?m.isText&&m.marks.length===0:!1,f=f?m.isBlock:!1}),a===c&&f){const{parent:m}=r.doc.resolve(a);m.isTextblock&&!m.type.spec.code&&!m.childCount&&(a-=1,c+=1)}u?Array.isArray(t)?r.insertText(t.map(m=>m.text||"").join(""),a,c):typeof t=="object"&&t&&t.text?r.insertText(t.text,a,c):r.insertText(t,a,c):r.replaceWith(a,c,s),n.updateSelection&&Exe(r,r.steps.length-1,-1)}return!0},Nxe=()=>({state:e,dispatch:t})=>Nbe(e,t),Txe=()=>({state:e,dispatch:t})=>Tbe(e,t),Ixe=()=>({state:e,dispatch:t})=>Cbe(e,t),Dxe=()=>({state:e,dispatch:t})=>$be(e,t),jxe=()=>({tr:e,state:t,dispatch:n})=>{try{const r=r1(t.doc,t.selection.$from.pos,-1);return r==null?!1:(e.join(r,2),n&&n(e),!0)}catch{return!1}},Lxe=()=>({state:e,dispatch:t,tr:n})=>{try{const r=r1(e.doc,e.selection.$from.pos,1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}};function IO(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function Rxe(e){const t=e.split(/-(?!$)/);let n=t[t.length-1];n==="Space"&&(n=" ");let r,o,i,s;for(let a=0;a({editor:t,view:n,tr:r,dispatch:o})=>{const i=Rxe(e).split(/-(?!$)/),s=i.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),a=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),c=t.captureTransaction(()=>{n.someProp("handleKeyDown",u=>u(n,a))});return c?.steps.forEach(u=>{const f=u.map(r.mapping);f&&o&&r.maybeStep(f)}),!0};function Ef(e,t,n={}){const{from:r,to:o,empty:i}=e.selection,s=t?Nn(t,e.schema):null,a=[];e.doc.nodesBetween(r,o,(h,m)=>{if(h.isText)return;const v=Math.max(r,m),y=Math.min(o,m+h.nodeSize);a.push({node:h,from:v,to:y})});const c=o-r,u=a.filter(h=>s?s.name===h.node.type.name:!0).filter(h=>ny(h.node.attrs,n,{strict:!1}));return i?!!u.length:u.reduce((h,m)=>h+m.to-m.from,0)>=c}const Axe=(e,t={})=>({state:n,dispatch:r})=>{const o=Nn(e,n.schema);return Ef(n,o,t)?Ibe(n,r):!1},Bxe=()=>({state:e,dispatch:t})=>Rbe(e,t),Fxe=e=>({state:t,dispatch:n})=>{const r=Nn(e,t.schema);return Ube(r)(t,n)},Vxe=()=>({state:e,dispatch:t})=>Dbe(e,t);function h1(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function HI(e,t){const n=typeof t=="string"?[t]:t;return Object.keys(e).reduce((r,o)=>(n.includes(o)||(r[o]=e[o]),r),{})}const Hxe=(e,t)=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const a=h1(typeof e=="string"?e:e.name,r.schema);return a?(a==="node"&&(i=Nn(e,r.schema)),a==="mark"&&(s=Fa(e,r.schema)),o&&n.selection.ranges.forEach(c=>{r.doc.nodesBetween(c.$from.pos,c.$to.pos,(u,f)=>{i&&i===u.type&&n.setNodeMarkup(f,void 0,HI(u.attrs,t)),s&&u.marks.length&&u.marks.forEach(h=>{s===h.type&&n.addMark(f,f+u.nodeSize,s.create(HI(h.attrs,t)))})})}),!0):!1},Wxe=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),Uxe=()=>({tr:e,commands:t})=>t.setTextSelection({from:0,to:e.doc.content.size}),Zxe=()=>({state:e,dispatch:t})=>kbe(e,t),Gxe=()=>({state:e,dispatch:t})=>Mbe(e,t),Yxe=()=>({state:e,dispatch:t})=>zbe(e,t),Kxe=()=>({state:e,dispatch:t})=>Fbe(e,t),qxe=()=>({state:e,dispatch:t})=>Bbe(e,t);function QB(e,t,n={}){return ry(e,t,{slice:!1,parseOptions:n})}const Jxe=(e,t=!1,n={})=>({tr:r,editor:o,dispatch:i})=>{const{doc:s}=r,a=QB(e,o.schema,n);return i&&r.replaceWith(0,s.content.size,a).setMeta("preventUpdate",!t),!0};function sh(e,t){const n=Fa(t,e.schema),{from:r,to:o,empty:i}=e.selection,s=[];i?(e.storedMarks&&s.push(...e.storedMarks),s.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,o,c=>{s.push(...c.marks)});const a=s.find(c=>c.type.name===n.name);return a?{...a.attrs}:{}}function Qxe(e,t){const n=new sB(e);return t.forEach(r=>{r.steps.forEach(o=>{n.step(o)})}),n}function Xxe(e){for(let t=0;t{n(o)&&r.push({node:o,pos:i})}),r}function tSe(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function DO(e){return t=>tSe(t.$from,e)}function nSe(e,t){const n=Ti.fromSchema(t).serializeFragment(e),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(n),o.innerHTML}function rSe(e,t){const n={from:0,to:e.content.size};return YB(e,n,t)}function oSe(e,t){const n=Nn(t,e.schema),{from:r,to:o}=e.selection,i=[];e.doc.nodesBetween(r,o,a=>{i.push(a)});const s=i.reverse().find(a=>a.type.name===n.name);return s?{...s.attrs}:{}}function XB(e,t){const n=h1(typeof t=="string"?t:t.name,e.schema);return n==="node"?oSe(e,t):n==="mark"?sh(e,t):{}}function iSe(e,t=JSON.stringify){const n={};return e.filter(r=>{const o=t(r);return Object.prototype.hasOwnProperty.call(n,o)?!1:n[o]=!0})}function sSe(e){const t=iSe(e);return t.length===1?t:t.filter((n,r)=>!t.filter((i,s)=>s!==r).some(i=>n.oldRange.from>=i.oldRange.from&&n.oldRange.to<=i.oldRange.to&&n.newRange.from>=i.newRange.from&&n.newRange.to<=i.newRange.to))}function aSe(e){const{mapping:t,steps:n}=e,r=[];return t.maps.forEach((o,i)=>{const s=[];if(o.ranges.length)o.forEach((a,c)=>{s.push({from:a,to:c})});else{const{from:a,to:c}=n[i];if(a===void 0||c===void 0)return;s.push({from:a,to:c})}s.forEach(({from:a,to:c})=>{const u=t.slice(i).map(a,-1),f=t.slice(i).map(c),h=t.invert().map(u,-1),m=t.invert().map(f);r.push({oldRange:{from:h,to:m},newRange:{from:u,to:f}})})}),sSe(r)}function jO(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach(o=>{const i=n.resolve(e-1),s=NO(i,o.type);s&&r.push({mark:o,...s})}):n.nodesBetween(e,t,(o,i)=>{r.push(...o.marks.map(s=>({from:i,to:i+o.nodeSize,mark:s})))}),r}function am(e,t,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const o=e.find(i=>i.type===t&&i.name===r);return o?o.attribute.keepOnSplit:!1}))}function Bx(e,t,n={}){const{empty:r,ranges:o}=e.selection,i=t?Fa(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(h=>i?i.name===h.type.name:!0).find(h=>ny(h.attrs,n,{strict:!1}));let s=0;const a=[];if(o.forEach(({$from:h,$to:m})=>{const v=h.pos,y=m.pos;e.doc.nodesBetween(v,y,(w,P)=>{if(!w.isText&&!w.marks.length)return;const b=Math.max(v,P),S=Math.min(y,P+w.nodeSize),O=S-b;s+=O,a.push(...w.marks.map(E=>({mark:E,from:b,to:S})))})}),s===0)return!1;const c=a.filter(h=>i?i.name===h.mark.type.name:!0).filter(h=>ny(h.mark.attrs,n,{strict:!1})).reduce((h,m)=>h+m.to-m.from,0),u=a.filter(h=>i?h.mark.type!==i&&h.mark.type.excludes(i):!0).reduce((h,m)=>h+m.to-m.from,0);return(c>0?c+u:c)>=s}function lSe(e,t,n={}){if(!t)return Ef(e,null,n)||Bx(e,null,n);const r=h1(t,e.schema);return r==="node"?Ef(e,t,n):r==="mark"?Bx(e,t,n):!1}function WI(e,t){const{nodeExtensions:n}=u1(t),r=n.find(s=>s.name===e);if(!r)return!1;const o={name:r.name,options:r.options,storage:r.storage},i=Ue(Ce(r,"group",o));return typeof i!="string"?!1:i.split(" ").includes("list")}function cSe(e){var t;const n=(t=e.type.createAndFill())===null||t===void 0?void 0:t.toJSON(),r=e.toJSON();return JSON.stringify(n)===JSON.stringify(r)}function uSe(e,t,n){var r;const{selection:o}=t;let i=null;if(qB(o)&&(i=o.$cursor),i){const a=(r=e.storedMarks)!==null&&r!==void 0?r:i.marks();return!!n.isInSet(a)||!a.some(c=>c.type.excludes(n))}const{ranges:s}=o;return s.some(({$from:a,$to:c})=>{let u=a.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(a.pos,c.pos,(f,h,m)=>{if(u)return!1;if(f.isInline){const v=!m||m.type.allowsMarkType(n),y=!!n.isInSet(f.marks)||!f.marks.some(w=>w.type.excludes(n));u=v&&y}return!u}),u})}const dSe=(e,t={})=>({tr:n,state:r,dispatch:o})=>{const{selection:i}=n,{empty:s,ranges:a}=i,c=Fa(e,r.schema);if(o)if(s){const u=sh(r,c);n.addStoredMark(c.create({...u,...t}))}else a.forEach(u=>{const f=u.$from.pos,h=u.$to.pos;r.doc.nodesBetween(f,h,(m,v)=>{const y=Math.max(v,f),w=Math.min(v+m.nodeSize,h);m.marks.find(b=>b.type===c)?m.marks.forEach(b=>{c===b.type&&n.addMark(y,w,c.create({...b.attrs,...t}))}):n.addMark(y,w,c.create(t))})});return uSe(r,n,c)},fSe=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),hSe=(e,t={})=>({state:n,dispatch:r,chain:o})=>{const i=Nn(e,n.schema);return i.isTextblock?o().command(({commands:s})=>zI(i,t)(n)?!0:s.clearNodes()).command(({state:s})=>zI(i,t)(s,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},pSe=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,o=vl(e,0,r.content.size),i=je.create(r,o);t.setSelection(i)}return!0},mSe=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,{from:o,to:i}=typeof e=="number"?{from:e,to:e}:e,s=Ve.atStart(r).from,a=Ve.atEnd(r).to,c=vl(o,s,a),u=vl(i,s,a),f=Ve.create(r,c,u);t.setSelection(f)}return!0},gSe=e=>({state:t,dispatch:n})=>{const r=Nn(e,t.schema);return Ybe(r)(t,n)};function UI(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter(o=>t?.includes(o.type.name));e.tr.ensureMarks(r)}}const vSe=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:o})=>{const{selection:i,doc:s}=t,{$from:a,$to:c}=i,u=o.extensionManager.attributes,f=am(u,a.node().type.name,a.node().attrs);if(i instanceof je&&i.node.isBlock)return!a.parentOffset||!Qc(s,a.pos)?!1:(r&&(e&&UI(n,o.extensionManager.splittableMarks),t.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;if(r){const h=c.parentOffset===c.parent.content.size;i instanceof Ve&&t.deleteSelection();const m=a.depth===0?void 0:Xxe(a.node(-1).contentMatchAt(a.indexAfter(-1)));let v=h&&m?[{type:m,attrs:f}]:void 0,y=Qc(t.doc,t.mapping.map(a.pos),1,v);if(!v&&!y&&Qc(t.doc,t.mapping.map(a.pos),1,m?[{type:m}]:void 0)&&(y=!0,v=m?[{type:m,attrs:f}]:void 0),y&&(t.split(t.mapping.map(a.pos),1,v),m&&!h&&!a.parentOffset&&a.parent.type!==m)){const w=t.mapping.map(a.before()),P=t.doc.resolve(w);a.node(-1).canReplaceWith(P.index(),P.index()+1,m)&&t.setNodeMarkup(t.mapping.map(a.before()),m)}e&&UI(n,o.extensionManager.splittableMarks),t.scrollIntoView()}return!0},ySe=e=>({tr:t,state:n,dispatch:r,editor:o})=>{var i;const s=Nn(e,n.schema),{$from:a,$to:c}=n.selection,u=n.selection.node;if(u&&u.isBlock||a.depth<2||!a.sameParent(c))return!1;const f=a.node(-1);if(f.type!==s)return!1;const h=o.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==s||a.index(-2)!==a.node(-2).childCount-1)return!1;if(r){let P=se.empty;const b=a.index(-1)?1:a.index(-2)?2:3;for(let I=a.depth-b;I>=a.depth-3;I-=1)P=se.from(a.node(I).copy(P));const S=a.indexAfter(-1){if(N>-1)return!1;I.isTextblock&&I.content.size===0&&(N=R+1)}),N>-1&&t.setSelection(Ve.near(t.doc.resolve(N))),t.scrollIntoView()}return!0}const m=c.pos===a.end()?f.contentMatchAt(0).defaultType:null,v=am(h,f.type.name,f.attrs),y=am(h,a.node().type.name,a.node().attrs);t.delete(a.pos,c.pos);const w=m?[{type:s,attrs:v},{type:m,attrs:y}]:[{type:s,attrs:v}];if(!Qc(t.doc,a.pos,2))return!1;if(r){const{selection:P,storedMarks:b}=n,{splittableMarks:S}=o.extensionManager,O=b||P.$to.parentOffset&&P.$from.marks();if(t.split(a.pos,2,w).scrollIntoView(),!O||!r)return!0;const E=O.filter($=>S.includes($.type.name));t.ensureMarks(E)}return!0},Ow=(e,t)=>{const n=DO(s=>s.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const o=e.doc.nodeAt(r);return n.node.type===o?.type&&Aa(e.doc,n.pos)&&e.join(n.pos),!0},Cw=(e,t)=>{const n=DO(s=>s.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const o=e.doc.nodeAt(r);return n.node.type===o?.type&&Aa(e.doc,r)&&e.join(r),!0},_Se=(e,t,n,r={})=>({editor:o,tr:i,state:s,dispatch:a,chain:c,commands:u,can:f})=>{const{extensions:h,splittableMarks:m}=o.extensionManager,v=Nn(e,s.schema),y=Nn(t,s.schema),{selection:w,storedMarks:P}=s,{$from:b,$to:S}=w,O=b.blockRange(S),E=P||w.$to.parentOffset&&w.$from.marks();if(!O)return!1;const $=DO(N=>WI(N.type.name,h))(w);if(O.depth>=1&&$&&O.depth-$.depth<=1){if($.node.type===v)return u.liftListItem(y);if(WI($.node.type.name,h)&&v.validContent($.node.content)&&a)return c().command(()=>(i.setNodeMarkup($.pos,v),!0)).command(()=>Ow(i,v)).command(()=>Cw(i,v)).run()}return!n||!E||!a?c().command(()=>f().wrapInList(v,r)?!0:u.clearNodes()).wrapInList(v,r).command(()=>Ow(i,v)).command(()=>Cw(i,v)).run():c().command(()=>{const N=f().wrapInList(v,r),I=E.filter(R=>m.includes(R.type.name));return i.ensureMarks(I),N?!0:u.clearNodes()}).wrapInList(v,r).command(()=>Ow(i,v)).command(()=>Cw(i,v)).run()},wSe=(e,t={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:i=!1}=n,s=Fa(e,r.schema);return Bx(r,s,t)?o.unsetMark(s,{extendEmptyMarkRange:i}):o.setMark(s,t)},bSe=(e,t,n={})=>({state:r,commands:o})=>{const i=Nn(e,r.schema),s=Nn(t,r.schema);return Ef(r,i,n)?o.setNode(s):o.setNode(i,n)},xSe=(e,t={})=>({state:n,commands:r})=>{const o=Nn(e,n.schema);return Ef(n,o,t)?r.lift(o):r.wrapIn(o,t)},SSe=()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r=0;c-=1)s.step(a.steps[c].invert(a.docs[c]));if(i.text){const c=s.doc.resolve(i.from).marks();s.replaceWith(i.from,i.to,e.schema.text(i.text,c))}else s.delete(i.from,i.to)}return!0}}return!1},PSe=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,ranges:o}=n;return r||t&&o.forEach(i=>{e.removeMark(i.$from.pos,i.$to.pos)}),!0},OSe=(e,t={})=>({tr:n,state:r,dispatch:o})=>{var i;const{extendEmptyMarkRange:s=!1}=t,{selection:a}=n,c=Fa(e,r.schema),{$from:u,empty:f,ranges:h}=a;if(!o)return!0;if(f&&s){let{from:m,to:v}=a;const y=(i=u.marks().find(P=>P.type===c))===null||i===void 0?void 0:i.attrs,w=NO(u,c,y);w&&(m=w.from,v=w.to),n.removeMark(m,v,c)}else h.forEach(m=>{n.removeMark(m.$from.pos,m.$to.pos,c)});return n.removeStoredMark(c),!0},CSe=(e,t={})=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const a=h1(typeof e=="string"?e:e.name,r.schema);return a?(a==="node"&&(i=Nn(e,r.schema)),a==="mark"&&(s=Fa(e,r.schema)),o&&n.selection.ranges.forEach(c=>{const u=c.$from.pos,f=c.$to.pos;r.doc.nodesBetween(u,f,(h,m)=>{i&&i===h.type&&n.setNodeMarkup(m,void 0,{...h.attrs,...t}),s&&h.marks.length&&h.marks.forEach(v=>{if(s===v.type){const y=Math.max(m,u),w=Math.min(m+h.nodeSize,f);n.addMark(y,w,s.create({...v.attrs,...t}))}})})}),!0):!1},kSe=(e,t={})=>({state:n,dispatch:r})=>{const o=Nn(e,n.schema);return Vbe(o,t)(n,r)},ESe=(e,t={})=>({state:n,dispatch:r})=>{const o=Nn(e,n.schema);return Hbe(o,t)(n,r)};var $Se=Object.freeze({__proto__:null,blur:uxe,clearContent:dxe,clearNodes:fxe,command:hxe,createParagraphNear:pxe,cut:mxe,deleteCurrentNode:gxe,deleteNode:vxe,deleteRange:yxe,deleteSelection:_xe,enter:wxe,exitCode:bxe,extendMarkRange:Sxe,first:Pxe,focus:Oxe,forEach:Cxe,insertContent:kxe,insertContentAt:Mxe,joinUp:Nxe,joinDown:Txe,joinBackward:Ixe,joinForward:Dxe,joinItemBackward:jxe,joinItemForward:Lxe,keyboardShortcut:zxe,lift:Axe,liftEmptyBlock:Bxe,liftListItem:Fxe,newlineInCode:Vxe,resetAttributes:Hxe,scrollIntoView:Wxe,selectAll:Uxe,selectNodeBackward:Zxe,selectNodeForward:Gxe,selectParentNode:Yxe,selectTextblockEnd:Kxe,selectTextblockStart:qxe,setContent:Jxe,setMark:dSe,setMeta:fSe,setNode:hSe,setNodeSelection:pSe,setTextSelection:mSe,sinkListItem:gSe,splitBlock:vSe,splitListItem:ySe,toggleList:_Se,toggleMark:wSe,toggleNode:bSe,toggleWrap:xSe,undoInputRule:SSe,unsetAllMarks:PSe,unsetMark:OSe,updateAttributes:CSe,wrapIn:kSe,wrapInList:ESe});const MSe=Sr.create({name:"commands",addCommands(){return{...$Se}}}),NSe=Sr.create({name:"editable",addProseMirrorPlugins(){return[new Kr({key:new Fi("editable"),props:{editable:()=>this.editor.options.editable}})]}}),TSe=Sr.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new Kr({key:new Fi("focusEvents"),props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),ISe=Sr.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:a})=>{const{selection:c,doc:u}=a,{empty:f,$anchor:h}=c,{pos:m,parent:v}=h,y=h.parent.isTextblock?a.doc.resolve(m-1):h,w=y.parent.type.spec.isolating,P=h.pos-h.parentOffset,b=w&&y.parent.childCount===1?P===h.pos:Ze.atStart(u).from===m;return!f||!b||!v.type.isTextblock||v.textContent.length?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},o={...r},i={...r,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return TO()||IO()?i:o},addProseMirrorPlugins(){return[new Kr({key:new Fi("clearDocument"),appendTransaction:(e,t,n)=>{if(!(e.some(y=>y.docChanged)&&!t.doc.eq(n.doc)))return;const{empty:o,from:i,to:s}=t.selection,a=Ze.atStart(t.doc).from,c=Ze.atEnd(t.doc).to;if(o||!(i===a&&s===c)||!(n.doc.textBetween(0,n.doc.content.size," "," ").length===0))return;const h=n.tr,m=l1({state:n,transaction:h}),{commands:v}=new c1({editor:this.editor,state:m});if(v.clearNodes(),!!h.steps.length)return h}})]}}),DSe=Sr.create({name:"tabindex",addProseMirrorPlugins(){return[new Kr({key:new Fi("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var jSe=Object.freeze({__proto__:null,ClipboardTextSerializer:cxe,Commands:MSe,Editable:NSe,FocusEvents:TSe,Keymap:ISe,Tabindex:DSe});const LSe=`.ProseMirror { +`,textSerializers:s={}}=n||{};let a="",c=!0;return e.nodesBetween(r,o,(u,f,h,m)=>{var v;const y=s?.[u.type.name];y?(u.isBlock&&!c&&(a+=i,c=!0),h&&(a+=y({node:u,pos:f,parent:h,index:m,range:t}))):u.isText?(a+=(v=u?.text)===null||v===void 0?void 0:v.slice(Math.max(r,f)-f,o-f),c=!1):u.isBlock&&!c&&(a+=i,c=!0)}),a}function KB(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}const cxe=Sr.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new Kr({key:new Fi("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:o}=t,{ranges:i}=o,s=Math.min(...i.map(f=>f.$from.pos)),a=Math.max(...i.map(f=>f.$to.pos)),c=KB(n);return YB(r,{from:s,to:a},{textSerializers:c})}}})]}}),uxe=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window?.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),dxe=(e=!1)=>({commands:t})=>t.setContent("",e),fxe=()=>({state:e,tr:t,dispatch:n})=>{const{selection:r}=t,{ranges:o}=r;return n&&o.forEach(({$from:i,$to:s})=>{e.doc.nodesBetween(i.pos,s.pos,(a,c)=>{if(a.type.isText)return;const{doc:u,mapping:f}=t,h=u.resolve(f.map(c)),m=u.resolve(f.map(c+a.nodeSize)),v=h.blockRange(m);if(!v)return;const y=ju(v);if(a.type.isTextblock){const{defaultType:w}=h.parent.contentMatchAt(h.index());t.setNodeMarkup(v.start,w)}(y||y===0)&&t.lift(v,y)})}),!0},hxe=e=>t=>e(t),pxe=()=>({state:e,dispatch:t})=>Rbe(e,t),mxe=(e,t)=>({editor:n,tr:r})=>{const{state:o}=n,i=o.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);const s=r.mapping.map(t);return r.insert(s,i.content),r.setSelection(new Ve(r.doc.resolve(s-1))),!0},gxe=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;const o=e.selection.$anchor;for(let i=o.depth;i>0;i-=1)if(o.node(i).type===r.type){if(t){const a=o.before(i),c=o.after(i);e.delete(a,c).scrollIntoView()}return!0}return!1},vxe=e=>({tr:t,state:n,dispatch:r})=>{const o=Nn(e,n.schema),i=t.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===o){if(r){const c=i.before(s),u=i.after(s);t.delete(c,u).scrollIntoView()}return!0}return!1},yxe=e=>({tr:t,dispatch:n})=>{const{from:r,to:o}=e;return n&&t.delete(r,o),!0},_xe=()=>({state:e,dispatch:t})=>Pbe(e,t),wxe=()=>({commands:e})=>e.keyboardShortcut("Enter"),bxe=()=>({state:e,dispatch:t})=>Dbe(e,t);function ny(e,t,n={strict:!0}){const r=Object.keys(t);return r.length?r.every(o=>n.strict?t[o]===e[o]:MO(t[o])?t[o].test(e[o]):t[o]===e[o]):!0}function Ax(e,t,n={}){return e.find(r=>r.type===t&&ny(r.attrs,n))}function xxe(e,t,n={}){return!!Ax(e,t,n)}function NO(e,t,n={}){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if(e.parentOffset===r.offset&&r.offset!==0&&(r=e.parent.childBefore(e.parentOffset)),!r.node)return;const o=Ax([...r.node.marks],t,n);if(!o)return;let i=r.index,s=e.start()+r.offset,a=i+1,c=s+r.node.nodeSize;for(Ax([...r.node.marks],t,n);i>0&&o.isInSet(e.parent.child(i-1).marks);)i-=1,s-=e.parent.child(i).nodeSize;for(;a({tr:n,state:r,dispatch:o})=>{const i=Fa(e,r.schema),{doc:s,selection:a}=n,{$from:c,from:u,to:f}=a;if(o){const h=NO(c,i,t);if(h&&h.from<=u&&h.to>=f){const m=Ve.create(s,h.from,h.to);n.setSelection(m)}}return!0},Pxe=e=>t=>{const n=typeof e=="function"?e(t):e;for(let r=0;r({editor:n,view:r,tr:o,dispatch:i})=>{t={scrollIntoView:!0,...t};const s=()=>{TO()&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t?.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&e===null||e===!1)return!0;if(i&&e===null&&!qB(n.state.selection))return s(),!0;const a=JB(o.doc,e)||n.state.selection,c=n.state.selection.eq(a);return i&&(c||o.setSelection(a),c&&o.storedMarks&&o.setStoredMarks(o.storedMarks),s()),!0},Cxe=(e,t)=>n=>e.every((r,o)=>t(r,{...n,index:o})),kxe=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t);function VI(e){const t=`${e}`;return new window.DOMParser().parseFromString(t,"text/html").body}function ry(e,t,n){if(n={slice:!0,parseOptions:{},...n},typeof e=="object"&&e!==null)try{return Array.isArray(e)&&e.length>0?se.fromArray(e.map(r=>t.nodeFromJSON(r))):t.nodeFromJSON(e)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",r),ry("",t,n)}if(typeof e=="string"){const r=vu.fromSchema(t);return n.slice?r.parseSlice(VI(e),n.parseOptions).content:r.parse(VI(e),n.parseOptions)}return ry("",t,n)}function Exe(e,t,n){const r=e.steps.length-1;if(r{s===0&&(s=f)}),e.setSelection(Ze.near(e.doc.resolve(s),n))}const $xe=e=>e.toString().startsWith("<"),Mxe=(e,t,n)=>({tr:r,dispatch:o,editor:i})=>{if(o){n={parseOptions:{},updateSelection:!0,...n};const s=ry(t,i.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if(s.toString()==="<>")return!0;let{from:a,to:c}=typeof e=="number"?{from:e,to:e}:{from:e.from,to:e.to},u=!0,f=!0;if(($xe(s)?s:[s]).forEach(m=>{m.check(),u=u?m.isText&&m.marks.length===0:!1,f=f?m.isBlock:!1}),a===c&&f){const{parent:m}=r.doc.resolve(a);m.isTextblock&&!m.type.spec.code&&!m.childCount&&(a-=1,c+=1)}u?Array.isArray(t)?r.insertText(t.map(m=>m.text||"").join(""),a,c):typeof t=="object"&&t&&t.text?r.insertText(t.text,a,c):r.insertText(t,a,c):r.replaceWith(a,c,s),n.updateSelection&&Exe(r,r.steps.length-1,-1)}return!0},Nxe=()=>({state:e,dispatch:t})=>Nbe(e,t),Txe=()=>({state:e,dispatch:t})=>Tbe(e,t),Ixe=()=>({state:e,dispatch:t})=>Cbe(e,t),jxe=()=>({state:e,dispatch:t})=>$be(e,t),Dxe=()=>({tr:e,state:t,dispatch:n})=>{try{const r=r1(t.doc,t.selection.$from.pos,-1);return r==null?!1:(e.join(r,2),n&&n(e),!0)}catch{return!1}},Rxe=()=>({state:e,dispatch:t,tr:n})=>{try{const r=r1(e.doc,e.selection.$from.pos,1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}};function IO(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function Lxe(e){const t=e.split(/-(?!$)/);let n=t[t.length-1];n==="Space"&&(n=" ");let r,o,i,s;for(let a=0;a({editor:t,view:n,tr:r,dispatch:o})=>{const i=Lxe(e).split(/-(?!$)/),s=i.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),a=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),c=t.captureTransaction(()=>{n.someProp("handleKeyDown",u=>u(n,a))});return c?.steps.forEach(u=>{const f=u.map(r.mapping);f&&o&&r.maybeStep(f)}),!0};function Ef(e,t,n={}){const{from:r,to:o,empty:i}=e.selection,s=t?Nn(t,e.schema):null,a=[];e.doc.nodesBetween(r,o,(h,m)=>{if(h.isText)return;const v=Math.max(r,m),y=Math.min(o,m+h.nodeSize);a.push({node:h,from:v,to:y})});const c=o-r,u=a.filter(h=>s?s.name===h.node.type.name:!0).filter(h=>ny(h.node.attrs,n,{strict:!1}));return i?!!u.length:u.reduce((h,m)=>h+m.to-m.from,0)>=c}const Axe=(e,t={})=>({state:n,dispatch:r})=>{const o=Nn(e,n.schema);return Ef(n,o,t)?Ibe(n,r):!1},Bxe=()=>({state:e,dispatch:t})=>Lbe(e,t),Fxe=e=>({state:t,dispatch:n})=>{const r=Nn(e,t.schema);return Ube(r)(t,n)},Vxe=()=>({state:e,dispatch:t})=>jbe(e,t);function h1(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function HI(e,t){const n=typeof t=="string"?[t]:t;return Object.keys(e).reduce((r,o)=>(n.includes(o)||(r[o]=e[o]),r),{})}const Hxe=(e,t)=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const a=h1(typeof e=="string"?e:e.name,r.schema);return a?(a==="node"&&(i=Nn(e,r.schema)),a==="mark"&&(s=Fa(e,r.schema)),o&&n.selection.ranges.forEach(c=>{r.doc.nodesBetween(c.$from.pos,c.$to.pos,(u,f)=>{i&&i===u.type&&n.setNodeMarkup(f,void 0,HI(u.attrs,t)),s&&u.marks.length&&u.marks.forEach(h=>{s===h.type&&n.addMark(f,f+u.nodeSize,s.create(HI(h.attrs,t)))})})}),!0):!1},Wxe=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),Uxe=()=>({tr:e,commands:t})=>t.setTextSelection({from:0,to:e.doc.content.size}),Zxe=()=>({state:e,dispatch:t})=>kbe(e,t),Gxe=()=>({state:e,dispatch:t})=>Mbe(e,t),Yxe=()=>({state:e,dispatch:t})=>zbe(e,t),Kxe=()=>({state:e,dispatch:t})=>Fbe(e,t),qxe=()=>({state:e,dispatch:t})=>Bbe(e,t);function QB(e,t,n={}){return ry(e,t,{slice:!1,parseOptions:n})}const Jxe=(e,t=!1,n={})=>({tr:r,editor:o,dispatch:i})=>{const{doc:s}=r,a=QB(e,o.schema,n);return i&&r.replaceWith(0,s.content.size,a).setMeta("preventUpdate",!t),!0};function sh(e,t){const n=Fa(t,e.schema),{from:r,to:o,empty:i}=e.selection,s=[];i?(e.storedMarks&&s.push(...e.storedMarks),s.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,o,c=>{s.push(...c.marks)});const a=s.find(c=>c.type.name===n.name);return a?{...a.attrs}:{}}function Qxe(e,t){const n=new sB(e);return t.forEach(r=>{r.steps.forEach(o=>{n.step(o)})}),n}function Xxe(e){for(let t=0;t{n(o)&&r.push({node:o,pos:i})}),r}function tSe(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function jO(e){return t=>tSe(t.$from,e)}function nSe(e,t){const n=Ti.fromSchema(t).serializeFragment(e),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(n),o.innerHTML}function rSe(e,t){const n={from:0,to:e.content.size};return YB(e,n,t)}function oSe(e,t){const n=Nn(t,e.schema),{from:r,to:o}=e.selection,i=[];e.doc.nodesBetween(r,o,a=>{i.push(a)});const s=i.reverse().find(a=>a.type.name===n.name);return s?{...s.attrs}:{}}function XB(e,t){const n=h1(typeof t=="string"?t:t.name,e.schema);return n==="node"?oSe(e,t):n==="mark"?sh(e,t):{}}function iSe(e,t=JSON.stringify){const n={};return e.filter(r=>{const o=t(r);return Object.prototype.hasOwnProperty.call(n,o)?!1:n[o]=!0})}function sSe(e){const t=iSe(e);return t.length===1?t:t.filter((n,r)=>!t.filter((i,s)=>s!==r).some(i=>n.oldRange.from>=i.oldRange.from&&n.oldRange.to<=i.oldRange.to&&n.newRange.from>=i.newRange.from&&n.newRange.to<=i.newRange.to))}function aSe(e){const{mapping:t,steps:n}=e,r=[];return t.maps.forEach((o,i)=>{const s=[];if(o.ranges.length)o.forEach((a,c)=>{s.push({from:a,to:c})});else{const{from:a,to:c}=n[i];if(a===void 0||c===void 0)return;s.push({from:a,to:c})}s.forEach(({from:a,to:c})=>{const u=t.slice(i).map(a,-1),f=t.slice(i).map(c),h=t.invert().map(u,-1),m=t.invert().map(f);r.push({oldRange:{from:h,to:m},newRange:{from:u,to:f}})})}),sSe(r)}function DO(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach(o=>{const i=n.resolve(e-1),s=NO(i,o.type);s&&r.push({mark:o,...s})}):n.nodesBetween(e,t,(o,i)=>{r.push(...o.marks.map(s=>({from:i,to:i+o.nodeSize,mark:s})))}),r}function am(e,t,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const o=e.find(i=>i.type===t&&i.name===r);return o?o.attribute.keepOnSplit:!1}))}function Bx(e,t,n={}){const{empty:r,ranges:o}=e.selection,i=t?Fa(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(h=>i?i.name===h.type.name:!0).find(h=>ny(h.attrs,n,{strict:!1}));let s=0;const a=[];if(o.forEach(({$from:h,$to:m})=>{const v=h.pos,y=m.pos;e.doc.nodesBetween(v,y,(w,P)=>{if(!w.isText&&!w.marks.length)return;const b=Math.max(v,P),S=Math.min(y,P+w.nodeSize),O=S-b;s+=O,a.push(...w.marks.map(E=>({mark:E,from:b,to:S})))})}),s===0)return!1;const c=a.filter(h=>i?i.name===h.mark.type.name:!0).filter(h=>ny(h.mark.attrs,n,{strict:!1})).reduce((h,m)=>h+m.to-m.from,0),u=a.filter(h=>i?h.mark.type!==i&&h.mark.type.excludes(i):!0).reduce((h,m)=>h+m.to-m.from,0);return(c>0?c+u:c)>=s}function lSe(e,t,n={}){if(!t)return Ef(e,null,n)||Bx(e,null,n);const r=h1(t,e.schema);return r==="node"?Ef(e,t,n):r==="mark"?Bx(e,t,n):!1}function WI(e,t){const{nodeExtensions:n}=u1(t),r=n.find(s=>s.name===e);if(!r)return!1;const o={name:r.name,options:r.options,storage:r.storage},i=Ue(Ce(r,"group",o));return typeof i!="string"?!1:i.split(" ").includes("list")}function cSe(e){var t;const n=(t=e.type.createAndFill())===null||t===void 0?void 0:t.toJSON(),r=e.toJSON();return JSON.stringify(n)===JSON.stringify(r)}function uSe(e,t,n){var r;const{selection:o}=t;let i=null;if(qB(o)&&(i=o.$cursor),i){const a=(r=e.storedMarks)!==null&&r!==void 0?r:i.marks();return!!n.isInSet(a)||!a.some(c=>c.type.excludes(n))}const{ranges:s}=o;return s.some(({$from:a,$to:c})=>{let u=a.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(a.pos,c.pos,(f,h,m)=>{if(u)return!1;if(f.isInline){const v=!m||m.type.allowsMarkType(n),y=!!n.isInSet(f.marks)||!f.marks.some(w=>w.type.excludes(n));u=v&&y}return!u}),u})}const dSe=(e,t={})=>({tr:n,state:r,dispatch:o})=>{const{selection:i}=n,{empty:s,ranges:a}=i,c=Fa(e,r.schema);if(o)if(s){const u=sh(r,c);n.addStoredMark(c.create({...u,...t}))}else a.forEach(u=>{const f=u.$from.pos,h=u.$to.pos;r.doc.nodesBetween(f,h,(m,v)=>{const y=Math.max(v,f),w=Math.min(v+m.nodeSize,h);m.marks.find(b=>b.type===c)?m.marks.forEach(b=>{c===b.type&&n.addMark(y,w,c.create({...b.attrs,...t}))}):n.addMark(y,w,c.create(t))})});return uSe(r,n,c)},fSe=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),hSe=(e,t={})=>({state:n,dispatch:r,chain:o})=>{const i=Nn(e,n.schema);return i.isTextblock?o().command(({commands:s})=>zI(i,t)(n)?!0:s.clearNodes()).command(({state:s})=>zI(i,t)(s,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},pSe=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,o=vl(e,0,r.content.size),i=De.create(r,o);t.setSelection(i)}return!0},mSe=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,{from:o,to:i}=typeof e=="number"?{from:e,to:e}:e,s=Ve.atStart(r).from,a=Ve.atEnd(r).to,c=vl(o,s,a),u=vl(i,s,a),f=Ve.create(r,c,u);t.setSelection(f)}return!0},gSe=e=>({state:t,dispatch:n})=>{const r=Nn(e,t.schema);return Ybe(r)(t,n)};function UI(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter(o=>t?.includes(o.type.name));e.tr.ensureMarks(r)}}const vSe=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:o})=>{const{selection:i,doc:s}=t,{$from:a,$to:c}=i,u=o.extensionManager.attributes,f=am(u,a.node().type.name,a.node().attrs);if(i instanceof De&&i.node.isBlock)return!a.parentOffset||!Qc(s,a.pos)?!1:(r&&(e&&UI(n,o.extensionManager.splittableMarks),t.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;if(r){const h=c.parentOffset===c.parent.content.size;i instanceof Ve&&t.deleteSelection();const m=a.depth===0?void 0:Xxe(a.node(-1).contentMatchAt(a.indexAfter(-1)));let v=h&&m?[{type:m,attrs:f}]:void 0,y=Qc(t.doc,t.mapping.map(a.pos),1,v);if(!v&&!y&&Qc(t.doc,t.mapping.map(a.pos),1,m?[{type:m}]:void 0)&&(y=!0,v=m?[{type:m,attrs:f}]:void 0),y&&(t.split(t.mapping.map(a.pos),1,v),m&&!h&&!a.parentOffset&&a.parent.type!==m)){const w=t.mapping.map(a.before()),P=t.doc.resolve(w);a.node(-1).canReplaceWith(P.index(),P.index()+1,m)&&t.setNodeMarkup(t.mapping.map(a.before()),m)}e&&UI(n,o.extensionManager.splittableMarks),t.scrollIntoView()}return!0},ySe=e=>({tr:t,state:n,dispatch:r,editor:o})=>{var i;const s=Nn(e,n.schema),{$from:a,$to:c}=n.selection,u=n.selection.node;if(u&&u.isBlock||a.depth<2||!a.sameParent(c))return!1;const f=a.node(-1);if(f.type!==s)return!1;const h=o.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==s||a.index(-2)!==a.node(-2).childCount-1)return!1;if(r){let P=se.empty;const b=a.index(-1)?1:a.index(-2)?2:3;for(let I=a.depth-b;I>=a.depth-3;I-=1)P=se.from(a.node(I).copy(P));const S=a.indexAfter(-1){if(N>-1)return!1;I.isTextblock&&I.content.size===0&&(N=R+1)}),N>-1&&t.setSelection(Ve.near(t.doc.resolve(N))),t.scrollIntoView()}return!0}const m=c.pos===a.end()?f.contentMatchAt(0).defaultType:null,v=am(h,f.type.name,f.attrs),y=am(h,a.node().type.name,a.node().attrs);t.delete(a.pos,c.pos);const w=m?[{type:s,attrs:v},{type:m,attrs:y}]:[{type:s,attrs:v}];if(!Qc(t.doc,a.pos,2))return!1;if(r){const{selection:P,storedMarks:b}=n,{splittableMarks:S}=o.extensionManager,O=b||P.$to.parentOffset&&P.$from.marks();if(t.split(a.pos,2,w).scrollIntoView(),!O||!r)return!0;const E=O.filter($=>S.includes($.type.name));t.ensureMarks(E)}return!0},Ow=(e,t)=>{const n=jO(s=>s.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const o=e.doc.nodeAt(r);return n.node.type===o?.type&&Aa(e.doc,n.pos)&&e.join(n.pos),!0},Cw=(e,t)=>{const n=jO(s=>s.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const o=e.doc.nodeAt(r);return n.node.type===o?.type&&Aa(e.doc,r)&&e.join(r),!0},_Se=(e,t,n,r={})=>({editor:o,tr:i,state:s,dispatch:a,chain:c,commands:u,can:f})=>{const{extensions:h,splittableMarks:m}=o.extensionManager,v=Nn(e,s.schema),y=Nn(t,s.schema),{selection:w,storedMarks:P}=s,{$from:b,$to:S}=w,O=b.blockRange(S),E=P||w.$to.parentOffset&&w.$from.marks();if(!O)return!1;const $=jO(N=>WI(N.type.name,h))(w);if(O.depth>=1&&$&&O.depth-$.depth<=1){if($.node.type===v)return u.liftListItem(y);if(WI($.node.type.name,h)&&v.validContent($.node.content)&&a)return c().command(()=>(i.setNodeMarkup($.pos,v),!0)).command(()=>Ow(i,v)).command(()=>Cw(i,v)).run()}return!n||!E||!a?c().command(()=>f().wrapInList(v,r)?!0:u.clearNodes()).wrapInList(v,r).command(()=>Ow(i,v)).command(()=>Cw(i,v)).run():c().command(()=>{const N=f().wrapInList(v,r),I=E.filter(R=>m.includes(R.type.name));return i.ensureMarks(I),N?!0:u.clearNodes()}).wrapInList(v,r).command(()=>Ow(i,v)).command(()=>Cw(i,v)).run()},wSe=(e,t={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:i=!1}=n,s=Fa(e,r.schema);return Bx(r,s,t)?o.unsetMark(s,{extendEmptyMarkRange:i}):o.setMark(s,t)},bSe=(e,t,n={})=>({state:r,commands:o})=>{const i=Nn(e,r.schema),s=Nn(t,r.schema);return Ef(r,i,n)?o.setNode(s):o.setNode(i,n)},xSe=(e,t={})=>({state:n,commands:r})=>{const o=Nn(e,n.schema);return Ef(n,o,t)?r.lift(o):r.wrapIn(o,t)},SSe=()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r=0;c-=1)s.step(a.steps[c].invert(a.docs[c]));if(i.text){const c=s.doc.resolve(i.from).marks();s.replaceWith(i.from,i.to,e.schema.text(i.text,c))}else s.delete(i.from,i.to)}return!0}}return!1},PSe=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,ranges:o}=n;return r||t&&o.forEach(i=>{e.removeMark(i.$from.pos,i.$to.pos)}),!0},OSe=(e,t={})=>({tr:n,state:r,dispatch:o})=>{var i;const{extendEmptyMarkRange:s=!1}=t,{selection:a}=n,c=Fa(e,r.schema),{$from:u,empty:f,ranges:h}=a;if(!o)return!0;if(f&&s){let{from:m,to:v}=a;const y=(i=u.marks().find(P=>P.type===c))===null||i===void 0?void 0:i.attrs,w=NO(u,c,y);w&&(m=w.from,v=w.to),n.removeMark(m,v,c)}else h.forEach(m=>{n.removeMark(m.$from.pos,m.$to.pos,c)});return n.removeStoredMark(c),!0},CSe=(e,t={})=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const a=h1(typeof e=="string"?e:e.name,r.schema);return a?(a==="node"&&(i=Nn(e,r.schema)),a==="mark"&&(s=Fa(e,r.schema)),o&&n.selection.ranges.forEach(c=>{const u=c.$from.pos,f=c.$to.pos;r.doc.nodesBetween(u,f,(h,m)=>{i&&i===h.type&&n.setNodeMarkup(m,void 0,{...h.attrs,...t}),s&&h.marks.length&&h.marks.forEach(v=>{if(s===v.type){const y=Math.max(m,u),w=Math.min(m+h.nodeSize,f);n.addMark(y,w,s.create({...v.attrs,...t}))}})})}),!0):!1},kSe=(e,t={})=>({state:n,dispatch:r})=>{const o=Nn(e,n.schema);return Vbe(o,t)(n,r)},ESe=(e,t={})=>({state:n,dispatch:r})=>{const o=Nn(e,n.schema);return Hbe(o,t)(n,r)};var $Se=Object.freeze({__proto__:null,blur:uxe,clearContent:dxe,clearNodes:fxe,command:hxe,createParagraphNear:pxe,cut:mxe,deleteCurrentNode:gxe,deleteNode:vxe,deleteRange:yxe,deleteSelection:_xe,enter:wxe,exitCode:bxe,extendMarkRange:Sxe,first:Pxe,focus:Oxe,forEach:Cxe,insertContent:kxe,insertContentAt:Mxe,joinUp:Nxe,joinDown:Txe,joinBackward:Ixe,joinForward:jxe,joinItemBackward:Dxe,joinItemForward:Rxe,keyboardShortcut:zxe,lift:Axe,liftEmptyBlock:Bxe,liftListItem:Fxe,newlineInCode:Vxe,resetAttributes:Hxe,scrollIntoView:Wxe,selectAll:Uxe,selectNodeBackward:Zxe,selectNodeForward:Gxe,selectParentNode:Yxe,selectTextblockEnd:Kxe,selectTextblockStart:qxe,setContent:Jxe,setMark:dSe,setMeta:fSe,setNode:hSe,setNodeSelection:pSe,setTextSelection:mSe,sinkListItem:gSe,splitBlock:vSe,splitListItem:ySe,toggleList:_Se,toggleMark:wSe,toggleNode:bSe,toggleWrap:xSe,undoInputRule:SSe,unsetAllMarks:PSe,unsetMark:OSe,updateAttributes:CSe,wrapIn:kSe,wrapInList:ESe});const MSe=Sr.create({name:"commands",addCommands(){return{...$Se}}}),NSe=Sr.create({name:"editable",addProseMirrorPlugins(){return[new Kr({key:new Fi("editable"),props:{editable:()=>this.editor.options.editable}})]}}),TSe=Sr.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new Kr({key:new Fi("focusEvents"),props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),ISe=Sr.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:a})=>{const{selection:c,doc:u}=a,{empty:f,$anchor:h}=c,{pos:m,parent:v}=h,y=h.parent.isTextblock?a.doc.resolve(m-1):h,w=y.parent.type.spec.isolating,P=h.pos-h.parentOffset,b=w&&y.parent.childCount===1?P===h.pos:Ze.atStart(u).from===m;return!f||!b||!v.type.isTextblock||v.textContent.length?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},o={...r},i={...r,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return TO()||IO()?i:o},addProseMirrorPlugins(){return[new Kr({key:new Fi("clearDocument"),appendTransaction:(e,t,n)=>{if(!(e.some(y=>y.docChanged)&&!t.doc.eq(n.doc)))return;const{empty:o,from:i,to:s}=t.selection,a=Ze.atStart(t.doc).from,c=Ze.atEnd(t.doc).to;if(o||!(i===a&&s===c)||!(n.doc.textBetween(0,n.doc.content.size," "," ").length===0))return;const h=n.tr,m=l1({state:n,transaction:h}),{commands:v}=new c1({editor:this.editor,state:m});if(v.clearNodes(),!!h.steps.length)return h}})]}}),jSe=Sr.create({name:"tabindex",addProseMirrorPlugins(){return[new Kr({key:new Fi("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var DSe=Object.freeze({__proto__:null,ClipboardTextSerializer:cxe,Commands:MSe,Editable:NSe,FocusEvents:TSe,Keymap:ISe,Tabindex:jSe});const RSe=`.ProseMirror { position: relative; } @@ -662,20 +662,20 @@ img.ProseMirror-separator { .tippy-box[data-animation=fade][data-state=hidden] { opacity: 0 -}`;function RSe(e,t,n){const r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:""}]`);if(r!==null)return r;const o=document.createElement("style");return t&&o.setAttribute("nonce",t),o.setAttribute(`data-tiptap-style${n?`-${n}`:""}`,""),o.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(o),o}let zSe=class extends Kbe{constructor(t={}){super(),this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=RSe(LSe,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,n=!0){this.setOptions({editable:t}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(t,n){const r=GB(n)?n(t,[...this.state.plugins]):[...this.state.plugins,t],o=this.state.reconfigure({plugins:r});this.view.updateState(o)}unregisterPlugin(t){if(this.isDestroyed)return;const n=typeof t=="string"?`${t}$`:t.key,r=this.state.reconfigure({plugins:this.state.plugins.filter(o=>!o.key.startsWith(n))});this.view.updateState(r)}createExtensionManager(){const n=[...this.options.enableCoreExtensions?Object.values(jSe):[],...this.options.extensions].filter(r=>["extension","node","mark"].includes(r?.type));this.extensionManager=new jc(n,this)}createCommandManager(){this.commandManager=new c1({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){const t=QB(this.options.content,this.schema,this.options.parseOptions),n=JB(t,this.options.autofocus);this.view=new pbe(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:Dc.create({doc:t,selection:n||void 0})});const r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.createNodeViews(),this.prependClass();const o=this.view.dom;o.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(s=>{var a;return(a=this.capturedTransaction)===null||a===void 0?void 0:a.step(s)});return}const n=this.state.apply(t),r=!this.state.selection.eq(n.selection);this.view.updateState(n),this.emit("transaction",{editor:this,transaction:t}),r&&this.emit("selectionUpdate",{editor:this,transaction:t});const o=t.getMeta("focus"),i=t.getMeta("blur");o&&this.emit("focus",{editor:this,event:o.event,transaction:t}),i&&this.emit("blur",{editor:this,event:i.event,transaction:t}),!(!t.docChanged||t.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:t})}getAttributes(t){return XB(this.state,t)}isActive(t,n){const r=typeof t=="string"?t:null,o=typeof t=="string"?n:t;return lSe(this.state,r,o)}getJSON(){return this.state.doc.toJSON()}getHTML(){return nSe(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:n=` +}`;function LSe(e,t,n){const r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:""}]`);if(r!==null)return r;const o=document.createElement("style");return t&&o.setAttribute("nonce",t),o.setAttribute(`data-tiptap-style${n?`-${n}`:""}`,""),o.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(o),o}let zSe=class extends Kbe{constructor(t={}){super(),this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=LSe(RSe,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,n=!0){this.setOptions({editable:t}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(t,n){const r=GB(n)?n(t,[...this.state.plugins]):[...this.state.plugins,t],o=this.state.reconfigure({plugins:r});this.view.updateState(o)}unregisterPlugin(t){if(this.isDestroyed)return;const n=typeof t=="string"?`${t}$`:t.key,r=this.state.reconfigure({plugins:this.state.plugins.filter(o=>!o.key.startsWith(n))});this.view.updateState(r)}createExtensionManager(){const n=[...this.options.enableCoreExtensions?Object.values(DSe):[],...this.options.extensions].filter(r=>["extension","node","mark"].includes(r?.type));this.extensionManager=new Dc(n,this)}createCommandManager(){this.commandManager=new c1({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){const t=QB(this.options.content,this.schema,this.options.parseOptions),n=JB(t,this.options.autofocus);this.view=new pbe(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:jc.create({doc:t,selection:n||void 0})});const r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.createNodeViews(),this.prependClass();const o=this.view.dom;o.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(s=>{var a;return(a=this.capturedTransaction)===null||a===void 0?void 0:a.step(s)});return}const n=this.state.apply(t),r=!this.state.selection.eq(n.selection);this.view.updateState(n),this.emit("transaction",{editor:this,transaction:t}),r&&this.emit("selectionUpdate",{editor:this,transaction:t});const o=t.getMeta("focus"),i=t.getMeta("blur");o&&this.emit("focus",{editor:this,event:o.event,transaction:t}),i&&this.emit("blur",{editor:this,event:i.event,transaction:t}),!(!t.docChanged||t.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:t})}getAttributes(t){return XB(this.state,t)}isActive(t,n){const r=typeof t=="string"?t:null,o=typeof t=="string"?n:t;return lSe(this.state,r,o)}getJSON(){return this.state.doc.toJSON()}getHTML(){return nSe(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:n=` -`,textSerializers:r={}}=t||{};return rSe(this.state.doc,{blockSeparator:n,textSerializers:{...KB(this.schema),...r}})}get isEmpty(){return cSe(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var t;return!(!((t=this.view)===null||t===void 0)&&t.docView)}};function Al(e){return new d1({find:e.find,handler:({state:t,range:n,match:r})=>{const o=Ue(e.getAttributes,void 0,r);if(o===!1||o===null)return null;const{tr:i}=t,s=r[r.length-1],a=r[0];if(s){const c=a.search(/\S/),u=n.from+a.indexOf(s),f=u+s.length;if(jO(n.from,n.to,t.doc).filter(v=>v.mark.type.excluded.find(w=>w===e.type&&w!==v.mark.type)).filter(v=>v.to>u).length)return null;fn.from&&i.delete(n.from+c,u);const m=n.from+c+s.length;i.addMark(n.from+c,m,e.type.create(o||{})),i.removeStoredMark(e.type)}}})}function eF(e){return new d1({find:e.find,handler:({state:t,range:n,match:r})=>{const o=Ue(e.getAttributes,void 0,r)||{},{tr:i}=t,s=n.from;let a=n.to;const c=e.type.create(o);if(r[1]){const u=r[0].lastIndexOf(r[1]);let f=s+u;f>a?f=a:a=f+r[1].length;const h=r[0][r[0].length-1];i.insertText(h,s+r[0].length-1),i.replaceWith(f,a,c)}else r[0]&&i.insert(s-1,e.type.create(o)).delete(i.mapping.map(s),i.mapping.map(a));i.scrollIntoView()}})}function Fx(e){return new d1({find:e.find,handler:({state:t,range:n,match:r})=>{const o=t.doc.resolve(n.from),i=Ue(e.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,i)}})}function $f(e){return new d1({find:e.find,handler:({state:t,range:n,match:r,chain:o})=>{const i=Ue(e.getAttributes,void 0,r)||{},s=t.tr.delete(n.from,n.to),c=s.doc.resolve(n.from).blockRange(),u=c&&yO(c,e.type,i);if(!u)return null;if(s.wrap(c,u),e.keepMarks&&e.editor){const{selection:h,storedMarks:m}=t,{splittableMarks:v}=e.editor.extensionManager,y=m||h.$to.parentOffset&&h.$from.marks();if(y){const w=y.filter(P=>v.includes(P.type.name));s.ensureMarks(w)}}if(e.keepAttributes){const h=e.type.name==="bulletList"||e.type.name==="orderedList"?"listItem":"taskList";o().updateAttributes(h,i).run()}const f=s.doc.resolve(n.from-1).nodeBefore;f&&f.type===e.type&&Aa(s.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,f))&&s.join(n.from-1)}})}class sr{constructor(t={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Ue(Ce(this,"addOptions",{name:this.name}))),this.storage=Ue(Ce(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new sr(t)}configure(t={}){const n=this.extend();return n.options=f1(this.options,t),n.storage=Ue(Ce(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){const n=new sr(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Ue(Ce(n,"addOptions",{name:n.name})),n.storage=Ue(Ce(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:t,mark:n}){const{tr:r}=t.state,o=t.state.selection.$from;if(o.pos===o.end()){const s=o.marks();if(!!!s.find(u=>u?.type.name===n.name))return!1;const c=s.find(u=>u?.type.name===n.name);return c&&r.removeStoredMark(c),r.insertText(" ",o.pos),t.view.dispatch(r),!0}return!1}}let qr=class Vx{constructor(t={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Ue(Ce(this,"addOptions",{name:this.name}))),this.storage=Ue(Ce(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new Vx(t)}configure(t={}){const n=this.extend();return n.options=f1(this.options,t),n.storage=Ue(Ce(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){const n=new Vx(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Ue(Ce(n,"addOptions",{name:n.name})),n.storage=Ue(Ce(n,"addStorage",{name:n.name,options:n.options})),n}};function Na(e){return new rxe({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:o})=>{const i=Ue(e.getAttributes,void 0,r,o);if(i===!1||i===null)return null;const{tr:s}=t,a=r[r.length-1],c=r[0];let u=n.to;if(a){const f=c.search(/\S/),h=n.from+c.indexOf(a),m=h+a.length;if(jO(n.from,n.to,t.doc).filter(y=>y.mark.type.excluded.find(P=>P===e.type&&P!==y.mark.type)).filter(y=>y.to>h).length)return null;mn.from&&s.delete(n.from+f,h),u=n.from+f+a.length,s.addMark(n.from+f,u,e.type.create(i||{})),s.removeStoredMark(e.type)}}})}const ASe=({renderers:e})=>k.createElement(k.Fragment,null,Object.entries(e).map(([t,n])=>iJ.createPortal(n.reactElement,n.element,t)));class BSe extends k.Component{constructor(t){super(t),this.editorContentRef=k.createRef(),this.initialized=!1,this.state={renderers:{}}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const{editor:t}=this.props;if(t&&t.options.element){if(t.contentComponent)return;const n=this.editorContentRef.current;n.append(...t.options.element.childNodes),t.setOptions({element:n}),t.contentComponent=this,t.createNodeViews(),this.initialized=!0}}maybeFlushSync(t){this.initialized?Cs.flushSync(t):t()}setRenderer(t,n){this.maybeFlushSync(()=>{this.setState(({renderers:r})=>({renderers:{...r,[t]:n}}))})}removeRenderer(t){this.maybeFlushSync(()=>{this.setState(({renderers:n})=>{const r={...n};return delete r[t],{renderers:r}})})}componentWillUnmount(){const{editor:t}=this.props;if(!t||(this.initialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),t.contentComponent=null,!t.options.element.firstChild))return;const n=document.createElement("div");n.append(...t.options.element.childNodes),t.setOptions({element:n})}render(){const{editor:t,...n}=this.props;return k.createElement(k.Fragment,null,k.createElement("div",{ref:this.editorContentRef,...n}),k.createElement(ASe,{renderers:this.state.renderers}))}}const FSe=e=>{const t=k.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return k.createElement(BSe,{key:t,...e})},VSe=k.memo(FSe);class HSe extends zSe{constructor(){super(...arguments),this.contentComponent=null}}function WSe(){const[,e]=_.useState(0);return()=>e(t=>t+1)}const tF=(e={},t=[])=>{const[n,r]=_.useState(null),o=WSe(),{onBeforeCreate:i,onBlur:s,onCreate:a,onDestroy:c,onFocus:u,onSelectionUpdate:f,onTransaction:h,onUpdate:m}=e,v=_.useRef(i),y=_.useRef(s),w=_.useRef(a),P=_.useRef(c),b=_.useRef(u),S=_.useRef(f),O=_.useRef(h),E=_.useRef(m);return _.useEffect(()=>{n&&(i&&(n.off("beforeCreate",v.current),n.on("beforeCreate",i),v.current=i),s&&(n.off("blur",y.current),n.on("blur",s),y.current=s),a&&(n.off("create",w.current),n.on("create",a),w.current=a),c&&(n.off("destroy",P.current),n.on("destroy",c),P.current=c),u&&(n.off("focus",b.current),n.on("focus",u),b.current=u),f&&(n.off("selectionUpdate",S.current),n.on("selectionUpdate",f),S.current=f),h&&(n.off("transaction",O.current),n.on("transaction",h),O.current=h),m&&(n.off("update",E.current),n.on("update",m),E.current=m))},[i,s,a,c,u,f,h,m,n]),_.useEffect(()=>{let $=!0;const N=new HSe(e);return r(N),N.on("transaction",()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{$&&o()})})}),()=>{$=!1}},t),_.useEffect(()=>()=>{n?.destroy()},[n]),n},USe=_.createContext({editor:null});USe.Consumer;const ZSe=_.createContext({onDragStart:void 0}),GSe=()=>_.useContext(ZSe);k.forwardRef((e,t)=>{const{onDragStart:n}=GSe(),r=e.as||"div";return k.createElement(r,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})});var YSe=Object.defineProperty,ZI=Object.getOwnPropertySymbols,KSe=Object.prototype.hasOwnProperty,qSe=Object.prototype.propertyIsEnumerable,GI=(e,t,n)=>t in e?YSe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,kw=(e,t)=>{for(var n in t||(t={}))KSe.call(t,n)&&GI(e,n,t[n]);if(ZI)for(var n of ZI(t))qSe.call(t,n)&&GI(e,n,t[n]);return e};function JSe(e,t){if(!e)return null;const n=t.colorScheme==="dark"?5:7;return{pre:{background:t.colorScheme==="dark"?t.colors.dark[8]:t.fn.rgba(t.colors.gray[0],.65),borderRadius:t.fn.radius(),color:t.colorScheme==="dark"?t.colors.dark[0]:t.colors.gray[9],fontFamily:t.fontFamilyMonospace,padding:`${t.spacing.md} ${t.spacing.xl}`,"& code":{background:"none",color:"inherit",fontSize:t.fontSizes.sm,padding:0}," & .hljs-comment, & .hljs-quote":{color:t.colorScheme==="dark"?t.colors.dark[2]:t.colors.gray[5]},"& .hljs-variable, & .hljs-template-variable, & .hljs-attribute, & .hljs-tag, & .hljs-name, & .hljs-regexp, & .hljs-link, & .hljs-name, & .hljs-selector-id, & .hljs-selector-class":{color:t.colors.red[n]},"& .hljs-number, & .hljs-meta, & .hljs-built_in, & .hljs-builtin-name, & .hljs-literal, & .hljs-type, & .hljs-params":{color:t.colors[t.colorScheme==="dark"?"cyan":"blue"][n]},"& .hljs-string, & .hljs-symbol, & .hljs-bullet":{color:t.colors.red[n]},"& .hljs-title, & .hljs-section":{color:t.colors[t.colorScheme==="dark"?"yellow":"pink"][n]},"& .hljs-keyword, & .hljs-selector-tag":{color:t.colors.violet[n]},"& .hljs-emphasis":{fontStyle:"italic"},"& .hljs-strong":{fontWeight:700}}}}function QSe(e){return e?{"& li > p":{margin:0},"& ul li, & ol li":{marginTop:M(2)},"& ul, & ol":{marginTop:M(5),marginBottom:M(5)},"& p":{marginBottom:M(7)},"& h1, & h2, & h3, & h4, & h5, & h6, & p":{marginTop:0}}:null}var XSe=ue((e,{withCodeHighlightStyles:t,withTypographyStyles:n})=>({typographyStylesProvider:kw({},QSe(n)),content:kw({backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white,borderRadius:e.fn.radius(),"& .ProseMirror":{outline:0,padding:e.spacing.md},"& .ProseMirror > *:last-child":{marginBottom:0},"& .ProseMirror p.is-editor-empty:first-of-type::before":kw({content:"attr(data-placeholder)",pointerEvents:"none",userSelect:"none",float:"left",height:0},e.fn.placeholderStyles())},JSe(t,e))}));const ePe=XSe;var tPe=Object.defineProperty,oy=Object.getOwnPropertySymbols,nF=Object.prototype.hasOwnProperty,rF=Object.prototype.propertyIsEnumerable,YI=(e,t,n)=>t in e?tPe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nPe=(e,t)=>{for(var n in t||(t={}))nF.call(t,n)&&YI(e,n,t[n]);if(oy)for(var n of oy(t))rF.call(t,n)&&YI(e,n,t[n]);return e},rPe=(e,t)=>{var n={};for(var r in e)nF.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&oy)for(var r of oy(e))t.indexOf(r)<0&&rF.call(e,r)&&(n[r]=e[r]);return n};const oPe={},oF=_.forwardRef((e,t)=>{const n=ae("RichTextEditorContent",oPe,e),{className:r}=n,o=rPe(n,["className"]),{editor:i,withCodeHighlightStyles:s,withTypographyStyles:a,classNames:c,styles:u,unstyled:f,variant:h}=za(),{classes:m,cx:v}=ePe({withCodeHighlightStyles:s,withTypographyStyles:a},{name:"RichTextEditor",classNames:c,styles:u,unstyled:f,variant:h});return k.createElement(A8,{className:v(m.typographyStylesProvider,r),unstyled:!a||f,ref:t},k.createElement(Pe,nPe({component:VSe,editor:i,className:m.content},o)))});oF.displayName="@mantine/tiptap/Content";var iPe=Object.defineProperty,KI=Object.getOwnPropertySymbols,sPe=Object.prototype.hasOwnProperty,aPe=Object.prototype.propertyIsEnumerable,qI=(e,t,n)=>t in e?iPe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,JI=(e,t)=>{for(var n in t||(t={}))sPe.call(t,n)&&qI(e,n,t[n]);if(KI)for(var n of KI(t))aPe.call(t,n)&&qI(e,n,t[n]);return e},lPe=ue(e=>{const t=e.fn.variant({variant:"light"});return{control:{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white,minWidth:M(26),height:M(26),display:"flex",justifyContent:"center",alignItems:"center",border:`${M(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`,borderRadius:e.fn.radius(),cursor:"default","&[data-interactive]":JI({cursor:"pointer"},e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[0]})),"&[data-active]":{backgroundColor:t.background,color:t.color,"&:hover":JI({},e.fn.hover({backgroundColor:t.hover}))}}}});const cPe=lPe;var uPe=Object.defineProperty,iy=Object.getOwnPropertySymbols,iF=Object.prototype.hasOwnProperty,sF=Object.prototype.propertyIsEnumerable,QI=(e,t,n)=>t in e?uPe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dPe=(e,t)=>{for(var n in t||(t={}))iF.call(t,n)&&QI(e,n,t[n]);if(iy)for(var n of iy(t))sF.call(t,n)&&QI(e,n,t[n]);return e},fPe=(e,t)=>{var n={};for(var r in e)iF.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&iy)for(var r of iy(e))t.indexOf(r)<0&&sF.call(e,r)&&(n[r]=e[r]);return n};const hPe={interactive:!0},ah=_.forwardRef((e,t)=>{const n=ae("RichTextEditorControl",hPe,e),{className:r,active:o,children:i,interactive:s}=n,a=fPe(n,["className","active","children","interactive"]),{classNames:c,styles:u,unstyled:f,variant:h}=za(),{classes:m,cx:v}=cPe(null,{name:"RichTextEditor",classNames:c,styles:u,unstyled:f,variant:h});return k.createElement(ds,dPe({className:v(m.control,r),"data-rich-text-editor-control":!0,tabIndex:s?0:-1,"data-interactive":s||void 0,"data-active":o||void 0,"aria-pressed":o&&s||void 0,"aria-hidden":!s||void 0,ref:t,unstyled:f},a),i)});ah.displayName="@mantine/tiptap/Control";var pPe=ue(e=>({controlsGroup:{display:"flex","& [data-rich-text-editor-control]":{borderRadius:0,"&:not(:last-of-type)":{borderRight:0},"&:last-of-type":{borderTopRightRadius:e.fn.radius(),borderBottomRightRadius:e.fn.radius()},"&:first-of-type":{borderTopLeftRadius:e.fn.radius(),borderBottomLeftRadius:e.fn.radius()}}}}));const mPe=pPe;var gPe=Object.defineProperty,sy=Object.getOwnPropertySymbols,aF=Object.prototype.hasOwnProperty,lF=Object.prototype.propertyIsEnumerable,XI=(e,t,n)=>t in e?gPe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vPe=(e,t)=>{for(var n in t||(t={}))aF.call(t,n)&&XI(e,n,t[n]);if(sy)for(var n of sy(t))lF.call(t,n)&&XI(e,n,t[n]);return e},yPe=(e,t)=>{var n={};for(var r in e)aF.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&sy)for(var r of sy(e))t.indexOf(r)<0&&lF.call(e,r)&&(n[r]=e[r]);return n};const _Pe={},cF=_.forwardRef((e,t)=>{const n=ae("RichTextEditorControlsGroup",_Pe,e),{className:r,children:o}=n,i=yPe(n,["className","children"]),{classNames:s,styles:a,unstyled:c}=za(),{classes:u,cx:f}=mPe(null,{name:"RichTextEditor",classNames:s,styles:a,unstyled:c});return k.createElement(Pe,vPe({className:f(u.controlsGroup,r),ref:t},i),o)});cF.displayName="@mantine/tiptap/ControlsGroup";var wPe=ue((e,{sticky:t,stickyOffset:n})=>({toolbar:{position:t?"sticky":"static",top:t?M(n):void 0,padding:`${e.spacing.xs} ${e.spacing.md}`,backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white,zIndex:1,borderTopRightRadius:e.fn.radius(),borderTopLeftRadius:e.fn.radius(),borderBottom:`${M(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`}}));const bPe=wPe;var xPe=Object.defineProperty,ay=Object.getOwnPropertySymbols,uF=Object.prototype.hasOwnProperty,dF=Object.prototype.propertyIsEnumerable,eD=(e,t,n)=>t in e?xPe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,SPe=(e,t)=>{for(var n in t||(t={}))uF.call(t,n)&&eD(e,n,t[n]);if(ay)for(var n of ay(t))dF.call(t,n)&&eD(e,n,t[n]);return e},PPe=(e,t)=>{var n={};for(var r in e)uF.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ay)for(var r of ay(e))t.indexOf(r)<0&&dF.call(e,r)&&(n[r]=e[r]);return n};const OPe={stickyOffset:0},fF=_.forwardRef((e,t)=>{const n=ae("RichTextEditorToolbar",OPe,e),{className:r,children:o,sticky:i,stickyOffset:s}=n,a=PPe(n,["className","children","sticky","stickyOffset"]),c=za(),{classes:u,cx:f}=bPe({sticky:i,stickyOffset:s},{name:"RichTextEditor",classNames:c.classNames,styles:c.styles,unstyled:c.unstyled,variant:c.variant});return k.createElement(nt,SPe({className:f(u.toolbar,r),ref:t},a),o)});fF.displayName="@mantine/tiptap/Toolbar";const CPe={linkControlLabel:"Link",colorPickerControlLabel:"Text color",highlightControlLabel:"Highlight text",colorControlLabel:e=>`Set text color ${e}`,boldControlLabel:"Bold",italicControlLabel:"Italic",underlineControlLabel:"Underline",strikeControlLabel:"Strikethrough",clearFormattingControlLabel:"Clear formatting",unlinkControlLabel:"Remove link",bulletListControlLabel:"Bullet list",orderedListControlLabel:"Ordered list",h1ControlLabel:"Heading 1",h2ControlLabel:"Heading 2",h3ControlLabel:"Heading 3",h4ControlLabel:"Heading 4",h5ControlLabel:"Heading 5",h6ControlLabel:"Heading 6",blockquoteControlLabel:"Blockquote",alignLeftControlLabel:"Align text: left",alignCenterControlLabel:"Align text: center",alignRightControlLabel:"Align text: right",alignJustifyControlLabel:"Align text: justify",codeControlLabel:"Code",codeBlockControlLabel:"Code block",subscriptControlLabel:"Subscript",superscriptControlLabel:"Superscript",unsetColorControlLabel:"Unset color",hrControlLabel:"Horizontal line",linkEditorInputLabel:"Enter URL",linkEditorInputPlaceholder:"https://example.com/",linkEditorExternalLink:"Open link in a new tab",linkEditorInternalLink:"Open link in the same tab",linkEditorSave:"Save",colorPickerCancel:"Cancel",colorPickerClear:"Clear color",colorPickerColorPicker:"Color picker",colorPickerPalette:"Color palette",colorPickerSave:"Save",colorPickerColorLabel:e=>`Set text color ${e}`};var kPe=ue(e=>({root:{position:"relative",border:`${M(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`,borderRadius:e.fn.radius()}}));const EPe=kPe;var $Pe=Object.defineProperty,ly=Object.getOwnPropertySymbols,hF=Object.prototype.hasOwnProperty,pF=Object.prototype.propertyIsEnumerable,tD=(e,t,n)=>t in e?$Pe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,MPe=(e,t)=>{for(var n in t||(t={}))hF.call(t,n)&&tD(e,n,t[n]);if(ly)for(var n of ly(t))pF.call(t,n)&&tD(e,n,t[n]);return e},NPe=(e,t)=>{var n={};for(var r in e)hF.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ly)for(var r of ly(e))t.indexOf(r)<0&&pF.call(e,r)&&(n[r]=e[r]);return n};const LO=_.forwardRef((e,t)=>{var n=e,{className:r,active:o,icon:i}=n,s=NPe(n,["className","active","icon"]);return k.createElement(ah,MPe({active:o,ref:t},s),k.createElement(i,{size:"1rem"}))});LO.displayName="@mantine/tiptap/ControlBase";var TPe=Object.defineProperty,nD=Object.getOwnPropertySymbols,IPe=Object.prototype.hasOwnProperty,DPe=Object.prototype.propertyIsEnumerable,rD=(e,t,n)=>t in e?TPe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,jPe=(e,t)=>{for(var n in t||(t={}))IPe.call(t,n)&&rD(e,n,t[n]);if(nD)for(var n of nD(t))DPe.call(t,n)&&rD(e,n,t[n]);return e};function Et({label:e,isActive:t,operation:n,icon:r}){return _.forwardRef((o,i)=>{const{editor:s,labels:a}=za(),c=a[e];return k.createElement(LO,jPe({"aria-label":c,title:c,active:t?.name?s?.isActive(t.name,t.attributes):!1,ref:i,onClick:()=>s?.chain().focus()[n.name](n.attributes).run(),icon:r},o))})}var LPe=Object.defineProperty,RPe=Object.defineProperties,zPe=Object.getOwnPropertyDescriptors,oD=Object.getOwnPropertySymbols,APe=Object.prototype.hasOwnProperty,BPe=Object.prototype.propertyIsEnumerable,iD=(e,t,n)=>t in e?LPe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$t=(e,t)=>{for(var n in t||(t={}))APe.call(t,n)&&iD(e,n,t[n]);if(oD)for(var n of oD(t))BPe.call(t,n)&&iD(e,n,t[n]);return e},Mt=(e,t)=>RPe(e,zPe(t));const FPe=Et({label:"boldControlLabel",icon:e=>k.createElement(Jpe,Mt($t({},e),{stroke:1.5})),isActive:{name:"bold"},operation:{name:"toggleBold"}}),VPe=Et({label:"italicControlLabel",icon:e=>k.createElement(gme,Mt($t({},e),{stroke:1.5})),isActive:{name:"italic"},operation:{name:"toggleItalic"}}),HPe=Et({label:"underlineControlLabel",icon:e=>k.createElement(Lme,Mt($t({},e),{stroke:1.5})),isActive:{name:"underline"},operation:{name:"toggleUnderline"}}),WPe=Et({label:"strikeControlLabel",icon:e=>k.createElement(Tme,Mt($t({},e),{stroke:1.5})),isActive:{name:"strike"},operation:{name:"toggleStrike"}}),UPe=Et({label:"clearFormattingControlLabel",icon:e=>k.createElement(eme,Mt($t({},e),{stroke:1.5})),operation:{name:"unsetAllMarks"}}),ZPe=Et({label:"unlinkControlLabel",icon:e=>k.createElement(a7,Mt($t({},e),{stroke:1.5})),operation:{name:"unsetLink"}}),GPe=Et({label:"bulletListControlLabel",icon:e=>k.createElement(Sme,Mt($t({},e),{stroke:1.5})),isActive:{name:"bulletList"},operation:{name:"toggleBulletList"}}),YPe=Et({label:"orderedListControlLabel",icon:e=>k.createElement(xme,Mt($t({},e),{stroke:1.5})),isActive:{name:"orderedList"},operation:{name:"toggleOrderedList"}}),KPe=Et({label:"h1ControlLabel",icon:e=>k.createElement(cme,Mt($t({},e),{stroke:1.5})),isActive:{name:"heading",attributes:{level:1}},operation:{name:"toggleHeading",attributes:{level:1}}}),qPe=Et({label:"h2ControlLabel",icon:e=>k.createElement(ume,Mt($t({},e),{stroke:1.5})),isActive:{name:"heading",attributes:{level:2}},operation:{name:"toggleHeading",attributes:{level:2}}}),JPe=Et({label:"h3ControlLabel",icon:e=>k.createElement(dme,Mt($t({},e),{stroke:1.5})),isActive:{name:"heading",attributes:{level:3}},operation:{name:"toggleHeading",attributes:{level:3}}}),QPe=Et({label:"h4ControlLabel",icon:e=>k.createElement(fme,Mt($t({},e),{stroke:1.5})),isActive:{name:"heading",attributes:{level:4}},operation:{name:"toggleHeading",attributes:{level:4}}}),XPe=Et({label:"h5ControlLabel",icon:e=>k.createElement(hme,Mt($t({},e),{stroke:1.5})),isActive:{name:"heading",attributes:{level:5}},operation:{name:"toggleHeading",attributes:{level:5}}}),eOe=Et({label:"h6ControlLabel",icon:e=>k.createElement(pme,Mt($t({},e),{stroke:1.5})),isActive:{name:"heading",attributes:{level:6}},operation:{name:"toggleHeading",attributes:{level:6}}}),tOe=Et({label:"blockquoteControlLabel",icon:e=>k.createElement(qpe,Mt($t({},e),{stroke:1.5})),isActive:{name:"blockquote"},operation:{name:"toggleBlockquote"}}),nOe=Et({label:"alignLeftControlLabel",icon:e=>k.createElement(Wpe,Mt($t({},e),{stroke:1.5})),operation:{name:"setTextAlign",attributes:"left"}}),rOe=Et({label:"alignRightControlLabel",icon:e=>k.createElement(Upe,Mt($t({},e),{stroke:1.5})),operation:{name:"setTextAlign",attributes:"right"}}),oOe=Et({label:"alignCenterControlLabel",icon:e=>k.createElement(Vpe,Mt($t({},e),{stroke:1.5})),operation:{name:"setTextAlign",attributes:"center"}}),iOe=Et({label:"alignJustifyControlLabel",icon:e=>k.createElement(Hpe,Mt($t({},e),{stroke:1.5})),operation:{name:"setTextAlign",attributes:"justify"}}),sOe=Et({label:"subscriptControlLabel",icon:e=>k.createElement(Ime,Mt($t({},e),{stroke:1.5})),isActive:{name:"subscript"},operation:{name:"toggleSubscript"}}),aOe=Et({label:"superscriptControlLabel",icon:e=>k.createElement(Dme,Mt($t({},e),{stroke:1.5})),isActive:{name:"superscript"},operation:{name:"toggleSuperscript"}}),lOe=Et({label:"codeControlLabel",icon:e=>k.createElement(e7,Mt($t({},e),{stroke:1.5})),isActive:{name:"code"},operation:{name:"toggleCode"}}),cOe=Et({label:"codeBlockControlLabel",icon:e=>k.createElement(e7,Mt($t({},e),{stroke:1.5})),isActive:{name:"codeBlock"},operation:{name:"toggleCodeBlock"}}),uOe=Et({label:"highlightControlLabel",icon:e=>k.createElement(mme,Mt($t({},e),{stroke:1.5})),isActive:{name:"highlight"},operation:{name:"toggleHighlight"}}),dOe=Et({label:"hrControlLabel",icon:e=>k.createElement(_me,Mt($t({},e),{stroke:1.5})),operation:{name:"setHorizontalRule"}}),fOe=Et({label:"unsetColorControlLabel",icon:e=>k.createElement(X8,Mt($t({},e),{stroke:1.5})),operation:{name:"unsetColor"}});var hOe=Object.defineProperty,sD=Object.getOwnPropertySymbols,pOe=Object.prototype.hasOwnProperty,mOe=Object.prototype.propertyIsEnumerable,aD=(e,t,n)=>t in e?hOe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gOe=(e,t)=>{for(var n in t||(t={}))pOe.call(t,n)&&aD(e,n,t[n]);if(sD)for(var n of sD(t))mOe.call(t,n)&&aD(e,n,t[n]);return e},vOe=ue(e=>{const t=e.fn.variant({variant:"light"});return{linkEditor:{display:"flex"},linkEditorInput:{borderTopRightRadius:0,borderBottomRightRadius:0,borderRight:0},linkEditorExternalControl:{backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.colors.dark[7],.5):e.white,border:`${M(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`,height:M(24),width:M(24),display:"flex",justifyContent:"center",alignItems:"center",borderRadius:e.fn.radius(),"&[data-active]":gOe({backgroundColor:t.background,borderColor:t.border,color:t.color},e.fn.hover({background:t.hover}))},linkEditorSave:{borderTopLeftRadius:0,borderBottomLeftRadius:0}}});const yOe=vOe;var _Oe=Object.defineProperty,wOe=Object.defineProperties,bOe=Object.getOwnPropertyDescriptors,cy=Object.getOwnPropertySymbols,mF=Object.prototype.hasOwnProperty,gF=Object.prototype.propertyIsEnumerable,lD=(e,t,n)=>t in e?_Oe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Hx=(e,t)=>{for(var n in t||(t={}))mF.call(t,n)&&lD(e,n,t[n]);if(cy)for(var n of cy(t))gF.call(t,n)&&lD(e,n,t[n]);return e},xOe=(e,t)=>wOe(e,bOe(t)),vF=(e,t)=>{var n={};for(var r in e)mF.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&cy)for(var r of cy(e))t.indexOf(r)<0&&gF.call(e,r)&&(n[r]=e[r]);return n};const SOe=e=>{var t=e,{size:n}=t,r=vF(t,["size"]);return k.createElement(wme,Hx({size:n,stroke:1.5},r))},POe={initialExternal:!1},OOe=_.forwardRef((e,t)=>{const n=ae("RichTextEditorLinkControl",POe,e),{icon:r,popoverProps:o,disableTooltips:i,initialExternal:s}=n,a=vF(n,["icon","popoverProps","disableTooltips","initialExternal"]),{editor:c,labels:u,classNames:f,styles:h,unstyled:m,variant:v}=za(),{classes:y}=yOe(null,{name:"RichTextEditor",classNames:f,styles:h,unstyled:m,variant:v}),[w,P]=SY(""),[b,S]=_.useState(s),[O,{open:E,close:$}]=NS(!1),N=()=>{E();const z=c?.getAttributes("link");P(z?.href||""),S(z?.target==="_blank")},I=()=>{$(),P(""),S(s)},R=()=>{I(),w===""?c.chain().focus().extendMarkRange("link").unsetLink().run():c.chain().focus().extendMarkRange("link").setLink({href:w,target:b?"_blank":null}).run()},B=z=>{z.key==="Enter"&&(z.preventDefault(),R())};return Pm("edit-link",N,!1),k.createElement(En,Hx({trapFocus:!0,shadow:"md",withinPortal:!0,opened:O,onClose:I,offset:-44,zIndex:1e4,unstyled:m},o),k.createElement(En.Target,null,k.createElement(LO,xOe(Hx({icon:r||SOe,"aria-label":u.linkControlLabel,title:u.linkControlLabel,onClick:N,active:c?.isActive("link"),unstyled:m},a),{ref:t}))),k.createElement(En.Dropdown,{sx:z=>({backgroundColor:z.colorScheme==="dark"?z.colors.dark[7]:z.white})},k.createElement("div",{className:y.linkEditor},k.createElement(_n,{placeholder:u.linkEditorInputPlaceholder,"aria-label":u.linkEditorInputLabel,type:"url",value:w,onChange:P,classNames:{input:y.linkEditorInput},onKeyDown:B,unstyled:m,rightSection:k.createElement(zt,{label:b?u.linkEditorExternalLink:u.linkEditorInternalLink,events:{hover:!0,focus:!0,touch:!0},withinPortal:!0,withArrow:!0,disabled:i,unstyled:m,zIndex:1e4},k.createElement(ds,{onClick:()=>S(z=>!z),"data-active":b||void 0,className:y.linkEditorExternalControl,unstyled:m},k.createElement(ime,{size:M(14),stroke:1.5})))}),k.createElement(at,{variant:"default",onClick:R,className:y.linkEditorSave,unstyled:m},u.linkEditorSave))))});var COe=Object.defineProperty,kOe=Object.defineProperties,EOe=Object.getOwnPropertyDescriptors,uy=Object.getOwnPropertySymbols,yF=Object.prototype.hasOwnProperty,_F=Object.prototype.propertyIsEnumerable,cD=(e,t,n)=>t in e?COe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ew=(e,t)=>{for(var n in t||(t={}))yF.call(t,n)&&cD(e,n,t[n]);if(uy)for(var n of uy(t))_F.call(t,n)&&cD(e,n,t[n]);return e},$Oe=(e,t)=>kOe(e,EOe(t)),MOe=(e,t)=>{var n={};for(var r in e)yF.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&uy)for(var r of uy(e))t.indexOf(r)<0&&_F.call(e,r)&&(n[r]=e[r]);return n};const NOe={},wF=_.forwardRef((e,t)=>{const n=ae("RichTextEditorColorPickerControl",NOe,e),{popoverProps:r,colors:o,colorPickerProps:i}=n,s=MOe(n,["popoverProps","colors","colorPickerProps"]),{editor:a,labels:c,unstyled:u}=za(),[f,{toggle:h,close:m}]=NS(!1),[v,y]=_.useState("palette"),w=ar(),P=a?.getAttributes("textStyle").color||(w.colorScheme==="dark"?w.colors.dark[1]:w.black),b=(E,$=!0)=>{a.chain().focus().setColor(E).run(),$&&m()},S=()=>{a.chain().focus().unsetColor().run(),m()},O=o.map((E,$)=>k.createElement(_f,{key:$,component:"button",color:E,onClick:()=>b(E),size:26,radius:"xs",sx:{cursor:"pointer"},title:c.colorPickerColorLabel(E),"aria-label":c.colorPickerColorLabel(E),unstyled:u}));return k.createElement(En,Ew({opened:f,withinPortal:!0,trapFocus:!0,onClose:m,unstyled:u},r),k.createElement(En.Target,null,k.createElement(ah,$Oe(Ew({"aria-label":c.colorPickerControlLabel,title:c.colorPickerControlLabel},s),{ref:t,onClick:h}),k.createElement(_f,{color:P,size:14,unstyled:u}))),k.createElement(En.Dropdown,{sx:()=>({backgroundColor:w.colorScheme==="dark"?w.colors.dark[7]:w.white})},v==="palette"&&k.createElement(qP,{cols:7,spacing:2},O),v==="colorPicker"&&k.createElement(N4,Ew({defaultValue:P,onChange:E=>b(E,!1),unstyled:u},i)),k.createElement(zt.Group,{closeDelay:200},k.createElement(nt,{position:"right",spacing:"xs",mt:"sm"},v==="palette"&&k.createElement(Xe,{variant:"default",onClick:m,unstyled:u,title:c.colorPickerCancel,"aria-label":c.colorPickerCancel},k.createElement(pu,{stroke:1.5,size:"1rem"})),k.createElement(Xe,{variant:"default",onClick:S,unstyled:u,title:c.colorPickerClear,"aria-label":c.colorPickerClear},k.createElement(X8,{stroke:1.5,size:"1rem"})),v==="palette"?k.createElement(Xe,{variant:"default",onClick:()=>y("colorPicker"),unstyled:u,title:c.colorPickerColorPicker,"aria-label":c.colorPickerColorPicker},k.createElement(nme,{stroke:1.5,size:"1rem"})):k.createElement(Xe,{variant:"default",onClick:()=>y("palette"),unstyled:u,"aria-label":c.colorPickerPalette,title:c.colorPickerPalette},k.createElement(i7,{stroke:1.5,size:"1rem"})),v==="colorPicker"&&k.createElement(Xe,{variant:"default",onClick:m,unstyled:u,title:c.colorPickerSave,"aria-label":c.colorPickerSave},k.createElement(Xpe,{stroke:1.5,size:"1rem"}))))))});wF.displayName="@mantine/tiptap/ColorPickerControl";var TOe=Object.defineProperty,IOe=Object.defineProperties,DOe=Object.getOwnPropertyDescriptors,dy=Object.getOwnPropertySymbols,bF=Object.prototype.hasOwnProperty,xF=Object.prototype.propertyIsEnumerable,uD=(e,t,n)=>t in e?TOe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,jOe=(e,t)=>{for(var n in t||(t={}))bF.call(t,n)&&uD(e,n,t[n]);if(dy)for(var n of dy(t))xF.call(t,n)&&uD(e,n,t[n]);return e},LOe=(e,t)=>IOe(e,DOe(t)),ROe=(e,t)=>{var n={};for(var r in e)bF.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&dy)for(var r of dy(e))t.indexOf(r)<0&&xF.call(e,r)&&(n[r]=e[r]);return n};const zOe={},AOe=_.forwardRef((e,t)=>{const n=ae("RichTextEditorColorControl",zOe,e),{color:r}=n,o=ROe(n,["color"]),{editor:i,labels:s,unstyled:a}=za(),c=i?.getAttributes("textStyle").color||null,u=s.colorControlLabel(r);return k.createElement(ah,LOe(jOe({active:c===r,"aria-label":u,title:u,onClick:()=>i.chain().focus().setColor(r).run()},o),{ref:t}),k.createElement(_f,{color:r,size:14,unstyled:a}))});var BOe=Object.defineProperty,FOe=Object.defineProperties,VOe=Object.getOwnPropertyDescriptors,fy=Object.getOwnPropertySymbols,SF=Object.prototype.hasOwnProperty,PF=Object.prototype.propertyIsEnumerable,dD=(e,t,n)=>t in e?BOe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$w=(e,t)=>{for(var n in t||(t={}))SF.call(t,n)&&dD(e,n,t[n]);if(fy)for(var n of fy(t))PF.call(t,n)&&dD(e,n,t[n]);return e},HOe=(e,t)=>FOe(e,VOe(t)),WOe=(e,t)=>{var n={};for(var r in e)SF.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&fy)for(var r of fy(e))t.indexOf(r)<0&&PF.call(e,r)&&(n[r]=e[r]);return n};const UOe={withCodeHighlightStyles:!0,withTypographyStyles:!0},Ee=_.forwardRef((e,t)=>{const n=ae("RichTextEditor",UOe,e),{editor:r,children:o,className:i,labels:s,withCodeHighlightStyles:a,withTypographyStyles:c,classNames:u,styles:f,unstyled:h,variant:m}=n,v=WOe(n,["editor","children","className","labels","withCodeHighlightStyles","withTypographyStyles","classNames","styles","unstyled","variant"]),{classes:y,cx:w}=EPe(null,{name:"RichTextEditor",classNames:u,styles:f,unstyled:h,variant:m}),P=_.useMemo(()=>$w($w({},CPe),s),[s]);return k.createElement(Z1e,{value:{editor:r,labels:P,withCodeHighlightStyles:a,withTypographyStyles:c,classNames:u,styles:f,unstyled:h,variant:m}},k.createElement(Pe,HOe($w({className:w(y.root,i)},v),{ref:t}),o))});Ee.Content=oF;Ee.Control=ah;Ee.ControlsGroup=cF;Ee.Toolbar=fF;Ee.Bold=FPe;Ee.Italic=VPe;Ee.Strikethrough=WPe;Ee.Underline=HPe;Ee.ClearFormatting=UPe;Ee.H1=KPe;Ee.H2=qPe;Ee.H3=JPe;Ee.H4=QPe;Ee.H5=XPe;Ee.H6=eOe;Ee.BulletList=GPe;Ee.OrderedList=YPe;Ee.Link=OOe;Ee.Unlink=ZPe;Ee.Blockquote=tOe;Ee.AlignLeft=nOe;Ee.AlignRight=rOe;Ee.AlignCenter=oOe;Ee.AlignJustify=iOe;Ee.Superscript=aOe;Ee.Subscript=sOe;Ee.Code=lOe;Ee.CodeBlock=cOe;Ee.ColorPicker=wF;Ee.Color=AOe;Ee.Highlight=uOe;Ee.Hr=dOe;Ee.UnsetColor=fOe;Ee.displayName="@mantine/tiptap/RichTextEditor";const ZOe="aaa1rp3barth4b0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0faromeo7ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re2s2c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y0eats7k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking0channel11l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t0isalat7u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0at2delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d0network8tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntdoor4ier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5gtv3iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0eles2s3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1nder2le4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster5ia3d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4de2k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0cys3drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7serati6ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic3tual5v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rthwesternmutual14on4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3ssagens7y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cher3ks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w0time7i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ffany5ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0channel7ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lkswagen7vo3te1ing3o2yage5u0elos6wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",GOe="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5تصالات6رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Su=(e,t)=>{for(const n in t)e[n]=t[n];return e},Wx="numeric",Ux="ascii",Zx="alpha",lm="asciinumeric",yp="alphanumeric",Gx="domain",OF="emoji",YOe="scheme",KOe="slashscheme",fD="whitespace";function qOe(e,t){return e in t||(t[e]=[]),t[e]}function yl(e,t,n){t[Wx]&&(t[lm]=!0,t[yp]=!0),t[Ux]&&(t[lm]=!0,t[Zx]=!0),t[lm]&&(t[yp]=!0),t[Zx]&&(t[yp]=!0),t[yp]&&(t[Gx]=!0),t[OF]&&(t[Gx]=!0);for(const r in t){const o=qOe(r,n);o.indexOf(e)<0&&o.push(e)}}function JOe(e,t){const n={};for(const r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function zr(e){e===void 0&&(e=null),this.j={},this.jr=[],this.jd=null,this.t=e}zr.groups={};zr.prototype={accepts(){return!!this.t},go(e){const t=this,n=t.j[e];if(n)return n;for(let r=0;re.ta(t,n,r,o),Mo=(e,t,n,r,o)=>e.tr(t,n,r,o),hD=(e,t,n,r,o)=>e.ts(t,n,r,o),de=(e,t,n,r,o)=>e.tt(t,n,r,o),ts="WORD",Yx="UWORD",Mf="LOCALHOST",Kx="TLD",qx="UTLD",cm="SCHEME",wc="SLASH_SCHEME",RO="NUM",CF="WS",zO="NL",Lc="OPENBRACE",Ud="OPENBRACKET",Zd="OPENANGLEBRACKET",Gd="OPENPAREN",al="CLOSEBRACE",Rc="CLOSEBRACKET",zc="CLOSEANGLEBRACKET",ll="CLOSEPAREN",hy="AMPERSAND",py="APOSTROPHE",my="ASTERISK",Ys="AT",gy="BACKSLASH",vy="BACKTICK",yy="CARET",Xs="COLON",AO="COMMA",_y="DOLLAR",wi="DOT",wy="EQUALS",BO="EXCLAMATION",bi="HYPHEN",by="PERCENT",xy="PIPE",Sy="PLUS",Py="POUND",Oy="QUERY",FO="QUOTE",VO="SEMI",xi="SLASH",Yd="TILDE",Cy="UNDERSCORE",kF="EMOJI",ky="SYM";var EF=Object.freeze({__proto__:null,WORD:ts,UWORD:Yx,LOCALHOST:Mf,TLD:Kx,UTLD:qx,SCHEME:cm,SLASH_SCHEME:wc,NUM:RO,WS:CF,NL:zO,OPENBRACE:Lc,OPENBRACKET:Ud,OPENANGLEBRACKET:Zd,OPENPAREN:Gd,CLOSEBRACE:al,CLOSEBRACKET:Rc,CLOSEANGLEBRACKET:zc,CLOSEPAREN:ll,AMPERSAND:hy,APOSTROPHE:py,ASTERISK:my,AT:Ys,BACKSLASH:gy,BACKTICK:vy,CARET:yy,COLON:Xs,COMMA:AO,DOLLAR:_y,DOT:wi,EQUALS:wy,EXCLAMATION:BO,HYPHEN:bi,PERCENT:by,PIPE:xy,PLUS:Sy,POUND:Py,QUERY:Oy,QUOTE:FO,SEMI:VO,SLASH:xi,TILDE:Yd,UNDERSCORE:Cy,EMOJI:kF,SYM:ky});const gc=/[a-z]/,Mw=/\p{L}/u,Nw=/\p{Emoji}/u,Tw=/\d/,pD=/\s/,mD=` -`,QOe="️",XOe="‍";let _p=null,wp=null;function eCe(e){e===void 0&&(e=[]);const t={};zr.groups=t;const n=new zr;_p==null&&(_p=gD(ZOe)),wp==null&&(wp=gD(GOe)),de(n,"'",py),de(n,"{",Lc),de(n,"[",Ud),de(n,"<",Zd),de(n,"(",Gd),de(n,"}",al),de(n,"]",Rc),de(n,">",zc),de(n,")",ll),de(n,"&",hy),de(n,"*",my),de(n,"@",Ys),de(n,"`",vy),de(n,"^",yy),de(n,":",Xs),de(n,",",AO),de(n,"$",_y),de(n,".",wi),de(n,"=",wy),de(n,"!",BO),de(n,"-",bi),de(n,"%",by),de(n,"|",xy),de(n,"+",Sy),de(n,"#",Py),de(n,"?",Oy),de(n,'"',FO),de(n,"/",xi),de(n,";",VO),de(n,"~",Yd),de(n,"_",Cy),de(n,"\\",gy);const r=Mo(n,Tw,RO,{[Wx]:!0});Mo(r,Tw,r);const o=Mo(n,gc,ts,{[Ux]:!0});Mo(o,gc,o);const i=Mo(n,Mw,Yx,{[Zx]:!0});Mo(i,gc),Mo(i,Mw,i);const s=Mo(n,pD,CF,{[fD]:!0});de(n,mD,zO,{[fD]:!0}),de(s,mD),Mo(s,pD,s);const a=Mo(n,Nw,kF,{[OF]:!0});Mo(a,Nw,a),de(a,QOe,a);const c=de(a,XOe);Mo(c,Nw,a);const u=[[gc,o]],f=[[gc,null],[Mw,i]];for(let h=0;h<_p.length;h++)zs(n,_p[h],Kx,ts,u);for(let h=0;hh[0]>m[0]?1:-1);for(let h=0;h=0?y[Gx]=!0:gc.test(m)?Tw.test(m)?y[lm]=!0:y[Ux]=!0:y[Wx]=!0,hD(n,m,m,y)}return hD(n,"localhost",Mf,{ascii:!0}),n.jd=new zr(ky),{start:n,tokens:Su({groups:t},EF)}}function tCe(e,t){const n=nCe(t.replace(/[A-Z]/g,a=>a.toLowerCase())),r=n.length,o=[];let i=0,s=0;for(;s=0&&(h+=n[s].length,m++),u+=n[s].length,i+=n[s].length,s++;i-=h,s-=m,u-=h,o.push({t:f.t,v:t.slice(i-u,i),s:i-u,e:i})}return o}function nCe(e){const t=[],n=e.length;let r=0;for(;r56319||r+1===n||(i=e.charCodeAt(r+1))<56320||i>57343?e[r]:e.slice(r,r+2);t.push(s),r+=s.length}return t}function zs(e,t,n,r,o){let i;const s=t.length;for(let a=0;a=0;)i++;if(i>0){t.push(n.join(""));for(let s=parseInt(e.substring(r,r+i),10);s>0;s--)n.pop();r+=i}else n.push(e[r]),r++}return t}const Nf={defaultProtocol:"http",events:null,format:vD,formatHref:vD,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function HO(e,t){t===void 0&&(t=null);let n=Su({},Nf);e&&(n=Su(n,e instanceof HO?e.o:e));const r=n.ignoreTags,o=[];for(let i=0;in?r.substring(0,n)+"…":r},toFormattedHref(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e){return e===void 0&&(e=Nf.defaultProtocol),{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get("validate",this.toString(),this)},render(e){const t=this,n=this.toHref(e.get("defaultProtocol")),r=e.get("formatHref",n,this),o=e.get("tagName",n,t),i=this.toFormattedString(e),s={},a=e.get("className",n,t),c=e.get("target",n,t),u=e.get("rel",n,t),f=e.getObj("attributes",n,t),h=e.getObj("events",n,t);return s.href=r,a&&(s.class=a),c&&(s.target=c),u&&(s.rel=u),f&&Su(s,f),{tagName:o,attributes:s,content:i,eventListeners:h}}};function p1(e,t){class n extends $F{constructor(o,i){super(o,i),this.t=e}}for(const r in t)n.prototype[r]=t[r];return n.t=e,n}const yD=p1("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),_D=p1("text"),rCe=p1("nl"),Xa=p1("url",{isLink:!0,toHref(e){return e===void 0&&(e=Nf.defaultProtocol),this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){const e=this.tk;return e.length>=2&&e[0].t!==Mf&&e[1].t===Xs}}),On=e=>new zr(e);function oCe(e){let{groups:t}=e;const n=t.domain.concat([hy,my,Ys,gy,vy,yy,_y,wy,bi,RO,by,xy,Sy,Py,xi,ky,Yd,Cy]),r=[py,zc,al,Rc,ll,Xs,AO,wi,BO,Zd,Lc,Ud,Gd,Oy,FO,VO],o=[hy,py,my,gy,vy,yy,al,_y,wy,bi,Lc,by,xy,Sy,Py,Oy,xi,ky,Yd,Cy],i=On(),s=de(i,Yd);Me(s,o,s),Me(s,t.domain,s);const a=On(),c=On(),u=On();Me(i,t.domain,a),Me(i,t.scheme,c),Me(i,t.slashscheme,u),Me(a,o,s),Me(a,t.domain,a);const f=de(a,Ys);de(s,Ys,f),de(c,Ys,f),de(u,Ys,f);const h=de(s,wi);Me(h,o,s),Me(h,t.domain,s);const m=On();Me(f,t.domain,m),Me(m,t.domain,m);const v=de(m,wi);Me(v,t.domain,m);const y=On(yD);Me(v,t.tld,y),Me(v,t.utld,y),de(f,Mf,y);const w=de(m,bi);Me(w,t.domain,m),Me(y,t.domain,m),de(y,wi,v),de(y,bi,w);const P=de(y,Xs);Me(P,t.numeric,yD);const b=de(a,bi),S=de(a,wi);Me(b,t.domain,a),Me(S,o,s),Me(S,t.domain,a);const O=On(Xa);Me(S,t.tld,O),Me(S,t.utld,O),Me(O,t.domain,a),Me(O,o,s),de(O,wi,S),de(O,bi,b),de(O,Ys,f);const E=de(O,Xs),$=On(Xa);Me(E,t.numeric,$);const N=On(Xa),I=On();Me(N,n,N),Me(N,r,I),Me(I,n,N),Me(I,r,I),de(O,xi,N),de($,xi,N);const R=de(c,Xs),B=de(u,Xs),z=de(B,xi),G=de(z,xi);Me(c,t.domain,a),de(c,wi,S),de(c,bi,b),Me(u,t.domain,a),de(u,wi,S),de(u,bi,b),Me(R,t.domain,N),de(R,xi,N),Me(G,t.domain,N),Me(G,n,N),de(G,xi,N);const Q=de(N,Lc),X=de(N,Ud),V=de(N,Zd),H=de(N,Gd);de(I,Lc,Q),de(I,Ud,X),de(I,Zd,V),de(I,Gd,H),de(Q,al,N),de(X,Rc,N),de(V,zc,N),de(H,ll,N),de(Q,al,N);const Z=On(Xa),Y=On(Xa),D=On(Xa),W=On(Xa);Me(Q,n,Z),Me(X,n,Y),Me(V,n,D),Me(H,n,W);const F=On(),K=On(),ee=On(),fe=On();return Me(Q,r),Me(X,r),Me(V,r),Me(H,r),Me(Z,n,Z),Me(Y,n,Y),Me(D,n,D),Me(W,n,W),Me(Z,r,Z),Me(Y,r,Y),Me(D,r,D),Me(W,r,W),Me(F,n,F),Me(K,n,Y),Me(ee,n,D),Me(fe,n,W),Me(F,r,F),Me(K,r,K),Me(ee,r,ee),Me(fe,r,fe),de(Y,Rc,N),de(D,zc,N),de(W,ll,N),de(Z,al,N),de(K,Rc,N),de(ee,zc,N),de(fe,ll,N),de(F,ll,N),de(i,Mf,O),de(i,zO,rCe),{start:i,tokens:EF}}function iCe(e,t,n){let r=n.length,o=0,i=[],s=[];for(;o=0&&m++,o++,f++;if(m<0)o-=f,o0&&(i.push(Iw(_D,t,s)),s=[]),o-=m,f-=m;const v=h.t,y=n.slice(o-f,o);i.push(Iw(v,t,y))}}return s.length>0&&i.push(Iw(_D,t,s)),i}function Iw(e,t,n){const r=n[0].s,o=n[n.length-1].e,i=t.slice(r,o);return new e(i,n)}const sCe=typeof console<"u"&&console&&console.warn||(()=>{}),aCe="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Vt={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function lCe(){zr.groups={},Vt.scanner=null,Vt.parser=null,Vt.tokenQueue=[],Vt.pluginQueue=[],Vt.customSchemes=[],Vt.initialized=!1}function wD(e,t){if(t===void 0&&(t=!1),Vt.initialized&&sCe(`linkifyjs: already initialized - will not register custom scheme "${e}" ${aCe}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw new Error(`linkifyjs: incorrect scheme format. +`,textSerializers:r={}}=t||{};return rSe(this.state.doc,{blockSeparator:n,textSerializers:{...KB(this.schema),...r}})}get isEmpty(){return cSe(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var t;return!(!((t=this.view)===null||t===void 0)&&t.docView)}};function Al(e){return new d1({find:e.find,handler:({state:t,range:n,match:r})=>{const o=Ue(e.getAttributes,void 0,r);if(o===!1||o===null)return null;const{tr:i}=t,s=r[r.length-1],a=r[0];if(s){const c=a.search(/\S/),u=n.from+a.indexOf(s),f=u+s.length;if(DO(n.from,n.to,t.doc).filter(v=>v.mark.type.excluded.find(w=>w===e.type&&w!==v.mark.type)).filter(v=>v.to>u).length)return null;fn.from&&i.delete(n.from+c,u);const m=n.from+c+s.length;i.addMark(n.from+c,m,e.type.create(o||{})),i.removeStoredMark(e.type)}}})}function eF(e){return new d1({find:e.find,handler:({state:t,range:n,match:r})=>{const o=Ue(e.getAttributes,void 0,r)||{},{tr:i}=t,s=n.from;let a=n.to;const c=e.type.create(o);if(r[1]){const u=r[0].lastIndexOf(r[1]);let f=s+u;f>a?f=a:a=f+r[1].length;const h=r[0][r[0].length-1];i.insertText(h,s+r[0].length-1),i.replaceWith(f,a,c)}else r[0]&&i.insert(s-1,e.type.create(o)).delete(i.mapping.map(s),i.mapping.map(a));i.scrollIntoView()}})}function Fx(e){return new d1({find:e.find,handler:({state:t,range:n,match:r})=>{const o=t.doc.resolve(n.from),i=Ue(e.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,i)}})}function $f(e){return new d1({find:e.find,handler:({state:t,range:n,match:r,chain:o})=>{const i=Ue(e.getAttributes,void 0,r)||{},s=t.tr.delete(n.from,n.to),c=s.doc.resolve(n.from).blockRange(),u=c&&yO(c,e.type,i);if(!u)return null;if(s.wrap(c,u),e.keepMarks&&e.editor){const{selection:h,storedMarks:m}=t,{splittableMarks:v}=e.editor.extensionManager,y=m||h.$to.parentOffset&&h.$from.marks();if(y){const w=y.filter(P=>v.includes(P.type.name));s.ensureMarks(w)}}if(e.keepAttributes){const h=e.type.name==="bulletList"||e.type.name==="orderedList"?"listItem":"taskList";o().updateAttributes(h,i).run()}const f=s.doc.resolve(n.from-1).nodeBefore;f&&f.type===e.type&&Aa(s.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,f))&&s.join(n.from-1)}})}class sr{constructor(t={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Ue(Ce(this,"addOptions",{name:this.name}))),this.storage=Ue(Ce(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new sr(t)}configure(t={}){const n=this.extend();return n.options=f1(this.options,t),n.storage=Ue(Ce(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){const n=new sr(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Ue(Ce(n,"addOptions",{name:n.name})),n.storage=Ue(Ce(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:t,mark:n}){const{tr:r}=t.state,o=t.state.selection.$from;if(o.pos===o.end()){const s=o.marks();if(!!!s.find(u=>u?.type.name===n.name))return!1;const c=s.find(u=>u?.type.name===n.name);return c&&r.removeStoredMark(c),r.insertText(" ",o.pos),t.view.dispatch(r),!0}return!1}}let qr=class Vx{constructor(t={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Ue(Ce(this,"addOptions",{name:this.name}))),this.storage=Ue(Ce(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new Vx(t)}configure(t={}){const n=this.extend();return n.options=f1(this.options,t),n.storage=Ue(Ce(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){const n=new Vx(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Ue(Ce(n,"addOptions",{name:n.name})),n.storage=Ue(Ce(n,"addStorage",{name:n.name,options:n.options})),n}};function Na(e){return new rxe({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:o})=>{const i=Ue(e.getAttributes,void 0,r,o);if(i===!1||i===null)return null;const{tr:s}=t,a=r[r.length-1],c=r[0];let u=n.to;if(a){const f=c.search(/\S/),h=n.from+c.indexOf(a),m=h+a.length;if(DO(n.from,n.to,t.doc).filter(y=>y.mark.type.excluded.find(P=>P===e.type&&P!==y.mark.type)).filter(y=>y.to>h).length)return null;mn.from&&s.delete(n.from+f,h),u=n.from+f+a.length,s.addMark(n.from+f,u,e.type.create(i||{})),s.removeStoredMark(e.type)}}})}const ASe=({renderers:e})=>k.createElement(k.Fragment,null,Object.entries(e).map(([t,n])=>iJ.createPortal(n.reactElement,n.element,t)));class BSe extends k.Component{constructor(t){super(t),this.editorContentRef=k.createRef(),this.initialized=!1,this.state={renderers:{}}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const{editor:t}=this.props;if(t&&t.options.element){if(t.contentComponent)return;const n=this.editorContentRef.current;n.append(...t.options.element.childNodes),t.setOptions({element:n}),t.contentComponent=this,t.createNodeViews(),this.initialized=!0}}maybeFlushSync(t){this.initialized?Cs.flushSync(t):t()}setRenderer(t,n){this.maybeFlushSync(()=>{this.setState(({renderers:r})=>({renderers:{...r,[t]:n}}))})}removeRenderer(t){this.maybeFlushSync(()=>{this.setState(({renderers:n})=>{const r={...n};return delete r[t],{renderers:r}})})}componentWillUnmount(){const{editor:t}=this.props;if(!t||(this.initialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),t.contentComponent=null,!t.options.element.firstChild))return;const n=document.createElement("div");n.append(...t.options.element.childNodes),t.setOptions({element:n})}render(){const{editor:t,...n}=this.props;return k.createElement(k.Fragment,null,k.createElement("div",{ref:this.editorContentRef,...n}),k.createElement(ASe,{renderers:this.state.renderers}))}}const FSe=e=>{const t=k.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return k.createElement(BSe,{key:t,...e})},VSe=k.memo(FSe);class HSe extends zSe{constructor(){super(...arguments),this.contentComponent=null}}function WSe(){const[,e]=_.useState(0);return()=>e(t=>t+1)}const tF=(e={},t=[])=>{const[n,r]=_.useState(null),o=WSe(),{onBeforeCreate:i,onBlur:s,onCreate:a,onDestroy:c,onFocus:u,onSelectionUpdate:f,onTransaction:h,onUpdate:m}=e,v=_.useRef(i),y=_.useRef(s),w=_.useRef(a),P=_.useRef(c),b=_.useRef(u),S=_.useRef(f),O=_.useRef(h),E=_.useRef(m);return _.useEffect(()=>{n&&(i&&(n.off("beforeCreate",v.current),n.on("beforeCreate",i),v.current=i),s&&(n.off("blur",y.current),n.on("blur",s),y.current=s),a&&(n.off("create",w.current),n.on("create",a),w.current=a),c&&(n.off("destroy",P.current),n.on("destroy",c),P.current=c),u&&(n.off("focus",b.current),n.on("focus",u),b.current=u),f&&(n.off("selectionUpdate",S.current),n.on("selectionUpdate",f),S.current=f),h&&(n.off("transaction",O.current),n.on("transaction",h),O.current=h),m&&(n.off("update",E.current),n.on("update",m),E.current=m))},[i,s,a,c,u,f,h,m,n]),_.useEffect(()=>{let $=!0;const N=new HSe(e);return r(N),N.on("transaction",()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{$&&o()})})}),()=>{$=!1}},t),_.useEffect(()=>()=>{n?.destroy()},[n]),n},USe=_.createContext({editor:null});USe.Consumer;const ZSe=_.createContext({onDragStart:void 0}),GSe=()=>_.useContext(ZSe);k.forwardRef((e,t)=>{const{onDragStart:n}=GSe(),r=e.as||"div";return k.createElement(r,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})});var YSe=Object.defineProperty,ZI=Object.getOwnPropertySymbols,KSe=Object.prototype.hasOwnProperty,qSe=Object.prototype.propertyIsEnumerable,GI=(e,t,n)=>t in e?YSe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,kw=(e,t)=>{for(var n in t||(t={}))KSe.call(t,n)&&GI(e,n,t[n]);if(ZI)for(var n of ZI(t))qSe.call(t,n)&&GI(e,n,t[n]);return e};function JSe(e,t){if(!e)return null;const n=t.colorScheme==="dark"?5:7;return{pre:{background:t.colorScheme==="dark"?t.colors.dark[8]:t.fn.rgba(t.colors.gray[0],.65),borderRadius:t.fn.radius(),color:t.colorScheme==="dark"?t.colors.dark[0]:t.colors.gray[9],fontFamily:t.fontFamilyMonospace,padding:`${t.spacing.md} ${t.spacing.xl}`,"& code":{background:"none",color:"inherit",fontSize:t.fontSizes.sm,padding:0}," & .hljs-comment, & .hljs-quote":{color:t.colorScheme==="dark"?t.colors.dark[2]:t.colors.gray[5]},"& .hljs-variable, & .hljs-template-variable, & .hljs-attribute, & .hljs-tag, & .hljs-name, & .hljs-regexp, & .hljs-link, & .hljs-name, & .hljs-selector-id, & .hljs-selector-class":{color:t.colors.red[n]},"& .hljs-number, & .hljs-meta, & .hljs-built_in, & .hljs-builtin-name, & .hljs-literal, & .hljs-type, & .hljs-params":{color:t.colors[t.colorScheme==="dark"?"cyan":"blue"][n]},"& .hljs-string, & .hljs-symbol, & .hljs-bullet":{color:t.colors.red[n]},"& .hljs-title, & .hljs-section":{color:t.colors[t.colorScheme==="dark"?"yellow":"pink"][n]},"& .hljs-keyword, & .hljs-selector-tag":{color:t.colors.violet[n]},"& .hljs-emphasis":{fontStyle:"italic"},"& .hljs-strong":{fontWeight:700}}}}function QSe(e){return e?{"& li > p":{margin:0},"& ul li, & ol li":{marginTop:M(2)},"& ul, & ol":{marginTop:M(5),marginBottom:M(5)},"& p":{marginBottom:M(7)},"& h1, & h2, & h3, & h4, & h5, & h6, & p":{marginTop:0}}:null}var XSe=ue((e,{withCodeHighlightStyles:t,withTypographyStyles:n})=>({typographyStylesProvider:kw({},QSe(n)),content:kw({backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white,borderRadius:e.fn.radius(),"& .ProseMirror":{outline:0,padding:e.spacing.md},"& .ProseMirror > *:last-child":{marginBottom:0},"& .ProseMirror p.is-editor-empty:first-of-type::before":kw({content:"attr(data-placeholder)",pointerEvents:"none",userSelect:"none",float:"left",height:0},e.fn.placeholderStyles())},JSe(t,e))}));const ePe=XSe;var tPe=Object.defineProperty,oy=Object.getOwnPropertySymbols,nF=Object.prototype.hasOwnProperty,rF=Object.prototype.propertyIsEnumerable,YI=(e,t,n)=>t in e?tPe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nPe=(e,t)=>{for(var n in t||(t={}))nF.call(t,n)&&YI(e,n,t[n]);if(oy)for(var n of oy(t))rF.call(t,n)&&YI(e,n,t[n]);return e},rPe=(e,t)=>{var n={};for(var r in e)nF.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&oy)for(var r of oy(e))t.indexOf(r)<0&&rF.call(e,r)&&(n[r]=e[r]);return n};const oPe={},oF=_.forwardRef((e,t)=>{const n=ae("RichTextEditorContent",oPe,e),{className:r}=n,o=rPe(n,["className"]),{editor:i,withCodeHighlightStyles:s,withTypographyStyles:a,classNames:c,styles:u,unstyled:f,variant:h}=za(),{classes:m,cx:v}=ePe({withCodeHighlightStyles:s,withTypographyStyles:a},{name:"RichTextEditor",classNames:c,styles:u,unstyled:f,variant:h});return k.createElement(A8,{className:v(m.typographyStylesProvider,r),unstyled:!a||f,ref:t},k.createElement(Pe,nPe({component:VSe,editor:i,className:m.content},o)))});oF.displayName="@mantine/tiptap/Content";var iPe=Object.defineProperty,KI=Object.getOwnPropertySymbols,sPe=Object.prototype.hasOwnProperty,aPe=Object.prototype.propertyIsEnumerable,qI=(e,t,n)=>t in e?iPe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,JI=(e,t)=>{for(var n in t||(t={}))sPe.call(t,n)&&qI(e,n,t[n]);if(KI)for(var n of KI(t))aPe.call(t,n)&&qI(e,n,t[n]);return e},lPe=ue(e=>{const t=e.fn.variant({variant:"light"});return{control:{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white,minWidth:M(26),height:M(26),display:"flex",justifyContent:"center",alignItems:"center",border:`${M(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`,borderRadius:e.fn.radius(),cursor:"default","&[data-interactive]":JI({cursor:"pointer"},e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[0]})),"&[data-active]":{backgroundColor:t.background,color:t.color,"&:hover":JI({},e.fn.hover({backgroundColor:t.hover}))}}}});const cPe=lPe;var uPe=Object.defineProperty,iy=Object.getOwnPropertySymbols,iF=Object.prototype.hasOwnProperty,sF=Object.prototype.propertyIsEnumerable,QI=(e,t,n)=>t in e?uPe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dPe=(e,t)=>{for(var n in t||(t={}))iF.call(t,n)&&QI(e,n,t[n]);if(iy)for(var n of iy(t))sF.call(t,n)&&QI(e,n,t[n]);return e},fPe=(e,t)=>{var n={};for(var r in e)iF.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&iy)for(var r of iy(e))t.indexOf(r)<0&&sF.call(e,r)&&(n[r]=e[r]);return n};const hPe={interactive:!0},ah=_.forwardRef((e,t)=>{const n=ae("RichTextEditorControl",hPe,e),{className:r,active:o,children:i,interactive:s}=n,a=fPe(n,["className","active","children","interactive"]),{classNames:c,styles:u,unstyled:f,variant:h}=za(),{classes:m,cx:v}=cPe(null,{name:"RichTextEditor",classNames:c,styles:u,unstyled:f,variant:h});return k.createElement(ds,dPe({className:v(m.control,r),"data-rich-text-editor-control":!0,tabIndex:s?0:-1,"data-interactive":s||void 0,"data-active":o||void 0,"aria-pressed":o&&s||void 0,"aria-hidden":!s||void 0,ref:t,unstyled:f},a),i)});ah.displayName="@mantine/tiptap/Control";var pPe=ue(e=>({controlsGroup:{display:"flex","& [data-rich-text-editor-control]":{borderRadius:0,"&:not(:last-of-type)":{borderRight:0},"&:last-of-type":{borderTopRightRadius:e.fn.radius(),borderBottomRightRadius:e.fn.radius()},"&:first-of-type":{borderTopLeftRadius:e.fn.radius(),borderBottomLeftRadius:e.fn.radius()}}}}));const mPe=pPe;var gPe=Object.defineProperty,sy=Object.getOwnPropertySymbols,aF=Object.prototype.hasOwnProperty,lF=Object.prototype.propertyIsEnumerable,XI=(e,t,n)=>t in e?gPe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vPe=(e,t)=>{for(var n in t||(t={}))aF.call(t,n)&&XI(e,n,t[n]);if(sy)for(var n of sy(t))lF.call(t,n)&&XI(e,n,t[n]);return e},yPe=(e,t)=>{var n={};for(var r in e)aF.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&sy)for(var r of sy(e))t.indexOf(r)<0&&lF.call(e,r)&&(n[r]=e[r]);return n};const _Pe={},cF=_.forwardRef((e,t)=>{const n=ae("RichTextEditorControlsGroup",_Pe,e),{className:r,children:o}=n,i=yPe(n,["className","children"]),{classNames:s,styles:a,unstyled:c}=za(),{classes:u,cx:f}=mPe(null,{name:"RichTextEditor",classNames:s,styles:a,unstyled:c});return k.createElement(Pe,vPe({className:f(u.controlsGroup,r),ref:t},i),o)});cF.displayName="@mantine/tiptap/ControlsGroup";var wPe=ue((e,{sticky:t,stickyOffset:n})=>({toolbar:{position:t?"sticky":"static",top:t?M(n):void 0,padding:`${e.spacing.xs} ${e.spacing.md}`,backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white,zIndex:1,borderTopRightRadius:e.fn.radius(),borderTopLeftRadius:e.fn.radius(),borderBottom:`${M(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`}}));const bPe=wPe;var xPe=Object.defineProperty,ay=Object.getOwnPropertySymbols,uF=Object.prototype.hasOwnProperty,dF=Object.prototype.propertyIsEnumerable,ej=(e,t,n)=>t in e?xPe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,SPe=(e,t)=>{for(var n in t||(t={}))uF.call(t,n)&&ej(e,n,t[n]);if(ay)for(var n of ay(t))dF.call(t,n)&&ej(e,n,t[n]);return e},PPe=(e,t)=>{var n={};for(var r in e)uF.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ay)for(var r of ay(e))t.indexOf(r)<0&&dF.call(e,r)&&(n[r]=e[r]);return n};const OPe={stickyOffset:0},fF=_.forwardRef((e,t)=>{const n=ae("RichTextEditorToolbar",OPe,e),{className:r,children:o,sticky:i,stickyOffset:s}=n,a=PPe(n,["className","children","sticky","stickyOffset"]),c=za(),{classes:u,cx:f}=bPe({sticky:i,stickyOffset:s},{name:"RichTextEditor",classNames:c.classNames,styles:c.styles,unstyled:c.unstyled,variant:c.variant});return k.createElement(nt,SPe({className:f(u.toolbar,r),ref:t},a),o)});fF.displayName="@mantine/tiptap/Toolbar";const CPe={linkControlLabel:"Link",colorPickerControlLabel:"Text color",highlightControlLabel:"Highlight text",colorControlLabel:e=>`Set text color ${e}`,boldControlLabel:"Bold",italicControlLabel:"Italic",underlineControlLabel:"Underline",strikeControlLabel:"Strikethrough",clearFormattingControlLabel:"Clear formatting",unlinkControlLabel:"Remove link",bulletListControlLabel:"Bullet list",orderedListControlLabel:"Ordered list",h1ControlLabel:"Heading 1",h2ControlLabel:"Heading 2",h3ControlLabel:"Heading 3",h4ControlLabel:"Heading 4",h5ControlLabel:"Heading 5",h6ControlLabel:"Heading 6",blockquoteControlLabel:"Blockquote",alignLeftControlLabel:"Align text: left",alignCenterControlLabel:"Align text: center",alignRightControlLabel:"Align text: right",alignJustifyControlLabel:"Align text: justify",codeControlLabel:"Code",codeBlockControlLabel:"Code block",subscriptControlLabel:"Subscript",superscriptControlLabel:"Superscript",unsetColorControlLabel:"Unset color",hrControlLabel:"Horizontal line",linkEditorInputLabel:"Enter URL",linkEditorInputPlaceholder:"https://example.com/",linkEditorExternalLink:"Open link in a new tab",linkEditorInternalLink:"Open link in the same tab",linkEditorSave:"Save",colorPickerCancel:"Cancel",colorPickerClear:"Clear color",colorPickerColorPicker:"Color picker",colorPickerPalette:"Color palette",colorPickerSave:"Save",colorPickerColorLabel:e=>`Set text color ${e}`};var kPe=ue(e=>({root:{position:"relative",border:`${M(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`,borderRadius:e.fn.radius()}}));const EPe=kPe;var $Pe=Object.defineProperty,ly=Object.getOwnPropertySymbols,hF=Object.prototype.hasOwnProperty,pF=Object.prototype.propertyIsEnumerable,tj=(e,t,n)=>t in e?$Pe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,MPe=(e,t)=>{for(var n in t||(t={}))hF.call(t,n)&&tj(e,n,t[n]);if(ly)for(var n of ly(t))pF.call(t,n)&&tj(e,n,t[n]);return e},NPe=(e,t)=>{var n={};for(var r in e)hF.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ly)for(var r of ly(e))t.indexOf(r)<0&&pF.call(e,r)&&(n[r]=e[r]);return n};const RO=_.forwardRef((e,t)=>{var n=e,{className:r,active:o,icon:i}=n,s=NPe(n,["className","active","icon"]);return k.createElement(ah,MPe({active:o,ref:t},s),k.createElement(i,{size:"1rem"}))});RO.displayName="@mantine/tiptap/ControlBase";var TPe=Object.defineProperty,nj=Object.getOwnPropertySymbols,IPe=Object.prototype.hasOwnProperty,jPe=Object.prototype.propertyIsEnumerable,rj=(e,t,n)=>t in e?TPe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,DPe=(e,t)=>{for(var n in t||(t={}))IPe.call(t,n)&&rj(e,n,t[n]);if(nj)for(var n of nj(t))jPe.call(t,n)&&rj(e,n,t[n]);return e};function Et({label:e,isActive:t,operation:n,icon:r}){return _.forwardRef((o,i)=>{const{editor:s,labels:a}=za(),c=a[e];return k.createElement(RO,DPe({"aria-label":c,title:c,active:t?.name?s?.isActive(t.name,t.attributes):!1,ref:i,onClick:()=>s?.chain().focus()[n.name](n.attributes).run(),icon:r},o))})}var RPe=Object.defineProperty,LPe=Object.defineProperties,zPe=Object.getOwnPropertyDescriptors,oj=Object.getOwnPropertySymbols,APe=Object.prototype.hasOwnProperty,BPe=Object.prototype.propertyIsEnumerable,ij=(e,t,n)=>t in e?RPe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$t=(e,t)=>{for(var n in t||(t={}))APe.call(t,n)&&ij(e,n,t[n]);if(oj)for(var n of oj(t))BPe.call(t,n)&&ij(e,n,t[n]);return e},Mt=(e,t)=>LPe(e,zPe(t));const FPe=Et({label:"boldControlLabel",icon:e=>k.createElement(Jpe,Mt($t({},e),{stroke:1.5})),isActive:{name:"bold"},operation:{name:"toggleBold"}}),VPe=Et({label:"italicControlLabel",icon:e=>k.createElement(gme,Mt($t({},e),{stroke:1.5})),isActive:{name:"italic"},operation:{name:"toggleItalic"}}),HPe=Et({label:"underlineControlLabel",icon:e=>k.createElement(Rme,Mt($t({},e),{stroke:1.5})),isActive:{name:"underline"},operation:{name:"toggleUnderline"}}),WPe=Et({label:"strikeControlLabel",icon:e=>k.createElement(Tme,Mt($t({},e),{stroke:1.5})),isActive:{name:"strike"},operation:{name:"toggleStrike"}}),UPe=Et({label:"clearFormattingControlLabel",icon:e=>k.createElement(eme,Mt($t({},e),{stroke:1.5})),operation:{name:"unsetAllMarks"}}),ZPe=Et({label:"unlinkControlLabel",icon:e=>k.createElement(a7,Mt($t({},e),{stroke:1.5})),operation:{name:"unsetLink"}}),GPe=Et({label:"bulletListControlLabel",icon:e=>k.createElement(Sme,Mt($t({},e),{stroke:1.5})),isActive:{name:"bulletList"},operation:{name:"toggleBulletList"}}),YPe=Et({label:"orderedListControlLabel",icon:e=>k.createElement(xme,Mt($t({},e),{stroke:1.5})),isActive:{name:"orderedList"},operation:{name:"toggleOrderedList"}}),KPe=Et({label:"h1ControlLabel",icon:e=>k.createElement(cme,Mt($t({},e),{stroke:1.5})),isActive:{name:"heading",attributes:{level:1}},operation:{name:"toggleHeading",attributes:{level:1}}}),qPe=Et({label:"h2ControlLabel",icon:e=>k.createElement(ume,Mt($t({},e),{stroke:1.5})),isActive:{name:"heading",attributes:{level:2}},operation:{name:"toggleHeading",attributes:{level:2}}}),JPe=Et({label:"h3ControlLabel",icon:e=>k.createElement(dme,Mt($t({},e),{stroke:1.5})),isActive:{name:"heading",attributes:{level:3}},operation:{name:"toggleHeading",attributes:{level:3}}}),QPe=Et({label:"h4ControlLabel",icon:e=>k.createElement(fme,Mt($t({},e),{stroke:1.5})),isActive:{name:"heading",attributes:{level:4}},operation:{name:"toggleHeading",attributes:{level:4}}}),XPe=Et({label:"h5ControlLabel",icon:e=>k.createElement(hme,Mt($t({},e),{stroke:1.5})),isActive:{name:"heading",attributes:{level:5}},operation:{name:"toggleHeading",attributes:{level:5}}}),eOe=Et({label:"h6ControlLabel",icon:e=>k.createElement(pme,Mt($t({},e),{stroke:1.5})),isActive:{name:"heading",attributes:{level:6}},operation:{name:"toggleHeading",attributes:{level:6}}}),tOe=Et({label:"blockquoteControlLabel",icon:e=>k.createElement(qpe,Mt($t({},e),{stroke:1.5})),isActive:{name:"blockquote"},operation:{name:"toggleBlockquote"}}),nOe=Et({label:"alignLeftControlLabel",icon:e=>k.createElement(Wpe,Mt($t({},e),{stroke:1.5})),operation:{name:"setTextAlign",attributes:"left"}}),rOe=Et({label:"alignRightControlLabel",icon:e=>k.createElement(Upe,Mt($t({},e),{stroke:1.5})),operation:{name:"setTextAlign",attributes:"right"}}),oOe=Et({label:"alignCenterControlLabel",icon:e=>k.createElement(Vpe,Mt($t({},e),{stroke:1.5})),operation:{name:"setTextAlign",attributes:"center"}}),iOe=Et({label:"alignJustifyControlLabel",icon:e=>k.createElement(Hpe,Mt($t({},e),{stroke:1.5})),operation:{name:"setTextAlign",attributes:"justify"}}),sOe=Et({label:"subscriptControlLabel",icon:e=>k.createElement(Ime,Mt($t({},e),{stroke:1.5})),isActive:{name:"subscript"},operation:{name:"toggleSubscript"}}),aOe=Et({label:"superscriptControlLabel",icon:e=>k.createElement(jme,Mt($t({},e),{stroke:1.5})),isActive:{name:"superscript"},operation:{name:"toggleSuperscript"}}),lOe=Et({label:"codeControlLabel",icon:e=>k.createElement(e7,Mt($t({},e),{stroke:1.5})),isActive:{name:"code"},operation:{name:"toggleCode"}}),cOe=Et({label:"codeBlockControlLabel",icon:e=>k.createElement(e7,Mt($t({},e),{stroke:1.5})),isActive:{name:"codeBlock"},operation:{name:"toggleCodeBlock"}}),uOe=Et({label:"highlightControlLabel",icon:e=>k.createElement(mme,Mt($t({},e),{stroke:1.5})),isActive:{name:"highlight"},operation:{name:"toggleHighlight"}}),dOe=Et({label:"hrControlLabel",icon:e=>k.createElement(_me,Mt($t({},e),{stroke:1.5})),operation:{name:"setHorizontalRule"}}),fOe=Et({label:"unsetColorControlLabel",icon:e=>k.createElement(X8,Mt($t({},e),{stroke:1.5})),operation:{name:"unsetColor"}});var hOe=Object.defineProperty,sj=Object.getOwnPropertySymbols,pOe=Object.prototype.hasOwnProperty,mOe=Object.prototype.propertyIsEnumerable,aj=(e,t,n)=>t in e?hOe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gOe=(e,t)=>{for(var n in t||(t={}))pOe.call(t,n)&&aj(e,n,t[n]);if(sj)for(var n of sj(t))mOe.call(t,n)&&aj(e,n,t[n]);return e},vOe=ue(e=>{const t=e.fn.variant({variant:"light"});return{linkEditor:{display:"flex"},linkEditorInput:{borderTopRightRadius:0,borderBottomRightRadius:0,borderRight:0},linkEditorExternalControl:{backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.colors.dark[7],.5):e.white,border:`${M(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`,height:M(24),width:M(24),display:"flex",justifyContent:"center",alignItems:"center",borderRadius:e.fn.radius(),"&[data-active]":gOe({backgroundColor:t.background,borderColor:t.border,color:t.color},e.fn.hover({background:t.hover}))},linkEditorSave:{borderTopLeftRadius:0,borderBottomLeftRadius:0}}});const yOe=vOe;var _Oe=Object.defineProperty,wOe=Object.defineProperties,bOe=Object.getOwnPropertyDescriptors,cy=Object.getOwnPropertySymbols,mF=Object.prototype.hasOwnProperty,gF=Object.prototype.propertyIsEnumerable,lj=(e,t,n)=>t in e?_Oe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Hx=(e,t)=>{for(var n in t||(t={}))mF.call(t,n)&&lj(e,n,t[n]);if(cy)for(var n of cy(t))gF.call(t,n)&&lj(e,n,t[n]);return e},xOe=(e,t)=>wOe(e,bOe(t)),vF=(e,t)=>{var n={};for(var r in e)mF.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&cy)for(var r of cy(e))t.indexOf(r)<0&&gF.call(e,r)&&(n[r]=e[r]);return n};const SOe=e=>{var t=e,{size:n}=t,r=vF(t,["size"]);return k.createElement(wme,Hx({size:n,stroke:1.5},r))},POe={initialExternal:!1},OOe=_.forwardRef((e,t)=>{const n=ae("RichTextEditorLinkControl",POe,e),{icon:r,popoverProps:o,disableTooltips:i,initialExternal:s}=n,a=vF(n,["icon","popoverProps","disableTooltips","initialExternal"]),{editor:c,labels:u,classNames:f,styles:h,unstyled:m,variant:v}=za(),{classes:y}=yOe(null,{name:"RichTextEditor",classNames:f,styles:h,unstyled:m,variant:v}),[w,P]=SY(""),[b,S]=_.useState(s),[O,{open:E,close:$}]=NS(!1),N=()=>{E();const z=c?.getAttributes("link");P(z?.href||""),S(z?.target==="_blank")},I=()=>{$(),P(""),S(s)},R=()=>{I(),w===""?c.chain().focus().extendMarkRange("link").unsetLink().run():c.chain().focus().extendMarkRange("link").setLink({href:w,target:b?"_blank":null}).run()},B=z=>{z.key==="Enter"&&(z.preventDefault(),R())};return Pm("edit-link",N,!1),k.createElement(En,Hx({trapFocus:!0,shadow:"md",withinPortal:!0,opened:O,onClose:I,offset:-44,zIndex:1e4,unstyled:m},o),k.createElement(En.Target,null,k.createElement(RO,xOe(Hx({icon:r||SOe,"aria-label":u.linkControlLabel,title:u.linkControlLabel,onClick:N,active:c?.isActive("link"),unstyled:m},a),{ref:t}))),k.createElement(En.Dropdown,{sx:z=>({backgroundColor:z.colorScheme==="dark"?z.colors.dark[7]:z.white})},k.createElement("div",{className:y.linkEditor},k.createElement(_n,{placeholder:u.linkEditorInputPlaceholder,"aria-label":u.linkEditorInputLabel,type:"url",value:w,onChange:P,classNames:{input:y.linkEditorInput},onKeyDown:B,unstyled:m,rightSection:k.createElement(zt,{label:b?u.linkEditorExternalLink:u.linkEditorInternalLink,events:{hover:!0,focus:!0,touch:!0},withinPortal:!0,withArrow:!0,disabled:i,unstyled:m,zIndex:1e4},k.createElement(ds,{onClick:()=>S(z=>!z),"data-active":b||void 0,className:y.linkEditorExternalControl,unstyled:m},k.createElement(ime,{size:M(14),stroke:1.5})))}),k.createElement(at,{variant:"default",onClick:R,className:y.linkEditorSave,unstyled:m},u.linkEditorSave))))});var COe=Object.defineProperty,kOe=Object.defineProperties,EOe=Object.getOwnPropertyDescriptors,uy=Object.getOwnPropertySymbols,yF=Object.prototype.hasOwnProperty,_F=Object.prototype.propertyIsEnumerable,cj=(e,t,n)=>t in e?COe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ew=(e,t)=>{for(var n in t||(t={}))yF.call(t,n)&&cj(e,n,t[n]);if(uy)for(var n of uy(t))_F.call(t,n)&&cj(e,n,t[n]);return e},$Oe=(e,t)=>kOe(e,EOe(t)),MOe=(e,t)=>{var n={};for(var r in e)yF.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&uy)for(var r of uy(e))t.indexOf(r)<0&&_F.call(e,r)&&(n[r]=e[r]);return n};const NOe={},wF=_.forwardRef((e,t)=>{const n=ae("RichTextEditorColorPickerControl",NOe,e),{popoverProps:r,colors:o,colorPickerProps:i}=n,s=MOe(n,["popoverProps","colors","colorPickerProps"]),{editor:a,labels:c,unstyled:u}=za(),[f,{toggle:h,close:m}]=NS(!1),[v,y]=_.useState("palette"),w=ar(),P=a?.getAttributes("textStyle").color||(w.colorScheme==="dark"?w.colors.dark[1]:w.black),b=(E,$=!0)=>{a.chain().focus().setColor(E).run(),$&&m()},S=()=>{a.chain().focus().unsetColor().run(),m()},O=o.map((E,$)=>k.createElement(_f,{key:$,component:"button",color:E,onClick:()=>b(E),size:26,radius:"xs",sx:{cursor:"pointer"},title:c.colorPickerColorLabel(E),"aria-label":c.colorPickerColorLabel(E),unstyled:u}));return k.createElement(En,Ew({opened:f,withinPortal:!0,trapFocus:!0,onClose:m,unstyled:u},r),k.createElement(En.Target,null,k.createElement(ah,$Oe(Ew({"aria-label":c.colorPickerControlLabel,title:c.colorPickerControlLabel},s),{ref:t,onClick:h}),k.createElement(_f,{color:P,size:14,unstyled:u}))),k.createElement(En.Dropdown,{sx:()=>({backgroundColor:w.colorScheme==="dark"?w.colors.dark[7]:w.white})},v==="palette"&&k.createElement(qP,{cols:7,spacing:2},O),v==="colorPicker"&&k.createElement(N4,Ew({defaultValue:P,onChange:E=>b(E,!1),unstyled:u},i)),k.createElement(zt.Group,{closeDelay:200},k.createElement(nt,{position:"right",spacing:"xs",mt:"sm"},v==="palette"&&k.createElement(Xe,{variant:"default",onClick:m,unstyled:u,title:c.colorPickerCancel,"aria-label":c.colorPickerCancel},k.createElement(pu,{stroke:1.5,size:"1rem"})),k.createElement(Xe,{variant:"default",onClick:S,unstyled:u,title:c.colorPickerClear,"aria-label":c.colorPickerClear},k.createElement(X8,{stroke:1.5,size:"1rem"})),v==="palette"?k.createElement(Xe,{variant:"default",onClick:()=>y("colorPicker"),unstyled:u,title:c.colorPickerColorPicker,"aria-label":c.colorPickerColorPicker},k.createElement(nme,{stroke:1.5,size:"1rem"})):k.createElement(Xe,{variant:"default",onClick:()=>y("palette"),unstyled:u,"aria-label":c.colorPickerPalette,title:c.colorPickerPalette},k.createElement(i7,{stroke:1.5,size:"1rem"})),v==="colorPicker"&&k.createElement(Xe,{variant:"default",onClick:m,unstyled:u,title:c.colorPickerSave,"aria-label":c.colorPickerSave},k.createElement(Xpe,{stroke:1.5,size:"1rem"}))))))});wF.displayName="@mantine/tiptap/ColorPickerControl";var TOe=Object.defineProperty,IOe=Object.defineProperties,jOe=Object.getOwnPropertyDescriptors,dy=Object.getOwnPropertySymbols,bF=Object.prototype.hasOwnProperty,xF=Object.prototype.propertyIsEnumerable,uj=(e,t,n)=>t in e?TOe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,DOe=(e,t)=>{for(var n in t||(t={}))bF.call(t,n)&&uj(e,n,t[n]);if(dy)for(var n of dy(t))xF.call(t,n)&&uj(e,n,t[n]);return e},ROe=(e,t)=>IOe(e,jOe(t)),LOe=(e,t)=>{var n={};for(var r in e)bF.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&dy)for(var r of dy(e))t.indexOf(r)<0&&xF.call(e,r)&&(n[r]=e[r]);return n};const zOe={},AOe=_.forwardRef((e,t)=>{const n=ae("RichTextEditorColorControl",zOe,e),{color:r}=n,o=LOe(n,["color"]),{editor:i,labels:s,unstyled:a}=za(),c=i?.getAttributes("textStyle").color||null,u=s.colorControlLabel(r);return k.createElement(ah,ROe(DOe({active:c===r,"aria-label":u,title:u,onClick:()=>i.chain().focus().setColor(r).run()},o),{ref:t}),k.createElement(_f,{color:r,size:14,unstyled:a}))});var BOe=Object.defineProperty,FOe=Object.defineProperties,VOe=Object.getOwnPropertyDescriptors,fy=Object.getOwnPropertySymbols,SF=Object.prototype.hasOwnProperty,PF=Object.prototype.propertyIsEnumerable,dj=(e,t,n)=>t in e?BOe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$w=(e,t)=>{for(var n in t||(t={}))SF.call(t,n)&&dj(e,n,t[n]);if(fy)for(var n of fy(t))PF.call(t,n)&&dj(e,n,t[n]);return e},HOe=(e,t)=>FOe(e,VOe(t)),WOe=(e,t)=>{var n={};for(var r in e)SF.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&fy)for(var r of fy(e))t.indexOf(r)<0&&PF.call(e,r)&&(n[r]=e[r]);return n};const UOe={withCodeHighlightStyles:!0,withTypographyStyles:!0},Ee=_.forwardRef((e,t)=>{const n=ae("RichTextEditor",UOe,e),{editor:r,children:o,className:i,labels:s,withCodeHighlightStyles:a,withTypographyStyles:c,classNames:u,styles:f,unstyled:h,variant:m}=n,v=WOe(n,["editor","children","className","labels","withCodeHighlightStyles","withTypographyStyles","classNames","styles","unstyled","variant"]),{classes:y,cx:w}=EPe(null,{name:"RichTextEditor",classNames:u,styles:f,unstyled:h,variant:m}),P=_.useMemo(()=>$w($w({},CPe),s),[s]);return k.createElement(Z1e,{value:{editor:r,labels:P,withCodeHighlightStyles:a,withTypographyStyles:c,classNames:u,styles:f,unstyled:h,variant:m}},k.createElement(Pe,HOe($w({className:w(y.root,i)},v),{ref:t}),o))});Ee.Content=oF;Ee.Control=ah;Ee.ControlsGroup=cF;Ee.Toolbar=fF;Ee.Bold=FPe;Ee.Italic=VPe;Ee.Strikethrough=WPe;Ee.Underline=HPe;Ee.ClearFormatting=UPe;Ee.H1=KPe;Ee.H2=qPe;Ee.H3=JPe;Ee.H4=QPe;Ee.H5=XPe;Ee.H6=eOe;Ee.BulletList=GPe;Ee.OrderedList=YPe;Ee.Link=OOe;Ee.Unlink=ZPe;Ee.Blockquote=tOe;Ee.AlignLeft=nOe;Ee.AlignRight=rOe;Ee.AlignCenter=oOe;Ee.AlignJustify=iOe;Ee.Superscript=aOe;Ee.Subscript=sOe;Ee.Code=lOe;Ee.CodeBlock=cOe;Ee.ColorPicker=wF;Ee.Color=AOe;Ee.Highlight=uOe;Ee.Hr=dOe;Ee.UnsetColor=fOe;Ee.displayName="@mantine/tiptap/RichTextEditor";const ZOe="aaa1rp3barth4b0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0faromeo7ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re2s2c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y0eats7k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking0channel11l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t0isalat7u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0at2delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d0network8tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntdoor4ier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5gtv3iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0eles2s3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1nder2le4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster5ia3d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4de2k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0cys3drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7serati6ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic3tual5v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rthwesternmutual14on4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3ssagens7y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cher3ks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w0time7i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ffany5ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0channel7ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lkswagen7vo3te1ing3o2yage5u0elos6wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",GOe="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5تصالات6رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Su=(e,t)=>{for(const n in t)e[n]=t[n];return e},Wx="numeric",Ux="ascii",Zx="alpha",lm="asciinumeric",yp="alphanumeric",Gx="domain",OF="emoji",YOe="scheme",KOe="slashscheme",fj="whitespace";function qOe(e,t){return e in t||(t[e]=[]),t[e]}function yl(e,t,n){t[Wx]&&(t[lm]=!0,t[yp]=!0),t[Ux]&&(t[lm]=!0,t[Zx]=!0),t[lm]&&(t[yp]=!0),t[Zx]&&(t[yp]=!0),t[yp]&&(t[Gx]=!0),t[OF]&&(t[Gx]=!0);for(const r in t){const o=qOe(r,n);o.indexOf(e)<0&&o.push(e)}}function JOe(e,t){const n={};for(const r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function zr(e){e===void 0&&(e=null),this.j={},this.jr=[],this.jd=null,this.t=e}zr.groups={};zr.prototype={accepts(){return!!this.t},go(e){const t=this,n=t.j[e];if(n)return n;for(let r=0;re.ta(t,n,r,o),Mo=(e,t,n,r,o)=>e.tr(t,n,r,o),hj=(e,t,n,r,o)=>e.ts(t,n,r,o),de=(e,t,n,r,o)=>e.tt(t,n,r,o),ts="WORD",Yx="UWORD",Mf="LOCALHOST",Kx="TLD",qx="UTLD",cm="SCHEME",wc="SLASH_SCHEME",LO="NUM",CF="WS",zO="NL",Rc="OPENBRACE",Ud="OPENBRACKET",Zd="OPENANGLEBRACKET",Gd="OPENPAREN",al="CLOSEBRACE",Lc="CLOSEBRACKET",zc="CLOSEANGLEBRACKET",ll="CLOSEPAREN",hy="AMPERSAND",py="APOSTROPHE",my="ASTERISK",Ys="AT",gy="BACKSLASH",vy="BACKTICK",yy="CARET",Xs="COLON",AO="COMMA",_y="DOLLAR",wi="DOT",wy="EQUALS",BO="EXCLAMATION",bi="HYPHEN",by="PERCENT",xy="PIPE",Sy="PLUS",Py="POUND",Oy="QUERY",FO="QUOTE",VO="SEMI",xi="SLASH",Yd="TILDE",Cy="UNDERSCORE",kF="EMOJI",ky="SYM";var EF=Object.freeze({__proto__:null,WORD:ts,UWORD:Yx,LOCALHOST:Mf,TLD:Kx,UTLD:qx,SCHEME:cm,SLASH_SCHEME:wc,NUM:LO,WS:CF,NL:zO,OPENBRACE:Rc,OPENBRACKET:Ud,OPENANGLEBRACKET:Zd,OPENPAREN:Gd,CLOSEBRACE:al,CLOSEBRACKET:Lc,CLOSEANGLEBRACKET:zc,CLOSEPAREN:ll,AMPERSAND:hy,APOSTROPHE:py,ASTERISK:my,AT:Ys,BACKSLASH:gy,BACKTICK:vy,CARET:yy,COLON:Xs,COMMA:AO,DOLLAR:_y,DOT:wi,EQUALS:wy,EXCLAMATION:BO,HYPHEN:bi,PERCENT:by,PIPE:xy,PLUS:Sy,POUND:Py,QUERY:Oy,QUOTE:FO,SEMI:VO,SLASH:xi,TILDE:Yd,UNDERSCORE:Cy,EMOJI:kF,SYM:ky});const gc=/[a-z]/,Mw=/\p{L}/u,Nw=/\p{Emoji}/u,Tw=/\d/,pj=/\s/,mj=` +`,QOe="️",XOe="‍";let _p=null,wp=null;function eCe(e){e===void 0&&(e=[]);const t={};zr.groups=t;const n=new zr;_p==null&&(_p=gj(ZOe)),wp==null&&(wp=gj(GOe)),de(n,"'",py),de(n,"{",Rc),de(n,"[",Ud),de(n,"<",Zd),de(n,"(",Gd),de(n,"}",al),de(n,"]",Lc),de(n,">",zc),de(n,")",ll),de(n,"&",hy),de(n,"*",my),de(n,"@",Ys),de(n,"`",vy),de(n,"^",yy),de(n,":",Xs),de(n,",",AO),de(n,"$",_y),de(n,".",wi),de(n,"=",wy),de(n,"!",BO),de(n,"-",bi),de(n,"%",by),de(n,"|",xy),de(n,"+",Sy),de(n,"#",Py),de(n,"?",Oy),de(n,'"',FO),de(n,"/",xi),de(n,";",VO),de(n,"~",Yd),de(n,"_",Cy),de(n,"\\",gy);const r=Mo(n,Tw,LO,{[Wx]:!0});Mo(r,Tw,r);const o=Mo(n,gc,ts,{[Ux]:!0});Mo(o,gc,o);const i=Mo(n,Mw,Yx,{[Zx]:!0});Mo(i,gc),Mo(i,Mw,i);const s=Mo(n,pj,CF,{[fj]:!0});de(n,mj,zO,{[fj]:!0}),de(s,mj),Mo(s,pj,s);const a=Mo(n,Nw,kF,{[OF]:!0});Mo(a,Nw,a),de(a,QOe,a);const c=de(a,XOe);Mo(c,Nw,a);const u=[[gc,o]],f=[[gc,null],[Mw,i]];for(let h=0;h<_p.length;h++)zs(n,_p[h],Kx,ts,u);for(let h=0;hh[0]>m[0]?1:-1);for(let h=0;h=0?y[Gx]=!0:gc.test(m)?Tw.test(m)?y[lm]=!0:y[Ux]=!0:y[Wx]=!0,hj(n,m,m,y)}return hj(n,"localhost",Mf,{ascii:!0}),n.jd=new zr(ky),{start:n,tokens:Su({groups:t},EF)}}function tCe(e,t){const n=nCe(t.replace(/[A-Z]/g,a=>a.toLowerCase())),r=n.length,o=[];let i=0,s=0;for(;s=0&&(h+=n[s].length,m++),u+=n[s].length,i+=n[s].length,s++;i-=h,s-=m,u-=h,o.push({t:f.t,v:t.slice(i-u,i),s:i-u,e:i})}return o}function nCe(e){const t=[],n=e.length;let r=0;for(;r56319||r+1===n||(i=e.charCodeAt(r+1))<56320||i>57343?e[r]:e.slice(r,r+2);t.push(s),r+=s.length}return t}function zs(e,t,n,r,o){let i;const s=t.length;for(let a=0;a=0;)i++;if(i>0){t.push(n.join(""));for(let s=parseInt(e.substring(r,r+i),10);s>0;s--)n.pop();r+=i}else n.push(e[r]),r++}return t}const Nf={defaultProtocol:"http",events:null,format:vj,formatHref:vj,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function HO(e,t){t===void 0&&(t=null);let n=Su({},Nf);e&&(n=Su(n,e instanceof HO?e.o:e));const r=n.ignoreTags,o=[];for(let i=0;in?r.substring(0,n)+"…":r},toFormattedHref(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e){return e===void 0&&(e=Nf.defaultProtocol),{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get("validate",this.toString(),this)},render(e){const t=this,n=this.toHref(e.get("defaultProtocol")),r=e.get("formatHref",n,this),o=e.get("tagName",n,t),i=this.toFormattedString(e),s={},a=e.get("className",n,t),c=e.get("target",n,t),u=e.get("rel",n,t),f=e.getObj("attributes",n,t),h=e.getObj("events",n,t);return s.href=r,a&&(s.class=a),c&&(s.target=c),u&&(s.rel=u),f&&Su(s,f),{tagName:o,attributes:s,content:i,eventListeners:h}}};function p1(e,t){class n extends $F{constructor(o,i){super(o,i),this.t=e}}for(const r in t)n.prototype[r]=t[r];return n.t=e,n}const yj=p1("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),_j=p1("text"),rCe=p1("nl"),Xa=p1("url",{isLink:!0,toHref(e){return e===void 0&&(e=Nf.defaultProtocol),this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){const e=this.tk;return e.length>=2&&e[0].t!==Mf&&e[1].t===Xs}}),On=e=>new zr(e);function oCe(e){let{groups:t}=e;const n=t.domain.concat([hy,my,Ys,gy,vy,yy,_y,wy,bi,LO,by,xy,Sy,Py,xi,ky,Yd,Cy]),r=[py,zc,al,Lc,ll,Xs,AO,wi,BO,Zd,Rc,Ud,Gd,Oy,FO,VO],o=[hy,py,my,gy,vy,yy,al,_y,wy,bi,Rc,by,xy,Sy,Py,Oy,xi,ky,Yd,Cy],i=On(),s=de(i,Yd);Me(s,o,s),Me(s,t.domain,s);const a=On(),c=On(),u=On();Me(i,t.domain,a),Me(i,t.scheme,c),Me(i,t.slashscheme,u),Me(a,o,s),Me(a,t.domain,a);const f=de(a,Ys);de(s,Ys,f),de(c,Ys,f),de(u,Ys,f);const h=de(s,wi);Me(h,o,s),Me(h,t.domain,s);const m=On();Me(f,t.domain,m),Me(m,t.domain,m);const v=de(m,wi);Me(v,t.domain,m);const y=On(yj);Me(v,t.tld,y),Me(v,t.utld,y),de(f,Mf,y);const w=de(m,bi);Me(w,t.domain,m),Me(y,t.domain,m),de(y,wi,v),de(y,bi,w);const P=de(y,Xs);Me(P,t.numeric,yj);const b=de(a,bi),S=de(a,wi);Me(b,t.domain,a),Me(S,o,s),Me(S,t.domain,a);const O=On(Xa);Me(S,t.tld,O),Me(S,t.utld,O),Me(O,t.domain,a),Me(O,o,s),de(O,wi,S),de(O,bi,b),de(O,Ys,f);const E=de(O,Xs),$=On(Xa);Me(E,t.numeric,$);const N=On(Xa),I=On();Me(N,n,N),Me(N,r,I),Me(I,n,N),Me(I,r,I),de(O,xi,N),de($,xi,N);const R=de(c,Xs),B=de(u,Xs),z=de(B,xi),G=de(z,xi);Me(c,t.domain,a),de(c,wi,S),de(c,bi,b),Me(u,t.domain,a),de(u,wi,S),de(u,bi,b),Me(R,t.domain,N),de(R,xi,N),Me(G,t.domain,N),Me(G,n,N),de(G,xi,N);const Q=de(N,Rc),X=de(N,Ud),V=de(N,Zd),H=de(N,Gd);de(I,Rc,Q),de(I,Ud,X),de(I,Zd,V),de(I,Gd,H),de(Q,al,N),de(X,Lc,N),de(V,zc,N),de(H,ll,N),de(Q,al,N);const Z=On(Xa),Y=On(Xa),j=On(Xa),W=On(Xa);Me(Q,n,Z),Me(X,n,Y),Me(V,n,j),Me(H,n,W);const F=On(),K=On(),ee=On(),fe=On();return Me(Q,r),Me(X,r),Me(V,r),Me(H,r),Me(Z,n,Z),Me(Y,n,Y),Me(j,n,j),Me(W,n,W),Me(Z,r,Z),Me(Y,r,Y),Me(j,r,j),Me(W,r,W),Me(F,n,F),Me(K,n,Y),Me(ee,n,j),Me(fe,n,W),Me(F,r,F),Me(K,r,K),Me(ee,r,ee),Me(fe,r,fe),de(Y,Lc,N),de(j,zc,N),de(W,ll,N),de(Z,al,N),de(K,Lc,N),de(ee,zc,N),de(fe,ll,N),de(F,ll,N),de(i,Mf,O),de(i,zO,rCe),{start:i,tokens:EF}}function iCe(e,t,n){let r=n.length,o=0,i=[],s=[];for(;o=0&&m++,o++,f++;if(m<0)o-=f,o0&&(i.push(Iw(_j,t,s)),s=[]),o-=m,f-=m;const v=h.t,y=n.slice(o-f,o);i.push(Iw(v,t,y))}}return s.length>0&&i.push(Iw(_j,t,s)),i}function Iw(e,t,n){const r=n[0].s,o=n[n.length-1].e,i=t.slice(r,o);return new e(i,n)}const sCe=typeof console<"u"&&console&&console.warn||(()=>{}),aCe="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Vt={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function lCe(){zr.groups={},Vt.scanner=null,Vt.parser=null,Vt.tokenQueue=[],Vt.pluginQueue=[],Vt.customSchemes=[],Vt.initialized=!1}function wj(e,t){if(t===void 0&&(t=!1),Vt.initialized&&sCe(`linkifyjs: already initialized - will not register custom scheme "${e}" ${aCe}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw new Error(`linkifyjs: incorrect scheme format. 1. Must only contain digits, lowercase ASCII letters or "-" 2. Cannot start or end with "-" - 3. "-" cannot repeat`);Vt.customSchemes.push([e,t])}function cCe(){Vt.scanner=eCe(Vt.customSchemes);for(let e=0;e{const o=t.some(u=>u.docChanged)&&!n.doc.eq(r.doc),i=t.some(u=>u.getMeta("preventAutolink"));if(!o||i)return;const{tr:s}=r,a=Qxe(n.doc,[...t]);if(aSe(a).forEach(({newRange:u})=>{const f=eSe(r.doc,u,v=>v.isTextblock);let h,m;if(f.length>1?(h=f[0],m=r.doc.textBetween(h.pos,h.pos+h.node.nodeSize,void 0," ")):f.length&&r.doc.textBetween(u.from,u.to," "," ").endsWith(" ")&&(h=f[0],m=r.doc.textBetween(h.pos,u.to,void 0," ")),h&&m){const v=m.split(" ").filter(P=>P!=="");if(v.length<=0)return!1;const y=v[v.length-1],w=h.pos+m.lastIndexOf(y);if(!y)return!1;MF(y).filter(P=>P.isLink).map(P=>({...P,from:w+P.start+1,to:w+P.end+1})).filter(P=>r.schema.marks.code?!r.doc.rangeHasMark(P.from,P.to,r.schema.marks.code):!0).filter(P=>e.validate?e.validate(P.value):!0).forEach(P=>{jO(P.from,P.to,r.doc).some(b=>b.mark.type===e.type)||s.addMark(P.from,P.to,e.type.create({href:P.href}))})}}),!!s.steps.length)return s}})}function fCe(e){return new Kr({key:new Fi("handleClickLink"),props:{handleClick:(t,n,r)=>{var o,i;if(r.button!==0||r.target.nodeName!=="A")return!1;const a=XB(t.state,e.type.name),c=r.target,u=(o=c?.href)!==null&&o!==void 0?o:a.href,f=(i=c?.target)!==null&&i!==void 0?i:a.target;return c&&u?(t.editable&&window.open(u,f),!0):!1}}})}const hCe=sr.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate(){this.options.protocols.forEach(e=>{if(typeof e=="string"){wD(e);return}wD(e.scheme,e.optionalSlashes)})},onDestroy(){lCe()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:void 0}},addAttributes(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:'a[href]:not([href *= "javascript:" i])'}]},renderHTML({HTMLAttributes:e}){return["a",kt(this.options.HTMLAttributes,e),0]},addCommands(){return{setLink:e=>({chain:t})=>t().setMark(this.name,e).setMeta("preventAutolink",!0).run(),toggleLink:e=>({chain:t})=>t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Na({find:e=>MF(e).filter(t=>this.options.validate?this.options.validate(t.value):!0).filter(t=>t.isLink).map(t=>({text:t.value,index:t.start,data:t})),type:this.type,getAttributes:(e,t)=>{var n,r;const o=(n=t.clipboardData)===null||n===void 0?void 0:n.getData("text/html"),i=/href="([^"]*)"/,s=o?.match(i);return s?{href:s[1]}:{href:(r=e.data)===null||r===void 0?void 0:r.href}}})]},addProseMirrorPlugins(){const e=[];return this.options.autolink&&e.push(dCe({type:this.type,validate:this.options.validate})),this.options.openOnClick&&e.push(fCe({type:this.type})),e}}),NF=hCe.extend({addKeyboardShortcuts:()=>({"Mod-k":()=>(window.dispatchEvent(new Event("edit-link")),!0)})}).configure({openOnClick:!1}),pCe=/(?:^|\s)((?:==)((?:[^~=]+))(?:==))$/,mCe=/(?:^|\s)((?:==)((?:[^~=]+))(?:==))/g,TF=sr.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute("data-color")||e.style.backgroundColor,renderHTML:e=>e.color?{"data-color":e.color,style:`background-color: ${e.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:e}){return["mark",kt(this.options.HTMLAttributes,e),0]},addCommands(){return{setHighlight:e=>({commands:t})=>t.setMark(this.name,e),toggleHighlight:e=>({commands:t})=>t.toggleMark(this.name,e),unsetHighlight:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Al({find:pCe,type:this.type})]},addPasteRules(){return[Na({find:mCe,type:this.type})]}}),gCe=/^\s*>\s$/,vCe=qr.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:e}){return["blockquote",kt(this.options.HTMLAttributes,e),0]},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[$f({find:gCe,type:this.type})]}}),yCe=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,_Ce=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,wCe=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,bCe=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,xCe=sr.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>e.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return["strong",kt(this.options.HTMLAttributes,e),0]},addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Al({find:yCe,type:this.type}),Al({find:wCe,type:this.type})]},addPasteRules(){return[Na({find:_Ce,type:this.type}),Na({find:bCe,type:this.type})]}}),SCe=qr.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",kt(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),bD=sr.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:e=>e.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["span",kt(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:e,commands:t})=>{const n=sh(e,this.type);return Object.entries(n).some(([,o])=>!!o)?!0:t.unsetMark(this.name)}}}}),xD=/^\s*([-+*])\s$/,PCe=qr.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:e}){return["ul",kt(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(SCe.name,this.editor.getAttributes(bD.name)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=$f({find:xD,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=$f({find:xD,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(bD.name),editor:this.editor})),[e]}}),OCe=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,CCe=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,kCe=sr.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:e}){return["code",kt(this.options.HTMLAttributes,e),0]},addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Al({find:OCe,type:this.type})]},addPasteRules(){return[Na({find:CCe,type:this.type})]}}),ECe=/^```([a-z]+)?[\s\n]$/,$Ce=/^~~~([a-z]+)?[\s\n]$/,MCe=qr.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:e=>{var t;const{languageClassPrefix:n}=this.options,i=[...((t=e.firstElementChild)===null||t===void 0?void 0:t.classList)||[]].filter(s=>s.startsWith(n)).map(s=>s.replace(n,""))[0];return i||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:e,HTMLAttributes:t}){return["pre",kt(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=e,{selection:n}=t,{$from:r,empty:o}=n;if(!o||r.parent.type!==this.type)return!1;const i=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(` + 3. "-" cannot repeat`);Vt.customSchemes.push([e,t])}function cCe(){Vt.scanner=eCe(Vt.customSchemes);for(let e=0;e{const o=t.some(u=>u.docChanged)&&!n.doc.eq(r.doc),i=t.some(u=>u.getMeta("preventAutolink"));if(!o||i)return;const{tr:s}=r,a=Qxe(n.doc,[...t]);if(aSe(a).forEach(({newRange:u})=>{const f=eSe(r.doc,u,v=>v.isTextblock);let h,m;if(f.length>1?(h=f[0],m=r.doc.textBetween(h.pos,h.pos+h.node.nodeSize,void 0," ")):f.length&&r.doc.textBetween(u.from,u.to," "," ").endsWith(" ")&&(h=f[0],m=r.doc.textBetween(h.pos,u.to,void 0," ")),h&&m){const v=m.split(" ").filter(P=>P!=="");if(v.length<=0)return!1;const y=v[v.length-1],w=h.pos+m.lastIndexOf(y);if(!y)return!1;MF(y).filter(P=>P.isLink).map(P=>({...P,from:w+P.start+1,to:w+P.end+1})).filter(P=>r.schema.marks.code?!r.doc.rangeHasMark(P.from,P.to,r.schema.marks.code):!0).filter(P=>e.validate?e.validate(P.value):!0).forEach(P=>{DO(P.from,P.to,r.doc).some(b=>b.mark.type===e.type)||s.addMark(P.from,P.to,e.type.create({href:P.href}))})}}),!!s.steps.length)return s}})}function fCe(e){return new Kr({key:new Fi("handleClickLink"),props:{handleClick:(t,n,r)=>{var o,i;if(r.button!==0||r.target.nodeName!=="A")return!1;const a=XB(t.state,e.type.name),c=r.target,u=(o=c?.href)!==null&&o!==void 0?o:a.href,f=(i=c?.target)!==null&&i!==void 0?i:a.target;return c&&u?(t.editable&&window.open(u,f),!0):!1}}})}const hCe=sr.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate(){this.options.protocols.forEach(e=>{if(typeof e=="string"){wj(e);return}wj(e.scheme,e.optionalSlashes)})},onDestroy(){lCe()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:void 0}},addAttributes(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:'a[href]:not([href *= "javascript:" i])'}]},renderHTML({HTMLAttributes:e}){return["a",kt(this.options.HTMLAttributes,e),0]},addCommands(){return{setLink:e=>({chain:t})=>t().setMark(this.name,e).setMeta("preventAutolink",!0).run(),toggleLink:e=>({chain:t})=>t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Na({find:e=>MF(e).filter(t=>this.options.validate?this.options.validate(t.value):!0).filter(t=>t.isLink).map(t=>({text:t.value,index:t.start,data:t})),type:this.type,getAttributes:(e,t)=>{var n,r;const o=(n=t.clipboardData)===null||n===void 0?void 0:n.getData("text/html"),i=/href="([^"]*)"/,s=o?.match(i);return s?{href:s[1]}:{href:(r=e.data)===null||r===void 0?void 0:r.href}}})]},addProseMirrorPlugins(){const e=[];return this.options.autolink&&e.push(dCe({type:this.type,validate:this.options.validate})),this.options.openOnClick&&e.push(fCe({type:this.type})),e}}),NF=hCe.extend({addKeyboardShortcuts:()=>({"Mod-k":()=>(window.dispatchEvent(new Event("edit-link")),!0)})}).configure({openOnClick:!1}),pCe=/(?:^|\s)((?:==)((?:[^~=]+))(?:==))$/,mCe=/(?:^|\s)((?:==)((?:[^~=]+))(?:==))/g,TF=sr.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute("data-color")||e.style.backgroundColor,renderHTML:e=>e.color?{"data-color":e.color,style:`background-color: ${e.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:e}){return["mark",kt(this.options.HTMLAttributes,e),0]},addCommands(){return{setHighlight:e=>({commands:t})=>t.setMark(this.name,e),toggleHighlight:e=>({commands:t})=>t.toggleMark(this.name,e),unsetHighlight:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Al({find:pCe,type:this.type})]},addPasteRules(){return[Na({find:mCe,type:this.type})]}}),gCe=/^\s*>\s$/,vCe=qr.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:e}){return["blockquote",kt(this.options.HTMLAttributes,e),0]},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[$f({find:gCe,type:this.type})]}}),yCe=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,_Ce=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,wCe=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,bCe=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,xCe=sr.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>e.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return["strong",kt(this.options.HTMLAttributes,e),0]},addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Al({find:yCe,type:this.type}),Al({find:wCe,type:this.type})]},addPasteRules(){return[Na({find:_Ce,type:this.type}),Na({find:bCe,type:this.type})]}}),SCe=qr.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",kt(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),bj=sr.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:e=>e.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["span",kt(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:e,commands:t})=>{const n=sh(e,this.type);return Object.entries(n).some(([,o])=>!!o)?!0:t.unsetMark(this.name)}}}}),xj=/^\s*([-+*])\s$/,PCe=qr.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:e}){return["ul",kt(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(SCe.name,this.editor.getAttributes(bj.name)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=$f({find:xj,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=$f({find:xj,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(bj.name),editor:this.editor})),[e]}}),OCe=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,CCe=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,kCe=sr.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:e}){return["code",kt(this.options.HTMLAttributes,e),0]},addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Al({find:OCe,type:this.type})]},addPasteRules(){return[Na({find:CCe,type:this.type})]}}),ECe=/^```([a-z]+)?[\s\n]$/,$Ce=/^~~~([a-z]+)?[\s\n]$/,MCe=qr.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:e=>{var t;const{languageClassPrefix:n}=this.options,i=[...((t=e.firstElementChild)===null||t===void 0?void 0:t.classList)||[]].filter(s=>s.startsWith(n)).map(s=>s.replace(n,""))[0];return i||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:e,HTMLAttributes:t}){return["pre",kt(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=e,{selection:n}=t,{$from:r,empty:o}=n;if(!o||r.parent.type!==this.type)return!1;const i=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(` `);return!i||!s?!1:e.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:n,doc:r}=t,{$from:o,empty:i}=n;if(!i||o.parent.type!==this.type||!(o.parentOffset===o.parent.nodeSize-2))return!1;const a=o.after();return a===void 0||r.nodeAt(a)?!1:e.commands.exitCode()}}},addInputRules(){return[Fx({find:ECe,type:this.type,getAttributes:e=>({language:e[1]})}),Fx({find:$Ce,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new Kr({key:new Fi("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),o=r?JSON.parse(r):void 0,i=o?.mode;if(!n||!i)return!1;const{tr:s}=e.state;return s.replaceSelectionWith(this.type.create({language:i})),s.setSelection(Ve.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.insertText(n.replace(/\r\n?/g,` -`)),s.setMeta("paste",!0),e.dispatch(s),!0}}})]}}),NCe=qr.create({name:"doc",topNode:!0,content:"block+"});function TCe(e={}){return new Kr({view(t){return new ICe(t,e)}})}class ICe{constructor(t,n){var r;this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(o=>{let i=s=>{this[o](s)};return t.dom.addEventListener(o,i),{name:o,handler:i}})}destroy(){this.handlers.forEach(({name:t,handler:n})=>this.editorView.dom.removeEventListener(t,n))}update(t,n){this.cursorPos!=null&&n.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(t){t!=this.cursorPos&&(this.cursorPos=t,t==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let t=this.editorView.state.doc.resolve(this.cursorPos),n=!t.parent.inlineContent,r;if(n){let a=t.nodeBefore,c=t.nodeAfter;if(a||c){let u=this.editorView.nodeDOM(this.cursorPos-(a?a.nodeSize:0));if(u){let f=u.getBoundingClientRect(),h=a?f.bottom:f.top;a&&c&&(h=(h+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:f.left,right:f.right,top:h-this.width/2,bottom:h+this.width/2}}}}if(!r){let a=this.editorView.coordsAtPos(this.cursorPos);r={left:a.left-this.width/2,right:a.left+this.width/2,top:a.top,bottom:a.bottom}}let o=this.editorView.dom.offsetParent;this.element||(this.element=o.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let i,s;if(!o||o==document.body&&getComputedStyle(o).position=="static")i=-pageXOffset,s=-pageYOffset;else{let a=o.getBoundingClientRect();i=a.left-o.scrollLeft,s=a.top-o.scrollTop}this.element.style.left=r.left-i+"px",this.element.style.top=r.top-s+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(t){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),t)}dragover(t){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),o=r&&r.type.spec.disableDropCursor,i=typeof o=="function"?o(this.editorView,n,t):o;if(n&&!i){let s=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=tB(this.editorView.state.doc,s,this.editorView.dragging.slice);a!=null&&(s=a)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(t){(t.target==this.editorView.dom||!this.editorView.dom.contains(t.relatedTarget))&&this.setCursor(null)}}const DCe=Sr.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[TCe(this.options)]}});class Kt extends Ze{constructor(t){super(t,t)}map(t,n){let r=t.resolve(n.map(this.head));return Kt.valid(r)?new Kt(r):Ze.near(r)}content(){return ye.empty}eq(t){return t instanceof Kt&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Kt(t.resolve(n.pos))}getBookmark(){return new WO(this.anchor)}static valid(t){let n=t.parent;if(n.isTextblock||!jCe(t)||!LCe(t))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let o=n.contentMatchAt(t.index()).defaultType;return o&&o.isTextblock}static findGapCursorFrom(t,n,r=!1){e:for(;;){if(!r&&Kt.valid(t))return t;let o=t.pos,i=null;for(let s=t.depth;;s--){let a=t.node(s);if(n>0?t.indexAfter(s)0){i=a.child(n>0?t.indexAfter(s):t.index(s)-1);break}else if(s==0)return null;o+=n;let c=t.doc.resolve(o);if(Kt.valid(c))return c}for(;;){let s=n>0?i.firstChild:i.lastChild;if(!s){if(i.isAtom&&!i.isText&&!je.isSelectable(i)){t=t.doc.resolve(o+i.nodeSize*n),r=!1;continue e}break}i=s,o+=n;let a=t.doc.resolve(o);if(Kt.valid(a))return a}return null}}}Kt.prototype.visible=!1;Kt.findFrom=Kt.findGapCursorFrom;Ze.jsonID("gapcursor",Kt);class WO{constructor(t){this.pos=t}map(t){return new WO(t.map(this.pos))}resolve(t){let n=t.resolve(this.pos);return Kt.valid(n)?new Kt(n):Ze.near(n)}}function jCe(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n-1);;o=o.lastChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function LCe(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n);;o=o.firstChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function RCe(){return new Kr({props:{decorations:FCe,createSelectionBetween(e,t,n){return t.pos==n.pos&&Kt.valid(n)?new Kt(n):null},handleClick:ACe,handleKeyDown:zCe,handleDOMEvents:{beforeinput:BCe}}})}const zCe=BB({ArrowLeft:bp("horiz",-1),ArrowRight:bp("horiz",1),ArrowUp:bp("vert",-1),ArrowDown:bp("vert",1)});function bp(e,t){const n=e=="vert"?t>0?"down":"up":t>0?"right":"left";return function(r,o,i){let s=r.selection,a=t>0?s.$to:s.$from,c=s.empty;if(s instanceof Ve){if(!i.endOfTextblock(n)||a.depth==0)return!1;c=!1,a=r.doc.resolve(t>0?a.after():a.before())}let u=Kt.findGapCursorFrom(a,t,c);return u?(o&&o(r.tr.setSelection(new Kt(u))),!0):!1}}function ACe(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!Kt.valid(r))return!1;let o=e.posAtCoords({left:n.clientX,top:n.clientY});return o&&o.inside>-1&&je.isSelectable(e.state.doc.nodeAt(o.inside))?!1:(e.dispatch(e.state.tr.setSelection(new Kt(r))),!0)}function BCe(e,t){if(t.inputType!="insertCompositionText"||!(e.state.selection instanceof Kt))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let o=se.empty;for(let s=r.length-1;s>=0;s--)o=se.from(r[s].createAndFill(null,o));let i=e.state.tr.replace(n.pos,n.pos,new ye(o,0,0));return i.setSelection(Ve.near(i.doc.resolve(n.pos+1))),e.dispatch(i),!1}function FCe(e){if(!(e.selection instanceof Kt))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",vn.create(e.doc,[Ro.widget(e.selection.head,t,{key:"gapcursor"})])}const VCe=Sr.create({name:"gapCursor",addProseMirrorPlugins(){return[RCe()]},extendNodeSchema(e){var t;const n={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:(t=Ue(Ce(e,"allowGapCursor",n)))!==null&&t!==void 0?t:null}}}),HCe=qr.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:e}){return["br",kt(this.options.HTMLAttributes,e)]},renderText(){return` -`},addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{selection:o,storedMarks:i}=n;if(o.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:a}=r.extensionManager,c=i||o.$to.parentOffset&&o.$from.marks();return t().insertContent({type:this.name}).command(({tr:u,dispatch:f})=>{if(f&&c&&s){const h=c.filter(m=>a.includes(m.type.name));u.ensureMarks(h)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),WCe=qr.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,kt(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,"paragraph",e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>Fx({find:new RegExp(`^(#{1,${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}});var Ey=200,Mn=function(){};Mn.prototype.append=function(t){return t.length?(t=Mn.from(t),!this.length&&t||t.length=n?Mn.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))};Mn.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};Mn.prototype.forEach=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(t,n,r,0):this.forEachInvertedInner(t,n,r,0)};Mn.prototype.map=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var o=[];return this.forEach(function(i,s){return o.push(t(i,s))},n,r),o};Mn.from=function(t){return t instanceof Mn?t:t&&t.length?new IF(t):Mn.empty};var IF=function(e){function t(r){e.call(this),this.values=r}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(o,i){return o==0&&i==this.length?this:new t(this.values.slice(o,i))},t.prototype.getInner=function(o){return this.values[o]},t.prototype.forEachInner=function(o,i,s,a){for(var c=i;c=s;c--)if(o(this.values[c],a+c)===!1)return!1},t.prototype.leafAppend=function(o){if(this.length+o.length<=Ey)return new t(this.values.concat(o.flatten()))},t.prototype.leafPrepend=function(o){if(this.length+o.length<=Ey)return new t(o.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(Mn);Mn.empty=new IF([]);var UCe=function(e){function t(n,r){e.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(r){return ra&&this.right.forEachInner(r,Math.max(o-a,0),Math.min(this.length,i)-a,s+a)===!1)return!1},t.prototype.forEachInvertedInner=function(r,o,i,s){var a=this.left.length;if(o>a&&this.right.forEachInvertedInner(r,o-a,Math.max(i,a)-a,s+a)===!1||i=i?this.right.slice(r-i,o-i):this.left.slice(r,i).append(this.right.slice(0,o-i))},t.prototype.leafAppend=function(r){var o=this.right.leafAppend(r);if(o)return new t(this.left,o)},t.prototype.leafPrepend=function(r){var o=this.left.leafPrepend(r);if(o)return new t(o,this.right)},t.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new t(this.left,new t(this.right,r)):new t(this,r)},t}(Mn);const ZCe=500;class ei{constructor(t,n){this.items=t,this.eventCount=n}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let o,i;n&&(o=this.remapping(r,this.items.length),i=o.maps.length);let s=t.tr,a,c,u=[],f=[];return this.items.forEach((h,m)=>{if(!h.step){o||(o=this.remapping(r,m+1),i=o.maps.length),i--,f.push(h);return}if(o){f.push(new Si(h.map));let v=h.step.map(o.slice(i)),y;v&&s.maybeStep(v).doc&&(y=s.mapping.maps[s.mapping.maps.length-1],u.push(new Si(y,void 0,void 0,u.length+f.length))),i--,y&&o.appendMap(y,i)}else s.maybeStep(h.step);if(h.selection)return a=o?h.selection.map(o.slice(i)):h.selection,c=new ei(this.items.slice(0,r).append(f.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:s,selection:a}}addTransform(t,n,r,o){let i=[],s=this.eventCount,a=this.items,c=!o&&a.length?a.get(a.length-1):null;for(let f=0;fYCe&&(a=GCe(a,u),s-=u),new ei(a.append(i),s)}remapping(t,n){let r=new Jc;return this.items.forEach((o,i)=>{let s=o.mirrorOffset!=null&&i-o.mirrorOffset>=t?r.maps.length-o.mirrorOffset:void 0;r.appendMap(o.map,s)},t,n),r}addMaps(t){return this.eventCount==0?this:new ei(this.items.append(t.map(n=>new Si(n))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],o=Math.max(0,this.items.length-n),i=t.mapping,s=t.steps.length,a=this.eventCount;this.items.forEach(m=>{m.selection&&a--},o);let c=n;this.items.forEach(m=>{let v=i.getMirror(--c);if(v==null)return;s=Math.min(s,v);let y=i.maps[v];if(m.step){let w=t.steps[v].invert(t.docs[v]),P=m.selection&&m.selection.map(i.slice(c+1,v));P&&a++,r.push(new Si(y,w,P))}else r.push(new Si(y))},o);let u=[];for(let m=n;mZCe&&(h=h.compress(this.items.length-r.length)),h}emptyItemCount(){let t=0;return this.items.forEach(n=>{n.step||t++}),t}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,o=[],i=0;return this.items.forEach((s,a)=>{if(a>=t)o.push(s),s.selection&&i++;else if(s.step){let c=s.step.map(n.slice(r)),u=c&&c.getMap();if(r--,u&&n.appendMap(u,r),c){let f=s.selection&&s.selection.map(n.slice(r));f&&i++;let h=new Si(u.invert(),c,f),m,v=o.length-1;(m=o.length&&o[v].merge(h))?o[v]=m:o.push(h)}}else s.map&&r--},this.items.length,0),new ei(Mn.from(o.reverse()),i)}}ei.empty=new ei(Mn.empty,0);function GCe(e,t){let n;return e.forEach((r,o)=>{if(r.selection&&t--==0)return n=o,!1}),e.slice(n)}class Si{constructor(t,n,r,o){this.map=t,this.step=n,this.selection=r,this.mirrorOffset=o}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new Si(n.getMap().invert(),n,this.selection)}}}class Ks{constructor(t,n,r,o,i){this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=o,this.prevComposition=i}}const YCe=20;function KCe(e,t,n,r){let o=n.getMeta(Pa),i;if(o)return o.historyState;n.getMeta(JCe)&&(e=new Ks(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return e;if(s&&s.getMeta(Pa))return s.getMeta(Pa).redo?new Ks(e.done.addTransform(n,void 0,r,um(t)),e.undone,SD(n.mapping.maps[n.steps.length-1]),e.prevTime,e.prevComposition):new Ks(e.done,e.undone.addTransform(n,void 0,r,um(t)),null,e.prevTime,e.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),c=e.prevTime==0||!s&&e.prevComposition!=a&&(e.prevTime<(n.time||0)-r.newGroupDelay||!qCe(n,e.prevRanges)),u=s?Dw(e.prevRanges,n.mapping):SD(n.mapping.maps[n.steps.length-1]);return new Ks(e.done.addTransform(n,c?t.selection.getBookmark():void 0,r,um(t)),ei.empty,u,n.time,a??e.prevComposition)}else return(i=n.getMeta("rebased"))?new Ks(e.done.rebased(n,i),e.undone.rebased(n,i),Dw(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new Ks(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),Dw(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function qCe(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((r,o)=>{for(let i=0;i=t[i]&&(n=!0)}),n}function SD(e){let t=[];return e.forEach((n,r,o,i)=>t.push(o,i)),t}function Dw(e,t){if(!e)return null;let n=[];for(let r=0;r{let n=Pa.getState(e);return!n||n.done.eventCount==0?!1:(t&&DF(n,e,t,!1),!0)},LF=(e,t)=>{let n=Pa.getState(e);return!n||n.undone.eventCount==0?!1:(t&&DF(n,e,t,!0),!0)},XCe=Sr.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>jF(e,t),redo:()=>({state:e,dispatch:t})=>LF(e,t)}},addProseMirrorPlugins(){return[QCe(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-Z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-Y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Shift-Mod-Z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),eke=qr.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:e}){return["hr",kt(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{const{$to:n}=t.selection,r=e();return n.parentOffset===0?r.insertContentAt(Math.max(n.pos-2,0),{type:this.name}):r.insertContent({type:this.name}),r.command(({tr:o,dispatch:i})=>{var s;if(i){const{$to:a}=o.selection,c=a.end();if(a.nodeAfter)a.nodeAfter.isTextblock?o.setSelection(Ve.create(o.doc,a.pos+1)):a.nodeAfter.isBlock?o.setSelection(je.create(o.doc,a.pos)):o.setSelection(Ve.create(o.doc,a.pos));else{const u=(s=a.parent.type.contentMatch.defaultType)===null||s===void 0?void 0:s.create();u&&(o.insert(c,u),o.setSelection(Ve.create(o.doc,c+1)))}o.scrollIntoView()}return!0}).run()}}},addInputRules(){return[eF({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),tke=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,nke=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,rke=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,oke=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,ike=sr.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>e.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",kt(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Al({find:tke,type:this.type}),Al({find:rke,type:this.type})]},addPasteRules(){return[Na({find:nke,type:this.type}),Na({find:oke,type:this.type})]}}),ske=qr.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",kt(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),ake=qr.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",kt(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),OD=sr.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:e=>e.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["span",kt(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:e,commands:t})=>{const n=sh(e,this.type);return Object.entries(n).some(([,o])=>!!o)?!0:t.unsetMark(this.name)}}}}),CD=/^(\d+)\.\s$/,lke=qr.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return t===1?["ol",kt(this.options.HTMLAttributes,n),0]:["ol",kt(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(ake.name,this.editor.getAttributes(OD.name)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=$f({find:CD,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=$f({find:CD,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(OD.name)}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1],editor:this.editor})),[e]}}),cke=qr.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",kt(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),uke=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,dke=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,fke=sr.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["s",kt(this.options.HTMLAttributes,e),0]},addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){const e={};return IO()?e["Mod-Shift-s"]=()=>this.editor.commands.toggleStrike():e["Ctrl-Shift-s"]=()=>this.editor.commands.toggleStrike(),e},addInputRules(){return[Al({find:uke,type:this.type})]},addPasteRules(){return[Na({find:dke,type:this.type})]}}),hke=qr.create({name:"text",group:"inline"}),RF=Sr.create({name:"starterKit",addExtensions(){var e,t,n,r,o,i,s,a,c,u,f,h,m,v,y,w,P,b;const S=[];return this.options.blockquote!==!1&&S.push(vCe.configure((e=this.options)===null||e===void 0?void 0:e.blockquote)),this.options.bold!==!1&&S.push(xCe.configure((t=this.options)===null||t===void 0?void 0:t.bold)),this.options.bulletList!==!1&&S.push(PCe.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&S.push(kCe.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&S.push(MCe.configure((o=this.options)===null||o===void 0?void 0:o.codeBlock)),this.options.document!==!1&&S.push(NCe.configure((i=this.options)===null||i===void 0?void 0:i.document)),this.options.dropcursor!==!1&&S.push(DCe.configure((s=this.options)===null||s===void 0?void 0:s.dropcursor)),this.options.gapcursor!==!1&&S.push(VCe.configure((a=this.options)===null||a===void 0?void 0:a.gapcursor)),this.options.hardBreak!==!1&&S.push(HCe.configure((c=this.options)===null||c===void 0?void 0:c.hardBreak)),this.options.heading!==!1&&S.push(WCe.configure((u=this.options)===null||u===void 0?void 0:u.heading)),this.options.history!==!1&&S.push(XCe.configure((f=this.options)===null||f===void 0?void 0:f.history)),this.options.horizontalRule!==!1&&S.push(eke.configure((h=this.options)===null||h===void 0?void 0:h.horizontalRule)),this.options.italic!==!1&&S.push(ike.configure((m=this.options)===null||m===void 0?void 0:m.italic)),this.options.listItem!==!1&&S.push(ske.configure((v=this.options)===null||v===void 0?void 0:v.listItem)),this.options.orderedList!==!1&&S.push(lke.configure((y=this.options)===null||y===void 0?void 0:y.orderedList)),this.options.paragraph!==!1&&S.push(cke.configure((w=this.options)===null||w===void 0?void 0:w.paragraph)),this.options.strike!==!1&&S.push(fke.configure((P=this.options)===null||P===void 0?void 0:P.strike)),this.options.text!==!1&&S.push(hke.configure((b=this.options)===null||b===void 0?void 0:b.text)),S}}),zF=sr.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["u",kt(this.options.HTMLAttributes,e),0]},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),AF=Sr.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:"left"}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:e=>e.style.textAlign||this.options.defaultAlignment,renderHTML:e=>e.textAlign===this.options.defaultAlignment?{}:{style:`text-align: ${e.textAlign}`}}}}]},addCommands(){return{setTextAlign:e=>({commands:t})=>this.options.alignments.includes(e)?this.options.types.every(n=>t.updateAttributes(n,{textAlign:e})):!1,unsetTextAlign:()=>({commands:e})=>this.options.types.every(t=>e.resetAttributes(t,"textAlign"))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),BF=sr.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(e){return e!=="super"?!1:null}}]},renderHTML({HTMLAttributes:e}){return["sup",kt(this.options.HTMLAttributes,e),0]},addCommands(){return{setSuperscript:()=>({commands:e})=>e.setMark(this.name),toggleSuperscript:()=>({commands:e})=>e.toggleMark(this.name),unsetSuperscript:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),FF=sr.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(e){return e!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:e}){return["sub",kt(this.options.HTMLAttributes,e),0]},addCommands(){return{setSubscript:()=>({commands:e})=>e.setMark(this.name),toggleSubscript:()=>({commands:e})=>e.toggleMark(this.name),unsetSubscript:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),pke=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,VF=qr.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:e}){return["img",kt(this.options.HTMLAttributes,e)]},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[eF({find:pke,type:this.type,getAttributes:e=>{const[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}}),HF=sr.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:e=>e.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["span",kt(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:e,commands:t})=>{const n=sh(e,this.type);return Object.entries(n).some(([,o])=>!!o)?!0:t.unsetMark(this.name)}}}}),WF=Sr.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:e=>{var t;return(t=e.style.color)===null||t===void 0?void 0:t.replace(/['"]+/g,"")},renderHTML:e=>e.color?{style:`color: ${e.color}`}:{}}}}]},addCommands(){return{setColor:e=>({chain:t})=>t().setMark("textStyle",{color:e}).run(),unsetColor:()=>({chain:e})=>e().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),mke=ue({saveButton:{position:"absolute",top:5,right:5,zIndex:99}}),lh=({content:e="

",onChange:t,styles:n,contentAreaStyle:r,onSave:o})=>{const{classes:i}=mke(),[s,a]=_.useState(!1),c=tF({content:e,extensions:[RF,zF,NF,BF,FF,TF,WF,HF,VF,AF.configure({types:["heading","paragraph"]})]});return _.useEffect(()=>{c?.commands.setContent(e,!0)},[e]),_.useEffect(()=>{if(t&&t(c?.getHTML()),!o)return;const u=setTimeout(()=>{c?.getHTML()!==e?a(!0):a(!1)},500);return()=>clearTimeout(u)},[c?.getHTML()]),p.jsx(p.Fragment,{children:p.jsxs(Ee,{editor:c,styles:n,style:{borderRadius:2},children:[p.jsxs(Ee.Toolbar,{sticky:!0,children:[p.jsxs(Ee.ControlsGroup,{children:[p.jsx(Ee.Bold,{}),p.jsx(Ee.Italic,{}),p.jsx(Ee.Underline,{}),p.jsx(Ee.Strikethrough,{}),p.jsx(Ee.ClearFormatting,{}),p.jsx(Ee.Highlight,{})]}),p.jsxs(Ee.ControlsGroup,{children:[p.jsx(Ee.Hr,{}),p.jsx(Ee.BulletList,{}),p.jsx(Ee.OrderedList,{})]}),p.jsxs(Ee.ControlsGroup,{children:[p.jsx(Ee.Link,{}),p.jsx(Ee.Unlink,{})]}),p.jsxs(Ee.ControlsGroup,{children:[p.jsx(Ee.AlignLeft,{}),p.jsx(Ee.AlignCenter,{}),p.jsx(Ee.AlignJustify,{}),p.jsx(Ee.AlignRight,{})]}),p.jsx(Ee.ControlsGroup,{children:p.jsx(Ee.ColorPicker,{colors:["#25262b","#868e96","#fa5252","#e64980","#be4bdb","#7950f2","#4c6ef5","#228be6","#15aabf","#12b886","#40c057","#82c91e","#fab005","#fd7e14"]})})]}),c&&p.jsxs(At,{style:r,children:[p.jsx($s,{mounted:!!(s&&o),transition:"slide-down",children:u=>p.jsx(Xe,{style:u,className:i.saveButton,color:"dark",variant:"default",size:26,onClick:()=>{a(!1),o&&o(c?.getHTML())},children:p.jsx(t7,{size:20})})}),p.jsx(Ee.Content,{})]})]})})},gke=[{contents:"Dsadaasd Hello there buddy, this is a message from the server.",id:1,playerId:1,position:[0,0,0],callsign:132,firstname:"Fdsadas",lastname:"DSasd",citizenid:"dsadas",image:"https://cdn.vectorstock.com/i/preview-1x/97/68/account-avatar-dark-mode-glyph-ui-icon-vector-44429768.jpg",createdAt:Date.now()-3e5},{contents:"Dsadaasd Hello there buddy, this is a message from the server.",id:2,playerId:1,position:[0,0,0],callsign:132,firstname:"Fdsadas",lastname:"DSasd",citizenid:"dsadas",image:"https://cdn.vectorstock.com/i/preview-1x/97/68/account-avatar-dark-mode-glyph-ui-icon-vector-44429768.jpg",createdAt:Date.now()-9e5},{contents:"Dsadaasd Hello there buddy, this is a message from the server.",id:3,playerId:1,position:[0,0,0],callsign:132,firstname:"Fdsadas",lastname:"DSasd",citizenid:"dsadas",image:"https://cdn.vectorstock.com/i/preview-1x/97/68/account-avatar-dark-mode-glyph-ui-icon-vector-44429768.jpg",createdAt:Date.now()-12e20},{contents:"Dsadaasd Hello there buddy",id:4,playerId:1,position:[0,0,0],callsign:132,firstname:"fad",lastname:"DSasd",citizenid:"dsadas",image:"https://cdn.vectorstock.com/i/preview-1x/97/68/account-avatar-dark-mode-glyph-ui-icon-vector-44429768.jpg",createdAt:Date.now()},{contents:"Dsadaasd Hello there buddy",id:5,playerId:1,position:[0,0,0],callsign:132,firstname:"fad",lastname:"DSasd",citizenid:"dsadas",image:"https://cdn.vectorstock.com/i/preview-1x/97/68/account-avatar-dark-mode-glyph-ui-icon-vector-44429768.jpg",createdAt:Date.now()}],UO=tn(e=>({announcements:[],fetchAnnouncements:async()=>{if(it())e({announcements:[...gke]});else{const t=await me("getAnnouncements");e({announcements:[...t.announcements]})}}})),vke=()=>{const{fetchAnnouncements:e}=UO(s=>({fetchAnnouncements:s.fetchAnnouncements})),[t,n]=_.useState(!1),[r,o]=_.useState(""),i=async()=>{if(!it()){if(n(!0),!await me("createAnnouncement",{contents:r}))return;e(),n(!1)}ke.closeAll()};return p.jsxs(Je,{h:400,style:{flex:"0 0 43.5rem"},children:[p.jsx(lh,{content:"",onChange:s=>o(s||""),styles:{content:{backgroundColor:"#1A1B1E"},toolbar:{backgroundColor:"#2C2E33"},controlsGroup:{pointerEvents:"auto",backgroundColor:"#282828"}},contentAreaStyle:{height:270,width:406,padding:0}}),p.jsx(at,{variant:"light",color:"gray",fullWidth:!0,onClick:()=>i(),loading:t,children:j.create})]})},yke=e=>{const t=tF({extensions:[RF,zF,NF,BF,FF,TF,WF,HF,VF,AF],content:e.contents,editable:!1});return p.jsx(Je,{children:p.jsx(Ee,{editor:t,children:p.jsx(Ee.Content,{})})})};he.extend(E7);const UF=({announcement:e})=>{const t=`

${e.contents}

`;function n(r){return r.replace(/<\/?[^>]+(>|$)/g,"")}return p.jsxs("div",{className:"announcement-list-card",onClick:()=>{ke.open({title:p.jsxs(U,{style:{fontSize:16,color:"white"},weight:500,children:[`${e.firstname} ${e.lastname}`," |"," ",he(e.createdAt).fromNow()]}),centered:!0,children:p.jsx(yke,{contents:t})})},children:[p.jsx(nt,{position:"apart",children:p.jsxs(nt,{children:[p.jsx(WP,{color:"blue",src:e.image}),p.jsxs(Je,{spacing:0,children:[p.jsx(U,{fw:500,c:"white",children:`${e.firstname} ${e.lastname}`}),p.jsx(U,{size:"xs",c:"dark.2",children:he(e.createdAt).fromNow()})]})]})}),p.jsx(U,{c:"gray.4",size:"sm",lineClamp:1,children:n(t)})]})},_ke=()=>{const{announcements:e}=UO(n=>({announcements:n.announcements})),t=[...e].sort((n,r)=>Number(new Date(r.createdAt))-Number(new Date(n.createdAt)));return p.jsx(At,{h:600,children:p.jsx("div",{className:"announcement-card-content",children:t.length>0?t.map(n=>p.jsx(UF,{announcement:n},n.id)):p.jsx(U,{color:"dimmed",size:"xs",children:j.no_announcements_found})})})},wke=4,bke=4,xke=4,Ske=4,Pke=4,Oke=4,Cke=4,kke=4,kD={create_announcement:wke,create_charge:bke,delete_charge:xke,edit_charge:Ske,hire_officer:Pke,set_officer_rank:Oke,set_officer_roles:Cke,fire_officer:kke},gn=(e,t)=>{if(!Array.isArray(t)){const r=kD[t];return e.grade>=r}let n=0;for(let r=0;r{const{announcements:e,fetchAnnouncements:t}=UO(s=>({announcements:s.announcements,fetchAnnouncements:s.fetchAnnouncements})),[n,r]=_.useState(!1),{personalData:o}=Gr(),i=[...e].sort((s,a)=>Number(new Date(a.createdAt))-Number(new Date(s.createdAt))).slice(0,3);return _.useEffect(()=>{r(!0),(async()=>await t())().then(()=>{r(!1)})},[]),p.jsxs("div",{className:"card-background",children:[p.jsxs("div",{className:"card-title",children:[p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:j.announcements}),p.jsxs("div",{className:"card-title-icons",children:[p.jsx(zt,{label:j.create_announcement,withArrow:!0,color:"gray",position:"bottom",children:p.jsx(Xe,{variant:"light",color:"dark",disabled:!gn(o,"create_announcement"),onClick:()=>{ke.open({title:p.jsx(U,{style:{fontSize:16,color:"white"},weight:500,children:j.create_announcement}),centered:!0,children:p.jsx(vke,{})})},children:p.jsx(Iu,{size:16,color:"white"})})}),p.jsx(zt,{label:j.view_all,withArrow:!0,color:"gray",position:"bottom",children:p.jsx(Xe,{variant:"light",color:"dark",onClick:()=>{ke.open({title:p.jsx(U,{style:{fontSize:16,color:"white"},weight:500,children:j.all_announcements}),centered:!0,children:p.jsx(_ke,{})})},children:p.jsx(yme,{size:16,color:"white"})})}),p.jsx(Nme,{size:M(25),color:"white"})]})]}),p.jsx(Ye,{mt:5,mb:5}),p.jsx("div",{className:"announcement-card-content",children:n?p.jsx(Zr,{h:"100%",children:p.jsx(en,{})}):i.length>0?i.map(s=>p.jsx(UF,{announcement:s},s.id)):p.jsx(U,{color:"dimmed",size:"xs",children:j.no_announcements_found})})]})},$ke=[{citizenid:"AF30442",firstname:"Billy",lastname:"Bob",incidentid:3,expiresAt:Date.now(),image:"https://i.imgur.com/dqopYB9b.jpg"},{citizenid:"AF30442",firstname:"Billy",lastname:"Bob",incidentid:3,expiresAt:Date.now(),image:"https://i.imgur.com/dqopYB9b.jpg"},{citizenid:"AF30442",firstname:"Billy",lastname:"Bob",incidentid:3,expiresAt:Date.now(),image:"https://i.imgur.com/dqopYB9b.jpg"},{citizenid:"AF30442",firstname:"Billy",lastname:"Bob",incidentid:3,expiresAt:Date.now(),image:"https://i.imgur.com/dqopYB9b.jpg"},{citizenid:"AF30442",firstname:"Billy",lastname:"Bob",incidentid:3,expiresAt:Date.now(),image:"https://i.imgur.com/dqopYB9b.jpg"},{citizenid:"AF30442",firstname:"Billy",lastname:"Bob",incidentid:3,expiresAt:Date.now(),image:"https://i.imgur.com/dqopYB9b.jpg"}],Mke=tn(e=>({warrants:it()?$ke:[],getWarrants:async()=>{try{const t=await me("getWarrants");return e({warrants:t}),{warrants:t}}catch(t){return console.error("Failed to fetch recent activities:",t),{warrants:[]}}},setWarrants:t=>e({warrants:t})})),Nke=()=>{const{warrants:e,getWarrants:t}=Mke(),[n,r]=_.useState(!1),o=Kl(),{setActiveIncident:i,setIncidentActive:s}=Yr();return _.useEffect(()=>{r(!0),(async()=>{t()})().then(()=>{r(!1)})},[]),p.jsxs("div",{className:"card-background",children:[p.jsxs("div",{className:"card-title",children:[p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:j.active_warrants}),p.jsx(Rme,{size:M(25),color:"white"})]}),p.jsx(Ye,{mt:5,mb:5}),p.jsx(At,{h:290,children:p.jsx("div",{className:"warrants-card-content",children:n?p.jsx(Zr,{h:"100%",children:p.jsx(en,{})}):e.length>0?e.map(a=>p.jsx(nt,{position:"apart",className:"warrants-card",onClick:async()=>{if(it())return;const c=await me("getIncident",a.incidentid);i(c),s(!0),o("/incidents")},children:p.jsxs(nt,{children:[p.jsx(WP,{color:"blue",src:a.image}),p.jsxs(Je,{spacing:0,children:[p.jsx(U,{fw:500,c:"white",children:`${a.firstname} ${a.lastname}`}),p.jsxs(U,{size:"xs",c:"dark.2",children:[j.expires_in,":"," ",he().to(a.expiresAt,!0)]})]})]})})):p.jsx(U,{color:"dimmed",size:"xs",children:j.no_warrants_found})})})]})},Pu=e=>e?Object.entries(e).map(t=>({id:+t[0],...t[1]})):[],Tke=e=>Array.isArray(e)?e.map(t=>({...t,units:Pu(t.units)})):Object.entries(e).map(t=>{const n={...t[1],units:[]};return n.units=Pu(t[1].units),n}),Od=e=>e.length===0?e:e.charAt(0).toUpperCase()+e.slice(1),Ike=[{id:1,time:Date.now(),location:"Somewhere",coords:[350,350],linked:!1,offense:"Bank robbery",code:"10-29",blip:162,units:[{name:"Unit 132",type:"car",members:[{firstname:"Billy",lastname:"Bob",callsign:132,citizenid:"321553",playerId:1,position:[0,0,0]}],id:132},{name:"Unit 322",type:"heli",members:[{firstname:"Marc",lastname:"Marshall",callsign:322,citizenid:"451503",playerId:1,position:[0,0,0]}],id:322}]},{id:2,time:Date.now(),location:"Somewhere",info:[{label:"Sultan RS",icon:"gun"},{label:"XYZ 123",icon:"badge-tm"}],coords:[255,150],blip:51,linked:!1,offense:"Officer Down",code:"10-13",units:[{name:"Unit 132",type:"car",members:[{firstname:"Billy",lastname:"Bob",callsign:132,citizenid:"311342",playerId:1,position:[0,0,0]},{firstname:"Martin",lastname:"Contreras",callsign:521,citizenid:"912132",playerId:1,position:[0,0,0]}],id:132},{name:"Unit 823",type:"heli",members:[{firstname:"Bobby",lastname:"Hopkins",callsign:823,citizenid:"100341",playerId:1,position:[0,0,0]}],id:823},{name:"Unit 531",type:"motor",members:[{firstname:"Connor",lastname:"Collins",callsign:531,citizenid:"913213",playerId:1,position:[0,0,0]}],id:531},{name:"Unit 274",type:"boat",members:[{firstname:"Corey",lastname:"Hayes",callsign:274,citizenid:"920132",playerId:1,position:[0,0,0]}],id:274}]},{id:3,time:Date.now(),location:"Somewhere",coords:[500,750],linked:!1,blip:310,offense:"Officer Down",code:"10-13",units:[{name:"Unit 1",type:"car",members:[{firstname:"Billy",lastname:"bob",callsign:132,citizenid:"913213",playerId:1,position:[0,0,0]}],id:136},{name:"Unit 6",type:"heli",members:[{firstname:"Freddie",lastname:"Reid",callsign:823,citizenid:"920132",playerId:2,position:[0,0,0]}],id:823}]}],Dke=async()=>{if(it())return Ike;const e=await me("getCalls");return Tke(e)},ju=tn(e=>({calls:[],fetchCalls:async()=>{const t=await Dke();e({calls:t})},updateCallUnits:(t,n)=>{e(r=>{const o=r.calls.findIndex(s=>s.id===t);if(o===-1)return r;const i=[...r.calls];return i[o]={...i[o],units:n},{calls:i}})},addCall:t=>{e(n=>({calls:[t,...n.calls]}))},setCalls:t=>e({calls:t})})),ZF=()=>ju(e=>e.calls),jke=()=>ju(e=>e.fetchCalls),Lke=()=>{const{calls:e,fetchCalls:t}=ju(),[n,r]=_.useState(!1),o=Kl();_.useEffect(()=>{r(!0),(async()=>{t()})().then(()=>{r(!1)})},[]);const i=_.useMemo(()=>e.sort((s,a)=>a.id-s.id),[e]);return p.jsxs("div",{className:"card-background",children:[p.jsxs("div",{className:"card-title",children:[p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:j.dispatch}),p.jsx($me,{size:M(25),color:"white"})]}),p.jsx(Ye,{mt:5,mb:5}),p.jsx(At,{h:330,children:p.jsx("div",{className:"warrants-card-content",children:n?p.jsx(Zr,{h:"100%",children:p.jsx(en,{})}):i.length>0?i.map(s=>p.jsx("div",{className:"active-dispatchcall-card",onClick:()=>{o("/dispatch")},children:p.jsxs(nt,{style:{width:"100%"},children:[p.jsxs("div",{style:{flex:1},children:[p.jsxs(U,{style:{fontSize:13,color:"white"},weight:500,children:["(",s.code,") ",s.offense]}),p.jsxs("div",{style:{display:"flex",gap:5},children:[p.jsx(Z0,{size:16,color:"#C1C2C5"}),p.jsx(U,{color:"dimmed",size:"xs",children:he(s.time).fromNow()})]})]}),p.jsxs(U,{color:"dimmed",size:"xs",children:[j.responding_units,": ",s.units.length]})]})})):p.jsx(U,{color:"dimmed",size:"xs",children:j.no_recent_calls_found})})})]})},Rke=[{plate:"AF30442",reason:"This vehicle is wanted because its been a part of a murder and we need to confiscate it to check for evidence",expiresAt:he(new Date).format("DD-MM-YYYY")},{plate:"AF30442",reason:"Billy",expiresAt:he(new Date).format("DD-MM-YYYY")}],zke=tn(e=>({bolos:it()?Rke:[],getBolos:async()=>{try{const t=await me("getBolos");return e({bolos:t}),{bolos:t}}catch(t){return console.error("Failed to fetch recent activities:",t),{bolos:[]}}},setBolos:t=>e({bolos:t})})),GF=[];for(let e=0;e<25;e++)GF[e]={plate:`44HJJO263${e+1}`,model:"Adder"};const ZO={plate:"44HJJO263",model:"gauntlet2",owner:"John Doe (ABC123AW)",color:"Red",notes:"string",class:"Muscle",knownInformation:["Gaunlet"]},GO={plate:"44HJJO263",model:"sultan3",owner:"John Doe (ABC123AW)",color:"Black",notes:"string",class:"Super",knownInformation:["Adder"]},Lu=tn(e=>({selectedVehicle:null,isVehicleBOLO:!1,BOLOExpirationDate:"",getVehicles:async()=>it()?GF:await me("getAllVehicles"),setSelectedVehicle:t=>{it()&&e({selectedVehicle:Math.random()*10>5?ZO:GO}),e({selectedVehicle:t})},setIsVehicleBOLO(t){e({isVehicleBOLO:t})},setBOLOExpirationDate(t){e({BOLOExpirationDate:t})}})),Ake=e=>{const{setSelectedVehicle:t,setIsVehicleBOLO:n,setBOLOExpirationDate:r}=Lu(),o=Math.random()*10>5?ZO:GO,i=Kl();return p.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[p.jsx(Ye,{}),p.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[p.jsx(U,{style:{fontSize:18,color:"white"},weight:500,children:j.reason}),p.jsx(U,{c:"gray.4",size:"sm",children:e.bolo.reason}),p.jsxs(U,{c:"dimmed",size:"xs",mt:5,children:[j.expires_at," ",e.bolo.expiresAt]})]}),p.jsx(Ye,{}),p.jsx("div",{style:{display:"flex",flexDirection:"column",gap:10,alignItems:"center",width:"100%",justifyContent:"center"},children:p.jsx(at,{variant:"light",color:"gray",w:200,onClick:async()=>{t(null);const s=await me("getVehicle",{plate:e.bolo.plate},{data:{...o}}),a=await me("isVehicleBOLO",{plate:e.bolo.plate},{data:!1});if(a){const c=await me("getBOLOExpirationDate",{plate:e.bolo.plate},{data:"12/12/2024"});r(c)}t(s),n(a),i("/vehicles"),ke.closeAll()},children:j.goto_vehicle})})]})},Bke=()=>{const{bolos:e,getBolos:t}=zke(),[n,r]=_.useState(!1);return _.useEffect(()=>{r(!0),(async()=>{t()})().then(()=>{r(!1)})},[]),p.jsxs("div",{className:"card-background",children:[p.jsxs("div",{className:"card-title",children:[p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:j.bolos}),p.jsx(Fme,{size:M(25),color:"white"})]}),p.jsx(Ye,{mt:5,mb:5}),p.jsx(At,{h:290,children:p.jsx("div",{className:"warrants-card-content",children:n?p.jsx(Zr,{h:"100%",children:p.jsx(en,{})}):e.length>0?e.map(o=>p.jsx("div",{className:"bolos-card",onClick:async()=>{const i=await me("getBolo",{plate:o.plate},{data:{plate:"ABCDEFG",reason:"A pretty nice and cool reason",expiresAt:he(new Date).format("DD-MM-YYYY")}});ke.open({title:p.jsxs("div",{style:{display:"flex",gap:10,alignItems:"center"},children:[p.jsx(mx,{size:20,color:"#C1C2C5"}),p.jsx(U,{style:{fontSize:16,color:"white"},weight:500,children:i.plate})]}),centered:!0,children:p.jsx(Ake,{bolo:i})})},children:p.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:5,width:"100%"},children:[p.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[p.jsxs("div",{style:{display:"flex",gap:5,alignItems:"center"},children:[p.jsx(mx,{size:20,color:"#C1C2C5"}),p.jsx(U,{style:{fontSize:13,color:"white"},weight:500,children:o.plate})]}),p.jsxs(U,{color:"dimmed",size:"xs",children:[j.expires_at," ",o.expiresAt]})]}),p.jsx(U,{c:"gray.4",size:"xs",lineClamp:2,children:o.reason})]})})):p.jsx(U,{color:"dimmed",size:"xs",children:j.no_bolos_found})})})]})},Fke=()=>{const{config:e}=nh(),{firstname:t,lastname:n}=Gr(i=>i.personalData),{activeOfficers:r,getActiveOfficers:o}=mO();return _.useEffect(()=>{o()},[]),p.jsxs("div",{className:"dashboard",children:[p.jsxs("div",{className:"left-side",children:[p.jsxs("div",{className:"header",children:[p.jsx(U,{style:{fontSize:24,color:"white"},weight:500,children:j.welcome_back.format(t,n)}),p.jsxs(U,{color:"dimmed",size:"xs",style:{display:"flex",gap:10},children:[p.jsx(tO,{size:M(18)})," ",p.jsx(U,{color:"dimmed",size:14,children:new Date().toLocaleDateString("en-EN",{weekday:"long",year:"numeric",month:"long",day:"numeric"})})]})]}),p.jsx(Ye,{}),p.jsx(C1e,{}),p.jsxs("div",{className:"content-bottom",children:[p.jsx(Nke,{}),p.jsx(Eke,{}),p.jsx(Bke,{})]})]}),p.jsx(Ye,{orientation:"vertical"}),p.jsxs("div",{className:"right-side",children:[p.jsx("div",{className:"card-background",children:p.jsxs(At,{h:400,children:[p.jsxs("div",{className:"card-title",children:[p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:j.active_officers}),p.jsxs("div",{className:"right-side-title",children:[p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:r.length}),p.jsx(q0,{size:M(20),color:"white"})]})]}),p.jsx(Ye,{mt:5,mb:5}),p.jsx("div",{className:"card-content",children:r.length>0?p.jsx("div",{className:"active-officers-cards",children:r.map(i=>p.jsx("div",{className:"active-officer-card",children:p.jsxs(nt,{style:{width:"100%"},children:[p.jsxs("div",{style:{flex:1},children:[p.jsxs(U,{style:{fontSize:13,color:"white"},weight:500,children:[i.firstname," ",i.lastname]}),p.jsxs(U,{color:"dimmed",size:"xs",children:[j.callsign,": ",i.callsign]})]}),p.jsxs(U,{color:"dimmed",size:"xs",children:[j.attached_unit,": ",i.unitId||"None"]})]})}))}):p.jsx(U,{color:"dimmed",size:"xs",children:"No active officers"})})]})}),e.isDispatchEnabled&&p.jsx(Lke,{})]})]})};const Vke=e=>p.jsxs("div",{className:"card-background profile-card-info",children:[p.jsxs("div",{className:"card-title",children:[p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:e.title}),typeof e.icon=="string"?p.jsx("i",{className:`ti ti-${e.icon}`,style:{fontSize:24,color:"white"}}):p.jsx(e.icon,{})]}),p.jsx(Ye,{style:{width:"100%"}}),p.jsx("div",{className:"profile-card-info-badges",children:e.children})]}),ED={title:"Debug Report title",id:0,description:"

This is a incident description

",evidence:[],officersInvolved:[{firstname:"Callum",lastname:"Graham",callsign:188,citizenid:"132142",playerId:1,position:[0,0,0]},{firstname:"Jacob",lastname:"Gray",callsign:273,citizenid:"152312",playerId:1,position:[0,0,0]},{firstname:"Edward",lastname:"Atkinson",callsign:125,citizenid:"948213",playerId:1,position:[0,0,0]}],citizensInvolved:[{firstname:"John",lastname:"Doe",citizenid:"BUB193Z4A",dob:Date.now()}]},Vi=tn(e=>({report:ED,isReportActive:!1,setActiveReport:t=>{it()&&e({report:ED}),e({report:t})},setReportActive:t=>{e({isReportActive:t})},setDescription:t=>{e(n=>({report:{...n.report,description:t}}))},setOfficersInvolved:t=>{e(n=>({report:{...n.report,officersInvolved:typeof t=="function"?t(n.report.officersInvolved):t}}))},setCitizensInvolved:t=>{e(n=>({report:{...n.report,citizensInvolved:typeof t=="function"?t(n.report.citizensInvolved):t}}))},setEvidence:t=>{e(n=>({report:{...n.report,evidence:typeof t=="function"?t(n.report.evidence):t}}))}})),Hke=()=>{const{setActiveReport:e,setReportActive:t}=Vi(),n=bs(u=>u.selectedProfile),r=bs(u=>u.profileCards),{setActiveIncident:o,setIncidentActive:i}=Yr(),s=Kl();if(!n)return p.jsx("div",{className:"content-width",children:p.jsx("div",{className:"card-background",children:p.jsxs("div",{className:"profile-no-selected",children:[p.jsx(lO,{size:M(50),color:"white"}),p.jsx(U,{style:{fontSize:15,color:"white"},weight:600,children:j.no_profile_selected})]})})});async function a(u){if(it())return s("/reports");const f=await me("getReport",u);e(f),t(!0),s("/reports")}async function c(u){if(it())return s("/incidents");const f=await me("getIncident",u);o(f),i(!0),s("/incidents")}return p.jsx("div",{className:"content-width",children:p.jsx(At,{h:860,children:p.jsxs("div",{className:"additional-profile-info",children:[r.map(u=>p.jsx(Vke,{title:u.title,icon:u.icon,children:p.jsx("div",{className:"profile-card-info-badges",children:n[u.id]?n[u.id].map(f=>p.jsx(mt,{color:"gray",variant:"filled",className:"profile-info-badge",radius:"md",children:f},f)):p.jsx(U,{color:"dimmed",size:"xs",children:j.no_cardid_registered.format(u.id)})})})),p.jsxs("div",{className:"card-background profile-card-info",children:[p.jsxs("div",{className:"card-title",children:[p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:j.related_reports}),p.jsx(rO,{size:M(25),color:"white"})]}),p.jsx(Ye,{style:{width:"100%"}}),n.relatedReports&&(n.relatedReports.length>0?n.relatedReports.map(u=>p.jsxs("div",{className:"related-reports-card",onClick:()=>{a(u.id)},children:[p.jsx(U,{style:{fontSize:15,color:"white"},weight:500,children:u.title}),p.jsxs("div",{className:"related-reports-extra-info",children:[p.jsxs(U,{style:{fontSize:12},weight:500,color:"dimmed",children:[u.author," - Date: ",u.date]}),p.jsxs(U,{style:{fontSize:12},weight:500,color:"dimmed",children:["#",u.id]})]})]},u.id)):p.jsx(U,{color:"dimmed",size:"xs",children:j.no_related_reports}))]}),p.jsxs("div",{className:"card-background profile-card-info",children:[p.jsxs("div",{className:"card-title",children:[p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:j.related_incidents}),p.jsx(sO,{size:M(25),color:"white"})]}),p.jsx(Ye,{style:{width:"100%"}}),n.relatedIncidents&&(n.relatedIncidents.length>0?n.relatedIncidents.map(u=>p.jsxs("div",{className:"related-reports-card",onClick:()=>{c(u.id)},children:[p.jsx(U,{style:{fontSize:15,color:"white"},weight:500,children:u.title}),p.jsxs("div",{className:"related-reports-extra-info",children:[p.jsxs(U,{style:{fontSize:12},weight:500,color:"dimmed",children:[u.author," - Date: ",u.date]}),p.jsxs(U,{style:{fontSize:12},weight:500,color:"dimmed",children:["#",u.id]})]})]},u.id)):p.jsx(U,{color:"dimmed",size:"xs",children:j.no_related_incidents}))]})]})})})},Wke=e=>{const{setSelectedProfile:t,selectedProfile:n}=bs(),r=_.useRef(null),[o,i]=_.useState(!1),s=async()=>{if(!n)return;i(!0);const a=r.current?.value;await me("updateProfileImage",{citizenId:n.citizenid,image:a},{data:1}),t({...n,image:a}),ke.closeAll()};return p.jsxs(Je,{children:[p.jsx(_n,{defaultValue:e.image,ref:r,label:j.image,description:j.avatar_description,placeholder:"https://r2.fivemanage.com/placeholder.jpg"}),p.jsx(at,{variant:"light",color:"gray",onClick:s,loading:o,children:"Confirm"})]})},Uke=()=>{const{selectedProfile:e,setSelectedProfile:t,isProfileWanted:n}=bs(),[r,o]=_.useState(!1);return e?p.jsx("div",{className:"content-width",children:p.jsx("div",{className:"card-background",children:p.jsxs("div",{className:"profile-card-content",children:[p.jsxs("div",{className:"profile-card-header",children:[p.jsxs(U,{style:{fontSize:14,color:"white"},children:[j.edit_citizen," #",e.citizenid]}),p.jsx("div",{className:"profile-card-header-buttons",children:p.jsx(zt,{label:"Unlink",withArrow:!0,color:"gray",position:"bottom",children:p.jsx(Xe,{variant:"filled",color:"gray",onClick:()=>{t(null)},children:p.jsx(Y0,{size:16,color:"white"})})})})]}),p.jsx(Ye,{style:{width:"100%"}}),p.jsxs("div",{className:"profile-card-profile-content",children:[p.jsxs("div",{className:"profile-card-wrapper",children:[p.jsxs("div",{className:"profile-card-image",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),children:[r&&p.jsx(Xe,{style:{position:"absolute",top:5,right:5,zIndex:99},onClick:()=>ke.open({title:p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:j.change_picture}),centered:!0,size:"sm",children:p.jsx(Wke,{image:e.image})}),children:p.jsx(nO,{})}),p.jsx(ai,{width:145,height:180,src:e.image??"https://r2.fivemanage.com/s64hZD0G9WtYHbURWCuSc/placeholder.jpg",radius:"md",alt:"With default placeholder",withPlaceholder:!0}),n&&p.jsx(ai,{className:"watermark",src:"https://r2.fivemanage.com/s64hZD0G9WtYHbURWCuSc/wanted-stamp.png",radius:"md",alt:"With default placeholder",withPlaceholder:!0})]}),p.jsxs("div",{className:"profile-card-inputs",children:[p.jsx(et,{disabled:!0,icon:p.jsx(r7,{size:16}),placeholder:e.citizenid,size:"xs"}),p.jsx(et,{disabled:!0,icon:p.jsx(Bme,{size:16}),placeholder:e.firstname+" "+e.lastname,size:"xs"}),p.jsx(et,{disabled:!0,icon:p.jsx(Qpe,{size:16}),placeholder:he(e.dob).format("DD/MM/YYYY"),size:"xs"}),p.jsx(et,{disabled:!0,icon:p.jsx(rme,{size:16}),placeholder:e.phoneNumber,size:"xs"}),p.jsx(et,{disabled:!0,icon:p.jsx(ame,{size:16}),placeholder:e.fingerprint??"No fingerprint found",size:"xs"})]})]}),p.jsx(Ye,{style:{width:"100%"}}),p.jsx("div",{className:"profile-card-information",children:p.jsx(lh,{content:e.notes,onSave:i=>{t({...e,notes:i}),me("saveProfileNotes",{citizenid:e.citizenid,notes:i})},styles:{content:{backgroundColor:"#242527"},toolbar:{backgroundColor:"#2C2E33"},controlsGroup:{pointerEvents:"auto",backgroundColor:"#282828"}},contentAreaStyle:{height:475,width:413,padding:0}})})]})]})})}):p.jsx("div",{className:"content-width",children:p.jsx("div",{className:"card-background",children:p.jsxs("div",{className:"profile-no-selected",children:[p.jsx(lO,{size:M(50),color:"white"}),p.jsx(U,{style:{fontSize:15,color:"white"},weight:600,children:j.no_profile_selected})]})})})},Zke=(e,t)=>{const n=k.useRef(null),{ref:r,entry:o}=wY({root:n.current,threshold:t||1});return k.useEffect(()=>{o&&o.isIntersecting&&e()},[o]),{ref:r}},Gke=({profile:e},t)=>{const{setIsProfileWanted:n,setSelectedProfile:r}=bs(),o=async i=>{r(null),n(!1);const s=await me("getProfile",i.citizenid,{data:{...pO,firstName:i.firstname,lastName:i.lastname,citizenid:i.citizenid}}),a=await me("isProfileWanted",i.citizenid,{data:!1});r(s),n(a)};return p.jsxs("div",{className:"profile-card",onClick:()=>o(e),ref:t,children:[p.jsx(ai,{width:65,height:65,src:e.image??"https://cdn.vectorstock.com/i/preview-1x/97/68/account-avatar-dark-mode-glyph-ui-icon-vector-44429768.jpg",radius:"lg",alt:"With default placeholder",withPlaceholder:!0}),p.jsxs("div",{children:[p.jsxs(U,{weight:600,style:{fontSize:13,color:"white"},children:[e.firstname," ",e.lastname]}),p.jsxs(U,{style:{fontSize:12,color:"white"},children:[j.dob,": ",he(e.dob).format("DD/MM/YYYY")]}),p.jsxs(U,{style:{fontSize:12,color:"white"},children:[j.citizen_id,": ",e.citizenid]})]})]})},Yke=k.memo(k.forwardRef(Gke)),Kke=()=>{const[e,t]=_.useState(""),{data:n,fetchNextPage:r,isFetching:o,isDebouncing:i}=eve(e),{ref:s}=Zke(()=>r()),a=_.useMemo(()=>n?n.pages.flatMap(c=>c.profiles):[],[n]);return p.jsx("div",{className:"content-width",children:p.jsxs("div",{className:"card-background",children:[p.jsxs("div",{className:"card-title",children:[p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:j.profiles}),p.jsx(cO,{size:M(25),color:"white"})]}),p.jsx(et,{icon:p.jsx(Ra,{}),variant:"filled",placeholder:j.search,mt:10,mb:10,value:e,onChange:c=>t(c.target.value)}),p.jsx(Ye,{mt:5,mb:5}),p.jsx("div",{className:"profiles-card-content",children:p.jsx(At,{h:860,children:p.jsx("div",{className:"profiles-card-content-flex",children:i||o?p.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center"},children:p.jsx(en,{})}):a.length>0?a.map((c,u)=>p.jsx(Yke,{profile:c,ref:u===a.length-2?s:null},c.citizenid)):p.jsx(U,{color:"dimmed",size:"xs",children:j.no_profiles_found})})})})]})})};function qke(e){CH.setQueriesData({queryKey:e},t=>{if(t)return{pages:t.pages.slice(0,1),pageParams:t.pageParams.slice(0,1)}})}const Jke=()=>(_.useEffect(()=>()=>qke(["profiles"]),[]),p.jsxs("div",{className:"profiles",children:[p.jsx(Kke,{}),p.jsx(Uke,{}),p.jsx(Hke,{})]})),YO=p.jsx("svg",{width:"54",height:"54",viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",stroke:s0.colors.blue[6],children:p.jsx("g",{fill:"none",fillRule:"evenodd",children:p.jsxs("g",{transform:"translate(1 1)",strokeWidth:"2",children:[p.jsx("circle",{strokeOpacity:".5",cx:"18",cy:"18",r:"18"}),p.jsx("path",{d:"M36 18c0-9.94-8.06-18-18-18",children:p.jsx("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})})]})})});var Qke=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,o,i;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(o=r;o--!==0;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(i=Object.keys(t),r=i.length,r!==Object.keys(n).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;for(o=r;o--!==0;){var s=i[o];if(!e(t[s],n[s]))return!1}return!0}return t!==t&&n!==n};const $D=Ta(Qke);function Jx(e){return e===null||typeof e!="object"?{}:Object.keys(e).reduce((t,n)=>{const r=e[n];return r!=null&&r!==!1&&(t[n]=r),t},{})}var Xke=Object.defineProperty,MD=Object.getOwnPropertySymbols,e2e=Object.prototype.hasOwnProperty,t2e=Object.prototype.propertyIsEnumerable,ND=(e,t,n)=>t in e?Xke(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,n2e=(e,t)=>{for(var n in t||(t={}))e2e.call(t,n)&&ND(e,n,t[n]);if(MD)for(var n of MD(t))t2e.call(t,n)&&ND(e,n,t[n]);return e};function YF(e,t){if(t===null||typeof t!="object")return{};const n=n2e({},t);return Object.keys(t).forEach(r=>{r.includes(`${String(e)}.`)&&delete n[r]}),n}const r2e="__MANTINE_FORM_INDEX__";function TD(e,t){return t?typeof t=="boolean"?t:Array.isArray(t)?t.includes(e.replace(/[.][0-9]/g,`.${r2e}`)):!1:!1}function ID(e,t,n){typeof n.value=="object"&&(n.value=Ac(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||t==="__proto__"?Object.defineProperty(e,t,n):e[t]=n.value}function Ac(e){if(typeof e!="object")return e;var t=0,n,r,o,i=Object.prototype.toString.call(e);if(i==="[object Object]"?o=Object.create(e.__proto__||null):i==="[object Array]"?o=Array(e.length):i==="[object Set]"?(o=new Set,e.forEach(function(s){o.add(Ac(s))})):i==="[object Map]"?(o=new Map,e.forEach(function(s,a){o.set(Ac(a),Ac(s))})):i==="[object Date]"?o=new Date(+e):i==="[object RegExp]"?o=new RegExp(e.source,e.flags):i==="[object DataView]"?o=new e.constructor(Ac(e.buffer)):i==="[object ArrayBuffer]"?o=e.slice(0):i.slice(-6)==="Array]"&&(o=new e.constructor(e)),o){for(r=Object.getOwnPropertySymbols(e);t0,errors:t}}function Qx(e,t,n="",r={}){return typeof e!="object"||e===null?r:Object.keys(e).reduce((o,i)=>{const s=e[i],a=`${n===""?"":`${n}.`}${i}`,c=as(a,t);let u=!1;return typeof s=="function"&&(o[a]=s(c,t,a)),typeof s=="object"&&Array.isArray(c)&&(u=!0,c.forEach((f,h)=>Qx(s,t,`${a}.${h}`,o))),typeof s=="object"&&typeof c=="object"&&c!==null&&(u||Qx(s,t,a,o)),o},r)}function Xx(e,t){return DD(typeof e=="function"?e(t):Qx(e,t))}function xp(e,t,n){if(typeof e!="string")return{hasError:!1,error:null};const r=Xx(t,n),o=Object.keys(r.errors).find(i=>e.split(".").every((s,a)=>s===i.split(".")[a]));return{hasError:!!o,error:o?r.errors[o]:null}}function o2e(e,{from:t,to:n},r){const o=as(e,r);if(!Array.isArray(o))return r;const i=[...o],s=o[t];return i.splice(t,1),i.splice(n,0,s),m1(e,i,r)}var i2e=Object.defineProperty,jD=Object.getOwnPropertySymbols,s2e=Object.prototype.hasOwnProperty,a2e=Object.prototype.propertyIsEnumerable,LD=(e,t,n)=>t in e?i2e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,l2e=(e,t)=>{for(var n in t||(t={}))s2e.call(t,n)&&LD(e,n,t[n]);if(jD)for(var n of jD(t))a2e.call(t,n)&&LD(e,n,t[n]);return e};function c2e(e,{from:t,to:n},r){const o=`${e}.${t}`,i=`${e}.${n}`,s=l2e({},r);return Object.keys(r).every(a=>{let c,u;if(a.startsWith(o)&&(c=a,u=a.replace(o,i)),a.startsWith(i)&&(c=a.replace(i,o),u=a),c&&u){const f=s[c],h=s[u];return h===void 0?delete s[c]:s[c]=h,f===void 0?delete s[u]:s[u]=f,!1}return!0}),s}function u2e(e,t,n){const r=as(e,n);return Array.isArray(r)?m1(e,r.filter((o,i)=>i!==t),n):n}var d2e=Object.defineProperty,RD=Object.getOwnPropertySymbols,f2e=Object.prototype.hasOwnProperty,h2e=Object.prototype.propertyIsEnumerable,zD=(e,t,n)=>t in e?d2e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,p2e=(e,t)=>{for(var n in t||(t={}))f2e.call(t,n)&&zD(e,n,t[n]);if(RD)for(var n of RD(t))h2e.call(t,n)&&zD(e,n,t[n]);return e};function AD(e,t){const n=e.substring(t.length+1).split(".")[0];return parseInt(n,10)}function BD(e,t,n,r){if(t===void 0)return n;const o=`${String(e)}`;let i=n;r===-1&&(i=YF(`${o}.${t}`,i));const s=p2e({},i),a=new Set;return Object.entries(i).filter(([c])=>{if(!c.startsWith(`${o}.`))return!1;const u=AD(c,o);return Number.isNaN(u)?!1:u>=t}).forEach(([c,u])=>{const f=AD(c,o),h=c.replace(`${o}.${f}`,`${o}.${f+r}`);s[h]=u,a.add(h),a.has(c)||delete s[c]}),s}function m2e(e,t,n,r){const o=as(e,r);if(!Array.isArray(o))return r;const i=[...o];return i.splice(typeof n=="number"?n:i.length,0,t),m1(e,i,r)}function FD(e,t){const n=Object.keys(e);if(typeof t=="string"){const r=n.filter(o=>o.startsWith(`${t}.`));return e[t]||r.some(o=>e[o])||!1}return n.some(r=>e[r])}function g2e(e){return t=>{if(!t)e(t);else if(typeof t=="function")e(t);else if(typeof t=="object"&&"nativeEvent"in t){const{currentTarget:n}=t;n instanceof HTMLInputElement?n.type==="checkbox"?e(n.checked):e(n.value):(n instanceof HTMLTextAreaElement||n instanceof HTMLSelectElement)&&e(n.value)}else e(t)}}var v2e=Object.defineProperty,y2e=Object.defineProperties,_2e=Object.getOwnPropertyDescriptors,VD=Object.getOwnPropertySymbols,w2e=Object.prototype.hasOwnProperty,b2e=Object.prototype.propertyIsEnumerable,HD=(e,t,n)=>t in e?v2e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,As=(e,t)=>{for(var n in t||(t={}))w2e.call(t,n)&&HD(e,n,t[n]);if(VD)for(var n of VD(t))b2e.call(t,n)&&HD(e,n,t[n]);return e},Lw=(e,t)=>y2e(e,_2e(t));function ql({initialValues:e={},initialErrors:t={},initialDirty:n={},initialTouched:r={},clearInputErrorOnChange:o=!0,validateInputOnChange:i=!1,validateInputOnBlur:s=!1,transformValues:a=u=>u,validate:c}={}){const[u,f]=_.useState(r),[h,m]=_.useState(n),[v,y]=_.useState(e),[w,P]=_.useState(Jx(t)),b=_.useRef(e),S=J=>{b.current=J},O=_.useCallback(()=>f({}),[]),E=J=>{const ne=J?As(As({},v),J):v;S(ne),m({})},$=_.useCallback(J=>P(ne=>Jx(typeof J=="function"?J(ne):J)),[]),N=_.useCallback(()=>P({}),[]),I=_.useCallback(()=>{y(e),N(),S(e),m({}),O()},[]),R=_.useCallback((J,ne)=>$(le=>Lw(As({},le),{[J]:ne})),[]),B=_.useCallback(J=>$(ne=>{if(typeof J!="string")return ne;const le=As({},ne);return delete le[J],le}),[]),z=_.useCallback(J=>m(ne=>{if(typeof J!="string")return ne;const le=YF(J,ne);return delete le[J],le}),[]),G=_.useCallback((J,ne)=>{const le=TD(J,i);z(J),f(_e=>Lw(As({},_e),{[J]:!0})),y(_e=>{const Ne=m1(J,ne,_e);if(le){const we=xp(J,c,Ne);we.hasError?R(J,we.error):B(J)}return Ne}),!le&&o&&R(J,null)},[]),Q=_.useCallback(J=>{y(ne=>{const le=typeof J=="function"?J(ne):J;return As(As({},ne),le)}),o&&N()},[]),X=_.useCallback((J,ne)=>{z(J),y(le=>o2e(J,ne,le)),P(le=>c2e(J,ne,le))},[]),V=_.useCallback((J,ne)=>{z(J),y(le=>u2e(J,ne,le)),P(le=>BD(J,ne,le,-1))},[]),H=_.useCallback((J,ne,le)=>{z(J),y(_e=>m2e(J,ne,le,_e)),P(_e=>BD(J,le,_e,1))},[]),Z=_.useCallback(()=>{const J=Xx(c,v);return P(J.errors),J},[v,c]),Y=_.useCallback(J=>{const ne=xp(J,c,v);return ne.hasError?R(J,ne.error):B(J),ne},[v,c]),D=(J,{type:ne="input",withError:le=!0,withFocus:_e=!0}={})=>{const we={onChange:g2e(He=>G(J,He))};return le&&(we.error=w[J]),ne==="checkbox"?we.checked=as(J,v):we.value=as(J,v),_e&&(we.onFocus=()=>f(He=>Lw(As({},He),{[J]:!0})),we.onBlur=()=>{if(TD(J,s)){const He=xp(J,c,v);He.hasError?R(J,He.error):B(J)}}),we},W=(J,ne)=>le=>{le?.preventDefault();const _e=Z();_e.hasErrors?ne?.(_e.errors,v,le):J?.(a(v),le)},F=J=>a(J||v),K=_.useCallback(J=>{J.preventDefault(),I()},[]),ee=J=>{if(J){const le=as(J,h);if(typeof le=="boolean")return le;const _e=as(J,v),Ne=as(J,b.current);return!$D(_e,Ne)}return Object.keys(h).length>0?FD(h):!$D(v,b.current)},fe=_.useCallback(J=>FD(u,J),[u]),ie=_.useCallback(J=>J?!xp(J,c,v).hasError:!Xx(c,v).hasErrors,[v,c]);return{values:v,errors:w,setValues:Q,setErrors:$,setFieldValue:G,setFieldError:R,clearFieldError:B,clearErrors:N,reset:I,validate:Z,validateField:Y,reorderListItem:X,removeListItem:V,insertListItem:H,getInputProps:D,onSubmit:W,onReset:K,isDirty:ee,isTouched:fe,setTouched:f,setDirty:m,resetTouched:O,resetDirty:E,isValid:ie,getTransformedValues:F}}const x2e=()=>{const{setActiveIncident:e,setIncidentActive:t}=Yr(),n=ql({initialValues:{title:""},validate:{title:o=>o.length===0?j.incident_title_required:null}}),r=async o=>{ke.closeAll();const i=await me("createIncident",o.title,{data:1});e({title:o.title,id:i,criminals:[],description:"

",evidence:[],officersInvolved:[]}),t(!0)};return p.jsx("form",{onSubmit:n.onSubmit(o=>r(o)),children:p.jsxs(Je,{children:[p.jsx(_n,{label:j.incident_title,"data-autofocus":!0,withAsterisk:!0,...n.getInputProps("title")}),p.jsx(at,{type:"submit",fullWidth:!0,variant:"light",color:"gray",children:j.confirm})]})})},qF=[];for(let e=0;e<25;e++)qF[e]={title:`Incident ${e+1}`,id:e,author:"Some One",date:Date.now()};const S2e=async()=>it()?{incidents:qF}:await me("getIncidents"),JF=tn(e=>({incidents:[],fetchIncidents:async()=>{const t=await S2e();e({incidents:t.incidents})},setIncidents:t=>{e(n=>({incidents:typeof t=="function"?t(n.incidents):t}))}})),P2e=e=>{const{incidents:t,fetchIncidents:n}=JF(),[r,o]=_.useState(!1),[i,s]=_.useState(""),a=500,[c,u]=_.useState(i),[f,h]=_.useState(null),[m,v]=_.useState(t);return _.useEffect(()=>{f!==null&&clearTimeout(f),o(!0);const y=setTimeout(()=>{u(i),o(!1)},a);return h(y),()=>{clearTimeout(y)}},[i]),_.useEffect(()=>{if(c.trim()==="")v(t);else{const y=t.filter(w=>(w.title||"").toLocaleLowerCase().includes(i.toLocaleLowerCase())||(w.author||"").toLocaleLowerCase().includes(i.toLocaleLowerCase()));v(y)}},[c,t]),_.useEffect(()=>{o(!0),(async()=>await n())().then(()=>{o(!1)})},[]),p.jsx("div",{className:"content-width",children:p.jsxs("div",{className:"card-background",children:[p.jsxs("div",{className:"card-title",children:[p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:j.incidents}),p.jsx(sO,{size:M(25),color:"white"})]}),p.jsx(et,{icon:p.jsx(Ra,{}),variant:"filled",placeholder:j.search,mt:10,mb:10,onChange:y=>s(y.target.value)}),p.jsxs(at,{fullWidth:!0,variant:"light",color:"gray",onClick:()=>ke.open({title:p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:j.create_incident}),centered:!0,size:"sm",children:p.jsx(x2e,{})}),children:[p.jsx(n7,{size:M(18),style:{marginRight:5}})," ",j.create_incident]}),p.jsx(Ye,{mt:10,mb:10}),p.jsx("div",{className:"incidents-cards-content",children:p.jsx(At,{h:680,children:p.jsx("div",{className:"profiles-card-content-flex",children:r?p.jsx(Zr,{children:p.jsx(en,{})}):m.map(y=>p.jsx("div",{className:"incident-card",onClick:()=>e.handleIncidentClick(y),children:p.jsxs("div",{className:"incident-card-content",children:[p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:y.title}),p.jsxs("div",{className:"incident-card-dimmed-text",children:[p.jsxs(U,{color:"dimmed",size:"xs",children:[y.author," -"," ",new Date(y.date).toLocaleDateString()]}),p.jsxs(U,{color:"dimmed",size:"xs",children:["#",y.id]})]})]})},y.id))})})})]})})},O2e=()=>{const{incident:e,setOfficersInvolved:t}=Yr(),[n,r]=_.useState(""),{officers:o,getOfficers:i}=mO(),[s,a]=_.useState(o),c=500,[u,f]=_.useState(n),[h,m]=_.useState(!1),[v,y]=_.useState(null);_.useEffect(()=>{v!==null&&clearTimeout(v),m(!0);const P=setTimeout(()=>{f(n),m(!1)},c);return y(P),()=>{clearTimeout(P)}},[n]),_.useEffect(()=>{if(u.trim()==="")a(o);else{const P=o.filter(b=>(b.citizenid||"").toLowerCase().includes(n.toLowerCase())||(b.firstname||"").toLowerCase().includes(n.toLowerCase())||(b.lastname||"").toLowerCase().includes(n.toLowerCase())||(b.firstname+" "+b.lastname||"").toLowerCase().includes(n.toLowerCase()));a(P)}},[u,o]),_.useEffect(()=>{i()},[]);const w=async P=>{if(e.officersInvolved.some(b=>b.citizenid===P.citizenid))return ke.closeAll();await me("addOfficer",{id:e.id,citizenid:P.citizenid},{data:1}),ke.closeAll(),t(b=>b.some(S=>S.citizenid===P.citizenid)?b:[...b,{firstname:P.firstname,lastname:P.lastname,callsign:P.callsign,citizenid:P.citizenid,playerId:P.playerId,position:[1,1,1]}])};return p.jsx("form",{children:p.jsxs(Je,{children:[p.jsx(et,{icon:p.jsx(Ra,{}),variant:"filled",placeholder:j.search,mt:10,mb:10,value:n,onChange:P=>r(P.target.value)}),h?p.jsx(Zr,{children:p.jsx(en,{})}):s.length>0?s.map(P=>p.jsxs("div",{className:"add-officer-card",onClick:()=>w(P),children:[p.jsxs(U,{weight:500,style:{fontSize:13,color:"white"},children:[P.firstname," ",P.lastname]}),p.jsxs(U,{style:{fontSize:13,color:"white"},children:[j.callsign,": ",P.callsign]})]},P.citizenid)):p.jsxs(Je,{spacing:0,c:"dark.2",justify:"center",align:"center",children:[p.jsx(Xf,{size:36}),p.jsx(U,{size:"xl",children:j.no_officers_found})]})]})})},C2e=()=>{const[e,t]=_.useState(!1),{incident:n,setEvidence:r}=Yr(),o=ql({initialValues:{label:"",image:""},validate:{label:s=>s.length===0?j.image_label_required:null,image:s=>s.length===0?j.image_url_required:null}}),i=async s=>{t(!0),await me("addEvidence",{id:n.id,evidence:{...s}},{data:1}),r(a=>[...a,s]),t(!1),ke.closeAll()};return p.jsx("form",{onSubmit:o.onSubmit(s=>i(s)),children:p.jsxs(Je,{children:[p.jsx(_n,{label:j.image_label,withAsterisk:!0,...o.getInputProps("label")}),p.jsx(_n,{label:p.jsxs("div",{style:{display:"flex",gap:10,alignItems:"center",marginBottom:5},children:[p.jsx(U,{children:j.image_url}),p.jsx(zt,{label:j.take_picture,withArrow:!0,color:"gray",children:p.jsx(Xe,{disabled:o.getInputProps("label").value==="",variant:"default",size:"sm",p:1.5,onClick:async()=>{await me("takePicture",{id:n.id,imageLabel:o.getInputProps("label").value,type:"incident"},{data:1})},children:p.jsx(Q8,{size:"1.125rem"})})})]}),placeholder:"https://i.imgur.com/dqopYB9b.jpg",...o.getInputProps("image")}),p.jsx(at,{variant:"light",color:"gray",type:"submit",loading:e,children:j.add_evidence})]})})},k2e=ue(()=>({container:{position:"relative"},image:{zIndex:2,"&:hover":{cursor:"pointer"}},actionIcon:{position:"absolute",top:0,right:0,zIndex:1}})),E2e=({evidence:e})=>{const{classes:t}=k2e(),[n,r]=_.useState(!1),{incident:o,setEvidence:i}=Yr();return p.jsx(zt,{label:e.label,withArrow:!0,color:"gray",children:p.jsxs(Pe,{className:t.container,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:[p.jsx(ai,{src:e.image,radius:"sm",width:105,height:105,className:t.image,onClick:()=>ke.open({children:p.jsx(ai,{src:e.image,onClick:()=>ke.closeAll()}),withCloseButton:!1,centered:!0,padding:0,size:"unset",transitionProps:{transition:"pop"}})},`${e.label}-${e.image}`),n&&p.jsx(Xe,{variant:"filled",color:"red",radius:"sm",size:"xs",className:t.actionIcon,onClick:()=>ke.openConfirmModal({title:p.jsx(U,{style:{fontSize:16,color:"white"},weight:500,children:j.remove_evidence}),centered:!0,children:p.jsx(U,{size:"sm",c:"dark.2",children:j.remove_evidence_confirm.format(e.label)}),labels:{confirm:j.confirm,cancel:j.cancel},confirmProps:{color:"red"},groupProps:{spacing:6},onConfirm:async()=>{await me("removeEvidence",{id:o.id,label:e.label,image:e.image},{data:1}),i(s=>s.filter(a=>a.image!==e.image&&a.label!==e.label))}}),children:p.jsx(pu,{})})]})})},$2e=()=>{const{incident:e,isIncidentActive:t,setIncidentActive:n,setOfficersInvolved:r,setDescription:o}=Yr(),{setIncidents:i}=JF();return t?p.jsx(At,{h:860,children:p.jsxs("div",{className:"incident-content-width",children:[p.jsxs("div",{className:"incident-middle-content",children:[p.jsxs("div",{className:"profile-card-header",children:[p.jsx(U,{style:{fontSize:15,color:"white"},children:e.title}),p.jsxs("div",{className:"profile-card-header-buttons",children:[p.jsx(zt,{label:j.delete_incident,withArrow:!0,color:"gray",position:"bottom",children:p.jsx(Xe,{variant:"filled",color:"red",onClick:()=>{ke.openConfirmModal({title:p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:j.delete_incident}),size:"sm",centered:!0,labels:{confirm:j.confirm,cancel:j.cancel},groupProps:{spacing:6},confirmProps:{color:"red"},onConfirm:async()=>{await me("deleteIncident",{id:e.id},{data:1})&&i(a=>a.filter(c=>c.id!==e.id)),n(!1)},children:p.jsx(U,{size:"sm",c:"dark.2",children:j.delete_incident_confirm.format(e.title)})})},children:p.jsx(K0,{size:16,color:"white"})})}),p.jsx(zt,{label:j.unlink,withArrow:!0,color:"gray",position:"bottom",children:p.jsx(Xe,{variant:"filled",color:"gray",onClick:()=>{n(!1)},children:p.jsx(Y0,{size:16,color:"white"})})})]})]}),p.jsx(Ye,{style:{width:"100%"}}),p.jsx("div",{className:"incident-middle-card",children:p.jsx(lh,{content:e.description,onSave:s=>{me("saveIncidentContents",{incidentId:e.id,contents:s}),o(s)},styles:{content:{backgroundColor:"#242527"},toolbar:{backgroundColor:"#2C2E33"},controlsGroup:{pointerEvents:"auto",backgroundColor:"#282828"}},contentAreaStyle:{height:270,width:413,padding:0}})})]}),p.jsxs("div",{className:"card-background profile-card-info",children:[p.jsxs("div",{className:"card-title",children:[p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:j.officers_involved}),p.jsx(q0,{size:M(25),color:"white"})]}),p.jsx(Ye,{style:{width:"100%"}}),p.jsxs("div",{className:"profile-card-info-badges",children:[p.jsx(mt,{color:"gray",variant:"filled",className:"incident-info-badge-main",radius:"md",onClick:()=>ke.open({title:p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:j.add_officer}),centered:!0,size:"sm",children:p.jsx(O2e,{})}),children:j.add_officer}),e.officersInvolved.map(s=>p.jsxs(mt,{color:"gray",variant:"filled",className:"incident-info-badge",rightSection:p.jsx(Xe,{size:"xs",radius:"xl",variant:"transparent",onClick:()=>{ke.openConfirmModal({title:p.jsx(U,{style:{fontSize:16,color:"white"},weight:500,children:j.remove_officer}),centered:!0,children:p.jsx(U,{size:"sm",c:"dark.2",children:j.remove_officer_confirm.format(s.firstname,s.lastname,s.callsign)}),confirmProps:{color:"red"},groupProps:{spacing:6},labels:{confirm:j.confirm,cancel:j.cancel},onConfirm:async()=>{await me("removeOfficer",{id:e.id,citizenid:s.citizenid},{data:1}),r(a=>a.filter(c=>c.citizenid!==s.citizenid))}})},children:p.jsx(pu,{size:M(10)})}),children:[s.firstname," ",s.lastname," ",s.callsign?`(${s.callsign})`:""]},s.citizenid))]})]}),p.jsxs("div",{className:"card-background profile-card-info",children:[p.jsxs("div",{className:"card-title",children:[p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:j.evidence}),p.jsx(s7,{size:M(25),color:"white"})]}),p.jsx(Ye,{style:{width:"100%"}}),p.jsxs("div",{className:"profile-card-info-badges",children:[p.jsx(at,{onClick:()=>ke.open({centered:!0,title:p.jsx(U,{style:{fontSize:16,color:"white"},weight:500,children:j.add_evidence}),children:p.jsx(C2e,{}),size:"sm"}),variant:"filled",color:"gray",w:105,h:105,children:p.jsx(Iu,{size:36})}),e.evidence.map(s=>p.jsx(E2e,{evidence:s},`${s.image}-${s.label}`))]})]})]})}):p.jsx("div",{className:"content-width",children:p.jsx("div",{className:"card-background",children:p.jsxs("div",{className:"profile-no-selected",children:[p.jsx(G0,{size:M(50),color:"white"}),p.jsx(U,{style:{fontSize:15,color:"white"},weight:600,children:j.no_incident_selected})]})})})},WD=[{firstname:"John",lastname:"Doe",dob:Date.now(),citizenid:"12345"},{firstname:"Jane",lastname:"Smith",dob:Date.now(),citizenid:"67890"},{firstname:"David",lastname:"Williams",dob:Date.now(),citizenid:"13579"},{firstname:"Samantha",lastname:"Jones",dob:Date.now(),citizenid:"24680"},{firstname:"Robert",lastname:"Garcia",dob:Date.now(),citizenid:"97531"},{firstname:"Emily",lastname:"Brown",dob:Date.now(),citizenid:"11223"},{firstname:"Michael",lastname:"Davis",dob:Date.now(),citizenid:"33445"},{firstname:"Sarah",lastname:"Wilson",dob:Date.now(),citizenid:"55667"},{firstname:"James",lastname:"Taylor",dob:Date.now(),citizenid:"77889"},{firstname:"Laura",lastname:"Moore",dob:Date.now(),citizenid:"99001"},{firstname:"Kevin",lastname:"Martin",dob:Date.now(),citizenid:"12321"},{firstname:"Jessica",lastname:"Lee",dob:Date.now(),citizenid:"34543"},{firstname:"Daniel",lastname:"Perez",dob:Date.now(),citizenid:"56765"},{firstname:"Nancy",lastname:"White",dob:Date.now(),citizenid:"78987"},{firstname:"Steven",lastname:"Harris",dob:Date.now(),citizenid:"90109"},{firstname:"Lisa",lastname:"Clark",dob:Date.now(),citizenid:"12212"},{firstname:"Paul",lastname:"Rodriguez",dob:Date.now(),citizenid:"34434"},{firstname:"Anna",lastname:"Lewis",dob:Date.now(),citizenid:"56656"},{firstname:"Charles",lastname:"Walker",dob:Date.now(),citizenid:"78878"},{firstname:"Susan",lastname:"Allen",dob:Date.now(),citizenid:"90090"}],M2e=tn(e=>({criminalProfiles:it()?WD:[],getCriminalProfiles:async()=>{const t=await me("getCriminalProfiles",{data:WD,delay:300});e({criminalProfiles:t})},setCriminalProfiles:t=>e({criminalProfiles:t})})),N2e=e=>{let t=e.length,n;for(;t!==0;)n=Math.floor(Math.random()*t),t--,[e[t],e[n]]=[e[n],e[t]];return e},T2e=()=>{const{incident:e,setCriminals:t}=Yr(),[n,r]=_.useState(""),{criminalProfiles:o,getCriminalProfiles:i}=M2e(),[s,a]=_.useState(o),c=500,[u,f]=_.useState(n),[h,m]=_.useState(!1),[v,y]=_.useState(null);_.useEffect(()=>{v!==null&&clearTimeout(v),m(!0);const P=setTimeout(()=>{f(n),m(!1)},c);return y(P),()=>{clearTimeout(P)}},[n]),_.useEffect(()=>{if(u.trim()==="")a(N2e([...o]).slice(0,5));else{const P=o.filter(b=>(b.citizenid||"").toLowerCase().includes(n.toLowerCase())||(b.firstname||"").toLowerCase().includes(n.toLowerCase())||(b.lastname||"").toLowerCase().includes(n.toLowerCase())||(b.firstname+" "+b.lastname||"").toLowerCase().includes(n.toLowerCase()));a(P)}},[u,o]),_.useEffect(()=>{(async()=>{await i()})()},[]);const w=async P=>{await me("addCriminal",{id:e.id,criminalId:P.citizenid},{data:1}),ke.closeAll(),t(b=>b.some(S=>S.citizenid===P.citizenid)?b:[...b,{citizenid:P.citizenid,dob:P.dob,firstname:P.firstname,lastname:P.lastname,image:P.image,charges:[],issueWarrant:!1,pleadedGuilty:!1,processed:!1,penalty:{time:0,reduction:0,points:0,fine:0}}])};return p.jsx("form",{children:p.jsxs(Je,{children:[p.jsx(et,{icon:p.jsx(Ra,{}),variant:"filled",placeholder:j.search,mt:10,mb:10,value:n,onChange:P=>r(P.target.value)}),h?p.jsx(Zr,{children:p.jsx(en,{})}):s.length>0?s.map(P=>p.jsxs("div",{className:"profile-card",onClick:()=>w(P),children:[p.jsx(ai,{width:65,height:65,src:P.image??"https://cdn.vectorstock.com/i/preview-1x/97/68/account-avatar-dark-mode-glyph-ui-icon-vector-44429768.jpg",radius:"lg",alt:"With default placeholder",withPlaceholder:!0}),p.jsxs("div",{children:[p.jsxs(U,{weight:600,style:{fontSize:13,color:"white"},children:[P.firstname," ",P.lastname]}),p.jsxs(U,{style:{fontSize:12,color:"white"},children:[j.dob,": ",P.dob]}),p.jsxs(U,{style:{fontSize:12,color:"white"},children:[j.citizen_id,": ",P.citizenid]})]})]},P.citizenid)):p.jsxs(Je,{spacing:0,c:"dark.2",justify:"center",align:"center",children:[p.jsx(Xf,{size:36}),p.jsx(U,{size:"xl",children:j.no_profiles_found})]})]})})};var I2e=Object.defineProperty,D2e=Object.defineProperties,j2e=Object.getOwnPropertyDescriptors,$y=Object.getOwnPropertySymbols,QF=Object.prototype.hasOwnProperty,XF=Object.prototype.propertyIsEnumerable,UD=(e,t,n)=>t in e?I2e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ZD=(e,t)=>{for(var n in t||(t={}))QF.call(t,n)&&UD(e,n,t[n]);if($y)for(var n of $y(t))XF.call(t,n)&&UD(e,n,t[n]);return e},GD=(e,t)=>D2e(e,j2e(t)),L2e=(e,t)=>{var n={};for(var r in e)QF.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&$y)for(var r of $y(e))t.indexOf(r)<0&&XF.call(e,r)&&(n[r]=e[r]);return n};function eS(e){var t=e,{direction:n,style:r}=t,o=L2e(t,["direction","style"]);const i=ar();return k.createElement(lJ,GD(ZD({},o),{style:GD(ZD({},r),{transform:n==="next"&&i.dir==="ltr"||n==="previous"&&i.dir==="rtl"?"rotate(270deg)":"rotate(90deg)"})}))}eS.displayName="@mantine/dates/Chevron";var R2e=Object.defineProperty,z2e=Object.defineProperties,A2e=Object.getOwnPropertyDescriptors,YD=Object.getOwnPropertySymbols,B2e=Object.prototype.hasOwnProperty,F2e=Object.prototype.propertyIsEnumerable,KD=(e,t,n)=>t in e?R2e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Sp=(e,t)=>{for(var n in t||(t={}))B2e.call(t,n)&&KD(e,n,t[n]);if(YD)for(var n of YD(t))F2e.call(t,n)&&KD(e,n,t[n]);return e},qD=(e,t)=>z2e(e,A2e(t));const Tf={xs:M(30),sm:M(36),md:M(42),lg:M(48),xl:M(54)};var V2e=ue((e,{radius:t,isStatic:n},{size:r})=>{const o=e.fn.variant({variant:"filled"}),i=e.fn.variant({variant:"light"});return{day:qD(Sp({width:re({size:r,sizes:Tf}),height:re({size:r,sizes:Tf}),fontSize:re({size:r,sizes:e.fontSizes}),display:"inline-flex",justifyContent:"center",alignItems:"center",userSelect:n?void 0:"none",cursor:n?"default":"pointer",borderRadius:e.fn.radius(t)},n?null:e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[0]})),{"&:active":n?void 0:e.activeStyles,"&[data-disabled]":qD(Sp({color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[4],cursor:"not-allowed"},e.fn.hover({backgroundColor:"transparent"})),{"&:active":{transform:"none"}}),"&[data-weekend]":{color:e.colors.red[e.fn.primaryShade()]},"&[data-outside]":{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[4]},"&[data-in-range]":Sp({backgroundColor:i.background,borderRadius:0},n?null:e.fn.hover({backgroundColor:i.hover})),"&[data-first-in-range]":{borderTopLeftRadius:e.radius.sm,borderBottomLeftRadius:e.radius.sm},"&[data-last-in-range]":{borderTopRightRadius:e.radius.sm,borderBottomRightRadius:e.radius.sm},"&[data-selected]":Sp({color:o.color,backgroundColor:o.background},n?null:e.fn.hover({backgroundColor:o.hover})),"&[data-hidden]":{display:"none"}})}});const H2e=V2e;var W2e=Object.defineProperty,U2e=Object.defineProperties,Z2e=Object.getOwnPropertyDescriptors,JD=Object.getOwnPropertySymbols,G2e=Object.prototype.hasOwnProperty,Y2e=Object.prototype.propertyIsEnumerable,QD=(e,t,n)=>t in e?W2e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Pp=(e,t)=>{for(var n in t||(t={}))G2e.call(t,n)&&QD(e,n,t[n]);if(JD)for(var n of JD(t))Y2e.call(t,n)&&QD(e,n,t[n]);return e},Op=(e,t)=>U2e(e,Z2e(t)),K2e=ue((e,t,{size:n})=>{const r=re({size:n,sizes:Tf});return{calendarHeaderControlIcon:{},calendarHeader:{display:"flex",maxWidth:`calc(${r} * 7 + ${M(7)})`},calendarHeaderControl:Op(Pp({width:r,height:r,borderRadius:e.fn.radius(),display:"flex",justifyContent:"center",alignItems:"center",userSelect:"none"},e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[0]})),{"&:active":e.activeStyles,"&[data-disabled]":Op(Pp({opacity:.2,cursor:"not-allowed"},e.fn.hover({backgroundColor:"transparent"})),{"&:active":{transform:"none"}})}),calendarHeaderLevel:Op(Pp({height:r,borderRadius:e.fn.radius(),display:"flex",justifyContent:"center",alignItems:"center",userSelect:"none",flex:1,fontSize:re({size:n,sizes:e.fontSizes}),fontWeight:500,textTransform:"capitalize"},e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[0]})),{"&:active":e.activeStyles,"&[data-static]":Op(Pp({cursor:"default",userSelect:"unset"},e.fn.hover({backgroundColor:"transparent"})),{"&:active":{transform:"none"}})})}});const q2e=K2e;var J2e=Object.defineProperty,My=Object.getOwnPropertySymbols,e9=Object.prototype.hasOwnProperty,t9=Object.prototype.propertyIsEnumerable,XD=(e,t,n)=>t in e?J2e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Q2e=(e,t)=>{for(var n in t||(t={}))e9.call(t,n)&&XD(e,n,t[n]);if(My)for(var n of My(t))t9.call(t,n)&&XD(e,n,t[n]);return e},X2e=(e,t)=>{var n={};for(var r in e)e9.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&My)for(var r of My(e))t.indexOf(r)<0&&t9.call(e,r)&&(n[r]=e[r]);return n};const eEe={nextDisabled:!1,previousDisabled:!1,hasNextLevel:!0,withNext:!0,withPrevious:!0,size:"sm"},g1=_.forwardRef((e,t)=>{const n=ae("CalendarHeader",eEe,e),{className:r,nextIcon:o,previousIcon:i,nextLabel:s,previousLabel:a,onNext:c,onPrevious:u,onLevelClick:f,label:h,classNames:m,styles:v,unstyled:y,nextDisabled:w,previousDisabled:P,hasNextLevel:b,levelControlAriaLabel:S,withNext:O,withPrevious:E,__staticSelector:$,__preventFocus:N,__stopPropagation:I,size:R,variant:B}=n,z=X2e(n,["className","nextIcon","previousIcon","nextLabel","previousLabel","onNext","onPrevious","onLevelClick","label","classNames","styles","unstyled","nextDisabled","previousDisabled","hasNextLevel","levelControlAriaLabel","withNext","withPrevious","__staticSelector","__preventFocus","__stopPropagation","size","variant"]),{classes:G,cx:Q}=q2e(null,{name:["CalendarHeader",$],classNames:m,styles:v,unstyled:y,size:R,variant:B}),X=N?V=>V.preventDefault():void 0;return k.createElement(Pe,Q2e({className:Q(G.calendarHeader,r),ref:t},z),E&&k.createElement(ds,{className:G.calendarHeaderControl,"data-previous":!0,"aria-label":a,onClick:u,unstyled:y,onMouseDown:X,disabled:P,"data-disabled":P||void 0,tabIndex:N?-1:0,"data-mantine-stop-propagation":I||void 0},i||k.createElement(eS,{className:G.calendarHeaderControlIcon,direction:"previous","data-previous":!0})),k.createElement(ds,{component:b?"button":"div",className:G.calendarHeaderLevel,onClick:b?f:void 0,unstyled:y,onMouseDown:b?X:void 0,disabled:!b,"data-static":!b||void 0,"aria-label":S,tabIndex:N||!b?-1:0,"data-mantine-stop-propagation":I||void 0},h),O&&k.createElement(ds,{className:G.calendarHeaderControl,"data-next":!0,"aria-label":s,onClick:c,unstyled:y,onMouseDown:X,disabled:w,"data-disabled":w||void 0,tabIndex:N?-1:0,"data-mantine-stop-propagation":I||void 0},o||k.createElement(eS,{className:G.calendarHeaderControlIcon,direction:"next","data-next":!0})))});g1.displayName="@mantine/dates/CalendarHeader";function Rw(e,t){return e?e==="month"?0:e==="year"?1:2:t}function tEe(e){return e===0?"month":e===1?"year":"decade"}function gd(e,t,n){return tEe(ca(Rw(e,0),Rw(t,0),Rw(n,2)))}var nEe=ue(()=>({calendar:{}}));const rEe=nEe;var oEe=ue((e,t,{size:n})=>({monthLevelGroup:{display:"flex","& [data-month-level]:not(:last-of-type)":{marginRight:re({size:n,sizes:e.spacing})}}}));const iEe=oEe;var sEe=ue(e=>({monthLevel:{},calendarHeader:{marginBottom:e.spacing.xs}}));const aEe=sEe,lEe={locale:"en",firstDayOfWeek:1,weekendDays:[0,6],labelSeparator:"–"},cEe=_.createContext(lEe);var uEe=Object.defineProperty,dEe=Object.defineProperties,fEe=Object.getOwnPropertyDescriptors,ej=Object.getOwnPropertySymbols,hEe=Object.prototype.hasOwnProperty,pEe=Object.prototype.propertyIsEnumerable,tj=(e,t,n)=>t in e?uEe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mEe=(e,t)=>{for(var n in t||(t={}))hEe.call(t,n)&&tj(e,n,t[n]);if(ej)for(var n of ej(t))pEe.call(t,n)&&tj(e,n,t[n]);return e},gEe=(e,t)=>dEe(e,fEe(t));function Va(){const e=_.useContext(cEe),t=_.useCallback(i=>i||e.locale,[e.locale]),n=_.useCallback(i=>typeof i=="number"?i:e.firstDayOfWeek,[e.firstDayOfWeek]),r=_.useCallback(i=>Array.isArray(i)?i:e.weekendDays,[e.weekendDays]),o=_.useCallback(i=>typeof i=="string"?i:e.labelSeparator,[e.labelSeparator]);return gEe(mEe({},e),{getLocale:t,getFirstDayOfWeek:n,getWeekendDays:r,getLabelSeparator:o})}function vEe(e,t=1){const n=new Date(e);for(;n.getDay()!==t;)n.setDate(n.getDate()-1);return n}function yEe(e,t=1){const n=new Date(e),r=t===0?6:t-1;for(;n.getDay()!==r;)n.setDate(n.getDate()+1);return n}function _Ee(e,t=1){const n=e.getMonth(),r=new Date(e.getFullYear(),n,1),o=new Date(e.getFullYear(),e.getMonth()+1,0),i=yEe(o,t),s=vEe(r,t),a=[];for(;s<=i;){const c=[];for(let u=0;u<7;u+=1)c.push(new Date(s)),s.setDate(s.getDate()+1);a.push(c)}return a}function n9(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()}function r9(e,t){return t instanceof Date?he(e).isBefore(he(t).add(1,"day"),"day"):!0}function o9(e,t){return t instanceof Date?he(e).isAfter(he(t).subtract(1,"day"),"day"):!0}var wEe=Object.defineProperty,bEe=Object.defineProperties,xEe=Object.getOwnPropertyDescriptors,nj=Object.getOwnPropertySymbols,SEe=Object.prototype.hasOwnProperty,PEe=Object.prototype.propertyIsEnumerable,rj=(e,t,n)=>t in e?wEe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,OEe=(e,t)=>{for(var n in t||(t={}))SEe.call(t,n)&&rj(e,n,t[n]);if(nj)for(var n of nj(t))PEe.call(t,n)&&rj(e,n,t[n]);return e},CEe=(e,t)=>bEe(e,xEe(t)),kEe=ue(e=>({monthThead:{},monthRow:{},monthTbody:{},monthCell:{padding:0,"&[data-with-spacing]":{padding:M(.5)}},month:CEe(OEe({},e.fn.fontStyles()),{borderCollapse:"collapse",tableLayout:"fixed","& *":{boxSizing:"border-box"}})}));const EEe=kEe;function $Ee(e,t,n,r,o,i,s){const a=e.flat().filter(f=>{var h;return r9(f,n)&&o9(f,t)&&!o?.(f)&&!((h=r?.(f))!=null&&h.disabled)&&(!i||n9(f,s))}),c=a.find(f=>{var h;return(h=r?.(f))==null?void 0:h.selected});if(c)return c;const u=a.find(f=>he().isSame(f,"date"));return u||a[0]}var MEe=Object.defineProperty,Ny=Object.getOwnPropertySymbols,i9=Object.prototype.hasOwnProperty,s9=Object.prototype.propertyIsEnumerable,oj=(e,t,n)=>t in e?MEe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,NEe=(e,t)=>{for(var n in t||(t={}))i9.call(t,n)&&oj(e,n,t[n]);if(Ny)for(var n of Ny(t))s9.call(t,n)&&oj(e,n,t[n]);return e},TEe=(e,t)=>{var n={};for(var r in e)i9.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ny)for(var r of Ny(e))t.indexOf(r)<0&&s9.call(e,r)&&(n[r]=e[r]);return n};const IEe={tabIndex:0,size:"sm"},a9=_.forwardRef((e,t)=>{const n=ae("Day",IEe,e),{className:r,date:o,radius:i,disabled:s,styles:a,classNames:c,unstyled:u,__staticSelector:f,weekend:h,outside:m,selected:v,renderDay:y,inRange:w,firstInRange:P,lastInRange:b,hidden:S,static:O,variant:E,size:$}=n,N=TEe(n,["className","date","radius","disabled","styles","classNames","unstyled","__staticSelector","weekend","outside","selected","renderDay","inRange","firstInRange","lastInRange","hidden","static","variant","size"]),{classes:I,cx:R}=H2e({radius:i,isStatic:O},{name:["Day",f],classNames:c,styles:a,unstyled:u,variant:E,size:$});return k.createElement(ds,NEe({component:O?"div":"button",ref:t,className:R(I.day,r),disabled:s,"data-today":he(o).isSame(new Date,"day")||void 0,"data-hidden":S||void 0,"data-disabled":s||void 0,"data-weekend":!s&&!m&&h||void 0,"data-outside":!s&&m||void 0,"data-selected":!s&&v||void 0,"data-in-range":w&&!s||void 0,"data-first-in-range":P&&!s||void 0,"data-last-in-range":b&&!s||void 0,unstyled:u},N),y?.(o)||o.getDate())});a9.displayName="@mantine/dates/Day";function DEe({locale:e,format:t="dd",firstDayOfWeek:n=1}){const r=he().day(n),o=[];for(let i=0;i<7;i+=1)typeof t=="string"?o.push(he(r).add(i,"days").locale(e).format(t)):o.push(t(he(r).add(i,"days").toDate()));return o}var jEe=ue((e,t,{size:n})=>({weekdaysRow:{},weekday:{color:e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[5],fontWeight:400,fontSize:re({size:n,sizes:e.fontSizes}),textTransform:"capitalize",paddingBottom:`calc(${re({size:n,sizes:e.spacing})} / 2)`}}));const LEe=jEe;var REe=Object.defineProperty,Ty=Object.getOwnPropertySymbols,l9=Object.prototype.hasOwnProperty,c9=Object.prototype.propertyIsEnumerable,ij=(e,t,n)=>t in e?REe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zEe=(e,t)=>{for(var n in t||(t={}))l9.call(t,n)&&ij(e,n,t[n]);if(Ty)for(var n of Ty(t))c9.call(t,n)&&ij(e,n,t[n]);return e},AEe=(e,t)=>{var n={};for(var r in e)l9.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ty)for(var r of Ty(e))t.indexOf(r)<0&&c9.call(e,r)&&(n[r]=e[r]);return n};const BEe={weekdayFormat:"dd",cellComponent:"th",size:"sm"},u9=_.forwardRef((e,t)=>{const n=ae("WeekdaysRow",BEe,e),{className:r,locale:o,firstDayOfWeek:i,weekdayFormat:s,cellComponent:a,__staticSelector:c,classNames:u,styles:f,unstyled:h,variant:m,size:v}=n,y=AEe(n,["className","locale","firstDayOfWeek","weekdayFormat","cellComponent","__staticSelector","classNames","styles","unstyled","variant","size"]),w=Va(),{classes:P,cx:b}=LEe(null,{name:["WeekdaysRow",c],classNames:u,styles:f,unstyled:h,variant:m,size:v}),S=DEe({locale:w.getLocale(o),format:s,firstDayOfWeek:w.getFirstDayOfWeek(i)}).map((O,E)=>k.createElement(a,{key:E,className:P.weekday},O));return k.createElement(Pe,zEe({component:"tr",ref:t,className:b(P.weekdaysRow,r)},y),S)});u9.displayName="@mantine/dates/WeekdaysRow";var FEe=Object.defineProperty,VEe=Object.defineProperties,HEe=Object.getOwnPropertyDescriptors,Iy=Object.getOwnPropertySymbols,d9=Object.prototype.hasOwnProperty,f9=Object.prototype.propertyIsEnumerable,sj=(e,t,n)=>t in e?FEe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Cp=(e,t)=>{for(var n in t||(t={}))d9.call(t,n)&&sj(e,n,t[n]);if(Iy)for(var n of Iy(t))f9.call(t,n)&&sj(e,n,t[n]);return e},zw=(e,t)=>VEe(e,HEe(t)),WEe=(e,t)=>{var n={};for(var r in e)d9.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Iy)for(var r of Iy(e))t.indexOf(r)<0&&f9.call(e,r)&&(n[r]=e[r]);return n};const UEe={size:"sm",withCellSpacing:!0},h9=_.forwardRef((e,t)=>{const n=ae("Month",UEe,e),{className:r,classNames:o,styles:i,unstyled:s,__staticSelector:a,locale:c,firstDayOfWeek:u,weekdayFormat:f,month:h,weekendDays:m,getDayProps:v,excludeDate:y,minDate:w,maxDate:P,renderDay:b,hideOutsideDates:S,hideWeekdays:O,getDayAriaLabel:E,static:$,__getDayRef:N,__onDayKeyDown:I,__onDayClick:R,__onDayMouseEnter:B,__preventFocus:z,__stopPropagation:G,withCellSpacing:Q,size:X,variant:V}=n,H=WEe(n,["className","classNames","styles","unstyled","__staticSelector","locale","firstDayOfWeek","weekdayFormat","month","weekendDays","getDayProps","excludeDate","minDate","maxDate","renderDay","hideOutsideDates","hideWeekdays","getDayAriaLabel","static","__getDayRef","__onDayKeyDown","__onDayClick","__onDayMouseEnter","__preventFocus","__stopPropagation","withCellSpacing","size","variant"]),Z=Va(),{classes:Y,cx:D}=EEe(null,{name:["Month",a],classNames:o,styles:i,unstyled:s,variant:V,size:X}),W={__staticSelector:a||"Month",classNames:o,styles:i,unstyled:s,variant:V,size:X},F=_Ee(h,Z.getFirstDayOfWeek(u)),K=$Ee(F,w,P,v,y,S,h),ee=F.map((fe,ie)=>{const J=fe.map((ne,le)=>{const _e=!n9(ne,h),Ne=E?.(ne)||he(ne).locale(c||Z.locale).format("D MMMM YYYY"),we=v?.(ne),He=he(ne).isSame(K,"date");return k.createElement("td",{key:ne.toString(),className:Y.monthCell,"data-with-spacing":Q||void 0},k.createElement(a9,zw(Cp(zw(Cp({},W),{"data-mantine-stop-propagation":G||void 0,renderDay:b,date:ne,weekend:Z.getWeekendDays(m).includes(ne.getDay()),outside:_e,hidden:S?_e:!1,"aria-label":Ne,static:$,disabled:y?.(ne)||!r9(ne,P)||!o9(ne,w),ref:Te=>N?.(ie,le,Te)}),we),{onKeyDown:Te=>{var De;(De=we?.onKeyDown)==null||De.call(we,Te),I?.(Te,{rowIndex:ie,cellIndex:le,date:ne})},onMouseEnter:Te=>{var De;(De=we?.onMouseEnter)==null||De.call(we,Te),B?.(Te,ne)},onClick:Te=>{var De;(De=we?.onClick)==null||De.call(we,Te),R?.(Te,ne)},onMouseDown:Te=>{var De;(De=we?.onMouseDown)==null||De.call(we,Te),z&&Te.preventDefault()},tabIndex:z||!He?-1:0})))});return k.createElement("tr",{key:ie,className:Y.monthRow},J)});return k.createElement(Pe,Cp({component:"table",className:D(Y.month,r),ref:t},H),!O&&k.createElement("thead",{className:Y.monthThead},k.createElement(u9,zw(Cp({},W),{locale:c,firstDayOfWeek:u,weekdayFormat:f}))),k.createElement("tbody",{className:Y.monthTbody},ee))});h9.displayName="@mantine/dates/Month";var ZEe=Object.defineProperty,Dy=Object.getOwnPropertySymbols,p9=Object.prototype.hasOwnProperty,m9=Object.prototype.propertyIsEnumerable,aj=(e,t,n)=>t in e?ZEe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Aw=(e,t)=>{for(var n in t||(t={}))p9.call(t,n)&&aj(e,n,t[n]);if(Dy)for(var n of Dy(t))m9.call(t,n)&&aj(e,n,t[n]);return e},GEe=(e,t)=>{var n={};for(var r in e)p9.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Dy)for(var r of Dy(e))t.indexOf(r)<0&&m9.call(e,r)&&(n[r]=e[r]);return n};const YEe={monthLabelFormat:"MMMM YYYY"},g9=_.forwardRef((e,t)=>{const n=ae("MonthLevel",YEe,e),{month:r,locale:o,firstDayOfWeek:i,weekdayFormat:s,weekendDays:a,getDayProps:c,excludeDate:u,minDate:f,maxDate:h,renderDay:m,hideOutsideDates:v,hideWeekdays:y,getDayAriaLabel:w,__getDayRef:P,__onDayKeyDown:b,__onDayClick:S,__onDayMouseEnter:O,withCellSpacing:E,__preventFocus:$,__stopPropagation:N,nextIcon:I,previousIcon:R,nextLabel:B,previousLabel:z,onNext:G,onPrevious:Q,onLevelClick:X,nextDisabled:V,previousDisabled:H,hasNextLevel:Z,levelControlAriaLabel:Y,withNext:D,withPrevious:W,className:F,monthLabelFormat:K,classNames:ee,styles:fe,unstyled:ie,__staticSelector:J,size:ne,variant:le,static:_e}=n,Ne=GEe(n,["month","locale","firstDayOfWeek","weekdayFormat","weekendDays","getDayProps","excludeDate","minDate","maxDate","renderDay","hideOutsideDates","hideWeekdays","getDayAriaLabel","__getDayRef","__onDayKeyDown","__onDayClick","__onDayMouseEnter","withCellSpacing","__preventFocus","__stopPropagation","nextIcon","previousIcon","nextLabel","previousLabel","onNext","onPrevious","onLevelClick","nextDisabled","previousDisabled","hasNextLevel","levelControlAriaLabel","withNext","withPrevious","className","monthLabelFormat","classNames","styles","unstyled","__staticSelector","size","variant","static"]),{classes:we,cx:He}=aEe(null,{name:["MonthLevel",J],classNames:ee,styles:fe,unstyled:ie,variant:le,size:ne}),Te=Va(),De={__staticSelector:J||"MonthLevel",classNames:ee,styles:fe,unstyled:ie,variant:le,size:ne},st=typeof V=="boolean"?V:h?!he(r).endOf("month").isBefore(h):!1,bt=typeof H=="boolean"?H:f?!he(r).startOf("month").isAfter(f):!1;return k.createElement(Pe,Aw({className:He(we.monthLevel,F),"data-month-level":!0,ref:t},Ne),k.createElement(g1,Aw({label:typeof K=="function"?K(r):he(r).locale(o||Te.locale).format(K),className:we.calendarHeader,__preventFocus:$,__stopPropagation:N,nextIcon:I,previousIcon:R,nextLabel:B,previousLabel:z,onNext:G,onPrevious:Q,onLevelClick:X,nextDisabled:st,previousDisabled:bt,hasNextLevel:Z,levelControlAriaLabel:Y,withNext:D,withPrevious:W},De)),k.createElement(h9,Aw({month:r,locale:o,firstDayOfWeek:i,weekdayFormat:s,weekendDays:a,getDayProps:c,excludeDate:u,minDate:f,maxDate:h,renderDay:m,hideOutsideDates:v,hideWeekdays:y,getDayAriaLabel:w,__getDayRef:P,__onDayKeyDown:b,__onDayClick:S,__onDayMouseEnter:O,__preventFocus:$,__stopPropagation:N,static:_e,withCellSpacing:E},De)))});g9.displayName="@mantine/dates/MonthLevel";function KEe({direction:e,levelIndex:t,rowIndex:n,cellIndex:r,size:o}){switch(e){case"up":return t===0&&n===0?null:n===0?{levelIndex:t-1,rowIndex:r<=o[t-1][o[t-1].length-1]-1?o[t-1].length-1:o[t-1].length-2,cellIndex:r}:{levelIndex:t,rowIndex:n-1,cellIndex:r};case"down":return n===o[t].length-1?{levelIndex:t+1,rowIndex:0,cellIndex:r}:n===o[t].length-2&&r>=o[t][o[t].length-1]?{levelIndex:t+1,rowIndex:0,cellIndex:r}:{levelIndex:t,rowIndex:n+1,cellIndex:r};case"left":return t===0&&n===0&&r===0?null:n===0&&r===0?{levelIndex:t-1,rowIndex:o[t-1].length-1,cellIndex:o[t-1][o[t-1].length-1]-1}:r===0?{levelIndex:t,rowIndex:n-1,cellIndex:o[t][n-1]-1}:{levelIndex:t,rowIndex:n,cellIndex:r-1};case"right":return n===o[t].length-1&&r===o[t][n]-1?{levelIndex:t+1,rowIndex:0,cellIndex:0}:r===o[t][n]-1?{levelIndex:t,rowIndex:n+1,cellIndex:0}:{levelIndex:t,rowIndex:n,cellIndex:r+1};default:return{levelIndex:t,rowIndex:n,cellIndex:r}}}function v9({controlsRef:e,direction:t,levelIndex:n,rowIndex:r,cellIndex:o,size:i}){var s,a;const c=KEe({direction:t,size:i,rowIndex:r,cellIndex:o,levelIndex:n});if(!c)return;const u=(a=(s=e.current[c.levelIndex])==null?void 0:s[c.rowIndex])==null?void 0:a[c.cellIndex];u&&(u.disabled||u.getAttribute("data-hidden")||u.getAttribute("data-outside")?v9({controlsRef:e,direction:t,levelIndex:c.levelIndex,cellIndex:c.cellIndex,rowIndex:c.rowIndex,size:i}):u.focus())}function qEe(e){switch(e){case"ArrowDown":return"down";case"ArrowUp":return"up";case"ArrowRight":return"right";case"ArrowLeft":return"left";default:return null}}function JEe(e){return e.current.map(t=>t.map(n=>n.length))}function KO({controlsRef:e,levelIndex:t,rowIndex:n,cellIndex:r,event:o}){const i=qEe(o.key);if(i){o.preventDefault();const s=JEe(e);v9({controlsRef:e,direction:i,levelIndex:t,rowIndex:n,cellIndex:r,size:s})}}var QEe=Object.defineProperty,jy=Object.getOwnPropertySymbols,y9=Object.prototype.hasOwnProperty,_9=Object.prototype.propertyIsEnumerable,lj=(e,t,n)=>t in e?QEe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,XEe=(e,t)=>{for(var n in t||(t={}))y9.call(t,n)&&lj(e,n,t[n]);if(jy)for(var n of jy(t))_9.call(t,n)&&lj(e,n,t[n]);return e},e$e=(e,t)=>{var n={};for(var r in e)y9.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&jy)for(var r of jy(e))t.indexOf(r)<0&&_9.call(e,r)&&(n[r]=e[r]);return n};const t$e={numberOfColumns:1},w9=_.forwardRef((e,t)=>{const n=ae("MonthLevelGroup",t$e,e),{month:r,locale:o,firstDayOfWeek:i,weekdayFormat:s,weekendDays:a,getDayProps:c,excludeDate:u,minDate:f,maxDate:h,renderDay:m,hideOutsideDates:v,hideWeekdays:y,getDayAriaLabel:w,__onDayClick:P,__onDayMouseEnter:b,withCellSpacing:S,__preventFocus:O,nextIcon:E,previousIcon:$,nextLabel:N,previousLabel:I,onNext:R,onPrevious:B,onLevelClick:z,nextDisabled:G,previousDisabled:Q,hasNextLevel:X,className:V,classNames:H,styles:Z,unstyled:Y,numberOfColumns:D,levelControlAriaLabel:W,monthLabelFormat:F,__staticSelector:K,__stopPropagation:ee,size:fe,variant:ie,static:J}=n,ne=e$e(n,["month","locale","firstDayOfWeek","weekdayFormat","weekendDays","getDayProps","excludeDate","minDate","maxDate","renderDay","hideOutsideDates","hideWeekdays","getDayAriaLabel","__onDayClick","__onDayMouseEnter","withCellSpacing","__preventFocus","nextIcon","previousIcon","nextLabel","previousLabel","onNext","onPrevious","onLevelClick","nextDisabled","previousDisabled","hasNextLevel","className","classNames","styles","unstyled","numberOfColumns","levelControlAriaLabel","monthLabelFormat","__staticSelector","__stopPropagation","size","variant","static"]),{classes:le,cx:_e}=iEe(null,{name:["MonthLevelGroup",K],classNames:H,styles:Z,unstyled:Y,variant:ie,size:fe}),Ne=_.useRef([]),we=Array(D).fill(0).map((He,Te)=>{const De=he(r).add(Te,"months").toDate();return k.createElement(g9,{key:Te,month:De,withNext:Te===D-1,withPrevious:Te===0,monthLabelFormat:F,__stopPropagation:ee,__onDayClick:P,__onDayMouseEnter:b,__onDayKeyDown:(st,bt)=>KO({levelIndex:Te,rowIndex:bt.rowIndex,cellIndex:bt.cellIndex,event:st,controlsRef:Ne}),__getDayRef:(st,bt,wn)=>{Array.isArray(Ne.current[Te])||(Ne.current[Te]=[]),Array.isArray(Ne.current[Te][st])||(Ne.current[Te][st]=[]),Ne.current[Te][st][bt]=wn},levelControlAriaLabel:typeof W=="function"?W(De):W,locale:o,firstDayOfWeek:i,weekdayFormat:s,weekendDays:a,getDayProps:c,excludeDate:u,minDate:f,maxDate:h,renderDay:m,hideOutsideDates:v,hideWeekdays:y,getDayAriaLabel:w,__preventFocus:O,nextIcon:E,previousIcon:$,nextLabel:N,previousLabel:I,onNext:R,onPrevious:B,onLevelClick:z,nextDisabled:G,previousDisabled:Q,hasNextLevel:X,classNames:H,styles:Z,unstyled:Y,__staticSelector:K||"MonthLevelGroup",size:fe,variant:ie,static:J,withCellSpacing:S})});return k.createElement(Pe,XEe({className:_e(le.monthLevelGroup,V),ref:t},ne),we)});w9.displayName="@mantine/dates/MonthLevelGroup";var n$e=ue((e,t,{size:n})=>({yearLevelGroup:{display:"flex","& [data-year-level]:not(:last-of-type)":{marginRight:re({size:n,sizes:e.spacing})}}}));const r$e=n$e;var o$e=ue(e=>({yearLevel:{},calendarHeader:{marginBottom:e.spacing.xs}}));const i$e=o$e;function s$e(e){const t=he(e).startOf("year").toDate(),n=[[],[],[],[]];let r=0;for(let o=0;o<4;o+=1)for(let i=0;i<3;i+=1)n[o].push(he(t).add(r,"months").toDate()),r+=1;return n}function b9(e,t,n){return!t&&!n?!1:!!(t&&he(e).isBefore(t,"month")||n&&he(e).isAfter(n,"month"))}var a$e=ue(()=>({monthsList:{borderCollapse:"collapse",borderWidth:0,cursor:"pointer"},monthsListCell:{padding:0,"&[data-with-spacing]":{padding:M(.5)}},monthsListRow:{}}));const l$e=a$e;function c$e(e,t,n,r){const o=e.flat().filter(a=>{var c;return!b9(a,t,n)&&!((c=r?.(a))!=null&&c.disabled)}),i=o.find(a=>{var c;return(c=r?.(a))==null?void 0:c.selected});if(i)return i;const s=o.find(a=>he().isSame(a,"month"));return s||o[0]}var u$e=Object.defineProperty,d$e=Object.defineProperties,f$e=Object.getOwnPropertyDescriptors,cj=Object.getOwnPropertySymbols,h$e=Object.prototype.hasOwnProperty,p$e=Object.prototype.propertyIsEnumerable,uj=(e,t,n)=>t in e?u$e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,kp=(e,t)=>{for(var n in t||(t={}))h$e.call(t,n)&&uj(e,n,t[n]);if(cj)for(var n of cj(t))p$e.call(t,n)&&uj(e,n,t[n]);return e},dj=(e,t)=>d$e(e,f$e(t)),m$e=ue((e,t,{size:n})=>{const r=e.fn.variant({variant:"filled"}),o=e.fn.variant({variant:"light"});return{pickerControl:dj(kp({fontSize:re({size:n,sizes:e.fontSizes}),height:re({size:n,sizes:Tf}),width:`calc((${re({size:n,sizes:Tf})} * 7) / 3 + ${M(1.5)})`,display:"flex",justifyContent:"center",alignItems:"center",userSelect:"none",borderRadius:e.fn.radius()},e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[0]})),{"&:active":e.activeStyles,"&[data-in-range]":kp({backgroundColor:o.background,borderRadius:0},e.fn.hover({backgroundColor:o.hover})),"&[data-first-in-range]":{borderRadius:0,borderTopLeftRadius:e.radius.sm,borderBottomLeftRadius:e.radius.sm},"&[data-last-in-range]":{borderRadius:0,borderTopRightRadius:e.radius.sm,borderBottomRightRadius:e.radius.sm},"&[data-last-in-range][data-first-in-range]":{borderRadius:e.radius.sm},"&[data-selected]":kp({color:r.color,backgroundColor:r.background},e.fn.hover({backgroundColor:r.hover})),"&[data-disabled]":dj(kp({color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[4],cursor:"not-allowed"},e.fn.hover({backgroundColor:"transparent"})),{"&:active":{transform:"none"}})})}});const g$e=m$e;var v$e=Object.defineProperty,Ly=Object.getOwnPropertySymbols,x9=Object.prototype.hasOwnProperty,S9=Object.prototype.propertyIsEnumerable,fj=(e,t,n)=>t in e?v$e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,y$e=(e,t)=>{for(var n in t||(t={}))x9.call(t,n)&&fj(e,n,t[n]);if(Ly)for(var n of Ly(t))S9.call(t,n)&&fj(e,n,t[n]);return e},_$e=(e,t)=>{var n={};for(var r in e)x9.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ly)for(var r of Ly(e))t.indexOf(r)<0&&S9.call(e,r)&&(n[r]=e[r]);return n};const w$e={size:"sm"},qO=_.forwardRef((e,t)=>{const n=ae("PickerControl",w$e,e),{className:r,children:o,disabled:i,selected:s,classNames:a,styles:c,unstyled:u,firstInRange:f,lastInRange:h,inRange:m,__staticSelector:v,size:y,variant:w}=n,P=_$e(n,["className","children","disabled","selected","classNames","styles","unstyled","firstInRange","lastInRange","inRange","__staticSelector","size","variant"]),{classes:b,cx:S}=g$e(null,{name:["PickerControl",v],classNames:a,styles:c,unstyled:u,variant:w,size:y});return k.createElement(ds,y$e({className:S(b.pickerControl,r),ref:t,unstyled:u,"data-picker-control":!0,"data-selected":s&&!i||void 0,"data-disabled":i||void 0,"data-in-range":m&&!i&&!s||void 0,"data-first-in-range":f&&!i||void 0,"data-last-in-range":h&&!i||void 0,disabled:i},P),o)});qO.displayName="@mantine/dates/PickerControl";var b$e=Object.defineProperty,x$e=Object.defineProperties,S$e=Object.getOwnPropertyDescriptors,Ry=Object.getOwnPropertySymbols,P9=Object.prototype.hasOwnProperty,O9=Object.prototype.propertyIsEnumerable,hj=(e,t,n)=>t in e?b$e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pj=(e,t)=>{for(var n in t||(t={}))P9.call(t,n)&&hj(e,n,t[n]);if(Ry)for(var n of Ry(t))O9.call(t,n)&&hj(e,n,t[n]);return e},P$e=(e,t)=>x$e(e,S$e(t)),O$e=(e,t)=>{var n={};for(var r in e)P9.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ry)for(var r of Ry(e))t.indexOf(r)<0&&O9.call(e,r)&&(n[r]=e[r]);return n};const C$e={monthsListFormat:"MMM",size:"sm",withCellSpacing:!0},C9=_.forwardRef((e,t)=>{const n=ae("MonthsList",C$e,e),{year:r,className:o,monthsListFormat:i,locale:s,minDate:a,maxDate:c,getMonthControlProps:u,classNames:f,styles:h,unstyled:m,__staticSelector:v,__getControlRef:y,__onControlKeyDown:w,__onControlClick:P,__onControlMouseEnter:b,__preventFocus:S,size:O,variant:E,__stopPropagation:$,withCellSpacing:N}=n,I=O$e(n,["year","className","monthsListFormat","locale","minDate","maxDate","getMonthControlProps","classNames","styles","unstyled","__staticSelector","__getControlRef","__onControlKeyDown","__onControlClick","__onControlMouseEnter","__preventFocus","size","variant","__stopPropagation","withCellSpacing"]),{classes:R,cx:B}=l$e(null,{name:["MonthsList",v],classNames:f,styles:h,unstyled:m,variant:E,size:O}),z=Va(),G=s$e(r),Q=c$e(G,a,c,u),X=G.map((V,H)=>{const Z=V.map((Y,D)=>{const W=u?.(Y),F=he(Y).isSame(Q,"month");return k.createElement("td",{key:D,className:R.monthsListCell,"data-with-spacing":N||void 0},k.createElement(qO,P$e(pj({variant:E,size:O,classNames:f,styles:h,unstyled:m,__staticSelector:v||"MonthsList","data-mantine-stop-propagation":$||void 0,disabled:b9(Y,a,c),ref:K=>y?.(H,D,K)},W),{onKeyDown:K=>{var ee;(ee=W?.onKeyDown)==null||ee.call(W,K),w?.(K,{rowIndex:H,cellIndex:D,date:Y})},onClick:K=>{var ee;(ee=W?.onClick)==null||ee.call(W,K),P?.(K,Y)},onMouseEnter:K=>{var ee;(ee=W?.onMouseEnter)==null||ee.call(W,K),b?.(K,Y)},onMouseDown:K=>{var ee;(ee=W?.onMouseDown)==null||ee.call(W,K),S&&K.preventDefault()},tabIndex:S||!F?-1:0}),he(Y).locale(z.getLocale(s)).format(i)))});return k.createElement("tr",{key:H,className:R.monthsListRow},Z)});return k.createElement(Pe,pj({component:"table",ref:t,className:B(R.monthsList,o)},I),k.createElement("tbody",null,X))});C9.displayName="@mantine/dates/MonthsList";var k$e=Object.defineProperty,zy=Object.getOwnPropertySymbols,k9=Object.prototype.hasOwnProperty,E9=Object.prototype.propertyIsEnumerable,mj=(e,t,n)=>t in e?k$e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Bw=(e,t)=>{for(var n in t||(t={}))k9.call(t,n)&&mj(e,n,t[n]);if(zy)for(var n of zy(t))E9.call(t,n)&&mj(e,n,t[n]);return e},E$e=(e,t)=>{var n={};for(var r in e)k9.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&zy)for(var r of zy(e))t.indexOf(r)<0&&E9.call(e,r)&&(n[r]=e[r]);return n};const $$e={yearLabelFormat:"YYYY",size:"sm"},$9=_.forwardRef((e,t)=>{const n=ae("YearLevel",$$e,e),{year:r,locale:o,minDate:i,maxDate:s,monthsListFormat:a,getMonthControlProps:c,__getControlRef:u,__onControlKeyDown:f,__onControlClick:h,__onControlMouseEnter:m,withCellSpacing:v,__preventFocus:y,nextIcon:w,previousIcon:P,nextLabel:b,previousLabel:S,onNext:O,onPrevious:E,onLevelClick:$,nextDisabled:N,previousDisabled:I,hasNextLevel:R,levelControlAriaLabel:B,withNext:z,withPrevious:G,className:Q,yearLabelFormat:X,classNames:V,styles:H,unstyled:Z,__staticSelector:Y,__stopPropagation:D,size:W,variant:F}=n,K=E$e(n,["year","locale","minDate","maxDate","monthsListFormat","getMonthControlProps","__getControlRef","__onControlKeyDown","__onControlClick","__onControlMouseEnter","withCellSpacing","__preventFocus","nextIcon","previousIcon","nextLabel","previousLabel","onNext","onPrevious","onLevelClick","nextDisabled","previousDisabled","hasNextLevel","levelControlAriaLabel","withNext","withPrevious","className","yearLabelFormat","classNames","styles","unstyled","__staticSelector","__stopPropagation","size","variant"]),{classes:ee,cx:fe}=i$e(null,{name:["YearLevel",Y],classNames:V,styles:H,unstyled:Z,size:W,variant:F}),ie=Va(),J={__staticSelector:Y||"YearLevel",classNames:V,styles:H,unstyled:Z,size:W,variant:F},ne=typeof N=="boolean"?N:s?!he(r).endOf("year").isBefore(s):!1,le=typeof I=="boolean"?I:i?!he(r).startOf("year").isAfter(i):!1;return k.createElement(Pe,Bw({className:fe(ee.yearLevel,Q),"data-year-level":!0,ref:t},K),k.createElement(g1,Bw({label:typeof X=="function"?X(r):he(r).locale(o||ie.locale).format(X),className:ee.calendarHeader,__preventFocus:y,__stopPropagation:D,nextIcon:w,previousIcon:P,nextLabel:b,previousLabel:S,onNext:O,onPrevious:E,onLevelClick:$,nextDisabled:ne,previousDisabled:le,hasNextLevel:R,levelControlAriaLabel:B,withNext:z,withPrevious:G},J)),k.createElement(C9,Bw({year:r,locale:o,minDate:i,maxDate:s,monthsListFormat:a,getMonthControlProps:c,__getControlRef:u,__onControlKeyDown:f,__onControlClick:h,__onControlMouseEnter:m,__preventFocus:y,__stopPropagation:D,withCellSpacing:v},J)))});$9.displayName="@mantine/dates/YearLevel";var M$e=Object.defineProperty,Ay=Object.getOwnPropertySymbols,M9=Object.prototype.hasOwnProperty,N9=Object.prototype.propertyIsEnumerable,gj=(e,t,n)=>t in e?M$e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,N$e=(e,t)=>{for(var n in t||(t={}))M9.call(t,n)&&gj(e,n,t[n]);if(Ay)for(var n of Ay(t))N9.call(t,n)&&gj(e,n,t[n]);return e},T$e=(e,t)=>{var n={};for(var r in e)M9.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ay)for(var r of Ay(e))t.indexOf(r)<0&&N9.call(e,r)&&(n[r]=e[r]);return n};const I$e={numberOfColumns:1,size:"sm"},T9=_.forwardRef((e,t)=>{const n=ae("YearLevelGroup",I$e,e),{year:r,locale:o,minDate:i,maxDate:s,monthsListFormat:a,getMonthControlProps:c,__onControlClick:u,__onControlMouseEnter:f,withCellSpacing:h,__preventFocus:m,nextIcon:v,previousIcon:y,nextLabel:w,previousLabel:P,onNext:b,onPrevious:S,onLevelClick:O,nextDisabled:E,previousDisabled:$,hasNextLevel:N,className:I,classNames:R,styles:B,unstyled:z,__staticSelector:G,__stopPropagation:Q,numberOfColumns:X,levelControlAriaLabel:V,yearLabelFormat:H,variant:Z,size:Y}=n,D=T$e(n,["year","locale","minDate","maxDate","monthsListFormat","getMonthControlProps","__onControlClick","__onControlMouseEnter","withCellSpacing","__preventFocus","nextIcon","previousIcon","nextLabel","previousLabel","onNext","onPrevious","onLevelClick","nextDisabled","previousDisabled","hasNextLevel","className","classNames","styles","unstyled","__staticSelector","__stopPropagation","numberOfColumns","levelControlAriaLabel","yearLabelFormat","variant","size"]),{classes:W,cx:F}=r$e(null,{name:["YearLevelGroup",G],styles:B,classNames:R,unstyled:z,variant:Z,size:Y}),K=_.useRef([]),ee=Array(X).fill(0).map((fe,ie)=>{const J=he(r).add(ie,"years").toDate();return k.createElement($9,{key:ie,variant:Z,size:Y,monthsListFormat:a,year:J,withNext:ie===X-1,withPrevious:ie===0,yearLabelFormat:H,__stopPropagation:Q,__onControlClick:u,__onControlMouseEnter:f,__onControlKeyDown:(ne,le)=>KO({levelIndex:ie,rowIndex:le.rowIndex,cellIndex:le.cellIndex,event:ne,controlsRef:K}),__getControlRef:(ne,le,_e)=>{Array.isArray(K.current[ie])||(K.current[ie]=[]),Array.isArray(K.current[ie][ne])||(K.current[ie][ne]=[]),K.current[ie][ne][le]=_e},levelControlAriaLabel:typeof V=="function"?V(J):V,locale:o,minDate:i,maxDate:s,__preventFocus:m,nextIcon:v,previousIcon:y,nextLabel:w,previousLabel:P,onNext:b,onPrevious:S,onLevelClick:O,nextDisabled:E,previousDisabled:$,hasNextLevel:N,getMonthControlProps:c,classNames:R,styles:B,unstyled:z,__staticSelector:G||"YearLevelGroup",withCellSpacing:h})});return k.createElement(Pe,N$e({className:F(W.yearLevelGroup,I),ref:t},D),ee)});T9.displayName="@mantine/dates/YearLevelGroup";var D$e=ue(e=>({decadeLevelGroup:{display:"flex",gap:e.spacing.md}}));const j$e=D$e;function I9(e){const t=e.getFullYear(),n=t-t%10;let r=0;const o=[[],[],[],[]];for(let i=0;i<4;i+=1){const s=i===3?1:3;for(let a=0;a({decadeLevel:{},calendarHeader:{marginBottom:e.spacing.xs}}));const z$e=R$e;function D9(e,t,n){return!t&&!n?!1:!!(t&&he(e).isBefore(t,"year")||n&&he(e).isAfter(n,"year"))}var A$e=ue(()=>({yearsList:{borderCollapse:"collapse",borderWidth:0},yearsListCell:{padding:0,"&[data-with-spacing]":{padding:M(.5)}},yearsListRow:{}}));const B$e=A$e;function F$e(e,t,n,r){const o=e.flat().filter(a=>{var c;return!D9(a,t,n)&&!((c=r?.(a))!=null&&c.disabled)}),i=o.find(a=>{var c;return(c=r?.(a))==null?void 0:c.selected});if(i)return i;const s=o.find(a=>he().isSame(a,"year"));return s||o[0]}var V$e=Object.defineProperty,H$e=Object.defineProperties,W$e=Object.getOwnPropertyDescriptors,By=Object.getOwnPropertySymbols,j9=Object.prototype.hasOwnProperty,L9=Object.prototype.propertyIsEnumerable,vj=(e,t,n)=>t in e?V$e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yj=(e,t)=>{for(var n in t||(t={}))j9.call(t,n)&&vj(e,n,t[n]);if(By)for(var n of By(t))L9.call(t,n)&&vj(e,n,t[n]);return e},U$e=(e,t)=>H$e(e,W$e(t)),Z$e=(e,t)=>{var n={};for(var r in e)j9.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&By)for(var r of By(e))t.indexOf(r)<0&&L9.call(e,r)&&(n[r]=e[r]);return n};const G$e={yearsListFormat:"YYYY",size:"sm",withCellSpacing:!0},R9=_.forwardRef((e,t)=>{const n=ae("YearsList",G$e,e),{decade:r,className:o,yearsListFormat:i,locale:s,minDate:a,maxDate:c,getYearControlProps:u,classNames:f,styles:h,unstyled:m,__staticSelector:v,__getControlRef:y,__onControlKeyDown:w,__onControlClick:P,__onControlMouseEnter:b,__preventFocus:S,__stopPropagation:O,size:E,variant:$,withCellSpacing:N}=n,I=Z$e(n,["decade","className","yearsListFormat","locale","minDate","maxDate","getYearControlProps","classNames","styles","unstyled","__staticSelector","__getControlRef","__onControlKeyDown","__onControlClick","__onControlMouseEnter","__preventFocus","__stopPropagation","size","variant","withCellSpacing"]),{classes:R,cx:B}=B$e(null,{name:["YearsList",v],classNames:f,styles:h,unstyled:m,variant:$,size:E}),z=Va(),G=I9(r),Q=F$e(G,a,c,u),X=G.map((V,H)=>{const Z=V.map((Y,D)=>{const W=u?.(Y),F=he(Y).isSame(Q,"year");return k.createElement("td",{key:D,className:R.yearsListCell,"data-with-spacing":N||void 0},k.createElement(qO,U$e(yj({size:E,variant:$,classNames:f,styles:h,unstyled:m,__staticSelector:v||"YearsList","data-mantine-stop-propagation":O||void 0,disabled:D9(Y,a,c),ref:K=>y?.(H,D,K)},W),{onKeyDown:K=>{var ee;(ee=W?.onKeyDown)==null||ee.call(W,K),w?.(K,{rowIndex:H,cellIndex:D,date:Y})},onClick:K=>{var ee;(ee=W?.onClick)==null||ee.call(W,K),P?.(K,Y)},onMouseEnter:K=>{var ee;(ee=W?.onMouseEnter)==null||ee.call(W,K),b?.(K,Y)},onMouseDown:K=>{var ee;(ee=W?.onMouseDown)==null||ee.call(W,K),S&&K.preventDefault()},tabIndex:S||!F?-1:0}),he(Y).locale(z.getLocale(s)).format(i)))});return k.createElement("tr",{key:H,className:R.yearsListRow},Z)});return k.createElement(Pe,yj({component:"table",ref:t,className:B(R.yearsList,o)},I),k.createElement("tbody",null,X))});R9.displayName="@mantine/dates/YearsList";var Y$e=Object.defineProperty,Fy=Object.getOwnPropertySymbols,z9=Object.prototype.hasOwnProperty,A9=Object.prototype.propertyIsEnumerable,_j=(e,t,n)=>t in e?Y$e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Fw=(e,t)=>{for(var n in t||(t={}))z9.call(t,n)&&_j(e,n,t[n]);if(Fy)for(var n of Fy(t))A9.call(t,n)&&_j(e,n,t[n]);return e},K$e=(e,t)=>{var n={};for(var r in e)z9.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Fy)for(var r of Fy(e))t.indexOf(r)<0&&A9.call(e,r)&&(n[r]=e[r]);return n};const q$e={decadeLabelFormat:"YYYY"},B9=_.forwardRef((e,t)=>{const n=ae("DecadeLevel",q$e,e),{decade:r,locale:o,minDate:i,maxDate:s,yearsListFormat:a,getYearControlProps:c,__getControlRef:u,__onControlKeyDown:f,__onControlClick:h,__onControlMouseEnter:m,withCellSpacing:v,__preventFocus:y,nextIcon:w,previousIcon:P,nextLabel:b,previousLabel:S,onNext:O,onPrevious:E,nextDisabled:$,previousDisabled:N,levelControlAriaLabel:I,withNext:R,withPrevious:B,className:z,decadeLabelFormat:G,classNames:Q,styles:X,unstyled:V,__staticSelector:H,__stopPropagation:Z,variant:Y,size:D}=n,W=K$e(n,["decade","locale","minDate","maxDate","yearsListFormat","getYearControlProps","__getControlRef","__onControlKeyDown","__onControlClick","__onControlMouseEnter","withCellSpacing","__preventFocus","nextIcon","previousIcon","nextLabel","previousLabel","onNext","onPrevious","nextDisabled","previousDisabled","levelControlAriaLabel","withNext","withPrevious","className","decadeLabelFormat","classNames","styles","unstyled","__staticSelector","__stopPropagation","variant","size"]),{classes:F,cx:K}=z$e(null,{name:["DecadeLevel",H],classNames:Q,styles:X,unstyled:V,variant:Y,size:D}),ee=Va(),[fe,ie]=L$e(r),J={__staticSelector:H||"DecadeLevel",classNames:Q,styles:X,unstyled:V,variant:Y,size:D},ne=typeof $=="boolean"?$:s?!he(ie).endOf("year").isBefore(s):!1,le=typeof N=="boolean"?N:i?!he(fe).startOf("year").isAfter(i):!1,_e=(Ne,we)=>he(Ne).locale(o||ee.locale).format(we);return k.createElement(Pe,Fw({className:K(F.decadeLevel,z),"data-decade-level":!0,ref:t},W),k.createElement(g1,Fw({label:typeof G=="function"?G(fe,ie):`${_e(fe,G)} – ${_e(ie,G)}`,className:F.calendarHeader,__preventFocus:y,__stopPropagation:Z,nextIcon:w,previousIcon:P,nextLabel:b,previousLabel:S,onNext:O,onPrevious:E,nextDisabled:ne,previousDisabled:le,hasNextLevel:!1,levelControlAriaLabel:I,withNext:R,withPrevious:B},J)),k.createElement(R9,Fw({decade:r,locale:o,minDate:i,maxDate:s,yearsListFormat:a,getYearControlProps:c,__getControlRef:u,__onControlKeyDown:f,__onControlClick:h,__onControlMouseEnter:m,__preventFocus:y,__stopPropagation:Z,withCellSpacing:v},J)))});B9.displayName="@mantine/dates/DecadeLevel";var J$e=Object.defineProperty,Vy=Object.getOwnPropertySymbols,F9=Object.prototype.hasOwnProperty,V9=Object.prototype.propertyIsEnumerable,wj=(e,t,n)=>t in e?J$e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Q$e=(e,t)=>{for(var n in t||(t={}))F9.call(t,n)&&wj(e,n,t[n]);if(Vy)for(var n of Vy(t))V9.call(t,n)&&wj(e,n,t[n]);return e},X$e=(e,t)=>{var n={};for(var r in e)F9.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Vy)for(var r of Vy(e))t.indexOf(r)<0&&V9.call(e,r)&&(n[r]=e[r]);return n};const eMe={numberOfColumns:1},H9=_.forwardRef((e,t)=>{const n=ae("DecadeLevelGroup",eMe,e),{decade:r,locale:o,minDate:i,maxDate:s,yearsListFormat:a,getYearControlProps:c,__onControlClick:u,__onControlMouseEnter:f,withCellSpacing:h,__preventFocus:m,nextIcon:v,previousIcon:y,nextLabel:w,previousLabel:P,onNext:b,onPrevious:S,nextDisabled:O,previousDisabled:E,className:$,classNames:N,styles:I,unstyled:R,__staticSelector:B,__stopPropagation:z,numberOfColumns:G,levelControlAriaLabel:Q,decadeLabelFormat:X,variant:V,size:H}=n,Z=X$e(n,["decade","locale","minDate","maxDate","yearsListFormat","getYearControlProps","__onControlClick","__onControlMouseEnter","withCellSpacing","__preventFocus","nextIcon","previousIcon","nextLabel","previousLabel","onNext","onPrevious","nextDisabled","previousDisabled","className","classNames","styles","unstyled","__staticSelector","__stopPropagation","numberOfColumns","levelControlAriaLabel","decadeLabelFormat","variant","size"]),{classes:Y,cx:D}=j$e(null,{name:["DecadeLevelGroup",B],styles:I,classNames:N,unstyled:R,variant:V,size:H}),W=_.useRef([]),F=Array(G).fill(0).map((K,ee)=>{const fe=he(r).add(ee*10,"years").toDate();return k.createElement(B9,{key:ee,variant:V,size:H,yearsListFormat:a,decade:fe,withNext:ee===G-1,withPrevious:ee===0,decadeLabelFormat:X,__onControlClick:u,__onControlMouseEnter:f,__onControlKeyDown:(ie,J)=>KO({levelIndex:ee,rowIndex:J.rowIndex,cellIndex:J.cellIndex,event:ie,controlsRef:W}),__getControlRef:(ie,J,ne)=>{Array.isArray(W.current[ee])||(W.current[ee]=[]),Array.isArray(W.current[ee][ie])||(W.current[ee][ie]=[]),W.current[ee][ie][J]=ne},levelControlAriaLabel:typeof Q=="function"?Q(fe):Q,locale:o,minDate:i,maxDate:s,__preventFocus:m,__stopPropagation:z,nextIcon:v,previousIcon:y,nextLabel:w,previousLabel:P,onNext:b,onPrevious:S,nextDisabled:O,previousDisabled:E,getYearControlProps:c,__staticSelector:B||"DecadeLevelGroup",classNames:N,styles:I,unstyled:R,withCellSpacing:h})});return k.createElement(Pe,Q$e({className:D(Y.decadeLevelGroup,$),ref:t},Z),F)});H9.displayName="@mantine/dates/DecadeLevelGroup";var tMe=Object.defineProperty,Hy=Object.getOwnPropertySymbols,W9=Object.prototype.hasOwnProperty,U9=Object.prototype.propertyIsEnumerable,bj=(e,t,n)=>t in e?tMe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ep=(e,t)=>{for(var n in t||(t={}))W9.call(t,n)&&bj(e,n,t[n]);if(Hy)for(var n of Hy(t))U9.call(t,n)&&bj(e,n,t[n]);return e},nMe=(e,t)=>{var n={};for(var r in e)W9.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Hy)for(var r of Hy(e))t.indexOf(r)<0&&U9.call(e,r)&&(n[r]=e[r]);return n};const rMe={maxLevel:"decade",minLevel:"month",__updateDateOnYearSelect:!0,__updateDateOnMonthSelect:!0},Z9=_.forwardRef((e,t)=>{const n=ae("Calendar",rMe,e),{maxLevel:r,minLevel:o,defaultLevel:i,level:s,onLevelChange:a,date:c,defaultDate:u,onDateChange:f,numberOfColumns:h,columnsToScroll:m,ariaLabels:v,onYearSelect:y,onMonthSelect:w,onYearMouseEnter:P,onMonthMouseEnter:b,__updateDateOnYearSelect:S,__updateDateOnMonthSelect:O,firstDayOfWeek:E,weekdayFormat:$,weekendDays:N,getDayProps:I,excludeDate:R,renderDay:B,hideOutsideDates:z,hideWeekdays:G,getDayAriaLabel:Q,monthLabelFormat:X,nextIcon:V,previousIcon:H,__onDayClick:Z,__onDayMouseEnter:Y,withCellSpacing:D,monthsListFormat:W,getMonthControlProps:F,yearLabelFormat:K,yearsListFormat:ee,getYearControlProps:fe,decadeLabelFormat:ie,minDate:J,maxDate:ne,locale:le,className:_e,classNames:Ne,styles:we,__staticSelector:He,unstyled:Te,variant:De,size:st,__preventFocus:bt,__stopPropagation:wn,onNextDecade:ht,onPreviousDecade:In,onNextYear:Er,onPreviousYear:lt,onNextMonth:Yn,onPreviousMonth:Jt,static:pt}=n,Po=nMe(n,["maxLevel","minLevel","defaultLevel","level","onLevelChange","date","defaultDate","onDateChange","numberOfColumns","columnsToScroll","ariaLabels","onYearSelect","onMonthSelect","onYearMouseEnter","onMonthMouseEnter","__updateDateOnYearSelect","__updateDateOnMonthSelect","firstDayOfWeek","weekdayFormat","weekendDays","getDayProps","excludeDate","renderDay","hideOutsideDates","hideWeekdays","getDayAriaLabel","monthLabelFormat","nextIcon","previousIcon","__onDayClick","__onDayMouseEnter","withCellSpacing","monthsListFormat","getMonthControlProps","yearLabelFormat","yearsListFormat","getYearControlProps","decadeLabelFormat","minDate","maxDate","locale","className","classNames","styles","__staticSelector","unstyled","variant","size","__preventFocus","__stopPropagation","onNextDecade","onPreviousDecade","onNextYear","onPreviousYear","onNextMonth","onPreviousMonth","static"]),{classes:Jr,cx:cr}=rEe(null,{name:["Calendar",He],classNames:Ne,styles:we,unstyled:Te,variant:De,size:st}),[Qr,Bt]=_o({value:s?gd(s,o,r):void 0,defaultValue:i?gd(i,o,r):void 0,finalValue:gd(void 0,o,r),onChange:a}),[Xr,hn]=_o({value:c,defaultValue:u,finalValue:null,onChange:f}),bn={__staticSelector:He||"Calendar",styles:we,classNames:Ne,unstyled:Te,variant:De,size:st},$r=m||h||1,gt=Xr||new Date,be=()=>{const xt=he(gt).add($r,"month").toDate();Yn?.(xt),hn(xt)},Le=()=>{const xt=he(gt).subtract($r,"month").toDate();Jt?.(xt),hn(xt)},eo=()=>{const xt=he(gt).add($r,"year").toDate();Er?.(xt),hn(xt)},Lt=()=>{const xt=he(gt).subtract($r,"year").toDate();lt?.(xt),hn(xt)},Zt=()=>{const xt=he(gt).add(10*$r,"year").toDate();ht?.(xt),hn(xt)},Mr=()=>{const xt=he(gt).subtract(10*$r,"year").toDate();In?.(xt),hn(xt)};return k.createElement(Pe,Ep({className:cr(Jr.calendar,_e),ref:t},Po),Qr==="month"&&k.createElement(w9,Ep({month:gt,minDate:J,maxDate:ne,firstDayOfWeek:E,weekdayFormat:$,weekendDays:N,getDayProps:I,excludeDate:R,renderDay:B,hideOutsideDates:z,hideWeekdays:G,getDayAriaLabel:Q,onNext:be,onPrevious:Le,hasNextLevel:r!=="month",onLevelClick:()=>Bt("year"),numberOfColumns:h,locale:le,levelControlAriaLabel:v?.monthLevelControl,nextLabel:v?.nextMonth,nextIcon:V,previousLabel:v?.previousMonth,previousIcon:H,monthLabelFormat:X,__onDayClick:Z,__onDayMouseEnter:Y,__preventFocus:bt,__stopPropagation:wn,static:pt,withCellSpacing:D},bn)),Qr==="year"&&k.createElement(T9,Ep({year:gt,numberOfColumns:h,minDate:J,maxDate:ne,monthsListFormat:W,getMonthControlProps:F,locale:le,onNext:eo,onPrevious:Lt,hasNextLevel:r!=="month"&&r!=="year",onLevelClick:()=>Bt("decade"),levelControlAriaLabel:v?.yearLevelControl,nextLabel:v?.nextYear,nextIcon:V,previousLabel:v?.previousYear,previousIcon:H,yearLabelFormat:K,__onControlMouseEnter:b,__onControlClick:(xt,nn)=>{O&&hn(nn),Bt(gd("month",o,r)),w?.(nn)},__preventFocus:bt,__stopPropagation:wn,withCellSpacing:D},bn)),Qr==="decade"&&k.createElement(H9,Ep({decade:gt,minDate:J,maxDate:ne,yearsListFormat:ee,getYearControlProps:fe,locale:le,onNext:Zt,onPrevious:Mr,numberOfColumns:h,nextLabel:v?.nextDecade,nextIcon:V,previousLabel:v?.previousDecade,previousIcon:H,decadeLabelFormat:ie,__onControlMouseEnter:P,__onControlClick:(xt,nn)=>{S&&hn(nn),Bt(gd("year",o,r)),y?.(nn)},__preventFocus:bt,__stopPropagation:wn,withCellSpacing:D},bn)))});Z9.displayName="@mantine/dates/Calendar";var xj=Object.getOwnPropertySymbols,oMe=Object.prototype.hasOwnProperty,iMe=Object.prototype.propertyIsEnumerable,sMe=(e,t)=>{var n={};for(var r in e)oMe.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&xj)for(var r of xj(e))t.indexOf(r)<0&&iMe.call(e,r)&&(n[r]=e[r]);return n};function aMe(e){const t=e,{maxLevel:n,minLevel:r,defaultLevel:o,level:i,onLevelChange:s,nextIcon:a,previousIcon:c,date:u,defaultDate:f,onDateChange:h,numberOfColumns:m,columnsToScroll:v,ariaLabels:y,onYearSelect:w,onMonthSelect:P,onYearMouseEnter:b,onMonthMouseEnter:S,onNextMonth:O,onPreviousMonth:E,onNextYear:$,onPreviousYear:N,onNextDecade:I,onPreviousDecade:R,withCellSpacing:B,__updateDateOnYearSelect:z,__updateDateOnMonthSelect:G,firstDayOfWeek:Q,weekdayFormat:X,weekendDays:V,getDayProps:H,excludeDate:Z,renderDay:Y,hideOutsideDates:D,hideWeekdays:W,getDayAriaLabel:F,monthLabelFormat:K,monthsListFormat:ee,getMonthControlProps:fe,yearLabelFormat:ie,yearsListFormat:J,getYearControlProps:ne,decadeLabelFormat:le,allowSingleDateInRange:_e,allowDeselect:Ne,minDate:we,maxDate:He,locale:Te}=t,De=sMe(t,["maxLevel","minLevel","defaultLevel","level","onLevelChange","nextIcon","previousIcon","date","defaultDate","onDateChange","numberOfColumns","columnsToScroll","ariaLabels","onYearSelect","onMonthSelect","onYearMouseEnter","onMonthMouseEnter","onNextMonth","onPreviousMonth","onNextYear","onPreviousYear","onNextDecade","onPreviousDecade","withCellSpacing","__updateDateOnYearSelect","__updateDateOnMonthSelect","firstDayOfWeek","weekdayFormat","weekendDays","getDayProps","excludeDate","renderDay","hideOutsideDates","hideWeekdays","getDayAriaLabel","monthLabelFormat","monthsListFormat","getMonthControlProps","yearLabelFormat","yearsListFormat","getYearControlProps","decadeLabelFormat","allowSingleDateInRange","allowDeselect","minDate","maxDate","locale"]);return{calendarProps:{maxLevel:n,minLevel:r,defaultLevel:o,level:i,onLevelChange:s,nextIcon:a,previousIcon:c,date:u,defaultDate:f,onDateChange:h,numberOfColumns:m,columnsToScroll:v,ariaLabels:y,onYearSelect:w,onMonthSelect:P,onYearMouseEnter:b,onMonthMouseEnter:S,onNextMonth:O,onPreviousMonth:E,onNextYear:$,onPreviousYear:N,onNextDecade:I,onPreviousDecade:R,withCellSpacing:B,__updateDateOnYearSelect:z,__updateDateOnMonthSelect:G,firstDayOfWeek:Q,weekdayFormat:X,weekendDays:V,getDayProps:H,excludeDate:Z,renderDay:Y,hideOutsideDates:D,hideWeekdays:W,getDayAriaLabel:F,monthLabelFormat:K,monthsListFormat:ee,getMonthControlProps:fe,yearLabelFormat:ie,yearsListFormat:J,getYearControlProps:ne,decadeLabelFormat:le,allowSingleDateInRange:_e,allowDeselect:Ne,minDate:we,maxDate:He,locale:Te},others:De}}function lMe(e,t){if(t==="range"&&Array.isArray(e)){const[n,r]=e;return n?r?`${n.toISOString()} – ${r.toISOString()}`:`${n.toISOString()} –`:""}return t==="multiple"&&Array.isArray(e)?e.map(n=>n.toISOString()).join(", "):!Array.isArray(e)&&e?e.toISOString():""}function G9({value:e,type:t,name:n,form:r}){return k.createElement("input",{type:"hidden",value:lMe(e,t),name:n,form:r})}G9.displayName="@mantine/dates/HiddenDatesInput";const Sj=e=>e==="range"?[null,null]:e==="multiple"?[]:null;function Y9({type:e,value:t,defaultValue:n,onChange:r}){const o=_.useRef(e),[i,s]=_o({value:t,defaultValue:n,onChange:r,finalValue:Sj(e)});let a=i;return o.current!==e&&(o.current=e,t===void 0&&(a=n!==void 0?n:Sj(e),s(a))),[a,s]}function Pj(e,t){const n=[...t].sort((r,o)=>r.getTime()-o.getTime());return he(n[0]).startOf("day").subtract(1,"ms").isBefore(e)&&he(n[1]).endOf("day").add(1,"ms").isAfter(e)}function cMe({type:e,level:t,value:n,defaultValue:r,onChange:o,allowSingleDateInRange:i,allowDeselect:s,onMouseLeave:a}){const[c,u]=Y9({type:e,value:n,defaultValue:r,onChange:o}),[f,h]=_.useState(e==="range"&&c[0]&&!c[1]?c[0]:null),[m,v]=_.useState(null),y=$=>{if(e==="range"){if(f instanceof Date&&!c[1]){if(he($).isSame(f,t)&&!i){h(null),v(null),u([null,null]);return}const N=[$,f];N.sort((I,R)=>I.getTime()-R.getTime()),u(N),v(null),h(null);return}if(c[0]&&!c[1]&&he($).isSame(c[0],t)&&!i){h(null),v(null),u([null,null]);return}u([$,null]),v(null),h($);return}if(e==="multiple"){c.some(N=>he(N).isSame($,t))?u(c.filter(N=>!he(N).isSame($,t))):u([...c,$]);return}c&&s&&he($).isSame(c,t)?u(null):u($)},w=$=>f instanceof Date&&m instanceof Date?Pj($,[m,f]):c[0]instanceof Date&&c[1]instanceof Date?Pj($,c):!1,P=e==="range"?$=>{a?.($),v(null)}:a,b=$=>c[0]instanceof Date&&he($).isSame(c[0],t)?!(m&&he(m).isBefore(c[0])):!1,S=$=>c[1]instanceof Date?he($).isSame(c[1],t):!(c[0]instanceof Date)||!m?!1:he(m).isBefore(c[0])&&he($).isSame(c[0],t);return{onDateChange:y,onRootMouseLeave:P,onHoveredDateChange:e==="range"&&f?v:()=>{},getControlProps:$=>{if(e==="range")return{selected:c.some(I=>I&&he(I).isSame($,t)),inRange:w($),firstInRange:b($),lastInRange:S($),"data-autofocus":!!c[0]&&he(c[0]).isSame($,t)||void 0};if(e==="multiple")return{selected:c.some(I=>I&&he(I).isSame($,t)),"data-autofocus":!!c[0]&&he(c[0]).isSame($,t)||void 0};const N=he(c).isSame($,t);return{selected:N,"data-autofocus":N||void 0}},_value:c,setValue:u}}var uMe=Object.defineProperty,Wy=Object.getOwnPropertySymbols,K9=Object.prototype.hasOwnProperty,q9=Object.prototype.propertyIsEnumerable,Oj=(e,t,n)=>t in e?uMe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Vw=(e,t)=>{for(var n in t||(t={}))K9.call(t,n)&&Oj(e,n,t[n]);if(Wy)for(var n of Wy(t))q9.call(t,n)&&Oj(e,n,t[n]);return e},dMe=(e,t)=>{var n={};for(var r in e)K9.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Wy)for(var r of Wy(e))t.indexOf(r)<0&&q9.call(e,r)&&(n[r]=e[r]);return n};const fMe={type:"default",numberOfColumns:1},J9=_.forwardRef((e,t)=>{const n=ae("DatePicker",fMe,e),{type:r,defaultValue:o,value:i,onChange:s,__staticSelector:a,getDayProps:c,allowSingleDateInRange:u,allowDeselect:f,onMouseLeave:h,numberOfColumns:m}=n,v=dMe(n,["type","defaultValue","value","onChange","__staticSelector","getDayProps","allowSingleDateInRange","allowDeselect","onMouseLeave","numberOfColumns"]),{onDateChange:y,onRootMouseLeave:w,onHoveredDateChange:P,getControlProps:b}=cMe({type:r,level:"day",allowDeselect:f,allowSingleDateInRange:u,value:i,defaultValue:o,onChange:s,onMouseLeave:h});return k.createElement(Z9,Vw({ref:t,minLevel:"month",__staticSelector:a||"DatePicker",onMouseLeave:w,hideOutsideDates:m!==1,numberOfColumns:m,__onDayMouseEnter:(S,O)=>P(O),__onDayClick:(S,O)=>y(O),getDayProps:S=>Vw(Vw({},b(S)),c?.(S))},v))});J9.displayName="@mantine/dates/DatePicker";function hMe({type:e,date:t,locale:n,format:r,labelSeparator:o}){const i=s=>he(s).locale(n).format(r);return e==="default"?t===null?"":i(t):e==="multiple"?t.map(i).join(", "):e==="range"?t[0]&&t[1]?`${i(t[0])} ${o} ${i(t[1])}`:t[0]?`${i(t[0])} ${o} `:"":""}function pMe({type:e,value:t,defaultValue:n,onChange:r,locale:o,format:i,closeOnChange:s,sortDates:a,labelSeparator:c}){const u=Va(),[f,h]=NS(!1),[m,v]=Y9({type:e,value:t,defaultValue:n,onChange:r}),y=hMe({type:e,date:m,locale:u.getLocale(o),format:i,labelSeparator:u.getLabelSeparator(c)}),w=S=>{s&&(e==="default"&&h.close(),e==="range"&&S[0]&&S[1]&&h.close()),v(a&&e==="multiple"?[...S].sort((O,E)=>O.getTime()-E.getTime()):S)},P=()=>w(e==="range"?[null,null]:e==="multiple"?[]:null),b=e==="range"?!!m[0]:e==="multiple"?m.length>0:m!==null;return{_value:m,setValue:w,onClear:P,shouldClear:b,formattedValue:y,dropdownOpened:f,dropdownHandlers:h}}function mMe({minDate:e,maxDate:t}){const n=new Date;return!e&&!t?n:he(n).isBefore(e)?e:he(n).isAfter(t)?t:n}var gMe=ue(()=>({placeholder:{},input:{cursor:"pointer",lineHeight:"unset","&[data-read-only]":{cursor:"default"}}}));const vMe=gMe;var yMe=Object.defineProperty,_Me=Object.defineProperties,wMe=Object.getOwnPropertyDescriptors,Uy=Object.getOwnPropertySymbols,Q9=Object.prototype.hasOwnProperty,X9=Object.prototype.propertyIsEnumerable,Cj=(e,t,n)=>t in e?yMe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,el=(e,t)=>{for(var n in t||(t={}))Q9.call(t,n)&&Cj(e,n,t[n]);if(Uy)for(var n of Uy(t))X9.call(t,n)&&Cj(e,n,t[n]);return e},kj=(e,t)=>_Me(e,wMe(t)),bMe=(e,t)=>{var n={};for(var r in e)Q9.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Uy)for(var r of Uy(e))t.indexOf(r)<0&&X9.call(e,r)&&(n[r]=e[r]);return n};const xMe={},eV=_.forwardRef((e,t)=>{const n=AP("PickerInputBase",xMe,e),{inputProps:r,wrapperProps:o,placeholder:i,classNames:s,styles:a,unstyled:c,popoverProps:u,modalProps:f,dropdownType:h,children:m,formattedValue:v,dropdownHandlers:y,dropdownOpened:w,onClick:P,clearable:b,onClear:S,clearButtonProps:O,rightSection:E,shouldClear:$,readOnly:N,disabled:I,value:R,name:B,form:z,type:G}=n,Q=bMe(n,["inputProps","wrapperProps","placeholder","classNames","styles","unstyled","popoverProps","modalProps","dropdownType","children","formattedValue","dropdownHandlers","dropdownOpened","onClick","clearable","onClear","clearButtonProps","rightSection","shouldClear","readOnly","disabled","value","name","form","type"]),{classes:X,cx:V}=vMe(null,{name:r.__staticSelector,classNames:s,styles:a,unstyled:c,variant:r.variant,size:r.size}),H=E||(b&&$&&!N&&!I?k.createElement(j0,el({variant:"transparent",onClick:S,unstyled:c,size:r.size},O)):null),Z=()=>{G==="range"&&R[0]&&!R[1]&&S(),y.close()},Y=o.label;return k.createElement(k.Fragment,null,h==="modal"&&!N&&k.createElement(Bi,el({opened:w,onClose:Z,withCloseButton:!1,size:"auto","data-dates-modal":!0,unstyled:c},f),m),k.createElement(et.Wrapper,el({},o),k.createElement(En,el({position:"bottom-start",opened:w,onClose:Z,disabled:h==="modal"||N,trapFocus:!0,returnFocus:!0,unstyled:c},u),k.createElement(En.Target,{shouldOverrideDefaultTargetId:!Y},k.createElement(et,el(kj(el({"aria-label":v,"data-dates-input":!0,"data-read-only":N||void 0,disabled:I,component:"button",type:"button",multiline:!0,onClick:D=>{P?.(D),y.toggle()},rightSection:H},r),{ref:t,classNames:kj(el({},s),{input:V(X.input,s?.input)})}),Q),v||k.createElement(et.Placeholder,{className:X.placeholder,sx:{color:r.error?"inherit":void 0}},i))),k.createElement(En.Dropdown,{"data-dates-dropdown":!0},m))),k.createElement(G9,{value:R,name:B,form:z,type:G}))});eV.displayName="@mantine/dates/PickerInputBase";var SMe=Object.defineProperty,PMe=Object.defineProperties,OMe=Object.getOwnPropertyDescriptors,Zy=Object.getOwnPropertySymbols,tV=Object.prototype.hasOwnProperty,nV=Object.prototype.propertyIsEnumerable,Ej=(e,t,n)=>t in e?SMe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$j=(e,t)=>{for(var n in t||(t={}))tV.call(t,n)&&Ej(e,n,t[n]);if(Zy)for(var n of Zy(t))nV.call(t,n)&&Ej(e,n,t[n]);return e},CMe=(e,t)=>PMe(e,OMe(t)),kMe=(e,t)=>{var n={};for(var r in e)tV.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Zy)for(var r of Zy(e))t.indexOf(r)<0&&nV.call(e,r)&&(n[r]=e[r]);return n};const EMe={type:"default",valueFormat:"MMMM D, YYYY",closeOnChange:!0,sortDates:!0,dropdownType:"popover"},JO=_.forwardRef((e,t)=>{const n=ae("DatePickerInput",EMe,e),{type:r,value:o,defaultValue:i,onChange:s,valueFormat:a,labelSeparator:c,locale:u,classNames:f,styles:h,unstyled:m,closeOnChange:v,size:y,variant:w,dropdownType:P,sortDates:b,maxDate:S,minDate:O,defaultDate:E}=n,$=kMe(n,["type","value","defaultValue","onChange","valueFormat","labelSeparator","locale","classNames","styles","unstyled","closeOnChange","size","variant","dropdownType","sortDates","maxDate","minDate","defaultDate"]),{calendarProps:N,others:I}=aMe($),{_value:R,setValue:B,formattedValue:z,dropdownHandlers:G,dropdownOpened:Q,onClear:X,shouldClear:V}=pMe({type:r,value:o,defaultValue:i,onChange:s,locale:u,format:a,labelSeparator:c,closeOnChange:v,sortDates:b}),H=E||mMe({maxDate:S,minDate:O});return k.createElement(eV,$j({formattedValue:z,dropdownOpened:Q,dropdownHandlers:G,classNames:f,styles:h,unstyled:m,__staticSelector:"DatePickerInput",ref:t,onClear:X,shouldClear:V,value:R,type:r,size:y,variant:w,dropdownType:P},I),k.createElement(J9,CMe($j({},N),{size:y,variant:w,type:r,value:R,defaultDate:Array.isArray(R)?R[0]||H:R||H,onChange:B,locale:u,classNames:f,styles:h,unstyled:m,__staticSelector:"DatePickerInput",__stopPropagation:P==="popover",maxDate:S,minDate:O})))});JO.displayName="@mantine/dates/DatePickerInput";const v1=tn(e=>({selectedCharges:[],setSelectedCharges:t=>e(n=>({selectedCharges:typeof t=="function"?t(n.selectedCharges):t})),setSelectedCharge:(t,n)=>{e(r=>({selectedCharges:r.selectedCharges.map(o=>o.label===t?n(o):o)}))}})),$Me=ue(e=>({wrapper:{width:105,display:"flex",alignItems:"center",justifyContent:"space-between",padding:`${M(.5)} ${e.spacing.xs}`,borderRadius:e.radius.sm,border:`${M(1)} solid ${e.colorScheme==="dark"?"transparent":e.colors.gray[3]}`,backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.white,"&:focus-within":{borderColor:e.colors[e.primaryColor][6]}},control:{backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white,border:`${M(1)} solid ${e.colorScheme==="dark"?"transparent":e.colors.gray[3]}`,"&:disabled":{borderColor:e.colorScheme==="dark"?"transparent":e.colors.gray[3],opacity:.8,backgroundColor:"transparent"}},input:{textAlign:"center",paddingRight:`${e.spacing.md} !important`,paddingLeft:`${e.spacing.sm} !important`,height:M(18),flex:1,"&:disabled":{backgroundColor:"#2C2E33",cursor:"auto",color:"#C1C2C5"}}})),MMe=({charge:e,index:t})=>{const{classes:n}=$Me(),{setSelectedCharge:r,setSelectedCharges:o}=v1();return p.jsxs("div",{className:"edit-charges-modal-charge-card",children:[p.jsx(U,{fz:"sm",fw:500,c:"white",style:{textAlign:"center"},children:e.label}),p.jsxs("div",{style:{display:"flex",gap:5,justifyContent:"center"},children:[p.jsxs(mt,{radius:"xs",variant:"filled",style:{backgroundColor:"rgb(42, 42, 42)",color:"white",fontSize:10,padding:12.5,margin:5,fontWeight:500},children:["$",e.fine," fine"]}),p.jsxs(mt,{radius:"xs",variant:"filled",style:{backgroundColor:"rgb(42, 42, 42)",color:"white",fontSize:10,padding:12.5,margin:5,fontWeight:500},children:[e.time," month(s)"]}),p.jsxs(mt,{radius:"xs",variant:"filled",style:{backgroundColor:"rgb(42, 42, 42)",color:"white",fontSize:10,padding:12.5,margin:5,fontWeight:500},children:[e.points," point(s)"]})]}),p.jsx(zt,{label:e.description,multiline:!0,withArrow:!0,color:"gray",children:p.jsx(U,{fz:"xs",fw:500,mt:5,style:{textAlign:"center"},lineClamp:2,children:e.description})}),p.jsxs(nt,{position:"apart",style:{gap:5},children:[p.jsx(mt,{radius:"xs",variant:"filled",style:{fontSize:10,padding:12.5,fontWeight:500},color:e.type.toLocaleLowerCase()==="felony"?"red":e.type.toLocaleLowerCase()==="infraction"?"green":"yellow",children:e.type}),p.jsxs(nt,{style:{gap:5},children:[p.jsx(zt,{label:j.remove_charge,withArrow:!0,color:"gray",children:p.jsx(Xe,{onClick:()=>{o(i=>i.filter((s,a)=>a!==t))},h:31,className:"action-icon",children:p.jsx(K0,{size:18})})}),p.jsxs("div",{className:n.wrapper,children:[p.jsx(Xe,{size:18,variant:"transparent",onClick:()=>r(e.label,i=>({...i,count:--i.count})),disabled:e.count===1,className:n.control,onMouseDown:i=>i.preventDefault(),children:p.jsx(Cme,{size:"1rem",stroke:1.5})}),p.jsx(_a,{variant:"unstyled",min:1,max:99,value:e.count,classNames:{input:n.input},disabled:!0}),p.jsx(Xe,{size:18,variant:"transparent",onClick:()=>r(e.label,i=>({...i,count:++i.count})),className:n.control,onMouseDown:i=>i.preventDefault(),children:p.jsx(Iu,{size:"1rem",stroke:1.5})})]})]})]})]})},NMe=e=>{const t={reduction:null,fine:0,time:0,points:0};for(let n=0;n{const[t,n]=_.useState(!1),{selectedCharges:r,setSelectedCharges:o}=v1(),{setCriminal:i}=Yr();return p.jsx(at,{variant:"light",color:"gray",loading:t,onClick:async()=>{n(!0);const s=await me("getRecommendedWarrantExpiry",r,{data:Date.now()});i(e.citizenid,a=>({...a,charges:r,penalty:NMe(r),warrantExpiry:new Date(s)})),n(!1),o([]),ke.closeAll()},children:j.confirm})},IMe=({criminal:e})=>{const{selectedCharges:t,setSelectedCharges:n}=v1(),{charges:r}=th(),[o,i]=_.useState({}),[s,a]=_.useState(!1),[c,u]=_.useState(null),f=500,[h,m]=_.useState(""),[v,y]=_.useState(h);return _.useEffect(()=>{c!==null&&clearTimeout(c),a(!0);const w=setTimeout(()=>{y(h),a(!1)},f);return u(w),()=>{clearTimeout(w)}},[h]),_.useEffect(()=>{if(v.trim()==="")i(r);else{const w=Object.entries(r).reduce((P,[b,S])=>{const O=v.trim()?S.filter(E=>E.label.toLowerCase().includes(v.toLowerCase())):S;return O.length>0&&(P[b]=O),P},{});i(w)}},[v,r]),p.jsxs("div",{className:"edit-charges-modal",children:[p.jsx(Ye,{}),p.jsxs("div",{className:"edit-charges-modal-content",children:[p.jsxs("div",{className:"edit-charges-modal-current-charges",children:[p.jsx(U,{fz:"md",fw:500,c:"white",mb:5,children:j.current_charges}),p.jsx(At,{h:620,children:p.jsx("div",{className:"edit-charges-modal-added-charges",children:t.map((w,P)=>p.jsx(MMe,{charge:w,index:P},P))})}),p.jsx(TMe,{criminal:e})]}),p.jsx(Ye,{orientation:"vertical"}),p.jsxs("div",{className:"edit-charges-modal-all-charges",children:[p.jsxs("div",{className:"edit-charges-modal-all-charges-header",children:[p.jsx(U,{fz:"md",fw:500,c:"white",mb:5,children:j.all_charges}),p.jsx(_n,{radius:"xs",variant:"filled",placeholder:j.search,w:300,value:h,onChange:w=>m(w.target.value)})]}),p.jsx(At,{h:635,children:p.jsx("div",{className:"edit-charges-modal-all-charges-list",children:s?p.jsx("div",{style:{display:"flex",width:"100%",marginTop:100,justifyContent:"center",alignItems:"center"},children:p.jsx(en,{})}):p.jsx(p.Fragment,{children:Object.entries(o).map(([w,P])=>p.jsxs("div",{children:[p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:w}),p.jsx("div",{className:"edit-charges-modal-charges-content",children:P.map((b,S)=>p.jsxs("div",{className:"edit-charges-modal-charge-card",children:[p.jsx(U,{fz:"sm",fw:500,c:"white",style:{textAlign:"center"},children:b.label}),p.jsxs("div",{style:{display:"flex",gap:5,justifyContent:"center"},children:[p.jsxs(mt,{radius:"xs",variant:"filled",style:{backgroundColor:"rgb(42, 42, 42)",color:"white",fontSize:10,padding:12.5,margin:5,fontWeight:500},children:["$",b.fine," fine"]}),p.jsxs(mt,{radius:"xs",variant:"filled",style:{backgroundColor:"rgb(42, 42, 42)",color:"white",fontSize:10,padding:12.5,margin:5,fontWeight:500},children:[b.time," ",j.months]}),p.jsxs(mt,{radius:"xs",variant:"filled",style:{backgroundColor:"rgb(42, 42, 42)",color:"white",fontSize:10,padding:12.5,margin:5,fontWeight:500},children:[b.points," ",j.points]})]}),p.jsx(zt,{label:b.description,multiline:!0,withArrow:!0,color:"gray",children:p.jsx(U,{fz:"xs",fw:500,mt:5,style:{textAlign:"center"},lineClamp:2,children:b.description})}),p.jsxs(nt,{position:"apart",children:[p.jsx(mt,{radius:"xs",variant:"filled",style:{fontSize:10,padding:12.5,fontWeight:500},color:b.type.toLocaleLowerCase()==="felony"?"red":b.type.toLocaleLowerCase()==="infraction"?"green":"yellow",children:b.type}),p.jsx(zt,{label:j.add_charge,withArrow:!0,color:"gray",children:p.jsx(Xe,{onClick:()=>n(O=>{const E=O.findIndex($=>$.label===b.label);return E===-1?[...O,{...b,count:1}]:O.map(($,N)=>N===E?{...$,count:++$.count}:$)}),h:31,className:"action-icon",children:p.jsx(Iu,{size:18})})})]})]},S))})]},w))})})})]})]})]})},rV=e=>Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:0}).format(e),Mj=[25,50,75,80,90],Gy=(e,t)=>t?Math.round(e-t/100*e):e,DMe=e=>{const t=[];if(!e)return[];for(let n=0;n{const{incident:t,setCriminals:n,setCriminal:r}=Yr(),{setSelectedCharges:o}=v1(),{setSelectedProfile:i}=bs(),s=Kl();return p.jsxs("div",{className:"incident-criminal-card-background",children:[p.jsxs("div",{className:"incident-criminal-card-header",children:[p.jsxs(U,{style:{fontSize:15,color:"white"},weight:600,children:[e.firstname," ",e.lastname]}),p.jsxs("div",{className:"incident-criminal-card-buttons",children:[p.jsx(zt,{label:j.remove_criminal,withArrow:!0,color:"gray",position:"bottom",children:p.jsx(Xe,{variant:"light",color:"red",onClick:()=>{ke.openConfirmModal({title:p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:j.remove_criminal}),size:"sm",centered:!0,labels:{confirm:j.confirm,cancel:j.cancel},groupProps:{spacing:6},confirmProps:{color:"red"},onConfirm:async()=>{await me("removeCriminal",{id:t.id,criminalId:e.citizenid},{data:1})&&n(c=>c.filter(u=>u.citizenid!==e.citizenid))},children:p.jsx(U,{size:"sm",c:"dark.2",children:j.remove_criminal_confirm.format(e.firstname,e.lastname)})})},children:p.jsx(K0,{size:16,color:"white"})})}),p.jsx(zt,{label:j.go_to_profile,withArrow:!0,color:"gray",position:"bottom",children:p.jsx(Xe,{variant:"light",color:"dark",onClick:async()=>{if(!it()){const a=await me("getProfile",e.citizenid);i(a)}s("/profiles")},children:p.jsx(zme,{size:16,color:"white"})})}),p.jsx(zt,{label:j.save_criminal,withArrow:!0,color:"gray",position:"bottom",children:p.jsx(Xe,{variant:"light",color:"dark",onClick:()=>{me("saveCriminal",{id:t.id,criminal:{...e,warrantExpiry:e.warrantExpiry?he(e.warrantExpiry).format("YYYY-MM-DD HH:mm:ss"):null}},{data:1})},children:p.jsx(t7,{size:16,color:"white"})})})]})]}),p.jsxs(U,{color:"dimmed",size:"xs",children:["#",e.citizenid]}),p.jsxs("div",{className:"incident-criminal-content",children:[p.jsxs("div",{className:"incident-criminal-edit-charges-badges",children:[p.jsx(mt,{radius:"xs",variant:"light",style:{color:"white",fontSize:10,padding:12.5,cursor:"pointer",backgroundColor:"#343a40"},w:125,onClick:()=>{o(e.charges),ke.open({title:p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:j.edit_charges}),styles:{body:{height:700,overflow:"hidden"},content:{width:1400}},centered:!0,size:1445,children:p.jsx(IMe,{criminal:e})})},children:j.edit_charges}),e.charges.map((a,c)=>p.jsxs(mt,{radius:"xs",variant:"filled",style:{fontSize:10,padding:12.5,fontWeight:500},color:a.type.toLowerCase()==="felony"?"red":a.type.toLowerCase()==="infraction"?"green":"yellow",children:[a.count,"x ",a.label]},c))]}),p.jsx(Ye,{style:{width:"100%"}}),p.jsx(vr,{label:j.issue_warrant,description:j.issue_warrant_description,checked:e.issueWarrant,onChange:()=>r(e.citizenid,a=>({...a,issueWarrant:!a.issueWarrant}))}),e.issueWarrant?p.jsx(JO,{icon:p.jsx(tO,{size:20}),label:j.warrant_expiration_date,weekendDays:[],minDate:new Date,value:e.warrantExpiry?new Date(e.warrantExpiry):null,onChange:a=>{r(e.citizenid,c=>({...c,warrantExpiry:a}))}}):p.jsxs(p.Fragment,{children:[p.jsx(jl,{label:j.reduction,value:e.penalty.reduction?e.penalty.reduction.toString():null,data:DMe(e.penalty),icon:p.jsx(tme,{size:20}),onChange:a=>r(e.citizenid,c=>({...c,penalty:c.penalty?{...c.penalty,reduction:a?+a:null}:{reduction:a?+a:null,time:0,fine:0,points:0}})),clearable:!0,placeholder:j.no_reduction,variant:"filled"}),p.jsxs(nt,{children:[p.jsxs(U,{size:"xs",style:{color:"white"},children:[j.time,":"," ",Gy(e.penalty.time,e.penalty.reduction)," ",j.months]}),p.jsxs(U,{size:"xs",style:{color:"white"},children:[j.fine,":"," ",rV(Gy(e.penalty.fine,e.penalty.reduction))]})]}),p.jsxs(nt,{children:[p.jsx(vr,{label:j.pleaded_guilty,checked:e.pleadedGuilty,onChange:()=>r(e.citizenid,a=>({...a,pleadedGuilty:!a.pleadedGuilty}))}),p.jsx(vr,{label:j.processed,checked:e.processed,onChange:()=>r(e.citizenid,a=>({...a,processed:!a.processed}))})]})]})]})]})},LMe=()=>{const{incident:e,isIncidentActive:t}=Yr();return t?p.jsx(At,{h:860,children:p.jsxs("div",{className:"incident-criminals-content-width",children:[p.jsxs(at,{fullWidth:!0,variant:"light",color:"gray",onClick:()=>ke.open({title:p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:j.add_criminal}),centered:!0,size:"sm",children:p.jsx(T2e,{})}),children:[p.jsx(l7,{size:M(18),style:{marginRight:5}})," ",j.add_criminal]}),e.criminals.map(n=>p.jsx(jMe,{criminal:n},n.citizenid))]})}):p.jsx("div",{className:"content-width",children:p.jsx("div",{className:"card-background",children:p.jsxs("div",{className:"profile-no-selected",children:[p.jsx(G0,{size:M(50),color:"white"}),p.jsx(U,{style:{fontSize:15,color:"white"},weight:600,children:j.no_incident_selected})]})})})},RMe=()=>{const{setActiveIncident:e,setIncidentActive:t}=Yr(),[n,r]=_.useState(!1),o=async i=>{r(!0);const s=await me("getIncident",i.id,{data:{id:1,officersInvolved:[],evidence:[],title:i.title,description:"

",criminals:[]}});e(s),t(!0),r(!1)};return p.jsxs("div",{className:"incidents",children:[p.jsx(P2e,{handleIncidentClick:o}),p.jsx(V0,{visible:n,overlayOpacity:.97,overlayColor:"rgb(34, 35, 37)",transitionDuration:250,loader:YO,style:{left:795,width:935,height:"96%",top:19,borderRadius:"0.25rem"}}),p.jsx($2e,{}),p.jsx(LMe,{})]})};const zMe=[{firstname:"John",lastname:"Doe",callsign:"1A-01",citizenid:"ABCD1234",playerId:1,position:[0,0,0],unitId:1,image:"",title:"Chief",apu:!0,air:!0,mc:!0,k9:!0,fto:!0,lastActive:Date.now()},{firstname:"Jenna",lastname:"Doe",callsign:"1A-02",citizenid:"ABCD1235",playerId:2,position:[0,0,0],image:"",title:"Captain",apu:!1,air:!0,mc:!0,k9:!1,fto:!1,lastActive:Date.now()}],Ru=tn(e=>({rosterOfficers:it()?zMe:[],getRosterOfficers:async()=>{try{const t=await me("fetchRoster");return e({rosterOfficers:t}),{rosterOfficers:t}}catch(t){return console.error("Failed to fetch recent activities:",t),{rosterOfficers:[]}}},setRosterOfficers:t=>{e(n=>({rosterOfficers:typeof t=="function"?t(n.rosterOfficers):t}))}})),AMe=({officer:e})=>{const[t,n]=_.useState(!1),{setRosterOfficers:r}=Ru(),o=ql({initialValues:{callsign:e.callsign}});return p.jsx("form",{onSubmit:o.onSubmit(async i=>{n(!0);const s=await me("setOfficerCallSign",{citizenid:e.citizenid,callsign:i.callsign},{data:!0,delay:500});if(n(!1),!s)return o.setFieldError("callSign",j.callsign_in_use);r(a=>a.map(c=>c.citizenid===e.citizenid?{...e,callsign:i.callsign}:c)),ke.closeAll()}),children:p.jsxs(Je,{children:[p.jsx(_n,{label:j.callsign,...o.getInputProps("callsign")}),p.jsx(at,{type:"submit",color:"gray",loading:t,variant:"light",children:j.confirm})]})})},BMe=({officer:e})=>{const t=["Cadet","Probationary Trooper","Trooper","Senior Trooper","Master Trooper","Corporal","Sergeant","Lieutenant","Captain","Assistant Chief","Chief"],[n,r]=_.useState(null),[o,i]=_.useState(!1),{setRosterOfficers:s}=Ru(),a=async()=>{n===null||(i(!0),!await me("setOfficerRank",{citizenId:e.citizenid,grade:+n},{data:!0}))||(s(u=>u.map(f=>f.citizenid===e.citizenid?{...e,title:`${t[n]}`}:f)),i(!1),ke.closeAll())};return p.jsxs(Je,{children:[p.jsx(jl,{withinPortal:!0,value:n!==null?n.toString():null,data:t?t.map((c,u)=>({label:c,value:u.toString()})):[],onChange:c=>r(c!==null?+c:null),label:j.rank}),p.jsx(at,{variant:"light",color:"gray",onClick:a,loading:o,children:j.confirm})]})},FMe=({officer:e})=>{const[t,n]=_.useState(!1),{setRosterOfficers:r}=Ru(),[o,i]=_.useState(e.apu||!1),[s,a]=_.useState(e.air||!1),[c,u]=_.useState(e.mc||!1),[f,h]=_.useState(e.k9||!1),[m,v]=_.useState(e.fto||!1),y=async()=>{n(!0),await me("setOfficerRoles",{citizenid:e.citizenid,roles:{apu:o,air:s,mc:c,k9:f,fto:m}},{data:!0,delay:500}),n(!1),r(w=>w.map(P=>P.citizenid===e.citizenid?{...e,apu:o,air:s,mc:c,k9:f,fto:m}:P)),ke.closeAll()};return p.jsxs(Je,{children:[p.jsxs("div",{style:{display:"flex",gap:15,alignItems:"center",justifyContent:"center"},children:[p.jsx(vr,{label:j.apu,checked:o,onChange:()=>{i(!o)}}),p.jsx(vr,{label:j.air,checked:s,onChange:()=>{a(!s)}}),p.jsx(vr,{label:j.mc,checked:c,onChange:()=>{u(!c)}}),p.jsx(vr,{label:j.k9,checked:f,onChange:()=>{h(!f)}}),p.jsx(vr,{label:j.fto,checked:m,onChange:()=>{v(!m)}})]}),p.jsx(at,{type:"submit",color:"gray",loading:t,variant:"light",onClick:y,children:j.confirm})]})},VMe=({officers:e})=>{const{personalData:t}=Gr(),{setRosterOfficers:n}=Ru(),r=s=>s.charAt(0).toUpperCase()+s.slice(1),o=s=>{const a=he(),c=he(s),u=a.diff(c,"day");return r(u===0?j.today:u===1?j.yesterday:he(s).fromNow())},i=e.map(s=>p.jsxs("tr",{children:[p.jsx("td",{children:p.jsxs(nt,{spacing:"sm",children:[p.jsx(WP,{size:55,src:s.image,radius:5}),p.jsx("div",{children:p.jsxs(U,{fz:"sm",fw:500,children:[s.firstname," ",s.lastname]})})]})}),p.jsx("td",{children:s.callsign}),p.jsx("td",{children:p.jsx(vr,{checked:s.apu,disabled:!0,styles:{input:{"&:disabled ":{backgroundColor:s.apu?"#1971c2":"#373A40"}}}})}),p.jsx("td",{children:p.jsx(vr,{checked:s.air,disabled:!0,styles:{input:{"&:disabled ":{backgroundColor:s.air?"#1971c2":"#373A40"}}}})}),p.jsx("td",{children:p.jsx(vr,{checked:s.mc,disabled:!0,styles:{input:{"&:disabled ":{backgroundColor:s.mc?"#1971c2":"#373A40"}}}})}),p.jsx("td",{children:p.jsx(vr,{checked:s.k9,disabled:!0,styles:{input:{"&:disabled ":{backgroundColor:s.k9?"#1971c2":"#373A40"}}}})}),p.jsx("td",{children:p.jsx(vr,{checked:s.fto,disabled:!0,styles:{input:{"&:disabled ":{backgroundColor:s.fto?"#1971c2":"#373A40"}}}})}),p.jsx("td",{children:s.lastActive?o(s.lastActive):""}),p.jsx("td",{children:p.jsx(et,{disabled:!0,icon:p.jsx(J8,{size:16}),variant:"unstyled",placeholder:s.title,size:"xs"})}),p.jsx("td",{children:p.jsx(nt,{spacing:2,position:"right",children:p.jsxs(Tt,{withinPortal:!0,withArrow:!0,position:"bottom-end",children:[p.jsx(Tt.Target,{children:p.jsx(Xe,{children:p.jsx(Mme,{size:"1.2rem",stroke:1.5})})}),p.jsxs(Tt.Dropdown,{children:[p.jsx(Tt.Item,{icon:p.jsx(kme,{size:20}),onClick:()=>ke.open({title:p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:j.set_callsign}),children:p.jsx(AMe,{officer:s}),size:"xs",centered:!0}),children:j.set_callsign}),p.jsx(Tt.Item,{disabled:!gn(t,"set_officer_rank"),icon:p.jsx(Gpe,{size:20}),onClick:()=>ke.open({title:p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:j.set_rank}),centered:!0,size:"xs",children:p.jsx(BMe,{officer:s})}),children:j.set_rank}),p.jsx(Tt.Item,{disabled:!gn(t,"set_officer_roles"),icon:p.jsx(bme,{size:20}),onClick:()=>ke.open({title:p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:j.set_roles}),centered:!0,size:"sm",children:p.jsx(FMe,{officer:s})}),children:j.set_roles}),p.jsx(Tt.Item,{icon:p.jsx(Xf,{size:20}),color:"red",disabled:!gn(t,"fire_officer"),onClick:()=>ke.openConfirmModal({title:p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:j.fire_officer}),children:p.jsx(U,{c:"dark.2",size:"sm",children:j.fire_officer_description.format(s.firstname,s.lastname)}),labels:{confirm:j.confirm,cancel:j.cancel},centered:!0,groupProps:{spacing:6},confirmProps:{color:"red"},onConfirm:async()=>{await me("fireOfficer",s.citizenid,{data:!0})&&(n(c=>c.filter(u=>u.citizenid!==s.citizenid)),ke.closeAll())}}),children:j.fire_officer})]})]})})})]},s.citizenid));return p.jsx(At,{h:735,children:p.jsxs(JP,{verticalSpacing:"sm",children:[p.jsx("thead",{children:p.jsxs("tr",{children:[p.jsx("th",{children:j.officer}),p.jsx("th",{children:j.callsign}),p.jsx("th",{children:j.apu}),p.jsx("th",{children:j.air}),p.jsx("th",{children:j.mc}),p.jsx("th",{children:j.k9}),p.jsx("th",{children:j.fto}),p.jsx("th",{children:j.last_active}),p.jsx("th",{children:j.role}),p.jsx("th",{})]})}),p.jsx("tbody",{children:i})]})})},HMe=()=>{const{getRosterOfficers:e}=Ru(),[t,n]=_.useState(!1),r=ql({initialValues:{citizenid:"",callsign:""}});return p.jsx("form",{onSubmit:r.onSubmit(async o=>{n(!0);const i=await me("hireOfficer",{citizenid:o.citizenid,callsign:o.callsign,lastActive:Date.now()},{data:!1,delay:500});if(n(!1),!i)return r.setFieldError("citizenid",j.citizen_id_already_hired);await e(),ke.closeAll()}),children:p.jsxs(Je,{children:[p.jsx(_n,{label:j.citizen_id,description:j.citizen_id_you_want_to_hire,required:!0,...r.getInputProps("citizenid")}),p.jsx(_n,{label:j.callsign,description:j.callsign_you_want_to_hire,required:!0,...r.getInputProps("callsign")}),p.jsx(at,{variant:"light",color:"gray",type:"submit",loading:t,children:j.confirm})]})})},WMe=()=>{const{rosterOfficers:e,getRosterOfficers:t}=Ru(),[n,r]=_.useState(""),[o,i]=_.useState(e),s=200,[a,c]=_.useState(n),[u,f]=_.useState(null),[h,m]=_.useState(!1),{personalData:v}=Gr();return _.useEffect(()=>{u!==null&&clearTimeout(u),m(!0);const y=setTimeout(()=>{c(n),m(!1)},s);return f(y),()=>{clearTimeout(y)}},[n]),_.useEffect(()=>{if(a.trim()==="")i(e);else{const y=e.filter(w=>(w.firstname||"").toLocaleLowerCase().includes(n.toLocaleLowerCase())||(w.lastname||"").toLocaleLowerCase().includes(n.toLocaleLowerCase()));i(y)}},[a,e]),_.useEffect(()=>{m(!0),(async()=>await t())().then(()=>{m(!1)})},[]),p.jsxs("div",{className:"roster",children:[p.jsxs("div",{className:"roster-top",children:[p.jsxs("div",{children:[p.jsx(U,{style:{fontSize:12},weight:500,c:"dimmed",children:j.manage_roster}),p.jsx(U,{style:{fontSize:24,color:"white"},weight:500,children:j.roster})]}),p.jsxs("div",{className:"roster-top-right",style:{display:"flex",gap:15,alignItems:"center"},children:[p.jsxs(U,{style:{fontSize:13,textAlign:"center"},weight:500,c:"dimmed",children:[e.length," ",j.members]}),p.jsx(_n,{placeholder:j.search,variant:"filled",value:n,onChange:y=>r(y.target.value)}),p.jsx(at,{leftIcon:p.jsx(l7,{size:20}),style:{backgroundColor:"rgba(51, 124, 255, 0.2)",color:"rgba(159, 194, 255, 1)"},onClick:()=>ke.open({title:p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:j.hire_officer}),centered:!0,size:"xs",children:p.jsx(HMe,{})}),disabled:!gn(v,"hire_officer"),children:j.hire_officer})]})]}),p.jsx("div",{className:"roster-list",children:h?p.jsx(Zr,{children:p.jsx(en,{})}):p.jsx(VMe,{officers:o})})]})};const UMe=({charge:e})=>{const{setCharges:t}=th(),[n,r]=_.useState(!1),[o,i]=_.useState(e.fine),[s,a]=_.useState(e.time),[c,u]=_.useState(e.points),{personalData:f}=Gr(),h=async()=>{r(!0),await me("editCharge",{chargelabel:e.label,fine:o,time:s,points:c},{data:!0})&&(r(!1),t(v=>{const y={...v};return Object.keys(v).forEach(w=>{y[w]=v[w].map(P=>P.label===e.label?{...e,fine:Number(o),time:Number(s),points:Number(c)}:P)}),y}),ke.closeAll())};return p.jsxs(Je,{children:[p.jsx(_a,{withAsterisk:!0,label:j.charge_fine,value:o,onChange:i,min:0,variant:"filled",placeholder:j.charge_fine,parser:m=>m.replace(/\$\s?|(,*)/g,""),formatter:m=>Number.isNaN(parseFloat(m))?"$ ":`$ ${m}`.replace(/\B(?{const{setCharges:t}=th(),{personalData:n}=Gr();return p.jsxs("div",{className:"charges-charge-card",children:[p.jsx(U,{fz:"sm",fw:500,c:"white",style:{textAlign:"center"},children:e.label}),p.jsxs("div",{style:{display:"flex",gap:5,justifyContent:"center"},children:[p.jsxs(mt,{radius:"xs",variant:"filled",style:{backgroundColor:"rgb(42, 42, 42)",color:"white",fontSize:10,padding:12.5,fontWeight:500},children:["$",e.fine," ",j.fine]}),p.jsxs(mt,{radius:"xs",variant:"filled",style:{backgroundColor:"rgb(42, 42, 42)",color:"white",fontSize:10,padding:12.5,fontWeight:500},children:[e.time," ",j.months]}),p.jsxs(mt,{radius:"xs",variant:"filled",style:{backgroundColor:"rgb(42, 42, 42)",color:"white",fontSize:10,padding:12.5,fontWeight:500},children:[e.points," ",j.points]})]}),p.jsx(zt,{label:e.description,multiline:!0,withArrow:!0,color:"gray",children:p.jsx(U,{fz:"xs",fw:500,mt:2,style:{textAlign:"center",color:"white"},lineClamp:2,children:e.description})}),p.jsxs(nt,{position:"apart",style:{flex:"1"},children:[p.jsx(mt,{radius:"xs",variant:"filled",style:{fontSize:10,padding:12.5,fontWeight:500},color:e.type.toLocaleLowerCase()==="felony"?"red":e.type.toLocaleLowerCase()==="infraction"?"green":"yellow",children:e.type.charAt(0).toUpperCase()+e.type.slice(1)}),p.jsxs("div",{style:{display:"flex",gap:5,alignItems:"center"},children:[p.jsx(Xe,{variant:"light",disabled:!gn(n,"delete_charge"),onClick:()=>{ke.openConfirmModal({title:p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:j.delete_charge}),size:"sm",centered:!0,labels:{confirm:j.confirm,cancel:j.cancel},groupProps:{spacing:6},confirmProps:{color:"red"},onConfirm:async()=>{await me("deleteCharge",{label:e.label},{data:1})&&t(o=>{const i={};return Object.keys(o).forEach(s=>{i[s]=o[s].filter(a=>a.label!==e.label)}),i})},children:p.jsx(U,{size:"sm",c:"dark.2",children:j.delete_charge_confirm.format(e.label)})})},children:p.jsx(K0,{size:16,color:gn(n,"delete_charge")?"white":"gray"})}),p.jsx(at,{disabled:!gn(n,"edit_charge"),color:"gray",compact:!0,onClick:()=>ke.open({title:p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:j.edit_charge}),centered:!0,size:"sm",children:p.jsx(UMe,{charge:e})}),children:j.edit})]})]})]})},GMe=()=>{const{charges:e,setCharges:t}=th(),{personalData:n}=Gr(),[r,o]=_.useState(""),[i,s]=_.useState(""),[a,c]=_.useState(""),[u,f]=_.useState(0),[h,m]=_.useState(0),[v,y]=_.useState(0),[w,P]=_.useState("infraction"),b=O=>O.sort((E,$)=>{const N={infraction:1,misdemeanor:2,felony:3};return N[E.type]-N[$.type]}),S=async()=>{r.length<3||i.length<3||a.length<2||u===""||u<=0||w.length<3||(it()?t(O=>{const E={...O};return E[a].push({label:r,description:i,fine:u,time:Number(h),points:Number(v),type:w}),E}):(await me("createCharge",{label:r,description:i,category:a,fine:u,time:h,points:v,type:w},{data:1}),t(O=>{const E={...O};return E[a].push({label:r,description:i,fine:u,time:Number(h),points:Number(v),type:w}),E})),o(""),s(""),c(""),f(0),m(0),y(0),P("infraction"))};return p.jsxs("div",{className:"charges",children:[p.jsx("div",{className:"top-side-create-charges",children:p.jsxs("div",{className:"charges-create",children:[p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:j.create_charge}),p.jsxs("div",{className:"charges-create-content",children:[p.jsx(_n,{withAsterisk:!0,label:j.charge_label,variant:"filled",placeholder:j.charge_label,value:r,onChange:O=>o(O.target.value),w:200,disabled:!gn(n,"create_charge")}),p.jsx(_n,{withAsterisk:!0,label:j.charge_description,variant:"filled",placeholder:j.charge_description,value:i,onChange:O=>s(O.target.value),w:250,disabled:!gn(n,"create_charge")}),p.jsx(jl,{withAsterisk:!0,label:j.charge_category,placeholder:j.charge_category,variant:"filled",data:[{value:"OFFENSES AGAINST PERSONS",label:"OFFENSES AGAINST PERSONS"},{value:"OFFENSES INVOLVING THEFT",label:"OFFENSES INVOLVING THEFT"},{value:"OFFENSES INVOLVING FRAUD",label:"OFFENSES INVOLVING FRAUD"},{value:"OFFENSES INVOLVING DAMAGE TO PROPERTY",label:"OFFENSES INVOLVING DAMAGE TO PROPERTY"},{value:"OFFENSES AGAINST PUBLIC ADMINISTRATION",label:"OFFENSES AGAINST PUBLIC ADMINISTRATION"},{value:"OFFENSES AGAINST PUBLIC ORDER",label:"OFFENSES AGAINST PUBLIC ORDER"},{value:"OFFENSES AGAINST HEALTH AND MORALS",label:"OFFENSES AGAINST HEALTH AND MORALS"},{value:"OFFENSES AGAINST PUBLIC SAFETY",label:"OFFENSES AGAINST PUBLIC SAFETY"},{value:"OFFENSES INVOLVING THE OPERATION OF A VEHICLE",label:"OFFENSES INVOLVING THE OPERATION OF A VEHICLE"},{value:"OFFENSES INVOLVING THE WELL-BEING OF WILDLIFE",label:"OFFENSES INVOLVING THE WELL-BEING OF WILDLIFE"}],value:a,onChange:O=>c(O),w:275,disabled:!gn(n,"create_charge")}),p.jsx(_a,{withAsterisk:!0,label:j.charge_fine,value:u,onChange:f,min:0,variant:"filled",placeholder:j.charge_fine,w:140,parser:O=>O.replace(/\$\s?|(,*)/g,""),formatter:O=>Number.isNaN(parseFloat(O))?"$ ":`$ ${O}`.replace(/\B(?P(O)})]}),p.jsx("div",{className:"charges-create-buttons",children:p.jsx(at,{color:"green",disabled:!gn(n,"create_charge"),onClick:S,children:j.create})})]})}),p.jsx(At,{h:700,scrollbarSize:4,children:p.jsx("div",{className:"charges-all-charges",children:p.jsx("div",{className:"charges-category",children:Object.entries(e).map(([O,E])=>p.jsxs("div",{children:[p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:O}),p.jsx("div",{className:"charges-cards-row",children:b(E).map($=>p.jsx(ZMe,{charge:$},$.label))})]},O))})})})]})};var tS={exports:{}};/* @preserve +`)),s.setMeta("paste",!0),e.dispatch(s),!0}}})]}}),NCe=qr.create({name:"doc",topNode:!0,content:"block+"});function TCe(e={}){return new Kr({view(t){return new ICe(t,e)}})}class ICe{constructor(t,n){var r;this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(o=>{let i=s=>{this[o](s)};return t.dom.addEventListener(o,i),{name:o,handler:i}})}destroy(){this.handlers.forEach(({name:t,handler:n})=>this.editorView.dom.removeEventListener(t,n))}update(t,n){this.cursorPos!=null&&n.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(t){t!=this.cursorPos&&(this.cursorPos=t,t==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let t=this.editorView.state.doc.resolve(this.cursorPos),n=!t.parent.inlineContent,r;if(n){let a=t.nodeBefore,c=t.nodeAfter;if(a||c){let u=this.editorView.nodeDOM(this.cursorPos-(a?a.nodeSize:0));if(u){let f=u.getBoundingClientRect(),h=a?f.bottom:f.top;a&&c&&(h=(h+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:f.left,right:f.right,top:h-this.width/2,bottom:h+this.width/2}}}}if(!r){let a=this.editorView.coordsAtPos(this.cursorPos);r={left:a.left-this.width/2,right:a.left+this.width/2,top:a.top,bottom:a.bottom}}let o=this.editorView.dom.offsetParent;this.element||(this.element=o.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let i,s;if(!o||o==document.body&&getComputedStyle(o).position=="static")i=-pageXOffset,s=-pageYOffset;else{let a=o.getBoundingClientRect();i=a.left-o.scrollLeft,s=a.top-o.scrollTop}this.element.style.left=r.left-i+"px",this.element.style.top=r.top-s+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(t){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),t)}dragover(t){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),o=r&&r.type.spec.disableDropCursor,i=typeof o=="function"?o(this.editorView,n,t):o;if(n&&!i){let s=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=tB(this.editorView.state.doc,s,this.editorView.dragging.slice);a!=null&&(s=a)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(t){(t.target==this.editorView.dom||!this.editorView.dom.contains(t.relatedTarget))&&this.setCursor(null)}}const jCe=Sr.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[TCe(this.options)]}});class Kt extends Ze{constructor(t){super(t,t)}map(t,n){let r=t.resolve(n.map(this.head));return Kt.valid(r)?new Kt(r):Ze.near(r)}content(){return ye.empty}eq(t){return t instanceof Kt&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Kt(t.resolve(n.pos))}getBookmark(){return new WO(this.anchor)}static valid(t){let n=t.parent;if(n.isTextblock||!DCe(t)||!RCe(t))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let o=n.contentMatchAt(t.index()).defaultType;return o&&o.isTextblock}static findGapCursorFrom(t,n,r=!1){e:for(;;){if(!r&&Kt.valid(t))return t;let o=t.pos,i=null;for(let s=t.depth;;s--){let a=t.node(s);if(n>0?t.indexAfter(s)0){i=a.child(n>0?t.indexAfter(s):t.index(s)-1);break}else if(s==0)return null;o+=n;let c=t.doc.resolve(o);if(Kt.valid(c))return c}for(;;){let s=n>0?i.firstChild:i.lastChild;if(!s){if(i.isAtom&&!i.isText&&!De.isSelectable(i)){t=t.doc.resolve(o+i.nodeSize*n),r=!1;continue e}break}i=s,o+=n;let a=t.doc.resolve(o);if(Kt.valid(a))return a}return null}}}Kt.prototype.visible=!1;Kt.findFrom=Kt.findGapCursorFrom;Ze.jsonID("gapcursor",Kt);class WO{constructor(t){this.pos=t}map(t){return new WO(t.map(this.pos))}resolve(t){let n=t.resolve(this.pos);return Kt.valid(n)?new Kt(n):Ze.near(n)}}function DCe(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n-1);;o=o.lastChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function RCe(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n);;o=o.firstChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function LCe(){return new Kr({props:{decorations:FCe,createSelectionBetween(e,t,n){return t.pos==n.pos&&Kt.valid(n)?new Kt(n):null},handleClick:ACe,handleKeyDown:zCe,handleDOMEvents:{beforeinput:BCe}}})}const zCe=BB({ArrowLeft:bp("horiz",-1),ArrowRight:bp("horiz",1),ArrowUp:bp("vert",-1),ArrowDown:bp("vert",1)});function bp(e,t){const n=e=="vert"?t>0?"down":"up":t>0?"right":"left";return function(r,o,i){let s=r.selection,a=t>0?s.$to:s.$from,c=s.empty;if(s instanceof Ve){if(!i.endOfTextblock(n)||a.depth==0)return!1;c=!1,a=r.doc.resolve(t>0?a.after():a.before())}let u=Kt.findGapCursorFrom(a,t,c);return u?(o&&o(r.tr.setSelection(new Kt(u))),!0):!1}}function ACe(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!Kt.valid(r))return!1;let o=e.posAtCoords({left:n.clientX,top:n.clientY});return o&&o.inside>-1&&De.isSelectable(e.state.doc.nodeAt(o.inside))?!1:(e.dispatch(e.state.tr.setSelection(new Kt(r))),!0)}function BCe(e,t){if(t.inputType!="insertCompositionText"||!(e.state.selection instanceof Kt))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let o=se.empty;for(let s=r.length-1;s>=0;s--)o=se.from(r[s].createAndFill(null,o));let i=e.state.tr.replace(n.pos,n.pos,new ye(o,0,0));return i.setSelection(Ve.near(i.doc.resolve(n.pos+1))),e.dispatch(i),!1}function FCe(e){if(!(e.selection instanceof Kt))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",vn.create(e.doc,[Lo.widget(e.selection.head,t,{key:"gapcursor"})])}const VCe=Sr.create({name:"gapCursor",addProseMirrorPlugins(){return[LCe()]},extendNodeSchema(e){var t;const n={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:(t=Ue(Ce(e,"allowGapCursor",n)))!==null&&t!==void 0?t:null}}}),HCe=qr.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:e}){return["br",kt(this.options.HTMLAttributes,e)]},renderText(){return` +`},addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{selection:o,storedMarks:i}=n;if(o.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:a}=r.extensionManager,c=i||o.$to.parentOffset&&o.$from.marks();return t().insertContent({type:this.name}).command(({tr:u,dispatch:f})=>{if(f&&c&&s){const h=c.filter(m=>a.includes(m.type.name));u.ensureMarks(h)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),WCe=qr.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,kt(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,"paragraph",e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>Fx({find:new RegExp(`^(#{1,${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}});var Ey=200,Mn=function(){};Mn.prototype.append=function(t){return t.length?(t=Mn.from(t),!this.length&&t||t.length=n?Mn.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))};Mn.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};Mn.prototype.forEach=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(t,n,r,0):this.forEachInvertedInner(t,n,r,0)};Mn.prototype.map=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var o=[];return this.forEach(function(i,s){return o.push(t(i,s))},n,r),o};Mn.from=function(t){return t instanceof Mn?t:t&&t.length?new IF(t):Mn.empty};var IF=function(e){function t(r){e.call(this),this.values=r}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(o,i){return o==0&&i==this.length?this:new t(this.values.slice(o,i))},t.prototype.getInner=function(o){return this.values[o]},t.prototype.forEachInner=function(o,i,s,a){for(var c=i;c=s;c--)if(o(this.values[c],a+c)===!1)return!1},t.prototype.leafAppend=function(o){if(this.length+o.length<=Ey)return new t(this.values.concat(o.flatten()))},t.prototype.leafPrepend=function(o){if(this.length+o.length<=Ey)return new t(o.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(Mn);Mn.empty=new IF([]);var UCe=function(e){function t(n,r){e.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(r){return ra&&this.right.forEachInner(r,Math.max(o-a,0),Math.min(this.length,i)-a,s+a)===!1)return!1},t.prototype.forEachInvertedInner=function(r,o,i,s){var a=this.left.length;if(o>a&&this.right.forEachInvertedInner(r,o-a,Math.max(i,a)-a,s+a)===!1||i=i?this.right.slice(r-i,o-i):this.left.slice(r,i).append(this.right.slice(0,o-i))},t.prototype.leafAppend=function(r){var o=this.right.leafAppend(r);if(o)return new t(this.left,o)},t.prototype.leafPrepend=function(r){var o=this.left.leafPrepend(r);if(o)return new t(o,this.right)},t.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new t(this.left,new t(this.right,r)):new t(this,r)},t}(Mn);const ZCe=500;class ei{constructor(t,n){this.items=t,this.eventCount=n}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let o,i;n&&(o=this.remapping(r,this.items.length),i=o.maps.length);let s=t.tr,a,c,u=[],f=[];return this.items.forEach((h,m)=>{if(!h.step){o||(o=this.remapping(r,m+1),i=o.maps.length),i--,f.push(h);return}if(o){f.push(new Si(h.map));let v=h.step.map(o.slice(i)),y;v&&s.maybeStep(v).doc&&(y=s.mapping.maps[s.mapping.maps.length-1],u.push(new Si(y,void 0,void 0,u.length+f.length))),i--,y&&o.appendMap(y,i)}else s.maybeStep(h.step);if(h.selection)return a=o?h.selection.map(o.slice(i)):h.selection,c=new ei(this.items.slice(0,r).append(f.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:s,selection:a}}addTransform(t,n,r,o){let i=[],s=this.eventCount,a=this.items,c=!o&&a.length?a.get(a.length-1):null;for(let f=0;fYCe&&(a=GCe(a,u),s-=u),new ei(a.append(i),s)}remapping(t,n){let r=new Jc;return this.items.forEach((o,i)=>{let s=o.mirrorOffset!=null&&i-o.mirrorOffset>=t?r.maps.length-o.mirrorOffset:void 0;r.appendMap(o.map,s)},t,n),r}addMaps(t){return this.eventCount==0?this:new ei(this.items.append(t.map(n=>new Si(n))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],o=Math.max(0,this.items.length-n),i=t.mapping,s=t.steps.length,a=this.eventCount;this.items.forEach(m=>{m.selection&&a--},o);let c=n;this.items.forEach(m=>{let v=i.getMirror(--c);if(v==null)return;s=Math.min(s,v);let y=i.maps[v];if(m.step){let w=t.steps[v].invert(t.docs[v]),P=m.selection&&m.selection.map(i.slice(c+1,v));P&&a++,r.push(new Si(y,w,P))}else r.push(new Si(y))},o);let u=[];for(let m=n;mZCe&&(h=h.compress(this.items.length-r.length)),h}emptyItemCount(){let t=0;return this.items.forEach(n=>{n.step||t++}),t}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,o=[],i=0;return this.items.forEach((s,a)=>{if(a>=t)o.push(s),s.selection&&i++;else if(s.step){let c=s.step.map(n.slice(r)),u=c&&c.getMap();if(r--,u&&n.appendMap(u,r),c){let f=s.selection&&s.selection.map(n.slice(r));f&&i++;let h=new Si(u.invert(),c,f),m,v=o.length-1;(m=o.length&&o[v].merge(h))?o[v]=m:o.push(h)}}else s.map&&r--},this.items.length,0),new ei(Mn.from(o.reverse()),i)}}ei.empty=new ei(Mn.empty,0);function GCe(e,t){let n;return e.forEach((r,o)=>{if(r.selection&&t--==0)return n=o,!1}),e.slice(n)}class Si{constructor(t,n,r,o){this.map=t,this.step=n,this.selection=r,this.mirrorOffset=o}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new Si(n.getMap().invert(),n,this.selection)}}}class Ks{constructor(t,n,r,o,i){this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=o,this.prevComposition=i}}const YCe=20;function KCe(e,t,n,r){let o=n.getMeta(Pa),i;if(o)return o.historyState;n.getMeta(JCe)&&(e=new Ks(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return e;if(s&&s.getMeta(Pa))return s.getMeta(Pa).redo?new Ks(e.done.addTransform(n,void 0,r,um(t)),e.undone,Sj(n.mapping.maps[n.steps.length-1]),e.prevTime,e.prevComposition):new Ks(e.done,e.undone.addTransform(n,void 0,r,um(t)),null,e.prevTime,e.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),c=e.prevTime==0||!s&&e.prevComposition!=a&&(e.prevTime<(n.time||0)-r.newGroupDelay||!qCe(n,e.prevRanges)),u=s?jw(e.prevRanges,n.mapping):Sj(n.mapping.maps[n.steps.length-1]);return new Ks(e.done.addTransform(n,c?t.selection.getBookmark():void 0,r,um(t)),ei.empty,u,n.time,a??e.prevComposition)}else return(i=n.getMeta("rebased"))?new Ks(e.done.rebased(n,i),e.undone.rebased(n,i),jw(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new Ks(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),jw(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function qCe(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((r,o)=>{for(let i=0;i=t[i]&&(n=!0)}),n}function Sj(e){let t=[];return e.forEach((n,r,o,i)=>t.push(o,i)),t}function jw(e,t){if(!e)return null;let n=[];for(let r=0;r{let n=Pa.getState(e);return!n||n.done.eventCount==0?!1:(t&&jF(n,e,t,!1),!0)},RF=(e,t)=>{let n=Pa.getState(e);return!n||n.undone.eventCount==0?!1:(t&&jF(n,e,t,!0),!0)},XCe=Sr.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>DF(e,t),redo:()=>({state:e,dispatch:t})=>RF(e,t)}},addProseMirrorPlugins(){return[QCe(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-Z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-Y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Shift-Mod-Z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),eke=qr.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:e}){return["hr",kt(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{const{$to:n}=t.selection,r=e();return n.parentOffset===0?r.insertContentAt(Math.max(n.pos-2,0),{type:this.name}):r.insertContent({type:this.name}),r.command(({tr:o,dispatch:i})=>{var s;if(i){const{$to:a}=o.selection,c=a.end();if(a.nodeAfter)a.nodeAfter.isTextblock?o.setSelection(Ve.create(o.doc,a.pos+1)):a.nodeAfter.isBlock?o.setSelection(De.create(o.doc,a.pos)):o.setSelection(Ve.create(o.doc,a.pos));else{const u=(s=a.parent.type.contentMatch.defaultType)===null||s===void 0?void 0:s.create();u&&(o.insert(c,u),o.setSelection(Ve.create(o.doc,c+1)))}o.scrollIntoView()}return!0}).run()}}},addInputRules(){return[eF({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),tke=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,nke=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,rke=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,oke=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,ike=sr.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>e.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",kt(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Al({find:tke,type:this.type}),Al({find:rke,type:this.type})]},addPasteRules(){return[Na({find:nke,type:this.type}),Na({find:oke,type:this.type})]}}),ske=qr.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",kt(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),ake=qr.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",kt(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Oj=sr.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:e=>e.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["span",kt(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:e,commands:t})=>{const n=sh(e,this.type);return Object.entries(n).some(([,o])=>!!o)?!0:t.unsetMark(this.name)}}}}),Cj=/^(\d+)\.\s$/,lke=qr.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return t===1?["ol",kt(this.options.HTMLAttributes,n),0]:["ol",kt(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(ake.name,this.editor.getAttributes(Oj.name)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=$f({find:Cj,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=$f({find:Cj,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(Oj.name)}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1],editor:this.editor})),[e]}}),cke=qr.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",kt(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),uke=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,dke=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,fke=sr.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["s",kt(this.options.HTMLAttributes,e),0]},addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){const e={};return IO()?e["Mod-Shift-s"]=()=>this.editor.commands.toggleStrike():e["Ctrl-Shift-s"]=()=>this.editor.commands.toggleStrike(),e},addInputRules(){return[Al({find:uke,type:this.type})]},addPasteRules(){return[Na({find:dke,type:this.type})]}}),hke=qr.create({name:"text",group:"inline"}),LF=Sr.create({name:"starterKit",addExtensions(){var e,t,n,r,o,i,s,a,c,u,f,h,m,v,y,w,P,b;const S=[];return this.options.blockquote!==!1&&S.push(vCe.configure((e=this.options)===null||e===void 0?void 0:e.blockquote)),this.options.bold!==!1&&S.push(xCe.configure((t=this.options)===null||t===void 0?void 0:t.bold)),this.options.bulletList!==!1&&S.push(PCe.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&S.push(kCe.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&S.push(MCe.configure((o=this.options)===null||o===void 0?void 0:o.codeBlock)),this.options.document!==!1&&S.push(NCe.configure((i=this.options)===null||i===void 0?void 0:i.document)),this.options.dropcursor!==!1&&S.push(jCe.configure((s=this.options)===null||s===void 0?void 0:s.dropcursor)),this.options.gapcursor!==!1&&S.push(VCe.configure((a=this.options)===null||a===void 0?void 0:a.gapcursor)),this.options.hardBreak!==!1&&S.push(HCe.configure((c=this.options)===null||c===void 0?void 0:c.hardBreak)),this.options.heading!==!1&&S.push(WCe.configure((u=this.options)===null||u===void 0?void 0:u.heading)),this.options.history!==!1&&S.push(XCe.configure((f=this.options)===null||f===void 0?void 0:f.history)),this.options.horizontalRule!==!1&&S.push(eke.configure((h=this.options)===null||h===void 0?void 0:h.horizontalRule)),this.options.italic!==!1&&S.push(ike.configure((m=this.options)===null||m===void 0?void 0:m.italic)),this.options.listItem!==!1&&S.push(ske.configure((v=this.options)===null||v===void 0?void 0:v.listItem)),this.options.orderedList!==!1&&S.push(lke.configure((y=this.options)===null||y===void 0?void 0:y.orderedList)),this.options.paragraph!==!1&&S.push(cke.configure((w=this.options)===null||w===void 0?void 0:w.paragraph)),this.options.strike!==!1&&S.push(fke.configure((P=this.options)===null||P===void 0?void 0:P.strike)),this.options.text!==!1&&S.push(hke.configure((b=this.options)===null||b===void 0?void 0:b.text)),S}}),zF=sr.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["u",kt(this.options.HTMLAttributes,e),0]},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),AF=Sr.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:"left"}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:e=>e.style.textAlign||this.options.defaultAlignment,renderHTML:e=>e.textAlign===this.options.defaultAlignment?{}:{style:`text-align: ${e.textAlign}`}}}}]},addCommands(){return{setTextAlign:e=>({commands:t})=>this.options.alignments.includes(e)?this.options.types.every(n=>t.updateAttributes(n,{textAlign:e})):!1,unsetTextAlign:()=>({commands:e})=>this.options.types.every(t=>e.resetAttributes(t,"textAlign"))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),BF=sr.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(e){return e!=="super"?!1:null}}]},renderHTML({HTMLAttributes:e}){return["sup",kt(this.options.HTMLAttributes,e),0]},addCommands(){return{setSuperscript:()=>({commands:e})=>e.setMark(this.name),toggleSuperscript:()=>({commands:e})=>e.toggleMark(this.name),unsetSuperscript:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),FF=sr.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(e){return e!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:e}){return["sub",kt(this.options.HTMLAttributes,e),0]},addCommands(){return{setSubscript:()=>({commands:e})=>e.setMark(this.name),toggleSubscript:()=>({commands:e})=>e.toggleMark(this.name),unsetSubscript:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),pke=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,VF=qr.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:e}){return["img",kt(this.options.HTMLAttributes,e)]},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[eF({find:pke,type:this.type,getAttributes:e=>{const[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}}),HF=sr.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:e=>e.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["span",kt(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:e,commands:t})=>{const n=sh(e,this.type);return Object.entries(n).some(([,o])=>!!o)?!0:t.unsetMark(this.name)}}}}),WF=Sr.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:e=>{var t;return(t=e.style.color)===null||t===void 0?void 0:t.replace(/['"]+/g,"")},renderHTML:e=>e.color?{style:`color: ${e.color}`}:{}}}}]},addCommands(){return{setColor:e=>({chain:t})=>t().setMark("textStyle",{color:e}).run(),unsetColor:()=>({chain:e})=>e().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),mke=ue({saveButton:{position:"absolute",top:5,right:5,zIndex:99}}),lh=({content:e="

",onChange:t,styles:n,contentAreaStyle:r,onSave:o})=>{const{classes:i}=mke(),[s,a]=_.useState(!1),c=tF({content:e,extensions:[LF,zF,NF,BF,FF,TF,WF,HF,VF,AF.configure({types:["heading","paragraph"]})]});return _.useEffect(()=>{c?.commands.setContent(e,!0)},[e]),_.useEffect(()=>{if(t&&t(c?.getHTML()),!o)return;const u=setTimeout(()=>{c?.getHTML()!==e?a(!0):a(!1)},500);return()=>clearTimeout(u)},[c?.getHTML()]),p.jsx(p.Fragment,{children:p.jsxs(Ee,{editor:c,styles:n,style:{borderRadius:2},children:[p.jsxs(Ee.Toolbar,{sticky:!0,children:[p.jsxs(Ee.ControlsGroup,{children:[p.jsx(Ee.Bold,{}),p.jsx(Ee.Italic,{}),p.jsx(Ee.Underline,{}),p.jsx(Ee.Strikethrough,{}),p.jsx(Ee.ClearFormatting,{}),p.jsx(Ee.Highlight,{})]}),p.jsxs(Ee.ControlsGroup,{children:[p.jsx(Ee.Hr,{}),p.jsx(Ee.BulletList,{}),p.jsx(Ee.OrderedList,{})]}),p.jsxs(Ee.ControlsGroup,{children:[p.jsx(Ee.Link,{}),p.jsx(Ee.Unlink,{})]}),p.jsxs(Ee.ControlsGroup,{children:[p.jsx(Ee.AlignLeft,{}),p.jsx(Ee.AlignCenter,{}),p.jsx(Ee.AlignJustify,{}),p.jsx(Ee.AlignRight,{})]}),p.jsx(Ee.ControlsGroup,{children:p.jsx(Ee.ColorPicker,{colors:["#25262b","#868e96","#fa5252","#e64980","#be4bdb","#7950f2","#4c6ef5","#228be6","#15aabf","#12b886","#40c057","#82c91e","#fab005","#fd7e14"]})})]}),c&&p.jsxs(At,{style:r,children:[p.jsx($s,{mounted:!!(s&&o),transition:"slide-down",children:u=>p.jsx(Xe,{style:u,className:i.saveButton,color:"dark",variant:"default",size:26,onClick:()=>{a(!1),o&&o(c?.getHTML())},children:p.jsx(t7,{size:20})})}),p.jsx(Ee.Content,{})]})]})})},gke=[{contents:"Dsadaasd Hello there buddy, this is a message from the server.",id:1,playerId:1,position:[0,0,0],callsign:132,firstname:"Fdsadas",lastname:"DSasd",citizenid:"dsadas",image:"https://cdn.vectorstock.com/i/preview-1x/97/68/account-avatar-dark-mode-glyph-ui-icon-vector-44429768.jpg",createdAt:Date.now()-3e5},{contents:"Dsadaasd Hello there buddy, this is a message from the server.",id:2,playerId:1,position:[0,0,0],callsign:132,firstname:"Fdsadas",lastname:"DSasd",citizenid:"dsadas",image:"https://cdn.vectorstock.com/i/preview-1x/97/68/account-avatar-dark-mode-glyph-ui-icon-vector-44429768.jpg",createdAt:Date.now()-9e5},{contents:"Dsadaasd Hello there buddy, this is a message from the server.",id:3,playerId:1,position:[0,0,0],callsign:132,firstname:"Fdsadas",lastname:"DSasd",citizenid:"dsadas",image:"https://cdn.vectorstock.com/i/preview-1x/97/68/account-avatar-dark-mode-glyph-ui-icon-vector-44429768.jpg",createdAt:Date.now()-12e20},{contents:"Dsadaasd Hello there buddy",id:4,playerId:1,position:[0,0,0],callsign:132,firstname:"fad",lastname:"DSasd",citizenid:"dsadas",image:"https://cdn.vectorstock.com/i/preview-1x/97/68/account-avatar-dark-mode-glyph-ui-icon-vector-44429768.jpg",createdAt:Date.now()},{contents:"Dsadaasd Hello there buddy",id:5,playerId:1,position:[0,0,0],callsign:132,firstname:"fad",lastname:"DSasd",citizenid:"dsadas",image:"https://cdn.vectorstock.com/i/preview-1x/97/68/account-avatar-dark-mode-glyph-ui-icon-vector-44429768.jpg",createdAt:Date.now()}],UO=tn(e=>({announcements:[],fetchAnnouncements:async()=>{if(it())e({announcements:[...gke]});else{const t=await me("getAnnouncements");e({announcements:[...t.announcements]})}}})),vke=()=>{const{fetchAnnouncements:e}=UO(s=>({fetchAnnouncements:s.fetchAnnouncements})),[t,n]=_.useState(!1),[r,o]=_.useState(""),i=async()=>{if(!it()){if(n(!0),!await me("createAnnouncement",{contents:r}))return;e(),n(!1)}ke.closeAll()};return p.jsxs(Je,{h:400,style:{flex:"0 0 43.5rem"},children:[p.jsx(lh,{content:"",onChange:s=>o(s||""),styles:{content:{backgroundColor:"#1A1B1E"},toolbar:{backgroundColor:"#2C2E33"},controlsGroup:{pointerEvents:"auto",backgroundColor:"#282828"}},contentAreaStyle:{height:270,width:406,padding:0}}),p.jsx(at,{variant:"light",color:"gray",fullWidth:!0,onClick:()=>i(),loading:t,children:D.create})]})},yke=e=>{const t=tF({extensions:[LF,zF,NF,BF,FF,TF,WF,HF,VF,AF],content:e.contents,editable:!1});return p.jsx(Je,{children:p.jsx(Ee,{editor:t,children:p.jsx(Ee.Content,{})})})};he.extend(E7);const UF=({announcement:e})=>{const t=`

${e.contents}

`;function n(r){return r.replace(/<\/?[^>]+(>|$)/g,"")}return p.jsxs("div",{className:"announcement-list-card",onClick:()=>{ke.open({title:p.jsxs(U,{style:{fontSize:16,color:"white"},weight:500,children:[`${e.firstname} ${e.lastname}`," |"," ",he(e.createdAt).fromNow()]}),centered:!0,children:p.jsx(yke,{contents:t})})},children:[p.jsx(nt,{position:"apart",children:p.jsxs(nt,{children:[p.jsx(WP,{color:"blue",src:e.image}),p.jsxs(Je,{spacing:0,children:[p.jsx(U,{fw:500,c:"white",children:`${e.firstname} ${e.lastname}`}),p.jsx(U,{size:"xs",c:"dark.2",children:he(e.createdAt).fromNow()})]})]})}),p.jsx(U,{c:"gray.4",size:"sm",lineClamp:1,children:n(t)})]})},_ke=()=>{const{announcements:e}=UO(n=>({announcements:n.announcements})),t=[...e].sort((n,r)=>Number(new Date(r.createdAt))-Number(new Date(n.createdAt)));return p.jsx(At,{h:600,children:p.jsx("div",{className:"announcement-card-content",children:t.length>0?t.map(n=>p.jsx(UF,{announcement:n},n.id)):p.jsx(U,{color:"dimmed",size:"xs",children:D.no_announcements_found})})})},wke=4,bke=4,xke=4,Ske=4,Pke=4,Oke=4,Cke=4,kke=4,kj={create_announcement:wke,create_charge:bke,delete_charge:xke,edit_charge:Ske,hire_officer:Pke,set_officer_rank:Oke,set_officer_roles:Cke,fire_officer:kke},gn=(e,t)=>{if(!Array.isArray(t)){const r=kj[t];return e.grade>=r}let n=0;for(let r=0;r{const{announcements:e,fetchAnnouncements:t}=UO(s=>({announcements:s.announcements,fetchAnnouncements:s.fetchAnnouncements})),[n,r]=_.useState(!1),{personalData:o}=Gr(),i=[...e].sort((s,a)=>Number(new Date(a.createdAt))-Number(new Date(s.createdAt))).slice(0,3);return _.useEffect(()=>{r(!0),(async()=>await t())().then(()=>{r(!1)})},[]),p.jsxs("div",{className:"card-background",children:[p.jsxs("div",{className:"card-title",children:[p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:D.announcements}),p.jsxs("div",{className:"card-title-icons",children:[p.jsx(zt,{label:D.create_announcement,withArrow:!0,color:"gray",position:"bottom",children:p.jsx(Xe,{variant:"light",color:"dark",disabled:!gn(o,"create_announcement"),onClick:()=>{ke.open({title:p.jsx(U,{style:{fontSize:16,color:"white"},weight:500,children:D.create_announcement}),centered:!0,children:p.jsx(vke,{})})},children:p.jsx(Iu,{size:16,color:"white"})})}),p.jsx(zt,{label:D.view_all,withArrow:!0,color:"gray",position:"bottom",children:p.jsx(Xe,{variant:"light",color:"dark",onClick:()=>{ke.open({title:p.jsx(U,{style:{fontSize:16,color:"white"},weight:500,children:D.all_announcements}),centered:!0,children:p.jsx(_ke,{})})},children:p.jsx(yme,{size:16,color:"white"})})}),p.jsx(Nme,{size:M(25),color:"white"})]})]}),p.jsx(Ye,{mt:5,mb:5}),p.jsx("div",{className:"announcement-card-content",children:n?p.jsx(Zr,{h:"100%",children:p.jsx(en,{})}):i.length>0?i.map(s=>p.jsx(UF,{announcement:s},s.id)):p.jsx(U,{color:"dimmed",size:"xs",children:D.no_announcements_found})})]})},$ke=[{citizenid:"AF30442",firstname:"Billy",lastname:"Bob",incidentid:3,expiresAt:Date.now(),image:"https://i.imgur.com/dqopYB9b.jpg"},{citizenid:"AF30442",firstname:"Billy",lastname:"Bob",incidentid:3,expiresAt:Date.now(),image:"https://i.imgur.com/dqopYB9b.jpg"},{citizenid:"AF30442",firstname:"Billy",lastname:"Bob",incidentid:3,expiresAt:Date.now(),image:"https://i.imgur.com/dqopYB9b.jpg"},{citizenid:"AF30442",firstname:"Billy",lastname:"Bob",incidentid:3,expiresAt:Date.now(),image:"https://i.imgur.com/dqopYB9b.jpg"},{citizenid:"AF30442",firstname:"Billy",lastname:"Bob",incidentid:3,expiresAt:Date.now(),image:"https://i.imgur.com/dqopYB9b.jpg"},{citizenid:"AF30442",firstname:"Billy",lastname:"Bob",incidentid:3,expiresAt:Date.now(),image:"https://i.imgur.com/dqopYB9b.jpg"}],Mke=tn(e=>({warrants:it()?$ke:[],getWarrants:async()=>{try{const t=await me("getWarrants");return e({warrants:t}),{warrants:t}}catch(t){return console.error("Failed to fetch recent activities:",t),{warrants:[]}}},setWarrants:t=>e({warrants:t})})),Nke=()=>{const{warrants:e,getWarrants:t}=Mke(),[n,r]=_.useState(!1),o=Kl(),{setActiveIncident:i,setIncidentActive:s}=Yr();return _.useEffect(()=>{r(!0),(async()=>{t()})().then(()=>{r(!1)})},[]),p.jsxs("div",{className:"card-background",children:[p.jsxs("div",{className:"card-title",children:[p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:D.active_warrants}),p.jsx(Lme,{size:M(25),color:"white"})]}),p.jsx(Ye,{mt:5,mb:5}),p.jsx(At,{h:290,children:p.jsx("div",{className:"warrants-card-content",children:n?p.jsx(Zr,{h:"100%",children:p.jsx(en,{})}):e.length>0?e.map(a=>p.jsx(nt,{position:"apart",className:"warrants-card",onClick:async()=>{if(it())return;const c=await me("getIncident",a.incidentid);i(c),s(!0),o("/incidents")},children:p.jsxs(nt,{children:[p.jsx(WP,{color:"blue",src:a.image}),p.jsxs(Je,{spacing:0,children:[p.jsx(U,{fw:500,c:"white",children:`${a.firstname} ${a.lastname}`}),p.jsxs(U,{size:"xs",c:"dark.2",children:[D.expires_in,":"," ",he().to(a.expiresAt,!0)]})]})]})})):p.jsx(U,{color:"dimmed",size:"xs",children:D.no_warrants_found})})})]})},Pu=e=>e?Object.entries(e).map(t=>({id:+t[0],...t[1]})):[],Tke=e=>Array.isArray(e)?e.map(t=>({...t,units:Pu(t.units)})):Object.entries(e).map(t=>{const n={...t[1],units:[]};return n.units=Pu(t[1].units),n}),Od=e=>e.length===0?e:e.charAt(0).toUpperCase()+e.slice(1),Ike=[{id:1,time:Date.now(),location:"Somewhere",coords:[350,350],linked:!1,offense:"Bank robbery",code:"10-29",blip:162,units:[{name:"Unit 132",type:"car",members:[{firstname:"Billy",lastname:"Bob",callsign:132,citizenid:"321553",playerId:1,position:[0,0,0]}],id:132},{name:"Unit 322",type:"heli",members:[{firstname:"Marc",lastname:"Marshall",callsign:322,citizenid:"451503",playerId:1,position:[0,0,0]}],id:322}]},{id:2,time:Date.now(),location:"Somewhere",info:[{label:"Sultan RS",icon:"gun"},{label:"XYZ 123",icon:"badge-tm"}],coords:[255,150],blip:51,linked:!1,offense:"Officer Down",code:"10-13",units:[{name:"Unit 132",type:"car",members:[{firstname:"Billy",lastname:"Bob",callsign:132,citizenid:"311342",playerId:1,position:[0,0,0]},{firstname:"Martin",lastname:"Contreras",callsign:521,citizenid:"912132",playerId:1,position:[0,0,0]}],id:132},{name:"Unit 823",type:"heli",members:[{firstname:"Bobby",lastname:"Hopkins",callsign:823,citizenid:"100341",playerId:1,position:[0,0,0]}],id:823},{name:"Unit 531",type:"motor",members:[{firstname:"Connor",lastname:"Collins",callsign:531,citizenid:"913213",playerId:1,position:[0,0,0]}],id:531},{name:"Unit 274",type:"boat",members:[{firstname:"Corey",lastname:"Hayes",callsign:274,citizenid:"920132",playerId:1,position:[0,0,0]}],id:274}]},{id:3,time:Date.now(),location:"Somewhere",coords:[500,750],linked:!1,blip:310,offense:"Officer Down",code:"10-13",units:[{name:"Unit 1",type:"car",members:[{firstname:"Billy",lastname:"bob",callsign:132,citizenid:"913213",playerId:1,position:[0,0,0]}],id:136},{name:"Unit 6",type:"heli",members:[{firstname:"Freddie",lastname:"Reid",callsign:823,citizenid:"920132",playerId:2,position:[0,0,0]}],id:823}]}],jke=async()=>{if(it())return Ike;const e=await me("getCalls");return Tke(e)},Du=tn(e=>({calls:[],fetchCalls:async()=>{const t=await jke();e({calls:t})},updateCallUnits:(t,n)=>{e(r=>{const o=r.calls.findIndex(s=>s.id===t);if(o===-1)return r;const i=[...r.calls];return i[o]={...i[o],units:n},{calls:i}})},addCall:t=>{e(n=>({calls:[t,...n.calls]}))},setCalls:t=>e({calls:t})})),ZF=()=>Du(e=>e.calls),Dke=()=>Du(e=>e.fetchCalls),Rke=()=>{const{calls:e,fetchCalls:t}=Du(),[n,r]=_.useState(!1),o=Kl();_.useEffect(()=>{r(!0),(async()=>{t()})().then(()=>{r(!1)})},[]);const i=_.useMemo(()=>e.sort((s,a)=>a.id-s.id),[e]);return p.jsxs("div",{className:"card-background",children:[p.jsxs("div",{className:"card-title",children:[p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:D.dispatch}),p.jsx($me,{size:M(25),color:"white"})]}),p.jsx(Ye,{mt:5,mb:5}),p.jsx(At,{h:330,children:p.jsx("div",{className:"warrants-card-content",children:n?p.jsx(Zr,{h:"100%",children:p.jsx(en,{})}):i.length>0?i.map(s=>p.jsx("div",{className:"active-dispatchcall-card",onClick:()=>{o("/dispatch")},children:p.jsxs(nt,{style:{width:"100%"},children:[p.jsxs("div",{style:{flex:1},children:[p.jsxs(U,{style:{fontSize:13,color:"white"},weight:500,children:["(",s.code,") ",s.offense]}),p.jsxs("div",{style:{display:"flex",gap:5},children:[p.jsx(Z0,{size:16,color:"#C1C2C5"}),p.jsx(U,{color:"dimmed",size:"xs",children:he(s.time).fromNow()})]})]}),p.jsxs(U,{color:"dimmed",size:"xs",children:[D.responding_units,": ",s.units.length]})]})})):p.jsx(U,{color:"dimmed",size:"xs",children:D.no_recent_calls_found})})})]})},Lke=[{plate:"AF30442",reason:"This vehicle is wanted because its been a part of a murder and we need to confiscate it to check for evidence",expiresAt:he(new Date).format("DD-MM-YYYY")},{plate:"AF30442",reason:"Billy",expiresAt:he(new Date).format("DD-MM-YYYY")}],zke=tn(e=>({bolos:it()?Lke:[],getBolos:async()=>{try{const t=await me("getBolos");return e({bolos:t}),{bolos:t}}catch(t){return console.error("Failed to fetch recent activities:",t),{bolos:[]}}},setBolos:t=>e({bolos:t})})),GF=[];for(let e=0;e<25;e++)GF[e]={plate:`44HJJO263${e+1}`,model:"Adder"};const ZO={plate:"44HJJO263",model:"gauntlet2",owner:"John Doe (ABC123AW)",color:"Red",notes:"string",class:"Muscle",knownInformation:["Gaunlet"]},GO={plate:"44HJJO263",model:"sultan3",owner:"John Doe (ABC123AW)",color:"Black",notes:"string",class:"Super",knownInformation:["Adder"]},Ru=tn(e=>({selectedVehicle:null,isVehicleBOLO:!1,BOLOExpirationDate:"",getVehicles:async()=>it()?GF:await me("getAllVehicles"),setSelectedVehicle:t=>{it()&&e({selectedVehicle:Math.random()*10>5?ZO:GO}),e({selectedVehicle:t})},setIsVehicleBOLO(t){e({isVehicleBOLO:t})},setBOLOExpirationDate(t){e({BOLOExpirationDate:t})}})),Ake=e=>{const{setSelectedVehicle:t,setIsVehicleBOLO:n,setBOLOExpirationDate:r}=Ru(),o=Math.random()*10>5?ZO:GO,i=Kl();return p.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[p.jsx(Ye,{}),p.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[p.jsx(U,{style:{fontSize:18,color:"white"},weight:500,children:D.reason}),p.jsx(U,{c:"gray.4",size:"sm",children:e.bolo.reason}),p.jsxs(U,{c:"dimmed",size:"xs",mt:5,children:[D.expires_at," ",e.bolo.expiresAt]})]}),p.jsx(Ye,{}),p.jsx("div",{style:{display:"flex",flexDirection:"column",gap:10,alignItems:"center",width:"100%",justifyContent:"center"},children:p.jsx(at,{variant:"light",color:"gray",w:200,onClick:async()=>{t(null);const s=await me("getVehicle",{plate:e.bolo.plate},{data:{...o}}),a=await me("isVehicleBOLO",{plate:e.bolo.plate},{data:!1});if(a){const c=await me("getBOLOExpirationDate",{plate:e.bolo.plate},{data:"12/12/2024"});r(c)}t(s),n(a),i("/vehicles"),ke.closeAll()},children:D.goto_vehicle})})]})},Bke=()=>{const{bolos:e,getBolos:t}=zke(),[n,r]=_.useState(!1);return _.useEffect(()=>{r(!0),(async()=>{t()})().then(()=>{r(!1)})},[]),p.jsxs("div",{className:"card-background",children:[p.jsxs("div",{className:"card-title",children:[p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:D.bolos}),p.jsx(Fme,{size:M(25),color:"white"})]}),p.jsx(Ye,{mt:5,mb:5}),p.jsx(At,{h:290,children:p.jsx("div",{className:"warrants-card-content",children:n?p.jsx(Zr,{h:"100%",children:p.jsx(en,{})}):e.length>0?e.map(o=>p.jsx("div",{className:"bolos-card",onClick:async()=>{const i=await me("getBolo",{plate:o.plate},{data:{plate:"ABCDEFG",reason:"A pretty nice and cool reason",expiresAt:he(new Date).format("DD-MM-YYYY")}});ke.open({title:p.jsxs("div",{style:{display:"flex",gap:10,alignItems:"center"},children:[p.jsx(mx,{size:20,color:"#C1C2C5"}),p.jsx(U,{style:{fontSize:16,color:"white"},weight:500,children:i.plate})]}),centered:!0,children:p.jsx(Ake,{bolo:i})})},children:p.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:5,width:"100%"},children:[p.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[p.jsxs("div",{style:{display:"flex",gap:5,alignItems:"center"},children:[p.jsx(mx,{size:20,color:"#C1C2C5"}),p.jsx(U,{style:{fontSize:13,color:"white"},weight:500,children:o.plate})]}),p.jsxs(U,{color:"dimmed",size:"xs",children:[D.expires_at," ",o.expiresAt]})]}),p.jsx(U,{c:"gray.4",size:"xs",lineClamp:2,children:o.reason})]})})):p.jsx(U,{color:"dimmed",size:"xs",children:D.no_bolos_found})})})]})},Fke=()=>{const{config:e}=nh(),{firstname:t,lastname:n}=Gr(i=>i.personalData),{activeOfficers:r,getActiveOfficers:o}=mO();return _.useEffect(()=>{o()},[]),p.jsxs("div",{className:"dashboard",children:[p.jsxs("div",{className:"left-side",children:[p.jsxs("div",{className:"header",children:[p.jsx(U,{style:{fontSize:24,color:"white"},weight:500,children:D.welcome_back.format(t,n)}),p.jsxs(U,{color:"dimmed",size:"xs",style:{display:"flex",gap:10},children:[p.jsx(tO,{size:M(18)})," ",p.jsx(U,{color:"dimmed",size:14,children:new Date().toLocaleDateString("en-EN",{weekday:"long",year:"numeric",month:"long",day:"numeric"})})]})]}),p.jsx(Ye,{}),p.jsx(C1e,{}),p.jsxs("div",{className:"content-bottom",children:[p.jsx(Nke,{}),p.jsx(Eke,{}),p.jsx(Bke,{})]})]}),p.jsx(Ye,{orientation:"vertical"}),p.jsxs("div",{className:"right-side",children:[p.jsx("div",{className:"card-background",children:p.jsxs(At,{h:400,children:[p.jsxs("div",{className:"card-title",children:[p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:D.active_officers}),p.jsxs("div",{className:"right-side-title",children:[p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:r.length}),p.jsx(q0,{size:M(20),color:"white"})]})]}),p.jsx(Ye,{mt:5,mb:5}),p.jsx("div",{className:"card-content",children:r.length>0?p.jsx("div",{className:"active-officers-cards",children:r.map(i=>p.jsx("div",{className:"active-officer-card",children:p.jsxs(nt,{style:{width:"100%"},children:[p.jsxs("div",{style:{flex:1},children:[p.jsxs(U,{style:{fontSize:13,color:"white"},weight:500,children:[i.firstname," ",i.lastname]}),p.jsxs(U,{color:"dimmed",size:"xs",children:[D.callsign,": ",i.callsign]})]}),p.jsxs(U,{color:"dimmed",size:"xs",children:[D.attached_unit,": ",i.unitId||"None"]})]})}))}):p.jsx(U,{color:"dimmed",size:"xs",children:"No active officers"})})]})}),e.isDispatchEnabled&&p.jsx(Rke,{})]})]})};const Vke=e=>p.jsxs("div",{className:"card-background profile-card-info",children:[p.jsxs("div",{className:"card-title",children:[p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:e.title}),typeof e.icon=="string"?p.jsx("i",{className:`ti ti-${e.icon}`,style:{fontSize:24,color:"white"}}):p.jsx(e.icon,{})]}),p.jsx(Ye,{style:{width:"100%"}}),p.jsx("div",{className:"profile-card-info-badges",children:e.children})]}),Ej={title:"Debug Report title",id:0,description:"

This is a incident description

",evidence:[],officersInvolved:[{firstname:"Callum",lastname:"Graham",callsign:188,citizenid:"132142",playerId:1,position:[0,0,0]},{firstname:"Jacob",lastname:"Gray",callsign:273,citizenid:"152312",playerId:1,position:[0,0,0]},{firstname:"Edward",lastname:"Atkinson",callsign:125,citizenid:"948213",playerId:1,position:[0,0,0]}],citizensInvolved:[{firstname:"John",lastname:"Doe",citizenid:"BUB193Z4A",dob:Date.now()}]},Vi=tn(e=>({report:Ej,isReportActive:!1,setActiveReport:t=>{it()&&e({report:Ej}),e({report:t})},setReportActive:t=>{e({isReportActive:t})},setDescription:t=>{e(n=>({report:{...n.report,description:t}}))},setOfficersInvolved:t=>{e(n=>({report:{...n.report,officersInvolved:typeof t=="function"?t(n.report.officersInvolved):t}}))},setCitizensInvolved:t=>{e(n=>({report:{...n.report,citizensInvolved:typeof t=="function"?t(n.report.citizensInvolved):t}}))},setEvidence:t=>{e(n=>({report:{...n.report,evidence:typeof t=="function"?t(n.report.evidence):t}}))}})),Hke=()=>{const{setActiveReport:e,setReportActive:t}=Vi(),n=bs(u=>u.selectedProfile),r=bs(u=>u.profileCards),{setActiveIncident:o,setIncidentActive:i}=Yr(),s=Kl();if(!n)return p.jsx("div",{className:"content-width",children:p.jsx("div",{className:"card-background",children:p.jsxs("div",{className:"profile-no-selected",children:[p.jsx(lO,{size:M(50),color:"white"}),p.jsx(U,{style:{fontSize:15,color:"white"},weight:600,children:D.no_profile_selected})]})})});async function a(u){if(it())return s("/reports");const f=await me("getReport",u);e(f),t(!0),s("/reports")}async function c(u){if(it())return s("/incidents");const f=await me("getIncident",u);o(f),i(!0),s("/incidents")}return p.jsx("div",{className:"content-width",children:p.jsx(At,{h:860,children:p.jsxs("div",{className:"additional-profile-info",children:[r.map(u=>p.jsx(Vke,{title:u.title,icon:u.icon,children:p.jsx("div",{className:"profile-card-info-badges",children:n[u.id]?n[u.id].map(f=>p.jsx(mt,{color:"gray",variant:"filled",className:"profile-info-badge",radius:"md",children:f},f)):p.jsx(U,{color:"dimmed",size:"xs",children:D.no_cardid_registered.format(u.id)})})})),p.jsxs("div",{className:"card-background profile-card-info",children:[p.jsxs("div",{className:"card-title",children:[p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:D.related_reports}),p.jsx(rO,{size:M(25),color:"white"})]}),p.jsx(Ye,{style:{width:"100%"}}),n.relatedReports&&(n.relatedReports.length>0?n.relatedReports.map(u=>p.jsxs("div",{className:"related-reports-card",onClick:()=>{a(u.id)},children:[p.jsx(U,{style:{fontSize:15,color:"white"},weight:500,children:u.title}),p.jsxs("div",{className:"related-reports-extra-info",children:[p.jsxs(U,{style:{fontSize:12},weight:500,color:"dimmed",children:[u.author," - Date: ",u.date]}),p.jsxs(U,{style:{fontSize:12},weight:500,color:"dimmed",children:["#",u.id]})]})]},u.id)):p.jsx(U,{color:"dimmed",size:"xs",children:D.no_related_reports}))]}),p.jsxs("div",{className:"card-background profile-card-info",children:[p.jsxs("div",{className:"card-title",children:[p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:D.related_incidents}),p.jsx(sO,{size:M(25),color:"white"})]}),p.jsx(Ye,{style:{width:"100%"}}),n.relatedIncidents&&(n.relatedIncidents.length>0?n.relatedIncidents.map(u=>p.jsxs("div",{className:"related-reports-card",onClick:()=>{c(u.id)},children:[p.jsx(U,{style:{fontSize:15,color:"white"},weight:500,children:u.title}),p.jsxs("div",{className:"related-reports-extra-info",children:[p.jsxs(U,{style:{fontSize:12},weight:500,color:"dimmed",children:[u.author," - Date: ",u.date]}),p.jsxs(U,{style:{fontSize:12},weight:500,color:"dimmed",children:["#",u.id]})]})]},u.id)):p.jsx(U,{color:"dimmed",size:"xs",children:D.no_related_incidents}))]})]})})})},Wke=e=>{const{setSelectedProfile:t,selectedProfile:n}=bs(),r=_.useRef(null),[o,i]=_.useState(!1),s=async()=>{if(!n)return;i(!0);const a=r.current?.value;await me("updateProfileImage",{citizenId:n.citizenid,image:a},{data:1}),t({...n,image:a}),ke.closeAll()};return p.jsxs(Je,{children:[p.jsx(_n,{defaultValue:e.image,ref:r,label:D.image,description:D.avatar_description,placeholder:"https://r2.fivemanage.com/placeholder.jpg"}),p.jsx(at,{variant:"light",color:"gray",onClick:s,loading:o,children:"Confirm"})]})},Uke=()=>{const{selectedProfile:e,setSelectedProfile:t,isProfileWanted:n}=bs(),[r,o]=_.useState(!1);return e?p.jsx("div",{className:"content-width",children:p.jsx("div",{className:"card-background",children:p.jsxs("div",{className:"profile-card-content",children:[p.jsxs("div",{className:"profile-card-header",children:[p.jsxs(U,{style:{fontSize:14,color:"white"},children:[D.edit_citizen," #",e.citizenid]}),p.jsx("div",{className:"profile-card-header-buttons",children:p.jsx(zt,{label:"Unlink",withArrow:!0,color:"gray",position:"bottom",children:p.jsx(Xe,{variant:"filled",color:"gray",onClick:()=>{t(null)},children:p.jsx(Y0,{size:16,color:"white"})})})})]}),p.jsx(Ye,{style:{width:"100%"}}),p.jsxs("div",{className:"profile-card-profile-content",children:[p.jsxs("div",{className:"profile-card-wrapper",children:[p.jsxs("div",{className:"profile-card-image",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),children:[r&&p.jsx(Xe,{style:{position:"absolute",top:5,right:5,zIndex:99},onClick:()=>ke.open({title:p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:D.change_picture}),centered:!0,size:"sm",children:p.jsx(Wke,{image:e.image})}),children:p.jsx(nO,{})}),p.jsx(ai,{width:145,height:180,src:e.image??"https://r2.fivemanage.com/s64hZD0G9WtYHbURWCuSc/placeholder.jpg",radius:"md",alt:"With default placeholder",withPlaceholder:!0}),n&&p.jsx(ai,{className:"watermark",src:"https://r2.fivemanage.com/s64hZD0G9WtYHbURWCuSc/wanted-stamp.png",radius:"md",alt:"With default placeholder",withPlaceholder:!0})]}),p.jsxs("div",{className:"profile-card-inputs",children:[p.jsx(et,{disabled:!0,icon:p.jsx(r7,{size:16}),placeholder:e.citizenid,size:"xs"}),p.jsx(et,{disabled:!0,icon:p.jsx(Bme,{size:16}),placeholder:e.firstname+" "+e.lastname,size:"xs"}),p.jsx(et,{disabled:!0,icon:p.jsx(Qpe,{size:16}),placeholder:he(e.dob).format("DD/MM/YYYY"),size:"xs"}),p.jsx(et,{disabled:!0,icon:p.jsx(rme,{size:16}),placeholder:e.phoneNumber,size:"xs"}),p.jsx(et,{disabled:!0,icon:p.jsx(ame,{size:16}),placeholder:e.fingerprint??"No fingerprint found",size:"xs"})]})]}),p.jsx(Ye,{style:{width:"100%"}}),p.jsx("div",{className:"profile-card-information",children:p.jsx(lh,{content:e.notes,onSave:i=>{t({...e,notes:i}),me("saveProfileNotes",{citizenid:e.citizenid,notes:i})},styles:{content:{backgroundColor:"#242527"},toolbar:{backgroundColor:"#2C2E33"},controlsGroup:{pointerEvents:"auto",backgroundColor:"#282828"}},contentAreaStyle:{height:475,width:413,padding:0}})})]})]})})}):p.jsx("div",{className:"content-width",children:p.jsx("div",{className:"card-background",children:p.jsxs("div",{className:"profile-no-selected",children:[p.jsx(lO,{size:M(50),color:"white"}),p.jsx(U,{style:{fontSize:15,color:"white"},weight:600,children:D.no_profile_selected})]})})})},Zke=(e,t)=>{const n=k.useRef(null),{ref:r,entry:o}=wY({root:n.current,threshold:t||1});return k.useEffect(()=>{o&&o.isIntersecting&&e()},[o]),{ref:r}},Gke=({profile:e},t)=>{const{setIsProfileWanted:n,setSelectedProfile:r}=bs(),o=async i=>{r(null),n(!1);const s=await me("getProfile",i.citizenid,{data:{...pO,firstName:i.firstname,lastName:i.lastname,citizenid:i.citizenid}}),a=await me("isProfileWanted",i.citizenid,{data:!1});r(s),n(a)};return p.jsxs("div",{className:"profile-card",onClick:()=>o(e),ref:t,children:[p.jsx(ai,{width:65,height:65,src:e.image??"https://cdn.vectorstock.com/i/preview-1x/97/68/account-avatar-dark-mode-glyph-ui-icon-vector-44429768.jpg",radius:"lg",alt:"With default placeholder",withPlaceholder:!0}),p.jsxs("div",{children:[p.jsxs(U,{weight:600,style:{fontSize:13,color:"white"},children:[e.firstname," ",e.lastname]}),p.jsxs(U,{style:{fontSize:12,color:"white"},children:[D.dob,": ",he(e.dob).format("DD/MM/YYYY")]}),p.jsxs(U,{style:{fontSize:12,color:"white"},children:[D.citizen_id,": ",e.citizenid]})]})]})},Yke=k.memo(k.forwardRef(Gke)),Kke=()=>{const[e,t]=_.useState(""),{data:n,fetchNextPage:r,isFetching:o,isDebouncing:i}=eve(e),{ref:s}=Zke(()=>r()),a=_.useMemo(()=>n?n.pages.flatMap(c=>c.profiles):[],[n]);return p.jsx("div",{className:"content-width",children:p.jsxs("div",{className:"card-background",children:[p.jsxs("div",{className:"card-title",children:[p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:D.profiles}),p.jsx(cO,{size:M(25),color:"white"})]}),p.jsx(et,{icon:p.jsx(La,{}),variant:"filled",placeholder:D.search,mt:10,mb:10,value:e,onChange:c=>t(c.target.value)}),p.jsx(Ye,{mt:5,mb:5}),p.jsx("div",{className:"profiles-card-content",children:p.jsx(At,{h:860,children:p.jsx("div",{className:"profiles-card-content-flex",children:i||o?p.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center"},children:p.jsx(en,{})}):a.length>0?a.map((c,u)=>p.jsx(Yke,{profile:c,ref:u===a.length-2?s:null},c.citizenid)):p.jsx(U,{color:"dimmed",size:"xs",children:D.no_profiles_found})})})})]})})};function qke(e){CH.setQueriesData({queryKey:e},t=>{if(t)return{pages:t.pages.slice(0,1),pageParams:t.pageParams.slice(0,1)}})}const Jke=()=>(_.useEffect(()=>()=>qke(["profiles"]),[]),p.jsxs("div",{className:"profiles",children:[p.jsx(Kke,{}),p.jsx(Uke,{}),p.jsx(Hke,{})]})),YO=p.jsx("svg",{width:"54",height:"54",viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",stroke:s0.colors.blue[6],children:p.jsx("g",{fill:"none",fillRule:"evenodd",children:p.jsxs("g",{transform:"translate(1 1)",strokeWidth:"2",children:[p.jsx("circle",{strokeOpacity:".5",cx:"18",cy:"18",r:"18"}),p.jsx("path",{d:"M36 18c0-9.94-8.06-18-18-18",children:p.jsx("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})})]})})});var Qke=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,o,i;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(o=r;o--!==0;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(i=Object.keys(t),r=i.length,r!==Object.keys(n).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;for(o=r;o--!==0;){var s=i[o];if(!e(t[s],n[s]))return!1}return!0}return t!==t&&n!==n};const $j=Ta(Qke);function Jx(e){return e===null||typeof e!="object"?{}:Object.keys(e).reduce((t,n)=>{const r=e[n];return r!=null&&r!==!1&&(t[n]=r),t},{})}var Xke=Object.defineProperty,Mj=Object.getOwnPropertySymbols,e2e=Object.prototype.hasOwnProperty,t2e=Object.prototype.propertyIsEnumerable,Nj=(e,t,n)=>t in e?Xke(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,n2e=(e,t)=>{for(var n in t||(t={}))e2e.call(t,n)&&Nj(e,n,t[n]);if(Mj)for(var n of Mj(t))t2e.call(t,n)&&Nj(e,n,t[n]);return e};function YF(e,t){if(t===null||typeof t!="object")return{};const n=n2e({},t);return Object.keys(t).forEach(r=>{r.includes(`${String(e)}.`)&&delete n[r]}),n}const r2e="__MANTINE_FORM_INDEX__";function Tj(e,t){return t?typeof t=="boolean"?t:Array.isArray(t)?t.includes(e.replace(/[.][0-9]/g,`.${r2e}`)):!1:!1}function Ij(e,t,n){typeof n.value=="object"&&(n.value=Ac(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||t==="__proto__"?Object.defineProperty(e,t,n):e[t]=n.value}function Ac(e){if(typeof e!="object")return e;var t=0,n,r,o,i=Object.prototype.toString.call(e);if(i==="[object Object]"?o=Object.create(e.__proto__||null):i==="[object Array]"?o=Array(e.length):i==="[object Set]"?(o=new Set,e.forEach(function(s){o.add(Ac(s))})):i==="[object Map]"?(o=new Map,e.forEach(function(s,a){o.set(Ac(a),Ac(s))})):i==="[object Date]"?o=new Date(+e):i==="[object RegExp]"?o=new RegExp(e.source,e.flags):i==="[object DataView]"?o=new e.constructor(Ac(e.buffer)):i==="[object ArrayBuffer]"?o=e.slice(0):i.slice(-6)==="Array]"&&(o=new e.constructor(e)),o){for(r=Object.getOwnPropertySymbols(e);t0,errors:t}}function Qx(e,t,n="",r={}){return typeof e!="object"||e===null?r:Object.keys(e).reduce((o,i)=>{const s=e[i],a=`${n===""?"":`${n}.`}${i}`,c=as(a,t);let u=!1;return typeof s=="function"&&(o[a]=s(c,t,a)),typeof s=="object"&&Array.isArray(c)&&(u=!0,c.forEach((f,h)=>Qx(s,t,`${a}.${h}`,o))),typeof s=="object"&&typeof c=="object"&&c!==null&&(u||Qx(s,t,a,o)),o},r)}function Xx(e,t){return jj(typeof e=="function"?e(t):Qx(e,t))}function xp(e,t,n){if(typeof e!="string")return{hasError:!1,error:null};const r=Xx(t,n),o=Object.keys(r.errors).find(i=>e.split(".").every((s,a)=>s===i.split(".")[a]));return{hasError:!!o,error:o?r.errors[o]:null}}function o2e(e,{from:t,to:n},r){const o=as(e,r);if(!Array.isArray(o))return r;const i=[...o],s=o[t];return i.splice(t,1),i.splice(n,0,s),m1(e,i,r)}var i2e=Object.defineProperty,Dj=Object.getOwnPropertySymbols,s2e=Object.prototype.hasOwnProperty,a2e=Object.prototype.propertyIsEnumerable,Rj=(e,t,n)=>t in e?i2e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,l2e=(e,t)=>{for(var n in t||(t={}))s2e.call(t,n)&&Rj(e,n,t[n]);if(Dj)for(var n of Dj(t))a2e.call(t,n)&&Rj(e,n,t[n]);return e};function c2e(e,{from:t,to:n},r){const o=`${e}.${t}`,i=`${e}.${n}`,s=l2e({},r);return Object.keys(r).every(a=>{let c,u;if(a.startsWith(o)&&(c=a,u=a.replace(o,i)),a.startsWith(i)&&(c=a.replace(i,o),u=a),c&&u){const f=s[c],h=s[u];return h===void 0?delete s[c]:s[c]=h,f===void 0?delete s[u]:s[u]=f,!1}return!0}),s}function u2e(e,t,n){const r=as(e,n);return Array.isArray(r)?m1(e,r.filter((o,i)=>i!==t),n):n}var d2e=Object.defineProperty,Lj=Object.getOwnPropertySymbols,f2e=Object.prototype.hasOwnProperty,h2e=Object.prototype.propertyIsEnumerable,zj=(e,t,n)=>t in e?d2e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,p2e=(e,t)=>{for(var n in t||(t={}))f2e.call(t,n)&&zj(e,n,t[n]);if(Lj)for(var n of Lj(t))h2e.call(t,n)&&zj(e,n,t[n]);return e};function Aj(e,t){const n=e.substring(t.length+1).split(".")[0];return parseInt(n,10)}function Bj(e,t,n,r){if(t===void 0)return n;const o=`${String(e)}`;let i=n;r===-1&&(i=YF(`${o}.${t}`,i));const s=p2e({},i),a=new Set;return Object.entries(i).filter(([c])=>{if(!c.startsWith(`${o}.`))return!1;const u=Aj(c,o);return Number.isNaN(u)?!1:u>=t}).forEach(([c,u])=>{const f=Aj(c,o),h=c.replace(`${o}.${f}`,`${o}.${f+r}`);s[h]=u,a.add(h),a.has(c)||delete s[c]}),s}function m2e(e,t,n,r){const o=as(e,r);if(!Array.isArray(o))return r;const i=[...o];return i.splice(typeof n=="number"?n:i.length,0,t),m1(e,i,r)}function Fj(e,t){const n=Object.keys(e);if(typeof t=="string"){const r=n.filter(o=>o.startsWith(`${t}.`));return e[t]||r.some(o=>e[o])||!1}return n.some(r=>e[r])}function g2e(e){return t=>{if(!t)e(t);else if(typeof t=="function")e(t);else if(typeof t=="object"&&"nativeEvent"in t){const{currentTarget:n}=t;n instanceof HTMLInputElement?n.type==="checkbox"?e(n.checked):e(n.value):(n instanceof HTMLTextAreaElement||n instanceof HTMLSelectElement)&&e(n.value)}else e(t)}}var v2e=Object.defineProperty,y2e=Object.defineProperties,_2e=Object.getOwnPropertyDescriptors,Vj=Object.getOwnPropertySymbols,w2e=Object.prototype.hasOwnProperty,b2e=Object.prototype.propertyIsEnumerable,Hj=(e,t,n)=>t in e?v2e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,As=(e,t)=>{for(var n in t||(t={}))w2e.call(t,n)&&Hj(e,n,t[n]);if(Vj)for(var n of Vj(t))b2e.call(t,n)&&Hj(e,n,t[n]);return e},Rw=(e,t)=>y2e(e,_2e(t));function ql({initialValues:e={},initialErrors:t={},initialDirty:n={},initialTouched:r={},clearInputErrorOnChange:o=!0,validateInputOnChange:i=!1,validateInputOnBlur:s=!1,transformValues:a=u=>u,validate:c}={}){const[u,f]=_.useState(r),[h,m]=_.useState(n),[v,y]=_.useState(e),[w,P]=_.useState(Jx(t)),b=_.useRef(e),S=J=>{b.current=J},O=_.useCallback(()=>f({}),[]),E=J=>{const ne=J?As(As({},v),J):v;S(ne),m({})},$=_.useCallback(J=>P(ne=>Jx(typeof J=="function"?J(ne):J)),[]),N=_.useCallback(()=>P({}),[]),I=_.useCallback(()=>{y(e),N(),S(e),m({}),O()},[]),R=_.useCallback((J,ne)=>$(le=>Rw(As({},le),{[J]:ne})),[]),B=_.useCallback(J=>$(ne=>{if(typeof J!="string")return ne;const le=As({},ne);return delete le[J],le}),[]),z=_.useCallback(J=>m(ne=>{if(typeof J!="string")return ne;const le=YF(J,ne);return delete le[J],le}),[]),G=_.useCallback((J,ne)=>{const le=Tj(J,i);z(J),f(_e=>Rw(As({},_e),{[J]:!0})),y(_e=>{const Ne=m1(J,ne,_e);if(le){const we=xp(J,c,Ne);we.hasError?R(J,we.error):B(J)}return Ne}),!le&&o&&R(J,null)},[]),Q=_.useCallback(J=>{y(ne=>{const le=typeof J=="function"?J(ne):J;return As(As({},ne),le)}),o&&N()},[]),X=_.useCallback((J,ne)=>{z(J),y(le=>o2e(J,ne,le)),P(le=>c2e(J,ne,le))},[]),V=_.useCallback((J,ne)=>{z(J),y(le=>u2e(J,ne,le)),P(le=>Bj(J,ne,le,-1))},[]),H=_.useCallback((J,ne,le)=>{z(J),y(_e=>m2e(J,ne,le,_e)),P(_e=>Bj(J,le,_e,1))},[]),Z=_.useCallback(()=>{const J=Xx(c,v);return P(J.errors),J},[v,c]),Y=_.useCallback(J=>{const ne=xp(J,c,v);return ne.hasError?R(J,ne.error):B(J),ne},[v,c]),j=(J,{type:ne="input",withError:le=!0,withFocus:_e=!0}={})=>{const we={onChange:g2e(He=>G(J,He))};return le&&(we.error=w[J]),ne==="checkbox"?we.checked=as(J,v):we.value=as(J,v),_e&&(we.onFocus=()=>f(He=>Rw(As({},He),{[J]:!0})),we.onBlur=()=>{if(Tj(J,s)){const He=xp(J,c,v);He.hasError?R(J,He.error):B(J)}}),we},W=(J,ne)=>le=>{le?.preventDefault();const _e=Z();_e.hasErrors?ne?.(_e.errors,v,le):J?.(a(v),le)},F=J=>a(J||v),K=_.useCallback(J=>{J.preventDefault(),I()},[]),ee=J=>{if(J){const le=as(J,h);if(typeof le=="boolean")return le;const _e=as(J,v),Ne=as(J,b.current);return!$j(_e,Ne)}return Object.keys(h).length>0?Fj(h):!$j(v,b.current)},fe=_.useCallback(J=>Fj(u,J),[u]),ie=_.useCallback(J=>J?!xp(J,c,v).hasError:!Xx(c,v).hasErrors,[v,c]);return{values:v,errors:w,setValues:Q,setErrors:$,setFieldValue:G,setFieldError:R,clearFieldError:B,clearErrors:N,reset:I,validate:Z,validateField:Y,reorderListItem:X,removeListItem:V,insertListItem:H,getInputProps:j,onSubmit:W,onReset:K,isDirty:ee,isTouched:fe,setTouched:f,setDirty:m,resetTouched:O,resetDirty:E,isValid:ie,getTransformedValues:F}}const x2e=()=>{const{setActiveIncident:e,setIncidentActive:t}=Yr(),n=ql({initialValues:{title:""},validate:{title:o=>o.length===0?D.incident_title_required:null}}),r=async o=>{ke.closeAll();const i=await me("createIncident",o.title,{data:1});e({title:o.title,id:i,criminals:[],description:"

",evidence:[],officersInvolved:[]}),t(!0)};return p.jsx("form",{onSubmit:n.onSubmit(o=>r(o)),children:p.jsxs(Je,{children:[p.jsx(_n,{label:D.incident_title,"data-autofocus":!0,withAsterisk:!0,...n.getInputProps("title")}),p.jsx(at,{type:"submit",fullWidth:!0,variant:"light",color:"gray",children:D.confirm})]})})},qF=[];for(let e=0;e<25;e++)qF[e]={title:`Incident ${e+1}`,id:e,author:"Some One",date:Date.now()};const S2e=async()=>it()?{incidents:qF}:await me("getIncidents"),JF=tn(e=>({incidents:[],fetchIncidents:async()=>{const t=await S2e();e({incidents:t.incidents})},setIncidents:t=>{e(n=>({incidents:typeof t=="function"?t(n.incidents):t}))}})),P2e=e=>{const{incidents:t,fetchIncidents:n}=JF(),[r,o]=_.useState(!1),[i,s]=_.useState(""),a=500,[c,u]=_.useState(i),[f,h]=_.useState(null),[m,v]=_.useState(t);return _.useEffect(()=>{f!==null&&clearTimeout(f),o(!0);const y=setTimeout(()=>{u(i),o(!1)},a);return h(y),()=>{clearTimeout(y)}},[i]),_.useEffect(()=>{if(c.trim()==="")v(t);else{const y=t.filter(w=>(w.title||"").toLocaleLowerCase().includes(i.toLocaleLowerCase())||(w.author||"").toLocaleLowerCase().includes(i.toLocaleLowerCase()));v(y)}},[c,t]),_.useEffect(()=>{o(!0),(async()=>await n())().then(()=>{o(!1)})},[]),p.jsx("div",{className:"content-width",children:p.jsxs("div",{className:"card-background",children:[p.jsxs("div",{className:"card-title",children:[p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:D.incidents}),p.jsx(sO,{size:M(25),color:"white"})]}),p.jsx(et,{icon:p.jsx(La,{}),variant:"filled",placeholder:D.search,mt:10,mb:10,onChange:y=>s(y.target.value)}),p.jsxs(at,{fullWidth:!0,variant:"light",color:"gray",onClick:()=>ke.open({title:p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:D.create_incident}),centered:!0,size:"sm",children:p.jsx(x2e,{})}),children:[p.jsx(n7,{size:M(18),style:{marginRight:5}})," ",D.create_incident]}),p.jsx(Ye,{mt:10,mb:10}),p.jsx("div",{className:"incidents-cards-content",children:p.jsx(At,{h:680,children:p.jsx("div",{className:"profiles-card-content-flex",children:r?p.jsx(Zr,{children:p.jsx(en,{})}):m.map(y=>p.jsx("div",{className:"incident-card",onClick:()=>e.handleIncidentClick(y),children:p.jsxs("div",{className:"incident-card-content",children:[p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:y.title}),p.jsxs("div",{className:"incident-card-dimmed-text",children:[p.jsxs(U,{color:"dimmed",size:"xs",children:[y.author," -"," ",new Date(y.date).toLocaleDateString()]}),p.jsxs(U,{color:"dimmed",size:"xs",children:["#",y.id]})]})]})},y.id))})})})]})})},O2e=()=>{const{incident:e,setOfficersInvolved:t}=Yr(),[n,r]=_.useState(""),{officers:o,getOfficers:i}=mO(),[s,a]=_.useState(o),c=500,[u,f]=_.useState(n),[h,m]=_.useState(!1),[v,y]=_.useState(null);_.useEffect(()=>{v!==null&&clearTimeout(v),m(!0);const P=setTimeout(()=>{f(n),m(!1)},c);return y(P),()=>{clearTimeout(P)}},[n]),_.useEffect(()=>{if(u.trim()==="")a(o);else{const P=o.filter(b=>(b.citizenid||"").toLowerCase().includes(n.toLowerCase())||(b.firstname||"").toLowerCase().includes(n.toLowerCase())||(b.lastname||"").toLowerCase().includes(n.toLowerCase())||(b.firstname+" "+b.lastname||"").toLowerCase().includes(n.toLowerCase()));a(P)}},[u,o]),_.useEffect(()=>{i()},[]);const w=async P=>{if(e.officersInvolved.some(b=>b.citizenid===P.citizenid))return ke.closeAll();await me("addOfficer",{id:e.id,citizenid:P.citizenid},{data:1}),ke.closeAll(),t(b=>b.some(S=>S.citizenid===P.citizenid)?b:[...b,{firstname:P.firstname,lastname:P.lastname,callsign:P.callsign,citizenid:P.citizenid,playerId:P.playerId,position:[1,1,1]}])};return p.jsx("form",{children:p.jsxs(Je,{children:[p.jsx(et,{icon:p.jsx(La,{}),variant:"filled",placeholder:D.search,mt:10,mb:10,value:n,onChange:P=>r(P.target.value)}),h?p.jsx(Zr,{children:p.jsx(en,{})}):s.length>0?s.map(P=>p.jsxs("div",{className:"add-officer-card",onClick:()=>w(P),children:[p.jsxs(U,{weight:500,style:{fontSize:13,color:"white"},children:[P.firstname," ",P.lastname]}),p.jsxs(U,{style:{fontSize:13,color:"white"},children:[D.callsign,": ",P.callsign]})]},P.citizenid)):p.jsxs(Je,{spacing:0,c:"dark.2",justify:"center",align:"center",children:[p.jsx(Xf,{size:36}),p.jsx(U,{size:"xl",children:D.no_officers_found})]})]})})},C2e=()=>{const[e,t]=_.useState(!1),{incident:n,setEvidence:r}=Yr(),o=ql({initialValues:{label:"",image:""},validate:{label:s=>s.length===0?D.image_label_required:null,image:s=>s.length===0?D.image_url_required:null}}),i=async s=>{t(!0),await me("addEvidence",{id:n.id,evidence:{...s}},{data:1}),r(a=>[...a,s]),t(!1),ke.closeAll()};return p.jsx("form",{onSubmit:o.onSubmit(s=>i(s)),children:p.jsxs(Je,{children:[p.jsx(_n,{label:D.image_label,withAsterisk:!0,...o.getInputProps("label")}),p.jsx(_n,{label:p.jsxs("div",{style:{display:"flex",gap:10,alignItems:"center",marginBottom:5},children:[p.jsx(U,{children:D.image_url}),p.jsx(zt,{label:D.take_picture,withArrow:!0,color:"gray",children:p.jsx(Xe,{disabled:o.getInputProps("label").value==="",variant:"default",size:"sm",p:1.5,onClick:async()=>{await me("takePicture",{id:n.id,imageLabel:o.getInputProps("label").value,type:"incident"},{data:1})},children:p.jsx(Q8,{size:"1.125rem"})})})]}),placeholder:"https://i.imgur.com/dqopYB9b.jpg",...o.getInputProps("image")}),p.jsx(at,{variant:"light",color:"gray",type:"submit",loading:e,children:D.add_evidence})]})})},k2e=ue(()=>({container:{position:"relative"},image:{zIndex:2,"&:hover":{cursor:"pointer"}},actionIcon:{position:"absolute",top:0,right:0,zIndex:1}})),E2e=({evidence:e})=>{const{classes:t}=k2e(),[n,r]=_.useState(!1),{incident:o,setEvidence:i}=Yr();return p.jsx(zt,{label:e.label,withArrow:!0,color:"gray",children:p.jsxs(Pe,{className:t.container,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:[p.jsx(ai,{src:e.image,radius:"sm",width:105,height:105,className:t.image,onClick:()=>ke.open({children:p.jsx(ai,{src:e.image,onClick:()=>ke.closeAll()}),withCloseButton:!1,centered:!0,padding:0,size:"unset",transitionProps:{transition:"pop"}})},`${e.label}-${e.image}`),n&&p.jsx(Xe,{variant:"filled",color:"red",radius:"sm",size:"xs",className:t.actionIcon,onClick:()=>ke.openConfirmModal({title:p.jsx(U,{style:{fontSize:16,color:"white"},weight:500,children:D.remove_evidence}),centered:!0,children:p.jsx(U,{size:"sm",c:"dark.2",children:D.remove_evidence_confirm.format(e.label)}),labels:{confirm:D.confirm,cancel:D.cancel},confirmProps:{color:"red"},groupProps:{spacing:6},onConfirm:async()=>{await me("removeEvidence",{id:o.id,label:e.label,image:e.image},{data:1}),i(s=>s.filter(a=>a.image!==e.image&&a.label!==e.label))}}),children:p.jsx(pu,{})})]})})},$2e=()=>{const{incident:e,isIncidentActive:t,setIncidentActive:n,setOfficersInvolved:r,setDescription:o}=Yr(),{setIncidents:i}=JF();return t?p.jsx(At,{h:860,children:p.jsxs("div",{className:"incident-content-width",children:[p.jsxs("div",{className:"incident-middle-content",children:[p.jsxs("div",{className:"profile-card-header",children:[p.jsx(U,{style:{fontSize:15,color:"white"},children:e.title}),p.jsxs("div",{className:"profile-card-header-buttons",children:[p.jsx(zt,{label:D.delete_incident,withArrow:!0,color:"gray",position:"bottom",children:p.jsx(Xe,{variant:"filled",color:"red",onClick:()=>{ke.openConfirmModal({title:p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:D.delete_incident}),size:"sm",centered:!0,labels:{confirm:D.confirm,cancel:D.cancel},groupProps:{spacing:6},confirmProps:{color:"red"},onConfirm:async()=>{await me("deleteIncident",{id:e.id},{data:1})&&i(a=>a.filter(c=>c.id!==e.id)),n(!1)},children:p.jsx(U,{size:"sm",c:"dark.2",children:D.delete_incident_confirm.format(e.title)})})},children:p.jsx(K0,{size:16,color:"white"})})}),p.jsx(zt,{label:D.unlink,withArrow:!0,color:"gray",position:"bottom",children:p.jsx(Xe,{variant:"filled",color:"gray",onClick:()=>{n(!1)},children:p.jsx(Y0,{size:16,color:"white"})})})]})]}),p.jsx(Ye,{style:{width:"100%"}}),p.jsx("div",{className:"incident-middle-card",children:p.jsx(lh,{content:e.description,onSave:s=>{me("saveIncidentContents",{incidentId:e.id,contents:s}),o(s)},styles:{content:{backgroundColor:"#242527"},toolbar:{backgroundColor:"#2C2E33"},controlsGroup:{pointerEvents:"auto",backgroundColor:"#282828"}},contentAreaStyle:{height:270,width:413,padding:0}})})]}),p.jsxs("div",{className:"card-background profile-card-info",children:[p.jsxs("div",{className:"card-title",children:[p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:D.officers_involved}),p.jsx(q0,{size:M(25),color:"white"})]}),p.jsx(Ye,{style:{width:"100%"}}),p.jsxs("div",{className:"profile-card-info-badges",children:[p.jsx(mt,{color:"gray",variant:"filled",className:"incident-info-badge-main",radius:"md",onClick:()=>ke.open({title:p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:D.add_officer}),centered:!0,size:"sm",children:p.jsx(O2e,{})}),children:D.add_officer}),e.officersInvolved.map(s=>p.jsxs(mt,{color:"gray",variant:"filled",className:"incident-info-badge",rightSection:p.jsx(Xe,{size:"xs",radius:"xl",variant:"transparent",onClick:()=>{ke.openConfirmModal({title:p.jsx(U,{style:{fontSize:16,color:"white"},weight:500,children:D.remove_officer}),centered:!0,children:p.jsx(U,{size:"sm",c:"dark.2",children:D.remove_officer_confirm.format(s.firstname,s.lastname,s.callsign)}),confirmProps:{color:"red"},groupProps:{spacing:6},labels:{confirm:D.confirm,cancel:D.cancel},onConfirm:async()=>{await me("removeOfficer",{id:e.id,citizenid:s.citizenid},{data:1}),r(a=>a.filter(c=>c.citizenid!==s.citizenid))}})},children:p.jsx(pu,{size:M(10)})}),children:[s.firstname," ",s.lastname," ",s.callsign?`(${s.callsign})`:""]},s.citizenid))]})]}),p.jsxs("div",{className:"card-background profile-card-info",children:[p.jsxs("div",{className:"card-title",children:[p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:D.evidence}),p.jsx(s7,{size:M(25),color:"white"})]}),p.jsx(Ye,{style:{width:"100%"}}),p.jsxs("div",{className:"profile-card-info-badges",children:[p.jsx(at,{onClick:()=>ke.open({centered:!0,title:p.jsx(U,{style:{fontSize:16,color:"white"},weight:500,children:D.add_evidence}),children:p.jsx(C2e,{}),size:"sm"}),variant:"filled",color:"gray",w:105,h:105,children:p.jsx(Iu,{size:36})}),e.evidence.map(s=>p.jsx(E2e,{evidence:s},`${s.image}-${s.label}`))]})]})]})}):p.jsx("div",{className:"content-width",children:p.jsx("div",{className:"card-background",children:p.jsxs("div",{className:"profile-no-selected",children:[p.jsx(G0,{size:M(50),color:"white"}),p.jsx(U,{style:{fontSize:15,color:"white"},weight:600,children:D.no_incident_selected})]})})})},Wj=[{firstname:"John",lastname:"Doe",dob:Date.now(),citizenid:"12345"},{firstname:"Jane",lastname:"Smith",dob:Date.now(),citizenid:"67890"},{firstname:"David",lastname:"Williams",dob:Date.now(),citizenid:"13579"},{firstname:"Samantha",lastname:"Jones",dob:Date.now(),citizenid:"24680"}],M2e=tn(e=>({criminalProfiles:it()?Wj:[],getCriminalProfiles:async t=>{if(t==="")return e({criminalProfiles:[]});const n=await me("getCriminalProfiles",t,{data:Wj,delay:300});e({criminalProfiles:n})},setCriminalProfiles:t=>e({criminalProfiles:t})})),N2e=()=>{const{incident:e,setCriminals:t}=Yr(),[n,r]=_.useState(""),{criminalProfiles:o,getCriminalProfiles:i}=M2e(),s=500,[a,c]=_.useState(n),[u,f]=_.useState(!1),[h,m]=_.useState(null);_.useEffect(()=>{h!==null&&clearTimeout(h),f(!0);const y=setTimeout(()=>{c(n),f(!1)},s);return m(y),()=>{clearTimeout(y)}},[n]),_.useEffect(()=>{i(a)},[a]);const v=async y=>{await me("addCriminal",{id:e.id,criminalId:y.citizenid},{data:1}),ke.closeAll(),t(w=>w.some(P=>P.citizenid===y.citizenid)?w:[...w,{citizenid:y.citizenid,dob:y.dob,firstname:y.firstname,lastname:y.lastname,image:y.image,charges:[],issueWarrant:!1,pleadedGuilty:!1,processed:!1,penalty:{time:0,reduction:0,points:0,fine:0}}])};return p.jsxs(Je,{children:[p.jsx(et,{icon:p.jsx(La,{}),variant:"filled",placeholder:D.search,mt:10,mb:10,value:n,onChange:y=>r(y.target.value)}),u?p.jsx(Zr,{children:p.jsx(en,{})}):o.length>0?o.map(y=>p.jsxs("div",{className:"profile-card",onClick:()=>v(y),children:[p.jsx(ai,{width:65,height:65,src:y.image??"https://cdn.vectorstock.com/i/preview-1x/97/68/account-avatar-dark-mode-glyph-ui-icon-vector-44429768.jpg",radius:"lg",alt:"With default placeholder",withPlaceholder:!0}),p.jsxs("div",{children:[p.jsxs(U,{weight:600,style:{fontSize:13,color:"white"},children:[y.firstname," ",y.lastname]}),p.jsxs(U,{style:{fontSize:12,color:"white"},children:[D.dob,": ",y.dob]}),p.jsxs(U,{style:{fontSize:12,color:"white"},children:[D.citizen_id,": ",y.citizenid]})]})]},y.citizenid)):p.jsxs(Je,{spacing:0,c:"dark.2",justify:"center",align:"center",children:[p.jsx(Xf,{size:36}),p.jsx(U,{size:"xl",children:D.no_profiles_found})]})]})};var T2e=Object.defineProperty,I2e=Object.defineProperties,j2e=Object.getOwnPropertyDescriptors,$y=Object.getOwnPropertySymbols,QF=Object.prototype.hasOwnProperty,XF=Object.prototype.propertyIsEnumerable,Uj=(e,t,n)=>t in e?T2e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Zj=(e,t)=>{for(var n in t||(t={}))QF.call(t,n)&&Uj(e,n,t[n]);if($y)for(var n of $y(t))XF.call(t,n)&&Uj(e,n,t[n]);return e},Gj=(e,t)=>I2e(e,j2e(t)),D2e=(e,t)=>{var n={};for(var r in e)QF.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&$y)for(var r of $y(e))t.indexOf(r)<0&&XF.call(e,r)&&(n[r]=e[r]);return n};function eS(e){var t=e,{direction:n,style:r}=t,o=D2e(t,["direction","style"]);const i=ar();return k.createElement(lJ,Gj(Zj({},o),{style:Gj(Zj({},r),{transform:n==="next"&&i.dir==="ltr"||n==="previous"&&i.dir==="rtl"?"rotate(270deg)":"rotate(90deg)"})}))}eS.displayName="@mantine/dates/Chevron";var R2e=Object.defineProperty,L2e=Object.defineProperties,z2e=Object.getOwnPropertyDescriptors,Yj=Object.getOwnPropertySymbols,A2e=Object.prototype.hasOwnProperty,B2e=Object.prototype.propertyIsEnumerable,Kj=(e,t,n)=>t in e?R2e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Sp=(e,t)=>{for(var n in t||(t={}))A2e.call(t,n)&&Kj(e,n,t[n]);if(Yj)for(var n of Yj(t))B2e.call(t,n)&&Kj(e,n,t[n]);return e},qj=(e,t)=>L2e(e,z2e(t));const Tf={xs:M(30),sm:M(36),md:M(42),lg:M(48),xl:M(54)};var F2e=ue((e,{radius:t,isStatic:n},{size:r})=>{const o=e.fn.variant({variant:"filled"}),i=e.fn.variant({variant:"light"});return{day:qj(Sp({width:re({size:r,sizes:Tf}),height:re({size:r,sizes:Tf}),fontSize:re({size:r,sizes:e.fontSizes}),display:"inline-flex",justifyContent:"center",alignItems:"center",userSelect:n?void 0:"none",cursor:n?"default":"pointer",borderRadius:e.fn.radius(t)},n?null:e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[0]})),{"&:active":n?void 0:e.activeStyles,"&[data-disabled]":qj(Sp({color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[4],cursor:"not-allowed"},e.fn.hover({backgroundColor:"transparent"})),{"&:active":{transform:"none"}}),"&[data-weekend]":{color:e.colors.red[e.fn.primaryShade()]},"&[data-outside]":{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[4]},"&[data-in-range]":Sp({backgroundColor:i.background,borderRadius:0},n?null:e.fn.hover({backgroundColor:i.hover})),"&[data-first-in-range]":{borderTopLeftRadius:e.radius.sm,borderBottomLeftRadius:e.radius.sm},"&[data-last-in-range]":{borderTopRightRadius:e.radius.sm,borderBottomRightRadius:e.radius.sm},"&[data-selected]":Sp({color:o.color,backgroundColor:o.background},n?null:e.fn.hover({backgroundColor:o.hover})),"&[data-hidden]":{display:"none"}})}});const V2e=F2e;var H2e=Object.defineProperty,W2e=Object.defineProperties,U2e=Object.getOwnPropertyDescriptors,Jj=Object.getOwnPropertySymbols,Z2e=Object.prototype.hasOwnProperty,G2e=Object.prototype.propertyIsEnumerable,Qj=(e,t,n)=>t in e?H2e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Pp=(e,t)=>{for(var n in t||(t={}))Z2e.call(t,n)&&Qj(e,n,t[n]);if(Jj)for(var n of Jj(t))G2e.call(t,n)&&Qj(e,n,t[n]);return e},Op=(e,t)=>W2e(e,U2e(t)),Y2e=ue((e,t,{size:n})=>{const r=re({size:n,sizes:Tf});return{calendarHeaderControlIcon:{},calendarHeader:{display:"flex",maxWidth:`calc(${r} * 7 + ${M(7)})`},calendarHeaderControl:Op(Pp({width:r,height:r,borderRadius:e.fn.radius(),display:"flex",justifyContent:"center",alignItems:"center",userSelect:"none"},e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[0]})),{"&:active":e.activeStyles,"&[data-disabled]":Op(Pp({opacity:.2,cursor:"not-allowed"},e.fn.hover({backgroundColor:"transparent"})),{"&:active":{transform:"none"}})}),calendarHeaderLevel:Op(Pp({height:r,borderRadius:e.fn.radius(),display:"flex",justifyContent:"center",alignItems:"center",userSelect:"none",flex:1,fontSize:re({size:n,sizes:e.fontSizes}),fontWeight:500,textTransform:"capitalize"},e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[0]})),{"&:active":e.activeStyles,"&[data-static]":Op(Pp({cursor:"default",userSelect:"unset"},e.fn.hover({backgroundColor:"transparent"})),{"&:active":{transform:"none"}})})}});const K2e=Y2e;var q2e=Object.defineProperty,My=Object.getOwnPropertySymbols,e9=Object.prototype.hasOwnProperty,t9=Object.prototype.propertyIsEnumerable,Xj=(e,t,n)=>t in e?q2e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,J2e=(e,t)=>{for(var n in t||(t={}))e9.call(t,n)&&Xj(e,n,t[n]);if(My)for(var n of My(t))t9.call(t,n)&&Xj(e,n,t[n]);return e},Q2e=(e,t)=>{var n={};for(var r in e)e9.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&My)for(var r of My(e))t.indexOf(r)<0&&t9.call(e,r)&&(n[r]=e[r]);return n};const X2e={nextDisabled:!1,previousDisabled:!1,hasNextLevel:!0,withNext:!0,withPrevious:!0,size:"sm"},g1=_.forwardRef((e,t)=>{const n=ae("CalendarHeader",X2e,e),{className:r,nextIcon:o,previousIcon:i,nextLabel:s,previousLabel:a,onNext:c,onPrevious:u,onLevelClick:f,label:h,classNames:m,styles:v,unstyled:y,nextDisabled:w,previousDisabled:P,hasNextLevel:b,levelControlAriaLabel:S,withNext:O,withPrevious:E,__staticSelector:$,__preventFocus:N,__stopPropagation:I,size:R,variant:B}=n,z=Q2e(n,["className","nextIcon","previousIcon","nextLabel","previousLabel","onNext","onPrevious","onLevelClick","label","classNames","styles","unstyled","nextDisabled","previousDisabled","hasNextLevel","levelControlAriaLabel","withNext","withPrevious","__staticSelector","__preventFocus","__stopPropagation","size","variant"]),{classes:G,cx:Q}=K2e(null,{name:["CalendarHeader",$],classNames:m,styles:v,unstyled:y,size:R,variant:B}),X=N?V=>V.preventDefault():void 0;return k.createElement(Pe,J2e({className:Q(G.calendarHeader,r),ref:t},z),E&&k.createElement(ds,{className:G.calendarHeaderControl,"data-previous":!0,"aria-label":a,onClick:u,unstyled:y,onMouseDown:X,disabled:P,"data-disabled":P||void 0,tabIndex:N?-1:0,"data-mantine-stop-propagation":I||void 0},i||k.createElement(eS,{className:G.calendarHeaderControlIcon,direction:"previous","data-previous":!0})),k.createElement(ds,{component:b?"button":"div",className:G.calendarHeaderLevel,onClick:b?f:void 0,unstyled:y,onMouseDown:b?X:void 0,disabled:!b,"data-static":!b||void 0,"aria-label":S,tabIndex:N||!b?-1:0,"data-mantine-stop-propagation":I||void 0},h),O&&k.createElement(ds,{className:G.calendarHeaderControl,"data-next":!0,"aria-label":s,onClick:c,unstyled:y,onMouseDown:X,disabled:w,"data-disabled":w||void 0,tabIndex:N?-1:0,"data-mantine-stop-propagation":I||void 0},o||k.createElement(eS,{className:G.calendarHeaderControlIcon,direction:"next","data-next":!0})))});g1.displayName="@mantine/dates/CalendarHeader";function Lw(e,t){return e?e==="month"?0:e==="year"?1:2:t}function eEe(e){return e===0?"month":e===1?"year":"decade"}function gd(e,t,n){return eEe(ca(Lw(e,0),Lw(t,0),Lw(n,2)))}var tEe=ue(()=>({calendar:{}}));const nEe=tEe;var rEe=ue((e,t,{size:n})=>({monthLevelGroup:{display:"flex","& [data-month-level]:not(:last-of-type)":{marginRight:re({size:n,sizes:e.spacing})}}}));const oEe=rEe;var iEe=ue(e=>({monthLevel:{},calendarHeader:{marginBottom:e.spacing.xs}}));const sEe=iEe,aEe={locale:"en",firstDayOfWeek:1,weekendDays:[0,6],labelSeparator:"–"},lEe=_.createContext(aEe);var cEe=Object.defineProperty,uEe=Object.defineProperties,dEe=Object.getOwnPropertyDescriptors,eD=Object.getOwnPropertySymbols,fEe=Object.prototype.hasOwnProperty,hEe=Object.prototype.propertyIsEnumerable,tD=(e,t,n)=>t in e?cEe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pEe=(e,t)=>{for(var n in t||(t={}))fEe.call(t,n)&&tD(e,n,t[n]);if(eD)for(var n of eD(t))hEe.call(t,n)&&tD(e,n,t[n]);return e},mEe=(e,t)=>uEe(e,dEe(t));function Va(){const e=_.useContext(lEe),t=_.useCallback(i=>i||e.locale,[e.locale]),n=_.useCallback(i=>typeof i=="number"?i:e.firstDayOfWeek,[e.firstDayOfWeek]),r=_.useCallback(i=>Array.isArray(i)?i:e.weekendDays,[e.weekendDays]),o=_.useCallback(i=>typeof i=="string"?i:e.labelSeparator,[e.labelSeparator]);return mEe(pEe({},e),{getLocale:t,getFirstDayOfWeek:n,getWeekendDays:r,getLabelSeparator:o})}function gEe(e,t=1){const n=new Date(e);for(;n.getDay()!==t;)n.setDate(n.getDate()-1);return n}function vEe(e,t=1){const n=new Date(e),r=t===0?6:t-1;for(;n.getDay()!==r;)n.setDate(n.getDate()+1);return n}function yEe(e,t=1){const n=e.getMonth(),r=new Date(e.getFullYear(),n,1),o=new Date(e.getFullYear(),e.getMonth()+1,0),i=vEe(o,t),s=gEe(r,t),a=[];for(;s<=i;){const c=[];for(let u=0;u<7;u+=1)c.push(new Date(s)),s.setDate(s.getDate()+1);a.push(c)}return a}function n9(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()}function r9(e,t){return t instanceof Date?he(e).isBefore(he(t).add(1,"day"),"day"):!0}function o9(e,t){return t instanceof Date?he(e).isAfter(he(t).subtract(1,"day"),"day"):!0}var _Ee=Object.defineProperty,wEe=Object.defineProperties,bEe=Object.getOwnPropertyDescriptors,nD=Object.getOwnPropertySymbols,xEe=Object.prototype.hasOwnProperty,SEe=Object.prototype.propertyIsEnumerable,rD=(e,t,n)=>t in e?_Ee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,PEe=(e,t)=>{for(var n in t||(t={}))xEe.call(t,n)&&rD(e,n,t[n]);if(nD)for(var n of nD(t))SEe.call(t,n)&&rD(e,n,t[n]);return e},OEe=(e,t)=>wEe(e,bEe(t)),CEe=ue(e=>({monthThead:{},monthRow:{},monthTbody:{},monthCell:{padding:0,"&[data-with-spacing]":{padding:M(.5)}},month:OEe(PEe({},e.fn.fontStyles()),{borderCollapse:"collapse",tableLayout:"fixed","& *":{boxSizing:"border-box"}})}));const kEe=CEe;function EEe(e,t,n,r,o,i,s){const a=e.flat().filter(f=>{var h;return r9(f,n)&&o9(f,t)&&!o?.(f)&&!((h=r?.(f))!=null&&h.disabled)&&(!i||n9(f,s))}),c=a.find(f=>{var h;return(h=r?.(f))==null?void 0:h.selected});if(c)return c;const u=a.find(f=>he().isSame(f,"date"));return u||a[0]}var $Ee=Object.defineProperty,Ny=Object.getOwnPropertySymbols,i9=Object.prototype.hasOwnProperty,s9=Object.prototype.propertyIsEnumerable,oD=(e,t,n)=>t in e?$Ee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,MEe=(e,t)=>{for(var n in t||(t={}))i9.call(t,n)&&oD(e,n,t[n]);if(Ny)for(var n of Ny(t))s9.call(t,n)&&oD(e,n,t[n]);return e},NEe=(e,t)=>{var n={};for(var r in e)i9.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ny)for(var r of Ny(e))t.indexOf(r)<0&&s9.call(e,r)&&(n[r]=e[r]);return n};const TEe={tabIndex:0,size:"sm"},a9=_.forwardRef((e,t)=>{const n=ae("Day",TEe,e),{className:r,date:o,radius:i,disabled:s,styles:a,classNames:c,unstyled:u,__staticSelector:f,weekend:h,outside:m,selected:v,renderDay:y,inRange:w,firstInRange:P,lastInRange:b,hidden:S,static:O,variant:E,size:$}=n,N=NEe(n,["className","date","radius","disabled","styles","classNames","unstyled","__staticSelector","weekend","outside","selected","renderDay","inRange","firstInRange","lastInRange","hidden","static","variant","size"]),{classes:I,cx:R}=V2e({radius:i,isStatic:O},{name:["Day",f],classNames:c,styles:a,unstyled:u,variant:E,size:$});return k.createElement(ds,MEe({component:O?"div":"button",ref:t,className:R(I.day,r),disabled:s,"data-today":he(o).isSame(new Date,"day")||void 0,"data-hidden":S||void 0,"data-disabled":s||void 0,"data-weekend":!s&&!m&&h||void 0,"data-outside":!s&&m||void 0,"data-selected":!s&&v||void 0,"data-in-range":w&&!s||void 0,"data-first-in-range":P&&!s||void 0,"data-last-in-range":b&&!s||void 0,unstyled:u},N),y?.(o)||o.getDate())});a9.displayName="@mantine/dates/Day";function IEe({locale:e,format:t="dd",firstDayOfWeek:n=1}){const r=he().day(n),o=[];for(let i=0;i<7;i+=1)typeof t=="string"?o.push(he(r).add(i,"days").locale(e).format(t)):o.push(t(he(r).add(i,"days").toDate()));return o}var jEe=ue((e,t,{size:n})=>({weekdaysRow:{},weekday:{color:e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[5],fontWeight:400,fontSize:re({size:n,sizes:e.fontSizes}),textTransform:"capitalize",paddingBottom:`calc(${re({size:n,sizes:e.spacing})} / 2)`}}));const DEe=jEe;var REe=Object.defineProperty,Ty=Object.getOwnPropertySymbols,l9=Object.prototype.hasOwnProperty,c9=Object.prototype.propertyIsEnumerable,iD=(e,t,n)=>t in e?REe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,LEe=(e,t)=>{for(var n in t||(t={}))l9.call(t,n)&&iD(e,n,t[n]);if(Ty)for(var n of Ty(t))c9.call(t,n)&&iD(e,n,t[n]);return e},zEe=(e,t)=>{var n={};for(var r in e)l9.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ty)for(var r of Ty(e))t.indexOf(r)<0&&c9.call(e,r)&&(n[r]=e[r]);return n};const AEe={weekdayFormat:"dd",cellComponent:"th",size:"sm"},u9=_.forwardRef((e,t)=>{const n=ae("WeekdaysRow",AEe,e),{className:r,locale:o,firstDayOfWeek:i,weekdayFormat:s,cellComponent:a,__staticSelector:c,classNames:u,styles:f,unstyled:h,variant:m,size:v}=n,y=zEe(n,["className","locale","firstDayOfWeek","weekdayFormat","cellComponent","__staticSelector","classNames","styles","unstyled","variant","size"]),w=Va(),{classes:P,cx:b}=DEe(null,{name:["WeekdaysRow",c],classNames:u,styles:f,unstyled:h,variant:m,size:v}),S=IEe({locale:w.getLocale(o),format:s,firstDayOfWeek:w.getFirstDayOfWeek(i)}).map((O,E)=>k.createElement(a,{key:E,className:P.weekday},O));return k.createElement(Pe,LEe({component:"tr",ref:t,className:b(P.weekdaysRow,r)},y),S)});u9.displayName="@mantine/dates/WeekdaysRow";var BEe=Object.defineProperty,FEe=Object.defineProperties,VEe=Object.getOwnPropertyDescriptors,Iy=Object.getOwnPropertySymbols,d9=Object.prototype.hasOwnProperty,f9=Object.prototype.propertyIsEnumerable,sD=(e,t,n)=>t in e?BEe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Cp=(e,t)=>{for(var n in t||(t={}))d9.call(t,n)&&sD(e,n,t[n]);if(Iy)for(var n of Iy(t))f9.call(t,n)&&sD(e,n,t[n]);return e},zw=(e,t)=>FEe(e,VEe(t)),HEe=(e,t)=>{var n={};for(var r in e)d9.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Iy)for(var r of Iy(e))t.indexOf(r)<0&&f9.call(e,r)&&(n[r]=e[r]);return n};const WEe={size:"sm",withCellSpacing:!0},h9=_.forwardRef((e,t)=>{const n=ae("Month",WEe,e),{className:r,classNames:o,styles:i,unstyled:s,__staticSelector:a,locale:c,firstDayOfWeek:u,weekdayFormat:f,month:h,weekendDays:m,getDayProps:v,excludeDate:y,minDate:w,maxDate:P,renderDay:b,hideOutsideDates:S,hideWeekdays:O,getDayAriaLabel:E,static:$,__getDayRef:N,__onDayKeyDown:I,__onDayClick:R,__onDayMouseEnter:B,__preventFocus:z,__stopPropagation:G,withCellSpacing:Q,size:X,variant:V}=n,H=HEe(n,["className","classNames","styles","unstyled","__staticSelector","locale","firstDayOfWeek","weekdayFormat","month","weekendDays","getDayProps","excludeDate","minDate","maxDate","renderDay","hideOutsideDates","hideWeekdays","getDayAriaLabel","static","__getDayRef","__onDayKeyDown","__onDayClick","__onDayMouseEnter","__preventFocus","__stopPropagation","withCellSpacing","size","variant"]),Z=Va(),{classes:Y,cx:j}=kEe(null,{name:["Month",a],classNames:o,styles:i,unstyled:s,variant:V,size:X}),W={__staticSelector:a||"Month",classNames:o,styles:i,unstyled:s,variant:V,size:X},F=yEe(h,Z.getFirstDayOfWeek(u)),K=EEe(F,w,P,v,y,S,h),ee=F.map((fe,ie)=>{const J=fe.map((ne,le)=>{const _e=!n9(ne,h),Ne=E?.(ne)||he(ne).locale(c||Z.locale).format("D MMMM YYYY"),we=v?.(ne),He=he(ne).isSame(K,"date");return k.createElement("td",{key:ne.toString(),className:Y.monthCell,"data-with-spacing":Q||void 0},k.createElement(a9,zw(Cp(zw(Cp({},W),{"data-mantine-stop-propagation":G||void 0,renderDay:b,date:ne,weekend:Z.getWeekendDays(m).includes(ne.getDay()),outside:_e,hidden:S?_e:!1,"aria-label":Ne,static:$,disabled:y?.(ne)||!r9(ne,P)||!o9(ne,w),ref:Te=>N?.(ie,le,Te)}),we),{onKeyDown:Te=>{var je;(je=we?.onKeyDown)==null||je.call(we,Te),I?.(Te,{rowIndex:ie,cellIndex:le,date:ne})},onMouseEnter:Te=>{var je;(je=we?.onMouseEnter)==null||je.call(we,Te),B?.(Te,ne)},onClick:Te=>{var je;(je=we?.onClick)==null||je.call(we,Te),R?.(Te,ne)},onMouseDown:Te=>{var je;(je=we?.onMouseDown)==null||je.call(we,Te),z&&Te.preventDefault()},tabIndex:z||!He?-1:0})))});return k.createElement("tr",{key:ie,className:Y.monthRow},J)});return k.createElement(Pe,Cp({component:"table",className:j(Y.month,r),ref:t},H),!O&&k.createElement("thead",{className:Y.monthThead},k.createElement(u9,zw(Cp({},W),{locale:c,firstDayOfWeek:u,weekdayFormat:f}))),k.createElement("tbody",{className:Y.monthTbody},ee))});h9.displayName="@mantine/dates/Month";var UEe=Object.defineProperty,jy=Object.getOwnPropertySymbols,p9=Object.prototype.hasOwnProperty,m9=Object.prototype.propertyIsEnumerable,aD=(e,t,n)=>t in e?UEe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Aw=(e,t)=>{for(var n in t||(t={}))p9.call(t,n)&&aD(e,n,t[n]);if(jy)for(var n of jy(t))m9.call(t,n)&&aD(e,n,t[n]);return e},ZEe=(e,t)=>{var n={};for(var r in e)p9.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&jy)for(var r of jy(e))t.indexOf(r)<0&&m9.call(e,r)&&(n[r]=e[r]);return n};const GEe={monthLabelFormat:"MMMM YYYY"},g9=_.forwardRef((e,t)=>{const n=ae("MonthLevel",GEe,e),{month:r,locale:o,firstDayOfWeek:i,weekdayFormat:s,weekendDays:a,getDayProps:c,excludeDate:u,minDate:f,maxDate:h,renderDay:m,hideOutsideDates:v,hideWeekdays:y,getDayAriaLabel:w,__getDayRef:P,__onDayKeyDown:b,__onDayClick:S,__onDayMouseEnter:O,withCellSpacing:E,__preventFocus:$,__stopPropagation:N,nextIcon:I,previousIcon:R,nextLabel:B,previousLabel:z,onNext:G,onPrevious:Q,onLevelClick:X,nextDisabled:V,previousDisabled:H,hasNextLevel:Z,levelControlAriaLabel:Y,withNext:j,withPrevious:W,className:F,monthLabelFormat:K,classNames:ee,styles:fe,unstyled:ie,__staticSelector:J,size:ne,variant:le,static:_e}=n,Ne=ZEe(n,["month","locale","firstDayOfWeek","weekdayFormat","weekendDays","getDayProps","excludeDate","minDate","maxDate","renderDay","hideOutsideDates","hideWeekdays","getDayAriaLabel","__getDayRef","__onDayKeyDown","__onDayClick","__onDayMouseEnter","withCellSpacing","__preventFocus","__stopPropagation","nextIcon","previousIcon","nextLabel","previousLabel","onNext","onPrevious","onLevelClick","nextDisabled","previousDisabled","hasNextLevel","levelControlAriaLabel","withNext","withPrevious","className","monthLabelFormat","classNames","styles","unstyled","__staticSelector","size","variant","static"]),{classes:we,cx:He}=sEe(null,{name:["MonthLevel",J],classNames:ee,styles:fe,unstyled:ie,variant:le,size:ne}),Te=Va(),je={__staticSelector:J||"MonthLevel",classNames:ee,styles:fe,unstyled:ie,variant:le,size:ne},st=typeof V=="boolean"?V:h?!he(r).endOf("month").isBefore(h):!1,bt=typeof H=="boolean"?H:f?!he(r).startOf("month").isAfter(f):!1;return k.createElement(Pe,Aw({className:He(we.monthLevel,F),"data-month-level":!0,ref:t},Ne),k.createElement(g1,Aw({label:typeof K=="function"?K(r):he(r).locale(o||Te.locale).format(K),className:we.calendarHeader,__preventFocus:$,__stopPropagation:N,nextIcon:I,previousIcon:R,nextLabel:B,previousLabel:z,onNext:G,onPrevious:Q,onLevelClick:X,nextDisabled:st,previousDisabled:bt,hasNextLevel:Z,levelControlAriaLabel:Y,withNext:j,withPrevious:W},je)),k.createElement(h9,Aw({month:r,locale:o,firstDayOfWeek:i,weekdayFormat:s,weekendDays:a,getDayProps:c,excludeDate:u,minDate:f,maxDate:h,renderDay:m,hideOutsideDates:v,hideWeekdays:y,getDayAriaLabel:w,__getDayRef:P,__onDayKeyDown:b,__onDayClick:S,__onDayMouseEnter:O,__preventFocus:$,__stopPropagation:N,static:_e,withCellSpacing:E},je)))});g9.displayName="@mantine/dates/MonthLevel";function YEe({direction:e,levelIndex:t,rowIndex:n,cellIndex:r,size:o}){switch(e){case"up":return t===0&&n===0?null:n===0?{levelIndex:t-1,rowIndex:r<=o[t-1][o[t-1].length-1]-1?o[t-1].length-1:o[t-1].length-2,cellIndex:r}:{levelIndex:t,rowIndex:n-1,cellIndex:r};case"down":return n===o[t].length-1?{levelIndex:t+1,rowIndex:0,cellIndex:r}:n===o[t].length-2&&r>=o[t][o[t].length-1]?{levelIndex:t+1,rowIndex:0,cellIndex:r}:{levelIndex:t,rowIndex:n+1,cellIndex:r};case"left":return t===0&&n===0&&r===0?null:n===0&&r===0?{levelIndex:t-1,rowIndex:o[t-1].length-1,cellIndex:o[t-1][o[t-1].length-1]-1}:r===0?{levelIndex:t,rowIndex:n-1,cellIndex:o[t][n-1]-1}:{levelIndex:t,rowIndex:n,cellIndex:r-1};case"right":return n===o[t].length-1&&r===o[t][n]-1?{levelIndex:t+1,rowIndex:0,cellIndex:0}:r===o[t][n]-1?{levelIndex:t,rowIndex:n+1,cellIndex:0}:{levelIndex:t,rowIndex:n,cellIndex:r+1};default:return{levelIndex:t,rowIndex:n,cellIndex:r}}}function v9({controlsRef:e,direction:t,levelIndex:n,rowIndex:r,cellIndex:o,size:i}){var s,a;const c=YEe({direction:t,size:i,rowIndex:r,cellIndex:o,levelIndex:n});if(!c)return;const u=(a=(s=e.current[c.levelIndex])==null?void 0:s[c.rowIndex])==null?void 0:a[c.cellIndex];u&&(u.disabled||u.getAttribute("data-hidden")||u.getAttribute("data-outside")?v9({controlsRef:e,direction:t,levelIndex:c.levelIndex,cellIndex:c.cellIndex,rowIndex:c.rowIndex,size:i}):u.focus())}function KEe(e){switch(e){case"ArrowDown":return"down";case"ArrowUp":return"up";case"ArrowRight":return"right";case"ArrowLeft":return"left";default:return null}}function qEe(e){return e.current.map(t=>t.map(n=>n.length))}function KO({controlsRef:e,levelIndex:t,rowIndex:n,cellIndex:r,event:o}){const i=KEe(o.key);if(i){o.preventDefault();const s=qEe(e);v9({controlsRef:e,direction:i,levelIndex:t,rowIndex:n,cellIndex:r,size:s})}}var JEe=Object.defineProperty,Dy=Object.getOwnPropertySymbols,y9=Object.prototype.hasOwnProperty,_9=Object.prototype.propertyIsEnumerable,lD=(e,t,n)=>t in e?JEe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,QEe=(e,t)=>{for(var n in t||(t={}))y9.call(t,n)&&lD(e,n,t[n]);if(Dy)for(var n of Dy(t))_9.call(t,n)&&lD(e,n,t[n]);return e},XEe=(e,t)=>{var n={};for(var r in e)y9.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Dy)for(var r of Dy(e))t.indexOf(r)<0&&_9.call(e,r)&&(n[r]=e[r]);return n};const e$e={numberOfColumns:1},w9=_.forwardRef((e,t)=>{const n=ae("MonthLevelGroup",e$e,e),{month:r,locale:o,firstDayOfWeek:i,weekdayFormat:s,weekendDays:a,getDayProps:c,excludeDate:u,minDate:f,maxDate:h,renderDay:m,hideOutsideDates:v,hideWeekdays:y,getDayAriaLabel:w,__onDayClick:P,__onDayMouseEnter:b,withCellSpacing:S,__preventFocus:O,nextIcon:E,previousIcon:$,nextLabel:N,previousLabel:I,onNext:R,onPrevious:B,onLevelClick:z,nextDisabled:G,previousDisabled:Q,hasNextLevel:X,className:V,classNames:H,styles:Z,unstyled:Y,numberOfColumns:j,levelControlAriaLabel:W,monthLabelFormat:F,__staticSelector:K,__stopPropagation:ee,size:fe,variant:ie,static:J}=n,ne=XEe(n,["month","locale","firstDayOfWeek","weekdayFormat","weekendDays","getDayProps","excludeDate","minDate","maxDate","renderDay","hideOutsideDates","hideWeekdays","getDayAriaLabel","__onDayClick","__onDayMouseEnter","withCellSpacing","__preventFocus","nextIcon","previousIcon","nextLabel","previousLabel","onNext","onPrevious","onLevelClick","nextDisabled","previousDisabled","hasNextLevel","className","classNames","styles","unstyled","numberOfColumns","levelControlAriaLabel","monthLabelFormat","__staticSelector","__stopPropagation","size","variant","static"]),{classes:le,cx:_e}=oEe(null,{name:["MonthLevelGroup",K],classNames:H,styles:Z,unstyled:Y,variant:ie,size:fe}),Ne=_.useRef([]),we=Array(j).fill(0).map((He,Te)=>{const je=he(r).add(Te,"months").toDate();return k.createElement(g9,{key:Te,month:je,withNext:Te===j-1,withPrevious:Te===0,monthLabelFormat:F,__stopPropagation:ee,__onDayClick:P,__onDayMouseEnter:b,__onDayKeyDown:(st,bt)=>KO({levelIndex:Te,rowIndex:bt.rowIndex,cellIndex:bt.cellIndex,event:st,controlsRef:Ne}),__getDayRef:(st,bt,wn)=>{Array.isArray(Ne.current[Te])||(Ne.current[Te]=[]),Array.isArray(Ne.current[Te][st])||(Ne.current[Te][st]=[]),Ne.current[Te][st][bt]=wn},levelControlAriaLabel:typeof W=="function"?W(je):W,locale:o,firstDayOfWeek:i,weekdayFormat:s,weekendDays:a,getDayProps:c,excludeDate:u,minDate:f,maxDate:h,renderDay:m,hideOutsideDates:v,hideWeekdays:y,getDayAriaLabel:w,__preventFocus:O,nextIcon:E,previousIcon:$,nextLabel:N,previousLabel:I,onNext:R,onPrevious:B,onLevelClick:z,nextDisabled:G,previousDisabled:Q,hasNextLevel:X,classNames:H,styles:Z,unstyled:Y,__staticSelector:K||"MonthLevelGroup",size:fe,variant:ie,static:J,withCellSpacing:S})});return k.createElement(Pe,QEe({className:_e(le.monthLevelGroup,V),ref:t},ne),we)});w9.displayName="@mantine/dates/MonthLevelGroup";var t$e=ue((e,t,{size:n})=>({yearLevelGroup:{display:"flex","& [data-year-level]:not(:last-of-type)":{marginRight:re({size:n,sizes:e.spacing})}}}));const n$e=t$e;var r$e=ue(e=>({yearLevel:{},calendarHeader:{marginBottom:e.spacing.xs}}));const o$e=r$e;function i$e(e){const t=he(e).startOf("year").toDate(),n=[[],[],[],[]];let r=0;for(let o=0;o<4;o+=1)for(let i=0;i<3;i+=1)n[o].push(he(t).add(r,"months").toDate()),r+=1;return n}function b9(e,t,n){return!t&&!n?!1:!!(t&&he(e).isBefore(t,"month")||n&&he(e).isAfter(n,"month"))}var s$e=ue(()=>({monthsList:{borderCollapse:"collapse",borderWidth:0,cursor:"pointer"},monthsListCell:{padding:0,"&[data-with-spacing]":{padding:M(.5)}},monthsListRow:{}}));const a$e=s$e;function l$e(e,t,n,r){const o=e.flat().filter(a=>{var c;return!b9(a,t,n)&&!((c=r?.(a))!=null&&c.disabled)}),i=o.find(a=>{var c;return(c=r?.(a))==null?void 0:c.selected});if(i)return i;const s=o.find(a=>he().isSame(a,"month"));return s||o[0]}var c$e=Object.defineProperty,u$e=Object.defineProperties,d$e=Object.getOwnPropertyDescriptors,cD=Object.getOwnPropertySymbols,f$e=Object.prototype.hasOwnProperty,h$e=Object.prototype.propertyIsEnumerable,uD=(e,t,n)=>t in e?c$e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,kp=(e,t)=>{for(var n in t||(t={}))f$e.call(t,n)&&uD(e,n,t[n]);if(cD)for(var n of cD(t))h$e.call(t,n)&&uD(e,n,t[n]);return e},dD=(e,t)=>u$e(e,d$e(t)),p$e=ue((e,t,{size:n})=>{const r=e.fn.variant({variant:"filled"}),o=e.fn.variant({variant:"light"});return{pickerControl:dD(kp({fontSize:re({size:n,sizes:e.fontSizes}),height:re({size:n,sizes:Tf}),width:`calc((${re({size:n,sizes:Tf})} * 7) / 3 + ${M(1.5)})`,display:"flex",justifyContent:"center",alignItems:"center",userSelect:"none",borderRadius:e.fn.radius()},e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[0]})),{"&:active":e.activeStyles,"&[data-in-range]":kp({backgroundColor:o.background,borderRadius:0},e.fn.hover({backgroundColor:o.hover})),"&[data-first-in-range]":{borderRadius:0,borderTopLeftRadius:e.radius.sm,borderBottomLeftRadius:e.radius.sm},"&[data-last-in-range]":{borderRadius:0,borderTopRightRadius:e.radius.sm,borderBottomRightRadius:e.radius.sm},"&[data-last-in-range][data-first-in-range]":{borderRadius:e.radius.sm},"&[data-selected]":kp({color:r.color,backgroundColor:r.background},e.fn.hover({backgroundColor:r.hover})),"&[data-disabled]":dD(kp({color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[4],cursor:"not-allowed"},e.fn.hover({backgroundColor:"transparent"})),{"&:active":{transform:"none"}})})}});const m$e=p$e;var g$e=Object.defineProperty,Ry=Object.getOwnPropertySymbols,x9=Object.prototype.hasOwnProperty,S9=Object.prototype.propertyIsEnumerable,fD=(e,t,n)=>t in e?g$e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,v$e=(e,t)=>{for(var n in t||(t={}))x9.call(t,n)&&fD(e,n,t[n]);if(Ry)for(var n of Ry(t))S9.call(t,n)&&fD(e,n,t[n]);return e},y$e=(e,t)=>{var n={};for(var r in e)x9.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ry)for(var r of Ry(e))t.indexOf(r)<0&&S9.call(e,r)&&(n[r]=e[r]);return n};const _$e={size:"sm"},qO=_.forwardRef((e,t)=>{const n=ae("PickerControl",_$e,e),{className:r,children:o,disabled:i,selected:s,classNames:a,styles:c,unstyled:u,firstInRange:f,lastInRange:h,inRange:m,__staticSelector:v,size:y,variant:w}=n,P=y$e(n,["className","children","disabled","selected","classNames","styles","unstyled","firstInRange","lastInRange","inRange","__staticSelector","size","variant"]),{classes:b,cx:S}=m$e(null,{name:["PickerControl",v],classNames:a,styles:c,unstyled:u,variant:w,size:y});return k.createElement(ds,v$e({className:S(b.pickerControl,r),ref:t,unstyled:u,"data-picker-control":!0,"data-selected":s&&!i||void 0,"data-disabled":i||void 0,"data-in-range":m&&!i&&!s||void 0,"data-first-in-range":f&&!i||void 0,"data-last-in-range":h&&!i||void 0,disabled:i},P),o)});qO.displayName="@mantine/dates/PickerControl";var w$e=Object.defineProperty,b$e=Object.defineProperties,x$e=Object.getOwnPropertyDescriptors,Ly=Object.getOwnPropertySymbols,P9=Object.prototype.hasOwnProperty,O9=Object.prototype.propertyIsEnumerable,hD=(e,t,n)=>t in e?w$e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pD=(e,t)=>{for(var n in t||(t={}))P9.call(t,n)&&hD(e,n,t[n]);if(Ly)for(var n of Ly(t))O9.call(t,n)&&hD(e,n,t[n]);return e},S$e=(e,t)=>b$e(e,x$e(t)),P$e=(e,t)=>{var n={};for(var r in e)P9.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ly)for(var r of Ly(e))t.indexOf(r)<0&&O9.call(e,r)&&(n[r]=e[r]);return n};const O$e={monthsListFormat:"MMM",size:"sm",withCellSpacing:!0},C9=_.forwardRef((e,t)=>{const n=ae("MonthsList",O$e,e),{year:r,className:o,monthsListFormat:i,locale:s,minDate:a,maxDate:c,getMonthControlProps:u,classNames:f,styles:h,unstyled:m,__staticSelector:v,__getControlRef:y,__onControlKeyDown:w,__onControlClick:P,__onControlMouseEnter:b,__preventFocus:S,size:O,variant:E,__stopPropagation:$,withCellSpacing:N}=n,I=P$e(n,["year","className","monthsListFormat","locale","minDate","maxDate","getMonthControlProps","classNames","styles","unstyled","__staticSelector","__getControlRef","__onControlKeyDown","__onControlClick","__onControlMouseEnter","__preventFocus","size","variant","__stopPropagation","withCellSpacing"]),{classes:R,cx:B}=a$e(null,{name:["MonthsList",v],classNames:f,styles:h,unstyled:m,variant:E,size:O}),z=Va(),G=i$e(r),Q=l$e(G,a,c,u),X=G.map((V,H)=>{const Z=V.map((Y,j)=>{const W=u?.(Y),F=he(Y).isSame(Q,"month");return k.createElement("td",{key:j,className:R.monthsListCell,"data-with-spacing":N||void 0},k.createElement(qO,S$e(pD({variant:E,size:O,classNames:f,styles:h,unstyled:m,__staticSelector:v||"MonthsList","data-mantine-stop-propagation":$||void 0,disabled:b9(Y,a,c),ref:K=>y?.(H,j,K)},W),{onKeyDown:K=>{var ee;(ee=W?.onKeyDown)==null||ee.call(W,K),w?.(K,{rowIndex:H,cellIndex:j,date:Y})},onClick:K=>{var ee;(ee=W?.onClick)==null||ee.call(W,K),P?.(K,Y)},onMouseEnter:K=>{var ee;(ee=W?.onMouseEnter)==null||ee.call(W,K),b?.(K,Y)},onMouseDown:K=>{var ee;(ee=W?.onMouseDown)==null||ee.call(W,K),S&&K.preventDefault()},tabIndex:S||!F?-1:0}),he(Y).locale(z.getLocale(s)).format(i)))});return k.createElement("tr",{key:H,className:R.monthsListRow},Z)});return k.createElement(Pe,pD({component:"table",ref:t,className:B(R.monthsList,o)},I),k.createElement("tbody",null,X))});C9.displayName="@mantine/dates/MonthsList";var C$e=Object.defineProperty,zy=Object.getOwnPropertySymbols,k9=Object.prototype.hasOwnProperty,E9=Object.prototype.propertyIsEnumerable,mD=(e,t,n)=>t in e?C$e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Bw=(e,t)=>{for(var n in t||(t={}))k9.call(t,n)&&mD(e,n,t[n]);if(zy)for(var n of zy(t))E9.call(t,n)&&mD(e,n,t[n]);return e},k$e=(e,t)=>{var n={};for(var r in e)k9.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&zy)for(var r of zy(e))t.indexOf(r)<0&&E9.call(e,r)&&(n[r]=e[r]);return n};const E$e={yearLabelFormat:"YYYY",size:"sm"},$9=_.forwardRef((e,t)=>{const n=ae("YearLevel",E$e,e),{year:r,locale:o,minDate:i,maxDate:s,monthsListFormat:a,getMonthControlProps:c,__getControlRef:u,__onControlKeyDown:f,__onControlClick:h,__onControlMouseEnter:m,withCellSpacing:v,__preventFocus:y,nextIcon:w,previousIcon:P,nextLabel:b,previousLabel:S,onNext:O,onPrevious:E,onLevelClick:$,nextDisabled:N,previousDisabled:I,hasNextLevel:R,levelControlAriaLabel:B,withNext:z,withPrevious:G,className:Q,yearLabelFormat:X,classNames:V,styles:H,unstyled:Z,__staticSelector:Y,__stopPropagation:j,size:W,variant:F}=n,K=k$e(n,["year","locale","minDate","maxDate","monthsListFormat","getMonthControlProps","__getControlRef","__onControlKeyDown","__onControlClick","__onControlMouseEnter","withCellSpacing","__preventFocus","nextIcon","previousIcon","nextLabel","previousLabel","onNext","onPrevious","onLevelClick","nextDisabled","previousDisabled","hasNextLevel","levelControlAriaLabel","withNext","withPrevious","className","yearLabelFormat","classNames","styles","unstyled","__staticSelector","__stopPropagation","size","variant"]),{classes:ee,cx:fe}=o$e(null,{name:["YearLevel",Y],classNames:V,styles:H,unstyled:Z,size:W,variant:F}),ie=Va(),J={__staticSelector:Y||"YearLevel",classNames:V,styles:H,unstyled:Z,size:W,variant:F},ne=typeof N=="boolean"?N:s?!he(r).endOf("year").isBefore(s):!1,le=typeof I=="boolean"?I:i?!he(r).startOf("year").isAfter(i):!1;return k.createElement(Pe,Bw({className:fe(ee.yearLevel,Q),"data-year-level":!0,ref:t},K),k.createElement(g1,Bw({label:typeof X=="function"?X(r):he(r).locale(o||ie.locale).format(X),className:ee.calendarHeader,__preventFocus:y,__stopPropagation:j,nextIcon:w,previousIcon:P,nextLabel:b,previousLabel:S,onNext:O,onPrevious:E,onLevelClick:$,nextDisabled:ne,previousDisabled:le,hasNextLevel:R,levelControlAriaLabel:B,withNext:z,withPrevious:G},J)),k.createElement(C9,Bw({year:r,locale:o,minDate:i,maxDate:s,monthsListFormat:a,getMonthControlProps:c,__getControlRef:u,__onControlKeyDown:f,__onControlClick:h,__onControlMouseEnter:m,__preventFocus:y,__stopPropagation:j,withCellSpacing:v},J)))});$9.displayName="@mantine/dates/YearLevel";var $$e=Object.defineProperty,Ay=Object.getOwnPropertySymbols,M9=Object.prototype.hasOwnProperty,N9=Object.prototype.propertyIsEnumerable,gD=(e,t,n)=>t in e?$$e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,M$e=(e,t)=>{for(var n in t||(t={}))M9.call(t,n)&&gD(e,n,t[n]);if(Ay)for(var n of Ay(t))N9.call(t,n)&&gD(e,n,t[n]);return e},N$e=(e,t)=>{var n={};for(var r in e)M9.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ay)for(var r of Ay(e))t.indexOf(r)<0&&N9.call(e,r)&&(n[r]=e[r]);return n};const T$e={numberOfColumns:1,size:"sm"},T9=_.forwardRef((e,t)=>{const n=ae("YearLevelGroup",T$e,e),{year:r,locale:o,minDate:i,maxDate:s,monthsListFormat:a,getMonthControlProps:c,__onControlClick:u,__onControlMouseEnter:f,withCellSpacing:h,__preventFocus:m,nextIcon:v,previousIcon:y,nextLabel:w,previousLabel:P,onNext:b,onPrevious:S,onLevelClick:O,nextDisabled:E,previousDisabled:$,hasNextLevel:N,className:I,classNames:R,styles:B,unstyled:z,__staticSelector:G,__stopPropagation:Q,numberOfColumns:X,levelControlAriaLabel:V,yearLabelFormat:H,variant:Z,size:Y}=n,j=N$e(n,["year","locale","minDate","maxDate","monthsListFormat","getMonthControlProps","__onControlClick","__onControlMouseEnter","withCellSpacing","__preventFocus","nextIcon","previousIcon","nextLabel","previousLabel","onNext","onPrevious","onLevelClick","nextDisabled","previousDisabled","hasNextLevel","className","classNames","styles","unstyled","__staticSelector","__stopPropagation","numberOfColumns","levelControlAriaLabel","yearLabelFormat","variant","size"]),{classes:W,cx:F}=n$e(null,{name:["YearLevelGroup",G],styles:B,classNames:R,unstyled:z,variant:Z,size:Y}),K=_.useRef([]),ee=Array(X).fill(0).map((fe,ie)=>{const J=he(r).add(ie,"years").toDate();return k.createElement($9,{key:ie,variant:Z,size:Y,monthsListFormat:a,year:J,withNext:ie===X-1,withPrevious:ie===0,yearLabelFormat:H,__stopPropagation:Q,__onControlClick:u,__onControlMouseEnter:f,__onControlKeyDown:(ne,le)=>KO({levelIndex:ie,rowIndex:le.rowIndex,cellIndex:le.cellIndex,event:ne,controlsRef:K}),__getControlRef:(ne,le,_e)=>{Array.isArray(K.current[ie])||(K.current[ie]=[]),Array.isArray(K.current[ie][ne])||(K.current[ie][ne]=[]),K.current[ie][ne][le]=_e},levelControlAriaLabel:typeof V=="function"?V(J):V,locale:o,minDate:i,maxDate:s,__preventFocus:m,nextIcon:v,previousIcon:y,nextLabel:w,previousLabel:P,onNext:b,onPrevious:S,onLevelClick:O,nextDisabled:E,previousDisabled:$,hasNextLevel:N,getMonthControlProps:c,classNames:R,styles:B,unstyled:z,__staticSelector:G||"YearLevelGroup",withCellSpacing:h})});return k.createElement(Pe,M$e({className:F(W.yearLevelGroup,I),ref:t},j),ee)});T9.displayName="@mantine/dates/YearLevelGroup";var I$e=ue(e=>({decadeLevelGroup:{display:"flex",gap:e.spacing.md}}));const j$e=I$e;function I9(e){const t=e.getFullYear(),n=t-t%10;let r=0;const o=[[],[],[],[]];for(let i=0;i<4;i+=1){const s=i===3?1:3;for(let a=0;a({decadeLevel:{},calendarHeader:{marginBottom:e.spacing.xs}}));const L$e=R$e;function j9(e,t,n){return!t&&!n?!1:!!(t&&he(e).isBefore(t,"year")||n&&he(e).isAfter(n,"year"))}var z$e=ue(()=>({yearsList:{borderCollapse:"collapse",borderWidth:0},yearsListCell:{padding:0,"&[data-with-spacing]":{padding:M(.5)}},yearsListRow:{}}));const A$e=z$e;function B$e(e,t,n,r){const o=e.flat().filter(a=>{var c;return!j9(a,t,n)&&!((c=r?.(a))!=null&&c.disabled)}),i=o.find(a=>{var c;return(c=r?.(a))==null?void 0:c.selected});if(i)return i;const s=o.find(a=>he().isSame(a,"year"));return s||o[0]}var F$e=Object.defineProperty,V$e=Object.defineProperties,H$e=Object.getOwnPropertyDescriptors,By=Object.getOwnPropertySymbols,D9=Object.prototype.hasOwnProperty,R9=Object.prototype.propertyIsEnumerable,vD=(e,t,n)=>t in e?F$e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yD=(e,t)=>{for(var n in t||(t={}))D9.call(t,n)&&vD(e,n,t[n]);if(By)for(var n of By(t))R9.call(t,n)&&vD(e,n,t[n]);return e},W$e=(e,t)=>V$e(e,H$e(t)),U$e=(e,t)=>{var n={};for(var r in e)D9.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&By)for(var r of By(e))t.indexOf(r)<0&&R9.call(e,r)&&(n[r]=e[r]);return n};const Z$e={yearsListFormat:"YYYY",size:"sm",withCellSpacing:!0},L9=_.forwardRef((e,t)=>{const n=ae("YearsList",Z$e,e),{decade:r,className:o,yearsListFormat:i,locale:s,minDate:a,maxDate:c,getYearControlProps:u,classNames:f,styles:h,unstyled:m,__staticSelector:v,__getControlRef:y,__onControlKeyDown:w,__onControlClick:P,__onControlMouseEnter:b,__preventFocus:S,__stopPropagation:O,size:E,variant:$,withCellSpacing:N}=n,I=U$e(n,["decade","className","yearsListFormat","locale","minDate","maxDate","getYearControlProps","classNames","styles","unstyled","__staticSelector","__getControlRef","__onControlKeyDown","__onControlClick","__onControlMouseEnter","__preventFocus","__stopPropagation","size","variant","withCellSpacing"]),{classes:R,cx:B}=A$e(null,{name:["YearsList",v],classNames:f,styles:h,unstyled:m,variant:$,size:E}),z=Va(),G=I9(r),Q=B$e(G,a,c,u),X=G.map((V,H)=>{const Z=V.map((Y,j)=>{const W=u?.(Y),F=he(Y).isSame(Q,"year");return k.createElement("td",{key:j,className:R.yearsListCell,"data-with-spacing":N||void 0},k.createElement(qO,W$e(yD({size:E,variant:$,classNames:f,styles:h,unstyled:m,__staticSelector:v||"YearsList","data-mantine-stop-propagation":O||void 0,disabled:j9(Y,a,c),ref:K=>y?.(H,j,K)},W),{onKeyDown:K=>{var ee;(ee=W?.onKeyDown)==null||ee.call(W,K),w?.(K,{rowIndex:H,cellIndex:j,date:Y})},onClick:K=>{var ee;(ee=W?.onClick)==null||ee.call(W,K),P?.(K,Y)},onMouseEnter:K=>{var ee;(ee=W?.onMouseEnter)==null||ee.call(W,K),b?.(K,Y)},onMouseDown:K=>{var ee;(ee=W?.onMouseDown)==null||ee.call(W,K),S&&K.preventDefault()},tabIndex:S||!F?-1:0}),he(Y).locale(z.getLocale(s)).format(i)))});return k.createElement("tr",{key:H,className:R.yearsListRow},Z)});return k.createElement(Pe,yD({component:"table",ref:t,className:B(R.yearsList,o)},I),k.createElement("tbody",null,X))});L9.displayName="@mantine/dates/YearsList";var G$e=Object.defineProperty,Fy=Object.getOwnPropertySymbols,z9=Object.prototype.hasOwnProperty,A9=Object.prototype.propertyIsEnumerable,_D=(e,t,n)=>t in e?G$e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Fw=(e,t)=>{for(var n in t||(t={}))z9.call(t,n)&&_D(e,n,t[n]);if(Fy)for(var n of Fy(t))A9.call(t,n)&&_D(e,n,t[n]);return e},Y$e=(e,t)=>{var n={};for(var r in e)z9.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Fy)for(var r of Fy(e))t.indexOf(r)<0&&A9.call(e,r)&&(n[r]=e[r]);return n};const K$e={decadeLabelFormat:"YYYY"},B9=_.forwardRef((e,t)=>{const n=ae("DecadeLevel",K$e,e),{decade:r,locale:o,minDate:i,maxDate:s,yearsListFormat:a,getYearControlProps:c,__getControlRef:u,__onControlKeyDown:f,__onControlClick:h,__onControlMouseEnter:m,withCellSpacing:v,__preventFocus:y,nextIcon:w,previousIcon:P,nextLabel:b,previousLabel:S,onNext:O,onPrevious:E,nextDisabled:$,previousDisabled:N,levelControlAriaLabel:I,withNext:R,withPrevious:B,className:z,decadeLabelFormat:G,classNames:Q,styles:X,unstyled:V,__staticSelector:H,__stopPropagation:Z,variant:Y,size:j}=n,W=Y$e(n,["decade","locale","minDate","maxDate","yearsListFormat","getYearControlProps","__getControlRef","__onControlKeyDown","__onControlClick","__onControlMouseEnter","withCellSpacing","__preventFocus","nextIcon","previousIcon","nextLabel","previousLabel","onNext","onPrevious","nextDisabled","previousDisabled","levelControlAriaLabel","withNext","withPrevious","className","decadeLabelFormat","classNames","styles","unstyled","__staticSelector","__stopPropagation","variant","size"]),{classes:F,cx:K}=L$e(null,{name:["DecadeLevel",H],classNames:Q,styles:X,unstyled:V,variant:Y,size:j}),ee=Va(),[fe,ie]=D$e(r),J={__staticSelector:H||"DecadeLevel",classNames:Q,styles:X,unstyled:V,variant:Y,size:j},ne=typeof $=="boolean"?$:s?!he(ie).endOf("year").isBefore(s):!1,le=typeof N=="boolean"?N:i?!he(fe).startOf("year").isAfter(i):!1,_e=(Ne,we)=>he(Ne).locale(o||ee.locale).format(we);return k.createElement(Pe,Fw({className:K(F.decadeLevel,z),"data-decade-level":!0,ref:t},W),k.createElement(g1,Fw({label:typeof G=="function"?G(fe,ie):`${_e(fe,G)} – ${_e(ie,G)}`,className:F.calendarHeader,__preventFocus:y,__stopPropagation:Z,nextIcon:w,previousIcon:P,nextLabel:b,previousLabel:S,onNext:O,onPrevious:E,nextDisabled:ne,previousDisabled:le,hasNextLevel:!1,levelControlAriaLabel:I,withNext:R,withPrevious:B},J)),k.createElement(L9,Fw({decade:r,locale:o,minDate:i,maxDate:s,yearsListFormat:a,getYearControlProps:c,__getControlRef:u,__onControlKeyDown:f,__onControlClick:h,__onControlMouseEnter:m,__preventFocus:y,__stopPropagation:Z,withCellSpacing:v},J)))});B9.displayName="@mantine/dates/DecadeLevel";var q$e=Object.defineProperty,Vy=Object.getOwnPropertySymbols,F9=Object.prototype.hasOwnProperty,V9=Object.prototype.propertyIsEnumerable,wD=(e,t,n)=>t in e?q$e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,J$e=(e,t)=>{for(var n in t||(t={}))F9.call(t,n)&&wD(e,n,t[n]);if(Vy)for(var n of Vy(t))V9.call(t,n)&&wD(e,n,t[n]);return e},Q$e=(e,t)=>{var n={};for(var r in e)F9.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Vy)for(var r of Vy(e))t.indexOf(r)<0&&V9.call(e,r)&&(n[r]=e[r]);return n};const X$e={numberOfColumns:1},H9=_.forwardRef((e,t)=>{const n=ae("DecadeLevelGroup",X$e,e),{decade:r,locale:o,minDate:i,maxDate:s,yearsListFormat:a,getYearControlProps:c,__onControlClick:u,__onControlMouseEnter:f,withCellSpacing:h,__preventFocus:m,nextIcon:v,previousIcon:y,nextLabel:w,previousLabel:P,onNext:b,onPrevious:S,nextDisabled:O,previousDisabled:E,className:$,classNames:N,styles:I,unstyled:R,__staticSelector:B,__stopPropagation:z,numberOfColumns:G,levelControlAriaLabel:Q,decadeLabelFormat:X,variant:V,size:H}=n,Z=Q$e(n,["decade","locale","minDate","maxDate","yearsListFormat","getYearControlProps","__onControlClick","__onControlMouseEnter","withCellSpacing","__preventFocus","nextIcon","previousIcon","nextLabel","previousLabel","onNext","onPrevious","nextDisabled","previousDisabled","className","classNames","styles","unstyled","__staticSelector","__stopPropagation","numberOfColumns","levelControlAriaLabel","decadeLabelFormat","variant","size"]),{classes:Y,cx:j}=j$e(null,{name:["DecadeLevelGroup",B],styles:I,classNames:N,unstyled:R,variant:V,size:H}),W=_.useRef([]),F=Array(G).fill(0).map((K,ee)=>{const fe=he(r).add(ee*10,"years").toDate();return k.createElement(B9,{key:ee,variant:V,size:H,yearsListFormat:a,decade:fe,withNext:ee===G-1,withPrevious:ee===0,decadeLabelFormat:X,__onControlClick:u,__onControlMouseEnter:f,__onControlKeyDown:(ie,J)=>KO({levelIndex:ee,rowIndex:J.rowIndex,cellIndex:J.cellIndex,event:ie,controlsRef:W}),__getControlRef:(ie,J,ne)=>{Array.isArray(W.current[ee])||(W.current[ee]=[]),Array.isArray(W.current[ee][ie])||(W.current[ee][ie]=[]),W.current[ee][ie][J]=ne},levelControlAriaLabel:typeof Q=="function"?Q(fe):Q,locale:o,minDate:i,maxDate:s,__preventFocus:m,__stopPropagation:z,nextIcon:v,previousIcon:y,nextLabel:w,previousLabel:P,onNext:b,onPrevious:S,nextDisabled:O,previousDisabled:E,getYearControlProps:c,__staticSelector:B||"DecadeLevelGroup",classNames:N,styles:I,unstyled:R,withCellSpacing:h})});return k.createElement(Pe,J$e({className:j(Y.decadeLevelGroup,$),ref:t},Z),F)});H9.displayName="@mantine/dates/DecadeLevelGroup";var eMe=Object.defineProperty,Hy=Object.getOwnPropertySymbols,W9=Object.prototype.hasOwnProperty,U9=Object.prototype.propertyIsEnumerable,bD=(e,t,n)=>t in e?eMe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ep=(e,t)=>{for(var n in t||(t={}))W9.call(t,n)&&bD(e,n,t[n]);if(Hy)for(var n of Hy(t))U9.call(t,n)&&bD(e,n,t[n]);return e},tMe=(e,t)=>{var n={};for(var r in e)W9.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Hy)for(var r of Hy(e))t.indexOf(r)<0&&U9.call(e,r)&&(n[r]=e[r]);return n};const nMe={maxLevel:"decade",minLevel:"month",__updateDateOnYearSelect:!0,__updateDateOnMonthSelect:!0},Z9=_.forwardRef((e,t)=>{const n=ae("Calendar",nMe,e),{maxLevel:r,minLevel:o,defaultLevel:i,level:s,onLevelChange:a,date:c,defaultDate:u,onDateChange:f,numberOfColumns:h,columnsToScroll:m,ariaLabels:v,onYearSelect:y,onMonthSelect:w,onYearMouseEnter:P,onMonthMouseEnter:b,__updateDateOnYearSelect:S,__updateDateOnMonthSelect:O,firstDayOfWeek:E,weekdayFormat:$,weekendDays:N,getDayProps:I,excludeDate:R,renderDay:B,hideOutsideDates:z,hideWeekdays:G,getDayAriaLabel:Q,monthLabelFormat:X,nextIcon:V,previousIcon:H,__onDayClick:Z,__onDayMouseEnter:Y,withCellSpacing:j,monthsListFormat:W,getMonthControlProps:F,yearLabelFormat:K,yearsListFormat:ee,getYearControlProps:fe,decadeLabelFormat:ie,minDate:J,maxDate:ne,locale:le,className:_e,classNames:Ne,styles:we,__staticSelector:He,unstyled:Te,variant:je,size:st,__preventFocus:bt,__stopPropagation:wn,onNextDecade:ht,onPreviousDecade:In,onNextYear:Er,onPreviousYear:lt,onNextMonth:Yn,onPreviousMonth:Jt,static:pt}=n,Po=tMe(n,["maxLevel","minLevel","defaultLevel","level","onLevelChange","date","defaultDate","onDateChange","numberOfColumns","columnsToScroll","ariaLabels","onYearSelect","onMonthSelect","onYearMouseEnter","onMonthMouseEnter","__updateDateOnYearSelect","__updateDateOnMonthSelect","firstDayOfWeek","weekdayFormat","weekendDays","getDayProps","excludeDate","renderDay","hideOutsideDates","hideWeekdays","getDayAriaLabel","monthLabelFormat","nextIcon","previousIcon","__onDayClick","__onDayMouseEnter","withCellSpacing","monthsListFormat","getMonthControlProps","yearLabelFormat","yearsListFormat","getYearControlProps","decadeLabelFormat","minDate","maxDate","locale","className","classNames","styles","__staticSelector","unstyled","variant","size","__preventFocus","__stopPropagation","onNextDecade","onPreviousDecade","onNextYear","onPreviousYear","onNextMonth","onPreviousMonth","static"]),{classes:Jr,cx:cr}=nEe(null,{name:["Calendar",He],classNames:Ne,styles:we,unstyled:Te,variant:je,size:st}),[Qr,Bt]=_o({value:s?gd(s,o,r):void 0,defaultValue:i?gd(i,o,r):void 0,finalValue:gd(void 0,o,r),onChange:a}),[Xr,hn]=_o({value:c,defaultValue:u,finalValue:null,onChange:f}),bn={__staticSelector:He||"Calendar",styles:we,classNames:Ne,unstyled:Te,variant:je,size:st},$r=m||h||1,gt=Xr||new Date,be=()=>{const xt=he(gt).add($r,"month").toDate();Yn?.(xt),hn(xt)},Re=()=>{const xt=he(gt).subtract($r,"month").toDate();Jt?.(xt),hn(xt)},eo=()=>{const xt=he(gt).add($r,"year").toDate();Er?.(xt),hn(xt)},Rt=()=>{const xt=he(gt).subtract($r,"year").toDate();lt?.(xt),hn(xt)},Zt=()=>{const xt=he(gt).add(10*$r,"year").toDate();ht?.(xt),hn(xt)},Mr=()=>{const xt=he(gt).subtract(10*$r,"year").toDate();In?.(xt),hn(xt)};return k.createElement(Pe,Ep({className:cr(Jr.calendar,_e),ref:t},Po),Qr==="month"&&k.createElement(w9,Ep({month:gt,minDate:J,maxDate:ne,firstDayOfWeek:E,weekdayFormat:$,weekendDays:N,getDayProps:I,excludeDate:R,renderDay:B,hideOutsideDates:z,hideWeekdays:G,getDayAriaLabel:Q,onNext:be,onPrevious:Re,hasNextLevel:r!=="month",onLevelClick:()=>Bt("year"),numberOfColumns:h,locale:le,levelControlAriaLabel:v?.monthLevelControl,nextLabel:v?.nextMonth,nextIcon:V,previousLabel:v?.previousMonth,previousIcon:H,monthLabelFormat:X,__onDayClick:Z,__onDayMouseEnter:Y,__preventFocus:bt,__stopPropagation:wn,static:pt,withCellSpacing:j},bn)),Qr==="year"&&k.createElement(T9,Ep({year:gt,numberOfColumns:h,minDate:J,maxDate:ne,monthsListFormat:W,getMonthControlProps:F,locale:le,onNext:eo,onPrevious:Rt,hasNextLevel:r!=="month"&&r!=="year",onLevelClick:()=>Bt("decade"),levelControlAriaLabel:v?.yearLevelControl,nextLabel:v?.nextYear,nextIcon:V,previousLabel:v?.previousYear,previousIcon:H,yearLabelFormat:K,__onControlMouseEnter:b,__onControlClick:(xt,nn)=>{O&&hn(nn),Bt(gd("month",o,r)),w?.(nn)},__preventFocus:bt,__stopPropagation:wn,withCellSpacing:j},bn)),Qr==="decade"&&k.createElement(H9,Ep({decade:gt,minDate:J,maxDate:ne,yearsListFormat:ee,getYearControlProps:fe,locale:le,onNext:Zt,onPrevious:Mr,numberOfColumns:h,nextLabel:v?.nextDecade,nextIcon:V,previousLabel:v?.previousDecade,previousIcon:H,decadeLabelFormat:ie,__onControlMouseEnter:P,__onControlClick:(xt,nn)=>{S&&hn(nn),Bt(gd("year",o,r)),y?.(nn)},__preventFocus:bt,__stopPropagation:wn,withCellSpacing:j},bn)))});Z9.displayName="@mantine/dates/Calendar";var xD=Object.getOwnPropertySymbols,rMe=Object.prototype.hasOwnProperty,oMe=Object.prototype.propertyIsEnumerable,iMe=(e,t)=>{var n={};for(var r in e)rMe.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&xD)for(var r of xD(e))t.indexOf(r)<0&&oMe.call(e,r)&&(n[r]=e[r]);return n};function sMe(e){const t=e,{maxLevel:n,minLevel:r,defaultLevel:o,level:i,onLevelChange:s,nextIcon:a,previousIcon:c,date:u,defaultDate:f,onDateChange:h,numberOfColumns:m,columnsToScroll:v,ariaLabels:y,onYearSelect:w,onMonthSelect:P,onYearMouseEnter:b,onMonthMouseEnter:S,onNextMonth:O,onPreviousMonth:E,onNextYear:$,onPreviousYear:N,onNextDecade:I,onPreviousDecade:R,withCellSpacing:B,__updateDateOnYearSelect:z,__updateDateOnMonthSelect:G,firstDayOfWeek:Q,weekdayFormat:X,weekendDays:V,getDayProps:H,excludeDate:Z,renderDay:Y,hideOutsideDates:j,hideWeekdays:W,getDayAriaLabel:F,monthLabelFormat:K,monthsListFormat:ee,getMonthControlProps:fe,yearLabelFormat:ie,yearsListFormat:J,getYearControlProps:ne,decadeLabelFormat:le,allowSingleDateInRange:_e,allowDeselect:Ne,minDate:we,maxDate:He,locale:Te}=t,je=iMe(t,["maxLevel","minLevel","defaultLevel","level","onLevelChange","nextIcon","previousIcon","date","defaultDate","onDateChange","numberOfColumns","columnsToScroll","ariaLabels","onYearSelect","onMonthSelect","onYearMouseEnter","onMonthMouseEnter","onNextMonth","onPreviousMonth","onNextYear","onPreviousYear","onNextDecade","onPreviousDecade","withCellSpacing","__updateDateOnYearSelect","__updateDateOnMonthSelect","firstDayOfWeek","weekdayFormat","weekendDays","getDayProps","excludeDate","renderDay","hideOutsideDates","hideWeekdays","getDayAriaLabel","monthLabelFormat","monthsListFormat","getMonthControlProps","yearLabelFormat","yearsListFormat","getYearControlProps","decadeLabelFormat","allowSingleDateInRange","allowDeselect","minDate","maxDate","locale"]);return{calendarProps:{maxLevel:n,minLevel:r,defaultLevel:o,level:i,onLevelChange:s,nextIcon:a,previousIcon:c,date:u,defaultDate:f,onDateChange:h,numberOfColumns:m,columnsToScroll:v,ariaLabels:y,onYearSelect:w,onMonthSelect:P,onYearMouseEnter:b,onMonthMouseEnter:S,onNextMonth:O,onPreviousMonth:E,onNextYear:$,onPreviousYear:N,onNextDecade:I,onPreviousDecade:R,withCellSpacing:B,__updateDateOnYearSelect:z,__updateDateOnMonthSelect:G,firstDayOfWeek:Q,weekdayFormat:X,weekendDays:V,getDayProps:H,excludeDate:Z,renderDay:Y,hideOutsideDates:j,hideWeekdays:W,getDayAriaLabel:F,monthLabelFormat:K,monthsListFormat:ee,getMonthControlProps:fe,yearLabelFormat:ie,yearsListFormat:J,getYearControlProps:ne,decadeLabelFormat:le,allowSingleDateInRange:_e,allowDeselect:Ne,minDate:we,maxDate:He,locale:Te},others:je}}function aMe(e,t){if(t==="range"&&Array.isArray(e)){const[n,r]=e;return n?r?`${n.toISOString()} – ${r.toISOString()}`:`${n.toISOString()} –`:""}return t==="multiple"&&Array.isArray(e)?e.map(n=>n.toISOString()).join(", "):!Array.isArray(e)&&e?e.toISOString():""}function G9({value:e,type:t,name:n,form:r}){return k.createElement("input",{type:"hidden",value:aMe(e,t),name:n,form:r})}G9.displayName="@mantine/dates/HiddenDatesInput";const SD=e=>e==="range"?[null,null]:e==="multiple"?[]:null;function Y9({type:e,value:t,defaultValue:n,onChange:r}){const o=_.useRef(e),[i,s]=_o({value:t,defaultValue:n,onChange:r,finalValue:SD(e)});let a=i;return o.current!==e&&(o.current=e,t===void 0&&(a=n!==void 0?n:SD(e),s(a))),[a,s]}function PD(e,t){const n=[...t].sort((r,o)=>r.getTime()-o.getTime());return he(n[0]).startOf("day").subtract(1,"ms").isBefore(e)&&he(n[1]).endOf("day").add(1,"ms").isAfter(e)}function lMe({type:e,level:t,value:n,defaultValue:r,onChange:o,allowSingleDateInRange:i,allowDeselect:s,onMouseLeave:a}){const[c,u]=Y9({type:e,value:n,defaultValue:r,onChange:o}),[f,h]=_.useState(e==="range"&&c[0]&&!c[1]?c[0]:null),[m,v]=_.useState(null),y=$=>{if(e==="range"){if(f instanceof Date&&!c[1]){if(he($).isSame(f,t)&&!i){h(null),v(null),u([null,null]);return}const N=[$,f];N.sort((I,R)=>I.getTime()-R.getTime()),u(N),v(null),h(null);return}if(c[0]&&!c[1]&&he($).isSame(c[0],t)&&!i){h(null),v(null),u([null,null]);return}u([$,null]),v(null),h($);return}if(e==="multiple"){c.some(N=>he(N).isSame($,t))?u(c.filter(N=>!he(N).isSame($,t))):u([...c,$]);return}c&&s&&he($).isSame(c,t)?u(null):u($)},w=$=>f instanceof Date&&m instanceof Date?PD($,[m,f]):c[0]instanceof Date&&c[1]instanceof Date?PD($,c):!1,P=e==="range"?$=>{a?.($),v(null)}:a,b=$=>c[0]instanceof Date&&he($).isSame(c[0],t)?!(m&&he(m).isBefore(c[0])):!1,S=$=>c[1]instanceof Date?he($).isSame(c[1],t):!(c[0]instanceof Date)||!m?!1:he(m).isBefore(c[0])&&he($).isSame(c[0],t);return{onDateChange:y,onRootMouseLeave:P,onHoveredDateChange:e==="range"&&f?v:()=>{},getControlProps:$=>{if(e==="range")return{selected:c.some(I=>I&&he(I).isSame($,t)),inRange:w($),firstInRange:b($),lastInRange:S($),"data-autofocus":!!c[0]&&he(c[0]).isSame($,t)||void 0};if(e==="multiple")return{selected:c.some(I=>I&&he(I).isSame($,t)),"data-autofocus":!!c[0]&&he(c[0]).isSame($,t)||void 0};const N=he(c).isSame($,t);return{selected:N,"data-autofocus":N||void 0}},_value:c,setValue:u}}var cMe=Object.defineProperty,Wy=Object.getOwnPropertySymbols,K9=Object.prototype.hasOwnProperty,q9=Object.prototype.propertyIsEnumerable,OD=(e,t,n)=>t in e?cMe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Vw=(e,t)=>{for(var n in t||(t={}))K9.call(t,n)&&OD(e,n,t[n]);if(Wy)for(var n of Wy(t))q9.call(t,n)&&OD(e,n,t[n]);return e},uMe=(e,t)=>{var n={};for(var r in e)K9.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Wy)for(var r of Wy(e))t.indexOf(r)<0&&q9.call(e,r)&&(n[r]=e[r]);return n};const dMe={type:"default",numberOfColumns:1},J9=_.forwardRef((e,t)=>{const n=ae("DatePicker",dMe,e),{type:r,defaultValue:o,value:i,onChange:s,__staticSelector:a,getDayProps:c,allowSingleDateInRange:u,allowDeselect:f,onMouseLeave:h,numberOfColumns:m}=n,v=uMe(n,["type","defaultValue","value","onChange","__staticSelector","getDayProps","allowSingleDateInRange","allowDeselect","onMouseLeave","numberOfColumns"]),{onDateChange:y,onRootMouseLeave:w,onHoveredDateChange:P,getControlProps:b}=lMe({type:r,level:"day",allowDeselect:f,allowSingleDateInRange:u,value:i,defaultValue:o,onChange:s,onMouseLeave:h});return k.createElement(Z9,Vw({ref:t,minLevel:"month",__staticSelector:a||"DatePicker",onMouseLeave:w,hideOutsideDates:m!==1,numberOfColumns:m,__onDayMouseEnter:(S,O)=>P(O),__onDayClick:(S,O)=>y(O),getDayProps:S=>Vw(Vw({},b(S)),c?.(S))},v))});J9.displayName="@mantine/dates/DatePicker";function fMe({type:e,date:t,locale:n,format:r,labelSeparator:o}){const i=s=>he(s).locale(n).format(r);return e==="default"?t===null?"":i(t):e==="multiple"?t.map(i).join(", "):e==="range"?t[0]&&t[1]?`${i(t[0])} ${o} ${i(t[1])}`:t[0]?`${i(t[0])} ${o} `:"":""}function hMe({type:e,value:t,defaultValue:n,onChange:r,locale:o,format:i,closeOnChange:s,sortDates:a,labelSeparator:c}){const u=Va(),[f,h]=NS(!1),[m,v]=Y9({type:e,value:t,defaultValue:n,onChange:r}),y=fMe({type:e,date:m,locale:u.getLocale(o),format:i,labelSeparator:u.getLabelSeparator(c)}),w=S=>{s&&(e==="default"&&h.close(),e==="range"&&S[0]&&S[1]&&h.close()),v(a&&e==="multiple"?[...S].sort((O,E)=>O.getTime()-E.getTime()):S)},P=()=>w(e==="range"?[null,null]:e==="multiple"?[]:null),b=e==="range"?!!m[0]:e==="multiple"?m.length>0:m!==null;return{_value:m,setValue:w,onClear:P,shouldClear:b,formattedValue:y,dropdownOpened:f,dropdownHandlers:h}}function pMe({minDate:e,maxDate:t}){const n=new Date;return!e&&!t?n:he(n).isBefore(e)?e:he(n).isAfter(t)?t:n}var mMe=ue(()=>({placeholder:{},input:{cursor:"pointer",lineHeight:"unset","&[data-read-only]":{cursor:"default"}}}));const gMe=mMe;var vMe=Object.defineProperty,yMe=Object.defineProperties,_Me=Object.getOwnPropertyDescriptors,Uy=Object.getOwnPropertySymbols,Q9=Object.prototype.hasOwnProperty,X9=Object.prototype.propertyIsEnumerable,CD=(e,t,n)=>t in e?vMe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,el=(e,t)=>{for(var n in t||(t={}))Q9.call(t,n)&&CD(e,n,t[n]);if(Uy)for(var n of Uy(t))X9.call(t,n)&&CD(e,n,t[n]);return e},kD=(e,t)=>yMe(e,_Me(t)),wMe=(e,t)=>{var n={};for(var r in e)Q9.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Uy)for(var r of Uy(e))t.indexOf(r)<0&&X9.call(e,r)&&(n[r]=e[r]);return n};const bMe={},eV=_.forwardRef((e,t)=>{const n=AP("PickerInputBase",bMe,e),{inputProps:r,wrapperProps:o,placeholder:i,classNames:s,styles:a,unstyled:c,popoverProps:u,modalProps:f,dropdownType:h,children:m,formattedValue:v,dropdownHandlers:y,dropdownOpened:w,onClick:P,clearable:b,onClear:S,clearButtonProps:O,rightSection:E,shouldClear:$,readOnly:N,disabled:I,value:R,name:B,form:z,type:G}=n,Q=wMe(n,["inputProps","wrapperProps","placeholder","classNames","styles","unstyled","popoverProps","modalProps","dropdownType","children","formattedValue","dropdownHandlers","dropdownOpened","onClick","clearable","onClear","clearButtonProps","rightSection","shouldClear","readOnly","disabled","value","name","form","type"]),{classes:X,cx:V}=gMe(null,{name:r.__staticSelector,classNames:s,styles:a,unstyled:c,variant:r.variant,size:r.size}),H=E||(b&&$&&!N&&!I?k.createElement(D0,el({variant:"transparent",onClick:S,unstyled:c,size:r.size},O)):null),Z=()=>{G==="range"&&R[0]&&!R[1]&&S(),y.close()},Y=o.label;return k.createElement(k.Fragment,null,h==="modal"&&!N&&k.createElement(Bi,el({opened:w,onClose:Z,withCloseButton:!1,size:"auto","data-dates-modal":!0,unstyled:c},f),m),k.createElement(et.Wrapper,el({},o),k.createElement(En,el({position:"bottom-start",opened:w,onClose:Z,disabled:h==="modal"||N,trapFocus:!0,returnFocus:!0,unstyled:c},u),k.createElement(En.Target,{shouldOverrideDefaultTargetId:!Y},k.createElement(et,el(kD(el({"aria-label":v,"data-dates-input":!0,"data-read-only":N||void 0,disabled:I,component:"button",type:"button",multiline:!0,onClick:j=>{P?.(j),y.toggle()},rightSection:H},r),{ref:t,classNames:kD(el({},s),{input:V(X.input,s?.input)})}),Q),v||k.createElement(et.Placeholder,{className:X.placeholder,sx:{color:r.error?"inherit":void 0}},i))),k.createElement(En.Dropdown,{"data-dates-dropdown":!0},m))),k.createElement(G9,{value:R,name:B,form:z,type:G}))});eV.displayName="@mantine/dates/PickerInputBase";var xMe=Object.defineProperty,SMe=Object.defineProperties,PMe=Object.getOwnPropertyDescriptors,Zy=Object.getOwnPropertySymbols,tV=Object.prototype.hasOwnProperty,nV=Object.prototype.propertyIsEnumerable,ED=(e,t,n)=>t in e?xMe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$D=(e,t)=>{for(var n in t||(t={}))tV.call(t,n)&&ED(e,n,t[n]);if(Zy)for(var n of Zy(t))nV.call(t,n)&&ED(e,n,t[n]);return e},OMe=(e,t)=>SMe(e,PMe(t)),CMe=(e,t)=>{var n={};for(var r in e)tV.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Zy)for(var r of Zy(e))t.indexOf(r)<0&&nV.call(e,r)&&(n[r]=e[r]);return n};const kMe={type:"default",valueFormat:"MMMM D, YYYY",closeOnChange:!0,sortDates:!0,dropdownType:"popover"},JO=_.forwardRef((e,t)=>{const n=ae("DatePickerInput",kMe,e),{type:r,value:o,defaultValue:i,onChange:s,valueFormat:a,labelSeparator:c,locale:u,classNames:f,styles:h,unstyled:m,closeOnChange:v,size:y,variant:w,dropdownType:P,sortDates:b,maxDate:S,minDate:O,defaultDate:E}=n,$=CMe(n,["type","value","defaultValue","onChange","valueFormat","labelSeparator","locale","classNames","styles","unstyled","closeOnChange","size","variant","dropdownType","sortDates","maxDate","minDate","defaultDate"]),{calendarProps:N,others:I}=sMe($),{_value:R,setValue:B,formattedValue:z,dropdownHandlers:G,dropdownOpened:Q,onClear:X,shouldClear:V}=hMe({type:r,value:o,defaultValue:i,onChange:s,locale:u,format:a,labelSeparator:c,closeOnChange:v,sortDates:b}),H=E||pMe({maxDate:S,minDate:O});return k.createElement(eV,$D({formattedValue:z,dropdownOpened:Q,dropdownHandlers:G,classNames:f,styles:h,unstyled:m,__staticSelector:"DatePickerInput",ref:t,onClear:X,shouldClear:V,value:R,type:r,size:y,variant:w,dropdownType:P},I),k.createElement(J9,OMe($D({},N),{size:y,variant:w,type:r,value:R,defaultDate:Array.isArray(R)?R[0]||H:R||H,onChange:B,locale:u,classNames:f,styles:h,unstyled:m,__staticSelector:"DatePickerInput",__stopPropagation:P==="popover",maxDate:S,minDate:O})))});JO.displayName="@mantine/dates/DatePickerInput";const v1=tn(e=>({selectedCharges:[],setSelectedCharges:t=>e(n=>({selectedCharges:typeof t=="function"?t(n.selectedCharges):t})),setSelectedCharge:(t,n)=>{e(r=>({selectedCharges:r.selectedCharges.map(o=>o.label===t?n(o):o)}))}})),EMe=ue(e=>({wrapper:{width:105,display:"flex",alignItems:"center",justifyContent:"space-between",padding:`${M(.5)} ${e.spacing.xs}`,borderRadius:e.radius.sm,border:`${M(1)} solid ${e.colorScheme==="dark"?"transparent":e.colors.gray[3]}`,backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.white,"&:focus-within":{borderColor:e.colors[e.primaryColor][6]}},control:{backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white,border:`${M(1)} solid ${e.colorScheme==="dark"?"transparent":e.colors.gray[3]}`,"&:disabled":{borderColor:e.colorScheme==="dark"?"transparent":e.colors.gray[3],opacity:.8,backgroundColor:"transparent"}},input:{textAlign:"center",paddingRight:`${e.spacing.md} !important`,paddingLeft:`${e.spacing.sm} !important`,height:M(18),flex:1,"&:disabled":{backgroundColor:"#2C2E33",cursor:"auto",color:"#C1C2C5"}}})),$Me=({charge:e,index:t})=>{const{classes:n}=EMe(),{setSelectedCharge:r,setSelectedCharges:o}=v1();return p.jsxs("div",{className:"edit-charges-modal-charge-card",children:[p.jsx(U,{fz:"sm",fw:500,c:"white",style:{textAlign:"center"},children:e.label}),p.jsxs("div",{style:{display:"flex",gap:5,justifyContent:"center"},children:[p.jsxs(mt,{radius:"xs",variant:"filled",style:{backgroundColor:"rgb(42, 42, 42)",color:"white",fontSize:10,padding:12.5,margin:5,fontWeight:500},children:["$",e.fine," fine"]}),p.jsxs(mt,{radius:"xs",variant:"filled",style:{backgroundColor:"rgb(42, 42, 42)",color:"white",fontSize:10,padding:12.5,margin:5,fontWeight:500},children:[e.time," month(s)"]}),p.jsxs(mt,{radius:"xs",variant:"filled",style:{backgroundColor:"rgb(42, 42, 42)",color:"white",fontSize:10,padding:12.5,margin:5,fontWeight:500},children:[e.points," point(s)"]})]}),p.jsx(zt,{label:e.description,multiline:!0,withArrow:!0,color:"gray",children:p.jsx(U,{fz:"xs",fw:500,mt:5,style:{textAlign:"center"},lineClamp:2,children:e.description})}),p.jsxs(nt,{position:"apart",style:{gap:5},children:[p.jsx(mt,{radius:"xs",variant:"filled",style:{fontSize:10,padding:12.5,fontWeight:500},color:e.type.toLocaleLowerCase()==="felony"?"red":e.type.toLocaleLowerCase()==="infraction"?"green":"yellow",children:e.type}),p.jsxs(nt,{style:{gap:5},children:[p.jsx(zt,{label:D.remove_charge,withArrow:!0,color:"gray",children:p.jsx(Xe,{onClick:()=>{o(i=>i.filter((s,a)=>a!==t))},h:31,className:"action-icon",children:p.jsx(K0,{size:18})})}),p.jsxs("div",{className:n.wrapper,children:[p.jsx(Xe,{size:18,variant:"transparent",onClick:()=>r(e.label,i=>({...i,count:--i.count})),disabled:e.count===1,className:n.control,onMouseDown:i=>i.preventDefault(),children:p.jsx(Cme,{size:"1rem",stroke:1.5})}),p.jsx(_a,{variant:"unstyled",min:1,max:99,value:e.count,classNames:{input:n.input},disabled:!0}),p.jsx(Xe,{size:18,variant:"transparent",onClick:()=>r(e.label,i=>({...i,count:++i.count})),className:n.control,onMouseDown:i=>i.preventDefault(),children:p.jsx(Iu,{size:"1rem",stroke:1.5})})]})]})]})]})},MMe=e=>{const t={reduction:null,fine:0,time:0,points:0};for(let n=0;n{const[t,n]=_.useState(!1),{selectedCharges:r,setSelectedCharges:o}=v1(),{setCriminal:i}=Yr();return p.jsx(at,{variant:"light",color:"gray",loading:t,onClick:async()=>{n(!0);const s=await me("getRecommendedWarrantExpiry",r,{data:Date.now()});i(e.citizenid,a=>({...a,charges:r,penalty:MMe(r),warrantExpiry:new Date(s)})),n(!1),o([]),ke.closeAll()},children:D.confirm})},TMe=({criminal:e})=>{const{selectedCharges:t,setSelectedCharges:n}=v1(),{charges:r}=th(),[o,i]=_.useState({}),[s,a]=_.useState(!1),[c,u]=_.useState(null),f=500,[h,m]=_.useState(""),[v,y]=_.useState(h);return _.useEffect(()=>{c!==null&&clearTimeout(c),a(!0);const w=setTimeout(()=>{y(h),a(!1)},f);return u(w),()=>{clearTimeout(w)}},[h]),_.useEffect(()=>{if(v.trim()==="")i(r);else{const w=Object.entries(r).reduce((P,[b,S])=>{const O=v.trim()?S.filter(E=>E.label.toLowerCase().includes(v.toLowerCase())):S;return O.length>0&&(P[b]=O),P},{});i(w)}},[v,r]),p.jsxs("div",{className:"edit-charges-modal",children:[p.jsx(Ye,{}),p.jsxs("div",{className:"edit-charges-modal-content",children:[p.jsxs("div",{className:"edit-charges-modal-current-charges",children:[p.jsx(U,{fz:"md",fw:500,c:"white",mb:5,children:D.current_charges}),p.jsx(At,{h:620,children:p.jsx("div",{className:"edit-charges-modal-added-charges",children:t.map((w,P)=>p.jsx($Me,{charge:w,index:P},P))})}),p.jsx(NMe,{criminal:e})]}),p.jsx(Ye,{orientation:"vertical"}),p.jsxs("div",{className:"edit-charges-modal-all-charges",children:[p.jsxs("div",{className:"edit-charges-modal-all-charges-header",children:[p.jsx(U,{fz:"md",fw:500,c:"white",mb:5,children:D.all_charges}),p.jsx(_n,{radius:"xs",variant:"filled",placeholder:D.search,w:300,value:h,onChange:w=>m(w.target.value)})]}),p.jsx(At,{h:635,children:p.jsx("div",{className:"edit-charges-modal-all-charges-list",children:s?p.jsx("div",{style:{display:"flex",width:"100%",marginTop:100,justifyContent:"center",alignItems:"center"},children:p.jsx(en,{})}):p.jsx(p.Fragment,{children:Object.entries(o).map(([w,P])=>p.jsxs("div",{children:[p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:w}),p.jsx("div",{className:"edit-charges-modal-charges-content",children:P.map((b,S)=>p.jsxs("div",{className:"edit-charges-modal-charge-card",children:[p.jsx(U,{fz:"sm",fw:500,c:"white",style:{textAlign:"center"},children:b.label}),p.jsxs("div",{style:{display:"flex",gap:5,justifyContent:"center"},children:[p.jsxs(mt,{radius:"xs",variant:"filled",style:{backgroundColor:"rgb(42, 42, 42)",color:"white",fontSize:10,padding:12.5,margin:5,fontWeight:500},children:["$",b.fine," fine"]}),p.jsxs(mt,{radius:"xs",variant:"filled",style:{backgroundColor:"rgb(42, 42, 42)",color:"white",fontSize:10,padding:12.5,margin:5,fontWeight:500},children:[b.time," ",D.months]}),p.jsxs(mt,{radius:"xs",variant:"filled",style:{backgroundColor:"rgb(42, 42, 42)",color:"white",fontSize:10,padding:12.5,margin:5,fontWeight:500},children:[b.points," ",D.points]})]}),p.jsx(zt,{label:b.description,multiline:!0,withArrow:!0,color:"gray",children:p.jsx(U,{fz:"xs",fw:500,mt:5,style:{textAlign:"center"},lineClamp:2,children:b.description})}),p.jsxs(nt,{position:"apart",children:[p.jsx(mt,{radius:"xs",variant:"filled",style:{fontSize:10,padding:12.5,fontWeight:500},color:b.type.toLocaleLowerCase()==="felony"?"red":b.type.toLocaleLowerCase()==="infraction"?"green":"yellow",children:b.type}),p.jsx(zt,{label:D.add_charge,withArrow:!0,color:"gray",children:p.jsx(Xe,{onClick:()=>n(O=>{const E=O.findIndex($=>$.label===b.label);return E===-1?[...O,{...b,count:1}]:O.map(($,N)=>N===E?{...$,count:++$.count}:$)}),h:31,className:"action-icon",children:p.jsx(Iu,{size:18})})})]})]},S))})]},w))})})})]})]})]})},rV=e=>Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:0}).format(e),MD=[25,50,75,80,90],Gy=(e,t)=>t?Math.round(e-t/100*e):e,IMe=e=>{const t=[];if(!e)return[];for(let n=0;n{const{incident:t,setCriminals:n,setCriminal:r}=Yr(),{setSelectedCharges:o}=v1(),{setSelectedProfile:i}=bs(),s=Kl();return p.jsxs("div",{className:"incident-criminal-card-background",children:[p.jsxs("div",{className:"incident-criminal-card-header",children:[p.jsxs(U,{style:{fontSize:15,color:"white"},weight:600,children:[e.firstname," ",e.lastname]}),p.jsxs("div",{className:"incident-criminal-card-buttons",children:[p.jsx(zt,{label:D.remove_criminal,withArrow:!0,color:"gray",position:"bottom",children:p.jsx(Xe,{variant:"light",color:"red",onClick:()=>{ke.openConfirmModal({title:p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:D.remove_criminal}),size:"sm",centered:!0,labels:{confirm:D.confirm,cancel:D.cancel},groupProps:{spacing:6},confirmProps:{color:"red"},onConfirm:async()=>{await me("removeCriminal",{id:t.id,criminalId:e.citizenid},{data:1})&&n(c=>c.filter(u=>u.citizenid!==e.citizenid))},children:p.jsx(U,{size:"sm",c:"dark.2",children:D.remove_criminal_confirm.format(e.firstname,e.lastname)})})},children:p.jsx(K0,{size:16,color:"white"})})}),p.jsx(zt,{label:D.go_to_profile,withArrow:!0,color:"gray",position:"bottom",children:p.jsx(Xe,{variant:"light",color:"dark",onClick:async()=>{if(!it()){const a=await me("getProfile",e.citizenid);i(a)}s("/profiles")},children:p.jsx(zme,{size:16,color:"white"})})}),p.jsx(zt,{label:D.save_criminal,withArrow:!0,color:"gray",position:"bottom",children:p.jsx(Xe,{variant:"light",color:"dark",onClick:()=>{me("saveCriminal",{id:t.id,criminal:{...e,warrantExpiry:e.warrantExpiry?he(e.warrantExpiry).format("YYYY-MM-DD HH:mm:ss"):null}},{data:1})},children:p.jsx(t7,{size:16,color:"white"})})})]})]}),p.jsxs(U,{color:"dimmed",size:"xs",children:["#",e.citizenid]}),p.jsxs("div",{className:"incident-criminal-content",children:[p.jsxs("div",{className:"incident-criminal-edit-charges-badges",children:[p.jsx(mt,{radius:"xs",variant:"light",style:{color:"white",fontSize:10,padding:12.5,cursor:"pointer",backgroundColor:"#343a40"},w:125,onClick:()=>{o(e.charges),ke.open({title:p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:D.edit_charges}),styles:{body:{height:700,overflow:"hidden"},content:{width:1400}},centered:!0,size:1445,children:p.jsx(TMe,{criminal:e})})},children:D.edit_charges}),e.charges.map((a,c)=>p.jsxs(mt,{radius:"xs",variant:"filled",style:{fontSize:10,padding:12.5,fontWeight:500},color:a.type.toLowerCase()==="felony"?"red":a.type.toLowerCase()==="infraction"?"green":"yellow",children:[a.count,"x ",a.label]},c))]}),p.jsx(Ye,{style:{width:"100%"}}),p.jsx(vr,{label:D.issue_warrant,description:D.issue_warrant_description,checked:e.issueWarrant,onChange:()=>r(e.citizenid,a=>({...a,issueWarrant:!a.issueWarrant}))}),e.issueWarrant?p.jsx(JO,{icon:p.jsx(tO,{size:20}),label:D.warrant_expiration_date,weekendDays:[],minDate:new Date,value:e.warrantExpiry?new Date(e.warrantExpiry):null,onChange:a=>{r(e.citizenid,c=>({...c,warrantExpiry:a}))}}):p.jsxs(p.Fragment,{children:[p.jsx(Dl,{label:D.reduction,value:e.penalty.reduction?e.penalty.reduction.toString():null,data:IMe(e.penalty),icon:p.jsx(tme,{size:20}),onChange:a=>r(e.citizenid,c=>({...c,penalty:c.penalty?{...c.penalty,reduction:a?+a:null}:{reduction:a?+a:null,time:0,fine:0,points:0}})),clearable:!0,placeholder:D.no_reduction,variant:"filled"}),p.jsxs(nt,{children:[p.jsxs(U,{size:"xs",style:{color:"white"},children:[D.time,":"," ",Gy(e.penalty.time,e.penalty.reduction)," ",D.months]}),p.jsxs(U,{size:"xs",style:{color:"white"},children:[D.fine,":"," ",rV(Gy(e.penalty.fine,e.penalty.reduction))]})]}),p.jsxs(nt,{children:[p.jsx(vr,{label:D.pleaded_guilty,checked:e.pleadedGuilty,onChange:()=>r(e.citizenid,a=>({...a,pleadedGuilty:!a.pleadedGuilty}))}),p.jsx(vr,{label:D.processed,checked:e.processed,onChange:()=>r(e.citizenid,a=>({...a,processed:!a.processed}))})]})]})]})]})},DMe=()=>{const{incident:e,isIncidentActive:t}=Yr();return t?p.jsx(At,{h:860,children:p.jsxs("div",{className:"incident-criminals-content-width",children:[p.jsxs(at,{fullWidth:!0,variant:"light",color:"gray",onClick:()=>ke.open({title:p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:D.add_criminal}),centered:!0,size:"sm",children:p.jsx(N2e,{})}),children:[p.jsx(l7,{size:M(18),style:{marginRight:5}})," ",D.add_criminal]}),e.criminals.map(n=>p.jsx(jMe,{criminal:n},n.citizenid))]})}):p.jsx("div",{className:"content-width",children:p.jsx("div",{className:"card-background",children:p.jsxs("div",{className:"profile-no-selected",children:[p.jsx(G0,{size:M(50),color:"white"}),p.jsx(U,{style:{fontSize:15,color:"white"},weight:600,children:D.no_incident_selected})]})})})},RMe=()=>{const{setActiveIncident:e,setIncidentActive:t}=Yr(),[n,r]=_.useState(!1),o=async i=>{r(!0);const s=await me("getIncident",i.id,{data:{id:1,officersInvolved:[],evidence:[],title:i.title,description:"

",criminals:[]}});e(s),t(!0),r(!1)};return p.jsxs("div",{className:"incidents",children:[p.jsx(P2e,{handleIncidentClick:o}),p.jsx(V0,{visible:n,overlayOpacity:.97,overlayColor:"rgb(34, 35, 37)",transitionDuration:250,loader:YO,style:{left:795,width:935,height:"96%",top:19,borderRadius:"0.25rem"}}),p.jsx($2e,{}),p.jsx(DMe,{})]})};const LMe=[{firstname:"John",lastname:"Doe",callsign:"1A-01",citizenid:"ABCD1234",playerId:1,position:[0,0,0],unitId:1,image:"",title:"Chief",apu:!0,air:!0,mc:!0,k9:!0,fto:!0,lastActive:Date.now()},{firstname:"Jenna",lastname:"Doe",callsign:"1A-02",citizenid:"ABCD1235",playerId:2,position:[0,0,0],image:"",title:"Captain",apu:!1,air:!0,mc:!0,k9:!1,fto:!1,lastActive:Date.now()}],Lu=tn(e=>({rosterOfficers:it()?LMe:[],getRosterOfficers:async()=>{try{const t=await me("fetchRoster");return e({rosterOfficers:t}),{rosterOfficers:t}}catch(t){return console.error("Failed to fetch recent activities:",t),{rosterOfficers:[]}}},setRosterOfficers:t=>{e(n=>({rosterOfficers:typeof t=="function"?t(n.rosterOfficers):t}))}})),zMe=({officer:e})=>{const[t,n]=_.useState(!1),{setRosterOfficers:r}=Lu(),o=ql({initialValues:{callsign:e.callsign}});return p.jsx("form",{onSubmit:o.onSubmit(async i=>{n(!0);const s=await me("setOfficerCallSign",{citizenid:e.citizenid,callsign:i.callsign},{data:!0,delay:500});if(n(!1),!s)return o.setFieldError("callSign",D.callsign_in_use);r(a=>a.map(c=>c.citizenid===e.citizenid?{...e,callsign:i.callsign}:c)),ke.closeAll()}),children:p.jsxs(Je,{children:[p.jsx(_n,{label:D.callsign,...o.getInputProps("callsign")}),p.jsx(at,{type:"submit",color:"gray",loading:t,variant:"light",children:D.confirm})]})})},AMe=({officer:e})=>{const t=["Cadet","Probationary Trooper","Trooper","Senior Trooper","Master Trooper","Corporal","Sergeant","Lieutenant","Captain","Assistant Chief","Chief"],[n,r]=_.useState(null),[o,i]=_.useState(!1),{setRosterOfficers:s}=Lu(),a=async()=>{n===null||(i(!0),!await me("setOfficerRank",{citizenId:e.citizenid,grade:+n},{data:!0}))||(s(u=>u.map(f=>f.citizenid===e.citizenid?{...e,title:`${t[n]}`}:f)),i(!1),ke.closeAll())};return p.jsxs(Je,{children:[p.jsx(Dl,{withinPortal:!0,value:n!==null?n.toString():null,data:t?t.map((c,u)=>({label:c,value:u.toString()})):[],onChange:c=>r(c!==null?+c:null),label:D.rank}),p.jsx(at,{variant:"light",color:"gray",onClick:a,loading:o,children:D.confirm})]})},BMe=({officer:e})=>{const[t,n]=_.useState(!1),{setRosterOfficers:r}=Lu(),[o,i]=_.useState(e.apu||!1),[s,a]=_.useState(e.air||!1),[c,u]=_.useState(e.mc||!1),[f,h]=_.useState(e.k9||!1),[m,v]=_.useState(e.fto||!1),y=async()=>{n(!0),await me("setOfficerRoles",{citizenid:e.citizenid,roles:{apu:o,air:s,mc:c,k9:f,fto:m}},{data:!0,delay:500}),n(!1),r(w=>w.map(P=>P.citizenid===e.citizenid?{...e,apu:o,air:s,mc:c,k9:f,fto:m}:P)),ke.closeAll()};return p.jsxs(Je,{children:[p.jsxs("div",{style:{display:"flex",gap:15,alignItems:"center",justifyContent:"center"},children:[p.jsx(vr,{label:D.apu,checked:o,onChange:()=>{i(!o)}}),p.jsx(vr,{label:D.air,checked:s,onChange:()=>{a(!s)}}),p.jsx(vr,{label:D.mc,checked:c,onChange:()=>{u(!c)}}),p.jsx(vr,{label:D.k9,checked:f,onChange:()=>{h(!f)}}),p.jsx(vr,{label:D.fto,checked:m,onChange:()=>{v(!m)}})]}),p.jsx(at,{type:"submit",color:"gray",loading:t,variant:"light",onClick:y,children:D.confirm})]})},FMe=({officers:e})=>{const{personalData:t}=Gr(),{setRosterOfficers:n}=Lu(),r=s=>s.charAt(0).toUpperCase()+s.slice(1),o=s=>{const a=he(),c=he(s),u=a.diff(c,"day");return r(u===0?D.today:u===1?D.yesterday:he(s).fromNow())},i=e.map(s=>p.jsxs("tr",{children:[p.jsx("td",{children:p.jsxs(nt,{spacing:"sm",children:[p.jsx(WP,{size:55,src:s.image,radius:5}),p.jsx("div",{children:p.jsxs(U,{fz:"sm",fw:500,children:[s.firstname," ",s.lastname]})})]})}),p.jsx("td",{children:s.callsign}),p.jsx("td",{children:p.jsx(vr,{checked:s.apu,disabled:!0,styles:{input:{"&:disabled ":{backgroundColor:s.apu?"#1971c2":"#373A40"}}}})}),p.jsx("td",{children:p.jsx(vr,{checked:s.air,disabled:!0,styles:{input:{"&:disabled ":{backgroundColor:s.air?"#1971c2":"#373A40"}}}})}),p.jsx("td",{children:p.jsx(vr,{checked:s.mc,disabled:!0,styles:{input:{"&:disabled ":{backgroundColor:s.mc?"#1971c2":"#373A40"}}}})}),p.jsx("td",{children:p.jsx(vr,{checked:s.k9,disabled:!0,styles:{input:{"&:disabled ":{backgroundColor:s.k9?"#1971c2":"#373A40"}}}})}),p.jsx("td",{children:p.jsx(vr,{checked:s.fto,disabled:!0,styles:{input:{"&:disabled ":{backgroundColor:s.fto?"#1971c2":"#373A40"}}}})}),p.jsx("td",{children:s.lastActive?o(s.lastActive):""}),p.jsx("td",{children:p.jsx(et,{disabled:!0,icon:p.jsx(J8,{size:16}),variant:"unstyled",placeholder:s.title,size:"xs"})}),p.jsx("td",{children:p.jsx(nt,{spacing:2,position:"right",children:p.jsxs(Tt,{withinPortal:!0,withArrow:!0,position:"bottom-end",children:[p.jsx(Tt.Target,{children:p.jsx(Xe,{children:p.jsx(Mme,{size:"1.2rem",stroke:1.5})})}),p.jsxs(Tt.Dropdown,{children:[p.jsx(Tt.Item,{icon:p.jsx(kme,{size:20}),onClick:()=>ke.open({title:p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:D.set_callsign}),children:p.jsx(zMe,{officer:s}),size:"xs",centered:!0}),children:D.set_callsign}),p.jsx(Tt.Item,{disabled:!gn(t,"set_officer_rank"),icon:p.jsx(Gpe,{size:20}),onClick:()=>ke.open({title:p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:D.set_rank}),centered:!0,size:"xs",children:p.jsx(AMe,{officer:s})}),children:D.set_rank}),p.jsx(Tt.Item,{disabled:!gn(t,"set_officer_roles"),icon:p.jsx(bme,{size:20}),onClick:()=>ke.open({title:p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:D.set_roles}),centered:!0,size:"sm",children:p.jsx(BMe,{officer:s})}),children:D.set_roles}),p.jsx(Tt.Item,{icon:p.jsx(Xf,{size:20}),color:"red",disabled:!gn(t,"fire_officer"),onClick:()=>ke.openConfirmModal({title:p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:D.fire_officer}),children:p.jsx(U,{c:"dark.2",size:"sm",children:D.fire_officer_description.format(s.firstname,s.lastname)}),labels:{confirm:D.confirm,cancel:D.cancel},centered:!0,groupProps:{spacing:6},confirmProps:{color:"red"},onConfirm:async()=>{await me("fireOfficer",s.citizenid,{data:!0})&&(n(c=>c.filter(u=>u.citizenid!==s.citizenid)),ke.closeAll())}}),children:D.fire_officer})]})]})})})]},s.citizenid));return p.jsx(At,{h:735,children:p.jsxs(JP,{verticalSpacing:"sm",children:[p.jsx("thead",{children:p.jsxs("tr",{children:[p.jsx("th",{children:D.officer}),p.jsx("th",{children:D.callsign}),p.jsx("th",{children:D.apu}),p.jsx("th",{children:D.air}),p.jsx("th",{children:D.mc}),p.jsx("th",{children:D.k9}),p.jsx("th",{children:D.fto}),p.jsx("th",{children:D.last_active}),p.jsx("th",{children:D.role}),p.jsx("th",{})]})}),p.jsx("tbody",{children:i})]})})},VMe=()=>{const{getRosterOfficers:e}=Lu(),[t,n]=_.useState(!1),r=ql({initialValues:{citizenid:"",callsign:""}});return p.jsx("form",{onSubmit:r.onSubmit(async o=>{n(!0);const i=await me("hireOfficer",{citizenid:o.citizenid,callsign:o.callsign,lastActive:Date.now()},{data:!1,delay:500});if(n(!1),!i)return r.setFieldError("citizenid",D.citizen_id_already_hired);await e(),ke.closeAll()}),children:p.jsxs(Je,{children:[p.jsx(_n,{label:D.citizen_id,description:D.citizen_id_you_want_to_hire,required:!0,...r.getInputProps("citizenid")}),p.jsx(_n,{label:D.callsign,description:D.callsign_you_want_to_hire,required:!0,...r.getInputProps("callsign")}),p.jsx(at,{variant:"light",color:"gray",type:"submit",loading:t,children:D.confirm})]})})},HMe=()=>{const{rosterOfficers:e,getRosterOfficers:t}=Lu(),[n,r]=_.useState(""),[o,i]=_.useState(e),s=200,[a,c]=_.useState(n),[u,f]=_.useState(null),[h,m]=_.useState(!1),{personalData:v}=Gr();return _.useEffect(()=>{u!==null&&clearTimeout(u),m(!0);const y=setTimeout(()=>{c(n),m(!1)},s);return f(y),()=>{clearTimeout(y)}},[n]),_.useEffect(()=>{if(a.trim()==="")i(e);else{const y=e.filter(w=>(w.firstname||"").toLocaleLowerCase().includes(n.toLocaleLowerCase())||(w.lastname||"").toLocaleLowerCase().includes(n.toLocaleLowerCase()));i(y)}},[a,e]),_.useEffect(()=>{m(!0),(async()=>await t())().then(()=>{m(!1)})},[]),p.jsxs("div",{className:"roster",children:[p.jsxs("div",{className:"roster-top",children:[p.jsxs("div",{children:[p.jsx(U,{style:{fontSize:12},weight:500,c:"dimmed",children:D.manage_roster}),p.jsx(U,{style:{fontSize:24,color:"white"},weight:500,children:D.roster})]}),p.jsxs("div",{className:"roster-top-right",style:{display:"flex",gap:15,alignItems:"center"},children:[p.jsxs(U,{style:{fontSize:13,textAlign:"center"},weight:500,c:"dimmed",children:[e.length," ",D.members]}),p.jsx(_n,{placeholder:D.search,variant:"filled",value:n,onChange:y=>r(y.target.value)}),p.jsx(at,{leftIcon:p.jsx(l7,{size:20}),style:{backgroundColor:"rgba(51, 124, 255, 0.2)",color:"rgba(159, 194, 255, 1)"},onClick:()=>ke.open({title:p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:D.hire_officer}),centered:!0,size:"xs",children:p.jsx(VMe,{})}),disabled:!gn(v,"hire_officer"),children:D.hire_officer})]})]}),p.jsx("div",{className:"roster-list",children:h?p.jsx(Zr,{children:p.jsx(en,{})}):p.jsx(FMe,{officers:o})})]})};const WMe=({charge:e})=>{const{setCharges:t}=th(),[n,r]=_.useState(!1),[o,i]=_.useState(e.fine),[s,a]=_.useState(e.time),[c,u]=_.useState(e.points),{personalData:f}=Gr(),h=async()=>{r(!0),await me("editCharge",{chargelabel:e.label,fine:o,time:s,points:c},{data:!0})&&(r(!1),t(v=>{const y={...v};return Object.keys(v).forEach(w=>{y[w]=v[w].map(P=>P.label===e.label?{...e,fine:Number(o),time:Number(s),points:Number(c)}:P)}),y}),ke.closeAll())};return p.jsxs(Je,{children:[p.jsx(_a,{withAsterisk:!0,label:D.charge_fine,value:o,onChange:i,min:0,variant:"filled",placeholder:D.charge_fine,parser:m=>m.replace(/\$\s?|(,*)/g,""),formatter:m=>Number.isNaN(parseFloat(m))?"$ ":`$ ${m}`.replace(/\B(?{const{setCharges:t}=th(),{personalData:n}=Gr();return p.jsxs("div",{className:"charges-charge-card",children:[p.jsx(U,{fz:"sm",fw:500,c:"white",style:{textAlign:"center"},children:e.label}),p.jsxs("div",{style:{display:"flex",gap:5,justifyContent:"center"},children:[p.jsxs(mt,{radius:"xs",variant:"filled",style:{backgroundColor:"rgb(42, 42, 42)",color:"white",fontSize:10,padding:12.5,fontWeight:500},children:["$",e.fine," ",D.fine]}),p.jsxs(mt,{radius:"xs",variant:"filled",style:{backgroundColor:"rgb(42, 42, 42)",color:"white",fontSize:10,padding:12.5,fontWeight:500},children:[e.time," ",D.months]}),p.jsxs(mt,{radius:"xs",variant:"filled",style:{backgroundColor:"rgb(42, 42, 42)",color:"white",fontSize:10,padding:12.5,fontWeight:500},children:[e.points," ",D.points]})]}),p.jsx(zt,{label:e.description,multiline:!0,withArrow:!0,color:"gray",children:p.jsx(U,{fz:"xs",fw:500,mt:2,style:{textAlign:"center",color:"white"},lineClamp:2,children:e.description})}),p.jsxs(nt,{position:"apart",style:{flex:"1"},children:[p.jsx(mt,{radius:"xs",variant:"filled",style:{fontSize:10,padding:12.5,fontWeight:500},color:e.type.toLocaleLowerCase()==="felony"?"red":e.type.toLocaleLowerCase()==="infraction"?"green":"yellow",children:e.type.charAt(0).toUpperCase()+e.type.slice(1)}),p.jsxs("div",{style:{display:"flex",gap:5,alignItems:"center"},children:[p.jsx(Xe,{variant:"light",disabled:!gn(n,"delete_charge"),onClick:()=>{ke.openConfirmModal({title:p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:D.delete_charge}),size:"sm",centered:!0,labels:{confirm:D.confirm,cancel:D.cancel},groupProps:{spacing:6},confirmProps:{color:"red"},onConfirm:async()=>{await me("deleteCharge",{label:e.label},{data:1})&&t(o=>{const i={};return Object.keys(o).forEach(s=>{i[s]=o[s].filter(a=>a.label!==e.label)}),i})},children:p.jsx(U,{size:"sm",c:"dark.2",children:D.delete_charge_confirm.format(e.label)})})},children:p.jsx(K0,{size:16,color:gn(n,"delete_charge")?"white":"gray"})}),p.jsx(at,{disabled:!gn(n,"edit_charge"),color:"gray",compact:!0,onClick:()=>ke.open({title:p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:D.edit_charge}),centered:!0,size:"sm",children:p.jsx(WMe,{charge:e})}),children:D.edit})]})]})]})},ZMe=()=>{const{charges:e,setCharges:t}=th(),{personalData:n}=Gr(),[r,o]=_.useState(""),[i,s]=_.useState(""),[a,c]=_.useState(""),[u,f]=_.useState(0),[h,m]=_.useState(0),[v,y]=_.useState(0),[w,P]=_.useState("infraction"),b=O=>O.sort((E,$)=>{const N={infraction:1,misdemeanor:2,felony:3};return N[E.type]-N[$.type]}),S=async()=>{r.length<3||i.length<3||a.length<2||u===""||u<=0||w.length<3||(it()?t(O=>{const E={...O};return E[a].push({label:r,description:i,fine:u,time:Number(h),points:Number(v),type:w}),E}):(await me("createCharge",{label:r,description:i,category:a,fine:u,time:h,points:v,type:w},{data:1}),t(O=>{const E={...O};return E[a].push({label:r,description:i,fine:u,time:Number(h),points:Number(v),type:w}),E})),o(""),s(""),c(""),f(0),m(0),y(0),P("infraction"))};return p.jsxs("div",{className:"charges",children:[p.jsx("div",{className:"top-side-create-charges",children:p.jsxs("div",{className:"charges-create",children:[p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:D.create_charge}),p.jsxs("div",{className:"charges-create-content",children:[p.jsx(_n,{withAsterisk:!0,label:D.charge_label,variant:"filled",placeholder:D.charge_label,value:r,onChange:O=>o(O.target.value),w:200,disabled:!gn(n,"create_charge")}),p.jsx(_n,{withAsterisk:!0,label:D.charge_description,variant:"filled",placeholder:D.charge_description,value:i,onChange:O=>s(O.target.value),w:250,disabled:!gn(n,"create_charge")}),p.jsx(Dl,{withAsterisk:!0,label:D.charge_category,placeholder:D.charge_category,variant:"filled",data:[{value:"OFFENSES AGAINST PERSONS",label:"OFFENSES AGAINST PERSONS"},{value:"OFFENSES INVOLVING THEFT",label:"OFFENSES INVOLVING THEFT"},{value:"OFFENSES INVOLVING FRAUD",label:"OFFENSES INVOLVING FRAUD"},{value:"OFFENSES INVOLVING DAMAGE TO PROPERTY",label:"OFFENSES INVOLVING DAMAGE TO PROPERTY"},{value:"OFFENSES AGAINST PUBLIC ADMINISTRATION",label:"OFFENSES AGAINST PUBLIC ADMINISTRATION"},{value:"OFFENSES AGAINST PUBLIC ORDER",label:"OFFENSES AGAINST PUBLIC ORDER"},{value:"OFFENSES AGAINST HEALTH AND MORALS",label:"OFFENSES AGAINST HEALTH AND MORALS"},{value:"OFFENSES AGAINST PUBLIC SAFETY",label:"OFFENSES AGAINST PUBLIC SAFETY"},{value:"OFFENSES INVOLVING THE OPERATION OF A VEHICLE",label:"OFFENSES INVOLVING THE OPERATION OF A VEHICLE"},{value:"OFFENSES INVOLVING THE WELL-BEING OF WILDLIFE",label:"OFFENSES INVOLVING THE WELL-BEING OF WILDLIFE"}],value:a,onChange:O=>c(O),w:275,disabled:!gn(n,"create_charge")}),p.jsx(_a,{withAsterisk:!0,label:D.charge_fine,value:u,onChange:f,min:0,variant:"filled",placeholder:D.charge_fine,w:140,parser:O=>O.replace(/\$\s?|(,*)/g,""),formatter:O=>Number.isNaN(parseFloat(O))?"$ ":`$ ${O}`.replace(/\B(?P(O)})]}),p.jsx("div",{className:"charges-create-buttons",children:p.jsx(at,{color:"green",disabled:!gn(n,"create_charge"),onClick:S,children:D.create})})]})}),p.jsx(At,{h:700,scrollbarSize:4,children:p.jsx("div",{className:"charges-all-charges",children:p.jsx("div",{className:"charges-category",children:Object.entries(e).map(([O,E])=>p.jsxs("div",{children:[p.jsx(U,{style:{fontSize:17,color:"white"},weight:500,children:O}),p.jsx("div",{className:"charges-cards-row",children:b(E).map($=>p.jsx(UMe,{charge:$},$.label))})]},O))})})})]})};var tS={exports:{}};/* @preserve * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade - */(function(e,t){(function(n,r){r(t)})(hS,function(n){var r="1.9.4";function o(l){var d,g,x,C;for(g=1,x=arguments.length;g"u"||!L||!L.Mixin)){l=O(l)?l:[l];for(var d=0;d0?Math.floor(l):Math.ceil(l)};D.prototype={clone:function(){return new D(this.x,this.y)},add:function(l){return this.clone()._add(F(l))},_add:function(l){return this.x+=l.x,this.y+=l.y,this},subtract:function(l){return this.clone()._subtract(F(l))},_subtract:function(l){return this.x-=l.x,this.y-=l.y,this},divideBy:function(l){return this.clone()._divideBy(l)},_divideBy:function(l){return this.x/=l,this.y/=l,this},multiplyBy:function(l){return this.clone()._multiplyBy(l)},_multiplyBy:function(l){return this.x*=l,this.y*=l,this},scaleBy:function(l){return new D(this.x*l.x,this.y*l.y)},unscaleBy:function(l){return new D(this.x/l.x,this.y/l.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=W(this.x),this.y=W(this.y),this},distanceTo:function(l){l=F(l);var d=l.x-this.x,g=l.y-this.y;return Math.sqrt(d*d+g*g)},equals:function(l){return l=F(l),l.x===this.x&&l.y===this.y},contains:function(l){return l=F(l),Math.abs(l.x)<=Math.abs(this.x)&&Math.abs(l.y)<=Math.abs(this.y)},toString:function(){return"Point("+m(this.x)+", "+m(this.y)+")"}};function F(l,d,g){return l instanceof D?l:O(l)?new D(l[0],l[1]):l==null?l:typeof l=="object"&&"x"in l&&"y"in l?new D(l.x,l.y):new D(l,d,g)}function K(l,d){if(l)for(var g=d?[l,d]:l,x=0,C=g.length;x=this.min.x&&g.x<=this.max.x&&d.y>=this.min.y&&g.y<=this.max.y},intersects:function(l){l=ee(l);var d=this.min,g=this.max,x=l.min,C=l.max,T=C.x>=d.x&&x.x<=g.x,A=C.y>=d.y&&x.y<=g.y;return T&&A},overlaps:function(l){l=ee(l);var d=this.min,g=this.max,x=l.min,C=l.max,T=C.x>d.x&&x.xd.y&&x.y=d.lat&&C.lat<=g.lat&&x.lng>=d.lng&&C.lng<=g.lng},intersects:function(l){l=ie(l);var d=this._southWest,g=this._northEast,x=l.getSouthWest(),C=l.getNorthEast(),T=C.lat>=d.lat&&x.lat<=g.lat,A=C.lng>=d.lng&&x.lng<=g.lng;return T&&A},overlaps:function(l){l=ie(l);var d=this._southWest,g=this._northEast,x=l.getSouthWest(),C=l.getNorthEast(),T=C.lat>d.lat&&x.latd.lng&&x.lng1,Gt=function(){var l=!1;try{var d=Object.defineProperty({},"passive",{get:function(){l=!0}});window.addEventListener("testPassiveEventSupport",h,d),window.removeEventListener("testPassiveEventSupport",h,d)}catch{}return l}(),to=function(){return!!document.createElement("canvas").getContext}(),Oo=!!(document.createElementNS&&bt("svg").createSVGRect),ur=!!Oo&&function(){var l=document.createElement("div");return l.innerHTML="",(l.firstChild&&l.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),dr=!Oo&&function(){try{var l=document.createElement("div");l.innerHTML='';var d=l.firstChild;return d.style.behavior="url(#default#VML)",d&&typeof d.adj=="object"}catch{return!1}}(),Ui=navigator.platform.indexOf("Mac")===0,Ts=navigator.platform.indexOf("Linux")===0;function fr(l){return navigator.userAgent.toLowerCase().indexOf(l)>=0}var Oe={ie:In,ielt9:Er,edge:lt,webkit:Yn,android:Jt,android23:pt,androidStock:Jr,opera:cr,chrome:Qr,gecko:Bt,safari:Xr,phantom:hn,opera12:bn,win:$r,ie3d:gt,webkit3d:be,gecko3d:Le,any3d:eo,mobile:Lt,mobileWebkit:Zt,mobileWebkit3d:Mr,msPointer:xt,pointer:nn,touch:Ha,touchNative:Kn,mobileOpera:qn,mobileGecko:xn,retina:Ft,passiveEvents:Gt,canvas:to,svg:Oo,vml:dr,inlineSvg:ur,mac:Ui,linux:Ts},Wa=Oe.msPointer?"MSPointerDown":"pointerdown",Ql=Oe.msPointer?"MSPointerMove":"pointermove",Ua=Oe.msPointer?"MSPointerUp":"pointerup",Se=Oe.msPointer?"MSPointerCancel":"pointercancel",ct={touchstart:Wa,touchmove:Ql,touchend:Ua,touchcancel:Se},rn={touchstart:Xl,touchmove:Za,touchend:Za,touchcancel:Za},ze={},Zi=!1;function no(l,d,g){return d==="touchstart"&&Gi(),rn[d]?(g=rn[d].bind(this,g),l.addEventListener(ct[d],g,!1),g):(console.warn("wrong event specified:",d),h)}function ch(l,d,g){if(!ct[d]){console.warn("wrong event specified:",d);return}l.removeEventListener(ct[d],g,!1)}function M1(l){ze[l.pointerId]=l}function N1(l){ze[l.pointerId]&&(ze[l.pointerId]=l)}function on(l){delete ze[l.pointerId]}function Gi(){Zi||(document.addEventListener(Wa,M1,!0),document.addEventListener(Ql,N1,!0),document.addEventListener(Ua,on,!0),document.addEventListener(Se,on,!0),Zi=!0)}function Za(l,d){if(d.pointerType!==(d.MSPOINTER_TYPE_MOUSE||"mouse")){d.touches=[];for(var g in ze)d.touches.push(ze[g]);d.changedTouches=[d],l(d)}}function Xl(l,d){d.MSPOINTER_TYPE_TOUCH&&d.pointerType===d.MSPOINTER_TYPE_TOUCH&&Dn(d),Za(l,d)}function T1(l){var d={},g,x;for(x in l)g=l[x],d[x]=g&&g.bind?g.bind(l):g;return l=d,d.type="dblclick",d.detail=2,d.isTrusted=!1,d._simulated=!0,d}var I1=200;function D1(l,d){l.addEventListener("dblclick",d);var g=0,x;function C(T){if(T.detail!==1){x=T.detail;return}if(!(T.pointerType==="mouse"||T.sourceCapabilities&&!T.sourceCapabilities.firesTouchEvents)){var A=xC(T);if(!(A.some(function(te){return te instanceof HTMLLabelElement&&te.attributes.for})&&!A.some(function(te){return te instanceof HTMLInputElement||te instanceof HTMLSelectElement}))){var q=Date.now();q-g<=I1?(x++,x===2&&d(T1(T))):x=1,g=q}}}return l.addEventListener("click",C),{dblclick:d,simDblclick:C}}function j1(l,d){l.removeEventListener("dblclick",d.dblclick),l.removeEventListener("click",d.simDblclick)}var Bu=dh(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),ui=dh(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),Ie=ui==="webkitTransition"||ui==="OTransition"?ui+"End":"transitionend";function vt(l){return typeof l=="string"?document.getElementById(l):l}function Sn(l,d){var g=l.style[d]||l.currentStyle&&l.currentStyle[d];if((!g||g==="auto")&&document.defaultView){var x=document.defaultView.getComputedStyle(l,null);g=x?x[d]:null}return g==="auto"?null:g}function Fe(l,d,g){var x=document.createElement(l);return x.className=d||"",g&&g.appendChild(x),x}function ut(l){var d=l.parentNode;d&&d.removeChild(l)}function Nr(l){for(;l.firstChild;)l.removeChild(l.firstChild)}function Co(l){var d=l.parentNode;d&&d.lastChild!==l&&d.appendChild(l)}function Tr(l){var d=l.parentNode;d&&d.firstChild!==l&&d.insertBefore(l,d.firstChild)}function L1(l,d){if(l.classList!==void 0)return l.classList.contains(d);var g=uh(l);return g.length>0&&new RegExp("(^|\\s)"+d+"(\\s|$)").test(g)}function We(l,d){if(l.classList!==void 0)for(var g=y(d),x=0,C=g.length;x0?2*window.devicePixelRatio:1;function PC(l){return Oe.edge?l.wheelDeltaY/2:l.deltaY&&l.deltaMode===0?-l.deltaY/$H:l.deltaY&&l.deltaMode===1?-l.deltaY*20:l.deltaY&&l.deltaMode===2?-l.deltaY*60:l.deltaX||l.deltaZ?0:l.wheelDelta?(l.wheelDeltaY||l.wheelDelta)/2:l.detail&&Math.abs(l.detail)<32765?-l.detail*20:l.detail?l.detail/-32765*60:0}function Y1(l,d){var g=d.relatedTarget;if(!g)return!0;try{for(;g&&g!==l;)g=g.parentNode}catch{return!1}return g!==l}var MH={__proto__:null,on:Ae,off:St,stopPropagation:Ka,disableScrollPropagation:G1,disableClickPropagation:Wu,preventDefault:Dn,stop:qa,getPropagationPath:xC,getMousePosition:SC,getWheelDelta:PC,isExternalTarget:Y1,addListener:Ae,removeListener:St},OC=Y.extend({run:function(l,d,g,x){this.stop(),this._el=l,this._inProgress=!0,this._duration=g||.25,this._easeOutPower=1/Math.max(x||.5,.2),this._startPos=Ya(l),this._offset=d.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=G(this._animate,this),this._step()},_step:function(l){var d=+new Date-this._startTime,g=this._duration*1e3;dthis.options.maxZoom)?this.setZoom(l):this},panInsideBounds:function(l,d){this._enforcingBounds=!0;var g=this.getCenter(),x=this._limitCenter(g,this._zoom,ie(l));return g.equals(x)||this.panTo(x,d),this._enforcingBounds=!1,this},panInside:function(l,d){d=d||{};var g=F(d.paddingTopLeft||d.padding||[0,0]),x=F(d.paddingBottomRight||d.padding||[0,0]),C=this.project(this.getCenter()),T=this.project(l),A=this.getPixelBounds(),q=ee([A.min.add(g),A.max.subtract(x)]),te=q.getSize();if(!q.contains(T)){this._enforcingBounds=!0;var oe=T.subtract(q.getCenter()),ve=q.extend(T).getSize().subtract(te);C.x+=oe.x<0?-ve.x:ve.x,C.y+=oe.y<0?-ve.y:ve.y,this.panTo(this.unproject(C),d),this._enforcingBounds=!1}return this},invalidateSize:function(l){if(!this._loaded)return this;l=o({animate:!1,pan:!0},l===!0?{animate:!0}:l);var d=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var g=this.getSize(),x=d.divideBy(2).round(),C=g.divideBy(2).round(),T=x.subtract(C);return!T.x&&!T.y?this:(l.animate&&l.pan?this.panBy(T):(l.pan&&this._rawPanBy(T),this.fire("move"),l.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(s(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:d,newSize:g}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(l){if(l=this._locateOptions=o({timeout:1e4,watch:!1},l),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var d=s(this._handleGeolocationResponse,this),g=s(this._handleGeolocationError,this);return l.watch?this._locationWatchId=navigator.geolocation.watchPosition(d,g,l):navigator.geolocation.getCurrentPosition(d,g,l),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(l){if(this._container._leaflet_id){var d=l.code,g=l.message||(d===1?"permission denied":d===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:d,message:"Geolocation error: "+g+"."})}},_handleGeolocationResponse:function(l){if(this._container._leaflet_id){var d=l.coords.latitude,g=l.coords.longitude,x=new J(d,g),C=x.toBounds(l.coords.accuracy*2),T=this._locateOptions;if(T.setView){var A=this.getBoundsZoom(C);this.setView(x,T.maxZoom?Math.min(A,T.maxZoom):A)}var q={latlng:x,bounds:C,timestamp:l.timestamp};for(var te in l.coords)typeof l.coords[te]=="number"&&(q[te]=l.coords[te]);this.fire("locationfound",q)}},addHandler:function(l,d){if(!d)return this;var g=this[l]=new d(this);return this._handlers.push(g),this.options[l]&&g.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),ut(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(Q(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var l;for(l in this._layers)this._layers[l].remove();for(l in this._panes)ut(this._panes[l]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(l,d){var g="leaflet-pane"+(l?" leaflet-"+l.replace("Pane","")+"-pane":""),x=Fe("div",g,d||this._mapPane);return l&&(this._panes[l]=x),x},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var l=this.getPixelBounds(),d=this.unproject(l.getBottomLeft()),g=this.unproject(l.getTopRight());return new fe(d,g)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(l,d,g){l=ie(l),g=F(g||[0,0]);var x=this.getZoom()||0,C=this.getMinZoom(),T=this.getMaxZoom(),A=l.getNorthWest(),q=l.getSouthEast(),te=this.getSize().subtract(g),oe=ee(this.project(q,x),this.project(A,x)).getSize(),ve=Oe.any3d?this.options.zoomSnap:1,Re=te.x/oe.x,Ke=te.y/oe.y,hr=d?Math.max(Re,Ke):Math.min(Re,Ke);return x=this.getScaleZoom(hr,x),ve&&(x=Math.round(x/(ve/100))*(ve/100),x=d?Math.ceil(x/ve)*ve:Math.floor(x/ve)*ve),Math.max(C,Math.min(T,x))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new D(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(l,d){var g=this._getTopLeftPoint(l,d);return new K(g,g.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(l){return this.options.crs.getProjectedBounds(l===void 0?this.getZoom():l)},getPane:function(l){return typeof l=="string"?this._panes[l]:l},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(l,d){var g=this.options.crs;return d=d===void 0?this._zoom:d,g.scale(l)/g.scale(d)},getScaleZoom:function(l,d){var g=this.options.crs;d=d===void 0?this._zoom:d;var x=g.zoom(l*g.scale(d));return isNaN(x)?1/0:x},project:function(l,d){return d=d===void 0?this._zoom:d,this.options.crs.latLngToPoint(ne(l),d)},unproject:function(l,d){return d=d===void 0?this._zoom:d,this.options.crs.pointToLatLng(F(l),d)},layerPointToLatLng:function(l){var d=F(l).add(this.getPixelOrigin());return this.unproject(d)},latLngToLayerPoint:function(l){var d=this.project(ne(l))._round();return d._subtract(this.getPixelOrigin())},wrapLatLng:function(l){return this.options.crs.wrapLatLng(ne(l))},wrapLatLngBounds:function(l){return this.options.crs.wrapLatLngBounds(ie(l))},distance:function(l,d){return this.options.crs.distance(ne(l),ne(d))},containerPointToLayerPoint:function(l){return F(l).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(l){return F(l).add(this._getMapPanePos())},containerPointToLatLng:function(l){var d=this.containerPointToLayerPoint(F(l));return this.layerPointToLatLng(d)},latLngToContainerPoint:function(l){return this.layerPointToContainerPoint(this.latLngToLayerPoint(ne(l)))},mouseEventToContainerPoint:function(l){return SC(l,this._container)},mouseEventToLayerPoint:function(l){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(l))},mouseEventToLatLng:function(l){return this.layerPointToLatLng(this.mouseEventToLayerPoint(l))},_initContainer:function(l){var d=this._container=vt(l);if(d){if(d._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");Ae(d,"scroll",this._onScroll,this),this._containerId=c(d)},_initLayout:function(){var l=this._container;this._fadeAnimated=this.options.fadeAnimation&&Oe.any3d,We(l,"leaflet-container"+(Oe.touch?" leaflet-touch":"")+(Oe.retina?" leaflet-retina":"")+(Oe.ielt9?" leaflet-oldie":"")+(Oe.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var d=Sn(l,"position");d!=="absolute"&&d!=="relative"&&d!=="fixed"&&d!=="sticky"&&(l.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var l=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),sn(this._mapPane,new D(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(We(l.markerPane,"leaflet-zoom-hide"),We(l.shadowPane,"leaflet-zoom-hide"))},_resetView:function(l,d,g){sn(this._mapPane,new D(0,0));var x=!this._loaded;this._loaded=!0,d=this._limitZoom(d),this.fire("viewprereset");var C=this._zoom!==d;this._moveStart(C,g)._move(l,d)._moveEnd(C),this.fire("viewreset"),x&&this.fire("load")},_moveStart:function(l,d){return l&&this.fire("zoomstart"),d||this.fire("movestart"),this},_move:function(l,d,g,x){d===void 0&&(d=this._zoom);var C=this._zoom!==d;return this._zoom=d,this._lastCenter=l,this._pixelOrigin=this._getNewPixelOrigin(l),x?g&&g.pinch&&this.fire("zoom",g):((C||g&&g.pinch)&&this.fire("zoom",g),this.fire("move",g)),this},_moveEnd:function(l){return l&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return Q(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(l){sn(this._mapPane,this._getMapPanePos().subtract(l))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(l){this._targets={},this._targets[c(this._container)]=this;var d=l?St:Ae;d(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&d(window,"resize",this._onResize,this),Oe.any3d&&this.options.transform3DLimit&&(l?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){Q(this._resizeRequest),this._resizeRequest=G(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var l=this._getMapPanePos();Math.max(Math.abs(l.x),Math.abs(l.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(l,d){for(var g=[],x,C=d==="mouseout"||d==="mouseover",T=l.target||l.srcElement,A=!1;T;){if(x=this._targets[c(T)],x&&(d==="click"||d==="preclick")&&this._draggableMoved(x)){A=!0;break}if(x&&x.listens(d,!0)&&(C&&!Y1(T,l)||(g.push(x),C))||T===this._container)break;T=T.parentNode}return!g.length&&!A&&!C&&this.listens(d,!0)&&(g=[this]),g},_isClickDisabled:function(l){for(;l&&l!==this._container;){if(l._leaflet_disable_click)return!0;l=l.parentNode}},_handleDOMEvent:function(l){var d=l.target||l.srcElement;if(!(!this._loaded||d._leaflet_disable_events||l.type==="click"&&this._isClickDisabled(d))){var g=l.type;g==="mousedown"&&V1(d),this._fireDOMEvent(l,g)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(l,d,g){if(l.type==="click"){var x=o({},l);x.type="preclick",this._fireDOMEvent(x,x.type,g)}var C=this._findEventTargets(l,d);if(g){for(var T=[],A=0;A0?Math.round(l-d)/2:Math.max(0,Math.ceil(l))-Math.max(0,Math.floor(d))},_limitZoom:function(l){var d=this.getMinZoom(),g=this.getMaxZoom(),x=Oe.any3d?this.options.zoomSnap:1;return x&&(l=Math.round(l/x)*x),Math.max(d,Math.min(g,l))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){Qt(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(l,d){var g=this._getCenterOffset(l)._trunc();return(d&&d.animate)!==!0&&!this.getSize().contains(g)?!1:(this.panBy(g,d),!0)},_createAnimProxy:function(){var l=this._proxy=Fe("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(l),this.on("zoomanim",function(d){var g=Bu,x=this._proxy.style[g];Ga(this._proxy,this.project(d.center,d.zoom),this.getZoomScale(d.zoom,1)),x===this._proxy.style[g]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){ut(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var l=this.getCenter(),d=this.getZoom();Ga(this._proxy,this.project(l,d),this.getZoomScale(d,1))},_catchTransitionEnd:function(l){this._animatingZoom&&l.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(l,d,g){if(this._animatingZoom)return!0;if(g=g||{},!this._zoomAnimated||g.animate===!1||this._nothingToAnimate()||Math.abs(d-this._zoom)>this.options.zoomAnimationThreshold)return!1;var x=this.getZoomScale(d),C=this._getCenterOffset(l)._divideBy(1-1/x);return g.animate!==!0&&!this.getSize().contains(C)?!1:(G(function(){this._moveStart(!0,g.noMoveStart||!1)._animateZoom(l,d,!0)},this),!0)},_animateZoom:function(l,d,g,x){this._mapPane&&(g&&(this._animatingZoom=!0,this._animateToCenter=l,this._animateToZoom=d,We(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:l,zoom:d,noUpdate:x}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(s(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&Qt(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function NH(l,d){return new rt(l,d)}var Uo=V.extend({options:{position:"topright"},initialize:function(l){w(this,l)},getPosition:function(){return this.options.position},setPosition:function(l){var d=this._map;return d&&d.removeControl(this),this.options.position=l,d&&d.addControl(this),this},getContainer:function(){return this._container},addTo:function(l){this.remove(),this._map=l;var d=this._container=this.onAdd(l),g=this.getPosition(),x=l._controlCorners[g];return We(d,"leaflet-control"),g.indexOf("bottom")!==-1?x.insertBefore(d,x.firstChild):x.appendChild(d),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(ut(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(l){this._map&&l&&l.screenX>0&&l.screenY>0&&this._map.getContainer().focus()}}),Uu=function(l){return new Uo(l)};rt.include({addControl:function(l){return l.addTo(this),this},removeControl:function(l){return l.remove(),this},_initControlPos:function(){var l=this._controlCorners={},d="leaflet-",g=this._controlContainer=Fe("div",d+"control-container",this._container);function x(C,T){var A=d+C+" "+d+T;l[C+T]=Fe("div",A,g)}x("top","left"),x("top","right"),x("bottom","left"),x("bottom","right")},_clearControlPos:function(){for(var l in this._controlCorners)ut(this._controlCorners[l]);ut(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var CC=Uo.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(l,d,g,x){return g1,this._baseLayersList.style.display=l?"":"none"),this._separator.style.display=d&&l?"":"none",this},_onLayerChange:function(l){this._handlingClick||this._update();var d=this._getLayer(c(l.target)),g=d.overlay?l.type==="add"?"overlayadd":"overlayremove":l.type==="add"?"baselayerchange":null;g&&this._map.fire(g,d)},_createRadioElement:function(l,d){var g='",x=document.createElement("div");return x.innerHTML=g,x.firstChild},_addItem:function(l){var d=document.createElement("label"),g=this._map.hasLayer(l.layer),x;l.overlay?(x=document.createElement("input"),x.type="checkbox",x.className="leaflet-control-layers-selector",x.defaultChecked=g):x=this._createRadioElement("leaflet-base-layers_"+c(this),g),this._layerControlInputs.push(x),x.layerId=c(l.layer),Ae(x,"click",this._onInputClick,this);var C=document.createElement("span");C.innerHTML=" "+l.name;var T=document.createElement("span");d.appendChild(T),T.appendChild(x),T.appendChild(C);var A=l.overlay?this._overlaysList:this._baseLayersList;return A.appendChild(d),this._checkDisabledLayers(),d},_onInputClick:function(){if(!this._preventClick){var l=this._layerControlInputs,d,g,x=[],C=[];this._handlingClick=!0;for(var T=l.length-1;T>=0;T--)d=l[T],g=this._getLayer(d.layerId).layer,d.checked?x.push(g):d.checked||C.push(g);for(T=0;T=0;C--)d=l[C],g=this._getLayer(d.layerId).layer,d.disabled=g.options.minZoom!==void 0&&xg.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var l=this._section;this._preventClick=!0,Ae(l,"click",Dn),this.expand();var d=this;setTimeout(function(){St(l,"click",Dn),d._preventClick=!1})}}),TH=function(l,d,g){return new CC(l,d,g)},K1=Uo.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(l){var d="leaflet-control-zoom",g=Fe("div",d+" leaflet-bar"),x=this.options;return this._zoomInButton=this._createButton(x.zoomInText,x.zoomInTitle,d+"-in",g,this._zoomIn),this._zoomOutButton=this._createButton(x.zoomOutText,x.zoomOutTitle,d+"-out",g,this._zoomOut),this._updateDisabled(),l.on("zoomend zoomlevelschange",this._updateDisabled,this),g},onRemove:function(l){l.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(l){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(l.shiftKey?3:1))},_createButton:function(l,d,g,x,C){var T=Fe("a",g,x);return T.innerHTML=l,T.href="#",T.title=d,T.setAttribute("role","button"),T.setAttribute("aria-label",d),Wu(T),Ae(T,"click",qa),Ae(T,"click",C,this),Ae(T,"click",this._refocusOnMap,this),T},_updateDisabled:function(){var l=this._map,d="leaflet-disabled";Qt(this._zoomInButton,d),Qt(this._zoomOutButton,d),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||l._zoom===l.getMinZoom())&&(We(this._zoomOutButton,d),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||l._zoom===l.getMaxZoom())&&(We(this._zoomInButton,d),this._zoomInButton.setAttribute("aria-disabled","true"))}});rt.mergeOptions({zoomControl:!0}),rt.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new K1,this.addControl(this.zoomControl))});var IH=function(l){return new K1(l)},kC=Uo.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(l){var d="leaflet-control-scale",g=Fe("div",d),x=this.options;return this._addScales(x,d+"-line",g),l.on(x.updateWhenIdle?"moveend":"move",this._update,this),l.whenReady(this._update,this),g},onRemove:function(l){l.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(l,d,g){l.metric&&(this._mScale=Fe("div",d,g)),l.imperial&&(this._iScale=Fe("div",d,g))},_update:function(){var l=this._map,d=l.getSize().y/2,g=l.distance(l.containerPointToLatLng([0,d]),l.containerPointToLatLng([this.options.maxWidth,d]));this._updateScales(g)},_updateScales:function(l){this.options.metric&&l&&this._updateMetric(l),this.options.imperial&&l&&this._updateImperial(l)},_updateMetric:function(l){var d=this._getRoundNum(l),g=d<1e3?d+" m":d/1e3+" km";this._updateScale(this._mScale,g,d/l)},_updateImperial:function(l){var d=l*3.2808399,g,x,C;d>5280?(g=d/5280,x=this._getRoundNum(g),this._updateScale(this._iScale,x+" mi",x/g)):(C=this._getRoundNum(d),this._updateScale(this._iScale,C+" ft",C/d))},_updateScale:function(l,d,g){l.style.width=Math.round(this.options.maxWidth*g)+"px",l.innerHTML=d},_getRoundNum:function(l){var d=Math.pow(10,(Math.floor(l)+"").length-1),g=l/d;return g=g>=10?10:g>=5?5:g>=3?3:g>=2?2:1,d*g}}),DH=function(l){return new kC(l)},jH='',q1=Uo.extend({options:{position:"bottomright",prefix:''+(Oe.inlineSvg?jH+" ":"")+"Leaflet"},initialize:function(l){w(this,l),this._attributions={}},onAdd:function(l){l.attributionControl=this,this._container=Fe("div","leaflet-control-attribution"),Wu(this._container);for(var d in l._layers)l._layers[d].getAttribution&&this.addAttribution(l._layers[d].getAttribution());return this._update(),l.on("layeradd",this._addAttribution,this),this._container},onRemove:function(l){l.off("layeradd",this._addAttribution,this)},_addAttribution:function(l){l.layer.getAttribution&&(this.addAttribution(l.layer.getAttribution()),l.layer.once("remove",function(){this.removeAttribution(l.layer.getAttribution())},this))},setPrefix:function(l){return this.options.prefix=l,this._update(),this},addAttribution:function(l){return l?(this._attributions[l]||(this._attributions[l]=0),this._attributions[l]++,this._update(),this):this},removeAttribution:function(l){return l?(this._attributions[l]&&(this._attributions[l]--,this._update()),this):this},_update:function(){if(this._map){var l=[];for(var d in this._attributions)this._attributions[d]&&l.push(d);var g=[];this.options.prefix&&g.push(this.options.prefix),l.length&&g.push(l.join(", ")),this._container.innerHTML=g.join(' ')}}});rt.mergeOptions({attributionControl:!0}),rt.addInitHook(function(){this.options.attributionControl&&new q1().addTo(this)});var LH=function(l){return new q1(l)};Uo.Layers=CC,Uo.Zoom=K1,Uo.Scale=kC,Uo.Attribution=q1,Uu.layers=TH,Uu.zoom=IH,Uu.scale=DH,Uu.attribution=LH;var fi=V.extend({initialize:function(l){this._map=l},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});fi.addTo=function(l,d){return l.addHandler(d,this),this};var RH={Events:Z},EC=Oe.touch?"touchstart mousedown":"mousedown",Is=Y.extend({options:{clickTolerance:3},initialize:function(l,d,g,x){w(this,x),this._element=l,this._dragStartTarget=d||l,this._preventOutline=g},enable:function(){this._enabled||(Ae(this._dragStartTarget,EC,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Is._dragging===this&&this.finishDrag(!0),St(this._dragStartTarget,EC,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(l){if(this._enabled&&(this._moved=!1,!L1(this._element,"leaflet-zoom-anim"))){if(l.touches&&l.touches.length!==1){Is._dragging===this&&this.finishDrag();return}if(!(Is._dragging||l.shiftKey||l.which!==1&&l.button!==1&&!l.touches)&&(Is._dragging=this,this._preventOutline&&V1(this._element),A1(),Fu(),!this._moving)){this.fire("down");var d=l.touches?l.touches[0]:l,g=wC(this._element);this._startPoint=new D(d.clientX,d.clientY),this._startPos=Ya(this._element),this._parentScale=H1(g);var x=l.type==="mousedown";Ae(document,x?"mousemove":"touchmove",this._onMove,this),Ae(document,x?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(l){if(this._enabled){if(l.touches&&l.touches.length>1){this._moved=!0;return}var d=l.touches&&l.touches.length===1?l.touches[0]:l,g=new D(d.clientX,d.clientY)._subtract(this._startPoint);!g.x&&!g.y||Math.abs(g.x)+Math.abs(g.y)T&&(A=q,T=te);T>g&&(d[A]=1,Q1(l,d,g,x,A),Q1(l,d,g,A,C))}function FH(l,d){for(var g=[l[0]],x=1,C=0,T=l.length;xd&&(g.push(l[x]),C=x);return Cd.max.x&&(g|=2),l.yd.max.y&&(g|=8),g}function VH(l,d){var g=d.x-l.x,x=d.y-l.y;return g*g+x*x}function Zu(l,d,g,x){var C=d.x,T=d.y,A=g.x-C,q=g.y-T,te=A*A+q*q,oe;return te>0&&(oe=((l.x-C)*A+(l.y-T)*q)/te,oe>1?(C=g.x,T=g.y):oe>0&&(C+=A*oe,T+=q*oe)),A=l.x-C,q=l.y-T,x?A*A+q*q:new D(C,T)}function Eo(l){return!O(l[0])||typeof l[0][0]!="object"&&typeof l[0][0]<"u"}function jC(l){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Eo(l)}function LC(l,d){var g,x,C,T,A,q,te,oe;if(!l||l.length===0)throw new Error("latlngs not passed");Eo(l)||(console.warn("latlngs are not flat! Only the first ring will be used"),l=l[0]);var ve=ne([0,0]),Re=ie(l),Ke=Re.getNorthWest().distanceTo(Re.getSouthWest())*Re.getNorthEast().distanceTo(Re.getNorthWest());Ke<1700&&(ve=J1(l));var hr=l.length,Pn=[];for(g=0;gx){te=(T-x)/C,oe=[q.x-te*(q.x-A.x),q.y-te*(q.y-A.y)];break}var Ir=d.unproject(F(oe));return ne([Ir.lat+ve.lat,Ir.lng+ve.lng])}var HH={__proto__:null,simplify:NC,pointToSegmentDistance:TC,closestPointOnSegment:AH,clipSegment:DC,_getEdgeIntersection:ph,_getBitCode:Ja,_sqClosestPointOnSegment:Zu,isFlat:Eo,_flat:jC,polylineCenter:LC},X1={project:function(l){return new D(l.lng,l.lat)},unproject:function(l){return new J(l.y,l.x)},bounds:new K([-180,-90],[180,90])},e_={R:6378137,R_MINOR:6356752314245179e-9,bounds:new K([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(l){var d=Math.PI/180,g=this.R,x=l.lat*d,C=this.R_MINOR/g,T=Math.sqrt(1-C*C),A=T*Math.sin(x),q=Math.tan(Math.PI/4-x/2)/Math.pow((1-A)/(1+A),T/2);return x=-g*Math.log(Math.max(q,1e-10)),new D(l.lng*d*g,x)},unproject:function(l){for(var d=180/Math.PI,g=this.R,x=this.R_MINOR/g,C=Math.sqrt(1-x*x),T=Math.exp(-l.y/g),A=Math.PI/2-2*Math.atan(T),q=0,te=.1,oe;q<15&&Math.abs(te)>1e-7;q++)oe=C*Math.sin(A),oe=Math.pow((1-oe)/(1+oe),C/2),te=Math.PI/2-2*Math.atan(T*oe)-A,A+=te;return new J(A*d,l.x*d/g)}},WH={__proto__:null,LonLat:X1,Mercator:e_,SphericalMercator:we},UH=o({},_e,{code:"EPSG:3395",projection:e_,transformation:function(){var l=.5/(Math.PI*e_.R);return Te(l,.5,-l,.5)}()}),RC=o({},_e,{code:"EPSG:4326",projection:X1,transformation:Te(1/180,1,-1/180,.5)}),ZH=o({},le,{projection:X1,transformation:Te(1,0,-1,0),scale:function(l){return Math.pow(2,l)},zoom:function(l){return Math.log(l)/Math.LN2},distance:function(l,d){var g=d.lng-l.lng,x=d.lat-l.lat;return Math.sqrt(g*g+x*x)},infinite:!0});le.Earth=_e,le.EPSG3395=UH,le.EPSG3857=De,le.EPSG900913=st,le.EPSG4326=RC,le.Simple=ZH;var Zo=Y.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(l){return l.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(l){return l&&l.removeLayer(this),this},getPane:function(l){return this._map.getPane(l?this.options[l]||l:this.options.pane)},addInteractiveTarget:function(l){return this._map._targets[c(l)]=this,this},removeInteractiveTarget:function(l){return delete this._map._targets[c(l)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(l){var d=l.target;if(d.hasLayer(this)){if(this._map=d,this._zoomAnimated=d._zoomAnimated,this.getEvents){var g=this.getEvents();d.on(g,this),this.once("remove",function(){d.off(g,this)},this)}this.onAdd(d),this.fire("add"),d.fire("layeradd",{layer:this})}}});rt.include({addLayer:function(l){if(!l._layerAdd)throw new Error("The provided object is not a Layer.");var d=c(l);return this._layers[d]?this:(this._layers[d]=l,l._mapToAdd=this,l.beforeAdd&&l.beforeAdd(this),this.whenReady(l._layerAdd,l),this)},removeLayer:function(l){var d=c(l);return this._layers[d]?(this._loaded&&l.onRemove(this),delete this._layers[d],this._loaded&&(this.fire("layerremove",{layer:l}),l.fire("remove")),l._map=l._mapToAdd=null,this):this},hasLayer:function(l){return c(l)in this._layers},eachLayer:function(l,d){for(var g in this._layers)l.call(d,this._layers[g]);return this},_addLayers:function(l){l=l?O(l)?l:[l]:[];for(var d=0,g=l.length;dthis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()=2&&d[0]instanceof J&&d[0].equals(d[g-1])&&d.pop(),d},_setLatLngs:function(l){Ki.prototype._setLatLngs.call(this,l),Eo(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Eo(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var l=this._renderer._bounds,d=this.options.weight,g=new D(d,d);if(l=new K(l.min.subtract(g),l.max.add(g)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(l))){if(this.options.noClip){this._parts=this._rings;return}for(var x=0,C=this._rings.length,T;xl.y!=C.y>l.y&&l.x<(C.x-x.x)*(l.y-x.y)/(C.y-x.y)+x.x&&(d=!d);return d||Ki.prototype._containsPoint.call(this,l,!0)}});function eW(l,d){return new nc(l,d)}var qi=Yi.extend({initialize:function(l,d){w(this,d),this._layers={},l&&this.addData(l)},addData:function(l){var d=O(l)?l:l.features,g,x,C;if(d){for(g=0,x=d.length;g0&&C.push(C[0].slice()),C}function rc(l,d){return l.feature?o({},l.feature,{geometry:d}):wh(d)}function wh(l){return l.type==="Feature"||l.type==="FeatureCollection"?l:{type:"Feature",properties:{},geometry:l}}var o_={toGeoJSON:function(l){return rc(this,{type:"Point",coordinates:r_(this.getLatLng(),l)})}};mh.include(o_),t_.include(o_),gh.include(o_),Ki.include({toGeoJSON:function(l){var d=!Eo(this._latlngs),g=_h(this._latlngs,d?1:0,!1,l);return rc(this,{type:(d?"Multi":"")+"LineString",coordinates:g})}}),nc.include({toGeoJSON:function(l){var d=!Eo(this._latlngs),g=d&&!Eo(this._latlngs[0]),x=_h(this._latlngs,g?2:d?1:0,!0,l);return d||(x=[x]),rc(this,{type:(g?"Multi":"")+"Polygon",coordinates:x})}}),ec.include({toMultiPoint:function(l){var d=[];return this.eachLayer(function(g){d.push(g.toGeoJSON(l).geometry.coordinates)}),rc(this,{type:"MultiPoint",coordinates:d})},toGeoJSON:function(l){var d=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(d==="MultiPoint")return this.toMultiPoint(l);var g=d==="GeometryCollection",x=[];return this.eachLayer(function(C){if(C.toGeoJSON){var T=C.toGeoJSON(l);if(g)x.push(T.geometry);else{var A=wh(T);A.type==="FeatureCollection"?x.push.apply(x,A.features):x.push(A)}}}),g?rc(this,{geometries:x,type:"GeometryCollection"}):{type:"FeatureCollection",features:x}}});function BC(l,d){return new qi(l,d)}var tW=BC,bh=Zo.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(l,d,g){this._url=l,this._bounds=ie(d),w(this,g)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(We(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){ut(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(l){return this.options.opacity=l,this._image&&this._updateOpacity(),this},setStyle:function(l){return l.opacity&&this.setOpacity(l.opacity),this},bringToFront:function(){return this._map&&Co(this._image),this},bringToBack:function(){return this._map&&Tr(this._image),this},setUrl:function(l){return this._url=l,this._image&&(this._image.src=l),this},setBounds:function(l){return this._bounds=ie(l),this._map&&this._reset(),this},getEvents:function(){var l={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(l.zoomanim=this._animateZoom),l},setZIndex:function(l){return this.options.zIndex=l,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var l=this._url.tagName==="IMG",d=this._image=l?this._url:Fe("img");if(We(d,"leaflet-image-layer"),this._zoomAnimated&&We(d,"leaflet-zoom-animated"),this.options.className&&We(d,this.options.className),d.onselectstart=h,d.onmousemove=h,d.onload=s(this.fire,this,"load"),d.onerror=s(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(d.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),l){this._url=d.src;return}d.src=this._url,d.alt=this.options.alt},_animateZoom:function(l){var d=this._map.getZoomScale(l.zoom),g=this._map._latLngBoundsToNewLayerBounds(this._bounds,l.zoom,l.center).min;Ga(this._image,g,d)},_reset:function(){var l=this._image,d=new K(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),g=d.getSize();sn(l,d.min),l.style.width=g.x+"px",l.style.height=g.y+"px"},_updateOpacity:function(){ko(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var l=this.options.errorOverlayUrl;l&&this._url!==l&&(this._url=l,this._image.src=l)},getCenter:function(){return this._bounds.getCenter()}}),nW=function(l,d,g){return new bh(l,d,g)},FC=bh.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var l=this._url.tagName==="VIDEO",d=this._image=l?this._url:Fe("video");if(We(d,"leaflet-image-layer"),this._zoomAnimated&&We(d,"leaflet-zoom-animated"),this.options.className&&We(d,this.options.className),d.onselectstart=h,d.onmousemove=h,d.onloadeddata=s(this.fire,this,"load"),l){for(var g=d.getElementsByTagName("source"),x=[],C=0;C0?x:[d.src];return}O(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(d.style,"objectFit")&&(d.style.objectFit="fill"),d.autoplay=!!this.options.autoplay,d.loop=!!this.options.loop,d.muted=!!this.options.muted,d.playsInline=!!this.options.playsInline;for(var T=0;TC?(d.height=C+"px",We(l,T)):Qt(l,T),this._containerWidth=this._container.offsetWidth},_animateZoom:function(l){var d=this._map._latLngToNewLayerPoint(this._latlng,l.zoom,l.center),g=this._getAnchor();sn(this._container,d.add(g))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var l=this._map,d=parseInt(Sn(this._container,"marginBottom"),10)||0,g=this._container.offsetHeight+d,x=this._containerWidth,C=new D(this._containerLeft,-g-this._containerBottom);C._add(Ya(this._container));var T=l.layerPointToContainerPoint(C),A=F(this.options.autoPanPadding),q=F(this.options.autoPanPaddingTopLeft||A),te=F(this.options.autoPanPaddingBottomRight||A),oe=l.getSize(),ve=0,Re=0;T.x+x+te.x>oe.x&&(ve=T.x+x-oe.x+te.x),T.x-ve-q.x<0&&(ve=T.x-q.x),T.y+g+te.y>oe.y&&(Re=T.y+g-oe.y+te.y),T.y-Re-q.y<0&&(Re=T.y-q.y),(ve||Re)&&(this.options.keepInView&&(this._autopanning=!0),l.fire("autopanstart").panBy([ve,Re]))}},_getAnchor:function(){return F(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),iW=function(l,d){return new xh(l,d)};rt.mergeOptions({closePopupOnClick:!0}),rt.include({openPopup:function(l,d,g){return this._initOverlay(xh,l,d,g).openOn(this),this},closePopup:function(l){return l=arguments.length?l:this._popup,l&&l.close(),this}}),Zo.include({bindPopup:function(l,d){return this._popup=this._initOverlay(xh,this._popup,l,d),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(l){return this._popup&&(this instanceof Yi||(this._popup._source=this),this._popup._prepareOpen(l||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(l){return this._popup&&this._popup.setContent(l),this},getPopup:function(){return this._popup},_openPopup:function(l){if(!(!this._popup||!this._map)){qa(l);var d=l.layer||l.target;if(this._popup._source===d&&!(d instanceof Ds)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(l.latlng);return}this._popup._source=d,this.openPopup(l.latlng)}},_movePopup:function(l){this._popup.setLatLng(l.latlng)},_onKeyPress:function(l){l.originalEvent.keyCode===13&&this._openPopup(l)}});var Sh=hi.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(l){hi.prototype.onAdd.call(this,l),this.setOpacity(this.options.opacity),l.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(l){hi.prototype.onRemove.call(this,l),l.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var l=hi.prototype.getEvents.call(this);return this.options.permanent||(l.preclick=this.close),l},_initLayout:function(){var l="leaflet-tooltip",d=l+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=Fe("div",d),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+c(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(l){var d,g,x=this._map,C=this._container,T=x.latLngToContainerPoint(x.getCenter()),A=x.layerPointToContainerPoint(l),q=this.options.direction,te=C.offsetWidth,oe=C.offsetHeight,ve=F(this.options.offset),Re=this._getAnchor();q==="top"?(d=te/2,g=oe):q==="bottom"?(d=te/2,g=0):q==="center"?(d=te/2,g=oe/2):q==="right"?(d=0,g=oe/2):q==="left"?(d=te,g=oe/2):A.xthis.options.maxZoom||gx?this._retainParent(C,T,A,x):!1)},_retainChildren:function(l,d,g,x){for(var C=2*l;C<2*l+2;C++)for(var T=2*d;T<2*d+2;T++){var A=new D(C,T);A.z=g+1;var q=this._tileCoordsToKey(A),te=this._tiles[q];if(te&&te.active){te.retain=!0;continue}else te&&te.loaded&&(te.retain=!0);g+1this.options.maxZoom||this.options.minZoom!==void 0&&C1){this._setView(l,g);return}for(var Re=C.min.y;Re<=C.max.y;Re++)for(var Ke=C.min.x;Ke<=C.max.x;Ke++){var hr=new D(Ke,Re);if(hr.z=this._tileZoom,!!this._isValidTile(hr)){var Pn=this._tiles[this._tileCoordsToKey(hr)];Pn?Pn.current=!0:A.push(hr)}}if(A.sort(function(Ir,ic){return Ir.distanceTo(T)-ic.distanceTo(T)}),A.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var $o=document.createDocumentFragment();for(Ke=0;Keg.max.x)||!d.wrapLat&&(l.yg.max.y))return!1}if(!this.options.bounds)return!0;var x=this._tileCoordsToBounds(l);return ie(this.options.bounds).overlaps(x)},_keyToBounds:function(l){return this._tileCoordsToBounds(this._keyToTileCoords(l))},_tileCoordsToNwSe:function(l){var d=this._map,g=this.getTileSize(),x=l.scaleBy(g),C=x.add(g),T=d.unproject(x,l.z),A=d.unproject(C,l.z);return[T,A]},_tileCoordsToBounds:function(l){var d=this._tileCoordsToNwSe(l),g=new fe(d[0],d[1]);return this.options.noWrap||(g=this._map.wrapLatLngBounds(g)),g},_tileCoordsToKey:function(l){return l.x+":"+l.y+":"+l.z},_keyToTileCoords:function(l){var d=l.split(":"),g=new D(+d[0],+d[1]);return g.z=+d[2],g},_removeTile:function(l){var d=this._tiles[l];d&&(ut(d.el),delete this._tiles[l],this.fire("tileunload",{tile:d.el,coords:this._keyToTileCoords(l)}))},_initTile:function(l){We(l,"leaflet-tile");var d=this.getTileSize();l.style.width=d.x+"px",l.style.height=d.y+"px",l.onselectstart=h,l.onmousemove=h,Oe.ielt9&&this.options.opacity<1&&ko(l,this.options.opacity)},_addTile:function(l,d){var g=this._getTilePos(l),x=this._tileCoordsToKey(l),C=this.createTile(this._wrapCoords(l),s(this._tileReady,this,l));this._initTile(C),this.createTile.length<2&&G(s(this._tileReady,this,l,null,C)),sn(C,g),this._tiles[x]={el:C,coords:l,current:!0},d.appendChild(C),this.fire("tileloadstart",{tile:C,coords:l})},_tileReady:function(l,d,g){d&&this.fire("tileerror",{error:d,tile:g,coords:l});var x=this._tileCoordsToKey(l);g=this._tiles[x],g&&(g.loaded=+new Date,this._map._fadeAnimated?(ko(g.el,0),Q(this._fadeFrame),this._fadeFrame=G(this._updateOpacity,this)):(g.active=!0,this._pruneTiles()),d||(We(g.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:g.el,coords:l})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Oe.ielt9||!this._map._fadeAnimated?G(this._pruneTiles,this):setTimeout(s(this._pruneTiles,this),250)))},_getTilePos:function(l){return l.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(l){var d=new D(this._wrapX?f(l.x,this._wrapX):l.x,this._wrapY?f(l.y,this._wrapY):l.y);return d.z=l.z,d},_pxBoundsToTileRange:function(l){var d=this.getTileSize();return new K(l.min.unscaleBy(d).floor(),l.max.unscaleBy(d).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var l in this._tiles)if(!this._tiles[l].loaded)return!1;return!0}});function lW(l){return new Yu(l)}var oc=Yu.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(l,d){this._url=l,d=w(this,d),d.detectRetina&&Oe.retina&&d.maxZoom>0?(d.tileSize=Math.floor(d.tileSize/2),d.zoomReverse?(d.zoomOffset--,d.minZoom=Math.min(d.maxZoom,d.minZoom+1)):(d.zoomOffset++,d.maxZoom=Math.max(d.minZoom,d.maxZoom-1)),d.minZoom=Math.max(0,d.minZoom)):d.zoomReverse?d.minZoom=Math.min(d.maxZoom,d.minZoom):d.maxZoom=Math.max(d.minZoom,d.maxZoom),typeof d.subdomains=="string"&&(d.subdomains=d.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(l,d){return this._url===l&&d===void 0&&(d=!0),this._url=l,d||this.redraw(),this},createTile:function(l,d){var g=document.createElement("img");return Ae(g,"load",s(this._tileOnLoad,this,d,g)),Ae(g,"error",s(this._tileOnError,this,d,g)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(g.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(g.referrerPolicy=this.options.referrerPolicy),g.alt="",g.src=this.getTileUrl(l),g},getTileUrl:function(l){var d={r:Oe.retina?"@2x":"",s:this._getSubdomain(l),x:l.x,y:l.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var g=this._globalTileRange.max.y-l.y;this.options.tms&&(d.y=g),d["-y"]=g}return S(this._url,o(d,this.options))},_tileOnLoad:function(l,d){Oe.ielt9?setTimeout(s(l,this,null,d),0):l(null,d)},_tileOnError:function(l,d,g){var x=this.options.errorTileUrl;x&&d.getAttribute("src")!==x&&(d.src=x),l(g,d)},_onTileRemove:function(l){l.tile.onload=null},_getZoomForUrl:function(){var l=this._tileZoom,d=this.options.maxZoom,g=this.options.zoomReverse,x=this.options.zoomOffset;return g&&(l=d-l),l+x},_getSubdomain:function(l){var d=Math.abs(l.x+l.y)%this.options.subdomains.length;return this.options.subdomains[d]},_abortLoading:function(){var l,d;for(l in this._tiles)if(this._tiles[l].coords.z!==this._tileZoom&&(d=this._tiles[l].el,d.onload=h,d.onerror=h,!d.complete)){d.src=$;var g=this._tiles[l].coords;ut(d),delete this._tiles[l],this.fire("tileabort",{tile:d,coords:g})}},_removeTile:function(l){var d=this._tiles[l];if(d)return d.el.setAttribute("src",$),Yu.prototype._removeTile.call(this,l)},_tileReady:function(l,d,g){if(!(!this._map||g&&g.getAttribute("src")===$))return Yu.prototype._tileReady.call(this,l,d,g)}});function WC(l,d){return new oc(l,d)}var UC=oc.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(l,d){this._url=l;var g=o({},this.defaultWmsParams);for(var x in d)x in this.options||(g[x]=d[x]);d=w(this,d);var C=d.detectRetina&&Oe.retina?2:1,T=this.getTileSize();g.width=T.x*C,g.height=T.y*C,this.wmsParams=g},onAdd:function(l){this._crs=this.options.crs||l.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var d=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[d]=this._crs.code,oc.prototype.onAdd.call(this,l)},getTileUrl:function(l){var d=this._tileCoordsToNwSe(l),g=this._crs,x=ee(g.project(d[0]),g.project(d[1])),C=x.min,T=x.max,A=(this._wmsVersion>=1.3&&this._crs===RC?[C.y,C.x,T.y,T.x]:[C.x,C.y,T.x,T.y]).join(","),q=oc.prototype.getTileUrl.call(this,l);return q+P(this.wmsParams,q,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+A},setParams:function(l,d){return o(this.wmsParams,l),d||this.redraw(),this}});function cW(l,d){return new UC(l,d)}oc.WMS=UC,WC.wms=cW;var Ji=Zo.extend({options:{padding:.1},initialize:function(l){w(this,l),c(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),We(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var l={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(l.zoomanim=this._onAnimZoom),l},_onAnimZoom:function(l){this._updateTransform(l.center,l.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(l,d){var g=this._map.getZoomScale(d,this._zoom),x=this._map.getSize().multiplyBy(.5+this.options.padding),C=this._map.project(this._center,d),T=x.multiplyBy(-g).add(C).subtract(this._map._getNewPixelOrigin(l,d));Oe.any3d?Ga(this._container,T,g):sn(this._container,T)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var l in this._layers)this._layers[l]._reset()},_onZoomEnd:function(){for(var l in this._layers)this._layers[l]._project()},_updatePaths:function(){for(var l in this._layers)this._layers[l]._update()},_update:function(){var l=this.options.padding,d=this._map.getSize(),g=this._map.containerPointToLayerPoint(d.multiplyBy(-l)).round();this._bounds=new K(g,g.add(d.multiplyBy(1+l*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),ZC=Ji.extend({options:{tolerance:0},getEvents:function(){var l=Ji.prototype.getEvents.call(this);return l.viewprereset=this._onViewPreReset,l},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Ji.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var l=this._container=document.createElement("canvas");Ae(l,"mousemove",this._onMouseMove,this),Ae(l,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Ae(l,"mouseout",this._handleMouseOut,this),l._leaflet_disable_events=!0,this._ctx=l.getContext("2d")},_destroyContainer:function(){Q(this._redrawRequest),delete this._ctx,ut(this._container),St(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var l;this._redrawBounds=null;for(var d in this._layers)l=this._layers[d],l._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Ji.prototype._update.call(this);var l=this._bounds,d=this._container,g=l.getSize(),x=Oe.retina?2:1;sn(d,l.min),d.width=x*g.x,d.height=x*g.y,d.style.width=g.x+"px",d.style.height=g.y+"px",Oe.retina&&this._ctx.scale(2,2),this._ctx.translate(-l.min.x,-l.min.y),this.fire("update")}},_reset:function(){Ji.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(l){this._updateDashArray(l),this._layers[c(l)]=l;var d=l._order={layer:l,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=d),this._drawLast=d,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(l){this._requestRedraw(l)},_removePath:function(l){var d=l._order,g=d.next,x=d.prev;g?g.prev=x:this._drawLast=x,x?x.next=g:this._drawFirst=g,delete l._order,delete this._layers[c(l)],this._requestRedraw(l)},_updatePath:function(l){this._extendRedrawBounds(l),l._project(),l._update(),this._requestRedraw(l)},_updateStyle:function(l){this._updateDashArray(l),this._requestRedraw(l)},_updateDashArray:function(l){if(typeof l.options.dashArray=="string"){var d=l.options.dashArray.split(/[, ]+/),g=[],x,C;for(C=0;C')}}catch{}return function(l){return document.createElement("<"+l+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),uW={_initContainer:function(){this._container=Fe("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Ji.prototype._update.call(this),this.fire("update"))},_initPath:function(l){var d=l._container=Ku("shape");We(d,"leaflet-vml-shape "+(this.options.className||"")),d.coordsize="1 1",l._path=Ku("path"),d.appendChild(l._path),this._updateStyle(l),this._layers[c(l)]=l},_addPath:function(l){var d=l._container;this._container.appendChild(d),l.options.interactive&&l.addInteractiveTarget(d)},_removePath:function(l){var d=l._container;ut(d),l.removeInteractiveTarget(d),delete this._layers[c(l)]},_updateStyle:function(l){var d=l._stroke,g=l._fill,x=l.options,C=l._container;C.stroked=!!x.stroke,C.filled=!!x.fill,x.stroke?(d||(d=l._stroke=Ku("stroke")),C.appendChild(d),d.weight=x.weight+"px",d.color=x.color,d.opacity=x.opacity,x.dashArray?d.dashStyle=O(x.dashArray)?x.dashArray.join(" "):x.dashArray.replace(/( *, *)/g," "):d.dashStyle="",d.endcap=x.lineCap.replace("butt","flat"),d.joinstyle=x.lineJoin):d&&(C.removeChild(d),l._stroke=null),x.fill?(g||(g=l._fill=Ku("fill")),C.appendChild(g),g.color=x.fillColor||x.color,g.opacity=x.fillOpacity):g&&(C.removeChild(g),l._fill=null)},_updateCircle:function(l){var d=l._point.round(),g=Math.round(l._radius),x=Math.round(l._radiusY||g);this._setPath(l,l._empty()?"M0 0":"AL "+d.x+","+d.y+" "+g+","+x+" 0,"+65535*360)},_setPath:function(l,d){l._path.v=d},_bringToFront:function(l){Co(l._container)},_bringToBack:function(l){Tr(l._container)}},Ph=Oe.vml?Ku:bt,qu=Ji.extend({_initContainer:function(){this._container=Ph("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Ph("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ut(this._container),St(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Ji.prototype._update.call(this);var l=this._bounds,d=l.getSize(),g=this._container;(!this._svgSize||!this._svgSize.equals(d))&&(this._svgSize=d,g.setAttribute("width",d.x),g.setAttribute("height",d.y)),sn(g,l.min),g.setAttribute("viewBox",[l.min.x,l.min.y,d.x,d.y].join(" ")),this.fire("update")}},_initPath:function(l){var d=l._path=Ph("path");l.options.className&&We(d,l.options.className),l.options.interactive&&We(d,"leaflet-interactive"),this._updateStyle(l),this._layers[c(l)]=l},_addPath:function(l){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(l._path),l.addInteractiveTarget(l._path)},_removePath:function(l){ut(l._path),l.removeInteractiveTarget(l._path),delete this._layers[c(l)]},_updatePath:function(l){l._project(),l._update()},_updateStyle:function(l){var d=l._path,g=l.options;d&&(g.stroke?(d.setAttribute("stroke",g.color),d.setAttribute("stroke-opacity",g.opacity),d.setAttribute("stroke-width",g.weight),d.setAttribute("stroke-linecap",g.lineCap),d.setAttribute("stroke-linejoin",g.lineJoin),g.dashArray?d.setAttribute("stroke-dasharray",g.dashArray):d.removeAttribute("stroke-dasharray"),g.dashOffset?d.setAttribute("stroke-dashoffset",g.dashOffset):d.removeAttribute("stroke-dashoffset")):d.setAttribute("stroke","none"),g.fill?(d.setAttribute("fill",g.fillColor||g.color),d.setAttribute("fill-opacity",g.fillOpacity),d.setAttribute("fill-rule",g.fillRule||"evenodd")):d.setAttribute("fill","none"))},_updatePoly:function(l,d){this._setPath(l,wn(l._parts,d))},_updateCircle:function(l){var d=l._point,g=Math.max(Math.round(l._radius),1),x=Math.max(Math.round(l._radiusY),1)||g,C="a"+g+","+x+" 0 1,0 ",T=l._empty()?"M0 0":"M"+(d.x-g)+","+d.y+C+g*2+",0 "+C+-g*2+",0 ";this._setPath(l,T)},_setPath:function(l,d){l._path.setAttribute("d",d)},_bringToFront:function(l){Co(l._path)},_bringToBack:function(l){Tr(l._path)}});Oe.vml&&qu.include(uW);function YC(l){return Oe.svg||Oe.vml?new qu(l):null}rt.include({getRenderer:function(l){var d=l.options.renderer||this._getPaneRenderer(l.options.pane)||this.options.renderer||this._renderer;return d||(d=this._renderer=this._createRenderer()),this.hasLayer(d)||this.addLayer(d),d},_getPaneRenderer:function(l){if(l==="overlayPane"||l===void 0)return!1;var d=this._paneRenderers[l];return d===void 0&&(d=this._createRenderer({pane:l}),this._paneRenderers[l]=d),d},_createRenderer:function(l){return this.options.preferCanvas&&GC(l)||YC(l)}});var KC=nc.extend({initialize:function(l,d){nc.prototype.initialize.call(this,this._boundsToLatLngs(l),d)},setBounds:function(l){return this.setLatLngs(this._boundsToLatLngs(l))},_boundsToLatLngs:function(l){return l=ie(l),[l.getSouthWest(),l.getNorthWest(),l.getNorthEast(),l.getSouthEast()]}});function dW(l,d){return new KC(l,d)}qu.create=Ph,qu.pointsToPath=wn,qi.geometryToLayer=vh,qi.coordsToLatLng=n_,qi.coordsToLatLngs=yh,qi.latLngToCoords=r_,qi.latLngsToCoords=_h,qi.getFeature=rc,qi.asFeature=wh,rt.mergeOptions({boxZoom:!0});var qC=fi.extend({initialize:function(l){this._map=l,this._container=l._container,this._pane=l._panes.overlayPane,this._resetStateTimeout=0,l.on("unload",this._destroy,this)},addHooks:function(){Ae(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){St(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ut(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(l){if(!l.shiftKey||l.which!==1&&l.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),Fu(),A1(),this._startPoint=this._map.mouseEventToContainerPoint(l),Ae(document,{contextmenu:qa,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(l){this._moved||(this._moved=!0,this._box=Fe("div","leaflet-zoom-box",this._container),We(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(l);var d=new K(this._point,this._startPoint),g=d.getSize();sn(this._box,d.min),this._box.style.width=g.x+"px",this._box.style.height=g.y+"px"},_finish:function(){this._moved&&(ut(this._box),Qt(this._container,"leaflet-crosshair")),Vu(),B1(),St(document,{contextmenu:qa,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(l){if(!(l.which!==1&&l.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(s(this._resetState,this),0);var d=new fe(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(d).fire("boxzoomend",{boxZoomBounds:d})}},_onKeyDown:function(l){l.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});rt.addInitHook("addHandler","boxZoom",qC),rt.mergeOptions({doubleClickZoom:!0});var JC=fi.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(l){var d=this._map,g=d.getZoom(),x=d.options.zoomDelta,C=l.originalEvent.shiftKey?g-x:g+x;d.options.doubleClickZoom==="center"?d.setZoom(C):d.setZoomAround(l.containerPoint,C)}});rt.addInitHook("addHandler","doubleClickZoom",JC),rt.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var QC=fi.extend({addHooks:function(){if(!this._draggable){var l=this._map;this._draggable=new Is(l._mapPane,l._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),l.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),l.on("zoomend",this._onZoomEnd,this),l.whenReady(this._onZoomEnd,this))}We(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){Qt(this._map._container,"leaflet-grab"),Qt(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var l=this._map;if(l._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var d=ie(this._map.options.maxBounds);this._offsetLimit=ee(this._map.latLngToContainerPoint(d.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(d.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;l.fire("movestart").fire("dragstart"),l.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(l){if(this._map.options.inertia){var d=this._lastTime=+new Date,g=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(g),this._times.push(d),this._prunePositions(d)}this._map.fire("move",l).fire("drag",l)},_prunePositions:function(l){for(;this._positions.length>1&&l-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var l=this._map.getSize().divideBy(2),d=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=d.subtract(l).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(l,d){return l-(l-d)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var l=this._draggable._newPos.subtract(this._draggable._startPos),d=this._offsetLimit;l.xd.max.x&&(l.x=this._viscousLimit(l.x,d.max.x)),l.y>d.max.y&&(l.y=this._viscousLimit(l.y,d.max.y)),this._draggable._newPos=this._draggable._startPos.add(l)}},_onPreDragWrap:function(){var l=this._worldWidth,d=Math.round(l/2),g=this._initialWorldOffset,x=this._draggable._newPos.x,C=(x-d+g)%l+d-g,T=(x+d+g)%l-d-g,A=Math.abs(C+g)0?T:-T))-d;this._delta=0,this._startTime=null,A&&(l.options.scrollWheelZoom==="center"?l.setZoom(d+A):l.setZoomAround(this._lastMousePos,d+A))}});rt.addInitHook("addHandler","scrollWheelZoom",ek);var fW=600;rt.mergeOptions({tapHold:Oe.touchNative&&Oe.safari&&Oe.mobile,tapTolerance:15});var tk=fi.extend({addHooks:function(){Ae(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){St(this._map._container,"touchstart",this._onDown,this)},_onDown:function(l){if(clearTimeout(this._holdTimeout),l.touches.length===1){var d=l.touches[0];this._startPos=this._newPos=new D(d.clientX,d.clientY),this._holdTimeout=setTimeout(s(function(){this._cancel(),this._isTapValid()&&(Ae(document,"touchend",Dn),Ae(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",d))},this),fW),Ae(document,"touchend touchcancel contextmenu",this._cancel,this),Ae(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function l(){St(document,"touchend",Dn),St(document,"touchend touchcancel",l)},_cancel:function(){clearTimeout(this._holdTimeout),St(document,"touchend touchcancel contextmenu",this._cancel,this),St(document,"touchmove",this._onMove,this)},_onMove:function(l){var d=l.touches[0];this._newPos=new D(d.clientX,d.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(l,d){var g=new MouseEvent(l,{bubbles:!0,cancelable:!0,view:window,screenX:d.screenX,screenY:d.screenY,clientX:d.clientX,clientY:d.clientY});g._simulated=!0,d.target.dispatchEvent(g)}});rt.addInitHook("addHandler","tapHold",tk),rt.mergeOptions({touchZoom:Oe.touch,bounceAtZoomLimits:!0});var nk=fi.extend({addHooks:function(){We(this._map._container,"leaflet-touch-zoom"),Ae(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){Qt(this._map._container,"leaflet-touch-zoom"),St(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(l){var d=this._map;if(!(!l.touches||l.touches.length!==2||d._animatingZoom||this._zooming)){var g=d.mouseEventToContainerPoint(l.touches[0]),x=d.mouseEventToContainerPoint(l.touches[1]);this._centerPoint=d.getSize()._divideBy(2),this._startLatLng=d.containerPointToLatLng(this._centerPoint),d.options.touchZoom!=="center"&&(this._pinchStartLatLng=d.containerPointToLatLng(g.add(x)._divideBy(2))),this._startDist=g.distanceTo(x),this._startZoom=d.getZoom(),this._moved=!1,this._zooming=!0,d._stop(),Ae(document,"touchmove",this._onTouchMove,this),Ae(document,"touchend touchcancel",this._onTouchEnd,this),Dn(l)}},_onTouchMove:function(l){if(!(!l.touches||l.touches.length!==2||!this._zooming)){var d=this._map,g=d.mouseEventToContainerPoint(l.touches[0]),x=d.mouseEventToContainerPoint(l.touches[1]),C=g.distanceTo(x)/this._startDist;if(this._zoom=d.getScaleZoom(C,this._startZoom),!d.options.bounceAtZoomLimits&&(this._zoomd.getMaxZoom()&&C>1)&&(this._zoom=d._limitZoom(this._zoom)),d.options.touchZoom==="center"){if(this._center=this._startLatLng,C===1)return}else{var T=g._add(x)._divideBy(2)._subtract(this._centerPoint);if(C===1&&T.x===0&&T.y===0)return;this._center=d.unproject(d.project(this._pinchStartLatLng,this._zoom).subtract(T),this._zoom)}this._moved||(d._moveStart(!0,!1),this._moved=!0),Q(this._animRequest);var A=s(d._move,d,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=G(A,this,!0),Dn(l)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,Q(this._animRequest),St(document,"touchmove",this._onTouchMove,this),St(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});rt.addInitHook("addHandler","touchZoom",nk),rt.BoxZoom=qC,rt.DoubleClickZoom=JC,rt.Drag=QC,rt.Keyboard=XC,rt.ScrollWheelZoom=ek,rt.TapHold=tk,rt.TouchZoom=nk,n.Bounds=K,n.Browser=Oe,n.CRS=le,n.Canvas=ZC,n.Circle=t_,n.CircleMarker=gh,n.Class=V,n.Control=Uo,n.DivIcon=HC,n.DivOverlay=hi,n.DomEvent=MH,n.DomUtil=EH,n.Draggable=Is,n.Evented=Y,n.FeatureGroup=Yi,n.GeoJSON=qi,n.GridLayer=Yu,n.Handler=fi,n.Icon=tc,n.ImageOverlay=bh,n.LatLng=J,n.LatLngBounds=fe,n.Layer=Zo,n.LayerGroup=ec,n.LineUtil=HH,n.Map=rt,n.Marker=mh,n.Mixin=RH,n.Path=Ds,n.Point=D,n.PolyUtil=zH,n.Polygon=nc,n.Polyline=Ki,n.Popup=xh,n.PosAnimation=OC,n.Projection=WH,n.Rectangle=KC,n.Renderer=Ji,n.SVG=qu,n.SVGOverlay=VC,n.TileLayer=oc,n.Tooltip=Sh,n.Transformation=He,n.Util=X,n.VideoOverlay=FC,n.bind=s,n.bounds=ee,n.canvas=GC,n.circle=QH,n.circleMarker=JH,n.control=Uu,n.divIcon=aW,n.extend=o,n.featureGroup=YH,n.geoJSON=BC,n.geoJson=tW,n.gridLayer=lW,n.icon=KH,n.imageOverlay=nW,n.latLng=ne,n.latLngBounds=ie,n.layerGroup=GH,n.map=NH,n.marker=qH,n.point=F,n.polygon=eW,n.polyline=XH,n.popup=iW,n.rectangle=dW,n.setOptions=w,n.stamp=c,n.svg=YC,n.svgOverlay=oW,n.tileLayer=WC,n.tooltip=sW,n.transformation=Te,n.version=r,n.videoOverlay=rW;var hW=window.L;n.noConflict=function(){return window.L=hW,this},window.L=n})})(tS,tS.exports);var y1=tS.exports;const Pi=Ta(y1);function oV(e,t){const n=_.useRef(t);_.useEffect(function(){t!==n.current&&e.attributionControl!=null&&(n.current!=null&&e.attributionControl.removeAttribution(n.current),t!=null&&e.attributionControl.addAttribution(t)),n.current=t},[e,t])}const YMe=1;function KMe(e){return Object.freeze({__version:YMe,map:e})}function qMe(e,t){return Object.freeze({...e,...t})}const iV=_.createContext(null),sV=iV.Provider;function QO(){const e=_.useContext(iV);if(e==null)throw new Error("No context provided: useLeafletContext() can only be used in a descendant of ");return e}function JMe(e){function t(n,r){const{instance:o,context:i}=e(n).current;return _.useImperativeHandle(r,()=>o),n.children==null?null:k.createElement(sV,{value:i},n.children)}return _.forwardRef(t)}function QMe(e){function t(n,r){const[o,i]=_.useState(!1),{instance:s}=e(n,i).current;_.useImperativeHandle(r,()=>s),_.useEffect(function(){o&&s.update()},[s,o,n.children]);const a=s._contentNode;return a?Cs.createPortal(n.children,a):null}return _.forwardRef(t)}function aV(e,t){const n=_.useRef();_.useEffect(function(){return t!=null&&e.instance.on(t),n.current=t,function(){n.current!=null&&e.instance.off(n.current),n.current=null}},[e,t])}function lV(e,t){const n=e.pane??t.pane;return n?{...e,pane:n}:e}function XMe(e,t){return function(r,o){const i=QO(),s=e(lV(r,i),i);return oV(i.map,r.attribution),aV(s.current,r.eventHandlers),t(s.current,i,r,o),s}}function cV(e,t,n){return Object.freeze({instance:e,context:t,container:n})}function uV(e,t){return t==null?function(r,o){const i=_.useRef();return i.current||(i.current=e(r,o)),i}:function(r,o){const i=_.useRef();i.current||(i.current=e(r,o));const s=_.useRef(r),{instance:a}=i.current;return _.useEffect(function(){s.current!==r&&(t(a,r,s.current),s.current=r)},[a,r,o]),i}}function eNe(e,t){_.useEffect(function(){return(t.layerContainer??t.map).addLayer(e.instance),function(){t.layerContainer?.removeLayer(e.instance),t.map.removeLayer(e.instance)}},[t,e])}function tNe(e){return function(n){const r=QO(),o=e(lV(n,r),r);return oV(r.map,n.attribution),aV(o.current,n.eventHandlers),eNe(o.current,r),o}}function nNe(e,t){const n=uV(e,t),r=tNe(n);return JMe(r)}function rNe(e,t){const n=uV(e),r=XMe(n,t);return QMe(r)}function oNe(){return QO().map}function nS(){return nS=Object.assign||function(e){for(var t=1;tv?.map??null,[v]);const w=_.useCallback(b=>{if(b!==null&&v===null){const S=new y1.Map(b,f);n!=null&&u!=null?S.setView(n,u):e!=null&&S.fitBounds(e,t),c!=null&&S.whenReady(c),y(KMe(S))}},[]);_.useEffect(()=>()=>{v?.map.remove()},[v]);const P=v?k.createElement(sV,{value:v},r):s??null;return k.createElement("div",nS({},m,{ref:w}),P)}const sNe=_.forwardRef(iNe),dV=nNe(function({position:t,...n},r){const o=new y1.Marker(t,n);return cV(o,qMe(r,{overlayContainer:o}))},function(t,n,r){n.position!==r.position&&t.setLatLng(n.position),n.icon!=null&&n.icon!==r.icon&&t.setIcon(n.icon),n.zIndexOffset!=null&&n.zIndexOffset!==r.zIndexOffset&&t.setZIndexOffset(n.zIndexOffset),n.opacity!=null&&n.opacity!==r.opacity&&t.setOpacity(n.opacity),t.dragging!=null&&n.draggable!==r.draggable&&(n.draggable===!0?t.dragging.enable():t.dragging.disable())}),aNe=rNe(function(t,n){const r=new y1.Popup(t,n.overlayContainer);return cV(r,n)},function(t,n,{position:r},o){_.useEffect(function(){const{instance:s}=t;function a(u){u.popup===s&&(s.update(),o(!0))}function c(u){u.popup===s&&o(!1)}return n.map.on({popupopen:a,popupclose:c}),n.overlayContainer==null?(r!=null&&s.setLatLng(r),s.openOn(n.map)):n.overlayContainer.bindPopup(s),function(){n.map.off({popupopen:a,popupclose:c}),n.overlayContainer?.unbindPopup(),n.map.removeLayer(s)}},[t,n,o,r])}),lNe=e=>{const t=oNe(),n=Pi.tileLayer(`https://s.rsg.sc/sc/images/games/GTAV/map/${e.mapLayer}/{z}/{x}/{y}.jpg`,{maxZoom:7,minZoom:2,bounds:Pi.latLngBounds(Pi.latLng(0,128),Pi.latLng(-192,0))}),r=Pi.latLngBounds(Pi.latLng(0,128),Pi.latLng(-192,0));return t.setMaxBounds(r),t.attributionControl.setPrefix(!1),t.setView([0,0],2),t.addLayer(n),null};var zu={};/** + */(function(e,t){(function(n,r){r(t)})(hS,function(n){var r="1.9.4";function o(l){var d,g,x,C;for(g=1,x=arguments.length;g"u"||!L||!L.Mixin)){l=O(l)?l:[l];for(var d=0;d0?Math.floor(l):Math.ceil(l)};j.prototype={clone:function(){return new j(this.x,this.y)},add:function(l){return this.clone()._add(F(l))},_add:function(l){return this.x+=l.x,this.y+=l.y,this},subtract:function(l){return this.clone()._subtract(F(l))},_subtract:function(l){return this.x-=l.x,this.y-=l.y,this},divideBy:function(l){return this.clone()._divideBy(l)},_divideBy:function(l){return this.x/=l,this.y/=l,this},multiplyBy:function(l){return this.clone()._multiplyBy(l)},_multiplyBy:function(l){return this.x*=l,this.y*=l,this},scaleBy:function(l){return new j(this.x*l.x,this.y*l.y)},unscaleBy:function(l){return new j(this.x/l.x,this.y/l.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=W(this.x),this.y=W(this.y),this},distanceTo:function(l){l=F(l);var d=l.x-this.x,g=l.y-this.y;return Math.sqrt(d*d+g*g)},equals:function(l){return l=F(l),l.x===this.x&&l.y===this.y},contains:function(l){return l=F(l),Math.abs(l.x)<=Math.abs(this.x)&&Math.abs(l.y)<=Math.abs(this.y)},toString:function(){return"Point("+m(this.x)+", "+m(this.y)+")"}};function F(l,d,g){return l instanceof j?l:O(l)?new j(l[0],l[1]):l==null?l:typeof l=="object"&&"x"in l&&"y"in l?new j(l.x,l.y):new j(l,d,g)}function K(l,d){if(l)for(var g=d?[l,d]:l,x=0,C=g.length;x=this.min.x&&g.x<=this.max.x&&d.y>=this.min.y&&g.y<=this.max.y},intersects:function(l){l=ee(l);var d=this.min,g=this.max,x=l.min,C=l.max,T=C.x>=d.x&&x.x<=g.x,A=C.y>=d.y&&x.y<=g.y;return T&&A},overlaps:function(l){l=ee(l);var d=this.min,g=this.max,x=l.min,C=l.max,T=C.x>d.x&&x.xd.y&&x.y=d.lat&&C.lat<=g.lat&&x.lng>=d.lng&&C.lng<=g.lng},intersects:function(l){l=ie(l);var d=this._southWest,g=this._northEast,x=l.getSouthWest(),C=l.getNorthEast(),T=C.lat>=d.lat&&x.lat<=g.lat,A=C.lng>=d.lng&&x.lng<=g.lng;return T&&A},overlaps:function(l){l=ie(l);var d=this._southWest,g=this._northEast,x=l.getSouthWest(),C=l.getNorthEast(),T=C.lat>d.lat&&x.latd.lng&&x.lng1,Gt=function(){var l=!1;try{var d=Object.defineProperty({},"passive",{get:function(){l=!0}});window.addEventListener("testPassiveEventSupport",h,d),window.removeEventListener("testPassiveEventSupport",h,d)}catch{}return l}(),to=function(){return!!document.createElement("canvas").getContext}(),Oo=!!(document.createElementNS&&bt("svg").createSVGRect),ur=!!Oo&&function(){var l=document.createElement("div");return l.innerHTML="",(l.firstChild&&l.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),dr=!Oo&&function(){try{var l=document.createElement("div");l.innerHTML='';var d=l.firstChild;return d.style.behavior="url(#default#VML)",d&&typeof d.adj=="object"}catch{return!1}}(),Ui=navigator.platform.indexOf("Mac")===0,Ts=navigator.platform.indexOf("Linux")===0;function fr(l){return navigator.userAgent.toLowerCase().indexOf(l)>=0}var Oe={ie:In,ielt9:Er,edge:lt,webkit:Yn,android:Jt,android23:pt,androidStock:Jr,opera:cr,chrome:Qr,gecko:Bt,safari:Xr,phantom:hn,opera12:bn,win:$r,ie3d:gt,webkit3d:be,gecko3d:Re,any3d:eo,mobile:Rt,mobileWebkit:Zt,mobileWebkit3d:Mr,msPointer:xt,pointer:nn,touch:Ha,touchNative:Kn,mobileOpera:qn,mobileGecko:xn,retina:Ft,passiveEvents:Gt,canvas:to,svg:Oo,vml:dr,inlineSvg:ur,mac:Ui,linux:Ts},Wa=Oe.msPointer?"MSPointerDown":"pointerdown",Ql=Oe.msPointer?"MSPointerMove":"pointermove",Ua=Oe.msPointer?"MSPointerUp":"pointerup",Se=Oe.msPointer?"MSPointerCancel":"pointercancel",ct={touchstart:Wa,touchmove:Ql,touchend:Ua,touchcancel:Se},rn={touchstart:Xl,touchmove:Za,touchend:Za,touchcancel:Za},ze={},Zi=!1;function no(l,d,g){return d==="touchstart"&&Gi(),rn[d]?(g=rn[d].bind(this,g),l.addEventListener(ct[d],g,!1),g):(console.warn("wrong event specified:",d),h)}function ch(l,d,g){if(!ct[d]){console.warn("wrong event specified:",d);return}l.removeEventListener(ct[d],g,!1)}function M1(l){ze[l.pointerId]=l}function N1(l){ze[l.pointerId]&&(ze[l.pointerId]=l)}function on(l){delete ze[l.pointerId]}function Gi(){Zi||(document.addEventListener(Wa,M1,!0),document.addEventListener(Ql,N1,!0),document.addEventListener(Ua,on,!0),document.addEventListener(Se,on,!0),Zi=!0)}function Za(l,d){if(d.pointerType!==(d.MSPOINTER_TYPE_MOUSE||"mouse")){d.touches=[];for(var g in ze)d.touches.push(ze[g]);d.changedTouches=[d],l(d)}}function Xl(l,d){d.MSPOINTER_TYPE_TOUCH&&d.pointerType===d.MSPOINTER_TYPE_TOUCH&&jn(d),Za(l,d)}function T1(l){var d={},g,x;for(x in l)g=l[x],d[x]=g&&g.bind?g.bind(l):g;return l=d,d.type="dblclick",d.detail=2,d.isTrusted=!1,d._simulated=!0,d}var I1=200;function j1(l,d){l.addEventListener("dblclick",d);var g=0,x;function C(T){if(T.detail!==1){x=T.detail;return}if(!(T.pointerType==="mouse"||T.sourceCapabilities&&!T.sourceCapabilities.firesTouchEvents)){var A=xC(T);if(!(A.some(function(te){return te instanceof HTMLLabelElement&&te.attributes.for})&&!A.some(function(te){return te instanceof HTMLInputElement||te instanceof HTMLSelectElement}))){var q=Date.now();q-g<=I1?(x++,x===2&&d(T1(T))):x=1,g=q}}}return l.addEventListener("click",C),{dblclick:d,simDblclick:C}}function D1(l,d){l.removeEventListener("dblclick",d.dblclick),l.removeEventListener("click",d.simDblclick)}var Bu=dh(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),ui=dh(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),Ie=ui==="webkitTransition"||ui==="OTransition"?ui+"End":"transitionend";function vt(l){return typeof l=="string"?document.getElementById(l):l}function Sn(l,d){var g=l.style[d]||l.currentStyle&&l.currentStyle[d];if((!g||g==="auto")&&document.defaultView){var x=document.defaultView.getComputedStyle(l,null);g=x?x[d]:null}return g==="auto"?null:g}function Fe(l,d,g){var x=document.createElement(l);return x.className=d||"",g&&g.appendChild(x),x}function ut(l){var d=l.parentNode;d&&d.removeChild(l)}function Nr(l){for(;l.firstChild;)l.removeChild(l.firstChild)}function Co(l){var d=l.parentNode;d&&d.lastChild!==l&&d.appendChild(l)}function Tr(l){var d=l.parentNode;d&&d.firstChild!==l&&d.insertBefore(l,d.firstChild)}function R1(l,d){if(l.classList!==void 0)return l.classList.contains(d);var g=uh(l);return g.length>0&&new RegExp("(^|\\s)"+d+"(\\s|$)").test(g)}function We(l,d){if(l.classList!==void 0)for(var g=y(d),x=0,C=g.length;x0?2*window.devicePixelRatio:1;function PC(l){return Oe.edge?l.wheelDeltaY/2:l.deltaY&&l.deltaMode===0?-l.deltaY/$H:l.deltaY&&l.deltaMode===1?-l.deltaY*20:l.deltaY&&l.deltaMode===2?-l.deltaY*60:l.deltaX||l.deltaZ?0:l.wheelDelta?(l.wheelDeltaY||l.wheelDelta)/2:l.detail&&Math.abs(l.detail)<32765?-l.detail*20:l.detail?l.detail/-32765*60:0}function Y1(l,d){var g=d.relatedTarget;if(!g)return!0;try{for(;g&&g!==l;)g=g.parentNode}catch{return!1}return g!==l}var MH={__proto__:null,on:Ae,off:St,stopPropagation:Ka,disableScrollPropagation:G1,disableClickPropagation:Wu,preventDefault:jn,stop:qa,getPropagationPath:xC,getMousePosition:SC,getWheelDelta:PC,isExternalTarget:Y1,addListener:Ae,removeListener:St},OC=Y.extend({run:function(l,d,g,x){this.stop(),this._el=l,this._inProgress=!0,this._duration=g||.25,this._easeOutPower=1/Math.max(x||.5,.2),this._startPos=Ya(l),this._offset=d.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=G(this._animate,this),this._step()},_step:function(l){var d=+new Date-this._startTime,g=this._duration*1e3;dthis.options.maxZoom)?this.setZoom(l):this},panInsideBounds:function(l,d){this._enforcingBounds=!0;var g=this.getCenter(),x=this._limitCenter(g,this._zoom,ie(l));return g.equals(x)||this.panTo(x,d),this._enforcingBounds=!1,this},panInside:function(l,d){d=d||{};var g=F(d.paddingTopLeft||d.padding||[0,0]),x=F(d.paddingBottomRight||d.padding||[0,0]),C=this.project(this.getCenter()),T=this.project(l),A=this.getPixelBounds(),q=ee([A.min.add(g),A.max.subtract(x)]),te=q.getSize();if(!q.contains(T)){this._enforcingBounds=!0;var oe=T.subtract(q.getCenter()),ve=q.extend(T).getSize().subtract(te);C.x+=oe.x<0?-ve.x:ve.x,C.y+=oe.y<0?-ve.y:ve.y,this.panTo(this.unproject(C),d),this._enforcingBounds=!1}return this},invalidateSize:function(l){if(!this._loaded)return this;l=o({animate:!1,pan:!0},l===!0?{animate:!0}:l);var d=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var g=this.getSize(),x=d.divideBy(2).round(),C=g.divideBy(2).round(),T=x.subtract(C);return!T.x&&!T.y?this:(l.animate&&l.pan?this.panBy(T):(l.pan&&this._rawPanBy(T),this.fire("move"),l.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(s(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:d,newSize:g}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(l){if(l=this._locateOptions=o({timeout:1e4,watch:!1},l),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var d=s(this._handleGeolocationResponse,this),g=s(this._handleGeolocationError,this);return l.watch?this._locationWatchId=navigator.geolocation.watchPosition(d,g,l):navigator.geolocation.getCurrentPosition(d,g,l),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(l){if(this._container._leaflet_id){var d=l.code,g=l.message||(d===1?"permission denied":d===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:d,message:"Geolocation error: "+g+"."})}},_handleGeolocationResponse:function(l){if(this._container._leaflet_id){var d=l.coords.latitude,g=l.coords.longitude,x=new J(d,g),C=x.toBounds(l.coords.accuracy*2),T=this._locateOptions;if(T.setView){var A=this.getBoundsZoom(C);this.setView(x,T.maxZoom?Math.min(A,T.maxZoom):A)}var q={latlng:x,bounds:C,timestamp:l.timestamp};for(var te in l.coords)typeof l.coords[te]=="number"&&(q[te]=l.coords[te]);this.fire("locationfound",q)}},addHandler:function(l,d){if(!d)return this;var g=this[l]=new d(this);return this._handlers.push(g),this.options[l]&&g.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),ut(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(Q(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var l;for(l in this._layers)this._layers[l].remove();for(l in this._panes)ut(this._panes[l]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(l,d){var g="leaflet-pane"+(l?" leaflet-"+l.replace("Pane","")+"-pane":""),x=Fe("div",g,d||this._mapPane);return l&&(this._panes[l]=x),x},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var l=this.getPixelBounds(),d=this.unproject(l.getBottomLeft()),g=this.unproject(l.getTopRight());return new fe(d,g)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(l,d,g){l=ie(l),g=F(g||[0,0]);var x=this.getZoom()||0,C=this.getMinZoom(),T=this.getMaxZoom(),A=l.getNorthWest(),q=l.getSouthEast(),te=this.getSize().subtract(g),oe=ee(this.project(q,x),this.project(A,x)).getSize(),ve=Oe.any3d?this.options.zoomSnap:1,Le=te.x/oe.x,Ke=te.y/oe.y,hr=d?Math.max(Le,Ke):Math.min(Le,Ke);return x=this.getScaleZoom(hr,x),ve&&(x=Math.round(x/(ve/100))*(ve/100),x=d?Math.ceil(x/ve)*ve:Math.floor(x/ve)*ve),Math.max(C,Math.min(T,x))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new j(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(l,d){var g=this._getTopLeftPoint(l,d);return new K(g,g.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(l){return this.options.crs.getProjectedBounds(l===void 0?this.getZoom():l)},getPane:function(l){return typeof l=="string"?this._panes[l]:l},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(l,d){var g=this.options.crs;return d=d===void 0?this._zoom:d,g.scale(l)/g.scale(d)},getScaleZoom:function(l,d){var g=this.options.crs;d=d===void 0?this._zoom:d;var x=g.zoom(l*g.scale(d));return isNaN(x)?1/0:x},project:function(l,d){return d=d===void 0?this._zoom:d,this.options.crs.latLngToPoint(ne(l),d)},unproject:function(l,d){return d=d===void 0?this._zoom:d,this.options.crs.pointToLatLng(F(l),d)},layerPointToLatLng:function(l){var d=F(l).add(this.getPixelOrigin());return this.unproject(d)},latLngToLayerPoint:function(l){var d=this.project(ne(l))._round();return d._subtract(this.getPixelOrigin())},wrapLatLng:function(l){return this.options.crs.wrapLatLng(ne(l))},wrapLatLngBounds:function(l){return this.options.crs.wrapLatLngBounds(ie(l))},distance:function(l,d){return this.options.crs.distance(ne(l),ne(d))},containerPointToLayerPoint:function(l){return F(l).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(l){return F(l).add(this._getMapPanePos())},containerPointToLatLng:function(l){var d=this.containerPointToLayerPoint(F(l));return this.layerPointToLatLng(d)},latLngToContainerPoint:function(l){return this.layerPointToContainerPoint(this.latLngToLayerPoint(ne(l)))},mouseEventToContainerPoint:function(l){return SC(l,this._container)},mouseEventToLayerPoint:function(l){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(l))},mouseEventToLatLng:function(l){return this.layerPointToLatLng(this.mouseEventToLayerPoint(l))},_initContainer:function(l){var d=this._container=vt(l);if(d){if(d._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");Ae(d,"scroll",this._onScroll,this),this._containerId=c(d)},_initLayout:function(){var l=this._container;this._fadeAnimated=this.options.fadeAnimation&&Oe.any3d,We(l,"leaflet-container"+(Oe.touch?" leaflet-touch":"")+(Oe.retina?" leaflet-retina":"")+(Oe.ielt9?" leaflet-oldie":"")+(Oe.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var d=Sn(l,"position");d!=="absolute"&&d!=="relative"&&d!=="fixed"&&d!=="sticky"&&(l.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var l=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),sn(this._mapPane,new j(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(We(l.markerPane,"leaflet-zoom-hide"),We(l.shadowPane,"leaflet-zoom-hide"))},_resetView:function(l,d,g){sn(this._mapPane,new j(0,0));var x=!this._loaded;this._loaded=!0,d=this._limitZoom(d),this.fire("viewprereset");var C=this._zoom!==d;this._moveStart(C,g)._move(l,d)._moveEnd(C),this.fire("viewreset"),x&&this.fire("load")},_moveStart:function(l,d){return l&&this.fire("zoomstart"),d||this.fire("movestart"),this},_move:function(l,d,g,x){d===void 0&&(d=this._zoom);var C=this._zoom!==d;return this._zoom=d,this._lastCenter=l,this._pixelOrigin=this._getNewPixelOrigin(l),x?g&&g.pinch&&this.fire("zoom",g):((C||g&&g.pinch)&&this.fire("zoom",g),this.fire("move",g)),this},_moveEnd:function(l){return l&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return Q(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(l){sn(this._mapPane,this._getMapPanePos().subtract(l))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(l){this._targets={},this._targets[c(this._container)]=this;var d=l?St:Ae;d(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&d(window,"resize",this._onResize,this),Oe.any3d&&this.options.transform3DLimit&&(l?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){Q(this._resizeRequest),this._resizeRequest=G(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var l=this._getMapPanePos();Math.max(Math.abs(l.x),Math.abs(l.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(l,d){for(var g=[],x,C=d==="mouseout"||d==="mouseover",T=l.target||l.srcElement,A=!1;T;){if(x=this._targets[c(T)],x&&(d==="click"||d==="preclick")&&this._draggableMoved(x)){A=!0;break}if(x&&x.listens(d,!0)&&(C&&!Y1(T,l)||(g.push(x),C))||T===this._container)break;T=T.parentNode}return!g.length&&!A&&!C&&this.listens(d,!0)&&(g=[this]),g},_isClickDisabled:function(l){for(;l&&l!==this._container;){if(l._leaflet_disable_click)return!0;l=l.parentNode}},_handleDOMEvent:function(l){var d=l.target||l.srcElement;if(!(!this._loaded||d._leaflet_disable_events||l.type==="click"&&this._isClickDisabled(d))){var g=l.type;g==="mousedown"&&V1(d),this._fireDOMEvent(l,g)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(l,d,g){if(l.type==="click"){var x=o({},l);x.type="preclick",this._fireDOMEvent(x,x.type,g)}var C=this._findEventTargets(l,d);if(g){for(var T=[],A=0;A0?Math.round(l-d)/2:Math.max(0,Math.ceil(l))-Math.max(0,Math.floor(d))},_limitZoom:function(l){var d=this.getMinZoom(),g=this.getMaxZoom(),x=Oe.any3d?this.options.zoomSnap:1;return x&&(l=Math.round(l/x)*x),Math.max(d,Math.min(g,l))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){Qt(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(l,d){var g=this._getCenterOffset(l)._trunc();return(d&&d.animate)!==!0&&!this.getSize().contains(g)?!1:(this.panBy(g,d),!0)},_createAnimProxy:function(){var l=this._proxy=Fe("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(l),this.on("zoomanim",function(d){var g=Bu,x=this._proxy.style[g];Ga(this._proxy,this.project(d.center,d.zoom),this.getZoomScale(d.zoom,1)),x===this._proxy.style[g]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){ut(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var l=this.getCenter(),d=this.getZoom();Ga(this._proxy,this.project(l,d),this.getZoomScale(d,1))},_catchTransitionEnd:function(l){this._animatingZoom&&l.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(l,d,g){if(this._animatingZoom)return!0;if(g=g||{},!this._zoomAnimated||g.animate===!1||this._nothingToAnimate()||Math.abs(d-this._zoom)>this.options.zoomAnimationThreshold)return!1;var x=this.getZoomScale(d),C=this._getCenterOffset(l)._divideBy(1-1/x);return g.animate!==!0&&!this.getSize().contains(C)?!1:(G(function(){this._moveStart(!0,g.noMoveStart||!1)._animateZoom(l,d,!0)},this),!0)},_animateZoom:function(l,d,g,x){this._mapPane&&(g&&(this._animatingZoom=!0,this._animateToCenter=l,this._animateToZoom=d,We(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:l,zoom:d,noUpdate:x}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(s(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&Qt(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function NH(l,d){return new rt(l,d)}var Uo=V.extend({options:{position:"topright"},initialize:function(l){w(this,l)},getPosition:function(){return this.options.position},setPosition:function(l){var d=this._map;return d&&d.removeControl(this),this.options.position=l,d&&d.addControl(this),this},getContainer:function(){return this._container},addTo:function(l){this.remove(),this._map=l;var d=this._container=this.onAdd(l),g=this.getPosition(),x=l._controlCorners[g];return We(d,"leaflet-control"),g.indexOf("bottom")!==-1?x.insertBefore(d,x.firstChild):x.appendChild(d),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(ut(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(l){this._map&&l&&l.screenX>0&&l.screenY>0&&this._map.getContainer().focus()}}),Uu=function(l){return new Uo(l)};rt.include({addControl:function(l){return l.addTo(this),this},removeControl:function(l){return l.remove(),this},_initControlPos:function(){var l=this._controlCorners={},d="leaflet-",g=this._controlContainer=Fe("div",d+"control-container",this._container);function x(C,T){var A=d+C+" "+d+T;l[C+T]=Fe("div",A,g)}x("top","left"),x("top","right"),x("bottom","left"),x("bottom","right")},_clearControlPos:function(){for(var l in this._controlCorners)ut(this._controlCorners[l]);ut(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var CC=Uo.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(l,d,g,x){return g1,this._baseLayersList.style.display=l?"":"none"),this._separator.style.display=d&&l?"":"none",this},_onLayerChange:function(l){this._handlingClick||this._update();var d=this._getLayer(c(l.target)),g=d.overlay?l.type==="add"?"overlayadd":"overlayremove":l.type==="add"?"baselayerchange":null;g&&this._map.fire(g,d)},_createRadioElement:function(l,d){var g='",x=document.createElement("div");return x.innerHTML=g,x.firstChild},_addItem:function(l){var d=document.createElement("label"),g=this._map.hasLayer(l.layer),x;l.overlay?(x=document.createElement("input"),x.type="checkbox",x.className="leaflet-control-layers-selector",x.defaultChecked=g):x=this._createRadioElement("leaflet-base-layers_"+c(this),g),this._layerControlInputs.push(x),x.layerId=c(l.layer),Ae(x,"click",this._onInputClick,this);var C=document.createElement("span");C.innerHTML=" "+l.name;var T=document.createElement("span");d.appendChild(T),T.appendChild(x),T.appendChild(C);var A=l.overlay?this._overlaysList:this._baseLayersList;return A.appendChild(d),this._checkDisabledLayers(),d},_onInputClick:function(){if(!this._preventClick){var l=this._layerControlInputs,d,g,x=[],C=[];this._handlingClick=!0;for(var T=l.length-1;T>=0;T--)d=l[T],g=this._getLayer(d.layerId).layer,d.checked?x.push(g):d.checked||C.push(g);for(T=0;T=0;C--)d=l[C],g=this._getLayer(d.layerId).layer,d.disabled=g.options.minZoom!==void 0&&xg.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var l=this._section;this._preventClick=!0,Ae(l,"click",jn),this.expand();var d=this;setTimeout(function(){St(l,"click",jn),d._preventClick=!1})}}),TH=function(l,d,g){return new CC(l,d,g)},K1=Uo.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(l){var d="leaflet-control-zoom",g=Fe("div",d+" leaflet-bar"),x=this.options;return this._zoomInButton=this._createButton(x.zoomInText,x.zoomInTitle,d+"-in",g,this._zoomIn),this._zoomOutButton=this._createButton(x.zoomOutText,x.zoomOutTitle,d+"-out",g,this._zoomOut),this._updateDisabled(),l.on("zoomend zoomlevelschange",this._updateDisabled,this),g},onRemove:function(l){l.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(l){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(l.shiftKey?3:1))},_createButton:function(l,d,g,x,C){var T=Fe("a",g,x);return T.innerHTML=l,T.href="#",T.title=d,T.setAttribute("role","button"),T.setAttribute("aria-label",d),Wu(T),Ae(T,"click",qa),Ae(T,"click",C,this),Ae(T,"click",this._refocusOnMap,this),T},_updateDisabled:function(){var l=this._map,d="leaflet-disabled";Qt(this._zoomInButton,d),Qt(this._zoomOutButton,d),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||l._zoom===l.getMinZoom())&&(We(this._zoomOutButton,d),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||l._zoom===l.getMaxZoom())&&(We(this._zoomInButton,d),this._zoomInButton.setAttribute("aria-disabled","true"))}});rt.mergeOptions({zoomControl:!0}),rt.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new K1,this.addControl(this.zoomControl))});var IH=function(l){return new K1(l)},kC=Uo.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(l){var d="leaflet-control-scale",g=Fe("div",d),x=this.options;return this._addScales(x,d+"-line",g),l.on(x.updateWhenIdle?"moveend":"move",this._update,this),l.whenReady(this._update,this),g},onRemove:function(l){l.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(l,d,g){l.metric&&(this._mScale=Fe("div",d,g)),l.imperial&&(this._iScale=Fe("div",d,g))},_update:function(){var l=this._map,d=l.getSize().y/2,g=l.distance(l.containerPointToLatLng([0,d]),l.containerPointToLatLng([this.options.maxWidth,d]));this._updateScales(g)},_updateScales:function(l){this.options.metric&&l&&this._updateMetric(l),this.options.imperial&&l&&this._updateImperial(l)},_updateMetric:function(l){var d=this._getRoundNum(l),g=d<1e3?d+" m":d/1e3+" km";this._updateScale(this._mScale,g,d/l)},_updateImperial:function(l){var d=l*3.2808399,g,x,C;d>5280?(g=d/5280,x=this._getRoundNum(g),this._updateScale(this._iScale,x+" mi",x/g)):(C=this._getRoundNum(d),this._updateScale(this._iScale,C+" ft",C/d))},_updateScale:function(l,d,g){l.style.width=Math.round(this.options.maxWidth*g)+"px",l.innerHTML=d},_getRoundNum:function(l){var d=Math.pow(10,(Math.floor(l)+"").length-1),g=l/d;return g=g>=10?10:g>=5?5:g>=3?3:g>=2?2:1,d*g}}),jH=function(l){return new kC(l)},DH='',q1=Uo.extend({options:{position:"bottomright",prefix:''+(Oe.inlineSvg?DH+" ":"")+"Leaflet"},initialize:function(l){w(this,l),this._attributions={}},onAdd:function(l){l.attributionControl=this,this._container=Fe("div","leaflet-control-attribution"),Wu(this._container);for(var d in l._layers)l._layers[d].getAttribution&&this.addAttribution(l._layers[d].getAttribution());return this._update(),l.on("layeradd",this._addAttribution,this),this._container},onRemove:function(l){l.off("layeradd",this._addAttribution,this)},_addAttribution:function(l){l.layer.getAttribution&&(this.addAttribution(l.layer.getAttribution()),l.layer.once("remove",function(){this.removeAttribution(l.layer.getAttribution())},this))},setPrefix:function(l){return this.options.prefix=l,this._update(),this},addAttribution:function(l){return l?(this._attributions[l]||(this._attributions[l]=0),this._attributions[l]++,this._update(),this):this},removeAttribution:function(l){return l?(this._attributions[l]&&(this._attributions[l]--,this._update()),this):this},_update:function(){if(this._map){var l=[];for(var d in this._attributions)this._attributions[d]&&l.push(d);var g=[];this.options.prefix&&g.push(this.options.prefix),l.length&&g.push(l.join(", ")),this._container.innerHTML=g.join(' ')}}});rt.mergeOptions({attributionControl:!0}),rt.addInitHook(function(){this.options.attributionControl&&new q1().addTo(this)});var RH=function(l){return new q1(l)};Uo.Layers=CC,Uo.Zoom=K1,Uo.Scale=kC,Uo.Attribution=q1,Uu.layers=TH,Uu.zoom=IH,Uu.scale=jH,Uu.attribution=RH;var fi=V.extend({initialize:function(l){this._map=l},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});fi.addTo=function(l,d){return l.addHandler(d,this),this};var LH={Events:Z},EC=Oe.touch?"touchstart mousedown":"mousedown",Is=Y.extend({options:{clickTolerance:3},initialize:function(l,d,g,x){w(this,x),this._element=l,this._dragStartTarget=d||l,this._preventOutline=g},enable:function(){this._enabled||(Ae(this._dragStartTarget,EC,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Is._dragging===this&&this.finishDrag(!0),St(this._dragStartTarget,EC,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(l){if(this._enabled&&(this._moved=!1,!R1(this._element,"leaflet-zoom-anim"))){if(l.touches&&l.touches.length!==1){Is._dragging===this&&this.finishDrag();return}if(!(Is._dragging||l.shiftKey||l.which!==1&&l.button!==1&&!l.touches)&&(Is._dragging=this,this._preventOutline&&V1(this._element),A1(),Fu(),!this._moving)){this.fire("down");var d=l.touches?l.touches[0]:l,g=wC(this._element);this._startPoint=new j(d.clientX,d.clientY),this._startPos=Ya(this._element),this._parentScale=H1(g);var x=l.type==="mousedown";Ae(document,x?"mousemove":"touchmove",this._onMove,this),Ae(document,x?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(l){if(this._enabled){if(l.touches&&l.touches.length>1){this._moved=!0;return}var d=l.touches&&l.touches.length===1?l.touches[0]:l,g=new j(d.clientX,d.clientY)._subtract(this._startPoint);!g.x&&!g.y||Math.abs(g.x)+Math.abs(g.y)T&&(A=q,T=te);T>g&&(d[A]=1,Q1(l,d,g,x,A),Q1(l,d,g,A,C))}function FH(l,d){for(var g=[l[0]],x=1,C=0,T=l.length;xd&&(g.push(l[x]),C=x);return Cd.max.x&&(g|=2),l.yd.max.y&&(g|=8),g}function VH(l,d){var g=d.x-l.x,x=d.y-l.y;return g*g+x*x}function Zu(l,d,g,x){var C=d.x,T=d.y,A=g.x-C,q=g.y-T,te=A*A+q*q,oe;return te>0&&(oe=((l.x-C)*A+(l.y-T)*q)/te,oe>1?(C=g.x,T=g.y):oe>0&&(C+=A*oe,T+=q*oe)),A=l.x-C,q=l.y-T,x?A*A+q*q:new j(C,T)}function Eo(l){return!O(l[0])||typeof l[0][0]!="object"&&typeof l[0][0]<"u"}function DC(l){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Eo(l)}function RC(l,d){var g,x,C,T,A,q,te,oe;if(!l||l.length===0)throw new Error("latlngs not passed");Eo(l)||(console.warn("latlngs are not flat! Only the first ring will be used"),l=l[0]);var ve=ne([0,0]),Le=ie(l),Ke=Le.getNorthWest().distanceTo(Le.getSouthWest())*Le.getNorthEast().distanceTo(Le.getNorthWest());Ke<1700&&(ve=J1(l));var hr=l.length,Pn=[];for(g=0;gx){te=(T-x)/C,oe=[q.x-te*(q.x-A.x),q.y-te*(q.y-A.y)];break}var Ir=d.unproject(F(oe));return ne([Ir.lat+ve.lat,Ir.lng+ve.lng])}var HH={__proto__:null,simplify:NC,pointToSegmentDistance:TC,closestPointOnSegment:AH,clipSegment:jC,_getEdgeIntersection:ph,_getBitCode:Ja,_sqClosestPointOnSegment:Zu,isFlat:Eo,_flat:DC,polylineCenter:RC},X1={project:function(l){return new j(l.lng,l.lat)},unproject:function(l){return new J(l.y,l.x)},bounds:new K([-180,-90],[180,90])},e_={R:6378137,R_MINOR:6356752314245179e-9,bounds:new K([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(l){var d=Math.PI/180,g=this.R,x=l.lat*d,C=this.R_MINOR/g,T=Math.sqrt(1-C*C),A=T*Math.sin(x),q=Math.tan(Math.PI/4-x/2)/Math.pow((1-A)/(1+A),T/2);return x=-g*Math.log(Math.max(q,1e-10)),new j(l.lng*d*g,x)},unproject:function(l){for(var d=180/Math.PI,g=this.R,x=this.R_MINOR/g,C=Math.sqrt(1-x*x),T=Math.exp(-l.y/g),A=Math.PI/2-2*Math.atan(T),q=0,te=.1,oe;q<15&&Math.abs(te)>1e-7;q++)oe=C*Math.sin(A),oe=Math.pow((1-oe)/(1+oe),C/2),te=Math.PI/2-2*Math.atan(T*oe)-A,A+=te;return new J(A*d,l.x*d/g)}},WH={__proto__:null,LonLat:X1,Mercator:e_,SphericalMercator:we},UH=o({},_e,{code:"EPSG:3395",projection:e_,transformation:function(){var l=.5/(Math.PI*e_.R);return Te(l,.5,-l,.5)}()}),LC=o({},_e,{code:"EPSG:4326",projection:X1,transformation:Te(1/180,1,-1/180,.5)}),ZH=o({},le,{projection:X1,transformation:Te(1,0,-1,0),scale:function(l){return Math.pow(2,l)},zoom:function(l){return Math.log(l)/Math.LN2},distance:function(l,d){var g=d.lng-l.lng,x=d.lat-l.lat;return Math.sqrt(g*g+x*x)},infinite:!0});le.Earth=_e,le.EPSG3395=UH,le.EPSG3857=je,le.EPSG900913=st,le.EPSG4326=LC,le.Simple=ZH;var Zo=Y.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(l){return l.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(l){return l&&l.removeLayer(this),this},getPane:function(l){return this._map.getPane(l?this.options[l]||l:this.options.pane)},addInteractiveTarget:function(l){return this._map._targets[c(l)]=this,this},removeInteractiveTarget:function(l){return delete this._map._targets[c(l)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(l){var d=l.target;if(d.hasLayer(this)){if(this._map=d,this._zoomAnimated=d._zoomAnimated,this.getEvents){var g=this.getEvents();d.on(g,this),this.once("remove",function(){d.off(g,this)},this)}this.onAdd(d),this.fire("add"),d.fire("layeradd",{layer:this})}}});rt.include({addLayer:function(l){if(!l._layerAdd)throw new Error("The provided object is not a Layer.");var d=c(l);return this._layers[d]?this:(this._layers[d]=l,l._mapToAdd=this,l.beforeAdd&&l.beforeAdd(this),this.whenReady(l._layerAdd,l),this)},removeLayer:function(l){var d=c(l);return this._layers[d]?(this._loaded&&l.onRemove(this),delete this._layers[d],this._loaded&&(this.fire("layerremove",{layer:l}),l.fire("remove")),l._map=l._mapToAdd=null,this):this},hasLayer:function(l){return c(l)in this._layers},eachLayer:function(l,d){for(var g in this._layers)l.call(d,this._layers[g]);return this},_addLayers:function(l){l=l?O(l)?l:[l]:[];for(var d=0,g=l.length;dthis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()=2&&d[0]instanceof J&&d[0].equals(d[g-1])&&d.pop(),d},_setLatLngs:function(l){Ki.prototype._setLatLngs.call(this,l),Eo(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Eo(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var l=this._renderer._bounds,d=this.options.weight,g=new j(d,d);if(l=new K(l.min.subtract(g),l.max.add(g)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(l))){if(this.options.noClip){this._parts=this._rings;return}for(var x=0,C=this._rings.length,T;xl.y!=C.y>l.y&&l.x<(C.x-x.x)*(l.y-x.y)/(C.y-x.y)+x.x&&(d=!d);return d||Ki.prototype._containsPoint.call(this,l,!0)}});function eW(l,d){return new nc(l,d)}var qi=Yi.extend({initialize:function(l,d){w(this,d),this._layers={},l&&this.addData(l)},addData:function(l){var d=O(l)?l:l.features,g,x,C;if(d){for(g=0,x=d.length;g0&&C.push(C[0].slice()),C}function rc(l,d){return l.feature?o({},l.feature,{geometry:d}):wh(d)}function wh(l){return l.type==="Feature"||l.type==="FeatureCollection"?l:{type:"Feature",properties:{},geometry:l}}var o_={toGeoJSON:function(l){return rc(this,{type:"Point",coordinates:r_(this.getLatLng(),l)})}};mh.include(o_),t_.include(o_),gh.include(o_),Ki.include({toGeoJSON:function(l){var d=!Eo(this._latlngs),g=_h(this._latlngs,d?1:0,!1,l);return rc(this,{type:(d?"Multi":"")+"LineString",coordinates:g})}}),nc.include({toGeoJSON:function(l){var d=!Eo(this._latlngs),g=d&&!Eo(this._latlngs[0]),x=_h(this._latlngs,g?2:d?1:0,!0,l);return d||(x=[x]),rc(this,{type:(g?"Multi":"")+"Polygon",coordinates:x})}}),ec.include({toMultiPoint:function(l){var d=[];return this.eachLayer(function(g){d.push(g.toGeoJSON(l).geometry.coordinates)}),rc(this,{type:"MultiPoint",coordinates:d})},toGeoJSON:function(l){var d=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(d==="MultiPoint")return this.toMultiPoint(l);var g=d==="GeometryCollection",x=[];return this.eachLayer(function(C){if(C.toGeoJSON){var T=C.toGeoJSON(l);if(g)x.push(T.geometry);else{var A=wh(T);A.type==="FeatureCollection"?x.push.apply(x,A.features):x.push(A)}}}),g?rc(this,{geometries:x,type:"GeometryCollection"}):{type:"FeatureCollection",features:x}}});function BC(l,d){return new qi(l,d)}var tW=BC,bh=Zo.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(l,d,g){this._url=l,this._bounds=ie(d),w(this,g)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(We(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){ut(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(l){return this.options.opacity=l,this._image&&this._updateOpacity(),this},setStyle:function(l){return l.opacity&&this.setOpacity(l.opacity),this},bringToFront:function(){return this._map&&Co(this._image),this},bringToBack:function(){return this._map&&Tr(this._image),this},setUrl:function(l){return this._url=l,this._image&&(this._image.src=l),this},setBounds:function(l){return this._bounds=ie(l),this._map&&this._reset(),this},getEvents:function(){var l={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(l.zoomanim=this._animateZoom),l},setZIndex:function(l){return this.options.zIndex=l,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var l=this._url.tagName==="IMG",d=this._image=l?this._url:Fe("img");if(We(d,"leaflet-image-layer"),this._zoomAnimated&&We(d,"leaflet-zoom-animated"),this.options.className&&We(d,this.options.className),d.onselectstart=h,d.onmousemove=h,d.onload=s(this.fire,this,"load"),d.onerror=s(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(d.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),l){this._url=d.src;return}d.src=this._url,d.alt=this.options.alt},_animateZoom:function(l){var d=this._map.getZoomScale(l.zoom),g=this._map._latLngBoundsToNewLayerBounds(this._bounds,l.zoom,l.center).min;Ga(this._image,g,d)},_reset:function(){var l=this._image,d=new K(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),g=d.getSize();sn(l,d.min),l.style.width=g.x+"px",l.style.height=g.y+"px"},_updateOpacity:function(){ko(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var l=this.options.errorOverlayUrl;l&&this._url!==l&&(this._url=l,this._image.src=l)},getCenter:function(){return this._bounds.getCenter()}}),nW=function(l,d,g){return new bh(l,d,g)},FC=bh.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var l=this._url.tagName==="VIDEO",d=this._image=l?this._url:Fe("video");if(We(d,"leaflet-image-layer"),this._zoomAnimated&&We(d,"leaflet-zoom-animated"),this.options.className&&We(d,this.options.className),d.onselectstart=h,d.onmousemove=h,d.onloadeddata=s(this.fire,this,"load"),l){for(var g=d.getElementsByTagName("source"),x=[],C=0;C0?x:[d.src];return}O(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(d.style,"objectFit")&&(d.style.objectFit="fill"),d.autoplay=!!this.options.autoplay,d.loop=!!this.options.loop,d.muted=!!this.options.muted,d.playsInline=!!this.options.playsInline;for(var T=0;TC?(d.height=C+"px",We(l,T)):Qt(l,T),this._containerWidth=this._container.offsetWidth},_animateZoom:function(l){var d=this._map._latLngToNewLayerPoint(this._latlng,l.zoom,l.center),g=this._getAnchor();sn(this._container,d.add(g))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var l=this._map,d=parseInt(Sn(this._container,"marginBottom"),10)||0,g=this._container.offsetHeight+d,x=this._containerWidth,C=new j(this._containerLeft,-g-this._containerBottom);C._add(Ya(this._container));var T=l.layerPointToContainerPoint(C),A=F(this.options.autoPanPadding),q=F(this.options.autoPanPaddingTopLeft||A),te=F(this.options.autoPanPaddingBottomRight||A),oe=l.getSize(),ve=0,Le=0;T.x+x+te.x>oe.x&&(ve=T.x+x-oe.x+te.x),T.x-ve-q.x<0&&(ve=T.x-q.x),T.y+g+te.y>oe.y&&(Le=T.y+g-oe.y+te.y),T.y-Le-q.y<0&&(Le=T.y-q.y),(ve||Le)&&(this.options.keepInView&&(this._autopanning=!0),l.fire("autopanstart").panBy([ve,Le]))}},_getAnchor:function(){return F(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),iW=function(l,d){return new xh(l,d)};rt.mergeOptions({closePopupOnClick:!0}),rt.include({openPopup:function(l,d,g){return this._initOverlay(xh,l,d,g).openOn(this),this},closePopup:function(l){return l=arguments.length?l:this._popup,l&&l.close(),this}}),Zo.include({bindPopup:function(l,d){return this._popup=this._initOverlay(xh,this._popup,l,d),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(l){return this._popup&&(this instanceof Yi||(this._popup._source=this),this._popup._prepareOpen(l||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(l){return this._popup&&this._popup.setContent(l),this},getPopup:function(){return this._popup},_openPopup:function(l){if(!(!this._popup||!this._map)){qa(l);var d=l.layer||l.target;if(this._popup._source===d&&!(d instanceof js)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(l.latlng);return}this._popup._source=d,this.openPopup(l.latlng)}},_movePopup:function(l){this._popup.setLatLng(l.latlng)},_onKeyPress:function(l){l.originalEvent.keyCode===13&&this._openPopup(l)}});var Sh=hi.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(l){hi.prototype.onAdd.call(this,l),this.setOpacity(this.options.opacity),l.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(l){hi.prototype.onRemove.call(this,l),l.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var l=hi.prototype.getEvents.call(this);return this.options.permanent||(l.preclick=this.close),l},_initLayout:function(){var l="leaflet-tooltip",d=l+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=Fe("div",d),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+c(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(l){var d,g,x=this._map,C=this._container,T=x.latLngToContainerPoint(x.getCenter()),A=x.layerPointToContainerPoint(l),q=this.options.direction,te=C.offsetWidth,oe=C.offsetHeight,ve=F(this.options.offset),Le=this._getAnchor();q==="top"?(d=te/2,g=oe):q==="bottom"?(d=te/2,g=0):q==="center"?(d=te/2,g=oe/2):q==="right"?(d=0,g=oe/2):q==="left"?(d=te,g=oe/2):A.xthis.options.maxZoom||gx?this._retainParent(C,T,A,x):!1)},_retainChildren:function(l,d,g,x){for(var C=2*l;C<2*l+2;C++)for(var T=2*d;T<2*d+2;T++){var A=new j(C,T);A.z=g+1;var q=this._tileCoordsToKey(A),te=this._tiles[q];if(te&&te.active){te.retain=!0;continue}else te&&te.loaded&&(te.retain=!0);g+1this.options.maxZoom||this.options.minZoom!==void 0&&C1){this._setView(l,g);return}for(var Le=C.min.y;Le<=C.max.y;Le++)for(var Ke=C.min.x;Ke<=C.max.x;Ke++){var hr=new j(Ke,Le);if(hr.z=this._tileZoom,!!this._isValidTile(hr)){var Pn=this._tiles[this._tileCoordsToKey(hr)];Pn?Pn.current=!0:A.push(hr)}}if(A.sort(function(Ir,ic){return Ir.distanceTo(T)-ic.distanceTo(T)}),A.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var $o=document.createDocumentFragment();for(Ke=0;Keg.max.x)||!d.wrapLat&&(l.yg.max.y))return!1}if(!this.options.bounds)return!0;var x=this._tileCoordsToBounds(l);return ie(this.options.bounds).overlaps(x)},_keyToBounds:function(l){return this._tileCoordsToBounds(this._keyToTileCoords(l))},_tileCoordsToNwSe:function(l){var d=this._map,g=this.getTileSize(),x=l.scaleBy(g),C=x.add(g),T=d.unproject(x,l.z),A=d.unproject(C,l.z);return[T,A]},_tileCoordsToBounds:function(l){var d=this._tileCoordsToNwSe(l),g=new fe(d[0],d[1]);return this.options.noWrap||(g=this._map.wrapLatLngBounds(g)),g},_tileCoordsToKey:function(l){return l.x+":"+l.y+":"+l.z},_keyToTileCoords:function(l){var d=l.split(":"),g=new j(+d[0],+d[1]);return g.z=+d[2],g},_removeTile:function(l){var d=this._tiles[l];d&&(ut(d.el),delete this._tiles[l],this.fire("tileunload",{tile:d.el,coords:this._keyToTileCoords(l)}))},_initTile:function(l){We(l,"leaflet-tile");var d=this.getTileSize();l.style.width=d.x+"px",l.style.height=d.y+"px",l.onselectstart=h,l.onmousemove=h,Oe.ielt9&&this.options.opacity<1&&ko(l,this.options.opacity)},_addTile:function(l,d){var g=this._getTilePos(l),x=this._tileCoordsToKey(l),C=this.createTile(this._wrapCoords(l),s(this._tileReady,this,l));this._initTile(C),this.createTile.length<2&&G(s(this._tileReady,this,l,null,C)),sn(C,g),this._tiles[x]={el:C,coords:l,current:!0},d.appendChild(C),this.fire("tileloadstart",{tile:C,coords:l})},_tileReady:function(l,d,g){d&&this.fire("tileerror",{error:d,tile:g,coords:l});var x=this._tileCoordsToKey(l);g=this._tiles[x],g&&(g.loaded=+new Date,this._map._fadeAnimated?(ko(g.el,0),Q(this._fadeFrame),this._fadeFrame=G(this._updateOpacity,this)):(g.active=!0,this._pruneTiles()),d||(We(g.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:g.el,coords:l})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Oe.ielt9||!this._map._fadeAnimated?G(this._pruneTiles,this):setTimeout(s(this._pruneTiles,this),250)))},_getTilePos:function(l){return l.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(l){var d=new j(this._wrapX?f(l.x,this._wrapX):l.x,this._wrapY?f(l.y,this._wrapY):l.y);return d.z=l.z,d},_pxBoundsToTileRange:function(l){var d=this.getTileSize();return new K(l.min.unscaleBy(d).floor(),l.max.unscaleBy(d).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var l in this._tiles)if(!this._tiles[l].loaded)return!1;return!0}});function lW(l){return new Yu(l)}var oc=Yu.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(l,d){this._url=l,d=w(this,d),d.detectRetina&&Oe.retina&&d.maxZoom>0?(d.tileSize=Math.floor(d.tileSize/2),d.zoomReverse?(d.zoomOffset--,d.minZoom=Math.min(d.maxZoom,d.minZoom+1)):(d.zoomOffset++,d.maxZoom=Math.max(d.minZoom,d.maxZoom-1)),d.minZoom=Math.max(0,d.minZoom)):d.zoomReverse?d.minZoom=Math.min(d.maxZoom,d.minZoom):d.maxZoom=Math.max(d.minZoom,d.maxZoom),typeof d.subdomains=="string"&&(d.subdomains=d.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(l,d){return this._url===l&&d===void 0&&(d=!0),this._url=l,d||this.redraw(),this},createTile:function(l,d){var g=document.createElement("img");return Ae(g,"load",s(this._tileOnLoad,this,d,g)),Ae(g,"error",s(this._tileOnError,this,d,g)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(g.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(g.referrerPolicy=this.options.referrerPolicy),g.alt="",g.src=this.getTileUrl(l),g},getTileUrl:function(l){var d={r:Oe.retina?"@2x":"",s:this._getSubdomain(l),x:l.x,y:l.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var g=this._globalTileRange.max.y-l.y;this.options.tms&&(d.y=g),d["-y"]=g}return S(this._url,o(d,this.options))},_tileOnLoad:function(l,d){Oe.ielt9?setTimeout(s(l,this,null,d),0):l(null,d)},_tileOnError:function(l,d,g){var x=this.options.errorTileUrl;x&&d.getAttribute("src")!==x&&(d.src=x),l(g,d)},_onTileRemove:function(l){l.tile.onload=null},_getZoomForUrl:function(){var l=this._tileZoom,d=this.options.maxZoom,g=this.options.zoomReverse,x=this.options.zoomOffset;return g&&(l=d-l),l+x},_getSubdomain:function(l){var d=Math.abs(l.x+l.y)%this.options.subdomains.length;return this.options.subdomains[d]},_abortLoading:function(){var l,d;for(l in this._tiles)if(this._tiles[l].coords.z!==this._tileZoom&&(d=this._tiles[l].el,d.onload=h,d.onerror=h,!d.complete)){d.src=$;var g=this._tiles[l].coords;ut(d),delete this._tiles[l],this.fire("tileabort",{tile:d,coords:g})}},_removeTile:function(l){var d=this._tiles[l];if(d)return d.el.setAttribute("src",$),Yu.prototype._removeTile.call(this,l)},_tileReady:function(l,d,g){if(!(!this._map||g&&g.getAttribute("src")===$))return Yu.prototype._tileReady.call(this,l,d,g)}});function WC(l,d){return new oc(l,d)}var UC=oc.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(l,d){this._url=l;var g=o({},this.defaultWmsParams);for(var x in d)x in this.options||(g[x]=d[x]);d=w(this,d);var C=d.detectRetina&&Oe.retina?2:1,T=this.getTileSize();g.width=T.x*C,g.height=T.y*C,this.wmsParams=g},onAdd:function(l){this._crs=this.options.crs||l.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var d=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[d]=this._crs.code,oc.prototype.onAdd.call(this,l)},getTileUrl:function(l){var d=this._tileCoordsToNwSe(l),g=this._crs,x=ee(g.project(d[0]),g.project(d[1])),C=x.min,T=x.max,A=(this._wmsVersion>=1.3&&this._crs===LC?[C.y,C.x,T.y,T.x]:[C.x,C.y,T.x,T.y]).join(","),q=oc.prototype.getTileUrl.call(this,l);return q+P(this.wmsParams,q,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+A},setParams:function(l,d){return o(this.wmsParams,l),d||this.redraw(),this}});function cW(l,d){return new UC(l,d)}oc.WMS=UC,WC.wms=cW;var Ji=Zo.extend({options:{padding:.1},initialize:function(l){w(this,l),c(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),We(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var l={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(l.zoomanim=this._onAnimZoom),l},_onAnimZoom:function(l){this._updateTransform(l.center,l.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(l,d){var g=this._map.getZoomScale(d,this._zoom),x=this._map.getSize().multiplyBy(.5+this.options.padding),C=this._map.project(this._center,d),T=x.multiplyBy(-g).add(C).subtract(this._map._getNewPixelOrigin(l,d));Oe.any3d?Ga(this._container,T,g):sn(this._container,T)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var l in this._layers)this._layers[l]._reset()},_onZoomEnd:function(){for(var l in this._layers)this._layers[l]._project()},_updatePaths:function(){for(var l in this._layers)this._layers[l]._update()},_update:function(){var l=this.options.padding,d=this._map.getSize(),g=this._map.containerPointToLayerPoint(d.multiplyBy(-l)).round();this._bounds=new K(g,g.add(d.multiplyBy(1+l*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),ZC=Ji.extend({options:{tolerance:0},getEvents:function(){var l=Ji.prototype.getEvents.call(this);return l.viewprereset=this._onViewPreReset,l},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Ji.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var l=this._container=document.createElement("canvas");Ae(l,"mousemove",this._onMouseMove,this),Ae(l,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Ae(l,"mouseout",this._handleMouseOut,this),l._leaflet_disable_events=!0,this._ctx=l.getContext("2d")},_destroyContainer:function(){Q(this._redrawRequest),delete this._ctx,ut(this._container),St(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var l;this._redrawBounds=null;for(var d in this._layers)l=this._layers[d],l._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Ji.prototype._update.call(this);var l=this._bounds,d=this._container,g=l.getSize(),x=Oe.retina?2:1;sn(d,l.min),d.width=x*g.x,d.height=x*g.y,d.style.width=g.x+"px",d.style.height=g.y+"px",Oe.retina&&this._ctx.scale(2,2),this._ctx.translate(-l.min.x,-l.min.y),this.fire("update")}},_reset:function(){Ji.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(l){this._updateDashArray(l),this._layers[c(l)]=l;var d=l._order={layer:l,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=d),this._drawLast=d,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(l){this._requestRedraw(l)},_removePath:function(l){var d=l._order,g=d.next,x=d.prev;g?g.prev=x:this._drawLast=x,x?x.next=g:this._drawFirst=g,delete l._order,delete this._layers[c(l)],this._requestRedraw(l)},_updatePath:function(l){this._extendRedrawBounds(l),l._project(),l._update(),this._requestRedraw(l)},_updateStyle:function(l){this._updateDashArray(l),this._requestRedraw(l)},_updateDashArray:function(l){if(typeof l.options.dashArray=="string"){var d=l.options.dashArray.split(/[, ]+/),g=[],x,C;for(C=0;C')}}catch{}return function(l){return document.createElement("<"+l+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),uW={_initContainer:function(){this._container=Fe("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Ji.prototype._update.call(this),this.fire("update"))},_initPath:function(l){var d=l._container=Ku("shape");We(d,"leaflet-vml-shape "+(this.options.className||"")),d.coordsize="1 1",l._path=Ku("path"),d.appendChild(l._path),this._updateStyle(l),this._layers[c(l)]=l},_addPath:function(l){var d=l._container;this._container.appendChild(d),l.options.interactive&&l.addInteractiveTarget(d)},_removePath:function(l){var d=l._container;ut(d),l.removeInteractiveTarget(d),delete this._layers[c(l)]},_updateStyle:function(l){var d=l._stroke,g=l._fill,x=l.options,C=l._container;C.stroked=!!x.stroke,C.filled=!!x.fill,x.stroke?(d||(d=l._stroke=Ku("stroke")),C.appendChild(d),d.weight=x.weight+"px",d.color=x.color,d.opacity=x.opacity,x.dashArray?d.dashStyle=O(x.dashArray)?x.dashArray.join(" "):x.dashArray.replace(/( *, *)/g," "):d.dashStyle="",d.endcap=x.lineCap.replace("butt","flat"),d.joinstyle=x.lineJoin):d&&(C.removeChild(d),l._stroke=null),x.fill?(g||(g=l._fill=Ku("fill")),C.appendChild(g),g.color=x.fillColor||x.color,g.opacity=x.fillOpacity):g&&(C.removeChild(g),l._fill=null)},_updateCircle:function(l){var d=l._point.round(),g=Math.round(l._radius),x=Math.round(l._radiusY||g);this._setPath(l,l._empty()?"M0 0":"AL "+d.x+","+d.y+" "+g+","+x+" 0,"+65535*360)},_setPath:function(l,d){l._path.v=d},_bringToFront:function(l){Co(l._container)},_bringToBack:function(l){Tr(l._container)}},Ph=Oe.vml?Ku:bt,qu=Ji.extend({_initContainer:function(){this._container=Ph("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Ph("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ut(this._container),St(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Ji.prototype._update.call(this);var l=this._bounds,d=l.getSize(),g=this._container;(!this._svgSize||!this._svgSize.equals(d))&&(this._svgSize=d,g.setAttribute("width",d.x),g.setAttribute("height",d.y)),sn(g,l.min),g.setAttribute("viewBox",[l.min.x,l.min.y,d.x,d.y].join(" ")),this.fire("update")}},_initPath:function(l){var d=l._path=Ph("path");l.options.className&&We(d,l.options.className),l.options.interactive&&We(d,"leaflet-interactive"),this._updateStyle(l),this._layers[c(l)]=l},_addPath:function(l){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(l._path),l.addInteractiveTarget(l._path)},_removePath:function(l){ut(l._path),l.removeInteractiveTarget(l._path),delete this._layers[c(l)]},_updatePath:function(l){l._project(),l._update()},_updateStyle:function(l){var d=l._path,g=l.options;d&&(g.stroke?(d.setAttribute("stroke",g.color),d.setAttribute("stroke-opacity",g.opacity),d.setAttribute("stroke-width",g.weight),d.setAttribute("stroke-linecap",g.lineCap),d.setAttribute("stroke-linejoin",g.lineJoin),g.dashArray?d.setAttribute("stroke-dasharray",g.dashArray):d.removeAttribute("stroke-dasharray"),g.dashOffset?d.setAttribute("stroke-dashoffset",g.dashOffset):d.removeAttribute("stroke-dashoffset")):d.setAttribute("stroke","none"),g.fill?(d.setAttribute("fill",g.fillColor||g.color),d.setAttribute("fill-opacity",g.fillOpacity),d.setAttribute("fill-rule",g.fillRule||"evenodd")):d.setAttribute("fill","none"))},_updatePoly:function(l,d){this._setPath(l,wn(l._parts,d))},_updateCircle:function(l){var d=l._point,g=Math.max(Math.round(l._radius),1),x=Math.max(Math.round(l._radiusY),1)||g,C="a"+g+","+x+" 0 1,0 ",T=l._empty()?"M0 0":"M"+(d.x-g)+","+d.y+C+g*2+",0 "+C+-g*2+",0 ";this._setPath(l,T)},_setPath:function(l,d){l._path.setAttribute("d",d)},_bringToFront:function(l){Co(l._path)},_bringToBack:function(l){Tr(l._path)}});Oe.vml&&qu.include(uW);function YC(l){return Oe.svg||Oe.vml?new qu(l):null}rt.include({getRenderer:function(l){var d=l.options.renderer||this._getPaneRenderer(l.options.pane)||this.options.renderer||this._renderer;return d||(d=this._renderer=this._createRenderer()),this.hasLayer(d)||this.addLayer(d),d},_getPaneRenderer:function(l){if(l==="overlayPane"||l===void 0)return!1;var d=this._paneRenderers[l];return d===void 0&&(d=this._createRenderer({pane:l}),this._paneRenderers[l]=d),d},_createRenderer:function(l){return this.options.preferCanvas&&GC(l)||YC(l)}});var KC=nc.extend({initialize:function(l,d){nc.prototype.initialize.call(this,this._boundsToLatLngs(l),d)},setBounds:function(l){return this.setLatLngs(this._boundsToLatLngs(l))},_boundsToLatLngs:function(l){return l=ie(l),[l.getSouthWest(),l.getNorthWest(),l.getNorthEast(),l.getSouthEast()]}});function dW(l,d){return new KC(l,d)}qu.create=Ph,qu.pointsToPath=wn,qi.geometryToLayer=vh,qi.coordsToLatLng=n_,qi.coordsToLatLngs=yh,qi.latLngToCoords=r_,qi.latLngsToCoords=_h,qi.getFeature=rc,qi.asFeature=wh,rt.mergeOptions({boxZoom:!0});var qC=fi.extend({initialize:function(l){this._map=l,this._container=l._container,this._pane=l._panes.overlayPane,this._resetStateTimeout=0,l.on("unload",this._destroy,this)},addHooks:function(){Ae(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){St(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ut(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(l){if(!l.shiftKey||l.which!==1&&l.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),Fu(),A1(),this._startPoint=this._map.mouseEventToContainerPoint(l),Ae(document,{contextmenu:qa,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(l){this._moved||(this._moved=!0,this._box=Fe("div","leaflet-zoom-box",this._container),We(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(l);var d=new K(this._point,this._startPoint),g=d.getSize();sn(this._box,d.min),this._box.style.width=g.x+"px",this._box.style.height=g.y+"px"},_finish:function(){this._moved&&(ut(this._box),Qt(this._container,"leaflet-crosshair")),Vu(),B1(),St(document,{contextmenu:qa,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(l){if(!(l.which!==1&&l.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(s(this._resetState,this),0);var d=new fe(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(d).fire("boxzoomend",{boxZoomBounds:d})}},_onKeyDown:function(l){l.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});rt.addInitHook("addHandler","boxZoom",qC),rt.mergeOptions({doubleClickZoom:!0});var JC=fi.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(l){var d=this._map,g=d.getZoom(),x=d.options.zoomDelta,C=l.originalEvent.shiftKey?g-x:g+x;d.options.doubleClickZoom==="center"?d.setZoom(C):d.setZoomAround(l.containerPoint,C)}});rt.addInitHook("addHandler","doubleClickZoom",JC),rt.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var QC=fi.extend({addHooks:function(){if(!this._draggable){var l=this._map;this._draggable=new Is(l._mapPane,l._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),l.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),l.on("zoomend",this._onZoomEnd,this),l.whenReady(this._onZoomEnd,this))}We(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){Qt(this._map._container,"leaflet-grab"),Qt(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var l=this._map;if(l._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var d=ie(this._map.options.maxBounds);this._offsetLimit=ee(this._map.latLngToContainerPoint(d.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(d.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;l.fire("movestart").fire("dragstart"),l.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(l){if(this._map.options.inertia){var d=this._lastTime=+new Date,g=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(g),this._times.push(d),this._prunePositions(d)}this._map.fire("move",l).fire("drag",l)},_prunePositions:function(l){for(;this._positions.length>1&&l-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var l=this._map.getSize().divideBy(2),d=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=d.subtract(l).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(l,d){return l-(l-d)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var l=this._draggable._newPos.subtract(this._draggable._startPos),d=this._offsetLimit;l.xd.max.x&&(l.x=this._viscousLimit(l.x,d.max.x)),l.y>d.max.y&&(l.y=this._viscousLimit(l.y,d.max.y)),this._draggable._newPos=this._draggable._startPos.add(l)}},_onPreDragWrap:function(){var l=this._worldWidth,d=Math.round(l/2),g=this._initialWorldOffset,x=this._draggable._newPos.x,C=(x-d+g)%l+d-g,T=(x+d+g)%l-d-g,A=Math.abs(C+g)0?T:-T))-d;this._delta=0,this._startTime=null,A&&(l.options.scrollWheelZoom==="center"?l.setZoom(d+A):l.setZoomAround(this._lastMousePos,d+A))}});rt.addInitHook("addHandler","scrollWheelZoom",ek);var fW=600;rt.mergeOptions({tapHold:Oe.touchNative&&Oe.safari&&Oe.mobile,tapTolerance:15});var tk=fi.extend({addHooks:function(){Ae(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){St(this._map._container,"touchstart",this._onDown,this)},_onDown:function(l){if(clearTimeout(this._holdTimeout),l.touches.length===1){var d=l.touches[0];this._startPos=this._newPos=new j(d.clientX,d.clientY),this._holdTimeout=setTimeout(s(function(){this._cancel(),this._isTapValid()&&(Ae(document,"touchend",jn),Ae(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",d))},this),fW),Ae(document,"touchend touchcancel contextmenu",this._cancel,this),Ae(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function l(){St(document,"touchend",jn),St(document,"touchend touchcancel",l)},_cancel:function(){clearTimeout(this._holdTimeout),St(document,"touchend touchcancel contextmenu",this._cancel,this),St(document,"touchmove",this._onMove,this)},_onMove:function(l){var d=l.touches[0];this._newPos=new j(d.clientX,d.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(l,d){var g=new MouseEvent(l,{bubbles:!0,cancelable:!0,view:window,screenX:d.screenX,screenY:d.screenY,clientX:d.clientX,clientY:d.clientY});g._simulated=!0,d.target.dispatchEvent(g)}});rt.addInitHook("addHandler","tapHold",tk),rt.mergeOptions({touchZoom:Oe.touch,bounceAtZoomLimits:!0});var nk=fi.extend({addHooks:function(){We(this._map._container,"leaflet-touch-zoom"),Ae(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){Qt(this._map._container,"leaflet-touch-zoom"),St(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(l){var d=this._map;if(!(!l.touches||l.touches.length!==2||d._animatingZoom||this._zooming)){var g=d.mouseEventToContainerPoint(l.touches[0]),x=d.mouseEventToContainerPoint(l.touches[1]);this._centerPoint=d.getSize()._divideBy(2),this._startLatLng=d.containerPointToLatLng(this._centerPoint),d.options.touchZoom!=="center"&&(this._pinchStartLatLng=d.containerPointToLatLng(g.add(x)._divideBy(2))),this._startDist=g.distanceTo(x),this._startZoom=d.getZoom(),this._moved=!1,this._zooming=!0,d._stop(),Ae(document,"touchmove",this._onTouchMove,this),Ae(document,"touchend touchcancel",this._onTouchEnd,this),jn(l)}},_onTouchMove:function(l){if(!(!l.touches||l.touches.length!==2||!this._zooming)){var d=this._map,g=d.mouseEventToContainerPoint(l.touches[0]),x=d.mouseEventToContainerPoint(l.touches[1]),C=g.distanceTo(x)/this._startDist;if(this._zoom=d.getScaleZoom(C,this._startZoom),!d.options.bounceAtZoomLimits&&(this._zoomd.getMaxZoom()&&C>1)&&(this._zoom=d._limitZoom(this._zoom)),d.options.touchZoom==="center"){if(this._center=this._startLatLng,C===1)return}else{var T=g._add(x)._divideBy(2)._subtract(this._centerPoint);if(C===1&&T.x===0&&T.y===0)return;this._center=d.unproject(d.project(this._pinchStartLatLng,this._zoom).subtract(T),this._zoom)}this._moved||(d._moveStart(!0,!1),this._moved=!0),Q(this._animRequest);var A=s(d._move,d,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=G(A,this,!0),jn(l)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,Q(this._animRequest),St(document,"touchmove",this._onTouchMove,this),St(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});rt.addInitHook("addHandler","touchZoom",nk),rt.BoxZoom=qC,rt.DoubleClickZoom=JC,rt.Drag=QC,rt.Keyboard=XC,rt.ScrollWheelZoom=ek,rt.TapHold=tk,rt.TouchZoom=nk,n.Bounds=K,n.Browser=Oe,n.CRS=le,n.Canvas=ZC,n.Circle=t_,n.CircleMarker=gh,n.Class=V,n.Control=Uo,n.DivIcon=HC,n.DivOverlay=hi,n.DomEvent=MH,n.DomUtil=EH,n.Draggable=Is,n.Evented=Y,n.FeatureGroup=Yi,n.GeoJSON=qi,n.GridLayer=Yu,n.Handler=fi,n.Icon=tc,n.ImageOverlay=bh,n.LatLng=J,n.LatLngBounds=fe,n.Layer=Zo,n.LayerGroup=ec,n.LineUtil=HH,n.Map=rt,n.Marker=mh,n.Mixin=LH,n.Path=js,n.Point=j,n.PolyUtil=zH,n.Polygon=nc,n.Polyline=Ki,n.Popup=xh,n.PosAnimation=OC,n.Projection=WH,n.Rectangle=KC,n.Renderer=Ji,n.SVG=qu,n.SVGOverlay=VC,n.TileLayer=oc,n.Tooltip=Sh,n.Transformation=He,n.Util=X,n.VideoOverlay=FC,n.bind=s,n.bounds=ee,n.canvas=GC,n.circle=QH,n.circleMarker=JH,n.control=Uu,n.divIcon=aW,n.extend=o,n.featureGroup=YH,n.geoJSON=BC,n.geoJson=tW,n.gridLayer=lW,n.icon=KH,n.imageOverlay=nW,n.latLng=ne,n.latLngBounds=ie,n.layerGroup=GH,n.map=NH,n.marker=qH,n.point=F,n.polygon=eW,n.polyline=XH,n.popup=iW,n.rectangle=dW,n.setOptions=w,n.stamp=c,n.svg=YC,n.svgOverlay=oW,n.tileLayer=WC,n.tooltip=sW,n.transformation=Te,n.version=r,n.videoOverlay=rW;var hW=window.L;n.noConflict=function(){return window.L=hW,this},window.L=n})})(tS,tS.exports);var y1=tS.exports;const Pi=Ta(y1);function oV(e,t){const n=_.useRef(t);_.useEffect(function(){t!==n.current&&e.attributionControl!=null&&(n.current!=null&&e.attributionControl.removeAttribution(n.current),t!=null&&e.attributionControl.addAttribution(t)),n.current=t},[e,t])}const GMe=1;function YMe(e){return Object.freeze({__version:GMe,map:e})}function KMe(e,t){return Object.freeze({...e,...t})}const iV=_.createContext(null),sV=iV.Provider;function QO(){const e=_.useContext(iV);if(e==null)throw new Error("No context provided: useLeafletContext() can only be used in a descendant of ");return e}function qMe(e){function t(n,r){const{instance:o,context:i}=e(n).current;return _.useImperativeHandle(r,()=>o),n.children==null?null:k.createElement(sV,{value:i},n.children)}return _.forwardRef(t)}function JMe(e){function t(n,r){const[o,i]=_.useState(!1),{instance:s}=e(n,i).current;_.useImperativeHandle(r,()=>s),_.useEffect(function(){o&&s.update()},[s,o,n.children]);const a=s._contentNode;return a?Cs.createPortal(n.children,a):null}return _.forwardRef(t)}function aV(e,t){const n=_.useRef();_.useEffect(function(){return t!=null&&e.instance.on(t),n.current=t,function(){n.current!=null&&e.instance.off(n.current),n.current=null}},[e,t])}function lV(e,t){const n=e.pane??t.pane;return n?{...e,pane:n}:e}function QMe(e,t){return function(r,o){const i=QO(),s=e(lV(r,i),i);return oV(i.map,r.attribution),aV(s.current,r.eventHandlers),t(s.current,i,r,o),s}}function cV(e,t,n){return Object.freeze({instance:e,context:t,container:n})}function uV(e,t){return t==null?function(r,o){const i=_.useRef();return i.current||(i.current=e(r,o)),i}:function(r,o){const i=_.useRef();i.current||(i.current=e(r,o));const s=_.useRef(r),{instance:a}=i.current;return _.useEffect(function(){s.current!==r&&(t(a,r,s.current),s.current=r)},[a,r,o]),i}}function XMe(e,t){_.useEffect(function(){return(t.layerContainer??t.map).addLayer(e.instance),function(){t.layerContainer?.removeLayer(e.instance),t.map.removeLayer(e.instance)}},[t,e])}function eNe(e){return function(n){const r=QO(),o=e(lV(n,r),r);return oV(r.map,n.attribution),aV(o.current,n.eventHandlers),XMe(o.current,r),o}}function tNe(e,t){const n=uV(e,t),r=eNe(n);return qMe(r)}function nNe(e,t){const n=uV(e),r=QMe(n,t);return JMe(r)}function rNe(){return QO().map}function nS(){return nS=Object.assign||function(e){for(var t=1;tv?.map??null,[v]);const w=_.useCallback(b=>{if(b!==null&&v===null){const S=new y1.Map(b,f);n!=null&&u!=null?S.setView(n,u):e!=null&&S.fitBounds(e,t),c!=null&&S.whenReady(c),y(YMe(S))}},[]);_.useEffect(()=>()=>{v?.map.remove()},[v]);const P=v?k.createElement(sV,{value:v},r):s??null;return k.createElement("div",nS({},m,{ref:w}),P)}const iNe=_.forwardRef(oNe),dV=tNe(function({position:t,...n},r){const o=new y1.Marker(t,n);return cV(o,KMe(r,{overlayContainer:o}))},function(t,n,r){n.position!==r.position&&t.setLatLng(n.position),n.icon!=null&&n.icon!==r.icon&&t.setIcon(n.icon),n.zIndexOffset!=null&&n.zIndexOffset!==r.zIndexOffset&&t.setZIndexOffset(n.zIndexOffset),n.opacity!=null&&n.opacity!==r.opacity&&t.setOpacity(n.opacity),t.dragging!=null&&n.draggable!==r.draggable&&(n.draggable===!0?t.dragging.enable():t.dragging.disable())}),sNe=nNe(function(t,n){const r=new y1.Popup(t,n.overlayContainer);return cV(r,n)},function(t,n,{position:r},o){_.useEffect(function(){const{instance:s}=t;function a(u){u.popup===s&&(s.update(),o(!0))}function c(u){u.popup===s&&o(!1)}return n.map.on({popupopen:a,popupclose:c}),n.overlayContainer==null?(r!=null&&s.setLatLng(r),s.openOn(n.map)):n.overlayContainer.bindPopup(s),function(){n.map.off({popupopen:a,popupclose:c}),n.overlayContainer?.unbindPopup(),n.map.removeLayer(s)}},[t,n,o,r])}),aNe=e=>{const t=rNe(),n=Pi.tileLayer(`https://s.rsg.sc/sc/images/games/GTAV/map/${e.mapLayer}/{z}/{x}/{y}.jpg`,{maxZoom:7,minZoom:2,bounds:Pi.latLngBounds(Pi.latLng(0,128),Pi.latLng(-192,0))}),r=Pi.latLngBounds(Pi.latLng(0,128),Pi.latLng(-192,0));return t.setMaxBounds(r),t.attributionControl.setPrefix(!1),t.setView([0,0],2),t.addLayer(n),null};var zu={};/** * @license React * react-dom-server-legacy.browser.production.min.js * @@ -683,13 +683,13 @@ img.ProseMirror-separator { * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var fV=_;function Be(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n